diff --git a/src/detection/de/de_linux.c b/src/detection/de/de_linux.c index 90326c226..5f7fd8839 100644 --- a/src/detection/de/de_linux.c +++ b/src/detection/de/de_linux.c @@ -12,7 +12,7 @@ static void getKDE(FFstrbuf* result, FFDEOptions* options) { - ffParsePropFileValues("/usr/share/xsessions/plasmax11.desktop", 1, (FFpropquery[]) { + ffParsePropFileValues(FASTFETCH_TARGET_DIR_USR "/share/xsessions/plasmax11.desktop", 1, (FFpropquery[]) { {"X-KDE-PluginInfo-Version =", result} }); if(result->length == 0) @@ -21,7 +21,7 @@ static void getKDE(FFstrbuf* result, FFDEOptions* options) ffParsePropFileData("xsessions/plasma5.desktop", "X-KDE-PluginInfo-Version =", result); if(result->length == 0) { - ffParsePropFileValues("/usr/share/wayland-sessions/plasma.desktop", 1, (FFpropquery[]) { + ffParsePropFileValues(FASTFETCH_TARGET_DIR_USR "/share/wayland-sessions/plasma.desktop", 1, (FFpropquery[]) { {"X-KDE-PluginInfo-Version =", result} }); } diff --git a/src/detection/gpu/gpu_bsd.c b/src/detection/gpu/gpu_bsd.c index e0ac12f11..2bca0137b 100644 --- a/src/detection/gpu/gpu_bsd.c +++ b/src/detection/gpu/gpu_bsd.c @@ -17,7 +17,7 @@ static bool loadPciIds(FFstrbuf* pciids) ffReadFileBuffer(_PATH_LOCALBASE "/share/pciids/pci.ids", pciids); if (pciids->length > 0) return true; - ffReadFileBuffer("/usr/share/pciids/pci.ids", pciids); + ffReadFileBuffer(FASTFETCH_TARGET_DIR_USR "/share/pciids/pci.ids", pciids); if (pciids->length > 0) return true; return false; diff --git a/src/detection/gpu/gpu_linux.c b/src/detection/gpu/gpu_linux.c index 1a8dead18..1c5b2f3c5 100644 --- a/src/detection/gpu/gpu_linux.c +++ b/src/detection/gpu/gpu_linux.c @@ -53,13 +53,13 @@ static void pciDetectDriver(FFGPUResult* gpu, FFstrbuf* pciDir, FFstrbuf* buffer static bool loadPciIds(FFstrbuf* pciids) { - ffReadFileBuffer("/usr/share/hwdata/pci.ids", pciids); + ffReadFileBuffer(FASTFETCH_TARGET_DIR_USR "/share/hwdata/pci.ids", pciids); if (pciids->length > 0) return true; - ffReadFileBuffer("/usr/share/misc/pci.ids", pciids); // debian? + ffReadFileBuffer(FASTFETCH_TARGET_DIR_USR "/share/misc/pci.ids", pciids); // debian? if (pciids->length > 0) return true; - ffReadFileBuffer("/usr/local/share/hwdata/pci.ids", pciids); + ffReadFileBuffer(FASTFETCH_TARGET_DIR_USR "/local/share/hwdata/pci.ids", pciids); if (pciids->length > 0) return true; return false; diff --git a/src/detection/lm/lm_linux.c b/src/detection/lm/lm_linux.c index c91fdf477..a792da592 100644 --- a/src/detection/lm/lm_linux.c +++ b/src/detection/lm/lm_linux.c @@ -63,7 +63,7 @@ static const char* getSddmVersion(FFstrbuf* version) FF_LIBRARY_LOAD_SYMBOL_MESSAGE(zlib, gzrewind) FF_LIBRARY_LOAD_SYMBOL_MESSAGE(zlib, gzclose) - gzFile file = ffgzopen("/usr/share/man/man1/sddm.1.gz", "rb"); + gzFile file = ffgzopen(FASTFETCH_TARGET_DIR_USR "/share/man/man1/sddm.1.gz", "rb"); if (file == Z_NULL) return "ffgzopen(\"/usr/share/man/man1/sddm.1.gz\", \"rb\") failed"; diff --git a/src/detection/packages/packages_apple.c b/src/detection/packages/packages_apple.c index e770f3f59..385926626 100644 --- a/src/detection/packages/packages_apple.c +++ b/src/detection/packages/packages_apple.c @@ -45,14 +45,14 @@ static void getBrewPackages(FFPackagesResult* result) if(ffStrSet(prefix)) return countBrewPackages(prefix, result); - countBrewPackages(FASTFETCH_TARGET_DIR_ROOT"/opt/homebrew", result); - countBrewPackages(FASTFETCH_TARGET_DIR_ROOT"/usr/local", result); + countBrewPackages(FASTFETCH_TARGET_DIR_ROOT "/opt/homebrew", result); + countBrewPackages(FASTFETCH_TARGET_DIR_USR "/local", result); } static uint32_t countMacPortsPackages(const char* dirname) { FF_STRBUF_AUTO_DESTROY baseDir = ffStrbufCreateS(dirname); - ffStrbufAppendS(&baseDir, "/var/macports/software"); + ffStrbufAppendS(&baseDir, FASTFETCH_TARGET_DIR_ROOT "/var/macports/software"); return getNumElements(baseDir.chars, DT_DIR); } @@ -63,7 +63,7 @@ static uint32_t getMacPortsPackages() if(ffStrSet(prefix)) return countMacPortsPackages(prefix); - return countMacPortsPackages(FASTFETCH_TARGET_DIR_ROOT"/opt/local"); + return countMacPortsPackages(FASTFETCH_TARGET_DIR_ROOT "/opt/local"); } static uint32_t getNixPackagesImpl(char* path) @@ -81,7 +81,7 @@ static uint32_t getNixPackagesImpl(char* path) ffStrbufAppendS(&command, "); do if [ -d $x ]; then echo $x ; fi ; done | cut -d- -f2- | egrep '([0-9]{1,}\\.)+[0-9]{1,}' | egrep -v '\\-doc$|\\-man$|\\-info$|\\-dev$|\\-bin$|^nixos-system-nixos-' | uniq | wc -l"); ffProcessAppendStdOut(&output, (char* const[]) { - "/bin/sh", + FASTFETCH_TARGET_DIR_ROOT "/bin/sh", "-c", command.chars, NULL