summaryrefslogtreecommitdiff
path: root/.config/eww/bar.yuck
diff options
context:
space:
mode:
Diffstat (limited to '.config/eww/bar.yuck')
-rw-r--r--.config/eww/bar.yuck46
1 files changed, 24 insertions, 22 deletions
diff --git a/.config/eww/bar.yuck b/.config/eww/bar.yuck
index a691155..d6bfc28 100644
--- a/.config/eww/bar.yuck
+++ b/.config/eww/bar.yuck
@@ -3,7 +3,7 @@
(defpoll song :initial "" :interval "5s" `rmpc song`)
(deflisten cava :initial "" `cava -p ~/.config/eww/cava.ini | python3 ~/.config/eww/cava.py`)
-(defwindow bar
+(defwindow bar [output]
:monitor 0
:geometry (geometry :x "0%"
:y "8px"
@@ -13,30 +13,32 @@
:stacking "fg"
:exclusive true
:focusable false
- (bar))
+ (bar :output output))
-(defwidget bar []
+(defwidget bar [output]
(centerbox :orientation "h"
:class "bar"
- (tags)
- (center)
+ (tags :output output)
+ (music)
(status)))
-(defwidget tags []
+(defwidget tags [output]
(box :orientation "h"
:halign "start"
:class "tags"
(for tag in "[1, 2, 3, 4, 5, 6, 7, 8, 9]"
(button :onclick `riverctl set-focused-tags $(dc -e"2 ${tag} 1- ^p")`
- :class {jq(tags_json, `.[] | select(.id == ${tag}) | {focused, occupied} | to_entries | map(select(.value) | .key) | join(" ") | {"class": .}`).class}))))
+ :class {jq(tags_json, `.[] | select(.output == "${output}" and .id == ${tag}) | {focused, occupied} | to_entries | map(select(.value) | .key) | join(" ") | {"class": .}`).class}))))
-
-(defwidget center []
+(defwidget music []
(box :orientation "h"
:spacing 4
:space-evenly false
:class "music"
- (label :text "${song.metadata.artist} - ${song.metadata.title}" :class "song")
+ (label :text "${song.metadata.artist} - ${song.metadata.title}"
+ :class "song"
+ :show-truncated true
+ :limit-width 55)
(label :text {cava} :class "cava")))
@@ -60,18 +62,18 @@
:class "status"
:spacing 8
:space-evenly false
- (revealer-on-hover :var showvol
- :varname "showvol"
- :icon "a"
- :transition "slideleft"
- :class "volume"
- (scale :orientation "h"
- :min 0
- :max 1
- :value {volume}
- :onchange `wpctl set-volume @DEFAULT_SINK@ {}`)
- (label :text "${matches(volume, "MUTED") ? " " : volume == 0 ? "" : volume < 50 ? "" : " "} ${volume}%"
- :class "volume"))
+ ;(revealer-on-hover :var showvol
+ ;:varname "showvol"
+ ;:icon "a"
+ ;:transition "slideleft"
+ ;:class "volume"
+ ;(scale :orientation "h"
+ ;:min 0
+ ;:max 1
+ ;:value {volume}
+ ;:onchange `wpctl set-volume @DEFAULT_SINK@ {}`)
+ (label :text "${matches(volume, "MUTED") ? " " : volume == 0 ? "" : volume < 50 ? "" : " "} ${volume}%"
+ :class "volume")
(label :text "${ssid == "" ? "󰖪" : "󰖩"} ${ssid}"
:class "network")
(label :text " ${brightness}%"