You are not logged in.
EDIT: https://github.com/nowrep/notify-desktop
I need a one line command for shell for dbus to show a notification.
I'm using this python script for now:
#!/usr/bin/env python
# -*- coding: utf8 -*-
"""This is a python script that creates a notification using dbus."""
import os, dbus
item = ('org.freedesktop.Notifications')
path = ('/org/freedesktop/Notifications')
interface = ('org.freedesktop.Notifications')
datum = os.popen("date +%X").read()
icon = '/home/mladen/.irssi/irssitop.png'
array = ''
hint = ''
time = 3 # Use seconds x 1000, 0 means wait for confirmation
app_name = ('irssi')
title = ('irssi обавјештење')
body = ('Неко вас је споменуо\n\nВријеме:\t'+str(datum))
bus = dbus.SessionBus()
notif = bus.get_object(item, path)
notify = dbus.Interface(notif, interface)
notify.Notify(app_name, 0, icon, title, body, array, hint, time)
os.popen("ogg123 -q /usr/share/sounds/KDE-Im-Irc-Event.ogg &>/dev/null &").read()
But the problem is that I would prefer a one line command, if possible, and I'm not familliar with coding in python, so I'm unable to adapt it to suit my needs.
Last edited by Demon (2014-01-11 20:52:30)
Offline
Dunno about a oneliner but does the code in the following provide food for thought?
CPU-optimized Linux-ck packages @ Repo-ck • AUR packages • Zsh and other configs
Offline
Thanks graysky, but I'm looking for a shell script, and this is python based.
Offline
just use notify-send ?
That python script is just ....................
Last edited by Mr.Elendig (2013-01-23 21:32:47)
Evil #archlinux@libera.chat channel op and general support dude.
. files on github, Screenshots, Random pics and the rest
Offline
I've tried this, no succes:
% dbus-send --session --dest=org.freedesktop.Notifications --type=method_call --reply-timeout=10000 /org/freedesktop/Notifications org.freedesktop.Notifications string:'Test Application' uint32:0 string: string:'NOTIFICATION TEST' string:'This is a test of the notification system via DBus.' array:string: dict:string: int32:10000
dbus-send: Data item "" is badly formed
Offline
notify-send != dbus-send.
Has different letters and stuff in it.
Evil #archlinux@libera.chat channel op and general support dude.
. files on github, Screenshots, Random pics and the rest
Offline
notify-send != dbus-send.
Has different letters and stuff in it.
I don't want to use notify-send.
Offline
1. dict needs to be in the format 'dict:string:string:' not 'dict:string:'
2. You didn't specify the function (org.freedesktop.Notifications.Notify instead of org.freedesktop.Notifications).
dbus-send --session --print-reply --dest=org.freedesktop.Notifications --type=method_call --reply-timeout=10000 /org/freedesktop/Notifications org.freedesktop.Notifications.Notify string:'Test Application' uint32:0 string: string:'NOTIFICATION TEST' string:'This is a test of the notification system via DBus.' array:string: dict:string:string: int32:10000
Steven [ web : git ]
GPG: 327B 20CE 21EA 68CF A7748675 7C92 3221 5899 410C
Do not email: honeypot@stebalien.com
Offline
Problem solved: https://github.com/nowrep/notify-desktop
Offline