dwm-flexipatch/polybar/scripts/get-media-source-icon.sh
Sravan Balaji 05175768cc Add more icons for media playing
- Netflix icon
- Hulu icon
- Amazon (prime video) icon
2022-08-07 19:38:24 -04:00

26 lines
778 B
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
mediaStatus=$(playerctl --player=playerctld metadata 2>&1)
if [[ "$mediaStatus" == "No player could handle this command" ]]; then
echo "ﱙ"
else
trackid=$(playerctl --player=playerctld metadata --format '{{ mpris:trackid }}')
title=$(playerctl --player=playerctld metadata --format '{{ xesam:title }}')
if grep -q -i "netflix" <<< "$title"; then
echo "ﱄ"
elif grep -q -i "hulu" <<< "$title"; then
echo "ﴧ"
elif grep -q -i "prime video" <<< "$title"; then
echo ""
elif grep -q -i "chromium" <<< "$trackid"; then
echo ""
elif grep -q -i "vlc" <<< "$trackid"; then
echo "嗢"
elif grep -q -i "spotify" <<< "$trackid"; then
echo ""
else
echo ""
fi
fi