replaced xdotool with i3 polling script for cpu reduction
parent
0758755dfa
commit
ec0e530958
@ -0,0 +1,14 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
# loops over i3 ipc events to prevent unnesecary polling
|
||||||
|
|
||||||
|
while :; do
|
||||||
|
# infinite loop
|
||||||
|
i3_msg=$(i3-msg -t SUBSCRIBE '[ "window" , "output" ]')
|
||||||
|
window=$(echo "$i3_msg" | gojq 'if .change == "focus" then .container.window_properties end | if .title == "tmux" then .title else .class end' | tr -d '"')
|
||||||
|
case "$window" in
|
||||||
|
'st-256color') echo 'st' ;;
|
||||||
|
'Brave-browser') echo 'Brave' ;;
|
||||||
|
*) echo "$window" ;;
|
||||||
|
esac
|
||||||
|
done
|
Binary file not shown.
Loading…
Reference in New Issue