Created
January 20, 2026 10:08
-
-
Save devproblemssolutions/4106708b2b0fa54e814f2288d5e7ac5e to your computer and use it in GitHub Desktop.
Mindful Terminal for Developers
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # ----------------------------------------------------------------------------- | |
| # πΏ Mindful Terminal | |
| # | |
| # Read more: https://www.devproblems.com/developer-mindfulness | |
| # | |
| # A simple shell script to trigger mindfulness prompts before long-running | |
| # developer commands (npm install, docker build, etc). | |
| # | |
| # HOW IT WORKS: | |
| # This script is SEQUENTIAL. It introduces a deliberate delay (default: 3s) | |
| # to force a moment of pause before the actual command executes. | |
| # | |
| # INSTALLATION: | |
| # 1. Copy this content. | |
| # 2. Paste it at the bottom of your configuration file: | |
| # - For recent macOS (Zsh): ~/.zshrc | |
| # - For older macOS/Linux (Bash): ~/.bashrc | |
| # 3. Run `source ~/.zshrc` (or ~/.bashrc) to apply. | |
| # ----------------------------------------------------------------------------- | |
| # 1. THE CONTENT | |
| # Selects a random mindful prompt to display | |
| function trigger_mindfulness() { | |
| local prompts=( | |
| "π¬οΈ Take a deep breath in... hold... and let it go." | |
| "π Look away from the screen. Focus on something 20 feet away." | |
| "π Unclench your jaw. Drop your shoulders." | |
| "π§ Have you had enough water today?" | |
| "π§ The code will be building soon. You can rest for a moment." | |
| "π§ Notice the silence between the keystrokes." | |
| "π² Nature does not hurry, yet everything is accomplished." | |
| ) | |
| # Pick a random quote | |
| # (Logic works for both Zsh and Bash) | |
| local msg="${prompts[$RANDOM % ${#prompts[@]} + 1]}" | |
| if [ -z "$msg" ]; then msg=${prompts[0]}; fi | |
| # Print the message | |
| echo "" | |
| echo "---------------------------------------------------" | |
| echo -e " $msg" | |
| echo "---------------------------------------------------" | |
| echo "" | |
| # THE DELAY | |
| # We deliberately sleep for 3 seconds to force the pause. | |
| # The actual command will NOT run until this sleep finishes. | |
| sleep 3 | |
| } | |
| # 2. THE WRAPPERS | |
| # These intercept specific commands to check if they are "heavy" tasks. | |
| # Node / NPM | |
| npm() { | |
| if [[ "$*" == *"install"* || "$*" == *"ci"* || "$*" == *"build"* ]]; then | |
| trigger_mindfulness | |
| fi | |
| command npm "$@" | |
| } | |
| # Yarn | |
| yarn() { | |
| if [[ "$*" == *"install"* || "$*" == *"build"* || "$*" == *"add"* ]]; then | |
| trigger_mindfulness | |
| fi | |
| command yarn "$@" | |
| } | |
| # PHP / Composer | |
| composer() { | |
| if [[ "$*" == *"install"* || "$*" == *"update"* ]]; then | |
| trigger_mindfulness | |
| fi | |
| command composer "$@" | |
| } | |
| # Docker | |
| docker() { | |
| if [[ "$*" == *"build"* || "$*" == *"compose up"* ]]; then | |
| trigger_mindfulness | |
| fi | |
| command docker "$@" | |
| } | |
| # iOS / CocoaPods | |
| pod() { | |
| if [[ "$*" == *"install"* || "$*" == *"update"* ]]; then | |
| trigger_mindfulness | |
| fi | |
| command pod "$@" | |
| } | |
| # Rust / Cargo | |
| cargo() { | |
| if [[ "$*" == *"build"* ]]; then | |
| trigger_mindfulness | |
| fi | |
| command cargo "$@" | |
| } | |
| # Git (Clone/GC can take a while) | |
| git() { | |
| if [[ "$*" == *"clone"* || "$*" == *"gc"* ]]; then | |
| trigger_mindfulness | |
| fi | |
| command git "$@" | |
| } |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Read more about it