A script to implement window snap in compiz

Asked by Ralemy

I need a script that the users can download and place in their machine, so that compiz can be used to implement a window arrangement functionality for their Lucid desktop

Question information

Language:
English Edit question
Status:
Solved
For:
UbuVanLoCo Edit question
Assignee:
Ralemy Edit question
Solved by:
Ralemy
Solved:
Last query:
Last reply:
Revision history for this message
Ralemy (reza.alemy) said :
#1

#!/bin/bash
#usage snap.sh [-r] [-l]
#snap the window to the right or left border (default is left)

WIDTH=`xdpyinfo | grep 'dimensions:' | cut -f 2 -d ':' | cut -f 1 -d 'x'`
HALF=$(($WIDTH/2))
wmctrl -r :ACTIVE: -b add,maximized_vert
Y=0
while getopts ":rl" optname
  do
    case $optname in
     "r")
       Y=$HALF
     ;;
    esac
  done
wmctrl -r :ACTIVE: -e 0,$Y,0,$HALF,-1