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?
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).
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
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.
lenoch
Tue, 2012-08-21 16:24
Permalink
Yes :-)
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).
netmage
Thu, 2012-08-23 20:17
Permalink
one line
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
fabianovrwrt
Tue, 2012-12-04 01:49
Permalink
I've changed the script a little and it looks better
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"
tomaszg
Sun, 2012-12-16 03:35
Permalink
Album cover
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 innotify-send
: notify-send doesn't show images that name includes commafabianovrwrt
Mon, 2012-12-17 22:15
Permalink
It works, but is not that good
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?
tomaszg
Mon, 2012-12-17 22:40
Permalink
You can add "-t x", where x
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?
Dany
Wed, 2015-12-23 06:41
Permalink
Other solution
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.