Xfce Forum

Sub domains
 

You are not logged in.

#1 2013-05-31 20:47:11

wirawan0
Member
Registered: 2013-05-31
Posts: 5

xfce4 on-sreen LCD brightness control

I am using xfce 4.8.0.3 under Debian 7. I am using it with Thinkpad T400, which worked like a charm. One thing I notice, though, is that the on-screen brightness control has only 6 steps (0,20,40,60,80,100). I know for sure the laptop has finer granularity. Outside my X desktop, I counted there are at least 16 steps. The questions:

1) is there a way to tweak the brightness steps so I can cover all the possible brightness levels? I feel the 6 steps above are far from sufficient for my need.
2) which software controls this brightness steps in xfce? If somehow we can query the hardware and figure out how many levels of brightness there are, that would be even better.

Wirawan

Offline

#2 2013-05-31 22:23:15

Darktux
Member
From: Portugal
Registered: 2013-01-17
Posts: 57

Re: xfce4 on-sreen LCD brightness control

Hi wirawan0,
You might want to try the command

xbacklight

Please not that it may not be installed by default
See

xbacklight --help

for reference
Then you can assign it to a keybord shortcut
Example:

xbacklight +10

to increase brightness by 10%

Last edited by Darktux (2013-05-31 23:13:32)

Offline

#3 2013-06-04 06:59:33

MountainDewManiac
Member
From: USA police-state welfare-state
Registered: 2013-03-24
Posts: 312

Re: xfce4 on-sreen LCD brightness control

The xfce4-brightness-plugin 1.2.0 panel applet appears to have 11 total steps in its adjustment range, counting from full bright to full dark (which isn't). Far from a 0-100 setup, granted - but it is somewhat better than the six I get using my laptop's (Fn-key) adjustments. If that applet isn't installed by default, it might be in the Goodies package (as I added that to my system).

Seems like I was once using a computer with a different graphics setup and noticed that the "adjuster app" installed by the graphics package also included brightness controls (might have been only applicable to full-screen situations, such as when viewing a video, I cannot remember) in addition to the color/et cetera ones. It might be - if your computer has this option - that you can make a subtle adjustment to your graphics' brightness level that would make the coarser 1-6 - or 1-11 - brightness steps more usable? IDK.

Off-topic: Hmm. I just realized that, when right-clicking on a panel applet and selecting Move, I can also move it from one panel to another (not just on the same panel). Unfortunately, I also noticed that the brightness applet is full-sized when placed beside the audio volume applet, even though the volume one is nice and small (I was hoping to stack them vertically in one "space").

To Darktux: Thanks for the xbacklight tip.

Online

#4 2013-06-04 16:23:34

sixsixfive
Member
From: behind you
Registered: 2012-04-08
Posts: 20
Website

Re: xfce4 on-sreen LCD brightness control

Offline

#5 2013-06-04 20:33:28

wirawan0
Member
Registered: 2013-05-31
Posts: 5

Re: xfce4 on-sreen LCD brightness control

Hi all,

Thanks for the replies. I am aware of the xbacklight, but that is inconvenient to use in an instant (i.e. you must type). Laptop special keys are there for a purpose. The same can be said with the LCD brightness applet. Plus, I do not like adding memory load (I notice applets are rather expensive in terms of memory use). All these aside, here are my observations:

1) the LCD brightness applet in my laptop has a total 16 steps (including the endpoints), which is correct.
2) the LCD brightness applet, when open, does not automatically adjust the slider value when I use the laptop hotkeys to change the brightness. This is a bug (or a weakness).

3) I checked the source code of xfce4 power manager (XFPM): see filecommon/xfpm-brightness.c and its .h file. I found that the brightness limits are queried from the hardware via RandR interface (which is good). The setup procedure is like this: if the number of steps is greater than 20, then the step size is set to max/10 (subroutine xfpm_brightness_setup_xrandr). This may or may not be desirable, but it is hardwired in the stable version (4.8) used in Debian 7.

4) I ran the XFPM in debug mode, and I found something interesting: the brightness seems to be adjusted 3x every time a key is pressed. In a test, I set the initial LCD brightness was to the max, before running the XFPM. Then I invoked:

xfce4-power-manager --restart --sm-client-id 233ea9da3-cb5f-4599-8664-7f87cf4b9f27 --debug

then I press:
- brightness up    -> debug log shows 15
- brightness down  -> debug log shows 13 then 12
- brightness down  -> debug log shows 10 then 9
- brightness down  -> debug log shows 7 then 6
- brightness down  -> debug log shows 4 then 3
- brightness down  -> debug log shows 1 then 0
- brightness down  -> debug log shows 0 then 0

Level 15 represents my hardware's max brightness, and 0 minimum, consistent with my deduced number of steps from the hardware itself.

The fact that the brightness changed in such a way, either there is a bug in the XFPM software, or maybe the brightness keys were not fully seized by the XFPM, and this results in double or triple action when a key is pressed.

Here's a full log:

Xfce power manager is not running
TRACE[xfpm-main.c:203] xfpm_start(): Starting the power manager
TRACE[xfpm-xfconf.c:156] xfpm_xfconf_load(): Using default configuration for general-notification
TRACE[xfpm-xfconf.c:156] xfpm_xfconf_load(): Using default configuration for lock-screen-suspend-hibernate
TRACE[xfpm-xfconf.c:156] xfpm_xfconf_load(): Using default configuration for enable-cpu-freq-control
TRACE[xfpm-xfconf.c:156] xfpm_xfconf_load(): Using default configuration for critical-power-level
TRACE[xfpm-xfconf.c:156] xfpm_xfconf_load(): Using default configuration for show-brightness-popup
TRACE[xfpm-xfconf.c:156] xfpm_xfconf_load(): Using default configuration for change-brightness-on-key-events
TRACE[xfpm-xfconf.c:156] xfpm_xfconf_load(): Using default configuration for show-tray-icon
TRACE[xfpm-xfconf.c:156] xfpm_xfconf_load(): Using default configuration for lid-action-on-ac
TRACE[xfpm-xfconf.c:156] xfpm_xfconf_load(): Using default configuration for brightness-level-on-battery
TRACE[xfpm-xfconf.c:156] xfpm_xfconf_load(): Using default configuration for dpms-enabled
TRACE[xfpm-xfconf.c:156] xfpm_xfconf_load(): Using default configuration for dpms-on-battery-sleep
TRACE[xfpm-xfconf.c:156] xfpm_xfconf_load(): Using default configuration for dpms-on-battery-off
TRACE[xfpm-xfconf.c:156] xfpm_xfconf_load(): Using default configuration for inactivity-on-ac
TRACE[xfpm-xfconf.c:156] xfpm_xfconf_load(): Using default configuration for inactivity-sleep-mode
TRACE[xfpm-xfconf.c:156] xfpm_xfconf_load(): Using default configuration for spin-down-on-ac
TRACE[xfpm-xfconf.c:156] xfpm_xfconf_load(): Using default configuration for spin-down-on-ac-timeout
TRACE[xfpm-xfconf.c:156] xfpm_xfconf_load(): Using default configuration for spin-down-on-battery-timeout
TRACE[xfpm-power.c:1055] xfpm_power_get_power_devices(): Power device detected at : /org/freedesktop/UPower/devices/line_power_AC
TRACE[xfpm-power.c:1002] xfpm_power_add_device():  device added: ((XfpmDeviceType) XFPM_DEVICE_TYPE_LINE_POWER)
TRACE[xfpm-power.c:1055] xfpm_power_get_power_devices(): Power device detected at : /org/freedesktop/UPower/devices/battery_BAT0
TRACE[xfpm-power.c:1002] xfpm_power_add_device():  device added: ((XfpmDeviceType) XFPM_DEVICE_TYPE_BATTERY)
TRACE[xfpm-power.c:1013] xfpm_power_add_device(): Battery device detected at : /org/freedesktop/UPower/devices/battery_BAT0: ((XfpmDeviceType) XFPM_DEVICE_TYPE_BATTERY)
TRACE[xfpm-button.c:179] xfpm_button_xevent_key(): Grabbed key 124 : ((XfpmButtonKey) BUTTON_POWER_OFF)

(xfce4-power-manager:7340): xfce4-power-manager-WARNING **: could not map keysym 1008ffa8 to keycode

TRACE[xfpm-button.c:179] xfpm_button_xevent_key(): Grabbed key 213 : ((XfpmButtonKey) BUTTON_HIBERNATE)
TRACE[xfpm-button.c:179] xfpm_button_xevent_key(): Grabbed key 150 : ((XfpmButtonKey) BUTTON_SLEEP)
TRACE[xfpm-button.c:179] xfpm_button_xevent_key(): Grabbed key 233 : ((XfpmButtonKey) BUTTON_MON_BRIGHTNESS_UP)
TRACE[xfpm-button.c:179] xfpm_button_xevent_key(): Grabbed key 232 : ((XfpmButtonKey) BUTTON_MON_BRIGHTNESS_DOWN)
TRACE[xfpm-button.c:179] xfpm_button_xevent_key(): Grabbed key 244 : ((XfpmButtonKey) BUTTON_BATTERY)
TRACE[xfpm-battery.c:148] xfpm_battery_refresh_visible(): visible=TRUE: ((XfpmShowIcon) SHOW_ICON_WHEN_BATTERY_PRESENT)
TRACE[xfpm-battery.c:284] xfpm_battery_refresh_icon(): Battery state 1
TRACE[xfpm-power.c:1148] xfpm_power_refresh_adaptor_visible(): Tray icon configuration: : ((XfpmShowIcon) SHOW_ICON_WHEN_BATTERY_PRESENT)
TRACE[xfpm-power.c:1113] xfpm_power_hide_adapter_icon(): Hide adaptor icon
TRACE[xfpm-polkit.c:369] xfpm_polkit_init_data(): Using unix session polkit subject
TRACE[xfpm-polkit.c:456] xfpm_polkit_check_auth_intern(): Action=org.freedesktop.upower.suspend is authorized=TRUE
TRACE[xfpm-polkit.c:456] xfpm_polkit_check_auth_intern(): Action=org.freedesktop.upower.hibernate is authorized=TRUE
TRACE[xfpm-power.c:1148] xfpm_power_refresh_adaptor_visible(): Tray icon configuration: : ((XfpmShowIcon) SHOW_ICON_WHEN_BATTERY_PRESENT)
TRACE[xfpm-power.c:1113] xfpm_power_hide_adapter_icon(): Hide adaptor icon
TRACE[xfpm-polkit.c:456] xfpm_polkit_check_auth_intern(): Action=org.freedesktop.udisks.drive-set-spindown is authorized=TRUE
TRACE[xfpm-disks.c:170] xfpm_disks_get_is_auth_to_spin(): Is auth to spin down disks : 1
TRACE[xfpm-disks.c:147] xfpm_disks_set_spin_timeouts(): On Battery=0 spin_down_enabled=0 timeout=800

TRACE[xfpm-backlight.c:324] xfpm_backlight_brightness_on_ac_settings_changed(): Alarm on ac timeout changed 70
TRACE[xfpm-backlight.c:345] xfpm_backlight_brightness_on_battery_settings_changed(): Alarm on battery timeout changed 45
TRACE[xfpm-button.c:114] xfpm_button_filter_x_events(): Key press: ((XfpmButtonKey) BUTTON_MON_BRIGHTNESS_UP)
TRACE[xfpm-backlight.c:219] xfpm_backlight_show(): Level 15
TRACE[xfpm-manager.c:259] xfpm_manager_button_pressed_cb(): Received button press event: ((XfpmButtonKey) BUTTON_MON_BRIGHTNESS_UP)
TRACE[xfpm-button.c:114] xfpm_button_filter_x_events(): Key press: ((XfpmButtonKey) BUTTON_MON_BRIGHTNESS_UP)
TRACE[xfpm-backlight.c:219] xfpm_backlight_show(): Level 15
TRACE[xfpm-manager.c:259] xfpm_manager_button_pressed_cb(): Received button press event: ((XfpmButtonKey) BUTTON_MON_BRIGHTNESS_UP)
TRACE[xfpm-button.c:114] xfpm_button_filter_x_events(): Key press: ((XfpmButtonKey) BUTTON_MON_BRIGHTNESS_DOWN)
TRACE[xfpm-backlight.c:219] xfpm_backlight_show(): Level 13
TRACE[xfpm-manager.c:259] xfpm_manager_button_pressed_cb(): Received button press event: ((XfpmButtonKey) BUTTON_MON_BRIGHTNESS_DOWN)
TRACE[xfpm-button.c:114] xfpm_button_filter_x_events(): Key press: ((XfpmButtonKey) BUTTON_MON_BRIGHTNESS_DOWN)
TRACE[xfpm-backlight.c:219] xfpm_backlight_show(): Level 12
TRACE[xfpm-manager.c:259] xfpm_manager_button_pressed_cb(): Received button press event: ((XfpmButtonKey) BUTTON_MON_BRIGHTNESS_DOWN)
TRACE[xfpm-button.c:114] xfpm_button_filter_x_events(): Key press: ((XfpmButtonKey) BUTTON_MON_BRIGHTNESS_DOWN)
TRACE[xfpm-backlight.c:219] xfpm_backlight_show(): Level 10
TRACE[xfpm-manager.c:259] xfpm_manager_button_pressed_cb(): Received button press event: ((XfpmButtonKey) BUTTON_MON_BRIGHTNESS_DOWN)
TRACE[xfpm-button.c:114] xfpm_button_filter_x_events(): Key press: ((XfpmButtonKey) BUTTON_MON_BRIGHTNESS_DOWN)
TRACE[xfpm-backlight.c:219] xfpm_backlight_show(): Level 9
TRACE[xfpm-manager.c:259] xfpm_manager_button_pressed_cb(): Received button press event: ((XfpmButtonKey) BUTTON_MON_BRIGHTNESS_DOWN)
TRACE[xfpm-button.c:114] xfpm_button_filter_x_events(): Key press: ((XfpmButtonKey) BUTTON_MON_BRIGHTNESS_DOWN)
TRACE[xfpm-backlight.c:219] xfpm_backlight_show(): Level 7
TRACE[xfpm-manager.c:259] xfpm_manager_button_pressed_cb(): Received button press event: ((XfpmButtonKey) BUTTON_MON_BRIGHTNESS_DOWN)
TRACE[xfpm-button.c:114] xfpm_button_filter_x_events(): Key press: ((XfpmButtonKey) BUTTON_MON_BRIGHTNESS_DOWN)
TRACE[xfpm-backlight.c:219] xfpm_backlight_show(): Level 6
TRACE[xfpm-manager.c:259] xfpm_manager_button_pressed_cb(): Received button press event: ((XfpmButtonKey) BUTTON_MON_BRIGHTNESS_DOWN)
TRACE[xfpm-button.c:114] xfpm_button_filter_x_events(): Key press: ((XfpmButtonKey) BUTTON_MON_BRIGHTNESS_DOWN)
TRACE[xfpm-backlight.c:219] xfpm_backlight_show(): Level 4
TRACE[xfpm-manager.c:259] xfpm_manager_button_pressed_cb(): Received button press event: ((XfpmButtonKey) BUTTON_MON_BRIGHTNESS_DOWN)
TRACE[xfpm-button.c:114] xfpm_button_filter_x_events(): Key press: ((XfpmButtonKey) BUTTON_MON_BRIGHTNESS_DOWN)
TRACE[xfpm-backlight.c:219] xfpm_backlight_show(): Level 3
TRACE[xfpm-manager.c:259] xfpm_manager_button_pressed_cb(): Received button press event: ((XfpmButtonKey) BUTTON_MON_BRIGHTNESS_DOWN)
TRACE[xfpm-button.c:114] xfpm_button_filter_x_events(): Key press: ((XfpmButtonKey) BUTTON_MON_BRIGHTNESS_DOWN)
TRACE[xfpm-backlight.c:219] xfpm_backlight_show(): Level 1
TRACE[xfpm-manager.c:259] xfpm_manager_button_pressed_cb(): Received button press event: ((XfpmButtonKey) BUTTON_MON_BRIGHTNESS_DOWN)
TRACE[xfpm-button.c:114] xfpm_button_filter_x_events(): Key press: ((XfpmButtonKey) BUTTON_MON_BRIGHTNESS_DOWN)
TRACE[xfpm-backlight.c:219] xfpm_backlight_show(): Level 0
TRACE[xfpm-manager.c:259] xfpm_manager_button_pressed_cb(): Received button press event: ((XfpmButtonKey) BUTTON_MON_BRIGHTNESS_DOWN)
TRACE[xfpm-button.c:114] xfpm_button_filter_x_events(): Key press: ((XfpmButtonKey) BUTTON_MON_BRIGHTNESS_DOWN)
TRACE[xfpm-backlight.c:219] xfpm_backlight_show(): Level 0
TRACE[xfpm-manager.c:259] xfpm_manager_button_pressed_cb(): Received button press event: ((XfpmButtonKey) BUTTON_MON_BRIGHTNESS_DOWN)
TRACE[xfpm-button.c:114] xfpm_button_filter_x_events(): Key press: ((XfpmButtonKey) BUTTON_MON_BRIGHTNESS_DOWN)
TRACE[xfpm-backlight.c:219] xfpm_backlight_show(): Level 0
TRACE[xfpm-manager.c:259] xfpm_manager_button_pressed_cb(): Received button press event: ((XfpmButtonKey) BUTTON_MON_BRIGHTNESS_DOWN)
^CTRACE[xfpm-main.c:67] xfpm_quit_signal(): sig 2
TRACE[xfpm-manager.c:576] xfpm_manager_stop(): Stopping
TRACE[xfpm-manager.c:164] xfpm_manager_quit(): Exiting
TRACE[xfpm-power.c:1113] xfpm_power_hide_adapter_icon(): Hide adaptor icon
TRACE[xfpm-polkit.c:239] xfpm_polkit_free_data(): Destroying Polkit data

Offline

#6 2013-06-05 11:36:12

Darktux
Member
From: Portugal
Registered: 2013-01-17
Posts: 57

Re: xfce4 on-sreen LCD brightness control

You can assign keyboard shortcuts to xbacklight
For example, one shortcut assigned to xbacklight +5 and other to xbacklight -5
Not sure if it would work, but you can try to assign it to the laptop brightness hotkeys.

Offline

Board footer

Powered by FluxBB