Quote:
Originally Posted by geekmaster
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.