diff --git a/bin/nwg-drawer b/bin/nwg-drawer index 3a8104e..55ec2e3 100755 Binary files a/bin/nwg-drawer and b/bin/nwg-drawer differ diff --git a/main.go b/main.go index 7c47e5a..6f0659f 100644 --- a/main.go +++ b/main.go @@ -263,20 +263,28 @@ func main() { // For opening files we use xdg-open. As its configuration is PITA, we may override some associations // in the ~/.config/nwg-panel/preferred-apps.json file. paFile := path.Join(configDirectory, "preferred-apps.json") - preferredApps, err = loadPreferredApps(paFile) - if err != nil { - log.Infof("Custom associations file %s not found or invalid", paFile) + if pathExists(paFile) { + preferredApps, err = loadPreferredApps(paFile) + if err != nil { + log.Infof("Custom associations file %s not found or invalid", paFile) + } else { + log.Infof("Found %v associations in %s", len(preferredApps), paFile) + } } else { - log.Infof("Found %v associations in %s", len(preferredApps), paFile) + log.Infof("%s file not found", paFile) } // Load user-defined paths excluded from file search exFile := path.Join(configDirectory, "excluded-dirs") - exclusions, err = loadTextFile(exFile) - if err != nil { - log.Infof("Search exclusions file %s not found %s", exFile, err) + if pathExists(exFile) { + exclusions, err = loadTextFile(exFile) + if err != nil { + log.Infof("Search exclusions file %s not found %s", exFile, err) + } else { + log.Infof("Found %v search exclusions in %s", len(exclusions), exFile) + } } else { - log.Infof("Found %v search exclusions in %s", len(exclusions), exFile) + log.Infof("%s file not found", exFile) } // USER INTERFACE