A simple implementation for automatic keyboard backlight in Linux for ThinkPad (and beyond)
After using an Apple MacBook Pro for four years, I collected quite a few elements from my computing workflow in macOS and carried over most of them to my Linux setup. However, one of those that I couldn't get over to this side of the wall was automatic keyboard backlight. The backlight could be turned ON and OFF, but would stay at the same state or brightness level regardless of whether I was interacting with the computer. After a few failed attempts at implementing a simple script to achieve it in Bash and on Node.js and then later on with Rust, I figured Lisp could be the one, and hence comes thinklucent.
thinklucent has been initially designed to be a script that watches for keyboard (and other input) events to keep the keyboard backlight ON for a reasonable time interval and then automatically turn if OFF until the next user interaction.
There are a few different ways to get thinklucent.
# Clone project to the local workspace
git clone https://github.com/myTerminal/thinklucent.git
# Switch to the project directory
cd thinklucent
# Install with `make`
make install
Simply execute the below command in a terminal; the rest should be automatic.
/bin/bash -c "$(curl https://raw.githubusercontent.com/myTerminal/thinklucent/main/install)"
thinklucent will soon be available to install from your operating system's package manager.
A simple way to use thinklucent is to run it in a command-line terminal with no command arguments.
sudo thinklucent
It does need to be run as root
so that it can work with keyboard backlight.
thinklucent can also be run as an init service, and currently only supports Runit. Support for more init systems will be implemented soon.
To learn more about usage, refer to manpage
:
man thinklucent
In order to update thinklucent, simply run:
thinklucent-update
In order to uninstall thinklucent, simply run:
thinklucent-uninstall
Being written with Common Lisp, thinklucent depends on SBCL. In most cases, it will be automatically installed while generating the binary, but if it doesn't please install it before running the installation.
The other required programs are as follows:
- Add support for more init systems like OpenRC, SysVinit, etc.
- Support for more hardware