Easy Chroot 0.3.1
[easy-deb-chroot] / fremantle / easy-deb-chroot / src / usr / bin / fixkbdfocus
1 #!/bin/sh
2 #
3 # A small keyboard focus hack that uses qobi's workaround
4 #
5 # Provide the unique name of your window and get keyboard focus in it.
6 # GPL licenced. Share your code!
7
8 if [ "x$1" = "x" ] ; then
9   gxmessage "Please specify a window name to focus."
10   exit 1
11 fi
12
13 WINLIST=`wmctrl -l`
14 FOCUSWIN=`echo "$WINLIST" | grep -i "$1" | awk '{print $1}'`
15
16 if [ "x$FOCUSWIN" = "x" ] ; then
17   # gxmessage "No window found with the name $1"
18   echo "No window found with the name $1"
19   exit 2
20 fi
21
22 #FOCUSCMD="sudo debian qobi-wmhint-fix $FOCUSWIN ; wmctrl -i -a $FOCUSWIN"
23 #osso-xterm "$FOCUSCMD"
24
25 sudo debian qobi-wmhint-fix $FOCUSWIN
26 wmctrl -i -a $FOCUSWIN