Skip to content

Commit 03511bd

Browse files
committed
Config: respect CMAKE_INSTALL_SYSCONFDIR
1 parent b0ad129 commit 03511bd

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,10 @@ if(NOT TARGET_DIR_HOME)
123123
endif()
124124
endif()
125125

126+
if(NOT TARGET_DIR_ETC)
127+
set(TARGET_DIR_ETC "${CMAKE_INSTALL_SYSCONFDIR}")
128+
endif()
129+
126130
#################
127131
# Tweak version #
128132
#################

src/fastfetch.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1310,7 +1310,7 @@ static void parseOption(FFinstance* instance, FFdata* data, const char* key, con
13101310

13111311
static void parseConfigFileSystem(FFinstance* instance, FFdata* data)
13121312
{
1313-
parseConfigFile(instance, data, FASTFETCH_TARGET_DIR_ROOT"/etc/fastfetch/config.conf");
1313+
parseConfigFile(instance, data, FASTFETCH_TARGET_DIR_ETC"/fastfetch/config.conf");
13141314
}
13151315

13161316
static void parseConfigFileUser(FFinstance* instance, FFdata* data)

src/fastfetch_config.h.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#define FASTFETCH_TARGET_DIR_ROOT "@TARGET_DIR_ROOT@"
1212
#define FASTFETCH_TARGET_DIR_USR "@TARGET_DIR_USR@"
1313
#define FASTFETCH_TARGET_DIR_HOME "@TARGET_DIR_HOME@"
14+
#define FASTFETCH_TARGET_DIR_ETC "@TARGET_DIR_ETC@"
1415

1516
#define FASTFETCH_DATATEXT_STRUCTURE "@DATATEXT_STRUCTURE@"
1617
#define FASTFETCH_DATATEXT_CONFIG_SYSTEM "@DATATEXT_CONFIG_SYSTEM@" //Requires FASTFETCH_PROJECT_VERSION to be set

0 commit comments

Comments
 (0)