summaryrefslogtreecommitdiff
path: root/.compizsnap/left.sh
blob: 8fb479fd0a13f718b1c4b4b833097c6b91aa54f4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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