π₯ 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