summaryrefslogtreecommitdiff
path: root/.compizsnap/right.sh
diff options
context:
space:
mode:
Diffstat (limited to '.compizsnap/right.sh')
-rw-r--r--.compizsnap/right.sh23
1 files changed, 23 insertions, 0 deletions
diff --git a/.compizsnap/right.sh b/.compizsnap/right.sh
new file mode 100644
index 0000000..c79151f
--- /dev/null
+++ b/.compizsnap/right.sh
@@ -0,0 +1,23 @@
+#!/bin/sh
+#
+# CompizSnap is a collaborative project from ubuntuforums.org and is free software.
+# This script adds window snapping functionality to compiz using the commands plugin.
+#
+# Directions: edit the mouse.sh script
+#
+
+. $HOME/.compizsnap/mouse.sh
+
+WIDTH=`xdpyinfo | grep 'dimensions:' | sed -r 's/.*\s([0-9]+)x([0-9]+)\s.*/\1/'`
+HALF=$(($WIDTH/2))
+
+if (xinput --query-state $MOUSE | grep down)
+then
+ echo ".compizsnap/right.sh: snapping because the mouse is pressed"
+ wmctrl -r :ACTIVE: -b remove,maximized_vert,maximized_horz
+ wmctrl -r :ACTIVE: -b add,maximized_vert
+ wmctrl -r :ACTIVE: -e 0,$HALF,0,$HALF,-1
+else
+ echo ".compizsnap/right.sh: exiting because the mouse isn't pressed"
+fi
+