You are not logged in.

#1 2016-11-03 17:09:15

axs
Member
Registered: 2009-01-23
Posts: 71
Website

xcubiclight - xbacklight with cubic scale

This is a small tool I wrote after trying for quite a time to script something usable out of xbacklight.

I run a simplistic openbox setup on an Intel laptop, backlight range 0..937, with xbacklight bindings on brightness control hotkeys. The problem with xbacklight is that it can only do fixed increments, like +5% or -10% of the whole range, and it does not work well for me. No matter which step I set, it's either too coarse on the lower end or it takes forever to get all the way to max brightness.

After some googling and experimenting, it looks like the cause is clear: xbacklight uses linear brightness scale but human perception of brightness is more like cubic root of that. Applying cubic scaling in the tool makes perceived steps in brightness much more even throughout the whole brightness range. So here it is:

https://github.com/arsv/xcubiclight
https://github.com/arsv/xcubiclight/rel … aur.tar.gz (Arch package tarball)

Plain C, xcb. Should be reasonably easy to modify if necessary.

Offline

#2 2016-11-16 20:05:34

domen
Member
Registered: 2010-02-22
Posts: 2

Re: xcubiclight - xbacklight with cubic scale

Thank you! Simple and working solution to an annoying problem.

This is in my ~/.i3/config now:

bindsym XF86MonBrightnessUp exec ~/bin/xcubiclight -i
bindsym XF86MonBrightnessDown exec ~/bin/xcubiclight -d -z

Offline

#3 2016-11-24 22:04:38

stabwound
Member
Registered: 2015-07-24
Posts: 48

Re: xcubiclight - xbacklight with cubic scale

Thank you! I agree, it works great with i3.

Offline

Board footer

Powered by FluxBB