Add an 'evlist' command to help get the exact strings for device names.

This commit is contained in:
Anna Rose Wiggins 2025-07-01 23:30:24 -04:00
parent a18275f53b
commit 50474f9fb2
2 changed files with 18 additions and 1 deletions

17
cmd/evlist/main.go Normal file
View file

@ -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)
}
}

View file

@ -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
}