Unverified Commit f1821a59 authored by Erik Reider's avatar Erik Reider Committed by GitHub

Fixed Debian packaged configs being checked before user configs (#296)

parent e400600d
...@@ -106,10 +106,7 @@ namespace SwayNotificationCenter { ...@@ -106,10 +106,7 @@ namespace SwayNotificationCenter {
public static string get_style_path (owned string ? custom_path, public static string get_style_path (owned string ? custom_path,
bool only_system = false) { bool only_system = false) {
string[] paths = { string[] paths = {};
// Fallback location. Specified in postinstall.py
"/usr/local/etc/xdg/swaync/style.css"
};
if (custom_path != null && custom_path.length > 0) { if (custom_path != null && custom_path.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) == '~') {
...@@ -127,6 +124,11 @@ namespace SwayNotificationCenter { ...@@ -127,6 +124,11 @@ namespace SwayNotificationCenter {
paths += Path.build_path (Path.DIR_SEPARATOR.to_string (), paths += Path.build_path (Path.DIR_SEPARATOR.to_string (),
path, "swaync/style.css"); path, "swaync/style.css");
} }
// Fallback location. Specified in postinstall.py. Mostly for Debian
paths += "/usr/local/etc/xdg/swaync/style.css";
info ("Looking for CSS file in these directories:\n\t- %s",
string.joinv ("\n\t- ", paths));
string path = ""; string path = "";
foreach (string try_path in paths) { foreach (string try_path in paths) {
...@@ -144,10 +146,7 @@ namespace SwayNotificationCenter { ...@@ -144,10 +146,7 @@ namespace SwayNotificationCenter {
} }
public static string get_config_path (owned string ? custom_path) { public static string get_config_path (owned string ? custom_path) {
string[] paths = { string[] paths = {};
// Fallback location. Specified in postinstall.py
"/usr/local/etc/xdg/swaync/config.json"
};
if (custom_path != null && (custom_path = custom_path.strip ()).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) == '~') {
...@@ -167,6 +166,11 @@ namespace SwayNotificationCenter { ...@@ -167,6 +166,11 @@ namespace SwayNotificationCenter {
paths += Path.build_path (Path.DIR_SEPARATOR.to_string (), paths += Path.build_path (Path.DIR_SEPARATOR.to_string (),
path, "swaync/config.json"); path, "swaync/config.json");
} }
// Fallback location. Specified in postinstall.py. Mostly for Debian
paths += "/usr/local/etc/xdg/swaync/config.json";
info ("Looking for config file in these directories:\n\t- %s",
string.joinv ("\n\t- ", paths));
string path = ""; string path = "";
foreach (string try_path in paths) { foreach (string try_path in paths) {
......
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