feat(hyprlock): update

This commit is contained in:
2026-02-25 01:35:25 +01:00
parent 566513de78
commit 74dda82f24
10 changed files with 115 additions and 24 deletions

24
waybar/scripts/nowplaying.sh Executable file
View File

@@ -0,0 +1,24 @@
#!/bin/bash
CACHE="$HOME/.cache/waybar-cover.jpg"
TMP="$HOME/.cache/waybar-cover.tmp.jpg"
status=$(playerctl status 2>/dev/null)
if [ "$status" = "Playing" ]; then
artist=$(playerctl metadata artist)
title=$(playerctl metadata title)
url=$(playerctl metadata mpris:artUrl)
if [[ "$url" == file://* ]]; then
cp "${url#file://}" "$TMP"
else
curl -sL "$url" -o "$TMP"
fi
mv -f "$TMP" "$CACHE"
echo "{\"text\": \"$artist - $title\", \"tooltip\": \"$artist - $title\", \"class\": \"playing\", \"alt\": \"$CACHE\"}"
else
echo "{\"text\": \"󰐎 \", \"class\": \"stopped\"}"
fi