You are not logged in.

#1 2009-09-08 20:52:39

2_Thumbs_Up
Member
Registered: 2009-05-09
Posts: 22

notify-osd and mpd issue

I have a custom script that uses notify-send to show mpd song changes with notify-osd. The problem is that when I
change songs quickly it queues the notifications so it kind of lags behind really bad. I've read
here (https://wiki.edubuntu.org/NotifyOSD) and it seems like a solution would be to use confirmation bubbles
instead of regular ones. Only thing is I don't know how to actually achieve that with notify-send.

Thanks

Offline

#2 2010-01-08 19:58:21

klazsick
Member
Registered: 2008-07-10
Posts: 12

Re: notify-osd and mpd issue

Try adding this to your notify-send string:

-h string:synchronous:mpd

So here's my mpd script:

#!/bin/sh

usage="usage: $0 -c {play|stop|next|prev|info}" 
command=

shift $(($OPTIND - 1))
command=$1

STATUS=""
if [ "$command" = "" ]; then
    echo "usage: $0 {play|stop|next|prev|info}"
    exit 0;
fi

if [ "$command" = "play" ]; then
    mpc toggle
    ARTIST=$(mpc -f "%artist%" current)
    ALBUM=$(mpc -f "%album%" current)
    TITLE=$(mpc -f "%title%" current)
fi

if [ "$command" = "next" ]; then
    mpc next
    ARTIST=$(mpc -f "%artist%" current)
    ALBUM=$(mpc -f "%album%" current)
    TITLE=$(mpc -f "%title%" current)
fi

if [ "$command" = "prev" ]; then
    mpc prev
    ARTIST=$(mpc -f "%artist%" current)
    ALBUM=$(mpc -f "%album%" current)
    TITLE=$(mpc -f "%title%" current)
fi

if [ "$command" = "info" ]; then
    ARTIST=$(mpc -f "%artist%" current)
    ALBUM=$(mpc -f "%album%" current)
    TITLE=$(mpc -f "%title%" current)
fi

if [ "$command" = "stop" ]; then
    mpc stop
    STATUS="stop"
fi

if [ "$STATUS" != "stop" ]; then
    notify-send "$TITLE" "$ARTIST" -i "/media/MyBook/Music/$ARTIST/$ALBUM/$ALBUM.jpg" -h string:synchronous:mpd
fi

Offline

#3 2010-01-09 21:42:20

martvefun
Member
From: The Internets
Registered: 2009-12-19
Posts: 174

Re: notify-osd and mpd issue

I think the post kind of 4 month old but I'm interested in this solution smile

Do you run your script at startup ? Same time as MPD ?


English is not my native language, sorry for the mistakes
Arch amd64, GNOME, Dell Vostro

Offline

Board footer

Powered by FluxBB