diff --git a/src/constants.vala.in b/src/constants.vala.in index 31779bc1..4f354f64 100644 --- a/src/constants.vala.in +++ b/src/constants.vala.in @@ -1,5 +1,6 @@ public class Constants { public const string VERSION = @VERSION@; public const string VERSIONNUM = @VERSION_NUM@; + public const string CONFIGPATH = @CONFIG_PATH@; public const uint ANIMATION_DURATION = 400; } diff --git a/src/functions.vala b/src/functions.vala index ec554534..3a9c9aba 100644 --- a/src/functions.vala +++ b/src/functions.vala @@ -145,7 +145,8 @@ namespace SwayNotificationCenter { path, "swaync/style.css"); } // Fallback location. Specified in postinstall.py. Mostly for Debian - paths += "/usr/local/etc/xdg/swaync/style.css"; + paths += Path.build_path (Path.DIR_SEPARATOR.to_string (), + Constants.CONFIGPATH, "style.css"); info ("Looking for CSS file in these directories:\n\t- %s", string.joinv ("\n\t- ", paths)); @@ -187,7 +188,8 @@ namespace SwayNotificationCenter { path, "swaync/config.json"); } // Fallback location. Specified in postinstall.py. Mostly for Debian - paths += "/usr/local/etc/xdg/swaync/config.json"; + paths += Path.build_path (Path.DIR_SEPARATOR.to_string (), + Constants.CONFIGPATH, "config.json"); info ("Looking for config file in these directories:\n\t- %s", string.joinv ("\n\t- ", paths)); diff --git a/src/meson.build b/src/meson.build index 7b9700f5..17c53e11 100644 --- a/src/meson.build +++ b/src/meson.build @@ -16,6 +16,7 @@ version = 'swaync @0@'.format(version) const_config_data = configuration_data() const_config_data.set_quoted('VERSION', version) const_config_data.set_quoted('VERSION_NUM', meson.project_version()) +const_config_data.set_quoted('CONFIG_PATH', join_paths(get_option('prefix'), config_path)) constants = configure_file( input : 'constants.vala.in', output : 'constants.vala',