Reply
Thread Tools
Self-Perfection's Avatar
Posts: 8 | Thanked: 4 times | Joined on Oct 2011 @ Russia
#1
It is possible to send notfications with D-Bus.

But how can I get unread notifications from script?

I would like to add printing unread notifications titles to my .bash_profile to see what I have missed when I SSH to my Jolla.
 

The Following User Says Thank You to Self-Perfection For This Useful Post:
javispedro's Avatar
Posts: 2,355 | Thanked: 5,249 times | Joined on Jan 2009 @ Barcelona
#2
This is possible with a non-standard Lipstick extension to the notification interface:

https://github.com/nemomobile/lipsti...anager.xml#L39

Unfortunately the complicated type of the return value from that function might make reading from the command line difficult. I hope someone figures it out.
 

The Following 2 Users Say Thank You to javispedro For This Useful Post:
coderus's Avatar
Posts: 6,436 | Thanked: 12,699 times | Joined on Nov 2011 @ Ängelholm, Sweden
#3
easier just creqte qt helper who will print you notifications, but you may use python also
__________________
Telegram | Openrepos | GitHub | Revolut donations
 

The Following 2 Users Say Thank You to coderus For This Useful Post:
Self-Perfection's Avatar
Posts: 8 | Thanked: 4 times | Joined on Oct 2011 @ Russia
#4
Thank you for the pointers. I got a bit further

To get list of e-mail notifications:
Code:
dbus-send --print-reply --dest=org.freedesktop.Notifications /org/freedesktop/Notifications org.freedesktop.Notifications.GetNotifications string:"messageserver5"
Unfortunately this interface requires specifying application name to get notifications.

Ewww, I would like to find a way to get just all notifications.
 

The Following 2 Users Say Thank You to Self-Perfection For This Useful Post:
Posts: 114 | Thanked: 409 times | Joined on Jun 2011 @ Germany
#5
I'm working on a little Qt console application for this

How should the output look like? Any suggestions?
Currently, I iterate simply over the list and print something like:
Code:
1: Incoming: 192.168.10.10
2: Incoming: 192.168.10.10
3: Incoming: 192.168.10.10
4: Incoming: 192.168.10.10
5: 
6: Incoming: 192.168.10.10
7: Incoming: 192.168.10.10
8: Incoming: 192.168.10.10
9: Incoming: 192.168.10.10
10: Incoming: 192.168.10.10
11: Incoming: 192.168.10.10
12: Incoming: 192.168.10.10
13: Incoming: 192.168.10.10
14: Incoming: 192.168.10.10
15: Incoming: 192.168.10.10
16: Incoming: 192.168.10.10
17: Incoming: 192.168.10.10
18: Incoming: 192.168.10.10
19: Incoming: 192.168.10.10
20: Dein Konto xxx@xxx.org muss aktualisiert werden
21: Incoming: 192.168.10.10
22: Incoming: 192.168.10.10
23: Incoming: 192.168.10.10
24: Incoming: 192.168.10.10
25: Incoming: 192.168.10.10
26: 1 Datei heruntergeladen
27: Incoming: 192.168.10.10
28: Incoming: 192.168.10.10
29: Incoming: 192.168.10.10
30: Humble Bundle
31: Incoming: 192.168.10.10
32: Incoming: 192.168.10.10
33: Incoming: 192.168.10.10
34: Incoming: 192.168.10.10
35: Incoming: 192.168.10.10
36: Incoming: 192.168.10.10
37: Incoming: 192.168.10.10
38: Incoming: 192.168.10.10
39: Incoming: 192.168.10.10
40: Incoming: 192.168.10.10
41: Incoming: 192.168.10.10
42: Incoming: 192.168.10.10
43: Incoming: 192.168.10.10
44: Incoming: 192.168.10.10
 

The Following User Says Thank You to ejjoman For This Useful Post:
coderus's Avatar
Posts: 6,436 | Thanked: 12,699 times | Joined on Nov 2011 @ Ängelholm, Sweden
#6
you need to add appname here
__________________
Telegram | Openrepos | GitHub | Revolut donations
 

The Following User Says Thank You to coderus For This Useful Post:
Self-Perfection's Avatar
Posts: 8 | Thanked: 4 times | Joined on Oct 2011 @ Russia
#7
Originally Posted by ejjoman View Post
I'm working on a little Qt console application for this

How should the output look like? Any suggestions?
I would like to be able to specify output format by myself with comman line switches. Consider adding --format switch with some substitute variables like this:
%a - application name
%t - message title
%b - message body
%c - count
%i - id
%ps - preview summary
%pb - preview body
<here should be a few more>

As default format I propose following string
"%a - %c %t\n%b\n\n"

It should be handy to add a couple shorthand switches for common variants of requests. Like --oneline for
--format "%a - %c %t\n"
and --raw for complete listing of all parameters of notification.

Last edited by Self-Perfection; 2015-02-11 at 15:46.
 

The Following User Says Thank You to Self-Perfection For This Useful Post:
Reply

Tags
d-bus, notifications


 
Forum Jump


All times are GMT. The time now is 03:03.