# Blinking keyboard backlight under Linux

Well, I own a Thinkpad T440p, so unfortunately I don't have a Thinklight. I recently put a backlit keyboard into the machine, then I realised that I don't really need the keyboard backlight. I thought the best way to put it into good use is to get it to blink when certain things happen.

My operating system is Debian - the Universal Operating System. I am running Debian Stretch.

## Under Pidgin

By following this guide, you can get your keyboard backlight to blink when you get new message:

1. apt-get source pidgin-blinklight
2. In pidgin-blinklight-0.11.1/src/blink.c, change /proc/acpi/ibm/light to /proc/acpi/ibm/kbdlight, and change off to 0, on to 2.
3. In pidgin-blinklight-0.11.1/src/blinklight-fixperm.c, change /proc/acpi/ibm/light to /proc/acpi/ibm/kbdlight.
4. Go to pidgin-blinklight-0.11.1, recompile the package by running debuild -b -uc -us.
5. Go to the parent directory of pidgin-blinklight-0.11.1, install the resulting package, it should have the name pidgin-blinklight_0.11.1-3_amd64.deb
6. Enable pidgin-blinklight plugin in Pidgin.

I am pretty sure someone can write a patch and submit to the package maintainer, I am sure I am probably able to do that, but then I have some homework to do. So I am just going to leave it like that for now.

## When the terminal bell is triggered

1. First of all, you need to follow the previous section, change light to kbdlight if you want to use the keyboard backlight rather than the Thinklight.
2. After compilation, copy pidgin-blinklight-0.11.1/src/demoblink to /usr/local/bin.
3. Add chmod o+w /proc/acpi/ibm/kbdlight to your /etc/rc.local.
4. Configure your terminal emulator to run /usr/local/bin/demoblink when the terminal alarm bell is sounded. In Konsole, this is under Settings→Configure Notifications…→Bell in Visible Session
5. Open your terminal emulator, and smash the tab key to make your keyboard blink. Now your keyboard would blink at you, as the terminal screams at you.

You can also trigger the running of /usr/local/bin/demoblink in notification events in your desktop environment. In KDE, it is under Notifications System Settings Module, which you can launch by typing in “Notification” in your Application Launcher. It is useful to change the notification settings for “Plasma Workspace”.