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

 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 = `mocp -i | egrep File | cut -d : -f2 | cut -d / -f 1,2,3,4,5,6`
if [ $(echo $track | wc -L) -lt 2 ] && [ "$(echo $track | grep [0-9])" = "$track" ] ; then track="0$track" ; fi
if [ -n $s_dir ]
then
notify-send -i "$s_dir/folder.jpg" \
"$track - $(mocp -Q ' %song')" "$(mocp -Q '%artist - %album') $(mocp -Q '(%tt)')"
else
notify-send -i "/usr/share/icons/Humanity/emblems/48/emblem-sound.svg" \
"$track - $(mocp -Q ' %song')" "$(mocp -Q '%artist - %album') $(mocp -Q '(%tt)')"
fi