DEV Community

Cover image for I built a tiny Linux tool that shouts “FAHH” when I type the wrong command
Hamza
Hamza

Posted on

I built a tiny Linux tool that shouts “FAHH” when I type the wrong command

I built a tiny Linux tool that shouts “FAHH” when I type the wrong command

A few weeks ago I noticed something about the way I work in the terminal.

When I’m focused and typing commands fast, I tend to make a lot of small mistakes.

Wrong command.

Misspelled command.

Sometimes I just type something that doesn't exist.

And the terminal just replies with the usual:

command not found
Enter fullscreen mode Exit fullscreen mode

That message is… boring.

And also very easy to ignore.

So I started thinking:

What if the terminal could actually react when I type something wrong?

Not visually.

Not with an error popup.

But with sound.

Something dramatic.

Something like:

FAHH.


The idea

I wanted something very simple:

Whenever I type a command that doesn't exist in the terminal, play a sound.

Nothing fancy.

Just a tiny reaction that reminds me:

"Hey… that command doesn't exist."

I initially looked for something like this inside VSCode extensions.

There were some interesting ones, but they only worked inside the editor terminal.

I wanted something that works everywhere:

  • WSL
  • Debian
  • normal Linux terminals
  • zsh
  • bash

Basically anything I run in the shell.

So I decided to build a tiny CLI tool for it.


The result

I ended up creating a small tool called:

fahhctl

What it does is very simple.

When you type a command that doesn't exist:

fakecommand
Enter fullscreen mode Exit fullscreen mode

You still see the normal error message:

command not found: fakecommand
Enter fullscreen mode Exit fullscreen mode

But you also hear:

FAHH 🔊


How it works

The tool installs a small hook into your shell configuration.

When the shell detects a command that doesn't exist, it simply runs:

fahhctl play
Enter fullscreen mode Exit fullscreen mode

Which plays a sound file.

That’s it.

No background process.

No daemon.

Just a tiny hook and a sound.


Installation

If you're curious and want to try it:

curl -fsSL https://raw.githubusercontent.com/hamza-topo/fahhctl/main/install.sh | bash
Enter fullscreen mode Exit fullscreen mode

Then reload your shell:

source ~/.zshrc
Enter fullscreen mode Exit fullscreen mode

Now try typing something wrong.


Customize the sound

The default sound is a dramatic FAHH, but you can replace it with anything.

The sound file lives here:

~/.local/share/fahh/fahh.mp3
Enter fullscreen mode Exit fullscreen mode

So you can replace it with:

  • a meme sound
  • a warning beep
  • a voice saying "wrong command"
  • whatever you want

Why I actually like this

It sounds silly, but it’s surprisingly useful.

The sound acts like a tiny feedback loop.

Instead of silently ignoring mistakes, the terminal gives a quick reaction.

It helps me stay a bit more focused when I’m typing commands fast.

Also… it's just fun.


The project

If you're curious about the code or want to try it:

https://github.com/hamza-topo/fahhctl

It's a very small project, but it was fun to build.

And sometimes the smallest tools are the most satisfying ones.

Top comments (0)