summaryrefslogtreecommitdiff
path: root/.compizsnap
diff options
context:
space:
mode:
authorLuke Shumaker <LukeShu@sbcglobal.net>2011-04-25 12:22:55 -0400
committerLuke Shumaker <LukeShu@sbcglobal.net>2011-04-25 12:22:55 -0400
commitc9935112c8b66e23d2acd7584fecd8e99a281b14 (patch)
tree218ebbeb47e5a77620de5af597833522304d92c3 /.compizsnap
parent9b77ce1433aa790e174947dc33745926965ee4a1 (diff)
.compizsnap, .nanorc
Track .compizsnap/* files (hurpdurp), only tracked the directory before. Use *.nanorc files from the nano 2.2.6 distribution.
Diffstat (limited to '.compizsnap')
-rw-r--r--.compizsnap/left.sh23
-rw-r--r--.compizsnap/max.sh19
-rw-r--r--.compizsnap/mouse.sh10
-rw-r--r--.compizsnap/right.sh23
4 files changed, 75 insertions, 0 deletions
diff --git a/.compizsnap/left.sh b/.compizsnap/left.sh
new file mode 100644
index 0000000..8fb479f
--- /dev/null
+++ b/.compizsnap/left.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/left.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,0,0,$HALF,-1
+else
+ echo ".compizsnap/left.sh: exiting because the mouse isn't pressed"
+fi
+
diff --git a/.compizsnap/max.sh b/.compizsnap/max.sh
new file mode 100644
index 0000000..d1115ec
--- /dev/null
+++ b/.compizsnap/max.sh
@@ -0,0 +1,19 @@
+#!/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
+
+if (xinput --query-state $MOUSE | grep down)
+then
+ echo ".compizsnap/max.sh: maximizing because the mouse is pressed"
+ wmctrl -r :ACTIVE: -b remove,maximized_vert,maximized_horz
+ wmctrl -r :ACTIVE: -b add,maximized_vert,maximized_horz
+else
+ echo ".compizsnap/max.sh: exiting because the mouse isn't pressed"
+fi
+
diff --git a/.compizsnap/mouse.sh b/.compizsnap/mouse.sh
new file mode 100644
index 0000000..76d632c
--- /dev/null
+++ b/.compizsnap/mouse.sh
@@ -0,0 +1,10 @@
+#!/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: run "xinput list" to find your mouse's ID# and then edit the MOUSE variable below:
+#
+
+export MOUSE=12
+
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
+