WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: [SOLVED] Calling exittc from actkbd  (Read 2334 times)

Offline dentonlt

  • Sr. Member
  • ****
  • Posts: 318
    • the trombone analog
[SOLVED] Calling exittc from actkbd
« on: November 02, 2010, 12:02:57 AM »
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?

Code: [Select]
# ~/.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
« Last Edit: November 02, 2010, 12:10:42 AM by dentonlt »

Offline dentonlt

  • Sr. Member
  • ****
  • Posts: 318
    • the trombone analog
[SOLVED] Re: Calling exittc from actkbd
« Reply #1 on: November 02, 2010, 12:10:18 AM »
Hmm. Found answer via:
http://forum.tinycorelinux.net/index.php?topic=7665.msg40921#msg40921

su tc -c -l exittc

I'll go look up the -l switch - it's not shown by busybox help.  :-\

works!

Offline maro

  • Hero Member
  • *****
  • Posts: 1228
Re: [SOLVED] Calling exittc from actkbd
« Reply #2 on: November 02, 2010, 05:07:57 PM »
As you found that the '-l' option "it's not shown by busybox help" I've taken the liberty to raise this as a bug (#2761) against BusyBox.