first commit arch

This commit is contained in:
[yuri]
2025-11-13 17:20:22 +01:00
parent f47d0af4c0
commit d9e0096812
420 changed files with 35001 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
#!/bin/sh
# credits
# https://github.com/NicholasFeldman/dotfiles/blob/master/polybar/.config/polybar/spotify.sh
main() {
if ! pgrep -x spotify >/dev/null; then
echo ""; exit
fi
cmd="org.freedesktop.DBus.Properties.Get"
domain="org.mpris.MediaPlayer2"
path="/org/mpris/MediaPlayer2"
meta=$(dbus-send --print-reply --dest=${domain}.spotify \
/org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get string:${domain}.Player string:Metadata)
artist=$(echo "$meta" | sed -nr '/xesam:artist"/,+2s/^ +string "(.*)"$/\1/p' | tail -1 | sed "s/\&/+/g")
album=$(echo "$meta" | sed -nr '/xesam:album"/,+2s/^ +variant +string "(.*)"$/\1/p' | tail -1)
title=$(echo "$meta" | sed -nr '/xesam:title"/,+2s/^ +variant +string "(.*)"$/\1/p' | tail -1 | sed "s/\&/+/g")
echo "${*:-%artist% - %title%}" | sed "s/%artist%/$artist/g;s/%title%/$title/g;s/%album%/$album/g"i | sed 's/&/\\&/g'
}
main "$@"