Advertisement
Guest User

Untitled

a guest
Nov 4th, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.42 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. prepend_zero () {
  4.     seq -f "%02g" $1 $1
  5. }
  6. if ! (cmus-remote -Q | grep -q 'status stopped'); then
  7.  
  8. (position=$(cmus-remote -C status | grep position | cut -c 10-)
  9. minutes1=$(prepend_zero $(($position / 60)))
  10. seconds1=$(prepend_zero $(($position % 60)))
  11.  
  12. duration=$(cmus-remote -C status | grep duration | cut -c 10-)
  13. minutes2=$(prepend_zero $(($duration / 60)))
  14. seconds2=$(prepend_zero $(($duration % 60)))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement