From 8f48135ef00f86c58f9d9ffbcc6f397718040faa Mon Sep 17 00:00:00 2001 From: guinux Date: Fri, 18 Oct 2013 10:03:50 +0200 Subject: [PATCH] use GObjectIntrospection API for pamac-tray notifications --- pamac-tray.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) mode change 100755 => 100644 pamac-tray.py diff --git a/pamac-tray.py b/pamac-tray.py old mode 100755 new mode 100644 index 675be93..eb3c56e --- a/pamac-tray.py +++ b/pamac-tray.py @@ -1,7 +1,7 @@ #! /usr/bin/python3 # -*- coding:utf-8 -*- -from gi.repository import Gtk, GObject +from gi.repository import Gtk, GObject, Notify from subprocess import Popen import dbus from pamac import common, transaction @@ -82,17 +82,17 @@ def set_icon(updates): else: info = update_info.format(number = updates) if not common.pid_file_exists(): - Popen(['notify-send', '-i', '/usr/share/pamac/icons/32x32/apps/pamac-updater.png', '-u', 'normal', _('Update Manager'), info]) + Notify.Notification.new(_('Update Manager'), info, '/usr/share/pamac/icons/32x32/apps/pamac-updater.png').show() else: icon = noupdate_icon info = noupdate_info print(info) tray.update_icon(icon, info) - return False bus = dbus.SystemBus() bus.add_signal_receiver(set_icon, dbus_interface = "org.manjaro.pamac", signal_name = "EmitAvailableUpdates") tray = Tray() +Notify.init(_('Update Manager')) refresh() GObject.timeout_add(3*3600*1000, refresh) Gtk.main()