Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from gi.repository import Notify
- from subprocess import check_output, check_call, call
- from time import sleep
- call(["sudo","pacman","-Syy"])
- a = check_call(["sudo","pacman","-Qu"])
- if a == 0:
- salida = check_output(["sudo","pacman","-Qu"])
- lista = salida.split("\n")
- lista.pop()
- largo = len(lista)
- Notify.init('pacnotify')
- if largo == 1:
- mensaje = "Usted tiene 1 actualizacion en Pacman"
- else:
- mensaje = "Usted tiene %d actualizaciones en Pacman" % largo
- n = Notify.Notification.new(mensaje,salida,'dialog-information')
- n.show()
- sleep(15)
- n.close()
- Notify.uninit()
- else:
- pass
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement