# MacOS – Trigger Notification Center when long-running commands finishes

> As a developer, I often run commands that take a while to finish: git pull composer install npm install Considering that I am not a very patient person, I get \[…\]

Source: https://antistatique.net/en/blog/macos-trigger-notification-center-when-long-running-commands-finishes

Category: Agency life

# MacOS – Trigger Notification Center when long-running commands finishes

Author(s)

[

![Kevin](https://images.statique.ch/t/w_750,h_750,c_fill,f_jpeg,q_70/wp/app/uploads/2020/12/Kevin-300x300.jpg)



](/en/agence/kevin)

[Kevin](/en/agence/kevin)3 August 2016

As a developer, I often run commands that take a while to finish:

-   `git pull`
-   `composer install`
-   `npm install`

Considering that I am not a very patient person, I get really bored waiting for these commands to finish, so during that time I usually switch to some other occupation such as:

-   Checking Twitter/Tech/Hacking websites,
-   Making & (sometimes) drinking coffee,
-   Playing [T-Rex Runner](http://apps.thecodepost.org/trex/trex.html) - The hidden endless running game of Chrome.

15 minutes later, I finally come back to my terminal with a cold coffee and I discover that I forgot to `cd` in the correct folder. Repeat for another 15 minutes.

**Isn't there a better way?**

> “ Work is hard. Distractions are plentiful. And time is short. ”
> 
> Adam Hochschild
> 
> American author, journalist, and lecturer

### Solution N°0 - The Junior Professor

Waiting by watching some Gifs right on the terminal with [Gifi](https://github.com/vdemedes/gifi). One of my favourite solutions but not enough "cool" for some people.

### Solution N°1 - The Middle-Earth Paradigm

Making all tools faster and developers more patient. That would work in a parallel universe where magic exists, maybe.

### Solution N°2 - The Luminous Fish Effect

Use a short script that uses `terminal-notifier` & append it to each command such as

```
git pull repo@github.com | notify-me
```

That's pretty cool and do the job but ... I'm lazy and I don't want to append anything to my commands or predict if my command is a long-running command or not before even running it.

### Solution N°3 - The Friendship Algorithm

What about trying another approach ? Instead of trying to detect long-running commands, we could simply send a notification when the CLI is not in the foreground. Mmmh, sounds good but is that possible ? With iTerm & OSX 10.9+, you can do this !!

-   Create a new command named `notify`:

```
touch /usr/local/bin/notify && chmod +x /usr/local/bin/notify
vim /usr/local/bin/notify
```

-   Copy and paste this system script inside:

-   Add a custom function named `f_notifyme` and expose it to iTerm using `PS1`

```
vim ~/.zshrc
```

-   Copy and paste the function

-   We did it ! Finally, reload the source file of your terminal `source ~/.zshrc` and enjoy !

## More articles

Author(s)

[

![Anthony](https://images.statique.ch/t/w_750,h_750,c_fill,f_jpeg,q_70/wp/app/uploads/2024/11/anthony-1-300x300.png)



](/en/agence/anthony-salamone)

[Anthony](/en/agence/anthony-salamone)28 September 2026

### [Smashing Conference Freiburg 2026](/en/blog/smashing-conference-freiburg-2026)

Back in Freiburg for Smashing Conference 2026: AI and design systems, deeply technical CSS and HTML, and more human talks about teams and mindset. Here's what we took away.

Back in Freiburg for Smashing Conference 2026: AI and design systems, deeply technical CSS and HTML, and more human talks about teams and mindset. Here's what we took away.

[

![Smashing Conference Freiburg 2026 poster](https://images.statique.ch/t/w_750,h_500,c_fill,f_jpeg,q_70/assets/blog/smashing-2026.png)



](/en/blog/smashing-conference-freiburg-2026)

Author(s)

[

![Elisa](https://images.statique.ch/t/w_750,h_750,c_fill,f_jpeg,q_70/wp/app/uploads/2026/08/Elisa_Small-300x300%20(1).jpg)



](/en/agence/elisa-benaissa)

[Elisa](/en/agence/elisa-benaissa)23 July 2026

### [Passwordless authentication and PWA installation : what we learned about our usability tests](/en/blog/passwordless-authentication-and-pwa-installation-what-we-learned-about-our-usability-tests)

It had been a while since we last ran usability tests. It’s one of our favourite parts of the job, though. With summer finally here and temperatures climbing, we figured \[…\]

It had been a while since we last ran usability tests. It’s one of our favourite parts of the job, though. With summer finally here and temperatures climbing, we figured \[…\]

[

![Passwordless authentication and PWA installation : what we learned about our usability tests](https://images.statique.ch/t/w_750,h_500,c_fill,f_jpeg,q_70/wp/app/uploads/2026/07/image-pwa-768x512.jpg)



](/en/blog/passwordless-authentication-and-pwa-installation-what-we-learned-about-our-usability-tests)

Author(s)

[

![Akira](https://images.statique.ch/t/w_750,h_750,c_fill,f_jpeg,q_70/wp/app/uploads/2025/03/akira-small-300x300.jpg)



](/en/agence/akira-kamata)

[Akira](/en/agence/akira-kamata)22 July 2026

### [Making of : “La nuit des Losers”](/en/blog/making-of-la-nuit-des-losers)

lanuitdeslosers.ch, built fast: paper wireframes, a bold hand-drawn identity, then Claude Code to prototype and ship. A mouse-tracking hero animation, a bowling game made of sponsor logos, and a few bugs we’re keeping.

lanuitdeslosers.ch, built fast: paper wireframes, a bold hand-drawn identity, then Claude Code to prototype and ship. A mouse-tracking hero animation, a bowling game made of sponsor logos, and a few bugs we’re keeping.

[

![Making of : “La nuit des Losers”](https://images.statique.ch/t/w_750,h_500,c_fill,f_jpeg,q_70/wp/app/uploads/2026/05/La-nuit-des-Losers-Teaser-1-768x576.png)



](/en/blog/making-of-la-nuit-des-losers)
