Skip to content

Instantly share code, notes, and snippets.

@blha303
Created January 10, 2018 02:37
Show Gist options
  • Save blha303/2b5afb10b739d5f4bc777aea5702e823 to your computer and use it in GitHub Desktop.
Save blha303/2b5afb10b739d5f4bc777aea5702e823 to your computer and use it in GitHub Desktop.
Wrapper for MPV that picks up icy-title updates and tells notify-send about them
#!/bin/bash
mpv http://stream 2>&1 | while read p; do if [[ "$p" != "A: "* ]]; then echo $p; fi; if [[ "$p" == *"icy-title:"* ]]; then notify-send "$(echo $p | cut -d' ' -f2-)"; fi; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment