Skip to content

Instantly share code, notes, and snippets.

@cesartalves
Created April 8, 2020 13:20
Show Gist options
  • Save cesartalves/208e807672dbf09bb5e61242b46c92c6 to your computer and use it in GitHub Desktop.
Save cesartalves/208e807672dbf09bb5e61242b46c92c6 to your computer and use it in GitHub Desktop.
health-check-crontab
# * * * * * DISPLAY=:0 /usr/bin/zenity --info --text="stretch" --title="reminder"
# * * * * * /bin/echo "cron works" >> /tmp/file
# * * * * * /usr/bin/zenity --notification --text="stretch" --title="reminder" --display=:0.0
# this one on top doesn't work unless we do as below
DISPLAY=:0.0
# * * * * * eval "export $(egrep -z DBUS_SESSION_BUS_ADDRESS /proc/$(pgrep -u $LOGNAME gnome-session)/environ)"; /usr/bin/notify-send "TEST" "Crons work!"
40 * * * * eval "export $(egrep -z DBUS_SESSION_BUS_ADDRESS /proc/$(pgrep -u $LOGNAME gnome-session)/environ)"; /usr/bin/notify-send "REMINDER" "Check posture!"
30 10,14,17 * * * eval "export $(egrep -z DBUS_SESSION_BUS_ADDRESS /proc/$(pgrep -u $LOGNAME gnome-session)/environ)"; /usr/bin/notify-send "REMINDER" "Take a break! (stretch, coffee, etc)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment