2

Notification through libnotify seems to work under icewm, as the different notifications from applications like konversation show. But I can't get it to work from the command line using the notify-send command. When I try it, the notification doesn't appear on my screen at all.

How can I get it to work under icewm?

Edit 1: I've now tried dbus-monitor. It seems there's a problem with notify-send: it isn't specifying any destination, whereas konversation for example specifies knotify as destination. Maybe this is what's causing the problem?

Edit 2: I've also tried d-feet to reproduce the query :(see http://dropcanvas.com/521xc/97), still nothing.

The query I tried to reproduce was this one:

method call sender=:1.14 -> dest=org.kde.knotify serial=1024 path=/Notify; interface=org.kde.KNotify; member=event  
   string "queryMessage"  
   string "konversation"  
   array [  
   ]  
   string ""  
   string "<html>&lt;ychaouche|ghost&gt; hello</html>"  
   array [  
   ]  
   array [  
   ]  
   int32 -1  
   int64 33554870  
method return sender=:1.8 -> dest=:1.14 reply_serial=1024  
   int32 1072  

It was captured using dbus-monitor, sent from konversation when receiving a PM from myself to myself (using xchat, konversation and two nicks).

fra-san
  • 9,931
  • 2
  • 21
  • 42
ychaouche
  • 945
  • 8
  • 25
  • What was your command line? And what does “not work” mean? Did you get an error message, a kernel panic, did the notification not appear? What about the return value of `notify-send`? – Marco Nov 05 '12 at 14:57
  • A got the BSOD... more seriously, not work means nothing happened. – ychaouche Nov 05 '12 at 16:13
  • the command line was notify-send "halp" "hahaha" – ychaouche Nov 05 '12 at 16:16
  • 1
    This works for me. Can you start `dbus-monitor` and run the command again? Check if you can see the notification request. – Marco Nov 05 '12 at 16:26
  • Oh thanks for the dbus-monitor tip, appearantly there's a problem with notify-send : it's putting no destination somewhere, whereas konversation for example puts knotify as destination. Maybe the problem comes from here ? http://pastie.org/5190564 – ychaouche Nov 05 '12 at 16:48

2 Answers2

1

This should work from the command line.

notify-send -u normal -t 60 -a cli "test notification" "This is simply a notification"

I built this string reading directly from the notify-send --help information.

Of course, the man page gives more detailed information.

vgoff
  • 440
  • 5
  • 14
1

You can maybe try the solution via dbus-send proposed there :

dbus-send --session --type=method_call --reply-timeout=10000 \
  --dest=org.freedesktop.Notifications \
  /org/freedesktop/Notifications  org.freedesktop.Notifications.Notify \
  string:"app_name" \
  uint32:0 \
  string:'app_icon' \
  string:"summary" \
  string:"body" \
  array:string:"" \
  dict:string:string:"",""\
  int32:10000

notify-send is actually a wrapper around this command.

Vincent Nivoliers
  • 1,379
  • 8
  • 11
  • Thanks, but that didn't work. However, using dbus-monitor, I could capture this message : http://pastie.org/5190800. Do you know how to translate this into that ? – ychaouche Nov 05 '12 at 17:22
  • This works for me as well as the `notify-send` command you proposed. I believe your problem is not in the request. – Vincent Nivoliers Nov 05 '12 at 18:04
  • 1
    from [this page](http://awesome.naquadah.org/wiki/Dbus,_naughty_and_logs) they propose to set the environment variable `DBUS_SESSION_BUS_ADDRESS` before running notify-send. Maybe you could try their solution. – Vincent Nivoliers Nov 05 '12 at 18:30
  • Thanks vincent, but still nothing http://pastie.org/5194703 :( – ychaouche Nov 06 '12 at 11:06