Simple C program to control the keyboard backlight on the Lenovo Legion Y720 (should probably work on other laptops with the same keyboard)
It's literally this but written in C without a GUI for the minimalists and purists
- Unlimited profiles
- Easy-ish configuration
- No GUI (terminal ftw)
- Written in C
$ make all
...- Binary can be found in
build/release/kbd-backlight
$ sudo make all install postinstall
...- Binary path is
/usr/local/bin/kbd-backlight - Configuration path is
/etc/kbd-backlight/backlight.conf
NOTE: Any user that should be able to control the backlight should be added to the kbd-backlight group (gpasswd -a [USER] kbd-backlight)
We now have an AppArmor profile for the binary, to install it do this:
$ sudo make apparmor
...
$ sudo aa-enforce /etc/apparmor.d/kbd-backlight$ kbd-backlight
Usage: kbd-backlight [profile name] {config file}{config file}: Specify another location for the config file (Optional)
Each user, who is in the kbd-backlight group, can now have their own personal config file with their own custom profiles. This config file must be manually created by the user with this command:
$ cp /usr/share/kbd-backlight/backlight.conf.default ~/.config/kbd-backlight.confThe executable will automagically detect whether the user has their own config and load that instead of the system-wide one