mirror of
https://github.com/Manoj-HV30/i3wm-ubuntu-dotfiles.git
synced 2026-05-16 19:35:23 +00:00
Initial Ubuntu i3wm dotfiles
This commit is contained in:
Executable
+27
@@ -0,0 +1,27 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
MAXLEN=25
|
||||
STATUS=$(playerctl status 2>/dev/null) # playing, paused, stopped
|
||||
TITLE=$(playerctl metadata title 2>/dev/null)
|
||||
|
||||
# Decide emoji based on status
|
||||
if [ "$STATUS" = "Playing" ]; then
|
||||
EMOJI="▶"
|
||||
elif [ "$STATUS" = "Paused" ]; then
|
||||
EMOJI="⏸"
|
||||
else
|
||||
EMOJI="⏹"
|
||||
fi
|
||||
|
||||
# If no song
|
||||
if [ -z "$TITLE" ]; then
|
||||
echo "🕊️ Chillin'"
|
||||
else
|
||||
# Truncate if too long
|
||||
if [ ${#TITLE} -gt $MAXLEN ]; then
|
||||
TITLE="${TITLE:0:MAXLEN}…"
|
||||
fi
|
||||
# Underline with Polybar formatting and show emoji
|
||||
echo "%{+u}%{F#8be9fd}$EMOJI $TITLE%{-u}%{F-}"
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user