Created
June 28, 2018 17:47
-
-
Save wallacesilva/3f2aae1da99fc0fbcd1fe354faf6a35e to your computer and use it in GitHub Desktop.
Revisions
-
wallacesilva created this gist
Jun 28, 2018 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,50 @@ #!/bin/bash # Wallace Silva - wallacesilva.com dothis=true toW=720 toH=560 nowW=0 nowH=0 increment=1 while [ dothis ] do nowW=$(xdotool getwindowfocus getwindowgeometry | sed -n '3,30p' | cut -d ':' -f 2 | xargs | cut -d 'x' -f 1) nowH=$(xdotool getwindowfocus getwindowgeometry | sed -n '3,30p' | cut -d ':' -f 2 | xargs | cut -d 'x' -f 2) ratioW=$(((toW-nowW)/100)) ratioH=$(((toH-nowH)/100)) echo "Ratio // W: $ratioW / H: $ratioH" if [ "$nowW" -lt "$toW" ]; then # nowW=$((nowW+increment)) nowW=$((nowW+ratioW)) fi if [ "$nowH" -lt "$toH" ]; then # nowH=$((nowH+increment)) nowH=$((nowH+ratioH)) fi sleep 0.1 && wmctrl -r :ACTIVE: -e 0,300,168,$nowW,$nowH if [ "$nowW" -ge "$toW" ] && [ "$nowH" -ge "$toH" ]; then dothis=false fi # can be better if [ $dothis ]; then doNothing=0 echo "NOW // W: $nowW / H: $nowH" echo "TO // W: $toW / H: $toH" else exit fi done