Just killing time while I wait for something else, so I thought I would share this, which is quite useful to open and layout multiple windows at once.
#!/bin/sh
#requires: wmctrl, xdpyinfo
#wmtrcl syntax: wmctrl -r:{which window to move} -e 0,x off-set,y off-set,width,height
#variables:
#windows=the number of windows to open
#per=the percent of the screen height each window should take up
#slp=how long to wait (in seconds) before opening the next window (float) which can be adjusted according to your computer speed
#dir=the directory you want to open in each window
windows=5
per=0.75
slp=0.1
dir="/root/HOME"
screenwidth=`xdpyinfo | grep dimensions | sed -r 's/^[^0-9]*([0-9]+x[0-9]+).*$/\1/' | cut -d'x' -f1`
screenheight=`xdpyinfo | grep dimensions | sed -r 's/^[^0-9]*([0-9]+x[0-9]+).*$/\1/' | cut -d'x' -f2`
width=$(echo "$screenwidth / $windows - 6" | bc)
height=$(echo "$screenheight*$per" | bc)
xoffset=0
COUNTER=0
while [ $COUNTER -lt $windows ]; do
rox "$dir"
sleep 0.25
wmctrl -r:ACTIVE: -e 0,"$xoffset",0,"$width","$height"
sleep "$slp"
let COUNTER=COUNTER+1
xoffset=$(echo "$screenwidth / $windows * $COUNTER" | bc)
done
exit 0
So...
- !-check the code first to see if you approve, if you do then set it to executable
- set the parameters: number of windows, % screen height, path to the directory to open, and time to wait before opening each one.
- then put it in a good location, ex. in your pd-externals maybe, or ~/ somewhere
- send a link to it to your desktop...
then - at a click it opens and lays out across the screen that many copies of the set directory.
I use this constantly to better align my brain, work, and focus.
p.s. Puppy Linux users seem to like it...as it's been viewed over there a 1,000+ times on their forum.
May you find it useful.
Note: one thing that works well...is save multiple copies of it with different "number of windows" parameters, ex. 2, 3, 4, then send links to all of them to your desktop. So you can align your current view to your current state of mind.
Peace through Music.
Love through Sharing.
-s