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}')
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

View file

@ -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