*nohtml*

local/bin/music-notify

   1 #!/bin/bash
   2 
   3 IFS=  read file icon tl artist album title < <(
   4 MUSIC_FORMAT='$file $icon $tl $artist $album $title' music)
   5 
   6 [[ $file ]] || exit
   7 [[ $file == ${file//\/} ]] &&
   8 file=~/Music/$file
   9 
  10 title="$icon $title (-$tl)"
  11 pics=("${file%/*}/"*.jpg)
  12 cover=~/.cache/music-notify.png
  13 
  14 [[ $album ]] &&
  15 artist+=" ($album)"
  16 
  17 [[ ! $artist ]] &&
  18 artist=$title title=
  19 
  20 rm $cover
  21 ffmpeg -i "$file" $cover || cp "$pics" $cover
  22 convert $cover -thumbnail '100x>^' $cover ||
  23 cover=audio-x-generic
  24 
  25 notify-send -a music-notify -i $cover -- "$artist" "$title"