Turn off keyboard backlight after a certain period of idleness
- linux
- systemd
- go 1.12 or above
In order to get a full setup clone the repo than then run make install.
$ git clone [email protected]:Shadowbeetle/skbl.git
$ make installThis installs the binary, creates a user systemd service, adds your user to the group input and creates the necessary config files.
To start using skbl with the default setup simply run:
$ sudo systemctl daemon-reload
$ sudo systemctl start skbl@$USER.serviceIf the keyboard backlight is not turned back on after hitting any key, read the Initial setup section.
Enable the service to start skbl on startup
$ sudo systemctl enable skbl@$USER.serviceYou can of course use skbl by simply running go get and set everythin up yourself by hand as well.
$ go get github.com/Shadowbeetle/skblskbl listens to events from /dev/input/mice and /dev/input/event4. Your keyboard might be a mapped to a different event, so you probably need to change that.
- you'll need to find the approprate iput file:
$ ls -lah /dev/input/by-path/- find the ones that might be keyboards (usually have kbd in them)
- test with
cat /dev/input/by-path/<kbd-input> - if you see gibberish appear in the terminal, you're good.
skbl can be configured by the following ways (consecutive modes override the previous ones):
/etc/skbl/config.tomlis the system wide default config$HOME/.skbl/config.tomlis the config of the given user- using flags
Installing skbl with make install creates the default config file in /etc/skbl, and the user config in $HOME/.skbl for the user running make. Additional users need to create their own config files.
$ mkdir $HOME/.skbl
$ cp /etc/skbl/config.toml $HOME/.skblThe config file currently has two fields:
wait-seconds = "10s" # idle time after which backlight should be turned off
inputs = ["/dev/input/mice", "/dev/input/event4"] # input files to listen tofor more information on inputs see Initial setup.
Individual sessions can be configured using flags as well eg.
$ skbl --wait 1s --input /dev/input/event1 --input /dev/input/mice
# or
$ skbl -w 1s -i /dev/input/event1 -i /dev/input/mice