Code: Select all
sudo nano /usr/bin/togglekbd.sh
#!/bin/bash
if ps ax | grep -v grep | grep xvkbd > /dev/null
then
/usr/bin/pkill xvkbd
else
/usr/bin/xvkbd -secure -always-on-top -geometry 798x175-0+362
fi
ctl+o
to save it
ctl+x
to exit nano
Code: Select all
sudo chmod 755 /usr/bin/toggle*
The last step is to adjust your keybindings to aim at this file. I am using xmodmap to handle the button presses. I will post a how to after finishing this post. If you are using the enlightenment window manager open the settings panel from the main menu and "Settings". Toggle the right arrow until you see "Input". Select "Key Bindings" and "Add". Press the hard button for the keyboard and scroll down the list of calls on the pop-up dialog until you see command. Select it and enter:
Enter:
Apply and Save and exit the settings panel./usr/bin/togglekbd.sh
Test and make any needed adjustments for position or size. Xvkbd can be set up to connect to a remote display and be fully customized. http://homepage3.nifty.com/tsato/xvkbd/ for more info.
If you use a different keyboard simply substitute each mention of xvkbd with your keyboard and match the postitioning to suit your needs.
Similarly this method can be used to trigger the toggle of any program to a button. Run your browser at full screen on this method. Start an ssh connection, modify xvkbd to have just enough keys to control the entertainment system and run it full screen with pretty pictures behind the buttons. Possibilities are numerous. This is a very versatile script. I hope it finds good use.
quotaholic