1 | #!/usr/bin/env python
|
---|
2 | # -*- coding: utf-8 -*-
|
---|
3 |
|
---|
4 | import sys
|
---|
5 | import dbus
|
---|
6 | import pprint
|
---|
7 |
|
---|
8 | m = sys.argv[1]
|
---|
9 |
|
---|
10 | knotify = dbus.SessionBus().get_object("org.kde.knotify", "/Notify")
|
---|
11 |
|
---|
12 | # interface for knotify,
|
---|
13 | # taken from knotify.h
|
---|
14 | # int event(
|
---|
15 | # const QString &event,
|
---|
16 | # const QString &fromApp,
|
---|
17 | # const QVariantList& contexts ,
|
---|
18 | # const QString &title,
|
---|
19 | # const QString &text,
|
---|
20 | # const QByteArray& pixmap,
|
---|
21 | # const QStringList& actions,
|
---|
22 | # int timeout,
|
---|
23 | # qlonglong winId );
|
---|
24 |
|
---|
25 |
|
---|
26 | # predefined notify settings, see
|
---|
27 | # find /usr/share/kde4/apps -name *.notifyrc
|
---|
28 | # grep -v '[a-z]\[' /usr/share/kde4/apps/kde/kde.notifyrc
|
---|
29 |
|
---|
30 | #i = knotify.event( "warning", "mettenmeier_batteriemanagement", [], "Batteriemanagement", m, [0,0,0,0], [], 0, dbus_interface="org.kde.KNotify")
|
---|
31 |
|
---|
32 | # use notify settings from powerdevil
|
---|
33 | #i = knotify.event( "criticalbattery", "powerdevil", [], "Batteriemanagement", m, [], [], 0, dbus_interface="org.kde.KNotify")
|
---|
34 | i = knotify.event( "notification", "kde", [], "knotify-client", m, [], [], 0, dbus_interface="org.kde.KNotify")
|
---|
35 | #pprint.pprint(i)
|
---|
36 |
|
---|