Trying to upload all related projects
[easy-deb-chroot] / diablo / easy-chroot / src / usr / bin / window-hack-toggle
diff --git a/diablo/easy-chroot/src/usr/bin/window-hack-toggle b/diablo/easy-chroot/src/usr/bin/window-hack-toggle
new file mode 100755 (executable)
index 0000000..2e72ede
--- /dev/null
@@ -0,0 +1,32 @@
+#!/bin/sh
+
+# Toggle the Movable Window Hack for Easy Debian applications.
+# (c) 2008 Alan Bruce (qole): GPL license.
+
+# Shut down Matchbox Window Manager.
+
+. /etc/osso-af-init/af-defines.sh
+. /etc/osso-af-init/matchbox.defs
+echo dialogmode=$DIALOGMODE 
+echo stopping matchbox...
+. /etc/osso-af-init/matchbox.sh stop
+
+# Figure out what mode we're running in, and switch to the other one.
+
+if [ ! "x`grep -i DIALOGMODE=free /etc/osso-af-init/matchbox.defs`" = "x" ] ; then
+ echo "free mode: switching to static."
+ sudo cp /etc/osso-af-init/matchbox.defs.orig /etc/osso-af-init/matchbox.defs
+ sudo cp /usr/bin/matchbox-window-manager.orig /usr/bin/matchbox-window-manager
+else
+ echo "static mode: switching to free."
+ sudo cp /etc/osso-af-init/matchbox.defs.window-hack /etc/osso-af-init/matchbox.defs
+ sudo cp /usr/bin/matchbox-window-manager-matan /usr/bin/matchbox-window-manager
+fi
+
+# Start up Matchbox Window Manager again, with the new settings.
+
+. /etc/osso-af-init/af-defines.sh
+. /etc/osso-af-init/matchbox.defs
+echo dialogmode=$DIALOGMODE 
+echo starting matchbox...
+. /etc/osso-af-init/matchbox.sh start
\ No newline at end of file