dotfiles/dot_config/waybar/literal_executable_mediaplayer.sh

20 lines
373 B
Bash
Raw Permalink Normal View History

2023-07-21 21:51:30 -04:00
#!/bin/sh
player_status=$(playerctl status 2> /dev/null)
title=$(playerctl metadata title)
if artist=$(playerctl metadata artist); then
song_info="${title} By ${artist}"
else
song_info="${title}"
fi
if [ "$player_status" = "Playing" ]; then
output="${song_info}"
elif [ "$player_status" = "Paused" ] ; then
output="⏸️ ${song_info}"
fi
echo $output