dotfiles/.config/waybar/scripts/playerctl/playerctl.sh

14 lines
420 B
Bash
Raw Normal View History

2024-07-13 23:12:03 +05:30
#!/bin/bash
playerctl_status=$(playerctl status 2>/dev/null)
if [[ $playerctl_status == "Playing" ]]; then
title=$(playerctl metadata title 2>/dev/null)
echo '{"text":"󰎈 󰏤","class":"playing","title":"$title"}'
elif [[ $playerctl_status == "Paused" ]]; then
title=$(playerctl metadata title 2>/dev/null)
echo '{"text":"󰎈 󰐊","class":"paused","title":"$title"}'
else
echo '{"text":""}'
fi