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)
wmctrl -d | egrep '^[0-9]+\s+\*' | cut -f1 -d" "
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
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