bin bash track mocp -Q title cut -d -f s_dir dirname mocp -i egrep Fil

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