Skip to content

Instantly share code, notes, and snippets.

@bashbunni
Created October 27, 2022 21:41
Show Gist options
  • Save bashbunni/f6b04fc4703903a71ce9f70c58345106 to your computer and use it in GitHub Desktop.
Save bashbunni/f6b04fc4703903a71ce9f70c58345106 to your computer and use it in GitHub Desktop.
CLI Pomodoro for Mac
# I'll be doing another one for Linux, but this one will give you
# a pop up notification and sound alert (using the built-in sounds for macOS)
# Requires https://github.com/caarlos0/timer to be installed
# Mac setup for pomo
alias work="timer 60m && terminal-notifier -message 'Pomodoro'\
-title 'Work Timer is up! Take a Break 😊'\
-appIcon '~/Pictures/pumpkin.png'\
-sound Crystal"
alias rest="timer 10m && terminal-notifier -message 'Pomodoro'\
-title 'Break is over! Get back to work 😬'\
-appIcon '~/Pictures/pumpkin.png'\
-sound Crystal"
@emmak3l
Copy link

emmak3l commented Sep 17, 2024

For anyone who wants the notification sound to play during "Do not disturb", try using afplay as the -ignoreDnD flag on terminal-notifier is broken. For example:

alias work="timer 30m -n work! --format 24h && terminal-notifier -message 'Pomodoro'\
	-title 'break!'\
	&& afplay /System/Library/Sounds/Glass.aiff"

I work in DnD mode too so I was running into the same issue! The way I fixed it so that it would both show the notification and play the sound is by going to System Preferences > Focus > Do Not Disturb > and then adding terminal-notifier to Allowed Apps. Now it works like a charm :)

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