Files
colorshell/eww/widgets/big-media.yuck
T

90 lines
3.2 KiB
Plaintext

(defwidget big-media [ show-album-bg show-album-image ?album-image-size ?style-background-color ?visible ]
(box :class "big-media ${ show-album-bg ? 'album-bg' : '' } ${ show-album-image ? 'album-image' : '' }"
:style "${ show-album-bg ? 'background-image: image(url(\"${json_media.artUrl}\"))' : '' } ${
style-background-color != '' ? 'background-color: ${style-background-color}' : '' }"
:visible { visible == "" ? true : "${ visible ? true : false }" }
:space-evenly false
:orientation "vertical"
(box :orientation "horizontal"
:space-evenly false
:class "media"
(box :class "album-image"
:width { album-image-size != "" ? album-image-size : 98 }
:height { album-image-size != "" ? "${album-image-size - 11}" : 87 }
:style "background-image: image(url('${json_media.artUrl}'));"
:valign "center"
:visible { show-album-image ? true : false })
(box :orientation "vertical"
:space-evenly false
:class "right"
:hexpand true
:valign "center"
(box :class "media-info"
:space-evenly false
:halign "fill"
:orientation "vertical"
(label :class "title"
:text "${json_media.title}"
:xalign 0
:wrap false
:hexpand true
:show-truncated true)
(label :class "artist"
:text "${json_media.artist}"
:xalign 0
:wrap false
:hexpand true
:show-truncated true)
)
(box :class "controls"
:orientation "horizontal"
:space-evenly false
:halign "start"
(box :class "button-row"
:orientation "horizontal"
:space-evenly false
:halign "start"
:visible { json_media.url != "null" ? true : false }
(button :class "url"
:onclick "wl-copy '${json_media.url}'"
:style "padding-right: 13px;"
:tooltip "Copy link to Clipboard"
"󰌷")
)
(box :class "button-row"
:orientation "horizontal"
:space-evenly false
:halign "start"
(button :class "shuffle"
:onclick "playerctl --player=${json_media.player} shuffle Toggle"
:tooltip "Toggle shuffle"
"󰒝")
(button :class "previous"
:onclick "playerctl --player=${json_media.player} previous"
:tooltip "Previous"
"󰒮")
(button :class "play-pause"
:onclick "playerctl --player=${json_media.player} play-pause"
:tooltip { json_media.status == "playing" ? "Pause" : "Play" }
{ json_media.status == "playing" ? "󰏤" : "󰐊" })
(button :class "next"
:onclick "playerctl --player=${json_media.player} next"
:tooltip "Next"
"󰒭")
)
)
)
)
)
)