πŸ’₯ Add a β€œFAHHH” Sound Every Time Your Terminal Command Fails (Ubuntu, macOS & Windows)

Just a dumb/fun little idea to make terminal life more dramatic 😈

Every time a command fails β†’ it plays a FAHHH sound.

Works on:

  • 🐧 Ubuntu / Linux (bash)
  • 🍎 macOS (zsh)
  • πŸͺŸ Windows (PowerShell)

------------------------------

πŸ”Š Download Sound

Download from:
https://www.myinstants.com/en/instant/fahhh-42300/

Rename it to:

fahhh.wav

If it downloads as mp3, convert it:

ffmpeg -i fahhh.mp3 fahhh.wav

-----------------------

🐧 Ubuntu / Linux (Bash)

βœ… One-Command Installer

bash -c 'sudo apt update -y && sudo apt install -y pulseaudio-utils && \
mkdir -p $HOME/.fahhh && \
grep -q "FAHHH_ERROR_SOUND" $HOME/.bashrc || cat >> $HOME/.bashrc << "EOF"

# ===== FAHHH_ERROR_SOUND =====
fahhh() {
    local exit_code=$?
    if [ $exit_code -ne 0 ]; then
        nohup paplay $HOME/.fahhh/fahhh.wav >/dev/null 2>&1 &
    fi
}
PROMPT_COMMAND=fahhh
# ===== END_FAHHH =====
EOF
source $HOME/.bashrc'

πŸ“Œ Put sound file here:

~/.fahhh/fahhh.wav

Test:

ls does_not_exist

------------------------------------

🍎 macOS (zsh default)

macOS uses afplay.

βœ… One-Command Installer

bash -c 'mkdir -p $HOME/.fahhh && \
grep -q "FAHHH_ERROR_SOUND" $HOME/.zshrc || cat >> $HOME/.zshrc << "EOF"

# ===== FAHHH_ERROR_SOUND =====
fahhh() {
    local exit_code=$?
    if [ $exit_code -ne 0 ]; then
        afplay $HOME/.fahhh/fahhh.wav >/dev/null 2>&1 &
    fi
}
precmd() { fahhh }
# ===== END_FAHHH =====
EOF
source $HOME/.zshrc'

Put sound file at:

~/.fahhh/fahhh.wav

------------------------------------

πŸͺŸ Windows (PowerShell)

⚠️ Must use .wav (MP3 not supported).

βœ… Setup

Open PowerShell and run:

$profilePath = $PROFILE
if (!(Test-Path $profilePath)) { New-Item -ItemType File -Path $profilePath -Force }

Add-Content $profilePath @"

# ===== FAHHH_ERROR_SOUND =====
function Invoke-Fahhh {
    if (-not $?) {
        $player = New-Object System.Media.SoundPlayer "$HOME\.fahhh\fahhh.wav"
        $player.Play()
    }
}
Register-EngineEvent PowerShell.OnIdle -Action { Invoke-Fahhh } | Out-Null
# ===== END_FAHHH =====
"@

Then:

Create folder:

C:\Users\YourName\.fahhh\

Put fahhh.wav inside.
Restart PowerShell.

-----------------------------

⚑ Why nohup?

Prevents:

[1]+ Done paplay ...

Keeps terminal clean.

Posted Feb 26, 2026, 3:19 AM UTC

10
Loading comments…