BeBits Information Developer Central Submit Application Your Account Web Links Contact Us
BeBits
Please support our sponsors!
Multimedia Keyboard Profile
Talkback
 Go back to the Multimedia Keyboard Profile page
 Post a new Talkback comment!
kbdshutdown
 By mmu_man - Posted on June 14, 2002 - 15:24:47   (#1824)
 Current version when comment was posted: 1.0
Hmm, seems there is a deadlock in my script...
the alert doesn't get killed and shutdown doesn't want to kill it :^)
To be fixed someday...

oooh, I like it!
 By Ruprect - Posted on June 14, 2002 - 01:09:16   (#1819)
 Current version when comment was posted: 1.0
Hey, I like your shutdown script, mmu_man! I'm going to try that.

Good luck with your keyboard. Aren't these mm keyboards great?!

safer shutdown
 By mmu_man - Posted on June 13, 2002 - 14:55:52   (#1814)
 Current version when comment was posted: 1.0
If you are quite quick at typing and sometime misstype Power instead of Pause (why did they put this key here ?), this might be useful for you.
This script waits 5 seconds before really shuting down, and can be told to cancel either by command line or cancelling the dialog. It's quite raw for now, but it does the job.
I mapped it like it:
Power: /boot/home/config/bin/kbdshutdown -h (halt)
Sleep: /boot/home/config/bin/kbdshutdown -r (reboot)
WakeUp: /boot/home/config/bin/kbdshutdown -c (cancel)

---------------------------
#!/bin/sh

# kbdshutdown -- handle keyboard shutdown requests
# (c) 2002, mmu_man - revol@free.fr
# BSD licence, use it at your own risk

# touch this file to cancel a running shutdown
CANCEL_FLAG=/tmp/kbdshutdown_cancel_flag
# delay before real shutdown
PRE_DELAY=5
# delay before cleaning up the flag
POST_DELAY=5

function cancel_shutdown () {
touch $CANCEL_FLAG
echo "canceling..."
}

function do_shutdown () {
if [ "x$1" != "x-r" ]; then
DISP="shutdown"
else
DISP="reboot"
fi
(if alert --stop "Will $DISP in $PRE_DELAY seconds..." "Cancel" ; then cancel_shutdown; fi)&
APID=$!
sleep $PRE_DELAY
if [ -f $CANCEL_FLAG ]; then
# make sure we let other instance to cancel too
sleep $POST_DELAY
rm -f $CANCEL_FLAG
kill $APID
alert --info "shutdown cancelled"
else
# for test
#alert --stop STOP
kill $APID
rm -f $CANCEL_FLAG
/bin/shutdown $1
fi
}



if [ -z "$1" ]; then
echo "usage: $0 [-h|-r|-c]"
exit 1
else
case "$1" in
-c) # cancen any running shutdown
cancel_shutdown
;;
-h)
do_shutdown
;;
-r)
do_shutdown -r
;;
esac
fi


Yeahhhhhhh !!
 By mmu_man - Posted on June 13, 2002 - 14:07:44   (#1812)
 Current version when comment was posted: 1.0
Awesome ! Even if I have only 3 additional keys (sleep, wake up, power) they are all useful now. Not even sure Linux handles those :^)
I tried once to do it, but I got the AT_Keyboard_Info file screwed up with only those 3 keys working right and the others wrong :D
Note also that I have an azerty (french keyboard), so all the other hacks around don't really work.

If you are afraid of screwing up your keyboard, you can do this in a Terminal:

cp /where/is/AT_Keyboard_Info ~/config/settings/
/system/servers/input_server -q; sleep 120; rm ~/config/settings/AT_Keyboard_Info; /system/servers/input_server -q

So you are sure even if things get bad you will get them right in 2 minutes
this gives time to check the keyboard still works.

About SpicyKeys, this is an awesome proggy :)
I was already using the Menu to right btn thing, as well as the BeMenu trick :)
I use CL-Amp rather than SoundPlay, but you can do the same things with the 'clr' command (I mapped the classic winamp shourtcuts (z,x,c,v,b) with the Win key).
Another thing you can do is:
Win-E: /bin/eject /dev/disk/ide/atapi/1/master/0/raw (eject cdrom :)
I also have a hacked helper proggy to open a new Opera window on Win-O (I should post this on bebits maybe)

 
The Green Board
  Recent Downloads  -  # 442
Total Downloads  -  # 2,846
Total Views  -  # 2,366
User Ratings  -  N/A
  Input Methods
Keymaps
1.  QEMU - 9.62
2.  ScummVM - 9.50
3.  cpu_fix - 9.42
4.  Jukebox - 9.36
5.  Haiku AGP busm... - 9.35
6.  vim6 - 9.31
7.  Beezer - 9.25
8.  BeeF - 9.25
9.  HandBrake - 9.24
10.  DOSBox - 9.22
1.  Realtek RTL8139... - 289
2.  BeOS 5 Personal... - 205
3.  ATI Rage 128 Pr... - 186
4.  Ati Radeon Grap... - 146
5.  USB Serial driver - 121
6.  Ensoniq AudioPC... - 113
7.  Broadcom 440x 1... - 106
8.  DjVu Viewer - 91
9.  S3 Trio 64 v2 DX... - 79
10.  VLC Media Player - 75
You are not logged in.
 Login or create an account...
Hosted by NetConnect

 
Unless otherwise noted, everything is copyright © 1999-2002 Fifth Ace Productions, LLC. All Rights Reserved.
For more legal trivia, take a gander at our
Legal Stuff page and our Privacy Statement.
Fifth Ace Productions