Skip to content

Simple C program to control the keyboard backlight on the Lenovo Legion Y720

License

Notifications You must be signed in to change notification settings

threadexio/Legion-Y720-Keyboard-Backlight

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Legion-Y720-Keyboard-Backlight


GitHub Travis (.com) Last commit Commits since latest Downloads


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

Features


  • Unlimited profiles
  • Easy-ish configuration
  • No GUI (terminal ftw)
  • Written in C

➡ 🏗️ Build


$ make all
...
  • Binary can be found in build/release/kbd-backlight

➡ ✨ Install


$ 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

Usage


$ 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.conf

The executable will automagically detect whether the user has their own config and load that instead of the system-wide one