Commit 0532fb38 authored by Erik Reider's avatar Erik Reider

Warn user if the custom config isn't found

parent 5eb7c2a5
...@@ -144,12 +144,17 @@ namespace SwayNotificationCenter { ...@@ -144,12 +144,17 @@ namespace SwayNotificationCenter {
// Fallback location. Specified in postinstall.py // Fallback location. Specified in postinstall.py
"/usr/local/etc/xdg/swaync/config.json" "/usr/local/etc/xdg/swaync/config.json"
}; };
if (custom_path != null && custom_path.length > 0) { if (custom_path != null && (custom_path = custom_path.strip ()).length > 0) {
// Replaces the home directory relative path with a absolute path // Replaces the home directory relative path with a absolute path
if (custom_path.get (0) == '~') { if (custom_path.get (0) == '~') {
custom_path = Environment.get_home_dir () + custom_path[1:]; custom_path = Environment.get_home_dir () + custom_path[1:];
} }
if (File.new_for_path (custom_path).query_exists ()) {
paths += custom_path; paths += custom_path;
} else {
critical ("Custom config file \"%s\" not found, skipping...", custom_path);
}
} }
paths += Path.build_path (Path.DIR_SEPARATOR.to_string (), paths += Path.build_path (Path.DIR_SEPARATOR.to_string (),
Environment.get_user_config_dir (), Environment.get_user_config_dir (),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment