Created
June 7, 2018 14:12
-
-
Save traverseda/4e0732c155b4c4f46532734e67e8fc6b to your computer and use it in GitHub Desktop.
A termux cuckoo clock for android
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/data/data/com.termux/files/usr/bin/python | |
import schedule, time, datetime | |
import os | |
def alarm(): | |
print(datetime.datetime.now()) | |
os.system("termux-vibrate -d 500 -f") | |
def hourAlarm(): | |
print(datetime.datetime.now()) | |
os.system("termux-vibrate -d 1000 -f") | |
schedule.every(15).minutes.do(alarm) | |
schedule.every().hour.do(hourAlarm) | |
while 1: | |
schedule.run_pending() | |
time.sleep(1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Surprisingly, it doesn't seem to eat battery life. One annoyance is that termux-vibrate doesn't let us send very complicated signals. Another annoyance is that it's no on the hour, it's once an hour.