diff --git a/lib/wp/wp.c b/lib/wp/wp.c index 5e9df90f..78d01c80 100644 --- a/lib/wp/wp.c +++ b/lib/wp/wp.c @@ -97,6 +97,22 @@ wp_get_xdg_state_dir (void) return xdg_dir; } +/*! + * \brief Gets the full path to the Wireplumber XDG_CONFIG_DIR subdirectory + * \returns The XDG_CONFIG_DIR subdirectory + */ +const gchar * +wp_get_xdg_config_dir (void) +{ + static gchar xdg_dir[PATH_MAX] = {0}; + if (xdg_dir[0] == '\0') { + g_autofree gchar *path = g_build_filename (g_get_user_config_dir (), + "wireplumber", NULL); + g_strlcpy (xdg_dir, path, sizeof (xdg_dir)); + } + return xdg_dir; +} + /*! * \brief Gets the Wireplumber configuration directory * \returns The Wireplumber configuration directory diff --git a/lib/wp/wp.h b/lib/wp/wp.h index a2a8f975..fc6abce9 100644 --- a/lib/wp/wp.h +++ b/lib/wp/wp.h @@ -68,6 +68,9 @@ const gchar * wp_get_module_dir (void); WP_API const gchar * wp_get_xdg_state_dir (void); +WP_API +const gchar * wp_get_xdg_config_dir (void); + WP_API const gchar * wp_get_config_dir (void);