Created
July 1, 2017 14:55
-
-
Save KaliumPuceon/0615e3d6faf3a771c6aa323d0aed0ee2 to your computer and use it in GitHub Desktop.
very simple shell script to get nowplaying from cmus and show in tmux status bar
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Stick this in your .tmux.conf somewhere | |
# This will override your current date setting if you have one though | |
# So modify to show other things I guess? This was for me really. | |
set -g status-right "#(nowplaying.sh) | #[bold]%d %b#[nobold] | %H:%M " | |
set -g status-right-length 120 | |
set -g status-left-length 80 | |
set -g status-interval 2 # Update bar regularly even without focus |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# put this in a PATH'd folder. | |
# I recommend ~/.local/bin | |
if pgrep -x "cmus" > /dev/null # is cmus running | |
then | |
START=$(cmus-remote -C status | grep "tag\ title" | head -n 1 | cut -d ' ' -f 3-) | |
END=$(cmus-remote -C status | grep "tag\ artist" | head -n 1 | cut -d ' ' -f 3-) | |
PLAYING=${START:0:60}" - "${END:0:40} | |
else | |
echo "cmus off" | |
fi | |
echo $PLAYING |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment