A D-Bus based backlight control daemon for Linux.
You can call into blctl through the system-wide message bus.
Increase backlight brightness by 5%
$ busctl --system call me.xela.blctl /me/xela/blctl me.xela.blctl1 Increase u 5
Decrease backlight brightness by 25%
$ busctl --system call me.xela.blctl /me/xela/blctl me.xela.blctl1 Decrease u 25
No config file exists by default, but one with the name config.toml
can be created in /etc/blctl
(e.g.: touch "/etc/blctl/config.toml"
).
Config options:
interface_override
Allows for the automatically selected backlight interface to be overridden with a manually set path.
Example config
# /etc/blctl/config.toml
# Allows for the automatically selected backlight interface to be overridden with a manually set path.
# interface_override = "/sys/class/backlight/example_backlight/"
If you want to setup blctl to be connected to the backlight keys on your keyboard, you can do so by configuring your desktop environment or window manager to call blctl via its system-wide message bus.
Here is an example of how I accomplish this using Sway:
# ~/.config/Sway/config
bindsym XF86MonBrightnessUp exec busctl --system call me.xela.blctl /me/xela/blctl me.xela.blctl1 Increase u 5
bindsym XF86MonBrightnessDown exec busctl --system call me.xela.blctl /me/xela/blctl me.xela.blctl1 Decrease u 5
To compile and install blctl, simply run the install.sh
script in the root directory of the repository:
$ ./install.sh
This will automatically install blctl to /usr/bin/
.
If you use runit, you can pass --runit
as a parameter to the installer and it will automatically copy a default service configuration file for you:
$ ./install.sh --runit
If you use another init system, you will have to create your own service configuration to use with blctl. Feel free to contribute your config to ./service-configs/
if you do! :)
Note that blctl at minimum requires read and write access to the sysfs backlight device directory (/sys/class/backlight
) to function properly.
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.