This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Notification run command

Tags: None
(comma "," separated)
gimzo0
Registered Member
Posts
1
Karma
0

Notification run command

Sun Feb 09, 2014 11:53 am
Hi,
sorry if this was already answered somewhere, I couldn't find it.
If I enable "run command" for a notification, the command is run without arguments. Is it possible to get some information about the notification in the command?
More precisely, I want to have notifications from instant messaging (telepathy) into my script that displays them on my (XBMC) HTPC, so it would be useful If I could get who's the message from and things like that.
Thanks
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS

Re: Notification run command

Sun Feb 09, 2014 9:54 pm
Based on this code from KNotify, you can use the following shell variables in the command:
$e: Name of the notification
$a: Name of the sending application
$s: Text of the notification itself
$w: ID of the Window which sent the notification (useful for raising it to the top for instance, if given)
$i: Unknown ID number, likely uniquely identifying the notification (would be used for cancelling or providing feedback with long term notifications).


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
paulfee
Registered Member
Posts
1
Karma
0

Re: Notification run command

Fri May 09, 2014 11:18 am
I find that % rather than $ works for me (Fedora 20, KDE 4.12.4).

%e: Name of the notification
%a: Name of the sending application
%s: Text of the notification itself
%w: ID of the Window which sent the notification (useful for raising it to the top for instance, if given)
%i: Unknown ID number, likely uniquely identifying the notification (would be used for cancelling or providing feedback with long term notifications).

Use these tokens as arguments to your program and you can get extra information about the current notification message.


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], Sogou [Bot]