wms/wms_clearer.sh

31 lines
476 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
2024-01-21 04:05:04 +01:00
# fucused window.
FW=$(pfw)
# clearer atom.
CL=$(atomx WM_CL $FW)
# all maped windows.
AMW=$(lsw)
# unmaped widnows.
UW=$(atomx WM_CL $(lsw -u))
2023-03-14 03:29:50 +01:00
2024-01-21 04:05:04 +01:00
# if unmaped windows exist.
if [ -n "$UW" ]; then
# map them.
mapw -m $UW
# delete atom.
atomx -d WM_CL $UW
2023-03-14 03:29:50 +01:00
2024-01-21 04:05:04 +01:00
else # if no unmaped windows
# unmaped them and create atom.
for wid in $(lsw); do
atomx WM_CL=$wid $wid
done
mapw -u $AMW
2023-03-14 03:29:50 +01:00
fi