wms/rwm_backgroundize.sh

39 lines
836 B
Bash
Raw Normal View History

2023-03-07 02:55:30 +01:00
#!/bin/sh
. $HOME/.wmvar
FLAG=$1
FW=$(pfw) # focused window
usage() {
echo "usage:
nowm_ignore.sh [ -i, -u ]
-i) ignore focused window
-u) open menu and choose the window/s to unignore"
}
case $FLAG in
-i) # ignore
if [ ! "$(wattr o $(pfw) && echo 1)" ]; then # if override is not set
ignw -s $FW # ignore focused window
chwb -c $IGNORED $FW # change border color to ignore
else
ignw -r $FW # unignore focused window
chwb -c $ACTIVE $FW # change border color to active
fi
;;
-u) # unignore
if [ -n "$(lsw -o)" ]; then
otarget=$(for wid in $(lsw -o); do # override target
printf '%s\n' "$wid | $(atomx WM_CLASS $wid) | $(wname $wid)"
done | cut -c 1-100 | $XMENU | cut -d ' ' -f 1)
ignw -r $otarget # unignore otarget
fi
;;
*)
usage
;;
esac