This repository has been archived on 2026-01-23. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
dotfiles-old/cmus-stats.sh
T
2019-05-03 02:20:07 +00:00

24 lines
677 B
Bash
Executable File

#!/bin/bash
if [ -x /usr/bin/cmus-remote ]
then
status=`cmus-remote -Q | grep status | awk '{print $2}'`
if [ $status == "paused" ]
then
<<<<<<< HEAD
status="ç"
=======
status="→"
>>>>>>> 2f6f026bc689f7612d2a67cfd9ae8478510dd898
else
status="æ"
fi
duration=`cmus-remote -Q | grep duration | awk '{print $2}'`
position=`cmus-remote -Q | grep position | awk '{print $2}'`
((timeleft = $duration - $position))
((timelefth = timeleft / 60))
((timeleftm = timeleft % 60))
artist=`cmus-remote -Q | grep -w artist | cut -d ' ' -f3-`
song=`cmus-remote -Q | grep title | cut -d ' ' -f3-`
echo $artist'-'$song $status $timelefth':'$timeleftm
fi