You are not logged in.

#1 2011-03-06 09:31:01

ngoonee
Forum Fellow
From: Between Thailand and Singapore
Registered: 2009-03-17
Posts: 7,358

[SOLVED] Alternative to notify-send allowing updating of notification?

I'm trying to use notify-send along with a simple volume update script to show me the current volume as I change it (with the script). Currently I use notify-send, but running the script twice creates two windows (and 10 times creates 10 windows) consecutively in a column. I'd like to be able to replace a current window, but this bug report seems to indicate I can't with notify-send.

https://bugs.launchpad.net/ubuntu/+sour … bug/257135

Any alternatives? Or would I need to use the python-notify bindings etc. and code my own notification...

Last edited by ngoonee (2011-03-07 00:28:15)


Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.

Offline

#2 2011-03-06 12:17:51

archman-cro
Member
From: Croatia
Registered: 2010-04-04
Posts: 943
Website

Re: [SOLVED] Alternative to notify-send allowing updating of notification?

I'd like that feature in notify-send too, since I use it with irssi, and every time I join Bitlbee, there's 300 notifications on both sides like "John is online." "Marry is online." so I can't see anything until they go away.
Looking forward for a solution.

Offline

#3 2011-03-06 16:54:16

Stebalien
Member
Registered: 2010-04-27
Posts: 1,239
Website

Re: [SOLVED] Alternative to notify-send allowing updating of notification?

From http://ubuntuforums.org/showpost.php?p= … ostcount=3.

dbus-send --type=method_call --dest='org.freedesktop.Notifications' \
/org/freedesktop/Notifications org.freedesktop.Notifications.Notify \
string:'[APPLICATION]' \
uint32:1 \ #replace old notifications
string:'[ICON]' or '' \
string:'Title' \
string:'body' \
array:string:'' \ #actions
dict:string:string:'','' \ #hints
int32:[TIMEOUT] # Optional timeout

Steven [ web : git ]
GPG:  327B 20CE 21EA 68CF A7748675 7C92 3221 5899 410C

Offline

#4 2011-03-06 18:09:08

firecat53
Member
From: Lake Stevens, WA, USA
Registered: 2007-05-14
Posts: 1,542
Website

Re: [SOLVED] Alternative to notify-send allowing updating of notification?

You could check how the statnot developer accomplished this. I asked for that feature and he added it as a configuration item:

~/.config/statnot/config.py  [partial]

# Put incoming notifications in a queue, so each one is shown.
# If false, the most recent notification is shown directly.
QUEUE_NOTIFICATIONS=False

Otherwise, it'd take several minutes to see the latest message to me on IRC if I'm talking to someone, or if I change the volume a bunch at one time!

Hopefully that's what you were looking for...

Scott

Offline

#5 2011-03-07 00:27:52

ngoonee
Forum Fellow
From: Between Thailand and Singapore
Registered: 2009-03-17
Posts: 7,358

Re: [SOLVED] Alternative to notify-send allowing updating of notification?

Stebalien wrote:

From http://ubuntuforums.org/showpost.php?p= … ostcount=3.

dbus-send --type=method_call --dest='org.freedesktop.Notifications' \
/org/freedesktop/Notifications org.freedesktop.Notifications.Notify \
string:'[APPLICATION]' \
uint32:1 \ #replace old notifications
string:'[ICON]' or '' \
string:'Title' \
string:'body' \
array:string:'' \ #actions
dict:string:string:'','' \ #hints
int32:[TIMEOUT] # Optional timeout

That worked just fine smile. Thanks Stebalien. Solved.


Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.

Offline

#6 2011-03-07 01:02:06

archman-cro
Member
From: Croatia
Registered: 2010-04-04
Posts: 943
Website

Re: [SOLVED] Alternative to notify-send allowing updating of notification?

Do you use this in a script to run dbus-send?

Offline

#7 2011-03-07 01:31:11

ngoonee
Forum Fellow
From: Between Thailand and Singapore
Registered: 2009-03-17
Posts: 7,358

Re: [SOLVED] Alternative to notify-send allowing updating of notification?

archman-cro wrote:

Do you use this in a script to run dbus-send?

Yep, did you try it?


Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.

Offline

#8 2011-03-07 10:31:38

archman-cro
Member
From: Croatia
Registered: 2010-04-04
Posts: 943
Website

Re: [SOLVED] Alternative to notify-send allowing updating of notification?

ngoonee wrote:
archman-cro wrote:

Do you use this in a script to run dbus-send?

Yep, did you try it?

I don't have an idea of how to try it. I use notify-send with some irssi script, so where should I put this? Does it need to be ran every time notify-send is supposed to run?

Offline

#9 2011-03-07 11:28:58

ngoonee
Forum Fellow
From: Between Thailand and Singapore
Registered: 2009-03-17
Posts: 7,358

Re: [SOLVED] Alternative to notify-send allowing updating of notification?

archman-cro wrote:
ngoonee wrote:
archman-cro wrote:

Do you use this in a script to run dbus-send?

Yep, did you try it?

I don't have an idea of how to try it. I use notify-send with some irssi script, so where should I put this? Does it need to be ran every time notify-send is supposed to run?

What HAVE you tried? In case I'm being too subtle - please go and do some basic homework first. You're asking me about simple things like "what is a script?", basically.


Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.

Offline

#10 2011-03-07 14:05:24

archman-cro
Member
From: Croatia
Registered: 2010-04-04
Posts: 943
Website

Re: [SOLVED] Alternative to notify-send allowing updating of notification?

I have tried running:

dbus-send --type=method_call --dest='org.freedesktop.Notifications' /org/freedesktop/Notifications org.freedesktop.Notifications.Notify string:'[APPLICATION]' uint32:1 string:'[ICON]' string:'Title' string:'body' array:string:'' dict:string:string:'','' int32:[TIMEOUT]

to see if this is a working command, since I've realized that Stebalien changed some strings from the linked source. (although I don't see an '[APPLICATION]' string in the libnotify source.) The command like this doesn't work for me, since I still get messages on both sides. Although the dest and object path seem correct, since I've found org.freedesktop.Notifications... in the source.

Last edited by archman-cro (2011-03-07 14:06:59)

Offline

#11 2011-03-07 14:07:24

cantabile
Member
Registered: 2010-06-29
Posts: 37

Re: [SOLVED] Alternative to notify-send allowing updating of notification?

ngoonee wrote:
Stebalien wrote:

From http://ubuntuforums.org/showpost.php?p= … ostcount=3.

dbus-send --type=method_call --dest='org.freedesktop.Notifications' \
/org/freedesktop/Notifications org.freedesktop.Notifications.Notify \
string:'[APPLICATION]' \
uint32:1 \ #replace old notifications
string:'[ICON]' or '' \
string:'Title' \
string:'body' \
array:string:'' \ #actions
dict:string:string:'','' \ #hints
int32:[TIMEOUT] # Optional timeout

That worked just fine smile. Thanks Stebalien. Solved.

Would you mind pasting the exact command you used?

I tried this:

dbus-send --type=method_call --dest='org.freedesktop.Notifications' \
/org/freedesktop/Notifications org.freedesktop.Notifications.Notify \
string:'asdf' \
uint32:1 \
string:'' \
string:'Title' \
string:'body' \
array:string:'' \
dict:string:string:'','' \
int32:4000

but nothing happens - no notification, no errors, nothing.

Offline

#12 2011-03-07 14:15:40

SanskritFritz
Member
From: Budapest, Hungary
Registered: 2009-01-08
Posts: 1,928
Website

Re: [SOLVED] Alternative to notify-send allowing updating of notification?

@cantabile
Do you have any notification daemon running?


zʇıɹɟʇıɹʞsuɐs AUR || Cycling in Budapest with a helmet camera || Revised log levels proposal: "FYI" "WTF" and "OMG" (John Barnette)

Offline

#13 2011-03-07 14:19:01

cantabile
Member
Registered: 2010-06-29
Posts: 37

Re: [SOLVED] Alternative to notify-send allowing updating of notification?

SanskritFritz wrote:

@cantabile
Do you have any notification daemon running?

Yeah, /usr/lib/notification-daemon-1.0/notification-daemon (owned by extra/notification-daemon 0.4.0-4).

notify-send 'foo' 'bar'

works.

Offline

#14 2011-03-07 15:13:33

ngoonee
Forum Fellow
From: Between Thailand and Singapore
Registered: 2009-03-17
Posts: 7,358

Re: [SOLVED] Alternative to notify-send allowing updating of notification?

@archman-cro, you didn't think to substitute [APPLICATION] and the like with other text? Especially given you had the ubuntuforums post to refer to?


Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.

Offline

#15 2011-03-07 15:43:04

archman-cro
Member
From: Croatia
Registered: 2010-04-04
Posts: 943
Website

Re: [SOLVED] Alternative to notify-send allowing updating of notification?

Yes, but if it's really a big problem to explain, it's ok. "I can understand it." My line

dbus-send --type=method_call --dest='org.freedesktop.Notifications' /org/freedesktop/Notifications org.freedesktop.Notifications.Notify string:'notify-send' uint32:1 string:'JEBEMTIMATER' string:'MUTAVU' array:string:'' dict:string:string:'',''

didn't work.
Also check cantabile's question, if you got a second. Thank you.

Offline

#16 2011-03-07 20:16:52

Stebalien
Member
Registered: 2010-04-27
Posts: 1,239
Website

Re: [SOLVED] Alternative to notify-send allowing updating of notification?

You forgot the icon string. It must be present even if it is blank.

dbus-send --type=method_call --dest='org.freedesktop.Notifications' /org/freedesktop/Notifications org.freedesktop.Notifications.Notify string:'notify-send' uint32:1 string:'' string:'JEBEMTIMATER' string:'MUTAVU' array:string:'' dict:string:string:'',''

Steven [ web : git ]
GPG:  327B 20CE 21EA 68CF A7748675 7C92 3221 5899 410C

Offline

#17 2011-03-07 20:33:36

archman-cro
Member
From: Croatia
Registered: 2010-04-04
Posts: 943
Website

Re: [SOLVED] Alternative to notify-send allowing updating of notification?

@Stebalien: Doesn't work. 'notify-send hello' works.

Offline

#18 2011-03-07 22:33:48

Gusar
Member
Registered: 2009-08-25
Posts: 3,605

Re: [SOLVED] Alternative to notify-send allowing updating of notification?

string:'JEBEMTIMATER'

^^ lol! Sorry, I don't have anything to actually contribute, but this I just had to comment on! smile

Offline

#19 2011-03-07 22:45:36

archman-cro
Member
From: Croatia
Registered: 2010-04-04
Posts: 943
Website

Re: [SOLVED] Alternative to notify-send allowing updating of notification?

Gusar wrote:

string:'JEBEMTIMATER'

^^ lol! Sorry, I don't have anything to actually contribute, but this I just had to comment on! smile

big_smile wink

Offline

#20 2011-03-08 00:52:03

ngoonee
Forum Fellow
From: Between Thailand and Singapore
Registered: 2009-03-17
Posts: 7,358

Re: [SOLVED] Alternative to notify-send allowing updating of notification?

Works fine here


Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.

Offline

#21 2011-03-09 09:14:08

jarryson
Member
Registered: 2007-02-18
Posts: 298

Re: [SOLVED] Alternative to notify-send allowing updating of notification?

Running those commands but nothing happened here, too.

i am using notify-osd and libnotify 0.5.2

Last edited by jarryson (2011-03-09 09:14:43)

Offline

#22 2011-03-09 09:25:20

archman-cro
Member
From: Croatia
Registered: 2010-04-04
Posts: 943
Website

Re: [SOLVED] Alternative to notify-send allowing updating of notification?

notify-osd-customizable 0.9.29-8
libnotify 0.5.2-1

I found out that the alternative to this might be xosd, a c library with which we can code our own notifications... But if someone here has this working, he could post some details about it. smile

Offline

#23 2013-01-23 22:05:41

Demon
Member
From: Republic of Srpska, BA
Registered: 2008-03-02
Posts: 246

Re: [SOLVED] Alternative to notify-send allowing updating of notification?

archman-cro wrote:

Yes, but if it's really a big problem to explain, it's ok. "I can understand it." My line

dbus-send --type=method_call --dest='org.freedesktop.Notifications' /org/freedesktop/Notifications org.freedesktop.Notifications.Notify string:'notify-send' uint32:1 string:'JEBEMTIMATER' string:'MUTAVU' array:string:'' dict:string:string:'',''

didn't work.
Also check cantabile's question, if you got a second. Thank you.

Haha, legendo! big_smile

Offline

#24 2013-01-24 13:42:11

kokoko3k
Member
Registered: 2008-11-14
Posts: 2,420

Re: [SOLVED] Alternative to notify-send allowing updating of notification?

Tried with kde, nothing happens.
notify-send works.


Help me to improve ssh-rdp !
Retroarch User? Try my koko-aio shader !

Offline

#25 2014-04-18 21:52:11

yapbreak
Member
Registered: 2014-04-18
Posts: 1

Re: [SOLVED] Alternative to notify-send allowing updating of notification?

It seems that signature of DBus metho Notify has changed. If you run dbus-send with switch --print-reply on, you will see the following error:

Error org.freedesktop.DBus.Error.InvalidArgs: Type of message, '(susssasi)', does not match expected type '(susssasa{sv}i)'

The dict:string:string has been replace by a dict:string:variant. Sadly, it seems that complexe structure is not yet supported by dbus-send (http://lists.freedesktop.org/archives/d … 08385.html)

Offline

Board footer

Powered by FluxBB