Thock

A personal project, built for the joy of typing.

I made Thock for myself, inspired by Hayyoth's calm, hand-coded programming videos like "No AI - Just pure JS hand coding to relax". It was never meant to be shared, but if you find it useful, you're welcome to use it. Thank you, Hayyoth. Go watch and support the channel.

Thock is an independent project, not affiliated with or endorsed by Hayyoth. The Coding Relax pack recreates the keyboard sound heard in one of Hayyoth's videos, for personal use only; it is not under a free license and will be removed on request.

Thock is a free Linux app that plays real mechanical keyboard sounds as you type.

Every key you press plays a real switch recording, from a buckling-spring IBM Model M to Topre, Box Jade and a vintage typewriter. It lives in your tray and stays out of the way.

Download for Linux | Source on GitHub | Release notes

Free. Ubuntu / Debian. X11 session. Version 1.0.0. Last updated: .

Install | FAQ | Sound packs | Troubleshooting | Credits


Install

One line, in a terminal:

cd ~ && wget -qO- https://github.com/christophervistal25/thock/releases/latest/download/thock-linux.tar.gz | tar xz && cd thock && ./install.sh && bin/thock

Or clone the repository:

git clone https://github.com/christophervistal25/thock ~/thock
cd ~/thock && ./install.sh

The installer installs any missing system packages (asks for your password once), adds Thock to the app menu and turns on start at login. Start it from the app menu or with bin/thock.

Requirements

Wayland isn't supported yet: it doesn't let apps hear system-wide key presses.

Something not working? See Troubleshooting below.

Update

Git install: cd ~/thock && git pull && ./install.sh. Download install: extract the new release over the old folder and run ./install.sh again. Your settings are kept.

Keep the folder where you installed it: the app menu entry and start at login point to it.


Using Thock

Run commands from the Thock folder (for example cd ~/thock).

WhatHow
Open settingsApp menu: Thock, tray icon: Settings..., or bin/thock --settings
Startbin/thock (also starts at login)
QuitTray: Quit Thock, or bin/thock --quit
Pause soundsTray: uncheck Sounds On, or the switch at the top of the settings window
Test the soundbin/thock --self-test (current pack) or bin/thock --self-test --all-packs
Measure latencybin/thock --latency-test
Settings file~/.config/thock/config.json (preferences only)

Troubleshooting

Thock doesn't open from the app menu

Run it in a terminal so you can see the error:

cd ~/thock && bin/thock --settings

If it was started at login, earlier errors are in the journal: journalctl --user -b | grep -i thock. The fixes below cover the usual messages.

No module named thock

The app menu entry points to a folder that moved or is out of date. Update and re-run the installer from the folder you want to keep:

cd ~/thock && git pull && ./install.sh     # or extract the latest release here, then ./install.sh

Missing module or library

For No module named 'gi', Namespace Gtk not available, Namespace AyatanaAppIndicator3 not available, No module named 'Xlib', PortAudio library not found or No module named 'sounddevice': a system package or the Python environment is missing. Re-run the installer, which installs what's missing:

cd ~/thock && ./install.sh

Or install the system packages by hand, then run ./install.sh again:

sudo apt install python3-venv python3-gi python3-xlib gir1.2-gtk-3.0 gir1.2-ayatanaappindicator3-0.1 libportaudio2

If the error persists, delete the environment so it's rebuilt: rm -rf .venv && ./install.sh.

No sound at all while typing, and you're on Wayland

echo $XDG_SESSION_TYPE prints wayland. Wayland doesn't let apps hear system-wide key presses, so Thock can't work there. Log out, click the gear icon on the login screen, choose Ubuntu on Xorg, and log in again.

No tray icon (GNOME)

GNOME needs the AppIndicator extension to show tray icons. Ubuntu ships it on by default (Ubuntu AppIndicators). Check and turn it on:

gnome-extensions list --enabled | grep -i appindicator
gnome-extensions enable ubuntu-appindicators@ubuntu.com

On other distributions install AppIndicator and KStatusNotifierItem Support from extensions.gnome.org. Thock still works without the icon; use bin/thock --settings to change settings.

No sound, or sound comes out of the wrong device

  1. Check that the right output is selected and not muted in Settings > Sound.
  2. Check Thock isn't paused (tray: Sounds On, or the switch in settings) and the volume isn't at 0.
  3. Run bin/thock --self-test. If you hear the test sweep, audio works and the problem is key capture (see Wayland and RECORD). If you don't, it's the audio output.
  4. Thock uses your system default output, so switch the default device in Sound settings, then restart Thock (bin/thock --quit, then bin/thock).

Sound feels delayed

Run bin/thock --latency-test; a healthy result is around 15 ms in total. Thock asks PipeWire for a 256-frame buffer. You can ask for a smaller one, or a larger one if you hear crackles:

bin/thock --quit
PIPEWIRE_LATENCY=128/48000 bin/thock     # lower latency
PIPEWIRE_LATENCY=512/48000 bin/thock     # more stable on slow machines

Bluetooth headphones add their own delay (often 100 ms or more); wired or USB audio is much faster.

X server has no RECORD extension

Thock reads key presses through the X11 RECORD extension, which almost every X server has. Check with:

xdpyinfo | grep -i record

If nothing is printed, your X server has it disabled (look for Option "RECORD" "false" or a Disable line in /etc/X11/xorg.conf or /etc/X11/xorg.conf.d/). Inside remote desktops and some virtual machines it may not be available at all.

"Already running", or the settings window won't open

Only one copy of Thock runs at a time; opening it again just brings up the settings window of the running copy. If the window doesn't appear, stop it and start fresh:

bin/thock --quit
pkill -f "python -m thock"     # only if --quit didn't stop it
bin/thock --settings

Turn off start at login

Settings > General > Start at login off, or:

rm ~/.config/autostart/thock.desktop

Uninstall

cd ~/thock && bin/thock --quit
rm -f ~/.config/autostart/thock.desktop ~/.local/share/applications/thock.desktop
rm -rf ~/.config/thock      # your settings
cd ~ && rm -rf ~/thock      # the app itself

The system packages install.sh added are shared with other apps, so they are left in place.

Still stuck? Open an issue with the output of bin/thock --settings and echo $XDG_SESSION_TYPE.


Sound packs

14 packs, all real recordings. Pick one from the tray menu or the settings window.

Calm and deep (new)

Classic

Features

Privacy

Input is read with the X RECORD extension. Only the event type (key down, key up, mouse button) and the keycode are used, in memory, to choose and pan a sound, and are dropped immediately. Nothing you type is logged, stored or sent. Thock makes no network connections.

Frequently asked questions

What is Thock?

Thock is a free Linux app that plays a real mechanical keyboard sound every time you press a key. It runs in the system tray and has 14 sound packs recorded from real keyboards.

Is Thock free?

Yes. Thock is free to download and use, and its source code is on GitHub.

Does Thock work on Windows or macOS?

No. Thock runs on Linux only: Ubuntu 22.04 or newer and other Debian-based distributions, in an X11 session.

Does Thock work on Wayland?

Not yet. Wayland does not let apps hear system-wide key presses. On Ubuntu, choose Ubuntu on Xorg at the login screen to use Thock.

Does Thock record or log what I type?

No. Thock only uses which key went down or up to pick and pan a sound, then forgets it. Nothing you type is logged, stored or sent, and Thock makes no network connections. Details: Privacy.

How do I install Thock on Ubuntu?

Run the one-line command in Install. The installer adds any missing system packages, puts Thock in the app menu and turns on start at login.

Which keyboard sounds does Thock include?

14 packs: Thocky, Rainy 75, Lubed Tactile, Buckling Spring (IBM Model M), Clicky Blue (Cherry MX Blue), Tactile Brown (Cherry MX Brown), Soft Tactile, Deep Clear (Cherry MX Clear), Smooth Linear, Box Jade, Topre, Vintage Alps, Typewriter and Laptop. See Sound packs.

Which Thock sound pack is the most relaxing?

Thocky and Rainy 75 are the calmest: deep, muffled sounds with soft attacks and little high-frequency click. Lubed Tactile is a warmer, smoother tactile option.

Is there a delay between typing and the sound?

About 15 ms in total, which feels instant. Bluetooth headphones add their own delay, often 100 ms or more; wired or USB audio is faster.

Can I make the sound deeper or brighter?

Yes. The tone slider in the settings window shifts every pack from deep "thock" to bright "clack".

How do I uninstall Thock?

Quit Thock, then delete its app menu entry, autostart entry, settings folder and the Thock folder. The exact commands are in Uninstall.

Who made Thock and why?

Thock is a personal project by Chris (christophervistal25 on GitHub), inspired by the calm, hand-coded programming videos of the YouTube channel Hayyoth. It was built for personal use and shared for anyone who finds it useful.

Screenshot

Thock settings window on Ubuntu showing the list of 14 mechanical keyboard sound packs


Sound credits

Thank you to everyone who recorded and shared these sounds. Every pack except Coding Relax is a genuine recording under a free license.

Calm and deep packs (CC0)

Classic packs (CC0)

Attribution required (CC BY 4.0)

GPL-2.0

Personal use only

Full list of sources, authors, licenses and edits: SOUNDS-LICENSES.md