A dumb, small keyboard driven command launcher
  • C 88%
  • Makefile 12%
Find a file
2026-01-01 17:55:45 +01:00
btshc.conf.example 1st commit of btshc 2026-01-01 17:55:45 +01:00
btshc.service 1st commit of btshc 2026-01-01 17:55:45 +01:00
LICENSE Initial commit 2024-01-31 22:04:09 +01:00
main.c 1st commit of btshc 2026-01-01 17:55:45 +01:00
Makefile 1st commit of btshc 2026-01-01 17:55:45 +01:00
queue.c Do not wait _cond if there are keys to be handled. 2024-02-11 18:37:56 +01:00
queue.h 1st commit of btshc 2026-01-01 17:55:45 +01:00
README.md 1st commit of btshc 2026-01-01 17:55:45 +01:00

btshc

A dumb, small keyboard driven command launcher

Buttons Shell Commands (btshc) is a background service daemon that reads keys from your computer's keyboard that triggers configurable shell commands.

dependencies

The following software libraries are needed in order to build btshc:

They are normally already present in your Linux Operating System. You must install their development packages. On Debian or Ubuntu this is a matter of typing:

$ sudo apt install libudev-dev libinput-dev

testing

$ make btshc
$ sudo ./btshc -d ./btshc.conf.example

This will use the UID input and produce a command ls -l when hitting the function key F1, and the argument -d makes every key pressed show the name of the key to use in the config file.

running as a systemd service

$ sudo make install
$ sudo make conf
$ sudo editor /etc/btshc.conf
$ edit btshc.service # you may tweak the file
$ sudo make systemd
$ sudo systemctl enable btshc
$ sudo systemctl start btshc

The format of the config file is the following:

RUNASUID = <user_id>
RUNASGID = <group_id>

COMMAND = <KEY_NAME> = <shell_command>
…

Usually you would want to use your own user ID and the group input.

uninstalling

$ sudo systemctl stop btshc
$ sudo systemctl disable btshc
$ sudo make uninstall

acknowledgements

Thanks to Ben for providing the starting point: btmpc