Created
June 30, 2021 07:33
Star
You must be signed in to star a gist
Aviso para mellorar a postura sentado
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
#!/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