Actkdb will let me call whatever when I hit my laptop power button. Unfortunately, I can't use actkbd to call exittc because exittc segfaults when run by root.
I'm using sudo actkbd because it needs access to the /dev/input/eventX devices. My actkbd.conf follows at bottom.
Any advice? In short, I've tried:
- su -c exittc tc
- setuid exittc
- base/norestore
- read lots of bits/pieces on permissions, sudo, sudoers, su, etc ...
I figure it will work if I can figure out how to run exittc from a root console. I'm out of ideas.
Suggestions?
# ~/.actkbd.conf
# for HP Mini 1001 TU
# dentonlt 11/2010
#
# The HP Mini has a few extra function keys:
#
# 142 Suspend (fn + F1)
# [ ] Switch screens (fn + F2) [ captured by BIOS? ]
# [ ] Brightness up/down (fn + f3/f4) [ captured by BIOS ]
# 38+125 Lock (fn + f6)
# 113 Mute (fn + f8)
# 114/115 Vol up/down (fn + f10/f11)
# 116 Front Power switch
# [ ] Front Wireless power switch [ captured by BIOS ]
# 99 Print Screen (fn + insert)
#
# There are others, but these are the ones I tested.
#
# You'll probably need 3 runs of actkbd, since there is input coming
# from three different device entries. To catch all the extra keys:
#
# actkbd -c ~/.actkbd.conf -d /dev/input/event1 -D
# actkbd -c ~/.actkbd.conf -d /dev/input/event3 -D
# actkbd -c ~/.actkbd.conf -d /dev/input/event5 -D
# Catch suspend key (fn + f1)
# this will be captured from /dev/input/event1 only
142:key:grab,noexec:
142:rep:noexec:
142:rel:ungrab: suspend.sh
# Catch Power key (front slider/switch)
# this will be captured from /dev/input/event3 only
116:key:grab,noexec:
116:rep:noexec:
116:rel:ungrab,exec: su tc; exittc
# Catch Volume Control Keys & Lock Key (fn + f6, f8, f10, f11)
# these will be captured from /dev/input/event5
38+125:key:noexec:
38+125:rep:noexec:
38+125:rel:exec: lock.sh
99:key:exec: make-imlib-screenshot.sh
99:rep:noexec:
99:rel:noexec:
113:key,rep:: volume.sh mute
114:key,rep:: volume.sh down
115:key,rep:: volume.sh up