Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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