38 lines
836 B
Bash
Executable file
38 lines
836 B
Bash
Executable file
#!/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
|