From b6444af0688dd0a99ba6782f7d4ca54c217cc662 Mon Sep 17 00:00:00 2001 From: elkowar <5300871+elkowar@users.noreply.github.com> Date: Thu, 12 Aug 2021 16:38:49 +0200 Subject: [PATCH] Fix bar sizing --- eww-bar/.config/eww-bar/audio.sh | 10 ++++++++-- eww-bar/.config/eww-bar/eww.yuck | 29 ++++++++++++++--------------- 2 files changed, 22 insertions(+), 17 deletions(-) diff --git a/eww-bar/.config/eww-bar/audio.sh b/eww-bar/.config/eww-bar/audio.sh index 8712cda..273ee76 100755 --- a/eww-bar/.config/eww-bar/audio.sh +++ b/eww-bar/.config/eww-bar/audio.sh @@ -21,8 +21,14 @@ case "$1" in speaker_sink_id=$(pamixer --list-sinks | grep "Komplete_Audio_6" | awk '{print $1}') game_sink_id=$(pamixer --list-sinks | grep "stereo-game" | awk '{print $1}') case "$(pactl get-default-sink)" in - *Arctis_9*) pactl set-default-sink $speaker_sink_id;; - *) pactl set-default-sink $game_sink_id ;; + *Arctis_9*) + eww -c ~/.config/eww-bar update audio_sink="" + pactl set-default-sink $speaker_sink_id + ;; + *) + eww -c ~/.config/eww-bar update audio_sink="" + pactl set-default-sink $game_sink_id + ;; esac ;; esac diff --git a/eww-bar/.config/eww-bar/eww.yuck b/eww-bar/.config/eww-bar/eww.yuck index e2783d1..ef2f18d 100644 --- a/eww-bar/.config/eww-bar/eww.yuck +++ b/eww-bar/.config/eww-bar/eww.yuck @@ -1,18 +1,14 @@ (defwidget bar [screen] - (box :orientation "v" - (box - (box :valign "start" - :halign "fill" - :class "segment-top" - (top :screen screen))) - (box - (box :valign "center" - :class "middle" - (middle))) - (box - (box :valign "end" - :class "segment-bottom" - (bottom))))) + (centerbox :orientation "v" + (box :class "segment-top" + :valign "start" + (top :screen screen)) + (box :valign "center" + :class "middle" + (middle)) + (box :valign "end" + :class "segment-bottom" + (bottom)))) (defwidget top [] (workspaces :wsp_yuck {screen == 0 ? workspaces_0_yuck : screen == 1 ? workspaces_1_yuck : workspaces_2_yuck})) @@ -82,7 +78,10 @@ :halign "center" day_word day month year)) -(deflisten audio_sink "./audio.sh symbol") +; TODO make this not hacky + +(defvar audio_sink "") + (deflisten volume :initial "0" "./audio.sh volume") (deflisten music_data