This commit is contained in:
2025-12-29 18:24:05 -05:00
parent 546f74ecc4
commit 395267f56c
5 changed files with 104 additions and 7 deletions

3
artist.sh Executable file
View File

@@ -0,0 +1,3 @@
#!/bin/sh
playerctl metadata --format 'by {{ artist }}' 2>/dev/null

View File

@@ -27,11 +27,46 @@
}
.clock-time {
font-size: 60px;
font-weight: 600;
font-size: 80px;
font-weight: 800;
}
.clock-date {
font-size: 20px;
}
.media {
background-color: rgba(0,0,0,0.25);
padding: 0px;
margin: 5px;
border-radius: 8px;
font-family: "Source Code Pro Black", monospace;
}
.media button {
background: none;
border: none;
font-size: 40px;
padding: 0px;
border-radius: 9px;
}
.media button:hover {
background-color: rgba(255, 255, 255, 0.08);
}
.media button:active {
background-color: rgba(255, 255, 255, 0.15);
}
.tlabel {
font-size: 18px;
}
.alabel {
font-size: 14px;
}
.notice {
font-size: 10px;
}

View File

@@ -60,9 +60,9 @@
(defwindow ports
:monitor 0
:geometry (geometry
:x "5%"
:y "5%"
:anchor "top left"
:x "32px"
:y "32px"
:anchor "top right"
:width "200px"
)
:stacking "bg"
@@ -76,7 +76,7 @@
(defpoll clock-date
:interval "60s"
"date '+%A %b %d'")
"date '+%A %B %d'")
(defwidget clock-widget []
(box
@@ -92,8 +92,53 @@
:x "32px"
:y "32px"
:anchor "bottom right"
:width "225px")
:width "300px")
:stacking "bg" ; appear behind other windows
:focusable false
(clock-widget))
(defpoll track :interval "2s"
"bash ~/.config/eww/title.sh")
(defpoll artist :interval "2s"
"bash ~/.config/eww/artist.sh")
(defpoll art :interval "2s"
"playerctl metadata mpris:artUrl 2>/dev/null \
| sed 's/^file:\\/\\///' \
| tr -d '\\n'")
(defwindow media_popup
:monitor 0
:geometry (geometry
:x "0px"
:y "40px"
:width "550px"
:height "80px"
:anchor "top center")
:exclusive false
:focusable false
:stacking "overlay"
(media-box :art art))
(defwidget media-box [art]
(box
; :class (list "media" playing_class)
:class "media"
:orientation "horizontal"
:space-evenly true
(image :path art :image-width 185 :image-height 185)
(box
:orientation "vertical"
(label :text track :class "tlabel")
(label :text artist :class "alabel")
(box
(button :onclick "playerctl previous" "⏮")
(button :onclick "playerctl play-pause" "⏯")
(button :onclick "playerctl next" "⏭")
)
(label :text "SUPER + M to close" :class "notice")
)
)
)

3
title.sh Executable file
View File

@@ -0,0 +1,3 @@
#!/bin/sh
playerctl metadata --format '{{ title }}' 2>/dev/null

11
toggle-media.sh Executable file
View File

@@ -0,0 +1,11 @@
#!/bin/sh
STATE="$HOME/.config/eww/media_open"
if [ -f "$STATE" ]; then
eww close media_popup
rm "$STATE"
else
eww open media_popup
touch "$STATE"
fi