dwm-flexipatch/polybar/scripts/get-media-playing.sh
Sravan Balaji 34d674a3f8 Nerd Fonts v3 Update Icon Fix
- Fix nerd font icons for v3
2023-05-01 08:56:59 -04:00

20 lines
518 B
Bash
Executable File

#!/bin/bash
mediaStatus=$(playerctl --player=playerctld metadata 2>&1)
if [[ "$mediaStatus" == "No player could handle this command" ]]; then
echo "N/A"
else
artist=$(playerctl --player=playerctld metadata --format '{{ artist }}')
title=$(playerctl --player=playerctld metadata --format '{{ title }}')
if [[ $artist == "" ]]; then
artist="N/A"
fi
if [[ $title == "" ]]; then
title="N/A"
fi
echo "$title | 󰠃 $artist"
fi