eww: add floating media popup on bar media click

This commit is contained in:
retrozinndev
2024-12-20 15:46:04 -03:00
parent b0d61250e8
commit 5bc04e4dff
13 changed files with 224 additions and 163 deletions
+78 -50
View File
@@ -1,58 +1,86 @@
(defwidget big-media [ album_background ]
(box :orientation "horizontal"
:space-evenly false
:class "big-media ${ album_background == true ? 'album-bg' : '' }"
:style { album_background == true ? "background-image: image(url('${json_media.artUrl}'))" : "" }
(defwidget big-media [ album-background ?player-info ]
(box :class "big-media ${ album-background == true ? 'album-bg' : '' }"
:style { album-background == true ? "background-image: image(url('${json_media.artUrl}'))" : "" }
:visible { json_media.title != "null" && json_media.artist != "null" ? true : false }
:space-evenly false
:orientation "vertical"
(box :class "album-image"
:width 98
:height 87
:style "background-image: image(url('${json_media.artUrl}'));"
:valign "center")
(box :orientation "horizontal"
:space-evenly false
:class "media"
(box :orientation "vertical"
(box :class "album-image"
:width 98
:height 87
:style "background-image: image(url('${json_media.artUrl}'));"
:valign "center")
(box :orientation "vertical"
:space-evenly false
:class "right"
:hexpand true
(box :class "media-info"
:space-evenly false
:class "right"
:hexpand true
:halign "fill"
:orientation "vertical"
(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 button-row"
:orientation "horizontal"
:space-evenly false
:halign "start"
(button :class "shuffle"
:onclick "playerctl --player=${json_media.player} shuffle Toggle"
"󰒝")
(button :class "previous"
:onclick "playerctl --player=${json_media.player} previous"
"󰒮")
(button :class "play-pause"
:onclick "playerctl --player=${json_media.player} play-pause"
{ json_media.status == "playing" ? "󰏤" : "󰐊" })
(button :class "next"
:onclick "playerctl --player=${json_media.player} next"
"󰒭")
)
(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"
"󰒭")
)
)
)
)
)
)
@@ -21,8 +21,7 @@
:image "${notification.app-icon.data}"
:summary "${notification.summary.data}"
:body "${notification.body.data}"
;:onclickclose "dunstctl history-rm ${notification.id.data}" ; needs fix
:onclick "makoctl invoke -n ${notification.id.data}"
:onclick "makoctl invoke -n ${notification.id.data} view"
:icon "${notification.app-name.data}"
)
)