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