wms/opt/wms_clearer.sh

32 lines
515 B
Bash
Executable File

#!/bin/sh
## clean screen ##
# wms_clearer.sh by @root_informatica.
. /tmp/wms_var
FLAG=$1
# fucused window.
FW=$(pfw)
# clearer atom.
CL=$(atomx WM_CL $FW)
# all maped windows.
AMW=$(lsw)
# unmaped widnows.
UW=$(atomx WM_CL $(lsw -u))
# if unmaped windows exist.
if [ -n "$UW" ]; then
# map them.
mapw -m $UW
# delete atom.
atomx -d WM_CL $UW
else # if no unmaped windows
# unmaped them and create atom.
for wid in $(lsw); do
atomx WM_CL=$wid $wid
done
mapw -u $AMW
fi