wms/wms_voyeur.sh

19 lines
459 B
Bash
Raw Permalink Normal View History

2023-03-06 19:08:25 +01:00
#!/bin/sh
2023-03-07 14:01:29 +01:00
## snooping on xorg window events and doing some things ##
2024-02-26 05:32:24 +01:00
## based on https://github.com/wmutils/contrib/blob/master/focus_watcher.sh ##
# wms_voyeur.sh by @root_informatica.
2023-03-07 14:01:29 +01:00
2023-03-06 19:08:25 +01:00
wew | while read ev wid args; do
case $ev in
2024-02-22 04:31:42 +01:00
MAP) # focus on mappng requests.
wattr o $wid || wms_focuser.sh -t
2023-03-06 19:08:25 +01:00
;;
2024-02-22 04:31:42 +01:00
UNMAP) # focus the top window in the servers window stack.
[ ! "$(pfw)" ] && wms_focuser.sh -t
2023-03-06 19:08:25 +01:00
;;
esac
done
2024-02-22 04:31:42 +01:00