Last active
May 5, 2020 15:54
-
-
Save debuti/a6f851142c467a976574e6a08ae26b20 to your computer and use it in GitHub Desktop.
Revisions
-
debuti revised this gist
May 5, 2020 . 1 changed file with 11 additions and 1 deletion.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 @@ -5,22 +5,32 @@ SHEIGHT=$((cd /tmp/.X11-unix && for x in X*; do DISPLAY=":${x#X}" xdpyinfo | gre ``` # Current desktop ``` wmctrl -d | egrep '^[0-9]+\s+\*' | cut -f1 -d" " ``` # Current desktop windows ``` wmctrl -pl | egrep "^0x[0-9a-f]+\s+$(wmctrl -d | egrep '^[0-9]+\s+\*' | cut -f1 -d" ")" ``` # All t32 instances of the current desktop ``` wmctrl -pl | egrep "^0x[0-9a-f]+\s+$(wmctrl -d | egrep '^[0-9]+\s+\*' | cut -f1 -d" ")" | grep t32marm ``` # Move and resize window ``` wmctrl -ir $WID -e 0,X,Y,W,H ``` # Move all windows in a horizontal tile ``` TITLE=Pluma; WIDS=( $(wmctrl -pl | egrep "^0x[0-9a-f]+\s+$(wmctrl -d | egrep '^[0-9]+\s+\*' | cut -f1 -d" ")" | grep $TITLE | cut -f1 -d" ") ) COUNT=$(echo "${#WIDS[@]}") WW=$(( $SWIDTH / $COUNT )) for i in "${!WIDS[@]}"; do wmctrl -ir ${WIDS[$i]} -e 0,$(( $WW * $i )),0,$WW,$SHEIGHT done ``` -
debuti revised this gist
May 5, 2020 . 1 changed file with 2 additions and 0 deletions.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 @@ -1,6 +1,8 @@ # Get screen dimensions ``` SWIDTH=$((cd /tmp/.X11-unix && for x in X*; do DISPLAY=":${x#X}" xdpyinfo | grep dimensions; exit 0; done) | grep -oP '[0-9]+x[0-9]+(?= pixels)' | cut -f1 -dx) SHEIGHT=$((cd /tmp/.X11-unix && for x in X*; do DISPLAY=":${x#X}" xdpyinfo | grep dimensions; exit 0; done) | grep -oP '[0-9]+x[0-9]+(?= pixels)' | cut -f2 -dx) ``` # Current desktop wmctrl -d | egrep '^[0-9]+\s+\*' | cut -f1 -d" " -
debuti created this gist
May 5, 2020 .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,24 @@ # Get screen dimensions SWIDTH=$((cd /tmp/.X11-unix && for x in X*; do DISPLAY=":${x#X}" xdpyinfo | grep dimensions; exit 0; done) | grep -oP '[0-9]+x[0-9]+(?= pixels)' | cut -f1 -dx) SHEIGHT=$((cd /tmp/.X11-unix && for x in X*; do DISPLAY=":${x#X}" xdpyinfo | grep dimensions; exit 0; done) | grep -oP '[0-9]+x[0-9]+(?= pixels)' | cut -f2 -dx) # Current desktop wmctrl -d | egrep '^[0-9]+\s+\*' | cut -f1 -d" " # Current desktop windows wmctrl -pl | egrep "^0x[0-9a-f]+\s+$(wmctrl -d | egrep '^[0-9]+\s+\*' | cut -f1 -d" ")" # All t32 instances of the current desktop wmctrl -pl | egrep "^0x[0-9a-f]+\s+$(wmctrl -d | egrep '^[0-9]+\s+\*' | cut -f1 -d" ")" | grep t32marm # Move and resize window wmctrl -ir $WID -e 0,X,Y,W,H # Move all windows in a horizontal tile TITLE=Pluma; WIDS=( $(wmctrl -pl | egrep "^0x[0-9a-f]+\s+$(wmctrl -d | egrep '^[0-9]+\s+\*' | cut -f1 -d" ")" | grep $TITLE | cut -f1 -d" ") ) COUNT=$(echo "${#WIDS[@]}") WW=$(( $SWIDTH / $COUNT )) for i in "${!WIDS[@]}"; do wmctrl -ir ${WIDS[$i]} -e 0,$(( $WW * $i )),0,$WW,$SHEIGHT done