replaced xdotool with i3 polling script for cpu reduction

nvim
spinach 2 years ago
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

@ -3,3 +3,8 @@ L3
Pset
Kalynn
Appt
EPR
S983
Airpods
swiffer
postlab

@ -23,8 +23,9 @@ exec --no-startup-id xss-lock --transfer-sleep-lock -- i3lock-blur --nofork
# auto starting default applications
# assign [class="st-256color"] 1
# assign [title="startup-browser"] 2
for_window [instance="startup-tmux"] move to workspace $ws1
exec --no-startup-id i3-msg "workspace 1; exec st -e tmux"
exec --no-startup-id exec st -n 'startup-tmux'-e tmux
exec --no-startup-id i3-msg "workspace 2; exec brave"
# Use pactl to adjust volume in PulseAudio.

@ -46,7 +46,7 @@ inherit = section/base-bar
; height
height = 24pt
; modules
modules-left = xworkspaces focus spotify spotify-len todo
modules-left = xworkspaces focus-fast spotify spotify-len todo
;modules-left = xworkspaces spotify spotify-len
modules-center = weather-desktop
modules-right = pulseaudio memory cpu temperature eth dev-bat seafile calendar-sync bg-selector quotes date powermenu
@ -88,6 +88,12 @@ type = custom/script
interval = 0.2
exec = ~/.dotfiles/bin/focus_class
[module/focus-fast]
; correct title size
type = custom/script
tail = true
exec = ~/.dotfiles/bin/i3-focus.sh
[module/pulseaudio]
type = internal/pulseaudio

Loading…
Cancel
Save