Skip to content

Instantly share code, notes, and snippets.

@NanoDano
Last active June 23, 2021 04:09
Show Gist options
  • Save NanoDano/06ccc1ab71f3fbf8034c0e699f28735e to your computer and use it in GitHub Desktop.
Save NanoDano/06ccc1ab71f3fbf8034c0e699f28735e to your computer and use it in GitHub Desktop.
Healthy Reminders
#!/bin/bash
# Healthy Reminders
#
# Setup a cron job to remind you to do healthy things
# Install dependency with: `sudo apt install libnotify-bin`
#
# Usage: remind.sh "Time to hydrate."
#
# Some cron examples (`crontab -e`):
# 0 * * * * /home/dano/Healthy-Reminders/remind.sh "Time to stand up."
# */15 * * * * /home/dano/Healthy-Reminders/remind.sh "Time to hydrate."
# 30 * * * * /home/dano/Healthy-Reminders/remind.sh "Time to breathe."
# Notes on DBUS+cron from https://askubuntu.com/questions/298608/notify-send-doesnt-work-from-crontab
export $(egrep -z DBUS_SESSION_BUS_ADDRESS /proc/$(pgrep -u $LOGNAME gnome-session)/environ)
/usr/bin/notify-send -u low -t 60000 -a "Stay Healthy" "$1"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment