<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[N-ply-window-opener and aligner (linux version)]]></title><description><![CDATA[<p>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.</p>
<pre><code>#!/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=&quot;/root/HOME&quot;

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 &quot;$screenwidth / $windows - 6&quot; | bc) 
height=$(echo &quot;$screenheight*$per&quot; | bc)

xoffset=0
COUNTER=0

while [  $COUNTER -lt $windows ]; do
    rox &quot;$dir&quot;
    sleep 0.25
    wmctrl -r:ACTIVE: -e 0,&quot;$xoffset&quot;,0,&quot;$width&quot;,&quot;$height&quot;
    sleep &quot;$slp&quot;

    let COUNTER=COUNTER+1
    xoffset=$(echo &quot;$screenwidth / $windows * $COUNTER&quot; | bc) 
done

exit 0

</code></pre>
<p><a href="/uploads/files/1630393878874-n-ply-window-opener.sh">N-ply-window-opener.sh</a></p>
<p>So...</p>
<ol>
<li>!-check the code first to see if you approve, if you do then set it to executable</li>
<li>set the parameters: number of windows, % screen height, path to the directory to open, and time to wait before opening each one.</li>
<li>then put it in a good location, ex. in your pd-externals maybe, or ~/ somewhere</li>
<li>send a link to it to your desktop...<br />
then</li>
<li>at a click it opens and lays out across the screen that many copies of the set directory.</li>
</ol>
<p>I use this constantly to better align my brain, work, and focus.</p>
<p>p.s. Puppy Linux users seem to like it...as it's been viewed over there  a 1,000+ times on their forum.</p>
<p>May you find it useful.</p>
<p>Note: one thing that works well...is save multiple copies of it with different &quot;number of windows&quot; 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. <img class="emoji emoji-extended" src="http://forum.pdpatchrepo.info/plugins/nodebb-plugin-emoji-extended/images/grinning.png" title=":-)" alt=":-)" /></p>
<p>Peace through Music.<br />
Love through Sharing.<br />
-s</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/13615/n-ply-window-opener-and-aligner-linux-version</link><generator>RSS for Node</generator><lastBuildDate>Sun, 08 Nov 2026 18:05:38 GMT</lastBuildDate><atom:link href="http://forum.pdpatchrepo.info/topic/13615.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 31 Aug 2021 07:14:55 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to N-ply-window-opener and aligner (linux version) on Tue, 31 Aug 2021 07:15:46 GMT]]></title><description><![CDATA[<p>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.</p>
<pre><code>#!/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=&quot;/root/HOME&quot;

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 &quot;$screenwidth / $windows - 6&quot; | bc) 
height=$(echo &quot;$screenheight*$per&quot; | bc)

xoffset=0
COUNTER=0

while [  $COUNTER -lt $windows ]; do
    rox &quot;$dir&quot;
    sleep 0.25
    wmctrl -r:ACTIVE: -e 0,&quot;$xoffset&quot;,0,&quot;$width&quot;,&quot;$height&quot;
    sleep &quot;$slp&quot;

    let COUNTER=COUNTER+1
    xoffset=$(echo &quot;$screenwidth / $windows * $COUNTER&quot; | bc) 
done

exit 0

</code></pre>
<p><a href="/uploads/files/1630393878874-n-ply-window-opener.sh">N-ply-window-opener.sh</a></p>
<p>So...</p>
<ol>
<li>!-check the code first to see if you approve, if you do then set it to executable</li>
<li>set the parameters: number of windows, % screen height, path to the directory to open, and time to wait before opening each one.</li>
<li>then put it in a good location, ex. in your pd-externals maybe, or ~/ somewhere</li>
<li>send a link to it to your desktop...<br />
then</li>
<li>at a click it opens and lays out across the screen that many copies of the set directory.</li>
</ol>
<p>I use this constantly to better align my brain, work, and focus.</p>
<p>p.s. Puppy Linux users seem to like it...as it's been viewed over there  a 1,000+ times on their forum.</p>
<p>May you find it useful.</p>
<p>Note: one thing that works well...is save multiple copies of it with different &quot;number of windows&quot; 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. <img class="emoji emoji-extended" src="http://forum.pdpatchrepo.info/plugins/nodebb-plugin-emoji-extended/images/grinning.png" title=":-)" alt=":-)" /></p>
<p>Peace through Music.<br />
Love through Sharing.<br />
-s</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/13615/n-ply-window-opener-and-aligner-linux-version</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/13615/n-ply-window-opener-and-aligner-linux-version</guid><dc:creator><![CDATA[sv]]></dc:creator><pubDate>Tue, 31 Aug 2021 07:15:46 GMT</pubDate></item></channel></rss>