feat(hyprlock): update
This commit is contained in:
@@ -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