source: kde/dbus/knotify-client-dbus@ 938

Last change on this file since 938 was 937, checked in by joergs, on Dec 8, 2010 at 1:42:29 PM

copy

  • Property svn:executable set to *
File size: 1.1 KB
RevLine 
[935]1#!/usr/bin/env python
2# -*- coding: utf-8 -*-
3
4import sys
5import dbus
6import pprint
7
[936]8try:
9 message = sys.argv[1]
10except:
11 message = sys.argv[0]
[935]12
13knotify = dbus.SessionBus().get_object("org.kde.knotify", "/Notify")
14
15# interface for knotify,
16# taken from knotify.h
17# int event(
18# const QString &event,
19# const QString &fromApp,
20# const QVariantList& contexts ,
21# const QString &title,
22# const QString &text,
23# const QByteArray& pixmap,
24# const QStringList& actions,
25# int timeout,
26# qlonglong winId );
27
28
29# predefined notify settings, see
30# find /usr/share/kde4/apps -name *.notifyrc
31# grep -v '[a-z]\[' /usr/share/kde4/apps/kde/kde.notifyrc
32
33#i = knotify.event( "warning", "mettenmeier_batteriemanagement", [], "Batteriemanagement", m, [0,0,0,0], [], 0, dbus_interface="org.kde.KNotify")
34
35# use notify settings from powerdevil
36#i = knotify.event( "criticalbattery", "powerdevil", [], "Batteriemanagement", m, [], [], 0, dbus_interface="org.kde.KNotify")
[936]37i = knotify.event( "notification", "kde", [], "knotify-client", message, [], [], 5, dbus_interface="org.kde.KNotify")
[935]38#pprint.pprint(i)
[936]39print i
Note: See TracBrowser for help on using the repository browser.