2022-10-16 22:41:38 +02:00
|
|
|
(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%),
|
2023-04-23 18:55:30 +02:00
|
|
|
url('${media-player_metadata_image}');"
|
2022-10-16 22:41:38 +02:00
|
|
|
(box :orientation "v"
|
|
|
|
(box :class "title"
|
|
|
|
:halign "start"
|
2023-04-23 18:55:30 +02:00
|
|
|
{media-player_metadata.title}
|
2022-10-16 22:41:38 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
(box :class "artist"
|
|
|
|
:halign "start"
|
2023-04-23 18:55:30 +02:00
|
|
|
{media-player_metadata.artist}
|
2022-10-16 22:41:38 +02:00
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
(box :class "buttons"
|
|
|
|
:valign "end"
|
|
|
|
:orientation "h"
|
|
|
|
:space-evenly true
|
|
|
|
:spacing 50
|
|
|
|
(eventbox :class "previous"
|
|
|
|
:width 40
|
|
|
|
:onclick "playerctl previous"
|
2023-10-30 14:49:11 +01:00
|
|
|
""
|
2022-10-16 22:41:38 +02:00
|
|
|
)
|
|
|
|
(eventbox :class "pause"
|
|
|
|
:width 40
|
|
|
|
:onclick "playerctl play-pause"
|
2023-10-30 14:49:11 +01:00
|
|
|
{media-player_status == "Playing" ? "" : ""}
|
2022-10-16 22:41:38 +02:00
|
|
|
)
|
|
|
|
(eventbox :class "next"
|
|
|
|
:width 40
|
|
|
|
:onclick "playerctl next"
|
2023-10-30 14:49:11 +01:00
|
|
|
""
|
2022-10-16 22:41:38 +02:00
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
(defwidget audio-title []
|
|
|
|
(box :class "audio-title"
|
|
|
|
:valign "start"
|
|
|
|
"Audio"
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
2023-04-23 18:55:30 +02:00
|
|
|
(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})
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
2022-10-16 22:41:38 +02:00
|
|
|
(defwidget audio-window []
|
|
|
|
(box :class "audio"
|
|
|
|
:orientation "v"
|
|
|
|
:space-evenly false
|
2023-04-23 18:55:30 +02:00
|
|
|
;; TODO: Maybe individual applications as well.
|
|
|
|
(box :orientation "h"
|
|
|
|
(media-player)
|
|
|
|
(box
|
|
|
|
;; TODO: Put something here
|
|
|
|
)
|
|
|
|
)
|
|
|
|
(box :orientation "h"
|
|
|
|
(audio-sinks)
|
|
|
|
(audio-sources)
|
|
|
|
)
|
2022-10-16 22:41:38 +02:00
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
(defwindow audio
|
|
|
|
:monitor 2
|
2023-04-23 18:55:30 +02:00
|
|
|
:geometry (geometry :x "10px"
|
|
|
|
:y "10px"
|
|
|
|
:width "1060"
|
|
|
|
:height "500px"
|
|
|
|
:anchor "top center")
|
|
|
|
:stacking "overlay"
|
|
|
|
:exclusive false
|
2022-10-16 22:41:38 +02:00
|
|
|
(audio-window)
|
|
|
|
)
|