diff --git a/CMakeLists.txt b/CMakeLists.txt index ab859f304..cbb54aed9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -25,27 +25,27 @@ endif() include(CMakeDependentOption) -cmake_dependent_option(ENABLE_LIBPCI "Enable libpci" ON "LINUX" OFF) -cmake_dependent_option(ENABLE_VULKAN "Enable vulkan" ON "LINUX OR APPLE" OFF) -cmake_dependent_option(ENABLE_WAYLAND "Enable wayland-client" ON "LINUX" OFF) -cmake_dependent_option(ENABLE_XCB_RANDR "Enable xcb-randr" ON "LINUX" OFF) -cmake_dependent_option(ENABLE_XCB "Enable xcb" ON "LINUX" OFF) -cmake_dependent_option(ENABLE_XRANDR "Enable xrandr" ON "LINUX" OFF) -cmake_dependent_option(ENABLE_X11 "Enable x11" ON "LINUX" OFF) -cmake_dependent_option(ENABLE_GIO "Enable gio-2.0" ON "LINUX" OFF) -cmake_dependent_option(ENABLE_DCONF "Enable dconf" ON "LINUX" OFF) -cmake_dependent_option(ENABLE_DBUS "Enable dbus-1" ON "LINUX" OFF) -cmake_dependent_option(ENABLE_XFCONF "Enable libxfconf-0" ON "LINUX" OFF) -cmake_dependent_option(ENABLE_SQLITE3 "Enable sqlite3" ON "LINUX" OFF) +cmake_dependent_option(ENABLE_LIBPCI "Enable libpci" ON "LINUX OR BSD" OFF) +cmake_dependent_option(ENABLE_VULKAN "Enable vulkan" ON "LINUX OR APPLE OR BSD" OFF) +cmake_dependent_option(ENABLE_WAYLAND "Enable wayland-client" ON "LINUX OR BSD" OFF) +cmake_dependent_option(ENABLE_XCB_RANDR "Enable xcb-randr" ON "LINUX OR BSD" OFF) +cmake_dependent_option(ENABLE_XCB "Enable xcb" ON "LINUX OR BSD" OFF) +cmake_dependent_option(ENABLE_XRANDR "Enable xrandr" ON "LINUX OR BSD" OFF) +cmake_dependent_option(ENABLE_X11 "Enable x11" ON "LINUX OR BSD" OFF) +cmake_dependent_option(ENABLE_GIO "Enable gio-2.0" ON "LINUX OR BSD" OFF) +cmake_dependent_option(ENABLE_DCONF "Enable dconf" ON "LINUX OR BSD" OFF) +cmake_dependent_option(ENABLE_DBUS "Enable dbus-1" ON "LINUX OR BSD" OFF) +cmake_dependent_option(ENABLE_XFCONF "Enable libxfconf-0" ON "LINUX OR BSD" OFF) +cmake_dependent_option(ENABLE_SQLITE3 "Enable sqlite3" ON "LINUX OR BSD" OFF) cmake_dependent_option(ENABLE_RPM "Enable rpm" ON "LINUX" OFF) -cmake_dependent_option(ENABLE_IMAGEMAGICK7 "Enable imagemagick 7" ON "LINUX" OFF) -cmake_dependent_option(ENABLE_IMAGEMAGICK6 "Enable imagemagick 6" ON "LINUX" OFF) +cmake_dependent_option(ENABLE_IMAGEMAGICK7 "Enable imagemagick 7" ON "LINUX OR BSD" OFF) +cmake_dependent_option(ENABLE_IMAGEMAGICK6 "Enable imagemagick 6" ON "LINUX OR BSD" OFF) cmake_dependent_option(ENABLE_CHAFA "Enable chafa" ON "ENABLE_IMAGEMAGICK6 OR ENABLE_IMAGEMAGICK7" OFF) cmake_dependent_option(ENABLE_ZLIB "Enable zlib" ON "ENABLE_IMAGEMAGICK6 OR ENABLE_IMAGEMAGICK7" OFF) -cmake_dependent_option(ENABLE_EGL "Enable egl" ON "LINUX" OFF) -cmake_dependent_option(ENABLE_GLX "Enable glx" ON "LINUX" OFF) -cmake_dependent_option(ENABLE_OSMESA "Enable osmesa" ON "LINUX" OFF) -cmake_dependent_option(ENABLE_OPENCL "Enable opencl" ON "LINUX" OFF) +cmake_dependent_option(ENABLE_EGL "Enable egl" ON "LINUX OR BSD" OFF) +cmake_dependent_option(ENABLE_GLX "Enable glx" ON "LINUX OR BSD" OFF) +cmake_dependent_option(ENABLE_OSMESA "Enable osmesa" ON "LINUX OR BSD" OFF) +cmake_dependent_option(ENABLE_OPENCL "Enable opencl" ON "LINUX OR BSD" OFF) cmake_dependent_option(ENABLE_LIBPLIST "Enable libplist" ON "APPLE" OFF) option(BUILD_TESTS "Build tests" OFF) # Also create test executables diff --git a/README.md b/README.md index b74db5672..4cf13bac6 100644 --- a/README.md +++ b/README.md @@ -66,7 +66,7 @@ AlmaLinux, Alpine, Android, Arch, Arco, Artix, Bedrock, CachyOS, CentOS, Crystal ##### Package managers ``` -Pacman, dpkg, rpm, emerge, xbps, nix, Flatpak, Snap, apk, brew, MacPorts +Pacman, dpkg, rpm, emerge, xbps, nix, Flatpak, Snap, apk, pkg, brew, MacPorts ``` ##### WM themes diff --git a/src/detection/displayserver/linux/wmde.c b/src/detection/displayserver/linux/wmde.c index 19554f96c..da942bbd7 100644 --- a/src/detection/displayserver/linux/wmde.c +++ b/src/detection/displayserver/linux/wmde.c @@ -129,6 +129,10 @@ static void getKDE(FFDisplayServerResult* result) ffParsePropFile(FASTFETCH_TARGET_DIR_USR"/share/wayland-sessions/plasmawayland.desktop", "X-KDE-PluginInfo-Version =", &result->deVersion); if(result->deVersion.length == 0) ffParsePropFile(FASTFETCH_TARGET_DIR_USR"/share/wayland-sessions/plasmawayland5.desktop", "X-KDE-PluginInfo-Version =", &result->deVersion); + if(result->deVersion.length == 0) + ffParsePropFile(FASTFETCH_TARGET_DIR_USR"/local/share/xsessions/plasma.desktop", "X-KDE-PluginInfo-Version =", &result->deVersion); + if(result->deVersion.length == 0) + ffParsePropFile(FASTFETCH_TARGET_DIR_USR"/local/share/wayland-sessions/plasmawayland.desktop", "X-KDE-PluginInfo-Version =", &result->deVersion); applyBetterWM(result, getenv("KDEWM")); } diff --git a/src/detection/memory/memory_bsd.c b/src/detection/memory/memory_bsd.c index ab27e26a9..a98cefdda 100644 --- a/src/detection/memory/memory_bsd.c +++ b/src/detection/memory/memory_bsd.c @@ -3,8 +3,14 @@ void ffDetectMemoryImpl(FFMemoryResult* memory) { - memory->ram.bytesTotal = (uint64_t) ffSysctlGetInt64("hw.physmem", 0); - memory->ram.bytesUsed = 0; + uint32_t pageSize = (uint32_t) ffSysctlGetInt("hw.pagesize", 0); + + memory->ram.bytesTotal = (uint64_t) ffSysctlGetInt64("vm.stats.vm.v_page_count", 0) * pageSize; + + memory->ram.bytesUsed = memory->ram.bytesTotal + - (uint64_t) ffSysctlGetInt64("vm.stats.vm.v_free_count", 0) * pageSize + - (uint64_t) ffSysctlGetInt64("vm.stats.vm.v_inactive_count", 0) * pageSize + ; memory->swap.bytesTotal = 0; memory->swap.bytesUsed = 0; diff --git a/src/detection/terminalShell.c b/src/detection/terminalShell.c index 2aadccd06..98766772b 100644 --- a/src/detection/terminalShell.c +++ b/src/detection/terminalShell.c @@ -137,6 +137,11 @@ static void getTerminalFromEnv(FFTerminalShellResult* result) getenv("TMUX_TMPDIR") != NULL )) term = "Termux"; + //Konsole + if(!ffStrSet(term) && ( + getenv("KONSOLE_VERSION") != NULL + )) term = "konsole"; + //MacOS if(!ffStrSet(term)) term = getenv("TERM_PROGRAM"); diff --git a/src/fastfetch.c b/src/fastfetch.c index ec1ea90a6..e27d12799 100644 --- a/src/fastfetch.c +++ b/src/fastfetch.c @@ -114,7 +114,7 @@ static inline void printCommandHelp(const char* command) } else if(strcasecmp(command, "packages-format") == 0) { - constructAndPrintCommandHelpFormat("packages", "{2} (pacman){?3}[{3}]{?}, {4} (dpkg), {5} (rpm), {6} (emerge), {7} (xbps), {8} (nix-system), {9} (nix-user), {10} (nix-default), {11} (apk), {12} (flatpak), {13} (snap), {14} (brew), {15} (port)", 15, + constructAndPrintCommandHelpFormat("packages", "{2} (pacman){?3}[{3}]{?}, {4} (dpkg), {5} (rpm), {6} (emerge), {7} (xbps), {8} (nix-system), {9} (nix-user), {10} (nix-default), {11} (apk), {12} (pkg), {13} (flatpak), {14} (snap), {15} (brew), {16} (port)", 16, "Number of all packages", "Number of pacman packages", "Pacman branch on manjaro", @@ -126,6 +126,7 @@ static inline void printCommandHelp(const char* command) "Number of nix-user packages", "Number of nix-default packages", "Number of apk packages", + "Number of pkg packages", "Number of flatpak packages", "Number of snap packages", "Number of brew packages", diff --git a/src/logo/builtin.c b/src/logo/builtin.c index dd371650c..ef54ca1de 100644 --- a/src/logo/builtin.c +++ b/src/logo/builtin.c @@ -817,21 +817,21 @@ static const FFlogo* getLogoFreeBSD() FF_LOGO_INIT FF_LOGO_NAMES("freebsd") FF_LOGO_LINES( - "$1``` $2` \n" - " $1` `.....---...$2....--.``` -/ \n" - " $1+o .--` $2/y:` +. \n" - " $1yo`:. $2:o `+- \n" - " $1y/ $2-/` -o/ \n" - " $1.- $2::/sy+:. \n" - " $1/ $2`-- / \n" - " $1`: $2:` \n" - " $1`: $2:` \n" - " $1/ $2/ \n" - " $1.- $2-. \n" - " $1-- $2-. \n" - " $1`:` $2`:` \n" - " .-- `--. \n" - " .---.....----. \n" + "``` $2`\n" + " $1` `.....---...$2....--.``` -/\n" + " $1+o .--` $2/y:` +.\n" + " $1yo`:. $2:o `+-\n" + " $1y/ $2-/` -o/\n" + " $1.- $2::/sy+:.\n" + " $1/ $2`-- /\n" + " $1`: $2:`\n" + " $1`: $2:`\n" + " $1/ $2/\n" + " $1.- $2-.\n" + " $1-- $2-.\n" + " $1`:` $2`:`\n" + " .-- `--.\n" + " .---.....----." ) FF_LOGO_COLORS( "37", //white diff --git a/src/modules/packages.c b/src/modules/packages.c index d3de44abc..5ddba446a 100644 --- a/src/modules/packages.c +++ b/src/modules/packages.c @@ -13,7 +13,7 @@ #include #define FF_PACKAGES_MODULE_NAME "Packages" -#define FF_PACKAGES_NUM_FORMAT_ARGS 15 +#define FF_PACKAGES_NUM_FORMAT_ARGS 16 typedef struct PackageCounts { @@ -25,6 +25,7 @@ typedef struct PackageCounts uint32_t nixSystem; uint32_t nixDefault; uint32_t apk; + uint32_t pkg; uint32_t flatpak; uint32_t snap; uint32_t brew; @@ -319,7 +320,7 @@ static void getPackageCounts(const FFinstance* instance, FFstrbuf* baseDir, Pack FF_UNUSED(instance); #endif - #ifndef __APPLE__ //Linux desktop and Anrdoid + #ifndef __APPLE__ //Linux desktop and Android uint32_t baseDirLength = baseDir->length; @@ -392,6 +393,14 @@ static void getPackageCounts(const FFinstance* instance, FFstrbuf* baseDir, Pack packageCounts->port += getMacPortsPackages(baseDir); #endif // __APPLE__ + + #ifdef __FreeBSD__ + + ffStrbufAppendS(baseDir, "/var/db/pkg/local.sqlite"); + packageCounts->pkg += (uint32_t) ffSettingsGetSQLite3Int(instance, baseDir->chars, "SELECT count(id) FROM packages"); + ffStrbufSubstrBefore(baseDir, baseDirLength); + + #endif // __FreeBSD__ } static void getPackageCountsBedrock(const FFinstance* instance, FFstrbuf* baseDir, PackageCounts* packageCounts) @@ -458,7 +467,7 @@ void ffPrintPackages(FFinstance* instance) ffStrbufDestroy(&baseDir); - uint32_t all = counts.pacman + counts.dpkg + counts.rpm + counts.emerge + counts.xbps + counts.nixSystem + nixUser + counts.nixDefault + counts.apk + counts.flatpak + counts.snap + counts.brew + counts.port; + uint32_t all = counts.pacman + counts.dpkg + counts.rpm + counts.emerge + counts.xbps + counts.nixSystem + nixUser + counts.nixDefault + counts.apk + counts.pkg + counts.flatpak + counts.snap + counts.brew + counts.port; if(all == 0) { ffPrintError(instance, FF_PACKAGES_MODULE_NAME, 0, &instance->config.packages, "No packages from known package managers found"); @@ -513,6 +522,7 @@ void ffPrintPackages(FFinstance* instance) } FF_PRINT_PACKAGE(apk) + FF_PRINT_PACKAGE(pkg) FF_PRINT_PACKAGE(flatpak) FF_PRINT_PACKAGE(snap) FF_PRINT_PACKAGE(brew) @@ -539,6 +549,7 @@ void ffPrintPackages(FFinstance* instance) {FF_FORMAT_ARG_TYPE_UINT, &nixUser}, {FF_FORMAT_ARG_TYPE_UINT, &counts.nixDefault}, {FF_FORMAT_ARG_TYPE_UINT, &counts.apk}, + {FF_FORMAT_ARG_TYPE_UINT, &counts.pkg}, {FF_FORMAT_ARG_TYPE_UINT, &counts.flatpak}, {FF_FORMAT_ARG_TYPE_UINT, &counts.snap}, {FF_FORMAT_ARG_TYPE_UINT, &counts.brew},