Created
February 24, 2012 22:22
-
-
Save erikw/1904176 to your computer and use it in GitHub Desktop.
NP from mpd in KDE
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 | |
# Announce current song playing in mpd in a KDE notification. | |
# Icon support for passivepopup is implemented in more recent versions of KDE. | |
#path=`mpc -f %file% | head -n1 | sed 's/\(.*\)\/.*\..\+$/~\/mult\/music\/\1/'` | |
#icon=`find $path -type f -iregex '.*\.\(png\|jpg\|jpeg\|gif\|bmp\)$' -print | head -n1` | |
#kdialog --icon "$icon" --title "Currently playing song" --passivepopup "$np" 3 | |
#np=`mpc --format "%title%[\n%album%]\n%artist%" | head -n3` | |
np=`mpc --format "%title%[\n%album%]\n%artist%" | grep -Pzo '^(.|\n)*?(?=\[)'` | |
kdialog --title "Currently playing song" --passivepopup "$np" 3 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment