wms/wms_voyeur.sh
2024-02-26 01:32:24 -03:00

18 lines
459 B
Bash
Executable file
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/sh
## snooping on xorg window events and doing some things ##
## based on https://github.com/wmutils/contrib/blob/master/focus_watcher.sh ##
# wms_voyeur.sh by @root_informatica.
wew | while read ev wid args; do
case $ev in
MAP) # focus on mappng requests.
wattr o $wid || wms_focuser.sh -t
;;
UNMAP) # focus the top window in the servers window stack.
[ ! "$(pfw)" ] && wms_focuser.sh -t
;;
esac
done