Thread: Odds and ends
View Single Post
Posts: 1,101 | Thanked: 1,185 times | Joined on Aug 2008 @ Spain
#54
Originally Posted by Addison View Post
I'm not seeing what I'm doing wrong on this.

I launch this just once in the beginning. It's the bottom keyboard that will always remain on the screen.
xkbd -geometry +65520+65992 -k /media/mmc2/N800/Keyboards/Med.xkbd & PID1=$! & filterm ascii-ascii cp437-utf8 tf

When pressing the fullscreen key, it brings up the big keyboard.
xkbd -geometry +65507+65536 -k /media/mmc2/N800/Keyboards/Full.xkbd & PID2=$!

When I press Enter on that big keyboard, it executes this.
kill $PID2
xte 'keydown KP_Enter' 'keyup KP_Enter'


It's not killing the big keyboard though.

From what you told me, this should be correct.
Probably because each is a different script. Environment variables are local, so they are lost when the script finishes and the next script can't read $PID1. Use a file to store and read the PID
Something like:
Code:
#launch script
xkbd -geometry +65507+65536 -k /media/mmc2/N800/Keyboards/Full.xkbd &
echo $! >/tmp/xkbd2.pid

#kill script
kill $(cat /tmp/xkbd2.pid)
xte 'keydown KP_Enter' 'keyup KP_Enter'

Last edited by maacruz; 2011-09-06 at 19:05. Reason: Fixed typo
 

The Following User Says Thank You to maacruz For This Useful Post: