Change music.sh to use cmus

Signed-off-by: Severin Kaderli <severin.kaderli@gmail.com>
This commit is contained in:
Severin Kaderli 2017-03-30 19:11:21 +02:00
parent 778debc10f
commit e3381dd4d0

View file

@ -1,8 +1,15 @@
#!/bin/bash #!/bin/bash
# music.sh
OUTPUT="$(audtool current-song)" QUERY="$(cmus-remote -Q)"
if [ -z "$OUTPUT" ]; then STATUS="$(echo "$QUERY" | grep -e "status " | cut -d " " -f 2)"
ARTIST="$(echo "$QUERY" | grep -e " artist " | cut -d " " -f 3-)"
TITLE="$(echo "$QUERY" | grep -e " title " | cut -d " " -f 3-)"
OUTPUT="$ARTIST - $TITLE"
if [ "$STATUS" != "playing" ]; then
OUTPUT="Not playing" OUTPUT="Not playing"
fi fi