dotfiles/system-specific/cheems/polybar/cmus-np.sh

18 lines
486 B
Bash
Raw Permalink Normal View History

2020-12-05 08:18:52 +00:00
# Code inspired by content found at http://v3gard.com/2011/01/getting-cmus-to-cooperate-with-conky/
if ps -C cmus > /dev/null; then
artist=`cmus-remote -Q |
grep --text '^tag artist' |
sed '/^tag artistsort/d' |
awk '{gsub("tag artist ", "");print}'`
title=`cmus-remote -Q |
grep --text '^tag title' |
sed -e 's/tag title //' |
awk '{gsub("tag title ", "");print}'`
echo "$title"; else echo "";
fi