Why not use xbindkeys
? In my laptop I glue some scripts to various buttons with this .xbindkeysrc
file in my home directory:
"$HOME/bin/do_suspend.sh" m:0x0 + c:150 XF86Sleep
"$HOME/bin/do_toggle_touchpad.sh" m:0x0 + c:199 XF86TouchpadToggle
"$HOME/bin/do_autoselect_monitor.sh" m:0x0 + c:235 XF86Display
"wicd-cli --wireless --disconnect && sudo rfkill block 1" m:0x0 + c:246 XF86WLAN