-
Star
(277)
You must be signed in to star a gist -
Fork
(35)
You must be signed in to fork a gist
-
-
Save bashbunni/f6b04fc4703903a71ce9f70c58345106 to your computer and use it in GitHub Desktop.
# 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" |
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 :)
Sorry I'm late to the game here. So do you just sacrifice a terminal when you run this? Or you ctrl-z + bg your work alias so you can still use the terminal? When I saw the youtube I was imagining it would adjust the prompt or something.
Sorry I'm late to the game here. So do you just sacrifice a terminal when you run this? Or you ctrl-z + bg your work alias so you can still use the terminal? When I saw the youtube I was imagining it would adjust the prompt or something.
Brother you need to use Tmux or smth like that to split the terminal and work on the same window. Otherwise, yes, you will sacrifice one terminal window just for this.
In case anyone else wanted this. Added functions for specifying the time.
Use:
w 50 # work 50 minutes
# Mac setup for pomo
alias work="timer 60m && terminal-notifier -message 'Pomodoro'\
-title 'Work Timer is up! Take a Break 😊'\
-appIcon '~/Pictures/pumpkin.jpg'\
-sound Crystal"
alias rest="timer 10m && terminal-notifier -message 'Pomodoro'\
-title 'Break is over! Get back to work 😬'\
-appIcon '~/Pictures/pumpkin.jpg'\
-sound Crystal"
w() {
timer "${1}m" && terminal-notifier -message 'Pomodoro'\
-title 'Work Timer is up! Take a Break 😊'\
-appIcon '~/Pictures/pumpkin.jpg'\
-sound Crystal
}
r() {
timer "${1}m" && terminal-notifier -message 'Pomodoro'\
-title 'Break is over! Get back to work 😬'\
-appIcon '~/Pictures/pumpkin.jpg'\
-sound Crystal
}
Okay, I have a plenty time to figure out how works in fish shell with kitty terminal. But in anyone want this, just copy and paste: