- C 88%
- Makefile 12%
| btshc.conf.example | ||
| btshc.service | ||
| LICENSE | ||
| main.c | ||
| Makefile | ||
| queue.c | ||
| queue.h | ||
| README.md | ||
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