View Single Post
Old 04-26-2012, 02:24 AM   #35
drauger
Enthusiast
drauger has every book they ever wanted in electronic form on their reader.drauger has every book they ever wanted in electronic form on their reader.drauger has every book they ever wanted in electronic form on their reader.drauger has every book they ever wanted in electronic form on their reader.drauger has every book they ever wanted in electronic form on their reader.drauger has every book they ever wanted in electronic form on their reader.drauger has every book they ever wanted in electronic form on their reader.drauger has every book they ever wanted in electronic form on their reader.drauger has every book they ever wanted in electronic form on their reader.drauger has every book they ever wanted in electronic form on their reader.drauger has every book they ever wanted in electronic form on their reader.
 
drauger's Avatar
 
Posts: 32
Karma: 46558
Join Date: Feb 2012
Device: Kindle4NT
Quote:
Originally Posted by geekmaster View Post
I did "waitforkey >/tmp/key &" which continues immediately, leaving waitforkey running in the background until a key is pressed, when it outputs the keypress value and quits. While waiting for a key, you can periodically check for a keypress in the main script with "key=$(cat /tmp/key)". You just need to get creative and try stuff...
OK, let's try to be creative
This code will be executing untill you press DOWN key:

Code:
waitforkey 108 &
W=$!
while [[ $W == $(ps $W | grep $W | sed 's/pts.*//') ]] ; do
##some code##
done
I've written it to create clock that can be used as a screensaver - before I've realized that clock sitting in status bar is much better thing.
drauger is offline   Reply With Quote