Guest User

Untitled

a guest
Nov 19th, 2017
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. #!/bin/sh
  2.  
  3. # Parse arguments into variables
  4. while test $# -ge 2; do
  5. eval _$1='$2'
  6. shift
  7. shift
  8. done
  9.  
  10. # Check that file actually exists
  11. if test -n "$_file"; then
  12. # Log status to file
  13. echo "[$(date '+%x %R:%S')][$_status] $_artist - $_album - $_title" >> ~/.config/cmus/status_log.txt
  14.  
  15. if [ $_status == "playing" ]; then
  16. # Pull current song icon into ~/.config/cmus/np_icon.jpg
  17. rm ~/.config/cmus/np_icon.jpg
  18. ffmpeg -i "$_file" -an -vcodec copy ~/.config/cmus/np_icon.jpg
  19.  
  20. # Show notification
  21. notify-send -i ~/.config/cmus/np_icon.jpg "Now Playing" "$_artist - $_album - $_title"
  22. fi
  23. fi
Add Comment
Please, Sign In to add comment