Fix HID timeout/EINTR errors and relative icon paths

- Treat "timeout" and "interrupted system call" from ReadWithTimeout as
  non-fatal — hidraw on Linux returns errors instead of (0, nil) for
  both, causing false device-dead detection and reconnect loops
- Resolve icons_dir relative to the config file when the path is not
  absolute, so the service finds icons regardless of working directory
- Installer now copies bundled icons to the config dir on first install
This commit is contained in:
2026-03-15 10:36:44 -06:00
parent 84430cb84b
commit b428f4861a
3 changed files with 64 additions and 2 deletions

View File

@@ -49,5 +49,11 @@ func Load(path string) (*Config, error) {
return nil, fmt.Errorf("parse config: %w", err)
}
// Resolve relative icons_dir against the config file's directory so the
// binary works regardless of the working directory (e.g. as a systemd service).
if !filepath.IsAbs(cfg.IconsDir) {
cfg.IconsDir = filepath.Join(filepath.Dir(path), cfg.IconsDir)
}
return cfg, nil
}