Difference between revisions of "ACPI hotkeys"

From ArchWiki
Jump to: navigation, search
(Merge to main page.)
(27 intermediate revisions by 14 users not shown)
Line 1: Line 1:
===ACPI Hotkeys===
#REDIRECT [[acpid]]
There are many guides on how to configure multimedia hotkeys using program such as xev or keyTouch.  However, this guide explains how to use the simple utility of acpi_listen and generate your own script for hotkeys.
====Who Should be Using This Guide====
If you have already used the wiki entry for [[Extra Keyboard Keys|using keyTouch]] or [[Hotkeys|just about hotkeys]] then you should look here.
====Installing Necessary Tools====
1)  acpi
2)  acpid
3)  acpitool
sudo pacman -S acpi acpid acpitool
====Checking that acpi_listen responds====
In the terminal, under root run:
Try pressing one of your multimedia keys, such as previous or next and you should get a response that looks similar to:
hkey VALZ 00000000 00000b31
If so, then good, we can now create a script.
====A Sample Script====
As keyTouch and other keyboard programs did not work for me, I created my own script which reacts directly to output from acpi_listen.  Here is the script, feel free to use it / modify it to suit your needs.
i=`acpi_listen -c 1`
case "$i" in
"hkey VALZ 00000000 00000b31")
#echo "PREVIOUS"
exaile -p
"hkey VALZ 00000000 00000b32")
#echo "NEXT"
exaile -n
"hkey VALZ 00000000 00000b33")
exaile -t
"hkey VALZ 00000000 00000b30")
#echo "STOP"
exaile -s
#echo "ELSE: $i"
if [ "$e" != "1" ]
./myHotkey.sh &
Note:  This does not need to be run as root, if you can receive an acpi_listen response from a user accounty.

Latest revision as of 02:09, 16 April 2013

Redirect to: