1

I'm using xbacklight to increment and decrement by 10% and run the comment using my keyboard function keys (Arch Linux, i3-wm):

bindsym XF86MonBrightnessDown exec --no-startup-id xbacklight -dec 10

It works, but the inc/dec values are inconsistent. By this I mean, it doesn't stick to the 10% value I specified. It can jump from 100% to 87.78932% when using the bindsym shortcut (values chosen here are an example, it appears to be random and happens in both inc and dec commands). This is exacerbated if I press the keyboard shortcut quickly in repetition, or press and hold the shortcut. Manually running the xbacklight commands in terminal does not seem to replicate the issue. It doesn't happen every time. If I slowly tap the shortcut quickly I can get it to step in 10's.

My guess is that the bindsym command is firing too quickly to keep up with the inc/dec value specifed, resulting in these inconsistent values. I've attempted to use the --release command with bindsym, but it doesn't appear to work (unrelated issue I assume).

Any suggestions on what I could try? Or anyone know why I'm seeing what I'm seeing?

Thanks.

  • "If I slowly tap the shortcut quickly I can get it to step in 10's." -> This is due to a race condition. Multiple copies of xbacklight are reading and writing the backlight value simultaneously when you hold the shortcut down. – dsstorefile1 May 6 '18 at 1:31
  • 1
    Thanks for this. I found there was no easy way to solve my issue, so I moved to using 'Light' (aur.archlinux.org/packages/light) instead. Works as expected now. – ritchie888 May 7 '18 at 19:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.