Skip to content

Instantly share code, notes, and snippets.

@serxoz
Created June 30, 2021 07:33
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save serxoz/f4f8d72aa128319d6145759ca9ccda84 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