Page 1 of 1

N-ply-Rox-Filer window-opening scripts: to open 1,2,3, or 4

Posted: Wed 14 Jun 2017, 21:17
by svanya
N-ply-Rox-Filer window-opening scripts: to open 1,2,3, or 4 windows at once

Preface:

Been a long time since I shared anything on this forum, and found myself thinking of how much puppy and its users have helped me "along the way".

So thought to share these scripts as they may help someone else "see better" their world and the work they are doing.

Instructions:

The four scripts (using (installed by default in the latest puppies) "wmctrl") from a singe click open (respectively) 1, 2, 3 or 4 roxfiler windows laid out on the screen so you can see that many folders at once (3-ply pic and code example below)

You Will need to adjust the scripts (they are currently configured for 1366x768) according to your screen dimensions (Well, worth the effort) according to the following syntax: wmctrl -r:ACTIVE: -e 0,x off-set,y off-set,width,height.

They are currently aligned so that the bottom portion of your window and tool-bar (if on the bottom) is exposed, so that you can browse and yet still have access to your os controls.

(I have included example icons to go along with them.)

Once you have downloaded and extracted them, you only need to 1) put them in your path, ex. "/usr/bin" or "/root/my-applications/bin" and 2) drag them to your desktop (for instance) to give you immediate access to all of the scripts, aka. window views.

Peace, love, and joy.

And thanks for all you do.

Sincerely,
Scott Vanya

p.s. let me know if you need additional help setting this up. I will be more than happy to explain further, ex. how to add icons to the scripts.

3-ply example code:

Code: Select all

#!/bin/sh
#syntax: -e 0,x off-set,y off-set,width,height

rox ~/HOME
wmctrl -r:ACTIVE: -e 0,0,0,452,515

rox ~/HOME
wmctrl -r:ACTIVE: -e 0,452,0,452,515

rox ~/HOME
wmctrl -r:ACTIVE: -e 0,904,0,452,515
Image

Posted: Thu 15 Jun 2017, 00:08
by smokey01
@svanya
You might want to advise what Puppy's this works on as wmctrl may not be included.

Posted: Thu 15 Jun 2017, 02:06
by musher0
Great find, svanya!

@smokey01:
Interested people can find a copy of wmctrl-1.0.7 here. This pet
package from forum member lithpr dating back to 2011, I suspect it
will fit Puppies new and old.

IHTH. BFN.

Updated to a generic script

Posted: Sun 11 Mar 2018, 09:34
by svanya
This is easier and more adaptable to use automatically capturing the screen size and only taking (mainly) as input the number of windows to be opened and the percent of the screen height to use. It also allows you to set which directory you want opened in each window.

Also, as to getting wmctrl: I believe (at least as of Trusty) it is in the repo(s). Also as of Trusty it comes preinstalled.

Ciao for now.
Happy Kaleidescopic Seeing.
-Scott

Code: Select all

#!/bin/sh
#wmtrcl syntax: wmctrl -r:{which window to move} -e 0,x off-set,y off-set,width,height
#windows=the number of windows to open
#per=the percent of the screen height each window should take up
#slp=how to wait before opening the next window (float) which can be adjust according to your computer speed
#path=the directory you want to open in each window

windows=3
per=0.75
slp=0.5
dir="/root"

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) #`expr ($screenwidth / $windows ) - 20`
height=$(echo "$screenheight*$per" | bc)

xoffset=0
COUNTER=0

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

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

exit 0