Easy Chroot 0.3.1
[easy-deb-chroot] / fremantle / easy-deb-chroot / src / usr / bin / fixkbdfocus
diff --git a/fremantle/easy-deb-chroot/src/usr/bin/fixkbdfocus b/fremantle/easy-deb-chroot/src/usr/bin/fixkbdfocus
new file mode 100755 (executable)
index 0000000..76ef544
--- /dev/null
@@ -0,0 +1,26 @@
+#!/bin/sh
+#
+# A small keyboard focus hack that uses qobi's workaround
+#
+# Provide the unique name of your window and get keyboard focus in it.
+# GPL licenced. Share your code!
+
+if [ "x$1" = "x" ] ; then
+  gxmessage "Please specify a window name to focus."
+  exit 1
+fi
+
+WINLIST=`wmctrl -l`
+FOCUSWIN=`echo "$WINLIST" | grep -i "$1" | awk '{print $1}'`
+
+if [ "x$FOCUSWIN" = "x" ] ; then
+  # gxmessage "No window found with the name $1"
+  echo "No window found with the name $1"
+  exit 2
+fi
+
+#FOCUSCMD="sudo debian qobi-wmhint-fix $FOCUSWIN ; wmctrl -i -a $FOCUSWIN"
+#osso-xterm "$FOCUSCMD"
+
+sudo debian qobi-wmhint-fix $FOCUSWIN
+wmctrl -i -a $FOCUSWIN