diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9583926bde..e8a47a75a2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -187,7 +187,7 @@ jobs: linux-armv7l: name: Linux-armv7l - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 permissions: security-events: write contents: read @@ -196,7 +196,7 @@ jobs: uses: actions/checkout@v4 - name: run VM - uses: uraimo/run-on-arch-action@v2 + uses: uraimo/run-on-arch-action@v3 id: runcmd with: arch: armv7 @@ -226,7 +226,7 @@ jobs: linux-armv6l: name: Linux-armv6l - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 permissions: security-events: write contents: read @@ -235,7 +235,7 @@ jobs: uses: actions/checkout@v4 - name: run VM - uses: uraimo/run-on-arch-action@v2 + uses: uraimo/run-on-arch-action@v3 id: runcmd with: arch: armv6 @@ -262,7 +262,7 @@ jobs: linux-riscv64: name: Linux-riscv64 - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 permissions: security-events: write contents: read @@ -271,7 +271,7 @@ jobs: uses: actions/checkout@v4 - name: run VM - uses: uraimo/run-on-arch-action@v2 + uses: uraimo/run-on-arch-action@v3 id: runcmd with: arch: riscv64 @@ -297,7 +297,7 @@ jobs: linux-ppc64le: name: Linux-ppc64le - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 permissions: security-events: write contents: read @@ -306,7 +306,7 @@ jobs: uses: actions/checkout@v4 - name: run VM - uses: uraimo/run-on-arch-action@v2 + uses: uraimo/run-on-arch-action@v3 id: runcmd with: arch: ppc64le @@ -332,7 +332,7 @@ jobs: linux-s390x: name: Linux-s390x - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 permissions: security-events: write contents: read @@ -341,7 +341,7 @@ jobs: uses: actions/checkout@v4 - name: run VM - uses: uraimo/run-on-arch-action@v2 + uses: uraimo/run-on-arch-action@v3 id: runcmd with: arch: s390x @@ -373,8 +373,6 @@ jobs: - name: setup alpine linux uses: jirutka/setup-alpine@master - with: - branch: v3.19 - name: install dependencies run: | @@ -422,20 +420,12 @@ jobs: run: | HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1 brew install --overwrite vulkan-loader vulkan-headers molten-vk imagemagick chafa - - name: Initialize CodeQL - uses: github/codeql-action/init@v3 - with: - languages: c - - name: configure project run: cmake -DSET_TWEAK=Off -DBUILD_TESTS=On -DCMAKE_OSX_ARCHITECTURES='arm64;x86_64' . - name: build project run: cmake --build . --target package --verbose -j4 - - name: perform CodeQL analysis - uses: github/codeql-action/analyze@v3 - - name: list features run: ./fastfetch --list-features diff --git a/CHANGELOG.md b/CHANGELOG.md index f5148beccb..f80f37bb8e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,29 @@ +# 2.38.0 + +Bugfixes: +* Fix empty battery slots handling (Battery, Haiku, #1575) +* Fix `{day-pretty}` output in custom format (DateTime, Windows) +* Fix VanillaOS detection (OS, Linux) +* Fix secure boot testing (Bootmgr, Linux, #1584) +* Fix the SI unit "kB" in help message (#1589) +* Fix segfault on macOS 10.15 when using the binary downloaded from Github Releases (Camera, macOS, #1594) + +Features: +* Support Chassis module in macOS (Chassis, macOS) +* Allow customize key format with kernel name and distro name (OS) +* Add missing `{icon}` in custom key format (Battery) +* Add missing `{mountpoint}` and `{mount-from}` in custom output format (Disk, #1577) +* Support percentage num & bar in custom format (GPU, #1583) +* Support `pisi` package manager detection (Packages, Linux) +* Support termite terminal font detection (TerminalFont, Linux) +* Report monitor type in Brightness module (Brightness) + +Logo: +* Add `opensuse-tumbleweed_small` +* Add `Bedrock_small` +* Add `fastfetch` +* Remove some unnecessary distro names + # 2.37.0 Changes: diff --git a/CMakeLists.txt b/CMakeLists.txt index d0839a5a1d..9284b746a5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 3.12.0) # target_link_libraries with OBJECT libs & project homepage url project(fastfetch - VERSION 2.37.0 + VERSION 2.38.0 LANGUAGES C DESCRIPTION "Fast neofetch-like system information tool" HOMEPAGE_URL "https://github.com/fastfetch-cli/fastfetch" @@ -103,7 +103,7 @@ if(NOT BINARY_LINK_TYPE IN_LIST BINARY_LINK_TYPE_OPTIONS) message(FATAL_ERROR "BINARY_LINK_TYPE must be one of ${BINARY_LINK_TYPE_OPTIONS}") endif() -set(PACKAGE_MANAGERS AM APK BREW CHOCO DPKG EMERGE EOPKG FLATPAK GUIX LINGLONG LPKG LPKGBUILD MACPORTS NIX OPKG PACMAN PACSTALL PALUDIS PKG PKGTOOL RPM SCOOP SNAP SORCERY WINGET XBPS) +set(PACKAGE_MANAGERS AM APK BREW CHOCO DPKG EMERGE EOPKG FLATPAK GUIX LINGLONG LPKG LPKGBUILD MACPORTS NIX OPKG PACMAN PACSTALL PALUDIS PISI PKG PKGTOOL RPM SCOOP SNAP SORCERY WINGET XBPS) foreach(package_manager ${PACKAGE_MANAGERS}) if(package_manager STREQUAL "WINGET") option(PACKAGES_DISABLE_${package_manager} "Disable ${package_manager} package manager detection by default" ON) @@ -905,7 +905,7 @@ elseif(APPLE) src/detection/bootmgr/bootmgr_apple.c src/detection/brightness/brightness_apple.c src/detection/btrfs/btrfs_nosupport.c - src/detection/chassis/chassis_nosupport.c + src/detection/chassis/chassis_apple.c src/detection/cpu/cpu_apple.c src/detection/cpucache/cpucache_apple.c src/detection/cpuusage/cpuusage_apple.c diff --git a/README.md b/README.md index 0649a4b83b..5dc3a121fb 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ [![latest packaged version(s)](https://repology.org/badge/latest-versions/fastfetch.svg)](https://repology.org/project/fastfetch/versions) [![Packaging status](https://repology.org/badge/tiny-repos/fastfetch.svg)](https://repology.org/project/fastfetch/versions) -Fastfetch is a [neofetch](https://github.com/dylanaraps/neofetch)-like tool for fetching system information and displaying it prettily. It is written mainly in C, with performance and customizability in mind. Currently, Linux, Android, FreeBSD, macOS, SunOS and Windows 7+ are supported. +Fastfetch is a [neofetch](https://github.com/dylanaraps/neofetch)-like tool for fetching system information and displaying it prettily. It is written mainly in C, with performance and customizability in mind. Currently, Linux, macOS, Windows 7+, Android, FreeBSD, OpenBSD, NetBSD, DragonFly, Haiku and SunOS are supported. diff --git a/debian/changelog b/debian/changelog index 63870842b2..30b84d86ca 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +fastfetch (2.37.0) jammy; urgency=medium + + * Update to 2.37.0 + + -- Carter Li Wed, 19 Feb 2025 15:43:42 +0800 + fastfetch (2.36.1) jammy; urgency=medium * Update to 2.36.1 diff --git a/debian/files b/debian/files index 116398cf1b..f056cc7e5b 100644 --- a/debian/files +++ b/debian/files @@ -1 +1 @@ -fastfetch_2.36.1_source.buildinfo universe/utils optional +fastfetch_2.37.0_source.buildinfo universe/utils optional diff --git a/doc/json_schema.json b/doc/json_schema.json index 9b6b2d4c9e..ae1f3f9d87 100644 --- a/doc/json_schema.json +++ b/doc/json_schema.json @@ -183,7 +183,7 @@ "type": "string" }, "diskFormat": { - "description": "Output format of the module `Disk`. See `-h format` for formatting syntax\n 1. {size-used}: Size used\n 2. {size-total}: Size total\n 3. {size-percentage}: Size percentage num\n 4. {files-used}: Files used\n 5. {files-total}: Files total\n 6. {files-percentage}: Files percentage num\n 7. {is-external}: True if external volume\n 8. {is-hidden}: True if hidden volume\n 9. {filesystem}: Filesystem\n 10. {name}: Label / name\n 11. {is-readonly}: True if read-only\n 12. {create-time}: Create time in local timezone\n 13. {size-percentage-bar}: Size percentage bar\n 14. {files-percentage-bar}: Files percentage bar\n 15. {days}: Days after creation\n 16. {hours}: Hours after creation\n 17. {minutes}: Minutes after creation\n 18. {seconds}: Seconds after creation\n 19. {milliseconds}: Milliseconds after creation", + "description": "Output format of the module `Disk`. See `-h format` for formatting syntax\n 1. {size-used}: Size used\n 2. {size-total}: Size total\n 3. {size-percentage}: Size percentage num\n 4. {files-used}: Files used\n 5. {files-total}: Files total\n 6. {files-percentage}: Files percentage num\n 7. {is-external}: True if external volume\n 8. {is-hidden}: True if hidden volume\n 9. {filesystem}: Filesystem\n 10. {name}: Label / name\n 11. {is-readonly}: True if read-only\n 12. {create-time}: Create time in local timezone\n 13. {size-percentage-bar}: Size percentage bar\n 14. {files-percentage-bar}: Files percentage bar\n 15. {days}: Days after creation\n 16. {hours}: Hours after creation\n 17. {minutes}: Minutes after creation\n 18. {seconds}: Seconds after creation\n 19. {milliseconds}: Milliseconds after creation\n 20. {mountpoint}: Mount point / drive letter\n 21. {mount-from}: Mount from (device path)", "type": "string" }, "diskioFormat": { @@ -207,7 +207,7 @@ "type": "string" }, "gpuFormat": { - "description": "Output format of the module `GPU`. See `-h format` for formatting syntax\n 1. {vendor}: GPU vendor\n 2. {name}: GPU name\n 3. {driver}: GPU driver\n 4. {temperature}: GPU temperature\n 5. {core-count}: GPU core count\n 6. {type}: GPU type\n 7. {dedicated-total}: GPU total dedicated memory\n 8. {dedicated-used}: GPU used dedicated memory\n 9. {shared-total}: GPU total shared memory\n 10. {shared-used}: GPU used shared memory\n 11. {platform-api}: The platform API used when detecting the GPU\n 12. {frequency}: Current frequency in GHz\n 13. {index}: GPU vendor specific index", + "description": "Output format of the module `GPU`. See `-h format` for formatting syntax\n 1. {vendor}: GPU vendor\n 2. {name}: GPU name\n 3. {driver}: GPU driver\n 4. {temperature}: GPU temperature\n 5. {core-count}: GPU core count\n 6. {type}: GPU type\n 7. {dedicated-total}: GPU total dedicated memory\n 8. {dedicated-used}: GPU used dedicated memory\n 9. {shared-total}: GPU total shared memory\n 10. {shared-used}: GPU used shared memory\n 11. {platform-api}: The platform API used when detecting the GPU\n 12. {frequency}: Current frequency in GHz\n 13. {index}: GPU vendor specific index\n 14. {dedicated-percentage-num}: Dedicated memory usage percentage num\n 15. {dedicated-percentage-bar}: Dedicated memory usage percentage bar\n 16. {shared-percentage-num}: Shared memory usage percentage num\n 17. {shared-percentage-bar}: Shared memory usage percentage bar\n 18. {core-usage-num}: Core usage percentage num (supports Nvidia & Apple GPU only)\n 19. {core-usage-bar}: Core usage percentage bar (supports Nvidia & Apple GPU only)", "type": "string" }, "hostFormat": { @@ -279,7 +279,7 @@ "type": "string" }, "packagesFormat": { - "description": "Output format of the module `Packages`. See `-h format` for formatting syntax\n 1. {all}: Number of all packages\n 2. {pacman}: Number of pacman packages\n 3. {pacman-branch}: Pacman branch on manjaro\n 4. {dpkg}: Number of dpkg packages\n 5. {rpm}: Number of rpm packages\n 6. {emerge}: Number of emerge packages\n 7. {eopkg}: Number of eopkg packages\n 8. {xbps}: Number of xbps packages\n 9. {nix-system}: Number of nix-system packages\n 10. {nix-user}: Number of nix-user packages\n 11. {nix-default}: Number of nix-default packages\n 12. {apk}: Number of apk packages\n 13. {pkg}: Number of pkg packages\n 14. {flatpak-system}: Number of flatpak-system app packages\n 15. {flatpak-user}: Number of flatpak-user app packages\n 16. {snap}: Number of snap packages\n 17. {brew}: Number of brew packages\n 18. {brew-cask}: Number of brew-cask packages\n 19. {macports}: Number of macports packages\n 20. {scoop}: Number of scoop packages\n 21. {choco}: Number of choco packages\n 22. {pkgtool}: Number of pkgtool packages\n 23. {paludis}: Number of paludis packages\n 24. {winget}: Number of winget packages\n 25. {opkg}: Number of opkg packages\n 26. {am-system}: Number of am-system packages\n 27. {sorcery}: Number of sorcery packages\n 28. {lpkg}: Number of lpkg packages\n 29. {lpkgbuild}: Number of lpkgbuild packages\n 30. {guix-system}: Number of guix-system packages\n 31. {guix-user}: Number of guix-user packages\n 32. {guix-home}: Number of guix-home packages\n 33. {linglong}: Number of linglong packages\n 34. {pacstall}: Number of pacstall packages\n 35. {mport}: Number of mport packages\n 36. {qi}: Number of qi packages\n 37. {am-user}: Number of am-user (aka appman) packages\n 38. {pkgsrc}: Number of pkgsrc packages\n 39. {nix-all}: Total number of all nix packages\n 40. {flatpak-all}: Total number of all flatpak app packages\n 41. {brew-all}: Total number of all brew packages\n 42. {guix-all}: Total number of all guix packages", + "description": "Output format of the module `Packages`. See `-h format` for formatting syntax\n 1. {all}: Number of all packages\n 2. {pacman}: Number of pacman packages\n 3. {pacman-branch}: Pacman branch on manjaro\n 4. {dpkg}: Number of dpkg packages\n 5. {rpm}: Number of rpm packages\n 6. {emerge}: Number of emerge packages\n 7. {eopkg}: Number of eopkg packages\n 8. {xbps}: Number of xbps packages\n 9. {nix-system}: Number of nix-system packages\n 10. {nix-user}: Number of nix-user packages\n 11. {nix-default}: Number of nix-default packages\n 12. {apk}: Number of apk packages\n 13. {pkg}: Number of pkg packages\n 14. {flatpak-system}: Number of flatpak-system app packages\n 15. {flatpak-user}: Number of flatpak-user app packages\n 16. {snap}: Number of snap packages\n 17. {brew}: Number of brew packages\n 18. {brew-cask}: Number of brew-cask packages\n 19. {macports}: Number of macports packages\n 20. {scoop}: Number of scoop packages\n 21. {choco}: Number of choco packages\n 22. {pkgtool}: Number of pkgtool packages\n 23. {paludis}: Number of paludis packages\n 24. {winget}: Number of winget packages\n 25. {opkg}: Number of opkg packages\n 26. {am-system}: Number of am-system packages\n 27. {sorcery}: Number of sorcery packages\n 28. {lpkg}: Number of lpkg packages\n 29. {lpkgbuild}: Number of lpkgbuild packages\n 30. {guix-system}: Number of guix-system packages\n 31. {guix-user}: Number of guix-user packages\n 32. {guix-home}: Number of guix-home packages\n 33. {linglong}: Number of linglong packages\n 34. {pacstall}: Number of pacstall packages\n 35. {mport}: Number of mport packages\n 36. {qi}: Number of qi packages\n 37. {am-user}: Number of am-user (aka appman) packages\n 38. {pkgsrc}: Number of pkgsrc packages\n 39. {hpkg-system}: Number of hpkg-system packages\n 40. {hpkg-user}: Number of hpkg-user packages\n 41. {pisi}: Number of pisi packages\n 42. {nix-all}: Total number of all nix packages\n 43. {flatpak-all}: Total number of all flatpak app packages\n 44. {brew-all}: Total number of all brew packages\n 45. {guix-all}: Total number of all guix packages\n 46. {hpkg-all}: Total number of all hpkg packages", "type": "string" }, "physicaldiskFormat": { @@ -786,11 +786,11 @@ }, { "const": "si", - "description": "1000 Bytes = 1 KB, 1000 KB = 1 MB, ..." + "description": "1000 Bytes = 1 kB, 1000 kB = 1 MB, ..." }, { "const": "jedec", - "description": "1024 Bytes = 1 kB, 1024 K = 1 MB, ..." + "description": "1024 Bytes = 1 KB, 1024 KB = 1 MB, ..." } ] }, @@ -2652,6 +2652,7 @@ "pacman", "pacstall", "paludis", + "pisi", "pkg", "pkgtool", "qi", diff --git a/presets/examples/25.jsonc b/presets/examples/25.jsonc new file mode 100644 index 0000000000..527b0db6dc --- /dev/null +++ b/presets/examples/25.jsonc @@ -0,0 +1,241 @@ +// Based on #1576 +{ + "$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json", + "display": { + "color": { + "keys": "blue" + }, + "separator": "", + "constants": [ + "──────────────────────────────────────────────", + "\u001b[47D", + "\u001b[47C", + "\u001b[46C" + ], + "brightColor": false + }, + "modules": [ + { + "type": "version", + "key": "┌───────────────┬─{$1}┐\u001b[41D", + "format": "\u001b[1m{#keys} {1} - {2} " + }, + { + "type": "os", + "key": "│ {icon} \u001b[s{sysname}\u001b[u\u001b[10C│{$3}│{$2}" + }, + { + "type": "datetime", + "key": "│ {icon} Fetched │{$3}│{$2}", + "format": "{year}-{month-pretty}-{day-pretty} {hour-pretty}:{minute-pretty}:{second-pretty} {timezone-name}" + }, + { + "type": "locale", + "key": "│ {icon} Locale │{$3}│{$2}" + }, + + // Hardware + { + "type": "custom", + "key": "│{#cyan}┌──────────────┬{$1}┐{#keys}│\u001b[37D", + "format": "{#bright_cyan} Hardware " + }, + { + "type": "chassis", + "key": "│{#cyan}│ {icon} Chassis │{$4}│{#keys}│{$2}" + }, + { + "type": "memory", + "key": "│{#cyan}│ {icon} RAM │{$4}│{#keys}│{$2}" + }, + { + "type": "swap", + "key": "│{#cyan}│ {icon} SWAP │{$4}│{#keys}│{$2}" + }, + { + "type": "cpu", + "key": "│{#cyan}│ {icon} CPU │{$4}│{#keys}│{$2}", + "showPeCoreCount": true + }, + { + "type": "gpu", + "key": "│{#cyan}│ {icon} GPU │{$4}│{#keys}│{$2}" + }, + { + "type": "disk", + "key": "│{#cyan}│ {icon} Disk │{$4}│{#keys}│{$2}", + "format": "{size-used} \/ {size-total} ({size-percentage}) - {filesystem}", + }, + { + "type": "battery", + "key": "│{#cyan}│ {icon} Battery │{$4}│{#keys}│{$2}" + }, + { + "type": "custom", + "key": "│{#cyan}└──────────────┴{$1}┘{#keys}│", + "format": "" + }, + + // Desktop + { + "type": "custom", + "key": "│{#green}┌──────────────┬{$1}┐{#keys}│\u001b[37D", + "format": "{#bright_green} Desktop " + }, + { + "type": "de", + "key": "│{#green}│ {icon} Desktop │{$4}│{#keys}│{$2}" + }, + { + "type": "wm", + "key": "│{#green}│ {icon} Session │{$4}│{#keys}│{$2}" + }, + { + "type": "display", + "key": "│{#green}│ {icon} Display │{$4}│{#keys}│{$2}", + "compactType": "original-with-refresh-rate" + }, + { + "type": "gpu", + "key": "│{#green}│ {icon} G-Driver │{$4}│{#keys}│{$2}", + "format": "{driver}" + }, + { + "type": "custom", + "key": "│{#green}└──────────────┴{$1}┘{#keys}│", + "format": "" + }, + + // Terminal + { + "type": "custom", + "key": "│{#yellow}┌──────────────┬{$1}┐{#keys}│\u001b[37D", + "format": "{#bright_yellow} Terminal " + }, + { + "type": "shell", + "key": "│{#yellow}│ {icon} Shell │{$4}│{#keys}│{$2}" + }, + { + "type": "terminal", + "key": "│{#yellow}│ {icon} Terminal │{$4}│{#keys}│{$2}" + }, + { + "type": "terminalfont", + "key": "│{#yellow}│ {icon} Term Font │{$4}│{#keys}│{$2}" + }, + { + "type": "terminaltheme", + "key": "│{#yellow}│ {icon} Colors │{$4}│{#keys}│{$2}" + }, + { + "type": "packages", + "key": "│{#yellow}│ {icon} Packages │{$4}│{#keys}│{$2}" + }, + { + "type": "custom", + "key": "│{#yellow}└──────────────┴{$1}┘{#keys}│", + "format": "" + }, + + // Development + { + "type": "custom", + "key": "│{#red}┌──────────────┬{$1}┐{#keys}│\u001b[39D", + "format": "{#bright_red} Development " + }, + { + "type": "command", + "keyIcon": "", + "key": "│{#red}│ {icon} Rust │{$4}│{#keys}│{$2}", + "text": "rustc --version | cut -d' ' -f2", + "format": "rustc {}" + }, + { + "type": "command", + "keyIcon": "", + "key": "│{#red}│ {icon} Clang │{$4}│{#keys}│{$2}", + "text": "clang --version | head -1 | awk '{print $NF}'", + "format": "clang {}" + }, + { + "type": "command", + "keyIcon": "", + "key": "│{#red}│ {icon} NodeJS │{$4}│{#keys}│{$2}", + "text": "node --version", + "format": "node {~1}" + }, + { + "type": "command", + "keyIcon": "", + "key": "│{#red}│ {icon} Go │{$4}│{#keys}│{$2}", + "text": "go version | cut -d' ' -f3", + "format": "go {~2}" + }, + { + "type": "command", + "keyIcon": "", + "key": "│{#red}│ {icon} Zig │{$4}│{#keys}│{$2}", + "text": "zig version", + "format": "zig {}" + }, + { + "type": "editor", + "key": "│{#red}│ {icon} Editor │{$4}│{#keys}│{$2}" + }, + { + "type": "command", + "keyIcon": "󰊢", + "key": "│{#red}│ {icon} Git │{$4}│{#keys}│{$2}", + "text": "git version", + "format": "git {~12}" + }, + { + "type": "font", + "key": "│{#red}│ {icon} Interface │{$4}│{#keys}│{$2}" + }, + { + "type": "custom", + "key": "│{#red}└──────────────┴{$1}┘{#keys}│", + "format": "" + }, + + // Uptime + { + "type": "custom", + "key": "│{#magenta}┌──────────────┬{$1}┐{#keys}│\u001b[36D", + "format": "{#bright_magenta} Uptime " + }, + { + "type": "uptime", + "key": "│{#magenta}│ {icon} Uptime │{$4}│{#keys}│{$2}" + }, + { + "type": "users", + "myselfOnly": true, + "keyIcon": "", + "key": "│{#magenta}│ {icon} Login │{$4}│{#keys}│{$2}" + }, + { + "type": "disk", + "keyIcon": "", + "key": "│{#magenta}│ {icon} OS Age │{$4}│{#keys}│{$2}", + "folders": "/", // On macOS, "/System/Volumes/VM" works for me + "format": "{create-time:10} [{days} days]" + }, + { + "type": "custom", + "key": "│{#magenta}└──────────────┴{$1}┘{#keys}│", + "format": "" + }, + { + "type": "custom", + "key": "└─────────────────{$1}┘", + "format": "" + }, + + // End + "break", + "colors" + ] +} diff --git a/src/data/help.json b/src/data/help.json index 35218f5cad..a4a869f5a3 100644 --- a/src/data/help.json +++ b/src/data/help.json @@ -683,8 +683,8 @@ "type": "enum", "enum": { "IEC": "1024 Bytes = 1 KiB, 1024 KiB = 1 MiB, ...", - "SI": "1000 Bytes = 1 KB, 1000 KB = 1 MB, ...", - "JEDEC": "1024 Bytes = 1 kB, 1024 kB = 1 MB, ..." + "SI": "1000 Bytes = 1 kB, 1000 kB = 1 MB, ...", + "JEDEC": "1024 Bytes = 1 KB, 1024 KB = 1 MB, ..." }, "default": "IEC" } diff --git a/src/detection/battery/battery_haiku.c b/src/detection/battery/battery_haiku.c index 09ffa37ded..181049e2df 100644 --- a/src/detection/battery/battery_haiku.c +++ b/src/detection/battery/battery_haiku.c @@ -18,6 +18,9 @@ const char* parseBattery(int dfd, const char* battId, FFlist* results) if (ioctl(fd, GET_EXTENDED_BATTERY_INFO, &extended, sizeof(extended)) != 0) return "ioctl(GET_EXTENDED_BATTERY_INFO) failed"; + if (extended.last_full_charge == (uint32)-1) + return "Skipped"; + FFBatteryResult* battery = (FFBatteryResult*)ffListAdd(results); ffStrbufInitS(&battery->modelName, extended.model_number); ffStrbufInitS(&battery->manufacturer, extended.oem_info); diff --git a/src/detection/bootmgr/bootmgr_linux.c b/src/detection/bootmgr/bootmgr_linux.c index e1e11f967a..27738f724b 100644 --- a/src/detection/bootmgr/bootmgr_linux.c +++ b/src/detection/bootmgr/bootmgr_linux.c @@ -20,7 +20,7 @@ const char* ffDetectBootmgr(FFBootmgrResult* result) ffEfiFillLoadOption((FFEfiLoadOption *)&buffer[4], result); - if (ffReadFileData(FF_EFIVARS_PATH_PREFIX "SecureBoot-" FF_EFI_GLOBAL_GUID, sizeof(buffer), buffer) == 6) + if (ffReadFileData(FF_EFIVARS_PATH_PREFIX "SecureBoot-" FF_EFI_GLOBAL_GUID, sizeof(buffer), buffer) >= 5) result->secureBoot = buffer[4] == 1; return NULL; diff --git a/src/detection/brightness/brightness.h b/src/detection/brightness/brightness.h index f0adf329dc..3db260a666 100644 --- a/src/detection/brightness/brightness.h +++ b/src/detection/brightness/brightness.h @@ -7,6 +7,7 @@ typedef struct FFBrightnessResult { FFstrbuf name; double min, max, current; + bool builtin; } FFBrightnessResult; const char* ffDetectBrightness(FFBrightnessOptions* options, FFlist* result); // list of FFBrightnessResult diff --git a/src/detection/brightness/brightness_apple.c b/src/detection/brightness/brightness_apple.c index e10d912bed..de3750a941 100644 --- a/src/detection/brightness/brightness_apple.c +++ b/src/detection/brightness/brightness_apple.c @@ -42,6 +42,7 @@ static const char* detectWithDisplayServices(const FFDisplayServerResult* displa brightness->max = 1; brightness->min = 0; ffStrbufInitCopy(&brightness->name, &display->name); + brightness->builtin = true; } } } @@ -111,6 +112,7 @@ static const char* detectWithDdcci(FF_MAYBE_UNUSED const FFDisplayServerResult* brightness->min = 0; brightness->current = current; ffStrbufInit(&brightness->name); + brightness->builtin = false; uint8_t edid[128] = {}; if (IOAVServiceReadI2C(service, 0x50, 0x00, edid, ARRAY_SIZE(edid)) == KERN_SUCCESS) @@ -179,6 +181,7 @@ static const char* detectWithDdcci(const FFDisplayServerResult* displayServer, F brightness->min = 0; brightness->current = current; ffStrbufInitCopy(&brightness->name, &display->name); + brightness->builtin = false; } } diff --git a/src/detection/brightness/brightness_bsd.c b/src/detection/brightness/brightness_bsd.c index c77c378fea..6b7a0a8b33 100644 --- a/src/detection/brightness/brightness_bsd.c +++ b/src/detection/brightness/brightness_bsd.c @@ -32,6 +32,7 @@ const char* ffDetectBrightness(FF_MAYBE_UNUSED FFBrightnessOptions* options, FFl brightness->max = BACKLIGHTMAXLEVELS; brightness->min = 0; brightness->current = status.brightness; + brightness->builtin = true; struct backlight_info info; if(ioctl(blfd, BACKLIGHTGETINFO, &info) == 0) diff --git a/src/detection/brightness/brightness_linux.c b/src/detection/brightness/brightness_linux.c index 645fb58c67..602649c3c8 100644 --- a/src/detection/brightness/brightness_linux.c +++ b/src/detection/brightness/brightness_linux.c @@ -74,6 +74,7 @@ static const char* detectWithBacklight(FFlist* result) brightness->max = ffStrbufToDouble(&buffer); brightness->min = 0; brightness->current = actualBrightness; + brightness->builtin = true; } } ffStrbufSubstrBefore(&backlightDir, backlightDirLength); diff --git a/src/detection/brightness/brightness_nbsd.c b/src/detection/brightness/brightness_nbsd.c index 1fd7773b0e..67464772e6 100644 --- a/src/detection/brightness/brightness_nbsd.c +++ b/src/detection/brightness/brightness_nbsd.c @@ -7,7 +7,7 @@ const char* ffDetectBrightness(FF_MAYBE_UNUSED FFBrightnessOptions* options, FFl // https://man.netbsd.org/NetBSD-10.1/acpiout.4#DESCRIPTION char key[] = "hw.acpi.acpiout0.brightness"; char* pn = key + strlen("hw.acpi.acpiout"); - + for (uint32_t i = 0; i <= 9; ++i) { *pn = (char) ('0' + i); @@ -20,6 +20,7 @@ const char* ffDetectBrightness(FF_MAYBE_UNUSED FFBrightnessOptions* options, FFl brightness->max = 100; brightness->min = 0; brightness->current = value; + brightness->builtin = true; } return NULL; } diff --git a/src/detection/brightness/brightness_obsd.c b/src/detection/brightness/brightness_obsd.c index ea5d7334cc..bb0bd861b4 100644 --- a/src/detection/brightness/brightness_obsd.c +++ b/src/detection/brightness/brightness_obsd.c @@ -25,6 +25,7 @@ const char* ffDetectBrightness(FF_MAYBE_UNUSED FFBrightnessOptions* options, FFl brightness->max = param.max; brightness->min = param.min; brightness->current = param.curval; + brightness->builtin = true; return NULL; } diff --git a/src/detection/brightness/brightness_windows.cpp b/src/detection/brightness/brightness_windows.cpp index fbbcf6e35e..27d53cca8e 100644 --- a/src/detection/brightness/brightness_windows.cpp +++ b/src/detection/brightness/brightness_windows.cpp @@ -24,6 +24,7 @@ static const char* detectWithWmi(FFlist* result) brightness->max = 100; brightness->min = 0; brightness->current = vtValue.get(); + brightness->builtin = true; ffStrbufInit(&brightness->name); if (FFWmiVariant vtName = record.get(L"InstanceName")) @@ -61,6 +62,7 @@ static const char* detectWithDdcci(const FFDisplayServerResult* displayServer, F brightness->max = max; brightness->min = min; brightness->current = curr; + brightness->builtin = false; } } } diff --git a/src/detection/camera/camera_apple.m b/src/detection/camera/camera_apple.m index 45da1246fe..49a296fbb9 100644 --- a/src/detection/camera/camera_apple.m +++ b/src/detection/camera/camera_apple.m @@ -16,18 +16,18 @@ #ifdef MAC_OS_X_VERSION_10_15 FF_SUPPRESS_IO(); // #822 - AVCaptureDeviceType deviceType; + AVCaptureDeviceType deviceType = NULL; #ifdef MAC_OS_VERSION_14_0 + // Strangely `@available(macOS 14.0, *)` doesn't work here (#1594) if (@available(macOS 14.0, *)) { - deviceType = AVCaptureDeviceTypeExternal; + if (&AVCaptureDeviceTypeExternal) + deviceType = AVCaptureDeviceTypeExternal; } - else #endif - { + if (deviceType == NULL) deviceType = AVCaptureDeviceTypeExternalUnknown; - } AVCaptureDeviceDiscoverySession* session = [AVCaptureDeviceDiscoverySession discoverySessionWithDeviceTypes:@[AVCaptureDeviceTypeBuiltInWideAngleCamera, deviceType] mediaType:AVMediaTypeVideo diff --git a/src/detection/chassis/chassis_apple.c b/src/detection/chassis/chassis_apple.c new file mode 100644 index 0000000000..0a649e0c1e --- /dev/null +++ b/src/detection/chassis/chassis_apple.c @@ -0,0 +1,38 @@ +#include "chassis.h" +#include "detection/host/host.h" + +const char* ffDetectChassis(FFChassisResult* result) +{ + FFHostResult host = { + .family = ffStrbufCreate(), + .name = ffStrbufCreate(), + .version = ffStrbufCreate(), + .sku = ffStrbufCreate(), + .serial = ffStrbufCreate(), + .uuid = ffStrbufCreate(), + .vendor = ffStrbufCreate(), + }; + if (ffDetectHost(&host) != NULL) + return "Failed to detect host"; + + if (ffStrbufStartsWithS(&host.name, "MacBook ")) + ffStrbufSetStatic(&result->type, "Laptop"); + else if (ffStrbufStartsWithS(&host.name, "Mac mini ")) + ffStrbufSetStatic(&result->type, "Mini PC"); + else if (ffStrbufStartsWithS(&host.name, "iMac ")) + ffStrbufSetStatic(&result->type, "All-in-One"); + else + ffStrbufSetStatic(&result->type, "Desktop"); + + ffStrbufSet(&result->vendor, &host.vendor); + + ffStrbufDestroy(&host.family); + ffStrbufDestroy(&host.name); + ffStrbufDestroy(&host.version); + ffStrbufDestroy(&host.sku); + ffStrbufDestroy(&host.serial); + ffStrbufDestroy(&host.uuid); + ffStrbufDestroy(&host.vendor); + + return NULL; +} diff --git a/src/detection/os/os_linux.c b/src/detection/os/os_linux.c index 44a3626053..1397febe66 100644 --- a/src/detection/os/os_linux.c +++ b/src/detection/os/os_linux.c @@ -83,6 +83,11 @@ FF_MAYBE_UNUSED static void getUbuntuFlavour(FFOSResult* result) ffStrbufSetS(&result->versionID, result->prettyName.chars + strlen("Rhino Linux ")); return; } + else if(ffStrbufStartsWithS(&result->prettyName, "VanillaOS ")) + { + ffStrbufSetS(&result->id, "vanilla"); + ffStrbufSetS(&result->idLike, "ubuntu"); + } if(ffStrContains(xdgConfigDirs, "kde") || ffStrContains(xdgConfigDirs, "plasma") || ffStrContains(xdgConfigDirs, "kubuntu")) { diff --git a/src/detection/packages/packages.h b/src/detection/packages/packages.h index 5e91173a68..eb8afc44a3 100644 --- a/src/detection/packages/packages.h +++ b/src/detection/packages/packages.h @@ -32,6 +32,7 @@ typedef struct FFPackagesResult uint32_t pacman; uint32_t pacstall; uint32_t paludis; + uint32_t pisi; uint32_t pkg; uint32_t pkgsrc; uint32_t pkgtool; diff --git a/src/detection/packages/packages_linux.c b/src/detection/packages/packages_linux.c index b306b17694..ab677ccfce 100644 --- a/src/detection/packages/packages_linux.c +++ b/src/detection/packages/packages_linux.c @@ -573,6 +573,7 @@ static void getPackageCounts(FFstrbuf* baseDir, FFPackagesResult* packageCounts, if (!(options->disabled & FF_PACKAGES_FLAG_LINGLONG_BIT)) packageCounts->linglong += getNumElements(baseDir, "/var/lib/linglong/repo/refs/heads/main", true); if (!(options->disabled & FF_PACKAGES_FLAG_PACSTALL_BIT)) packageCounts->pacstall += getNumElements(baseDir, "/var/lib/pacstall/metadata", false); if (!(options->disabled & FF_PACKAGES_FLAG_QI_BIT)) packageCounts->qi += getNumStrings(baseDir, "/var/qi/installed_packages.list", "\n", "qi"); + if (!(options->disabled & FF_PACKAGES_FLAG_PISI_BIT)) packageCounts->pisi += getNumElements(baseDir, "/var/lib/pisi/package", true); } static void getPackageCountsRegular(FFstrbuf* baseDir, FFPackagesResult* packageCounts, FFPackagesOptions* options) diff --git a/src/detection/terminalfont/terminalfont_linux.c b/src/detection/terminalfont/terminalfont_linux.c index 497755bc5a..ef762e9618 100644 --- a/src/detection/terminalfont/terminalfont_linux.c +++ b/src/detection/terminalfont/terminalfont_linux.c @@ -475,4 +475,6 @@ void ffDetectTerminalFontPlatform(const FFTerminalResult* terminal, FFTerminalFo else if(ffStrbufStartsWithIgnCaseS(&terminal->processName, "Terminal")) detectHaikuTerminal(terminalFont); #endif + else if(ffStrbufStartsWithIgnCaseS(&terminal->processName, "termite")) + detectFromConfigFile("termite/config", "font =", terminalFont); } diff --git a/src/detection/terminalshell/terminalshell.c b/src/detection/terminalshell/terminalshell.c index 6d6f5b6b67..d3c69d63eb 100644 --- a/src/detection/terminalshell/terminalshell.c +++ b/src/detection/terminalshell/terminalshell.c @@ -707,6 +707,20 @@ FF_MAYBE_UNUSED static bool getTerminalVersionSakura(FFstrbuf* exe, FFstrbuf* ve ffStrbufSubstrAfterLastC(version, ' '); return true; } + +FF_MAYBE_UNUSED static bool getTerminalVersionTermite(FFstrbuf* exe, FFstrbuf* version) +{ + if(ffProcessAppendStdOut(version, (char* const[]) { + exe->chars, + "--version", + NULL + }) != NULL) // termite v16.9\nvte 0.78.1 +BIDI +GNUTLS +ICU +SYSTEMD + return false; + + ffStrbufSubstrBeforeFirstC(version, '\n'); + ffStrbufSubstrAfterLastC(version, 'v'); + return true; +} #endif #ifdef _WIN32 @@ -812,6 +826,9 @@ bool fftsGetTerminalVersion(FFstrbuf* processName, FF_MAYBE_UNUSED FFstrbuf* exe if(ffStrbufIgnCaseEqualS(processName, "sakura")) return getTerminalVersionSakura(exe, version); + if(ffStrbufIgnCaseEqualS(processName, "termite")) + return getTerminalVersionTermite(exe, version); + #endif #ifdef _WIN32 diff --git a/src/logo/ascii/bedrock_small.txt b/src/logo/ascii/bedrock_small.txt new file mode 100644 index 0000000000..2de5e4ddaf --- /dev/null +++ b/src/logo/ascii/bedrock_small.txt @@ -0,0 +1,6 @@ + _________ +| __ | +| \ \___ | +| \ _ \ | +| \___/ | +|_________| diff --git a/src/logo/ascii/fastfetch.txt b/src/logo/ascii/fastfetch.txt new file mode 100644 index 0000000000..099baf85a3 --- /dev/null +++ b/src/logo/ascii/fastfetch.txt @@ -0,0 +1,11 @@ +╭───────────────────────╮ +│ $2● $3● $4● $5FASTFETCH $1│ +├───────────────────────┤ +│ │ +│ $2 /\ $7►►►►►►► $1│ +│ $2 /--\ $7►►►►►► $1│ +│ $2/----\ $7►►►►► $1│ +│ $6|xx| $7►►►► $1│ +│ $6|xx| $7►►► $1│ +│ $3^^^^ $1│ +╰───────────────────────╯ \ No newline at end of file diff --git a/src/logo/ascii/mint.txt b/src/logo/ascii/linuxmint.txt similarity index 100% rename from src/logo/ascii/mint.txt rename to src/logo/ascii/linuxmint.txt diff --git a/src/logo/ascii/mint_old.txt b/src/logo/ascii/linuxmint_old.txt similarity index 100% rename from src/logo/ascii/mint_old.txt rename to src/logo/ascii/linuxmint_old.txt diff --git a/src/logo/ascii/mint_small.txt b/src/logo/ascii/linuxmint_small.txt similarity index 100% rename from src/logo/ascii/mint_small.txt rename to src/logo/ascii/linuxmint_small.txt diff --git a/src/logo/ascii/opensuse_tumbleweed_small.txt b/src/logo/ascii/opensuse_tumbleweed_small.txt new file mode 100644 index 0000000000..d7c50d7d46 --- /dev/null +++ b/src/logo/ascii/opensuse_tumbleweed_small.txt @@ -0,0 +1,9 @@ + .oooo. +o o o +ooooo oo +o oo + 'oooooooooooo. + oo o + oo ooooo + o o o + 'oooo' \ No newline at end of file diff --git a/src/logo/ascii/shebang.txt b/src/logo/ascii/shebang.txt new file mode 100644 index 0000000000..22b98e3663 --- /dev/null +++ b/src/logo/ascii/shebang.txt @@ -0,0 +1,20 @@ + ' + '#' + '#!#' + '#!#!#' + '#!#!#!#' + '#!#!#!#!#' + '#!#!#!#!#!#' + '#!#!#!#!#!#!#' + #!#!#!#!#!#!' + '#! #!#!#!#!#' + '#!#!#!#! #!#!#!' + '#!#!#!#!#!#!#! #!#!' + '#!#!#!#!#!#!#!#!#!#! #' + '#!#!#!#!#!#!#!#!#!#!#!#! + '#!#!#!#!#!#!#!#!#!#! #!' + '#!#!#!#!#!#!#!#! #!#!#!' + '#!#!#!#!#!#! #!#!#!#!#!' + '#!#!#!#! #!#!#!#!#' + '#!#! #!#!#' +'# #!' diff --git a/src/logo/builtin.c b/src/logo/builtin.c index 78a38bf088..3e7f81d5d2 100644 --- a/src/logo/builtin.c +++ b/src/logo/builtin.c @@ -56,7 +56,7 @@ static const FFlogo A[] = { }, // AlmaLinux { - .names = {"almalinux"}, + .names = {"Almalinux"}, .lines = FASTFETCH_DATATEXT_LOGO_ALMALINUX, .colors = { FF_COLOR_FG_RED, @@ -70,7 +70,7 @@ static const FFlogo A[] = { }, // Alpine { - .names = {"alpine", "alpinelinux", "alpine-linux"}, + .names = {"Alpine"}, .lines = FASTFETCH_DATATEXT_LOGO_ALPINE, .colors = { FF_COLOR_FG_BLUE, @@ -80,7 +80,7 @@ static const FFlogo A[] = { }, // AlpineSmall { - .names = {"alpine_small", "alpine-linux-small"}, + .names = {"Alpine_small"}, .type = FF_LOGO_LINE_TYPE_SMALL_BIT, .lines = FASTFETCH_DATATEXT_LOGO_ALPINE_SMALL, .colors = { @@ -92,7 +92,7 @@ static const FFlogo A[] = { }, // Alpine2Small { - .names = {"alpine2_small", "alpine-linux2-small"}, + .names = {"alpine2_small"}, .type = FF_LOGO_LINE_TYPE_SMALL_BIT | FF_LOGO_LINE_TYPE_ALTER_BIT, .lines = FASTFETCH_DATATEXT_LOGO_ALPINE2_SMALL, .colors = { @@ -114,7 +114,7 @@ static const FFlogo A[] = { }, // ALTLinux { - .names = {"ALTLinux", "Sisyphus"}, + .names = {"ALTLinux"}, .lines = FASTFETCH_DATATEXT_LOGO_ALTLINUX, .colors = { FF_COLOR_FG_YELLOW, @@ -177,7 +177,7 @@ static const FFlogo A[] = { }, // AndroidSmall { - .names = {"android-small", "android_small"}, + .names = {"android_small"}, .type = FF_LOGO_LINE_TYPE_SMALL_BIT, .lines = FASTFETCH_DATATEXT_LOGO_ANDROID_SMALL, .colors = { @@ -341,7 +341,7 @@ static const FFlogo A[] = { }, // Arch { - .names = {"arch", "archlinux", "arch-linux", "archmerge"}, + .names = {"arch", "archmerge"}, .lines = FASTFETCH_DATATEXT_LOGO_ARCH, .colors = { FF_COLOR_FG_CYAN, @@ -350,7 +350,7 @@ static const FFlogo A[] = { }, // Arch2 { - .names = {"arch2", "archlinux2", "arch-linux2"}, + .names = {"arch2"}, .type = FF_LOGO_LINE_TYPE_ALTER_BIT, .lines = FASTFETCH_DATATEXT_LOGO_ARCH2, .colors = { @@ -360,7 +360,7 @@ static const FFlogo A[] = { }, // Arch3 { - .names = {"arch3", "archlinux3", "arch-linux3"}, + .names = {"arch3"}, .type = FF_LOGO_LINE_TYPE_ALTER_BIT, .lines = FASTFETCH_DATATEXT_LOGO_ARCH3, .colors = { @@ -370,7 +370,7 @@ static const FFlogo A[] = { }, // ArchSmall { - .names = {"arch_small", "archlinux_small", "arch-linux-small"}, + .names = {"arch_small"}, .type = FF_LOGO_LINE_TYPE_SMALL_BIT, .lines = FASTFETCH_DATATEXT_LOGO_ARCH_SMALL, .colors = { @@ -454,7 +454,7 @@ static const FFlogo A[] = { }, // ArtixSmall { - .names = {"artix_small", "artixlinux_small", "artix-linux-small"}, + .names = {"artix_small", "artixlinux_small"}, .type = FF_LOGO_LINE_TYPE_SMALL_BIT, .lines = FASTFETCH_DATATEXT_LOGO_ARTIX_SMALL, .colors = { @@ -465,7 +465,7 @@ static const FFlogo A[] = { }, // Artix2Small { - .names = {"artix2_small", "artixlinux2_small", "artix-linux2-small"}, + .names = {"artix2_small", "artixlinux2_small"}, .type = FF_LOGO_LINE_TYPE_SMALL_BIT | FF_LOGO_LINE_TYPE_ALTER_BIT, .lines = FASTFETCH_DATATEXT_LOGO_ARTIX2_SMALL, .colors = { @@ -634,7 +634,7 @@ static const FFlogo A[] = { static const FFlogo B[] = { // Bedrock { - .names = {"bedrock", "bedrocklinux", "bedrock-linux"}, + .names = {"bedrock"}, .lines = FASTFETCH_DATATEXT_LOGO_BEDROCK, .colors = { FF_COLOR_FG_LIGHT_BLACK, //grey @@ -643,6 +643,17 @@ static const FFlogo B[] = { .colorKeys = FF_COLOR_FG_LIGHT_BLACK, //grey .colorTitle = FF_COLOR_FG_WHITE, }, + // BedrockSmall + { + .names = {"bedrock_small"}, + .lines = FASTFETCH_DATATEXT_LOGO_BEDROCK_SMALL, + .type = FF_LOGO_LINE_TYPE_SMALL_BIT, + .colors = { + FF_COLOR_FG_WHITE, + }, + .colorKeys = FF_COLOR_FG_WHITE, + .colorTitle = FF_COLOR_FG_WHITE, + }, // BigLinux { .names = {"BigLinux"}, @@ -786,7 +797,7 @@ static const FFlogo B[] = { static const FFlogo C[] = { // CachyOS { - .names = {"Cachy", "cachyos", "cachy-linux", "cachyos-linux"}, + .names = {"CachyOS"}, .lines = FASTFETCH_DATATEXT_LOGO_CACHYOS, .colors = { FF_COLOR_FG_CYAN, @@ -798,7 +809,7 @@ static const FFlogo C[] = { }, // CachyOSSmall { - .names = {"Cachy_small", "cachyos_small", "cachy-linux-small", "cachyos-linux-small"}, + .names = {"CachyOS_small"}, .type = FF_LOGO_LINE_TYPE_SMALL_BIT, .lines = FASTFETCH_DATATEXT_LOGO_CACHYOS_SMALL, .colors = { @@ -882,7 +893,7 @@ static const FFlogo C[] = { }, // CentOS { - .names = {"Cent", "centos", "cent-linux", "centos-linux"}, + .names = {"CentOS"}, .lines = FASTFETCH_DATATEXT_LOGO_CENTOS, .colors = { FF_COLOR_FG_YELLOW, @@ -896,7 +907,7 @@ static const FFlogo C[] = { }, // CentOSSmall { - .names = {"Cent_small", "centos_small", "cent-linux_small", "cent-linux-small", "centos-linux-small"}, + .names = {"CentOS_small"}, .type = FF_LOGO_LINE_TYPE_SMALL_BIT, .lines = FASTFETCH_DATATEXT_LOGO_CENTOS_SMALL, .colors = { @@ -910,7 +921,7 @@ static const FFlogo C[] = { }, // Cereus { - .names = {"cereus", "Cereus Linux"}, + .names = {"Cereus", "Cereus Linux"}, .lines = FASTFETCH_DATATEXT_LOGO_CEREUS, .colors = { FF_COLOR_FG_256 "173", @@ -1239,7 +1250,7 @@ static const FFlogo D[] = { }, // DebianSmall { - .names = {"Debian_small", "debian-linux-small"}, + .names = {"Debian_small", "debian-linux_small"}, .type = FF_LOGO_LINE_TYPE_SMALL_BIT, .lines = FASTFETCH_DATATEXT_LOGO_DEBIAN_SMALL, .colors = { @@ -1271,7 +1282,7 @@ static const FFlogo D[] = { }, // Devuan { - .names = {"Devuan", "devuan-linux"}, + .names = {"Devuan"}, .lines = FASTFETCH_DATATEXT_LOGO_DEVUAN, .colors = { FF_COLOR_FG_MAGENTA, @@ -1281,7 +1292,7 @@ static const FFlogo D[] = { }, // DevuanSmall { - .names = {"Devuan_small", "devuan-linux-small"}, + .names = {"Devuan_small"}, .type = FF_LOGO_LINE_TYPE_SMALL_BIT, .lines = FASTFETCH_DATATEXT_LOGO_DEVUAN_SMALL, .colors = { @@ -1314,7 +1325,7 @@ static const FFlogo D[] = { }, // DragonFly { - .names = {"DragonFly", "DragonFly-BSD"}, + .names = {"DragonFly"}, .lines = FASTFETCH_DATATEXT_LOGO_DRAGONFLY, .colors = { FF_COLOR_FG_RED, @@ -1325,7 +1336,7 @@ static const FFlogo D[] = { }, // DragonFlySmall { - .names = {"DragonFly_small", "DragonFly-BSD_small"}, + .names = {"DragonFly_small"}, .type = FF_LOGO_LINE_TYPE_SMALL_BIT, .lines = FASTFETCH_DATATEXT_LOGO_DRAGONFLY_SMALL, .colors = { @@ -1337,7 +1348,7 @@ static const FFlogo D[] = { }, // DragonFlyOld { - .names = {"DragonFly_old", "DragonFly-BSD_old"}, + .names = {"DragonFly_old"}, .type = FF_LOGO_LINE_TYPE_ALTER_BIT, .lines = FASTFETCH_DATATEXT_LOGO_DRAGONFLY_OLD, .colors = { @@ -1397,7 +1408,7 @@ static const FFlogo E[] = { }, // ElementarySmall { - .names = {"Elementary_small", "elementary-small"}, + .names = {"Elementary_small"}, .type = FF_LOGO_LINE_TYPE_SMALL_BIT, .lines = FASTFETCH_DATATEXT_LOGO_ELEMENTARY_SMALL, .colors = { @@ -1570,9 +1581,25 @@ static const FFlogo E[] = { }; static const FFlogo F[] = { + // Fastfetch + { + .names = {"Fastfetch", "FF"}, + .lines = FASTFETCH_DATATEXT_LOGO_FASTFETCH, + .colors = { + FF_COLOR_FG_BLUE, + FF_COLOR_FG_RED, + FF_COLOR_FG_YELLOW, + FF_COLOR_FG_GREEN, + FF_COLOR_FG_DEFAULT, + FF_COLOR_FG_MAGENTA, + FF_COLOR_FG_CYAN, + }, + .colorKeys = FF_COLOR_FG_BLUE, + .colorTitle = FF_COLOR_FG_YELLOW, + }, // Fedora { - .names = {"Fedora", "fedora-linux"}, + .names = {"Fedora"}, .lines = FASTFETCH_DATATEXT_LOGO_FEDORA, .colors = { FF_COLOR_FG_BLUE, @@ -1599,7 +1626,7 @@ static const FFlogo F[] = { }, // FedoraSmall { - .names = {"Fedora_small", "fedora-linux-small"}, + .names = {"Fedora_small"}, .type = FF_LOGO_LINE_TYPE_SMALL_BIT, .lines = FASTFETCH_DATATEXT_LOGO_FEDORA_SMALL, .colors = { @@ -1610,7 +1637,7 @@ static const FFlogo F[] = { }, // FedoraOld { - .names = {"Fedora_old", "fedora-old", "fedora-linux-old", "fedora-linux_old"}, + .names = {"Fedora_old"}, .type = FF_LOGO_LINE_TYPE_ALTER_BIT, .lines = FASTFETCH_DATATEXT_LOGO_FEDORA_OLD, .colors = { @@ -1622,7 +1649,7 @@ static const FFlogo F[] = { }, // FedoraSilverblue { - .names = {"Fedora_silverblue", "fedora-silverblue", "fedora-linux-silverblue", "fedora-linux_silverblue"}, + .names = {"Fedora_silverblue", "fedora-silverblue"}, .type = FF_LOGO_LINE_TYPE_ALTER_BIT, .lines = FASTFETCH_DATATEXT_LOGO_FEDORA_SILVERBLUE, .colors = { @@ -1635,7 +1662,7 @@ static const FFlogo F[] = { }, // FedoraKinoite { - .names = {"Fedora_kinoite", "fedora-kinoite", "fedora-linux-kinoite", "fedora-linux_kinoite"}, + .names = {"Fedora_kinoite", "fedora-kinoite"}, .type = FF_LOGO_LINE_TYPE_ALTER_BIT, .lines = FASTFETCH_DATATEXT_LOGO_FEDORA_KINOITE, .colors = { @@ -1647,7 +1674,7 @@ static const FFlogo F[] = { }, // FedoraSericea { - .names = {"Fedora_sericea", "fedora-sericea", "fedora-linux-sericea", "fedora-linux_sericea"}, + .names = {"Fedora_sericea", "fedora-sericea"}, .type = FF_LOGO_LINE_TYPE_ALTER_BIT, .lines = FASTFETCH_DATATEXT_LOGO_FEDORA_SERICEA, .colors = { @@ -1659,7 +1686,7 @@ static const FFlogo F[] = { }, // FedoraCoreOS { - .names = {"Fedora_coreos", "fedora-coreos", "fedora-linux-coreos", "fedora-linux_coreos"}, + .names = {"Fedora_coreos", "fedora-coreos"}, .type = FF_LOGO_LINE_TYPE_ALTER_BIT, .lines = FASTFETCH_DATATEXT_LOGO_FEDORA_COREOS, .colors = { @@ -1822,7 +1849,7 @@ static const FFlogo G[] = { }, // GarudaDragon { - .names = {"GarudaDragon", "garuda-dragon", "garuda-linux-dragon"}, + .names = {"GarudaDragon", "garuda-dragon"}, .lines = FASTFETCH_DATATEXT_LOGO_GARUDA_DRAGON, .colors = { FF_COLOR_FG_RED, @@ -1832,7 +1859,7 @@ static const FFlogo G[] = { }, // GarudaSmall { - .names = {"Garuda_small", "garudalinux_small", "garuda-linux-small"}, + .names = {"Garuda_small", "garuda-linux_small"}, .type = FF_LOGO_LINE_TYPE_SMALL_BIT, .lines = FASTFETCH_DATATEXT_LOGO_GARUDA_SMALL, .colors = { @@ -1843,7 +1870,7 @@ static const FFlogo G[] = { }, // Gentoo { - .names = {"Gentoo", "gentoo-linux"}, + .names = {"Gentoo"}, .lines = FASTFETCH_DATATEXT_LOGO_GENTOO, .colors = { FF_COLOR_FG_MAGENTA, @@ -1854,7 +1881,7 @@ static const FFlogo G[] = { }, // GentooSmall { - .names = {"Gentoo_small", "gentoo-linux-small"}, + .names = {"Gentoo_small"}, .type = FF_LOGO_LINE_TYPE_SMALL_BIT, .lines = FASTFETCH_DATATEXT_LOGO_GENTOO_SMALL, .colors = { @@ -2025,7 +2052,7 @@ static const FFlogo H[] = { }, // HaikuSmall { - .names = {"Haiku-small"}, + .names = {"Haiku_small"}, .type = FF_LOGO_LINE_TYPE_SMALL_BIT, .lines = FASTFETCH_DATATEXT_LOGO_HAIKU_SMALL, .colors = { @@ -2475,7 +2502,7 @@ static const FFlogo L[] = { }, // Lingmo OS { - .names = {"Lingmo", "lingmo", "LingmoOS", "lingmoos"}, + .names = {"Lingmo", "LingmoOS"}, .lines = FASTFETCH_DATATEXT_LOGO_LINGMO, .colors = { FF_COLOR_FG_BLUE, @@ -2558,7 +2585,7 @@ static const FFlogo L[] = { // LinuxMint { .names = {"linuxmint", "linux-mint"}, - .lines = FASTFETCH_DATATEXT_LOGO_MINT, + .lines = FASTFETCH_DATATEXT_LOGO_LINUXMINT, .colors = { FF_COLOR_FG_GREEN, FF_COLOR_FG_WHITE, @@ -2570,7 +2597,7 @@ static const FFlogo L[] = { { .names = {"linuxmint_small", "linux-mint_small"}, .type = FF_LOGO_LINE_TYPE_SMALL_BIT, - .lines = FASTFETCH_DATATEXT_LOGO_MINT_SMALL, + .lines = FASTFETCH_DATATEXT_LOGO_LINUXMINT_SMALL, .colors = { FF_COLOR_FG_GREEN, FF_COLOR_FG_WHITE, @@ -2582,7 +2609,7 @@ static const FFlogo L[] = { { .names = {"linuxmint_old", "linux-mint_old"}, .type = FF_LOGO_LINE_TYPE_ALTER_BIT, - .lines = FASTFETCH_DATATEXT_LOGO_MINT_OLD, + .lines = FASTFETCH_DATATEXT_LOGO_LINUXMINT_OLD, .colors = { FF_COLOR_FG_GREEN, FF_COLOR_FG_WHITE, @@ -2810,7 +2837,7 @@ static const FFlogo M[] = { }, // Manjaro { - .names = {"manjaro", "manjaro-linux", "manjarolinux", "manjaro-arm"}, + .names = {"manjaro", "manjaro-arm"}, .lines = FASTFETCH_DATATEXT_LOGO_MANJARO, .colors = { FF_COLOR_FG_GREEN, @@ -2820,7 +2847,7 @@ static const FFlogo M[] = { }, // ManjaroSmall { - .names = {"manjaro_small", "manjaro-linux-small"}, + .names = {"manjaro_small", "manjaro-arm_small"}, .type = FF_LOGO_LINE_TYPE_SMALL_BIT, .lines = FASTFETCH_DATATEXT_LOGO_MANJARO_SMALL, .colors = { @@ -2924,41 +2951,6 @@ static const FFlogo M[] = { .colorKeys = FF_COLOR_FG_LIGHT_BLACK, .colorTitle = FF_COLOR_FG_WHITE, }, - // Mint - { - .names = {"mint", "mint-linux"}, - .lines = FASTFETCH_DATATEXT_LOGO_MINT, - .colors = { - FF_COLOR_FG_GREEN, - FF_COLOR_FG_WHITE, - }, - .colorKeys = FF_COLOR_FG_GREEN, - .colorTitle = FF_COLOR_FG_GREEN, - }, - // MintSmall - { - .names = {"mint_small", "mint-linux-small"}, - .type = FF_LOGO_LINE_TYPE_SMALL_BIT, - .lines = FASTFETCH_DATATEXT_LOGO_MINT_SMALL, - .colors = { - FF_COLOR_FG_GREEN, - FF_COLOR_FG_WHITE, - }, - .colorKeys = FF_COLOR_FG_GREEN, - .colorTitle = FF_COLOR_FG_GREEN, - }, - // MintOld - { - .names = {"mint_old", "mint-old", "mint-linux_old", "mint-linux-old"}, - .type = FF_LOGO_LINE_TYPE_ALTER_BIT, - .lines = FASTFETCH_DATATEXT_LOGO_MINT_OLD, - .colors = { - FF_COLOR_FG_GREEN, - FF_COLOR_FG_WHITE, - }, - .colorKeys = FF_COLOR_FG_GREEN, - .colorTitle = FF_COLOR_FG_GREEN, - }, // Minix { .names = {"Minix"}, @@ -3096,7 +3088,7 @@ static const FFlogo N[] = { }, // NixOS { - .names = {"NixOS", "nix", "nixos-linux", "nix-linux"}, + .names = {"NixOS"}, .lines = FASTFETCH_DATATEXT_LOGO_NIXOS, .colors = { FF_COLOR_FG_BLUE, @@ -3105,7 +3097,7 @@ static const FFlogo N[] = { }, // NixOSSmall { - .names = {"NixOS_small", "nix_small", "nixos-linux-small", "nix-linux-small"}, + .names = {"NixOS_small"}, .type = FF_LOGO_LINE_TYPE_SMALL_BIT, .lines = FASTFETCH_DATATEXT_LOGO_NIXOS_SMALL, .colors = { @@ -3115,7 +3107,7 @@ static const FFlogo N[] = { }, // NixOSOld { - .names = {"nixos_old", "nix-old", "nixos-old", "nix_old"}, + .names = {"nixos_old"}, .type = FF_LOGO_LINE_TYPE_ALTER_BIT, .lines = FASTFETCH_DATATEXT_LOGO_NIXOS_OLD, .colors = { @@ -3125,7 +3117,7 @@ static const FFlogo N[] = { }, // NixOsOldSmall { - .names = {"nixos_old_small", "nix-old-small", "nixos-old-small", "nix_old_small"}, + .names = {"nixos_old_small"}, .type = FF_LOGO_LINE_TYPE_SMALL_BIT | FF_LOGO_LINE_TYPE_ALTER_BIT, .lines = FASTFETCH_DATATEXT_LOGO_NIXOS_OLD_SMALL, .colors = { @@ -3269,7 +3261,7 @@ static const FFlogo O[] = { }, // OpenBSDSmall { - .names = {"openbsd_small", "openbsd-small"}, + .names = {"openbsd_small"}, .type = FF_LOGO_LINE_TYPE_SMALL_BIT, .lines = FASTFETCH_DATATEXT_LOGO_OPENBSD_SMALL, .colors = { @@ -3339,7 +3331,7 @@ static const FFlogo O[] = { }, // openSuseMicroOS { - .names = {"opensuse-microos", "opensuse_microos"}, + .names = {"opensuse-microos"}, .lines = FASTFETCH_DATATEXT_LOGO_OPENSUSE_MICROOS, .colors = { FF_COLOR_FG_GREEN, @@ -3347,7 +3339,7 @@ static const FFlogo O[] = { }, // OpenSuseLeap { - .names = {"opensuse-leap", "opensuse leap"}, + .names = {"opensuse-leap"}, .lines = FASTFETCH_DATATEXT_LOGO_OPENSUSE_LEAP, .colors = { FF_COLOR_FG_WHITE, @@ -3357,7 +3349,7 @@ static const FFlogo O[] = { }, // OpenSuseLeapOld { - .names = {"opensuse-leap_old", "opensuse leap_old"}, + .names = {"opensuse-leap_old"}, .lines = FASTFETCH_DATATEXT_LOGO_OPENSUSE_LEAP_OLD, .type = FF_LOGO_LINE_TYPE_ALTER_BIT, .colors = { @@ -3376,9 +3368,20 @@ static const FFlogo O[] = { .colorKeys = FF_COLOR_FG_GREEN, .colorTitle = FF_COLOR_FG_GREEN, }, + // OpenSuseTumbleweedSmall + { + .names = {"opensuse-tumbleweed_small"}, + .lines = FASTFETCH_DATATEXT_LOGO_OPENSUSE_TUMBLEWEED, + .type = FF_LOGO_LINE_TYPE_SMALL_BIT, + .colors = { + FF_COLOR_FG_WHITE, + }, + .colorKeys = FF_COLOR_FG_GREEN, + .colorTitle = FF_COLOR_FG_GREEN, + }, // OpenSuseTumbleweedOld { - .names = {"opensuse-tumbleweed-old"}, + .names = {"opensuse-tumbleweed_old"}, .lines = FASTFETCH_DATATEXT_LOGO_OPENSUSE_TUMBLEWEED_OLD, .type = FF_LOGO_LINE_TYPE_ALTER_BIT, .colors = { @@ -3684,9 +3687,9 @@ static const FFlogo P[] = { FF_COLOR_FG_YELLOW, }, }, - // Pisi + // PisiLinux { - .names = {"Pisi"}, + .names = {"PisiLinux"}, .lines = FASTFETCH_DATATEXT_LOGO_PISI, .colors = { FF_COLOR_FG_BLUE, @@ -4229,6 +4232,15 @@ static const FFlogo S[] = { FF_COLOR_FG_WHITE, }, }, + // Shebang + { + .names = {"Shebang"}, + .lines = FASTFETCH_DATATEXT_LOGO_SHEBANG, + .colors = { + FF_COLOR_FG_WHITE, + FF_COLOR_FG_WHITE, + }, + }, // Siduction { .names = {"Siduction"}, @@ -4609,7 +4621,7 @@ static const FFlogo U[] = { }, // UbuntuSmall { - .names = {"ubuntu_small", "ubuntu-linux-small"}, + .names = {"ubuntu_small", "ubuntu-linux_small"}, .type = FF_LOGO_LINE_TYPE_SMALL_BIT, .lines = FASTFETCH_DATATEXT_LOGO_UBUNTU_SMALL, .colors = { @@ -4644,7 +4656,7 @@ static const FFlogo U[] = { }, // UbuntuOld2Small { - .names = {"ubuntu_old2_small", "ubuntu_old2-small"}, + .names = {"ubuntu_old2_small", "ubuntu_old2_small"}, .type = FF_LOGO_LINE_TYPE_SMALL_BIT | FF_LOGO_LINE_TYPE_ALTER_BIT, .lines = FASTFETCH_DATATEXT_LOGO_UBUNTU_OLD2_SMALL, .colors = { @@ -4851,7 +4863,7 @@ static const FFlogo V[] = { }, // Vanilla { - .names = {"vanilla", "vanilla-os", "vanilla-linux"}, + .names = {"vanilla"}, .lines = FASTFETCH_DATATEXT_LOGO_VANILLA, .colors = { FF_COLOR_FG_YELLOW, @@ -4861,7 +4873,7 @@ static const FFlogo V[] = { }, // Vanilla2 { - .names = {"vanilla2", "vanilla-os2", "vanilla-linux2"}, + .names = {"vanilla2"}, .type = FF_LOGO_LINE_TYPE_ALTER_BIT, .lines = FASTFETCH_DATATEXT_LOGO_VANILLA2, .colors = { @@ -4872,7 +4884,7 @@ static const FFlogo V[] = { }, // VanillaSmall { - .names = {"vanilla-small", "vanilla-os-small", "vanilla-linux-small"}, + .names = {"vanilla_small"}, .type = FF_LOGO_LINE_TYPE_SMALL_BIT, .lines = FASTFETCH_DATATEXT_LOGO_VANILLA_SMALL, .colors = { @@ -4923,7 +4935,7 @@ static const FFlogo V[] = { }, // Void { - .names = {"void", "void-linux"}, + .names = {"void"}, .lines = FASTFETCH_DATATEXT_LOGO_VOID, .colors = { FF_COLOR_FG_GREEN, @@ -4934,7 +4946,7 @@ static const FFlogo V[] = { }, // VoidSmall { - .names = {"void_small", "void-linux-small"}, + .names = {"void_small"}, .type = FF_LOGO_LINE_TYPE_SMALL_BIT, .lines = FASTFETCH_DATATEXT_LOGO_VOID_SMALL, .colors = { @@ -4945,7 +4957,7 @@ static const FFlogo V[] = { }, // Void2Small { - .names = {"void2_small", "void-linux2-small"}, + .names = {"void2_small"}, .type = FF_LOGO_LINE_TYPE_SMALL_BIT | FF_LOGO_LINE_TYPE_ALTER_BIT, .lines = FASTFETCH_DATATEXT_LOGO_VOID2_SMALL, .colors = { @@ -4996,7 +5008,7 @@ static const FFlogo W[] = { }, // Windows11Small { - .names = {"Windows 11_small", "Windows 11-small"}, + .names = {"Windows 11_small"}, .type = FF_LOGO_LINE_TYPE_SMALL_BIT, .lines = FASTFETCH_DATATEXT_LOGO_WINDOWS_11_SMALL, .colors = { @@ -5131,7 +5143,7 @@ static const FFlogo Y[] = { static const FFlogo Z[] = { // Zorin { - .names = {"zorin", "zorin-linux", "zorinos", "zorinos-linux"}, + .names = {"Zorin"}, .lines = FASTFETCH_DATATEXT_LOGO_ZORIN, .colors = { FF_COLOR_FG_BLUE, diff --git a/src/logo/logo.svg b/src/logo/logo.svg new file mode 100644 index 0000000000..474cd6a27c --- /dev/null +++ b/src/logo/logo.svg @@ -0,0 +1,39 @@ + + + + + + + + + + FASTFETCH + + + + + + + + + + + + + + + + + + + + + ►►►►►►► + ►►►►►► + ►►►►► + ►►►► + ►►► + ►► + + diff --git a/src/modules/battery/battery.c b/src/modules/battery/battery.c index 5dd95c11c3..20d10aab51 100644 --- a/src/modules/battery/battery.c +++ b/src/modules/battery/battery.c @@ -23,6 +23,7 @@ static void printBattery(FFBatteryOptions* options, FFBatteryResult* result, uin FF_PARSE_FORMAT_STRING_CHECKED(&key, &options->moduleArgs.key, ((FFformatarg[]) { FF_FORMAT_ARG(index, "index"), FF_FORMAT_ARG(result->modelName, "name"), + FF_FORMAT_ARG(options->moduleArgs.keyIcon, "icon"), })); } diff --git a/src/modules/brightness/brightness.c b/src/modules/brightness/brightness.c index e4862f526d..78caf587f4 100644 --- a/src/modules/brightness/brightness.c +++ b/src/modules/brightness/brightness.c @@ -82,6 +82,8 @@ void ffPrintBrightness(FFBrightnessOptions* options) ffPercentAppendNum(&str, percent, options->percent, str.length > 0, &options->moduleArgs); } + ffStrbufAppendS(&str, item->builtin ? " [Built-in]" : " [External]"); + ffStrbufPutTo(&str, stdout); } else @@ -100,6 +102,7 @@ void ffPrintBrightness(FFBrightnessOptions* options) FF_FORMAT_ARG(item->min, "min"), FF_FORMAT_ARG(item->current, "current"), FF_FORMAT_ARG(valueBar, "percentage-bar"), + FF_FORMAT_ARG(item->builtin, "is-builtin"), })); } @@ -204,6 +207,7 @@ void ffGenerateBrightnessJsonResult(FF_MAYBE_UNUSED FFBrightnessOptions* options yyjson_mut_obj_add_real(doc, obj, "max", item->max); yyjson_mut_obj_add_real(doc, obj, "min", item->min); yyjson_mut_obj_add_real(doc, obj, "current", item->current); + yyjson_mut_obj_add_bool(doc, obj, "builtin", item->builtin); } FF_LIST_FOR_EACH(FFBrightnessResult, item, result) @@ -227,6 +231,7 @@ static FFModuleBaseInfo ffModuleInfo = { {"Minimum brightness value", "min"}, {"Current brightness value", "current"}, {"Screen brightness (percentage bar)", "percentage-bar"}, + {"Is built-in screen", "is-builtin"}, })) }; diff --git a/src/modules/datetime/datetime.c b/src/modules/datetime/datetime.c index 09c62e7a4e..a5b4b06ce7 100644 --- a/src/modules/datetime/datetime.c +++ b/src/modules/datetime/datetime.c @@ -54,7 +54,7 @@ void ffPrintDateTimeFormat(struct tm* tm, const FFModuleArgs* moduleArgs) result.dayInYear = (uint8_t) (tm->tm_yday + 1); result.dayInMonth = (uint8_t) tm->tm_mday; result.dayInWeek = tm->tm_wday == 0 ? 7 : (uint8_t) tm->tm_wday; - strftime(result.dayPretty, sizeof(result.dayPretty), "%0d", tm); + strftime(result.dayPretty, sizeof(result.dayPretty), "%d", tm); result.hour = (uint8_t) tm->tm_hour; strftime(result.hourPretty, sizeof(result.hourPretty), "%H", tm); result.hour12 = (uint8_t) (result.hour % 12); diff --git a/src/modules/disk/disk.c b/src/modules/disk/disk.c index d0ff29a937..68d0a89aec 100644 --- a/src/modules/disk/disk.c +++ b/src/modules/disk/disk.c @@ -156,6 +156,8 @@ static void printDisk(FFDiskOptions* options, const FFDisk* disk, uint32_t index FF_FORMAT_ARG(minutes, "minutes"), FF_FORMAT_ARG(seconds, "seconds"), FF_FORMAT_ARG(milliseconds, "milliseconds"), + FF_FORMAT_ARG(disk->mountpoint, "mountpoint"), + FF_FORMAT_ARG(disk->mountFrom, "mount-from"), })); } } @@ -483,6 +485,8 @@ static FFModuleBaseInfo ffModuleInfo = { {"Minutes after creation", "minutes"}, {"Seconds after creation", "seconds"}, {"Milliseconds after creation", "milliseconds"}, + {"Mount point / drive letter", "mountpoint"}, + {"Mount from (device path)", "mount-from"}, })) }; diff --git a/src/modules/gpu/gpu.c b/src/modules/gpu/gpu.c index 10d1b46d26..e8cf55cae2 100644 --- a/src/modules/gpu/gpu.c +++ b/src/modules/gpu/gpu.c @@ -20,6 +20,8 @@ static void printGPUResult(FFGPUOptions* options, uint8_t index, const FFGPUResu default: type = "Unknown"; break; } + FFPercentageTypeFlags percentType = options->percent.type == 0 ? instance.config.display.percentType : options->percent.type; + if(options->moduleArgs.outputFormat.length == 0) { ffPrintLogoAndKey(FF_GPU_MODULE_NAME, index, &options->moduleArgs, FF_PRINT_TYPE_DEFAULT); @@ -53,16 +55,28 @@ static void printGPUResult(FFGPUOptions* options, uint8_t index, const FFGPUResu { ffStrbufAppendS(&output, " ("); - if(gpu->dedicated.used != FF_GPU_VMEM_SIZE_UNSET) + if (!(percentType & FF_PERCENTAGE_TYPE_HIDE_OTHERS_BIT)) { - ffParseSize(gpu->dedicated.used, &output); - ffStrbufAppendS(&output, " / "); + if(gpu->dedicated.used != FF_GPU_VMEM_SIZE_UNSET) + { + ffParseSize(gpu->dedicated.used, &output); + ffStrbufAppendS(&output, " / "); + } + ffParseSize(gpu->dedicated.total, &output); } - ffParseSize(gpu->dedicated.total, &output); if(gpu->dedicated.used != FF_GPU_VMEM_SIZE_UNSET) { - ffStrbufAppendS(&output, ", "); - ffPercentAppendNum(&output, (double) gpu->dedicated.used / (double) gpu->dedicated.total * 100.0, options->percent, false, &options->moduleArgs); + double percent = (double) gpu->dedicated.used / (double) gpu->dedicated.total * 100.0; + if (percentType & FF_PERCENTAGE_TYPE_NUM_BIT) + { + ffStrbufAppendS(&output, ", "); + ffPercentAppendNum(&output, percent, options->percent, false, &options->moduleArgs); + } + if (percentType & FF_PERCENTAGE_TYPE_BAR_BIT) + { + ffStrbufAppendS(&output, " "); + ffPercentAppendBar(&output, percent, options->percent, &options->moduleArgs); + } } ffStrbufAppendC(&output, ')'); } @@ -78,16 +92,47 @@ static void printGPUResult(FFGPUOptions* options, uint8_t index, const FFGPUResu ffTempsAppendNum(gpu->temperature, &tempStr, options->tempConfig, &options->moduleArgs); FF_STRBUF_AUTO_DESTROY dTotal = ffStrbufCreate(); FF_STRBUF_AUTO_DESTROY dUsed = ffStrbufCreate(); - FF_STRBUF_AUTO_DESTROY sTotal = ffStrbufCreate(); - FF_STRBUF_AUTO_DESTROY sUsed = ffStrbufCreate(); + FF_STRBUF_AUTO_DESTROY dPercentNum = ffStrbufCreate(); + FF_STRBUF_AUTO_DESTROY dPercentBar = ffStrbufCreate(); if (gpu->dedicated.total != FF_GPU_VMEM_SIZE_UNSET) ffParseSize(gpu->dedicated.total, &dTotal); if (gpu->dedicated.used != FF_GPU_VMEM_SIZE_UNSET) ffParseSize(gpu->dedicated.used, &dUsed); + if (gpu->dedicated.total != FF_GPU_VMEM_SIZE_UNSET && gpu->dedicated.used != FF_GPU_VMEM_SIZE_UNSET) + { + double percent = (double) gpu->dedicated.used / (double) gpu->dedicated.total * 100.0; + if (percentType & FF_PERCENTAGE_TYPE_NUM_BIT) + ffPercentAppendNum(&dPercentNum, percent, options->percent, false, &options->moduleArgs); + if (percentType & FF_PERCENTAGE_TYPE_BAR_BIT) + ffPercentAppendBar(&dPercentBar, percent, options->percent, &options->moduleArgs); + } + + FF_STRBUF_AUTO_DESTROY sTotal = ffStrbufCreate(); + FF_STRBUF_AUTO_DESTROY sUsed = ffStrbufCreate(); + FF_STRBUF_AUTO_DESTROY sPercentNum = ffStrbufCreate(); + FF_STRBUF_AUTO_DESTROY sPercentBar = ffStrbufCreate(); if (gpu->shared.total != FF_GPU_VMEM_SIZE_UNSET) ffParseSize(gpu->shared.total, &sTotal); if (gpu->shared.used != FF_GPU_VMEM_SIZE_UNSET) ffParseSize(gpu->shared.used, &sUsed); + if (gpu->shared.total != FF_GPU_VMEM_SIZE_UNSET && gpu->shared.used != FF_GPU_VMEM_SIZE_UNSET) + { + double percent = (double) gpu->shared.used / (double) gpu->shared.total * 100.0; + if (percentType & FF_PERCENTAGE_TYPE_NUM_BIT) + ffPercentAppendNum(&sPercentNum, percent, options->percent, false, &options->moduleArgs); + if (percentType & FF_PERCENTAGE_TYPE_BAR_BIT) + ffPercentAppendBar(&sPercentBar, percent, options->percent, &options->moduleArgs); + } FF_STRBUF_AUTO_DESTROY frequency = ffStrbufCreate(); ffParseFrequency(gpu->frequency, &frequency); + FF_STRBUF_AUTO_DESTROY coreUsageNum = ffStrbufCreate(); + FF_STRBUF_AUTO_DESTROY coreUsageBar = ffStrbufCreate(); + if (gpu->coreUsage == gpu->coreUsage) //FF_GPU_CORE_USAGE_UNSET + { + if (percentType & FF_PERCENTAGE_TYPE_NUM_BIT) + ffPercentAppendNum(&coreUsageNum, gpu->coreUsage, options->percent, false, &options->moduleArgs); + if (percentType & FF_PERCENTAGE_TYPE_BAR_BIT) + ffPercentAppendBar(&coreUsageBar, gpu->coreUsage, options->percent, &options->moduleArgs); + } + FF_PRINT_FORMAT_CHECKED(FF_GPU_MODULE_NAME, index, &options->moduleArgs, FF_PRINT_TYPE_DEFAULT, ((FFformatarg[]) { FF_FORMAT_ARG(gpu->vendor, "vendor"), FF_FORMAT_ARG(gpu->name, "name"), @@ -102,6 +147,12 @@ static void printGPUResult(FFGPUOptions* options, uint8_t index, const FFGPUResu FF_FORMAT_ARG(gpu->platformApi, "platform-api"), FF_FORMAT_ARG(frequency, "frequency"), FF_FORMAT_ARG(index, "index"), + FF_FORMAT_ARG(dPercentNum, "dedicated-percentage-num"), + FF_FORMAT_ARG(dPercentBar, "dedicated-percentage-bar"), + FF_FORMAT_ARG(sPercentNum, "shared-percentage-num"), + FF_FORMAT_ARG(sPercentBar, "shared-percentage-bar"), + FF_FORMAT_ARG(coreUsageNum, "core-usage-num"), + FF_FORMAT_ARG(coreUsageBar, "core-usage-bar"), })); } } @@ -414,6 +465,12 @@ static FFModuleBaseInfo ffModuleInfo = { {"The platform API used when detecting the GPU", "platform-api"}, {"Current frequency in GHz", "frequency"}, {"GPU vendor specific index", "index"}, + {"Dedicated memory usage percentage num", "dedicated-percentage-num"}, + {"Dedicated memory usage percentage bar", "dedicated-percentage-bar"}, + {"Shared memory usage percentage num", "shared-percentage-num"}, + {"Shared memory usage percentage bar", "shared-percentage-bar"}, + {"Core usage percentage num (supports Nvidia & Apple GPU only)", "core-usage-num"}, + {"Core usage percentage bar (supports Nvidia & Apple GPU only)", "core-usage-bar"}, })), }; diff --git a/src/modules/os/os.c b/src/modules/os/os.c index b26ef8600f..9edde87492 100644 --- a/src/modules/os/os.c +++ b/src/modules/os/os.c @@ -63,6 +63,19 @@ void ffPrintOS(FFOSOptions* options) return; } + FF_STRBUF_AUTO_DESTROY key = ffStrbufCreate(); + + if(options->moduleArgs.key.length == 0) + ffStrbufSetStatic(&key, FF_OS_MODULE_NAME); + else + { + FF_PARSE_FORMAT_STRING_CHECKED(&key, &options->moduleArgs.key, ((FFformatarg[]) { + FF_FORMAT_ARG(instance.state.platform.sysinfo.name, "sysname"), + FF_FORMAT_ARG(os->name, "name"), + FF_FORMAT_ARG(options->moduleArgs.keyIcon, "icon"), + })); + } + if(options->moduleArgs.outputFormat.length == 0) { FF_STRBUF_AUTO_DESTROY result = ffStrbufCreate(); @@ -79,12 +92,12 @@ void ffPrintOS(FFOSOptions* options) ffStrbufAppend(&result, &instance.state.platform.sysinfo.architecture); } - ffPrintLogoAndKey(FF_OS_MODULE_NAME, 0, &options->moduleArgs, FF_PRINT_TYPE_DEFAULT); + ffPrintLogoAndKey(key.chars, 0, &options->moduleArgs, FF_PRINT_TYPE_NO_CUSTOM_KEY); ffStrbufPutTo(&result, stdout); } else { - FF_PRINT_FORMAT_CHECKED(FF_OS_MODULE_NAME, 0, &options->moduleArgs, FF_PRINT_TYPE_DEFAULT, ((FFformatarg[]){ + FF_PRINT_FORMAT_CHECKED(key.chars, 0, &options->moduleArgs, FF_PRINT_TYPE_NO_CUSTOM_KEY, ((FFformatarg[]){ FF_FORMAT_ARG(instance.state.platform.sysinfo.name, "sysname"), FF_FORMAT_ARG(os->name, "name"), FF_FORMAT_ARG(os->prettyName, "pretty-name"), @@ -96,7 +109,8 @@ void ffPrintOS(FFOSOptions* options) FF_FORMAT_ARG(os->versionID, "version-id"), FF_FORMAT_ARG(os->codename, "codename"), FF_FORMAT_ARG(os->buildID, "build-id"), - FF_FORMAT_ARG(instance.state.platform.sysinfo.architecture, "arch") + FF_FORMAT_ARG(instance.state.platform.sysinfo.architecture, "arch"), + FF_FORMAT_ARG(instance.state.platform.sysinfo.release, "kernel-release"), })); } } diff --git a/src/modules/packages/option.h b/src/modules/packages/option.h index a7b7255c09..ec12db341c 100644 --- a/src/modules/packages/option.h +++ b/src/modules/packages/option.h @@ -37,6 +37,7 @@ typedef enum __attribute__((__packed__)) FFPackagesFlags FF_PACKAGES_FLAG_QI_BIT = 1 << 27, FF_PACKAGES_FLAG_PKGSRC_BIT = 1 << 28, FF_PACKAGES_FLAG_HPKG_BIT = 1 << 29, + FF_PACKAGES_FLAG_PISI_BIT = 1 << 30, FF_PACKAGES_FLAG_FORCE_UNSIGNED = UINT32_MAX, } FFPackagesFlags; static_assert(sizeof(FFPackagesFlags) == sizeof(uint32_t), ""); diff --git a/src/modules/packages/packages.c b/src/modules/packages/packages.c index 8d8f986ba2..8766cbda3b 100644 --- a/src/modules/packages/packages.c +++ b/src/modules/packages/packages.c @@ -77,6 +77,7 @@ void ffPrintPackages(FFPackagesOptions* options) FF_PRINT_PACKAGE(pacstall) FF_PRINT_PACKAGE(mport) FF_PRINT_PACKAGE(qi) + FF_PRINT_PACKAGE(pisi) putchar('\n'); } @@ -128,6 +129,7 @@ void ffPrintPackages(FFPackagesOptions* options) FF_FORMAT_ARG(counts.pkgsrc, "pkgsrc"), FF_FORMAT_ARG(counts.hpkgSystem, "hpkg-system"), FF_FORMAT_ARG(counts.hpkgUser, "hpkg-user"), + FF_FORMAT_ARG(counts.pisi, "pisi"), FF_FORMAT_ARG(nixAll, "nix-all"), FF_FORMAT_ARG(flatpakAll, "flatpak-all"), FF_FORMAT_ARG(brewAll, "brew-all"), @@ -206,6 +208,7 @@ bool ffParsePackagesCommandOptions(FFPackagesOptions* options, const char* key, FF_TEST_PACKAGE_NAME(PACMAN) FF_TEST_PACKAGE_NAME(PACSTALL) FF_TEST_PACKAGE_NAME(PALUDIS) + FF_TEST_PACKAGE_NAME(PISI) FF_TEST_PACKAGE_NAME(PKG) FF_TEST_PACKAGE_NAME(PKGTOOL) FF_TEST_PACKAGE_NAME(PKGSRC) @@ -324,6 +327,7 @@ void ffParsePackagesJsonObject(FFPackagesOptions* options, yyjson_val* module) FF_TEST_PACKAGE_NAME(PACMAN) FF_TEST_PACKAGE_NAME(PACSTALL) FF_TEST_PACKAGE_NAME(PALUDIS) + FF_TEST_PACKAGE_NAME(PISI) FF_TEST_PACKAGE_NAME(PKG) FF_TEST_PACKAGE_NAME(PKGTOOL) FF_TEST_PACKAGE_NAME(PKGSRC) @@ -388,6 +392,7 @@ void ffGeneratePackagesJsonConfig(FFPackagesOptions* options, yyjson_mut_doc* do FF_TEST_PACKAGE_NAME(PACMAN) FF_TEST_PACKAGE_NAME(PACSTALL) FF_TEST_PACKAGE_NAME(PALUDIS) + FF_TEST_PACKAGE_NAME(PISI) FF_TEST_PACKAGE_NAME(PKG) FF_TEST_PACKAGE_NAME(PKGTOOL) FF_TEST_PACKAGE_NAME(PKGSRC) @@ -445,6 +450,7 @@ void ffGeneratePackagesJsonResult(FF_MAYBE_UNUSED FFPackagesOptions* options, yy FF_APPEND_PACKAGE_COUNT(pacman) FF_APPEND_PACKAGE_COUNT(pacstall) FF_APPEND_PACKAGE_COUNT(paludis) + FF_APPEND_PACKAGE_COUNT(pisi) FF_APPEND_PACKAGE_COUNT(pkg) FF_APPEND_PACKAGE_COUNT(pkgtool) FF_APPEND_PACKAGE_COUNT(pkgsrc) @@ -508,6 +514,7 @@ static FFModuleBaseInfo ffModuleInfo = { {"Number of pkgsrc packages", "pkgsrc"}, {"Number of hpkg-system packages", "hpkg-system"}, {"Number of hpkg-user packages", "hpkg-user"}, + {"Number of pisi packages", "pisi"}, {"Total number of all nix packages", "nix-all"}, {"Total number of all flatpak app packages", "flatpak-all"}, {"Total number of all brew packages", "brew-all"}, diff --git a/src/options/display.h b/src/options/display.h index ef3c21971c..f96f304bec 100644 --- a/src/options/display.h +++ b/src/options/display.h @@ -5,8 +5,8 @@ typedef enum __attribute__((__packed__)) FFSizeBinaryPrefixType { FF_SIZE_BINARY_PREFIX_TYPE_IEC, // 1024 Bytes = 1 KiB, 1024 KiB = 1 MiB, ... (standard) - FF_SIZE_BINARY_PREFIX_TYPE_SI, // 1000 Bytes = 1 KB, 1000 KB = 1 MB, ... - FF_SIZE_BINARY_PREFIX_TYPE_JEDEC, // 1024 Bytes = 1 kB, 1024 kB = 1 MB, ... + FF_SIZE_BINARY_PREFIX_TYPE_SI, // 1000 Bytes = 1 kB, 1000 kB = 1 MB, ... + FF_SIZE_BINARY_PREFIX_TYPE_JEDEC, // 1024 Bytes = 1 KB, 1024 KB = 1 MB, ... } FFSizeBinaryPrefixType; typedef enum __attribute__((__packed__)) FFTemperatureUnit diff --git a/src/util/windows/c-logo.sh b/src/util/windows/c-logo.sh new file mode 100755 index 0000000000..e4d7863cc8 --- /dev/null +++ b/src/util/windows/c-logo.sh @@ -0,0 +1,10 @@ +#!/bin/sh +# Convert logo.svg to logo.ico +rsvg-convert -w 16 -h 16 logo.svg > logo16.png +rsvg-convert -w 32 -h 32 logo.svg > logo32.png +rsvg-convert -w 48 -h 48 logo.svg > logo48.png +rsvg-convert -w 64 -h 64 logo.svg > logo64.png +rsvg-convert -w 128 -h 128 logo.svg > logo128.png +rsvg-convert -w 256 -h 256 logo.svg > logo256.png +convert logo16.png logo32.png logo48.png logo64.png logo128.png logo256.png logo.ico +rm logo16.png logo32.png logo48.png logo64.png logo128.png logo256.png diff --git a/src/util/windows/logo.ico b/src/util/windows/logo.ico new file mode 100644 index 0000000000..cdd89adbc9 Binary files /dev/null and b/src/util/windows/logo.ico differ diff --git a/src/util/windows/logo.svg b/src/util/windows/logo.svg new file mode 120000 index 0000000000..068d3f663c --- /dev/null +++ b/src/util/windows/logo.svg @@ -0,0 +1 @@ +../../logo/logo.svg \ No newline at end of file diff --git a/src/util/windows/version.rc b/src/util/windows/version.rc index 789c0c1037..f01ca7f520 100644 --- a/src/util/windows/version.rc +++ b/src/util/windows/version.rc @@ -9,6 +9,7 @@ #define FF_TO_STR(str) FF_TO_STR1(str) CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "manifest.xml" +id ICON "logo.ico" VS_VERSION_INFO VERSIONINFO FILEVERSION FASTFETCH_PROJECT_VERSION_MAJOR,FASTFETCH_PROJECT_VERSION_MINOR,FASTFETCH_PROJECT_VERSION_PATCH,FASTFETCH_PROJECT_VERSION_TWEAK_NUM