wms/wms_clearer.sh

22 lines
472 B
Bash
Raw Normal View History

2023-03-07 02:55:30 +01:00
#!/bin/sh
2023-03-07 14:01:29 +01:00
## clean screen ##
2023-03-20 02:46:41 +01:00
. $HOME/.config/wms/wms_var
2023-03-07 02:55:30 +01:00
2023-03-14 03:29:50 +01:00
FLAG=$1
2023-03-17 20:19:07 +01:00
FW=$(pfw) # focused window
CL=$(atomx WM_CL $FW) # clearrer atom
UW=$(atomx WM_CL $(lsw -u)) # unmaped windows
2023-03-14 03:29:50 +01:00
2023-03-17 20:19:07 +01:00
if [ -n "$UW" ]; then # if unmaped windows
mapw -m $UW # map them
2023-03-28 06:24:25 +02:00
atomx -d WM_CL $UW # delete atom
2023-03-14 03:29:50 +01:00
2023-03-17 20:19:07 +01:00
else # if no unmaped windows
2023-03-14 03:29:50 +01:00
for wid in $(lsw); do
2023-03-15 05:40:44 +01:00
atomx WM_CL=$wid $wid
2023-03-14 03:29:50 +01:00
mapw -u $wid
2023-03-17 20:19:07 +01:00
done # unmap the maped windows
2023-03-14 03:29:50 +01:00
fi