Skip to content

Commit 213a2be

Browse files
committed
Honor sysconfdir for global config file
1 parent fa91029 commit 213a2be

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

meson.build

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ metainfodir = join_paths(datadir, 'metainfo')
3232
desktopdir = join_paths(datadir, 'applications')
3333
dbusinterfacesdir = join_paths(datadir, 'dbus-1', 'interfaces')
3434
plugindir = join_paths(get_option('libdir'), 'zathura')
35+
sysconfdir = get_option('sysconfdir')
36+
if not sysconfdir.startswith('/')
37+
sysconfdir = join_paths(prefix, sysconfdir)
38+
endif
3539

3640
# required dependencies
3741
libm = cc.find_library('m', required: false)
@@ -59,6 +63,7 @@ defines = [
5963
'-DGETTEXT_PACKAGE="zathura"',
6064
'-DLOCALEDIR="@0@"'.format(join_paths(prefix, localedir)),
6165
'-DZATHURA_PLUGINDIR="@0@"'.format(join_paths(prefix, plugindir)),
66+
'-DSYSCONFDIR="@0@"'.format(sysconfdir),
6267
'-D_DEFAULT_SOURCE',
6368
]
6469

zathura/config.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
#include <girara/utils.h>
1919
#include <glib/gi18n.h>
2020

21-
#define GLOBAL_RC "/etc/zathurarc"
2221
#define ZATHURA_RC "zathurarc"
2322

2423
static void cb_jumplist_change(girara_session_t* session, const char* UNUSED(name), girara_setting_type_t UNUSED(type),
@@ -645,7 +644,7 @@ void config_load_files(zathura_t* zathura) {
645644
girara_list_free(config_dirs);
646645
g_free(config_path);
647646

648-
girara_config_parse(zathura->ui.session, GLOBAL_RC);
647+
girara_config_parse(zathura->ui.session, SYSCONFDIR "/" ZATHURA_RC);
649648

650649
/* load local configuration files */
651650
char* configuration_file = g_build_filename(zathura->config.config_dir, ZATHURA_RC, NULL);

0 commit comments

Comments
 (0)