usb-ks

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 822785a24f970bbad0df6d5a6b90bb318e2a194d
parent cc3b7d949c9b15c8368c76fecbc398d6b2ad580b
Author: Andrew Laack <andrew@laack.co>
Date:   Sun, 15 Mar 2026 16:13:08 -0500

Readme

Diffstat:
AREADME.md | 30++++++++++++++++++++++++++++++
Mmain.go | 2+-
2 files changed, 31 insertions(+), 1 deletion(-)

diff --git a/README.md b/README.md @@ -0,0 +1,30 @@ +# usb-ks + +usb-ks is a USB killswitch program, inspired by [https://github.com/BusKill/buskill-app](https://github.com/BusKill/buskill-app), but simplified and written in Go instead of Python. Additionally, usb-ks executes the specified command on all USB device changes, not just disconnects. + +# installation + +```go install git.laack.co/andrewlaack/usb-ks@latest``` + +NOTE: ensure your go installation directory (default: ~/go/bin) is on your path as this is the default installation location. + +## dependencies + +- go +- [libudev](https://www.freedesktop.org/software/systemd/man/latest/libudev.html) +- a shell + - /bin/sh is used to execute the specified command + +# usage + +Basic invocation, executing xscreensaver on USB device change: + +```usb-ks``` + +Execute `shutdown` on USB device change: + +```usb-ks shutdown``` + +See options: + +```usb-ks --help``` diff --git a/main.go b/main.go @@ -10,7 +10,7 @@ import ( "os/exec" ) -const ShellToUse = "bash" +const ShellToUse = "/bin/sh" func Shellout(command string) (string, string, error) { var stdout bytes.Buffer