mensajes

Oct 21 06:36

Mostrar un mensaje en el escritorio

Este sencillo código nos permite mostrar mensajes en el escritorio del usuario activo
#!/usr/bin/env python
 
import dbus
# Inicializando el bus de tipo session para comunicarse entre aplicaciones
bus = dbus.SessionBus()
# El objeto Notifications se encarga de enviar las notificaciones
noti = bus.get_object('org.freedesktop.Notifications','/org/freedesktop/Notifications')
interface = dbus.Interface(noti,'org.freedesktop.Notifications')
#Muestro la notificacion
#El tercer parametro es el icono a mostrar del stock de gtk y el ultimo es el tiempo de la notificacion
notificar = interface.Notify("DBus Test", 0, "gtk-about", "Realizando Backup",'En este momento se procede a 
Lenguaje: 
python