57 lines
1.8 KiB
Plaintext
57 lines
1.8 KiB
Plaintext
;; Music Variables
|
|
(defpoll art :interval "0s" "~/.config/polybar/widgets/MusicPlayer/MediaControl coverloc")
|
|
(defpoll title :interval "0s" "~/.config/polybar/widgets/MusicPlayer/MediaControl title")
|
|
(defpoll artist :interval "0s" "~/.config/polybar/widgets/MusicPlayer/MediaControl artist")
|
|
(defpoll album :interval "0s" "~/.config/polybar/widgets/MusicPlayer/MediaControl album")
|
|
(defpoll playpause :interval "0s" "~/.config/polybar/widgets/MusicPlayer/MediaControl statusicon")
|
|
(defpoll songtime :interval "0s" "~/.config/polybar/widgets/MusicPlayer/MediaControl percent")
|
|
|
|
;; Music Widgets
|
|
(defwidget music []
|
|
(box :class "music-player"
|
|
:orientation "v"
|
|
:space-evenly "false"
|
|
:halign "center"
|
|
(box :class "album_art"
|
|
:style "background-image: url('${art}');")
|
|
(box :orientation "v"
|
|
:space-evenly "false"
|
|
:halign "center"
|
|
:spacing 10
|
|
(label :class "artist"
|
|
:limit-width 15
|
|
:text artist)
|
|
(label :class "song"
|
|
:limit-width 20
|
|
:text title)
|
|
(box :orientation "h"
|
|
:space-evenly "false"
|
|
:halign "center"
|
|
:spacing 30
|
|
(button :class "btn_prev" :onclick "~/.config/polybar/widgets/MusicPlayer/MediaControl --previous" "ﭣ")
|
|
(button :class "btn_play" :onclick "~/.config/polybar/widgets/MusicPlayer/MediaControl --toggle" playpause)
|
|
(button :class "btn_next" :onclick "~/.config/polybar/widgets/MusicPlayer/MediaControl --next" "ﭡ"))
|
|
(box :orientation "h"
|
|
:class "metric-player"
|
|
:space-evenly "false"
|
|
(scale :min 0
|
|
:max 101
|
|
:active "false"
|
|
:value {songtime != "" ? "${songtime}" : "0"}
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
|
|
|
|
;windows
|
|
|
|
(defwindow music
|
|
:geometry (geometry :x "-470px"
|
|
:y "-45px"
|
|
:width "18%"
|
|
:height "30%"
|
|
:anchor "bottom right")
|
|
(music))
|