[Linux] Playing With Thinkpad Special Buttons
I am using a T60 laptop, the one without a fingerprint reader. The 4 special buttons on the top left corner of the keyword are mute, volume up, volume down and ThinkVantage. The Window version came preinstalled with a program that displays a volume bar whenever any one of the volume controlling buttons is pressed. Unfortunately in a M$ dominated world, this program does not have a Linux version. There are applications that provide similar functionality, but I have decided to write a script myself.
Playing With Volume Buttons
ACPI (Advanced Configuration and Power Interface) is a wonderful standard, it makes programming devices easier. In Linux, information for some of the devices is made available in /proc/acpi/ibm/ folder. A simple cat /proc/acpi/ibm/volume tells you whether the speaker is muted, and the volume level (on a scale of 0 ~ 14).
I wrote the following script to display the volume level:
I used Python because I am not familar with Bash. I guess there may be 1-liner Bash commands that returns similar result. I am using CrunchBang distro, and it is preinstalled with Conky. I have added an entry to the Conky config file, and the volume information will be displayed on my desktop all the time.
Playing With ThinkVantage Button
After I am done with the volume buttons, I move on to ThinkVantage button. When I press the ThinkVantage button, I want to launch a Terminator terminal. With the help of xev, I discovered that the ThinkVantage button is binded to XF86Launch1. I added the following code to ~/.config/openbox/rc.xml config file.
