38 lines
1.6 KiB
Plaintext
38 lines
1.6 KiB
Plaintext
; Music vars
|
|
(deflisten music_metadata "scripts/music listen-metadata")
|
|
(deflisten music_position "scripts/music listen-position")
|
|
(deflisten music_status "scripts/music listen-status")
|
|
|
|
; Music
|
|
(defwidget music []
|
|
(box :class "genwin" :orientation "h" :space-evenly "false" :vexpand "false" :hexpand "false"
|
|
(box :class "album_art" :vexpand "false" :hexpand "false" :style "background-image: url('${music_metadata.arturl}');")
|
|
(box :orientation "v" :spacing 20 :space-evenly "false" :vexpand "false" :hexpand "false"
|
|
(label :halign "center" :class "song" :wrap "true" :limit-width 20 :text "${music_metadata.title}")
|
|
(label :halign "center" :class "artist" :wrap "true" :limit-width 15 :text "${music_metadata.artist}")
|
|
(box :orientation "h" :spacing 20 :halign "center" :space-evenly "true" :vexpand "false" :hexpand "false"
|
|
(button :class "btn_prev" :onclick "playerctl previous" "")
|
|
(button :class "btn_play" :onclick "playerctl play-pause" {"${music_status.status}" == "Playing" ? "" : ""})
|
|
(button :class "btn_next" :onclick "playerctl next" "")
|
|
)
|
|
(box :class "music_bar" :halign "center" :state "progress"
|
|
(scale
|
|
:onscroll "playerctl position {}"
|
|
:onclick "playerctl position {}"
|
|
:min 0
|
|
:max "${music_metadata.length}"
|
|
:active true
|
|
:hexpand true
|
|
:vexpand true
|
|
:value "${music_position.position}"
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
|
|
; music
|
|
(defwindow music :stacking "fg" :focusable "false" :screen 1 :monitor 0
|
|
:geometry (geometry :x 100 :y 100 :width 610 :height 280)
|
|
(music))
|