Skip to content

Instantly share code, notes, and snippets.

@Ilgrim
Forked from serxoz/postura.py
Created July 2, 2021 08:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Ilgrim/deb5d80adb1fee8c89b4ea64de007694 to your computer and use it in GitHub Desktop.
Save Ilgrim/deb5d80adb1fee8c89b4ea64de007694 to your computer and use it in GitHub Desktop.
Aviso para mellorar a postura sentado
#!/usr/bin/env python
"""
Aviso para que me recorde que me sente ben.
crontab:
0,20,40 * * * * DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus XDG_RUNTIME_DIR="/run/user/1000" ~/bin/postura.py
NOTA: axustar as variables de sesión co UID do teu usuario.
"""
from random import randint
from time import sleep
import subprocess
def notifica():
subprocess.Popen(['/usr/bin/notify-send',
'Revisa a postura.',
'Séntate ben!'])
subprocess.Popen(['/usr/bin/paplay',
'/usr/share/sounds/freedesktop/stereo/message.oga'])
sleep(randint(180, 300))
notifica()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment