I currently have a function that prints the position and duration from cmus and formats it like "1/500". The issue I'm having is that I would like the position and duration data to be presented in minutes as opposed to seconds (0:01/8:20 instead of 1/500) but I'm out of ideas on how to achieve this.
Currently the relevant part of the function looks like this:
print_music(){
if ps -C cmus > /dev/null; then
position=`cmus-remote -Q |
grep --text '^position' |
sed -e 's/position //' |
awk '{gsub("position ", "");print}'`
duration=`cmus-remote -Q |
grep --text '^duration' |
sed -e 's/duration //' |
awk '{gsub("duration ", "");print}'`
echo "[$position/$duration]"; else echo "";
fi
}