Dotfiles for i3-wm, zsh, polybar, neomutt etc.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

16 lines
629 B

#!/bin/bash
duration=$(cmus-remote -Q 2> /dev/null | grep duration | cut -d ' ' -f2-)
position=$(cmus-remote -Q 2> /dev/null | grep position | cut -d ' ' -f2-)
stat=$(cmus-remote -Q 2> /dev/null | grep status | cut -d ' ' -f2-)
artist=$(cmus-remote -Q 2> /dev/null | grep ' artist ' | cut -d ' ' -f3-)
song=$(cmus-remote -Q 2> /dev/null | grep title | cut -d ' ' -f3-)
if [ "$stat" != "" -a "$artist" != "" ]; then
cur=$(date -d@"$position" -u +%M:%S)
dur=$(date -d@"$duration" -u +%M:%S)
if [ "$stat" = "playing" ]; then
echo "$artist - $song || $cur"
else
echo "$song - $cur - paused"
fi
fi