Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- prepend_zero () {
- seq -f "%02g" $1 $1
- }
- if ! (cmus-remote -Q | grep -q 'status stopped'); then
- (position=$(cmus-remote -C status | grep position | cut -c 10-)
- minutes1=$(prepend_zero $(($position / 60)))
- seconds1=$(prepend_zero $(($position % 60)))
- duration=$(cmus-remote -C status | grep duration | cut -c 10-)
- minutes2=$(prepend_zero $(($duration / 60)))
- seconds2=$(prepend_zero $(($duration % 60)))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement