MOC Notify-OSD

Forums:

For the past few months I had been looking for a good enough music player. MOC fulfills everything naturally, but I still want that notify-osd bubble in Ubuntu. Anyone got any scripts or such?

Hi,

it's been some time since I have written a not-yet-complete MPRIS (Media Player Remote Interfacing Specification) 1.0 support for MOC.
I have also made but never released a little plain C++ application (that I called mpris-notify) that translates MPRIS TrackChange and StatusChange signals to notification messages (using org.freedesktop.Notifications interface) with notify-osd in mind (well, specifically for it, but IIRC it used to work with other notification daemons too since it's the same simple interface).
Let me just refine the code a bit :-) Things will appear in (hopefully) not very distant future at https://github.com/lenoch/mpris-notify

Edit: If you want a ready-made solution with no MPRIS in between, feel free to try https://github.com/sumpygump/moc-notify (just found when looking for MOC repositories in the wild).

I just use an one line script

#!/bin/sh
notify-send "$1 - $2 ($3)"

chmod +x and add a line in conf

OnSongChange = "/home/user/.moc/onsongchange %a %t %r"

I couldn't figure out how to escape the quotes in the conf file but it's good enough

Is changed to match the look of audacious notifications (including the audio-card icon because it looks good)

#!/bin/sh
notify-send -i audio-card "$1" "$2\n $3"

after that is the same:
chmod +x and add the line in config file

OnSongChange = "~/.moc/onsongchange %a %t %r"

Audio-card icon is a nice touch, but I got the idea to include album cover as an icon.

I've assumed that the file is named cover.jpg (I use Musicbrainz's Picard which saves album art in this way). There is one dirty hack needed due to the bug in notify-send: notify-send doesn't show images that name includes comma

#!/bin/sh p=`dirname "$5"` if [[ -f $p/cover.jpg ]]; then cp "$p/cover.jpg" /tmp/cover.jpg notify-send -i /tmp/cover.jpg "$1" "$2\n$3" else notify-send -i audio-headphones "$1" "$2\n$3" fi

I've tried your modification but only very few of my songs shows the cover, otherwise is an awesome feature, the only thing that remains is the dissapearance timeout, because it takes so much time and it's annoying when you change a lot of songs in a short time. Is there anyway to fix it?

You can add "-t x" to notify-send, where x is number of miliseconds each announcement lives.

As for missing covers, do you mean that you don't have a "cover.jpg" file, or you have the file, but it doesn't appear? Or maybe cover image has different name?

Hi.
Another possible solution: https://github.com/daltomi/moc_notify

Linux only.
1- moc_notify make one FIFO file.
2- the script onsongchange.sh send data to FIFO file, format: printf title @ body > FIFO
3- moc_notify show new message or update the existing one.

Only one popup message for all notifications.
I hope it's helpful.
Regards.