- C 98.1%
- Makefile 1.9%
I noticed a bug once where the backlight shut off early again, similar to what would happen before the EV_SYN SYN_DROPPED support was working properly. This, however, was not the cause of the bug. However, it is possible that if only one event was returned in a read, that the loop would read memory below the beginning of the array. This would result in effectively no input being processed, possibly causing the backlight to turn off early. |
||
|---|---|---|
| debian | ||
| .gitignore | ||
| gpl-2.0.txt | ||
| gpl-3.0.txt | ||
| keylightc.c | ||
| keylightc.service | ||
| Makefile | ||
| README.md | ||
keylightc
Keyboard backlight daemon for Framework laptops in C
keylightc is a small system daemon for Framework laptops that listens to keyboard and touchpad input, and turns on the keyboard backlight while either is being used.
It is like keylightd except in C and with no dependencies!
Package Installation
It is highly recommended to install a package if one is available. Currently, a PPA is available for Ubuntu. To set it up, run:
$ sudo add-apt-repository ppa:mamarley/keylightc-git
$ sudo apt update
$ sudo apt install keylightc
Source Installation
To install from source, clone the repository and run:
$ make
$ sudo make install
$ sudo systemctl enable --now keylightc.service
keylightc has no dependencies you have to install first. Really.
It works using the sysfs keyboard backlight interface introduced in Linux 6.11 and therefore requires at least that version.
It uses kernel event data directly and does not have any dependency on a desktop environment or display server.
Running
Note that keylightc must either be run as root or using the included systemd unit.
Using the .deb package or executing the source installation commands above sets this up for you.
keylightc takes the following command-line arguments:
Usage: keylightc [--brightness <brightness>] [--fadeduration <fadeduration>] [--timeout <timeout>]
keylightc - automatic keyboard backlight daemon for Framework laptops
Options:
--brightness brightness level when active (1-100) [default=30]
--fadeduration fade time in microseconds (1-1000000) [default=100000]
--timeout activity timeout in seconds (1-2147483647) [default=10]
--help display usage information