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:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user