th-cmd command not found

In this troubleshooting guide we learn how to fix th-cmd command not found error message

Introduction

When you run more command in linux terminal / console, you get the following error message

th-cmd: command not found

or when using sudo you get the following error message

sudo: th-cmd: command not found

Solutions to th-cmd: command not found

How To Fix th-cmd: command not found in Ubuntu / Debian / Kali Linux / Raspbian

In Ubuntu th-cmd is provided by triggerhappy package.

triggerhappy is:

Triggerhappy watches connected input devices for certain key presses or other input events and runs administrator-configured commands when they occur. Unlike other hotkey daemons, it runs as a persistent, systemwide service and therefore can be used even outside the context of a user or X11 session.

It can handle a wide variety of devices (keyboards, joysticks, wiimote, etc.), as long as they are presented by the kernel as generic input devices. No kernel patch is required. The daemon is a userspace program that polls the /dev/input/event? interfaces for incoming key, button and switch events. A single daemon can monitor multiple input devices and can dynamically add additional ones. Hotkey handlers can be assigned to dedicated (tagged) devices or globally.

For example, this package might be useful on a headless system to use input events generated by a remote control to control an mpd server, but can also be used to allow the adjustment of audio and network status on a notebook without relying on user specific configuration.

Key combinations are supported as well as the hotplugging of devices using a udev hotplug script; the running daemon can also be influenced by a client program, e.g. to temporarily pause the processing of events or switch to a different set of hotkey bindings.

To fix this problem, we can install more using the command below.

sudo apt-get -y install triggerhappy

This command might take some time to finish depending on your machine internet connection.

You can also use apt command to install triggerhappy.

sudo apt -y install triggerhappy

Or if you have aptitude installed you can use the following command.

sudo aptitude install triggerhappy

Summary

In this tutorial we learn how to fix th-cmd command not found error in Ubuntu / Debian / Kali Linux or Raspbian distribution.