Skip to content

Instantly share code, notes, and snippets.

@odysseuskir
Created August 15, 2023 10:14
Show Gist options
  • Save odysseuskir/b97acb28713215cf4ec86db1917d5267 to your computer and use it in GitHub Desktop.
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.
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