Skip to content

Instantly share code, notes, and snippets.

@th0j
Last active October 28, 2018 10:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save th0j/6a2c8f8d54ef0f68ffc83957f05ca767 to your computer and use it in GitHub Desktop.
Save th0j/6a2c8f8d54ef0f68ffc83957f05ca767 to your computer and use it in GitHub Desktop.
Send notification to remember drink water
eval "export $(egrep -z DBUS_SESSION_BUS_ADDRESS /proc/$(pgrep -u $LOGNAME gnome-session)/environ)";
DISPLAY=:0 notify-send "Hey!!!" "Keep your back straight and remember drink water!"
echo 'Hey!!!" "Keep your back straight and remember drink water!' | terminal-notifier -sound default

SETUP FOR LINUX

sudo chmod +x /path/to/.drink_water_linux.sh
crontab -e

SETUP FOR MACOS

Install terminal-notifier

brew install terminal-notifier

Install

sudo chmod +x /path/to/.drink_water_osx.sh
crontab -e

Add this line to setup crontab

*/15 * * * * /path/to/.drink_water.sh

visualization crontab

https://crontab.guru/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment