updated hyprlock

This commit is contained in:
2026-04-02 13:46:16 +02:00
parent eadaaa5d52
commit 74945d45e9
4 changed files with 140 additions and 47 deletions
+13
View File
@@ -0,0 +1,13 @@
#!/bin/bash
status=$(playerctl status 2>/dev/null)
if [ "$status" = "Playing" ] || [ "$status" = "Paused" ]; then
title=$(playerctl metadata title | sed 's/&/\&amp;/g; s/</\&lt;/g; s/>/\&gt;/g')
artist=$(playerctl metadata artist | sed 's/&/\&amp;/g; s/</\&lt;/g; s/>/\&gt;/g')
if [ ${#title} -gt 25 ]; then title="${title:0:22}..."; fi
if [ ${#artist} -gt 25 ]; then artist="${artist:0:22}..."; fi
echo "<span weight='bold' foreground='#cba6f7'>$title</span>"
echo "<span foreground='#bac2de' size='small'>$artist</span>"
else
echo "<span weight='bold' foreground='#cdd6f4'>No Media</span>"
echo "<span size='small' foreground='#a6adc8'>Idling</span>"
fi