Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #! /usr/bin/python
- # -*- coding: iso-8859-1 -*-
- # Dependencias pynotify e xprintidle
- import commands
- import time
- import pynotify
- msg = 'Computador inativo por mais de 1 minuto. Pegue café.'
- limit = 60000
- while 1:
- idle = int(commands.getoutput('xprintidle'))
- if idle > limit:
- if pynotify.init("cafe"):
- notification = pynotify.Notification("Cafeinne", msg,"caffeine")
- notification.show()
- time.sleep(60)
- else:
- print "Houve um problema ao iniciar o módulo pynotify"
- time.sleep(14)
Add Comment
Please, Sign In to add comment