Skip to content

Instantly share code, notes, and snippets.

@yfwu
Created November 19, 2012 14:54
Show Gist options
  • Save yfwu/4111092 to your computer and use it in GitHub Desktop.
Save yfwu/4111092 to your computer and use it in GitHub Desktop.
A python daemon use zenity to notice user his setting time.
import os, sys, time
setting = raw_input('Please input your time setting:')
newpid = os.fork()
if newpid == 0:
while True:
time.sleep(10)
if setting <= time.strftime("%H%M",time.localtime(time.time())):
os.system('zenity --error --text="Alert!"')
break
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment