Skip to content

Instantly share code, notes, and snippets.

@yfwu
Created November 19, 2012 15:07
Show Gist options
  • Save yfwu/4111166 to your computer and use it in GitHub Desktop.
Save yfwu/4111166 to your computer and use it in GitHub Desktop.
A python daemon use kdialog 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('kdialog --error "Alert!"')
break
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment