feat(hyprlock): update
This commit is contained in:
@@ -18,4 +18,6 @@ exec-once = ~/.config/hypr/scripts/cover-listener.sh
|
||||
exec-once = gsettings set org.gnome.desktop.interface gtk-theme 'adw-gtk3-dark'
|
||||
exec-once = gsettings set org.gnome.desktop.interface color-scheme 'prefer-dark'
|
||||
|
||||
exec-once = curl -s https://zenquotes.io/api/random > ~/.cache/quote.json
|
||||
|
||||
exec-once = seafile-applet
|
||||
|
||||
@@ -85,22 +85,22 @@ image {
|
||||
|
||||
label {
|
||||
monitor =
|
||||
text = cmd[update:1000] playerctl metadata artist
|
||||
text = cmd[update:1000] playerctl metadata title || jq -r '.[0].q' ~/.cache/quote.json
|
||||
color = rgba(242, 243, 244, 0.8)
|
||||
font_size = 14
|
||||
font_family = Lexend Bold
|
||||
position = 0, -300
|
||||
font_size = 14
|
||||
font_family = Lexend
|
||||
position = 0, -270
|
||||
halign = center
|
||||
valign = center
|
||||
}
|
||||
|
||||
label {
|
||||
monitor =
|
||||
text = cmd[update:1000] playerctl metadata title
|
||||
text = cmd[update:1000] playerctl metadata artist || jq -r '.[0].a' ~/.cache/quote.json
|
||||
color = rgba(242, 243, 244, 0.8)
|
||||
font_size = 14
|
||||
font_family = Lexend
|
||||
position = 0, -270
|
||||
font_size = 14
|
||||
font_family = Lexend Bold
|
||||
position = 0, -300
|
||||
halign = center
|
||||
valign = center
|
||||
}
|
||||
|
||||
@@ -1,15 +1,23 @@
|
||||
#!/bin/bash
|
||||
|
||||
CACHE="$HOME/.cache/nowplaying-cover.jpg"
|
||||
TMP="$HOME/.cache/nowplaying-cover.tmp.jpg"
|
||||
|
||||
url=$(playerctl metadata mpris:artUrl 2>/dev/null)
|
||||
status=$(playerctl status 2>/dev/null)
|
||||
|
||||
# Kein Player aktiv
|
||||
[ -z "$url" ] && exit 0
|
||||
|
||||
# file:// prefix entfernen (Spotify lokal)
|
||||
if [[ "$url" == file://* ]]; then
|
||||
cp "${url#file://}" "$CACHE"
|
||||
else
|
||||
curl -sL "$url" -o "$CACHE"
|
||||
if [ "$status" != "Playing" ]; then
|
||||
rm -f "$CACHE"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
url=$(playerctl metadata mpris:artUrl)
|
||||
|
||||
[ -z "$url" ] && rm -f "$CACHE" && exit 0
|
||||
|
||||
if [[ "$url" == file://* ]]; then
|
||||
cp "${url#file://}" "$TMP"
|
||||
else
|
||||
curl -sL "$url" -o "$TMP"
|
||||
fi
|
||||
|
||||
mv -f "$TMP" "$CACHE"
|
||||
|
||||
Reference in New Issue
Block a user