Guest User

Untitled

a guest
Jan 21st, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. #! /usr/bin/python
  2. # -*- coding: iso-8859-1 -*-
  3.  
  4. # Dependencias pynotify e xprintidle
  5.  
  6. import commands
  7. import time
  8. import pynotify
  9.  
  10. msg = 'Computador inativo por mais de 1 minuto. Pegue café.'
  11. limit = 60000
  12.  
  13. while 1:
  14. idle = int(commands.getoutput('xprintidle'))
  15. if idle > limit:
  16. if pynotify.init("cafe"):
  17. notification = pynotify.Notification("Cafeinne", msg,"caffeine")
  18. notification.show()
  19. time.sleep(60)
  20. else:
  21. print "Houve um problema ao iniciar o módulo pynotify"
  22.  
  23. time.sleep(14)
Add Comment
Please, Sign In to add comment