Created
November 17, 2017 03:39
-
-
Save notjuliee/36e0f5cc7b7310b92adf1dcc7481d0b6 to your computer and use it in GitHub Desktop.
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/sh | |
# Parse arguments into variables | |
while test $# -ge 2; do | |
eval _$1='$2' | |
shift | |
shift | |
done | |
# Check that file actually exists | |
if test -n "$_file"; then | |
# Log status to file | |
echo "[$(date '+%x %R:%S')][$_status] $_artist - $_album - $_title" >> ~/.config/cmus/status_log.txt | |
if [ $_status == "playing" ]; then | |
# Pull current song icon into ~/.config/cmus/np_icon.jpg | |
rm ~/.config/cmus/np_icon.jpg | |
ffmpeg -i "$_file" -an -vcodec copy ~/.config/cmus/np_icon.jpg | |
# Show notification | |
notify-send -i ~/.config/cmus/np_icon.jpg "Now Playing" "$_artist - $_album - $_title" | |
fi | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment