powerful but friendly backup program that runs in your tray, powered by restic devins.page/restray
go restic system-tray
2

Configure Feed

Select the types of activity you want to include in your feed.

fix: show config parse errors

intergrav (Jul 10, 2026, 4:06 PM EDT) c7ca889d c8f89416

+28 -2
+16 -2
cmd/restray/config.go
··· 4 4 "bufio" 5 5 "bytes" 6 6 _ "embed" 7 + "errors" 8 + "fmt" 7 9 "log" 8 10 "os" 9 11 "path/filepath" ··· 89 91 GUI GUI `toml:"gui"` 90 92 Profile []Profile `toml:"profile,omitempty"` // deprecated, use [[profiles]] 91 93 Profiles []Profile `toml:"profiles"` 94 + loadErr error 92 95 } 93 96 94 97 func parseEnvFile(path string) (map[string]string, error) { ··· 182 185 var configDirOverride string 183 186 var dataDirOverride string 184 187 188 + func configLoadErrorMessage(err error) string { 189 + var parseErr toml.ParseError 190 + if errors.As(err, &parseErr) { 191 + return fmt.Sprintf("Config error: line %d, column %d", parseErr.Position.Line, parseErr.Position.Col) 192 + } 193 + return "Config error: " + err.Error() 194 + } 195 + 185 196 func configDir() string { 186 197 if configDirOverride != "" { 187 198 return configDirOverride ··· 233 244 234 245 func loadConfig() Config { 235 246 cfg := Config{} 236 - if _, err := toml.DecodeFile(configPath(), &cfg); err != nil && !os.IsNotExist(err) { 237 - log.Printf("config: %v", err) 247 + if _, err := toml.DecodeFile(configPath(), &cfg); err != nil { 248 + if !os.IsNotExist(err) { 249 + cfg.loadErr = err 250 + log.Printf("config: %s", configLoadErrorMessage(err)) 251 + } 238 252 } 239 253 if len(cfg.Profile) > 0 { 240 254 log.Printf("config: [[profile]] is deprecated, use [[profiles]] instead")
+12
cmd/restray/tray.go
··· 524 524 pendingFullApply = false 525 525 cfg := loadConfig() 526 526 applyIconMode(cfg.GUI.Icon) 527 + if cfg.loadErr != nil { 528 + setIconAnimated("fail") 529 + mGlobalStatus.SetTitle(configLoadErrorMessage(cfg.loadErr)) 530 + mGlobalStatus.Show() 531 + hideActions() 532 + mProfile.Disable() 533 + for i := range mStatusItems { 534 + mStatusItems[i].Hide() 535 + profileItems[i].Hide() 536 + } 537 + return 538 + } 527 539 state.mu.Lock() 528 540 state.notifications = strings.ToLower(cfg.GUI.Notifications) 529 541 state.mu.Unlock()