Custom hot key programming with acpid

Key In

© Nikolai Sorokin, Fotolia

© Nikolai Sorokin, Fotolia

Article from Issue 109/2009
Author(s):

A little research from the command line and a short script bends your keyboard to your will.

Linux support for laptops has improved by leaps and bounds in the last decade. At this point, if you buy a laptop from any of the major manufacturers and load a Linux distro with a reasonably recent kernel version, things pretty much "just work" – problems with proprietary display drivers aside.

What can sometimes not work, however, are some of the vendor-specific hot keys on the keyboard. For example, I do a lot of presentations, and I'd like the hot key that's supposed to switch between my laptop display and an external monitor (Fn+F7 on my ThinkPad) to work under Linux. In this article, I describe my solution for this problem and offer some pointers for customizing hot key events.

Getting to Know acpid

Most Linux systems support ACPI (Advanced Configuration and Power Interface [1]), a popular standard for device configuration and power management. The ACPI standard specifies a structure for defining and customizing hardware events. In Linux, the acpid daemon [2] listens for ACPI events and maps each event to an action. Hot key events are typically handled by acpid.

[...]

Use Express-Checkout link below to read the full article (PDF).

Buy Linux Magazine

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

  • ASK KLAUS!

    Klaus Knopper is the creator of Knoppix and co-founder of the LinuxTag expo. He currently works as a teacher, programmer, and consultant. If you have a configuration problem, or if you just want to learn more about how Linux works, send your questions to: klaus@linux-magazine. com

  • ACPI Tools

    Linux offers some useful command-line tools that leverage the ACPI power management framework to display detailed data on the status of a laptop battery.

  • Ask Klaus!

    Klaus Knopper is the creator of Knoppix and co-founder of the LinuxTag expo. He currently works as a teacher, programmer, and consultant. If you have a configuration problem, or if you just want to learn more about how Linux works, send your questions to: klaus@linux-magazine.com

  • Multi-heading with RandR

    The RandR X server extension gives users more intuitive control over video projectors and multi-head installations.

  • Ask Klaus

    What’s new in Knoppix 7.4?

comments powered by Disqus
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters

Support Our Work

Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.

Learn More

News