diff --git a/crates/eww/src/app.rs b/crates/eww/src/app.rs index 99e7692..05b4f6d 100644 --- a/crates/eww/src/app.rs +++ b/crates/eww/src/app.rs @@ -203,7 +203,8 @@ impl App { self.open_windows .remove(window_name) - .with_context(|| format!("Tried to close window named '{}', but no such window was open", window_name))?; + .with_context(|| format!("Tried to close window named '{}', but no such window was open", window_name))? + .close(); self.eww_state.clear_window_state(window_name); diff --git a/examples/eww-bar/eww.yuck b/examples/eww-bar/eww.yuck index 346661c..7593ed6 100644 --- a/examples/eww-bar/eww.yuck +++ b/examples/eww-bar/eww.yuck @@ -38,7 +38,7 @@ :orientation "h" :space-evenly false :halign "center" - '🎵${music}')) + {music != "" ? "🎵${music}" : ""})) (defwidget metric [label value onchange] @@ -54,8 +54,8 @@ -(defpoll music :interval "5s" - "playerctl metadata --format '{{ artist }} - {{ title }}' || true") +(deflisten music :initial "" + "playerctl --follow metadata --format '{{ artist }} - {{ title }}' || true") (defpoll volume :interval "1s" "scripts/getvol") @@ -66,6 +66,10 @@ (defwindow bar :monitor 0 :windowtype "dock" - :geometry (geometry :x "0%" :y "0%" :width "100%" :height "4%") + :geometry (geometry :x "0%" + :y "0%" + :width "90%" + :height "10px" + :anchor "top center") :reserve (struts :side "top" :distance "4%") (bar))