Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Sat 20 Oct 2018, 15:50
All times are UTC - 4
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Desktop
jwm 2.3.6 aerosnap
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 2 [29 Posts]   Goto page: 1, 2 Next
Author Message
rufwoof

Joined: 24 Feb 2014
Posts: 2599

PostPosted: Sun 09 Jul 2017, 21:40    Post subject:  jwm 2.3.6 aerosnap  

As of jwm 2.3.6 aerosnap is supported. Add something like
Code:
    <Group>
        <Option>tiled</Option>
        <Option>aerosnap</Option>
    </Group>

to ~/.jwmrc and when you drag a window title to the top of the screen it will resize to full screen. Or drag to the side of screen and it will resize to half screen. (Handy for quickly getting two spreadsheets nicely side by size for comparing cells in the two spreadsheets).

Looks like it is still being refined by Joe and 2.3.7 is planned to have better support for multiple-monitors.
Back to top
View user's profile Send private message 
rockedge


Joined: 11 Apr 2012
Posts: 832
Location: Connecticut, United States

PostPosted: Sun 09 Jul 2017, 22:02    Post subject:  

Thanks!! that is really cool.....works great on my Tahr 6.0.6 systems....
Back to top
View user's profile Send private message Visit poster's website 
rufwoof

Joined: 24 Feb 2014
Posts: 2599

PostPosted: Sun 09 Jul 2017, 22:33    Post subject:  

Just remember in Puppy you should be editing /etc/xdg/templates/_root_.jwmrc and not ~/.jwmrc (there is a note in the top of that file indicating such IIRC).
Back to top
View user's profile Send private message 
rockedge


Joined: 11 Apr 2012
Posts: 832
Location: Connecticut, United States

PostPosted: Sun 09 Jul 2017, 23:58    Post subject:  

Yes, thanks I modified /etc/xdg/templates/_root_.jwmrc
I use the aerosnap in some setups now, works well!
Back to top
View user's profile Send private message Visit poster's website 
rufwoof

Joined: 24 Feb 2014
Posts: 2599

PostPosted: Wed 12 Jul 2017, 09:03    Post subject:  

rockedge wrote:
Thanks!! that is really cool.....works great on my Tahr 6.0.6 systems....

I see that its already coded into Tahr 6.0.6 ... Menu, Desktop, JWMDesk Manager ... Window Tab, Snap subsection (Aero Snap tickbox)
s.png
 Description   
 Filesize   74.48 KB
 Viewed   749 Time(s)

s.png

Back to top
View user's profile Send private message 
rockedge


Joined: 11 Apr 2012
Posts: 832
Location: Connecticut, United States

PostPosted: Sun 16 Jul 2017, 16:47    Post subject:  

wow your right! that is even cooler....thanks for this tip!
Back to top
View user's profile Send private message Visit poster's website 
stemsee

Joined: 27 Jun 2013
Posts: 2271
Location: In The Way

PostPosted: Thu 26 Oct 2017, 04:33    Post subject:  

Here is pseudo aerosnap should work for all window managers. It uses wmctrl. I use it with sven multimedia keyboard daemon, using win+arrow-keys.
1. Win+Arrow-up toggles full width top half screen, full width bottom half and fill screen (maximise).
2. Win+Arrow-left toggles left-top-quarter/left-bottom-quarter/left-full-height.
3. Win+Arrow-right toggles right-top-quarter / right-bottom-quarter/right-full-height.
4. Win+Arrow-down minimises.
alt+tab to re-maximise

All together nine 9 positions on screen affecting active window.

I named script aerosnap. needs to be run at startup to export functions. call functions like this
Code:
bash -c MTH
bash -c MBH
bash -c ML
bash -c MR

Code:
#!/bin/sh
# uses mctrl for pseudo aerosnap
# by stemsee (C) 2017 Marcos Contant
# use with sven multimedia keyboard daemon
# run aerosnap on Startup to export functions
# win+arrow key, command: bash -c MR|ML|MTH|MBH
#
function MTH () {         # toggles full-width: fill screen  / top half horizontal /bottom half horizontal
res=`xrandr | cut -f8,9,10 -d' ' | cut -f1 -d',' | head -1 | sed 's/ //g'`
XX=`echo $res | cut -f1 -d'x'`
YY=`echo $res | cut -f2 -d'x'`
YY=$((YY / 2 ))
wmctrl -r :ACTIVE: -b remove,maximized_horz,maximized_vert
if [[ ! -e /tmp/MTH && ! -e /tmp/MBH ]]; then
   wmctrl -r :ACTIVE: -e 0,0,0,$XX,$YY
   touch /tmp/MTH
elif [[ -e /tmp/MTH ]]; then
   XX=`echo $res | cut -f1 -d'x'`
   YY=`echo $res | cut -f2 -d'x'`
   rm /tmp/MTH
   wmctrl -r :ACTIVE: -e 0,0,0,$XX,$YY
   touch /tmp/MBH
elif [[ -e /tmp/MBH ]]; then
   wmctrl -r :ACTIVE: -e 0,0,$YY,$XX,$YY
   rm /tmp/MBH
fi
}
export -f MTH

function MBH () {      # minimizes
   res=`xrandr | cut -f8,9,10 -d' ' | cut -f1 -d',' | head -1 | sed 's/ //g'`
XX=`echo $res | cut -f1 -d'x'`
YY=`echo $res | cut -f2 -d'x'`
YY=$((YY / 2))
wmctrl -r :ACTIVE: -b remove,maximized_horz,maximized_vert
wmctrl -r :ACTIVE: -b toggle,hidden
}
export -f MBH

function ML () {      # Toggles, Left - top quarter/ bottom quarter/ full-height
   res=`xrandr | cut -f8,9,10 -d' ' | cut -f1 -d',' | head -1 | sed 's/ //g'`
XX=`echo $res | cut -f1 -d'x'`
YY=`echo $res | cut -f2 -d'x'`
XX=$((XX / 2))
YY=$((YY))
wmctrl -r :ACTIVE: -b remove,maximized_horz,maximized_vert
if [[ ! -e /tmp/ML && ! -e /tmp/LM ]]; then
   wmctrl -r :ACTIVE: -e 0,0,0,$XX,$YY
   touch /tmp/ML
elif [[ -e /tmp/ML ]]; then
   YY=$((YY / 2))
   rm /tmp/ML
   wmctrl -r :ACTIVE: -e 0,0,$YY,$XX,$YY
   touch /tmp/LM
elif [[ -e /tmp/LM ]]; then
XX=`echo $res | cut -f1 -d'x'`
YY=`echo $res | cut -f2 -d'x'`
XX=$((XX / 2))
YY=$((YY / 2))
wmctrl -r :ACTIVE: -e 0,0,0,$XX,$YY
rm /tmp/LM
fi
}
export -f ML

function MR () {      # Toggles, Right - top quarter / bottom quarter / full-height
   res=`xrandr | cut -f8,9,10 -d' ' | cut -f1 -d',' | head -1 | sed 's/ //g'`
XX=`echo $res | cut -f1 -d'x'`
YY=`echo $res | cut -f2 -d'x'`
XX=$((XX / 2))
YY=$((YY))
wmctrl -r :ACTIVE: -b remove,maximized_horz,maximized_vert
if [[ ! -e /tmp/MR && ! -e /tmp/RM ]]; then
   wmctrl -r :ACTIVE: -e 0,$XX,0,$XX,$YY
   touch /tmp/MR
elif [[ -e /tmp/MR ]]; then
   YY=$((YY / 2))
   rm -f /tmp/MR
   wmctrl -r :ACTIVE: -e 0,$XX,$YY,$XX,$YY
   touch /tmp/RM
elif [[ -e /tmp/RM ]]; then
   XX=`echo $res | cut -f1 -d'x'`
   YY=`echo $res | cut -f2 -d'x'`
   XX=$((XX / 2))
   YY=$((YY / 2))
   wmctrl -r :ACTIVE: -e 0,$XX,0,$XX,$YY
   rm /tmp/RM
fi
}
export -f MR


Code needs tweaking to accomodate decoration on openbox at least. Still better than nothing!
xscreenshot-20171027T131706.png
Description 
png

 Download 
Filename  xscreenshot-20171027T131706.png 
Filesize  213.14 KB 
Downloaded  194 Time(s) 
xscreenshot-20171027T131831.png
Description 
png

 Download 
Filename  xscreenshot-20171027T131831.png 
Filesize  251.63 KB 
Downloaded  183 Time(s) 
xscreenshot-20171027T131850.png
Description 
png

 Download 
Filename  xscreenshot-20171027T131850.png 
Filesize  148.11 KB 
Downloaded  163 Time(s) 
xscreenshot-20171027T131908.png
Description 
png

 Download 
Filename  xscreenshot-20171027T131908.png 
Filesize  250 KB 
Downloaded  159 Time(s) 
xscreenshot-20171027T132002.png
Description 
png

 Download 
Filename  xscreenshot-20171027T132002.png 
Filesize  91.17 KB 
Downloaded  173 Time(s) 

Last edited by stemsee on Wed 08 Nov 2017, 07:38; edited 7 times in total
Back to top
View user's profile Send private message MSN Messenger 
recobayu


Joined: 15 Sep 2010
Posts: 309
Location: indonesia

PostPosted: Thu 26 Oct 2017, 05:07    Post subject:  

Hi Stemsee. I try that code. I make a script file: aerosnap in /usr/bin then I copy all of your code. Then I link symbolic to /root/Startup. After that I restart x win. Then I open terminal and type: bash -c MR. But the text "bash: MR: command not found" appear. How to run that?

I also make a stickyjwm like this in here:
http://murga-linux.com/puppy/viewtopic.php?p=910550#910550
That also use wmctrl.
Very Happy
Back to top
View user's profile Send private message 
stemsee

Joined: 27 Jun 2013
Posts: 2271
Location: In The Way

PostPosted: Thu 26 Oct 2017, 08:19    Post subject:  

make the script executable
Code:
chmod 755 /usr/bin/aerosnap


Also install wmctrl package from repository
Back to top
View user's profile Send private message MSN Messenger 
stemsee

Joined: 27 Jun 2013
Posts: 2271
Location: In The Way

PostPosted: Thu 26 Oct 2017, 10:01    Post subject:  

On windows aerosnap provides a central adjuster bar down the middle of the screen. When the cursor grips the bar and is dragged left or right, the affected window narrows accordingly, and after that the remaining window re-maximises to its resized area. I wonder how to do that?
Back to top
View user's profile Send private message MSN Messenger 
stemsee

Joined: 27 Jun 2013
Posts: 2271
Location: In The Way

PostPosted: Fri 12 Jan 2018, 06:42    Post subject:  

My version works best when each function is its own script.
each script provides top, bottom, full-length, either, right, left and full width of screen.
MR
Code:
#!/bin/sh
res=`xwininfo -root | grep -e 'Height' -e 'Width'  | awk '{print $2}'`
XX=`echo $res | awk '{print $1}'`
YY=`echo $res | awk '{print $2}'`
XX=$((XX / 2))
YY=$((YY))
wmctrl -r :ACTIVE: -b remove,maximized_horz,maximized_vert
if [[ ! -e /tmp/MR && ! -e /tmp/RM ]]; then
   wmctrl -r :ACTIVE: -e 0,$XX,0,$XX,$YY
   touch /tmp/MR
elif [[ -e /tmp/MR ]]; then
   YY=$((YY / 2 ))
   rm -f /tmp/MR
   wmctrl -r :ACTIVE: -e 0,$XX,$YY,$XX,$YY
   touch /tmp/RM
elif [[ -e /tmp/RM ]]; then
   XX=`echo $res | awk '{print $1}'`
   YY=`echo $res | awk '{print $2}'`
   XX=$((XX / 2))
   YY=$((YY / 2))
   wmctrl -r :ACTIVE: -e 0,$XX,0,$XX,$YY
   rm /tmp/RM
fi

ML
Code:
#!/bin/sh
res=`xwininfo -root | grep -e 'Height' -e 'Width'  | awk '{print $2}'`
XX=`echo $res | awk '{print $1}'`
YY=`echo $res | awk '{print $2}'`
XX=$((XX / 2))
YY=$((YY))
wmctrl -r :ACTIVE: -b remove,maximized_horz,maximized_vert
if [[ ! -e /tmp/ML && ! -e /tmp/LM ]]; then
   wmctrl -r :ACTIVE: -e 0,0,0,$XX,$YY
   touch /tmp/ML
elif [[ -e /tmp/ML ]]; then
   YY=$((YY / 2))
   rm /tmp/ML
   wmctrl -r :ACTIVE: -e 0,0,$YY,$XX,$YY
   touch /tmp/LM
elif [[ -e /tmp/LM ]]; then
   XX=`echo $res | awk '{print $1}'`
   YY=`echo $res | awk '{print $2}'`
   XX=$((XX / 2))
   YY=$((YY / 2))
   wmctrl -r :ACTIVE: -e 0,0,0,$XX,$YY
   rm /tmp/LM
fi

MTH
Code:
#!/bin/sh
res=`xwininfo -root | grep -e 'Height' -e 'Width'  | awk '{print $2}'`
XX=`echo $res | awk '{print $1}'`
YY=`echo $res | awk '{print $2}'`
YY=$((YY / 2))
wmctrl -r :ACTIVE: -b remove,maximized_horz,maximized_vert
if [[ ! -e /tmp/MTH && ! -e /tmp/MBH ]]; then
   wmctrl -r :ACTIVE: -e 0,0,0,$XX,$YY
   touch /tmp/MTH
elif [[ -e /tmp/MTH ]]; then
   XX=`echo $res | awk '{print $1}'`
   YY=`echo $res | awk '{print $2}'`
   rm /tmp/MTH
   wmctrl -r :ACTIVE: -e 0,0,0,$XX,$YY
   touch /tmp/MBH
elif [[ -e /tmp/MBH ]]; then
   wmctrl -r :ACTIVE: -e 0,0,$YY,$XX,$YY
   rm /tmp/MBH
fi


MM
Code:
#!/bin/sh
res=`xwininfo -root | grep -e 'Height' -e 'Width'  | awk '{print $2}'`
XX=`echo $res | awk '{print $1}'`
YY=`echo $res | awk '{print $2}'`
XX=$((XX / 3))
YY=$((YY))
wmctrl -r :ACTIVE: -b remove,maximized_horz,maximized_vert
if [[ ! -e /tmp/MR && ! -e /tmp/RM ]]; then
   wmctrl -r :ACTIVE: -e 0,$XX,0,$XX,$YY
   touch /tmp/MR
elif [[ -e /tmp/MR ]]; then
   YY=$((YY / 3))
   rm -f /tmp/MR
   wmctrl -r :ACTIVE: -e 0,$XX,$YY,$XX,$YY
   touch /tmp/RM
elif [[ -e /tmp/RM ]]; then
        XX=`echo $res | awk '{print $1}'`
        YY=`echo $res | awk '{print $2}'`
   XX=$((XX / 3))
   YY=$((YY / 3))
   wmctrl -r :ACTIVE: -e 0,$XX,0,$XX,$YY
   rm /tmp/RM
fi


MBH
Code:
#!/bin/sh
#mnimise to tray
wmctrl -r :ACTIVE: -b remove,maximized_horz,maximized_vert
wmctrl -r :ACTIVE: -b toggle,hidden
out_2018-01-12_104110.gif
 Description   
 Filesize   187.32 KB
 Viewed   399 Time(s)

out_2018-01-12_104110.gif


Last edited by stemsee on Sun 14 Jan 2018, 10:18; edited 1 time in total
Back to top
View user's profile Send private message MSN Messenger 
tallboy


Joined: 21 Sep 2010
Posts: 1026
Location: Oslo, Norway

PostPosted: Fri 12 Jan 2018, 20:23    Post subject:  

Cool! Thank you stemsee.
When I used fvwm as a WM in RedHat and Debian, I made custom buttons in the title line to perform similar moves. The buttons had a graphical layout made to show the expected position and size of the window when clicked.

_________________
True freedom is a live Puppy on a multisession CD/DVD.
Back to top
View user's profile Send private message 
stemsee

Joined: 27 Jun 2013
Posts: 2271
Location: In The Way

PostPosted: Sat 13 Jan 2018, 05:52    Post subject:  

Hi Tallboy

I use winkey+(right_arrow|left_arrow|up_arrow) for MR ML MTH respectively in sven multimedia keyboard daemon. Press one keycombo for thrie for three layouts. Top|Full length|Bottom ; Right|Ful-width|Left etc

Then only need to position the mouse to activate chosen window.
Back to top
View user's profile Send private message MSN Messenger 
musher0

Joined: 04 Jan 2009
Posts: 12827
Location: Gatineau (Qc), Canada

PostPosted: Sat 13 Jan 2018, 09:23    Post subject:  

Good work,stemsee.

I suppose this is the closest thing to tiling you can get from within a cascading
window manager, such as icewm, jwm, waimea or pekwm.

To state the obvious, to get your windows really tiled side by side on your desktop,
one needs a real tiling window manager, such as echinus or dwm.

I did test your functions in echinus, a tiling window manager, and they work fine.

I am a bit disappointed that your scripts can not automatically tile, say, four apps,
two side by side at the top and two side by side at the bottom, on the same desktop.
Only one app at a time, eh?

But as you say, this type of tiling "is better than nothing"! Plus you have these
resizing functions "on call", with your win-arrow system.

One nice thing about your scripts is that they can be incorporated in waimea's and
pekwm's "window menus".

Good continuation! Smile BFN.

~~~~~~~~~~~~~~
PS -- For the record, MochiMopei did similar work in 2015:
http://murga-linux.com/puppy/viewtopic.php?search_id=737092742&t=97950
Also forum member recobayu:
http://murga-linux.com/puppy/viewtopic.php?p=825303&sort=lastpost#825303
your-MR-script-added-to-waimea.jpg
 Description   
 Filesize   52.86 KB
 Viewed   319 Time(s)

your-MR-script-added-to-waimea.jpg

tiling-in-echinus-WM.jpg
 Description   (By comparison)
 Filesize   78.94 KB
 Viewed   362 Time(s)

tiling-in-echinus-WM.jpg


_________________
musher0
~~~~~~~~~~
Fidèle elle commença, ainsi elle restera. (Prov. canadien) /
Faithful she began, so will she stay. (Canadian prov.)
Back to top
View user's profile Send private message 
stemsee

Joined: 27 Jun 2013
Posts: 2271
Location: In The Way

PostPosted: Sat 13 Jan 2018, 15:18    Post subject:  

Hi Musher0

Thanks for testing, and providing feedback and a priori scripts by real programmers whose scripts seem tied to jwm. I use this in openbox and jwm.

I think i should be easy to auto-tile 2/4/5/6/7/8/9/10+ windows with two arrow keys combo. The maths is simple and the arrangements could auto divide the screen into columns and rows according to how many windows are open. However I don't need it. Three columns instead of two interests me, along with three rows. Also auto quad and auto halves would be most useful for 1080p desktop.

I have a 4k tv display at hand, so 16nths (4x4) might be useful at some point (video montage)! Also Qemu multi-seat for 4.

I also like that MochiMopel's script remembers original size and position and can restore it.
Feel free to adapt the scripts as suits you. There is also one other script which minimises with win+down_arrow, but then alt+tab to call it back!
Back to top
View user's profile Send private message MSN Messenger 
Display posts from previous:   Sort by:   
Page 1 of 2 [29 Posts]   Goto page: 1, 2 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Desktop
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0809s ][ Queries: 15 (0.0202s) ][ GZIP on ]