Created
August 15, 2023 10:14
-
-
Save odysseuskir/b97acb28713215cf4ec86db1917d5267 to your computer and use it in GitHub Desktop.
The doctor told me that I should get off the chair every 30 minutes to take a walk and come back, so I made this in Python.
This file contains 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
import dbus | |
import time | |
item = "org.freedesktop.Notifications" | |
notfy_intf = dbus.Interface( | |
dbus.SessionBus().get_object(item, "/"+item.replace(".", "/")), item) | |
def countdown(t): | |
while t > 0: | |
print(t) | |
t -= 1 | |
time.sleep(1) | |
seconds = 1800 | |
countdown(seconds) | |
notfy_intf.Notify("", 0, "", "Time to get up!", "Get off the computer and walk for a bit.", [], {"urgency": 1}, 3000) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment