Commit 2578ec42 authored by Julian Bouzas's avatar Julian Bouzas
Browse files

src: set the default configuration path when wireplumber starts

parent 77ec4c54
......@@ -13,6 +13,7 @@ clean:
run: all
WIREPLUMBER_MODULE_DIR=build/modules \
WIREPLUMBER_CONFIG_FILE=src/wireplumber.conf \
WIREPLUMBER_CONFIG_DIR=src/wireplumber \
$(DBG) ./build/src/wireplumber
test: all
......
......@@ -284,8 +284,10 @@ main (gint argc, gchar **argv)
struct WpDaemonData data = {0};
g_autoptr (GOptionContext) context = NULL;
g_autoptr (GError) error = NULL;
g_autoptr (WpConfiguration) config = NULL;
g_autoptr (WpCore) core = NULL;
g_autoptr (GMainLoop) loop = NULL;
const gchar *configuration_path;
context = g_option_context_new ("- PipeWire Session/Policy Manager");
g_option_context_add_main_entries (context, entries, NULL);
......@@ -301,6 +303,14 @@ main (gint argc, gchar **argv)
g_signal_connect (core, "remote-state-changed",
(GCallback) remote_state_changed, &data);
/* init configuration */
configuration_path = g_getenv ("WIREPLUMBER_CONFIG_DIR");
if (!configuration_path)
configuration_path = WIREPLUMBER_DEFAULT_CONFIG_DIR;
config = wp_configuration_get_instance (core);
wp_configuration_add_path (config, configuration_path);
/* init main loop */
data.loop = loop = g_main_loop_new (NULL, FALSE);
......
......@@ -7,6 +7,10 @@ install_data('wireplumber.conf',
install_dir: wireplumber_config_dir
)
install_subdir('wireplumber',
install_dir: wireplumber_config_dir
)
executable('wireplumber',
wp_sources,
c_args : [
......@@ -14,6 +18,7 @@ executable('wireplumber',
'-DG_LOG_USE_STRUCTURED',
'-DG_LOG_DOMAIN="wireplumber"',
'-DWIREPLUMBER_DEFAULT_CONFIG_FILE="@0@"'.format(wireplumber_config_file),
'-DWIREPLUMBER_DEFAULT_CONFIG_DIR="@0@"'.format(wireplumber_config_dir),
],
install: true,
dependencies : [gobject_dep, gio_dep, wp_dep, pipewire_dep],
......
Supports Markdown
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