mirror of
https://gitlab.freedesktop.org/pipewire/wireplumber.git
synced 2026-05-07 06:28:04 +02:00
src: set the default configuration path when wireplumber starts
This commit is contained in:
parent
77ec4c548c
commit
2578ec4286
3 changed files with 16 additions and 0 deletions
1
Makefile
1
Makefile
|
|
@ -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
|
||||
|
|
|
|||
10
src/main.c
10
src/main.c
|
|
@ -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],
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue