From 50474f9fb2a9e7d56b0ecebce8cb713860ebb4a3 Mon Sep 17 00:00:00 2001 From: Anna Rose Wiggins Date: Tue, 1 Jul 2025 23:30:24 -0400 Subject: [PATCH] Add an 'evlist' command to help get the exact strings for device names. --- cmd/evlist/main.go | 17 +++++++++++++++++ internal/config/configparser.go | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 cmd/evlist/main.go diff --git a/cmd/evlist/main.go b/cmd/evlist/main.go new file mode 100644 index 0000000..568ce87 --- /dev/null +++ b/cmd/evlist/main.go @@ -0,0 +1,17 @@ +package main + +import ( + "fmt" + + "git.annabunches.net/annabunches/joyful/internal/logger" + "github.com/holoplot/go-evdev" +) + +func main() { + devices, err := evdev.ListDevicePaths() + logger.FatalIfError(err, "") + + for _, device := range devices { + fmt.Printf("%s: '%s'\n", device.Path, device.Name) + } +} diff --git a/internal/config/configparser.go b/internal/config/configparser.go index 43caeeb..ae464d8 100644 --- a/internal/config/configparser.go +++ b/internal/config/configparser.go @@ -118,7 +118,7 @@ func (parser *ConfigParser) ConnectPhysicalDevices() map[string]*evdev.InputDevi device, err := evdev.OpenByName(deviceConfig.DeviceName) if err != nil { - logger.LogError(err, "Failed to open physical device, skipping. Confirm the device name with 'evtest'") + logger.LogError(err, "Failed to open physical device, skipping. Confirm the device name with 'evlist'. Watch out for spaces.") continue }