wms/opt/wms_clearer.sh
2024-02-22 00:31:42 -03:00

31 lines
476 B
Bash
Executable file

#!/bin/sh
## clean screen ##
. /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