conf: move config file to datadir

Install the config file in $PREFIX/share/pipewire so that a factory
reset can be done by wiping /etc and /home.
Add this new directory to the search path.
System wide config can still be done in /etc, user config in
$HOME/.config/pipewire/ by copying files from $PREFIX/share/pipewire

Fixes #1191
This commit is contained in:
Wim Taymans 2021-05-17 16:22:31 +02:00
parent d9240bb766
commit 1609126bcd
6 changed files with 25 additions and 15 deletions

View file

@ -104,6 +104,13 @@ static int get_read_path(char *path, size_t size, const char *prefix, const char
access(path, R_OK) == 0)
return 1;
}
dir = PIPEWIRE_CONFDATADIR;
if (dir != NULL) {
const char *paths[] = { dir, prefix, name, NULL };
if (make_path(path, size, paths) == 0 &&
access(path, R_OK) == 0)
return 1;
}
return 0;
}