Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#! /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
You can’t perform that action at this time.