Compare commits

..

138 Commits

Author SHA1 Message Date
Carter Li 1b219a9d5c Merge pull request #1596 from fastfetch-cli/dev
Release: v2.38.0
2025-03-03 13:30:58 +08:00
李通洲 0ac01003b2 CI: try fixing CI failures 2025-03-03 10:33:33 +08:00
李通洲 a36bdfabd0 Release: v2.38.0 2025-03-03 10:18:13 +08:00
李通洲 570abb194a Chore: update image logo
Make the rocket bigger, so it's more visible in small size
2025-03-03 10:12:21 +08:00
Carter Li 4e00f37be9 Camera (macOS): silence compiler warnings 2025-03-02 10:43:54 +08:00
李通洲 334afc9838 Camera (macOS): fix crashing on old macOS version
Fix #1594
2025-03-02 10:24:02 +08:00
李通洲 64f9e53a36 CI (macOS): remove CodeQL
It slows down the CI greatly, but never reports anything useful.
2025-03-02 10:18:00 +08:00
Yurin Doctrine b94c6ab8d5 Logo (Builtin): Add Shebang Linux (#1592)
* add src/logo/ascii/shebang.txt

Support for Shebang Linux

* add Shebang to src/logo/builtin.c

Support for Shebang Linux

* fix Shebang order in builtin.c
2025-03-01 20:00:18 +08:00
李通洲 38ea333644 Doc: update supported platforms 2025-02-28 16:19:05 +08:00
李通洲 efbdaf7aaf Logo (Builtin): update fastfetch logo to match the svg one 2025-02-28 16:18:43 +08:00
李通洲 aee7b37fc8 Chore (Windows): set exe file icon to fastfetch logo 2025-02-28 15:44:31 +08:00
李通洲 664460cd34 Logo: add fastfetch logo 2025-02-28 15:06:39 +08:00
李通洲 a66e1b2e6d Doc: fix SI size prefix description
Fix #1589
2025-02-27 21:13:58 +08:00
李通洲 8000574a82 Doc: update changelog [ci skip] 2025-02-27 16:16:05 +08:00
李通洲 2eae5a86d2 Camera (macOS): try fixing segfault in macOS 10.15 2025-02-27 00:00:05 +08:00
李通洲 75da934815 Brightness: detect & print screen type 2025-02-26 09:31:09 +08:00
Carter Li ac71ebcad9 Terminal (Linux): support termite version detection 2025-02-26 09:28:18 +08:00
koraynilay 383a6c8a05 TerminalFont (Linux): support termite terminal (#1588)
currently developed termite fork: https://github.com/aperezdc/termite
2025-02-26 09:12:53 +08:00
李通洲 8e79fde0d9 JsonSchema: update format json [ci skip] 2025-02-25 10:34:16 +08:00
Kerem Gökcek 4f4622eab9 Packages (Linux): Add support for Pisi Linux (#1580) 2025-02-24 15:29:14 +08:00
Carter Li a2327b7350 GPU: support percentage num & bar in custom format
Fix #1583
2025-02-24 15:19:40 +08:00
李通洲 b76ada7f30 Logo (Builtin): simplify 2025-02-24 15:19:40 +08:00
TurtleMeds 59b568a6d0 Logo (Builtin): Added Bedrock Linux small ASCII logo (#1582)
* Logo (Builtin): Added Bedrock Linux small ASCII logo

* Logo (Builtin): fixed spacing of small bedrock logo

* Update bedrock_small.txt

---------

Co-authored-by: Carter Li <CarterLi@users.noreply.github.com>
2025-02-24 14:56:04 +08:00
Carter Li 3d6bd26e59 Bootmgr (Linux): fix secure boot testing
Fix #1584
2025-02-24 13:57:38 +08:00
李通洲 4e17688b7c Logo (Builtin): simplify os names 2025-02-21 14:31:21 +08:00
李通洲 f34548621f OS (Linux): fix VanillaOS detection 2025-02-21 10:32:34 +08:00
李通洲 7a2e071081 Builtin (Logo): simplify linuxmint handling 2025-02-21 09:02:26 +08:00
李通洲 de7b57d807 Logo (Builtin): add opensuse-tumbleweed_small 2025-02-21 08:48:30 +08:00
李通洲 6de9d0c024 Disk: add {mountpoint} and {mount-from} in custom output format
Fix #1577
2025-02-20 19:58:10 +08:00
李通洲 8f69533f30 Presets: fix OS key in examples/25 2025-02-20 19:48:08 +08:00
李通洲 d463853aeb DateTime (Windows): fix day-pretty output in custom format 2025-02-20 19:47:27 +08:00
李通洲 1047d1cf6e Presets: add a new example 2025-02-20 16:39:32 +08:00
李通洲 0bfa12c38c OS: allow customize key format with kernel name and distro name 2025-02-20 15:59:28 +08:00
李通洲 c8e4962cfd Battery: add missing {icon} in key format 2025-02-20 15:58:38 +08:00
李通洲 171005b6a3 Chassis (macOS): add support
Based on model string matching
2025-02-20 15:57:57 +08:00
李通洲 8526f4a021 JsonSchema: update format schema 2025-02-20 10:31:41 +08:00
François Revol 3e5d129248 Battery (Haiku): handle empty slots
My ThinkPad has a second slot for external batteries.
2025-02-19 22:21:43 +08:00
Carter Li 6e98db3bf3 Packaging: update debian stuff [ci skip] 2025-02-19 15:44:54 +08:00
Carter Li ff0236639a Merge pull request #1574 from fastfetch-cli/dev
Release: v2.37.0
2025-02-19 15:39:29 +08:00
李通洲 959bf769fb Doc: fix typo in changelog [ci skip] 2025-02-19 15:35:52 +08:00
李通洲 3ae7c4f788 Release: v2.37.0 2025-02-19 15:21:01 +08:00
李通洲 143b3df771 OS (Haiku): calcuate OS version 2025-02-19 10:47:21 +08:00
李通洲 c0c59a890a Version: report more CPU arches 2025-02-19 10:01:29 +08:00
Carter Li 3c5f69b874 OS (Haiku): report pre version as - 2025-02-19 09:10:40 +08:00
Carter Li 36a452c852 CPU (NetBSD): support non-intel CPUs
Fix #1573
2025-02-19 08:59:10 +08:00
Carter Li c66b32fc6f CMake (Haiku): enable more optional dependencies 2025-02-18 20:48:17 +08:00
Carter Li bc129a65d9 OS (Haiku): detect OS beta version 2025-02-18 20:38:58 +08:00
Carter Li 1137e8d1c9 Processing (Haiku): fix exe detection 2025-02-18 19:49:40 +08:00
Carter Li 95a44d3a33 GPU (Haiku): silence warnings 2025-02-18 19:49:19 +08:00
李通洲 b8b2fab499 Haiku: fix building 2025-02-18 15:49:39 +08:00
李通洲 7aceb1072a Doc: update changelog [ci skip] 2025-02-18 14:13:13 +08:00
李通洲 13723893ba Packages (Haiku): rename package manager name to hpkg 2025-02-18 10:38:14 +08:00
李通洲 6fd4720faf PhysicalDisk (Haiku): fix drive size calcuation 2025-02-18 10:13:25 +08:00
李通洲 966b8452b7 Disk (Haiku): report all partitions 2025-02-18 09:35:56 +08:00
李通洲 8dc4f77f42 Shell (Haiku): fix arg0 detection 2025-02-18 09:17:55 +08:00
Carter Li ab0240e9b7 IO (Haiku): access /path/to/file/ doesn't work. Work around it 2025-02-18 06:58:09 +08:00
李通洲 399f262692 LocalIP: fix --localip-default-route-only false not working with --gen-config
Fix #1570
2025-02-17 21:29:27 +08:00
Carter Li d1385804bb Bios (Haiku): report BIOS type 2025-02-17 21:24:35 +08:00
Carter Li 948a965c7a Terminal (Haiku): detect terminal version 2025-02-17 21:22:12 +08:00
李通洲 a13935e232 PhysicalDisk (Haiku): fix SCSI drive detection 2025-02-17 21:21:28 +08:00
李通洲 46f920ae2a OpenGL (Haiku): report platform API 2025-02-16 23:29:05 +08:00
李通洲 e79b561f2a Smbios: add comments about UEFI systems [ci skip] 2025-02-16 23:25:16 +08:00
Carter Li 9018fda92e OpenGL (Haiku): add support 2025-02-16 22:53:20 +08:00
Carter Li 76b8b9a44b Chore: remove unused #includes 2025-02-16 22:53:20 +08:00
李通洲 36a129f668 GPU: add missing variable inits 2025-02-16 22:05:06 +08:00
Carter Li 24e94acbb9 Bluetooth (Haiku): suppress debug output of system API 2025-02-16 21:43:35 +08:00
Carter Li 716f0a3bbb PhysicalDisk (Haiku): report drive type 2025-02-16 21:43:35 +08:00
李通洲 f839fcfa29 Presets: print keyboard & mouse in all.jsonc 2025-02-16 21:27:53 +08:00
Carter Li 41d930b1e1 Bluetooth (Haiku): WIP 2025-02-16 20:37:21 +08:00
Carter Li 5e615d12d5 Gamepad (Haiku): enable 2025-02-16 20:18:04 +08:00
Carter Li 17711ee5c8 PhysicalDisk (Haiku): add support 2025-02-16 20:12:46 +08:00
李通洲 9ff3142b61 CPUUsage (Haiku): add support 2025-02-16 19:13:47 +08:00
Carter Li 8e5c2adda3 Gamepad (Haiku): add support 2025-02-16 11:05:58 +08:00
Carter Li 01d37653b0 Disk (Haiku): code cleanup; honor option->folders 2025-02-16 11:05:53 +08:00
Carter Li f5dbbb70ef Mouse / Keyboard (Haiku): code cleanup; ignore disabled devices 2025-02-16 10:22:26 +08:00
Carter Li fc3f47742a NetIO (Haiku): code cleanup 2025-02-16 10:14:14 +08:00
François Revol 1d2b6c0b1a NetIO (Haiku): add support 2025-02-16 10:04:36 +08:00
François Revol 5ebf984e9a Keyboard (Haiku): add support 2025-02-16 10:04:36 +08:00
François Revol bfa59d2c04 Mouse (Haiku): add support 2025-02-16 10:04:36 +08:00
François Revol c1c59cff6d Sound (Haiku): fix runtime error getting mute status
sizeof(bool) is only 1.
2025-02-15 22:38:05 +08:00
李通洲 519dae9462 Smbios: don't try to scan memory multiple times 2025-02-15 19:50:34 +08:00
李通洲 34419d9bcf Revert "Host (Haiku): add debug log"
This reverts commit f3e54f33c2.
2025-02-15 19:47:16 +08:00
Carter Li 532b3cd457 Smbios (NetBSD): add support 2025-02-15 14:45:09 +08:00
Carter Li 437006f5f1 Sound (Haiku): Init variables unconditionally; fix mute handling 2025-02-15 12:42:26 +08:00
François Revol 1c858ae835 InitSystem (Haiku): add support 2025-02-15 12:08:27 +08:00
François Revol 349fdd47e4 Sound (Haiku): add support 2025-02-15 12:08:27 +08:00
François Revol c64854804d Haiku: 32bit fixes
For historical reasons int32 and int32_t are not compatible types.
2025-02-15 12:08:27 +08:00
Carter Li f3e54f33c2 Host (Haiku): add debug log 2025-02-15 11:13:03 +08:00
Carter Li 5f3ff07b4b Terminal (Haiku): fix konsole version detection 2025-02-14 23:54:16 +08:00
李通洲 e8db71fe19 Chore (Haiku): silence compiler warnings 2025-02-14 22:42:15 +08:00
Carter Li 8984aa740e Smbios (Haiku): add support; enable related modules 2025-02-14 21:49:50 +00:00
李通洲 c081268b7c StringUtils: fix a possible segfault 2025-02-14 19:34:33 +08:00
李通洲 fae8d1dd10 PhysicalMemory: fix --format json printing 2025-02-14 19:34:33 +08:00
Carter Li 217ea61568 Sound: properly round percent values
Fix #1558
2025-02-14 14:06:08 +08:00
李通洲 ba7885913d Weather: honor display.temp.unit
Fix #1560
2025-02-14 10:31:13 +08:00
李通洲 a8afd05d19 Battery (Haiku): fix capacity calculation 2025-02-14 10:30:34 +08:00
李通洲 f4f1592bfa CI: enable -DENABLE_EMBEDDED_AMDGPUIDS=On 2025-02-14 01:09:28 +08:00
Carter Li cdc8124883 Battery (Haiku): add support (untested) 2025-02-14 00:23:20 +00:00
Carter Li c53191a441 Battery (Haiku): add stub file 2025-02-13 23:27:14 +00:00
Carter Li 14aadd5b61 Logo (Builtin): simplify haiku; add haiku2 from neofetch 2025-02-13 23:04:20 +00:00
Carter Li e38f094c16 Uptime (Haiku): silence compiler warnings 2025-02-13 22:56:25 +00:00
Carter Li 452d52c217 InitSystem (Haiku): enable support 2025-02-13 22:46:27 +00:00
Carter Li c585e09ef0 Processing (Haiku): support exe path detection 2025-02-13 22:39:45 +00:00
Carter Li 464e00d616 GPU (Haiku): use system API to fetch PCI devices 2025-02-13 22:22:29 +00:00
李通洲 b8e25bdc4e GPU: support embedding amdgpu.ids into fastfetch 2025-02-13 05:57:41 +00:00
Carter Li 379c39d8b5 GPU (Haiku): change the path of pci.ids to hwdata 2025-02-12 23:06:40 +00:00
Carter Li f2a41b82bc TerminalFont (Haiku): support Haiku Terminal 2025-02-12 22:48:24 +00:00
Carter Li d1a98fe69f Terminal (Haiku): add pretty name for Haiku Terminal 2025-02-12 22:47:37 +00:00
Carter Li ef3412f81b GPU (Haiku): add pci.ids file path 2025-02-12 22:22:35 +00:00
DrSheppard 1812c30fbf Doc: update README.md (#1557) [ci skip]
* [chore] Update README.md

move repology badge to install section
customize with `columns` and `minversion` tags

* tweaks

---------

Co-authored-by: Carter Li <CarterLi@users.noreply.github.com>
2025-02-12 16:42:21 +08:00
李通洲 3c45f2e590 Scripts: download pci.ids by cmake; remove python-requests dependency 2025-02-12 16:18:02 +08:00
Pro-pra 735a464f68 Logo (Builtin): update Rosa linux logo (#1559)
* Update rosa logo

* Update rosa colors

* replace invisible unicode charactors

---------

Co-authored-by: Carter Li <CarterLi@users.noreply.github.com>
2025-02-12 15:13:17 +08:00
Carter Li 3e3dfb4a02 OS: remove option --escape-bedrock 2025-02-12 08:53:27 +08:00
李通洲 f77a9c185d Media (Haiku): enable support 2025-02-12 00:45:14 +08:00
李通洲 d3a5f986a8 Terminal (Haiku): add basic support 2025-02-12 00:44:41 +08:00
李通洲 ef60910e51 Display (Haiku): code cleanup; detect manufacture date 2025-02-12 00:44:07 +08:00
李通洲 565934ba2e OS (Haiku): silence warnings 2025-02-12 00:43:33 +08:00
Carter Li 5c5e12f0a7 Media (Haiku): enable support 2025-02-12 00:42:55 +08:00
李通洲 b3e7451a08 Sound (Haiku): add stub file 2025-02-12 00:42:55 +08:00
李通洲 da76dcb2fe Disk (Haiku): add support 2025-02-12 00:42:55 +08:00
李通洲 cbc8b1f11d CPU (Haiku): add support 2025-02-12 00:42:55 +08:00
李通洲 5ca4268be2 CMake (Haiku): add more optional dependencies 2025-02-12 00:42:54 +08:00
李通洲 ff8bfadd25 Display (Haiku): trim monitor name 2025-02-11 16:24:42 +08:00
李通洲 1fc0f75776 GPU (Haiku): add support 2025-02-11 16:23:05 +08:00
Shu Niu bf707c2e94 GPU (macOS): fix build error in MacOS 10.13 (#1556)
* Fix build error in MacOS 10.13

* Update gpu_apple.m

---------

Co-authored-by: Carter Li <CarterLi@users.noreply.github.com>
2025-02-11 14:15:32 +08:00
Carter Li 08cd4ac1ee Packaging: update debian stuff [ci skip] 2025-02-11 13:41:50 +08:00
Carter Li 48fc598ccb Merge pull request #1555 from fastfetch-cli/dev
Release: v2.36.1
2025-02-11 10:40:51 +08:00
李通洲 3a8138e3da Release: v2.36.1 2025-02-11 10:20:16 +08:00
李通洲 4251456619 CI: fix typo 2025-02-11 10:19:38 +08:00
李通洲 5bc6d16138 CMake (Haiku): set _GNU_SOURCE 2025-02-11 09:15:30 +08:00
Jami Kettunen 11374e73ae Logo (Builtin): fix Chimera Linux distro name to match ID (#1554)
* Logo (Builtin): fix Chimera Linux distro name to match ID

* Update builtin.c

---------

Co-authored-by: Carter Li <CarterLi@users.noreply.github.com>
2025-02-11 08:45:28 +08:00
Sultaniiazov David 373cb4106a Logo (Builtin): correct shape of ALT Linux (#1553) 2025-02-10 22:32:53 +08:00
李通洲 a0949c5675 CI: build with chafa & ddcutil (aarch64) 2025-02-10 15:40:13 +08:00
李通洲 97b1eb155f CI: update artifact names of armv6l and armv7l 2025-02-10 15:15:10 +08:00
李通洲 093cc6fba2 Doc: update readme 2025-02-10 14:35:38 +08:00
李通洲 c8a3ae9186 CI (Linux): use native aarch64 runner
It now uses Ubuntu 22.04
2025-02-10 13:29:13 +08:00
李通洲 778013aec9 CI (NetBSD): update OS version to 10.1 2025-02-10 10:49:17 +08:00
Carter Li e6af1bfb91 Packaging: update debian stuff [ci skip] 2025-02-10 10:15:11 +08:00
107 changed files with 2050 additions and 392 deletions
+77 -60
View File
@@ -73,8 +73,14 @@ jobs:
- name: uname -a
run: uname -a
- name: cat /etc/os-release
run: cat /etc/os-release
- name: cat /proc/cpuinfo
run: cat /proc/cpuinfo
- name: install required packages
run: sudo apt-get update && sudo apt-get install -y libvulkan-dev libwayland-dev libxrandr-dev libxcb-randr0-dev libdconf-dev libdbus-1-dev libmagickcore-dev libxfconf-0-dev libsqlite3-dev librpm-dev libegl-dev libglx-dev libosmesa6-dev ocl-icd-opencl-dev libpulse-dev libdrm-dev libelf-dev directx-headers-dev python3-requests
run: sudo apt-get update && sudo apt-get install -y libvulkan-dev libwayland-dev libxrandr-dev libxcb-randr0-dev libdconf-dev libdbus-1-dev libmagickcore-dev libxfconf-0-dev libsqlite3-dev librpm-dev libegl-dev libglx-dev libosmesa6-dev ocl-icd-opencl-dev libpulse-dev libdrm-dev libelf-dev directx-headers-dev
- name: install linuxbrew packages
run: |
@@ -87,7 +93,7 @@ jobs:
languages: c
- name: configure project
run: PKG_CONFIG_PATH=/home/linuxbrew/.linuxbrew/lib/pkgconfig:$PKG_CONFIG_PATH cmake -DSET_TWEAK=Off -DBUILD_TESTS=On -DENABLE_EMBEDDED_PCIIDS=On -DCMAKE_INSTALL_PREFIX=/usr .
run: PKG_CONFIG_PATH=/home/linuxbrew/.linuxbrew/lib/pkgconfig:$PKG_CONFIG_PATH cmake -DSET_TWEAK=Off -DBUILD_TESTS=On -DENABLE_EMBEDDED_PCIIDS=On -DENABLE_EMBEDDED_AMDGPUIDS=On -DCMAKE_INSTALL_PREFIX=/usr .
- name: build project
run: cmake --build . --target package --verbose -j4
@@ -125,7 +131,7 @@ jobs:
linux-aarch64:
name: Linux-aarch64
runs-on: ubuntu-22.04
runs-on: ubuntu-22.04-arm
permissions:
security-events: write
contents: read
@@ -133,24 +139,45 @@ jobs:
- name: checkout repository
uses: actions/checkout@v4
- name: run VM
uses: uraimo/run-on-arch-action@v2
id: runcmd
with:
arch: aarch64
distro: ubuntu20.04
githubToken: ${{ github.token }}
run: |
uname -a
apt-get update && apt-get install -y cmake make g++ libvulkan-dev libwayland-dev libxrandr-dev libxcb-randr0-dev libdconf-dev libdbus-1-dev libmagickcore-dev libxfconf-0-dev libsqlite3-dev librpm-dev libegl-dev libglx-dev libosmesa6-dev ocl-icd-opencl-dev libpulse-dev libdrm-dev libelf-dev directx-headers-dev rpm
cmake -DSET_TWEAK=Off -DBUILD_TESTS=On -DCMAKE_INSTALL_PREFIX=/usr .
cmake --build . --target package --verbose -j4
./fastfetch --list-features
time ./fastfetch -c presets/ci.jsonc --stat false
time ./fastfetch -c presets/ci.jsonc --format json
time ./flashfetch
ldd fastfetch
ctest --output-on-failure
- name: uname -a
run: uname -a
- name: cat /etc/os-release
run: cat /etc/os-release
- name: cat /proc/cpuinfo
run: cat /proc/cpuinfo
- name: install required packages
run: sudo apt-get update && sudo apt-get install -y libvulkan-dev libwayland-dev libxrandr-dev libxcb-randr0-dev libdconf-dev libdbus-1-dev libmagickcore-dev libxfconf-0-dev libsqlite3-dev librpm-dev libegl-dev libglx-dev libosmesa6-dev ocl-icd-opencl-dev libpulse-dev libdrm-dev libelf-dev directx-headers-dev libchafa-dev libddcutil-dev rpm
- name: configure project
run: cmake -DSET_TWEAK=Off -DBUILD_TESTS=On -DENABLE_EMBEDDED_PCIIDS=On -DENABLE_EMBEDDED_AMDGPUIDS=On -DCMAKE_INSTALL_PREFIX=/usr .
- name: build project
run: cmake --build . --target package --verbose -j4
- name: list features
run: ./fastfetch --list-features
- name: run fastfetch
run: time ./fastfetch -c presets/ci.jsonc --stat false
- name: run fastfetch --format json
run: time ./fastfetch -c presets/ci.jsonc --format json
- name: run flashfetch
run: time ./flashfetch
- name: print dependencies
run: ldd fastfetch
- name: run tests
run: ctest --output-on-failure
- name: get fastfetch version
id: ffversion
run: echo "ffversion=$(./fastfetch --version-raw)" >> $GITHUB_OUTPUT
- name: upload artifacts
uses: actions/upload-artifact@v4
@@ -158,9 +185,9 @@ jobs:
name: fastfetch-linux-aarch64
path: ./fastfetch-*.*
linux-armv7:
name: Linux-armv7
runs-on: ubuntu-22.04
linux-armv7l:
name: Linux-armv7l
runs-on: ubuntu-24.04
permissions:
security-events: write
contents: read
@@ -169,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
@@ -194,12 +221,12 @@ jobs:
- name: upload artifacts
uses: actions/upload-artifact@v4
with:
name: fastfetch-linux-armv7
name: fastfetch-linux-armv7l
path: ./fastfetch-*.*
linux-armv6:
name: Linux-armv6
runs-on: ubuntu-22.04
linux-armv6l:
name: Linux-armv6l
runs-on: ubuntu-24.04
permissions:
security-events: write
contents: read
@@ -208,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
@@ -230,12 +257,12 @@ jobs:
- name: upload artifacts
uses: actions/upload-artifact@v4
with:
name: fastfetch-linux-armv6
name: fastfetch-linux-armv6l
path: ./fastfetch-*.*
linux-riscv64:
name: Linux-riscv64
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
permissions:
security-events: write
contents: read
@@ -244,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
@@ -270,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
@@ -279,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
@@ -305,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
@@ -314,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
@@ -346,19 +373,17 @@ jobs:
- name: setup alpine linux
uses: jirutka/setup-alpine@master
with:
branch: v3.19
- name: install dependencies
run: |
cat /etc/alpine-release
uname -a
apk add cmake samurai vulkan-loader-dev libxcb-dev wayland-dev libdrm-dev dconf-dev imagemagick-dev chafa-dev zlib-dev dbus-dev mesa-dev opencl-dev xfconf-dev sqlite-dev networkmanager-dev pulseaudio-dev ddcutil-dev elfutils-dev py3-requests gcc g++
apk add cmake samurai vulkan-loader-dev libxcb-dev wayland-dev libdrm-dev dconf-dev imagemagick-dev chafa-dev zlib-dev dbus-dev mesa-dev opencl-dev xfconf-dev sqlite-dev networkmanager-dev pulseaudio-dev ddcutil-dev elfutils-dev gcc g++
shell: alpine.sh --root {0}
- name: build
run: |
cmake -DSET_TWEAK=Off -DBUILD_TESTS=On -DCMAKE_INSTALL_PREFIX=/usr -DIS_MUSL=ON -DENABLE_EMBEDDED_PCIIDS=On -GNinja .
cmake -DSET_TWEAK=Off -DBUILD_TESTS=On -DCMAKE_INSTALL_PREFIX=/usr -DIS_MUSL=ON -DENABLE_EMBEDDED_PCIIDS=On -DENABLE_EMBEDDED_AMDGPUIDS=On -GNinja .
cmake --build . --target package --verbose -j4
shell: alpine.sh {0}
@@ -395,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
@@ -487,8 +504,8 @@ jobs:
run: |
uname -a
sudo pkg update
sudo pkg install -y cmake git pkgconf binutils wayland vulkan-headers vulkan-loader libxcb libXrandr libX11 libdrm glib dconf dbus sqlite3-tcl xfce4-conf egl libosmesa opencl ocl-icd v4l_compat py311-requests chafa
cmake -DSET_TWEAK=Off -DBUILD_TESTS=On -DENABLE_EMBEDDED_PCIIDS=On .
sudo pkg install -y cmake git pkgconf binutils wayland vulkan-headers vulkan-loader libxcb libXrandr libX11 libdrm glib dconf dbus sqlite3-tcl xfce4-conf egl libosmesa opencl ocl-icd v4l_compat chafa
cmake -DSET_TWEAK=Off -DBUILD_TESTS=On -DENABLE_EMBEDDED_PCIIDS=On -DENABLE_EMBEDDED_AMDGPUIDS=On .
cmake --build . --target package --verbose -j4
./fastfetch --list-features
time ./fastfetch -c presets/ci.jsonc --stat false
@@ -520,10 +537,10 @@ jobs:
prepare: |
uname -a
pkg update
pkg install -y cmake git pkgconf binutils wayland vulkan-headers vulkan-loader libxcb libXrandr libX11 libdrm glib dconf dbus sqlite3-tcl xfce4-conf egl libosmesa opencl ocl-icd v4l_compat py39-requests chafa libelf
pkg install -y cmake git pkgconf binutils wayland vulkan-headers vulkan-loader libxcb libXrandr libX11 libdrm glib dconf dbus sqlite3-tcl xfce4-conf egl libosmesa opencl ocl-icd v4l_compat chafa libelf
run: |
cmake -DSET_TWEAK=Off -DBUILD_TESTS=On -DENABLE_EMBEDDED_PCIIDS=On .
cmake -DSET_TWEAK=Off -DBUILD_TESTS=On -DENABLE_EMBEDDED_PCIIDS=On -DENABLE_EMBEDDED_AMDGPUIDS=On .
cmake --build . --target package --verbose -j4
./fastfetch --list-features
time ./fastfetch -c presets/ci.jsonc --stat false
@@ -558,8 +575,8 @@ jobs:
version: '7.6'
run: |
uname -a
sudo pkg_add -r cmake git pkgconf wayland vulkan-headers vulkan-loader glib2 dconf dbus sqlite3 xfconf imagemagick chafa pulseaudio hwdata py3-requests
cmake -DSET_TWEAK=Off -DBUILD_TESTS=On -DENABLE_EMBEDDED_PCIIDS=ON .
sudo pkg_add -r cmake git pkgconf wayland vulkan-headers vulkan-loader glib2 dconf dbus sqlite3 xfconf imagemagick chafa pulseaudio hwdata
cmake -DSET_TWEAK=Off -DBUILD_TESTS=On -DENABLE_EMBEDDED_PCIIDS=On -DENABLE_EMBEDDED_AMDGPUIDS=On .
cmake --build . --target package --verbose -j4
./fastfetch --list-features
time ./fastfetch -c presets/ci.jsonc --stat false
@@ -591,11 +608,11 @@ jobs:
architecture: x86-64
cpu_count: 4
shell: bash
version: '10.0'
version: '10.1'
run: |
uname -a
sudo pkgin -y install cmake git pkgconf wayland vulkan-headers dconf dbus sqlite3 ImageMagick pulseaudio opencl-headers ocl-icd py312-requests
cmake -DSET_TWEAK=Off -DBUILD_TESTS=On -DENABLE_EMBEDDED_PCIIDS=ON .
sudo pkgin -y install cmake git pkgconf wayland vulkan-headers dconf dbus sqlite3 ImageMagick pulseaudio opencl-headers ocl-icd
cmake -DSET_TWEAK=Off -DBUILD_TESTS=On -DENABLE_EMBEDDED_PCIIDS=On -DENABLE_EMBEDDED_AMDGPUIDS=On .
cmake --build . --target package --verbose -j4
./fastfetch --list-features
time ./fastfetch -c presets/ci.jsonc --stat false
@@ -682,8 +699,8 @@ jobs:
needs:
- linux-amd64
- linux-aarch64
- linux-armv7
- linux-armv6
- linux-armv7l
- linux-armv6l
- linux-riscv64
- linux-ppc64le
- linux-s390x
+69
View File
@@ -1,3 +1,72 @@
# 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:
* Option `--escape-bedrock` is removed. The function is always enabled now.
Features:
* Support for Haiku is greatly improved (Haiku)
* CPU, GPU, Disk, Sound, Terminal, Terminal Font, Init System, Battery, Mouse, Keyboard, NetIO, CPU Usage, Physical Disk and OpenGL should work on Haiku now
* SMBIOS related modules (Host, Bios, Board, Chassis, Physical Memory) should work in platforms with legacy BIOS system.
* Support for Gamepad and Bluetooth are WIP.
* Some bugs are found and fixed.
* Remove `python-requests` dependency in `scripts/gen-*.py`.
* Add cmake option `-DENABLE_EMBEDDED_AMDGPUIDS=BOOL` (disabled by default)
* If enabled, fastfetch will embed the newest [`amdgpu.ids`](https://gitlab.freedesktop.org/mesa/drm/-/blob/main/data/amdgpu.ids?ref_type=heads) file into fastfetch binary.
* Weather module now honors `display.temp.unit` option (#1560, Weather)
* Support Physical Memory module in NetBSD (PhysicalMemory, NetBSD)
* Requires root permission
* Improve non-intel CPU detection in NetBSD (#1573, CPU, NetBSD)
Bugfixes:
* Fix building in macOS 10.13 (GPU, macOS)
* Properly round percent values when detecting volume (#1558, Sound)
* Fix Physical Memory module doesn't work in `--format json` mode
* Add some missing variable inits (GPU, Linux)
* Fix `--localip-default-route-only false` not working with `--gen-config` (#1570, LocalIP)
Logo:
* Update Rosa linux
* Add Haiku2
# 2.36.1
Changes:
* To use [the native arm64 runner of Github Action](https://github.blog/changelog/2025-01-16-linux-arm64-hosted-runners-now-available-for-free-in-public-repositories-public-preview/), Linux aarch64 binary is built with Ubuntu 22.04 (Glibc 2.35, Debian 12).
Bugfixes:
* Chimera Linux logo is now displayed correctly (#1554, Logo)
* Regression of 2.36.0
* Fix building on Haiku
Logo:
* Fix ALT Linux
# 2.36.0
Bugfixes:
+73 -35
View File
@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.12.0) # target_link_libraries with OBJECT libs & project homepage url
project(fastfetch
VERSION 2.36.0
VERSION 2.38.0
LANGUAGES C
DESCRIPTION "Fast neofetch-like system information tool"
HOMEPAGE_URL "https://github.com/fastfetch-cli/fastfetch"
@@ -56,7 +56,7 @@ include(CheckIncludeFile)
include(CMakeDependentOption)
cmake_dependent_option(ENABLE_VULKAN "Enable vulkan" ON "LINUX OR APPLE OR FreeBSD OR OpenBSD OR NetBSD OR WIN32 OR ANDROID OR SunOS" OFF)
cmake_dependent_option(ENABLE_VULKAN "Enable vulkan" ON "LINUX OR APPLE OR FreeBSD OR OpenBSD OR NetBSD OR WIN32 OR ANDROID OR SunOS OR Haiku" OFF)
cmake_dependent_option(ENABLE_WAYLAND "Enable wayland-client" ON "LINUX OR FreeBSD OR OpenBSD OR NetBSD" OFF)
cmake_dependent_option(ENABLE_XCB_RANDR "Enable xcb-randr" ON "LINUX OR FreeBSD OR OpenBSD OR NetBSD OR SunOS" OFF)
cmake_dependent_option(ENABLE_XRANDR "Enable xrandr" ON "LINUX OR FreeBSD OR OpenBSD OR NetBSD OR SunOS" OFF)
@@ -64,23 +64,23 @@ cmake_dependent_option(ENABLE_DRM "Enable libdrm" ON "LINUX OR FreeBSD OR OpenBS
cmake_dependent_option(ENABLE_DRM_AMDGPU "Enable libdrm_amdgpu" ON "LINUX" OFF)
cmake_dependent_option(ENABLE_GIO "Enable gio-2.0" ON "LINUX OR FreeBSD OR OpenBSD OR NetBSD OR SunOS" OFF)
cmake_dependent_option(ENABLE_DCONF "Enable dconf" ON "LINUX OR FreeBSD OR OpenBSD OR NetBSD OR SunOS" OFF)
cmake_dependent_option(ENABLE_DBUS "Enable dbus-1" ON "LINUX OR FreeBSD OR OpenBSD OR NetBSD OR SunOS" OFF)
cmake_dependent_option(ENABLE_DBUS "Enable dbus-1" ON "LINUX OR FreeBSD OR OpenBSD OR NetBSD OR SunOS OR Haiku" OFF)
cmake_dependent_option(ENABLE_XFCONF "Enable libxfconf-0" ON "LINUX OR FreeBSD OR OpenBSD OR NetBSD OR SunOS" OFF)
cmake_dependent_option(ENABLE_SQLITE3 "Enable sqlite3" ON "LINUX OR FreeBSD OR APPLE OR OpenBSD OR NetBSD OR SunOS" OFF)
cmake_dependent_option(ENABLE_RPM "Enable rpm" ON "LINUX" OFF)
cmake_dependent_option(ENABLE_IMAGEMAGICK7 "Enable imagemagick 7" ON "LINUX OR FreeBSD OR OpenBSD OR NetBSD OR APPLE OR WIN32 OR SunOS" OFF)
cmake_dependent_option(ENABLE_IMAGEMAGICK7 "Enable imagemagick 7" ON "LINUX OR FreeBSD OR OpenBSD OR NetBSD OR APPLE OR WIN32 OR SunOS OR Haiku" OFF)
cmake_dependent_option(ENABLE_IMAGEMAGICK6 "Enable imagemagick 6" ON "LINUX OR FreeBSD OR OpenBSD OR NetBSD OR APPLE OR SunOS" 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 OR FreeBSD OR OpenBSD OR NetBSD OR ANDROID OR WIN32 OR SunOS OR Haiku" OFF)
cmake_dependent_option(ENABLE_GLX "Enable glx" ON "LINUX OR FreeBSD OR OpenBSD OR NetBSD OR ANDROID OR SunOS OR Haiku" OFF)
cmake_dependent_option(ENABLE_OSMESA "Enable osmesa" ON "LINUX OR FreeBSD OR OpenBSD OR NetBSD OR SunOS" OFF)
cmake_dependent_option(ENABLE_OPENCL "Enable opencl" ON "LINUX OR FreeBSD OR OpenBSD OR NetBSD OR WIN32 OR ANDROID OR SunOS" OFF)
cmake_dependent_option(ENABLE_GLX "Enable glx" ON "LINUX OR FreeBSD OR OpenBSD OR NetBSD OR ANDROID OR SunOS" OFF)
cmake_dependent_option(ENABLE_OSMESA "Enable osmesa" ON "LINUX OR FreeBSD OR OpenBSD OR NetBSD OR SunOS OR Haiku" OFF)
cmake_dependent_option(ENABLE_OPENCL "Enable opencl" ON "LINUX OR FreeBSD OR OpenBSD OR NetBSD OR WIN32 OR ANDROID OR SunOS OR Haiku" OFF)
cmake_dependent_option(ENABLE_FREETYPE "Enable freetype" ON "ANDROID" OFF)
cmake_dependent_option(ENABLE_PULSE "Enable pulse" ON "LINUX OR SunOS" OFF)
cmake_dependent_option(ENABLE_DDCUTIL "Enable ddcutil" ON "LINUX" OFF)
cmake_dependent_option(ENABLE_DIRECTX_HEADERS "Enable DirectX headers for WSL" ON "LINUX" OFF)
cmake_dependent_option(ENABLE_ELF "Enable libelf" ON "LINUX OR ANDROID OR DragonFly" OFF)
cmake_dependent_option(ENABLE_ELF "Enable libelf" ON "LINUX OR ANDROID OR DragonFly OR Haiku" OFF)
cmake_dependent_option(ENABLE_THREADS "Enable multithreading" ON "Threads_FOUND" OFF)
cmake_dependent_option(ENABLE_LIBZFS "Enable libzfs" ON "LINUX OR FreeBSD OR SunOS" OFF)
cmake_dependent_option(ENABLE_PCIACCESS "Enable libpciaccess" ON "NetBSD OR OpenBSD OR SunOS" OFF)
@@ -94,6 +94,7 @@ option(SET_TWEAK "Add tweak to project version" ON) # This is set to off by gith
option(IS_MUSL "Build with musl libc" OFF) # Used by Github Actions
option(INSTALL_LICENSE "Install license into /usr/share/licenses" ON)
option(ENABLE_EMBEDDED_PCIIDS "Embed pci.ids into fastfetch, requires `python`" OFF)
option(ENABLE_EMBEDDED_AMDGPUIDS "Embed amdgpu.ids into fastfetch, requires `python`" OFF)
set(BINARY_LINK_TYPE_OPTIONS dlopen dynamic static)
set(BINARY_LINK_TYPE dlopen CACHE STRING "How to link fastfetch")
@@ -102,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)
@@ -141,7 +142,7 @@ set(WARNING_FLAGS "-Wall -Wextra -Wconversion -Werror=uninitialized -Werror=retu
set(CMAKE_C_STANDARD 11)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${WARNING_FLAGS} -Werror=incompatible-pointer-types -Werror=implicit-function-declaration -Werror=int-conversion")
if(WIN32 OR HAIKU OR ENABLE_DIRECTX_HEADERS)
if(WIN32 OR Haiku OR ENABLE_DIRECTX_HEADERS)
enable_language(CXX)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${WARNING_FLAGS}")
@@ -271,11 +272,16 @@ endif()
if(ENABLE_EMBEDDED_PCIIDS AND NOT EXISTS "${PROJECT_BINARY_DIR}/fastfetch_pciids.c.inc")
if(Python_FOUND)
if(NOT EXISTS "${PROJECT_BINARY_DIR}/pci.ids")
message(STATUS "'${PROJECT_BINARY_DIR}/pci.ids' is missing, downloading...")
file(DOWNLOAD "https://pci-ids.ucw.cz/v2.2/pci.ids" "${PROJECT_BINARY_DIR}/pci.ids")
endif()
message(STATUS "Generating 'fastfetch_pciids.c.inc'")
execute_process(COMMAND ${Python_EXECUTABLE} "${CMAKE_CURRENT_SOURCE_DIR}/scripts/gen-pciids.py"
execute_process(COMMAND ${Python_EXECUTABLE} "${CMAKE_CURRENT_SOURCE_DIR}/scripts/gen-pciids.py" "${PROJECT_BINARY_DIR}/pci.ids"
OUTPUT_FILE "${PROJECT_BINARY_DIR}/fastfetch_pciids.c.inc"
RESULT_VARIABLE PYTHON_PCIIDS_RETCODE)
if(NOT PYTHON_PCIIDS_RETCODE EQUAL 0)
file(REMOVE "${PROJECT_BINARY_DIR}/fastfetch_pciids.c.inc")
message(FATAL_ERROR "Failed to generate 'fastfetch_pciids.c.inc'")
endif()
else()
@@ -284,6 +290,26 @@ if(ENABLE_EMBEDDED_PCIIDS AND NOT EXISTS "${PROJECT_BINARY_DIR}/fastfetch_pciids
endif()
endif()
if(ENABLE_EMBEDDED_AMDGPUIDS AND NOT EXISTS "${PROJECT_BINARY_DIR}/fastfetch_amdgpuids.c.inc")
if(Python_FOUND)
if(NOT EXISTS "${PROJECT_BINARY_DIR}/amdgpu.ids")
message(STATUS "'${PROJECT_BINARY_DIR}/amdgpu.ids' is missing, downloading...")
file(DOWNLOAD "https://gitlab.freedesktop.org/mesa/drm/-/raw/main/data/amdgpu.ids" "${PROJECT_BINARY_DIR}/amdgpu.ids")
endif()
message(STATUS "Generating 'fastfetch_amdgpuids.c.inc'")
execute_process(COMMAND ${Python_EXECUTABLE} "${CMAKE_CURRENT_SOURCE_DIR}/scripts/gen-amdgpuids.py" "${PROJECT_BINARY_DIR}/amdgpu.ids"
OUTPUT_FILE "${PROJECT_BINARY_DIR}/fastfetch_amdgpuids.c.inc"
RESULT_VARIABLE PYTHON_AMDGPUIDS_RETCODE)
if(NOT PYTHON_AMDGPUIDS_RETCODE EQUAL 0)
file(REMOVE "${PROJECT_BINARY_DIR}/fastfetch_amdgpuids.c.inc")
message(FATAL_ERROR "Failed to generate 'fastfetch_amdgpuids.c.inc'")
endif()
else()
message(WARNING "Python3 is not found, 'fastfetch_amdgpuids.c.inc' will not be generated")
set(ENABLE_EMBEDDED_AMDGPUIDS OFF)
endif()
endif()
if(Python_FOUND)
message(STATUS "Generating 'fastfetch.1'")
execute_process(COMMAND ${Python_EXECUTABLE} "${CMAKE_CURRENT_SOURCE_DIR}/scripts/gen-man.py"
@@ -718,13 +744,13 @@ elseif(NetBSD)
src/detection/btrfs/btrfs_nosupport.c
src/detection/chassis/chassis_nbsd.c
src/detection/cpu/cpu_nbsd.c
src/detection/cpucache/cpucache_nosupport.c
src/detection/cpucache/cpucache_shared.c
src/detection/cpuusage/cpuusage_bsd.c
src/detection/cursor/cursor_linux.c
src/detection/disk/disk_bsd.c
src/detection/dns/dns_linux.c
src/detection/physicaldisk/physicaldisk_nosupport.c
src/detection/physicalmemory/physicalmemory_nosupport.c
src/detection/physicalmemory/physicalmemory_linux.c
src/detection/diskio/diskio_nbsd.c
src/detection/displayserver/linux/displayserver_linux.c
src/detection/displayserver/linux/drm.c
@@ -879,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
@@ -1092,54 +1118,55 @@ elseif(SunOS)
)
elseif(Haiku)
list(APPEND LIBFASTFETCH_SRC
src/common/dbus.c
src/common/io/io_unix.c
src/common/netif/netif_haiku.c
src/common/networking_linux.c
src/common/processing_linux.c
src/detection/battery/battery_nosupport.c
src/detection/bios/bios_nosupport.c
src/detection/board/board_nosupport.c
src/detection/battery/battery_haiku.c
src/detection/bios/bios_windows.c
src/detection/board/board_windows.c
src/detection/bootmgr/bootmgr_nosupport.c
src/detection/brightness/brightness_nosupport.c
src/detection/btrfs/btrfs_nosupport.c
src/detection/chassis/chassis_nosupport.c
src/detection/cpu/cpu_nosupport.c
src/detection/cpucache/cpucache_nosupport.c
src/detection/cpuusage/cpuusage_nosupport.c
src/detection/chassis/chassis_windows.c
src/detection/cpu/cpu_haiku.c
src/detection/cpucache/cpucache_shared.c
src/detection/cpuusage/cpuusage_haiku.c
src/detection/cursor/cursor_nosupport.c
src/detection/bluetooth/bluetooth_nosupport.c
src/detection/bluetooth/bluetooth_haiku.cpp
src/detection/bluetoothradio/bluetoothradio_nosupport.c
src/detection/disk/disk_nosupport.c
src/detection/disk/disk_haiku.cpp
src/detection/dns/dns_linux.c
src/detection/physicaldisk/physicaldisk_nosupport.c
src/detection/physicalmemory/physicalmemory_nosupport.c
src/detection/physicaldisk/physicaldisk_haiku.c
src/detection/physicalmemory/physicalmemory_linux.c
src/detection/diskio/diskio_nosupport.c
src/detection/displayserver/displayserver_haiku.cpp
src/detection/font/font_haiku.cpp
src/detection/gpu/gpu_nosupport.c
src/detection/gpu/gpu_haiku.c
src/detection/gpu/gpu_pci.c
src/detection/gtk_qt/gtk.c
src/detection/host/host_nosupport.c
src/detection/host/host_windows.c
src/detection/icons/icons_nosupport.c
src/detection/initsystem/initsystem_nosupport.c
src/detection/keyboard/keyboard_nosupport.c
src/detection/initsystem/initsystem_haiku.c
src/detection/keyboard/keyboard_haiku.cpp
src/detection/libc/libc_nosupport.c
src/detection/lm/lm_nosupport.c
src/detection/loadavg/loadavg_nosupport.c
src/detection/locale/locale_linux.c
src/detection/localip/localip_linux.c
src/detection/gamepad/gamepad_nosupport.c
src/detection/media/media_nosupport.c
src/detection/gamepad/gamepad_haiku.cpp
src/detection/media/media_linux.c
src/detection/memory/memory_haiku.c
src/detection/mouse/mouse_nosupport.c
src/detection/netio/netio_nosupport.c
src/detection/opengl/opengl_linux.c
src/detection/mouse/mouse_haiku.cpp
src/detection/netio/netio_haiku.cpp
src/detection/opengl/opengl_haiku.cpp
src/detection/os/os_haiku.c
src/detection/packages/packages_haiku.c
src/detection/poweradapter/poweradapter_nosupport.c
src/detection/processes/processes_haiku.c
src/detection/gtk_qt/qt.c
src/detection/sound/sound_nosupport.c
src/detection/sound/sound_haiku.cpp
src/detection/swap/swap_haiku.c
src/detection/terminalfont/terminalfont_linux.c
src/detection/terminalshell/terminalshell_linux.c
@@ -1157,6 +1184,7 @@ elseif(Haiku)
src/detection/zpool/zpool_nosupport.c
src/util/platform/FFPlatform_unix.c
src/util/binary_linux.c
src/util/haiku/version.cpp
)
endif()
@@ -1279,6 +1307,8 @@ elseif(NetBSD)
target_compile_definitions(libfastfetch PUBLIC _GNU_SOURCE)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-char-subscripts")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-rpath,/usr/X11R7/lib -Wl,-rpath,/usr/pkg/lib") # ditto
elseif(Haiku)
target_compile_definitions(libfastfetch PUBLIC _GNU_SOURCE)
endif()
if(FreeBSD OR OpenBSD OR NetBSD)
@@ -1509,6 +1539,9 @@ endif()
if(ENABLE_EMBEDDED_PCIIDS)
target_compile_definitions(libfastfetch PRIVATE FF_HAVE_EMBEDDED_PCIIDS=1)
endif()
if(ENABLE_EMBEDDED_AMDGPUIDS)
target_compile_definitions(libfastfetch PRIVATE FF_HAVE_EMBEDDED_AMDGPUIDS=1)
endif()
if(LINUX)
target_link_libraries(libfastfetch
@@ -1614,6 +1647,11 @@ elseif(ANDROID)
elseif(Haiku)
target_link_libraries(libfastfetch
PRIVATE "network"
PRIVATE "bnetapi"
PRIVATE "media"
PRIVATE "device"
PRIVATE "bluetooth"
PRIVATE "GL"
PRIVATE "be"
PRIVATE "gnu"
)
+9 -15
View File
@@ -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.
<img src="screenshots/example1.png" width="49%" align="left" />
<img src="https://upload.wikimedia.org/wikipedia/commons/2/24/Transparent_Square_Tiles_Texture.png" width="49%" height="16px" align="left" />
@@ -29,6 +29,10 @@ There are [screenshots on different platforms](https://github.com/fastfetch-cli/
Some distros package an outdated fastfetch version. Older versions receive no support, so please try always to use the latest version.
<a href="https://repology.org/project/fastfetch/versions">
<img src="https://repology.org/badge/vertical-allrepos/fastfetch.svg?columns=2" alt="Packaging status" align="right">
</a>
* Ubuntu: [`ppa:zhangsongcui3371/fastfetch`](https://launchpad.net/~zhangsongcui3371/+archive/ubuntu/fastfetch) (for Ubuntu 22.04 or newer)
* Debian: `apt install fastfetch` (for Debian 13 or newer)
* Debian / Ubuntu: Download `fastfetch-linux-<proper architecture>.deb` from [Github release page](https://github.com/fastfetch-cli/fastfetch/releases/latest) and double-click it (for Ubuntu 20.04 or newer and Debian 11 or newer).
@@ -47,8 +51,6 @@ Some distros package an outdated fastfetch version. Older versions receive no su
You may need `sudo`, `doas` or `sup` to run these commands.
[See also if fastfetch has been packaged for your favorite Linux distro](#Packaging).
If fastfetch is not packaged for your distro or an outdated version is packaged, [linuxbrew](https://brew.sh/) is a good alternative: `brew install fastfetch`
### macOS
@@ -73,6 +75,10 @@ You may also download the program directly from [the GitHub releases page](https
* `pkg install fastfetch`
### Nightly
<https://nightly.link/fastfetch-cli/fastfetch/workflows/ci/dev?preview>
## Build from source
See Wiki: https://github.com/fastfetch-cli/fastfetch/wiki/Building
@@ -91,18 +97,6 @@ Fastfetch uses the JSONC (or JSON with comments) for configuration. [See Wiki fo
Logos can also be heavily customized; see the [logo documentation](https://github.com/fastfetch-cli/fastfetch/wiki/Logo-options) for more information.
## Packaging
### Repositories
[![Packaging status](https://repology.org/badge/vertical-allrepos/fastfetch.svg?header=)](https://repology.org/project/fastfetch/versions)
### Manual
* DEB / RPM package: `cmake --build . --target package`
* Install directly: `cmake --install . --prefix /usr/local`
## FAQ
### Q: Neofetch is good enough. Why do I need fastfetch?
+18
View File
@@ -1,3 +1,21 @@
fastfetch (2.37.0) jammy; urgency=medium
* Update to 2.37.0
-- Carter Li <zhangsongcui@live.cn> Wed, 19 Feb 2025 15:43:42 +0800
fastfetch (2.36.1) jammy; urgency=medium
* Update to 2.36.1
-- Carter Li <zhangsongcui@live.cn> Tue, 11 Feb 2025 13:39:55 +0800
fastfetch (2.36.0) jammy; urgency=medium
* Update to 2.36.0
-- Carter Li <zhangsongcui@live.cn> Mon, 10 Feb 2025 10:13:53 +0800
fastfetch (2.35.0) jammy; urgency=medium
* Update to 2.35.0
+1 -1
View File
@@ -1 +1 @@
fastfetch_2.35.0_source.buildinfo universe/utils optional
fastfetch_2.37.0_source.buildinfo universe/utils optional
+9 -7
View File
@@ -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, ..."
}
]
},
@@ -817,8 +817,8 @@
"unit": {
"type": "string",
"description": "Set the unit of the temperature",
"enum": ["CELSIUS", "C", "FAHRENHEIT", "F", "KELVIN", "K"],
"default": "C"
"enum": ["D", "Default", "Celsius", "C", "Fahrenheit", "F", "Kelvin", "K"],
"default": "D"
},
"ndigits": {
"type": "integer",
@@ -2641,6 +2641,7 @@
"eopkg",
"flatpak",
"guix",
"hpkg",
"linglong",
"lpkg",
"lpkgbuild",
@@ -2651,6 +2652,7 @@
"pacman",
"pacstall",
"paludis",
"pisi",
"pkg",
"pkgtool",
"qi",
+2
View File
@@ -90,6 +90,8 @@
"sound",
"camera",
"gamepad",
"mouse",
"keyboard",
{
"type": "weather",
"timeout": 1000
+2
View File
@@ -92,6 +92,8 @@
"sound",
"camera",
"gamepad",
"mouse",
"keyboard",
{
"type": "weather",
"timeout": 1000
+241
View File
@@ -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"
]
}
+43
View File
@@ -0,0 +1,43 @@
#!/usr/bin/env python3
import sys
def main(amdgpu_ids_path: str):
with open(amdgpu_ids_path, 'r') as f:
full_text = f.read()
products = []
for line in full_text.split('\n'):
if not line or line[0] == '#' or not ',\t' in line:
continue
device, revision, name = line.split(',\t', maxsplit=2)
products.append((device, revision, name))
code = """\
// SPDX-License-Identifier: MIT
// https://opensource.org/license/mit
// Generated from https://gitlab.freedesktop.org/mesa/drm/-/raw/main/data/amdgpu.ids
#include <stdint.h>
#include <stddef.h>
typedef struct FFArmGpuProduct
{
const uint32_t id; // device << 8 | revision
const char* name;
} FFArmGpuProduct;
const FFArmGpuProduct ffAmdGpuProducts[] = {
"""
for device, revision, name in products:
code += f" {{ 0x{device} << 8 | 0x{revision}, \"{name}\" }},\n"
code += "};\n"
print(code)
if __name__ == '__main__':
len(sys.argv) == 2 or sys.exit('Usage: gen-amdgpuids.py </path/to/amdgpu.ids>')
main(sys.argv[1])
+7 -9
View File
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
from requests import get as http_get
import sys
class PciDeviceModel:
def __init__(self, id: int, name: str):
@@ -13,14 +13,10 @@ class PciVendorModel:
self.name = name
self.devices = []
def main(keep_vendor_list: set):
def main(keep_vendor_list: set, pci_ids_path: str):
vendors = []
try:
with open('pci.ids', 'r') as f:
full_text = f.read()
except FileNotFoundError:
response = http_get('https://pci-ids.ucw.cz/v2.2/pci.ids')
full_text = response.text
with open(pci_ids_path, 'r') as f:
full_text = f.read()
dev_list_text = full_text[:full_text.rfind('\n\n\n')] # remove known classes
for line in dev_list_text.split('\n'):
@@ -80,6 +76,8 @@ const FFPciVendor ffPciVendors[] = {{
print(code)
if __name__ == '__main__':
len(sys.argv) == 2 or sys.exit('Usage: gen-pciids.py </path/to/pci.ids>')
# From <src/detection/gpu/gpu.c>
main({
0x106b, # Apple
@@ -94,4 +92,4 @@ if __name__ == '__main__':
0x1ab8, # Parallel
0x1414, # Microsoft
0x108e, # Oracle
})
}, sys.argv[1])
+3
View File
@@ -236,6 +236,9 @@ void ffListFeatures(void)
#if FF_HAVE_FREETYPE
"freetype\n"
#endif
#if FF_HAVE_PCIACCESS
"libpciaccess\n"
#endif
#if FF_HAVE_PULSE
"libpulse\n"
#endif
+1 -1
View File
@@ -119,7 +119,7 @@ static inline bool ffPathExists(const char* path, FFPathType pathType)
}
else
{
#if __APPLE__ // #1395
#if (__APPLE__ || __HAIKU__) // #1395
struct stat fileStat;
if(stat(path, &fileStat) != 0)
return false;
+2 -2
View File
@@ -24,10 +24,10 @@ bool ffNetifGetDefaultRouteImpl(char iface[IF_NAMESIZE + 1], uint32_t* ifIndex)
return false;
int size = config.ifc_value;
if (size == 0)
if (size <= 0)
return false;
FF_AUTO_FREE void *buffer = malloc(size);
FF_AUTO_FREE void *buffer = malloc((size_t) size);
if (buffer == NULL) {
return false;
}
+30
View File
@@ -28,6 +28,9 @@
#elif defined(__NetBSD__)
#include <sys/types.h>
#include <sys/sysctl.h>
#elif defined(__HAIKU__)
#include <OS.h>
#include <image.h>
#endif
enum { FF_PIPE_BUFSIZ = 8192 };
@@ -310,6 +313,21 @@ void ffProcessGetInfoLinux(pid_t pid, FFstrbuf* processName, FFstrbuf* exe, cons
}
kvm_close(kd);
#elif defined(__HAIKU__)
image_info info;
int32 cookie = 0;
while (get_next_image_info(pid, &cookie, &info) == B_OK)
{
if (info.type != B_APP_IMAGE) continue;
ffStrbufSetS(exe, info.name);
if (exePath)
ffStrbufSet(exePath, exe);
break;
}
#endif
if(exe->length == 0)
@@ -476,6 +494,18 @@ const char* ffProcessGetBasicInfoLinux(pid_t pid, FFstrbuf* name, pid_t* ppid, i
if (!proc)
return "kvm_getprocs() failed";
#elif defined(__HAIKU__)
team_info info;
if (get_team_info(pid, &info) == B_OK)
{
ffStrbufSetS(name, info.name);
if (ppid)
*ppid = info.parent;
}
FF_UNUSED(tty);
#else
return "Unsupported platform";
+1
View File
@@ -39,6 +39,7 @@ void ffTempsAppendNum(double celsius, FFstrbuf* buffer, FFColorRangeConfig confi
switch (options->tempUnit)
{
case FF_TEMPERATURE_UNIT_DEFAULT:
case FF_TEMPERATURE_UNIT_CELSIUS:
ffStrbufAppendF(buffer, "%.*f°C", options->tempNdigits, celsius);
break;
+6
View File
@@ -7,6 +7,8 @@
#include <synchapi.h>
#include <profileapi.h>
#include <sysinfoapi.h>
#elif defined(__HAIKU__)
#include <OS.h>
#endif
static inline double ffTimeGetTick(void) //In msec
@@ -17,6 +19,8 @@ static inline double ffTimeGetTick(void) //In msec
LARGE_INTEGER start;
QueryPerformanceCounter(&start);
return (double) start.QuadPart * 1000 / (double) frequency.QuadPart;
#elif defined(__HAIKU__)
return (double) system_time() / 1000.;
#else
struct timespec timeNow;
clock_gettime(CLOCK_MONOTONIC, &timeNow);
@@ -30,6 +34,8 @@ static inline uint64_t ffTimeGetNow(void)
uint64_t timeNow;
GetSystemTimeAsFileTime((FILETIME*) &timeNow);
return (timeNow - 116444736000000000ull) / 10000ull;
#elif defined(__HAIKU__)
return (uint64_t) real_time_clock_usecs() / 1000u;
#else
struct timespec timeNow;
clock_gettime(CLOCK_REALTIME, &timeNow);
+4 -13
View File
@@ -104,16 +104,6 @@
"default": true
}
},
{
"long": "escape-bedrock",
"desc": "On Bedrock Linux, whether to escape the bedrock jail",
"remark": "Linux only",
"arg": {
"type": "bool",
"optional": true,
"default": true
}
},
{
"long": "wmi-timeout",
"desc": "Set the timeout (ms) for WMI queries",
@@ -693,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"
}
@@ -732,11 +722,12 @@
"arg": {
"type": "enum",
"enum": {
"D": "Default",
"C": "Celsius",
"F": "Fahrenheit",
"K": "Kelvin"
},
"default": "C"
"default": "D"
}
},
{
+63
View File
@@ -0,0 +1,63 @@
#include "fastfetch.h"
#include "battery.h"
#include "common/io/io.h"
#include <private/device/power_managment.h>
#include <sys/ioctl.h>
#include <fcntl.h>
const char* parseBattery(int dfd, const char* battId, FFlist* results)
{
FF_AUTO_CLOSE_FD int fd = openat(dfd, battId, O_RDWR);
if (fd < 0) return "openat() failed";
acpi_battery_info basic = {};
if (ioctl(fd, GET_BATTERY_INFO, &basic, sizeof(basic)) != 0)
return "ioctl(GET_BATTERY_INFO) failed";
acpi_extended_battery_info extended = {};
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);
ffStrbufInit(&battery->manufactureDate);
ffStrbufInitS(&battery->technology, extended.type); // extended.technology?
ffStrbufInit(&battery->status);
ffStrbufInitS(&battery->serial, extended.serial_number);
battery->temperature = FF_BATTERY_TEMP_UNSET;
battery->cycleCount = extended.cycles;
battery->timeRemaining = -1;
battery->capacity = (double) basic.capacity * 100. / (double) extended.last_full_charge;
if (basic.state & BATTERY_DISCHARGING)
ffStrbufAppendS(&battery->status, "Discharging, ");
if (basic.state & BATTERY_CHARGING)
ffStrbufAppendS(&battery->status, "Charging, ");
if (basic.state & BATTERY_CRITICAL_STATE)
ffStrbufAppendS(&battery->status, "Critical, ");
if (basic.state & BATTERY_NOT_CHARGING)
ffStrbufAppendS(&battery->status, "AC Connected, ");
ffStrbufTrimRight(&battery->status, ' ');
ffStrbufTrimRight(&battery->status, ',');
return NULL;
}
const char* ffDetectBattery(FF_MAYBE_UNUSED FFBatteryOptions* options, FFlist* results)
{
FF_AUTO_CLOSE_DIR DIR* dir = opendir("/dev/power/acpi_battery/");
if (!dir) return "opendir(/dev/power/acpi_battery) failed";
struct dirent* entry;
while ((entry = readdir(dir)))
{
if (entry->d_name[0] == '.') continue;
parseBattery(dirfd(dir), entry->d_name, results);
}
return NULL;
}
+3
View File
@@ -89,6 +89,9 @@ const char* ffDetectBios(FFBiosResult* bios)
default: break;
}
}
#elif __HAIKU__
// Currently SMBIOS detection is supported in legency BIOS only
ffStrbufSetStatic(&bios->type, "BIOS");
#endif
return NULL;
@@ -0,0 +1,29 @@
extern "C" {
#include "bluetooth.h"
#include "common/io/io.h"
}
#include <bluetooth/LocalDevice.h>
const char* ffDetectBluetooth(FF_MAYBE_UNUSED FFBluetoothOptions* options, FFlist* devices /* FFBluetoothResult */)
{
using namespace Bluetooth;
FF_SUPPRESS_IO();
LocalDevice* dev = LocalDevice::GetLocalDevice();
if (!dev) return NULL;
BString devClass;
dev->GetDeviceClass().DumpDeviceClass(devClass);
FFBluetoothResult* device = (FFBluetoothResult*) ffListAdd(devices);
ffStrbufInitS(&device->name, dev->GetFriendlyName());
ffStrbufInitS(&device->address, bdaddrUtils::ToString(dev->GetBluetoothAddress()).String());
ffStrbufInitS(&device->type, devClass.String());
device->battery = 0;
device->connected = true;
// TODO: more devices?
return NULL;
}
+1 -1
View File
@@ -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;
+1
View File
@@ -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
@@ -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;
}
}
@@ -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)
@@ -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);
+2 -1
View File
@@ -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;
}
@@ -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;
}
@@ -24,6 +24,7 @@ static const char* detectWithWmi(FFlist* result)
brightness->max = 100;
brightness->min = 0;
brightness->current = vtValue.get<uint8_t>();
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;
}
}
}
+5 -5
View File
@@ -16,18 +16,18 @@ const char* ffDetectCamera(FFlist* result)
#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
+38
View File
@@ -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;
}
+64
View File
@@ -0,0 +1,64 @@
#include "cpu.h"
#include "util/mallocHelper.h"
#include <OS.h>
#include <private/shared/cpu_type.h>
const char* ffDetectCPUImpl(FF_MAYBE_UNUSED const FFCPUOptions* options, FFCPUResult* cpu)
{
system_info sysInfo;
if (get_system_info(&sysInfo) != B_OK)
return "get_system_info() failed";
uint32 topoNodeCount = 0;
get_cpu_topology_info(NULL, &topoNodeCount);
if (topoNodeCount == 0)
return "get_cpu_topology_info(NULL) failed";
FF_AUTO_FREE cpu_topology_node_info* topology = malloc(sizeof(*topology) * topoNodeCount);
if (get_cpu_topology_info(topology, &topoNodeCount) != B_OK)
return "get_cpu_topology_info(topology) failed";
enum cpu_platform platform = B_CPU_UNKNOWN;
enum cpu_vendor cpuVendor = B_CPU_VENDOR_UNKNOWN;
uint32 cpuModel = 0, frequency = 0;
uint16_t packages = 0, cores = 0;
for (uint32 i = 0; i < topoNodeCount; i++)
{
switch (topology[i].type) {
case B_TOPOLOGY_ROOT:
platform = topology[i].data.root.platform;
break;
case B_TOPOLOGY_PACKAGE:
cpuVendor = topology[i].data.package.vendor;
++packages;
break;
case B_TOPOLOGY_CORE:
cpuModel = topology[i].data.core.model;
uint32_t freq = (uint32_t) (topology[i].data.core.default_frequency / 1000000);
frequency = freq > frequency ? freq : frequency;
++cores;
break;
default:
break;
}
}
const char *model = get_cpu_model_string(platform, cpuVendor, cpuModel);
if (model)
ffStrbufSetS(&cpu->name, model);
else
ffStrbufSetF(&cpu->name, "(Unknown %" B_PRIx32 ")", cpuModel);
ffStrbufSetS(&cpu->vendor, get_cpu_vendor_string(cpuVendor));
ffCPUDetectSpeedByCpuid(cpu);
if (cpu->frequencyBase < frequency) cpu->frequencyBase = frequency;
cpu->packages = packages;
cpu->coresPhysical = cores;
cpu->coresOnline = cpu->coresLogical = (uint16_t) sysInfo.cpu_count;
return NULL;
}
+5 -3
View File
@@ -42,10 +42,11 @@ static const char* detectCpuTemp(double* current)
const char* ffDetectCPUImpl(const FFCPUOptions* options, FFCPUResult* cpu)
{
if (ffSysctlGetString("machdep.cpu_brand", &cpu->name) != NULL)
if (ffSysctlGetString("machdep.cpu_brand", &cpu->name) != NULL &&
ffSysctlGetString("machdep.dmi.processor-version", &cpu->name) != NULL &&
ffSysctlGetString("hw.cpu0.name", &cpu->name) != NULL)
{
if (ffSysctlGetString("machdep.dmi.processor-version", &cpu->name) != NULL)
return "sysctlbyname(machdep.cpu_brand) failed";
ffStrbufSetS(&cpu->name, "Unknown CPU");
}
if (ffSysctlGetString("machdep.dmi.processor-vendor", &cpu->vendor) == NULL)
@@ -58,6 +59,7 @@ const char* ffDetectCPUImpl(const FFCPUOptions* options, FFCPUResult* cpu)
ffCPUDetectSpeedByCpuid(cpu);
uint32_t freq = (uint32_t) ffSysctlGetInt("machdep.cpu.frequency.target", 0);
if (freq == 0) freq = (uint32_t) (ffSysctlGetInt64("hw.cpu0.clock_frequency", 0) / 1000000);
if (freq > cpu->frequencyBase) cpu->frequencyBase = freq;
cpu->temperature = FF_CPU_TEMP_UNSET;
+27
View File
@@ -0,0 +1,27 @@
#include "fastfetch.h"
#include "detection/cpuusage/cpuusage.h"
#include "util/mallocHelper.h"
#include <OS.h>
const char* ffGetCpuUsageInfo(FFlist* cpuTimes)
{
system_info sysInfo;
if (get_system_info(&sysInfo) != B_OK)
return "get_system_info() failed";
FF_AUTO_FREE cpu_info* cpuInfo = malloc(sizeof(*cpuInfo) * sysInfo.cpu_count);
if (get_cpu_info(0, sysInfo.cpu_count, cpuInfo) != B_OK)
return "get_cpu_info() failed";
uint64_t uptime = (uint64_t) system_time();
for (uint32_t i = 0; i < sysInfo.cpu_count; ++i)
{
FFCpuUsageInfo* info = (FFCpuUsageInfo*) ffListAdd(cpuTimes);
info->inUseAll = (uint64_t) cpuInfo[i].active_time;
info->totalAll = uptime;
}
return NULL;
}
+59
View File
@@ -0,0 +1,59 @@
extern "C"
{
#include "disk.h"
#include "util/stringUtils.h"
}
#include <fs_info.h>
#include <Directory.h>
#include <Path.h>
const char* ffDetectDisksImpl(FFDiskOptions* options, FFlist* disks)
{
int32 pos = 0;
for (dev_t dev; (dev = next_dev(&pos)) >= B_OK;)
{
fs_info fs;
if (fs_stat_dev(dev, &fs) < -1) continue;
node_ref node(fs.dev, fs.root);
BDirectory dir(&node);
BPath path(&dir);
if (path.InitCheck() != B_OK) continue;
if (__builtin_expect(options->folders.length, 0))
{
if (!ffDiskMatchMountpoint(options, path.Path()))
continue;
}
FFDisk* disk = (FFDisk*) ffListAdd(disks);
disk->bytesTotal = (uint64_t)fs.total_blocks * (uint64_t) fs.block_size;
disk->bytesFree = (uint64_t)fs.free_blocks * (uint64_t) fs.block_size;
disk->bytesAvailable = disk->bytesFree;
disk->bytesUsed = 0; // To be filled in ./disk. c
disk->filesTotal = (uint32_t) fs.total_nodes;
disk->filesUsed = (uint32_t) (disk->filesTotal - (uint64_t)fs.free_nodes);
ffStrbufInitS(&disk->mountFrom, fs.device_name);
ffStrbufInitS(&disk->mountpoint, path.Path());
ffStrbufInitS(&disk->filesystem, fs.fsh_name);
ffStrbufInitS(&disk->name, fs.volume_name);
disk->type = FF_DISK_VOLUME_TYPE_NONE;
if (!(fs.flags & B_FS_IS_PERSISTENT))
disk->type = (FFDiskVolumeType) (disk->type | FF_DISK_VOLUME_TYPE_HIDDEN_BIT);
if (fs.flags & B_FS_IS_READONLY)
disk->type = (FFDiskVolumeType) (disk->type | FF_DISK_VOLUME_TYPE_READONLY_BIT);
if (fs.flags & B_FS_IS_REMOVABLE)
disk->type = (FFDiskVolumeType) (disk->type | FF_DISK_VOLUME_TYPE_EXTERNAL_BIT);
if (disk->type == FF_DISK_VOLUME_TYPE_NONE) disk->type = FF_DISK_VOLUME_TYPE_REGULAR_BIT;
disk->createTime = 0;
time_t crTime;
if (dir.GetCreationTime(&crTime) == B_OK)
disk->createTime = (uint64_t) crTime * 1000;
}
return NULL;
}
@@ -1,7 +1,5 @@
extern "C" {
#include "displayserver.h"
#include "common/settings.h"
#include "common/processing.h"
}
#include <math.h>
@@ -31,14 +29,16 @@ static void detectDisplays(FFDisplayServerResult* ds)
monitor_info monitor;
// WARNING: This is experimental new Haiku API
status_t err = s.GetMonitorInfo(&monitor);
if (err == B_OK) {
if (err == B_OK)
{
ffStrbufSetF(&name, "%s %s", monitor.vendor, monitor.name);
ffStrbufTrimRightSpace(&name);
}
uint32_t width = (uint32_t) s.Frame().Width() + 1;
uint32_t height = (uint32_t) (uint32_t)s.Frame().Height() + 1;
double scaleFactor = (double) 1.0;
ffdsAppendDisplay(ds,
FFDisplayResult* res = ffdsAppendDisplay(ds,
width,
height,
(double)mode.timing.pixel_clock * 1000 / (mode.timing.v_total * mode.timing.h_total),
@@ -51,11 +51,16 @@ static void detectDisplays(FFDisplayServerResult* ds)
&name,
FF_DISPLAY_TYPE_UNKNOWN,
main,
s.ID().id,
(uint64_t) s.ID().id,
0,
0,
"BScreen"
);
if (err == B_OK)
{
res->manufactureWeek = monitor.produced.week;
res->manufactureYear = monitor.produced.year;
}
main = false;
} while (s.SetToNext() == B_OK);
-2
View File
@@ -1,6 +1,4 @@
extern "C" {
#include "common/font.h"
#include "common/parsing.h"
#include "font.h"
}
+21
View File
@@ -0,0 +1,21 @@
extern "C" {
#include "gamepad.h"
}
#include <Joystick.h>
const char* ffDetectGamepad(FFlist* devices /* List of FFGamepadDevice */)
{
BJoystick js;
for (int32 i = 0, n = js.CountDevices(); i < n; ++i)
{
char name[B_OS_NAME_LENGTH];
if (js.GetDeviceName(i, name) == B_OK)
{
FFGamepadDevice* device = (FFGamepadDevice*) ffListAdd(devices);
ffStrbufInit(&device->serial);
ffStrbufInitS(&device->name, name);
device->battery = 0;
}
}
return NULL;
}
+2 -1
View File
@@ -48,6 +48,7 @@ const char* ffDetectGPUImpl(const FFGPUOptions* options, FFlist* gpus);
const char* ffGPUGetVendorString(unsigned vendorId);
#if defined(__linux__) || defined(__FreeBSD__) || defined(__sun) || defined(__NetBSD__) || defined(__OpenBSD__)
#if defined(__linux__) || defined(__FreeBSD__) || defined(__sun) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__HAIKU__)
void ffGPUFillVendorAndName(uint8_t subclass, uint16_t vendor, uint16_t device, FFGPUResult* gpu);
void ffGPUQueryAmdGpuName(uint16_t deviceId, uint8_t revisionId, FFGPUResult* gpu);
#endif
+1 -1
View File
@@ -115,7 +115,7 @@ const char* ffDetectGPUImpl(const FFGPUOptions* options, FFlist* gpus)
if(ffCfDictGetInt(properties, CFSTR("gpu-core-count"), &gpu->coreCount)) // For Apple
gpu->coreCount = FF_GPU_CORE_COUNT_UNSET;
gpu->coreUsage = 0.0/0.0;
gpu->coreUsage = FF_GPU_CORE_USAGE_UNSET;
CFDictionaryRef perfStatistics = NULL;
uint64_t vramUsed = 0, vramTotal = 0;
if (ffCfDictGetDict(properties, CFSTR("PerformanceStatistics"), &perfStatistics) == NULL)
+1 -1
View File
@@ -67,10 +67,10 @@ const char* ffGpuDetectMetal(FFlist* gpus)
gpu->type = device.location == MTLDeviceLocationBuiltIn ? FF_GPU_TYPE_INTEGRATED : FF_GPU_TYPE_DISCRETE;
gpu->index = (uint32_t) device.locationNumber;
#endif
if (device.hasUnifiedMemory && device.recommendedMaxWorkingSetSize > 0)
gpu->shared.total = device.recommendedMaxWorkingSetSize;
#endif
}
return NULL;
}
+1 -6
View File
@@ -1,7 +1,6 @@
#include "gpu_driver_specific.h"
#include "common/io/io.h"
#include "common/properties.h"
#include <sys/pciio.h>
#include <fcntl.h>
@@ -76,11 +75,7 @@ const char* ffDetectGPUImpl(const FFGPUOptions* options, FFlist* gpus)
if (gpu->name.length == 0)
{
if (gpu->vendor.chars == FF_GPU_VENDOR_NAME_AMD)
{
char query[32];
snprintf(query, ARRAY_SIZE(query), "%X,\t%X,", (unsigned) pc->pc_device, (unsigned) pc->pc_revid);
ffParsePropFileData("libdrm/amdgpu.ids", query, &gpu->name);
}
ffGPUQueryAmdGpuName(pc->pc_device, pc->pc_revid, gpu);
if (gpu->name.length == 0)
ffGPUFillVendorAndName(pc->pc_subclass, pc->pc_vendor, pc->pc_device, gpu);
}
+2 -6
View File
@@ -2,7 +2,6 @@
#ifdef FF_HAVE_PCIACCESS
#include "common/properties.h"
#include "common/io/io.h"
#include "common/library.h"
@@ -37,17 +36,14 @@ const char* ffDetectGPUImpl(FF_MAYBE_UNUSED const FFGPUOptions* options, FFlist*
ffStrbufInit(&gpu->platformApi);
gpu->temperature = FF_GPU_TEMP_UNSET;
gpu->coreCount = FF_GPU_CORE_COUNT_UNSET;
gpu->coreUsage = FF_GPU_CORE_USAGE_UNSET;
gpu->type = FF_GPU_TYPE_UNKNOWN;
gpu->dedicated.total = gpu->dedicated.used = gpu->shared.total = gpu->shared.used = FF_GPU_VMEM_SIZE_UNSET;
gpu->deviceId = ((uint64_t) dev->domain << 6) | ((uint64_t) dev->bus << 4) | ((uint64_t) dev->dev << 2) | (uint64_t) dev->func;
gpu->frequency = FF_GPU_FREQUENCY_UNSET;
if (gpu->vendor.chars == FF_GPU_VENDOR_NAME_AMD)
{
char query[32];
snprintf(query, sizeof(query), "%X,\t%X,", (unsigned) dev->device_id, (unsigned) dev->revision);
ffParsePropFileData("libdrm/amdgpu.ids", query, &gpu->name);
}
ffGPUQueryAmdGpuName(dev->device_id, dev->revision, gpu);
if (gpu->name.length == 0)
{
+43
View File
@@ -0,0 +1,43 @@
#include "gpu.h"
#include "common/io/io.h"
#include <private/drivers/poke.h>
const char* ffDetectGPUImpl(FF_MAYBE_UNUSED const FFGPUOptions* options, FFlist* gpus)
{
FF_AUTO_CLOSE_FD int pokefd = open(POKE_DEVICE_FULLNAME, O_RDWR);
if (pokefd < 0) return "open(POKE_DEVICE_FULLNAME) failed";
pci_info dev;
pci_info_args cmd = {
.signature = POKE_SIGNATURE,
.info = &dev,
};
for (cmd.index = 0; ioctl(pokefd, POKE_GET_NTH_PCI_INFO, &cmd, sizeof(cmd)) == B_OK && cmd.status == B_OK; ++cmd.index)
{
if (dev.class_base != 0x03 /*PCI_BASE_CLASS_DISPLAY*/)
continue;
FFGPUResult* gpu = (FFGPUResult*)ffListAdd(gpus);
ffStrbufInitStatic(&gpu->vendor, ffGPUGetVendorString(dev.vendor_id));
ffStrbufInit(&gpu->name);
ffStrbufInit(&gpu->driver);
ffStrbufInit(&gpu->platformApi);
gpu->temperature = FF_GPU_TEMP_UNSET;
gpu->coreCount = FF_GPU_CORE_COUNT_UNSET;
gpu->coreUsage = FF_GPU_CORE_USAGE_UNSET;
gpu->type = FF_GPU_TYPE_UNKNOWN;
gpu->dedicated.total = gpu->dedicated.used = gpu->shared.total = gpu->shared.used = FF_GPU_VMEM_SIZE_UNSET;
gpu->deviceId = ((uint64_t) dev.bus << 4) | ((uint64_t) dev.device << 2) | (uint64_t) dev.function;
gpu->frequency = FF_GPU_FREQUENCY_UNSET;
if (gpu->vendor.chars == FF_GPU_VENDOR_NAME_AMD)
ffGPUQueryAmdGpuName(dev.device_id, dev.revision, gpu);
if (gpu->name.length == 0)
ffGPUFillVendorAndName(dev.class_sub, dev.vendor_id, dev.device_id, gpu);
}
return NULL;
}
+1 -10
View File
@@ -4,7 +4,6 @@
#include "detection/gpu/gpu_driver_specific.h"
#include "common/io/io.h"
#include "common/library.h"
#include "common/properties.h"
#include "util/stringUtils.h"
#include "util/mallocHelper.h"
@@ -491,15 +490,7 @@ static const char* detectPci(const FFGPUOptions* options, FFlist* gpus, FFstrbuf
char* pend;
uint64_t revision = strtoul(buffer->chars, &pend, 16);
if (pend != buffer->chars)
{
char query[32];
snprintf(query, ARRAY_SIZE(query), "%X,\t%X,", (unsigned) deviceId, (unsigned) revision);
#ifdef FF_CUSTOM_AMDGPU_IDS_PATH
ffParsePropFile(FF_STR(FF_CUSTOM_AMDGPU_IDS_PATH), query, &gpu->name);
#else
ffParsePropFileData("libdrm/amdgpu.ids", query, &gpu->name);
#endif
}
ffGPUQueryAmdGpuName((uint16_t) deviceId, (uint8_t) revision, gpu);
}
ffStrbufSubstrBefore(deviceDir, drmDirPathLength);
}
+46
View File
@@ -1,5 +1,6 @@
#include "gpu.h"
#include "common/io/io.h"
#include "common/properties.h"
#include <stdlib.h>
#ifdef __FreeBSD__
@@ -16,6 +17,9 @@
#if FF_HAVE_EMBEDDED_PCIIDS
#include "fastfetch_pciids.c.inc"
#endif
#if FF_HAVE_EMBEDDED_AMDGPUIDS
#include "fastfetch_amdgpuids.c.inc"
#endif
#define FF_STR_INDIR(x) #x
#define FF_STR(x) FF_STR_INDIR(x)
@@ -45,6 +49,8 @@ static const FFstrbuf* loadPciIds()
ffReadFileBuffer(_PATH_LOCALBASE "/share/pciids/pci.ids", &pciids);
#elif __sun
ffReadFileBuffer(FASTFETCH_TARGET_DIR_ROOT "/usr/share/hwdata/pci.ids", &pciids);
#elif __HAIKU__
ffReadFileBuffer(FASTFETCH_TARGET_DIR_ROOT "/system/data/hwdata/pci.ids", &pciids);
#endif
#endif // FF_CUSTOM_PCI_IDS_PATH
@@ -189,3 +195,43 @@ void ffGPUFillVendorAndName(uint8_t subclass, uint16_t vendor, uint16_t device,
#endif
return parsePciIdsFile(loadPciIds(), subclass, vendor, device, gpu);
}
#if FF_HAVE_EMBEDDED_AMDGPUIDS
static inline int amdGpuCmp(const uint32_t* key, const FFArmGpuProduct* element)
{
// Maximum value of *key is 0x00FFFFFF. `(int) *key` should never overflow
return (int) *key - (int) element->id;
}
static bool loadAmdGpuIdsInc(uint16_t deviceId, uint8_t revision, FFGPUResult* gpu)
{
uint32_t key = (deviceId << 8u) | revision;
FFArmGpuProduct* product = bsearch(&key, ffAmdGpuProducts, ARRAY_SIZE(ffAmdGpuProducts), sizeof(*ffAmdGpuProducts), (void*) amdGpuCmp);
if (product)
{
ffStrbufSetS(&gpu->name, product->name);
return true;
}
return false;
}
#endif
static void parseAmdGpuIdsFile(uint16_t deviceId, uint8_t revision, FFGPUResult* gpu)
{
char query[32];
snprintf(query, ARRAY_SIZE(query), "%X,\t%X,", (unsigned) deviceId, (unsigned) revision);
#ifdef FF_CUSTOM_AMDGPU_IDS_PATH
ffParsePropFile(FF_STR(FF_CUSTOM_AMDGPU_IDS_PATH), query, &gpu->name);
#else
ffParsePropFileData("libdrm/amdgpu.ids", query, &gpu->name);
#endif
}
void ffGPUQueryAmdGpuName(uint16_t deviceId, uint8_t revisionId, FFGPUResult* gpu)
{
#if FF_HAVE_EMBEDDED_AMDGPUIDS
bool ok = loadAmdGpuIdsInc(deviceId, revisionId, gpu);
if (ok) return;
#endif
return parseAmdGpuIdsFile(deviceId, revisionId, gpu);
}
+1 -6
View File
@@ -1,5 +1,4 @@
#include "gpu.h"
#include "common/properties.h"
#include "common/io/io.h"
#include "common/processing.h"
@@ -65,11 +64,7 @@ const char* ffDetectGPUImpl(FF_MAYBE_UNUSED const FFGPUOptions* options, FFlist*
gpu->frequency = FF_GPU_FREQUENCY_UNSET;
if (gpu->vendor.chars == FF_GPU_VENDOR_NAME_AMD)
{
char query[32];
snprintf(query, ARRAY_SIZE(query), "%X,\t%X,", (unsigned) deviceId, (unsigned) revision);
ffParsePropFileData("libdrm/amdgpu.ids", query, &gpu->name);
}
ffGPUQueryAmdGpuName((uint16_t) deviceId, (uint8_t) revision, gpu);
if (gpu->name.length == 0)
{
@@ -0,0 +1,34 @@
#include "initsystem.h"
#include "util/stringUtils.h"
#include "util/haiku/version.h"
#include "common/io/io.h"
#include <OS.h>
#include <unistd.h>
const char* ffDetectInitSystem(FFInitSystemResult* result)
{
// Since it runs first, registrar does not know about it,
// so we can't query be_roster for it.
const char* path = "/boot/system/servers/launch_daemon";
if (!ffPathExists(path, FF_PATHTYPE_FILE))
return "launch_daemon is not found";
ffStrbufSetStatic(&result->exe, path);
ffStrbufSetStatic(&result->name, "launch_daemon");
team_info teamInfo;
int32 cookie = 0;
while (get_next_team_info(&cookie, &teamInfo) == B_OK)
{
if (ffStrEquals(teamInfo.args, path))
{
result->pid = (uint32_t) teamInfo.team;
break;
}
}
ffGetFileVersion(path, &result->version);
return NULL;
}
+27
View File
@@ -0,0 +1,27 @@
extern "C" {
#include "keyboard.h"
}
#include <interface/Input.h>
#include <support/List.h>
const char* ffDetectKeyboard(FFlist* devices /* List of FFKeyboardDevice */)
{
BList list;
if (get_input_devices(&list) != B_OK)
return "get_input_devices() failed";
for (int32 i = 0, n = list.CountItems(); i < n; i++)
{
BInputDevice *device = (BInputDevice *) list.ItemAt(i);
if (device->Type() != B_KEYBOARD_DEVICE || !device->IsRunning())
continue;
FFKeyboardDevice* item = (FFKeyboardDevice*) ffListAdd(devices);
ffStrbufInit(&item->serial);
ffStrbufInitS(&item->name, device->Name());
}
return NULL;
}
+27
View File
@@ -0,0 +1,27 @@
extern "C" {
#include "mouse.h"
}
#include <interface/Input.h>
#include <support/List.h>
const char* ffDetectMouse(FFlist* devices /* List of FFMouseDevice */)
{
BList list;
if (get_input_devices(&list) != B_OK)
return "get_input_devices() failed";
for (int32 i = 0, n = list.CountItems(); i < n; i++)
{
BInputDevice *device = (BInputDevice *) list.ItemAt(i);
if (device->Type() != B_POINTING_DEVICE || !device->IsRunning())
continue;
FFMouseDevice* item = (FFMouseDevice*) ffListAdd(devices);
ffStrbufInit(&item->serial);
ffStrbufInitS(&item->name, device->Name());
}
return NULL;
}
-2
View File
@@ -2,8 +2,6 @@
#include "common/time.h"
const char* ffNetIOGetIoCounters(FFlist* result, FFNetIOOptions* options);
static FFlist ioCounters1;
static uint64_t time1;
+1
View File
@@ -17,3 +17,4 @@ typedef struct FFNetIOResult
} FFNetIOResult;
const char* ffDetectNetIO(FFlist* result, FFNetIOOptions* options);
const char* ffNetIOGetIoCounters(FFlist* result, FFNetIOOptions* options);
+49
View File
@@ -0,0 +1,49 @@
extern "C" {
#include "netio.h"
#include "common/netif/netif.h"
}
#include <NetworkInterface.h>
#include <NetworkRoster.h>
const char* ffNetIOGetIoCounters(FFlist* result, FFNetIOOptions* options)
{
BNetworkRoster& roster = BNetworkRoster::Default();
BNetworkInterface interface;
uint32 cookie = 0;
uint32_t defaultRouteIfIndex = ffNetifGetDefaultRouteIfIndex();
while (roster.GetNextInterface(&cookie, interface) == B_OK)
{
if (!interface.Exists())
continue;
bool defaultRoute = interface.Index() == defaultRouteIfIndex;
if (options->defaultRouteOnly && !defaultRoute)
continue;
if (options->namePrefix.length && strncmp(interface.Name(), options->namePrefix.chars, options->namePrefix.length) != 0)
continue;
ifreq_stats stats = {};
if (interface.GetStats(stats) != B_OK) continue;
FFNetIOResult* counters = (FFNetIOResult*) ffListAdd(result);
*counters = (FFNetIOResult) {
.name = ffStrbufCreateS(interface.Name()),
.defaultRoute = defaultRoute,
.txBytes = stats.send.bytes,
.rxBytes = stats.receive.bytes,
.txPackets = stats.send.packets,
.rxPackets = stats.receive.packets,
.rxErrors = stats.receive.errors,
.txErrors = stats.send.errors,
.rxDrops = stats.receive.dropped,
.txDrops = stats.send.dropped
};
}
return NULL;
}
+39
View File
@@ -0,0 +1,39 @@
#include <OpenGLKit.h>
extern "C" {
#include "opengl.h"
#include "common/io/io.h"
#if FF_HAVE_EGL
const char* ffOpenGLDetectByEGL(FFOpenGLResult* result);
#endif
void ffOpenGLHandleResult(FFOpenGLResult* result, __typeof__(&glGetString) ffglGetString);
}
static const char* oglDetectOpenGL(FFOpenGLResult* result)
{
BApplication app("application/x-vnd.fastfetch-cli-fastfetch");
FF_SUPPRESS_IO();
BGLView glView(BRect(), "ff_ogl_view", B_FOLLOW_NONE, B_WILL_DRAW, BGL_RGB);
auto ffglGetString = (decltype(&glGetString)) glView.GetGLProcAddress("glGetString");
if (!ffglGetString) return "glView.GetGLProcAddress() failed";
ffOpenGLHandleResult(result, ffglGetString);
ffStrbufSetStatic(&result->library, "OpenGLKit");
return NULL;
}
const char* ffDetectOpenGL(FFOpenGLOptions* options, FFOpenGLResult* result)
{
if (options->library == FF_OPENGL_LIBRARY_AUTO)
return oglDetectOpenGL(result);
else if (options->library == FF_OPENGL_LIBRARY_EGL)
{
#if FF_HAVE_EGL
return ffOpenGLDetectByEGL(result);
#else
return "fastfetch was compiled without egl support";
#endif
}
else
return "Unsupported OpenGL library";
}
+62 -9
View File
@@ -1,20 +1,73 @@
#include "os.h"
#include "common/io/io.h"
#include <OS.h>
#include <image.h>
void ffDetectOSImpl(FFOSResult* os)
{
system_info info;
ffStrbufSetStatic(&os->name, "Haiku");
ffStrbufSetStatic(&os->prettyName, "Haiku");
ffStrbufSetStatic(&os->id, "haiku");
if (get_system_info(&info) != B_OK)
return;
ffStrbufAppendF(&os->version, "R%lld", info.kernel_version);
image_info image;
int32 cookie = 0;
while (get_next_image_info(B_SYSTEM_TEAM, &cookie, &image) == B_OK)
{
int32 ver = image.api_version;
if (ver == 0) continue;
// TODO: check kernel resources?
// https://github.com/haiku/haiku/blob/e63683b2fb337d2034059a7e053c170eaf978142/headers/os/BeBuild.h#L36
if (ver < B_HAIKU_VERSION_1_ALPHA_1)
{
switch (ver)
{
case B_HAIKU_VERSION_BEOS:
ffStrbufSetStatic(&os->version, "BEOS");
break;
case B_HAIKU_VERSION_BONE:
ffStrbufSetStatic(&os->version, "BONE");
break;
case B_HAIKU_VERSION_DANO:
ffStrbufSetStatic(&os->version, "DANO");
break;
}
}
else
{
int32 relVer = ver / 0x10000;
ver %= 0x10000;
if (ver == 0)
{
ffStrbufSetF(&os->version, "R%d", relVer);
}
else
{
relVer++;
bool isPre = !!(ver & 1);
if (ver < B_HAIKU_VERSION_1_PRE_BETA_1)
{
int32 alphaVer = ver / 0x100;
if (isPre)
ffStrbufSetF(&os->version, "R%dA%d-", relVer, alphaVer + 1);
else
ffStrbufSetF(&os->version, "R%dA%d", relVer, alphaVer);
}
else if (ver < 0x00010000 /* B_HAIKU_VERSION_1 */)
{
int32 betaVer = (ver - B_HAIKU_VERSION_1_ALPHA_4) / 0x100;
if (isPre)
ffStrbufSetF(&os->version, "R%dB%d-", relVer, betaVer + 1);
else
ffStrbufSetF(&os->version, "R%dB%d", relVer, betaVer);
}
}
}
}
if (!os->version.length)
{
system_info sys;
if (get_system_info(&sys) == B_OK)
ffStrbufAppendF(&os->version, "R%ldx", sys.kernel_version);
}
}
+6 -1
View File
@@ -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"))
{
@@ -261,7 +266,7 @@ static void detectOS(FFOSResult* os)
return;
#endif
if(instance.config.general.escapeBedrock && parseOsRelease(FASTFETCH_TARGET_DIR_ROOT "/bedrock" FASTFETCH_TARGET_DIR_ETC "/bedrock-release", os))
if(parseOsRelease(FASTFETCH_TARGET_DIR_ROOT "/bedrock" FASTFETCH_TARGET_DIR_ETC "/bedrock-release", os))
{
if(os->id.length == 0)
ffStrbufAppendS(&os->id, "bedrock");
+3
View File
@@ -18,6 +18,8 @@ typedef struct FFPackagesResult
uint32_t guixHome;
uint32_t guixSystem;
uint32_t guixUser;
uint32_t hpkgSystem;
uint32_t hpkgUser;
uint32_t linglong;
uint32_t lpkg;
uint32_t lpkgbuild;
@@ -30,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;
+5 -4
View File
@@ -6,8 +6,9 @@ void ffDetectPackagesImpl(FFPackagesResult* result, FFPackagesOptions* options)
{
// TODO: Use the Package Kit C++ API instead (would account for disabled packages)
if (!(options->disabled & FF_PACKAGES_FLAG_PKG_BIT))
result->pkg = ffPackagesGetNumElements(FASTFETCH_TARGET_DIR_ROOT "/system/packages", false);
if (!(options->disabled & FF_PACKAGES_FLAG_PKGSRC_BIT))
result->pkgsrc = ffPackagesGetNumElements(FASTFETCH_TARGET_DIR_ROOT "/boot/home/config/packages", false);
if (!(options->disabled & FF_PACKAGES_FLAG_HPKG_BIT))
{
result->hpkgSystem = ffPackagesGetNumElements(FASTFETCH_TARGET_DIR_ROOT "/system/packages", false);
result->hpkgUser = ffPackagesGetNumElements(FASTFETCH_TARGET_DIR_ROOT "/boot/home/config/packages", false);
}
}
+1
View File
@@ -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)
@@ -0,0 +1,91 @@
#include "physicaldisk.h"
#include "common/io/io.h"
#include "util/stringUtils.h"
#include <OS.h>
#include <StorageDefs.h>
#include <Drivers.h>
#include <sys/ioctl.h>
static const char* detectDisk(FFstrbuf* path, const char* diskType, FFlist* result)
{
FF_AUTO_CLOSE_FD int rawfd = open(path->chars, O_RDONLY);
if (rawfd < 0) return "detectDisk: open(rawfd) failed";
device_geometry geometry;
if (ioctl(rawfd, B_GET_GEOMETRY, &geometry, sizeof(geometry)) < 0)
return "ioctl(B_GET_GEOMETRY) failed";
char name[B_OS_NAME_LENGTH];
if (ioctl(rawfd, B_GET_DEVICE_NAME, name, sizeof(name)) != 0)
{
// ioctl reports `not a tty` for NVME drives for some reason
snprintf(name, sizeof(name), "Unknown %s drive", diskType);
}
FFPhysicalDiskResult* device = (FFPhysicalDiskResult*) ffListAdd(result);
ffStrbufInitS(&device->name, name);
ffStrbufInitCopy(&device->devPath, path);
ffStrbufInit(&device->serial);
ffStrbufInit(&device->revision);
ffStrbufInitS(&device->interconnect, diskType);
device->temperature = FF_PHYSICALDISK_TEMP_UNSET;
device->type = FF_PHYSICALDISK_TYPE_NONE;
device->type |= (geometry.read_only ? FF_PHYSICALDISK_TYPE_READONLY : FF_PHYSICALDISK_TYPE_READWRITE) |
(geometry.removable ? FF_PHYSICALDISK_TYPE_REMOVABLE : FF_PHYSICALDISK_TYPE_FIXED);
device->size = (uint64_t) geometry.cylinder_count * geometry.head_count * geometry.sectors_per_track * geometry.bytes_per_sector;
return NULL;
}
static const char* searchRawDeviceFile(FFstrbuf* path, const char* diskType, FFlist* result)
{
FF_AUTO_CLOSE_DIR DIR* dir = opendir(path->chars);
if (!dir) return "detectDiskType: opendir() failed";
uint32_t baseLen = path->length;
struct dirent* entry;
while((entry = readdir(dir)))
{
if (entry->d_name[0] == '.') continue;
ffStrbufAppendC(path, '/');
ffStrbufAppendS(path, entry->d_name);
struct stat st;
if (stat(path->chars, &st) != 0)
{
ffStrbufSubstrBefore(path, baseLen);
continue;
}
if (S_ISDIR(st.st_mode))
searchRawDeviceFile(path, diskType, result);
else if (ffStrEquals(entry->d_name, "raw"))
detectDisk(path, diskType, result);
ffStrbufSubstrBefore(path, baseLen);
}
return NULL;
}
const char* ffDetectPhysicalDisk(FFlist* result, FF_MAYBE_UNUSED FFPhysicalDiskOptions* options)
{
FF_AUTO_CLOSE_DIR DIR* dir = opendir("/dev/disk");
if (!dir) return "opendir(/dev/disk) failed";
FF_STRBUF_AUTO_DESTROY path = ffStrbufCreateA(64);
ffStrbufAppendS(&path, "/dev/disk/");
uint32_t baseLen = path.length;
struct dirent* entry;
while((entry = readdir(dir)))
{
if (entry->d_name[0] == '.' || ffStrEquals(entry->d_name, "virtual")) continue;
ffStrbufAppendS(&path, entry->d_name);
searchRawDeviceFile(&path, entry->d_name, result);
ffStrbufSubstrBefore(&path, baseLen);
}
return NULL;
}
+87
View File
@@ -0,0 +1,87 @@
extern "C"
{
#include "sound.h"
#include "util/stringUtils.h"
}
#include <MediaAddOn.h>
#include <MediaNode.h>
#include <MediaRoster.h>
#include <ParameterWeb.h>
const char* ffDetectSound(FFlist* devices /* List of FFSoundDevice */)
{
BMediaRoster* roster = BMediaRoster::Roster();
media_node mediaNode;
live_node_info liveInfo;
dormant_node_info dormantInfo;
if (roster->GetAudioOutput(&mediaNode) != B_OK)
return NULL;
FFSoundDevice* device = (FFSoundDevice*)ffListAdd(devices);
ffStrbufInit(&device->identifier);
if (roster->GetDormantNodeFor(mediaNode, &dormantInfo) == B_OK)
ffStrbufAppendS(&device->identifier, dormantInfo.name);
ffStrbufInit(&device->name);
if (roster->GetLiveNodeInfo(mediaNode, &liveInfo) == B_OK)
{
ffStrbufAppendS(&device->name, liveInfo.name);
ffStrbufTrimRightSpace(&device->name);
}
ffStrbufInitStatic(&device->platformApi, "MediaKit");
// We'll check the Mixer actually
device->volume = 0;
device->active = true;
device->main = true;
roster->ReleaseNode(mediaNode);
media_node mixer;
if (roster->GetAudioMixer(&mixer) != B_OK)
return NULL;
BParameterWeb *web;
status_t status = roster->GetParameterWebFor(mixer, &web);
roster->ReleaseNode(mixer); // the web is all we need :-)
if (status != B_OK)
return NULL;
BContinuousParameter *gain = NULL;
BParameter *mute = NULL;
BParameter *parameter;
for (int32 index = 0; (parameter = web->ParameterAt(index)) != NULL; index++)
{
// assume the mute preceding master gain control
if (ffStrEquals(parameter->Kind(), B_MUTE))
mute = parameter;
if (ffStrEquals(parameter->Kind(), B_MASTER_GAIN))
{
// Can not use dynamic_cast due to fno-rtti
//gain = dynamic_cast<BContinuousParameter *>(parameter);
gain = (BContinuousParameter *)(parameter);
break;
}
}
if (gain == NULL)
return NULL;
bigtime_t when;
size_t size;
if (mute)
{
int32 isMute = false;
size = sizeof(isMute);
if (mute->GetValue(&isMute, &size, &when) == B_OK && isMute)
return NULL;
}
float volume = 0.0;
size = sizeof(volume);
if (gain->GetValue(&volume, &size, &when) == B_OK)
device->volume = (uint8_t) (100 * (volume - gain->MinValue()) / (gain->MaxValue() - gain->MinValue()));
return NULL;
}
+1 -1
View File
@@ -18,7 +18,7 @@ static void paSinkInfoCallback(pa_context *c, const pa_sink_info *i, int eol, vo
ffStrbufInitS(&device->name, i->description);
ffStrbufTrimRightSpace(&device->name);
ffStrbufTrimLeft(&device->name, ' ');
device->volume = i->mute ? 0 : (uint8_t) (i->volume.values[0] * 100 / PA_VOLUME_NORM);
device->volume = i->mute ? 0 : (uint8_t) ((i->volume.values[0] * 100 + PA_VOLUME_NORM / 2 /*round*/) / PA_VOLUME_NORM);
device->active = i->active_port && i->active_port->available != PA_PORT_AVAILABLE_NO;
device->main = false;
}
+1 -1
View File
@@ -41,7 +41,7 @@ const char* ffDetectSound(FFlist* devices)
ffStrbufInitS(&device->name, ad.name);
ffStrbufTrimRightSpace(&device->name);
ffStrbufInitF(&device->platformApi, "%s", "SunAudio");
device->volume = (uint8_t) (ai.play.gain * 100 / AUDIO_MAX_GAIN);
device->volume = (uint8_t) ((ai.play.gain * 100 + AUDIO_MAX_GAIN / 2) / AUDIO_MAX_GAIN);
device->active = true;
device->main = defaultDev == idev;
}
+1 -1
View File
@@ -80,7 +80,7 @@ const char* ffDetectSound(FFlist* devices)
if (!bundle.mute[i])
totalLevel += bundle.level[i];
}
device->volume = (uint8_t) (totalLevel * 100 / bundle.iLevel);
device->volume = (uint8_t) ((totalLevel * 100 + bundle.iLevel / 2) / bundle.iLevel);
return NULL;
}
@@ -418,6 +418,21 @@ static void detectWestonTerminal(FFTerminalFontResult* terminalFont)
ffFontInitValues(&terminalFont->font, font.chars, size.chars);
}
#ifdef __HAIKU__
static void detectHaikuTerminal(FFTerminalFontResult* terminalFont)
{
FF_STRBUF_AUTO_DESTROY font = ffStrbufCreate();
FF_STRBUF_AUTO_DESTROY size = ffStrbufCreate();
ffParsePropFileConfigValues("Terminal/Default", 2, (FFpropquery[]) {
{"\"Half Font Family\" , ", &font},
{"\"Half Font Size\" , ", &size},
});
if (!font.length) ffStrbufSetStatic(&font, "Noto Sans Mono");
if (!size.length) ffStrbufSetStatic(&size, "12");
ffFontInitValues(&terminalFont->font, font.chars, size.chars);
}
#endif
void ffDetectTerminalFontPlatform(const FFTerminalResult* terminal, FFTerminalFontResult* terminalFont)
{
if(ffStrbufIgnCaseEqualS(&terminal->processName, "konsole"))
@@ -455,5 +470,11 @@ void ffDetectTerminalFontPlatform(const FFTerminalResult* terminal, FFTerminalFo
else if(ffStrbufStartsWithIgnCaseS(&terminal->processName, "terminator"))
detectTerminator(terminalFont);
else if(ffStrbufStartsWithIgnCaseS(&terminal->processName, "sakura"))
detectFromConfigFile("sakura/sakura.conf", "font=", terminalFont);;
detectFromConfigFile("sakura/sakura.conf", "font=", terminalFont);
#ifdef __HAIKU__
else if(ffStrbufStartsWithIgnCaseS(&terminal->processName, "Terminal"))
detectHaikuTerminal(terminalFont);
#endif
else if(ffStrbufStartsWithIgnCaseS(&terminal->processName, "termite"))
detectFromConfigFile("termite/config", "font =", terminalFont);
}
+25 -1
View File
@@ -27,6 +27,8 @@ static bool getFileVersion(const FFstrbuf* exePath, FFstrbuf* version)
if (len <= 0) return false;
return ffGetFileVersion(exePathW, version);
}
#elif __HAIKU__
#include "util/haiku/version.h"
#endif
static bool getExeVersionRaw(FFstrbuf* exe, FFstrbuf* version)
@@ -705,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
@@ -747,7 +763,7 @@ bool fftsGetTerminalVersion(FFstrbuf* processName, FF_MAYBE_UNUSED FFstrbuf* exe
#endif
#if defined(__linux__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__sun) || defined(__NetBSD__)
#if defined(__linux__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__sun) || defined(__NetBSD__) || defined(__HAIKU__)
if(ffStrbufStartsWithIgnCaseS(processName, "gnome-terminal"))
return getTerminalVersionGnome(exe, version);
@@ -810,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
@@ -847,6 +866,11 @@ bool fftsGetTerminalVersion(FFstrbuf* processName, FF_MAYBE_UNUSED FFstrbuf* exe
if(ffStrbufStartsWithIgnCaseS(processName, "zed"))
return getTerminalVersionZed(exe, version);
#if __HAIKU__
if(ffStrbufEqualS(processName, "Terminal"))
return ffGetFileVersion(exe->chars, version);
#endif
const char* termProgramVersion = getenv("TERM_PROGRAM_VERSION");
if(termProgramVersion)
{
@@ -359,6 +359,11 @@ static void setTerminalInfoDetails(FFTerminalResult* result)
else if(ffStrbufEqualS(&result->processName, "WarpTerminal"))
ffStrbufInitStatic(&result->prettyName, "Warp");
#elif defined(__HAIKU__)
else if(ffStrbufEqualS(&result->processName, "Terminal"))
ffStrbufInitStatic(&result->prettyName, "Haiku Terminal");
#endif
else if(strncmp(result->exeName, result->processName.chars, result->processName.length) == 0) // if exeName starts with processName, print it. Otherwise print processName
+2 -4
View File
@@ -1,11 +1,9 @@
#include "uptime.h"
#include "common/time.h"
#include <OS.h>
const char* ffDetectUptime(FFUptimeResult* result)
{
result->uptime = system_time() / 1000;
result->bootTime = (real_time_clock_usecs() / 1000) - result->uptime;
result->uptime = (uint64_t) system_time() / 1000;
result->bootTime = ffTimeGetNow() - result->uptime;
return NULL;
}
+12 -2
View File
@@ -4,6 +4,8 @@
#define FF_ARCHITECTURE "x86_64"
#elif defined(__i386__)
#define FF_ARCHITECTURE "i386"
#elif defined(__ia64__)
#define FF_ARCHITECTURE "ia64"
#elif defined(__aarch64__)
#define FF_ARCHITECTURE "aarch64"
#elif defined(__arm__)
@@ -18,8 +20,16 @@
#define FF_ARCHITECTURE "s390x"
#elif defined(__loongarch__)
#define FF_ARCHITECTURE "loongarch"
#elif defined(__sparc__)
#define FF_ARCHITECTURE "sparc"
#elif defined(__alpha__)
#define FF_ARCHITECTURE "alpha"
#elif defined(__hppa__)
#define FF_ARCHITECTURE "hppa"
#elif defined(__m68k__)
#define FF_ARCHITECTURE "m68k"
#else
#define FF_ARCHITECTURE "unknown"
#define FF_ARCHITECTURE "Unknown"
#endif
#if defined(__ANDROID__)
@@ -45,7 +55,7 @@
#elif defined(__HAIKU__)
#define FF_SYSNAME "Haiku"
#else
#define FF_SYSNAME "unknown"
#define FF_SYSNAME "Unknown"
#endif
#define FF_STR_INDIR(x) #x
+11
View File
@@ -19,6 +19,17 @@ void ffPrepareWeather(FFWeatherOptions* options)
ffStrbufAppend(&path, &options->location);
ffStrbufAppendS(&path, "?format=");
ffStrbufAppend(&path, &options->outputFormat);
switch (instance.config.display.tempUnit)
{
case FF_TEMPERATURE_UNIT_CELSIUS:
ffStrbufAppendS(&path, "&m");
break;
case FF_TEMPERATURE_UNIT_FAHRENHEIT:
ffStrbufAppendS(&path, "&u");
break;
default:
break;
}
status = ffNetworkingSendHttpRequest(&state, "wttr.in", path.chars, "User-Agent: curl/0.0.0\r\n");
}
+2 -2
View File
@@ -1,7 +1,7 @@
##############
##############
######################
##########################
##+$2###$1#######################
##+$2####$1#######################
#####$2#$1*$2###%+$1######################
########$2%$1*#$2%#####$1###################
##########$2##$1*#*$2#######%+$1##############
+6
View File
@@ -0,0 +1,6 @@
_________
| __ |
| \ \___ |
| \ _ \ |
| \___/ |
|_________|
+11
View File
@@ -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│
╰───────────────────────╯
+6 -6
View File
@@ -1,12 +1,12 @@
$3 MMMM MMMM
MMMM MMMM
MMMM MMMM
MMMM MMMM
MMMM$4 .ciO| /YMMMMM*"
$3 MMMM$4 .cOMMMMM|/MMMMM/`
MMMM MMMM
MMMM$2 .ciO| /YMMMMM*"
$1 MMMM$2 .cOMMMMM|/MMMMM/`
, ,iMM|/MMMMMMMMMMMMMMM*
`*.__,-cMMMMMMMMMMMMMMMMM/`$3.MMM
MM$4MMMMMMM/`:MMM/ $3MMMM
`*.__,-cMMMMMMMMMMMMMMMMM/`$1.MMM
MM$2MMMMMMM/`:MMM/ $1MMMM
MMMM MMMM
MMMM MMMM
"""" """"
"""" """"
+17
View File
@@ -0,0 +1,17 @@
${c2} :dc'
'l:;'${c1},${c2}'ck. .;dc:.
co ${c1}..${c2}k. .;; ':o.
co ${c1}..${c2}k. ol ${c1}.${c2}0.
co ${c1}..${c2}k. oc ${c1}..${c2}0.
co ${c1}..${c2}k. oc ${c1}..${c2}0.
.Ol,. co ${c1}...''${c2}Oc;kkodxOdddOoc,.
';lxxlxOdxkxk0kd${c1}oooll${c2}dl${c1}ccc:${c2}clxd;
..${c1}oOolllllccccccc:::::${c2}od;
cx:ooc${c1}:::::::;${c2}cooolcX.
cd${c1}.${c2}''cloxdoollc' ${c1}...${c2}0.
cd${c1}......${c2}k;${c1}.${c2}xl${c1}.... .${c2}0.
.::c${c1};..${c2}cx;${c1}.${c2}xo${c1}..... .${c2}0.
'::c'${c1}...${c2}do${c1}..... .${c2}K,
cd,.${c1}....:${c2}O,${c1}
':clod:'${c1}
${c1}
@@ -0,0 +1,9 @@
.oooo.
o o o
ooooo oo
o oo
'oooooooooooo.
oo o
oo ooooo
o o o
'oooo'
+18 -20
View File
@@ -1,20 +1,18 @@
ROSAROSAROSAROSAR
ROSA AROS
ROS SAROSAROSAROSAR AROS
RO ROSAROSAROSAROSAROSAR RO
ARO AROSAROSAROSARO AROS ROS
ARO ROSAROS OSAR ROSA ROS
RO AROSA ROSAROSAROSA ROSAR RO
RO ROSAR ROSAROSAROSAR R ROSARO RO
RO ROSA AROSAROSAROSA AR ROSARO AR
RO AROS ROSAROSAROSA ROS AROSARO AR
RO AROS ROSAROSARO ROSARO ROSARO AR
RO ROS AROSAROS ROSAROSA AROSAR AR
RO ROSA ROS ROSAROSAR ROSARO RO
RO ROS AROSAROSAROSA ROSARO AR
ARO ROSA ROSAROSAROS AROSAR ARO
ARO OROSA R ROSAROS ROS
RO AROSAROS AROSAROSAR RO
AROS AROSAROSAROSARO AROS
ROSA SARO
ROSAROSAROSAROSAR
${c2} ⢀⣀⣤⣤⣤⣤⣤⣤⣤⣤⣤⣤⣤⣤⣤⣤⣤⣤⣤⣤⣤⣄
${c2} ⠈⠻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡇
${c1} ⢀⣤⣄ ${c2}⣿⣿⣿⡇
${c1} ⢀⣴⣿⣿⣿⠗ ${c2}⣿⣿⣿⡇
${c1} ⢠⣾⣿⣿⡿⠁ ${c2}⣿⣿⣿⡇
${c1} ⢠⣿⣿⣿⡟ ${c2}⣿⣿⣿⡇
${c1}⢀⣿⣿⣿⡿ ${c2}⣿⣿⣿⡇
${c1}⢸⣿⣿⣿⠃ ${c2}⣿⣿⣿⡇
${c1}⢸⣿⣿⣿ ${c2}⣿⣿⣿⡇
${c1}⢸⣿⣿⣿ ${c2}⣿⣿⣿⡇
${c1}⢸⣿⣿⣿⡄ ${c2}⠙⢿⡿
${c1}⠘⣿⣿⣿⣷
⠘⣿⣿⣿⣦
⠙⣿⣿⣿⣷⡀ ⢀⡀
⠘⢿⣿⣿⣿⣦⣄ ⣠⣴⣿⣿⡦
⠙⢿⣿⣿⣿⣷⣦⣀⣀⡀ ⢀⣀⣠⣴⣾⣿⣿⣿⠟⠁
⠈⠙⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠟⠋⠁
⠈⠙⠛⠿⠿⠿⠿⠿⠿⠟⠛⠋⠁
+20
View File
@@ -0,0 +1,20 @@
'
'#'
'#!#'
'#!#!#'
'#!#!#!#'
'#!#!#!#!#'
'#!#!#!#!#!#'
'#!#!#!#!#!#!#'
#!#!#!#!#!#!'
'#! #!#!#!#!#'
'#!#!#!#! #!#!#!'
'#!#!#!#!#!#!#! #!#!'
'#!#!#!#!#!#!#!#!#!#! #'
'#!#!#!#!#!#!#!#!#!#!#!#!
'#!#!#!#!#!#!#!#!#!#! #!'
'#!#!#!#!#!#!#!#! #!#!#!'
'#!#!#!#!#!#! #!#!#!#!#!'
'#!#!#!#! #!#!#!#!#'
'#!#! #!#!#'
'# #!'
+128 -106
View File
@@ -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",
@@ -954,9 +965,9 @@ static const FFlogo C[] = {
.colorKeys = FF_COLOR_FG_GREEN,
.colorTitle = FF_COLOR_FG_WHITE,
},
// Chimera Linux
// Chimera
{
.names = {"Chimera Linux"},
.names = {"Chimera"},
.lines = FASTFETCH_DATATEXT_LOGO_CHIMERA_LINUX,
.colors = {
FF_COLOR_FG_RED,
@@ -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 = {
@@ -2006,17 +2033,26 @@ static const FFlogo H[] = {
.names = {"Haiku"},
.lines = FASTFETCH_DATATEXT_LOGO_HAIKU,
.colors = {
FF_COLOR_FG_RED,
FF_COLOR_FG_YELLOW,
FF_COLOR_FG_DEFAULT,
FF_COLOR_FG_GREEN,
},
.colorKeys = FF_COLOR_FG_RED,
.colorTitle = FF_COLOR_FG_YELLOW,
},
// Haiku2
{
.names = {"Haiku2"},
.lines = FASTFETCH_DATATEXT_LOGO_HAIKU2,
.colors = {
FF_COLOR_FG_GREEN,
FF_COLOR_FG_DEFAULT,
},
.colorKeys = FF_COLOR_FG_RED,
.colorTitle = FF_COLOR_FG_YELLOW,
},
// HaikuSmall
{
.names = {"Haiku-small"},
.names = {"Haiku_small"},
.type = FF_LOGO_LINE_TYPE_SMALL_BIT,
.lines = FASTFETCH_DATATEXT_LOGO_HAIKU_SMALL,
.colors = {
@@ -2466,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,
@@ -2549,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,
@@ -2561,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,
@@ -2573,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,
@@ -2801,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,
@@ -2811,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 = {
@@ -2915,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"},
@@ -3087,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,
@@ -3096,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 = {
@@ -3106,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 = {
@@ -3116,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 = {
@@ -3260,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 = {
@@ -3330,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,
@@ -3338,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,
@@ -3348,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 = {
@@ -3367,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 = {
@@ -3675,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,
@@ -4056,10 +4068,11 @@ static const FFlogo R[] = {
.names = {"rosa", "rosa-linux", "rosalinux"},
.lines = FASTFETCH_DATATEXT_LOGO_ROSA,
.colors = {
FF_COLOR_FG_BLUE,
FF_COLOR_FG_RGB "250;250;250",
FF_COLOR_FG_RGB "100;165;225",
},
.colorKeys = FF_COLOR_FG_BLUE,
.colorTitle = FF_COLOR_FG_BLUE,
.colorKeys = FF_COLOR_FG_RGB "100;165;225",
.colorTitle = FF_COLOR_FG_RGB "100;165;225",
},
// RhinoLinux
{
@@ -4219,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"},
@@ -4599,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 = {
@@ -4634,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 = {
@@ -4841,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,
@@ -4851,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 = {
@@ -4862,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 = {
@@ -4913,7 +4935,7 @@ static const FFlogo V[] = {
},
// Void
{
.names = {"void", "void-linux"},
.names = {"void"},
.lines = FASTFETCH_DATATEXT_LOGO_VOID,
.colors = {
FF_COLOR_FG_GREEN,
@@ -4924,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 = {
@@ -4935,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 = {
@@ -4986,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 = {
@@ -5121,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,
+39
View File
@@ -0,0 +1,39 @@
<!-- Fastfetch Logo -->
<svg width="400" height="400" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 400 400">
<!-- Terminal border -->
<rect x="0" y="0" width="400" height="400" rx="15" ry="15" fill="#282c34" stroke="#3498db"
stroke-width="3" />
<!-- Title bar of terminal -->
<g>
<!-- Background -->
<path d="M15,0 h370 a15,15 0 0 1 15,15 v25 h-400 v-25 a15,15 0 0 1 15,-15 z" fill="#3498db" opacity="0.2" />
<text x="190" y="28" font-family="Arial, sans-serif" font-size="20" font-weight="bold" fill="#ecf0f1">FASTFETCH</text>
<!-- Close btn -->
<circle cx="25" cy="20" r="7" fill="#e74c3c" />
<!-- Minimize btn -->
<circle cx="45" cy="20" r="7" fill="#f1c40f" />
<!-- Maximize btn -->
<circle cx="65" cy="20" r="7" fill="#2ecc71" />
<!-- Bottom border of title bar -->
<line x1="0" y1="40" x2="400" y2="40" stroke="#3498db" stroke-width="2" />
</g>
<!-- Rocket icon -->
<g>
<path d="M94.25,73.59 L139.99,142.20 L48.52,142.20 Z" fill="#e74c3c" />
<rect x="48.52" y="142.20" width="91.48" height="141.75" fill="#ecf0f1" />
<rect x="57.66" y="172.50" width="73.19" height="45.74" fill="#95a5a6" />
<path d="M57.66,328.89 L71.39,374.63 L89.68,328.89 Z" fill="#e67e22" />
<path d="M98.83,328.89 L117.12,374.63 L130.85,328.89 Z" fill="#e67e22" />
<rect x="48.52" y="283.15" width="91.48" height="45.74" fill="#7f8c8d" />
</g>
<!-- System info -->
<g font-family="monospace" font-size="42" fill="#2980b9" transform="translate(190, 102)">
<text y="0">►►►►►►►</text>
<text y="45">►►►►►►</text>
<text y="90">►►►►►</text>
<text y="135">►►►►</text>
<text y="180">►►►</text>
<text y="225">►►</text>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.7 KiB

+1
View File
@@ -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"),
}));
}
+5
View File
@@ -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"},
}))
};
+1 -1
View File
@@ -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);
+4
View File
@@ -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"},
}))
};
+65 -8
View File
@@ -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"},
})),
};
+4 -4
View File
@@ -419,8 +419,8 @@ void ffGenerateLocalIpJsonConfig(FFLocalIpOptions* options, yyjson_mut_doc* doc,
if (defaultOptions.showType != options->showType)
{
if (options->showType & FF_LOCALIP_TYPE_IPV4_BIT)
yyjson_mut_obj_add_bool(doc, module, "showIpv4", true);
if (!(options->showType & FF_LOCALIP_TYPE_IPV4_BIT))
yyjson_mut_obj_add_bool(doc, module, "showIpv4", false);
if (options->showType & FF_LOCALIP_TYPE_IPV6_BIT)
yyjson_mut_obj_add_bool(doc, module, "showIpv6", true);
@@ -446,8 +446,8 @@ void ffGenerateLocalIpJsonConfig(FFLocalIpOptions* options, yyjson_mut_doc* doc,
if (options->showType & FF_LOCALIP_TYPE_COMPACT_BIT)
yyjson_mut_obj_add_bool(doc, module, "compact", true);
if (options->showType & FF_LOCALIP_TYPE_DEFAULT_ROUTE_ONLY_BIT)
yyjson_mut_obj_add_bool(doc, module, "defaultRouteOnly", true);
if (!(options->showType & FF_LOCALIP_TYPE_DEFAULT_ROUTE_ONLY_BIT))
yyjson_mut_obj_add_bool(doc, module, "defaultRouteOnly", false);
if (options->showType & FF_LOCALIP_TYPE_ALL_IPS_BIT)
yyjson_mut_obj_add_bool(doc, module, "showAllIps", true);
+17 -3
View File
@@ -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"),
}));
}
}
+2
View File
@@ -36,6 +36,8 @@ typedef enum __attribute__((__packed__)) FFPackagesFlags
FF_PACKAGES_FLAG_MPORT_BIT = 1 << 26,
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), "");
+25
View File
@@ -51,6 +51,8 @@ void ffPrintPackages(FFPackagesOptions* options)
FF_PRINT_PACKAGE(apk)
FF_PRINT_PACKAGE(pkg)
FF_PRINT_PACKAGE(pkgsrc)
FF_PRINT_PACKAGE_NAME(hpkgSystem, counts.hpkgUser ? "hpkg-system" : "hpkg")
FF_PRINT_PACKAGE_NAME(hpkgUser, "hpkg-user")
FF_PRINT_PACKAGE_NAME(flatpakSystem, counts.flatpakUser ? "flatpak-system" : "flatpak")
FF_PRINT_PACKAGE_NAME(flatpakUser, "flatpak-user")
FF_PRINT_PACKAGE(snap)
@@ -75,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');
}
@@ -84,6 +87,7 @@ void ffPrintPackages(FFPackagesOptions* options)
uint32_t flatpakAll = counts.flatpakSystem + counts.flatpakUser;
uint32_t brewAll = counts.brew + counts.brewCask;
uint32_t guixAll = counts.guixSystem + counts.guixUser + counts.guixHome;
uint32_t hpkgAll = counts.hpkgSystem + counts.hpkgUser;
FF_PRINT_FORMAT_CHECKED(FF_PACKAGES_MODULE_NAME, 0, &options->moduleArgs, FF_PRINT_TYPE_DEFAULT, ((FFformatarg[]){
FF_FORMAT_ARG(counts.all, "all"),
FF_FORMAT_ARG(counts.pacman, "pacman"),
@@ -123,10 +127,14 @@ void ffPrintPackages(FFPackagesOptions* options)
FF_FORMAT_ARG(counts.qi, "qi"),
FF_FORMAT_ARG(counts.amUser, "am-user"),
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"),
FF_FORMAT_ARG(guixAll, "guix-all"),
FF_FORMAT_ARG(hpkgAll, "hpkg-all"),
}));
}
@@ -178,6 +186,9 @@ bool ffParsePackagesCommandOptions(FFPackagesOptions* options, const char* key,
case 'G': if (false);
FF_TEST_PACKAGE_NAME(GUIX)
break;
case 'H': if (false);
FF_TEST_PACKAGE_NAME(HPKG)
break;
case 'L': if (false);
FF_TEST_PACKAGE_NAME(LPKG)
FF_TEST_PACKAGE_NAME(LPKGBUILD)
@@ -197,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)
@@ -293,6 +305,9 @@ void ffParsePackagesJsonObject(FFPackagesOptions* options, yyjson_val* module)
case 'G': if (false);
FF_TEST_PACKAGE_NAME(GUIX)
break;
case 'H': if (false);
FF_TEST_PACKAGE_NAME(HPKG)
break;
case 'L': if (false);
FF_TEST_PACKAGE_NAME(LPKG)
FF_TEST_PACKAGE_NAME(LPKGBUILD)
@@ -312,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)
@@ -365,6 +381,7 @@ void ffGeneratePackagesJsonConfig(FFPackagesOptions* options, yyjson_mut_doc* do
FF_TEST_PACKAGE_NAME(EOPKG)
FF_TEST_PACKAGE_NAME(FLATPAK)
FF_TEST_PACKAGE_NAME(GUIX)
FF_TEST_PACKAGE_NAME(HPKG)
FF_TEST_PACKAGE_NAME(LINGLONG)
FF_TEST_PACKAGE_NAME(LPKG)
FF_TEST_PACKAGE_NAME(LPKGBUILD)
@@ -375,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)
@@ -421,6 +439,8 @@ void ffGeneratePackagesJsonResult(FF_MAYBE_UNUSED FFPackagesOptions* options, yy
FF_APPEND_PACKAGE_COUNT(guixSystem)
FF_APPEND_PACKAGE_COUNT(guixUser)
FF_APPEND_PACKAGE_COUNT(guixHome)
FF_APPEND_PACKAGE_COUNT(hpkgSystem)
FF_APPEND_PACKAGE_COUNT(hpkgUser)
FF_APPEND_PACKAGE_COUNT(linglong)
FF_APPEND_PACKAGE_COUNT(mport)
FF_APPEND_PACKAGE_COUNT(nixDefault)
@@ -430,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)
@@ -491,10 +512,14 @@ static FFModuleBaseInfo ffModuleInfo = {
{"Number of qi packages", "qi"},
{"Number of am-user (aka appman) packages", "am-user"},
{"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"},
{"Total number of all guix packages", "guix-all"},
{"Total number of all hpkg packages", "hpkg-all"},
}))
};
@@ -160,6 +160,7 @@ static FFModuleBaseInfo ffModuleInfo = {
.parseJsonObject = (void*) ffParsePhysicalMemoryJsonObject,
.printModule = (void*) ffPrintPhysicalMemory,
.generateJsonConfig = (void*) ffGeneratePhysicalMemoryJsonConfig,
.generateJsonResult = (void*) ffGeneratePhysicalMemoryJsonResult,
.formatArgs = FF_FORMAT_ARG_LIST(((FFModuleFormatArg[]) {
{"Size (in bytes)", "bytes"},
{"Size formatted", "size"},
+8 -1
View File
@@ -130,6 +130,8 @@ const char* ffOptionsParseDisplayJsonConfig(FFOptionsDisplay* options, yyjson_va
{
int value;
const char* error = ffJsonConfigParseEnum(unit, &value, (FFKeyValuePair[]) {
{ "DEFAULT", FF_TEMPERATURE_UNIT_DEFAULT },
{ "D", FF_TEMPERATURE_UNIT_DEFAULT },
{ "CELSIUS", FF_TEMPERATURE_UNIT_CELSIUS },
{ "C", FF_TEMPERATURE_UNIT_CELSIUS },
{ "FAHRENHEIT", FF_TEMPERATURE_UNIT_FAHRENHEIT },
@@ -418,6 +420,8 @@ bool ffOptionsParseDisplayCommandLine(FFOptionsDisplay* options, const char* key
if(ffStrEqualsIgnCase(subkey, "unit"))
{
options->tempUnit = (FFTemperatureUnit) ffOptionParseEnum(key, value, (FFKeyValuePair[]) {
{ "DEFAULT", FF_TEMPERATURE_UNIT_DEFAULT },
{ "D", FF_TEMPERATURE_UNIT_DEFAULT },
{ "CELSIUS", FF_TEMPERATURE_UNIT_CELSIUS },
{ "C", FF_TEMPERATURE_UNIT_CELSIUS },
{ "FAHRENHEIT", FF_TEMPERATURE_UNIT_FAHRENHEIT },
@@ -513,7 +517,7 @@ void ffOptionsInitDisplay(FFOptionsDisplay* options)
options->keyPaddingLeft = 0;
options->keyType = FF_MODULE_KEY_TYPE_STRING;
options->tempUnit = FF_TEMPERATURE_UNIT_CELSIUS;
options->tempUnit = FF_TEMPERATURE_UNIT_DEFAULT;
options->tempNdigits = 1;
ffStrbufInitStatic(&options->tempColorGreen, FF_COLOR_FG_GREEN);
ffStrbufInitStatic(&options->tempColorYellow, instance.state.terminalLightTheme ? FF_COLOR_FG_YELLOW : FF_COLOR_FG_LIGHT_YELLOW);
@@ -643,6 +647,9 @@ void ffOptionsGenerateDisplayJsonConfig(FFOptionsDisplay* options, yyjson_mut_do
{
switch (options->tempUnit)
{
case FF_TEMPERATURE_UNIT_DEFAULT:
yyjson_mut_obj_add_str(doc, temperature, "unit", "DEFAULT");
break;
case FF_TEMPERATURE_UNIT_CELSIUS:
yyjson_mut_obj_add_str(doc, obj, "unit", "C");
break;
+3 -2
View File
@@ -5,12 +5,13 @@
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
{
FF_TEMPERATURE_UNIT_DEFAULT,
FF_TEMPERATURE_UNIT_CELSIUS,
FF_TEMPERATURE_UNIT_FAHRENHEIT,
FF_TEMPERATURE_UNIT_KELVIN,
+5 -13
View File
@@ -30,9 +30,7 @@ const char* ffOptionsParseGeneralJsonConfig(FFOptionsGeneral* options, yyjson_va
else if (ffStrEqualsIgnCase(key, "detectVersion"))
options->detectVersion = yyjson_get_bool(val);
#if defined(__linux__) || defined(__FreeBSD__) || defined(__sun) || defined(__OpenBSD__) || defined(__NetBSD__)
else if (ffStrEqualsIgnCase(key, "escapeBedrock"))
options->escapeBedrock = yyjson_get_bool(val);
#if defined(__linux__) || defined(__FreeBSD__) || defined(__sun) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__HAIKU__)
else if (ffStrEqualsIgnCase(key, "playerName"))
ffStrbufSetS(&options->playerName, yyjson_get_str(val));
else if (ffStrEqualsIgnCase(key, "dsForceDrm"))
@@ -75,9 +73,7 @@ bool ffOptionsParseGeneralCommandLine(FFOptionsGeneral* options, const char* key
else if(ffStrEqualsIgnCase(key, "--detect-version"))
options->detectVersion = ffOptionParseBoolean(value);
#if defined(__linux__) || defined(__FreeBSD__) || defined(__sun) || defined(__OpenBSD__) || defined(__NetBSD__)
else if(ffStrEqualsIgnCase(key, "--escape-bedrock"))
options->escapeBedrock = ffOptionParseBoolean(value);
#if defined(__linux__) || defined(__FreeBSD__) || defined(__sun) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__HAIKU__)
else if(ffStrEqualsIgnCase(key, "--player-name"))
ffOptionParseString(key, value, &options->playerName);
else if(ffStrEqualsIgnCase(key, "--ds-force-drm"))
@@ -106,8 +102,7 @@ void ffOptionsInitGeneral(FFOptionsGeneral* options)
options->multithreading = true;
options->detectVersion = true;
#if defined(__linux__) || defined(__FreeBSD__) || defined(__sun) || defined(__OpenBSD__) || defined(__NetBSD__)
options->escapeBedrock = true;
#if defined(__linux__) || defined(__FreeBSD__) || defined(__sun) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__HAIKU__)
ffStrbufInit(&options->playerName);
options->dsForceDrm = FF_DS_FORCE_DRM_TYPE_FALSE;
#elif defined(_WIN32)
@@ -117,7 +112,7 @@ void ffOptionsInitGeneral(FFOptionsGeneral* options)
void ffOptionsDestroyGeneral(FF_MAYBE_UNUSED FFOptionsGeneral* options)
{
#if defined(__linux__) || defined(__FreeBSD__)
#if defined(__linux__) || defined(__FreeBSD__) || defined(__sun) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__HAIKU__)
ffStrbufDestroy(&options->playerName);
#endif
}
@@ -135,10 +130,7 @@ void ffOptionsGenerateGeneralJsonConfig(FFOptionsGeneral* options, yyjson_mut_do
if (options->processingTimeout != defaultOptions.processingTimeout)
yyjson_mut_obj_add_int(doc, obj, "processingTimeout", options->processingTimeout);
#if defined(__linux__) || defined(__FreeBSD__)
if (options->escapeBedrock != defaultOptions.escapeBedrock)
yyjson_mut_obj_add_bool(doc, obj, "escapeBedrock", options->escapeBedrock);
#if defined(__linux__) || defined(__FreeBSD__) || defined(__sun) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__HAIKU__)
if (!ffStrbufEqual(&options->playerName, &defaultOptions.playerName))
yyjson_mut_obj_add_strbuf(doc, obj, "playerName", &options->playerName);
+1 -2
View File
@@ -16,9 +16,8 @@ typedef struct FFOptionsGeneral
bool detectVersion;
// Module options that cannot be put in module option structure
#if defined(__linux__) || defined(__FreeBSD__) || defined(__sun) || defined(__OpenBSD__) || defined(__NetBSD__)
#if defined(__linux__) || defined(__FreeBSD__) || defined(__sun) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__HAIKU__)
FFstrbuf playerName;
bool escapeBedrock;
FFDsForceDrmType dsForceDrm;
#elif defined(_WIN32)
int32_t wmiTimeout;
+1 -1
View File
@@ -233,7 +233,7 @@ static inline void ffStrbufInit(FFstrbuf* strbuf)
strbuf->chars = CHAR_NULL_PTR;
}
FF_C_NODISCARD static inline FFstrbuf ffStrbufCreate()
FF_C_NODISCARD static inline FFstrbuf ffStrbufCreate(void)
{
FFstrbuf strbuf;
ffStrbufInit(&strbuf);
+24
View File
@@ -0,0 +1,24 @@
extern "C" {
#include "version.h"
}
#include <File.h>
#include <AppFileInfo.h>
bool ffGetFileVersion(const char* filePath, FFstrbuf* version)
{
BFile f(filePath, B_READ_ONLY);
if (f.InitCheck() != B_OK)
return false;
BAppFileInfo fileInfo(&f);
if (f.InitCheck() != B_OK)
return false;
version_info info;
if (fileInfo.GetVersionInfo(&info, B_SYSTEM_VERSION_KIND) != B_OK)
return false;
ffStrbufSetF(version, "%d.%d.%d", (int)info.major, (int)info.middle, (int)info.minor);
return true;
}

Some files were not shown because too many files have changed in this diff Show More