USB Equipment Commander
Find a file
2025-12-15 15:07:55 +01:00
.github Add pull_request_template.md 2025-12-15 15:07:55 +01:00
config Make usbec fully configurable 2024-09-20 12:52:34 -05:00
.editorconfig Initial commit 2024-02-10 19:28:06 -05:00
.gitignore Initial commit 2024-02-10 19:28:06 -05:00
.goreleaser.yaml Disable linux_386 2024-09-21 10:42:49 -05:00
go.mod Update dependencies 2025-10-30 12:02:12 +01:00
go.sum Update dependencies 2025-10-30 12:02:12 +01:00
LICENSE Added LICENSE 2024-02-10 19:48:58 -05:00
main.go Add debug output 2024-11-13 05:41:55 -05:00
README.md Update README.md 2025-10-30 11:31:24 +01:00
usbec.toml Make usbec fully configurable 2024-09-20 12:52:34 -05:00

usbec

The USB Equipment Commander is a lightweight daemon that is able to run commands based on the USB equipment connected to a computer. It makes it easily possible to run scripts and programs when specific USB devices are being connected or disconnected.

"Why, there's udev for that?!" you might say. Sure, but udev rules come with all sorts of limitations, making it very cumbersome to run especially Wayland-related commands. Often times, rules that trigger user-specific scripts and tools are hacky at best, given the constrains imposed by udev.

The daemon can be fully configured using a toml file.

Build

go build .

Configure

Check out the example config and create a similar config under any of the usual configuration paths (/etc/usbec.toml, $XDG_CONFIG_HOME/usbec.toml, ./usbec.toml).

Run

usbec

What can I do with usbec?

Examples include disabling the internal keyboard when you connect an external keyboard to your laptop, triggering a script that runs a backup on an external hard drive as soon as it's being connected, opening a LUKS encrypted device when a USB stick containing a key was inserted and much more.