eww: dashboard(fake) & spotify player

This commit is contained in:
2025-06-18 13:46:51 +02:00
parent 514cbdabfc
commit 285f7a37b7
37 changed files with 1417 additions and 25 deletions

43
eww/Main/scripts/music-title Executable file
View File

@@ -0,0 +1,43 @@
#!/bin/bash
# Set the source audio player here.
# Players supporting the MPRIS spec are supported.
# Examples: spotify, vlc, chrome, mpv and others.
# Use `playerctld` to always detect the latest player.
# See more here: https://github.com/altdesktop/playerctl/#selecting-players-to-control
PLAYER="playerctld"
# Format of the information displayed
# Eg. {{ artist }} - {{ album }} - {{ title }}
# See more attributes here: https://github.com/altdesktop/playerctl/#printing-properties-and-metadata
FORMAT="{{ title }}"
PLAYERCTL_STATUS=$(playerctl --player=$PLAYER status 2>/dev/null)
EXIT_CODE=$?
if [ $EXIT_CODE -eq 0 ]; then
STATUS=$PLAYERCTL_STATUS
else
STATUS="Nothing is playing"
fi
if [ "$1" == "--status" ]; then
if [ "$STATUS" = "Stopped" ]; then
echo "Nothing is playing"
elif [ "$STATUS" = "Paused" ]; then
playerctl --player=$PLAYER metadata --format "$FORMAT"
elif [ "$STATUS" = "Nothing is playing" ]; then
echo "$STATUS"
else
playerctl --player=$PLAYER metadata --format "$FORMAT"
fi
fi
if [ "$1" == "--icon" ]; then
if [[ $STATUS == "Playing" ]]; then
echo "󰏤"
else
echo "󰐊"
fi
fi