Code: Select all
<Group>
<Option>tiled</Option>
<Option>aerosnap</Option>
</Group>
Looks like it is still being refined by Joe and 2.3.7 is planned to have better support for multiple-monitors.
Code: Select all
<Group>
<Option>tiled</Option>
<Option>aerosnap</Option>
</Group>
I see that its already coded into Tahr 6.0.6 ... Menu, Desktop, JWMDesk Manager ... Window Tab, Snap subsection (Aero Snap tickbox)rockedge wrote:Thanks!! that is really cool.....works great on my Tahr 6.0.6 systems....
Code: Select all
bash -c MTH
bash -c MBH
bash -c ML
bash -c MR
Code: Select all
#!/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: Select all
chmod 755 /usr/bin/aerosnap
Code: Select all
#!/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
Code: Select all
#!/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
Code: Select all
#!/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
Code: Select all
#!/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
Code: Select all
#!/bin/sh
#mnimise to tray
wmctrl -r :ACTIVE: -b remove,maximized_horz,maximized_vert
wmctrl -r :ACTIVE: -b toggle,hidden
Code: Select all
wmctrl -l | wc -l
Code: Select all
who | awk 'END{print NR - 1}'
My formula has to be:wmctrl -l
0x00c0000a 0 puppypc# sam. 13 jan. 18
0x00e00005 0 puppypc # xload
0x02600001 -1 puppypc # Conky (puppypc #)
0x02800001 -1 puppypc # Conky (puppypc #)
0x02a00001 -1 puppypc # Conky (puppypc #)
0x02c00001 -1 puppypc # Conky (puppypc #)
0x01e00002 -1 N/A N/A
0x01c00015 0 puppypc # Puppy Linux Discussion Forum :: View topic - jwm 2.3.6 aerosnap - Opera
0x02400001 -1 puppypc # Conky (puppypc #)
0x03200006 2 puppypc # Console1
Code: Select all
wmctrl -l | grep -v Conky | wc -l
5
who?stemsee wrote:Code: Select all
who | awk 'END{print NR - 1}'
Code: Select all
wmctrl -l | grep -v "\-1"
Your version would work even better than best if it would get the screen dimension rightstemsee wrote:My version works best when each function is its own script.