Skip to content

Instantly share code, notes, and snippets.

@mpounsett
Created January 30, 2023 17:10
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 mpounsett/7116c5a0d7611655c980ef990f3a14c7 to your computer and use it in GitHub Desktop.
Save mpounsett/7116c5a0d7611655c980ef990f3a14c7 to your computer and use it in GitHub Desktop.
Pomodoro alias for MacOS
if [[ $OSTYPE =~ 'darwin.*' ]]; then
# Inspired by https://gist.github.com/bashbunni/f6b04fc4703903a71ce9f70c58345106
# requires:
# - https://github.com/caarlos0/timer
# - https://github.com/julienXX/terminal-notifier
#
POMO_WORKMSG="Work timer is up! Take a break."
POMO_WORKTIME=60m
POMO_RESTMSG="Break is over! Time to get back to work."
POMO_RESTTIME=10m
POMO_SOUND=Blow
POMO_OPTIONS=(-title Pomodoro -sound ${POMO_SOUND})
POMO_DATE=(date "+%H:%M")
alias work="timer ${POMO_WORKTIME} && terminal-notifier ${POMO_OPTIONS}\
-message '\[$(${POMO_DATE})] ${POMO_WORKMSG}'"
alias rest="timer ${POMO_RESTTIME} && terminal-notifier ${POMO_OPTIONS}\
-message '\[$(${POMO_DATE})] ${POMO_RESTMSG}'"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment