From 2f17e369400b9c895b3554008ab3efbc76255428 Mon Sep 17 00:00:00 2001 From: Caroline Larimore Date: Thu, 25 Jul 2024 22:52:20 -0700 Subject: roles: home: migrate old home module to roles --- roles/home/desktop/eww/windows/music.yuck | 86 +++++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 roles/home/desktop/eww/windows/music.yuck (limited to 'roles/home/desktop/eww/windows') diff --git a/roles/home/desktop/eww/windows/music.yuck b/roles/home/desktop/eww/windows/music.yuck new file mode 100644 index 0000000..91ee05f --- /dev/null +++ b/roles/home/desktop/eww/windows/music.yuck @@ -0,0 +1,86 @@ +(defwindow music [pos gaps] + :monitor "" + :geometry (geometry + :x { + pos == "right" + ? gaps == "true" + ? "-8px" : "2px" + : "0px" + } + :y { gaps == "true" ? "-8px" : "2px" } + :height {128 + 16} + :anchor { pos == "right" ? "bottom right" : "bottom center" } + ) + :stacking "fg" + :windowtype "dock" + :wm-ignore true + + (box :class "main" + :orientation "h" + :spacing 8 + :space-evenly false + :height {128 + 16} + + (image + :path song-cover + :image-width 128 + :image-height 128 + ) + + (box :class "left" + :orientation "v" + :spacing 0 + :space-evenly true + :hexpand true + + (box :class "info" + :orientation "v" + :space-evenly false + :valign "center" + + (label :class "song-title" + :text {song.title} + :halign "start" + ) + (label :class "song-album" + :text {song.album} + :halign "start" + ) + (label :class "song-artist" + :text {song.artist} + :halign "start" + ) + ) + + (box :class "control" + :space-evenly false + :halign "center" + :valign "end" + + (button + :onclick `playerctl --player=cmus,firefox,%any previous` + "󰒮" + ) + (button + :onclick `playerctl --player=cmus,firefox,%any play-pause` + { song.status == "Playing" ? "󰏤" : "󰐊" } + ) + (button + :onclick `playerctl --player=cmus,firefox,%any next` + "󰒭" + ) + + ; Offset controls to center of screen + (box :width {128 + 8}) + ) + ) + ) +) + +(deflisten song-cover + `playerctl --player=cmus,firefox,%any -F metadata title | get-album-art` +) + +(deflisten song + `playerctl --player=cmus,firefox,%any -F metadata --format='{"title": "{{title}}", "album": "{{album}}", "artist": "{{artist}}", "status": "{{status}}"}'` +) \ No newline at end of file -- cgit v1.2.3