~whynothugo/bright-rs

🖥️ A backlight control utility that does smooth transitions.
WIP: Scaffold for daemon mode
Rename project to `bright`

refs

main
browse  log 

clone

read-only
https://git.sr.ht/~whynothugo/bright-rs
read/write
git@git.sr.ht:~whynothugo/bright-rs

You can also use your local clone with git send-email.

#bright

Bright is a tool to control display backlight. It's had many shapes over the years to experiment on the subject. We humans have a logarithmic perception of light, so linear brightness control tools don't make sense. When the backlight is at 1%, a 1% makes a lot of difference, but increasing by %1 is very little when at 97%.

Using a logarithmic scale for changes makes more sense. This is what volume control application and consumer audio devices do too. This scale likely needs a bit more fine tuning.

Additionally, bright will adjust brightness with smooth transitions rather than abruptly, because sudden jumps in brightness are always terrible.

Recommended mappings are:

XF86MonBrightnessDown Decrease brightness XF86MonBrightnessUp Increase brightness Super+XF86MonBrightnessDown Minimum brightness (1%, not 0%. 0% is no light) Super+XF86MonBrightnessUp Maximum brightness (be careful!)

#Development

TODO: Logarithmic scale inc/dec polishing. TODO: Run as a daemon to avoid overlapping instances invoking chaos. TODO: Expose a unix socket to control this easily.

Please report any bugs in the issue tracker.

#Notes

Generated D-Bus proxy was done using:

dbus-codegen-rust \
  --client nonblock \
  --destination org.freedesktop.login1 \
  --interfaces org.freedesktop.login1.Session \
  --path /org/freedesktop/login1/session/auto \
  --system-bus \
  --output src/generated.rs

TODO: only use systemd as a fallback so we can stop relying on it exclusively.

#Licence

bright is licensed under the ISC licence. See LICENCE for more details.