dotfiles/eww/volume.yuck

102 lines
2.4 KiB
Plaintext

(defwidget media-player []
(box :class "media-player"
:orientation "v"
:height 200
:style "background-image: radial-gradient(
circle farthest-side at left,
rgba(0, 0, 0, 0.9) 40%,
rgba(0, 0, 0, 0.2) 70%),
url('${media-player_metadata_image}');"
(box :orientation "v"
(box :class "title"
:halign "start"
{media-player_metadata.title}
)
(box :class "artist"
:halign "start"
{media-player_metadata.artist}
)
)
(box :class "buttons"
:valign "end"
:orientation "h"
:space-evenly true
:spacing 50
(eventbox :class "previous"
:width 40
:onclick "playerctl previous"
"玲"
)
(eventbox :class "pause"
:width 40
:onclick "playerctl play-pause"
{media-player_status == "Playing" ? "" : "契"}
)
(eventbox :class "next"
:width 40
:onclick "playerctl next"
"怜"
)
)
)
)
(defwidget audio-title []
(box :class "audio-title"
:valign "start"
"Audio"
)
)
(defwidget audio-sinks []
(box :orientation "v" :class "audio-sinks" :space-evenly false
(title :content "Sinks")
{audio_sink_default ? "" : ""} ;; This is dumb, but fixes this variable not updating
(for sink in audio-sinks
(audio-sink :sink {sink})
)
)
)
(defwidget audio-sources []
(box :orientation "v" :class "audio-sources" :space-evenly false
(title :content "Sources")
{audio_source_default ? "" : ""} ;; This is dumb, but fixes this variable not updating
(for source in audio-sources
(audio-source :source {source})
)
)
)
(defwidget audio-window []
(box :class "audio"
:orientation "v"
:space-evenly false
;; TODO: Maybe individual applications as well.
(box :orientation "h"
(media-player)
(box
;; TODO: Put something here
)
)
(box :orientation "h"
(audio-sinks)
(audio-sources)
)
)
)
(defwindow audio
:monitor 2
:geometry (geometry :x "10px"
:y "10px"
:width "1060"
:height "500px"
:anchor "top center")
:stacking "overlay"
:exclusive false
(audio-window)
)