Skip to content

Instantly share code, notes, and snippets.

@fabioluciano
Created September 14, 2011 21:14
Show Gist options
  • Save fabioluciano/1217806 to your computer and use it in GitHub Desktop.
Save fabioluciano/1217806 to your computer and use it in GitHub Desktop.
#! /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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment