Skip to content

Instantly share code, notes, and snippets.

@dharmx
Created May 21, 2022 09:51
Show Gist options
  • Save dharmx/63b1d914fb377c46dc564392e2ccdd05 to your computer and use it in GitHub Desktop.
Save dharmx/63b1d914fb377c46dc564392e2ccdd05 to your computer and use it in GitHub Desktop.
EWW current window name example.
(deflisten node_events "./loop.zsh")
(defwindow test :geometry
(geometry :anchor "center" :width "500px" :height "50px")
(window-test))
(defwidget window-test [] (box :orientation "v" (label :text node_events)))
;; vim:ft=yuck
#!/usr/bin/env zsh
function window_name() {
local old="$(xdotool getwindowfocus getwindowname)"
print "$old"
while sleep 0.5; do
local new="$(xdotool getwindowfocus getwindowname)"
[ ! $old = $new ] && old="$new" && print "$old"
done
}
window_name
# vim:filetype=zsh
@dharmx
Copy link
Author

dharmx commented May 21, 2022

lol

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment