#!/bin/sh ## monopolize the screen with the window in focus ## . $HOME/.config/rootwm/rwm_var FW=$(pfw) # focused window RW=$(wattr w $(lsw -r)) # root width RH=$(wattr h $(lsw -r)) # root height WFW=$((RW - BW * 2)) # window fullsize width WFH=$((RH - BW * 2)) # window fullsize heigh TWF="/tmp/rwm_fullsize-$FW" # temporal window file # if it is in the list and it is in fullsize if [ -f "$TWF" ] & [ "$(wattr wh $FW)" = "$WFW $WFH" ]; then wtp $(cat $TWF) $FW # restore size and position rm $TWF # remove from list else # if it's not in the list and it's not in fullsize echo "$(wattr xywh $FW)" > $TWF # gets on the list wtp 0 0 $WFW $WFH $FW # gets fullsize fi