ark/users/modules/eww/windows/music_win.yuck

54 lines
1.4 KiB
Plaintext
Raw Normal View History

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