Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Fn+<F5><F4> = XF86MonBrightness<UP><Down> doesn't work
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
rudregues
Apprentice
Apprentice


Joined: 29 Jan 2013
Posts: 227
Location: Brazil

PostPosted: Sat Feb 07, 2015 4:32 pm    Post subject: Fn+<F5><F4> = XF86MonBrightness<UP><Dow Reply with quote

Well, for some reason Fn+F5 or Fn+F5 doesn't work for brightness control. But I think I have them mapped:

Code:
$ xmodmap -pke

keycode 232 = XF86MonBrightnessDown NoSymbol XF86MonBrightnessDown
keycode 233 = XF86MonBrightnessUp NoSymbol XF86MonBrightnessUp


Code:
$ xev

KeyRelease event, serial 113, synthetic NO, window 0x1e00001,
    root 0x9b, subw 0x0, time 14528982, (-136,-43), root:(458,252),
    state 0x0, keycode 233 (keysym 0x1008ff02, XF86MonBrightnessUp), same_screen YES,
    XLookupString gives 0 bytes:
    XFilterEvent returns: False

KeyRelease event, serial 111, synthetic NO, window 0x1e00001,
    root 0x9b, subw 0x0, time 14528620, (-136,-43), root:(458,252),
    state 0x0, keycode 232 (keysym 0x1008ff03, XF86MonBrightnessDown), same_screen YES,
    XLookupString gives 0 bytes:
    XFilterEvent returns: False


I have XFCE with desktop profile set. The strange thing is that XFCE has a panel brightness plugin control that simply work! I've used locate command to find some info about brightness:

Code:
 $ locate brightness

/usr/lib64/xfce4/panel/plugins/libxfce4brightness.so
/usr/portage/x11-terms/terminator/files/terminator-0.97-brightness.patch
/usr/portage/xfce-extra/xfce4-power-manager/files/xfce4-power-manager-1.3.0-restore_brightness_level_after_sleep.patch
/usr/share/icons/hicolor/16x16/status/xfpm-brightness-lcd-missing.png
/usr/share/icons/hicolor/16x16/status/xfpm-brightness-lcd.png
/usr/share/icons/hicolor/22x22/status/xfpm-brightness-lcd-missing.png
/usr/share/icons/hicolor/22x22/status/xfpm-brightness-lcd.png
/usr/share/icons/hicolor/24x24/status/xfpm-brightness-lcd-missing.png
/usr/share/icons/hicolor/24x24/status/xfpm-brightness-lcd.png
/usr/share/icons/hicolor/32x32/status/xfpm-brightness-lcd-missing.png
/usr/share/icons/hicolor/32x32/status/xfpm-brightness-lcd.png
/usr/share/icons/hicolor/48x48/status/xfpm-brightness-lcd-missing.png
/usr/share/icons/hicolor/48x48/status/xfpm-brightness-lcd.png
/usr/share/icons/hicolor/scalable/status/xfpm-brightness-lcd-missing.svg
/usr/share/icons/hicolor/scalable/status/xfpm-brightness-lcd.svg
/usr/share/xfce4/panel-plugins/xfce4-brightness-plugin.desktop


From that output I'm shure /usr/lib64/xfce4/panel/plugins/libxfce4brightness.so is that plugin. But the question is: how it can control brightness? Found no docs about how this plugin works. My idea was to find the internal commands used and then put that commands as a shortcut with Fn+F4/5. I even tried to see the code of xfce4-power-manager, but I'm not a programmer and failed to find any common command that I'm used to.

Don't know if it helps, but I don't have laptop-mode-tools installed or the xbacklight installed.
_________________
Emerging en gentoo
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6228
Location: Room 101

PostPosted: Sat Feb 07, 2015 5:24 pm    Post subject: Reply with quote

rudregues ... perhaps the following will help:

Code:
# zgrep BACKLIGHT /proc/config.gz | egrep -v '(^#|^$)
CONFIG_BACKLIGHT_LCD_SUPPORT=y
CONFIG_BACKLIGHT_CLASS_DEVICE=y
CONFIG_BACKLIGHT_APPLE=y

Code:
# eix '-I*' --format '<installedversions:NAMEVERSION>' acpid
sys-power/acpid-2.0.20

/etc/acpi/default.sh
Code:
case "$group" in
[....]
   video)
      case "$action" in
         brightnessup)
            /etc/acpi/actions/backlight.sh up
            ;;
         brightnessdown)
            /etc/acpi/actions/backlight.sh down
            ;;
         *)
            log_unhandled $*
            ;;
      esac
      ;;
[....]
esac

/etc/acpi/actions/backlight.sh
Code:
#!/bin/sh

backlight_sys_dir="/sys/class/backlight/intel_backlight"

read -r max_brightness < "${backlight_sys_dir}/max_brightness"
read -r curr_brightness < "${backlight_sys_dir}/brightness"

case "$1" in
      up) increment="+ 10" ;;
    down) increment="- 10" ;;
       *) exit 1 ;;
esac

new_brightness=$(($curr_brightness $increment))

if $((new_brightness < 1)) || $((new_brightness > $max_brightness)); then
    exit 1
else
    echo "$new_brightness" > ${backlight_sys_dir}/brightness
fi

HTH & best ... khay
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum