wms/wms_clearer.sh

23 lines
514 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-08-08 04:42:24 +02:00
. /tmp/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
2023-04-01 06:12:32 +02:00
AMW=$(lsw) # all maped windows
2023-03-17 20:19:07 +01:00
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-04-03 05:29:42 +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-04-03 05:29:42 +02:00
done # create atom
mapw -u $AMW # unmap windows
2023-03-14 03:29:50 +01:00
fi