Fix bar sizing

This commit is contained in:
elkowar 2021-08-12 16:38:49 +02:00
parent d81c401ce6
commit b6444af068
No known key found for this signature in database
GPG key ID: E321AD71B1D1F27F
2 changed files with 22 additions and 17 deletions

View file

@ -21,8 +21,14 @@ case "$1" in
speaker_sink_id=$(pamixer --list-sinks | grep "Komplete_Audio_6" | awk '{print $1}') 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}') game_sink_id=$(pamixer --list-sinks | grep "stereo-game" | awk '{print $1}')
case "$(pactl get-default-sink)" in case "$(pactl get-default-sink)" in
*Arctis_9*) pactl set-default-sink $speaker_sink_id;; *Arctis_9*)
*) pactl set-default-sink $game_sink_id ;; 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
;; ;;
esac esac

View file

@ -1,18 +1,14 @@
(defwidget bar [screen] (defwidget bar [screen]
(box :orientation "v" (centerbox :orientation "v"
(box (box :class "segment-top"
(box :valign "start" :valign "start"
:halign "fill" (top :screen screen))
:class "segment-top" (box :valign "center"
(top :screen screen))) :class "middle"
(box (middle))
(box :valign "center" (box :valign "end"
:class "middle" :class "segment-bottom"
(middle))) (bottom))))
(box
(box :valign "end"
:class "segment-bottom"
(bottom)))))
(defwidget top [] (defwidget top []
(workspaces :wsp_yuck {screen == 0 ? workspaces_0_yuck : screen == 1 ? workspaces_1_yuck : workspaces_2_yuck})) (workspaces :wsp_yuck {screen == 0 ? workspaces_0_yuck : screen == 1 ? workspaces_1_yuck : workspaces_2_yuck}))
@ -82,7 +78,10 @@
:halign "center" :halign "center"
day_word day month year)) 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 volume :initial "0" "./audio.sh volume")
(deflisten music_data (deflisten music_data