add fixer script
This commit is contained in:
parent
783c6c20f5
commit
dae6963b24
1 changed files with 26 additions and 0 deletions
|
@ -9,7 +9,33 @@ CHROME_HEIGHT_OFFSET=20
|
|||
|
||||
# end of user configurable section
|
||||
|
||||
# need room file
|
||||
if [ ! -f "$1" ]; then
|
||||
echo "ERROR: need room file"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# get screen width and height
|
||||
WIDTH=`xdpyinfo | grep dimensions | awk '{print $2}' | awk -Fx '{print $1}'`
|
||||
HEIGHT=`xdpyinfo | grep dimensions | awk '{print $2}' | awk -Fx '{print $2}'`
|
||||
echo "display is $WIDTH x $HEIGHT"
|
||||
|
||||
# start at 0,0
|
||||
X=0
|
||||
Y=0
|
||||
NUM=0
|
||||
|
||||
while read ROOM; do
|
||||
HEX="`echo "obase=16; $NUM" | bc | tr '[A-Z]' '[a-z]'`"
|
||||
echo "check $ROOM num $NUM hex $HEX"
|
||||
WINTITLE="[$HEX] $ROOM"
|
||||
echo "moving $WINTITLE to $X,$Y"
|
||||
wmctrl -Fr "$WINTITLE" -e "0,$X,$Y,$WINDOW_WIDTH,$WINDOW_HEIGHT"
|
||||
NUM=$((NUM+1))
|
||||
X=$((X+WINDOW_WIDTH+CHROME_WIDTH_OFFSET))
|
||||
if [ $X -gt $WIDTH ]; then
|
||||
echo "new row"
|
||||
X=0
|
||||
Y=$((Y+WINDOW_HEIGHT+CHROME_HEIGHT_OFFSET))
|
||||
fi
|
||||
done < "$1"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue