mirror of
https://github.com/clearlinux/linux-steam-integration.git
synced 2026-09-06 22:01:27 +00:00
lsi: Dedupe into common
Signed-off-by: Ikey Doherty <ikey@solus-project.com>
This commit is contained in:
+2
-32
@@ -26,6 +26,8 @@
|
||||
#include "nica/hashmap.h"
|
||||
#include "nica/inifile.h"
|
||||
|
||||
#include "../common/files.h"
|
||||
|
||||
/**
|
||||
* Configuration file suffix, i.e. ~/.config/linux-steam-integration.conf
|
||||
*/
|
||||
@@ -42,38 +44,6 @@
|
||||
*/
|
||||
#define LSI_VENDOR_CONFIG_FILE VENDORDIR "/ " LSI_CONFIG_FILE
|
||||
|
||||
/**
|
||||
* Determine the home directory
|
||||
*/
|
||||
static const char *lsi_get_home_dir(void)
|
||||
{
|
||||
char *c = NULL;
|
||||
struct passwd *p = NULL;
|
||||
|
||||
c = getenv("HOME");
|
||||
if (c) {
|
||||
return c;
|
||||
}
|
||||
p = getpwuid(getuid());
|
||||
if (!p) {
|
||||
return NULL;
|
||||
}
|
||||
return p->pw_dir;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine the home config directory
|
||||
*/
|
||||
static char *lsi_get_user_config_dir(void)
|
||||
{
|
||||
const char *home = lsi_get_home_dir();
|
||||
char *c = NULL;
|
||||
if (asprintf(&c, "%s/.config", home) < 0) {
|
||||
return NULL;
|
||||
}
|
||||
return c;
|
||||
}
|
||||
|
||||
/**
|
||||
* Build the user config file path
|
||||
*/
|
||||
|
||||
@@ -9,6 +9,9 @@ if shim_behaviour != 'none' or with_frontend == true
|
||||
lib_lsi = static_library(
|
||||
'lsi-lsi',
|
||||
sources: lsi_sources + nica_sources,
|
||||
dependencies: [
|
||||
link_lsi_common,
|
||||
],
|
||||
include_directories: nica_includes,
|
||||
)
|
||||
link_lsi = declare_dependency(
|
||||
|
||||
Reference in New Issue
Block a user