mocp popup

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
#!/bin/bash
track=`mocp -Q %title | cut -d " " -f 1`
s_dir="$(dirname "$(mocp -i | egrep File | cut -d : -f2 | sed 's/^[ ]//g')")"
icon="$s_dir/folder.jpg"
if [ $(echo $track | wc -L) -lt 2 ] && [ "$(echo $track | grep [0-9])" = "$track" ] ; then track="0$track" ; fi
if ! [ -f "$icon" ]; then icon="/usr/share/icons/Humanity/emblems/48/emblem-sound.svg" ; fi
notify-send -i "$icon" \
"$track - $(mocp -Q ' %song')" "$(mocp -Q '%artist - %album') $(mocp -Q '(%tt)')"