Branch: master
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
59 lines (47 sloc) 1.77 KB
#!/usr/bin/env python
# This application was developed as I cannot remember for birthdays efficiently.
# This app helps me remind birthdays and notifies me on their birthdays.
# To store birthdays ceate a file '' and store birthdays in this format:
# MonthDay Name Surname
# Copy the python file to /bin:
# sudo cp -i /path/to/ /bin
# ( should be executable)
# Add A New Cron Job:
# sudo crontab -e
# Scroll to the bottom and add the following line (after all the #'s):
# @reboot python /bin/ &
# And Reboot to check if the script is working
# Or simply search for 'Startup applications' and add you script there
import time
import os
birthdayFile = '/home/omkarpathak/Documents/GITs/Python-Programs/Programs/'
myFilePath = 'python /home/omkarpathak/Documents/GITs/Python-Programs/Programs/'
def checkStartupScript():
''' This function ensures that our application executes on every startup '''
flag = 0
fileName = open('/etc/rc.local', 'r')
for line in fileName:
if myFilePath in line:
flag =1
if flag == 0:
def addToStartup():
fileName = open('/etc/rc.local', 'a')
fileName.write(myFilePath + '\n')
def checkTodaysBirthdays():
fileName = open(birthdayFile, 'r')
today = time.strftime('%m%d')
flag = 0
for line in fileName:
if today in line:
line = line.split(' ')
flag =1
os.system('notify-send "Birthdays Today: ' + line[1] + ' ' + line[2] + '"')
if flag == 0:
os.system('notify-send "No Birthdays Today!"')
if __name__ == '__main__':