ark/users/modules/eww/windows/music_win.yuck
2022-10-04 02:08:44 +03:00

54 lines
1.4 KiB
Plaintext

(defwidget music_window []
(box
:class "music-window"
(box
:class "music-cover-art"
:style "background-image: url(\"${music_cover}\");")
(box
:orientation "v"
:class "music-box"
(label
:class "music-title"
:limit-width 18
:text {music.title})
(label
:class "music-artist"
:wrap "true"
:limit-width 30
:text {music.artist})
(centerbox
:halign "center"
:class "music-button-box"
(button :class "music-button" :onclick "playerctl previous" "")
(button :class "music-button" :onclick "playerctl play-pause" {music.status})
(button :class "music-button" :onclick "playerctl next" ""))
(box
:orientation "v"
(centerbox
(label
:xalign 0
:class "music-time"
:text {music.position_time})
(label)
(label
:xalign 1
:class "music-time"
:text {music.length}))
(box
:class "music-bar"
(scale
:onchange "playerctl position `bc <<< \"{} * $(playerctl metadata mpris:length) / 1000000 / 100\"`"
:value {music.position}))))))
(defwindow music_win
:stacking "fg"
:focusable "false"
:monitor 0
:geometry (geometry
:x "0%"
:y "0%"
:width "0%"
:height "0%"
:anchor "top center")
(music_window))