diff --git a/.github/workflows/build-dragonfly-amd64.yml b/.github/workflows/build-dragonfly-amd64.yml index f4ed8230b1..0a995b36bb 100644 --- a/.github/workflows/build-dragonfly-amd64.yml +++ b/.github/workflows/build-dragonfly-amd64.yml @@ -21,7 +21,7 @@ jobs: prepare: | uname -a pkg update - pkg install -y llvm cmake git pkgconf binutils wayland vulkan-headers vulkan-loader libxcb libXrandr libX11 libdrm glib dconf dbus sqlite3-tcl egl opencl ocl-icd v4l_compat chafa libelf + pkg install -y llvm cmake git pkgconf binutils wayland vulkan-headers vulkan-loader libxcb libXrandr libX11 libdrm glib dconf dbus sqlite3-tcl egl opencl ocl-icd v4l_compat chafa libelf lua54 libva libvdpau run: | env CC=clang cmake -DSET_TWEAK=Off -DBUILD_TESTS=On -DENABLE_EMBEDDED_PCIIDS=On -DENABLE_EMBEDDED_AMDGPUIDS=On . diff --git a/.github/workflows/build-freebsd-amd64.yml b/.github/workflows/build-freebsd-amd64.yml index f43dff038d..9527d08996 100644 --- a/.github/workflows/build-freebsd-amd64.yml +++ b/.github/workflows/build-freebsd-amd64.yml @@ -25,7 +25,7 @@ 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 egl opencl ocl-icd v4l_compat chafa + sudo pkg install -y cmake git pkgconf binutils wayland vulkan-headers vulkan-loader libxcb libXrandr libX11 libdrm glib dconf dbus sqlite3-tcl egl opencl ocl-icd v4l_compat chafa lua54 libva libvdpau cmake -DSET_TWEAK=Off -DBUILD_TESTS=On -DENABLE_EMBEDDED_PCIIDS=On -DENABLE_EMBEDDED_AMDGPUIDS=On . cmake --build . --target package --verbose -j4 ./fastfetch --list-features diff --git a/.github/workflows/build-haiku-amd64.yml b/.github/workflows/build-haiku-amd64.yml index f23abd25bd..d89b6cb4f3 100644 --- a/.github/workflows/build-haiku-amd64.yml +++ b/.github/workflows/build-haiku-amd64.yml @@ -24,7 +24,7 @@ jobs: environment_variables: 'CMAKE_BUILD_TYPE' run: | uname -a - pkgman install -y git dbus_devel mesa_devel libelf_devel imagemagick_devel opencl_headers ocl_icd_devel vulkan_devel zlib_devel chafa_devel cmake gcc make pkgconfig python3.10 || pkgman install -y git dbus_devel mesa_devel libelf_devel imagemagick_devel opencl_headers ocl_icd_devel vulkan_devel zlib_devel chafa_devel cmake gcc make pkgconfig python3.10 + pkgman install -y git dbus_devel mesa_devel libelf_devel imagemagick_devel opencl_headers ocl_icd_devel vulkan_devel zlib_devel chafa_devel cmake gcc make pkgconfig python3.10 || pkgman install -y git dbus_devel mesa_devel libelf_devel imagemagick_devel opencl_headers ocl_icd_devel vulkan_devel zlib_devel chafa_devel cmake gcc make pkgconfig python3.10 lua cmake -DSET_TWEAK=Off -DBUILD_TESTS=On -DENABLE_EMBEDDED_PCIIDS=On -DENABLE_EMBEDDED_AMDGPUIDS=On . cmake --build . --target package --verbose -j4 ./fastfetch --list-features diff --git a/.github/workflows/build-linux-armv6l.yml b/.github/workflows/build-linux-armv6l.yml index 0294a30630..39e96353a9 100644 --- a/.github/workflows/build-linux-armv6l.yml +++ b/.github/workflows/build-linux-armv6l.yml @@ -23,7 +23,7 @@ jobs: run: | uname -a apt-get update && apt-get install -y wget - apt-get install -y cmake make gcc libvulkan-dev libwayland-dev libxrandr-dev libxcb-randr0-dev libdconf-dev libdbus-1-dev libmagickcore-dev libsqlite3-dev librpm-dev libegl-dev libglx-dev ocl-icd-opencl-dev libpulse-dev libdrm-dev libelf-dev libefl-all-dev rpm + apt-get install -y cmake make gcc libvulkan-dev libwayland-dev libxrandr-dev libxcb-randr0-dev libdconf-dev libdbus-1-dev libmagickcore-dev libsqlite3-dev librpm-dev libegl-dev libglx-dev ocl-icd-opencl-dev libpulse-dev libdrm-dev libelf-dev libefl-all-dev liblua5.4-dev libvdpau-dev libva-dev rpm cmake -DSET_TWEAK=Off -DBUILD_TESTS=On -DCMAKE_INSTALL_PREFIX=/usr . cmake --build . --target package --verbose -j4 ./fastfetch --list-features diff --git a/.github/workflows/build-linux-armv7l.yml b/.github/workflows/build-linux-armv7l.yml index 36992a5a23..a6061a7d3c 100644 --- a/.github/workflows/build-linux-armv7l.yml +++ b/.github/workflows/build-linux-armv7l.yml @@ -27,7 +27,7 @@ jobs: curl -L https://apt.kitware.com/keys/kitware-archive-latest.asc | gpg --dearmor - | tee /usr/share/keyrings/kitware-archive-keyring.gpg >/dev/null echo 'deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ jammy main' | tee /etc/apt/sources.list.d/kitware.list >/dev/null echo -e 'Acquire::https::Verify-Peer "false";\nAcquire::https::Verify-Host "false";' >> /etc/apt/apt.conf.d/99ignore-certificates - apt-get update && apt-get install -y cmake make gcc-13 libvulkan-dev libwayland-dev libxrandr-dev libxcb-randr0-dev libdconf-dev libdbus-1-dev libmagickcore-dev libsqlite3-dev librpm-dev libegl-dev libglx-dev ocl-icd-opencl-dev libpulse-dev libdrm-dev libelf-dev libefl-all-dev rpm + apt-get update && apt-get install -y cmake make gcc-13 libvulkan-dev libwayland-dev libxrandr-dev libxcb-randr0-dev libdconf-dev libdbus-1-dev libmagickcore-dev libsqlite3-dev librpm-dev libegl-dev libglx-dev ocl-icd-opencl-dev libpulse-dev libdrm-dev libelf-dev libefl-all-dev liblua5.4-dev libvdpau-dev libva-dev rpm CC=gcc-13 cmake -DSET_TWEAK=Off -DBUILD_TESTS=On -DCMAKE_INSTALL_PREFIX=/usr . cmake --build . --target package --verbose -j4 ./fastfetch --list-features diff --git a/.github/workflows/build-linux-hosts.yml b/.github/workflows/build-linux-hosts.yml index 2eef528168..17d878070b 100644 --- a/.github/workflows/build-linux-hosts.yml +++ b/.github/workflows/build-linux-hosts.yml @@ -39,12 +39,12 @@ jobs: run: sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test - name: install required packages - run: sudo apt-get update && sudo apt-get install -y gcc-13 libvulkan-dev libwayland-dev libxrandr-dev libxcb-randr0-dev libdconf-dev libdbus-1-dev libmagickcore-dev libsqlite3-dev librpm-dev libegl-dev libglx-dev ocl-icd-opencl-dev libpulse-dev libdrm-dev libelf-dev libddcutil-dev libefl-all-dev libunwind-dev rpm ninja-build + run: sudo apt-get update && sudo apt-get install -y gcc-13 libvulkan-dev libwayland-dev libxrandr-dev libxcb-randr0-dev libdconf-dev libdbus-1-dev libmagickcore-dev libsqlite3-dev librpm-dev libegl-dev libglx-dev ocl-icd-opencl-dev libpulse-dev libdrm-dev libelf-dev libddcutil-dev libefl-all-dev libunwind-dev liblua5.4-dev libvdpau-dev libva-dev rpm ninja-build - name: install linuxbrew packages run: | /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" - /home/linuxbrew/.linuxbrew/bin/brew install imagemagick chafa --ignore-dependencies + /home/linuxbrew/.linuxbrew/bin/brew install imagemagick chafa quickjs-ng --ignore-dependencies - name: Initialize CodeQL if: inputs.arch == 'amd64' @@ -53,7 +53,7 @@ jobs: languages: c - name: configure project - run: CC=gcc-13 PKG_CONFIG_PATH=/home/linuxbrew/.linuxbrew/lib/pkgconfig:$PKG_CONFIG_PATH cmake -GNinja -DSET_TWEAK=Off -DBUILD_TESTS=On -DENABLE_EMBEDDED_PCIIDS=On -DENABLE_EMBEDDED_AMDGPUIDS=On -DCMAKE_INSTALL_PREFIX=/usr . + run: CC=gcc-13 CMAKE_PREFIX_PATH=/home/linuxbrew/.linuxbrew PKG_CONFIG_PATH=/home/linuxbrew/.linuxbrew/lib/pkgconfig:$PKG_CONFIG_PATH cmake -GNinja -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 diff --git a/.github/workflows/build-linux-i686.yml b/.github/workflows/build-linux-i686.yml index c1c127fb95..cf1a2d39b7 100644 --- a/.github/workflows/build-linux-i686.yml +++ b/.github/workflows/build-linux-i686.yml @@ -26,18 +26,18 @@ jobs: run: sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test - name: install required packages - run: sudo apt-get update && sudo apt-get install -y gcc-13 gcc-13-multilib libvulkan-dev libwayland-dev libxrandr-dev libxcb-randr0-dev libdconf-dev libdbus-1-dev libmagickcore-dev libsqlite3-dev librpm-dev libegl-dev libglx-dev ocl-icd-opencl-dev libpulse-dev libdrm-dev libelf-dev libddcutil-dev libefl-all-dev libunwind-dev rpm ninja-build + run: sudo apt-get update && sudo apt-get install -y gcc-13 gcc-13-multilib libvulkan-dev libwayland-dev libxrandr-dev libxcb-randr0-dev libdconf-dev libdbus-1-dev libmagickcore-dev libsqlite3-dev librpm-dev libegl-dev libglx-dev ocl-icd-opencl-dev libpulse-dev libdrm-dev libelf-dev libddcutil-dev libefl-all-dev libunwind-dev liblua5.4-dev libvdpau-dev libva-dev rpm ninja-build - name: install linuxbrew packages run: | /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" - /home/linuxbrew/.linuxbrew/bin/brew install imagemagick chafa --ignore-dependencies + /home/linuxbrew/.linuxbrew/bin/brew install imagemagick chafa quickjs-ng --ignore-dependencies - name: cmake version run: cmake --version - name: configure project - run: CC=gcc-13 PKG_CONFIG_PATH=/home/linuxbrew/.linuxbrew/lib/pkgconfig:$PKG_CONFIG_PATH cmake -DCMAKE_C_FLAGS="-m32 -march=i686 -mtune=i686" -DCMAKE_SYSTEM_PROCESSOR_OVERRIDE=i686 -DCPACK_DEBIAN_PACKAGE_ARCHITECTURE=i386 -GNinja -DSET_TWEAK=Off -DBUILD_TESTS=On -DENABLE_EMBEDDED_PCIIDS=On -DENABLE_EMBEDDED_AMDGPUIDS=On -DCMAKE_INSTALL_PREFIX=/usr . + run: CC=gcc-13 CMAKE_PREFIX_PATH=/home/linuxbrew/.linuxbrew PKG_CONFIG_PATH=/home/linuxbrew/.linuxbrew/lib/pkgconfig:$PKG_CONFIG_PATH cmake -DCMAKE_C_FLAGS="-m32 -march=i686 -mtune=i686" -DCMAKE_SYSTEM_PROCESSOR_OVERRIDE=i686 -DCPACK_DEBIAN_PACKAGE_ARCHITECTURE=i386 -GNinja -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 diff --git a/.github/workflows/build-linux-vms.yml b/.github/workflows/build-linux-vms.yml index 6523c92723..2247d924c0 100644 --- a/.github/workflows/build-linux-vms.yml +++ b/.github/workflows/build-linux-vms.yml @@ -28,7 +28,7 @@ jobs: uname -a apt-get update && apt-get install -y software-properties-common add-apt-repository -y ppa:ubuntu-toolchain-r/test - apt-get update && apt-get install -y cmake make gcc-13 libvulkan-dev libwayland-dev libxrandr-dev libxcb-randr0-dev libdconf-dev libdbus-1-dev libmagickcore-dev libsqlite3-dev librpm-dev libegl-dev libglx-dev ocl-icd-opencl-dev libpulse-dev libdrm-dev libchafa-dev libelf-dev libefl-all-dev rpm + apt-get update && apt-get install -y cmake make gcc-13 libvulkan-dev libwayland-dev libxrandr-dev libxcb-randr0-dev libdconf-dev libdbus-1-dev libmagickcore-dev libsqlite3-dev librpm-dev libegl-dev libglx-dev ocl-icd-opencl-dev libpulse-dev libdrm-dev libchafa-dev libelf-dev libefl-all-dev liblua5.4-dev libvdpau-dev libva-dev rpm CC=gcc-13 cmake -DSET_TWEAK=Off -DBUILD_TESTS=On -DCMAKE_INSTALL_PREFIX=/usr . cmake --build . --target package --verbose -j4 ./fastfetch --list-features diff --git a/.github/workflows/build-macos-hosts.yml b/.github/workflows/build-macos-hosts.yml index 34b8db5e4b..40fa0009d4 100644 --- a/.github/workflows/build-macos-hosts.yml +++ b/.github/workflows/build-macos-hosts.yml @@ -25,7 +25,8 @@ jobs: - name: install required packages run: | - HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1 brew install --overwrite vulkan-loader vulkan-headers molten-vk imagemagick chafa + HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1 brew update + HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1 brew install --overwrite vulkan-loader vulkan-headers molten-vk imagemagick chafa lua quickjs-ng - name: configure project run: cmake -DSET_TWEAK=Off -DBUILD_TESTS=On . diff --git a/.github/workflows/build-musl-amd64.yml b/.github/workflows/build-musl-amd64.yml index f0216541ff..aed91bd982 100644 --- a/.github/workflows/build-musl-amd64.yml +++ b/.github/workflows/build-musl-amd64.yml @@ -14,12 +14,14 @@ jobs: - name: setup alpine linux uses: jirutka/setup-alpine@master + with: + branch: edge - name: install dependencies run: | cat /etc/alpine-release uname -a - apk add cmake samurai vulkan-loader-dev libxcb-dev libxrandr-dev rpm-dev wayland-dev libdrm-dev dconf-dev imagemagick-dev chafa-dev zlib-dev dbus-dev mesa-dev opencl-dev sqlite-dev networkmanager-dev pulseaudio-dev ddcutil-dev elfutils-dev gcc g++ + apk add cmake samurai vulkan-loader-dev libxcb-dev libxrandr-dev rpm-dev wayland-dev libdrm-dev dconf-dev imagemagick-dev chafa-dev zlib-dev dbus-dev mesa-dev opencl-dev sqlite-dev networkmanager-dev pulseaudio-dev ddcutil-dev elfutils-dev lua5.4-dev quickjs-ng-dev libvdpau-dev libva-dev gcc g++ shell: alpine.sh --root {0} - name: build diff --git a/.github/workflows/build-netbsd-amd64.yml b/.github/workflows/build-netbsd-amd64.yml index d541ac5c1c..eb95b22649 100644 --- a/.github/workflows/build-netbsd-amd64.yml +++ b/.github/workflows/build-netbsd-amd64.yml @@ -24,7 +24,7 @@ jobs: environment_variables: 'CMAKE_BUILD_TYPE' run: | uname -a - sudo pkgin -y install clang cmake git pkgconf wayland vulkan-headers dconf dbus sqlite3 ImageMagick + sudo pkgin -y install clang cmake git pkgconf wayland vulkan-headers dconf dbus sqlite3 ImageMagick libva libvdpau CC=clang cmake -DSET_TWEAK=Off -DBUILD_TESTS=On -DENABLE_EMBEDDED_PCIIDS=On -DENABLE_EMBEDDED_AMDGPUIDS=On . cmake --build . --target package --verbose -j4 ./fastfetch --list-features diff --git a/.github/workflows/build-openbsd-amd64.yml b/.github/workflows/build-openbsd-amd64.yml index 101e07d412..cae4cbb231 100644 --- a/.github/workflows/build-openbsd-amd64.yml +++ b/.github/workflows/build-openbsd-amd64.yml @@ -25,7 +25,7 @@ jobs: run: | uname -a sudo pkg_add -u - sudo pkg_add -r llvm-21.1.2p0 cmake git pkgconf wayland vulkan-headers vulkan-loader glib2 dconf dbus sqlite3 imagemagick chafa + sudo pkg_add -r llvm-21.1.2p0 cmake git wayland vulkan-headers vulkan-loader glib2 dconf dbus sqlite3 imagemagick chafa lua-5.4.7 # pkg-config is preinstalled CC=clang-21 cmake -DSET_TWEAK=Off -DBUILD_TESTS=On -DENABLE_EMBEDDED_PCIIDS=On -DENABLE_EMBEDDED_AMDGPUIDS=On . cmake --build . --target package --verbose -j4 ./fastfetch --list-features diff --git a/.github/workflows/build-solaris-amd64.yml b/.github/workflows/build-solaris-amd64.yml index 1cdc009b57..717bf67b4f 100644 --- a/.github/workflows/build-solaris-amd64.yml +++ b/.github/workflows/build-solaris-amd64.yml @@ -21,7 +21,7 @@ jobs: release: "11.4-gcc-14" prepare: | uname -a - pkg install cmake git pkg-config glib2 dbus sqlite-3 imagemagick ninja dconf mesa + pkg install cmake git pkg-config glib2 dbus sqlite-3 imagemagick ninja dconf mesa lua run: | export PKG_CONFIG_PATH=/usr/lib/64/pkgconfig diff --git a/.github/workflows/build-windows-hosts.yml b/.github/workflows/build-windows-hosts.yml index 9c869f01ff..f45e3f8946 100644 --- a/.github/workflows/build-windows-hosts.yml +++ b/.github/workflows/build-windows-hosts.yml @@ -37,7 +37,7 @@ jobs: with: msystem: ${{ inputs.msystem }} update: true - install: git mingw-w64-clang-${{ inputs.msys-arch }}-7zip mingw-w64-clang-${{ inputs.msys-arch }}-cmake mingw-w64-clang-${{ inputs.msys-arch }}-clang mingw-w64-clang-${{ inputs.msys-arch }}-vulkan-loader mingw-w64-clang-${{ inputs.msys-arch }}-vulkan-headers mingw-w64-clang-${{ inputs.msys-arch }}-opencl-icd mingw-w64-clang-${{ inputs.msys-arch }}-opencl-headers mingw-w64-clang-${{ inputs.msys-arch }}-cppwinrt mingw-w64-clang-${{ inputs.msys-arch }}-imagemagick mingw-w64-clang-${{ inputs.msys-arch }}-chafa mingw-w64-clang-${{ inputs.msys-arch }}-directx-headers + install: git mingw-w64-clang-${{ inputs.msys-arch }}-7zip mingw-w64-clang-${{ inputs.msys-arch }}-cmake mingw-w64-clang-${{ inputs.msys-arch }}-clang mingw-w64-clang-${{ inputs.msys-arch }}-vulkan-loader mingw-w64-clang-${{ inputs.msys-arch }}-vulkan-headers mingw-w64-clang-${{ inputs.msys-arch }}-opencl-icd mingw-w64-clang-${{ inputs.msys-arch }}-opencl-headers mingw-w64-clang-${{ inputs.msys-arch }}-cppwinrt mingw-w64-clang-${{ inputs.msys-arch }}-imagemagick mingw-w64-clang-${{ inputs.msys-arch }}-chafa mingw-w64-clang-${{ inputs.msys-arch }}-lua mingw-w64-clang-${{ inputs.msys-arch }}-quickjs-ng mingw-w64-clang-${{ inputs.msys-arch }}-directx-headers - name: print msys version run: uname -a @@ -49,7 +49,7 @@ jobs: run: cmake --build . --verbose -j4 - name: copy necessary dlls - run: cp /${{ inputs.msystem-lower }}/bin/{OpenCL,vulkan-1}.dll . + run: cp /${{ inputs.msystem-lower }}/bin/{lua55,libqjs-0}.dll . - name: list features run: ./fastfetch --list-features diff --git a/CHANGELOG.md b/CHANGELOG.md index f533997248..bd8f86d820 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,64 @@ +# 2.64.0 + +New **optional build** dependencies: +* [`libva`](https://github.com/intel/libva) and [`libvdpau`](https://www.freedesktop.org/wiki/Software/VDPAU) for the new `Codec` module. +* [Lua 5.3 to 5.5](https://www.lua.org/) for Lua scripting support, or [QuickJS](https://github.com/quickjs-ng/quickjs) v0.15.0 or newer for JavaScript scripting support. + +Features: +* Adds `Codec` module support for Windows, macOS, Linux, and Android for hardware-accelerated video codec detection (Codec) + * Backends used (results may vary depending on the backend due to driver differences): + * Linux and BSD: VA-API (default) and VDPAU (fallback for NVIDIA). Fastfetch must be built with `libva` and `libvdpau` support to enable these backends. + * Windows: D3D12VA (Windows 11) and D3D11VA+MFT (Windows 10 or older) + * macOS: VideoToolbox + * Android: AMediaCodec + * Common: Vulkan Video (disabled by default; can be enabled with `"useVulkan": true`) + * By default, both encoders and decoders are reported. If no codecs are detected for a given type, `None` is reported. This behavior can be configured using the `"showType": "encoder|decoder"` option. +* Adds experimental Lua script support for custom formats (Global) + * Basic usage (using `Title` as an example): `{ "type": "title", "format": "lua:return string.format('Hello %s@%s', (...).userName, (...).hostName)" }`. The `lua:` prefix indicates a Lua script. A `return` statement is required to pass the final result back to the fastfetch module; otherwise, `nil` is returned implicitly and the entire module output is skipped. + * Parameters are passed via variable arguments `(...)`. Users can assign them to named variables for better readability. For example: `lua:local args = ...; string.format('Hello %s@%s', args.userName, args.hostName)`. + * The Lua interpreter instance is shared across all modules. This allows users to store and manipulate data across modules. For example: + * `{ "type": "shell", "format": "lua:shell = ..." } // Note: no "return" here` + * `{ "type": "terminal", "format": "lua:return shell.prettyName .. ' in ' .. (...).prettyName" } // This will print the detected shell and terminal names` + * A `json_encode(table, is_pretty)` function has been added to the Lua API for easier debugging. For example, `lua:return json_encode(...)` will print all available variables and their values in JSON format. + * Supported Lua versions: Lua 5.3 to 5.5 (Lua 5.1 and LuaJIT are not supported). The Lua version is auto-detected at build time. Once built, users can check the configured Lua version using `fastfetch --list-features`. +* Adds experimental QuickJS script support for custom formats as an alternative to Lua (Global) + * Basic usage: `{ "type": "title", "format": "qjs:`Hello ${this.userName}@${this.hostName}`" }`. The `qjs:` prefix indicates a JavaScript script. No `return` statement is needed; the final result is simply the evaluated value of the script. + * Parameters are passed via the `this` object. Usage is mostly the same as Lua, but using JavaScript syntax. + * Requires [quickjs-ng v0.15.0](https://github.com/quickjs-ng/quickjs/releases/tag/v0.15.0) or newer. +* Adds CMake options `-DMODULE_DISABLE_=ON` to disable modules at compile time for a smaller binary size + * Use `cmake -L . | grep MODULE_DISABLE_` to list all available options. + * These options rely on LTO for dead code elimination (`-DCMAKE_BUILD_TYPE=Release` should enable LTO by default). +* Adds the ability to remove unneeded ASCII logos without modifying the fastfetch source code, further reducing binary size + * Simply remove the corresponding logo file from the logo directory (`src/logo/ascii/[a-z]/*`) and re-run `cmake`. +* Improves string manipulation specifiers in custom formats + * They are now ANSI escape-aware and work correctly with colored output (e.g., percentages with `num-color`) (#2364). Limitations: + * They are still not wide-character aware and treat CJK and emoji characters as raw bytes. + * Escape sequences in the middle of strings are not supported. + * A new `|` specifier has been added to center strings. For example, `{user-name|20}` will center the username in a 20-character-wide field. +* Adds preliminary `Bootmgr`, `Brightness`, and `WMTheme` detection support for Haiku (#2358, Haiku) +* Adds `Wallpaper` and `WMTheme` detection support for the COSMIC desktop environment (Linux) +* Improves terminal name detection for Nix packages (#2352, Terminal, Linux) +* Adds DDC/CI brightness detection support for FreeBSD (Brightness, FreeBSD) + * DDC/CI communication can be very slow. Users can set the `ddcciSleep: null` option to skip DDC/CI detection. +* Reworks the built-in logo printing logic. ASCII logos and modules are now printed line by line, avoiding issues like #2239 + * Note: Image logos are not affected by this change and still print the entire image first before printing any modules. +* Adds a new `--logo-padding-bottom` option to control the padding between the bottom of the logo and the first module when `--logo-position top` is used + * Previously, `--logo-padding-right` was used for both right and bottom padding. +* Adds `Samsung Exynos 2600` to CPU detection (CPU, Android) +* Adds terminal font detection support for the Muxy terminal (TerminalFont, macOS) +* Improves the performance of BusyBox (ash) version detection and always reports `ash` as the pretty name (Shell, Linux) + +Bugfixes: +* Fixes SwayFX version detection (WM, Linux) +* Fixes fallback font detection for Ghostty (TerminalFont, macOS) +* Fixes `--stat` output to correctly align with the right border (Global) +* Fixes boot manager on macOS 26 (mBoot) is incorrectly reported as `iBoot` (Bootmgr, macOS) + +Logos: +* Adds Quasar (#2338, #2323), Origami, Origami_small (#2321, #2322), BerserkArch (#2324, #2310), and NixOS2 (#2346) +* Minor tweaks and color fixes for the NixOS_small logo (#2357) +* Updates NurOS (#2366) + # 2.63.1 Bugfixes: diff --git a/CMakeLists.txt b/CMakeLists.txt index ee9f5826e4..5e104fe36a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 3.12.0) # target_link_libraries with OBJECT libs & project homepage url project(fastfetch - VERSION 2.63.1 + VERSION 2.64.0 LANGUAGES C DESCRIPTION "Fast neofetch-like system information tool" HOMEPAGE_URL "https://github.com/fastfetch-cli/fastfetch" @@ -74,6 +74,8 @@ cmake_dependent_option(ENABLE_WAYLAND "Enable wayland-client" ON "LINUX OR FreeB cmake_dependent_option(ENABLE_XCB_RANDR "Enable xcb-randr" ON "LINUX OR FreeBSD OR OpenBSD OR NetBSD OR ANDROID OR SunOS OR GNU" OFF) cmake_dependent_option(ENABLE_XRANDR "Enable xrandr" ON "LINUX OR FreeBSD OR OpenBSD OR NetBSD OR ANDROID OR SunOS OR GNU" OFF) cmake_dependent_option(ENABLE_DRM "Enable libdrm" ON "LINUX OR FreeBSD OR OpenBSD OR NetBSD OR SunOS OR GNU" OFF) +cmake_dependent_option(ENABLE_VA "Enable libva" ON "LINUX OR FreeBSD OR OpenBSD OR NetBSD OR SunOS OR GNU" OFF) +cmake_dependent_option(ENABLE_VDPAU "Enable vdpau" ON "LINUX OR FreeBSD OR OpenBSD OR NetBSD OR SunOS OR GNU" OFF) cmake_dependent_option(ENABLE_DRM_AMDGPU "Enable libdrm_amdgpu" ON "LINUX OR FreeBSD OR GNU" OFF) cmake_dependent_option(ENABLE_GIO "Enable gio-2.0" ON "LINUX OR FreeBSD OR OpenBSD OR NetBSD OR ANDROID OR SunOS OR GNU" OFF) cmake_dependent_option(ENABLE_DCONF "Enable dconf" ON "LINUX OR FreeBSD OR OpenBSD OR NetBSD OR ANDROID OR SunOS OR GNU" OFF) @@ -105,7 +107,11 @@ 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) option(ENABLE_WORDEXP "Enable using of wordexp(3) if available, instead of glob(3)" ON) +option(ENABLE_LUA "Enable lua scripting for format strings" ON) +option(ENABLE_QUICKJS "Enable quickjs scripting for format strings" ON) option(ENABLE_LIBZFS "Enable libzfs" ON) +option(ENABLE_WCWIDTH "Detect wide-width characters with wcwidth when calculating logo and separator width. Disable for a smaller and slightly faster build, but logos containing CJK/emoji may be measured too narrow and render incorrectly. Such usecases are uncommon." ON) +set(DEFAULT_STRUCTURE "Title:Separator:OS:Host:Kernel:Uptime:Packages:Shell:Display:DE:WM:WMTheme:Theme:Icons:Font:Cursor:Terminal:TerminalFont:CPU:GPU:Memory:Swap:Disk:LocalIp:Battery:PowerAdapter:Locale:Break:Colors" CACHE STRING "Default module structure for detection") if(WIN32 AND NOT CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64") option(ENABLE_WIN81_COMPAT "Enable legacy Windows compatibility (Windows 8.1 and later; Windows 7 unsupported)" ON) endif() @@ -113,6 +119,14 @@ if(APPLE) option(ENABLE_APPLE_MEMSIZE_USABLE "Use usable memory size as total memory size in Memory module, to match other systems" OFF) endif() +file(GLOB FF_MODULE_DIRS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}/src/modules" "${CMAKE_CURRENT_SOURCE_DIR}/src/modules/*/") +foreach(FF_MODULE_DIR ${FF_MODULE_DIRS}) + if(IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/src/modules/${FF_MODULE_DIR}") + string(TOUPPER "${FF_MODULE_DIR}" FF_MODULE_UPPER) + option(MODULE_DISABLE_${FF_MODULE_UPPER} "Disable module ${FF_MODULE_DIR}" OFF) + endif() +endforeach() + set(BINARY_LINK_TYPE_OPTIONS dlopen dynamic static) set(BINARY_LINK_TYPE dlopen CACHE STRING "How to link fastfetch") set_property(CACHE BINARY_LINK_TYPE PROPERTY STRINGS ${BINARY_LINK_TYPE_OPTIONS}) @@ -287,14 +301,14 @@ find_package(Python) if(Python_FOUND) message(STATUS "Minifying 'help.json'") execute_process(COMMAND ${Python_EXECUTABLE} -c "import json,sys;json.dump(json.load(sys.stdin),sys.stdout,separators=(',',':'))" - INPUT_FILE "${CMAKE_CURRENT_SOURCE_DIR}/src/data/help.json" + INPUT_FILE "${CMAKE_CURRENT_SOURCE_DIR}/doc/help.json" OUTPUT_VARIABLE DATATEXT_JSON_HELP) if(DATATEXT_JSON_HELP STREQUAL "") message(ERROR "DATATEXT_JSON_HELP is empty, which should not happen!") endif() else() message(WARNING "Python3 is not found, 'help.json' will not be minified") - file(READ "src/data/help.json" DATATEXT_JSON_HELP) + file(READ "doc/help.json" DATATEXT_JSON_HELP) endif() if(ENABLE_EMBEDDED_PCIIDS AND NOT EXISTS "${PROJECT_BINARY_DIR}/fastfetch_pciids.c.inc") @@ -354,7 +368,6 @@ else() endif() fastfetch_encode_c_string("${DATATEXT_JSON_HELP}" DATATEXT_JSON_HELP) -fastfetch_load_text(src/data/structure.txt DATATEXT_STRUCTURE) configure_file(src/fastfetch_config.h.in fastfetch_config.h @ONLY) configure_file(src/fastfetch_datatext.h.in fastfetch_datatext.h @ONLY) @@ -366,7 +379,7 @@ endif() # Ascii image data # #################### -file(GLOB LOGO_FILES CONFIGURE_DEPENDS "src/logo/ascii/*.txt") +file(GLOB LOGO_FILES CONFIGURE_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/src/logo/ascii/[a-z_]/*.txt") set(LOGO_BUILTIN_H "#pragma once\n#pragma GCC diagnostic ignored \"-Wtrigraphs\"\n\n") foreach(file ${LOGO_FILES}) fastfetch_load_text("${file}" content) @@ -389,6 +402,7 @@ set(LIBFASTFETCH_SRC src/common/impl/init.c src/common/impl/jsonconfig.c src/common/impl/library.c + src/common/impl/lua.c src/common/impl/netif.c src/common/impl/networking_common.c src/common/impl/option.c @@ -407,9 +421,12 @@ set(LIBFASTFETCH_SRC src/common/impl/path.c src/common/impl/FFPlatform.c src/common/impl/smbios.c + src/common/impl/strutil.c src/detection/bluetoothradio/bluetoothradio.c src/detection/bootmgr/bootmgr.c src/detection/chassis/chassis.c + src/detection/codec/codec.c + src/detection/codec/codec_vulkan.c src/detection/cpu/cpu.c src/detection/cpuusage/cpuusage.c src/detection/command/command.c @@ -451,6 +468,7 @@ set(LIBFASTFETCH_SRC src/modules/btrfs/btrfs.c src/modules/camera/camera.c src/modules/chassis/chassis.c + src/modules/codec/codec.c src/modules/colors/colors.c src/modules/cpu/cpu.c src/modules/cpucache/cpucache.c @@ -537,6 +555,7 @@ if(LINUX) src/detection/brightness/brightness_linux.c src/detection/btrfs/btrfs_linux.c src/detection/chassis/chassis_linux.c + src/detection/codec/codec_linux.c src/detection/cpu/cpu_linux.c src/detection/cpucache/cpucache_linux.c src/detection/cpuusage/cpuusage_linux.c @@ -624,6 +643,7 @@ elseif(ANDROID) src/detection/brightness/brightness_nosupport.c src/detection/btrfs/btrfs_nosupport.c src/detection/chassis/chassis_nosupport.c + src/detection/codec/codec_android.c src/detection/cpu/cpu_linux.c src/detection/cpucache/cpucache_linux.c src/detection/cursor/cursor_linux.c @@ -698,6 +718,7 @@ elseif(FreeBSD) src/detection/brightness/brightness_bsd.c src/detection/btrfs/btrfs_nosupport.c src/detection/chassis/chassis_bsd.c + src/detection/codec/codec_linux.c src/detection/cpu/cpu_bsd.c src/detection/cpucache/cpucache_shared.c src/detection/cpuusage/cpuusage_bsd.c @@ -792,6 +813,7 @@ elseif(NetBSD) src/detection/brightness/brightness_nbsd.c src/detection/btrfs/btrfs_nosupport.c src/detection/chassis/chassis_nbsd.c + src/detection/codec/codec_linux.c src/detection/cpu/cpu_nbsd.c src/detection/cpucache/cpucache_shared.c src/detection/cpuusage/cpuusage_bsd.c @@ -876,6 +898,7 @@ elseif(OpenBSD) src/detection/brightness/brightness_obsd.c src/detection/btrfs/btrfs_nosupport.c src/detection/chassis/chassis_windows.c + src/detection/codec/codec_linux.c src/detection/cpu/cpu_obsd.c src/detection/cpucache/cpucache_shared.c src/detection/cpuusage/cpuusage_bsd.c @@ -952,12 +975,14 @@ elseif(APPLE) src/common/apple/cf_helpers.c src/common/apple/osascript.m src/common/apple/smc_temps.c + src/common/apple/version.m src/detection/battery/battery_apple.c src/detection/bluetooth/bluetooth_apple.m src/detection/bluetoothradio/bluetoothradio_apple.m src/detection/bootmgr/bootmgr_apple.c src/detection/brightness/brightness_apple.c src/detection/btrfs/btrfs_nosupport.c + src/detection/codec/codec_apple.c src/detection/cpu/cpu_apple.c src/detection/cpucache/cpucache_apple.c src/detection/cpuusage/cpuusage_apple.c @@ -1048,6 +1073,7 @@ elseif(WIN32) src/detection/brightness/brightness_windows.c src/detection/btrfs/btrfs_nosupport.c src/detection/chassis/chassis_windows.c + src/detection/codec/codec_windows.cpp src/detection/cpu/cpu_windows.c src/detection/cpucache/cpucache_windows.c src/detection/cpuusage/cpuusage_windows.c @@ -1119,6 +1145,7 @@ elseif(SunOS) src/detection/cursor/cursor_linux.c src/detection/bluetooth/bluetooth_nosupport.c src/detection/bluetoothradio/bluetoothradio_nosupport.c + src/detection/codec/codec_linux.c src/detection/disk/disk_sunos.c src/detection/dns/dns_linux.c src/detection/physicaldisk/physicaldisk_sunos.c @@ -1192,8 +1219,8 @@ elseif(Haiku) 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/bootmgr/bootmgr_haiku.cpp + src/detection/brightness/brightness_haiku.cpp src/detection/btrfs/btrfs_nosupport.c src/detection/chassis/chassis_windows.c src/detection/cpu/cpu_haiku.c @@ -1202,6 +1229,7 @@ elseif(Haiku) src/detection/cursor/cursor_nosupport.c src/detection/bluetooth/bluetooth_haiku.cpp src/detection/bluetoothradio/bluetoothradio_nosupport.c + src/detection/codec/codec_linux.c src/detection/disk/disk_haiku.cpp src/detection/dns/dns_linux.c src/detection/physicaldisk/physicaldisk_haiku.c @@ -1245,7 +1273,7 @@ elseif(Haiku) src/detection/wifi/wifi_nosupport.c src/detection/wm/wm_nosupport.c src/detection/de/de_nosupport.c - src/detection/wmtheme/wmtheme_nosupport.c + src/detection/wmtheme/wmtheme_haiku.cpp src/detection/camera/camera_nosupport.c ) elseif(GNU) @@ -1271,6 +1299,7 @@ elseif(GNU) src/detection/cursor/cursor_linux.c src/detection/bluetooth/bluetooth_linux.c src/detection/bluetoothradio/bluetoothradio_linux.c + src/detection/codec/codec_linux.c src/detection/disk/disk_linux.c src/detection/dns/dns_linux.c src/detection/physicaldisk/physicaldisk_nosupport.c @@ -1338,19 +1367,20 @@ if(WIN32) list(APPEND LIBFASTFETCH_SRC src/detection/gpu/gpu_intel.c) list(APPEND LIBFASTFETCH_SRC src/detection/gpu/gpu_amd.c) - include(CheckIncludeFileCXX) - CHECK_INCLUDE_FILE_CXX("winrt/Windows.Foundation.h" HAVE_WINRT) - if(HAVE_WINRT) - message(STATUS "WinRT headers are available, media detection will be enabled") + if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + message(STATUS "WinRT support is disabled due to known issues with g++") + set(HAVE_WINRT FALSE) else() - message(WARNING "WinRT headers are NOT available, media detection will be disabled") + include(CheckIncludeFileCXX) + CHECK_INCLUDE_FILE_CXX("winrt/Windows.Foundation.h" HAVE_WINRT) + if(HAVE_WINRT) + message(STATUS "WinRT headers are available, media detection will be enabled") + else() + message(WARNING "WinRT headers are NOT available, media detection will be disabled") + endif() endif() endif() include(CheckFunctionExists) -check_function_exists(wcwidth HAVE_WCWIDTH) -if(NOT HAVE_WCWIDTH) - list(APPEND LIBFASTFETCH_SRC src/common/impl/wcwidth.c) -endif() if(NOT WIN32) check_function_exists(pipe2 HAVE_PIPE2) endif() @@ -1358,6 +1388,9 @@ check_function_exists(memrchr HAVE_MEMRCHR) if(NOT HAVE_MEMRCHR) list(APPEND LIBFASTFETCH_SRC src/common/impl/memrchr.c) endif() +if(ENABLE_WCWIDTH) + list(APPEND LIBFASTFETCH_SRC src/common/impl/wcwidth.c) +endif() if(ENABLE_SYSTEM_YYJSON) find_package(yyjson) @@ -1376,6 +1409,15 @@ add_library(libfastfetch OBJECT ${LIBFASTFETCH_SRC} ) +foreach(FF_MODULE_DIR ${FF_MODULE_DIRS}) + if(IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/src/modules/${FF_MODULE_DIR}") + string(TOUPPER "${FF_MODULE_DIR}" FF_MODULE_UPPER) + if(MODULE_DISABLE_${FF_MODULE_UPPER}) + target_compile_definitions(libfastfetch PUBLIC FF_MODULE_DISABLE_${FF_MODULE_UPPER}=1) + endif() + endif() +endforeach() + include(CheckCSourceCompiles) check_c_source_compiles("int main(void){int arr[1];return _Countof(arr);}" COMPILER_SUPPORTS_COUNT_OF) if(COMPILER_SUPPORTS_COUNT_OF) @@ -1509,10 +1551,6 @@ if(FreeBSD OR OpenBSD OR NetBSD) unset(CMAKE_REQUIRED_DEFINITIONS) endif() -if(HAVE_WCWIDTH) - target_compile_definitions(libfastfetch PUBLIC FF_HAVE_WCWIDTH) -endif() - if(HAVE_PIPE2) target_compile_definitions(libfastfetch PUBLIC FF_HAVE_PIPE2) endif() @@ -1542,22 +1580,52 @@ if(NOT BINARY_LINK_TYPE STREQUAL "dlopen") endif() endif() -function(ff_lib_enable VARNAME PKGCONFIG_NAMES CMAKE_NAME) +function(ff_lib_enable VARNAME PKGCONFIG_NAMES CMAKE_NAME) # [CMAKE_TARGET_NAME] if(NOT ENABLE_${VARNAME}) return() endif() if(PKG_CONFIG_FOUND) pkg_search_module(${VARNAME} QUIET ${PKGCONFIG_NAMES}) + if(${VARNAME}_FOUND) + set(${VARNAME}_FOUND "pkg-config") + endif() endif() if(NOT ${VARNAME}_FOUND) find_package(${CMAKE_NAME} QUIET) set(${VARNAME}_FOUND ${${CMAKE_NAME}_FOUND}) - set(${VARNAME}_INCLUDE_DIRS ${${CMAKE_NAME}_INCLUDE_DIRS}) - set(${VARNAME}_LIBRARIES ${${CMAKE_NAME}_LIBRARIES}) - set(${VARNAME}_CFLAGS_OTHER ${${CMAKE_NAME}_CFLAGS_OTHER}) + if(${VARNAME}_FOUND) + set(${VARNAME}_FOUND "CMake") + + # Some CMake packages (e.g. quickjs) are target-based only and + # don't expose *_INCLUDE_DIRS/*_LIBRARIES variables. + if(ARGC GREATER 3) + set(_FF_CMAKE_TARGET ${ARGV3}) + if(NOT _FF_CMAKE_TARGET STREQUAL "") + if(NOT DEFINED ${VARNAME}_INCLUDE_DIRS OR "${${VARNAME}_INCLUDE_DIRS}" STREQUAL "") + get_target_property(_FF_CMAKE_TARGET_INCLUDES ${_FF_CMAKE_TARGET} INTERFACE_INCLUDE_DIRECTORIES) + if(_FF_CMAKE_TARGET_INCLUDES) + set(${VARNAME}_INCLUDE_DIRS ${_FF_CMAKE_TARGET_INCLUDES}) + endif() + endif() + + if(NOT DEFINED ${VARNAME}_LIBRARIES OR "${${VARNAME}_LIBRARIES}" STREQUAL "") + get_target_property(_FF_CMAKE_TARGET_LIBRARIES ${_FF_CMAKE_TARGET} INTERFACE_LINK_LIBRARIES) + if(_FF_CMAKE_TARGET_LIBRARIES) + set(${VARNAME}_LIBRARIES ${_FF_CMAKE_TARGET_LIBRARIES}) + else() + set(${VARNAME}_LIBRARIES ${_FF_CMAKE_TARGET}) + endif() + endif() + endif() + else() + set(${VARNAME}_INCLUDE_DIRS ${${CMAKE_NAME}_INCLUDE_DIRS}) + set(${VARNAME}_LIBRARIES ${${CMAKE_NAME}_LIBRARIES}) + set(${VARNAME}_CFLAGS_OTHER ${${CMAKE_NAME}_CFLAGS_OTHER}) + endif() + endif() endif() if(NOT ${VARNAME}_FOUND) @@ -1565,7 +1633,7 @@ function(ff_lib_enable VARNAME PKGCONFIG_NAMES CMAKE_NAME) return() endif() - message(STATUS "Library: found ${VARNAME}") + message(STATUS "Library: found ${VARNAME} by ${${VARNAME}_FOUND}") target_compile_definitions(libfastfetch PRIVATE FF_HAVE_${VARNAME}=1) target_include_directories(libfastfetch PRIVATE ${${VARNAME}_INCLUDE_DIRS}) @@ -1603,6 +1671,14 @@ ff_lib_enable(DRM "libdrm" "Libdrm" ) +ff_lib_enable(VA + "libva" + "Libva" +) +ff_lib_enable(VDPAU + "vdpau" + "vdpau" +) ff_lib_enable(DRM_AMDGPU "libdrm_amdgpu" "Libdrm_Amdgpu" @@ -1682,6 +1758,36 @@ ff_lib_enable(ELF "libelf" "libelf" ) +ff_lib_enable(QUICKJS + "qjs" + "qjs" + "qjs" +) +if(ENABLE_LUA) + # Lua is a special case since its CMake config does not follow the usual pattern + find_package(Lua QUIET) + if(Lua_FOUND AND NOT DEFINED Lua_VERSION) # For CMake 4.2- compatible + set(Lua_VERSION ${LUA_VERSION_STRING}) + set(Lua_VERSION_MAJOR ${LUA_VERSION_MAJOR}) + set(Lua_VERSION_MINOR ${LUA_VERSION_MINOR}) + endif() + if(Lua_FOUND) + if((NOT Lua_VERSION_MAJOR EQUAL 5) OR Lua_VERSION_MINOR LESS 3 OR Lua_VERSION_MINOR GREATER 5) + message(STATUS "Library: Lua version ${Lua_VERSION} is not supported, requires 5.3-5.5") + unset(Lua_FOUND) + else() + target_compile_definitions(libfastfetch PRIVATE FF_HAVE_LUA=1) + target_include_directories(libfastfetch PRIVATE ${LUA_INCLUDE_DIR}) + + if(NOT BINARY_LINK_TYPE STREQUAL "dlopen") + target_link_libraries(libfastfetch PRIVATE ${LUA_LIBRARIES}) + endif() + message(STATUS "Library: found LUA ${Lua_VERSION} by CMake") + endif() + else() + message(STATUS "Library: missing: LUA") + endif() +endif() if(ENABLE_THREADS) target_compile_definitions(libfastfetch PRIVATE FF_HAVE_THREADS=1) @@ -1705,8 +1811,11 @@ if(ENABLE_LIBZFS) ) endif() endif() +if(ENABLE_WCWIDTH) + target_compile_definitions(libfastfetch PUBLIC FF_ENABLE_WCWIDTH=1) +endif() if(NOT HAVE_MEMRCHR) - target_compile_definitions(libfastfetch PRIVATE FF_HAVE_CUSTOM_MEMRCHR=1) + target_compile_definitions(libfastfetch PUBLIC FF_HAVE_CUSTOM_MEMRCHR=1) endif() if(LINUX) @@ -1736,6 +1845,7 @@ elseif(APPLE) PRIVATE "-framework OpenGL" PRIVATE "-framework OpenCL" PRIVATE "-framework SystemConfiguration" + PRIVATE "-framework VideoToolbox" PRIVATE "-weak_framework CoreDisplay" PRIVATE "-F /System/Library/PrivateFrameworks" @@ -2015,12 +2125,20 @@ if (BUILD_TESTS) PRIVATE libfastfetch ) + add_executable(fastfetch-test-strutil + tests/strutil.c + ) + target_link_libraries(fastfetch-test-strutil + PRIVATE libfastfetch + ) + enable_testing() add_test(NAME test-strbuf COMMAND fastfetch-test-strbuf) add_test(NAME test-list COMMAND fastfetch-test-list) add_test(NAME test-format COMMAND fastfetch-test-format) add_test(NAME test-color COMMAND fastfetch-test-color) add_test(NAME test-duration COMMAND fastfetch-test-duration) + add_test(NAME test-strutil COMMAND fastfetch-test-strutil) endif() ################## diff --git a/debian/changelog.tpl b/debian/changelog.tpl index 19e47cdb87..a8ddebdebb 100644 --- a/debian/changelog.tpl +++ b/debian/changelog.tpl @@ -1,3 +1,9 @@ +fastfetch (2.63.1~#UBUNTU_CODENAME#) #UBUNTU_CODENAME#; urgency=medium + + * Update to 2.63.1 + + -- Carter Li Fri, 15 May 2026 09:31:54 +0800 + fastfetch (2.63.0~#UBUNTU_CODENAME#) #UBUNTU_CODENAME#; urgency=medium * Update to 2.63.0 diff --git a/src/data/help.json b/doc/help.json similarity index 100% rename from src/data/help.json rename to doc/help.json diff --git a/doc/json_schema.json b/doc/json_schema.json index f8198587d7..2243fb6f59 100644 --- a/doc/json_schema.json +++ b/doc/json_schema.json @@ -313,6 +313,10 @@ "description": "Output format for the `Chassis` module. See Wiki for formatting syntax\n 1. {type}: Chassis type\n 2. {vendor}: Chassis vendor\n 3. {version}: Chassis version\n 4. {serial}: Chassis serial number", "type": "string" }, + "codecFormat": { + "description": "Output format for the `Codec` module. See Wiki for formatting syntax\n 1. {gpu}: GPU name\n 2. {direction}: Decoder / Encoder\n 3. {types}: Compatibility alias of codec types\n 4. {platform-api}: Platform API used for detection", + "type": "string" + }, "commandFormat": { "description": "Output format for the `Command` module. See Wiki for formatting syntax\n 1. {result}: Command result", "type": "string" @@ -731,6 +735,11 @@ "description": "Top padding of the logo", "minimum": 0 }, + "bottom": { + "type": "integer", + "description": "Bottom padding of the logo; only supported when position is `top`", + "minimum": 0 + }, "left": { "type": "integer", "description": "Left padding of the logo", @@ -1440,6 +1449,7 @@ "cpu", "cpucache", "cpuusage", + "codec", "command", "colors", "cursor", @@ -1745,10 +1755,18 @@ "$ref": "#/$defs/percent" }, "ddcciSleep": { - "type": "integer", - "description": "Sleep time in milliseconds between DDC/CI requests\nSee for details", - "minimum": 0, - "maximum": 400, + "description": "Sleep time in milliseconds between DDC/CI requests\nSet to null to skip DDC/CI detection\nSee for details", + "oneOf": [ + { + "type": "null", + "description": "Skip DDC/CI detection" + }, + { + "type": "integer", + "minimum": 0, + "maximum": 400 + } + ], "default": 10 }, "compact": { @@ -1878,6 +1896,67 @@ } } }, + { + "title": "Codec", + "type": "object", + "additionalProperties": false, + "properties": { + "type": { + "const": "codec", + "description": "Print hardware video acceleration codec types (decode / encode)" + }, + "splitGPU": { + "description": "Whether to print each GPU separately. If false, merge codecs from all GPUs", + "type": "boolean", + "default": false + }, + "useVulkan": { + "description": "Whether to use Vulkan for codec detection instead of other platform-specific APIs", + "type": "boolean", + "default": false + }, + "showType": { + "description": "Which types of codecs to detect and show", + "type": "string", + "oneOf": [ + { + "const": "both", + "description": "Show both decoders and encoders" + }, + { + "const": "decoder", + "description": "Show only decoders" + }, + { + "const": "encoder", + "description": "Show only encoders" + } + ], + "default": "both" + }, + "key": { + "$ref": "#/$defs/key" + }, + "keyColor": { + "$ref": "#/$defs/keyColor" + }, + "keyIcon": { + "$ref": "#/$defs/keyIcon" + }, + "keyWidth": { + "$ref": "#/$defs/keyWidth" + }, + "outputColor": { + "$ref": "#/$defs/outputColor" + }, + "format": { + "$ref": "#/$defs/codecFormat" + }, + "condition": { + "$ref": "#/$defs/conditions" + } + } + }, { "title": "CPU", "type": "object", diff --git a/presets/all.jsonc b/presets/all.jsonc index 74bea1f352..c9f951659e 100644 --- a/presets/all.jsonc +++ b/presets/all.jsonc @@ -50,6 +50,10 @@ "driverSpecific": true, "temp": true }, + { + "type": "codec", + "splitGPU": true + }, "memory", "physicalmemory", { diff --git a/presets/ci.jsonc b/presets/ci.jsonc index d9946454fe..52eb9b4427 100644 --- a/presets/ci.jsonc +++ b/presets/ci.jsonc @@ -52,6 +52,10 @@ "driverSpecific": true, "temp": true }, + { + "type": "codec", + "splitGPU": true + }, "memory", "physicalmemory", { diff --git a/presets/examples/10.jsonc b/presets/examples/10.jsonc index 4f342b10bf..790ebe2a4f 100644 --- a/presets/examples/10.jsonc +++ b/presets/examples/10.jsonc @@ -1,6 +1,3 @@ -// Load with --config examples/2.jsonc -// Note that you must replace the image path to an existing image to display it. - { "$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json", "logo": { diff --git a/presets/examples/6.jsonc b/presets/examples/6.jsonc index c82b8af102..a71fe24b63 100644 --- a/presets/examples/6.jsonc +++ b/presets/examples/6.jsonc @@ -1,6 +1,3 @@ -// Load with --config examples/2.jsonc -// Note that you must replace the image path to an existing image to display it. - { "$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json", "display": { diff --git a/presets/examples/7.jsonc b/presets/examples/7.jsonc index b17e5d39c0..aaea47a864 100644 --- a/presets/examples/7.jsonc +++ b/presets/examples/7.jsonc @@ -1,6 +1,3 @@ -// Load with --config examples/2.jsonc -// Note that you must replace the image path to an existing image to display it. - { "$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json", "logo": { diff --git a/scripts/gen-man.py b/scripts/gen-man.py index 1976e1d3a4..f87a8b7abf 100755 --- a/scripts/gen-man.py +++ b/scripts/gen-man.py @@ -33,7 +33,7 @@ # path to the current directory pathToCurrentDir = path.dirname(__file__) # path to the JSON option file -pathToHelpFile = path.join(pathToCurrentDir, "../src/data/help.json") +pathToHelpFile = path.join(pathToCurrentDir, "../doc/help.json") # man page section manSection = 1 # title (center header) diff --git a/src/common/FFstrbuf.h b/src/common/FFstrbuf.h index 2c9a09b9bd..2279152dbf 100644 --- a/src/common/FFstrbuf.h +++ b/src/common/FFstrbuf.h @@ -9,6 +9,7 @@ #include #include #include +#include "common/memrchr.h" #ifdef FF_USE_SYSTEM_YYJSON #include @@ -71,11 +72,6 @@ bool ffStrbufRemoveSubstr(FFstrbuf* strbuf, uint32_t startIndex, uint32_t endInd void ffStrbufRemoveS(FFstrbuf* strbuf, const char* str); void ffStrbufRemoveStrings(FFstrbuf* strbuf, uint32_t numStrings, const char* strings[]); -FF_A_NODISCARD uint32_t ffStrbufNextIndexC(const FFstrbuf* strbuf, uint32_t start, char c); -FF_A_NODISCARD uint32_t ffStrbufNextIndexS(const FFstrbuf* strbuf, uint32_t start, const char* str); - -FF_A_NODISCARD uint32_t ffStrbufPreviousIndexC(const FFstrbuf* strbuf, uint32_t start, char c); - void ffStrbufReplaceAllC(FFstrbuf* strbuf, char find, char replace); // Returns true if the strbuf is modified @@ -417,6 +413,27 @@ static inline FF_A_NODISCARD bool ffStrbufContainIgnCase(const FFstrbuf* strbuf, return ffStrbufContainIgnCaseS(strbuf, str->chars); } +FF_A_NODISCARD static inline uint32_t ffStrbufNextIndexC(const FFstrbuf* strbuf, uint32_t start, char c) { + assert(start <= strbuf->length); + + const char* ptr = (const char*) memchr(strbuf->chars + start, c, strbuf->length - start); + return ptr ? (uint32_t) (ptr - strbuf->chars) : strbuf->length; +} + +FF_A_NODISCARD static inline uint32_t ffStrbufNextIndexS(const FFstrbuf* strbuf, uint32_t start, const char* str) { + assert(start <= strbuf->length); + + const char* ptr = strstr(strbuf->chars + start, str); + return ptr ? (uint32_t) (ptr - strbuf->chars) : strbuf->length; +} + +FF_A_NODISCARD static inline uint32_t ffStrbufPreviousIndexC(const FFstrbuf* strbuf, uint32_t start, char c) { + assert(start <= strbuf->length); + + const char* ptr = (const char*) memrchr(strbuf->chars, c, start + 1); + return ptr ? (uint32_t) (ptr - strbuf->chars) : strbuf->length; +} + static inline FF_A_NODISCARD uint32_t ffStrbufFirstIndexC(const FFstrbuf* strbuf, char c) { return ffStrbufNextIndexC(strbuf, 0, c); } diff --git a/src/common/apple/smc_temps.c b/src/common/apple/smc_temps.c index a71f94a5da..6669c31259 100644 --- a/src/common/apple/smc_temps.c +++ b/src/common/apple/smc_temps.c @@ -1,6 +1,6 @@ #include "smc_temps.h" #include "common/apple/cf_helpers.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include #include diff --git a/src/common/apple/version.h b/src/common/apple/version.h new file mode 100644 index 0000000000..d15acb4f8c --- /dev/null +++ b/src/common/apple/version.h @@ -0,0 +1,5 @@ +#pragma once + +#include "fastfetch.h" + +bool ffGetAppNameAndVersion(const char* exePath, FFstrbuf* retName, FFstrbuf* retVersion); diff --git a/src/common/apple/version.m b/src/common/apple/version.m new file mode 100644 index 0000000000..133ec5b196 --- /dev/null +++ b/src/common/apple/version.m @@ -0,0 +1,43 @@ +#include "common/apple/version.h" +#include "common/strutil.h" + +#import + +#define APP_CONTENTS_MACOS ".app/Contents/MacOS" + +bool ffGetAppNameAndVersion(const char* exePath, FFstrbuf* retName, FFstrbuf* retVersion) { + char* lastSlash = strrchr(exePath, '/'); + if (!lastSlash) { + return false; + } + if ((size_t) (lastSlash - exePath) > strlen("X" APP_CONTENTS_MACOS) && memcmp(lastSlash - strlen(APP_CONTENTS_MACOS), APP_CONTENTS_MACOS, strlen(APP_CONTENTS_MACOS)) != 0) { + return false; + } + + lastSlash -= strlen("MacOS"); + char infoPlistPath[PATH_MAX]; + memcpy(infoPlistPath, exePath, lastSlash - exePath); + memcpy(infoPlistPath + (lastSlash - exePath), "Info.plist", sizeof("Info.plist")); // X.app/Contents/Info.plist + NSError* error; + NSDictionary* dict = [NSDictionary dictionaryWithContentsOfURL:[NSURL fileURLWithPath:@(infoPlistPath)] + error:&error]; + if (!dict) { + return false; + } + + if (retName) { + NSString* bundleName = dict[@"CFBundleDisplayName"] ?: dict[@"CFBundleName"]; + if (bundleName) { + ffStrbufSetS(retName, bundleName.UTF8String); + } + } + + if (retVersion) { + NSString* bundleVersion = dict[@"CFBundleShortVersionString"]; + if (bundleVersion) { + ffStrbufSetS(retVersion, bundleVersion.UTF8String); + } + } + + return true; +} diff --git a/src/common/arrayUtils.h b/src/common/arrutil.h similarity index 100% rename from src/common/arrayUtils.h rename to src/common/arrutil.h diff --git a/src/common/attributes.h b/src/common/attributes.h index 8cfba29c4c..ff1e66067b 100644 --- a/src/common/attributes.h +++ b/src/common/attributes.h @@ -16,3 +16,4 @@ #define FF_A_UNUSED __attribute__((__unused__)) #define FF_A_PACKED __attribute__((__packed__)) #define FF_A_WEAK_IMPORT __attribute__((__weak_import__)) +#define FF_A_ALWAYS_INLINE __attribute__((__always_inline__)) diff --git a/src/common/format.h b/src/common/format.h index f47fc86127..5be5dffae7 100644 --- a/src/common/format.h +++ b/src/common/format.h @@ -9,6 +9,6 @@ typedef struct FFformatarg { } FFformatarg; void ffFormatAppendFormatArg(FFstrbuf* buffer, const FFformatarg* formatarg); -void ffParseFormatString(FFstrbuf* buffer, const FFstrbuf* formatstr, uint32_t numArgs, const FFformatarg* arguments); +bool ffParseFormatString(FFstrbuf* buffer, const FFstrbuf* formatstr, uint32_t numArgs, const FFformatarg* arguments); #define FF_PARSE_FORMAT_STRING_CHECKED(buffer, formatstr, arguments) \ ffParseFormatString((buffer), (formatstr), sizeof(arguments) / sizeof(*arguments), (arguments)); diff --git a/src/common/impl/FFPlatform.c b/src/common/impl/FFPlatform.c index 4366bc10ed..ff4c45cd21 100644 --- a/src/common/impl/FFPlatform.c +++ b/src/common/impl/FFPlatform.c @@ -1,5 +1,5 @@ #include "FFPlatform_private.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include "common/io.h" #include "detection/version/version.h" diff --git a/src/common/impl/FFPlatform_unix.c b/src/common/impl/FFPlatform_unix.c index 76afb3597e..de69f6bef6 100644 --- a/src/common/impl/FFPlatform_unix.c +++ b/src/common/impl/FFPlatform_unix.c @@ -1,7 +1,7 @@ #include "FFPlatform_private.h" #include "common/FFstrbuf.h" -#include "common/arrayUtils.h" -#include "common/stringUtils.h" +#include "common/arrutil.h" +#include "common/strutil.h" #include "common/io.h" #include "fastfetch_config.h" diff --git a/src/common/impl/FFPlatform_windows.c b/src/common/impl/FFPlatform_windows.c index e483071e01..083d20aa00 100644 --- a/src/common/impl/FFPlatform_windows.c +++ b/src/common/impl/FFPlatform_windows.c @@ -1,7 +1,7 @@ #include "FFPlatform_private.h" #include "common/io.h" #include "common/library.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include "common/windows/unicode.h" #include "common/windows/registry.h" #include "common/windows/nt.h" diff --git a/src/common/impl/FFstrbuf.c b/src/common/impl/FFstrbuf.c index 8005753dff..1f6477ba7b 100644 --- a/src/common/impl/FFstrbuf.c +++ b/src/common/impl/FFstrbuf.c @@ -1,6 +1,6 @@ #include "common/FFstrbuf.h" #include "common/mallocHelper.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include #include @@ -411,32 +411,6 @@ void ffStrbufRemoveStrings(FFstrbuf* strbuf, uint32_t numStrings, const char* st } } -uint32_t ffStrbufNextIndexC(const FFstrbuf* strbuf, uint32_t start, char c) { - assert(start <= strbuf->length); - - const char* ptr = (const char*) memchr(strbuf->chars + start, c, strbuf->length - start); - return ptr ? (uint32_t) (ptr - strbuf->chars) : strbuf->length; -} - -uint32_t ffStrbufNextIndexS(const FFstrbuf* strbuf, uint32_t start, const char* str) { - assert(start <= strbuf->length); - - const char* ptr = strstr(strbuf->chars + start, str); - return ptr ? (uint32_t) (ptr - strbuf->chars) : strbuf->length; -} - -uint32_t ffStrbufPreviousIndexC(const FFstrbuf* strbuf, uint32_t start, char c) { - assert(start <= strbuf->length); - - // We need to loop one higher than the actual index, because uint32_t is guaranteed to be >= 0, so this statement would always be true - for (uint32_t i = start + 1; i > 0; i--) { - if (strbuf->chars[i - 1] == c) { - return i - 1; - } - } - return strbuf->length; -} - void ffStrbufReplaceAllC(FFstrbuf* strbuf, char find, char replace) { if (strbuf->length == 0) { return; diff --git a/src/common/impl/binary_apple.c b/src/common/impl/binary_apple.c index de2c87638a..84781693a9 100644 --- a/src/common/impl/binary_apple.c +++ b/src/common/impl/binary_apple.c @@ -1,6 +1,6 @@ #include "common/binary.h" #include "common/io.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include #include diff --git a/src/common/impl/binary_linux.c b/src/common/impl/binary_linux.c index ac04bf71b8..9a24217326 100644 --- a/src/common/impl/binary_linux.c +++ b/src/common/impl/binary_linux.c @@ -4,7 +4,7 @@ #include "common/io.h" #include "common/library.h" - #include "common/stringUtils.h" + #include "common/strutil.h" #include // #1254 #include diff --git a/src/common/impl/binary_windows.c b/src/common/impl/binary_windows.c index 4bf2f4644a..918cad5312 100644 --- a/src/common/impl/binary_windows.c +++ b/src/common/impl/binary_windows.c @@ -1,6 +1,6 @@ #include "common/binary.h" #include "common/io.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include "common/windows/nt.h" #include diff --git a/src/common/impl/commandoption.c b/src/common/impl/commandoption.c index e855b0ae77..2f548dfada 100644 --- a/src/common/impl/commandoption.c +++ b/src/common/impl/commandoption.c @@ -3,7 +3,7 @@ #include "common/printing.h" #include "common/time.h" #include "common/jsonconfig.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include "fastfetch_datatext.h" #include "modules/modules.h" @@ -70,12 +70,15 @@ void ffPrepareCommandOption(FFdata* data) { #define FF_IF_MODULE_MATCH(moduleNameConstant) if (moduleLen == strlen(moduleNameConstant) && ffStrEqualsIgnCase(moduleType, moduleNameConstant) && !ffStrbufSeparatedContainIgnCaseS(&data->structureDisabled, moduleNameConstant, ':')) switch (moduleType[0]) { + #if !FF_MODULE_DISABLE_CPUUSAGE case 'C': case 'c': FF_IF_MODULE_MATCH(FF_CPUUSAGE_MODULE_NAME) ffPrepareCPUUsage(); break; + #endif + #if !FF_MODULE_DISABLE_DISKIO case 'D': case 'd': FF_IF_MODULE_MATCH(FF_DISKIO_MODULE_NAME) { @@ -84,7 +87,9 @@ void ffPrepareCommandOption(FFdata* data) { ffPrepareDiskIO(&options); } break; + #endif + #if !FF_MODULE_DISABLE_NETIO case 'N': case 'n': FF_IF_MODULE_MATCH(FF_NETIO_MODULE_NAME) { @@ -93,7 +98,9 @@ void ffPrepareCommandOption(FFdata* data) { ffPrepareNetIO(&options); } break; + #endif + #if !FF_MODULE_DISABLE_PUBLICIP case 'P': case 'p': FF_IF_MODULE_MATCH(FF_PUBLICIP_MODULE_NAME) { @@ -102,7 +109,9 @@ void ffPrepareCommandOption(FFdata* data) { ffPreparePublicIp(&options); } break; + #endif + #if !FF_MODULE_DISABLE_WEATHER case 'W': case 'w': FF_IF_MODULE_MATCH(FF_WEATHER_MODULE_NAME) { @@ -111,6 +120,7 @@ void ffPrepareCommandOption(FFdata* data) { ffPrepareWeather(&options); } break; + #endif } #undef FF_IF_MODULE_MATCH @@ -221,7 +231,7 @@ void ffPrintCommandOption(FFdata* data) { : FF_COLOR_FG_RED), ms); } - printf("\e7\e[1A\e[9999999C\e[%dD%s\e8", len, str); // Save; Up 1; Right 9999999; Left ; Print ; Load + printf("\e7\e[1A\e[9999999C\e[%dD%s\e8", len - 1, str); // Save; Up 1; Right 9999999; Left ; Print ; Load } } diff --git a/src/common/impl/dbus.c b/src/common/impl/dbus.c index 5b7ae73895..473af2d200 100644 --- a/src/common/impl/dbus.c +++ b/src/common/impl/dbus.c @@ -3,7 +3,7 @@ #ifdef FF_HAVE_DBUS #include "common/thread.h" - #include "common/stringUtils.h" + #include "common/strutil.h" static bool loadLibSymbols(FFDBusLibrary* lib) { FF_LIBRARY_LOAD(dbus, false, "libdbus-1" FF_LIBRARY_EXTENSION, 4); diff --git a/src/common/impl/font.c b/src/common/impl/font.c index 3bd19d4524..93feff15c7 100644 --- a/src/common/impl/font.c +++ b/src/common/impl/font.c @@ -1,7 +1,7 @@ #include "fastfetch.h" #include "common/FFlist.h" #include "common/FFstrbuf.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include "common/font.h" #include diff --git a/src/common/impl/format.c b/src/common/impl/format.c index 175941410b..b230db7bbd 100644 --- a/src/common/impl/format.c +++ b/src/common/impl/format.c @@ -2,7 +2,8 @@ #include "common/format.h" #include "common/parsing.h" #include "common/textModifier.h" -#include "common/stringUtils.h" +#include "common/strutil.h" +#include "common/library.h" #include @@ -111,7 +112,347 @@ static inline bool formatArgSet(const FFformatarg* arg) { return arg->value != NULL && ((arg->type == FF_ARG_TYPE_DOUBLE && *(double*) arg->value > 0.0) || (arg->type == FF_ARG_TYPE_FLOAT && *(float*) arg->value > 0.0) || (arg->type == FF_ARG_TYPE_INT && *(int32_t*) arg->value > 0) || (arg->type == FF_ARG_TYPE_STRBUF && ((FFstrbuf*) arg->value)->length > 0) || (arg->type == FF_ARG_TYPE_STRING && ffStrSet((char*) arg->value)) || (arg->type == FF_ARG_TYPE_UINT8 && *(uint8_t*) arg->value > 0) || (arg->type == FF_ARG_TYPE_UINT16 && *(uint16_t*) arg->value > 0) || (arg->type == FF_ARG_TYPE_UINT && *(uint32_t*) arg->value > 0) || (arg->type == FF_ARG_TYPE_UINT64 && *(uint64_t*) arg->value > 0) || (arg->type == FF_ARG_TYPE_BOOL && *(bool*) arg->value) || (arg->type == FF_ARG_TYPE_LIST && ((FFlist*) arg->value)->length > 0)); } -void ffParseFormatString(FFstrbuf* buffer, const FFstrbuf* formatstr, uint32_t numArgs, const FFformatarg* arguments) { +FF_A_UNUSED static inline void normalizeArgName(FFstrbuf* dst, const char* src) { + ffStrbufClear(dst); + bool flag = false; + for (const char* p = src; *p; ++p) { + if (*p == '-') { + flag = true; + } else if (flag) { + ffStrbufAppendC(dst, (char) toupper((unsigned char) *p)); + flag = false; + } else { + ffStrbufAppendC(dst, *p); + } + } +} + +#if FF_HAVE_LUA + #include "common/lua.h" + +static void appendLuaError(FFstrbuf* buffer, const char* prefix, lua_State* L) { + const char* err = lua_tolstring(L, -1, NULL); + if (err) { + const char* tmp = strchr(err, ':'); + if (tmp) { + err = tmp + 1; + while (*err == ' ') { + ++err; + } + } + } + ffStrbufAppendF(buffer, "%s: %s", prefix, err ? err : "unknown"); +} + +static bool parseLuaString(FFstrbuf* buffer, const char* script, uint32_t scriptLen, uint32_t numArgs, const FFformatarg* arguments) { + const char* err = ffLuaLoadState(); + if (err) { + ffStrbufAppendF(buffer, "Lua init error: %s", err); + return false; + } + + FF_STRBUF_AUTO_DESTROY argNameBuf = ffStrbufCreate(); + bool ret = false; + + lua_State* L = luaData.L; + // Clear stack and load chunk + lua_settop(L, 0); + if (luaL_loadbuffer(L, script, scriptLen, "") != LUA_OK) { + appendLuaError(buffer, "Lua load error", L); + } else { + // Build args table for name lookup only. + lua_createtable(L, 0, 0); + + for (uint32_t i = 0; i < numArgs; ++i) { + const FFformatarg* arg = &arguments[i]; + switch (arg->type) { + case FF_ARG_TYPE_INT: + lua_pushinteger(L, (lua_Integer) * (int32_t*) arg->value); + break; + case FF_ARG_TYPE_UINT: + lua_pushinteger(L, (lua_Integer) * (uint32_t*) arg->value); + break; + case FF_ARG_TYPE_UINT64: + lua_pushinteger(L, (lua_Integer) * (uint64_t*) arg->value); + break; + case FF_ARG_TYPE_UINT16: + lua_pushinteger(L, (lua_Integer) * (uint16_t*) arg->value); + break; + case FF_ARG_TYPE_UINT8: + lua_pushinteger(L, (lua_Integer) * (uint8_t*) arg->value); + break; + case FF_ARG_TYPE_FLOAT: + lua_pushnumber(L, (lua_Number) * (float*) arg->value); + break; + case FF_ARG_TYPE_DOUBLE: + lua_pushnumber(L, (lua_Number) * (double*) arg->value); + break; + case FF_ARG_TYPE_BOOL: + lua_pushboolean(L, *(bool*) arg->value); + break; + case FF_ARG_TYPE_STRING: + lua_pushstring(L, (const char*) arg->value); + break; + case FF_ARG_TYPE_STRBUF: { + const FFstrbuf* sb = (const FFstrbuf*) arg->value; + lua_pushlstring(L, sb->chars, sb->length); + break; + } + case FF_ARG_TYPE_LIST: { + const FFlist* list = (const FFlist*) arg->value; + lua_createtable(L, 0, 0); + for (uint32_t li = 0; li < list->length; ++li) { + const FFstrbuf* item = FF_LIST_GET(FFstrbuf, *list, li); + lua_pushlstring(L, item->chars, item->length); + lua_seti(L, -2, (lua_Integer) (li + 1)); + } + break; + } + default: + lua_pushnil(L); + break; + } + if (arg->name && arg->name[0]) { + normalizeArgName(&argNameBuf, arg->name); + } else { + ffStrbufSetF(&argNameBuf, "arg%" PRIu32, i + 1); + } + lua_setfield(L, -2, argNameBuf.chars); + } + + if (lua_pcall(L, 1, LUA_MULTRET, 0) != LUA_OK) { + appendLuaError(buffer, "Lua runtime error", L); + } else { + int nresults = lua_gettop(L); + if (nresults == 0) { + ffStrbufAppendS(buffer, "Lua result error: no result"); + } else { + // Convert first result to string + const char* res = lua_tolstring(L, 1, NULL); + if (res) { + ffStrbufAppendS(buffer, res); + } else { + // Fallback: use luaL_tolstring to get a reasonable representation + luaL_tolstring(L, 1, NULL); + const char* sval = lua_tolstring(L, -1, NULL); + if (sval) { + ffStrbufAppendS(buffer, sval); + } + } + ret = true; + } + } + } + lua_settop(L, 0); + return ret; +} +#endif + +#if FF_HAVE_QUICKJS + #include + +struct FFQuickJSData { + FF_LIBRARY_SYMBOL(JS_NewRuntime) + FF_LIBRARY_SYMBOL(JS_NewContext) + FF_LIBRARY_SYMBOL(JS_FreeRuntime) + FF_LIBRARY_SYMBOL(JS_EvalThis) + FF_LIBRARY_SYMBOL(JS_GetException) + FF_LIBRARY_SYMBOL(JS_ToCStringLen2) + FF_LIBRARY_SYMBOL(JS_FreeCString) + FF_LIBRARY_SYMBOL(JS_NewStringLen) + FF_LIBRARY_SYMBOL(JS_NewArray) + FF_LIBRARY_SYMBOL(JS_NewBigUint64) + FF_LIBRARY_SYMBOL(JS_SetPropertyUint32) + FF_LIBRARY_SYMBOL(JS_NewObject) + FF_LIBRARY_SYMBOL(JS_SetPropertyStr) + FF_LIBRARY_SYMBOL(JS_FreeValue) + + JSRuntime* rt; + JSContext* ctx; + bool inited; +} qjsData; + +static const char* loadQuickJSState(void) { + if (qjsData.inited) { + if (qjsData.ctx == NULL) { + return "QuickJS is not available"; + } + return NULL; + } + + qjsData.inited = true; + #ifdef _WIN32 + FF_LIBRARY_LOAD_MESSAGE(libqjs, "libqjs-0" FF_LIBRARY_EXTENSION, 0) + #else + FF_LIBRARY_LOAD_MESSAGE(libqjs, "libqjs" FF_LIBRARY_EXTENSION, 0) + #endif + + FF_LIBRARY_LOAD_SYMBOL_VAR_MESSAGE(libqjs, qjsData, JS_NewRuntime) + FF_LIBRARY_LOAD_SYMBOL_VAR_MESSAGE(libqjs, qjsData, JS_NewContext) + FF_LIBRARY_LOAD_SYMBOL_VAR_MESSAGE(libqjs, qjsData, JS_FreeRuntime) + FF_LIBRARY_LOAD_SYMBOL_VAR_MESSAGE(libqjs, qjsData, JS_EvalThis) + FF_LIBRARY_LOAD_SYMBOL_VAR_MESSAGE(libqjs, qjsData, JS_GetException) + FF_LIBRARY_LOAD_SYMBOL_VAR_MESSAGE(libqjs, qjsData, JS_ToCStringLen2) + FF_LIBRARY_LOAD_SYMBOL_VAR_MESSAGE(libqjs, qjsData, JS_FreeCString) + FF_LIBRARY_LOAD_SYMBOL_VAR_MESSAGE(libqjs, qjsData, JS_NewStringLen) + FF_LIBRARY_LOAD_SYMBOL_VAR_MESSAGE(libqjs, qjsData, JS_NewArray) + FF_LIBRARY_LOAD_SYMBOL_VAR_MESSAGE(libqjs, qjsData, JS_SetPropertyUint32) + FF_LIBRARY_LOAD_SYMBOL_VAR_MESSAGE(libqjs, qjsData, JS_NewObject) + FF_LIBRARY_LOAD_SYMBOL_VAR_MESSAGE(libqjs, qjsData, JS_SetPropertyStr) + FF_LIBRARY_LOAD_SYMBOL_VAR_MESSAGE(libqjs, qjsData, JS_FreeValue) + + qjsData.rt = qjsData.ffJS_NewRuntime(); + if (qjsData.rt == NULL) { + return "JS_NewRuntime() failed"; + } + + qjsData.ctx = qjsData.ffJS_NewContext(qjsData.rt); + if (qjsData.ctx == NULL) { + qjsData.ffJS_FreeRuntime(qjsData.rt); + qjsData.rt = NULL; + return "JS_NewContext() failed"; + } + + libqjs = NULL; // don't close quickjs + + return NULL; +} + +static bool parseQuickJSString(FFstrbuf* buffer, const char* script, uint32_t scriptLen, uint32_t numArgs, const FFformatarg* arguments) { + const char* err = loadQuickJSState(); + if (err) { + ffStrbufAppendF(buffer, "Qjs init error: %s", err); + return false; + } + JSContext* ctx = qjsData.ctx; + JSValue argsObj = qjsData.ffJS_NewObject(ctx); + FF_STRBUF_AUTO_DESTROY argNameBuf = ffStrbufCreate(); + + for (uint32_t i = 0; i < numArgs; ++i) { + const FFformatarg* arg = &arguments[i]; + + JSValue value; + switch (arg->type) { + case FF_ARG_TYPE_INT: + value = JS_NewInt32(ctx, *(int32_t*) arg->value); + break; + case FF_ARG_TYPE_UINT: + value = JS_NewUint32(ctx, *(uint32_t*) arg->value); + break; + case FF_ARG_TYPE_UINT64: { + uint64_t val = *(uint64_t*) arg->value; + if (val <= INT32_MAX) { + value = JS_NewInt32(ctx, (int32_t) val); + } else { + value = JS_NewFloat64(ctx, (double) val); + } + break; + } + case FF_ARG_TYPE_UINT16: + value = JS_NewUint32(ctx, *(uint16_t*) arg->value); + break; + case FF_ARG_TYPE_UINT8: + value = JS_NewUint32(ctx, *(uint8_t*) arg->value); + break; + case FF_ARG_TYPE_FLOAT: + value = JS_NewFloat64(ctx, *(float*) arg->value); + break; + case FF_ARG_TYPE_DOUBLE: + value = JS_NewFloat64(ctx, *(double*) arg->value); + break; + case FF_ARG_TYPE_BOOL: + value = JS_NewBool(ctx, *(bool*) arg->value); + break; + case FF_ARG_TYPE_STRING: + value = qjsData.ffJS_NewStringLen(ctx, (const char*) arg->value, strlen((const char*) arg->value)); + break; + case FF_ARG_TYPE_STRBUF: { + const FFstrbuf* sb = (const FFstrbuf*) arg->value; + value = qjsData.ffJS_NewStringLen(ctx, sb->chars, sb->length); + break; + } + case FF_ARG_TYPE_LIST: { + const FFlist* list = (const FFlist*) arg->value; + JSValue arr = qjsData.ffJS_NewArray(ctx); + for (uint32_t li = 0; li < list->length; ++li) { + const FFstrbuf* item = FF_LIST_GET(FFstrbuf, *list, li); + JSValue itemValue = qjsData.ffJS_NewStringLen(ctx, item->chars, item->length); + qjsData.ffJS_SetPropertyUint32(ctx, arr, li, itemValue); + } + + value = arr; + break; + } + default: + value = JS_UNDEFINED; + break; + } + + if (arg->name && arg->name[0]) { + normalizeArgName(&argNameBuf, arg->name); + } else { + ffStrbufSetF(&argNameBuf, "arg%" PRIu32, i + 1); + } + qjsData.ffJS_SetPropertyStr(ctx, argsObj, argNameBuf.chars, value); + } + JSValue result = qjsData.ffJS_EvalThis(ctx, argsObj, script, scriptLen, "", JS_EVAL_TYPE_GLOBAL | JS_EVAL_FLAG_STRICT); + + qjsData.ffJS_FreeValue(ctx, argsObj); + + bool ret = false; + if (JS_IsException(result)) { + JSValue exc = qjsData.ffJS_GetException(ctx); + const char* message = qjsData.ffJS_ToCStringLen2(ctx, NULL, exc, false); + qjsData.ffJS_FreeValue(ctx, exc); + ffStrbufAppendF(buffer, "Qjs runtime error: %s", message ?: "unknown"); + if (message) { + qjsData.ffJS_FreeCString(ctx, message); + } + } else if (JS_IsUndefined(result)) { + ffStrbufAppendS(buffer, "Qjs result error: undefined result"); + } else { + size_t len; + const char* res = qjsData.ffJS_ToCStringLen2(ctx, &len, result, false); + if (res) { + ffStrbufAppendNS(buffer, (uint32_t) len, res); + qjsData.ffJS_FreeCString(ctx, res); + } + ret = true; + } + + qjsData.ffJS_FreeValue(ctx, result); + return ret; +} +#endif + +static bool skipAnsiEscape(FFstrbuf* in, FFstrbuf* out, FFstrbuf* trailingEscape) { + if (__builtin_expect(in->chars[0] == '\e' && in->chars[1] == '[', false)) { + // skip ANSI escape codes at the start of the string for truncation + const char* p = in->chars + 2; + while (*p && (ffCharIsDigit(*p) || *p == ';')) { + ++p; + } + if (*p && isascii(*p)) { + ++p; + } + uint32_t prefixLen = (uint32_t) (p - in->chars); + ffStrbufAppendNS(out, prefixLen, in->chars); + ffStrbufSubstrAfter(in, prefixLen - 1); + + if (trailingEscape) { + // likely have a `CSI m` reset at the end of the string + uint32_t iLastEscape = ffStrbufLastIndexC(in, '\e'); + if (iLastEscape != in->length) { + ffStrbufSetNS(trailingEscape, in->length - iLastEscape, in->chars + iLastEscape); + ffStrbufSubstrBefore(in, iLastEscape); + } + } + return true; + } + return false; +} + +static bool parseFormatString(FFstrbuf* buffer, const FFstrbuf* formatstr, uint32_t numArgs, const FFformatarg* arguments) { uint32_t argCounter = 0; uint32_t numOpenIfs = 0; @@ -129,6 +470,12 @@ void ffParseFormatString(FFstrbuf* buffer, const FFstrbuf* formatstr, uint32_t n // jump to next char, the start of the placeholder value ++i; + // unmatched trailing '{' + if (i >= formatstr->length) { + ffStrbufAppendC(buffer, '{'); + break; + } + // double {{ elvaluates to a single { and doesn't count as start if (formatstr->chars[i] == '{') { ffStrbufAppendC(buffer, '{'); @@ -267,7 +614,7 @@ void ffParseFormatString(FFstrbuf* buffer, const FFstrbuf* formatstr, uint32_t n char* pSep = placeholderValue.chars; char cSep = '\0'; - while (*pSep && *pSep != ':' && *pSep != '<' && *pSep != '>' && *pSep != '~') { + while (*pSep && *pSep != ':' && *pSep != '<' && *pSep != '>' && *pSep != '|' && *pSep != '~') { ++pSep; } if (*pSep) { @@ -297,6 +644,8 @@ void ffParseFormatString(FFstrbuf* buffer, const FFstrbuf* formatstr, uint32_t n } else if (cSep == '~') { FF_STRBUF_AUTO_DESTROY tempString = ffStrbufCreate(); ffFormatAppendFormatArg(&tempString, &arguments[index - 1]); + FF_STRBUF_AUTO_DESTROY trailingEscape = ffStrbufCreate(); + skipAnsiEscape(&tempString, buffer, &trailingEscape); char* pEnd = NULL; int32_t start = (int32_t) strtol(pSep + 1, &pEnd, 10); @@ -322,6 +671,10 @@ void ffParseFormatString(FFstrbuf* buffer, const FFstrbuf* formatstr, uint32_t n } } + if (trailingEscape.length > 0) { + ffStrbufAppend(buffer, &trailingEscape); + } + if (*pEnd) { *pSep = cSep; appendInvalidPlaceholder(buffer, "{", &placeholderValue, i, formatstr->length); @@ -344,6 +697,9 @@ void ffParseFormatString(FFstrbuf* buffer, const FFstrbuf* formatstr, uint32_t n FF_STRBUF_AUTO_DESTROY tempString = ffStrbufCreate(); ffFormatAppendFormatArg(&tempString, &arguments[index - 1]); + FF_STRBUF_AUTO_DESTROY trailingEscape = ffStrbufCreate(); + skipAnsiEscape(&tempString, buffer, &trailingEscape); + if (tempString.length == (uint32_t) truncLength) { ffStrbufAppend(buffer, &tempString); } else if (tempString.length > (uint32_t) truncLength) { @@ -361,18 +717,46 @@ void ffParseFormatString(FFstrbuf* buffer, const FFstrbuf* formatstr, uint32_t n } else if (cSep == ':') { ffStrbufAppend(buffer, &tempString); } else { - if (cSep == '<') { + if (cSep == '<') { // left align ffStrbufAppend(buffer, &tempString); ffStrbufAppendNC(buffer, (uint32_t) truncLength - tempString.length, ' '); - } else { + } else if (cSep == '>') { // right align ffStrbufAppendNC(buffer, (uint32_t) truncLength - tempString.length, ' '); ffStrbufAppend(buffer, &tempString); + } else if (cSep == '|') { // center align + uint32_t padding = ((uint32_t) truncLength - tempString.length) / 2; + ffStrbufAppendNC(buffer, padding, ' '); + ffStrbufAppend(buffer, &tempString); + ffStrbufAppendNC(buffer, (uint32_t) truncLength - tempString.length - padding, ' '); } } + + if (trailingEscape.length > 0) { + ffStrbufAppend(buffer, &trailingEscape); + } } } if (!instance.config.display.pipe) { ffStrbufAppendS(buffer, FASTFETCH_TEXT_MODIFIER_RESET); } + + return true; +} + +bool ffParseFormatString(FFstrbuf* buffer, const FFstrbuf* formatstr, uint32_t numArgs, const FFformatarg* arguments) { +#if FF_HAVE_QUICKJS + if (ffStrbufStartsWithS(formatstr, "qjs:")) { + return parseQuickJSString(buffer, formatstr->chars + 4, formatstr->length - 4, numArgs, arguments); + } +#endif + +#if FF_HAVE_LUA + if (ffStrbufStartsWithS(formatstr, "lua:")) { + // If outputFormat starts with "lua:", treat the rest as a Lua script + return parseLuaString(buffer, formatstr->chars + 4, formatstr->length - 4, numArgs, arguments); + } +#endif + + return parseFormatString(buffer, formatstr, numArgs, arguments); } diff --git a/src/common/impl/init.c b/src/common/impl/init.c index 1d3fa8cccd..f0fc0a2f32 100644 --- a/src/common/impl/init.c +++ b/src/common/impl/init.c @@ -29,6 +29,7 @@ static void initState(FFstate* state) { ffPlatformInit(&state->platform); state->dynamicInterval = 0; + #if !FF_MODULE_DISABLE_TERMINALTHEME { // don't enable bright color if the terminal is in light mode FFTerminalThemeResult result; @@ -36,6 +37,7 @@ static void initState(FFstate* state) { state->terminalLightTheme = true; } } + #endif } static void defaultConfig(void) { @@ -173,6 +175,15 @@ void ffDestroyInstance(void) { destroyState(); } +#if FF_HAVE_LUA + #include +#endif +#if FF_HAVE_QUICKJS + #include + #define FF_STR_INDIR(x) #x + #define FF_STR(x) FF_STR_INDIR(x) +#endif + // Must be in a file compiled with the libfastfetch target, because the FF_HAVE* macros are not defined for the executable targets void ffListFeatures(void) { fputs( @@ -251,6 +262,12 @@ void ffListFeatures(void) { #if FF_HAVE_LIBZFS "libzfs\n" #endif +#if FF_HAVE_VA + "va\n" +#endif +#if FF_HAVE_VDPAU + "vdpau\n" +#endif #if FF_USE_SYSTEM_YYJSON "System yyjson\n" #endif @@ -260,6 +277,9 @@ void ffListFeatures(void) { #if FF_HAVE_EMBEDDED_PCIIDS "Embedded pciids\n" #endif +#if FF_ENABLE_WCWIDTH + "Embedded wcwidth\n" +#endif #if FF_HAVE_WINRT "WinRT headers\n" #endif @@ -268,6 +288,12 @@ void ffListFeatures(void) { #endif #if FF_APPLE_MEMSIZE_USABLE "Apple memsize_usable\n" +#endif +#if FF_HAVE_LUA + LUA_VERSION "\n" +#endif +#if FF_HAVE_QUICKJS + "QuickJS " FF_STR(QJS_VERSION_MAJOR) "." FF_STR(QJS_VERSION_MINOR) "." FF_STR(QJS_VERSION_PATCH) QJS_VERSION_SUFFIX "\n" #endif "", stdout); diff --git a/src/common/impl/io_unix.c b/src/common/impl/io_unix.c index c760861ef3..e603186117 100644 --- a/src/common/impl/io_unix.c +++ b/src/common/impl/io_unix.c @@ -1,6 +1,6 @@ #include "common/io.h" #include "fastfetch.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include "common/time.h" #include diff --git a/src/common/impl/io_windows.c b/src/common/impl/io_windows.c index cfac99e8e5..24b8d05d1e 100644 --- a/src/common/impl/io_windows.c +++ b/src/common/impl/io_windows.c @@ -1,6 +1,6 @@ #include "fastfetch.h" #include "common/io.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include "common/windows/nt.h" #include "common/windows/unicode.h" diff --git a/src/common/impl/jsonconfig.c b/src/common/impl/jsonconfig.c index e88feafc97..fccc56cc07 100644 --- a/src/common/impl/jsonconfig.c +++ b/src/common/impl/jsonconfig.c @@ -4,7 +4,7 @@ #include "common/printing.h" #include "common/io.h" #include "common/time.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include "detection/version/version.h" #include "modules/modules.h" @@ -133,6 +133,7 @@ static bool parseModuleJsonObject(const char* type, yyjson_val* jsonVal, yyjson_ static void prepareModuleJsonObject(const char* type, yyjson_val* module) { switch (type[0]) { + #if !FF_MODULE_DISABLE_CPUUSAGE case 'c': case 'C': { if (ffStrEqualsIgnCase(type, FF_CPUUSAGE_MODULE_NAME)) { @@ -147,6 +148,9 @@ static void prepareModuleJsonObject(const char* type, yyjson_val* module) { } break; } + #endif + + #if !FF_MODULE_DISABLE_DISKIO case 'd': case 'D': { if (ffStrEqualsIgnCase(type, FF_DISKIO_MODULE_NAME)) { @@ -159,6 +163,9 @@ static void prepareModuleJsonObject(const char* type, yyjson_val* module) { } break; } + #endif + + #if !FF_MODULE_DISABLE_NETIO case 'n': case 'N': { if (ffStrEqualsIgnCase(type, FF_NETIO_MODULE_NAME)) { @@ -171,6 +178,9 @@ static void prepareModuleJsonObject(const char* type, yyjson_val* module) { } break; } + #endif + + #if !FF_MODULE_DISABLE_PUBLICIP case 'p': case 'P': { if (ffStrEqualsIgnCase(type, FF_PUBLICIP_MODULE_NAME)) { @@ -183,6 +193,9 @@ static void prepareModuleJsonObject(const char* type, yyjson_val* module) { } break; } + #endif + + #if !FF_MODULE_DISABLE_WEATHER case 'w': case 'W': { if (ffStrEqualsIgnCase(type, FF_WEATHER_MODULE_NAME)) { @@ -195,6 +208,7 @@ static void prepareModuleJsonObject(const char* type, yyjson_val* module) { } break; } + #endif } } @@ -322,7 +336,7 @@ static const char* printJsonConfig(FFdata* data, bool prepare) { : FF_COLOR_FG_RED), ms); } - printf("\e7\e[1A\e[9999999C\e[%dD%s\e8", len, str); // Save; Up 1; Right 9999999; Left ; Print ; Load + printf("\e7\e[1A\e[9999999C\e[%dD%s\e8", len - 1, str); // Save; Up 1; Right 9999999; Left ; Print ; Load } } diff --git a/src/common/impl/kmod_nbsd.c b/src/common/impl/kmod_nbsd.c index 06149eab11..f1b450a9bd 100644 --- a/src/common/impl/kmod_nbsd.c +++ b/src/common/impl/kmod_nbsd.c @@ -1,5 +1,5 @@ #include "common/kmod.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include #include diff --git a/src/common/impl/kmod_sunos.c b/src/common/impl/kmod_sunos.c index de00206707..da392e26b5 100644 --- a/src/common/impl/kmod_sunos.c +++ b/src/common/impl/kmod_sunos.c @@ -1,5 +1,5 @@ #include "common/kmod.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include #include diff --git a/src/common/impl/kmod_windows.c b/src/common/impl/kmod_windows.c index b8db05210c..081e5a788c 100644 --- a/src/common/impl/kmod_windows.c +++ b/src/common/impl/kmod_windows.c @@ -1,7 +1,7 @@ #include "common/kmod.h" #include "common/windows/nt.h" #include "common/mallocHelper.h" -#include "common/stringUtils.h" +#include "common/strutil.h" bool ffKmodLoaded(const char* modName) { ULONG bufferSize = 0; diff --git a/src/common/impl/library.c b/src/common/impl/library.c index 954619a366..6f96e968b2 100644 --- a/src/common/impl/library.c +++ b/src/common/impl/library.c @@ -1,8 +1,8 @@ #include "fastfetch.h" #include "common/library.h" +#include "common/debug.h" #if _WIN32 - #include "common/debug.h" #include "common/windows/nt.h" #include #include @@ -50,6 +50,10 @@ static void* libraryLoad(const char* path, int maxVersion) { #else + if (result == NULL) { + FF_DEBUG("dlopen(\"%s\"): %s", path, dlerror()); + } + if (result != NULL || maxVersion < 0) { return result; } @@ -65,6 +69,8 @@ static void* libraryLoad(const char* path, int maxVersion) { result = dlopen(pathbuf.chars, FF_DLOPEN_FLAGS); if (result != NULL) { break; + } else { + FF_DEBUG("dlopen(\"%s\"): %s", pathbuf.chars, dlerror()); } ffStrbufSubstrBefore(&pathbuf, originalLength); diff --git a/src/common/impl/lua.c b/src/common/impl/lua.c new file mode 100644 index 0000000000..bc853c56a5 --- /dev/null +++ b/src/common/impl/lua.c @@ -0,0 +1,216 @@ +#if FF_HAVE_LUA + + #include "common/lua.h" + #include "common/mallocHelper.h" + +struct FFLuaData luaData; + +static yyjson_mut_val* lua2yyjson(lua_State* L, int idx, yyjson_mut_doc* doc) { + if (idx < 0) { + idx = lua_gettop(L) + idx + 1; + } + int type = lua_type(L, idx); + + switch (type) { + case LUA_TNIL: + return yyjson_mut_null(doc); + + case LUA_TBOOLEAN: + return yyjson_mut_bool(doc, lua_toboolean(L, idx)); + + case LUA_TNUMBER: { + if (lua_isinteger(L, idx)) { + lua_Integer i = lua_tointeger(L, idx); + return yyjson_mut_sint(doc, (int64_t) i); + } else { + return yyjson_mut_real(doc, lua_tonumber(L, idx)); + } + } + + case LUA_TSTRING: { + size_t len; + const char* str = lua_tolstring(L, idx, &len); + return yyjson_mut_strncpy(doc, str, len); + } + + case LUA_TTABLE: { + lua_Unsigned len = lua_rawlen(L, idx); + int is_array = 1; + + if (len == 0) { + lua_pushnil(L); + is_array = 0; + if (lua_next(L, idx) != 0) { + lua_pop(L, 2); + } + } else { + lua_pushnil(L); + while (lua_next(L, idx) != 0) { + if (lua_type(L, -2) != LUA_TNUMBER) { + is_array = 0; + lua_pop(L, 2); + break; + } + int isnum = false; + lua_Integer k = lua_tointegerx(L, -2, &isnum); + if (!isnum || (lua_Unsigned) k > len) { + is_array = 0; + lua_pop(L, 2); + break; + } + lua_pop(L, 1); + } + } + + if (is_array) { + yyjson_mut_val* arr = yyjson_mut_arr(doc); + for (lua_Unsigned i = 1; i <= len; i++) { + lua_rawgeti(L, idx, (lua_Integer) i); + yyjson_mut_val* val = lua2yyjson(L, -1, doc); + yyjson_mut_arr_append(arr, val); + lua_pop(L, 1); + } + return arr; + } else { + yyjson_mut_val* obj = yyjson_mut_obj(doc); + lua_pushnil(L); + while (lua_next(L, idx) != 0) { + size_t klen; + const char* key_str = luaL_tolstring(L, -2, &klen); + yyjson_mut_val* key = yyjson_mut_strncpy(doc, key_str, klen); + lua_pop(L, 1); + + yyjson_mut_val* val = lua2yyjson(L, -1, doc); + yyjson_mut_obj_add(obj, key, val); + lua_pop(L, 1); + } + return obj; + } + } + + default: + return yyjson_mut_null(doc); + } +} + +static int yyjsonEncode(lua_State* L) { + luaL_checkany(L, 1); + + bool pretty = false; + if (lua_isboolean(L, 2)) { + pretty = (int) lua_toboolean(L, 2); + } + + yyjson_mut_doc* doc = yyjson_mut_doc_new(NULL); + if (!doc) { + return luaL_error(L, "failed to create yyjson document"); + } + + yyjson_mut_val* root = lua2yyjson(L, 1, doc); + yyjson_mut_doc_set_root(doc, root); + + size_t jsonLen; + yyjson_write_err err = {}; + FF_AUTO_FREE const char* jsonStr = yyjson_mut_write_opts(doc, YYJSON_WRITE_ALLOW_INF_AND_NAN | (pretty ? YYJSON_WRITE_PRETTY_TWO_SPACES : 0), NULL, &jsonLen, &err); + + if (jsonStr) { + lua_pushlstring(L, jsonStr, jsonLen); + yyjson_mut_doc_free(doc); + return 1; + } else { + yyjson_mut_doc_free(doc); + return luaL_error(L, "failed to encode JSON: %s", err.msg); + } +} + +const char* ffLuaLoadState() { + if (luaData.inited) { + if (luaData.L == NULL) { + return "Lua library is not available"; + } + return NULL; + } + + luaData.inited = true; + // clang-format off + #ifdef _WIN32 + #define FF_LOAD_LIBLUA(version) FF_LIBRARY_LOAD_MESSAGE(liblua, \ + "lua5" #version FF_LIBRARY_EXTENSION, 0) + #else + #define FF_LOAD_LIBLUA(version) FF_LIBRARY_LOAD_MESSAGE(liblua, \ + "liblua5." #version FF_LIBRARY_EXTENSION, 0, \ + "liblua-5." #version FF_LIBRARY_EXTENSION, 0, \ + "liblua5." #version FF_LIBRARY_EXTENSION ".5." #version, 0) + #endif + // clang-format on + #if LUA_VERSION_NUM == 505 + FF_LOAD_LIBLUA(5) + #elif LUA_VERSION_NUM == 504 + FF_LOAD_LIBLUA(4) + #elif LUA_VERSION_NUM == 503 + FF_LOAD_LIBLUA(3) + #else + #error "Unsupported Lua version" + #endif + #undef FF_LOAD_LIBLUA + FF_LIBRARY_LOAD_SYMBOL_MESSAGE(liblua, luaL_newstate) + #if LUA_VERSION_NUM >= 505 + FF_LIBRARY_LOAD_SYMBOL_MESSAGE(liblua, luaL_openselectedlibs) + #else + FF_LIBRARY_LOAD_SYMBOL_MESSAGE(liblua, luaL_requiref) + FF_LIBRARY_LOAD_SYMBOL_MESSAGE(liblua, luaopen_base) + FF_LIBRARY_LOAD_SYMBOL_MESSAGE(liblua, luaopen_math) + FF_LIBRARY_LOAD_SYMBOL_MESSAGE(liblua, luaopen_string) + FF_LIBRARY_LOAD_SYMBOL_MESSAGE(liblua, luaopen_table) + #endif + FF_LIBRARY_LOAD_SYMBOL_VAR_MESSAGE(liblua, luaData, lua_settop) + FF_LIBRARY_LOAD_SYMBOL_VAR_MESSAGE(liblua, luaData, luaL_loadbufferx) + FF_LIBRARY_LOAD_SYMBOL_VAR_MESSAGE(liblua, luaData, lua_tolstring) + FF_LIBRARY_LOAD_SYMBOL_VAR_MESSAGE(liblua, luaData, lua_createtable) + FF_LIBRARY_LOAD_SYMBOL_VAR_MESSAGE(liblua, luaData, lua_pushinteger) + FF_LIBRARY_LOAD_SYMBOL_VAR_MESSAGE(liblua, luaData, lua_pushnumber) + FF_LIBRARY_LOAD_SYMBOL_VAR_MESSAGE(liblua, luaData, lua_pushboolean) + FF_LIBRARY_LOAD_SYMBOL_VAR_MESSAGE(liblua, luaData, lua_pushstring) + FF_LIBRARY_LOAD_SYMBOL_VAR_MESSAGE(liblua, luaData, lua_pushlstring) + FF_LIBRARY_LOAD_SYMBOL_VAR_MESSAGE(liblua, luaData, lua_pushvalue) + FF_LIBRARY_LOAD_SYMBOL_VAR_MESSAGE(liblua, luaData, lua_seti) + FF_LIBRARY_LOAD_SYMBOL_VAR_MESSAGE(liblua, luaData, lua_pushnil) + FF_LIBRARY_LOAD_SYMBOL_VAR_MESSAGE(liblua, luaData, lua_setfield) + FF_LIBRARY_LOAD_SYMBOL_VAR_MESSAGE(liblua, luaData, lua_pcallk) + FF_LIBRARY_LOAD_SYMBOL_VAR_MESSAGE(liblua, luaData, lua_gettop) + FF_LIBRARY_LOAD_SYMBOL_VAR_MESSAGE(liblua, luaData, luaL_tolstring) + FF_LIBRARY_LOAD_SYMBOL_VAR_MESSAGE(liblua, luaData, luaL_error) + FF_LIBRARY_LOAD_SYMBOL_VAR_MESSAGE(liblua, luaData, lua_pushcclosure) + FF_LIBRARY_LOAD_SYMBOL_VAR_MESSAGE(liblua, luaData, luaL_checkany) + FF_LIBRARY_LOAD_SYMBOL_VAR_MESSAGE(liblua, luaData, lua_callk) + FF_LIBRARY_LOAD_SYMBOL_VAR_MESSAGE(liblua, luaData, lua_isinteger) + FF_LIBRARY_LOAD_SYMBOL_VAR_MESSAGE(liblua, luaData, lua_next) + FF_LIBRARY_LOAD_SYMBOL_VAR_MESSAGE(liblua, luaData, lua_rawgeti) + FF_LIBRARY_LOAD_SYMBOL_VAR_MESSAGE(liblua, luaData, lua_rawlen) + FF_LIBRARY_LOAD_SYMBOL_VAR_MESSAGE(liblua, luaData, lua_setglobal) + FF_LIBRARY_LOAD_SYMBOL_VAR_MESSAGE(liblua, luaData, lua_toboolean) + FF_LIBRARY_LOAD_SYMBOL_VAR_MESSAGE(liblua, luaData, lua_tointegerx) + FF_LIBRARY_LOAD_SYMBOL_VAR_MESSAGE(liblua, luaData, lua_tonumberx) + FF_LIBRARY_LOAD_SYMBOL_VAR_MESSAGE(liblua, luaData, lua_type) + + lua_State* L = ffluaL_newstate(); + if (L == NULL) { + return "luaL_newstate() failed"; + } + #if LUA_VERSION_NUM >= 505 + ffluaL_openselectedlibs(L, LUA_GLIBK | LUA_MATHLIBK | LUA_STRLIBK | LUA_TABLIBK, 0); + #else + ffluaL_requiref(L, LUA_GNAME, ffluaopen_base, 1); + ffluaL_requiref(L, LUA_MATHLIBNAME, ffluaopen_math, 1); + ffluaL_requiref(L, LUA_STRLIBNAME, ffluaopen_string, 1); + ffluaL_requiref(L, LUA_TABLIBNAME, ffluaopen_table, 1); + lua_settop(L, 0); + #endif + lua_pushcfunction(L, yyjsonEncode); + lua_setglobal(L, "json_encode"); + luaData.L = L; + liblua = NULL; // don't close lua + return NULL; +} + +#endif diff --git a/src/common/impl/networking_common.c b/src/common/impl/networking_common.c index c716195ae3..e63979bf27 100644 --- a/src/common/impl/networking_common.c +++ b/src/common/impl/networking_common.c @@ -1,7 +1,7 @@ #include "fastfetch.h" #include "common/library.h" #include "common/networking.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include "common/debug.h" #ifdef FF_HAVE_ZLIB diff --git a/src/common/impl/networking_linux.c b/src/common/impl/networking_linux.c index 0db8d88294..e253451fee 100644 --- a/src/common/impl/networking_linux.c +++ b/src/common/impl/networking_linux.c @@ -2,7 +2,7 @@ #include "common/networking.h" #include "common/time.h" #include "common/library.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include "common/mallocHelper.h" #include "common/debug.h" diff --git a/src/common/impl/networking_windows.c b/src/common/impl/networking_windows.c index dd90948dcc..d3a7752285 100644 --- a/src/common/impl/networking_windows.c +++ b/src/common/impl/networking_windows.c @@ -4,7 +4,7 @@ // Must be included after #include "fastfetch.h" #include "common/networking.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include "common/debug.h" static LPFN_CONNECTEX ConnectEx; diff --git a/src/common/impl/option.c b/src/common/impl/option.c index 7390f7b667..3d592d0ec1 100644 --- a/src/common/impl/option.c +++ b/src/common/impl/option.c @@ -1,7 +1,7 @@ #include "fastfetch.h" #include "common/option.h" #include "common/color.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include diff --git a/src/common/impl/path.c b/src/common/impl/path.c index 97dc9993a7..c97210e969 100644 --- a/src/common/impl/path.c +++ b/src/common/impl/path.c @@ -1,6 +1,6 @@ #include "common/path.h" #include "common/io.h" -#include "common/arrayUtils.h" +#include "common/arrutil.h" #if !_WIN32 const char* ffFindExecutableInPath(const char* name, FFstrbuf* result) { diff --git a/src/common/impl/percent.c b/src/common/impl/percent.c index f19fbacb7c..266588cb68 100644 --- a/src/common/impl/percent.c +++ b/src/common/impl/percent.c @@ -4,7 +4,7 @@ #include "common/option.h" #include "common/jsonconfig.h" #include "common/textModifier.h" -#include "common/stringUtils.h" +#include "common/strutil.h" static void appendOutputColor(FFstrbuf* buffer, const FFModuleArgs* module) { if (module->outputColor.length) { diff --git a/src/common/impl/printing.c b/src/common/impl/printing.c index c9f43c01c2..9f372d9378 100644 --- a/src/common/impl/printing.c +++ b/src/common/impl/printing.c @@ -81,16 +81,24 @@ void ffPrintLogoAndKey(const char* moduleName, uint8_t moduleIndex, const FFModu } } -void ffPrintFormat(const char* moduleName, uint8_t moduleIndex, const FFModuleArgs* moduleArgs, FFPrintType printType, uint32_t numArgs, const FFformatarg* arguments) { +bool ffPrintFormat(const char* moduleName, uint8_t moduleIndex, const FFModuleArgs* moduleArgs, FFPrintType printType, uint32_t numArgs, const FFformatarg* arguments) { FF_STRBUF_AUTO_DESTROY buffer = ffStrbufCreate(); - if (moduleArgs) { - ffParseFormatString(&buffer, &moduleArgs->outputFormat, numArgs, arguments); + bool success; + if (__builtin_expect(moduleArgs != NULL, 1)) { + success = ffParseFormatString(&buffer, &moduleArgs->outputFormat, numArgs, arguments); } else { - ffStrbufAppendS(&buffer, "unknown"); + ffStrbufSetStatic(&buffer, "undefined format"); + success = false; } - ffPrintLogoAndKey(moduleName, moduleIndex, moduleArgs, printType); - ffStrbufPutTo(&buffer, stdout); + if (success) { + ffPrintLogoAndKey(moduleName, moduleIndex, moduleArgs, printType); + ffStrbufPutTo(&buffer, stdout); + } else { + ffPrintError(moduleName, moduleIndex, moduleArgs, printType, "%s", buffer.chars); + } + + return success; } void ffPrintError(const char* moduleName, uint8_t moduleIndex, const FFModuleArgs* moduleArgs, FFPrintType printType, const char* message, ...) { diff --git a/src/common/impl/processing_linux.c b/src/common/impl/processing_linux.c index 6fda83ce6b..2b87c3b793 100644 --- a/src/common/impl/processing_linux.c +++ b/src/common/impl/processing_linux.c @@ -1,7 +1,7 @@ #include "fastfetch.h" #include "common/processing.h" #include "common/io.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include "common/mallocHelper.h" #include diff --git a/src/common/impl/strutil.c b/src/common/impl/strutil.c new file mode 100644 index 0000000000..3a801f7e8d --- /dev/null +++ b/src/common/impl/strutil.c @@ -0,0 +1,80 @@ +#include "common/strutil.h" + +uint8_t ffUtf8CharLenWidth(const char* str, uint32_t length, uint8_t* width) { + if (__builtin_expect(length == 0 || *str == '\0', false)) { + if (width) { + *width = 0; + } + return 0; + } + + unsigned char first = (unsigned char) *str; + if (__builtin_expect(first < 0x80, true)) { + if (width) { + *width = 1; + } + return 1; + } + + uint8_t bytes; + if ((first & 0xE0) == 0xC0) { + bytes = 2; + } else if ((first & 0xF0) == 0xE0) { + bytes = 3; + } else if ((first & 0xF8) == 0xF0) { + bytes = 4; + } else { + if (width) { + *width = 1; + } + return 1; + } + + if (length < bytes) { + if (width) { + *width = 1; + } + return 1; + } + + for (uint8_t i = 1; i < bytes; ++i) { + unsigned char continuation = (unsigned char) str[i]; + if (continuation == '\0' || (continuation & 0xC0) != 0x80) { + if (width) { + *width = 1; + } + return 1; + } + } + + uint32_t ucs = (uint32_t) (first & ((1U << (8 - bytes)) - 1)); + for (uint8_t i = 1; i < bytes; ++i) { + ucs <<= 6; + ucs |= (uint32_t) ((unsigned char) str[i] & 0x3F); + } + + int wcWidth = mk_wcwidth(ucs); + if (width) { + *width = (uint8_t) (wcWidth < 0 ? 0 : wcWidth); + } + return bytes; +} + +uint32_t ffUtf8StrWidth(const char* str, uint32_t length) { + uint32_t result = 0; + const char* ptr = str; + + while (length > 0 && *ptr != '\0') { + uint8_t width = 0; + uint8_t bytes = ffUtf8CharLenWidth(ptr, length, &width); + if (__builtin_expect(bytes == 0, false)) { + break; + } + + result += width; + ptr += bytes; + length -= bytes; + } + + return result > 0 ? result : (uint32_t) (ptr - str); +} diff --git a/src/common/impl/temps.c b/src/common/impl/temps.c index ae51e65b3b..652f3fbb25 100644 --- a/src/common/impl/temps.c +++ b/src/common/impl/temps.c @@ -1,7 +1,7 @@ #include "fastfetch.h" #include "common/temps.h" #include "common/textModifier.h" -#include "common/stringUtils.h" +#include "common/strutil.h" void ffTempsAppendNum(double celsius, FFstrbuf* buffer, FFColorRangeConfig config, const FFModuleArgs* module) { if (celsius == -DBL_MAX) { // ignores invalid value diff --git a/src/common/impl/wcwidth.c b/src/common/impl/wcwidth.c index 5b4a1adc97..445351046b 100644 --- a/src/common/impl/wcwidth.c +++ b/src/common/impl/wcwidth.c @@ -19,11 +19,11 @@ int mk_wcwidth(uint32_t wc) { case widechar_widened_in_9: // Our renderer supports Unicode 9 return 2; - // case widechar_nonprint: - // case widechar_combining: - // case widechar_unassigned: - // case widechar_non_character: - // return -1; + case widechar_nonprint: + case widechar_combining: + case widechar_unassigned: + case widechar_non_character: + return 0; default: // Use the width widechar_width gave us. return width; diff --git a/src/common/lua.h b/src/common/lua.h new file mode 100644 index 0000000000..5577837b4e --- /dev/null +++ b/src/common/lua.h @@ -0,0 +1,183 @@ +#pragma once + +#include "fastfetch.h" + +#if FF_HAVE_LUA + // Hack. LUA_API is defined as extern which prevents us from implementing the functions ourselves. + #include + #undef LUA_API + #undef LUALIB_API + #undef LUAMOD_API + #define LUA_API static inline + #define LUALIB_API LUA_API + #define LUAMOD_API LUA_API + + #pragma GCC diagnostic ignored "-Wunused-function" + #include + #include + #include + + #ifndef LUA_GNAME + #define LUA_GNAME "_G" + #endif + + #include "common/library.h" + +extern struct FFLuaData { + FF_LIBRARY_SYMBOL(luaL_newstate) + #if LUA_VERSION_NUM >= 505 + FF_LIBRARY_SYMBOL(luaL_openselectedlibs) + #else + FF_LIBRARY_SYMBOL(luaL_openlibs) + #endif + FF_LIBRARY_SYMBOL(lua_settop) + FF_LIBRARY_SYMBOL(luaL_loadbufferx) + FF_LIBRARY_SYMBOL(lua_tolstring) + FF_LIBRARY_SYMBOL(lua_createtable) + FF_LIBRARY_SYMBOL(lua_pushinteger) + FF_LIBRARY_SYMBOL(lua_pushnumber) + FF_LIBRARY_SYMBOL(lua_pushboolean) + FF_LIBRARY_SYMBOL(lua_pushstring) + FF_LIBRARY_SYMBOL(lua_pushlstring) + FF_LIBRARY_SYMBOL(lua_pushvalue) + FF_LIBRARY_SYMBOL(lua_seti) + FF_LIBRARY_SYMBOL(lua_pushnil) + FF_LIBRARY_SYMBOL(lua_setfield) + FF_LIBRARY_SYMBOL(lua_pcallk) + FF_LIBRARY_SYMBOL(lua_gettop) + FF_LIBRARY_SYMBOL(luaL_tolstring) + FF_LIBRARY_SYMBOL(luaL_error) + FF_LIBRARY_SYMBOL(lua_pushcclosure) + FF_LIBRARY_SYMBOL(luaL_checkany) + FF_LIBRARY_SYMBOL(lua_callk) + FF_LIBRARY_SYMBOL(lua_isinteger) + FF_LIBRARY_SYMBOL(lua_next) + FF_LIBRARY_SYMBOL(lua_rawgeti) + FF_LIBRARY_SYMBOL(lua_rawlen) + FF_LIBRARY_SYMBOL(lua_setglobal) + FF_LIBRARY_SYMBOL(lua_toboolean) + FF_LIBRARY_SYMBOL(lua_tointegerx) + FF_LIBRARY_SYMBOL(lua_tonumberx) + FF_LIBRARY_SYMBOL(lua_type) + + lua_State* L; + bool inited; +} luaData; + +const char* ffLuaLoadState(); + +FF_A_ALWAYS_INLINE void(lua_settop)(lua_State* L, int idx) { + return luaData.fflua_settop(L, idx); +} + +FF_A_ALWAYS_INLINE int(luaL_loadbufferx)(lua_State* L, const char* buff, size_t sz, const char* name, const char* mode) { + return luaData.ffluaL_loadbufferx(L, buff, sz, name, mode); +} + +FF_A_ALWAYS_INLINE const char*(lua_tolstring) (lua_State * L, int idx, size_t* len) { + return luaData.fflua_tolstring(L, idx, len); +} + +FF_A_ALWAYS_INLINE void(lua_createtable)(lua_State* L, int narr, int nrec) { + return luaData.fflua_createtable(L, narr, nrec); +} + +FF_A_ALWAYS_INLINE void(lua_pushinteger)(lua_State* L, lua_Integer n) { + return luaData.fflua_pushinteger(L, n); +} + +FF_A_ALWAYS_INLINE void(lua_pushnumber)(lua_State* L, lua_Number n) { + return luaData.fflua_pushnumber(L, n); +} + +FF_A_ALWAYS_INLINE void(lua_pushboolean)(lua_State* L, int b) { + return luaData.fflua_pushboolean(L, b); +} + +FF_A_ALWAYS_INLINE const char*(lua_pushstring) (lua_State * L, const char* s) { + return luaData.fflua_pushstring(L, s); +} + +FF_A_ALWAYS_INLINE const char*(lua_pushlstring) (lua_State * L, const char* s, size_t len) { + return luaData.fflua_pushlstring(L, s, len); +} + +FF_A_ALWAYS_INLINE void(lua_pushvalue)(lua_State* L, int idx) { + return luaData.fflua_pushvalue(L, idx); +} + +FF_A_ALWAYS_INLINE void(lua_seti)(lua_State* L, int idx, lua_Integer n) { + return luaData.fflua_seti(L, idx, n); +} + +FF_A_ALWAYS_INLINE void(lua_pushnil)(lua_State* L) { + return luaData.fflua_pushnil(L); +} + +FF_A_ALWAYS_INLINE void(lua_setfield)(lua_State* L, int idx, const char* k) { + return luaData.fflua_setfield(L, idx, k); +} + +FF_A_ALWAYS_INLINE int(lua_pcallk)(lua_State* L, int nargs, int nresults, int errfunc, lua_KContext ctx, lua_KFunction k) { + return luaData.fflua_pcallk(L, nargs, nresults, errfunc, ctx, k); +} + +FF_A_ALWAYS_INLINE int(lua_gettop)(lua_State* L) { + return luaData.fflua_gettop(L); +} + +FF_A_ALWAYS_INLINE const char*(luaL_tolstring) (lua_State * L, int idx, size_t* len) { + return luaData.ffluaL_tolstring(L, idx, len); +} + + #define luaL_error(L, fmt, ...) luaData.ffluaL_error(L, fmt, ##__VA_ARGS__) + +FF_A_ALWAYS_INLINE void(lua_pushcclosure)(lua_State* L, lua_CFunction fn, int n) { + return luaData.fflua_pushcclosure(L, fn, n); +} + +FF_A_ALWAYS_INLINE void(luaL_checkany)(lua_State* L, int idx) { + return luaData.ffluaL_checkany(L, idx); +} + +FF_A_ALWAYS_INLINE void(lua_callk)(lua_State* L, int nargs, int nresults, lua_KContext ctx, lua_KFunction k) { + return luaData.fflua_callk(L, nargs, nresults, ctx, k); +} + +FF_A_ALWAYS_INLINE int(lua_isinteger)(lua_State* L, int idx) { + return luaData.fflua_isinteger(L, idx); +} + +FF_A_ALWAYS_INLINE int(lua_next)(lua_State* L, int idx) { + return luaData.fflua_next(L, idx); +} + +FF_A_ALWAYS_INLINE int(lua_rawgeti)(lua_State* L, int idx, lua_Integer n) { + return luaData.fflua_rawgeti(L, idx, n); +} + +FF_A_ALWAYS_INLINE lua_Unsigned(lua_rawlen)(lua_State* L, int idx) { + return luaData.fflua_rawlen(L, idx); +} + +FF_A_ALWAYS_INLINE void(lua_setglobal)(lua_State* L, const char* name) { + return luaData.fflua_setglobal(L, name); +} + +FF_A_ALWAYS_INLINE int(lua_toboolean)(lua_State* L, int idx) { + return luaData.fflua_toboolean(L, idx); +} + +FF_A_ALWAYS_INLINE lua_Integer(lua_tointegerx)(lua_State* L, int idx, int* isnum) { + return luaData.fflua_tointegerx(L, idx, isnum); +} + +FF_A_ALWAYS_INLINE lua_Number(lua_tonumberx)(lua_State* L, int idx, int* isnum) { + return luaData.fflua_tonumberx(L, idx, isnum); +} + +FF_A_ALWAYS_INLINE int(lua_type)(lua_State* L, int idx) { + return luaData.fflua_type(L, idx); +} + +#endif diff --git a/src/common/path.h b/src/common/path.h index 79d181df24..705b1c0948 100644 --- a/src/common/path.h +++ b/src/common/path.h @@ -1,7 +1,7 @@ #pragma once #include "common/FFstrbuf.h" -#include "common/stringUtils.h" +#include "common/strutil.h" const char* ffFindExecutableInPath(const char* name, FFstrbuf* result); static inline bool ffIsAbsolutePath(const char* path) { diff --git a/src/common/printing.h b/src/common/printing.h index 9401dd729a..f20a244166 100644 --- a/src/common/printing.h +++ b/src/common/printing.h @@ -13,7 +13,7 @@ typedef enum FF_A_PACKED FFPrintType { } FFPrintType; void ffPrintLogoAndKey(const char* moduleName, uint8_t moduleIndex, const FFModuleArgs* moduleArgs, FFPrintType printType); -void ffPrintFormat(const char* moduleName, uint8_t moduleIndex, const FFModuleArgs* moduleArgs, FFPrintType printType, uint32_t numArgs, const FFformatarg* arguments); +bool ffPrintFormat(const char* moduleName, uint8_t moduleIndex, const FFModuleArgs* moduleArgs, FFPrintType printType, uint32_t numArgs, const FFformatarg* arguments); #define FF_PRINT_FORMAT_CHECKED(moduleName, moduleIndex, moduleArgs, printType, arguments) \ ffPrintFormat((moduleName), (moduleIndex), (moduleArgs), (printType), (sizeof(arguments) / sizeof(*arguments)), (arguments)); FF_A_PRINTF(5, 6) void ffPrintError(const char* moduleName, uint8_t moduleIndex, const FFModuleArgs* moduleArgs, FFPrintType printType, const char* message, ...); diff --git a/src/common/stringUtils.h b/src/common/strutil.h similarity index 84% rename from src/common/stringUtils.h rename to src/common/strutil.h index 34e5cc8324..00a8a08398 100644 --- a/src/common/stringUtils.h +++ b/src/common/strutil.h @@ -5,6 +5,14 @@ #include #include +#include "common/wcwidth.h" + +#ifdef _WIN32 +// #include +__stdcall char* StrStrIA(const char* lpFirst, const char* lpSrch); + #define strcasestr StrStrIA +#endif + static inline bool ffStrSet(const char* str) { if (str == NULL) { return false; @@ -71,6 +79,13 @@ static inline bool ffCharIsDigit(char c) { return '0' <= c && c <= '9'; } +// Parse one UTF-8 character, returning consumed byte count and display width. +// Invalid / incomplete sequence falls back to one-byte width=1. +// If the Unicode codepoint is non-printable, width becomes 0. +uint8_t ffUtf8CharLenWidth(const char* str, uint32_t length, uint8_t* width); + +uint32_t ffUtf8StrWidth(const char* str, uint32_t length); + static inline bool ffCharIsHexDigit(char c) { return ffCharIsDigit(c) || ('a' <= c && c <= 'f') || ('A' <= c && c <= 'F'); } diff --git a/src/common/time.h b/src/common/time.h index 23529fe791..e2d86ab1de 100644 --- a/src/common/time.h +++ b/src/common/time.h @@ -11,7 +11,7 @@ #include #endif -#include "common/arrayUtils.h" +#include "common/arrutil.h" static inline double ffTimeGetTick(void) // In msec { diff --git a/src/common/wcwidth.h b/src/common/wcwidth.h index af00837af5..8d093da520 100644 --- a/src/common/wcwidth.h +++ b/src/common/wcwidth.h @@ -2,15 +2,11 @@ #include -#ifdef FF_HAVE_WCWIDTH - #include - -// Should be char32_t but it's not defined on macOS -static_assert(sizeof(wchar_t) == sizeof(uint32_t), "wcwidth implementation requires wchar_t to be 32 bits"); - -static inline int mk_wcwidth(uint32_t ucs) { - return wcwidth((wchar_t) ucs); -} -#else +#if FF_ENABLE_WCWIDTH int mk_wcwidth(uint32_t wc); +#else +static inline int mk_wcwidth(uint32_t wc) { + (void) wc; + return 1; +} #endif diff --git a/src/data/structure.txt b/src/data/structure.txt deleted file mode 100644 index 717e3a3a3e..0000000000 --- a/src/data/structure.txt +++ /dev/null @@ -1 +0,0 @@ -Title:Separator:OS:Host:Kernel:Uptime:Packages:Shell:Display:DE:WM:WMTheme:Theme:Icons:Font:Cursor:Terminal:TerminalFont:CPU:GPU:Memory:Swap:Disk:LocalIp:Battery:PowerAdapter:Locale:Break:Colors diff --git a/src/detection/battery/battery_android.c b/src/detection/battery/battery_android.c index 4c52d3a774..d76c4adaaa 100644 --- a/src/detection/battery/battery_android.c +++ b/src/detection/battery/battery_android.c @@ -1,6 +1,6 @@ #include "fastfetch.h" #include "battery.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include "common/processing.h" #include "common/properties.h" diff --git a/src/detection/battery/battery_linux.c b/src/detection/battery/battery_linux.c index 13fc4d05cc..6c1f711256 100644 --- a/src/detection/battery/battery_linux.c +++ b/src/detection/battery/battery_linux.c @@ -1,6 +1,6 @@ #include "battery.h" #include "common/io.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include "common/debug.h" #include diff --git a/src/detection/battery/battery_nbsd.c b/src/detection/battery/battery_nbsd.c index f24907c5e1..2e8b42680a 100644 --- a/src/detection/battery/battery_nbsd.c +++ b/src/detection/battery/battery_nbsd.c @@ -1,7 +1,7 @@ #include "battery.h" #include "common/io.h" #include "common/FFstrbuf.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include #include diff --git a/src/detection/bios/bios_apple.c b/src/detection/bios/bios_apple.c index 96845d8886..6b046d2ea6 100644 --- a/src/detection/bios/bios_apple.c +++ b/src/detection/bios/bios_apple.c @@ -38,9 +38,10 @@ const char* ffDetectBios(FFBiosResult* bios) { FF_IOOBJECT_AUTO_RELEASE io_registry_entry_t deviceChosen = IORegistryEntryFromPath(MACH_PORT_NULL, "IODeviceTree:/chosen"); if (deviceChosen) { - FF_CFTYPE_AUTO_RELEASE CFStringRef systemFirmwareVersion = IORegistryEntryCreateCFProperty(deviceChosen, CFSTR("system-firmware-version"), kCFAllocatorDefault, kNilOptions); - if (systemFirmwareVersion) { - ffCfStrGetString(systemFirmwareVersion, &bios->version); + FF_CFTYPE_AUTO_RELEASE CFStringRef tag = IORegistryEntryCreateCFProperty(deviceChosen, CFSTR("iboot-stage-one-tag"), kCFAllocatorDefault, kNilOptions) + ?: IORegistryEntryCreateCFProperty(deviceChosen, CFSTR("system-firmware-version"), kCFAllocatorDefault, kNilOptions); + if (tag) { + ffCfStrGetString(tag, &bios->version); uint32_t index = ffStrbufFirstIndexC(&bios->version, '-'); if (index != bios->version.length) { ffStrbufAppendNS(&bios->type, index, bios->version.chars); diff --git a/src/detection/bluetooth/bluetooth_linux.c b/src/detection/bluetooth/bluetooth_linux.c index 8d02127552..fb4e422425 100644 --- a/src/detection/bluetooth/bluetooth_linux.c +++ b/src/detection/bluetooth/bluetooth_linux.c @@ -1,5 +1,5 @@ #include "bluetooth.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #ifdef FF_HAVE_DBUS #include "common/dbus.h" diff --git a/src/detection/bluetoothradio/bluetoothradio_linux.c b/src/detection/bluetoothradio/bluetoothradio_linux.c index 5f5554a356..a7d92a4830 100644 --- a/src/detection/bluetoothradio/bluetoothradio_linux.c +++ b/src/detection/bluetoothradio/bluetoothradio_linux.c @@ -1,5 +1,5 @@ #include "bluetoothradio.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #ifdef FF_HAVE_DBUS #include "common/dbus.h" diff --git a/src/detection/bootmgr/bootmgr_apple.c b/src/detection/bootmgr/bootmgr_apple.c index 25f4a826b9..d2b24e00e8 100644 --- a/src/detection/bootmgr/bootmgr_apple.c +++ b/src/detection/bootmgr/bootmgr_apple.c @@ -11,7 +11,7 @@ static const char* detectSecureBoot(bool* result) { return "IORegistryEntryFromPath() failed"; } - FF_CFTYPE_AUTO_RELEASE CFTypeRef prop = IORegistryEntryCreateCFProperty(entryDevice, CFSTR("secure-boot"), kCFAllocatorDefault, 0); + FF_CFTYPE_AUTO_RELEASE CFTypeRef prop = IORegistryEntryCreateCFProperty(entryDevice, CFSTR("secure-boot"), kCFAllocatorDefault, kNilOptions); if (!prop) { return "IORegistryEntryCreateCFProperty() failed"; } @@ -47,7 +47,21 @@ const char* ffDetectBootmgr(FFBootmgrResult* result) { ffStrbufSetStatic(&result->firmware, "/System/Library/CoreServices/boot.efi"); } - ffStrbufSetStatic(&result->name, "iBoot"); + #ifdef __aarch64__ + FF_IOOBJECT_AUTO_RELEASE io_registry_entry_t deviceChosen = IORegistryEntryFromPath(MACH_PORT_NULL, "IODeviceTree:/chosen"); + if (deviceChosen) { + FF_CFTYPE_AUTO_RELEASE CFStringRef tag = IORegistryEntryCreateCFProperty(deviceChosen, CFSTR("iboot-stage-two-tag"), kCFAllocatorDefault, kNilOptions) + ?: IORegistryEntryCreateCFProperty(deviceChosen, CFSTR("system-firmware-version"), kCFAllocatorDefault, kNilOptions); + if (tag) { + ffCfStrGetString(tag, &result->name); + ffStrbufSubstrBeforeFirstC(&result->name, '-'); + } + } + #endif + + if (!result->name.length) { + ffStrbufSetStatic(&result->name, "iBoot"); + } detectSecureBoot(&result->secureBoot); diff --git a/src/detection/bootmgr/bootmgr_haiku.cpp b/src/detection/bootmgr/bootmgr_haiku.cpp new file mode 100644 index 0000000000..72358fca0a --- /dev/null +++ b/src/detection/bootmgr/bootmgr_haiku.cpp @@ -0,0 +1,17 @@ +extern "C" { + #include "bootmgr.h" + #include "common/io.h" +} + +const char* ffDetectBootmgr(FFBootmgrResult* result) { + // TODO: glob haiku_loader.* + check EFI partition + if (ffPathExists("/system/haiku_loader.bios_ia32", FF_PATHTYPE_FILE)) { + ffStrbufSetStatic(&result->firmware, "/system/haiku_loader.bios_ia32"); + } + + ffStrbufSetStatic(&result->name, "haiku_loader"); + + // TODO: detectSecureBoot(&result->secureBoot); + + return NULL; +} diff --git a/src/detection/brightness/brightness.h b/src/detection/brightness/brightness.h index ae75abd323..abb94787e8 100644 --- a/src/detection/brightness/brightness.h +++ b/src/detection/brightness/brightness.h @@ -9,4 +9,18 @@ typedef struct FFBrightnessResult { bool builtin; } FFBrightnessResult; +enum { + FF_DDC_EDID_ADDR = 0x50u, + FF_DDC_CI_ADDR = 0x37u, + FF_DDC_CI_WRITE_ADDR = FF_DDC_CI_ADDR << 1, + FF_DDC_CI_READ_ADDR = FF_DDC_CI_WRITE_ADDR | 1, + FF_DDC_CI_VCP_COMMAND = 0x51u, + FF_DDC_CI_GET_VCP = 0x01u, + FF_DDC_CI_SET_VCP = 0x03u, + FF_DDC_CI_COMMAND_PACKET = 0x80u, + FF_DDC_CI_LUMINANCE_OPCODE = 0x10u, +}; +#define FF_BRIGHTNESS_DDCCI_SLEEP_SKIP ((uint32_t) -1) +#define FF_DDC_CI_MAKE_HEADER(len) (FF_DDC_CI_COMMAND_PACKET | ((len) & 0x7F)) + const char* ffDetectBrightness(FFBrightnessOptions* options, FFlist* result); // list of FFBrightnessResult diff --git a/src/detection/brightness/brightness_apple.c b/src/detection/brightness/brightness_apple.c index 39f173b6b3..5dd12b2a4b 100644 --- a/src/detection/brightness/brightness_apple.c +++ b/src/detection/brightness/brightness_apple.c @@ -2,6 +2,7 @@ #include "detection/displayserver/displayserver.h" #include "common/apple/cf_helpers.h" #include "common/edidHelper.h" +#include "common/time.h" #include @@ -85,17 +86,17 @@ static const char* detectWithDdcci(FF_A_UNUSED const FFDisplayServerResult* disp } { - uint8_t i2cIn[4] = { 0x82, 0x01, 0x10 /* luminance */ }; - i2cIn[3] = 0x6e ^ i2cIn[0] ^ i2cIn[1] ^ i2cIn[2]; + uint8_t i2cIn[4] = { FF_DDC_CI_MAKE_HEADER(2), FF_DDC_CI_GET_VCP, FF_DDC_CI_LUMINANCE_OPCODE }; + i2cIn[3] = FF_DDC_CI_WRITE_ADDR ^ i2cIn[0] ^ i2cIn[1] ^ i2cIn[2]; for (uint32_t i = 0; i < 2; ++i) { - IOAVServiceWriteI2C(service, 0x37, 0x51, i2cIn, ARRAY_SIZE(i2cIn)); - usleep(options->ddcciSleep * 1000); + IOAVServiceWriteI2C(service, FF_DDC_CI_ADDR, FF_DDC_CI_VCP_COMMAND, i2cIn, ARRAY_SIZE(i2cIn)); + ffTimeSleep(options->ddcciSleep); } } uint8_t i2cOut[12] = {}; - if (IOAVServiceReadI2C(service, 0x37, 0x51, i2cOut, ARRAY_SIZE(i2cOut)) == KERN_SUCCESS) { + if (IOAVServiceReadI2C(service, FF_DDC_CI_ADDR, FF_DDC_CI_VCP_COMMAND, i2cOut, ARRAY_SIZE(i2cOut)) == KERN_SUCCESS) { if (i2cOut[2] != 0x02 || i2cOut[3] != 0x00) { continue; } @@ -185,18 +186,18 @@ static const char* detectWithDdcci(const FFDisplayServerResult* displayServer, F continue; } - uint8_t i2cIn[] = { 0x51, 0x82, 0x01, 0x10 /* luminance */, 0 }; - i2cIn[4] = 0x6E ^ i2cIn[0] ^ i2cIn[1] ^ i2cIn[2] ^ i2cIn[3]; + uint8_t i2cIn[] = { FF_DDC_CI_VCP_COMMAND, FF_DDC_CI_MAKE_HEADER(2), FF_DDC_CI_GET_VCP, FF_DDC_CI_LUMINANCE_OPCODE, 0 }; + i2cIn[4] = FF_DDC_CI_WRITE_ADDR ^ i2cIn[0] ^ i2cIn[1] ^ i2cIn[2] ^ i2cIn[3]; IOI2CRequest request = { .commFlags = kNilOptions, - .sendAddress = 0x6e, + .sendAddress = FF_DDC_CI_WRITE_ADDR, .sendTransactionType = kIOI2CSimpleTransactionType, .sendBuffer = (vm_address_t) i2cIn, .sendBytes = ARRAY_SIZE(i2cIn), .minReplyDelay = options->ddcciSleep * 1000ULL, - .replyAddress = 0x6F, - .replySubAddress = 0x51, + .replyAddress = FF_DDC_CI_READ_ADDR, + .replySubAddress = FF_DDC_CI_VCP_COMMAND, .replyTransactionType = transactionType, .replyBytes = ARRAY_SIZE(i2cOut), .replyBuffer = (vm_address_t) i2cOut, @@ -235,7 +236,7 @@ const char* ffDetectBrightness(FFBrightnessOptions* options, FFlist* result) { detectWithDisplayServices(displayServer, result); - if (displayServer->displays.length > result->length) { + if (options->ddcciSleep != FF_BRIGHTNESS_DDCCI_SLEEP_SKIP && displayServer->displays.length > result->length) { detectWithDdcci(displayServer, options, result); } diff --git a/src/detection/brightness/brightness_bsd.c b/src/detection/brightness/brightness_bsd.c index 525bb1c5af..5ff411c618 100644 --- a/src/detection/brightness/brightness_bsd.c +++ b/src/detection/brightness/brightness_bsd.c @@ -1,28 +1,112 @@ #include "brightness.h" +#include "common/arrutil.h" +#include "common/io.h" +#include "common/kmod.h" +#include "common/debug.h" +#include "common/time.h" -#if __has_include() +#include +#include +#include + +#if __has_include() + #include + +const char* detectWithDdcci(FF_A_UNUSED FFBrightnessOptions* options, FFlist* result) { + // FIXME: doesn't work for me + for (char i = '0'; i <= '9'; ++i) { + char path[] = "/dev/iic0"; + path[ARRAY_SIZE(path) - 2] = i; + + FF_AUTO_CLOSE_FD int fd = open(path, O_RDWR | O_CLOEXEC); + if (fd < 0) { + int err = errno; + if (err == ENOENT) { + FF_DEBUG("No more I2C devices"); + break; + } else if (i == '0' && !ffKmodLoaded("iicbus")) { + FF_DEBUG("iicbus module is not loaded"); + return "No I2C devices found and iicbus module is not loaded"; + } + FF_DEBUG("open(/dev/iic%c) failed: %s", i, strerror(errno)); + continue; + } + + uint8_t i2cIn[] = { FF_DDC_CI_VCP_COMMAND, FF_DDC_CI_MAKE_HEADER(2), FF_DDC_CI_GET_VCP, FF_DDC_CI_LUMINANCE_OPCODE, 0 }; + i2cIn[4] = FF_DDC_CI_WRITE_ADDR ^ i2cIn[0] ^ i2cIn[1] ^ i2cIn[2] ^ i2cIn[3]; + + int ret = ioctl(fd, I2CRDWR, &(struct iic_rdwr_data){ .msgs = &(struct iic_msg){ .slave = FF_DDC_CI_WRITE_ADDR, .flags = IIC_M_WR, .len = ARRAY_SIZE(i2cIn), .buf = i2cIn }, .nmsgs = 1 }); + if (ret < 0) { + FF_DEBUG("First ioctl(/dev/iic%c, I2CRDWR) failed: %s", i, strerror(errno)); + continue; + } + + ffTimeSleep(options->ddcciSleep); + + uint8_t i2cOut[12] = {}; + ret = ioctl(fd, I2CRDWR, &(struct iic_rdwr_data){ .msgs = &(struct iic_msg){ .slave = FF_DDC_CI_READ_ADDR, // LSB will be overridden by kernel to set read bit + .flags = IIC_M_RD, + .len = ARRAY_SIZE(i2cOut), + .buf = i2cOut }, + .nmsgs = 1 }); + if (ret < 0) { + FF_DEBUG("Second ioctl(/dev/iic%c, I2CRDWR) failed: %s", i, strerror(errno)); + continue; + } + if (i2cOut[2] != 0x02 || i2cOut[3] != 0x00) { + FF_DEBUG("i2c out validation failed: i2cOut[2] = 0x%02x, i2cOut[3] = 0x%02x", i2cOut[2], i2cOut[3]); + continue; + } - #include "common/io.h" + uint32_t current = ((uint32_t) i2cOut[8] << 8u) + (uint32_t) i2cOut[9]; + uint32_t max = ((uint32_t) i2cOut[6] << 8u) + (uint32_t) i2cOut[7]; + FFBrightnessResult* brightness = FF_LIST_ADD(FFBrightnessResult, *result); + brightness->max = max; + brightness->min = 0; + brightness->current = current; + ffStrbufInitS(&brightness->name, path + strlen("/dev/")); + brightness->builtin = false; + } + + return NULL; +} + +#else + +const char* detectWithDdcci(FF_A_UNUSED FFBrightnessOptions* options, FF_A_UNUSED FFlist* result) { + FF_DEBUG("DDC/CI support is not available on this system"); + return "DDC/CI is supported only on FreeBSD"; +} + +#endif + +#if __has_include() #include - #include - #include - #include -const char* ffDetectBrightness(FF_A_UNUSED FFBrightnessOptions* options, FFlist* result) { +const char* detectWithBacklight(FF_A_UNUSED FFBrightnessOptions* options, FFlist* result) { // https://man.freebsd.org/cgi/man.cgi?query=backlight&sektion=9 char path[] = "/dev/backlight/backlight0"; for (char i = '0'; i <= '9'; ++i) { path[ARRAY_SIZE(path) - 2] = i; - FF_AUTO_CLOSE_FD int blfd = open(path, O_RDONLY | O_CLOEXEC); - if (blfd < 0) { + FF_AUTO_CLOSE_FD int fd = open(path, O_RDONLY | O_CLOEXEC); + if (fd < 0) { + int err = errno; + if (err == ENOENT) { + FF_DEBUG("No more backlight devices"); + break; + } else if (i == '0' && !ffKmodLoaded("backlight")) { + FF_DEBUG("backlight module is not loaded"); + return "No backlight devices found and backlight module is not loaded"; + } + FF_DEBUG("open(/dev/backlight/backlight%c) failed: %s", i, strerror(errno)); continue; } struct backlight_props status; - if (ioctl(blfd, BACKLIGHTGETSTATUS, &status) < 0) { + if (ioctl(fd, BACKLIGHTGETSTATUS, &status) < 0) { continue; } @@ -35,7 +119,7 @@ const char* ffDetectBrightness(FF_A_UNUSED FFBrightnessOptions* options, FFlist* brightness->builtin = true; struct backlight_info info; - if (ioctl(blfd, BACKLIGHTGETINFO, &info) == 0) { + if (ioctl(fd, BACKLIGHTGETINFO, &info) == 0) { ffStrbufAppendS(&brightness->name, info.name); } else { ffStrbufAppendS(&brightness->name, path + strlen("/dev/backlight/")); @@ -46,8 +130,18 @@ const char* ffDetectBrightness(FF_A_UNUSED FFBrightnessOptions* options, FFlist* #else -const char* ffDetectBrightness(FF_A_UNUSED FFBrightnessOptions* options, FF_A_UNUSED FFlist* result) { +const char* detectWithBacklight(FF_A_UNUSED FFBrightnessOptions* options, FF_A_UNUSED FFlist* result) { + FF_DEBUG("Backlight support is not available on this system"); return "Backlight is supported only on FreeBSD 13 and newer"; } #endif + +const char* ffDetectBrightness(FF_A_UNUSED FFBrightnessOptions* options, FFlist* result) { + detectWithBacklight(options, result); + + if (options->ddcciSleep != FF_BRIGHTNESS_DDCCI_SLEEP_SKIP && result->length == 0) { + detectWithDdcci(options, result); + } + return NULL; +} diff --git a/src/detection/brightness/brightness_haiku.cpp b/src/detection/brightness/brightness_haiku.cpp new file mode 100644 index 0000000000..86fbe6d82b --- /dev/null +++ b/src/detection/brightness/brightness_haiku.cpp @@ -0,0 +1,46 @@ +extern "C" { +#include "brightness.h" +#include "common/strutil.h" +} + +#include +#include + +const char* ffDetectBrightness(FF_A_UNUSED FFBrightnessOptions* options, FFlist* result) { + // We need a valid be_app to query the app_server here. + BApplication app("application/x-vnd.fastfetch-cli-fastfetch"); + BScreen screen{}; // default screen is the main one + + do { + if (!screen.IsValid()) { + continue; + } + + float value = 1.0f; + status_t status = screen.GetBrightness(&value); + if (status != B_OK) { + continue; + } + + monitor_info monitor; + // WARNING: This is experimental new Haiku API + status_t err = screen.GetMonitorInfo(&monitor); + + FFBrightnessResult* brightness = FF_LIST_ADD(FFBrightnessResult, *result); + + if (err == B_OK) { + ffStrbufInitF(&brightness->name, "%s %s (%d)", monitor.vendor, monitor.name, screen.ID().id); + ffStrbufTrimRightSpace(&brightness->name); + } else { + ffStrbufInitF(&brightness->name, "Screen %d", screen.ID().id); + } + + brightness->max = 1.0f; + brightness->min = 0.0f; + brightness->current = value; + brightness->builtin = true; + + } while (screen.SetToNext() == B_OK); + + return NULL; +} diff --git a/src/detection/brightness/brightness_linux.c b/src/detection/brightness/brightness_linux.c index 876d8fbda3..e7125f8fc1 100644 --- a/src/detection/brightness/brightness_linux.c +++ b/src/detection/brightness/brightness_linux.c @@ -1,7 +1,7 @@ #include "brightness.h" #include "common/io.h" #include "common/edidHelper.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include #include @@ -164,9 +164,11 @@ const char* ffDetectBrightness(FF_A_UNUSED FFBrightnessOptions* options, FFlist* detectWithBacklight(result); #ifdef FF_HAVE_DDCUTIL - const FFDisplayServerResult* displayServer = ffConnectDisplayServer(); - if (result->length < displayServer->displays.length) { - detectWithDdcci(options, result); + if (options->ddcciSleep != FF_BRIGHTNESS_DDCCI_SLEEP_SKIP) { + const FFDisplayServerResult* displayServer = ffConnectDisplayServer(); + if (result->length < displayServer->displays.length) { + detectWithDdcci(options, result); + } } #endif diff --git a/src/detection/brightness/brightness_windows.c b/src/detection/brightness/brightness_windows.c index 57b53cff28..70b7f0197e 100644 --- a/src/detection/brightness/brightness_windows.c +++ b/src/detection/brightness/brightness_windows.c @@ -159,7 +159,7 @@ static const char* detectWithDdcci(const FFDisplayServerResult* displayServer, F NTSTATUS monitorStatus = ffGetPhysicalMonitors(&deviceName, 1, &monitorCount, &physicalMonitor); if (NT_SUCCESS(monitorStatus) && monitorCount >= 1) { DWORD curr = 0, max = 0; - if (NT_SUCCESS(ffDDCCIGetVCPFeature(physicalMonitor, 0x10 /* luminance */, NULL, &curr, &max))) { + if (NT_SUCCESS(ffDDCCIGetVCPFeature(physicalMonitor, FF_DDC_CI_LUMINANCE_OPCODE, NULL, &curr, &max))) { FFBrightnessResult* brightness = FF_LIST_ADD(FFBrightnessResult, *result); if (display->name.length > 0) { ffStrbufInitCopy(&brightness->name, &display->name); @@ -213,7 +213,7 @@ const char* ffDetectBrightness(FF_A_UNUSED FFBrightnessOptions* options, FFlist* detectWithWmi(result); } - if (result->length < displayServer->displays.length) { + if (options->ddcciSleep != FF_BRIGHTNESS_DDCCI_SLEEP_SKIP && result->length < displayServer->displays.length) { FF_DEBUG("resultCount=%u < displayCount=%u, trying DDC/CI", result->length, displayServer->displays.length); detectWithDdcci(displayServer, result); } diff --git a/src/detection/codec/codec.c b/src/detection/codec/codec.c new file mode 100644 index 0000000000..c7b3c459f6 --- /dev/null +++ b/src/detection/codec/codec.c @@ -0,0 +1,14 @@ +#include "codec.h" + +const char* ffDetectCodec(FFCodecOptions* options, FFlist* result /*list of FFCodecResult*/) { + if (options->useVulkan) { +#ifdef FF_HAVE_VULKAN + return ffDetectCodecVulkan(options, result); +#else + FF_UNUSED(options, result); + return "Fastfetch was built without Vulkan support"; +#endif + } + + return ffDetectCodecNative(options, result); +} diff --git a/src/detection/codec/codec.h b/src/detection/codec/codec.h new file mode 100644 index 0000000000..3ed07ceb4f --- /dev/null +++ b/src/detection/codec/codec.h @@ -0,0 +1,44 @@ +#pragma once + +#include "fastfetch.h" +#include "modules/codec/option.h" + +typedef enum FF_A_PACKED FFCodecType { + FF_CODEC_TYPE_NONE = 0, + FF_CODEC_TYPE_UNKNOWN = UINT32_C(1) << 0, + FF_CODEC_TYPE_H261 = UINT32_C(1) << 1, + FF_CODEC_TYPE_H263 = UINT32_C(1) << 2, + FF_CODEC_TYPE_MJPEG = UINT32_C(1) << 3, + FF_CODEC_TYPE_MPEG1 = UINT32_C(1) << 4, + FF_CODEC_TYPE_MPEG2 = UINT32_C(1) << 5, + FF_CODEC_TYPE_DIVX_XVID = UINT32_C(1) << 6, + FF_CODEC_TYPE_H264 = UINT32_C(1) << 7, + FF_CODEC_TYPE_WMV8 = UINT32_C(1) << 8, + FF_CODEC_TYPE_WMV9 = UINT32_C(1) << 9, + FF_CODEC_TYPE_VC1 = UINT32_C(1) << 10, + FF_CODEC_TYPE_VP8 = UINT32_C(1) << 11, + FF_CODEC_TYPE_HEVC = UINT32_C(1) << 12, + FF_CODEC_TYPE_VP9 = UINT32_C(1) << 13, + FF_CODEC_TYPE_AV1 = UINT32_C(1) << 14, + FF_CODEC_TYPE_VVC = UINT32_C(1) << 15, + FF_CODEC_TYPE_DOLBY_VISION_HEVC = UINT32_C(1) << 16, + FF_CODEC_TYPE_PRORES = UINT32_C(1) << 17, + FF_CODEC_TYPE_PRORES_RAW = UINT32_C(1) << 18, + FF_CODEC_TYPE_JPEG_XL = UINT32_C(1) << 19, + FF_CODEC_TYPE_MAX = FF_CODEC_TYPE_JPEG_XL, + FF_CODEC_TYPE_FORCE_UNSIGNED = UINT32_MAX, +} FFCodecType; + +typedef struct FFCodecResult { + FFstrbuf gpu; + FFCodecType decoders; + FFCodecType encoders; + const char* platformApi; +} FFCodecResult; + +const char* ffDetectCodec(FFCodecOptions* options, FFlist* result /*list of FFCodecResult*/); +const char* ffDetectCodecNative(FFCodecOptions* options, FFlist* result /*list of FFCodecResult*/); + +#ifdef FF_HAVE_VULKAN +const char* ffDetectCodecVulkan(FFCodecOptions* options, FFlist* result /*list of FFCodecResult*/); +#endif diff --git a/src/detection/codec/codec_android.c b/src/detection/codec/codec_android.c new file mode 100644 index 0000000000..238dab7e81 --- /dev/null +++ b/src/detection/codec/codec_android.c @@ -0,0 +1,102 @@ +#include "codec.h" + +#include "common/library.h" +#include "common/strutil.h" +#undef __INTRODUCED_IN +#define __INTRODUCED_IN(...) +#include + +static const struct { + const char* mime; + FFCodecType type; +} FF_CODEC_MIME_TO_TYPE[] = { + { "video/3gpp", FF_CODEC_TYPE_H263 }, + { "video/h263", FF_CODEC_TYPE_H263 }, + { "video/mjpeg", FF_CODEC_TYPE_MJPEG }, + { "video/mpeg2", FF_CODEC_TYPE_MPEG2 }, + { "video/mp2v-es", FF_CODEC_TYPE_MPEG2 }, + { "video/mp4v-es", FF_CODEC_TYPE_DIVX_XVID }, + { "video/avc", FF_CODEC_TYPE_H264 }, + { "video/hevc", FF_CODEC_TYPE_HEVC }, + { "video/x-vnd.on2.vp8", FF_CODEC_TYPE_VP8 }, + { "video/x-vnd.on2.vp9", FF_CODEC_TYPE_VP9 }, + { "video/av01", FF_CODEC_TYPE_AV1 }, + { "video/vvc", FF_CODEC_TYPE_VVC }, +}; + +static bool ffCodecIsLikelySoftware(const char* codecName) { + if (!codecName) { + return true; + } + + return ffStrStartsWith(codecName, "OMX.google.") || + ffStrStartsWith(codecName, "c2.android.") || + ffStrStartsWith(codecName, "OMX.ffmpeg.") || + ffStrStartsWith(codecName, "OMX.PV."); +} + +static bool ffCodecIsHardwareAccelerated( + AMediaCodec* codec, + __typeof__(&AMediaCodec_getName) ffAMediaCodec_getName, + __typeof__(&AMediaCodec_releaseName) ffAMediaCodec_releaseName) { + if (!codec) { + return false; + } + + char* codecName = NULL; + media_status_t status = ffAMediaCodec_getName(codec, &codecName); + if (status != AMEDIA_OK || !codecName) { + return false; + } + + bool isHardware = !ffCodecIsLikelySoftware(codecName); + ffAMediaCodec_releaseName(codec, codecName); + return isHardware; +} + +const char* ffDetectCodecNative(FFCodecOptions* options, FFlist* result /*list of FFCodecResult*/) { + FF_LIBRARY_LOAD_MESSAGE(mediandk, "libmediandk.so", 0) + FF_LIBRARY_LOAD_SYMBOL_MESSAGE(mediandk, AMediaCodec_createDecoderByType) + FF_LIBRARY_LOAD_SYMBOL_MESSAGE(mediandk, AMediaCodec_createEncoderByType) + FF_LIBRARY_LOAD_SYMBOL_MESSAGE(mediandk, AMediaCodec_delete) + FF_LIBRARY_LOAD_SYMBOL_MESSAGE(mediandk, AMediaCodec_getName) + FF_LIBRARY_LOAD_SYMBOL_MESSAGE(mediandk, AMediaCodec_releaseName) + + FFCodecType decoders = FF_CODEC_TYPE_NONE; + FFCodecType encoders = FF_CODEC_TYPE_NONE; + + for (uint32_t i = 0; i < ARRAY_SIZE(FF_CODEC_MIME_TO_TYPE); ++i) { + const char* mime = FF_CODEC_MIME_TO_TYPE[i].mime; + FFCodecType type = FF_CODEC_MIME_TO_TYPE[i].type; + + if ((options->showType & FF_CODEC_SHOW_TYPE_DECODER) && !(decoders & type)) { + AMediaCodec* decoder = ffAMediaCodec_createDecoderByType(mime); + if (decoder) { + if (ffCodecIsHardwareAccelerated(decoder, ffAMediaCodec_getName, ffAMediaCodec_releaseName)) { + decoders |= type; + } + ffAMediaCodec_delete(decoder); + } + } + + if ((options->showType & FF_CODEC_SHOW_TYPE_ENCODER) && !(encoders & type)) { + AMediaCodec* encoder = ffAMediaCodec_createEncoderByType(mime); + if (encoder) { + if (ffCodecIsHardwareAccelerated(encoder, ffAMediaCodec_getName, ffAMediaCodec_releaseName)) { + encoders |= type; + } + ffAMediaCodec_delete(encoder); + } + } + } + + if (decoders != FF_CODEC_TYPE_NONE || encoders != FF_CODEC_TYPE_NONE) { + FFCodecResult* item = FF_LIST_ADD(FFCodecResult, *result); + ffStrbufInitStatic(&item->gpu, "Default"); + item->decoders = decoders; + item->encoders = encoders; + item->platformApi = "AMediaCodec"; + } + + return NULL; +} diff --git a/src/detection/codec/codec_apple.c b/src/detection/codec/codec_apple.c new file mode 100644 index 0000000000..68ee5933e1 --- /dev/null +++ b/src/detection/codec/codec_apple.c @@ -0,0 +1,96 @@ +#include "codec.h" + +#include +#include "common/apple/cf_helpers.h" + +static const struct { + CMVideoCodecType codec; + FFCodecType type; +} FF_CODEC_CODECS[] = { + { kCMVideoCodecType_H263, FF_CODEC_TYPE_H263 }, + { kCMVideoCodecType_JPEG, FF_CODEC_TYPE_MJPEG }, + { kCMVideoCodecType_JPEG_XL, FF_CODEC_TYPE_JPEG_XL }, + { kCMVideoCodecType_MPEG1Video, FF_CODEC_TYPE_MPEG1 }, + { kCMVideoCodecType_MPEG2Video, FF_CODEC_TYPE_MPEG2 }, + { kCMVideoCodecType_MPEG4Video, FF_CODEC_TYPE_DIVX_XVID }, + { kCMVideoCodecType_H264, FF_CODEC_TYPE_H264 }, + { kCMVideoCodecType_HEVC, FF_CODEC_TYPE_HEVC }, + { kCMVideoCodecType_HEVCWithAlpha, FF_CODEC_TYPE_HEVC }, + { kCMVideoCodecType_DolbyVisionHEVC, FF_CODEC_TYPE_DOLBY_VISION_HEVC }, + { kCMVideoCodecType_DisparityHEVC, FF_CODEC_TYPE_HEVC }, + { kCMVideoCodecType_DepthHEVC, FF_CODEC_TYPE_HEVC }, + { kCMVideoCodecType_VP9, FF_CODEC_TYPE_VP9 }, + { kCMVideoCodecType_AV1, FF_CODEC_TYPE_AV1 }, + { kCMVideoCodecType_AppleProRes4444XQ, FF_CODEC_TYPE_PRORES }, + { kCMVideoCodecType_AppleProRes4444, FF_CODEC_TYPE_PRORES }, + { kCMVideoCodecType_AppleProRes422HQ, FF_CODEC_TYPE_PRORES }, + { kCMVideoCodecType_AppleProRes422, FF_CODEC_TYPE_PRORES }, + { kCMVideoCodecType_AppleProRes422LT, FF_CODEC_TYPE_PRORES }, + { kCMVideoCodecType_AppleProRes422Proxy, FF_CODEC_TYPE_PRORES }, + { kCMVideoCodecType_AppleProResRAW, FF_CODEC_TYPE_PRORES_RAW }, + { kCMVideoCodecType_AppleProResRAWHQ, FF_CODEC_TYPE_PRORES_RAW }, +}; + +static FFCodecType ffCodecCodecToType(CMVideoCodecType codec) { + for (uint32_t i = 0; i < ARRAY_SIZE(FF_CODEC_CODECS); ++i) { + if (FF_CODEC_CODECS[i].codec == codec) { + return FF_CODEC_CODECS[i].type; + } + } + return FF_CODEC_TYPE_NONE; +} + +static FFCodecType ffCodecDetectEncoders(void) { + CFArrayRef encoderList = NULL; + if (VTCopyVideoEncoderList(NULL, &encoderList) != noErr || !encoderList) { + return FF_CODEC_TYPE_NONE; + } + + FFCodecType types = FF_CODEC_TYPE_NONE; + for (uint32_t i = 0; i < CFArrayGetCount(encoderList); ++i) { + CFDictionaryRef encoder = CFArrayGetValueAtIndex(encoderList, i); + bool isHardwareAccelerated; + int codec; + if (ffCfDictGetBool(encoder, CFSTR("IsHardwareAccelerated"), &isHardwareAccelerated) != NULL || + !isHardwareAccelerated || + ffCfDictGetInt(encoder, CFSTR("CodecType"), &codec) != NULL) { + continue; + } + types |= ffCodecCodecToType((CMVideoCodecType) codec); + } + + return types; +} + +static FFCodecType ffCodecDetectDecoders() { + FFCodecType types = FF_CODEC_TYPE_NONE; + for (uint32_t i = 0; i < ARRAY_SIZE(FF_CODEC_CODECS); ++i) { + if (types & FF_CODEC_CODECS[i].type) { + continue; + } + + bool supported = VTIsHardwareDecodeSupported(FF_CODEC_CODECS[i].codec); + if (!supported) { + continue; + } + + types |= FF_CODEC_CODECS[i].type; + } + + return types; +} + +const char* ffDetectCodecNative(FFCodecOptions* options, FFlist* result /* list of FFCodecResult */) { + FFCodecType decoders = options->showType & FF_CODEC_SHOW_TYPE_DECODER ? ffCodecDetectDecoders() : FF_CODEC_TYPE_NONE; + FFCodecType encoders = options->showType & FF_CODEC_SHOW_TYPE_ENCODER ? ffCodecDetectEncoders() : FF_CODEC_TYPE_NONE; + + if (decoders != FF_CODEC_TYPE_NONE || encoders != FF_CODEC_TYPE_NONE) { + FFCodecResult* item = FF_LIST_ADD(FFCodecResult, *result); + ffStrbufInitStatic(&item->gpu, "Default"); + item->decoders = decoders; + item->encoders = encoders; + item->platformApi = "VideoToolbox"; + } + + return NULL; +} diff --git a/src/detection/codec/codec_linux.c b/src/detection/codec/codec_linux.c new file mode 100644 index 0000000000..c25614e83c --- /dev/null +++ b/src/detection/codec/codec_linux.c @@ -0,0 +1,470 @@ +#include "codec.h" + +#if (FF_HAVE_DRM && FF_HAVE_VA) || FF_HAVE_VDPAU + + #include "common/library.h" + #include "common/mallocHelper.h" + #include "common/io.h" + + #if FF_HAVE_DRM && FF_HAVE_VA + #include "detection/gpu/gpu.h" + + #include + #include + #include + #include + #endif + + #include + + #if FF_HAVE_VDPAU + #include + #include + +VdpStatus vdp_device_create_x11(void* display, int screen, VdpDevice* device, VdpGetProcAddress** get_proc_address); +void* XOpenDisplay(const char* display_name); +int XCloseDisplay(void* display); +int XDefaultScreen(void* display); + #endif + + #if FF_HAVE_DRM && FF_HAVE_VA + +static FFCodecType ffCodecProfileToType(VAProfile profile) { + switch (profile) { + case 11: // VAProfileH263Baseline + return FF_CODEC_TYPE_H263; + + case 12: // VAProfileJPEGBaseline + return FF_CODEC_TYPE_MJPEG; + + case 0: // VAProfileMPEG2Simple + case 1: // VAProfileMPEG2Main + return FF_CODEC_TYPE_MPEG2; + + case 2: // VAProfileMPEG4Simple + case 3: // VAProfileMPEG4AdvancedSimple + case 4: // VAProfileMPEG4Main + return FF_CODEC_TYPE_DIVX_XVID; + + case 5: // VAProfileH264Baseline + case 6: // VAProfileH264Main + case 7: // VAProfileH264High + case 13: // VAProfileH264ConstrainedBaseline + case 15: // VAProfileH264MultiviewHigh + case 16: // VAProfileH264StereoHigh + case 36: // VAProfileH264High10 + case 40: // VAProfileH264High422 + return FF_CODEC_TYPE_H264; + + case 8: // VAProfileVC1Simple + case 9: // VAProfileVC1Main + case 10: // VAProfileVC1Advanced + return FF_CODEC_TYPE_VC1; + + case 14: // VAProfileVP8Version0_3 + return FF_CODEC_TYPE_VP8; + + case 17: // VAProfileHEVCMain + case 18: // VAProfileHEVCMain10 + case 23: // VAProfileHEVCMain12 + case 24: // VAProfileHEVCMain422_10 + case 25: // VAProfileHEVCMain422_12 + case 26: // VAProfileHEVCMain444 + case 27: // VAProfileHEVCMain444_10 + case 28: // VAProfileHEVCMain444_12 + case 29: // VAProfileHEVCSccMain + case 30: // VAProfileHEVCSccMain10 + case 31: // VAProfileHEVCSccMain444 + case 34: // VAProfileHEVCSccMain444_10 + return FF_CODEC_TYPE_HEVC; + + case 19: // VAProfileVP9Profile0 + case 20: // VAProfileVP9Profile1 + case 21: // VAProfileVP9Profile2 + case 22: // VAProfileVP9Profile3 + return FF_CODEC_TYPE_VP9; + + case 32: // VAProfileAV1Profile0 + case 33: // VAProfileAV1Profile1 + case 39: // VAProfileAV1Profile2 + return FF_CODEC_TYPE_AV1; + + case 37: // VAProfileVVCMain10 + case 38: // VAProfileVVCMultilayerMain10 + return FF_CODEC_TYPE_VVC; + + default: + return FF_CODEC_TYPE_UNKNOWN; + } +} + +static FFCodecShowType ffCodecGetEntrypointType(VAEntrypoint entrypoint) { + switch (entrypoint) { + case VAEntrypointVLD: + case VAEntrypointIDCT: + case VAEntrypointMoComp: + return FF_CODEC_SHOW_TYPE_DECODER; + case VAEntrypointEncSlice: + case VAEntrypointEncSliceLP: + case VAEntrypointFEI: + return FF_CODEC_SHOW_TYPE_ENCODER; + default: + return FF_CODEC_SHOW_TYPE_NONE; + } +} + +static bool ffCodecProfileHasOutput( + VADisplay display, + __typeof__(vaQueryConfigEntrypoints)* ffvaQueryConfigEntrypoints, + __typeof__(vaGetConfigAttributes)* ffvaGetConfigAttributes, + int maxEntrypoints, + VAEntrypoint* entrypoints, + VAProfile profile, + FFCodecShowType entrypointType) { + int numEntrypoints = maxEntrypoints; + if (ffvaQueryConfigEntrypoints(display, profile, entrypoints, &numEntrypoints) != VA_STATUS_SUCCESS) { + return false; + } + + for (int i = 0; i < numEntrypoints; ++i) { + if (ffCodecGetEntrypointType(entrypoints[i]) != entrypointType) { + continue; + } + + VAConfigAttrib attrib = { + .type = VAConfigAttribRTFormat, + .value = 0, + }; + + if (ffvaGetConfigAttributes(display, profile, entrypoints[i], &attrib, 1) == VA_STATUS_SUCCESS && + attrib.value != VA_ATTRIB_NOT_SUPPORTED && + attrib.value != 0) { + return true; + } + } + + return false; +} + +static void ffCodecFillGpuName(const drmDevice* dev, const char* path, FFstrbuf* name) { + ffStrbufInit(name); + + switch (dev->bustype) { + case DRM_BUS_PCI: { + FFGPUResult gpu = { + .vendor = ffStrbufCreateStatic(ffGPUGetVendorString(dev->deviceinfo.pci->vendor_id)), + .name = ffStrbufCreate(), + }; + + ffGPUFillVendorAndName(0, dev->deviceinfo.pci->vendor_id, dev->deviceinfo.pci->device_id, &gpu); + ffStrbufSetF(name, "%s %s", gpu.vendor.chars, gpu.name.chars); + + ffStrbufDestroy(&gpu.vendor); + ffStrbufDestroy(&gpu.name); + break; + } + case DRM_BUS_PLATFORM: + ffStrbufSetS(name, dev->deviceinfo.platform->compatible[0]); + return; + case DRM_BUS_HOST1X: + ffStrbufSetS(name, dev->deviceinfo.host1x->compatible[0]); + return; + case DRM_BUS_USB: + ffStrbufSetF(name, "0x%04X 0x%04X", dev->deviceinfo.usb->vendor, dev->deviceinfo.usb->product); + return; + default: + ffStrbufSetStatic(name, "Unknown GPU"); + return; + } + + if (!name->length && path && *path) { + const char* base = strrchr(path, '/'); + ffStrbufSetS(name, base ? base + 1 : path); + } + + if (!name->length) { + ffStrbufSetStatic(name, "Unknown GPU"); + } +} + +static const char* ffDetectCodecByVa(FFCodecOptions* options, FFlist* result) { + FF_LIBRARY_LOAD_MESSAGE(libdrm, "libdrm" FF_LIBRARY_EXTENSION, 2) + FF_LIBRARY_LOAD_SYMBOL_MESSAGE(libdrm, drmGetDevices) + FF_LIBRARY_LOAD_SYMBOL_MESSAGE(libdrm, drmFreeDevices) + + FF_LIBRARY_LOAD_MESSAGE(libva, "libva" FF_LIBRARY_EXTENSION, 2) + FF_LIBRARY_LOAD_SYMBOL_MESSAGE(libva, vaInitialize) + FF_LIBRARY_LOAD_SYMBOL_MESSAGE(libva, vaTerminate) + FF_LIBRARY_LOAD_SYMBOL_MESSAGE(libva, vaMaxNumProfiles) + FF_LIBRARY_LOAD_SYMBOL_MESSAGE(libva, vaMaxNumEntrypoints) + FF_LIBRARY_LOAD_SYMBOL_MESSAGE(libva, vaQueryConfigProfiles) + FF_LIBRARY_LOAD_SYMBOL_MESSAGE(libva, vaQueryConfigEntrypoints) + FF_LIBRARY_LOAD_SYMBOL_MESSAGE(libva, vaGetConfigAttributes) + + FF_LIBRARY_LOAD_MESSAGE(libvaDrm, "libva-drm" FF_LIBRARY_EXTENSION, 2) + FF_LIBRARY_LOAD_SYMBOL_MESSAGE(libvaDrm, vaGetDisplayDRM) + + drmDevicePtr devices[64]; + int numDevices = ffdrmGetDevices(devices, ARRAY_SIZE(devices)); + if (numDevices < 0) { + return "drmGetDevices() failed"; + } + if (numDevices == 0) { + return "No DRM devices found"; + } + + const char* error = "No DRM device could initialize VA-API"; + + for (int i = 0; i < numDevices; ++i) { + drmDevice* dev = devices[i]; + + const char* path = NULL; + if (dev->available_nodes & (1 << DRM_NODE_RENDER)) { + path = dev->nodes[DRM_NODE_RENDER]; + } else if (dev->available_nodes & (1 << DRM_NODE_PRIMARY)) { + path = dev->nodes[DRM_NODE_PRIMARY]; + } else { + continue; + } + + FF_AUTO_CLOSE_FD int fd = open(path, O_RDWR | O_CLOEXEC); + if (fd < 0) { + fd = open(path, O_RDONLY | O_CLOEXEC); + } + if (fd < 0) { + continue; + } + + VADisplay display = ffvaGetDisplayDRM(fd); + if (!display) { + continue; + } + + int major = 0, minor = 0; + if (ffvaInitialize(display, &major, &minor) != VA_STATUS_SUCCESS) { + continue; + } + error = NULL; + + int maxProfiles = ffvaMaxNumProfiles(display); + int maxEntrypoints = ffvaMaxNumEntrypoints(display); + if (maxProfiles <= 0 || maxEntrypoints <= 0) { + ffvaTerminate(display); + continue; + } + + FF_AUTO_FREE VAProfile* profiles = (VAProfile*) malloc(sizeof(VAProfile) * (size_t) maxProfiles); + FF_AUTO_FREE VAEntrypoint* entrypoints = (VAEntrypoint*) malloc(sizeof(VAEntrypoint) * (size_t) maxEntrypoints); + + int numProfiles = maxProfiles; + if (ffvaQueryConfigProfiles(display, profiles, &numProfiles) != VA_STATUS_SUCCESS) { + ffvaTerminate(display); + continue; + } + + FFCodecType decoderTypes = FF_CODEC_TYPE_NONE; + FFCodecType encoderTypes = FF_CODEC_TYPE_NONE; + for (int j = 0; j < numProfiles; ++j) { + FFCodecType type = ffCodecProfileToType(profiles[j]); + + bool hasDecoder = (options->showType & FF_CODEC_SHOW_TYPE_DECODER) && + !(decoderTypes & type) && + ffCodecProfileHasOutput( + display, + ffvaQueryConfigEntrypoints, + ffvaGetConfigAttributes, + maxEntrypoints, + entrypoints, + profiles[j], + FF_CODEC_SHOW_TYPE_DECODER); + + bool hasEncoder = (options->showType & FF_CODEC_SHOW_TYPE_ENCODER) && + !(encoderTypes & type) && + ffCodecProfileHasOutput( + display, + ffvaQueryConfigEntrypoints, + ffvaGetConfigAttributes, + maxEntrypoints, + entrypoints, + profiles[j], + FF_CODEC_SHOW_TYPE_ENCODER); + + if (!hasDecoder && !hasEncoder) { + continue; + } + + if (hasDecoder) { + decoderTypes |= type; + } + if (hasEncoder) { + encoderTypes |= type; + } + } + + if (decoderTypes != FF_CODEC_TYPE_NONE || encoderTypes != FF_CODEC_TYPE_NONE) { + FFCodecResult* item = FF_LIST_ADD(FFCodecResult, *result); + ffCodecFillGpuName(dev, path, &item->gpu); + item->decoders = decoderTypes; + item->encoders = encoderTypes; + item->platformApi = "VA-API"; + } + + ffvaTerminate(display); + } + + ffdrmFreeDevices(devices, numDevices); + return error; +} + #endif + + #if FF_HAVE_VDPAU + +static const struct FFCodecVdpauCodec { + VdpDecoderProfile profile; + FFCodecType type; +} FF_CODEC_VDPAU_CODECS[] = { + { 0, FF_CODEC_TYPE_MPEG1 }, // VDP_DECODER_PROFILE_MPEG1 + { 1, FF_CODEC_TYPE_MPEG2 }, // VDP_DECODER_PROFILE_MPEG2_SIMPLE + { 2, FF_CODEC_TYPE_MPEG2 }, // VDP_DECODER_PROFILE_MPEG2_MAIN + { 12, FF_CODEC_TYPE_DIVX_XVID }, // VDP_DECODER_PROFILE_MPEG4_PART2_SP + { 13, FF_CODEC_TYPE_DIVX_XVID }, // VDP_DECODER_PROFILE_MPEG4_PART2_ASP + { 14, FF_CODEC_TYPE_DIVX_XVID }, // VDP_DECODER_PROFILE_DIVX4_QMOBILE + { 15, FF_CODEC_TYPE_DIVX_XVID }, // VDP_DECODER_PROFILE_DIVX4_MOBILE + { 16, FF_CODEC_TYPE_DIVX_XVID }, // VDP_DECODER_PROFILE_DIVX4_HOME_THEATER + { 17, FF_CODEC_TYPE_DIVX_XVID }, // VDP_DECODER_PROFILE_DIVX4_HD_1080P + { 18, FF_CODEC_TYPE_DIVX_XVID }, // VDP_DECODER_PROFILE_DIVX5_QMOBILE + { 19, FF_CODEC_TYPE_DIVX_XVID }, // VDP_DECODER_PROFILE_DIVX5_MOBILE + { 20, FF_CODEC_TYPE_DIVX_XVID }, // VDP_DECODER_PROFILE_DIVX5_HOME_THEATER + { 21, FF_CODEC_TYPE_DIVX_XVID }, // VDP_DECODER_PROFILE_DIVX5_HD_1080P + { 6, FF_CODEC_TYPE_H264 }, // VDP_DECODER_PROFILE_H264_BASELINE + { 7, FF_CODEC_TYPE_H264 }, // VDP_DECODER_PROFILE_H264_MAIN + { 8, FF_CODEC_TYPE_H264 }, // VDP_DECODER_PROFILE_H264_HIGH + { 22, FF_CODEC_TYPE_H264 }, // VDP_DECODER_PROFILE_H264_CONSTRAINED_BASELINE + { 23, FF_CODEC_TYPE_H264 }, // VDP_DECODER_PROFILE_H264_EXTENDED + { 24, FF_CODEC_TYPE_H264 }, // VDP_DECODER_PROFILE_H264_PROGRESSIVE_HIGH + { 25, FF_CODEC_TYPE_H264 }, // VDP_DECODER_PROFILE_H264_CONSTRAINED_HIGH + { 26, FF_CODEC_TYPE_H264 }, // VDP_DECODER_PROFILE_H264_HIGH_444_PREDICTIVE + { 9, FF_CODEC_TYPE_VC1 }, // VDP_DECODER_PROFILE_VC1_SIMPLE + { 10, FF_CODEC_TYPE_VC1 }, // VDP_DECODER_PROFILE_VC1_MAIN + { 11, FF_CODEC_TYPE_VC1 }, // VDP_DECODER_PROFILE_VC1_ADVANCED + { 100, FF_CODEC_TYPE_HEVC }, // VDP_DECODER_PROFILE_HEVC_MAIN + { 101, FF_CODEC_TYPE_HEVC }, // VDP_DECODER_PROFILE_HEVC_MAIN_10 + { 102, FF_CODEC_TYPE_HEVC }, // VDP_DECODER_PROFILE_HEVC_MAIN_STILL + { 103, FF_CODEC_TYPE_HEVC }, // VDP_DECODER_PROFILE_HEVC_MAIN_12 + { 104, FF_CODEC_TYPE_HEVC }, // VDP_DECODER_PROFILE_HEVC_MAIN_444 + { 105, FF_CODEC_TYPE_HEVC }, // VDP_DECODER_PROFILE_HEVC_MAIN_444_10 + { 106, FF_CODEC_TYPE_HEVC }, // VDP_DECODER_PROFILE_HEVC_MAIN_444_12 + { 27, FF_CODEC_TYPE_VP9 }, // VDP_DECODER_PROFILE_VP9_PROFILE_0 + { 28, FF_CODEC_TYPE_VP9 }, // VDP_DECODER_PROFILE_VP9_PROFILE_1 + { 29, FF_CODEC_TYPE_VP9 }, // VDP_DECODER_PROFILE_VP9_PROFILE_2 + { 30, FF_CODEC_TYPE_VP9 }, // VDP_DECODER_PROFILE_VP9_PROFILE_3 + { 107, FF_CODEC_TYPE_AV1 }, // VDP_DECODER_PROFILE_AV1_MAIN + { 108, FF_CODEC_TYPE_AV1 }, // VDP_DECODER_PROFILE_AV1_HIGH + { 109, FF_CODEC_TYPE_AV1 }, // VDP_DECODER_PROFILE_AV1_PROFESSIONAL +}; + +static const char* ffDetectCodecByVdpau(FFCodecOptions* options, FFlist* result) { + if (options->showType == FF_CODEC_SHOW_TYPE_DECODER) { + return "VDPAU only supports decoding"; + } + + FF_LIBRARY_LOAD_MESSAGE(libX11, "libX11" FF_LIBRARY_EXTENSION, 6) + FF_LIBRARY_LOAD_SYMBOL_MESSAGE(libX11, XOpenDisplay) + FF_LIBRARY_LOAD_SYMBOL_MESSAGE(libX11, XCloseDisplay) + FF_LIBRARY_LOAD_SYMBOL_MESSAGE(libX11, XDefaultScreen) + + FF_LIBRARY_LOAD_MESSAGE(libvdpau, "libvdpau" FF_LIBRARY_EXTENSION, 1) + FF_LIBRARY_LOAD_SYMBOL_MESSAGE(libvdpau, vdp_device_create_x11) + + void* x11Display = ffXOpenDisplay(NULL); + if (!x11Display) { + return "XOpenDisplay() failed"; + } + + VdpDevice device = VDP_INVALID_HANDLE; + VdpGetProcAddress* ffvdp_get_proc_address = NULL; + if (ffvdp_device_create_x11(x11Display, ffXDefaultScreen(x11Display), &device, &ffvdp_get_proc_address) != VDP_STATUS_OK || + device == VDP_INVALID_HANDLE || + ffvdp_get_proc_address == NULL) { + ffXCloseDisplay(x11Display); + return "vdp_device_create_x11() failed"; + } + + VdpDeviceDestroy* ffvdp_device_destroy = NULL; + VdpDecoderQueryCapabilities* ffvdp_decoder_query_capabilities = NULL; + if (ffvdp_get_proc_address(device, VDP_FUNC_ID_DEVICE_DESTROY, (void**) &ffvdp_device_destroy) != VDP_STATUS_OK || + ffvdp_get_proc_address(device, VDP_FUNC_ID_DECODER_QUERY_CAPABILITIES, (void**) &ffvdp_decoder_query_capabilities) != VDP_STATUS_OK || + ffvdp_device_destroy == NULL || + ffvdp_decoder_query_capabilities == NULL) { + if (ffvdp_device_destroy) { + ffvdp_device_destroy(device); + } + ffXCloseDisplay(x11Display); + return "ffvdp_get_proc_address() failed"; + } + + FFCodecType decoderTypes = FF_CODEC_TYPE_NONE; + + for (uint32_t i = 0; i < ARRAY_SIZE(FF_CODEC_VDPAU_CODECS); ++i) { + const struct FFCodecVdpauCodec* codec = &FF_CODEC_VDPAU_CODECS[i]; + if (decoderTypes & codec->type) { + continue; + } + VdpBool isSupported = VDP_FALSE; + uint32_t maxLevel = 0, maxMacroblocks = 0, maxWidth = 0, maxHeight = 0; + if (ffvdp_decoder_query_capabilities(device, codec->profile, &isSupported, &maxLevel, &maxMacroblocks, &maxWidth, &maxHeight) != VDP_STATUS_OK || + !isSupported) { + continue; + } + + decoderTypes |= codec->type; + } + + ffvdp_device_destroy(device); + ffXCloseDisplay(x11Display); + + if (decoderTypes == FF_CODEC_TYPE_NONE) { + return NULL; + } + + FFCodecResult* item = FF_LIST_ADD(FFCodecResult, *result); + ffStrbufInit(&item->gpu); + const char* driver = getenv("VDPAU_DRIVER"); + if (driver && *driver) { + ffStrbufSetS(&item->gpu, driver); + } else { + ffStrbufSetStatic(&item->gpu, "Default"); + } + item->decoders = decoderTypes; + item->encoders = FF_CODEC_TYPE_NONE; + item->platformApi = "VDPAU"; + + return NULL; +} + #endif + +const char* ffDetectCodecNative(FFCodecOptions* options, FFlist* result /* list of FFCodecResult */) { + FF_SUPPRESS_IO(); + + #if FF_HAVE_DRM && FF_HAVE_VA + if (ffDetectCodecByVa(options, result) == NULL) { + return NULL; + } + #endif + #if FF_HAVE_VDPAU + if (ffDetectCodecByVdpau(options, result) == NULL) { + return NULL; + } + #endif + + return "Both libva and libvdpau fail to initialize"; +} + +#else + +const char* ffDetectCodecNative(FFCodecOptions* options, FFlist* result /* list of FFCodecResult */) { + FF_UNUSED(options, result); + return "Fastfetch was built without DRM / VA-API / VDPAU headers"; +} + +#endif diff --git a/src/detection/codec/codec_vulkan.c b/src/detection/codec/codec_vulkan.c new file mode 100644 index 0000000000..eabfe26160 --- /dev/null +++ b/src/detection/codec/codec_vulkan.c @@ -0,0 +1,270 @@ +#include "codec.h" + +#ifdef FF_HAVE_VULKAN + #include + #include "common/strutil.h" + + #if VK_KHR_video_decode_queue && VK_KHR_video_encode_queue + + #include "common/debug.h" + #include "common/io.h" + #include "common/library.h" + #include "common/mallocHelper.h" + +static FFCodecType ffCodecDecodeOperationsToTypes(VkVideoCodecOperationFlagsKHR operations) { + FFCodecType types = FF_CODEC_TYPE_NONE; + + if (operations & 0x00000001 /*VK_VIDEO_CODEC_OPERATION_DECODE_H264_BIT_KHR*/) { + types |= FF_CODEC_TYPE_H264; + } + if (operations & 0x00000002 /*VK_VIDEO_CODEC_OPERATION_DECODE_H265_BIT_KHR*/) { + types |= FF_CODEC_TYPE_HEVC; + } + if (operations & 0x00000004 /*VK_VIDEO_CODEC_OPERATION_DECODE_AV1_BIT_KHR*/) { + types |= FF_CODEC_TYPE_AV1; + } + if (operations & 0x00000008 /*VK_VIDEO_CODEC_OPERATION_DECODE_VP9_BIT_KHR*/) { + types |= FF_CODEC_TYPE_VP9; + } + + return types; +} + +static FFCodecType ffCodecEncodeOperationsToTypes(VkVideoCodecOperationFlagsKHR operations) { + FFCodecType types = FF_CODEC_TYPE_NONE; + + if (operations & 0x00010000 /*VK_VIDEO_CODEC_OPERATION_ENCODE_H264_BIT_KHR*/) { + types |= FF_CODEC_TYPE_H264; + } + if (operations & 0x00020000 /*VK_VIDEO_CODEC_OPERATION_ENCODE_H265_BIT_KHR*/) { + types |= FF_CODEC_TYPE_HEVC; + } + if (operations & 0x00040000 /*VK_VIDEO_CODEC_OPERATION_ENCODE_AV1_BIT_KHR*/) { + types |= FF_CODEC_TYPE_AV1; + } + + return types; +} + +static bool ffCodecHasDeviceExtension(const VkExtensionProperties* extensions, uint32_t extensionCount, const char* extensionName) { + for (uint32_t i = 0; i < extensionCount; ++i) { + if (ffStrEquals(extensions[i].extensionName, extensionName)) { + return true; + } + } + + return false; +} + +const char* ffDetectCodecVulkan(FFCodecOptions* options, FFlist* result /*list of FFCodecResult*/) { + FF_DEBUG("Starting Vulkan codec detection"); + + FF_LIBRARY_LOAD_MESSAGE(vulkan, + #if __APPLE__ + "libMoltenVK" FF_LIBRARY_EXTENSION, + -1 + #elif _WIN32 + "vulkan-1" FF_LIBRARY_EXTENSION, + -1 + #else + "libvulkan" FF_LIBRARY_EXTENSION, + 2 + #endif + ) + FF_LIBRARY_LOAD_SYMBOL_MESSAGE(vulkan, vkGetInstanceProcAddr) + FF_LIBRARY_LOAD_SYMBOL_MESSAGE(vulkan, vkCreateInstance) + FF_LIBRARY_LOAD_SYMBOL_MESSAGE(vulkan, vkDestroyInstance) + FF_LIBRARY_LOAD_SYMBOL_MESSAGE(vulkan, vkEnumeratePhysicalDevices) + FF_LIBRARY_LOAD_SYMBOL_MESSAGE(vulkan, vkEnumerateDeviceExtensionProperties) + + FF_SUPPRESS_IO(); + + uint32_t apiVersion = VK_API_VERSION_1_0; + PFN_vkEnumerateInstanceVersion ffvkEnumerateInstanceVersion = (PFN_vkEnumerateInstanceVersion) ffvkGetInstanceProcAddr(NULL, "vkEnumerateInstanceVersion"); + if (ffvkEnumerateInstanceVersion != NULL) { + uint32_t detectedApiVersion = 0; + if (ffvkEnumerateInstanceVersion(&detectedApiVersion) == VK_SUCCESS) { + apiVersion = detectedApiVersion; + } + } + + const uint32_t projectVersion = VK_MAKE_VERSION( + FASTFETCH_PROJECT_VERSION_MAJOR, + FASTFETCH_PROJECT_VERSION_MINOR, + FASTFETCH_PROJECT_VERSION_PATCH); + + VkInstance vkInstance = VK_NULL_HANDLE; + VkResult res = ffvkCreateInstance(&(VkInstanceCreateInfo){ + .sType = VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO, + .pApplicationInfo = &(VkApplicationInfo){ + .sType = VK_STRUCTURE_TYPE_APPLICATION_INFO, + .pApplicationName = FASTFETCH_PROJECT_NAME, + .applicationVersion = projectVersion, + .pEngineName = "fastfetch-codec-vulkan", + .engineVersion = projectVersion, + .apiVersion = apiVersion, + }, + }, + NULL, + &vkInstance); + if (res != VK_SUCCESS) { + FF_DEBUG("ffvkCreateInstance() failed with VkResult=%d", res); + switch (res) { + case VK_ERROR_OUT_OF_HOST_MEMORY: + return "ffvkCreateInstance() failed: VK_ERROR_OUT_OF_HOST_MEMORY"; + case VK_ERROR_OUT_OF_DEVICE_MEMORY: + return "ffvkCreateInstance() failed: VK_ERROR_OUT_OF_DEVICE_MEMORY"; + case VK_ERROR_INITIALIZATION_FAILED: + return "ffvkCreateInstance() failed: VK_ERROR_INITIALIZATION_FAILED"; + case VK_ERROR_LAYER_NOT_PRESENT: + return "ffvkCreateInstance() failed: VK_ERROR_LAYER_NOT_PRESENT"; + case VK_ERROR_EXTENSION_NOT_PRESENT: + return "ffvkCreateInstance() failed: VK_ERROR_EXTENSION_NOT_PRESENT"; + case VK_ERROR_INCOMPATIBLE_DRIVER: + return "ffvkCreateInstance() failed: VK_ERROR_INCOMPATIBLE_DRIVER"; + default: + return "ffvkCreateInstance() failed: unknown error"; + } + } + + PFN_vkGetPhysicalDeviceProperties ffvkGetPhysicalDeviceProperties = (PFN_vkGetPhysicalDeviceProperties) ffvkGetInstanceProcAddr(vkInstance, "vkGetPhysicalDeviceProperties"); + if (!ffvkGetPhysicalDeviceProperties) { + ffvkDestroyInstance(vkInstance, NULL); + return "vkGetPhysicalDeviceProperties is not available"; + } + + PFN_vkGetPhysicalDeviceQueueFamilyProperties2 ffvkGetPhysicalDeviceQueueFamilyProperties2 = (PFN_vkGetPhysicalDeviceQueueFamilyProperties2) ffvkGetInstanceProcAddr(vkInstance, "vkGetPhysicalDeviceQueueFamilyProperties2"); + if (!ffvkGetPhysicalDeviceQueueFamilyProperties2) { + ffvkDestroyInstance(vkInstance, NULL); + return "vkGetPhysicalDeviceQueueFamilyProperties2 is not available"; + } + + uint32_t physicalDeviceCount = 0; + res = ffvkEnumeratePhysicalDevices(vkInstance, &physicalDeviceCount, NULL); + if (res != VK_SUCCESS) { + FF_DEBUG("ffvkEnumeratePhysicalDevices(count) failed with VkResult=%d", res); + ffvkDestroyInstance(vkInstance, NULL); + return "ffvkEnumeratePhysicalDevices() failed during Vulkan codec detection"; + } + if (physicalDeviceCount == 0) { + ffvkDestroyInstance(vkInstance, NULL); + return "No Vulkan physical devices found"; + } + + FF_AUTO_FREE VkPhysicalDevice* physicalDevices = (VkPhysicalDevice*) malloc(sizeof(VkPhysicalDevice) * (size_t) physicalDeviceCount); + + res = ffvkEnumeratePhysicalDevices(vkInstance, &physicalDeviceCount, physicalDevices); + if (res != VK_SUCCESS) { + FF_DEBUG("ffvkEnumeratePhysicalDevices(list) failed with VkResult=%d", res); + ffvkDestroyInstance(vkInstance, NULL); + return "ffvkEnumeratePhysicalDevices() failed during Vulkan codec detection"; + } + + bool sawVideoQueueExtension = false; + + for (uint32_t i = 0; i < physicalDeviceCount; ++i) { + VkPhysicalDeviceProperties properties = {}; + ffvkGetPhysicalDeviceProperties(physicalDevices[i], &properties); + + uint32_t extensionCount = 0; + res = ffvkEnumerateDeviceExtensionProperties(physicalDevices[i], NULL, &extensionCount, NULL); + if (res != VK_SUCCESS) { + FF_DEBUG("vkEnumerateDeviceExtensionProperties(count) failed for '%s' with VkResult=%d", properties.deviceName, res); + continue; + } + + if (extensionCount == 0) { + FF_DEBUG("Skipping Vulkan device '%s' because it has no extensions", properties.deviceName); + continue; + } + + FF_AUTO_FREE VkExtensionProperties* extensions = (VkExtensionProperties*) malloc(sizeof(VkExtensionProperties) * (size_t) extensionCount); + + res = ffvkEnumerateDeviceExtensionProperties(physicalDevices[i], NULL, &extensionCount, extensions); + if (res != VK_SUCCESS) { + FF_DEBUG("vkEnumerateDeviceExtensionProperties(list) failed for '%s' with VkResult=%d", properties.deviceName, res); + continue; + } + + bool hasVideoDecode = (options->showType & FF_CODEC_SHOW_TYPE_DECODER) && + ffCodecHasDeviceExtension(extensions, extensionCount, VK_KHR_VIDEO_DECODE_QUEUE_EXTENSION_NAME); + bool hasVideoEncode = (options->showType & FF_CODEC_SHOW_TYPE_ENCODER) && + ffCodecHasDeviceExtension(extensions, extensionCount, VK_KHR_VIDEO_ENCODE_QUEUE_EXTENSION_NAME); + + if (!hasVideoDecode && !hasVideoEncode) { + FF_DEBUG("Skipping Vulkan device '%s' because it does not support video queue extensions", properties.deviceName); + continue; + } + sawVideoQueueExtension = true; + + uint32_t queueFamilyCount = 0; + ffvkGetPhysicalDeviceQueueFamilyProperties2(physicalDevices[i], &queueFamilyCount, NULL); + if (queueFamilyCount == 0) { + FF_DEBUG("Skipping Vulkan device '%s' because it has no queue families", properties.deviceName); + continue; + } + + FF_AUTO_FREE VkQueueFamilyProperties2* queueFamilyProperties = (VkQueueFamilyProperties2*) malloc(sizeof(VkQueueFamilyProperties2) * (size_t) queueFamilyCount); + FF_AUTO_FREE VkQueueFamilyVideoPropertiesKHR* queueFamilyVideoProperties = (VkQueueFamilyVideoPropertiesKHR*) malloc(sizeof(VkQueueFamilyVideoPropertiesKHR) * (size_t) queueFamilyCount); + + for (uint32_t queueIndex = 0; queueIndex < queueFamilyCount; ++queueIndex) { + queueFamilyVideoProperties[queueIndex] = (VkQueueFamilyVideoPropertiesKHR){ + .sType = VK_STRUCTURE_TYPE_QUEUE_FAMILY_VIDEO_PROPERTIES_KHR, + }; + queueFamilyProperties[queueIndex] = (VkQueueFamilyProperties2){ + .sType = VK_STRUCTURE_TYPE_QUEUE_FAMILY_PROPERTIES_2, + .pNext = &queueFamilyVideoProperties[queueIndex], + }; + } + + ffvkGetPhysicalDeviceQueueFamilyProperties2(physicalDevices[i], &queueFamilyCount, queueFamilyProperties); + + FFCodecType decoders = FF_CODEC_TYPE_NONE; + FFCodecType encoders = FF_CODEC_TYPE_NONE; + + for (uint32_t queueIndex = 0; queueIndex < queueFamilyCount; ++queueIndex) { + const VkQueueFlags queueFlags = queueFamilyProperties[queueIndex].queueFamilyProperties.queueFlags; + const VkVideoCodecOperationFlagsKHR operations = queueFamilyVideoProperties[queueIndex].videoCodecOperations; + + if (hasVideoDecode && (queueFlags & VK_QUEUE_VIDEO_DECODE_BIT_KHR)) { + decoders |= ffCodecDecodeOperationsToTypes(operations); + } + + if (hasVideoEncode && (queueFlags & VK_QUEUE_VIDEO_ENCODE_BIT_KHR)) { + encoders |= ffCodecEncodeOperationsToTypes(operations); + } + } + + if (decoders == FF_CODEC_TYPE_NONE && encoders == FF_CODEC_TYPE_NONE) { + FF_DEBUG("Skipping Vulkan device '%s' because no supported codec operations were reported", properties.deviceName); + continue; + } + + FFCodecResult* item = FF_LIST_ADD(FFCodecResult, *result); + ffStrbufInitS(&item->gpu, properties.deviceName); + item->decoders = decoders; + item->encoders = encoders; + item->platformApi = "Vulkan Video"; + FF_DEBUG("Added Vulkan codec result for '%s': decoders=%u encoders=%u", properties.deviceName, (unsigned) decoders, (unsigned) encoders); + } + + ffvkDestroyInstance(vkInstance, NULL); + + if (result->length > 0) { + return NULL; + } + + return sawVideoQueueExtension ? "No supported Vulkan video codec operations found" + : "VK_KHR_video_queue is not supported by any Vulkan physical device"; +} + + #else + +const char* ffDetectCodecVulkan(FFCodecOptions* options, FFlist* result) { + FF_UNUSED(options, result); + return "Vulkan video queue extensions are not supported by this Vulkan implementation"; +} + + #endif + +#endif diff --git a/src/detection/codec/codec_windows.cpp b/src/detection/codec/codec_windows.cpp new file mode 100644 index 0000000000..df01a63789 --- /dev/null +++ b/src/detection/codec/codec_windows.cpp @@ -0,0 +1,553 @@ +extern "C" { +#include "codec.h" +#include "common/library.h" +#include "common/windows/com.h" +#include "common/windows/unicode.h" +#include "common/windows/nt.h" +} + +#include +#include +#include +#include +#include +#include +#include + +typedef struct D3D12_FEATURE_DATA_VIDEO_ENCODER_CODEC { + UINT NodeIndex; + D3D12_VIDEO_ENCODER_CODEC Codec; + BOOL IsSupported; +} D3D12_FEATURE_DATA_VIDEO_ENCODER_CODEC; + +HRESULT MFTEnum2( + _In_ GUID guidCategory, + _In_ UINT32 Flags, + _In_ const MFT_REGISTER_TYPE_INFO* pInputType, + _In_ const MFT_REGISTER_TYPE_INFO* pOutputType, + _In_opt_ IMFAttributes* pAttributes, + _Out_ IMFActivate*** pppMFTActivate, + _Out_ UINT32* pnumMFTActivate); + +// clang-format off +#ifndef MFT_ENUM_ADAPTER_LUID +// {1D39518C-E220-4DA8-A07F-BA172552D6B1} +DEFINE_GUID(MFT_ENUM_ADAPTER_LUID, + 0x1d39518c, 0xe220, 0x4da8, 0xa0, 0x7f, 0xba, 0x17, 0x25, 0x52, 0xd6, 0xb1); +#endif +// clang-format on + +static const DXGI_FORMAT FF_NATIVE_CODEC_FORMATS[] = { + DXGI_FORMAT_420_OPAQUE, + DXGI_FORMAT_NV12, + DXGI_FORMAT_P010, + DXGI_FORMAT_P016, + DXGI_FORMAT_YUY2, + DXGI_FORMAT_Y210, + DXGI_FORMAT_Y216, + DXGI_FORMAT_AYUV, + DXGI_FORMAT_Y410, + DXGI_FORMAT_Y416, +}; + +static FFCodecType ffCodecProfileToTypeDx11(const GUID& profile) { + // clang-format off + if (IsEqualGUID(profile, DXVA_ModeH261_A) || + IsEqualGUID(profile, DXVA_ModeH261_B)) { + return FF_CODEC_TYPE_H261; + } + + if (IsEqualGUID(profile, DXVA_ModeH263_A) || + IsEqualGUID(profile, DXVA_ModeH263_B) || + IsEqualGUID(profile, DXVA_ModeH263_C) || + IsEqualGUID(profile, DXVA_ModeH263_D) || + IsEqualGUID(profile, DXVA_ModeH263_E) || + IsEqualGUID(profile, DXVA_ModeH263_F)) { + return FF_CODEC_TYPE_H263; + } + + if (IsEqualGUID(profile, DXVA_ModeMJPEG_VLD_420) || + IsEqualGUID(profile, DXVA_ModeMJPEG_VLD_422) || + IsEqualGUID(profile, DXVA_ModeMJPEG_VLD_444) || + IsEqualGUID(profile, DXVA_ModeMJPEG_VLD_4444) || + IsEqualGUID(profile, DXVA_ModeJPEG_VLD_420) || + IsEqualGUID(profile, DXVA_ModeJPEG_VLD_422) || + IsEqualGUID(profile, DXVA_ModeJPEG_VLD_444)) { + return FF_CODEC_TYPE_MJPEG; + } + + if (IsEqualGUID(profile, DXVA_ModeMPEG1_A) || + IsEqualGUID(profile, DXVA_ModeMPEG1_VLD)) { + return FF_CODEC_TYPE_MPEG1; + } + + if (IsEqualGUID(profile, DXVA_ModeMPEG2_A) || + IsEqualGUID(profile, DXVA_ModeMPEG2_B) || + IsEqualGUID(profile, DXVA_ModeMPEG2_C) || + IsEqualGUID(profile, DXVA_ModeMPEG2_D) || + IsEqualGUID(profile, DXVA_ModeMPEG2and1_VLD)) { + return FF_CODEC_TYPE_MPEG2; + } + + if (IsEqualGUID(profile, DXVA_ModeMPEG4pt2_VLD_Simple) || + IsEqualGUID(profile, DXVA_ModeMPEG4pt2_VLD_AdvSimple_NoGMC) || + IsEqualGUID(profile, DXVA_ModeMPEG4pt2_VLD_AdvSimple_GMC)) { + return FF_CODEC_TYPE_DIVX_XVID; + } + + if (IsEqualGUID(profile, DXVA_ModeH264_E) || + IsEqualGUID(profile, DXVA_ModeH264_F) || + IsEqualGUID(profile, DXVA_ModeH264_VLD_WithFMOASO_NoFGT) || + IsEqualGUID(profile, DXVA_ModeH264_VLD_Stereo_Progressive_NoFGT) || + IsEqualGUID(profile, DXVA_ModeH264_VLD_Stereo_NoFGT) || + IsEqualGUID(profile, DXVA_ModeH264_VLD_Multiview_NoFGT)) { + return FF_CODEC_TYPE_H264; + } + + if (IsEqualGUID(profile, DXVA_ModeWMV8_A) || + IsEqualGUID(profile, DXVA_ModeWMV8_B)) { + return FF_CODEC_TYPE_WMV8; + } + + if (IsEqualGUID(profile, DXVA_ModeWMV9_A) || + IsEqualGUID(profile, DXVA_ModeWMV9_B) || + IsEqualGUID(profile, DXVA_ModeWMV9_C)) { + return FF_CODEC_TYPE_WMV9; + } + + if (IsEqualGUID(profile, DXVA_ModeVC1_A) || + IsEqualGUID(profile, DXVA_ModeVC1_B) || + IsEqualGUID(profile, DXVA_ModeVC1_C) || + IsEqualGUID(profile, DXVA_ModeVC1_D) || + IsEqualGUID(profile, DXVA_ModeVC1_D2010)) { + return FF_CODEC_TYPE_VC1; + } + + if (IsEqualGUID(profile, DXVA_ModeVP8_VLD)) { + return FF_CODEC_TYPE_VP8; + } + + if (IsEqualGUID(profile, DXVA_ModeHEVC_VLD_Main) || + IsEqualGUID(profile, DXVA_ModeHEVC_VLD_Main10) || + IsEqualGUID(profile, DXVA_ModeHEVC_VLD_Main12) || + IsEqualGUID(profile, DXVA_ModeHEVC_VLD_Main10_422) || + IsEqualGUID(profile, DXVA_ModeHEVC_VLD_Main12_422) || + IsEqualGUID(profile, DXVA_ModeHEVC_VLD_Main_444) || + IsEqualGUID(profile, DXVA_ModeHEVC_VLD_Main10_Ext) || + IsEqualGUID(profile, DXVA_ModeHEVC_VLD_Main10_444) || + IsEqualGUID(profile, DXVA_ModeHEVC_VLD_Main12_444) || + IsEqualGUID(profile, DXVA_ModeHEVC_VLD_Main16)) { + return FF_CODEC_TYPE_HEVC; + } + + if (IsEqualGUID(profile, DXVA_ModeVP9_VLD_Profile0) || + IsEqualGUID(profile, DXVA_ModeVP9_VLD_10bit_Profile2)) { + return FF_CODEC_TYPE_VP9; + } + + if (IsEqualGUID(profile, DXVA_ModeAV1_VLD_Profile0) || + IsEqualGUID(profile, DXVA_ModeAV1_VLD_Profile1) || + IsEqualGUID(profile, DXVA_ModeAV1_VLD_Profile2) || + IsEqualGUID(profile, DXVA_ModeAV1_VLD_12bit_Profile2) || + IsEqualGUID(profile, DXVA_ModeAV1_VLD_12bit_Profile2_420)) { + return FF_CODEC_TYPE_AV1; + } + // clang-format on + + return FF_CODEC_TYPE_UNKNOWN; +} + +static FFCodecType ffCodecProfileToTypeDx12(const GUID& profile) { + // clang-format off + if (IsEqualGUID(profile, D3D12_VIDEO_DECODE_PROFILE_MPEG1_AND_MPEG2)) { + return FFCodecType(FF_CODEC_TYPE_MPEG1 | FF_CODEC_TYPE_MPEG2); + } + + if (IsEqualGUID(profile, D3D12_VIDEO_DECODE_PROFILE_MPEG2)) { + return FF_CODEC_TYPE_MPEG2; + } + + if (IsEqualGUID(profile, D3D12_VIDEO_DECODE_PROFILE_MPEG4PT2_SIMPLE) || + IsEqualGUID(profile, D3D12_VIDEO_DECODE_PROFILE_MPEG4PT2_ADVSIMPLE_NOGMC)) { + return FF_CODEC_TYPE_DIVX_XVID; + } + + if (IsEqualGUID(profile, D3D12_VIDEO_DECODE_PROFILE_H264) || + IsEqualGUID(profile, D3D12_VIDEO_DECODE_PROFILE_H264_STEREO_PROGRESSIVE) || + IsEqualGUID(profile, D3D12_VIDEO_DECODE_PROFILE_H264_STEREO) || + IsEqualGUID(profile, D3D12_VIDEO_DECODE_PROFILE_H264_MULTIVIEW)) { + return FF_CODEC_TYPE_H264; + } + + if (IsEqualGUID(profile, D3D12_VIDEO_DECODE_PROFILE_VC1) || + IsEqualGUID(profile, D3D12_VIDEO_DECODE_PROFILE_VC1_D2010)) { + return FF_CODEC_TYPE_VC1; + } + + if (IsEqualGUID(profile, D3D12_VIDEO_DECODE_PROFILE_VP8)) { + return FF_CODEC_TYPE_VP8; + } + + if (IsEqualGUID(profile, D3D12_VIDEO_DECODE_PROFILE_HEVC_MAIN) || + IsEqualGUID(profile, D3D12_VIDEO_DECODE_PROFILE_HEVC_MAIN10)) { + return FF_CODEC_TYPE_HEVC; + } + + if (IsEqualGUID(profile, D3D12_VIDEO_DECODE_PROFILE_VP9) || + IsEqualGUID(profile, D3D12_VIDEO_DECODE_PROFILE_VP9_10BIT_PROFILE2)) { + return FF_CODEC_TYPE_VP9; + } + + if (IsEqualGUID(profile, D3D12_VIDEO_DECODE_PROFILE_AV1_PROFILE0) || + IsEqualGUID(profile, D3D12_VIDEO_DECODE_PROFILE_AV1_PROFILE1) || + IsEqualGUID(profile, D3D12_VIDEO_DECODE_PROFILE_AV1_PROFILE2) || + IsEqualGUID(profile, D3D12_VIDEO_DECODE_PROFILE_AV1_12BIT_PROFILE2) || + IsEqualGUID(profile, D3D12_VIDEO_DECODE_PROFILE_AV1_12BIT_PROFILE2_420)) { + return FF_CODEC_TYPE_AV1; + } + // clang-format on + + return FF_CODEC_TYPE_UNKNOWN; +} + +static bool ffCodecProfileHasNativeOutput(ID3D11VideoDevice* videoDevice, const GUID& profile) { + for (uint32_t i = 0; i < ARRAY_SIZE(FF_NATIVE_CODEC_FORMATS); ++i) { + BOOL supported = FALSE; + if (SUCCEEDED(videoDevice->CheckVideoDecoderFormat(&profile, FF_NATIVE_CODEC_FORMATS[i], &supported)) && supported) { + return true; + } + } + + return false; +} + +static bool ffCodecProfileHasNativeOutput(ID3D12VideoDevice* videoDevice, const GUID& profile, UINT nodeIndex) { + for (uint32_t i = 0; i < ARRAY_SIZE(FF_NATIVE_CODEC_FORMATS); ++i) { + D3D12_FEATURE_DATA_VIDEO_DECODE_SUPPORT support = { + .NodeIndex = nodeIndex, + .Configuration = { + .DecodeProfile = profile, + .BitstreamEncryption = D3D12_BITSTREAM_ENCRYPTION_TYPE_NONE, + .InterlaceType = D3D12_VIDEO_FRAME_CODED_INTERLACE_TYPE_NONE, + }, + .Width = 1920, + .Height = 1080, + .DecodeFormat = FF_NATIVE_CODEC_FORMATS[i], + .FrameRate = { + .Numerator = 30, + .Denominator = 1, + }, + .BitRate = 10000000, + .SupportFlags = D3D12_VIDEO_DECODE_SUPPORT_FLAG_NONE, + .ConfigurationFlags = D3D12_VIDEO_DECODE_CONFIGURATION_FLAG_NONE, + .DecodeTier = D3D12_VIDEO_DECODE_TIER_NOT_SUPPORTED, + }; + + if (SUCCEEDED(videoDevice->CheckFeatureSupport(D3D12_FEATURE_VIDEO_DECODE_SUPPORT, &support, sizeof(support))) && + (support.SupportFlags & D3D12_VIDEO_DECODE_SUPPORT_FLAG_SUPPORTED)) { + return true; + } + } + + return false; +} + +static bool ffCodecEncoderSupportedD3d12(ID3D12VideoDevice* videoDevice, D3D12_VIDEO_ENCODER_CODEC codec, UINT nodeIndex) { + D3D12_FEATURE_DATA_VIDEO_ENCODER_CODEC encoderCodec = { + .NodeIndex = nodeIndex, + .Codec = codec, + .IsSupported = FALSE, + }; + + return SUCCEEDED(videoDevice->CheckFeatureSupport( + D3D12_FEATURE_VIDEO_ENCODER_CODEC, + &encoderCodec, + sizeof(encoderCodec))) && + encoderCodec.IsSupported; +} + +typedef struct FFCodecMftEncoderSubtype { + const GUID* subtype; + FFCodecType codecType; +} FFCodecMftEncoderSubtype; + +static const FFCodecMftEncoderSubtype FF_D3D11VA_MFT_ENCODER_SUBTYPES[] = { + { &MFVideoFormat_H264, FF_CODEC_TYPE_H264 }, + { &MFVideoFormat_HEVC, FF_CODEC_TYPE_HEVC }, + { &MFVideoFormat_AV1, FF_CODEC_TYPE_AV1 }, +}; + +static FFCodecType ffDetectD3d11vaDecoders(IDXGIAdapter1* adapter, __typeof__(&D3D11CreateDevice) ffD3D11CreateDevice) { + ID3D11Device* FF_AUTO_RELEASE_COM_OBJECT d3dDevice = nullptr; + D3D_FEATURE_LEVEL featureLevel; + if (FAILED(ffD3D11CreateDevice( + adapter, + D3D_DRIVER_TYPE_UNKNOWN, + nullptr, + D3D11_CREATE_DEVICE_VIDEO_SUPPORT, + nullptr, + 0, + D3D11_SDK_VERSION, + &d3dDevice, + &featureLevel, + nullptr)) || + !d3dDevice) { + return FF_CODEC_TYPE_NONE; + } + + ID3D11VideoDevice* FF_AUTO_RELEASE_COM_OBJECT videoDevice = nullptr; + if (FAILED(d3dDevice->QueryInterface(__uuidof(ID3D11VideoDevice), (void**) &videoDevice)) || !videoDevice) { + return FF_CODEC_TYPE_NONE; + } + + FFCodecType decoders = FF_CODEC_TYPE_NONE; + UINT profileCount = videoDevice->GetVideoDecoderProfileCount(); + for (UINT profileIndex = 0; profileIndex < profileCount; ++profileIndex) { + GUID profile; + if (FAILED(videoDevice->GetVideoDecoderProfile(profileIndex, &profile))) { + continue; + } + + FFCodecType type = ffCodecProfileToTypeDx11(profile); + + if ((decoders & type) || !ffCodecProfileHasNativeOutput(videoDevice, profile)) { + continue; + } + + decoders = (FFCodecType) (((uint32_t) decoders) | ((uint32_t) type)); + } + return decoders; +} + +static FFCodecType ffDetectD3d11MftEncoders(const LUID& adapterLuid, __typeof__(&MFCreateAttributes) ffMFCreateAttributes, __typeof__(&MFTEnum2) ffMFTEnum2) { + IMFAttributes* FF_AUTO_RELEASE_COM_OBJECT attributes = nullptr; + if (FAILED(ffMFCreateAttributes(&attributes, 1)) || !attributes) { + return FF_CODEC_TYPE_NONE; + } + + if (FAILED(attributes->SetBlob(MFT_ENUM_ADAPTER_LUID, (const UINT8*) &adapterLuid, sizeof(adapterLuid)))) { + return FF_CODEC_TYPE_NONE; + } + + FFCodecType encoders = FF_CODEC_TYPE_NONE; + + for (uint32_t subtypeIndex = 0; subtypeIndex < ARRAY_SIZE(FF_D3D11VA_MFT_ENCODER_SUBTYPES); ++subtypeIndex) { + const FFCodecMftEncoderSubtype& subtype = FF_D3D11VA_MFT_ENCODER_SUBTYPES[subtypeIndex]; + if (encoders & subtype.codecType) { + continue; + } + + MFT_REGISTER_TYPE_INFO outputType = { + .guidMajorType = MFMediaType_Video, + .guidSubtype = *subtype.subtype, + }; + + IMFActivate** activateList = nullptr; + UINT32 activateCount = 0; + + if (SUCCEEDED(ffMFTEnum2( + MFT_CATEGORY_VIDEO_ENCODER, + MFT_ENUM_FLAG_HARDWARE | MFT_ENUM_FLAG_SORTANDFILTER, + nullptr, + &outputType, + attributes, + &activateList, + &activateCount)) && + activateCount > 0) { + encoders = (FFCodecType) (((uint32_t) encoders) | ((uint32_t) subtype.codecType)); + } + + for (uint32_t i = 0; i < activateCount; ++i) { + activateList[i]->Release(); + } + CoTaskMemFree(activateList); + } + + return encoders; +} + +static FFCodecType ffCodecEncoderToType(D3D12_VIDEO_ENCODER_CODEC codec) { + switch (codec) { + case D3D12_VIDEO_ENCODER_CODEC_H264: + return FF_CODEC_TYPE_H264; + case D3D12_VIDEO_ENCODER_CODEC_HEVC: + return FF_CODEC_TYPE_HEVC; + case D3D12_VIDEO_ENCODER_CODEC_AV1: + return FF_CODEC_TYPE_AV1; + default: + return FF_CODEC_TYPE_UNKNOWN; + } +} + +template +static void ffEnumHardwareAdapters(IDXGIFactory1* factory, Func&& onAdapter) { + for (UINT adapterIndex = 0;; ++adapterIndex) { + IDXGIAdapter1* FF_AUTO_RELEASE_COM_OBJECT adapter = nullptr; + HRESULT adapterStatus = factory->EnumAdapters1(adapterIndex, &adapter); + if (adapterStatus == DXGI_ERROR_NOT_FOUND) { + break; + } + if (FAILED(adapterStatus) || !adapter) { + continue; + } + + DXGI_ADAPTER_DESC1 desc; + if (FAILED(adapter->GetDesc1(&desc))) { + continue; + } + if (desc.Flags & DXGI_ADAPTER_FLAG_SOFTWARE) { + continue; + } + + onAdapter(adapter, desc); + } +} + +const char* detectD3d11va(FFCodecOptions* options, FFlist* result /*list of FFCodecResult*/, IDXGIFactory1* factory) { + FF_LIBRARY_LOAD_MESSAGE(d3d11, "d3d11" FF_LIBRARY_EXTENSION, 1) + FF_LIBRARY_LOAD_SYMBOL_MESSAGE(d3d11, D3D11CreateDevice) + FF_LIBRARY_LOAD_MESSAGE(mfplat, "mfplat" FF_LIBRARY_EXTENSION, 1) + FF_LIBRARY_LOAD_SYMBOL_MESSAGE(mfplat, MFCreateAttributes) + FF_LIBRARY_LOAD_SYMBOL_MESSAGE(mfplat, MFTEnum2) + + ffEnumHardwareAdapters(factory, [&](IDXGIAdapter1* adapter, const DXGI_ADAPTER_DESC1& desc) { + FFCodecType decoders = (options->showType & FF_CODEC_SHOW_TYPE_DECODER) + ? ffDetectD3d11vaDecoders(adapter, ffD3D11CreateDevice) + : FF_CODEC_TYPE_NONE; + FFCodecType encoders = (options->showType & FF_CODEC_SHOW_TYPE_ENCODER) + ? ffDetectD3d11MftEncoders(desc.AdapterLuid, ffMFCreateAttributes, ffMFTEnum2) + : FF_CODEC_TYPE_NONE; + + if (decoders == FF_CODEC_TYPE_NONE && encoders == FF_CODEC_TYPE_NONE) { + return; + } + + FFCodecResult* gpuResult = FF_LIST_ADD(FFCodecResult, *result); + ffStrbufInitWS(&gpuResult->gpu, desc.Description); + gpuResult->decoders = decoders; + gpuResult->encoders = encoders; + gpuResult->platformApi = "D3D11VA+MFT"; + }); + + return nullptr; +} + +const char* detectD3d12va(FFCodecOptions* options, FFlist* result /*list of FFCodecResult*/, IDXGIFactory1* factory) { + FF_LIBRARY_LOAD_MESSAGE(d3d12, "d3d12" FF_LIBRARY_EXTENSION, 1) + FF_LIBRARY_LOAD_SYMBOL_MESSAGE(d3d12, D3D12CreateDevice) + + static const GUID FF_D3D12_DECODE_PROFILES[] = { + D3D12_VIDEO_DECODE_PROFILE_MPEG2, + D3D12_VIDEO_DECODE_PROFILE_MPEG1_AND_MPEG2, + D3D12_VIDEO_DECODE_PROFILE_H264, + D3D12_VIDEO_DECODE_PROFILE_H264_STEREO_PROGRESSIVE, + D3D12_VIDEO_DECODE_PROFILE_H264_STEREO, + D3D12_VIDEO_DECODE_PROFILE_H264_MULTIVIEW, + D3D12_VIDEO_DECODE_PROFILE_VC1, + D3D12_VIDEO_DECODE_PROFILE_VC1_D2010, + D3D12_VIDEO_DECODE_PROFILE_MPEG4PT2_SIMPLE, + D3D12_VIDEO_DECODE_PROFILE_MPEG4PT2_ADVSIMPLE_NOGMC, + D3D12_VIDEO_DECODE_PROFILE_HEVC_MAIN, + D3D12_VIDEO_DECODE_PROFILE_HEVC_MAIN10, + D3D12_VIDEO_DECODE_PROFILE_VP9, + D3D12_VIDEO_DECODE_PROFILE_VP9_10BIT_PROFILE2, + D3D12_VIDEO_DECODE_PROFILE_VP8, + D3D12_VIDEO_DECODE_PROFILE_AV1_PROFILE0, + D3D12_VIDEO_DECODE_PROFILE_AV1_PROFILE1, + D3D12_VIDEO_DECODE_PROFILE_AV1_PROFILE2, + D3D12_VIDEO_DECODE_PROFILE_AV1_12BIT_PROFILE2, + D3D12_VIDEO_DECODE_PROFILE_AV1_12BIT_PROFILE2_420, + }; + + static const D3D12_VIDEO_ENCODER_CODEC FF_D3D12_ENCODER_CODECS[] = { + D3D12_VIDEO_ENCODER_CODEC_H264, + D3D12_VIDEO_ENCODER_CODEC_HEVC, + D3D12_VIDEO_ENCODER_CODEC_AV1, + }; + + const uint32_t resultLengthBefore = result->length; + + ffEnumHardwareAdapters(factory, [&](IDXGIAdapter1* adapter, const DXGI_ADAPTER_DESC1& desc) { + ID3D12Device* FF_AUTO_RELEASE_COM_OBJECT d3dDevice = nullptr; + if (FAILED(ffD3D12CreateDevice( + adapter, + D3D_FEATURE_LEVEL_11_0, + __uuidof(ID3D12Device), + (void**) &d3dDevice)) || + !d3dDevice) { + return; + } + + ID3D12VideoDevice* FF_AUTO_RELEASE_COM_OBJECT videoDevice = nullptr; + if (FAILED(d3dDevice->QueryInterface(__uuidof(ID3D12VideoDevice), (void**) &videoDevice)) || !videoDevice) { + return; + } + + FFCodecType decoders = FF_CODEC_TYPE_NONE; + if (options->showType & FF_CODEC_SHOW_TYPE_DECODER) { + for (uint32_t profileIndex = 0; profileIndex < ARRAY_SIZE(FF_D3D12_DECODE_PROFILES); ++profileIndex) { + const GUID& profile = FF_D3D12_DECODE_PROFILES[profileIndex]; + FFCodecType codecType = ffCodecProfileToTypeDx12(profile); + + if ((decoders & codecType) || !ffCodecProfileHasNativeOutput(videoDevice, profile, 0)) { + continue; + } + + decoders = (FFCodecType) (((uint32_t) decoders) | ((uint32_t) codecType)); + } + } + + FFCodecType encoders = FF_CODEC_TYPE_NONE; + if (options->showType & FF_CODEC_SHOW_TYPE_ENCODER) { + for (uint32_t codecIndex = 0; codecIndex < ARRAY_SIZE(FF_D3D12_ENCODER_CODECS); ++codecIndex) { + D3D12_VIDEO_ENCODER_CODEC codec = FF_D3D12_ENCODER_CODECS[codecIndex]; + FFCodecType codecType = ffCodecEncoderToType(codec); + + if ((encoders & codecType) || !ffCodecEncoderSupportedD3d12(videoDevice, codec, 0)) { + continue; + } + + encoders = (FFCodecType) (((uint32_t) encoders) | ((uint32_t) codecType)); + } + } + + if (decoders == FF_CODEC_TYPE_NONE && encoders == FF_CODEC_TYPE_NONE) { + return; + } + + FFCodecResult* gpuResult = FF_LIST_ADD(FFCodecResult, *result); + ffStrbufInitWS(&gpuResult->gpu, desc.Description); + gpuResult->decoders = decoders; + gpuResult->encoders = encoders; + gpuResult->platformApi = "D3D12VA"; + }); + + if (result->length == resultLengthBefore) { + return "No D3D12 video acceleration support"; + } + + return nullptr; +} + +const char* ffDetectCodecNative(FFCodecOptions* options, FFlist* result /*list of FFCodecResult*/) { + FF_LIBRARY_LOAD_MESSAGE(dxgi, "dxgi" FF_LIBRARY_EXTENSION, 1) + FF_LIBRARY_LOAD_SYMBOL_MESSAGE(dxgi, CreateDXGIFactory1) + + const char* error = ffInitCom(); + if (error) { + return error; + } + + IDXGIFactory1* FF_AUTO_RELEASE_COM_OBJECT factory = nullptr; + if (FAILED(ffCreateDXGIFactory1(__uuidof(IDXGIFactory1), (void**) &factory)) || !factory) { + return "CreateDXGIFactory1() failed"; + } + + if (ffIsWindows11OrGreater()) { + // D3D12 video encoding is supported only on Windows 11 + if (detectD3d12va(options, result, factory) == nullptr) { + return nullptr; + } + } + return detectD3d11va(options, result, factory); +} diff --git a/src/detection/cpu/cpu_apple.c b/src/detection/cpu/cpu_apple.c index 30b71568a3..f078b0c1f8 100644 --- a/src/detection/cpu/cpu_apple.c +++ b/src/detection/cpu/cpu_apple.c @@ -1,7 +1,7 @@ #include "cpu.h" #include "common/sysctl.h" #include "common/apple/smc_temps.h" -#include "common/stringUtils.h" +#include "common/strutil.h" static double detectCpuTemp(const FFCPUOptions* options, const FFstrbuf* cpuName) { double result = 0; diff --git a/src/detection/cpu/cpu_bsd.c b/src/detection/cpu/cpu_bsd.c index 838e95dd73..4cca30e736 100644 --- a/src/detection/cpu/cpu_bsd.c +++ b/src/detection/cpu/cpu_bsd.c @@ -1,6 +1,6 @@ #include "cpu.h" #include "common/sysctl.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include #if __has_include() diff --git a/src/detection/cpu/cpu_linux.c b/src/detection/cpu/cpu_linux.c index da73a207c2..b228d5230b 100644 --- a/src/detection/cpu/cpu_linux.c +++ b/src/detection/cpu/cpu_linux.c @@ -3,7 +3,7 @@ #include "common/processing.h" #include "common/properties.h" #include "common/mallocHelper.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include "common/path.h" #include @@ -357,6 +357,9 @@ static void detectExynos(FFCPUResult* cpu) { const char* name = NULL; switch (code) { + case 9965: + name = "2600"; + break; case 9955: name = "2500"; break; diff --git a/src/detection/cpu/cpu_obsd.c b/src/detection/cpu/cpu_obsd.c index 47e6bfb9ea..e5b8d2fdf1 100644 --- a/src/detection/cpu/cpu_obsd.c +++ b/src/detection/cpu/cpu_obsd.c @@ -1,6 +1,6 @@ #include "cpu.h" #include "common/sysctl.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include #include diff --git a/src/detection/cpu/cpu_sunos.c b/src/detection/cpu/cpu_sunos.c index 7d93dd49c4..9b1cab503d 100644 --- a/src/detection/cpu/cpu_sunos.c +++ b/src/detection/cpu/cpu_sunos.c @@ -1,6 +1,6 @@ #include "cpu.h" #include "common/processing.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include static const char* detectCPUTempByKstat(const FFCPUOptions* options, kstat_ctl_t* kc, FFCPUResult* cpu) { diff --git a/src/detection/cpucache/cpucache_apple.c b/src/detection/cpucache/cpucache_apple.c index 61afcd7501..3d1562cef2 100644 --- a/src/detection/cpucache/cpucache_apple.c +++ b/src/detection/cpucache/cpucache_apple.c @@ -1,6 +1,6 @@ #include "cpucache.h" #include "common/sysctl.h" -#include "common/stringUtils.h" +#include "common/strutil.h" const char* ffDetectCPUCache(FFCPUCacheResult* result) { // https://developer.apple.com/documentation/kernel/1387446-sysctlbyname/determining_system_capabilities#3901385 diff --git a/src/detection/cpucache/cpucache_linux.c b/src/detection/cpucache/cpucache_linux.c index 8f435d8eab..0657c84ae6 100644 --- a/src/detection/cpucache/cpucache_linux.c +++ b/src/detection/cpucache/cpucache_linux.c @@ -1,6 +1,6 @@ #include "cpucache.h" #include "common/io.h" -#include "common/stringUtils.h" +#include "common/strutil.h" static const char* parseCpuCacheIndex(FFstrbuf* path, FFCPUCacheResult* result, FFstrbuf* buffer, FFstrbuf* added) { uint32_t baseLen = path->length; diff --git a/src/detection/cpucache/cpucache_shared.c b/src/detection/cpucache/cpucache_shared.c index ece9d68662..c13e351685 100644 --- a/src/detection/cpucache/cpucache_shared.c +++ b/src/detection/cpucache/cpucache_shared.c @@ -1,6 +1,6 @@ #include "cpucache.h" #include "common/smbios.h" -#include "common/stringUtils.h" +#include "common/strutil.h" typedef struct FFSmbiosCacheInfo { FFSmbiosHeader Header; diff --git a/src/detection/cursor/cursor_linux.c b/src/detection/cursor/cursor_linux.c index 11e341ea6b..89dabbc371 100644 --- a/src/detection/cursor/cursor_linux.c +++ b/src/detection/cursor/cursor_linux.c @@ -5,7 +5,7 @@ #include "common/properties.h" #include "common/parsing.h" #include "common/settings.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include diff --git a/src/detection/disk/disk_bsd.c b/src/detection/disk/disk_bsd.c index 6e0475f846..9156d79efd 100644 --- a/src/detection/disk/disk_bsd.c +++ b/src/detection/disk/disk_bsd.c @@ -1,6 +1,6 @@ #include "disk.h" #include "common/mallocHelper.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include #include diff --git a/src/detection/disk/disk_haiku.cpp b/src/detection/disk/disk_haiku.cpp index 094d8c0451..0987897101 100644 --- a/src/detection/disk/disk_haiku.cpp +++ b/src/detection/disk/disk_haiku.cpp @@ -1,6 +1,6 @@ extern "C" { #include "disk.h" -#include "common/stringUtils.h" +#include "common/strutil.h" } #include #include diff --git a/src/detection/disk/disk_linux.c b/src/detection/disk/disk_linux.c index a14a7561c4..720531731f 100644 --- a/src/detection/disk/disk_linux.c +++ b/src/detection/disk/disk_linux.c @@ -1,7 +1,7 @@ #include "disk.h" #include "common/io.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include #include diff --git a/src/detection/disk/disk_sunos.c b/src/detection/disk/disk_sunos.c index e2382f4fbf..3d811e03e4 100644 --- a/src/detection/disk/disk_sunos.c +++ b/src/detection/disk/disk_sunos.c @@ -1,6 +1,6 @@ #include "disk.h" #include "common/io.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include #include diff --git a/src/detection/diskio/diskio_bsd.c b/src/detection/diskio/diskio_bsd.c index b945b61148..f5eb4b8b84 100644 --- a/src/detection/diskio/diskio_bsd.c +++ b/src/detection/diskio/diskio_bsd.c @@ -2,7 +2,7 @@ #if __has_include() - #include "common/stringUtils.h" + #include "common/strutil.h" #include #include diff --git a/src/detection/diskio/diskio_linux.c b/src/detection/diskio/diskio_linux.c index a0ee44e99e..c7ddc55ea3 100644 --- a/src/detection/diskio/diskio_linux.c +++ b/src/detection/diskio/diskio_linux.c @@ -1,7 +1,7 @@ #include "diskio.h" #include "common/io.h" #include "common/properties.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include #include diff --git a/src/detection/diskio/diskio_nbsd.c b/src/detection/diskio/diskio_nbsd.c index 71f0bfa088..9ca9578a8e 100644 --- a/src/detection/diskio/diskio_nbsd.c +++ b/src/detection/diskio/diskio_nbsd.c @@ -1,6 +1,6 @@ #include "diskio.h" #include "common/io.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include "common/mallocHelper.h" #include diff --git a/src/detection/diskio/diskio_obsd.c b/src/detection/diskio/diskio_obsd.c index cab0abe05a..8dbc67ebde 100644 --- a/src/detection/diskio/diskio_obsd.c +++ b/src/detection/diskio/diskio_obsd.c @@ -1,5 +1,5 @@ #include "diskio.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include "common/mallocHelper.h" #include diff --git a/src/detection/diskio/diskio_sunos.c b/src/detection/diskio/diskio_sunos.c index 0a1db093c7..7cda42081f 100644 --- a/src/detection/diskio/diskio_sunos.c +++ b/src/detection/diskio/diskio_sunos.c @@ -1,5 +1,5 @@ #include "diskio.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include static inline void kstatFreeWrap(kstat_ctl_t** pkc) { diff --git a/src/detection/displayserver/displayserver.h b/src/detection/displayserver/displayserver.h index b33f2c84bd..fd88f370d9 100644 --- a/src/detection/displayserver/displayserver.h +++ b/src/detection/displayserver/displayserver.h @@ -41,6 +41,7 @@ #define FF_WM_PRETTY_DTWM "dtwm" #define FF_WM_PRETTY_FVWM "fvwm" #define FF_WM_PRETTY_CTWM "ctwm" +#define FF_WM_PRETTY_COSMIC_COMP "cosmic-comp" #define FF_WM_PRETTY_RATPOISON "ratpoison" #define FF_WM_PRETTY_ENLIGHTENMENT "Enlightenment" diff --git a/src/detection/displayserver/displayserver_apple.c b/src/detection/displayserver/displayserver_apple.c index a4cb809aa3..39ba604b38 100644 --- a/src/detection/displayserver/displayserver_apple.c +++ b/src/detection/displayserver/displayserver_apple.c @@ -1,6 +1,6 @@ #include "displayserver.h" #include "common/apple/cf_helpers.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include "common/edidHelper.h" #include "detection/os/os.h" diff --git a/src/detection/displayserver/linux/common.c b/src/detection/displayserver/linux/common.c index cb33b80cde..305766dd75 100644 --- a/src/detection/displayserver/linux/common.c +++ b/src/detection/displayserver/linux/common.c @@ -1,5 +1,5 @@ #include "displayserver_linux.h" -#include "common/stringUtils.h" +#include "common/strutil.h" FFDisplayType ffdsGetDisplayType(const char* name) { if (ffStrStartsWith(name, "eDP-") || ffStrStartsWith(name, "LVDS-")) { diff --git a/src/detection/displayserver/linux/displayserver_linux.c b/src/detection/displayserver/linux/displayserver_linux.c index 174aeb37cb..70d2d40014 100644 --- a/src/detection/displayserver/linux/displayserver_linux.c +++ b/src/detection/displayserver/linux/displayserver_linux.c @@ -1,6 +1,6 @@ #include "displayserver_linux.h" #include "common/io.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #ifdef __FreeBSD__ #include "common/settings.h" diff --git a/src/detection/displayserver/linux/drm.c b/src/detection/displayserver/linux/drm.c index 8d970bee23..43c6afcf4c 100644 --- a/src/detection/displayserver/linux/drm.c +++ b/src/detection/displayserver/linux/drm.c @@ -1,7 +1,7 @@ #include "displayserver_linux.h" #include "common/io.h" #include "common/edidHelper.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #ifdef __linux__ #include diff --git a/src/detection/displayserver/linux/wayland/global-output.c b/src/detection/displayserver/linux/wayland/global-output.c index 7627682d5a..51fb425610 100644 --- a/src/detection/displayserver/linux/wayland/global-output.c +++ b/src/detection/displayserver/linux/wayland/global-output.c @@ -1,7 +1,7 @@ #ifdef FF_HAVE_WAYLAND #include "wayland.h" - #include "common/stringUtils.h" + #include "common/strutil.h" #include "xdg-output-unstable-v1-client-protocol.h" static void waylandOutputModeListener(void* data, FF_A_UNUSED struct wl_output* output, uint32_t flags, int32_t width, int32_t height, int32_t refreshRate) { diff --git a/src/detection/displayserver/linux/wayland/wayland.c b/src/detection/displayserver/linux/wayland/wayland.c index 91b7d4069b..064c239070 100644 --- a/src/detection/displayserver/linux/wayland/wayland.c +++ b/src/detection/displayserver/linux/wayland/wayland.c @@ -1,7 +1,7 @@ #include "../displayserver_linux.h" #include "common/io.h" #include "common/edidHelper.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include #include diff --git a/src/detection/displayserver/linux/wayland/wayland.h b/src/detection/displayserver/linux/wayland/wayland.h index 141b3964d0..b103ab934a 100644 --- a/src/detection/displayserver/linux/wayland/wayland.h +++ b/src/detection/displayserver/linux/wayland/wayland.h @@ -3,7 +3,7 @@ #ifdef FF_HAVE_WAYLAND #include "common/library.h" - #include "common/stringUtils.h" + #include "common/strutil.h" #include diff --git a/src/detection/displayserver/linux/wmde.c b/src/detection/displayserver/linux/wmde.c index 135eb1c9d9..f0321c8ada 100644 --- a/src/detection/displayserver/linux/wmde.c +++ b/src/detection/displayserver/linux/wmde.c @@ -1,7 +1,7 @@ #include "displayserver_linux.h" #include "common/io.h" #include "common/properties.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include "common/mallocHelper.h" #include diff --git a/src/detection/displayserver/linux/xcb.c b/src/detection/displayserver/linux/xcb.c index e6b5cd07c6..8620d71508 100644 --- a/src/detection/displayserver/linux/xcb.c +++ b/src/detection/displayserver/linux/xcb.c @@ -6,7 +6,7 @@ #include "common/properties.h" #include "common/edidHelper.h" #include "common/mallocHelper.h" - #include "common/stringUtils.h" + #include "common/strutil.h" #include #include diff --git a/src/detection/displayserver/linux/xlib.c b/src/detection/displayserver/linux/xlib.c index c97308fe85..2beffccabf 100644 --- a/src/detection/displayserver/linux/xlib.c +++ b/src/detection/displayserver/linux/xlib.c @@ -5,7 +5,7 @@ #include "common/library.h" #include "common/properties.h" #include "common/edidHelper.h" - #include "common/stringUtils.h" + #include "common/strutil.h" #include #include diff --git a/src/detection/dns/dns_apple.c b/src/detection/dns/dns_apple.c index 2facd8fc91..e490ffe743 100644 --- a/src/detection/dns/dns_apple.c +++ b/src/detection/dns/dns_apple.c @@ -2,7 +2,7 @@ #include "common/io.h" #include "common/mallocHelper.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include "common/apple/cf_helpers.h" #include "common/debug.h" diff --git a/src/detection/dns/dns_linux.c b/src/detection/dns/dns_linux.c index 9f1a4429b0..41e008cc21 100644 --- a/src/detection/dns/dns_linux.c +++ b/src/detection/dns/dns_linux.c @@ -2,7 +2,7 @@ #include "common/io.h" #include "common/mallocHelper.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include "common/debug.h" #ifdef __HAIKU__ diff --git a/src/detection/editor/editor.c b/src/detection/editor/editor.c index bb586997b5..b84f279bb0 100644 --- a/src/detection/editor/editor.c +++ b/src/detection/editor/editor.c @@ -1,7 +1,7 @@ #include "editor.h" #include "common/processing.h" #include "common/library.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include "common/path.h" #include "common/binary.h" diff --git a/src/detection/gamepad/gamepad_linux.c b/src/detection/gamepad/gamepad_linux.c index c55ba73432..6bb4ee214c 100644 --- a/src/detection/gamepad/gamepad_linux.c +++ b/src/detection/gamepad/gamepad_linux.c @@ -1,6 +1,6 @@ #include "gamepad.h" #include "common/io.h" -#include "common/stringUtils.h" +#include "common/strutil.h" static void detectGamepad(FFlist* devices, FFstrbuf* name, FFstrbuf* path) { uint32_t baseLen = path->length; diff --git a/src/detection/gpu/gpu_android.c b/src/detection/gpu/gpu_android.c index baf8a8d9eb..08fd48af22 100644 --- a/src/detection/gpu/gpu_android.c +++ b/src/detection/gpu/gpu_android.c @@ -1,6 +1,6 @@ #include "gpu.h" #include "common/io.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include diff --git a/src/detection/gpu/gpu_bsd.c b/src/detection/gpu/gpu_bsd.c index 0d8ca02f6a..ae29f46c49 100644 --- a/src/detection/gpu/gpu_bsd.c +++ b/src/detection/gpu/gpu_bsd.c @@ -32,7 +32,7 @@ static void fillGPUTypeGeneric(FFGPUResult* gpu) { #if FF_HAVE_DRM #include "common/library.h" - #include "common/stringUtils.h" + #include "common/strutil.h" #include diff --git a/src/detection/gpu/gpu_drm.c b/src/detection/gpu/gpu_drm.c index 2e077ad82e..3a7d381a3f 100644 --- a/src/detection/gpu/gpu_drm.c +++ b/src/detection/gpu/gpu_drm.c @@ -8,7 +8,7 @@ #include "common/io.h" #include "common/library.h" #include "common/mallocHelper.h" - #include "common/stringUtils.h" + #include "common/strutil.h" #include "intel_drm.h" #include "asahi_drm.h" diff --git a/src/detection/gpu/gpu_linux.c b/src/detection/gpu/gpu_linux.c index de5093f69b..3aaa09cb03 100644 --- a/src/detection/gpu/gpu_linux.c +++ b/src/detection/gpu/gpu_linux.c @@ -5,7 +5,7 @@ #include "common/io.h" #include "common/library.h" #include "common/FFstrbuf.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include "common/mallocHelper.h" #include "modules/gpu/option.h" diff --git a/src/detection/gpu/gpu_sunos.c b/src/detection/gpu/gpu_sunos.c index f739b62076..13d4998154 100644 --- a/src/detection/gpu/gpu_sunos.c +++ b/src/detection/gpu/gpu_sunos.c @@ -1,5 +1,5 @@ #include "gpu.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include diff --git a/src/detection/gpu/gpu_windows.c b/src/detection/gpu/gpu_windows.c index 37968b9fdd..796c1c566d 100644 --- a/src/detection/gpu/gpu_windows.c +++ b/src/detection/gpu/gpu_windows.c @@ -189,7 +189,7 @@ static void closeDxgfd(void) { } } -static inline const char* ffDebugNtStatus(NTSTATUS status) { +FF_A_UNUSED static inline const char* ffDebugNtStatus(NTSTATUS status) { return status < 0 ? strerror(-status) : "Success"; } #endif diff --git a/src/detection/gtk_qt/qt.c b/src/detection/gtk_qt/qt.c index 2e0ed00443..26c8b58e23 100644 --- a/src/detection/gtk_qt/qt.c +++ b/src/detection/gtk_qt/qt.c @@ -1,7 +1,7 @@ #include "fastfetch.h" #include "common/properties.h" #include "common/thread.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include "detection/gtk_qt/gtk_qt.h" #include "detection/displayserver/displayserver.h" diff --git a/src/detection/host/host_mac.c b/src/detection/host/host_mac.c index 7efa18a9b1..d680332630 100644 --- a/src/detection/host/host_mac.c +++ b/src/detection/host/host_mac.c @@ -1,5 +1,5 @@ #include "host.h" -#include "common/stringUtils.h" +#include "common/strutil.h" const char* ffHostGetMacProductNameWithHwModel(const FFstrbuf* hwModel) { // Macbook Pro: https://support.apple.com/en-us/HT201300 diff --git a/src/detection/initsystem/initsystem_haiku.c b/src/detection/initsystem/initsystem_haiku.c index bae9f851b2..04857bca30 100644 --- a/src/detection/initsystem/initsystem_haiku.c +++ b/src/detection/initsystem/initsystem_haiku.c @@ -1,5 +1,5 @@ #include "initsystem.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include "common/haiku/version.h" #include "common/io.h" diff --git a/src/detection/initsystem/initsystem_linux.c b/src/detection/initsystem/initsystem_linux.c index cbce56fed4..445657bad2 100644 --- a/src/detection/initsystem/initsystem_linux.c +++ b/src/detection/initsystem/initsystem_linux.c @@ -1,7 +1,7 @@ #include "initsystem.h" #include "common/processing.h" #include "common/binary.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include #include diff --git a/src/detection/keyboard/keyboard_linux.c b/src/detection/keyboard/keyboard_linux.c index 343cc57ebe..1a29abb01e 100644 --- a/src/detection/keyboard/keyboard_linux.c +++ b/src/detection/keyboard/keyboard_linux.c @@ -1,6 +1,6 @@ #include "keyboard.h" #include "common/io.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include diff --git a/src/detection/localip/localip_linux.c b/src/detection/localip/localip_linux.c index 53fe9fc564..d07ec76961 100644 --- a/src/detection/localip/localip_linux.c +++ b/src/detection/localip/localip_linux.c @@ -1,7 +1,7 @@ #include "localip.h" #include "common/io.h" #include "common/netif.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include "common/debug.h" #include diff --git a/src/detection/media/media_apple.m b/src/detection/media/media_apple.m index e99196c865..d9501d1fb0 100644 --- a/src/detection/media/media_apple.m +++ b/src/detection/media/media_apple.m @@ -110,7 +110,9 @@ static uint32_t getTrueElapsedTime(CFDictionaryRef info) { return error; } -__attribute__((visibility("default"), used)) int ffPrintMediaByMediaRemote(bool saveCover) { +#if !FF_MODULE_DISABLE_MEDIA +__attribute__((visibility("default"), used)) +int ffPrintMediaByMediaRemote(bool saveCover) { FFMediaResult media = { .status = ffStrbufCreate(), .song = ffStrbufCreate(), @@ -151,6 +153,7 @@ static uint32_t getTrueElapsedTime(CFDictionaryRef info) { ffStrbufDestroy(&media.cover); return 0; } +#endif static const char* getMediaByAuthorizedProcess(FFMediaResult* result, bool saveCover) { // #1737 diff --git a/src/detection/media/media_linux.c b/src/detection/media/media_linux.c index d12f1ac033..724e834845 100644 --- a/src/detection/media/media_linux.c +++ b/src/detection/media/media_linux.c @@ -1,6 +1,6 @@ #include "fastfetch.h" #include "common/io.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include "common/memrchr.h" #include "detection/media/media.h" diff --git a/src/detection/media/media_windows.cpp b/src/detection/media/media_windows.cpp index aaf9da9196..f0ebd35f81 100644 --- a/src/detection/media/media_windows.cpp +++ b/src/detection/media/media_windows.cpp @@ -16,8 +16,6 @@ extern "C" { #include #include - #define FF_BIND_FRONT(method, pobject) std::bind_front(&std::remove_cvref_t::method, (pobject)) - using winrt::impl::abi_t; using winrt::Windows::Foundation::IAsyncOperation; using winrt::Windows::Foundation::IAsyncOperationWithProgress; @@ -82,10 +80,10 @@ static HRESULT ffWaitForAsyncOperation(TOperationAbi* operation, TResultAbi** re return operation->GetResults((void**) result); } -template -static HRESULT ffRunAndWait(TOperation&& operation, abi_t** result, TArgs&&... args) { +template +static HRESULT ffRunAndWait(TOperation&& operation, abi_t** result) { abi_t>* FF_AUTO_RELEASE_COM_OBJECT opResult = NULL; - HRESULT hr = operation(std::forward(args)..., reinterpret_cast(&opResult)); + HRESULT hr = operation(reinterpret_cast(&opResult)); if (FAILED(hr) || !opResult) { return hr; } @@ -93,12 +91,12 @@ static HRESULT ffRunAndWait(TOperation&& operation, abi_t** r return ffWaitForAsyncOperation(opResult, result); } -template -static HRESULT ffRunAndWait2(TOperation&& operation, abi_t** result, TArgs&&... args) { +template +static HRESULT ffRunAndWait2(TOperation&& operation, abi_t** result) { *result = NULL; abi_t>* FF_AUTO_RELEASE_COM_OBJECT opResult = NULL; - HRESULT hr = operation(std::forward(args)..., reinterpret_cast(&opResult)); + HRESULT hr = operation(reinterpret_cast(&opResult)); if (FAILED(hr) || !opResult) { return hr; } @@ -110,7 +108,10 @@ static HRESULT ffSaveThumbnailToTempPath( abi_t* thumbnail, FFstrbuf* destination) { abi_t* FF_AUTO_RELEASE_COM_OBJECT contentStream = NULL; - HRESULT hr = ffRunAndWait(FF_BIND_FRONT(OpenReadAsync, thumbnail), &contentStream); + HRESULT hr = ffRunAndWait([=](void** result) { + return thumbnail->OpenReadAsync(result); + }, + &contentStream); if (FAILED(hr) || !contentStream) { return FAILED(hr) ? hr : E_FAIL; } @@ -150,7 +151,10 @@ static HRESULT ffSaveThumbnailToTempPath( } abi_t* FF_AUTO_RELEASE_COM_OBJECT readBuffer = NULL; - hr = ffRunAndWait2(FF_BIND_FRONT(ReadAsync, inputStream), &readBuffer, buffer, (uint32_t) size, static_cast(winrt::Windows::Storage::Streams::InputStreamOptions::None)); + hr = ffRunAndWait2([=](void** result) { + return inputStream->ReadAsync(buffer, (uint32_t) size, (uint32_t) winrt::Windows::Storage::Streams::InputStreamOptions::None, result); + }, + &readBuffer); if (FAILED(hr) || !readBuffer) { return FAILED(hr) ? hr : E_FAIL; } @@ -221,7 +225,10 @@ static const char* getMedia(FFMediaResult* result, bool saveCover) { } abi_t* FF_AUTO_RELEASE_COM_OBJECT manager = NULL; - hr = ffRunAndWait(FF_BIND_FRONT(RequestAsync, managerStatics), &manager); + hr = ffRunAndWait([=](void** result) { + return managerStatics->RequestAsync(result); + }, + &manager); if (FAILED(hr) || !manager) { error = "winrt: RequestAsync().GetResults() failed"; break; @@ -288,7 +295,10 @@ static const char* getMedia(FFMediaResult* result, bool saveCover) { } abi_t* FF_AUTO_RELEASE_COM_OBJECT mediaProps = NULL; - hr = ffRunAndWait(FF_BIND_FRONT(TryGetMediaPropertiesAsync, session), &mediaProps); + hr = ffRunAndWait([=](void** result) { + return session->TryGetMediaPropertiesAsync(result); + }, + &mediaProps); if (FAILED(hr) || !mediaProps) { error = "winrt: TryGetMediaPropertiesAsync().GetResults() failed"; break; diff --git a/src/detection/mouse/mouse_linux.c b/src/detection/mouse/mouse_linux.c index a608f88aab..939c332a12 100644 --- a/src/detection/mouse/mouse_linux.c +++ b/src/detection/mouse/mouse_linux.c @@ -1,6 +1,6 @@ #include "mouse.h" #include "common/io.h" -#include "common/stringUtils.h" +#include "common/strutil.h" const char* ffDetectMouse(FFlist* devices /* List of FFMouseDevice */) { FF_AUTO_CLOSE_DIR DIR* dirp = opendir("/sys/class/input/"); diff --git a/src/detection/netio/netio_linux.c b/src/detection/netio/netio_linux.c index aa48c0114a..5870d3f439 100644 --- a/src/detection/netio/netio_linux.c +++ b/src/detection/netio/netio_linux.c @@ -2,7 +2,7 @@ #include "common/io.h" #include "common/netif.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include #include diff --git a/src/detection/netio/netio_sunos.c b/src/detection/netio/netio_sunos.c index 553634a33d..3789e4528e 100644 --- a/src/detection/netio/netio_sunos.c +++ b/src/detection/netio/netio_sunos.c @@ -1,6 +1,6 @@ #include "netio.h" #include "common/netif.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include diff --git a/src/detection/opencl/opencl.c b/src/detection/opencl/opencl.c index 880eb7e01a..14216ac090 100644 --- a/src/detection/opencl/opencl.c +++ b/src/detection/opencl/opencl.c @@ -9,7 +9,7 @@ #include "common/library.h" #include "common/parsing.h" - #include "common/stringUtils.h" + #include "common/strutil.h" #include #define CL_TARGET_OPENCL_VERSION 110 diff --git a/src/detection/os/os_apple.m b/src/detection/os/os_apple.m index e3201908ce..2890fc31ab 100644 --- a/src/detection/os/os_apple.m +++ b/src/detection/os/os_apple.m @@ -1,7 +1,7 @@ #include "os.h" #include "common/io.h" #include "common/sysctl.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include "common/mallocHelper.h" #include diff --git a/src/detection/os/os_haiku.c b/src/detection/os/os_haiku.c index 40dad2220c..e8e9f4a8d6 100644 --- a/src/detection/os/os_haiku.c +++ b/src/detection/os/os_haiku.c @@ -1,6 +1,7 @@ #include "os.h" #include #include +#include void ffDetectOSImpl(FFOSResult* os) { ffStrbufSetStatic(&os->name, "Haiku"); @@ -32,7 +33,7 @@ void ffDetectOSImpl(FFOSResult* os) { int32 relVer = ver / 0x10000; ver %= 0x10000; if (ver == 0) { - ffStrbufSetF(&os->version, "R%d", relVer); + ffStrbufSetF(&os->version, "R%" PRIi32, relVer); } else { relVer++; @@ -40,16 +41,16 @@ void ffDetectOSImpl(FFOSResult* os) { if (ver < B_HAIKU_VERSION_1_PRE_BETA_1) { int32 alphaVer = ver / 0x100; if (isPre) { - ffStrbufSetF(&os->version, "R%dA%d-", relVer, alphaVer + 1); + ffStrbufSetF(&os->version, "R%" PRId32 "A%" PRIi32 "-", relVer, alphaVer + 1); } else { - ffStrbufSetF(&os->version, "R%dA%d", relVer, alphaVer); + ffStrbufSetF(&os->version, "R%" PRIi32 "A%" PRIi32, 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); + ffStrbufSetF(&os->version, "R%" PRIi32 "B%" PRIi32 "-", relVer, betaVer + 1); } else { - ffStrbufSetF(&os->version, "R%dB%d", relVer, betaVer); + ffStrbufSetF(&os->version, "R%" PRIi32 "B%" PRIi32, relVer, betaVer); } } } @@ -59,7 +60,7 @@ void ffDetectOSImpl(FFOSResult* os) { if (!os->version.length) { system_info sys; if (get_system_info(&sys) == B_OK) { - ffStrbufAppendF(&os->version, "R%ldx", sys.kernel_version); + ffStrbufAppendF(&os->version, "R%" PRIx64, sys.kernel_version); } } } diff --git a/src/detection/os/os_linux.c b/src/detection/os/os_linux.c index f6223e5ca9..fc653a3c64 100644 --- a/src/detection/os/os_linux.c +++ b/src/detection/os/os_linux.c @@ -3,7 +3,7 @@ #include "common/parsing.h" #include "common/io.h" #include "common/processing.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include #include diff --git a/src/detection/os/os_windows.c b/src/detection/os/os_windows.c index 12e51bbeab..2f280c8425 100644 --- a/src/detection/os/os_windows.c +++ b/src/detection/os/os_windows.c @@ -1,5 +1,5 @@ #include "os.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include "common/windows/registry.h" #include "common/windows/unicode.h" diff --git a/src/detection/packages/packages_apple.c b/src/detection/packages/packages_apple.c index 83ccaf0479..fd268868c0 100644 --- a/src/detection/packages/packages_apple.c +++ b/src/detection/packages/packages_apple.c @@ -2,7 +2,7 @@ #include "common/io.h" #include "common/parsing.h" #include "common/processing.h" -#include "common/stringUtils.h" +#include "common/strutil.h" static void countBrewPackages(FFstrbuf* baseDir, FFPackagesResult* result) { uint32_t baseDirLength = baseDir->length; diff --git a/src/detection/packages/packages_linux.c b/src/detection/packages/packages_linux.c index 98a01b23a0..0f42f8a6b6 100644 --- a/src/detection/packages/packages_linux.c +++ b/src/detection/packages/packages_linux.c @@ -3,7 +3,7 @@ #include "common/parsing.h" #include "common/properties.h" #include "common/settings.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include "detection/os/os.h" static uint32_t getNumElements(FFstrbuf* baseDir, const char* dirname, bool isdir) { diff --git a/src/detection/packages/packages_nix.c b/src/detection/packages/packages_nix.c index 95a27e5a2d..d1cc2647e3 100644 --- a/src/detection/packages/packages_nix.c +++ b/src/detection/packages/packages_nix.c @@ -1,7 +1,7 @@ #include "packages.h" #include "common/io.h" #include "common/processing.h" -#include "common/stringUtils.h" +#include "common/strutil.h" static bool isValidNixPkg(FFstrbuf* pkg) { if (!ffPathExists(pkg->chars, FF_PATHTYPE_DIRECTORY)) { diff --git a/src/detection/packages/packages_windows.c b/src/detection/packages/packages_windows.c index 4023a92e06..3bf4dfa72f 100644 --- a/src/detection/packages/packages_windows.c +++ b/src/detection/packages/packages_windows.c @@ -1,6 +1,6 @@ #include "packages.h" #include "common/processing.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include "common/path.h" #include "common/windows/unicode.h" #include "common/mallocHelper.h" diff --git a/src/detection/physicaldisk/physicaldisk_bsd.c b/src/detection/physicaldisk/physicaldisk_bsd.c index eda060905d..5a877681fe 100644 --- a/src/detection/physicaldisk/physicaldisk_bsd.c +++ b/src/detection/physicaldisk/physicaldisk_bsd.c @@ -2,7 +2,7 @@ #if __has_include() - #include "common/stringUtils.h" + #include "common/strutil.h" #include #include diff --git a/src/detection/physicaldisk/physicaldisk_haiku.c b/src/detection/physicaldisk/physicaldisk_haiku.c index 89799a2e17..e44ddced17 100644 --- a/src/detection/physicaldisk/physicaldisk_haiku.c +++ b/src/detection/physicaldisk/physicaldisk_haiku.c @@ -1,7 +1,7 @@ #include "physicaldisk.h" #include "common/io.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include #include diff --git a/src/detection/physicaldisk/physicaldisk_linux.c b/src/detection/physicaldisk/physicaldisk_linux.c index c06f8dc425..f8126b96a2 100644 --- a/src/detection/physicaldisk/physicaldisk_linux.c +++ b/src/detection/physicaldisk/physicaldisk_linux.c @@ -1,7 +1,7 @@ #include "physicaldisk.h" #include "common/io.h" #include "common/properties.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include #include diff --git a/src/detection/physicaldisk/physicaldisk_sunos.c b/src/detection/physicaldisk/physicaldisk_sunos.c index 93952c295e..d929d5a235 100644 --- a/src/detection/physicaldisk/physicaldisk_sunos.c +++ b/src/detection/physicaldisk/physicaldisk_sunos.c @@ -1,5 +1,5 @@ #include "physicaldisk.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include "sys/scsi/generic/inquiry.h" #include diff --git a/src/detection/physicalmemory/physicalmemory_apple.m b/src/detection/physicalmemory/physicalmemory_apple.m index b9d2c267e6..e35f53863f 100644 --- a/src/detection/physicalmemory/physicalmemory_apple.m +++ b/src/detection/physicalmemory/physicalmemory_apple.m @@ -1,7 +1,7 @@ #include "physicalmemory.h" #include "common/processing.h" #include "common/smbios.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include "common/apple/cf_helpers.h" #import diff --git a/src/detection/poweradapter/poweradapter_linux.c b/src/detection/poweradapter/poweradapter_linux.c index 747e5b42ad..fb555d5384 100644 --- a/src/detection/poweradapter/poweradapter_linux.c +++ b/src/detection/poweradapter/poweradapter_linux.c @@ -1,6 +1,6 @@ #include "poweradapter.h" #include "common/io.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include #include diff --git a/src/detection/processes/processes_linux.c b/src/detection/processes/processes_linux.c index 6b7b468554..dee8c09517 100644 --- a/src/detection/processes/processes_linux.c +++ b/src/detection/processes/processes_linux.c @@ -1,7 +1,7 @@ #include "processes.h" #include "common/io.h" -#include "common/stringUtils.h" +#include "common/strutil.h" const char* ffDetectProcesses(uint32_t* result) { FF_AUTO_CLOSE_DIR DIR* dir = opendir("/proc"); diff --git a/src/detection/sound/sound_haiku.cpp b/src/detection/sound/sound_haiku.cpp index 8cb3814c30..d69602e02e 100644 --- a/src/detection/sound/sound_haiku.cpp +++ b/src/detection/sound/sound_haiku.cpp @@ -1,6 +1,6 @@ extern "C" { #include "sound.h" -#include "common/stringUtils.h" +#include "common/strutil.h" } #include #include diff --git a/src/detection/sound/sound_obsd.c b/src/detection/sound/sound_obsd.c index 0d9d7fea46..a6dd6df405 100644 --- a/src/detection/sound/sound_obsd.c +++ b/src/detection/sound/sound_obsd.c @@ -1,5 +1,5 @@ #include "sound.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include #include diff --git a/src/detection/sound/sound_sunos.c b/src/detection/sound/sound_sunos.c index be3e9739ab..7c84e55cb2 100644 --- a/src/detection/sound/sound_sunos.c +++ b/src/detection/sound/sound_sunos.c @@ -1,6 +1,6 @@ #include "sound.h" #include "common/io.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include #include diff --git a/src/detection/terminalfont/terminalfont.c b/src/detection/terminalfont/terminalfont.c index c62b5cc429..7ef71206af 100644 --- a/src/detection/terminalfont/terminalfont.c +++ b/src/detection/terminalfont/terminalfont.c @@ -3,7 +3,7 @@ #include "common/properties.h" #include "common/processing.h" #include "common/debug.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include "detection/terminalshell/terminalshell.h" static void detectAlacritty(FFTerminalFontResult* terminalFont) { @@ -67,47 +67,84 @@ static void detectAlacritty(FFTerminalFontResult* terminalFont) { ffFontInitMoveValues(&terminalFont->font, &fontFamily, &fontSize, &fontStyle); } -static void detectGhostty(const FFstrbuf* exe, FFTerminalFontResult* terminalFont) { - FF_DEBUG("detectGhostty: start"); - FF_STRBUF_AUTO_DESTROY configPath = ffStrbufCreate(); - FF_STRBUF_AUTO_DESTROY fontName = ffStrbufCreate(); - FF_STRBUF_AUTO_DESTROY fontNameFallback = ffStrbufCreate(); - FF_STRBUF_AUTO_DESTROY fontSize = ffStrbufCreate(); +static bool parseGhosttyConfig(FFstrbuf* path, FFstrbuf* fontName, FFstrbuf* fontNameFallback, FFstrbuf* fontSize) { + FF_DEBUG("parsing config: %s", path->chars); - // Try ghostty +show-config first FF_STRBUF_AUTO_DESTROY buffer = ffStrbufCreate(); - const char* error = ffProcessAppendStdOut(&buffer, (char* const[]) { - exe->chars, - "+show-config", - NULL, - }); - if (error != NULL) { - FF_DEBUG("`ghostty +show-config` failed: %s", error); - return; + FF_STRBUF_AUTO_DESTROY temp = ffStrbufCreate(); + if (!ffAppendFileBuffer(path->chars, &buffer)) { + FF_DEBUG("cannot read config: %s", path->chars); + return false; } char* line = NULL; size_t len = 0; while (ffStrbufGetline(&line, &len, &buffer)) { - if (!fontName.length || !fontNameFallback.length) { - if (ffStrStartsWith(line, "font-family = ")) { - FF_DEBUG("found %s", line); - ffStrbufSetNS( - !fontName.length ? &fontName : &fontNameFallback, - (uint32_t) (len - strlen("font-family = ")), - line + strlen("font-family = ")); - continue; + if (ffParsePropLine(line, "font-family =", &temp)) { + FF_DEBUG("found font-family='%s' in %s", temp.chars, path->chars); + if (fontName->length > 0) { + ffStrbufDestroy(fontNameFallback); + ffStrbufInitMove(fontNameFallback, fontName); } + ffStrbufDestroy(fontName); + ffStrbufInitMove(fontName, &temp); + } else if (ffParsePropLine(line, "font-size =", fontSize)) { + FF_DEBUG("found font-size='%s' in %s", temp.chars, path->chars); + // Latter overrides former + ffStrbufDestroy(fontSize); + ffStrbufInitMove(fontSize, &temp); + } + } + return true; +} + +static void detectGhostty(const FFstrbuf* exe, FFTerminalFontResult* terminalFont, const char* configPathMac, const char* configPathUnix) { + FF_DEBUG("detectGhostty: start"); + FF_STRBUF_AUTO_DESTROY configPath = ffStrbufCreate(); + FF_STRBUF_AUTO_DESTROY fontName = ffStrbufCreate(); + FF_STRBUF_AUTO_DESTROY fontNameFallback = ffStrbufCreate(); + FF_STRBUF_AUTO_DESTROY fontSize = ffStrbufCreate(); + + if (configPathMac && configPathUnix) { +#if __APPLE__ + ffStrbufSet(&configPath, &instance.state.platform.homeDir); + ffStrbufAppendS(&configPath, "Library/Application Support/"); + ffStrbufAppendS(&configPath, configPathMac); // com.mitchellh.ghostty/config + parseGhosttyConfig(&configPath, &fontName, &fontNameFallback, &fontSize); +#endif + + if (instance.state.platform.configDirs.length > 0) { + ffStrbufSet(&configPath, FF_LIST_FIRST(FFstrbuf, instance.state.platform.configDirs)); + ffStrbufAppendS(&configPath, configPathUnix); // ghostty/config + parseGhosttyConfig(&configPath, &fontName, &fontNameFallback, &fontSize); } - if (!fontSize.length) { - if (ffStrStartsWith(line, "font-size = ")) { - FF_DEBUG("found fallback %s", line); - ffStrbufSetNS( - &fontSize, - (uint32_t) (len - strlen("font-size = ")), - line + strlen("font-size = ")); - continue; + } else { + // Try ghostty +show-config first + FF_STRBUF_AUTO_DESTROY buffer = ffStrbufCreate(); + const char* error = ffProcessAppendStdOut(&buffer, (char* const[]){ + exe->chars, + "+show-config", + NULL, + }); + if (error == NULL) { + char* line = NULL; + size_t len = 0; + while (ffStrbufGetline(&line, &len, &buffer)) { + if (ffStrStartsWith(line, "font-family = ")) { + FF_DEBUG("found %s", line); + if (fontName.length > 0) { + ffStrbufDestroy(&fontNameFallback); + ffStrbufInitMove(&fontNameFallback, &fontName); + } + ffStrbufSetNS(&fontName, (uint32_t) (len - strlen("font-family = ")), line + strlen("font-family = ")); + } else if (ffStrStartsWith(line, "font-size = ")) { + FF_DEBUG("found %s", line); + // `ghostty +show-config` reports only one font size even if the config has multiple font sizes + ffStrbufSetNS(&fontSize, (uint32_t) (len - strlen("font-size = ")), line + strlen("font-size = ")); + } } + } else { + FF_DEBUG("`ghostty +show-config` failed: %s", error); } } @@ -143,7 +180,7 @@ FF_A_UNUSED static void detectTTY(FFTerminalFontResult* terminalFont) { if (fontName.length == 0) { ffStrbufAppendS(&fontName, "VGA default kernel font "); - ffProcessAppendStdOut(&fontName, (char* const[]) { "showconsolefont", "--info", NULL }); + ffProcessAppendStdOut(&fontName, (char* const[]){ "showconsolefont", "--info", NULL }); ffStrbufTrimRight(&fontName, ' '); } @@ -183,7 +220,7 @@ FF_A_UNUSED static bool detectKitty(const FFstrbuf* exe, FFTerminalFontResult* r } } else { FF_STRBUF_AUTO_DESTROY buf = ffStrbufCreate(); - if (!ffProcessAppendStdOut(&buf, (char* const[]) { + if (!ffProcessAppendStdOut(&buf, (char* const[]){ exe->chars, "+kitten", "query-terminal", @@ -223,7 +260,7 @@ static bool detectWezterm(const FFstrbuf* exe, FFTerminalFontResult* result) { FF_STRBUF_AUTO_DESTROY fontName = ffStrbufCreate(); - ffStrbufSetS(&result->error, ffProcessAppendStdOut(&fontName, (char* const[]) { cli.chars, "ls-fonts", "--text", "a", NULL })); + ffStrbufSetS(&result->error, ffProcessAppendStdOut(&fontName, (char* const[]){ cli.chars, "ls-fonts", "--text", "a", NULL })); if (result->error.length) { return false; } @@ -269,7 +306,7 @@ static bool detectTabby(FFTerminalFontResult* result) { static bool detectContour(const FFstrbuf* exe, FFTerminalFontResult* result) { FF_STRBUF_AUTO_DESTROY buf = ffStrbufCreate(); - if (ffProcessAppendStdOut(&buf, (char* const[]) { exe->chars, "font-locator", NULL })) { + if (ffProcessAppendStdOut(&buf, (char* const[]){ exe->chars, "font-locator", NULL })) { ffStrbufAppendS(&result->error, "`contour font-locator` failed"); return false; } @@ -328,7 +365,9 @@ static bool detectTerminalFontCommon(const FFTerminalResult* terminal, FFTermina } else if (ffStrbufStartsWithIgnCaseS(&terminal->processName, "contour")) { detectContour(&terminal->exe, terminalFont); } else if (ffStrbufStartsWithIgnCaseS(&terminal->processName, "ghostty")) { - detectGhostty(&terminal->exe, terminalFont); + detectGhostty(&terminal->exe, terminalFont, NULL, NULL); + } else if (ffStrbufStartsWithIgnCaseS(&terminal->processName, "Muxy")) { + detectGhostty(&terminal->exe, terminalFont, "Muxy/ghostty.conf", "muxy/ghostty.conf"); } else if (ffStrbufStartsWithIgnCaseS(&terminal->processName, "rio")) { detectRio(terminalFont); } diff --git a/src/detection/terminalfont/terminalfont_linux.c b/src/detection/terminalfont/terminalfont_linux.c index 8dd1533dcf..bfc8959dce 100644 --- a/src/detection/terminalfont/terminalfont_linux.c +++ b/src/detection/terminalfont/terminalfont_linux.c @@ -6,7 +6,7 @@ #include "common/io.h" #include "common/processing.h" #include "common/mallocHelper.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include "common/binary.h" #include "detection/terminalshell/terminalshell.h" #include "detection/displayserver/displayserver.h" diff --git a/src/detection/terminalfont/terminalfont_windows.c b/src/detection/terminalfont/terminalfont_windows.c index cfb7865222..87566af8d9 100644 --- a/src/detection/terminalfont/terminalfont_windows.c +++ b/src/detection/terminalfont/terminalfont_windows.c @@ -5,7 +5,7 @@ #include "common/properties.h" #include "common/windows/unicode.h" #include "common/windows/registry.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include "detection/terminalshell/terminalshell.h" #include "terminalfont.h" diff --git a/src/detection/terminalshell/terminalshell.c b/src/detection/terminalshell/terminalshell.c index 10f365cfc3..222221660b 100644 --- a/src/detection/terminalshell/terminalshell.c +++ b/src/detection/terminalshell/terminalshell.c @@ -3,7 +3,7 @@ #include "common/processing.h" #include "common/properties.h" #include "common/path.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include "common/binary.h" #include @@ -32,6 +32,8 @@ static bool getFileVersion(const FFstrbuf* exePath, const wchar_t* stringName, F #elif __HAIKU__ #include "common/haiku/version.h" +#elif __APPLE__ + #include "common/apple/version.h" #endif static bool getExeVersionRaw(FFstrbuf* exe, FFstrbuf* version) { @@ -166,7 +168,25 @@ static bool getShellVersionNushell(FFstrbuf* exe, FFstrbuf* version) { return getExeVersionRaw(exe, version); // 0.73.0 } +static bool extractBusyboxVersion(const char* line, uint32_t len, void* userdata) { + if (!ffStrStartsWith(line, "BusyBox v")) { + return true; + } + + line += strlen("BusyBox v"); + len -= (uint32_t) strlen("BusyBox v"); + const char* space = memchr(line, ' ', len); + if (space) { + len = (uint32_t) (space - line); + } + + ffStrbufSetNS((FFstrbuf*) userdata, len, line); + return false; +} + static bool getShellVersionAsh(FFstrbuf* exe, FFstrbuf* version) { + ffBinaryExtractStrings(exe->chars, extractBusyboxVersion, version, (uint32_t) strlen("BusyBox v0.0.0")); + const char* error = ffStrbufEndsWithS(exe, "busybox") ? ffProcessAppendStdErr(version, (char* const[]) { exe->chars, "ash", "--help", NULL }) : ffProcessAppendStdErr(version, (char* const[]) { exe->chars, "--help", NULL }); @@ -233,10 +253,6 @@ static bool getShellVersionWinPowerShell(FFstrbuf* exe, FFstrbuf* version) { #endif bool fftsGetShellVersion(FFstrbuf* exe, const char* exeName, FFstrbuf* version) { - if (!instance.config.general.detectVersion) { - return false; - } - if (ffStrEqualsIgnCase(exeName, "sh")) { // #849 return false; } @@ -616,31 +632,8 @@ static bool getTerminalVersionKitty(FFstrbuf* exe, FFstrbuf* version) { } } #elif __APPLE__ - if (ffStrbufEndsWithS(exe, "/kitty.app/Contents/MacOS/kitty")) { - ffStrbufSet(version, exe); - ffStrbufSubstrBeforeLastC(version, '/'); - ffStrbufSubstrBeforeLastC(version, '/'); - ffStrbufAppendS(version, "/Info.plist"); - char buf[4096]; - ssize_t size = ffReadFileData(version->chars, ARRAY_SIZE(buf) - 1, buf); - if (size > 0) { - buf[size] = '\0'; - - const char* p = strstr(buf, "CFBundleShortVersionString"); - if (p) { - p += strlen("CFBundleShortVersionString"); - p = strchr(p, '>'); - if (p) { - p++; - const char* end = strchr(p, '<'); - if (end) { - ffStrbufSetNS(version, (uint32_t) (end - p), p); - return true; - } - } - } - } - ffStrbufClear(version); + if (ffGetAppNameAndVersion(exe->chars, NULL, version)) { + return true; } #endif @@ -748,10 +741,6 @@ static bool getTerminalVersionConEmu(FFstrbuf* exe, FFstrbuf* version) { #endif bool fftsGetTerminalVersion(FFstrbuf* processName, FF_A_UNUSED FFstrbuf* exe, FFstrbuf* version) { - if (!instance.config.general.detectVersion) { - return false; - } - #ifdef __ANDROID__ if (ffStrbufEqualS(processName, "com.termux")) { @@ -948,6 +937,10 @@ bool fftsGetTerminalVersion(FFstrbuf* processName, FF_A_UNUSED FFstrbuf* exe, FF return getFileVersion(exe, NULL, version); +#elif __APPLE__ + + return ffGetAppNameAndVersion(exe->chars, NULL, version); + #else return false; diff --git a/src/detection/terminalshell/terminalshell.h b/src/detection/terminalshell/terminalshell.h index 85083fa129..008e30c405 100644 --- a/src/detection/terminalshell/terminalshell.h +++ b/src/detection/terminalshell/terminalshell.h @@ -30,3 +30,6 @@ typedef struct FFTerminalResult { const FFShellResult* ffDetectShell(); const FFTerminalResult* ffDetectTerminal(); + +bool fftsGetShellVersion(FFstrbuf* exe, const char* exeName, FFstrbuf* version); +bool fftsGetTerminalVersion(FFstrbuf* processName, FFstrbuf* exe, FFstrbuf* version); diff --git a/src/detection/terminalshell/terminalshell_linux.c b/src/detection/terminalshell/terminalshell_linux.c index 75f88c4e9d..1eccf26ebd 100644 --- a/src/detection/terminalshell/terminalshell_linux.c +++ b/src/detection/terminalshell/terminalshell_linux.c @@ -3,7 +3,7 @@ #include "common/parsing.h" #include "common/processing.h" #include "common/thread.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include #include @@ -280,20 +280,15 @@ static void getUserShellFromEnv(FFShellResult* result) { } } -bool fftsGetShellVersion(FFstrbuf* exe, const char* exeName, FFstrbuf* version); - -bool fftsGetTerminalVersion(FFstrbuf* processName, FFstrbuf* exe, FFstrbuf* version); - static void setShellInfoDetails(FFShellResult* result) { - ffStrbufClear(&result->version); - fftsGetShellVersion(result->exePath.length > 0 ? &result->exePath : &result->exe, result->exeName, &result->version); - if (ffStrbufEqualS(&result->processName, "pwsh")) { ffStrbufInitStatic(&result->prettyName, "PowerShell"); } else if (ffStrbufEqualS(&result->processName, "nu")) { ffStrbufInitStatic(&result->prettyName, "nushell"); } else if (ffStrbufEqualS(&result->processName, "oil.ovm")) { ffStrbufInitStatic(&result->prettyName, "Oils"); + } else if (ffStrbufEqualS(&result->processName, "busybox")) { + ffStrbufInitStatic(&result->prettyName, "ash"); } else { // https://github.com/fastfetch-cli/fastfetch/discussions/280#discussioncomment-3831734 ffStrbufInitS(&result->prettyName, result->exeName); @@ -301,11 +296,13 @@ static void setShellInfoDetails(FFShellResult* result) { } static void setTerminalInfoDetails(FFTerminalResult* result) { - if (ffStrbufStartsWithC(&result->processName, '.') && ffStrbufContainS(&result->processName, "-wrap")) { - // For NixOS. Ref: #510 and https://github.com/NixOS/nixpkgs/pull/249428 - // We use processName when detecting version and font, overriding it for simplification - ffStrbufSubstrBeforeLastC(&result->processName, '-'); + // For Nixpkgs. Ref: #510 and https://github.com/NixOS/nixpkgs/pull/249428 + // We use processName when detecting version and font, overriding it for simplification + if (ffStrbufStartsWithC(&result->processName, '.') && ffStrbufStartsWithS(&result->exePath,"/nix/store")) { ffStrbufSubstrAfter(&result->processName, 0); + if (strlen(result->exeName) < 15) { + ffStrbufSubstrBeforeLastC(&result->processName, '-'); + } } if (ffStrbufEqualS(&result->processName, "wezterm-gui")) { @@ -364,13 +361,11 @@ static void setTerminalInfoDetails(FFTerminalResult* result) { #endif - else if (strncmp(result->exeName, result->processName.chars, result->processName.length) == 0) { // if exeName starts with processName, print it. Otherwise print processName + else if (strncmp(result->exeName, result->processName.chars, result->processName.length) == 0 || (ffStrbufStartsWithS(&result->exePath,"/nix/store") && strlen(result->exeName) > 15)) { // if exeName starts with processName, print it. Otherwise print processName. For nixpkgs, use exeName if processName can't be unwrapped ffStrbufInitS(&result->prettyName, result->exeName); } else { ffStrbufInitCopy(&result->prettyName, &result->processName); } - - fftsGetTerminalVersion(&result->processName, result->exePath.length > 0 ? &result->exePath : &result->exe, &result->version); } #if defined(MAXPATH) @@ -408,7 +403,13 @@ const FFShellResult* ffDetectShell() { ppid = getShellInfo(&result, ppid); getUserShellFromEnv(&result); - setShellInfoDetails(&result); + + if (result.processName.length > 0) { + setShellInfoDetails(&result); + if (instance.config.general.detectVersion) { + fftsGetShellVersion(result.exePath.length > 0 ? &result.exePath : &result.exe, result.exeName, &result.version); + } + } return &result; } @@ -436,7 +437,13 @@ const FFTerminalResult* ffDetectTerminal() { ppid = getTerminalInfo(&result, ppid); } getTerminalFromEnv(&result); - setTerminalInfoDetails(&result); + + if (result.processName.length > 0) { + setTerminalInfoDetails(&result); + if (instance.config.general.detectVersion) { + fftsGetTerminalVersion(&result.processName, result.exePath.length > 0 ? &result.exePath : &result.exe, &result.version); + } + } return &result; } diff --git a/src/detection/terminalshell/terminalshell_windows.c b/src/detection/terminalshell/terminalshell_windows.c index cd687e892c..d037663c83 100644 --- a/src/detection/terminalshell/terminalshell_windows.c +++ b/src/detection/terminalshell/terminalshell_windows.c @@ -7,7 +7,7 @@ #include "common/windows/unicode.h" #include "common/windows/version.h" #include "common/windows/nt.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include #include @@ -17,8 +17,6 @@ #include #include -bool fftsGetShellVersion(FFstrbuf* exe, const char* exeName, FFstrbuf* version); - static uint32_t getShellInfo(FFShellResult* result, uint32_t pid) { uint32_t ppid = 0; bool gui = false; @@ -95,6 +93,8 @@ static void setShellInfoDetails(FFShellResult* result) { ffStrbufSetS(&result->prettyName, "nushell"); } else if (ffStrbufIgnCaseEqualS(&result->prettyName, "explorer")) { ffStrbufSetS(&result->prettyName, "Windows Explorer"); + } else if (ffStrbufIgnCaseEqualS(&result->prettyName, "busybox")) { + ffStrbufInitStatic(&result->prettyName, "ash"); } } @@ -292,8 +292,6 @@ static void setTerminalInfoDetails(FFTerminalResult* result) { } } -bool fftsGetTerminalVersion(FFstrbuf* processName, FFstrbuf* exe, FFstrbuf* version); - const FFShellResult* ffDetectShell(void) { static FFShellResult result; static bool init = false; @@ -332,7 +330,9 @@ const FFShellResult* ffDetectShell(void) { if (ext) { *ext = '\0'; } - fftsGetShellVersion(result.exePath.length > 0 ? &result.exePath : &result.exe, tmp, &result.version); + if (instance.config.general.detectVersion) { + fftsGetShellVersion(result.exePath.length > 0 ? &result.exePath : &result.exe, tmp, &result.version); + } } return &result; @@ -370,7 +370,9 @@ const FFTerminalResult* ffDetectTerminal(void) { if (result.processName.length > 0) { setTerminalInfoDetails(&result); - fftsGetTerminalVersion(&result.processName, result.exePath.length > 0 ? &result.exePath : &result.exe, &result.version); + if (instance.config.general.detectVersion) { + fftsGetTerminalVersion(&result.processName, result.exePath.length > 0 ? &result.exePath : &result.exe, &result.version); + } } return &result; diff --git a/src/detection/terminaltheme/terminaltheme.c b/src/detection/terminaltheme/terminaltheme.c index 5be3c2068a..e609754d7c 100644 --- a/src/detection/terminaltheme/terminaltheme.c +++ b/src/detection/terminaltheme/terminaltheme.c @@ -1,6 +1,6 @@ #include "terminaltheme.h" #include "common/io.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include diff --git a/src/detection/vulkan/vulkan.c b/src/detection/vulkan/vulkan.c index 001966de92..013c457266 100644 --- a/src/detection/vulkan/vulkan.c +++ b/src/detection/vulkan/vulkan.c @@ -7,7 +7,7 @@ #include "common/library.h" #include "common/io.h" #include "common/parsing.h" - #include "common/stringUtils.h" + #include "common/strutil.h" #include #include diff --git a/src/detection/wallpaper/wallpaper_linux.c b/src/detection/wallpaper/wallpaper_linux.c index ee709b1cd9..f5ad4eca70 100644 --- a/src/detection/wallpaper/wallpaper_linux.c +++ b/src/detection/wallpaper/wallpaper_linux.c @@ -1,8 +1,83 @@ #include "wallpaper.h" +#include "common/io.h" #include "common/settings.h" +#include "detection/displayserver/displayserver.h" #include "detection/gtk_qt/gtk_qt.h" +static const char* detectCosmicComp(FFstrbuf* result) { + FF_STRBUF_AUTO_DESTROY path = ffStrbufCreateCopy(FF_LIST_FIRST(FFstrbuf, instance.state.platform.configDirs)); + ffStrbufAppendS(&path, "cosmic/com.system76.CosmicBackground/v1/"); + uint32_t basePathLength = path.length; + + FF_STRBUF_AUTO_DESTROY backgrounds = ffStrbufCreate(); + ffStrbufAppendS(&path, "backgrounds"); + bool sharedWallpaper = true; + FF_STRBUF_AUTO_DESTROY monitorName = ffStrbufCreate(); + if (ffReadFileBuffer(path.chars, &backgrounds)) { + FF_STRBUF_AUTO_DESTROY cleaned = ffStrbufCreateCopy(&backgrounds); + ffStrbufRemoveStrings(&cleaned, 4, (const char*[]){ " ", "\n", "\r", "\t" }); + + if (!ffStrbufEqualS(&cleaned, "[]")) { + const char* firstQuote = strchr(backgrounds.chars, '"'); + if (firstQuote != NULL) { + const char* secondQuote = strchr(firstQuote + 1, '"'); + if (secondQuote != NULL && secondQuote > firstQuote + 1) { + ffStrbufAppendNS(&monitorName, (uint32_t) (secondQuote - firstQuote - 1), firstQuote + 1); + sharedWallpaper = false; + } + } + } + } + ffStrbufSubstrBefore(&path, basePathLength); + + if (sharedWallpaper) { + ffStrbufAppendS(&path, "all"); + } else { + ffStrbufAppendS(&path, "output."); + ffStrbufAppend(&path, &monitorName); + } + + FF_STRBUF_AUTO_DESTROY output = ffStrbufCreate(); + if (!ffReadFileBuffer(path.chars, &output)) { + return "Failed to read COSMIC wallpaper config"; + } + + const char* sourceStart = strstr(output.chars, "source:"); + if (sourceStart == NULL) { + return "COSMIC wallpaper config doesn't contain source"; + } + + const char* pathStart = strstr(sourceStart, "Path("); + if (pathStart == NULL) { + return "COSMIC wallpaper source is not a Path value"; + } + + pathStart += strlen("Path("); + while (*pathStart == ' ' || *pathStart == '\t') { + ++pathStart; + } + + if (*pathStart != '\'' && *pathStart != '"') { + return "COSMIC wallpaper Path format is invalid"; + } + + char quote = *pathStart; + ++pathStart; + const char* pathEnd = strchr(pathStart, quote); + if (pathEnd == NULL || pathEnd == pathStart) { + return "COSMIC wallpaper path is empty"; + } + + ffStrbufAppendNS(result, (uint32_t) (pathEnd - pathStart), pathStart); + return NULL; +} + const char* ffDetectWallpaper(FFstrbuf* result) { + const FFDisplayServerResult* wm = ffConnectDisplayServer(); + if (ffStrbufIgnCaseEqualS(&wm->wmPrettyName, FF_WM_PRETTY_COSMIC_COMP)) { + return detectCosmicComp(result); + } + const FFstrbuf* wallpaper = NULL; const FFGTKResult* gtk = ffDetectGTK4(); if (gtk->wallpaper.length) { diff --git a/src/detection/wifi/wifi_apple.m b/src/detection/wifi/wifi_apple.m index 21411335ef..21808e03df 100644 --- a/src/detection/wifi/wifi_apple.m +++ b/src/detection/wifi/wifi_apple.m @@ -1,6 +1,6 @@ #include "wifi.h" #include "common/processing.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #import diff --git a/src/detection/wifi/wifi_bsd.c b/src/detection/wifi/wifi_bsd.c index 865a0a80fa..fab1293bca 100644 --- a/src/detection/wifi/wifi_bsd.c +++ b/src/detection/wifi/wifi_bsd.c @@ -1,6 +1,6 @@ #include "wifi.h" #include "common/io.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include #include diff --git a/src/detection/wifi/wifi_linux.c b/src/detection/wifi/wifi_linux.c index fc5d0767c8..6f761590de 100644 --- a/src/detection/wifi/wifi_linux.c +++ b/src/detection/wifi/wifi_linux.c @@ -1,7 +1,7 @@ #include "wifi.h" #include "common/io.h" #include "common/debug.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include #include @@ -110,7 +110,7 @@ static bool ffWifiNlGetFamilyId(FFWifiNlContext* ctx) { }, .genl = { .cmd = CTRL_CMD_GETFAMILY, - .version = 1, + .version = 1, // generic netlink control protocol version }, }; @@ -197,7 +197,7 @@ static bool ffWifiNlInit(FFWifiNlContext* ctx) { ctx->sockFd, SOL_SOCKET, SO_RCVTIMEO, - &(struct timeval){ .tv_sec = 0, .tv_usec = 250000 }, + &(struct timeval){ .tv_sec = 0, .tv_usec = 250000 }, // 250 ms recv timeout sizeof(struct timeval)) < 0) { FF_DEBUG("Failed to set netlink receive timeout: %s", strerror(errno)); return false; @@ -243,12 +243,12 @@ static double ffWifiParseBitrateFromRateInfo(const struct nlattr* rateAttr, FFst break; case NL80211_RATE_INFO_BITRATE32: if (payload >= sizeof(uint32_t)) { - rate = *(uint32_t*) ffWifiNlAttrData(info) / 10.0; + rate = *(uint32_t*) ffWifiNlAttrData(info) / 10.0; // nl80211 bitrate unit: 100 kbps => Mbps } break; case NL80211_RATE_INFO_BITRATE: if (payload >= sizeof(uint16_t) && rate == -DBL_MAX) { - rate = *(uint16_t*) ffWifiNlAttrData(info) / 10.0; + rate = *(uint16_t*) ffWifiNlAttrData(info) / 10.0; // nl80211 bitrate unit: 100 kbps => Mbps } break; } @@ -291,54 +291,54 @@ static void ffWifiApplySecurityFlags(FFWifiResult* item, const FFWifiSecurityFla } static void ffWifiParseRsnIe(const uint8_t* ie, size_t len, FFWifiSecurityFlags* sec) { - if (len < 8) { + if (len < 8) { // version(2) + group cipher suite(4) + pairwise count(2) return; } sec->wpa2 = true; size_t pos = 0; - pos += 2; - if (pos + 4 > len) { + pos += 2; // RSN version field length + if (pos + 4 > len) { // group cipher suite selector length return; } - pos += 4; + pos += 4; // skip group cipher suite selector - if (pos + 2 > len) { + if (pos + 2 > len) { // pairwise cipher suite count field length return; } uint16_t pairwiseCount = *(uint16_t*) (ie + pos); - pos += 2; + pos += 2; // skip pairwise cipher suite count field - size_t pairwiseLen = (size_t) pairwiseCount * 4; + size_t pairwiseLen = (size_t) pairwiseCount * 4; // each suite selector is 4 bytes if (pos + pairwiseLen > len) { return; } pos += pairwiseLen; - if (pos + 2 > len) { + if (pos + 2 > len) { // AKM suite count field length return; } uint16_t akmCount = *(uint16_t*) (ie + pos); - pos += 2; + pos += 2; // skip AKM suite count field - for (uint16_t i = 0; i < akmCount && pos + 4 <= len; ++i, pos += 4) { + for (uint16_t i = 0; i < akmCount && pos + 4 <= len; ++i, pos += 4) { // each AKM suite selector is 4 bytes const uint8_t* akm = ie + pos; - if (akm[0] != 0x00 || akm[1] != 0x0f || akm[2] != 0xac) { + if (akm[0] != 0x00 || akm[1] != 0x0f || akm[2] != 0xac) { // RSN OUI 00:0f:ac continue; } switch (akm[3]) { - case 1: - case 5: - case 11: - case 12: + case 1: // 802.1X + case 5: // FT/802.1X + case 11: // 802.1X-SHA256 + case 12: // FT/802.1X-SHA384 (suite selector value) sec->eap = true; break; - case 8: + case 8: // SAE (WPA3-Personal) sec->wpa3 = true; break; - case 18: + case 18: // OWE sec->owe = true; break; default: @@ -352,45 +352,45 @@ static void ffWifiParseRsnIe(const uint8_t* ie, size_t len, FFWifiSecurityFlags* } static void ffWifiParseWpaVendorIe(const uint8_t* ie, size_t len, FFWifiSecurityFlags* sec) { - if (len < 8) { + if (len < 8) { // OUI+type(4) + version(2) + multicast cipher suite(4) starts here return; } - if (!(ie[0] == 0x00 && ie[1] == 0x50 && ie[2] == 0xf2 && ie[3] == 0x01)) { + if (!(ie[0] == 0x00 && ie[1] == 0x50 && ie[2] == 0xf2 && ie[3] == 0x01)) { // Microsoft WPA OUI/type return; } sec->wpa = true; - size_t pos = 4; - if (pos + 2 > len) { + size_t pos = 4; // WPA vendor OUI/type selector length + if (pos + 2 > len) { // WPA version field length return; } - pos += 2; + pos += 2; // skip WPA version - if (pos + 4 > len) { + if (pos + 4 > len) { // multicast cipher suite selector length return; } - pos += 4; + pos += 4; // skip multicast cipher suite selector - if (pos + 2 > len) { + if (pos + 2 > len) { // unicast cipher suite count field length return; } uint16_t pairwiseCount = *(uint16_t*) (ie + pos); - pos += 2 + (size_t) pairwiseCount * 4; + pos += 2 + (size_t) pairwiseCount * 4; // count field(2) + N unicast suite selectors(4 each) - if (pos + 2 > len) { + if (pos + 2 > len) { // AKM suite count field length return; } uint16_t akmCount = *(uint16_t*) (ie + pos); - pos += 2; + pos += 2; // skip AKM suite count field - for (uint16_t i = 0; i < akmCount && pos + 4 <= len; ++i, pos += 4) { + for (uint16_t i = 0; i < akmCount && pos + 4 <= len; ++i, pos += 4) { // each AKM suite selector is 4 bytes const uint8_t* akm = ie + pos; - if (!(akm[0] == 0x00 && akm[1] == 0x50 && akm[2] == 0xf2)) { + if (!(akm[0] == 0x00 && akm[1] == 0x50 && akm[2] == 0xf2)) { // WPA vendor OUI 00:50:f2 continue; } - if (akm[3] == 1) { + if (akm[3] == 1) { // WPA Enterprise (802.1X) sec->eap = true; } } @@ -407,11 +407,11 @@ static void ffWifiParseInformationElements(const uint8_t* ies, size_t length, FF } const uint8_t* ie = ies + pos; - if (id == 0) { + if (id == 0) { // SSID element ID ffStrbufSetNS(&item->conn.ssid, len, (const char*) ie); - } else if (id == 48) { + } else if (id == 48) { // RSN element ID ffWifiParseRsnIe(ie, len, sec); - } else if (id == 221) { + } else if (id == 221) { // vendor-specific element ID (WPA IE lives here) ffWifiParseWpaVendorIe(ie, len, sec); } @@ -452,11 +452,11 @@ static void ffWifiParseBssAttr(const struct nlattr* bssAttr, FFWifiResult* item) item->conn.frequency = (uint16_t) *(uint32_t*) ffWifiNlAttrData(attr); item->conn.channel = ffWifiFreqToChannel(item->conn.frequency); } else if (type == NL80211_BSS_SIGNAL_MBM && payload >= sizeof(int32_t)) { - int rssi = *(int32_t*) ffWifiNlAttrData(attr) / 100; + int rssi = *(int32_t*) ffWifiNlAttrData(attr) / 100; // mBm (100 * dBm) => dBm item->conn.signalQuality = rssiToSignalQuality(rssi); } else if (type == NL80211_BSS_CAPABILITY && payload >= sizeof(uint16_t)) { uint16_t capability = *(uint16_t*) ffWifiNlAttrData(attr); - sec.privacy = (capability & (1u << 4u)) != 0; + sec.privacy = (capability & (1u << 4u)) != 0; // IEEE 802.11 capability bit 4: privacy } else if (type == NL80211_BSS_INFORMATION_ELEMENTS || type == NL80211_BSS_BEACON_IES) { ffWifiParseInformationElements((const uint8_t*) ffWifiNlAttrData(attr), payload, item, &sec); } @@ -481,7 +481,7 @@ static bool ffWifiFetchScanInfo(FFWifiNlContext* ctx, FFWifiResult* item, uint32 }, .genl = { .cmd = NL80211_CMD_GET_SCAN, - .version = 0, + .version = 0, // nl80211 command version }, }; @@ -595,7 +595,7 @@ static bool ffWifiFetchStationInfo(FFWifiNlContext* ctx, FFWifiResult* item, uin }, .genl = { .cmd = NL80211_CMD_GET_STATION, - .version = 0, + .version = 0, // nl80211 command version }, }; @@ -667,7 +667,7 @@ static const char* detectWithNetlink(FFWifiNlContext* ctx, FFWifiResult* item, u if (ctx->sockFd == -1) { if (!ffWifiNlInit(ctx)) { FF_DEBUG("Failed to initialize netlink context, skipping"); - ctx->sockFd = -2; // Don't try again + ctx->sockFd = -2; // sentinel: permanent netlink failure, don't retry return "Netlink initialization failed"; } } else { @@ -705,7 +705,7 @@ static const char* detectWithIoctl(FFWifiIcContext* ctx, FFWifiResult* item, cha sock = socket(AF_INET, SOCK_DGRAM | SOCK_CLOEXEC, 0); if (sock < 0) { FF_DEBUG("Failed to initialize ioctl context, skipping: %s", strerror(errno)); - ctx->sockFd = -2; // Don't try again + ctx->sockFd = -2; // sentinel: permanent ioctl failure, don't retry return "socket() failed"; } ctx->sockFd = sock; @@ -793,7 +793,7 @@ static const char* detectWithIoctl(FFWifiIcContext* ctx, FFWifiResult* item, cha FF_DEBUG("Getting bitrate via ioctl"); if (ioctl(sock, SIOCGIWRATE, &iwr) >= 0) { if (iwr.u.bitrate.value > 0) { - item->conn.txRate = iwr.u.bitrate.value / 1000000.; + item->conn.txRate = iwr.u.bitrate.value / 1000000.; // bps => Mbps FF_DEBUG("TX bitrate: %.2f Mbps", item->conn.txRate); } else { FF_DEBUG("Bitrate value is zero or negative, ignoring"); @@ -806,16 +806,16 @@ static const char* detectWithIoctl(FFWifiIcContext* ctx, FFWifiResult* item, cha if (item->conn.frequency == 0 && item->conn.channel == 0) { FF_DEBUG("Getting frequency via ioctl"); if (ioctl(sock, SIOCGIWFREQ, &iwr) >= 0) { - if (iwr.u.freq.e == 0 && iwr.u.freq.m <= 1000) { + if (iwr.u.freq.e == 0 && iwr.u.freq.m <= 1000) { // kernel may return direct channel number item->conn.channel = (uint16_t) iwr.u.freq.m; FF_DEBUG("Direct channel value: %u", item->conn.channel); } else { // convert it to MHz - while (iwr.u.freq.e < 6) { + while (iwr.u.freq.e < 6) { // normalize exponent to 10^6 (MHz) iwr.u.freq.m /= 10; iwr.u.freq.e++; } - while (iwr.u.freq.e > 6) { + while (iwr.u.freq.e > 6) { // normalize exponent to 10^6 (MHz) iwr.u.freq.m *= 10; iwr.u.freq.e--; } @@ -952,7 +952,7 @@ const char* ffDetectWifi(FFlist* result) { } flags[len] = '\0'; - unsigned flagsVal = (unsigned) strtoul(flags, NULL, 16); + unsigned flagsVal = (unsigned) strtoul(flags, NULL, 16); // parse /sys flags as hexadecimal if (flagsVal & IFF_UP) { ffStrbufSetStatic(&item->inf.status, "up"); } else { diff --git a/src/detection/wifi/wifi_nbsd.c b/src/detection/wifi/wifi_nbsd.c index b7dbe131ee..52897c487e 100644 --- a/src/detection/wifi/wifi_nbsd.c +++ b/src/detection/wifi/wifi_nbsd.c @@ -1,6 +1,6 @@ #include "wifi.h" #include "common/io.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #define COMPAT_FREEBSD_NET80211 1 #include diff --git a/src/detection/wifi/wifi_obsd.c b/src/detection/wifi/wifi_obsd.c index 2fa4cd75c7..f686231b31 100644 --- a/src/detection/wifi/wifi_obsd.c +++ b/src/detection/wifi/wifi_obsd.c @@ -1,6 +1,6 @@ #include "wifi.h" #include "common/io.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include #include diff --git a/src/detection/wm/wm_apple.m b/src/detection/wm/wm_apple.m index f9865bef26..89273e9390 100644 --- a/src/detection/wm/wm_apple.m +++ b/src/detection/wm/wm_apple.m @@ -2,78 +2,63 @@ #include "common/sysctl.h" #include "common/mallocHelper.h" -#include "common/stringUtils.h" +#include "common/strutil.h" +#include "common/apple/version.h" #include #include #import -const char* ffDetectWMPlugin(FFstrbuf* pluginName) -{ - int request[] = {CTL_KERN, KERN_PROC, KERN_PROC_ALL}; +const char* ffDetectWMPlugin(FFstrbuf* pluginName) { + int request[] = { CTL_KERN, KERN_PROC, KERN_PROC_ALL }; u_int requestLength = ARRAY_SIZE(request); size_t length = 0; FF_AUTO_FREE struct kinfo_proc* processes = ffSysctlGetData(request, requestLength, &length); - if(processes == NULL) + if (processes == NULL) { return "sysctl(CTL_KERN, KERN_PROC, KERN_PROC_ALL) failed"; + } assert(length % sizeof(struct kinfo_proc) == 0); - for(size_t i = 0; i < length / sizeof(struct kinfo_proc); i++) - { + for (size_t i = 0; i < length / sizeof(struct kinfo_proc); i++) { const struct kinfo_proc* proc = &processes[i]; - if (proc->kp_eproc.e_ppid != 1) continue; + if (proc->kp_eproc.e_ppid != 1) { + continue; + } const char* comm = proc->kp_proc.p_comm; - if( + if ( !ffStrEqualsIgnCase(comm, "rectangle") && // 28.6k - !ffStrEqualsIgnCase(comm, "yabai") && // 28.4k + !ffStrEqualsIgnCase(comm, "yabai") && // 28.4k !ffStrEqualsIgnCase(comm, "aerospace") && // 19.6k - !ffStrEqualsIgnCase(comm, "amethyst") && // 16k - !ffStrEqualsIgnCase(comm, "glazewm") && // 11.6k + !ffStrEqualsIgnCase(comm, "amethyst") && // 16k + !ffStrEqualsIgnCase(comm, "glazewm") && // 11.6k - #if 0 +#if 0 // Unmaintained !ffStrEqualsIgnCase(comm, "spectacle") && // 13.6k !ffStrEqualsIgnCase(comm, "chunkwm") && // repo deleted; was https://github.com/koekeishiya/chunkwm !ffStrEqualsIgnCase(comm, "kwm") && // repo deleted; was https://github.com/koekeishiya/kwm - #endif - true - ) continue; +#endif + true) + continue; - if (instance.config.general.detectVersion) - { + if (instance.config.general.detectVersion) { char buf[PROC_PIDPATHINFO_MAXSIZE]; int length = proc_pidpath(proc->kp_proc.p_pid, buf, ARRAY_SIZE(buf) - strlen("Info.plist")); - if (length > 0) - { - char* lastSlash = strrchr(buf, '/'); - if (lastSlash) - { - *lastSlash = '\0'; - if (ffStrEndsWith(buf, ".app/Contents/MacOS")) - { - lastSlash -= strlen("MacOS"); - strcpy(lastSlash, "Info.plist"); // X.app/Contents/Info.plist - NSError* error; - NSDictionary* dict = [NSDictionary dictionaryWithContentsOfURL:[NSURL fileURLWithPath:@(buf)] - error:&error]; - if (dict) - { - NSString* name = dict[@"CFBundleDisplayName"] ?: dict[@"CFBundleName"]; - ffStrbufSetS(pluginName, name.UTF8String ?: comm); - - NSString* version = dict[@"CFBundleShortVersionString"]; - if (version) - { - ffStrbufAppendC(pluginName, ' '); - ffStrbufAppendS(pluginName, version.UTF8String); - } - - break; - } + if (length > 0) { + buf[length] = '\0'; + FF_STRBUF_AUTO_DESTROY pluginVersion = ffStrbufCreate(); + if (ffGetAppNameAndVersion(buf, pluginName, &pluginVersion)) { + if (pluginName->length == 0) { + ffStrbufSetS(pluginName, comm); } + if (pluginVersion.length > 0) { + ffStrbufAppendC(pluginName, ' '); + ffStrbufAppend(pluginName, &pluginVersion); + } + break; } } } @@ -86,24 +71,23 @@ return NULL; } -const char* ffDetectWMVersion(const FFstrbuf* wmName, FFstrbuf* result, FF_A_UNUSED FFWMOptions* options) -{ - if (!wmName) +const char* ffDetectWMVersion(const FFstrbuf* wmName, FFstrbuf* result, FF_A_UNUSED FFWMOptions* options) { + if (!wmName) { return "No WM detected"; + } - if (ffStrbufEqualS(wmName, "WindowServer")) - { + if (ffStrbufEqualS(wmName, "WindowServer")) { NSError* error; NSDictionary* dict = [NSDictionary dictionaryWithContentsOfURL:[NSURL fileURLWithPath:@"/System/Library/PrivateFrameworks/SkyLight.framework/Resources/version.plist" isDirectory:NO] - error:&error]; - if (!dict) - { + error:&error]; + if (!dict) { dict = [NSDictionary dictionaryWithContentsOfURL:[NSURL fileURLWithPath:@"/System/Library/Frameworks/ApplicationServices.framework/Frameworks/CoreGraphics.framework/Resources/version.plist" isDirectory:NO] - error:&error]; + error:&error]; } - if (dict) + if (dict) { ffStrbufSetS(result, ((NSString*) dict[@"CFBundleShortVersionString"]).UTF8String); + } } return NULL; diff --git a/src/detection/wm/wm_linux.c b/src/detection/wm/wm_linux.c index 6c864a7fe1..a62a4af9ac 100644 --- a/src/detection/wm/wm_linux.c +++ b/src/detection/wm/wm_linux.c @@ -4,9 +4,8 @@ #include "common/io.h" #include "common/binary.h" #include "common/path.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include "common/debug.h" -#include "detection/displayserver/displayserver.h" const char* ffDetectWMPlugin(FF_A_UNUSED FFstrbuf* pluginName) { return "Not supported on this platform"; @@ -99,14 +98,23 @@ static const char* getHyprland(FFstrbuf* result) { } static bool extractSwayVersion(const char* line, FF_A_UNUSED uint32_t len, void* userdata) { - if (!ffStrStartsWith(line, "sway version ")) { + FFstrbuf* result = (FFstrbuf*) userdata; + if (!ffStrStartsWith(line, "sway")) { return true; } + if (ffStrStartsWith(line + 4, " version ")) { + ffStrbufSetNS(result, len - (uint32_t) strlen("sway version "), line + strlen("sway version ")); + ffStrbufTrimRightSpace(result); + return false; + } else { + char swayfxVer[32], swayVer[32]; + if (sscanf(line + 4, "fx version %31[^ ] (based on sway %31[^)])", swayfxVer, swayVer) == 2) { + ffStrbufSetF(result, "%s [swayfx %s]", swayVer, swayfxVer); + return false; + } + } - FFstrbuf* result = (FFstrbuf*) userdata; - ffStrbufSetNS(result, len - (uint32_t) strlen("sway version "), line + strlen("sway version ")); - ffStrbufTrimRightSpace(result); - return false; + return true; } static const char* getSway(FFstrbuf* result) { @@ -116,15 +124,14 @@ static const char* getSway(FFstrbuf* result) { return "Failed to find sway executable path"; } - ffBinaryExtractStrings(path.chars, extractSwayVersion, result, (uint32_t) strlen("v0.0.0")); + ffBinaryExtractStrings(path.chars, extractSwayVersion, result, (uint32_t) strlen("sway version 0.0.0")); if (result->length > 0) { return NULL; } - if (ffProcessAppendStdOut(result, (char* const[]) { path.chars, "--version", NULL }) == NULL) { // sway version 1.10 - ffStrbufSubstrAfterLastC(result, ' '); - ffStrbufTrimRightSpace(result); - return NULL; + FF_STRBUF_AUTO_DESTROY buffer = ffStrbufCreate(); + if (ffProcessAppendStdOut(&buffer, (char* const[]) { path.chars, "--version", NULL }) == NULL) { // sway version 1.10 + return extractSwayVersion(buffer.chars, buffer.length, result) ? "Failed to parse sway version output" : NULL; } return "Failed to run command `sway --version`"; diff --git a/src/detection/wmtheme/wmtheme_haiku.cpp b/src/detection/wmtheme/wmtheme_haiku.cpp new file mode 100644 index 0000000000..243eaa43e4 --- /dev/null +++ b/src/detection/wmtheme/wmtheme_haiku.cpp @@ -0,0 +1,30 @@ +extern "C" { +#include "fastfetch.h" +#include "wmtheme.h" +} + +#include +#include + +bool ffDetectWmTheme(FFstrbuf* themeOrError) +{ + // We need a valid be_app to query the app_server here. + BApplication app("application/x-vnd.fastfetch-cli-fastfetch"); + + DecorInfoUtility *util = new DecorInfoUtility(); + DecorInfo* decor = NULL; + + if (util) { + decor = util->CurrentDecorator(); + if (decor) { + ffStrbufAppendS(themeOrError, decor->Name().String()); + } + delete util; + if (decor) { + return true; + } + } + + ffStrbufAppendS(themeOrError, "Failed to get DecorInfo"); + return false; +} diff --git a/src/detection/wmtheme/wmtheme_linux.c b/src/detection/wmtheme/wmtheme_linux.c index 685ba5f5ef..e9123025d3 100644 --- a/src/detection/wmtheme/wmtheme_linux.c +++ b/src/detection/wmtheme/wmtheme_linux.c @@ -3,7 +3,7 @@ #include "common/properties.h" #include "common/parsing.h" #include "common/settings.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include "common/mallocHelper.h" #include "detection/gtk_qt/gtk_qt.h" #include "detection/displayserver/displayserver.h" @@ -180,6 +180,112 @@ static bool detectOpenbox(const FFstrbuf* dePrettyName, FFstrbuf* themeOrError) return false; } +static bool detectCosmicComp(FFstrbuf* themeOrError) { + FF_STRBUF_AUTO_DESTROY path = ffStrbufCreateCopy(FF_LIST_FIRST(FFstrbuf, instance.state.platform.configDirs)); + ffStrbufAppendS(&path, "cosmic/"); + uint32_t basePathLength = path.length; + + const char* variant; + { + char isDarkC; + ffStrbufAppendS(&path, "com.system76.CosmicTheme.Mode/v1/is_dark"); + if (ffReadFileData(path.chars, 1, &isDarkC) == 1) { + variant = isDarkC == 't' || isDarkC == '1' ? "Dark" : "Light"; + } else { + ffStrbufAppendF(themeOrError, "Couldn't read cosmic theme mode from %s", path.chars); + return false; + } + ffStrbufSubstrBefore(&path, basePathLength); + } + + FF_STRBUF_AUTO_DESTROY name = ffStrbufCreate(); + ffStrbufAppendF(&path, "com.system76.CosmicTheme.%s/v1/name", variant); + if (ffReadFileBuffer(path.chars, &name)) { + ffStrbufTrimSpace(&name); + ffStrbufTrim(&name, '"'); + } + ffStrbufSubstrBefore(&path, basePathLength); + + if (name.length > 0) { + ffStrbufAppend(themeOrError, &name); + } else { + ffStrbufAppendS(themeOrError, variant); + } + + FF_STRBUF_AUTO_DESTROY accent = ffStrbufCreate(); + ffStrbufAppendF(&path, "com.system76.CosmicTheme.%s/v1/accent", variant); + if (ffReadFileBuffer(path.chars, &accent)) { + const char* baseStart = strstr(accent.chars, "base:"); + if (baseStart != NULL) { + const char* contentStart = strchr(baseStart, '('); + if (contentStart != NULL) { + int depth = 1; + const char* contentEnd = contentStart + 1; + while (*contentEnd != '\0' && depth > 0) { + if (*contentEnd == '(') { + ++depth; + } else if (*contentEnd == ')') { + --depth; + } + ++contentEnd; + } + + if (depth == 0) { + double red = 0.0, green = 0.0, blue = 0.0, alpha = 1.0; + bool ok = true; + for (uint32_t i = 0; i < 4; ++i) { + const char* key = + i == 0 ? "red:" : (i == 1 ? "green:" : (i == 2 ? "blue:" : "alpha:")); + const char* componentStart = strstr(contentStart, key); + if (componentStart == NULL || componentStart >= contentEnd) { + ok = false; + break; + } + + componentStart += strlen(key); + char* componentEnd = NULL; + double value = strtod(componentStart, &componentEnd); + if (componentEnd == componentStart) { + ok = false; + break; + } + + if (i == 0) { + red = value; + } else if (i == 1) { + green = value; + } else if (i == 2) { + blue = value; + } else { + alpha = value; + } + } + + if (ok) { + uint32_t r = red <= 0.0 ? 0 : (red >= 1.0 ? 255 : (uint32_t) (red * 255.0 + 0.5)); + uint32_t g = green <= 0.0 ? 0 : (green >= 1.0 ? 255 : (uint32_t) (green * 255.0 + 0.5)); + uint32_t b = blue <= 0.0 ? 0 : (blue >= 1.0 ? 255 : (uint32_t) (blue * 255.0 + 0.5)); + uint32_t a = alpha <= 0.0 ? 0 : (alpha >= 1.0 ? 255 : (uint32_t) (alpha * 255.0 + 0.5)); + uint32_t rgb = (r << 16) | (g << 8) | b; + if (a == 255) { + ffStrbufAppendF(themeOrError, " - #%06X", rgb); + } else { + ffStrbufAppendF(themeOrError, " - #%06X%02X", rgb, a); + } + } + } + } + } + } + ffStrbufSubstrBefore(&path, basePathLength); + + if (name.length > 0) { + ffStrbufAppendF(themeOrError, " (%s)", variant); + } + + return true; +} + bool ffDetectWmTheme(FFstrbuf* themeOrError) { const FFDisplayServerResult* wm = ffConnectDisplayServer(); @@ -192,6 +298,10 @@ bool ffDetectWmTheme(FFstrbuf* themeOrError) { return detectWMThemeFromConfigFile("kwinrc", "theme =", "Breeze", themeOrError); } + if (ffStrbufIgnCaseEqualS(&wm->wmPrettyName, FF_WM_PRETTY_COSMIC_COMP)) { + return detectCosmicComp(themeOrError); + } + if ( ffStrbufIgnCaseEqualS(&wm->wmPrettyName, FF_WM_PRETTY_XFWM4) || (ffStrbufIgnCaseEqualS(&wm->wmPrettyName, "labwc") && ffStrbufIgnCaseEqualS(&wm->dePrettyName, FF_DE_PRETTY_XFCE4))) { diff --git a/src/fastfetch.c b/src/fastfetch.c index f8cdb55847..a82d853ebe 100644 --- a/src/fastfetch.c +++ b/src/fastfetch.c @@ -7,7 +7,7 @@ #include "common/io.h" #include "common/jsonconfig.h" #include "common/time.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include "common/mallocHelper.h" #include "fastfetch_datatext.h" diff --git a/src/fastfetch.h b/src/fastfetch.h index 7e79dc302d..ac9fa6c260 100644 --- a/src/fastfetch.h +++ b/src/fastfetch.h @@ -5,7 +5,7 @@ #include #include -#include "common/arrayUtils.h" +#include "common/arrutil.h" #include "common/FFstrbuf.h" #include "common/FFlist.h" #include "common/FFPlatform.h" @@ -21,6 +21,12 @@ typedef struct FFconfig { FFOptionsGeneral general; } FFconfig; +typedef struct FFLogoLineCacheState { + FFlist lines; + uint32_t nextLine; + uint32_t rightOffset; +} FFLogoLineCacheState; + typedef struct FFstate { uint32_t logoWidth; uint32_t logoHeight; @@ -29,6 +35,7 @@ typedef struct FFstate { bool titleFqdn; uint32_t dynamicInterval; FFPlatform platform; + FFLogoLineCacheState logoLineCache; } FFstate; typedef struct FFinstance { diff --git a/src/fastfetch_datatext.h.in b/src/fastfetch_datatext.h.in index 5c73b9d498..127db626e6 100644 --- a/src/fastfetch_datatext.h.in +++ b/src/fastfetch_datatext.h.in @@ -1,4 +1,4 @@ #pragma once #define FASTFETCH_DATATEXT_JSON_HELP @DATATEXT_JSON_HELP@ -#define FASTFETCH_DATATEXT_STRUCTURE @DATATEXT_STRUCTURE@ +#define FASTFETCH_DATATEXT_STRUCTURE "@DEFAULT_STRUCTURE@" diff --git a/src/flashfetch.c b/src/flashfetch.c index 81502b9e93..e056ca29cd 100644 --- a/src/flashfetch.c +++ b/src/flashfetch.c @@ -23,7 +23,7 @@ int main(void) { ffStart(); // Print logo - ffLogoPrint(); + ffLogoPrintDetected(FF_LOGO_SIZE_NORMAL); // Print all modules { diff --git a/src/logo/ascii/unknown.txt b/src/logo/ascii/_/unknown.txt similarity index 100% rename from src/logo/ascii/unknown.txt rename to src/logo/ascii/_/unknown.txt diff --git a/src/logo/ascii/a.inc b/src/logo/ascii/a.inc new file mode 100644 index 0000000000..848cad1dca --- /dev/null +++ b/src/logo/ascii/a.inc @@ -0,0 +1,881 @@ +#include "../logo.h" +#include "logo_builtin.h" +#include "common/color.h" + +static const FFlogo A[] = { + #ifdef FASTFETCH_DATATEXT_LOGO_ADELIE + // Adélie + { + .names = { "Adélie", "Adelie" }, + .lines = FASTFETCH_DATATEXT_LOGO_ADELIE, + .colors = { + FF_COLOR_FG_BLUE, + FF_COLOR_FG_WHITE, + FF_COLOR_FG_CYAN, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_AEROS + // AerOS + { + .names = { "aerOS" }, + .lines = FASTFETCH_DATATEXT_LOGO_AEROS, + .colors = { + FF_COLOR_FG_CYAN, + FF_COLOR_FG_CYAN, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_AEON + // Aeon + { + .names = { "Aeon" }, + .lines = FASTFETCH_DATATEXT_LOGO_AEON, + .colors = { + FF_COLOR_FG_256 "36", + FF_COLOR_FG_256 "36", + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_AERYNOS + // AerynOS + { + .names = { "AerynOS" }, + .lines = FASTFETCH_DATATEXT_LOGO_AERYNOS, + .colors = { + FF_COLOR_FG_GREEN, + FF_COLOR_FG_YELLOW, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_AERYNOS_OLD + // AerynOS_old + { + .names = { "AerynOS_old" }, + .lines = FASTFETCH_DATATEXT_LOGO_AERYNOS_OLD, + .type = FF_LOGO_LINE_TYPE_ALTER_BIT, + .colors = { + FF_COLOR_FG_DEFAULT, + FF_COLOR_FG_MAGENTA, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_AFTERGLOW + // Afterglow + { + .names = { "Afterglow" }, + .lines = FASTFETCH_DATATEXT_LOGO_AFTERGLOW, + .colors = { + FF_COLOR_FG_MAGENTA, + FF_COLOR_FG_RED, + FF_COLOR_FG_YELLOW, + FF_COLOR_FG_BLUE, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_AIX + // AIX + { + .names = { "aix" }, + .lines = FASTFETCH_DATATEXT_LOGO_AIX, + .colors = { + FF_COLOR_FG_GREEN, + FF_COLOR_FG_WHITE, + }, + .colorKeys = FF_COLOR_FG_GREEN, + .colorTitle = FF_COLOR_FG_DEFAULT, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_ALMALINUX + // AlmaLinux + { + .names = { "Almalinux" }, + .lines = FASTFETCH_DATATEXT_LOGO_ALMALINUX, + .colors = { + FF_COLOR_FG_RED, + FF_COLOR_FG_LIGHT_YELLOW, + FF_COLOR_FG_BLUE, + FF_COLOR_FG_LIGHT_GREEN, + FF_COLOR_FG_CYAN, + }, + .colorKeys = FF_COLOR_FG_YELLOW, + .colorTitle = FF_COLOR_FG_RED, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_ALPINE + // Alpine + { + .names = { "Alpine" }, + .lines = FASTFETCH_DATATEXT_LOGO_ALPINE, + .colors = { + FF_COLOR_FG_BLUE, + }, + .colorKeys = FF_COLOR_FG_MAGENTA, + .colorTitle = FF_COLOR_FG_BLUE, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_ALPINE2 + // Alpine2 + { + .names = { "Alpine2" }, + .lines = FASTFETCH_DATATEXT_LOGO_ALPINE2, + .type = FF_LOGO_LINE_TYPE_ALTER_BIT, + .colors = { + FF_COLOR_FG_BLUE, + FF_COLOR_FG_WHITE, + }, + .colorKeys = FF_COLOR_FG_BLUE, + .colorTitle = FF_COLOR_FG_BLUE, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_ALPINE_SMALL + // AlpineSmall + { + .names = { "Alpine_small" }, + .type = FF_LOGO_LINE_TYPE_SMALL_BIT, + .lines = FASTFETCH_DATATEXT_LOGO_ALPINE_SMALL, + .colors = { + FF_COLOR_FG_BLUE, + FF_COLOR_FG_WHITE, + }, + .colorKeys = FF_COLOR_FG_MAGENTA, + .colorTitle = FF_COLOR_FG_BLUE, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_ALPINE2_SMALL + // Alpine2Small + { + .names = { "alpine2_small" }, + .type = FF_LOGO_LINE_TYPE_SMALL_BIT | FF_LOGO_LINE_TYPE_ALTER_BIT, + .lines = FASTFETCH_DATATEXT_LOGO_ALPINE2_SMALL, + .colors = { + FF_COLOR_FG_BLUE, + FF_COLOR_FG_WHITE, + }, + .colorKeys = FF_COLOR_FG_MAGENTA, + .colorTitle = FF_COLOR_FG_BLUE, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_ALPINE3_SMALL + // Alpine3Small + { + .names = { "alpine3_small" }, + .type = FF_LOGO_LINE_TYPE_SMALL_BIT | FF_LOGO_LINE_TYPE_ALTER_BIT, + .lines = FASTFETCH_DATATEXT_LOGO_ALPINE3_SMALL, + .colors = { + FF_COLOR_FG_DEFAULT, + }, + .colorKeys = FF_COLOR_FG_BLUE, + .colorTitle = FF_COLOR_FG_BLUE, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_ALTER + // Alter + { + .names = { "Alter" }, + .lines = FASTFETCH_DATATEXT_LOGO_ALTER, + .colors = { + FF_COLOR_FG_CYAN, + }, + .colorKeys = FF_COLOR_FG_CYAN, + .colorTitle = FF_COLOR_FG_CYAN, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_ALTLINUX + // ALTLinux + { + .names = { "ALTLinux" }, + .lines = FASTFETCH_DATATEXT_LOGO_ALTLINUX, + .colors = { + FF_COLOR_FG_YELLOW, + FF_COLOR_FG_BLACK, + FF_COLOR_FG_WHITE, + }, + .colorKeys = FF_COLOR_FG_YELLOW, + .colorTitle = FF_COLOR_FG_YELLOW, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_AMAZON + // Amazon + { + .names = { "Amazon" }, + .lines = FASTFETCH_DATATEXT_LOGO_AMAZON, + .colors = { + FF_COLOR_FG_YELLOW, + FF_COLOR_FG_WHITE, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_AMAZON_LINUX + // AmazonLinux + { + .names = { "Amazon Linux", "amzn" }, + .lines = FASTFETCH_DATATEXT_LOGO_AMAZON_LINUX, + .colors = { + FF_COLOR_FG_WHITE, + FF_COLOR_FG_256 "178", + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_AMIGA + // Amiga + { + .names = { "Amiga" }, + .lines = FASTFETCH_DATATEXT_LOGO_AMIGA, + .colors = { + FF_COLOR_FG_RED, + FF_COLOR_FG_LIGHT_RED, + FF_COLOR_FG_YELLOW, + FF_COLOR_FG_BLUE, + FF_COLOR_FG_CYAN, + FF_COLOR_FG_LIGHT_YELLOW, + FF_COLOR_FG_GREEN, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_AMOGOS + // AmogOS + { + .names = { "AmogOS" }, + .lines = FASTFETCH_DATATEXT_LOGO_AMOGOS, + .colors = { + FF_COLOR_FG_WHITE, + FF_COLOR_FG_CYAN, + }, + .colorKeys = FF_COLOR_FG_DEFAULT, + .colorTitle = FF_COLOR_FG_CYAN, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_ANARCHY + // Anarchy + { + .names = { "Anarchy" }, + .lines = FASTFETCH_DATATEXT_LOGO_ANARCHY, + .colors = { + FF_COLOR_FG_WHITE, + FF_COLOR_FG_BLUE, + }, + .colorKeys = FF_COLOR_FG_DEFAULT, + .colorTitle = FF_COLOR_FG_BLUE, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_ANDROID + // Android + { + .names = { "android" }, + .lines = FASTFETCH_DATATEXT_LOGO_ANDROID, + .colors = { + FF_COLOR_FG_GREEN, + FF_COLOR_FG_WHITE, + }, + .colorKeys = FF_COLOR_FG_GREEN, + .colorTitle = FF_COLOR_FG_GREEN, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_ANDROID_SMALL + // AndroidSmall + { + .names = { "android_small" }, + .type = FF_LOGO_LINE_TYPE_SMALL_BIT, + .lines = FASTFETCH_DATATEXT_LOGO_ANDROID_SMALL, + .colors = { + FF_COLOR_FG_GREEN, + }, + .colorKeys = FF_COLOR_FG_GREEN, + .colorTitle = FF_COLOR_FG_GREEN, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_ANDUINOS + // AnduinOS + { + .names = { "anduinos" }, + .lines = FASTFETCH_DATATEXT_LOGO_ANDUINOS, + .colors = { + FF_COLOR_FG_CYAN, + FF_COLOR_FG_BLUE, + }, + .colorKeys = FF_COLOR_FG_BLUE, + .colorTitle = FF_COLOR_FG_DEFAULT, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_ANTERGOS + // Antergos + { + .names = { "Antergos" }, + .lines = FASTFETCH_DATATEXT_LOGO_ANTERGOS, + .colors = { + FF_COLOR_FG_BLUE, + FF_COLOR_FG_CYAN, + }, + .colorKeys = FF_COLOR_FG_BLUE, + .colorTitle = FF_COLOR_FG_CYAN, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_ANTIX + // Antix + { + .names = { "antiX" }, + .lines = FASTFETCH_DATATEXT_LOGO_ANTIX, + .colors = { + FF_COLOR_FG_RED, + }, + .colorKeys = FF_COLOR_FG_RED, + .colorTitle = FF_COLOR_FG_DEFAULT, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_ANUSHOS + // AnushOS + { + .names = { "AnushOS" }, + .lines = FASTFETCH_DATATEXT_LOGO_ANUSHOS, + .colors = { + FF_COLOR_FG_WHITE, + FF_COLOR_FG_BLACK, + FF_COLOR_FG_YELLOW, + FF_COLOR_FG_CYAN, + FF_COLOR_FG_RED, + }, + .colorKeys = FF_COLOR_FG_DEFAULT, + .colorTitle = FF_COLOR_FG_DEFAULT, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_AOSCOSRETRO + // AoscOsRetro + { + .names = { "Aosc OS/Retro", "aoscosretro" }, + .lines = FASTFETCH_DATATEXT_LOGO_AOSCOSRETRO, + .colors = { + FF_COLOR_FG_BLUE, + FF_COLOR_FG_WHITE, + }, + .colorKeys = FF_COLOR_FG_BLUE, + .colorTitle = FF_COLOR_FG_DEFAULT, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_AOSCOSRETRO_SMALL + // AoscOsRetro_small + { + .names = { "Aosc OS/Retro_small", "aoscosretro_small" }, + .type = FF_LOGO_LINE_TYPE_SMALL_BIT, + .lines = FASTFETCH_DATATEXT_LOGO_AOSCOSRETRO_SMALL, + .colors = { + FF_COLOR_FG_BLUE, + FF_COLOR_FG_WHITE, + }, + .colorKeys = FF_COLOR_FG_BLUE, + .colorTitle = FF_COLOR_FG_DEFAULT, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_AOSCOS + // AoscOS + { + .names = { "Aosc OS", "aoscos" }, + .lines = FASTFETCH_DATATEXT_LOGO_AOSCOS, + .colors = { + FF_COLOR_FG_BLUE, + FF_COLOR_FG_BLACK, + FF_COLOR_FG_RED, + FF_COLOR_FG_YELLOW, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_AOSCOS_OLD + // AoscOS_old + { + .names = { "Aosc OS_old", "aoscos_old" }, + .lines = FASTFETCH_DATATEXT_LOGO_AOSCOS_OLD, + .type = FF_LOGO_LINE_TYPE_ALTER_BIT, + .colors = { + FF_COLOR_FG_DEFAULT, + }, + .colorKeys = FF_COLOR_FG_BLUE, + .colorTitle = FF_COLOR_FG_DEFAULT, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_APERTURE + // Aperture + { + .names = { "Aperture" }, + .lines = FASTFETCH_DATATEXT_LOGO_APERTURE, + .colors = { + FF_COLOR_FG_CYAN, + FF_COLOR_FG_CYAN, + FF_COLOR_FG_CYAN, + FF_COLOR_FG_CYAN, + FF_COLOR_FG_CYAN, + FF_COLOR_FG_CYAN, + FF_COLOR_FG_CYAN, + FF_COLOR_FG_CYAN, + }, + .colorKeys = FF_COLOR_FG_CYAN, + .colorTitle = FF_COLOR_FG_DEFAULT, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_MACOS + // Apple + { + .names = { "Apple" }, + .lines = FASTFETCH_DATATEXT_LOGO_MACOS, + .colors = { + FF_COLOR_FG_GREEN, + FF_COLOR_FG_YELLOW, + FF_COLOR_FG_LIGHT_RED, + FF_COLOR_FG_RED, + FF_COLOR_FG_MAGENTA, + FF_COLOR_FG_BLUE, + }, + .colorKeys = FF_COLOR_FG_YELLOW, + .colorTitle = FF_COLOR_FG_GREEN, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_MACOS_SMALL + // AppleSmall + { + .names = { "Apple_small" }, + .type = FF_LOGO_LINE_TYPE_SMALL_BIT, + .lines = FASTFETCH_DATATEXT_LOGO_MACOS_SMALL, + .colors = { + FF_COLOR_FG_GREEN, + FF_COLOR_FG_YELLOW, + FF_COLOR_FG_RED, + FF_COLOR_FG_MAGENTA, + FF_COLOR_FG_BLUE, + }, + .colorKeys = FF_COLOR_FG_YELLOW, + .colorTitle = FF_COLOR_FG_GREEN, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_APRICITY + // Apricity + { + .names = { "Apricity" }, + .lines = FASTFETCH_DATATEXT_LOGO_APRICITY, + .colors = { + FF_COLOR_FG_DEFAULT, + }, + .colorKeys = FF_COLOR_FG_BLUE, + .colorTitle = FF_COLOR_FG_DEFAULT, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_ARCHBOX + // ArchBox + { + .names = { "ArchBox" }, + .lines = FASTFETCH_DATATEXT_LOGO_ARCHBOX, + .colors = { + FF_COLOR_FG_GREEN, + }, + .colorKeys = FF_COLOR_FG_GREEN, + .colorTitle = FF_COLOR_FG_DEFAULT, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_ARCHCRAFT + // Archcraft + { + .names = { "Archcraft" }, + .lines = FASTFETCH_DATATEXT_LOGO_ARCHCRAFT, + .colors = { + FF_COLOR_FG_CYAN, + }, + .colorKeys = FF_COLOR_FG_CYAN, + .colorTitle = FF_COLOR_FG_RED, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_ARCHCRAFT2 + // Archcraft2 + { + .names = { "Archcraft2" }, + .type = FF_LOGO_LINE_TYPE_ALTER_BIT, + .lines = FASTFETCH_DATATEXT_LOGO_ARCHCRAFT2, + .colors = { + FF_COLOR_FG_CYAN, + }, + .colorKeys = FF_COLOR_FG_CYAN, + .colorTitle = FF_COLOR_FG_RED, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_ARCH + // Arch + { + .names = { "arch", "archmerge" }, + .lines = FASTFETCH_DATATEXT_LOGO_ARCH, + .colors = { + FF_COLOR_FG_CYAN, + FF_COLOR_FG_CYAN, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_ARCH2 + // Arch2 + { + .names = { "arch2" }, + .type = FF_LOGO_LINE_TYPE_ALTER_BIT, + .lines = FASTFETCH_DATATEXT_LOGO_ARCH2, + .colors = { + FF_COLOR_FG_CYAN, + FF_COLOR_FG_CYAN, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_ARCH3 + // Arch3 + { + .names = { "arch3" }, + .type = FF_LOGO_LINE_TYPE_ALTER_BIT, + .lines = FASTFETCH_DATATEXT_LOGO_ARCH3, + .colors = { + FF_COLOR_FG_CYAN, + FF_COLOR_FG_CYAN, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_ARCH_SMALL + // ArchSmall + { + .names = { "arch_small" }, + .type = FF_LOGO_LINE_TYPE_SMALL_BIT, + .lines = FASTFETCH_DATATEXT_LOGO_ARCH_SMALL, + .colors = { + FF_COLOR_FG_CYAN, + FF_COLOR_FG_CYAN, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_ARCH_OLD + // ArchOld + { + .names = { "arch_old" }, + .type = FF_LOGO_LINE_TYPE_ALTER_BIT, + .lines = FASTFETCH_DATATEXT_LOGO_ARCH_OLD, + .colors = { + FF_COLOR_FG_BLUE, + FF_COLOR_FG_WHITE, + }, + .colorTitle = FF_COLOR_FG_DEFAULT, + .colorKeys = FF_COLOR_FG_BLUE, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_ARCHLABS + // Archlabs + { + .names = { "ARCHlabs" }, + .lines = FASTFETCH_DATATEXT_LOGO_ARCHLABS, + .colors = { + FF_COLOR_FG_CYAN, + FF_COLOR_FG_RED, + }, + .colorKeys = FF_COLOR_FG_CYAN, + .colorTitle = FF_COLOR_FG_RED, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_ARCHSTRIKE + // ArchStrike + { + .names = { "ArchStrike" }, + .lines = FASTFETCH_DATATEXT_LOGO_ARCHSTRIKE, + .colors = { + FF_COLOR_FG_CYAN, + FF_COLOR_FG_BLACK, + }, + .colorKeys = FF_COLOR_FG_CYAN, + .colorTitle = FF_COLOR_FG_CYAN, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_ARKANE + // Arkane + { + .names = { "Arkane", "Arkane Linux" }, + .lines = FASTFETCH_DATATEXT_LOGO_ARKANE, + .colors = { + FF_COLOR_FG_256 "237", + FF_COLOR_FG_256 "130", + FF_COLOR_FG_WHITE, + }, + .colorKeys = FF_COLOR_FG_256 "130", + .colorTitle = FF_COLOR_FG_DEFAULT, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_ARMBIAN + // Armbian + { + .names = { "Armbian" }, + .lines = FASTFETCH_DATATEXT_LOGO_ARMBIAN, + .colors = { + FF_COLOR_FG_WHITE, + FF_COLOR_FG_RED, + }, + .colorKeys = FF_COLOR_FG_DEFAULT, + .colorTitle = FF_COLOR_FG_RED, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_ARMBIAN2 + // Armbian2 + { + .names = { "Armbian2" }, + .type = FF_LOGO_LINE_TYPE_ALTER_BIT, + .lines = FASTFETCH_DATATEXT_LOGO_ARMBIAN2, + .colors = { + FF_COLOR_FG_RED, + }, + .colorKeys = FF_COLOR_FG_DEFAULT, + .colorTitle = FF_COLOR_FG_RED, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_ARTIX + // Artix + { + .names = { "artix" }, + .lines = FASTFETCH_DATATEXT_LOGO_ARTIX, + .colors = { + FF_COLOR_FG_CYAN, + }, + .colorKeys = FF_COLOR_FG_CYAN, + .colorTitle = FF_COLOR_FG_CYAN, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_ARTIX_SMALL + // ArtixSmall + { + .names = { "artix_small" }, + .type = FF_LOGO_LINE_TYPE_SMALL_BIT, + .lines = FASTFETCH_DATATEXT_LOGO_ARTIX_SMALL, + .colors = { + FF_COLOR_FG_CYAN, + }, + .colorKeys = FF_COLOR_FG_CYAN, + .colorTitle = FF_COLOR_FG_CYAN, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_ARTIX2_SMALL + // Artix2Small + { + .names = { "artix2_small" }, + .type = FF_LOGO_LINE_TYPE_SMALL_BIT | FF_LOGO_LINE_TYPE_ALTER_BIT, + .lines = FASTFETCH_DATATEXT_LOGO_ARTIX2_SMALL, + .colors = { + FF_COLOR_FG_CYAN, + }, + .colorKeys = FF_COLOR_FG_CYAN, + .colorTitle = FF_COLOR_FG_CYAN, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_ARCO + // ArcoLinux (Discontinued) + { + .names = { "arco", "arcolinux" }, // ID=arcolinux + .lines = FASTFETCH_DATATEXT_LOGO_ARCO, + .colors = { + FF_COLOR_FG_BLUE, + FF_COLOR_FG_WHITE, + }, + .colorKeys = FF_COLOR_FG_BLUE, + .colorTitle = FF_COLOR_FG_BLUE, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_ARCO_SMALL + // ArcoLinuxSmall + { + .names = { "arco_small", "arcolinux_small" }, + .type = FF_LOGO_LINE_TYPE_SMALL_BIT, + .lines = FASTFETCH_DATATEXT_LOGO_ARCO_SMALL, + .colors = { + FF_COLOR_FG_BLUE, + FF_COLOR_FG_WHITE, + }, + .colorKeys = FF_COLOR_FG_BLUE, + .colorTitle = FF_COLOR_FG_BLUE, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_ARSELINUX + // ArseLinux + { + .names = { "arse", "arselinux", "arse-linux" }, + .lines = FASTFETCH_DATATEXT_LOGO_ARSELINUX, + .colors = { + FF_COLOR_FG_BLUE, + FF_COLOR_FG_WHITE, + }, + .colorKeys = FF_COLOR_FG_BLUE, + .colorTitle = FF_COLOR_FG_DEFAULT, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_ARYA + // Arya + { + .names = { "Arya" }, + .lines = FASTFETCH_DATATEXT_LOGO_ARYA, + .colors = { + FF_COLOR_FG_GREEN, + FF_COLOR_FG_RED, + }, + .colorKeys = FF_COLOR_FG_GREEN, + .colorTitle = FF_COLOR_FG_RED, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_ASAHI + // Asahi + { + .names = { "asahi", "asahi-linux" }, + .lines = FASTFETCH_DATATEXT_LOGO_ASAHI, + .colors = { + FF_COLOR_FG_YELLOW, + FF_COLOR_FG_GREEN, + FF_COLOR_FG_RED, + FF_COLOR_FG_LIGHT_BLACK, + FF_COLOR_FG_WHITE, + FF_COLOR_FG_CYAN, + FF_COLOR_FG_BLUE, + }, + .colorKeys = FF_COLOR_FG_YELLOW, + .colorTitle = FF_COLOR_FG_GREEN, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_ASAHI2 + // Asahi2 + { + .names = { "asahi2", "asahi-linux2" }, + .lines = FASTFETCH_DATATEXT_LOGO_ASAHI2, + .type = FF_LOGO_LINE_TYPE_ALTER_BIT, + .colors = { + FF_COLOR_FG_LIGHT_YELLOW, + FF_COLOR_FG_CYAN, + FF_COLOR_FG_RED, + FF_COLOR_FG_LIGHT_RED, + FF_COLOR_FG_WHITE, + FF_COLOR_FG_BLACK, + FF_COLOR_FG_LIGHT_CYAN, + }, + .colorKeys = FF_COLOR_FG_YELLOW, + .colorTitle = FF_COLOR_FG_GREEN, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_ASTER + // Aster + { + .names = { "aster" }, + .lines = FASTFETCH_DATATEXT_LOGO_ASTER, + .colors = { + FF_COLOR_FG_CYAN, + }, + .colorKeys = FF_COLOR_FG_CYAN, + .colorTitle = FF_COLOR_FG_CYAN, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_ASTEROIDOS + // AsteroidOS + { + .names = { "AsteroidOS" }, + .lines = FASTFETCH_DATATEXT_LOGO_ASTEROIDOS, + .colors = { + FF_COLOR_FG_256 "160", + FF_COLOR_FG_256 "208", + FF_COLOR_FG_256 "202", + FF_COLOR_FG_256 "214", + }, + .colorKeys = FF_COLOR_FG_256 "160", + .colorTitle = FF_COLOR_FG_256 "208", + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_ASTOS + // AstOS + { + .names = { "astOS" }, + .lines = FASTFETCH_DATATEXT_LOGO_ASTOS, + .colors = { + FF_COLOR_FG_DEFAULT, + }, + .colorKeys = FF_COLOR_FG_DEFAULT, + .colorTitle = FF_COLOR_FG_DEFAULT, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_ASTRA_LINUX + // Astra + { + .names = { "Astra", "Astra Linux", "astralinux" }, + .lines = FASTFETCH_DATATEXT_LOGO_ASTRA_LINUX, + .colors = { + FF_COLOR_FG_LIGHT_RED, + FF_COLOR_FG_WHITE, + }, + .colorKeys = FF_COLOR_FG_RED, + .colorTitle = FF_COLOR_FG_DEFAULT, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_JANUSLINUX + // Ataraxia + { + .names = { "Ataraxia Linux", "Ataraxia" }, + .lines = FASTFETCH_DATATEXT_LOGO_JANUSLINUX, + .colors = { + FF_COLOR_FG_BLUE, + FF_COLOR_FG_MAGENTA, + }, + .colorKeys = FF_COLOR_FG_BLUE, + .colorTitle = FF_COLOR_FG_MAGENTA, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_ATHENAOS + // AthenaOS + { + .names = { "AthenaOS" }, + .lines = FASTFETCH_DATATEXT_LOGO_ATHENAOS, + .colors = { + FF_COLOR_FG_BLUE, + FF_COLOR_FG_LIGHT_BLUE, + }, + .colorKeys = FF_COLOR_FG_BLUE, + .colorTitle = FF_COLOR_FG_LIGHT_BLUE, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_ATHENAOS_OLD + // AthenaOS_old + { + .names = { "AthenaOS_old" }, + .lines = FASTFETCH_DATATEXT_LOGO_ATHENAOS_OLD, + .type = FF_LOGO_LINE_TYPE_ALTER_BIT, + .colors = { + FF_COLOR_FG_WHITE, + FF_COLOR_FG_YELLOW, + }, + .colorKeys = FF_COLOR_FG_YELLOW, + .colorTitle = FF_COLOR_FG_DEFAULT, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_AURORA + // Aurora + { + .names = { "Aurora" }, + .lines = FASTFETCH_DATATEXT_LOGO_AURORA, + .colors = { + FF_COLOR_FG_BLUE, + FF_COLOR_FG_MAGENTA, + FF_COLOR_FG_RED, + FF_COLOR_FG_WHITE, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_AXOS + // AxOS + { + .names = { "AxOS" }, + .lines = FASTFETCH_DATATEXT_LOGO_AXOS, + .colors = { + FF_COLOR_FG_RGB "222;6;255", + FF_COLOR_FG_RGB "222;6;255", + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_AZOS + // Azos + { + .names = { "Azos" }, + .lines = FASTFETCH_DATATEXT_LOGO_AZOS, + .colors = { + FF_COLOR_FG_CYAN, + FF_COLOR_FG_RED, + }, + }, + #endif + // LAST + {}, +}; diff --git a/src/logo/ascii/adelie.txt b/src/logo/ascii/a/adelie.txt similarity index 100% rename from src/logo/ascii/adelie.txt rename to src/logo/ascii/a/adelie.txt diff --git a/src/logo/ascii/aeon.txt b/src/logo/ascii/a/aeon.txt similarity index 100% rename from src/logo/ascii/aeon.txt rename to src/logo/ascii/a/aeon.txt diff --git a/src/logo/ascii/aeros.txt b/src/logo/ascii/a/aeros.txt similarity index 100% rename from src/logo/ascii/aeros.txt rename to src/logo/ascii/a/aeros.txt diff --git a/src/logo/ascii/aerynos.txt b/src/logo/ascii/a/aerynos.txt similarity index 100% rename from src/logo/ascii/aerynos.txt rename to src/logo/ascii/a/aerynos.txt diff --git a/src/logo/ascii/aerynos_old.txt b/src/logo/ascii/a/aerynos_old.txt similarity index 100% rename from src/logo/ascii/aerynos_old.txt rename to src/logo/ascii/a/aerynos_old.txt diff --git a/src/logo/ascii/afterglow.txt b/src/logo/ascii/a/afterglow.txt similarity index 100% rename from src/logo/ascii/afterglow.txt rename to src/logo/ascii/a/afterglow.txt diff --git a/src/logo/ascii/aix.txt b/src/logo/ascii/a/aix.txt similarity index 100% rename from src/logo/ascii/aix.txt rename to src/logo/ascii/a/aix.txt diff --git a/src/logo/ascii/almalinux.txt b/src/logo/ascii/a/almalinux.txt similarity index 100% rename from src/logo/ascii/almalinux.txt rename to src/logo/ascii/a/almalinux.txt diff --git a/src/logo/ascii/alpine.txt b/src/logo/ascii/a/alpine.txt similarity index 100% rename from src/logo/ascii/alpine.txt rename to src/logo/ascii/a/alpine.txt diff --git a/src/logo/ascii/alpine2.txt b/src/logo/ascii/a/alpine2.txt similarity index 100% rename from src/logo/ascii/alpine2.txt rename to src/logo/ascii/a/alpine2.txt diff --git a/src/logo/ascii/alpine2_small.txt b/src/logo/ascii/a/alpine2_small.txt similarity index 100% rename from src/logo/ascii/alpine2_small.txt rename to src/logo/ascii/a/alpine2_small.txt diff --git a/src/logo/ascii/alpine3_small.txt b/src/logo/ascii/a/alpine3_small.txt similarity index 100% rename from src/logo/ascii/alpine3_small.txt rename to src/logo/ascii/a/alpine3_small.txt diff --git a/src/logo/ascii/alpine_small.txt b/src/logo/ascii/a/alpine_small.txt similarity index 100% rename from src/logo/ascii/alpine_small.txt rename to src/logo/ascii/a/alpine_small.txt diff --git a/src/logo/ascii/alter.txt b/src/logo/ascii/a/alter.txt similarity index 100% rename from src/logo/ascii/alter.txt rename to src/logo/ascii/a/alter.txt diff --git a/src/logo/ascii/altlinux.txt b/src/logo/ascii/a/altlinux.txt similarity index 100% rename from src/logo/ascii/altlinux.txt rename to src/logo/ascii/a/altlinux.txt diff --git a/src/logo/ascii/amazon.txt b/src/logo/ascii/a/amazon.txt similarity index 100% rename from src/logo/ascii/amazon.txt rename to src/logo/ascii/a/amazon.txt diff --git a/src/logo/ascii/amazon_linux.txt b/src/logo/ascii/a/amazon_linux.txt similarity index 100% rename from src/logo/ascii/amazon_linux.txt rename to src/logo/ascii/a/amazon_linux.txt diff --git a/src/logo/ascii/amiga.txt b/src/logo/ascii/a/amiga.txt similarity index 100% rename from src/logo/ascii/amiga.txt rename to src/logo/ascii/a/amiga.txt diff --git a/src/logo/ascii/amogos.txt b/src/logo/ascii/a/amogos.txt similarity index 100% rename from src/logo/ascii/amogos.txt rename to src/logo/ascii/a/amogos.txt diff --git a/src/logo/ascii/anarchy.txt b/src/logo/ascii/a/anarchy.txt similarity index 100% rename from src/logo/ascii/anarchy.txt rename to src/logo/ascii/a/anarchy.txt diff --git a/src/logo/ascii/android.txt b/src/logo/ascii/a/android.txt similarity index 100% rename from src/logo/ascii/android.txt rename to src/logo/ascii/a/android.txt diff --git a/src/logo/ascii/android_small.txt b/src/logo/ascii/a/android_small.txt similarity index 100% rename from src/logo/ascii/android_small.txt rename to src/logo/ascii/a/android_small.txt diff --git a/src/logo/ascii/anduinos.txt b/src/logo/ascii/a/anduinos.txt similarity index 100% rename from src/logo/ascii/anduinos.txt rename to src/logo/ascii/a/anduinos.txt diff --git a/src/logo/ascii/antergos.txt b/src/logo/ascii/a/antergos.txt similarity index 100% rename from src/logo/ascii/antergos.txt rename to src/logo/ascii/a/antergos.txt diff --git a/src/logo/ascii/antix.txt b/src/logo/ascii/a/antix.txt similarity index 100% rename from src/logo/ascii/antix.txt rename to src/logo/ascii/a/antix.txt diff --git a/src/logo/ascii/anushos.txt b/src/logo/ascii/a/anushos.txt similarity index 100% rename from src/logo/ascii/anushos.txt rename to src/logo/ascii/a/anushos.txt diff --git a/src/logo/ascii/aoscos.txt b/src/logo/ascii/a/aoscos.txt similarity index 100% rename from src/logo/ascii/aoscos.txt rename to src/logo/ascii/a/aoscos.txt diff --git a/src/logo/ascii/aoscos_old.txt b/src/logo/ascii/a/aoscos_old.txt similarity index 100% rename from src/logo/ascii/aoscos_old.txt rename to src/logo/ascii/a/aoscos_old.txt diff --git a/src/logo/ascii/aoscosretro.txt b/src/logo/ascii/a/aoscosretro.txt similarity index 100% rename from src/logo/ascii/aoscosretro.txt rename to src/logo/ascii/a/aoscosretro.txt diff --git a/src/logo/ascii/aoscosretro_small.txt b/src/logo/ascii/a/aoscosretro_small.txt similarity index 100% rename from src/logo/ascii/aoscosretro_small.txt rename to src/logo/ascii/a/aoscosretro_small.txt diff --git a/src/logo/ascii/aperture.txt b/src/logo/ascii/a/aperture.txt similarity index 100% rename from src/logo/ascii/aperture.txt rename to src/logo/ascii/a/aperture.txt diff --git a/src/logo/ascii/apricity.txt b/src/logo/ascii/a/apricity.txt similarity index 100% rename from src/logo/ascii/apricity.txt rename to src/logo/ascii/a/apricity.txt diff --git a/src/logo/ascii/arch.txt b/src/logo/ascii/a/arch.txt similarity index 100% rename from src/logo/ascii/arch.txt rename to src/logo/ascii/a/arch.txt diff --git a/src/logo/ascii/arch2.txt b/src/logo/ascii/a/arch2.txt similarity index 100% rename from src/logo/ascii/arch2.txt rename to src/logo/ascii/a/arch2.txt diff --git a/src/logo/ascii/arch3.txt b/src/logo/ascii/a/arch3.txt similarity index 100% rename from src/logo/ascii/arch3.txt rename to src/logo/ascii/a/arch3.txt diff --git a/src/logo/ascii/arch_old.txt b/src/logo/ascii/a/arch_old.txt similarity index 100% rename from src/logo/ascii/arch_old.txt rename to src/logo/ascii/a/arch_old.txt diff --git a/src/logo/ascii/arch_small.txt b/src/logo/ascii/a/arch_small.txt similarity index 100% rename from src/logo/ascii/arch_small.txt rename to src/logo/ascii/a/arch_small.txt diff --git a/src/logo/ascii/archbox.txt b/src/logo/ascii/a/archbox.txt similarity index 100% rename from src/logo/ascii/archbox.txt rename to src/logo/ascii/a/archbox.txt diff --git a/src/logo/ascii/archcraft.txt b/src/logo/ascii/a/archcraft.txt similarity index 100% rename from src/logo/ascii/archcraft.txt rename to src/logo/ascii/a/archcraft.txt diff --git a/src/logo/ascii/archcraft2.txt b/src/logo/ascii/a/archcraft2.txt similarity index 100% rename from src/logo/ascii/archcraft2.txt rename to src/logo/ascii/a/archcraft2.txt diff --git a/src/logo/ascii/archlabs.txt b/src/logo/ascii/a/archlabs.txt similarity index 100% rename from src/logo/ascii/archlabs.txt rename to src/logo/ascii/a/archlabs.txt diff --git a/src/logo/ascii/archstrike.txt b/src/logo/ascii/a/archstrike.txt similarity index 100% rename from src/logo/ascii/archstrike.txt rename to src/logo/ascii/a/archstrike.txt diff --git a/src/logo/ascii/arco.txt b/src/logo/ascii/a/arco.txt similarity index 100% rename from src/logo/ascii/arco.txt rename to src/logo/ascii/a/arco.txt diff --git a/src/logo/ascii/arco_small.txt b/src/logo/ascii/a/arco_small.txt similarity index 100% rename from src/logo/ascii/arco_small.txt rename to src/logo/ascii/a/arco_small.txt diff --git a/src/logo/ascii/arkane.txt b/src/logo/ascii/a/arkane.txt similarity index 100% rename from src/logo/ascii/arkane.txt rename to src/logo/ascii/a/arkane.txt diff --git a/src/logo/ascii/armbian.txt b/src/logo/ascii/a/armbian.txt similarity index 100% rename from src/logo/ascii/armbian.txt rename to src/logo/ascii/a/armbian.txt diff --git a/src/logo/ascii/armbian2.txt b/src/logo/ascii/a/armbian2.txt similarity index 100% rename from src/logo/ascii/armbian2.txt rename to src/logo/ascii/a/armbian2.txt diff --git a/src/logo/ascii/arselinux.txt b/src/logo/ascii/a/arselinux.txt similarity index 100% rename from src/logo/ascii/arselinux.txt rename to src/logo/ascii/a/arselinux.txt diff --git a/src/logo/ascii/artix.txt b/src/logo/ascii/a/artix.txt similarity index 100% rename from src/logo/ascii/artix.txt rename to src/logo/ascii/a/artix.txt diff --git a/src/logo/ascii/artix2.txt b/src/logo/ascii/a/artix2.txt similarity index 100% rename from src/logo/ascii/artix2.txt rename to src/logo/ascii/a/artix2.txt diff --git a/src/logo/ascii/artix2_small.txt b/src/logo/ascii/a/artix2_small.txt similarity index 100% rename from src/logo/ascii/artix2_small.txt rename to src/logo/ascii/a/artix2_small.txt diff --git a/src/logo/ascii/artix_small.txt b/src/logo/ascii/a/artix_small.txt similarity index 100% rename from src/logo/ascii/artix_small.txt rename to src/logo/ascii/a/artix_small.txt diff --git a/src/logo/ascii/arya.txt b/src/logo/ascii/a/arya.txt similarity index 100% rename from src/logo/ascii/arya.txt rename to src/logo/ascii/a/arya.txt diff --git a/src/logo/ascii/asahi.txt b/src/logo/ascii/a/asahi.txt similarity index 100% rename from src/logo/ascii/asahi.txt rename to src/logo/ascii/a/asahi.txt diff --git a/src/logo/ascii/asahi2.txt b/src/logo/ascii/a/asahi2.txt similarity index 100% rename from src/logo/ascii/asahi2.txt rename to src/logo/ascii/a/asahi2.txt diff --git a/src/logo/ascii/aster.txt b/src/logo/ascii/a/aster.txt similarity index 100% rename from src/logo/ascii/aster.txt rename to src/logo/ascii/a/aster.txt diff --git a/src/logo/ascii/asteroidos.txt b/src/logo/ascii/a/asteroidos.txt similarity index 100% rename from src/logo/ascii/asteroidos.txt rename to src/logo/ascii/a/asteroidos.txt diff --git a/src/logo/ascii/astos.txt b/src/logo/ascii/a/astos.txt similarity index 100% rename from src/logo/ascii/astos.txt rename to src/logo/ascii/a/astos.txt diff --git a/src/logo/ascii/astra_linux.txt b/src/logo/ascii/a/astra_linux.txt similarity index 100% rename from src/logo/ascii/astra_linux.txt rename to src/logo/ascii/a/astra_linux.txt diff --git a/src/logo/ascii/athenaos.txt b/src/logo/ascii/a/athenaos.txt similarity index 100% rename from src/logo/ascii/athenaos.txt rename to src/logo/ascii/a/athenaos.txt diff --git a/src/logo/ascii/athenaos_old.txt b/src/logo/ascii/a/athenaos_old.txt similarity index 100% rename from src/logo/ascii/athenaos_old.txt rename to src/logo/ascii/a/athenaos_old.txt diff --git a/src/logo/ascii/aurora.txt b/src/logo/ascii/a/aurora.txt similarity index 100% rename from src/logo/ascii/aurora.txt rename to src/logo/ascii/a/aurora.txt diff --git a/src/logo/ascii/axos.txt b/src/logo/ascii/a/axos.txt similarity index 100% rename from src/logo/ascii/axos.txt rename to src/logo/ascii/a/axos.txt diff --git a/src/logo/ascii/azos.txt b/src/logo/ascii/a/azos.txt similarity index 100% rename from src/logo/ascii/azos.txt rename to src/logo/ascii/a/azos.txt diff --git a/src/logo/ascii/b.inc b/src/logo/ascii/b.inc new file mode 100644 index 0000000000..2844655323 --- /dev/null +++ b/src/logo/ascii/b.inc @@ -0,0 +1,218 @@ +#include "../logo.h" +#include "logo_builtin.h" +#include "common/color.h" + +static const FFlogo B[] = { + #ifdef FASTFETCH_DATATEXT_LOGO_BEDROCK + // Bedrock + { + .names = { "bedrock" }, + .lines = FASTFETCH_DATATEXT_LOGO_BEDROCK, + .colors = { + FF_COLOR_FG_LIGHT_BLACK, // grey + FF_COLOR_FG_DEFAULT, + }, + .colorKeys = FF_COLOR_FG_LIGHT_BLACK, // grey + .colorTitle = FF_COLOR_FG_DEFAULT, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_BEDROCK_SMALL + // BedrockSmall + { + .names = { "bedrock_small" }, + .lines = FASTFETCH_DATATEXT_LOGO_BEDROCK_SMALL, + .type = FF_LOGO_LINE_TYPE_SMALL_BIT, + .colors = { + FF_COLOR_FG_LIGHT_BLACK, // grey + FF_COLOR_FG_DEFAULT, + }, + .colorKeys = FF_COLOR_FG_LIGHT_BLACK, // grey + .colorTitle = FF_COLOR_FG_DEFAULT, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_BERSERKARCH + // BerserkArch + { + .names = { "BerserkArch" }, + .lines = FASTFETCH_DATATEXT_LOGO_BERSERKARCH, + .colors = { + FF_COLOR_FG_BLUE, + FF_COLOR_FG_DEFAULT, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_BIGLINUX + // BigLinux + { + .names = { "BigLinux" }, + .lines = FASTFETCH_DATATEXT_LOGO_BIGLINUX, + .colors = { + FF_COLOR_FG_CYAN, + FF_COLOR_FG_YELLOW, + FF_COLOR_FG_BLUE, + }, + .colorKeys = FF_COLOR_FG_YELLOW, + .colorTitle = FF_COLOR_FG_CYAN, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_BITRIG + // Bitrig + { + .names = { "Bitrig" }, + .lines = FASTFETCH_DATATEXT_LOGO_BITRIG, + .colors = { + FF_COLOR_FG_GREEN, + }, + .colorKeys = FF_COLOR_FG_DEFAULT, + .colorTitle = FF_COLOR_FG_GREEN, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_BLACKARCH + // BlackArch + { + .names = { "Blackarch" }, + .lines = FASTFETCH_DATATEXT_LOGO_BLACKARCH, + .colors = { + FF_COLOR_FG_RED, + FF_COLOR_FG_LIGHT_RED, + FF_COLOR_FG_BLACK, + }, + .colorKeys = FF_COLOR_FG_LIGHT_RED, + .colorTitle = FF_COLOR_FG_RED, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_BLACKMESA + // BlackMesa + { + .names = { "BlackMesa", "black-mesa" }, + .lines = FASTFETCH_DATATEXT_LOGO_BLACKMESA, + .colors = { + FF_COLOR_FG_BLACK, + }, + .colorKeys = FF_COLOR_FG_BLACK, + .colorTitle = FF_COLOR_FG_DEFAULT, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_BLACKPANTHER + // BlackPanther + { + .names = { "BlackPanther" }, + .lines = FASTFETCH_DATATEXT_LOGO_BLACKPANTHER, + .colors = { + FF_COLOR_FG_RED, + FF_COLOR_FG_YELLOW, + FF_COLOR_FG_LIGHT_BLUE, + }, + .colorKeys = FF_COLOR_FG_RED, + .colorTitle = FF_COLOR_FG_YELLOW, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_BLAG + // BLAG + { + .names = { "BLAG" }, + .lines = FASTFETCH_DATATEXT_LOGO_BLAG, + .colors = { + FF_COLOR_FG_MAGENTA, + }, + .colorKeys = FF_COLOR_FG_MAGENTA, + .colorTitle = FF_COLOR_FG_DEFAULT, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_BLANKON + // BlankOn + { + .names = { "BlankOn" }, + .lines = FASTFETCH_DATATEXT_LOGO_BLANKON, + .colors = { + FF_COLOR_FG_RED, + FF_COLOR_FG_WHITE, + }, + .colorKeys = FF_COLOR_FG_RED, + .colorTitle = FF_COLOR_FG_DEFAULT, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_BLUELIGHT + // BlueLight + { + .names = { "BlueLight" }, + .lines = FASTFETCH_DATATEXT_LOGO_BLUELIGHT, + .colors = { + FF_COLOR_FG_WHITE, + FF_COLOR_FG_BLUE, + }, + .colorKeys = FF_COLOR_FG_DEFAULT, + .colorTitle = FF_COLOR_FG_BLUE, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_BODHI + // Bodhi + { + .names = { "Bodhi" }, + .lines = FASTFETCH_DATATEXT_LOGO_BODHI, + .colors = { + FF_COLOR_FG_WHITE, + FF_COLOR_FG_LIGHT_YELLOW, + FF_COLOR_FG_GREEN, + }, + .colorKeys = FF_COLOR_FG_YELLOW, + .colorTitle = FF_COLOR_FG_GREEN, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_BONSAI + // Bonsai + { + .names = { "Bonsai" }, + .lines = FASTFETCH_DATATEXT_LOGO_BONSAI, + .colors = { + FF_COLOR_FG_CYAN, + FF_COLOR_FG_GREEN, + FF_COLOR_FG_YELLOW, + }, + .colorKeys = FF_COLOR_FG_CYAN, + .colorTitle = FF_COLOR_FG_GREEN, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_BREDOS + // BredOS + { + .names = { "Bredos" }, + .lines = FASTFETCH_DATATEXT_LOGO_BREDOS, + .colors = { + FF_COLOR_FG_RGB "198;151;66", // grey + }, + .colorKeys = FF_COLOR_FG_RGB "198;151;66", + .colorTitle = FF_COLOR_FG_RGB "198;151;66", + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_BSD + // BSD + { + .names = { "BSD" }, + .lines = FASTFETCH_DATATEXT_LOGO_BSD, + .colors = { + FF_COLOR_FG_RED, + FF_COLOR_FG_WHITE, + FF_COLOR_FG_BLUE, + FF_COLOR_FG_YELLOW, + FF_COLOR_FG_CYAN, + }, + .colorKeys = FF_COLOR_FG_RED, + .colorTitle = FF_COLOR_FG_DEFAULT, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_BUNSENLABS + // BunsenLabs + { + .names = { "BunsenLabs" }, + .lines = FASTFETCH_DATATEXT_LOGO_BUNSENLABS, + .colors = { + FF_COLOR_FG_DEFAULT, + }, + .colorKeys = FF_COLOR_FG_DEFAULT, + .colorTitle = FF_COLOR_FG_DEFAULT, + }, + #endif + // LAST + {}, +}; diff --git a/src/logo/ascii/bedrock.txt b/src/logo/ascii/b/bedrock.txt similarity index 100% rename from src/logo/ascii/bedrock.txt rename to src/logo/ascii/b/bedrock.txt diff --git a/src/logo/ascii/bedrock_small.txt b/src/logo/ascii/b/bedrock_small.txt similarity index 100% rename from src/logo/ascii/bedrock_small.txt rename to src/logo/ascii/b/bedrock_small.txt diff --git a/src/logo/ascii/b/berserkarch.txt b/src/logo/ascii/b/berserkarch.txt new file mode 100644 index 0000000000..90128afab9 --- /dev/null +++ b/src/logo/ascii/b/berserkarch.txt @@ -0,0 +1,21 @@ + .~?5P^ + :&@#Y~..!^ :^ + 7@&: ^JPP!!55#!~YB#7. + ^: !&@&.?&GJ5G##G&@@@@@@J:. + JP. @@#?#@&#@&5&@@@@@@@@@@G!: + ^PP: :#@&@@@@@@&#G&B#&@@@@@@@@&5^ + ~J Y@@@@&&@@@@@@#~Y@@@@@@@@@@@@@&Y. +:G .@@@PJ&@&&@@@&BP#@@@@@@@@@@@@@@??~ +5: .&@BG&@7J@@@!. .:!J&@@@@@@@@@@~ .. +? . :B@@@&BG@@@@!. .&@@@@@@@@@@~ +~ ?&&@&@#Y~^^: !#@@@@@@@@@@B. +. J&7:&@@^ ^@@@@@@@@@@&!G. + .&G~. J@@@@@@@@@@@# ! + . . ^YG@@@@@@@@@@@@!? + P. : ~#B&@@@@@@@@@@@B#@@. + Y@: ?&B@@@@@@@@@@@@&G?~P@@B + .?#5. .Y&@@@@@@@@@@&####BGB@@@@Y + !#G^ Y@@@@@@@@@@BP#&@@@@@@@@&!B^ + B@@#Y5##&&&@@@@@#&@@@@@@@@@#! ^ + ^YG#@@@@@@@@@@@@@@@@@@@@#J: + .~#@@@@@@@@@&&BP?^ \ No newline at end of file diff --git a/src/logo/ascii/biglinux.txt b/src/logo/ascii/b/biglinux.txt similarity index 100% rename from src/logo/ascii/biglinux.txt rename to src/logo/ascii/b/biglinux.txt diff --git a/src/logo/ascii/bitrig.txt b/src/logo/ascii/b/bitrig.txt similarity index 100% rename from src/logo/ascii/bitrig.txt rename to src/logo/ascii/b/bitrig.txt diff --git a/src/logo/ascii/blackarch.txt b/src/logo/ascii/b/blackarch.txt similarity index 100% rename from src/logo/ascii/blackarch.txt rename to src/logo/ascii/b/blackarch.txt diff --git a/src/logo/ascii/blackmesa.txt b/src/logo/ascii/b/blackmesa.txt similarity index 100% rename from src/logo/ascii/blackmesa.txt rename to src/logo/ascii/b/blackmesa.txt diff --git a/src/logo/ascii/blackpanther.txt b/src/logo/ascii/b/blackpanther.txt similarity index 100% rename from src/logo/ascii/blackpanther.txt rename to src/logo/ascii/b/blackpanther.txt diff --git a/src/logo/ascii/blag.txt b/src/logo/ascii/b/blag.txt similarity index 100% rename from src/logo/ascii/blag.txt rename to src/logo/ascii/b/blag.txt diff --git a/src/logo/ascii/blankon.txt b/src/logo/ascii/b/blankon.txt similarity index 100% rename from src/logo/ascii/blankon.txt rename to src/logo/ascii/b/blankon.txt diff --git a/src/logo/ascii/bluelight.txt b/src/logo/ascii/b/bluelight.txt similarity index 100% rename from src/logo/ascii/bluelight.txt rename to src/logo/ascii/b/bluelight.txt diff --git a/src/logo/ascii/bodhi.txt b/src/logo/ascii/b/bodhi.txt similarity index 100% rename from src/logo/ascii/bodhi.txt rename to src/logo/ascii/b/bodhi.txt diff --git a/src/logo/ascii/bonsai.txt b/src/logo/ascii/b/bonsai.txt similarity index 100% rename from src/logo/ascii/bonsai.txt rename to src/logo/ascii/b/bonsai.txt diff --git a/src/logo/ascii/bredos.txt b/src/logo/ascii/b/bredos.txt similarity index 100% rename from src/logo/ascii/bredos.txt rename to src/logo/ascii/b/bredos.txt diff --git a/src/logo/ascii/bsd.txt b/src/logo/ascii/b/bsd.txt similarity index 100% rename from src/logo/ascii/bsd.txt rename to src/logo/ascii/b/bsd.txt diff --git a/src/logo/ascii/bunsenlabs.txt b/src/logo/ascii/b/bunsenlabs.txt similarity index 100% rename from src/logo/ascii/bunsenlabs.txt rename to src/logo/ascii/b/bunsenlabs.txt diff --git a/src/logo/ascii/c.inc b/src/logo/ascii/c.inc new file mode 100644 index 0000000000..2cf1a4a2aa --- /dev/null +++ b/src/logo/ascii/c.inc @@ -0,0 +1,515 @@ +#include "../logo.h" +#include "logo_builtin.h" +#include "common/color.h" + +static const FFlogo C[] = { + #ifdef FASTFETCH_DATATEXT_LOGO_CACHYOS + // CachyOS + { + .names = { "CachyOS" }, + .lines = FASTFETCH_DATATEXT_LOGO_CACHYOS, + .colors = { + FF_COLOR_FG_CYAN, + FF_COLOR_FG_GREEN, + FF_COLOR_FG_BLACK, + }, + .colorKeys = FF_COLOR_FG_CYAN, + .colorTitle = FF_COLOR_FG_CYAN, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_CACHYOS_SMALL + // CachyOSSmall + { + .names = { "CachyOS_small" }, + .type = FF_LOGO_LINE_TYPE_SMALL_BIT, + .lines = FASTFETCH_DATATEXT_LOGO_CACHYOS_SMALL, + .colors = { + FF_COLOR_FG_CYAN, + }, + .colorKeys = FF_COLOR_FG_CYAN, + .colorTitle = FF_COLOR_FG_CYAN, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_CALCULATE + // Calculate + { + .names = { "Calculate" }, + .lines = FASTFETCH_DATATEXT_LOGO_CALCULATE, + .colors = { + FF_COLOR_FG_WHITE, + FF_COLOR_FG_YELLOW, + }, + .colorKeys = FF_COLOR_FG_YELLOW, + .colorTitle = FF_COLOR_FG_DEFAULT, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_CALINIXOS + // CalinixOS + { + .names = { "Calinix", "calinixos" }, + .lines = FASTFETCH_DATATEXT_LOGO_CALINIXOS, + .colors = { + FF_COLOR_FG_MAGENTA, + }, + .colorKeys = FF_COLOR_FG_MAGENTA, + .colorTitle = FF_COLOR_FG_BLUE, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_CALINIXOS_SMALL + // CalinixOSSmall + { + .names = { "Calinix_small", "calinixos_small" }, + .type = FF_LOGO_LINE_TYPE_SMALL_BIT, + .lines = FASTFETCH_DATATEXT_LOGO_CALINIXOS_SMALL, + .colors = { + FF_COLOR_FG_MAGENTA, + }, + .colorKeys = FF_COLOR_FG_MAGENTA, + .colorTitle = FF_COLOR_FG_BLUE, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_CARBS + // Carbs + { + .names = { "Carbs" }, + .lines = FASTFETCH_DATATEXT_LOGO_CARBS, + .colors = { + FF_COLOR_FG_MAGENTA, + }, + .colorKeys = FF_COLOR_FG_MAGENTA, + .colorTitle = FF_COLOR_FG_BLUE, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_CBL_MARINER + // CBL-Mariner + { + .names = { "CBL-Mariner" }, + .lines = FASTFETCH_DATATEXT_LOGO_CBL_MARINER, + .colors = { + FF_COLOR_FG_CYAN, + }, + .colorKeys = FF_COLOR_FG_CYAN, + .colorTitle = FF_COLOR_FG_CYAN, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_CELOS + // CelOS + { + .names = { "Cel", "celos", "cel-linux", "celos-linux" }, + .lines = FASTFETCH_DATATEXT_LOGO_CELOS, + .colors = { + FF_COLOR_FG_MAGENTA, + FF_COLOR_FG_BLACK, + }, + .colorKeys = FF_COLOR_FG_CYAN, + .colorTitle = FF_COLOR_FG_BLUE, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_CENTER + // Center + { + .names = { "Center" }, + .lines = FASTFETCH_DATATEXT_LOGO_CENTER, + .colors = { + FF_COLOR_FG_DEFAULT, + }, + .colorKeys = FF_COLOR_FG_DEFAULT, + .colorTitle = FF_COLOR_FG_DEFAULT, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_CENTOS + // CentOS + { + .names = { "CentOS" }, + .lines = FASTFETCH_DATATEXT_LOGO_CENTOS, + .colors = { + FF_COLOR_FG_YELLOW, + FF_COLOR_FG_GREEN, + FF_COLOR_FG_BLUE, + FF_COLOR_FG_MAGENTA, + FF_COLOR_FG_WHITE, + }, + .colorKeys = FF_COLOR_FG_GREEN, + .colorTitle = FF_COLOR_FG_YELLOW, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_CENTOS_SMALL + // CentOSSmall + { + .names = { "CentOS_small" }, + .type = FF_LOGO_LINE_TYPE_SMALL_BIT, + .lines = FASTFETCH_DATATEXT_LOGO_CENTOS_SMALL, + .colors = { + FF_COLOR_FG_YELLOW, + FF_COLOR_FG_GREEN, + FF_COLOR_FG_BLUE, + FF_COLOR_FG_MAGENTA, + }, + .colorKeys = FF_COLOR_FG_GREEN, + .colorTitle = FF_COLOR_FG_YELLOW, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_CEREUS + // Cereus + { + .names = { "Cereus", "Cereus Linux" }, + .lines = FASTFETCH_DATATEXT_LOGO_CEREUS, + .colors = { + FF_COLOR_FG_256 "173", + FF_COLOR_FG_256 "108", + FF_COLOR_FG_256 "71", + FF_COLOR_FG_256 "151", + FF_COLOR_FG_256 "72", + }, + .colorKeys = FF_COLOR_FG_256 "108", + .colorTitle = FF_COLOR_MODE_BOLD FF_COLOR_FG_WHITE, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_CHAKRA + // Chakra + { + .names = { "Chakra" }, + .lines = FASTFETCH_DATATEXT_LOGO_CHAKRA, + .colors = { + FF_COLOR_FG_BLUE, + }, + .colorKeys = FF_COLOR_FG_BLUE, + .colorTitle = FF_COLOR_FG_MAGENTA, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_CHALETOS + // ChaletOS + { + .names = { "ChaletOS" }, + .lines = FASTFETCH_DATATEXT_LOGO_CHALETOS, + .colors = { + FF_COLOR_FG_BLUE, + FF_COLOR_FG_WHITE, + }, + .colorKeys = FF_COLOR_FG_BLUE, + .colorTitle = FF_COLOR_FG_DEFAULT, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_CHAPEAU + // Chapeau + { + .names = { "Chapeau" }, + .lines = FASTFETCH_DATATEXT_LOGO_CHAPEAU, + .colors = { + FF_COLOR_FG_GREEN, + FF_COLOR_FG_WHITE, + }, + .colorKeys = FF_COLOR_FG_GREEN, + .colorTitle = FF_COLOR_FG_DEFAULT, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_CHIMERA_LINUX + // Chimera + { + .names = { "Chimera" }, + .lines = FASTFETCH_DATATEXT_LOGO_CHIMERA_LINUX, + .colors = { + FF_COLOR_FG_RED, + FF_COLOR_FG_MAGENTA, + FF_COLOR_FG_BLUE, + FF_COLOR_FG_RED, + }, + .colorKeys = FF_COLOR_FG_MAGENTA, + .colorTitle = FF_COLOR_FG_RED, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_CHONKYSEALOS + // ChonkySealOS + { + .names = { "ChonkySealOS" }, + .lines = FASTFETCH_DATATEXT_LOGO_CHONKYSEALOS, + .colors = { + FF_COLOR_FG_DEFAULT, + }, + .colorKeys = FF_COLOR_FG_DEFAULT, + .colorTitle = FF_COLOR_FG_DEFAULT, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_CHROM + // Chrom + { + .names = { "Chrom", "ChromeOS" }, + .lines = FASTFETCH_DATATEXT_LOGO_CHROM, + .colors = { + FF_COLOR_FG_GREEN, + FF_COLOR_FG_RED, + FF_COLOR_FG_YELLOW, + FF_COLOR_FG_BLUE, + FF_COLOR_FG_WHITE, + }, + .colorKeys = FF_COLOR_FG_GREEN, + .colorTitle = FF_COLOR_FG_RED, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_CLEANJARO + // Cleanjaro + { + .names = { "Cleanjaro" }, + .lines = FASTFETCH_DATATEXT_LOGO_CLEANJARO, + .colors = { + FF_COLOR_FG_DEFAULT, + }, + .colorKeys = FF_COLOR_FG_DEFAULT, + .colorTitle = FF_COLOR_FG_DEFAULT, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_CLEANJARO_SMALL + // CleanjaroSmall + { + .names = { "Cleanjaro_small" }, + .type = FF_LOGO_LINE_TYPE_SMALL_BIT, + .lines = FASTFETCH_DATATEXT_LOGO_CLEANJARO_SMALL, + .colors = { + FF_COLOR_FG_DEFAULT, + }, + .colorKeys = FF_COLOR_FG_DEFAULT, + .colorTitle = FF_COLOR_FG_DEFAULT, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_CLEAR_LINUX + // ClearLinux + { + .names = { "Clear Linux", "clearlinux", "Clear Linux OS" }, + .lines = FASTFETCH_DATATEXT_LOGO_CLEAR_LINUX, + .colors = { + FF_COLOR_FG_BLUE, + FF_COLOR_FG_YELLOW, + }, + .colorKeys = FF_COLOR_FG_BLUE, + .colorTitle = FF_COLOR_FG_YELLOW, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_CLEAROS + // ClearOS + { + .names = { "ClearOS" }, + .lines = FASTFETCH_DATATEXT_LOGO_CLEAROS, + .colors = { + FF_COLOR_FG_GREEN, + }, + .colorKeys = FF_COLOR_FG_GREEN, + .colorTitle = FF_COLOR_FG_GREEN, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_CLOVER + // Clover + { + .names = { "Clover" }, + .lines = FASTFETCH_DATATEXT_LOGO_CLOVER, + .colors = { + FF_COLOR_FG_GREEN, + FF_COLOR_FG_CYAN, + }, + .colorKeys = FF_COLOR_FG_GREEN, + .colorTitle = FF_COLOR_FG_CYAN, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_COBALT + // Cobalt + { + .names = { "Cobalt" }, + .lines = FASTFETCH_DATATEXT_LOGO_COBALT, + .colors = { + FF_COLOR_FG_BLUE, + FF_COLOR_FG_BLUE, + FF_COLOR_FG_LIGHT_BLACK, + FF_COLOR_FG_LIGHT_BLUE, + FF_COLOR_FG_BLACK, + }, + .colorKeys = FF_COLOR_FG_BLUE, + .colorTitle = FF_COLOR_FG_BLUE, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_CODEX + // Codex Linux (reMarkable OS) + { + .names = { "Codex Linux" }, + .lines = FASTFETCH_DATATEXT_LOGO_CODEX, + .colors = { + FF_COLOR_FG_WHITE, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_CONDRES + // Condres + { + .names = { "Condres" }, + .lines = FASTFETCH_DATATEXT_LOGO_CONDRES, + .colors = { + FF_COLOR_FG_GREEN, + FF_COLOR_FG_YELLOW, + FF_COLOR_FG_CYAN, + }, + .colorKeys = FF_COLOR_FG_GREEN, + .colorTitle = FF_COLOR_FG_YELLOW, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_FEDORA_COREOS + // ContainerLinux + { + .names = { "ContainerLinux", "Container Linux", "Container Linux by CoreOS" }, + .lines = FASTFETCH_DATATEXT_LOGO_FEDORA_COREOS, + .colors = { + FF_COLOR_FG_BLUE, + FF_COLOR_FG_WHITE, + FF_COLOR_FG_RED, + }, + .colorKeys = FF_COLOR_FG_BLUE, + .colorTitle = FF_COLOR_FG_DEFAULT, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_TORIZONCORE + // Common Torizon + { + .names = { "common-torizon" }, + .lines = FASTFETCH_DATATEXT_LOGO_TORIZONCORE, + .colors = { + FF_COLOR_FG_LIGHT_WHITE, + FF_COLOR_FG_YELLOW, + FF_COLOR_FG_BLUE, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_COSMIC + // Cosmic DE + { + .names = { "Cosmic" }, + .lines = FASTFETCH_DATATEXT_LOGO_COSMIC, + .colors = { + FF_COLOR_FG_WHITE, + FF_COLOR_FG_LIGHT_YELLOW, + FF_COLOR_FG_YELLOW, + FF_COLOR_FG_LIGHT_RED, + FF_COLOR_FG_RED, + }, + .colorKeys = FF_COLOR_FG_LIGHT_RED, + .colorTitle = FF_COLOR_FG_YELLOW, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_CRUX + // CRUX + { + .names = { "CRUX" }, + .lines = FASTFETCH_DATATEXT_LOGO_CRUX, + .colors = { + FF_COLOR_FG_BLUE, + FF_COLOR_FG_MAGENTA, + FF_COLOR_FG_WHITE, + }, + .colorKeys = FF_COLOR_FG_MAGENTA, + .colorTitle = FF_COLOR_FG_BLUE, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_CRUX_SMALL + // CRUXSmall + { + .names = { "CRUX_small" }, + .type = FF_LOGO_LINE_TYPE_SMALL_BIT, + .lines = FASTFETCH_DATATEXT_LOGO_CRUX_SMALL, + .colors = { + FF_COLOR_FG_BLUE, + FF_COLOR_FG_MAGENTA, + FF_COLOR_FG_WHITE, + }, + .colorKeys = FF_COLOR_FG_MAGENTA, + .colorTitle = FF_COLOR_FG_BLUE, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_CRYSTAL + // CrystalLinux + { + .names = { "Crystal", "Crystal", "crystal-linux", "Crystal-Linux" }, + .lines = FASTFETCH_DATATEXT_LOGO_CRYSTAL, + .colors = { + FF_COLOR_FG_MAGENTA, + }, + .colorKeys = FF_COLOR_FG_MAGENTA, + .colorTitle = FF_COLOR_FG_MAGENTA, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_CUCUMBER + // Cucumber + { + .names = { "Cucumber", "CucumberOS" }, + .lines = FASTFETCH_DATATEXT_LOGO_CUCUMBER, + .colors = { + FF_COLOR_FG_GREEN, + FF_COLOR_FG_YELLOW, + }, + .colorKeys = FF_COLOR_FG_GREEN, + .colorTitle = FF_COLOR_FG_YELLOW, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_CUERDOS + // CuerdOS + { + .names = { "CuerdOS", "CuerdOS GNU/Linux" }, + .lines = FASTFETCH_DATATEXT_LOGO_CUERDOS, + .colors = { + FF_COLOR_FG_YELLOW, + FF_COLOR_FG_GREEN, + }, + .colorKeys = FF_COLOR_FG_GREEN, + .colorTitle = FF_COLOR_FG_YELLOW, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_CUTEFISHOS + // CutefishOS + { + .names = { "CutefishOS" }, + .lines = FASTFETCH_DATATEXT_LOGO_CUTEFISHOS, + .colors = { + FF_COLOR_FG_CYAN, + FF_COLOR_FG_WHITE, + FF_COLOR_FG_BLUE, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_CUTEOS + // CuteOS + { + .names = { "CuteOS" }, + .lines = FASTFETCH_DATATEXT_LOGO_CUTEOS, + .colors = { + FF_COLOR_FG_BLUE, + FF_COLOR_FG_CYAN, + FF_COLOR_FG_256 "57", + }, + .colorKeys = FF_COLOR_FG_BLUE, + .colorTitle = FF_COLOR_FG_CYAN, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_CYBEROS + // CyberOS + { + .names = { "CyberOS" }, + .lines = FASTFETCH_DATATEXT_LOGO_CYBEROS, + .colors = { + FF_COLOR_FG_BLUE, + FF_COLOR_FG_CYAN, + FF_COLOR_FG_256 "57", + }, + .colorKeys = FF_COLOR_FG_BLUE, + .colorTitle = FF_COLOR_FG_CYAN, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_CYCLEDREAM + // cycledream + { + .names = { "cycledream" }, + .lines = FASTFETCH_DATATEXT_LOGO_CYCLEDREAM, + .colors = { + FF_COLOR_FG_MAGENTA, + }, + .colorKeys = FF_COLOR_FG_MAGENTA, + .colorTitle = FF_COLOR_FG_MAGENTA, + }, + #endif + // LAST + {}, +}; diff --git a/src/logo/ascii/cachyos.txt b/src/logo/ascii/c/cachyos.txt similarity index 100% rename from src/logo/ascii/cachyos.txt rename to src/logo/ascii/c/cachyos.txt diff --git a/src/logo/ascii/cachyos_small.txt b/src/logo/ascii/c/cachyos_small.txt similarity index 100% rename from src/logo/ascii/cachyos_small.txt rename to src/logo/ascii/c/cachyos_small.txt diff --git a/src/logo/ascii/calculate.txt b/src/logo/ascii/c/calculate.txt similarity index 100% rename from src/logo/ascii/calculate.txt rename to src/logo/ascii/c/calculate.txt diff --git a/src/logo/ascii/calinixos.txt b/src/logo/ascii/c/calinixos.txt similarity index 100% rename from src/logo/ascii/calinixos.txt rename to src/logo/ascii/c/calinixos.txt diff --git a/src/logo/ascii/calinixos_small.txt b/src/logo/ascii/c/calinixos_small.txt similarity index 100% rename from src/logo/ascii/calinixos_small.txt rename to src/logo/ascii/c/calinixos_small.txt diff --git a/src/logo/ascii/carbs.txt b/src/logo/ascii/c/carbs.txt similarity index 100% rename from src/logo/ascii/carbs.txt rename to src/logo/ascii/c/carbs.txt diff --git a/src/logo/ascii/cbl_mariner.txt b/src/logo/ascii/c/cbl_mariner.txt similarity index 100% rename from src/logo/ascii/cbl_mariner.txt rename to src/logo/ascii/c/cbl_mariner.txt diff --git a/src/logo/ascii/celos.txt b/src/logo/ascii/c/celos.txt similarity index 100% rename from src/logo/ascii/celos.txt rename to src/logo/ascii/c/celos.txt diff --git a/src/logo/ascii/center.txt b/src/logo/ascii/c/center.txt similarity index 100% rename from src/logo/ascii/center.txt rename to src/logo/ascii/c/center.txt diff --git a/src/logo/ascii/centos.txt b/src/logo/ascii/c/centos.txt similarity index 100% rename from src/logo/ascii/centos.txt rename to src/logo/ascii/c/centos.txt diff --git a/src/logo/ascii/centos_small.txt b/src/logo/ascii/c/centos_small.txt similarity index 100% rename from src/logo/ascii/centos_small.txt rename to src/logo/ascii/c/centos_small.txt diff --git a/src/logo/ascii/cereus.txt b/src/logo/ascii/c/cereus.txt similarity index 100% rename from src/logo/ascii/cereus.txt rename to src/logo/ascii/c/cereus.txt diff --git a/src/logo/ascii/chakra.txt b/src/logo/ascii/c/chakra.txt similarity index 100% rename from src/logo/ascii/chakra.txt rename to src/logo/ascii/c/chakra.txt diff --git a/src/logo/ascii/chaletos.txt b/src/logo/ascii/c/chaletos.txt similarity index 100% rename from src/logo/ascii/chaletos.txt rename to src/logo/ascii/c/chaletos.txt diff --git a/src/logo/ascii/chapeau.txt b/src/logo/ascii/c/chapeau.txt similarity index 100% rename from src/logo/ascii/chapeau.txt rename to src/logo/ascii/c/chapeau.txt diff --git a/src/logo/ascii/chimera_linux.txt b/src/logo/ascii/c/chimera_linux.txt similarity index 100% rename from src/logo/ascii/chimera_linux.txt rename to src/logo/ascii/c/chimera_linux.txt diff --git a/src/logo/ascii/chonkysealos.txt b/src/logo/ascii/c/chonkysealos.txt similarity index 100% rename from src/logo/ascii/chonkysealos.txt rename to src/logo/ascii/c/chonkysealos.txt diff --git a/src/logo/ascii/chrom.txt b/src/logo/ascii/c/chrom.txt similarity index 100% rename from src/logo/ascii/chrom.txt rename to src/logo/ascii/c/chrom.txt diff --git a/src/logo/ascii/cleanjaro.txt b/src/logo/ascii/c/cleanjaro.txt similarity index 100% rename from src/logo/ascii/cleanjaro.txt rename to src/logo/ascii/c/cleanjaro.txt diff --git a/src/logo/ascii/cleanjaro_small.txt b/src/logo/ascii/c/cleanjaro_small.txt similarity index 100% rename from src/logo/ascii/cleanjaro_small.txt rename to src/logo/ascii/c/cleanjaro_small.txt diff --git a/src/logo/ascii/clear_linux.txt b/src/logo/ascii/c/clear_linux.txt similarity index 100% rename from src/logo/ascii/clear_linux.txt rename to src/logo/ascii/c/clear_linux.txt diff --git a/src/logo/ascii/clearos.txt b/src/logo/ascii/c/clearos.txt similarity index 100% rename from src/logo/ascii/clearos.txt rename to src/logo/ascii/c/clearos.txt diff --git a/src/logo/ascii/clover.txt b/src/logo/ascii/c/clover.txt similarity index 100% rename from src/logo/ascii/clover.txt rename to src/logo/ascii/c/clover.txt diff --git a/src/logo/ascii/cobalt.txt b/src/logo/ascii/c/cobalt.txt similarity index 100% rename from src/logo/ascii/cobalt.txt rename to src/logo/ascii/c/cobalt.txt diff --git a/src/logo/ascii/codex.txt b/src/logo/ascii/c/codex.txt similarity index 100% rename from src/logo/ascii/codex.txt rename to src/logo/ascii/c/codex.txt diff --git a/src/logo/ascii/condres.txt b/src/logo/ascii/c/condres.txt similarity index 100% rename from src/logo/ascii/condres.txt rename to src/logo/ascii/c/condres.txt diff --git a/src/logo/ascii/cosmic.txt b/src/logo/ascii/c/cosmic.txt similarity index 100% rename from src/logo/ascii/cosmic.txt rename to src/logo/ascii/c/cosmic.txt diff --git a/src/logo/ascii/crux.txt b/src/logo/ascii/c/crux.txt similarity index 100% rename from src/logo/ascii/crux.txt rename to src/logo/ascii/c/crux.txt diff --git a/src/logo/ascii/crux_small.txt b/src/logo/ascii/c/crux_small.txt similarity index 100% rename from src/logo/ascii/crux_small.txt rename to src/logo/ascii/c/crux_small.txt diff --git a/src/logo/ascii/crystal.txt b/src/logo/ascii/c/crystal.txt similarity index 100% rename from src/logo/ascii/crystal.txt rename to src/logo/ascii/c/crystal.txt diff --git a/src/logo/ascii/cucumber.txt b/src/logo/ascii/c/cucumber.txt similarity index 100% rename from src/logo/ascii/cucumber.txt rename to src/logo/ascii/c/cucumber.txt diff --git a/src/logo/ascii/cuerdos.txt b/src/logo/ascii/c/cuerdos.txt similarity index 100% rename from src/logo/ascii/cuerdos.txt rename to src/logo/ascii/c/cuerdos.txt diff --git a/src/logo/ascii/cutefishos.txt b/src/logo/ascii/c/cutefishos.txt similarity index 100% rename from src/logo/ascii/cutefishos.txt rename to src/logo/ascii/c/cutefishos.txt diff --git a/src/logo/ascii/cuteos.txt b/src/logo/ascii/c/cuteos.txt similarity index 100% rename from src/logo/ascii/cuteos.txt rename to src/logo/ascii/c/cuteos.txt diff --git a/src/logo/ascii/cyberos.txt b/src/logo/ascii/c/cyberos.txt similarity index 100% rename from src/logo/ascii/cyberos.txt rename to src/logo/ascii/c/cyberos.txt diff --git a/src/logo/ascii/cycledream.txt b/src/logo/ascii/c/cycledream.txt similarity index 100% rename from src/logo/ascii/cycledream.txt rename to src/logo/ascii/c/cycledream.txt diff --git a/src/logo/ascii/d.inc b/src/logo/ascii/d.inc new file mode 100644 index 0000000000..f9acc5b6a0 --- /dev/null +++ b/src/logo/ascii/d.inc @@ -0,0 +1,206 @@ +#include "../logo.h" +#include "logo_builtin.h" +#include "common/color.h" + +static const FFlogo D[] = { + #ifdef FASTFETCH_DATATEXT_LOGO_DAHLIA + // DahliaOS + { + .names = { "dahliaOS" }, + .lines = FASTFETCH_DATATEXT_LOGO_DAHLIA, + .colors = { + FF_COLOR_FG_RED, + }, + .colorKeys = FF_COLOR_FG_RED, + .colorTitle = FF_COLOR_FG_DEFAULT, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_DARKOS + // DarkOS + { + .names = { "DarkOS" }, + .lines = FASTFETCH_DATATEXT_LOGO_DARKOS, + .colors = { + FF_COLOR_FG_RED, + FF_COLOR_FG_CYAN, + FF_COLOR_FG_MAGENTA, + FF_COLOR_FG_YELLOW, + FF_COLOR_FG_GREEN, + }, + .colorKeys = FF_COLOR_FG_RED, + .colorTitle = FF_COLOR_FG_CYAN, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_DEBIAN + // Debian + { + .names = { "Debian" }, + .lines = FASTFETCH_DATATEXT_LOGO_DEBIAN, + .colors = { + FF_COLOR_FG_RED, + FF_COLOR_FG_WHITE, + }, + .colorKeys = FF_COLOR_FG_RED, + .colorTitle = FF_COLOR_FG_RED, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_DEBIAN_SMALL + // DebianSmall + { + .names = { "Debian_small" }, + .type = FF_LOGO_LINE_TYPE_SMALL_BIT, + .lines = FASTFETCH_DATATEXT_LOGO_DEBIAN_SMALL, + .colors = { + FF_COLOR_FG_RED, + }, + .colorKeys = FF_COLOR_FG_RED, + .colorTitle = FF_COLOR_FG_RED, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_DEEPIN + // Deepin + { + .names = { "Deepin" }, + .lines = FASTFETCH_DATATEXT_LOGO_DEEPIN, + .colors = { + FF_COLOR_FG_BLUE, + }, + .colorKeys = FF_COLOR_FG_BLUE, + .colorTitle = FF_COLOR_FG_BLUE, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_DESAOS + // DesaOS + { + .names = { "DesaOS" }, + .lines = FASTFETCH_DATATEXT_LOGO_DESAOS, + .colors = { + FF_COLOR_FG_GREEN, + FF_COLOR_FG_WHITE, + }, + .colorKeys = FF_COLOR_FG_GREEN, + .colorTitle = FF_COLOR_FG_DEFAULT, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_DEVUAN + // Devuan + { + .names = { "Devuan" }, + .lines = FASTFETCH_DATATEXT_LOGO_DEVUAN, + .colors = { + FF_COLOR_FG_MAGENTA, + }, + .colorKeys = FF_COLOR_FG_MAGENTA, + .colorTitle = FF_COLOR_FG_MAGENTA, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_DEVUAN_SMALL + // DevuanSmall + { + .names = { "Devuan_small" }, + .type = FF_LOGO_LINE_TYPE_SMALL_BIT, + .lines = FASTFETCH_DATATEXT_LOGO_DEVUAN_SMALL, + .colors = { + FF_COLOR_FG_MAGENTA, + }, + .colorKeys = FF_COLOR_FG_MAGENTA, + .colorTitle = FF_COLOR_FG_MAGENTA, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_DIETPI + // DietPi + { + .names = { "DietPi" }, + .lines = FASTFETCH_DATATEXT_LOGO_DIETPI, + .colors = { + FF_COLOR_FG_GREEN, + FF_COLOR_FG_LIGHT_BLACK, + }, + .colorKeys = FF_COLOR_FG_LIGHT_BLACK, + .colorTitle = FF_COLOR_FG_GREEN, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_DRACOS + // DracOS + { + .names = { "DracOS" }, + .lines = FASTFETCH_DATATEXT_LOGO_DRACOS, + .colors = { + FF_COLOR_FG_RED, + FF_COLOR_FG_WHITE, + }, + .colorKeys = FF_COLOR_FG_RED, + .colorTitle = FF_COLOR_FG_DEFAULT, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_DRAGONFLY + // DragonFly + { + .names = { "DragonFly" }, + .lines = FASTFETCH_DATATEXT_LOGO_DRAGONFLY, + .colors = { + FF_COLOR_FG_RED, + FF_COLOR_FG_DEFAULT, + }, + .colorKeys = FF_COLOR_FG_RED, + .colorTitle = FF_COLOR_FG_DEFAULT, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_DRAGONFLY_SMALL + // DragonFlySmall + { + .names = { "DragonFly_small" }, + .type = FF_LOGO_LINE_TYPE_SMALL_BIT, + .lines = FASTFETCH_DATATEXT_LOGO_DRAGONFLY_SMALL, + .colors = { + FF_COLOR_FG_RED, + FF_COLOR_FG_DEFAULT, + }, + .colorKeys = FF_COLOR_FG_RED, + .colorTitle = FF_COLOR_FG_DEFAULT, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_DRAGONFLY_OLD + // DragonFlyOld + { + .names = { "DragonFly_old" }, + .type = FF_LOGO_LINE_TYPE_ALTER_BIT, + .lines = FASTFETCH_DATATEXT_LOGO_DRAGONFLY_OLD, + .colors = { + FF_COLOR_FG_RED, + FF_COLOR_FG_DEFAULT, + FF_COLOR_FG_YELLOW, + }, + .colorKeys = FF_COLOR_FG_RED, + .colorTitle = FF_COLOR_FG_DEFAULT, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_DRAUGER + // DraugerOS + { + .names = { "DraugerOS", "Drauger" }, + .lines = FASTFETCH_DATATEXT_LOGO_DRAUGER, + .colors = { + FF_COLOR_FG_RED, + FF_COLOR_FG_WHITE, + }, + .colorKeys = FF_COLOR_FG_RED, + .colorTitle = FF_COLOR_FG_DEFAULT, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_DROIDIAN + // Droidian + { + .names = { "Droidian" }, + .lines = FASTFETCH_DATATEXT_LOGO_DROIDIAN, + .colors = { + FF_COLOR_FG_GREEN, + FF_COLOR_FG_LIGHT_GREEN, + }, + .colorKeys = FF_COLOR_FG_GREEN, + .colorTitle = FF_COLOR_FG_LIGHT_GREEN, + }, + #endif + // LAST + {}, +}; diff --git a/src/logo/ascii/dahlia.txt b/src/logo/ascii/d/dahlia.txt similarity index 100% rename from src/logo/ascii/dahlia.txt rename to src/logo/ascii/d/dahlia.txt diff --git a/src/logo/ascii/darkos.txt b/src/logo/ascii/d/darkos.txt similarity index 100% rename from src/logo/ascii/darkos.txt rename to src/logo/ascii/d/darkos.txt diff --git a/src/logo/ascii/debian.txt b/src/logo/ascii/d/debian.txt similarity index 100% rename from src/logo/ascii/debian.txt rename to src/logo/ascii/d/debian.txt diff --git a/src/logo/ascii/debian_small.txt b/src/logo/ascii/d/debian_small.txt similarity index 100% rename from src/logo/ascii/debian_small.txt rename to src/logo/ascii/d/debian_small.txt diff --git a/src/logo/ascii/deepin.txt b/src/logo/ascii/d/deepin.txt similarity index 100% rename from src/logo/ascii/deepin.txt rename to src/logo/ascii/d/deepin.txt diff --git a/src/logo/ascii/desaos.txt b/src/logo/ascii/d/desaos.txt similarity index 100% rename from src/logo/ascii/desaos.txt rename to src/logo/ascii/d/desaos.txt diff --git a/src/logo/ascii/devuan.txt b/src/logo/ascii/d/devuan.txt similarity index 100% rename from src/logo/ascii/devuan.txt rename to src/logo/ascii/d/devuan.txt diff --git a/src/logo/ascii/devuan_small.txt b/src/logo/ascii/d/devuan_small.txt similarity index 100% rename from src/logo/ascii/devuan_small.txt rename to src/logo/ascii/d/devuan_small.txt diff --git a/src/logo/ascii/dietpi.txt b/src/logo/ascii/d/dietpi.txt similarity index 100% rename from src/logo/ascii/dietpi.txt rename to src/logo/ascii/d/dietpi.txt diff --git a/src/logo/ascii/dracos.txt b/src/logo/ascii/d/dracos.txt similarity index 100% rename from src/logo/ascii/dracos.txt rename to src/logo/ascii/d/dracos.txt diff --git a/src/logo/ascii/dragonfly.txt b/src/logo/ascii/d/dragonfly.txt similarity index 100% rename from src/logo/ascii/dragonfly.txt rename to src/logo/ascii/d/dragonfly.txt diff --git a/src/logo/ascii/dragonfly_old.txt b/src/logo/ascii/d/dragonfly_old.txt similarity index 100% rename from src/logo/ascii/dragonfly_old.txt rename to src/logo/ascii/d/dragonfly_old.txt diff --git a/src/logo/ascii/dragonfly_small.txt b/src/logo/ascii/d/dragonfly_small.txt similarity index 100% rename from src/logo/ascii/dragonfly_small.txt rename to src/logo/ascii/d/dragonfly_small.txt diff --git a/src/logo/ascii/drauger.txt b/src/logo/ascii/d/drauger.txt similarity index 100% rename from src/logo/ascii/drauger.txt rename to src/logo/ascii/d/drauger.txt diff --git a/src/logo/ascii/droidian.txt b/src/logo/ascii/d/droidian.txt similarity index 100% rename from src/logo/ascii/droidian.txt rename to src/logo/ascii/d/droidian.txt diff --git a/src/logo/ascii/e.inc b/src/logo/ascii/e.inc new file mode 100644 index 0000000000..3e5fd91081 --- /dev/null +++ b/src/logo/ascii/e.inc @@ -0,0 +1,256 @@ +#include "../logo.h" +#include "logo_builtin.h" +#include "common/color.h" + +static const FFlogo E[] = { + #ifdef FASTFETCH_DATATEXT_LOGO_ELBRUS + // Elbrus + { + .names = { "elbrus" }, + .lines = FASTFETCH_DATATEXT_LOGO_ELBRUS, + .colors = { + FF_COLOR_FG_BLUE, + }, + .colorKeys = FF_COLOR_FG_BLUE, + .colorTitle = FF_COLOR_FG_BLUE, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_ELEMENTARY + // Elementary + { + .names = { "Elementary" }, + .lines = FASTFETCH_DATATEXT_LOGO_ELEMENTARY, + .colors = { + FF_COLOR_FG_DEFAULT, + }, + .colorKeys = FF_COLOR_FG_BLUE, + .colorTitle = FF_COLOR_FG_DEFAULT, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_ELEMENTARY_SMALL + // ElementarySmall + { + .names = { "Elementary_small" }, + .type = FF_LOGO_LINE_TYPE_SMALL_BIT, + .lines = FASTFETCH_DATATEXT_LOGO_ELEMENTARY_SMALL, + .colors = { + FF_COLOR_FG_DEFAULT, + }, + .colorKeys = FF_COLOR_FG_BLUE, + .colorTitle = FF_COLOR_FG_DEFAULT, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_ELIVE + // Elive + { + .names = { "Elive" }, + .lines = FASTFETCH_DATATEXT_LOGO_ELIVE, + .colors = { + FF_COLOR_FG_WHITE, + FF_COLOR_FG_LIGHT_CYAN, + FF_COLOR_FG_CYAN, + }, + .colorKeys = FF_COLOR_FG_DEFAULT, + .colorTitle = FF_COLOR_FG_CYAN, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_EMMABUNTUS + // Emmabuntüs + { + .names = { "Emmabuntus" }, + .lines = FASTFETCH_DATATEXT_LOGO_EMMABUNTUS, + .colors = { + FF_COLOR_FG_BLUE, + FF_COLOR_FG_YELLOW, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_EMPEROROS + // EmperorOS + { + .names = { "Emperor" }, + .lines = FASTFETCH_DATATEXT_LOGO_EMPEROROS, + .colors = { + FF_COLOR_FG_YELLOW, + FF_COLOR_FG_DEFAULT, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_ENOS + // EN-OS + { + .names = { "ENOS" }, + .lines = FASTFETCH_DATATEXT_LOGO_ENOS, + .colors = { + FF_COLOR_FG_LIGHT_BLUE, + }, + .colorKeys = FF_COLOR_FG_LIGHT_BLUE, + .colorTitle = FF_COLOR_FG_LIGHT_BLUE, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_ENCRYPTOS + // EncryptOS + { + .names = { "EncryptOS" }, + .lines = FASTFETCH_DATATEXT_LOGO_ENCRYPTOS, + .colors = { + FF_COLOR_FG_MAGENTA, + }, + .colorKeys = FF_COLOR_FG_MAGENTA, + .colorTitle = FF_COLOR_FG_GREEN, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_ENDEAVOUROS + // EndeavourOS + { + .names = { "EndeavourOS" }, + .lines = FASTFETCH_DATATEXT_LOGO_ENDEAVOUROS, + .colors = { + FF_COLOR_FG_MAGENTA, + FF_COLOR_FG_RED, + FF_COLOR_FG_BLUE, + }, + .colorKeys = FF_COLOR_FG_MAGENTA, + .colorTitle = FF_COLOR_FG_RED, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_ENDEAVOUROS_SMALL + // EndeavourOSSmall + { + .names = { "EndeavourOS_small" }, + .type = FF_LOGO_LINE_TYPE_SMALL_BIT, + .lines = FASTFETCH_DATATEXT_LOGO_ENDEAVOUROS_SMALL, + .colors = { + FF_COLOR_FG_RED, + FF_COLOR_FG_MAGENTA, + FF_COLOR_FG_BLUE, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_ENDLESS + // Endless + { + .names = { "Endless" }, + .lines = FASTFETCH_DATATEXT_LOGO_ENDLESS, + .colors = { + FF_COLOR_FG_RED, + FF_COLOR_FG_WHITE, + }, + .colorKeys = FF_COLOR_FG_RED, + .colorTitle = FF_COLOR_FG_DEFAULT, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_ENSO + // Enso + { + .names = { "Enso" }, + .lines = FASTFETCH_DATATEXT_LOGO_ENSO, + .colors = { + FF_COLOR_FG_DEFAULT, + }, + .colorKeys = FF_COLOR_FG_DEFAULT, + .colorTitle = FF_COLOR_FG_DEFAULT, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_ESHANIZEDOS + // EshanizedOS + { + .names = { "EshanizedOS" }, + .lines = FASTFETCH_DATATEXT_LOGO_ESHANIZEDOS, + .colors = { + FF_COLOR_FG_RED, + FF_COLOR_FG_WHITE, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_EUROLINUX + // EuroLinux + { + .names = { "EuroLinux" }, + .lines = FASTFETCH_DATATEXT_LOGO_EUROLINUX, + .colors = { + FF_COLOR_FG_BLUE, + FF_COLOR_FG_WHITE, + }, + .colorKeys = FF_COLOR_FG_BLUE, + .colorTitle = FF_COLOR_FG_DEFAULT, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_EVOLUTIONOS + // EvolutionOS + { + .names = { "EvolutionOS" }, + .lines = FASTFETCH_DATATEXT_LOGO_EVOLUTIONOS, + .colors = { + FF_COLOR_FG_GREEN, + FF_COLOR_FG_WHITE, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_EVOLUTIONOS_SMALL + // EvolutionOSSmall + { + .names = { "EvolutionOS_small" }, + .type = FF_LOGO_LINE_TYPE_SMALL_BIT, + .lines = FASTFETCH_DATATEXT_LOGO_EVOLUTIONOS_SMALL, + .colors = { + FF_COLOR_FG_GREEN, + FF_COLOR_FG_WHITE, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_EVOLUTIONOS_OLD + // EvolutionOS_old + { + .names = { "EvolutionOS_old" }, + .type = FF_LOGO_LINE_TYPE_ALTER_BIT, + .lines = FASTFETCH_DATATEXT_LOGO_EVOLUTIONOS_OLD, + .colors = { + FF_COLOR_FG_LIGHT_BLUE, + FF_COLOR_FG_WHITE, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_EWEOS + // eweOS + { + .names = { "eweOS" }, + .lines = FASTFETCH_DATATEXT_LOGO_EWEOS, + .colors = { + FF_COLOR_FG_WHITE, + FF_COLOR_FG_LIGHT_YELLOW, + FF_COLOR_FG_LIGHT_RED, + FF_COLOR_FG_LIGHT_BLACK, + FF_COLOR_FG_RED, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_EXHERBO + // Exherbo + { + .names = { "Exherbo" }, + .lines = FASTFETCH_DATATEXT_LOGO_EXHERBO, + .colors = { + FF_COLOR_FG_BLUE, + FF_COLOR_FG_WHITE, + FF_COLOR_FG_RED, + }, + .colorKeys = FF_COLOR_FG_BLUE, + .colorTitle = FF_COLOR_FG_BLUE, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_EXODIA_PREDATOR + // ExodiaOS + { + .names = { "Exodia" }, + .lines = FASTFETCH_DATATEXT_LOGO_EXODIA_PREDATOR, + .colors = { + FF_COLOR_FG_MAGENTA, + }, + .colorKeys = FF_COLOR_FG_MAGENTA, + .colorTitle = FF_COLOR_FG_MAGENTA, + }, + #endif + // LAST + {}, +}; diff --git a/src/logo/ascii/elbrus.txt b/src/logo/ascii/e/elbrus.txt similarity index 100% rename from src/logo/ascii/elbrus.txt rename to src/logo/ascii/e/elbrus.txt diff --git a/src/logo/ascii/elementary.txt b/src/logo/ascii/e/elementary.txt similarity index 100% rename from src/logo/ascii/elementary.txt rename to src/logo/ascii/e/elementary.txt diff --git a/src/logo/ascii/elementary_small.txt b/src/logo/ascii/e/elementary_small.txt similarity index 100% rename from src/logo/ascii/elementary_small.txt rename to src/logo/ascii/e/elementary_small.txt diff --git a/src/logo/ascii/elive.txt b/src/logo/ascii/e/elive.txt similarity index 100% rename from src/logo/ascii/elive.txt rename to src/logo/ascii/e/elive.txt diff --git a/src/logo/ascii/emmabuntus.txt b/src/logo/ascii/e/emmabuntus.txt similarity index 100% rename from src/logo/ascii/emmabuntus.txt rename to src/logo/ascii/e/emmabuntus.txt diff --git a/src/logo/ascii/emperoros.txt b/src/logo/ascii/e/emperoros.txt similarity index 100% rename from src/logo/ascii/emperoros.txt rename to src/logo/ascii/e/emperoros.txt diff --git a/src/logo/ascii/encryptos.txt b/src/logo/ascii/e/encryptos.txt similarity index 100% rename from src/logo/ascii/encryptos.txt rename to src/logo/ascii/e/encryptos.txt diff --git a/src/logo/ascii/endeavouros.txt b/src/logo/ascii/e/endeavouros.txt similarity index 100% rename from src/logo/ascii/endeavouros.txt rename to src/logo/ascii/e/endeavouros.txt diff --git a/src/logo/ascii/endeavouros_small.txt b/src/logo/ascii/e/endeavouros_small.txt similarity index 100% rename from src/logo/ascii/endeavouros_small.txt rename to src/logo/ascii/e/endeavouros_small.txt diff --git a/src/logo/ascii/endless.txt b/src/logo/ascii/e/endless.txt similarity index 100% rename from src/logo/ascii/endless.txt rename to src/logo/ascii/e/endless.txt diff --git a/src/logo/ascii/enos.txt b/src/logo/ascii/e/enos.txt similarity index 100% rename from src/logo/ascii/enos.txt rename to src/logo/ascii/e/enos.txt diff --git a/src/logo/ascii/enso.txt b/src/logo/ascii/e/enso.txt similarity index 100% rename from src/logo/ascii/enso.txt rename to src/logo/ascii/e/enso.txt diff --git a/src/logo/ascii/eshanizedos.txt b/src/logo/ascii/e/eshanizedos.txt similarity index 100% rename from src/logo/ascii/eshanizedos.txt rename to src/logo/ascii/e/eshanizedos.txt diff --git a/src/logo/ascii/eurolinux.txt b/src/logo/ascii/e/eurolinux.txt similarity index 100% rename from src/logo/ascii/eurolinux.txt rename to src/logo/ascii/e/eurolinux.txt diff --git a/src/logo/ascii/evolutionos.txt b/src/logo/ascii/e/evolutionos.txt similarity index 100% rename from src/logo/ascii/evolutionos.txt rename to src/logo/ascii/e/evolutionos.txt diff --git a/src/logo/ascii/evolutionos_old.txt b/src/logo/ascii/e/evolutionos_old.txt similarity index 100% rename from src/logo/ascii/evolutionos_old.txt rename to src/logo/ascii/e/evolutionos_old.txt diff --git a/src/logo/ascii/evolutionos_small.txt b/src/logo/ascii/e/evolutionos_small.txt similarity index 100% rename from src/logo/ascii/evolutionos_small.txt rename to src/logo/ascii/e/evolutionos_small.txt diff --git a/src/logo/ascii/eweos.txt b/src/logo/ascii/e/eweos.txt similarity index 100% rename from src/logo/ascii/eweos.txt rename to src/logo/ascii/e/eweos.txt diff --git a/src/logo/ascii/exherbo.txt b/src/logo/ascii/e/exherbo.txt similarity index 100% rename from src/logo/ascii/exherbo.txt rename to src/logo/ascii/e/exherbo.txt diff --git a/src/logo/ascii/exodia_predator.txt b/src/logo/ascii/e/exodia_predator.txt similarity index 100% rename from src/logo/ascii/exodia_predator.txt rename to src/logo/ascii/e/exodia_predator.txt diff --git a/src/logo/ascii/f.inc b/src/logo/ascii/f.inc new file mode 100644 index 0000000000..8be44fa17f --- /dev/null +++ b/src/logo/ascii/f.inc @@ -0,0 +1,288 @@ +#include "../logo.h" +#include "logo_builtin.h" +#include "common/color.h" + +static const FFlogo F[] = { + #ifdef FASTFETCH_DATATEXT_LOGO_FASTFETCH + // 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, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_FEDORA + // Fedora + { + .names = { "Fedora" }, + .lines = FASTFETCH_DATATEXT_LOGO_FEDORA, + .colors = { + FF_COLOR_FG_BLUE, + FF_COLOR_FG_WHITE, + }, + .colorKeys = FF_COLOR_FG_BLUE, + .colorTitle = FF_COLOR_FG_DEFAULT, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_ASAHI + // FedoraAsahiRemix + { + .names = { "fedora-asahi-remix" }, + .lines = FASTFETCH_DATATEXT_LOGO_ASAHI, + .colors = { + FF_COLOR_FG_YELLOW, + FF_COLOR_FG_GREEN, + FF_COLOR_FG_RED, + FF_COLOR_FG_LIGHT_BLACK, + FF_COLOR_FG_WHITE, + FF_COLOR_FG_CYAN, + FF_COLOR_FG_BLUE, + }, + .colorKeys = FF_COLOR_FG_YELLOW, + .colorTitle = FF_COLOR_FG_GREEN, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_FEDORA_SMALL + // FedoraSmall + { + .names = { "Fedora_small" }, + .type = FF_LOGO_LINE_TYPE_SMALL_BIT, + .lines = FASTFETCH_DATATEXT_LOGO_FEDORA_SMALL, + .colors = { + FF_COLOR_FG_BLUE, + }, + .colorKeys = FF_COLOR_FG_BLUE, + .colorTitle = FF_COLOR_FG_DEFAULT, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_FEDORA2_SMALL + { + .names = { "Fedora2_small" }, + .type = FF_LOGO_LINE_TYPE_SMALL_BIT | FF_LOGO_LINE_TYPE_ALTER_BIT, + .lines = FASTFETCH_DATATEXT_LOGO_FEDORA2_SMALL, + .colors = { + FF_COLOR_FG_BLUE, + }, + .colorKeys = FF_COLOR_FG_BLUE, + .colorTitle = FF_COLOR_FG_DEFAULT, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_FEDORA_OLD + // FedoraOld + { + .names = { "Fedora_old" }, + .type = FF_LOGO_LINE_TYPE_ALTER_BIT, + .lines = FASTFETCH_DATATEXT_LOGO_FEDORA_OLD, + .colors = { + FF_COLOR_FG_BLUE, + FF_COLOR_FG_WHITE, + }, + .colorKeys = FF_COLOR_FG_BLUE, + .colorTitle = FF_COLOR_FG_DEFAULT, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_FEDORA_SILVERBLUE + // FedoraSilverblue + { + .names = { "Fedora-Silverblue" }, + .lines = FASTFETCH_DATATEXT_LOGO_FEDORA_SILVERBLUE, + .colors = { + FF_COLOR_FG_BLUE, + FF_COLOR_FG_WHITE, + FF_COLOR_FG_CYAN, + }, + .colorKeys = FF_COLOR_FG_BLUE, + .colorTitle = FF_COLOR_FG_DEFAULT, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_FEDORA_KINOITE + // FedoraKinoite + { + .names = { "Fedora-Kinoite" }, + .lines = FASTFETCH_DATATEXT_LOGO_FEDORA_KINOITE, + .colors = { + FF_COLOR_FG_BLUE, + FF_COLOR_FG_WHITE, + }, + .colorKeys = FF_COLOR_FG_BLUE, + .colorTitle = FF_COLOR_FG_DEFAULT, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_FEDORA_SERICEA + // FedoraSericea + { + .names = { "Fedora-Sericea" }, + .lines = FASTFETCH_DATATEXT_LOGO_FEDORA_SERICEA, + .colors = { + FF_COLOR_FG_BLUE, + FF_COLOR_FG_WHITE, + }, + .colorKeys = FF_COLOR_FG_BLUE, + .colorTitle = FF_COLOR_FG_DEFAULT, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_FEDORA_COREOS + // FedoraCoreOS + { + .names = { "Fedora-CoreOS" }, + .lines = FASTFETCH_DATATEXT_LOGO_FEDORA_COREOS, + .colors = { + FF_COLOR_FG_BLUE, + FF_COLOR_FG_WHITE, + FF_COLOR_FG_RED, + }, + .colorKeys = FF_COLOR_FG_BLUE, + .colorTitle = FF_COLOR_FG_DEFAULT, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_FEMBOYOS + // FemboyOS + { + .names = { "FemboyOS" }, + .lines = FASTFETCH_DATATEXT_LOGO_FEMBOYOS, + .colors = { + FF_COLOR_FG_BLUE, + }, + .colorKeys = FF_COLOR_FG_BLUE, + .colorTitle = FF_COLOR_FG_DEFAULT, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_FEREN + // Feren + { + .names = { "Feren" }, + .lines = FASTFETCH_DATATEXT_LOGO_FEREN, + .colors = { + FF_COLOR_FG_BLUE, + }, + .colorKeys = FF_COLOR_FG_BLUE, + .colorTitle = FF_COLOR_FG_DEFAULT, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_FILOTIMO + // Filotimo + { + .names = { "filotimo" }, + .lines = FASTFETCH_DATATEXT_LOGO_FILOTIMO, + .colors = { + FF_COLOR_FG_BLUE, + }, + .colorKeys = FF_COLOR_FG_BLUE, + .colorTitle = FF_COLOR_FG_DEFAULT, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_FINNIX + // Finnix + { + .names = { "Finnix" }, + .lines = FASTFETCH_DATATEXT_LOGO_FINNIX, + .colors = { + FF_COLOR_FG_BLUE, + FF_COLOR_FG_WHITE, + }, + .colorKeys = FF_COLOR_FG_BLUE, + .colorTitle = FF_COLOR_FG_DEFAULT, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_FLOFLIS + // Floflis + { + .names = { "Floflis" }, + .lines = FASTFETCH_DATATEXT_LOGO_FLOFLIS, + .colors = { + FF_COLOR_FG_LIGHT_CYAN, + }, + .colorKeys = FF_COLOR_FG_RED, + .colorTitle = FF_COLOR_FG_DEFAULT, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_FREEBSD + // FreeBSD + { + .names = { "Freebsd" }, + .lines = FASTFETCH_DATATEXT_LOGO_FREEBSD, + .colors = { + FF_COLOR_FG_WHITE, + FF_COLOR_FG_RED, + }, + .colorKeys = FF_COLOR_FG_RED, + .colorTitle = FF_COLOR_FG_RED, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_FREEBSD_SMALL + // FreeBSDSmall + { + .names = { "freebsd_small" }, + .type = FF_LOGO_LINE_TYPE_SMALL_BIT, + .lines = FASTFETCH_DATATEXT_LOGO_FREEBSD_SMALL, + .colors = { + FF_COLOR_FG_RED, + }, + .colorKeys = FF_COLOR_FG_RED, + .colorTitle = FF_COLOR_FG_RED, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_FREEMINT + // FreeMiNT + { + .names = { "FreeMiNT" }, + .lines = FASTFETCH_DATATEXT_LOGO_FREEMINT, + .colors = { + FF_COLOR_FG_WHITE, + }, + .colorKeys = FF_COLOR_FG_DEFAULT, + .colorTitle = FF_COLOR_FG_DEFAULT, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_FRUGALWARE + // Frugalware + { + .names = { "Frugalware", "frugalware-linux" }, + .lines = FASTFETCH_DATATEXT_LOGO_FRUGALWARE, + .colors = { + FF_COLOR_FG_BLUE, + FF_COLOR_FG_WHITE, + }, + .colorKeys = FF_COLOR_FG_BLUE, + .colorTitle = FF_COLOR_FG_DEFAULT, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_FUNTOO + // Funtoo + { + .names = { "Funtoo" }, + .lines = FASTFETCH_DATATEXT_LOGO_FUNTOO, + .colors = { + FF_COLOR_FG_MAGENTA, + FF_COLOR_FG_WHITE, + }, + .colorKeys = FF_COLOR_FG_MAGENTA, + .colorTitle = FF_COLOR_FG_DEFAULT, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_FURRETO + // Furreto + { + .names = { "Furreto" }, + .lines = FASTFETCH_DATATEXT_LOGO_FURRETO, + .colors = { + FF_COLOR_FG_WHITE, + FF_COLOR_FG_LIGHT_MAGENTA, + }, + .colorKeys = FF_COLOR_FG_CYAN, + .colorTitle = FF_COLOR_FG_CYAN, + }, + #endif + // LAST + {}, +}; diff --git a/src/logo/ascii/fastfetch.txt b/src/logo/ascii/f/fastfetch.txt similarity index 100% rename from src/logo/ascii/fastfetch.txt rename to src/logo/ascii/f/fastfetch.txt diff --git a/src/logo/ascii/fedora.txt b/src/logo/ascii/f/fedora.txt similarity index 100% rename from src/logo/ascii/fedora.txt rename to src/logo/ascii/f/fedora.txt diff --git a/src/logo/ascii/fedora2_small.txt b/src/logo/ascii/f/fedora2_small.txt similarity index 100% rename from src/logo/ascii/fedora2_small.txt rename to src/logo/ascii/f/fedora2_small.txt diff --git a/src/logo/ascii/fedora_coreos.txt b/src/logo/ascii/f/fedora_coreos.txt similarity index 100% rename from src/logo/ascii/fedora_coreos.txt rename to src/logo/ascii/f/fedora_coreos.txt diff --git a/src/logo/ascii/fedora_kinoite.txt b/src/logo/ascii/f/fedora_kinoite.txt similarity index 100% rename from src/logo/ascii/fedora_kinoite.txt rename to src/logo/ascii/f/fedora_kinoite.txt diff --git a/src/logo/ascii/fedora_old.txt b/src/logo/ascii/f/fedora_old.txt similarity index 100% rename from src/logo/ascii/fedora_old.txt rename to src/logo/ascii/f/fedora_old.txt diff --git a/src/logo/ascii/fedora_sericea.txt b/src/logo/ascii/f/fedora_sericea.txt similarity index 100% rename from src/logo/ascii/fedora_sericea.txt rename to src/logo/ascii/f/fedora_sericea.txt diff --git a/src/logo/ascii/fedora_silverblue.txt b/src/logo/ascii/f/fedora_silverblue.txt similarity index 100% rename from src/logo/ascii/fedora_silverblue.txt rename to src/logo/ascii/f/fedora_silverblue.txt diff --git a/src/logo/ascii/fedora_small.txt b/src/logo/ascii/f/fedora_small.txt similarity index 100% rename from src/logo/ascii/fedora_small.txt rename to src/logo/ascii/f/fedora_small.txt diff --git a/src/logo/ascii/femboyos.txt b/src/logo/ascii/f/femboyos.txt similarity index 100% rename from src/logo/ascii/femboyos.txt rename to src/logo/ascii/f/femboyos.txt diff --git a/src/logo/ascii/feren.txt b/src/logo/ascii/f/feren.txt similarity index 100% rename from src/logo/ascii/feren.txt rename to src/logo/ascii/f/feren.txt diff --git a/src/logo/ascii/filotimo.txt b/src/logo/ascii/f/filotimo.txt similarity index 100% rename from src/logo/ascii/filotimo.txt rename to src/logo/ascii/f/filotimo.txt diff --git a/src/logo/ascii/finnix.txt b/src/logo/ascii/f/finnix.txt similarity index 100% rename from src/logo/ascii/finnix.txt rename to src/logo/ascii/f/finnix.txt diff --git a/src/logo/ascii/floflis.txt b/src/logo/ascii/f/floflis.txt similarity index 100% rename from src/logo/ascii/floflis.txt rename to src/logo/ascii/f/floflis.txt diff --git a/src/logo/ascii/freebsd.txt b/src/logo/ascii/f/freebsd.txt similarity index 100% rename from src/logo/ascii/freebsd.txt rename to src/logo/ascii/f/freebsd.txt diff --git a/src/logo/ascii/freebsd_small.txt b/src/logo/ascii/f/freebsd_small.txt similarity index 100% rename from src/logo/ascii/freebsd_small.txt rename to src/logo/ascii/f/freebsd_small.txt diff --git a/src/logo/ascii/freemint.txt b/src/logo/ascii/f/freemint.txt similarity index 100% rename from src/logo/ascii/freemint.txt rename to src/logo/ascii/f/freemint.txt diff --git a/src/logo/ascii/frugalware.txt b/src/logo/ascii/f/frugalware.txt similarity index 100% rename from src/logo/ascii/frugalware.txt rename to src/logo/ascii/f/frugalware.txt diff --git a/src/logo/ascii/funtoo.txt b/src/logo/ascii/f/funtoo.txt similarity index 100% rename from src/logo/ascii/funtoo.txt rename to src/logo/ascii/f/funtoo.txt diff --git a/src/logo/ascii/furreto.txt b/src/logo/ascii/f/furreto.txt similarity index 100% rename from src/logo/ascii/furreto.txt rename to src/logo/ascii/f/furreto.txt diff --git a/src/logo/ascii/g.inc b/src/logo/ascii/g.inc new file mode 100644 index 0000000000..3fa3f7af72 --- /dev/null +++ b/src/logo/ascii/g.inc @@ -0,0 +1,244 @@ +#include "../logo.h" +#include "logo_builtin.h" +#include "common/color.h" + +static const FFlogo G[] = { + #ifdef FASTFETCH_DATATEXT_LOGO_GALLIUMOS + // GalliumOS + { + .names = { "GalliumOS" }, + .lines = FASTFETCH_DATATEXT_LOGO_GALLIUMOS, + .colors = { + FF_COLOR_FG_BLUE, + FF_COLOR_FG_WHITE, + }, + .colorKeys = FF_COLOR_FG_BLUE, + .colorTitle = FF_COLOR_FG_DEFAULT, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_GARUDA + // Garuda + { + .names = { "Garuda", "garuda-linux" }, + .lines = FASTFETCH_DATATEXT_LOGO_GARUDA, + .colors = { + FF_COLOR_FG_RED, + }, + .colorKeys = FF_COLOR_FG_RED, + .colorTitle = FF_COLOR_FG_RED, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_GARUDA_DRAGON + // GarudaDragon + { + .names = { "GarudaDragon", "garuda-dragon" }, + .lines = FASTFETCH_DATATEXT_LOGO_GARUDA_DRAGON, + .colors = { + FF_COLOR_FG_RED, + }, + .colorKeys = FF_COLOR_FG_RED, + .colorTitle = FF_COLOR_FG_RED, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_GARUDA_SMALL + // GarudaSmall + { + .names = { "Garuda_small", "garuda-linux_small" }, + .type = FF_LOGO_LINE_TYPE_SMALL_BIT, + .lines = FASTFETCH_DATATEXT_LOGO_GARUDA_SMALL, + .colors = { + FF_COLOR_FG_RED, + }, + .colorKeys = FF_COLOR_FG_RED, + .colorTitle = FF_COLOR_FG_RED, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_GENTOO + // Gentoo + { + .names = { "Gentoo" }, + .lines = FASTFETCH_DATATEXT_LOGO_GENTOO, + .colors = { + FF_COLOR_FG_MAGENTA, + FF_COLOR_FG_WHITE, + }, + .colorKeys = FF_COLOR_FG_MAGENTA, + .colorTitle = FF_COLOR_FG_MAGENTA, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_GENTOO_SMALL + // GentooSmall + { + .names = { "Gentoo_small" }, + .type = FF_LOGO_LINE_TYPE_SMALL_BIT, + .lines = FASTFETCH_DATATEXT_LOGO_GENTOO_SMALL, + .colors = { + FF_COLOR_FG_MAGENTA, + FF_COLOR_FG_WHITE, + }, + .colorKeys = FF_COLOR_FG_MAGENTA, + .colorTitle = FF_COLOR_FG_MAGENTA, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_GHOSTBSD + // GhostBSD + { + .names = { "GhostBSD" }, + .lines = FASTFETCH_DATATEXT_LOGO_GHOSTBSD, + .colors = { + FF_COLOR_FG_BLUE, + }, + .colorKeys = FF_COLOR_FG_BLUE, + .colorTitle = FF_COLOR_FG_RED, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_GHOSTFREAK + // GhostFreak + { + .names = { "GhostFreak" }, + .lines = FASTFETCH_DATATEXT_LOGO_GHOSTFREAK, + .colors = { + FF_COLOR_FG_DEFAULT, + }, + .colorKeys = FF_COLOR_FG_DEFAULT, + .colorTitle = FF_COLOR_FG_BLUE, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_GLAUCUS + // Glaucus + { + .names = { "Glaucus" }, + .lines = FASTFETCH_DATATEXT_LOGO_GLAUCUS, + .colors = { + FF_COLOR_FG_MAGENTA, + }, + .colorKeys = FF_COLOR_FG_MAGENTA, + .colorTitle = FF_COLOR_FG_MAGENTA, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_GNEWSENSE + // GNewSense + { + .names = { "gNewSense" }, + .lines = FASTFETCH_DATATEXT_LOGO_GNEWSENSE, + .colors = { + FF_COLOR_FG_BLUE, + }, + .colorKeys = FF_COLOR_FG_BLUE, + .colorTitle = FF_COLOR_FG_BLUE, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_GNOME + // GNOME OS + { + .names = { "GNOME OS" }, // matches "NAME" + .lines = FASTFETCH_DATATEXT_LOGO_GNOME, + .colors = { + FF_COLOR_FG_BLUE, + }, + .colorKeys = FF_COLOR_FG_BLUE, + .colorTitle = FF_COLOR_FG_RED, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_GNU + // GNU + { + .names = { "GNU" }, + .lines = FASTFETCH_DATATEXT_LOGO_GNU, + .colors = { + FF_COLOR_FG_DEFAULT, + }, + .colorKeys = FF_COLOR_FG_DEFAULT, + .colorTitle = FF_COLOR_FG_RED, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_GOBOLINUX + // GoboLinux + { + .names = { "GoboLinux", "Gobo" }, + .lines = FASTFETCH_DATATEXT_LOGO_GOBOLINUX, + .colors = { + FF_COLOR_FG_MAGENTA, + }, + .colorKeys = FF_COLOR_FG_MAGENTA, + .colorTitle = FF_COLOR_FG_MAGENTA, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_GOLDENDOGLINUX + // GoldenDogLinux + { + .names = { "GoldenDog Linux", "GDL", "goldendoglinux" }, + .lines = FASTFETCH_DATATEXT_LOGO_GOLDENDOGLINUX, + .colors = { + FF_COLOR_FG_YELLOW, + }, + .colorKeys = FF_COLOR_FG_MAGENTA, + .colorTitle = FF_COLOR_FG_DEFAULT, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_GRAPHENEOS + // GrapheneOS + { + .names = { "GrapheneOS" }, + .lines = FASTFETCH_DATATEXT_LOGO_GRAPHENEOS, + .colors = { + FF_COLOR_FG_DEFAULT, + }, + .colorKeys = FF_COLOR_FG_DEFAULT, + .colorTitle = FF_COLOR_FG_BLUE, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_GROMBYANG + // Grombyang + { + .names = { "Grombyang" }, + .lines = FASTFETCH_DATATEXT_LOGO_GROMBYANG, + .colors = { + FF_COLOR_FG_BLUE, + FF_COLOR_FG_GREEN, + FF_COLOR_FG_RED, + }, + .colorKeys = FF_COLOR_FG_BLUE, + .colorTitle = FF_COLOR_FG_GREEN, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_GUIX + // Guix + { + .names = { "Guix" }, + .lines = FASTFETCH_DATATEXT_LOGO_GUIX, + .colors = { + FF_COLOR_FG_YELLOW, + }, + .colorKeys = FF_COLOR_FG_YELLOW, + .colorTitle = FF_COLOR_FG_DEFAULT, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_GUIX_SMALL + // GuixSmall + { + .names = { "Guix_small" }, + .type = FF_LOGO_LINE_TYPE_SMALL_BIT, + .lines = FASTFETCH_DATATEXT_LOGO_GUIX_SMALL, + .colors = { + FF_COLOR_FG_YELLOW, + }, + .colorKeys = FF_COLOR_FG_YELLOW, + .colorTitle = FF_COLOR_FG_DEFAULT, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_GXDE + // GXDE + { + .names = { "GXDE" }, + .lines = FASTFETCH_DATATEXT_LOGO_GXDE, + .colors = { + FF_COLOR_FG_RED, + }, + .colorKeys = FF_COLOR_FG_RED, + .colorTitle = FF_COLOR_FG_RED, + }, + #endif + // LAST + {}, +}; diff --git a/src/logo/ascii/galliumos.txt b/src/logo/ascii/g/galliumos.txt similarity index 100% rename from src/logo/ascii/galliumos.txt rename to src/logo/ascii/g/galliumos.txt diff --git a/src/logo/ascii/garuda.txt b/src/logo/ascii/g/garuda.txt similarity index 100% rename from src/logo/ascii/garuda.txt rename to src/logo/ascii/g/garuda.txt diff --git a/src/logo/ascii/garuda_dragon.txt b/src/logo/ascii/g/garuda_dragon.txt similarity index 100% rename from src/logo/ascii/garuda_dragon.txt rename to src/logo/ascii/g/garuda_dragon.txt diff --git a/src/logo/ascii/garuda_small.txt b/src/logo/ascii/g/garuda_small.txt similarity index 100% rename from src/logo/ascii/garuda_small.txt rename to src/logo/ascii/g/garuda_small.txt diff --git a/src/logo/ascii/gentoo.txt b/src/logo/ascii/g/gentoo.txt similarity index 100% rename from src/logo/ascii/gentoo.txt rename to src/logo/ascii/g/gentoo.txt diff --git a/src/logo/ascii/gentoo_small.txt b/src/logo/ascii/g/gentoo_small.txt similarity index 100% rename from src/logo/ascii/gentoo_small.txt rename to src/logo/ascii/g/gentoo_small.txt diff --git a/src/logo/ascii/ghostbsd.txt b/src/logo/ascii/g/ghostbsd.txt similarity index 100% rename from src/logo/ascii/ghostbsd.txt rename to src/logo/ascii/g/ghostbsd.txt diff --git a/src/logo/ascii/ghostfreak.txt b/src/logo/ascii/g/ghostfreak.txt similarity index 100% rename from src/logo/ascii/ghostfreak.txt rename to src/logo/ascii/g/ghostfreak.txt diff --git a/src/logo/ascii/glaucus.txt b/src/logo/ascii/g/glaucus.txt similarity index 100% rename from src/logo/ascii/glaucus.txt rename to src/logo/ascii/g/glaucus.txt diff --git a/src/logo/ascii/gnewsense.txt b/src/logo/ascii/g/gnewsense.txt similarity index 100% rename from src/logo/ascii/gnewsense.txt rename to src/logo/ascii/g/gnewsense.txt diff --git a/src/logo/ascii/gnome.txt b/src/logo/ascii/g/gnome.txt similarity index 100% rename from src/logo/ascii/gnome.txt rename to src/logo/ascii/g/gnome.txt diff --git a/src/logo/ascii/gnu.txt b/src/logo/ascii/g/gnu.txt similarity index 100% rename from src/logo/ascii/gnu.txt rename to src/logo/ascii/g/gnu.txt diff --git a/src/logo/ascii/gobolinux.txt b/src/logo/ascii/g/gobolinux.txt similarity index 100% rename from src/logo/ascii/gobolinux.txt rename to src/logo/ascii/g/gobolinux.txt diff --git a/src/logo/ascii/goldendoglinux.txt b/src/logo/ascii/g/goldendoglinux.txt similarity index 100% rename from src/logo/ascii/goldendoglinux.txt rename to src/logo/ascii/g/goldendoglinux.txt diff --git a/src/logo/ascii/grapheneos.txt b/src/logo/ascii/g/grapheneos.txt similarity index 100% rename from src/logo/ascii/grapheneos.txt rename to src/logo/ascii/g/grapheneos.txt diff --git a/src/logo/ascii/grombyang.txt b/src/logo/ascii/g/grombyang.txt similarity index 100% rename from src/logo/ascii/grombyang.txt rename to src/logo/ascii/g/grombyang.txt diff --git a/src/logo/ascii/guix.txt b/src/logo/ascii/g/guix.txt similarity index 100% rename from src/logo/ascii/guix.txt rename to src/logo/ascii/g/guix.txt diff --git a/src/logo/ascii/guix_small.txt b/src/logo/ascii/g/guix_small.txt similarity index 100% rename from src/logo/ascii/guix_small.txt rename to src/logo/ascii/g/guix_small.txt diff --git a/src/logo/ascii/gxde.txt b/src/logo/ascii/g/gxde.txt similarity index 100% rename from src/logo/ascii/gxde.txt rename to src/logo/ascii/g/gxde.txt diff --git a/src/logo/ascii/h.inc b/src/logo/ascii/h.inc new file mode 100644 index 0000000000..9d471eb737 --- /dev/null +++ b/src/logo/ascii/h.inc @@ -0,0 +1,211 @@ +#include "../logo.h" +#include "logo_builtin.h" +#include "common/color.h" + +static const FFlogo H[] = { + #ifdef FASTFETCH_DATATEXT_LOGO_HAIKU + // Haiku + { + .names = { "Haiku" }, + .lines = FASTFETCH_DATATEXT_LOGO_HAIKU, + .colors = { + FF_COLOR_FG_DEFAULT, + FF_COLOR_FG_GREEN, + }, + .colorKeys = FF_COLOR_FG_RED, + .colorTitle = FF_COLOR_FG_YELLOW, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_HAIKU2 + // 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, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_HAIKU_SMALL + // HaikuSmall + { + .names = { "Haiku_small" }, + .type = FF_LOGO_LINE_TYPE_SMALL_BIT, + .lines = FASTFETCH_DATATEXT_LOGO_HAIKU_SMALL, + .colors = { + FF_COLOR_FG_GREEN, + }, + .colorKeys = FF_COLOR_FG_GREEN, + .colorTitle = FF_COLOR_FG_YELLOW, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_HAMONIKR + // HamoniKR + { + .names = { "HamoniKR" }, + .lines = FASTFETCH_DATATEXT_LOGO_HAMONIKR, + .colors = { + FF_COLOR_FG_BLUE, + FF_COLOR_FG_WHITE, + FF_COLOR_FG_256 "99", + }, + .colorKeys = FF_COLOR_FG_BLUE, + .colorTitle = FF_COLOR_FG_DEFAULT, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_HARDCLANZ + // HarDClanZ + { + .names = { "HarDClanZ" }, + .lines = FASTFETCH_DATATEXT_LOGO_HARDCLANZ, + .colors = { + FF_COLOR_FG_BLUE, + FF_COLOR_FG_WHITE, + FF_COLOR_FG_RED, + }, + .colorKeys = FF_COLOR_FG_BLUE, + .colorTitle = FF_COLOR_FG_DEFAULT, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_FREEBSD + // HardenedBSD + { + .names = { "HardenedBSD" }, + .lines = FASTFETCH_DATATEXT_LOGO_FREEBSD, + .colors = { + FF_COLOR_FG_WHITE, + FF_COLOR_FG_RED, + }, + .colorKeys = FF_COLOR_FG_RED, + .colorTitle = FF_COLOR_FG_RED, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_HARMONYOS + // HarmonyOS + { + .names = { "HarmonyOS" }, + .lines = FASTFETCH_DATATEXT_LOGO_HARMONYOS, + .colors = { + FF_COLOR_FG_WHITE, + FF_COLOR_FG_BLUE, + }, + .colorKeys = FF_COLOR_FG_BLUE, + .colorTitle = FF_COLOR_FG_BLUE, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_HASH + // Hash + { + .names = { "Hash" }, + .lines = FASTFETCH_DATATEXT_LOGO_HASH, + .colors = { + FF_COLOR_FG_256 "123", + FF_COLOR_FG_256 "123", + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_HELIUMOS + // HeliumOS + { + .names = { "HeliumOS" }, + .lines = FASTFETCH_DATATEXT_LOGO_HELIUMOS, + .colors = { + FF_COLOR_FG_256 "81", + }, + .colorKeys = FF_COLOR_FG_256 "81", + .colorTitle = FF_COLOR_FG_DEFAULT, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_HCE + // Huawei Cloud EulerOS + { + .names = { "Huawei Cloud EulerOS", "hce" }, + .lines = FASTFETCH_DATATEXT_LOGO_HCE, + .colors = { + FF_COLOR_FG_RED, + }, + .colorKeys = FF_COLOR_FG_RED, + .colorTitle = FF_COLOR_FG_RED, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_HUAYRA + // Huayra + { + .names = { "Huayra" }, + .lines = FASTFETCH_DATATEXT_LOGO_HUAYRA, + .colors = { + FF_COLOR_FG_DEFAULT, + }, + .colorKeys = FF_COLOR_FG_DEFAULT, + .colorTitle = FF_COLOR_FG_BLUE, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_HYBRID + // Hybrid + { + .names = { "Hybrid" }, + .lines = FASTFETCH_DATATEXT_LOGO_HYBRID, + .colors = { + FF_COLOR_FG_BLUE, + FF_COLOR_FG_LIGHT_BLUE, + }, + .colorKeys = FF_COLOR_FG_LIGHT_BLUE, + .colorTitle = FF_COLOR_FG_BLUE, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_HYDROOS + // HydroOS + { + .names = { "HydroOS" }, + .lines = FASTFETCH_DATATEXT_LOGO_HYDROOS, + .colors = { + FF_COLOR_FG_RED, + }, + .colorKeys = FF_COLOR_FG_RED, + .colorTitle = FF_COLOR_FG_GREEN, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_HYPROS + // HyprOS + { + .names = { "hypros" }, + .lines = FASTFETCH_DATATEXT_LOGO_HYPROS, + .colors = { + FF_COLOR_FG_RED, + FF_COLOR_FG_YELLOW, + FF_COLOR_FG_CYAN, + FF_COLOR_FG_BLUE, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_HYPERBOLA + // Hyperbola + { + .names = { "Hyperbola" }, + .lines = FASTFETCH_DATATEXT_LOGO_HYPERBOLA, + .colors = { + FF_COLOR_FG_LIGHT_BLACK, + }, + .colorKeys = FF_COLOR_FG_LIGHT_BLACK, + .colorTitle = FF_COLOR_FG_DEFAULT, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_HYPERBOLA_SMALL + // HyperbolaSmall + { + .names = { "Hyperbola_small" }, + .type = FF_LOGO_LINE_TYPE_SMALL_BIT, + .lines = FASTFETCH_DATATEXT_LOGO_HYPERBOLA_SMALL, + .colors = { + FF_COLOR_FG_LIGHT_BLACK, + }, + .colorKeys = FF_COLOR_FG_LIGHT_BLACK, + .colorTitle = FF_COLOR_FG_DEFAULT, + }, + #endif + // LAST + {}, +}; diff --git a/src/logo/ascii/haiku.txt b/src/logo/ascii/h/haiku.txt similarity index 100% rename from src/logo/ascii/haiku.txt rename to src/logo/ascii/h/haiku.txt diff --git a/src/logo/ascii/haiku2.txt b/src/logo/ascii/h/haiku2.txt similarity index 100% rename from src/logo/ascii/haiku2.txt rename to src/logo/ascii/h/haiku2.txt diff --git a/src/logo/ascii/haiku_small.txt b/src/logo/ascii/h/haiku_small.txt similarity index 100% rename from src/logo/ascii/haiku_small.txt rename to src/logo/ascii/h/haiku_small.txt diff --git a/src/logo/ascii/hamonikr.txt b/src/logo/ascii/h/hamonikr.txt similarity index 100% rename from src/logo/ascii/hamonikr.txt rename to src/logo/ascii/h/hamonikr.txt diff --git a/src/logo/ascii/hardclanz.txt b/src/logo/ascii/h/hardclanz.txt similarity index 100% rename from src/logo/ascii/hardclanz.txt rename to src/logo/ascii/h/hardclanz.txt diff --git a/src/logo/ascii/harmonyos.txt b/src/logo/ascii/h/harmonyos.txt similarity index 100% rename from src/logo/ascii/harmonyos.txt rename to src/logo/ascii/h/harmonyos.txt diff --git a/src/logo/ascii/hash.txt b/src/logo/ascii/h/hash.txt similarity index 100% rename from src/logo/ascii/hash.txt rename to src/logo/ascii/h/hash.txt diff --git a/src/logo/ascii/hce.txt b/src/logo/ascii/h/hce.txt similarity index 100% rename from src/logo/ascii/hce.txt rename to src/logo/ascii/h/hce.txt diff --git a/src/logo/ascii/heliumos.txt b/src/logo/ascii/h/heliumos.txt similarity index 100% rename from src/logo/ascii/heliumos.txt rename to src/logo/ascii/h/heliumos.txt diff --git a/src/logo/ascii/huayra.txt b/src/logo/ascii/h/huayra.txt similarity index 100% rename from src/logo/ascii/huayra.txt rename to src/logo/ascii/h/huayra.txt diff --git a/src/logo/ascii/hybrid.txt b/src/logo/ascii/h/hybrid.txt similarity index 100% rename from src/logo/ascii/hybrid.txt rename to src/logo/ascii/h/hybrid.txt diff --git a/src/logo/ascii/hydroos.txt b/src/logo/ascii/h/hydroos.txt similarity index 100% rename from src/logo/ascii/hydroos.txt rename to src/logo/ascii/h/hydroos.txt diff --git a/src/logo/ascii/hyperbola.txt b/src/logo/ascii/h/hyperbola.txt similarity index 100% rename from src/logo/ascii/hyperbola.txt rename to src/logo/ascii/h/hyperbola.txt diff --git a/src/logo/ascii/hyperbola_small.txt b/src/logo/ascii/h/hyperbola_small.txt similarity index 100% rename from src/logo/ascii/hyperbola_small.txt rename to src/logo/ascii/h/hyperbola_small.txt diff --git a/src/logo/ascii/hypros.txt b/src/logo/ascii/h/hypros.txt similarity index 100% rename from src/logo/ascii/hypros.txt rename to src/logo/ascii/h/hypros.txt diff --git a/src/logo/ascii/i.inc b/src/logo/ascii/i.inc new file mode 100644 index 0000000000..3b41f460bd --- /dev/null +++ b/src/logo/ascii/i.inc @@ -0,0 +1,83 @@ +#include "../logo.h" +#include "logo_builtin.h" +#include "common/color.h" + +static const FFlogo I[] = { + #ifdef FASTFETCH_DATATEXT_LOGO_IGLUNIX + // Iglunix + { + .names = { "Iglunix", "Iglu" }, + .lines = FASTFETCH_DATATEXT_LOGO_IGLUNIX, + .colors = { + FF_COLOR_FG_LIGHT_BLACK, + }, + .colorKeys = FF_COLOR_FG_LIGHT_BLACK, + .colorTitle = FF_COLOR_FG_DEFAULT, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_INSTANTOS + // InstantOS + { + .names = { "InstantOS" }, + .lines = FASTFETCH_DATATEXT_LOGO_INSTANTOS, + .colors = { + FF_COLOR_FG_BLUE, + FF_COLOR_FG_CYAN, + }, + .colorKeys = FF_COLOR_FG_BLUE, + .colorTitle = FF_COLOR_FG_CYAN, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_INTERIX + // Interix + { + .names = { "Interix" }, + .lines = FASTFETCH_DATATEXT_LOGO_INTERIX, + .colors = { + FF_COLOR_FG_RED, + FF_COLOR_FG_WHITE, + FF_COLOR_FG_BLUE, + FF_COLOR_FG_BLACK, + FF_COLOR_FG_YELLOW, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_IRIX + // IRIX + { + .names = { "IRIX" }, + .lines = FASTFETCH_DATATEXT_LOGO_IRIX, + .colors = { + FF_COLOR_FG_BLUE, + }, + .colorKeys = FF_COLOR_FG_BLUE, + .colorTitle = FF_COLOR_FG_DEFAULT, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_IRONCLAD + // Ironclad + { + .names = { "Ironclad" }, + .lines = FASTFETCH_DATATEXT_LOGO_IRONCLAD, + .colors = { + FF_COLOR_FG_BLACK, + }, + .colorKeys = FF_COLOR_FG_DEFAULT, + .colorTitle = FF_COLOR_FG_MAGENTA, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_ITC + // Itc + { + .names = { "Itc" }, + .lines = FASTFETCH_DATATEXT_LOGO_ITC, + .colors = { + FF_COLOR_FG_RED, + }, + .colorKeys = FF_COLOR_FG_DEFAULT, + .colorTitle = FF_COLOR_FG_RED, + }, + #endif + // LAST + {}, +}; diff --git a/src/logo/ascii/iglunix.txt b/src/logo/ascii/i/iglunix.txt similarity index 100% rename from src/logo/ascii/iglunix.txt rename to src/logo/ascii/i/iglunix.txt diff --git a/src/logo/ascii/instantos.txt b/src/logo/ascii/i/instantos.txt similarity index 100% rename from src/logo/ascii/instantos.txt rename to src/logo/ascii/i/instantos.txt diff --git a/src/logo/ascii/interix.txt b/src/logo/ascii/i/interix.txt similarity index 100% rename from src/logo/ascii/interix.txt rename to src/logo/ascii/i/interix.txt diff --git a/src/logo/ascii/irix.txt b/src/logo/ascii/i/irix.txt similarity index 100% rename from src/logo/ascii/irix.txt rename to src/logo/ascii/i/irix.txt diff --git a/src/logo/ascii/ironclad.txt b/src/logo/ascii/i/ironclad.txt similarity index 100% rename from src/logo/ascii/ironclad.txt rename to src/logo/ascii/i/ironclad.txt diff --git a/src/logo/ascii/itc.txt b/src/logo/ascii/i/itc.txt similarity index 100% rename from src/logo/ascii/itc.txt rename to src/logo/ascii/i/itc.txt diff --git a/src/logo/ascii/j.inc b/src/logo/ascii/j.inc new file mode 100644 index 0000000000..023f66dfb0 --- /dev/null +++ b/src/logo/ascii/j.inc @@ -0,0 +1,21 @@ +#include "../logo.h" +#include "logo_builtin.h" +#include "common/color.h" + +static const FFlogo J[] = { + #ifdef FASTFETCH_DATATEXT_LOGO_JANUSLINUX + // Januslinux + { + .names = { "januslinux", "janus" }, + .lines = FASTFETCH_DATATEXT_LOGO_JANUSLINUX, + .colors = { + FF_COLOR_FG_BLUE, + FF_COLOR_FG_MAGENTA, + }, + .colorKeys = FF_COLOR_FG_BLUE, + .colorTitle = FF_COLOR_FG_MAGENTA, + }, + #endif + // LAST + {}, +}; diff --git a/src/logo/ascii/januslinux.txt b/src/logo/ascii/j/januslinux.txt similarity index 100% rename from src/logo/ascii/januslinux.txt rename to src/logo/ascii/j/januslinux.txt diff --git a/src/logo/ascii/k.inc b/src/logo/ascii/k.inc new file mode 100644 index 0000000000..354b7026d8 --- /dev/null +++ b/src/logo/ascii/k.inc @@ -0,0 +1,239 @@ +#include "../logo.h" +#include "logo_builtin.h" +#include "common/color.h" + +static const FFlogo K[] = { + #ifdef FASTFETCH_DATATEXT_LOGO_KAISEN + // Kaisen + { + .names = { "Kaisen" }, + .lines = FASTFETCH_DATATEXT_LOGO_KAISEN, + .colors = { + FF_COLOR_FG_RED, + FF_COLOR_FG_WHITE, + }, + .colorKeys = FF_COLOR_FG_RED, + .colorTitle = FF_COLOR_FG_DEFAULT, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_KALI + // Kali + { + .names = { "Kali" }, + .lines = FASTFETCH_DATATEXT_LOGO_KALI, + .colors = { + FF_COLOR_FG_BLUE, + FF_COLOR_FG_LIGHT_BLACK, + }, + .colorKeys = FF_COLOR_FG_BLUE, + .colorTitle = FF_COLOR_FG_DEFAULT, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_KALI_SMALL + // KaliSmall + { + .names = { "Kali_small" }, + .type = FF_LOGO_LINE_TYPE_SMALL_BIT, + .lines = FASTFETCH_DATATEXT_LOGO_KALI_SMALL, + .colors = { + FF_COLOR_FG_BLUE, + FF_COLOR_FG_LIGHT_BLACK, + }, + .colorKeys = FF_COLOR_FG_BLUE, + .colorTitle = FF_COLOR_FG_DEFAULT, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_KALPA_DESKTOP + // Kalpa Desktop + { + .names = { "kalpa-desktop" }, + .lines = FASTFETCH_DATATEXT_LOGO_KALPA_DESKTOP, + .colors = { + FF_COLOR_FG_GREEN, + }, + .colorKeys = FF_COLOR_FG_GREEN, + .colorTitle = FF_COLOR_FG_DEFAULT, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_KAOS + // KaOS + { + .names = { "KaOS" }, + .lines = FASTFETCH_DATATEXT_LOGO_KAOS, + .colors = { + FF_COLOR_FG_BLUE, + FF_COLOR_FG_WHITE, + }, + .colorKeys = FF_COLOR_FG_BLUE, + .colorTitle = FF_COLOR_FG_DEFAULT, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_KERNELOS + // KernelOS + { + .names = { "KernelOS" }, + .lines = FASTFETCH_DATATEXT_LOGO_KERNELOS, + .colors = { + FF_COLOR_FG_RED, + FF_COLOR_FG_MAGENTA, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_KDELINUX + // KDELinux + { + .names = { "kdelinux", "kde-linux" }, + .lines = FASTFETCH_DATATEXT_LOGO_KDELINUX, + .colors = { + FF_COLOR_FG_YELLOW, + FF_COLOR_FG_WHITE, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_KDENEON + // KDE Neon + { + .names = { "KDE Neon" }, // Distro ID is "neon"; Distro name is "KDE Neon" + .lines = FASTFETCH_DATATEXT_LOGO_KDENEON, + .colors = { + FF_COLOR_FG_GREEN, + FF_COLOR_FG_DEFAULT, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_KIBAOS + // KibaOS + { + .names = { "KibaOS" }, + .lines = FASTFETCH_DATATEXT_LOGO_KIBAOS, + .colors = { + FF_COLOR_BG_WHITE, + FF_COLOR_FG_BLUE, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_KIBOJOE + // Kibojoe + { + .names = { "Kibojoe" }, + .lines = FASTFETCH_DATATEXT_LOGO_KIBOJOE, + .colors = { + FF_COLOR_FG_GREEN, + FF_COLOR_FG_WHITE, + FF_COLOR_FG_BLUE, + }, + .colorKeys = FF_COLOR_FG_GREEN, + .colorTitle = FF_COLOR_FG_DEFAULT, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_KISS + // KISSLinux + { + .names = { "KISS", "kiss-linux", "kisslinux" }, + .lines = FASTFETCH_DATATEXT_LOGO_KISS, + .colors = { + FF_COLOR_FG_MAGENTA, + FF_COLOR_FG_WHITE, + FF_COLOR_FG_BLUE, + }, + .colorKeys = FF_COLOR_FG_MAGENTA, + .colorTitle = FF_COLOR_FG_BLUE, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_KISS2 + // KISSLinux2 + { + .names = { "kiss2" }, + .lines = FASTFETCH_DATATEXT_LOGO_KISS2, + .colors = { + FF_COLOR_FG_BLACK, + FF_COLOR_FG_RED, + FF_COLOR_FG_WHITE, + }, + .colorKeys = FF_COLOR_FG_RED, + .colorTitle = FF_COLOR_FG_RED, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_KOGAION + // Kogaion + { + .names = { "Kogaion" }, + .lines = FASTFETCH_DATATEXT_LOGO_KOGAION, + .colors = { + FF_COLOR_FG_BLUE, + FF_COLOR_FG_WHITE, + }, + .colorKeys = FF_COLOR_FG_BLUE, + .colorTitle = FF_COLOR_FG_DEFAULT, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_KORORA + // Korora + { + .names = { "Korora" }, + .lines = FASTFETCH_DATATEXT_LOGO_KORORA, + .colors = { + FF_COLOR_FG_BLUE, + FF_COLOR_FG_WHITE, + }, + .colorKeys = FF_COLOR_FG_BLUE, + .colorTitle = FF_COLOR_FG_DEFAULT, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_KRASSOS + // KrassOS + { + .names = { "KrassOS", "Krass" }, + .lines = FASTFETCH_DATATEXT_LOGO_KRASSOS, + .colors = { + FF_COLOR_FG_BLUE, + FF_COLOR_FG_WHITE, + }, + .colorKeys = FF_COLOR_FG_BLUE, + .colorTitle = FF_COLOR_FG_DEFAULT, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_KSLINUX + // KSLinux + { + .names = { "KSLinux" }, + .lines = FASTFETCH_DATATEXT_LOGO_KSLINUX, + .colors = { + FF_COLOR_FG_BLUE, + FF_COLOR_FG_WHITE, + }, + .colorKeys = FF_COLOR_FG_BLUE, + .colorTitle = FF_COLOR_FG_DEFAULT, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_KUBUNTU + // Kubuntu + { + .names = { "Kubuntu", "kubuntu-linux", "kde-ubuntu" }, + .lines = FASTFETCH_DATATEXT_LOGO_KUBUNTU, + .colors = { + FF_COLOR_FG_BLUE, + FF_COLOR_FG_WHITE, + }, + .colorKeys = FF_COLOR_FG_BLUE, + .colorTitle = FF_COLOR_FG_BLUE, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_KYLIN + // Kylin + { + .names = { "Kylin" }, + .lines = FASTFETCH_DATATEXT_LOGO_KYLIN, + .colors = { + FF_COLOR_FG_BLUE, + FF_COLOR_FG_CYAN, + FF_COLOR_FG_WHITE, + FF_COLOR_FG_LIGHT_BLACK, + }, + .colorKeys = FF_COLOR_FG_BLUE, + .colorTitle = FF_COLOR_FG_BLUE, + }, + #endif + // LAST + {}, +}; diff --git a/src/logo/ascii/kaisen.txt b/src/logo/ascii/k/kaisen.txt similarity index 100% rename from src/logo/ascii/kaisen.txt rename to src/logo/ascii/k/kaisen.txt diff --git a/src/logo/ascii/kali.txt b/src/logo/ascii/k/kali.txt similarity index 100% rename from src/logo/ascii/kali.txt rename to src/logo/ascii/k/kali.txt diff --git a/src/logo/ascii/kali_small.txt b/src/logo/ascii/k/kali_small.txt similarity index 100% rename from src/logo/ascii/kali_small.txt rename to src/logo/ascii/k/kali_small.txt diff --git a/src/logo/ascii/kalpa_desktop.txt b/src/logo/ascii/k/kalpa_desktop.txt similarity index 100% rename from src/logo/ascii/kalpa_desktop.txt rename to src/logo/ascii/k/kalpa_desktop.txt diff --git a/src/logo/ascii/kaos.txt b/src/logo/ascii/k/kaos.txt similarity index 100% rename from src/logo/ascii/kaos.txt rename to src/logo/ascii/k/kaos.txt diff --git a/src/logo/ascii/kdelinux.txt b/src/logo/ascii/k/kdelinux.txt similarity index 100% rename from src/logo/ascii/kdelinux.txt rename to src/logo/ascii/k/kdelinux.txt diff --git a/src/logo/ascii/kdeneon.txt b/src/logo/ascii/k/kdeneon.txt similarity index 100% rename from src/logo/ascii/kdeneon.txt rename to src/logo/ascii/k/kdeneon.txt diff --git a/src/logo/ascii/kernelos.txt b/src/logo/ascii/k/kernelos.txt similarity index 100% rename from src/logo/ascii/kernelos.txt rename to src/logo/ascii/k/kernelos.txt diff --git a/src/logo/ascii/kibaos.txt b/src/logo/ascii/k/kibaos.txt similarity index 100% rename from src/logo/ascii/kibaos.txt rename to src/logo/ascii/k/kibaos.txt diff --git a/src/logo/ascii/kibojoe.txt b/src/logo/ascii/k/kibojoe.txt similarity index 100% rename from src/logo/ascii/kibojoe.txt rename to src/logo/ascii/k/kibojoe.txt diff --git a/src/logo/ascii/kiss.txt b/src/logo/ascii/k/kiss.txt similarity index 100% rename from src/logo/ascii/kiss.txt rename to src/logo/ascii/k/kiss.txt diff --git a/src/logo/ascii/kiss2.txt b/src/logo/ascii/k/kiss2.txt similarity index 100% rename from src/logo/ascii/kiss2.txt rename to src/logo/ascii/k/kiss2.txt diff --git a/src/logo/ascii/kogaion.txt b/src/logo/ascii/k/kogaion.txt similarity index 100% rename from src/logo/ascii/kogaion.txt rename to src/logo/ascii/k/kogaion.txt diff --git a/src/logo/ascii/korora.txt b/src/logo/ascii/k/korora.txt similarity index 100% rename from src/logo/ascii/korora.txt rename to src/logo/ascii/k/korora.txt diff --git a/src/logo/ascii/krassos.txt b/src/logo/ascii/k/krassos.txt similarity index 100% rename from src/logo/ascii/krassos.txt rename to src/logo/ascii/k/krassos.txt diff --git a/src/logo/ascii/kslinux.txt b/src/logo/ascii/k/kslinux.txt similarity index 100% rename from src/logo/ascii/kslinux.txt rename to src/logo/ascii/k/kslinux.txt diff --git a/src/logo/ascii/kubuntu.txt b/src/logo/ascii/k/kubuntu.txt similarity index 100% rename from src/logo/ascii/kubuntu.txt rename to src/logo/ascii/k/kubuntu.txt diff --git a/src/logo/ascii/kylin.txt b/src/logo/ascii/k/kylin.txt similarity index 100% rename from src/logo/ascii/kylin.txt rename to src/logo/ascii/k/kylin.txt diff --git a/src/logo/ascii/l.inc b/src/logo/ascii/l.inc new file mode 100644 index 0000000000..ace13ca38f --- /dev/null +++ b/src/logo/ascii/l.inc @@ -0,0 +1,326 @@ +#include "../logo.h" +#include "logo_builtin.h" +#include "common/color.h" + +static const FFlogo L[] = { + #ifdef FASTFETCH_DATATEXT_LOGO_LAINOS + // LainOS + { + .names = { "LainOS" }, + .lines = FASTFETCH_DATATEXT_LOGO_LAINOS, + .colors = { + FF_COLOR_FG_BLUE, + FF_COLOR_FG_256 "14", + FF_COLOR_FG_WHITE, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_LANGITKETUJUH + // LangitKetujuh + { + .names = { "langitketujuh", "l7" }, + .lines = FASTFETCH_DATATEXT_LOGO_LANGITKETUJUH, + .colors = { + FF_COLOR_FG_BLUE, + FF_COLOR_FG_WHITE, + }, + .colorKeys = FF_COLOR_FG_BLUE, + .colorTitle = FF_COLOR_FG_BLUE, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_LAXEROS + // Laxeros + { + .names = { "Laxeros" }, + .lines = FASTFETCH_DATATEXT_LOGO_LAXEROS, + .colors = { + FF_COLOR_FG_BLUE, + FF_COLOR_FG_WHITE, + }, + .colorKeys = FF_COLOR_FG_BLUE, + .colorTitle = FF_COLOR_FG_DEFAULT, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_LEDE + // LEDE + { + .names = { "LEDE" }, + .lines = FASTFETCH_DATATEXT_LOGO_LEDE, + .colors = { + FF_COLOR_FG_BLUE, + FF_COLOR_FG_WHITE, + }, + .colorKeys = FF_COLOR_FG_BLUE, + .colorTitle = FF_COLOR_FG_DEFAULT, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_LIBREELEC + // LibreELEC + { + .names = { "LibreELEC" }, + .lines = FASTFETCH_DATATEXT_LOGO_LIBREELEC, + .colors = { + FF_COLOR_FG_GREEN, + FF_COLOR_FG_YELLOW, + FF_COLOR_FG_WHITE, + FF_COLOR_FG_CYAN, + FF_COLOR_FG_MAGENTA, + }, + .colorKeys = FF_COLOR_FG_GREEN, + .colorTitle = FF_COLOR_FG_YELLOW, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_LILIDOG + // Lilidog + { + .names = { "Lilidog" }, + .lines = FASTFETCH_DATATEXT_LOGO_LILIDOG, + .colors = { + FF_COLOR_FG_BLUE, + }, + .colorKeys = FF_COLOR_FG_RED, + .colorTitle = FF_COLOR_FG_DEFAULT, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_LINGMO + // Lingmo OS + { + .names = { "Lingmo", "LingmoOS" }, + .lines = FASTFETCH_DATATEXT_LOGO_LINGMO, + .colors = { + FF_COLOR_FG_BLUE, + FF_COLOR_FG_WHITE, + }, + .colorKeys = FF_COLOR_FG_BLUE, + .colorTitle = FF_COLOR_FG_BLUE, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_LIMEOS + // LimeOS + { + .names = { "LimeOS" }, + .lines = FASTFETCH_DATATEXT_LOGO_LIMEOS, + .colors = { + FF_COLOR_FG_DEFAULT, + }, + .colorKeys = FF_COLOR_FG_DEFAULT, + .colorTitle = FF_COLOR_FG_DEFAULT, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_LINSPIRE + // Linspire + { + .names = { "Linspire", "Lindows" }, + .lines = FASTFETCH_DATATEXT_LOGO_LINSPIRE, + .colors = { + FF_COLOR_FG_BLUE, + FF_COLOR_FG_GREEN, + }, + .colorKeys = FF_COLOR_FG_BLUE, + .colorTitle = FF_COLOR_FG_GREEN, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_LINUX + // Linux + { + .names = { "Linux", "linux-generic" }, + .lines = FASTFETCH_DATATEXT_LOGO_LINUX, + .colors = { + FF_COLOR_FG_WHITE, + FF_COLOR_FG_LIGHT_BLACK, + FF_COLOR_FG_YELLOW, + }, + .colorKeys = FF_COLOR_FG_DEFAULT, + .colorTitle = FF_COLOR_FG_YELLOW, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_LFS + // LinuxFromScratch + { + .names = { "LinuxFromScratch", "lfs" }, + .lines = FASTFETCH_DATATEXT_LOGO_LFS, + .colors = { + FF_COLOR_FG_WHITE, + FF_COLOR_FG_BLACK, + FF_COLOR_FG_YELLOW, + }, + .colorKeys = FF_COLOR_FG_BLACK, + .colorTitle = FF_COLOR_FG_YELLOW, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_LINUX_SMALL + // LinuxSmall + { + .names = { "Linux_small", "linux-generic_small" }, + .type = FF_LOGO_LINE_TYPE_SMALL_BIT, + .lines = FASTFETCH_DATATEXT_LOGO_LINUX_SMALL, + .colors = { + FF_COLOR_FG_BLACK, + FF_COLOR_FG_WHITE, + FF_COLOR_FG_YELLOW, + }, + .colorKeys = FF_COLOR_FG_DEFAULT, + .colorTitle = FF_COLOR_FG_DEFAULT, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_LINUXLITE + // LinuxLite + { + .names = { "LinuxLite" }, + .lines = FASTFETCH_DATATEXT_LOGO_LINUXLITE, + .colors = { + FF_COLOR_FG_GREEN, + FF_COLOR_FG_WHITE, + }, + .colorKeys = FF_COLOR_FG_GREEN, + .colorTitle = FF_COLOR_FG_DEFAULT, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_LINUXLITE_SMALL + // LinuxLiteSmall + { + .names = { "LinuxLite_small" }, + .type = FF_LOGO_LINE_TYPE_SMALL_BIT, + .lines = FASTFETCH_DATATEXT_LOGO_LINUXLITE_SMALL, + .colors = { + FF_COLOR_FG_BLUE, + FF_COLOR_FG_WHITE, + }, + .colorKeys = FF_COLOR_FG_BLUE, + .colorTitle = FF_COLOR_FG_DEFAULT, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_LINUXMINT + // LinuxMint + { + .names = { "linuxmint" }, + .lines = FASTFETCH_DATATEXT_LOGO_LINUXMINT, + .colors = { + FF_COLOR_FG_GREEN, + FF_COLOR_FG_WHITE, + }, + .colorKeys = FF_COLOR_FG_GREEN, + .colorTitle = FF_COLOR_FG_GREEN, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_LINUXMINT_SMALL + // LinuxMintSmall + { + .names = { "linuxmint_small" }, + .type = FF_LOGO_LINE_TYPE_SMALL_BIT, + .lines = FASTFETCH_DATATEXT_LOGO_LINUXMINT_SMALL, + .colors = { + FF_COLOR_FG_GREEN, + FF_COLOR_FG_WHITE, + }, + .colorKeys = FF_COLOR_FG_GREEN, + .colorTitle = FF_COLOR_FG_GREEN, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_LINUXMINT2 + // LinuxMint2 + { + .names = { "linuxmint2" }, + .type = FF_LOGO_LINE_TYPE_ALTER_BIT, + .lines = FASTFETCH_DATATEXT_LOGO_LINUXMINT2, + .colors = { + FF_COLOR_FG_GREEN, + FF_COLOR_FG_WHITE, + }, + .colorKeys = FF_COLOR_FG_GREEN, + .colorTitle = FF_COLOR_FG_GREEN, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_LINUXMINT_OLD + // LinuxMintOld + { + .names = { "linuxmint_old" }, + .type = FF_LOGO_LINE_TYPE_ALTER_BIT, + .lines = FASTFETCH_DATATEXT_LOGO_LINUXMINT_OLD, + .colors = { + FF_COLOR_FG_GREEN, + FF_COLOR_FG_WHITE, + }, + .colorKeys = FF_COLOR_FG_GREEN, + .colorTitle = FF_COLOR_FG_GREEN, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_LIVE_RAIZO + // Live_Raizo + { + .names = { "Live Raizo", "Live_Raizo" }, + .lines = FASTFETCH_DATATEXT_LOGO_LIVE_RAIZO, + .colors = { + FF_COLOR_FG_YELLOW, + }, + .colorKeys = FF_COLOR_FG_YELLOW, + .colorTitle = FF_COLOR_FG_DEFAULT, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_LLIUREX + // LliureX + { + .names = { "LliureX" }, + .lines = FASTFETCH_DATATEXT_LOGO_LLIUREX, + .colors = { + FF_COLOR_FG_BLUE, + }, + .colorKeys = FF_COLOR_FG_DEFAULT, + .colorTitle = FF_COLOR_FG_BLUE, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_LMDE + // LMDE + { + .names = { "LMDE" }, + .lines = FASTFETCH_DATATEXT_LOGO_LMDE, + .colors = { + FF_COLOR_FG_GREEN, + FF_COLOR_FG_WHITE, + }, + .colorKeys = FF_COLOR_FG_GREEN, + .colorTitle = FF_COLOR_FG_DEFAULT, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_LOCOS + // Loc-OS + { + .names = { "locos", "loc-os", "Loc-OS Linux" }, + .lines = FASTFETCH_DATATEXT_LOGO_LOCOS, + .colors = { + FF_COLOR_FG_BLACK, + FF_COLOR_FG_YELLOW, + FF_COLOR_FG_WHITE, + }, + .colorKeys = FF_COLOR_FG_YELLOW, + .colorTitle = FF_COLOR_FG_RED, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_LUBUNTU + // Lubuntu + { + .names = { "lubuntu" }, + .lines = FASTFETCH_DATATEXT_LOGO_LUBUNTU, + .colors = { + FF_COLOR_FG_BLUE, + FF_COLOR_FG_WHITE, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_LUNAR + // Lunar + { + .names = { "Lunar" }, + .lines = FASTFETCH_DATATEXT_LOGO_LUNAR, + .colors = { + FF_COLOR_FG_BLUE, + FF_COLOR_FG_WHITE, + FF_COLOR_FG_YELLOW, + }, + .colorKeys = FF_COLOR_FG_BLUE, + .colorTitle = FF_COLOR_FG_DEFAULT, + }, + #endif + // LAST + {}, +}; diff --git a/src/logo/ascii/lainos.txt b/src/logo/ascii/l/lainos.txt similarity index 100% rename from src/logo/ascii/lainos.txt rename to src/logo/ascii/l/lainos.txt diff --git a/src/logo/ascii/langitketujuh.txt b/src/logo/ascii/l/langitketujuh.txt similarity index 100% rename from src/logo/ascii/langitketujuh.txt rename to src/logo/ascii/l/langitketujuh.txt diff --git a/src/logo/ascii/laxeros.txt b/src/logo/ascii/l/laxeros.txt similarity index 100% rename from src/logo/ascii/laxeros.txt rename to src/logo/ascii/l/laxeros.txt diff --git a/src/logo/ascii/lede.txt b/src/logo/ascii/l/lede.txt similarity index 100% rename from src/logo/ascii/lede.txt rename to src/logo/ascii/l/lede.txt diff --git a/src/logo/ascii/lfs.txt b/src/logo/ascii/l/lfs.txt similarity index 100% rename from src/logo/ascii/lfs.txt rename to src/logo/ascii/l/lfs.txt diff --git a/src/logo/ascii/libreelec.txt b/src/logo/ascii/l/libreelec.txt similarity index 100% rename from src/logo/ascii/libreelec.txt rename to src/logo/ascii/l/libreelec.txt diff --git a/src/logo/ascii/lilidog.txt b/src/logo/ascii/l/lilidog.txt similarity index 100% rename from src/logo/ascii/lilidog.txt rename to src/logo/ascii/l/lilidog.txt diff --git a/src/logo/ascii/limeos.txt b/src/logo/ascii/l/limeos.txt similarity index 100% rename from src/logo/ascii/limeos.txt rename to src/logo/ascii/l/limeos.txt diff --git a/src/logo/ascii/lingmo.txt b/src/logo/ascii/l/lingmo.txt similarity index 100% rename from src/logo/ascii/lingmo.txt rename to src/logo/ascii/l/lingmo.txt diff --git a/src/logo/ascii/linspire.txt b/src/logo/ascii/l/linspire.txt similarity index 100% rename from src/logo/ascii/linspire.txt rename to src/logo/ascii/l/linspire.txt diff --git a/src/logo/ascii/linux.txt b/src/logo/ascii/l/linux.txt similarity index 100% rename from src/logo/ascii/linux.txt rename to src/logo/ascii/l/linux.txt diff --git a/src/logo/ascii/linux_small.txt b/src/logo/ascii/l/linux_small.txt similarity index 100% rename from src/logo/ascii/linux_small.txt rename to src/logo/ascii/l/linux_small.txt diff --git a/src/logo/ascii/linuxlite.txt b/src/logo/ascii/l/linuxlite.txt similarity index 100% rename from src/logo/ascii/linuxlite.txt rename to src/logo/ascii/l/linuxlite.txt diff --git a/src/logo/ascii/linuxlite_small.txt b/src/logo/ascii/l/linuxlite_small.txt similarity index 100% rename from src/logo/ascii/linuxlite_small.txt rename to src/logo/ascii/l/linuxlite_small.txt diff --git a/src/logo/ascii/linuxmint.txt b/src/logo/ascii/l/linuxmint.txt similarity index 100% rename from src/logo/ascii/linuxmint.txt rename to src/logo/ascii/l/linuxmint.txt diff --git a/src/logo/ascii/linuxmint2.txt b/src/logo/ascii/l/linuxmint2.txt similarity index 100% rename from src/logo/ascii/linuxmint2.txt rename to src/logo/ascii/l/linuxmint2.txt diff --git a/src/logo/ascii/linuxmint_old.txt b/src/logo/ascii/l/linuxmint_old.txt similarity index 100% rename from src/logo/ascii/linuxmint_old.txt rename to src/logo/ascii/l/linuxmint_old.txt diff --git a/src/logo/ascii/linuxmint_small.txt b/src/logo/ascii/l/linuxmint_small.txt similarity index 100% rename from src/logo/ascii/linuxmint_small.txt rename to src/logo/ascii/l/linuxmint_small.txt diff --git a/src/logo/ascii/live_raizo.txt b/src/logo/ascii/l/live_raizo.txt similarity index 100% rename from src/logo/ascii/live_raizo.txt rename to src/logo/ascii/l/live_raizo.txt diff --git a/src/logo/ascii/lliurex.txt b/src/logo/ascii/l/lliurex.txt similarity index 100% rename from src/logo/ascii/lliurex.txt rename to src/logo/ascii/l/lliurex.txt diff --git a/src/logo/ascii/lmde.txt b/src/logo/ascii/l/lmde.txt similarity index 100% rename from src/logo/ascii/lmde.txt rename to src/logo/ascii/l/lmde.txt diff --git a/src/logo/ascii/locos.txt b/src/logo/ascii/l/locos.txt similarity index 100% rename from src/logo/ascii/locos.txt rename to src/logo/ascii/l/locos.txt diff --git a/src/logo/ascii/lubuntu.txt b/src/logo/ascii/l/lubuntu.txt similarity index 100% rename from src/logo/ascii/lubuntu.txt rename to src/logo/ascii/l/lubuntu.txt diff --git a/src/logo/ascii/lunar.txt b/src/logo/ascii/l/lunar.txt similarity index 100% rename from src/logo/ascii/lunar.txt rename to src/logo/ascii/l/lunar.txt diff --git a/src/logo/ascii/m.inc b/src/logo/ascii/m.inc new file mode 100644 index 0000000000..b0a1456918 --- /dev/null +++ b/src/logo/ascii/m.inc @@ -0,0 +1,436 @@ +#include "../logo.h" +#include "logo_builtin.h" +#include "common/color.h" + +static const FFlogo M[] = { + #ifdef FASTFETCH_DATATEXT_LOGO_MACARONIOS + // Macaroni + { + .names = { "Macaroni" }, + .lines = FASTFETCH_DATATEXT_LOGO_MACARONIOS, + .colors = { + FF_COLOR_FG_YELLOW, + FF_COLOR_FG_WHITE, + }, + .colorKeys = FF_COLOR_FG_YELLOW, + .colorTitle = FF_COLOR_FG_GREEN, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_MACOS + // MacOS + { + .names = { "macOS" }, + .lines = FASTFETCH_DATATEXT_LOGO_MACOS, + .colors = { + FF_COLOR_FG_GREEN, + FF_COLOR_FG_YELLOW, + FF_COLOR_FG_LIGHT_RED, + FF_COLOR_FG_RED, + FF_COLOR_FG_MAGENTA, + FF_COLOR_FG_BLUE, + }, + .colorKeys = FF_COLOR_FG_YELLOW, + .colorTitle = FF_COLOR_FG_GREEN, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_MACOS_SMALL + // MacOSSmall + { + .names = { "macOS_small" }, + .type = FF_LOGO_LINE_TYPE_SMALL_BIT, + .lines = FASTFETCH_DATATEXT_LOGO_MACOS_SMALL, + .colors = { + FF_COLOR_FG_GREEN, + FF_COLOR_FG_YELLOW, + FF_COLOR_FG_RED, + FF_COLOR_FG_MAGENTA, + FF_COLOR_FG_BLUE, + }, + .colorKeys = FF_COLOR_FG_YELLOW, + .colorTitle = FF_COLOR_FG_GREEN, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_MACOS2 + // MacOS2 + { + .names = { "macOS2" }, + .type = FF_LOGO_LINE_TYPE_ALTER_BIT, + .lines = FASTFETCH_DATATEXT_LOGO_MACOS2, + .colors = { + FF_COLOR_FG_GREEN, + FF_COLOR_FG_YELLOW, + FF_COLOR_FG_LIGHT_RED, + FF_COLOR_FG_RED, + FF_COLOR_FG_MAGENTA, + FF_COLOR_FG_BLUE, + }, + .colorKeys = FF_COLOR_FG_YELLOW, + .colorTitle = FF_COLOR_FG_GREEN, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_MACOS2_SMALL + // MacOS2Small + { + .names = { "macOS2_small" }, + .type = FF_LOGO_LINE_TYPE_SMALL_BIT | FF_LOGO_LINE_TYPE_ALTER_BIT, + .lines = FASTFETCH_DATATEXT_LOGO_MACOS2_SMALL, + .colors = { + FF_COLOR_FG_GREEN, + FF_COLOR_FG_YELLOW, + FF_COLOR_FG_RED, + FF_COLOR_FG_MAGENTA, + FF_COLOR_FG_BLUE, + }, + .colorKeys = FF_COLOR_FG_YELLOW, + .colorTitle = FF_COLOR_FG_GREEN, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_MACOS3 + // MacOS3 + { + .names = { "macOS3" }, + .type = FF_LOGO_LINE_TYPE_ALTER_BIT, + .lines = FASTFETCH_DATATEXT_LOGO_MACOS3, + .colors = { + FF_COLOR_FG_GREEN, + FF_COLOR_FG_YELLOW, + FF_COLOR_FG_LIGHT_RED, + FF_COLOR_FG_RED, + FF_COLOR_FG_MAGENTA, + FF_COLOR_FG_BLUE, + }, + .colorKeys = FF_COLOR_FG_YELLOW, + .colorTitle = FF_COLOR_FG_GREEN, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_MAINSAILOS + // MainsailOS + { + .names = { "MainsailOS" }, + .lines = FASTFETCH_DATATEXT_LOGO_MAINSAILOS, + .colors = { + FF_COLOR_FG_RED, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_MAINSAILOS_SMALL + // MainsailOSSmall + { + .names = { "MainsailOS_small" }, + .type = FF_LOGO_LINE_TYPE_SMALL_BIT, + .lines = FASTFETCH_DATATEXT_LOGO_MAINSAILOS_SMALL, + .colors = { + FF_COLOR_FG_RED, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_MAGEIA + // Mageia + { + .names = { "Mageia" }, + .lines = FASTFETCH_DATATEXT_LOGO_MAGEIA, + .colors = { + FF_COLOR_FG_CYAN, + FF_COLOR_FG_WHITE, + }, + .colorKeys = FF_COLOR_FG_CYAN, + .colorTitle = FF_COLOR_FG_DEFAULT, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_MAGEIA_SMALL + // MageiaSmall + { + .names = { "Mageia_small" }, + .type = FF_LOGO_LINE_TYPE_SMALL_BIT, + .lines = FASTFETCH_DATATEXT_LOGO_MAGEIA_SMALL, + .colors = { + FF_COLOR_FG_CYAN, + FF_COLOR_FG_WHITE, + }, + .colorKeys = FF_COLOR_FG_CYAN, + .colorTitle = FF_COLOR_FG_DEFAULT, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_MAGIX + // Magix + { + .names = { "Magix", "MagixOS" }, + .lines = FASTFETCH_DATATEXT_LOGO_MAGIX, + .colors = { + FF_COLOR_FG_LIGHT_MAGENTA, + FF_COLOR_FG_CYAN, + }, + .colorKeys = FF_COLOR_FG_CYAN, + .colorTitle = FF_COLOR_FG_LIGHT_MAGENTA, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_MAGPIEOS + // MagpieOS + { + .names = { "MagpieOS", "Magpie" }, + .lines = FASTFETCH_DATATEXT_LOGO_MAGPIEOS, + .colors = { + FF_COLOR_FG_GREEN, + FF_COLOR_FG_RED, + FF_COLOR_FG_YELLOW, + FF_COLOR_FG_MAGENTA, + }, + .colorKeys = FF_COLOR_FG_GREEN, + .colorTitle = FF_COLOR_FG_RED, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_MANDRIVA + // Mandriva + { + .names = { "mandriva", "mandrake" }, + .lines = FASTFETCH_DATATEXT_LOGO_MANDRIVA, + .colors = { + FF_COLOR_FG_BLUE, + FF_COLOR_FG_YELLOW, + }, + .colorKeys = FF_COLOR_FG_BLUE, + .colorTitle = FF_COLOR_FG_YELLOW, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_MANJARO + // Manjaro + { + .names = { "manjaro", "manjaro-arm" }, + .lines = FASTFETCH_DATATEXT_LOGO_MANJARO, + .colors = { + FF_COLOR_FG_GREEN, + }, + .colorKeys = FF_COLOR_FG_GREEN, + .colorTitle = FF_COLOR_FG_GREEN, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_MANJARO_SMALL + // ManjaroSmall + { + .names = { "manjaro_small", "manjaro-arm_small" }, + .type = FF_LOGO_LINE_TYPE_SMALL_BIT, + .lines = FASTFETCH_DATATEXT_LOGO_MANJARO_SMALL, + .colors = { + FF_COLOR_FG_GREEN, + }, + .colorKeys = FF_COLOR_FG_GREEN, + .colorTitle = FF_COLOR_FG_GREEN, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_MASSOS + // MassOS + { + .names = { "MassOS" }, + .lines = FASTFETCH_DATATEXT_LOGO_MASSOS, + .colors = { + FF_COLOR_FG_DEFAULT, + }, + .colorKeys = FF_COLOR_FG_DEFAULT, + .colorTitle = FF_COLOR_FG_DEFAULT, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_MATUUSOS + // MatuusOS + { + .names = { "MatuusOS", "Matuus" }, + .lines = FASTFETCH_DATATEXT_LOGO_MATUUSOS, + .colors = { + FF_COLOR_FG_YELLOW, + FF_COLOR_FG_RED, + }, + .colorKeys = FF_COLOR_FG_YELLOW, + .colorTitle = FF_COLOR_FG_RED, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_MAUI + // MaUI + { + .names = { "MaUI" }, + .lines = FASTFETCH_DATATEXT_LOGO_MAUI, + .colors = { + FF_COLOR_FG_CYAN, + }, + .colorKeys = FF_COLOR_FG_CYAN, + .colorTitle = FF_COLOR_FG_DEFAULT, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_MAUNA + // Mauna + { + .names = { "Mauna" }, + .lines = FASTFETCH_DATATEXT_LOGO_MAUNA, + .colors = { + FF_COLOR_FG_BLUE, + FF_COLOR_FG_CYAN, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_MEOWIX + // Meowix + { + .names = { "Meowix" }, + .lines = FASTFETCH_DATATEXT_LOGO_MEOWIX, + .colors = { + FF_COLOR_FG_RED, + FF_COLOR_FG_YELLOW, + FF_COLOR_FG_YELLOW, + FF_COLOR_FG_BLUE, + }, + .colorKeys = FF_COLOR_FG_RED, + .colorTitle = FF_COLOR_FG_YELLOW, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_MER + // Mer + { + .names = { "Mer" }, + .lines = FASTFETCH_DATATEXT_LOGO_MER, + .colors = { + FF_COLOR_FG_BLUE, + }, + .colorKeys = FF_COLOR_FG_BLUE, + .colorTitle = FF_COLOR_FG_DEFAULT, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_MIDNIGHTBSD + // MidnightBSD + { + .names = { "MidnightBSD" }, + .lines = FASTFETCH_DATATEXT_LOGO_MIDNIGHTBSD, + .colors = { + FF_COLOR_FG_DEFAULT, + }, + .colorKeys = FF_COLOR_FG_LIGHT_BLACK, + .colorTitle = FF_COLOR_FG_DEFAULT, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_MIDOS + // MidOS + { + .names = { "MidOS" }, + .lines = FASTFETCH_DATATEXT_LOGO_MIDOS, + .colors = { + FF_COLOR_FG_LIGHT_BLACK, + }, + .colorKeys = FF_COLOR_FG_LIGHT_BLACK, + .colorTitle = FF_COLOR_FG_DEFAULT, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_MIDOS_OLD + // MidOSOld + { + .names = { "MidOS_old" }, + .lines = FASTFETCH_DATATEXT_LOGO_MIDOS_OLD, + .type = FF_LOGO_LINE_TYPE_ALTER_BIT, + .colors = { + FF_COLOR_FG_LIGHT_BLACK, + FF_COLOR_FG_WHITE, + }, + .colorKeys = FF_COLOR_FG_LIGHT_BLACK, + .colorTitle = FF_COLOR_FG_DEFAULT, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_MINIMAL + // Minimal System + { + .names = { "Minimal_System" }, + .lines = FASTFETCH_DATATEXT_LOGO_MINIMAL, + .colors = { + FF_COLOR_FG_RED, + }, + .colorKeys = FF_COLOR_FG_CYAN, + .colorTitle = FF_COLOR_FG_DEFAULT, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_MINIX + // Minix + { + .names = { "Minix" }, + .lines = FASTFETCH_DATATEXT_LOGO_MINIX, + .colors = { + FF_COLOR_FG_RED, + FF_COLOR_FG_WHITE, + FF_COLOR_FG_YELLOW, + }, + .colorKeys = FF_COLOR_FG_RED, + .colorTitle = FF_COLOR_FG_YELLOW, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_MIRACLE_LINUX + // MiracleLinux + { + .names = { "miraclelinux" }, + .lines = FASTFETCH_DATATEXT_LOGO_MIRACLE_LINUX, + .colors = { + FF_COLOR_FG_256 "29", + }, + .colorKeys = FF_COLOR_FG_256 "29", + .colorTitle = FF_COLOR_FG_DEFAULT, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_MOS + // MOS + { + .names = { "MOS" }, + .lines = FASTFETCH_DATATEXT_LOGO_MOS, + .colors = { + FF_COLOR_FG_CYAN, + FF_COLOR_FG_BLUE, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_MSYS2 + // Msys2 + { + .names = { "Msys2" }, + .lines = FASTFETCH_DATATEXT_LOGO_MSYS2, + .colors = { + FF_COLOR_FG_MAGENTA, + FF_COLOR_FG_WHITE, + FF_COLOR_FG_RED, + }, + .colorKeys = FF_COLOR_FG_MAGENTA, + .colorTitle = FF_COLOR_FG_RED, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_MX + // MX + { + .names = { "MX" }, + .lines = FASTFETCH_DATATEXT_LOGO_MX, + .colors = { + FF_COLOR_FG_DEFAULT, + }, + .colorKeys = FF_COLOR_FG_BLUE, + .colorTitle = FF_COLOR_FG_CYAN, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_MX_SMALL + // MXSmall + { + .names = { "MX_small" }, + .type = FF_LOGO_LINE_TYPE_SMALL_BIT, + .lines = FASTFETCH_DATATEXT_LOGO_MX_SMALL, + .colors = { + FF_COLOR_FG_DEFAULT, + }, + .colorKeys = FF_COLOR_FG_BLUE, + .colorTitle = FF_COLOR_FG_CYAN, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_MX2 + // MX2 + { + .names = { "MX2" }, + .type = FF_LOGO_LINE_TYPE_ALTER_BIT, + .lines = FASTFETCH_DATATEXT_LOGO_MX2, + .colors = { + FF_COLOR_FG_DEFAULT, + }, + .colorKeys = FF_COLOR_FG_BLUE, + .colorTitle = FF_COLOR_FG_CYAN, + }, + #endif + // LAST + {}, +}; diff --git a/src/logo/ascii/macaronios.txt b/src/logo/ascii/m/macaronios.txt similarity index 100% rename from src/logo/ascii/macaronios.txt rename to src/logo/ascii/m/macaronios.txt diff --git a/src/logo/ascii/macos.txt b/src/logo/ascii/m/macos.txt similarity index 100% rename from src/logo/ascii/macos.txt rename to src/logo/ascii/m/macos.txt diff --git a/src/logo/ascii/macos2.txt b/src/logo/ascii/m/macos2.txt similarity index 100% rename from src/logo/ascii/macos2.txt rename to src/logo/ascii/m/macos2.txt diff --git a/src/logo/ascii/macos2_small.txt b/src/logo/ascii/m/macos2_small.txt similarity index 100% rename from src/logo/ascii/macos2_small.txt rename to src/logo/ascii/m/macos2_small.txt diff --git a/src/logo/ascii/macos3.txt b/src/logo/ascii/m/macos3.txt similarity index 100% rename from src/logo/ascii/macos3.txt rename to src/logo/ascii/m/macos3.txt diff --git a/src/logo/ascii/macos_small.txt b/src/logo/ascii/m/macos_small.txt similarity index 100% rename from src/logo/ascii/macos_small.txt rename to src/logo/ascii/m/macos_small.txt diff --git a/src/logo/ascii/mageia.txt b/src/logo/ascii/m/mageia.txt similarity index 100% rename from src/logo/ascii/mageia.txt rename to src/logo/ascii/m/mageia.txt diff --git a/src/logo/ascii/mageia_small.txt b/src/logo/ascii/m/mageia_small.txt similarity index 100% rename from src/logo/ascii/mageia_small.txt rename to src/logo/ascii/m/mageia_small.txt diff --git a/src/logo/ascii/magix.txt b/src/logo/ascii/m/magix.txt similarity index 100% rename from src/logo/ascii/magix.txt rename to src/logo/ascii/m/magix.txt diff --git a/src/logo/ascii/magpieos.txt b/src/logo/ascii/m/magpieos.txt similarity index 100% rename from src/logo/ascii/magpieos.txt rename to src/logo/ascii/m/magpieos.txt diff --git a/src/logo/ascii/mainsailos.txt b/src/logo/ascii/m/mainsailos.txt similarity index 100% rename from src/logo/ascii/mainsailos.txt rename to src/logo/ascii/m/mainsailos.txt diff --git a/src/logo/ascii/mainsailos_small.txt b/src/logo/ascii/m/mainsailos_small.txt similarity index 100% rename from src/logo/ascii/mainsailos_small.txt rename to src/logo/ascii/m/mainsailos_small.txt diff --git a/src/logo/ascii/mandriva.txt b/src/logo/ascii/m/mandriva.txt similarity index 100% rename from src/logo/ascii/mandriva.txt rename to src/logo/ascii/m/mandriva.txt diff --git a/src/logo/ascii/manjaro.txt b/src/logo/ascii/m/manjaro.txt similarity index 100% rename from src/logo/ascii/manjaro.txt rename to src/logo/ascii/m/manjaro.txt diff --git a/src/logo/ascii/manjaro_small.txt b/src/logo/ascii/m/manjaro_small.txt similarity index 100% rename from src/logo/ascii/manjaro_small.txt rename to src/logo/ascii/m/manjaro_small.txt diff --git a/src/logo/ascii/massos.txt b/src/logo/ascii/m/massos.txt similarity index 100% rename from src/logo/ascii/massos.txt rename to src/logo/ascii/m/massos.txt diff --git a/src/logo/ascii/matuusos.txt b/src/logo/ascii/m/matuusos.txt similarity index 100% rename from src/logo/ascii/matuusos.txt rename to src/logo/ascii/m/matuusos.txt diff --git a/src/logo/ascii/maui.txt b/src/logo/ascii/m/maui.txt similarity index 100% rename from src/logo/ascii/maui.txt rename to src/logo/ascii/m/maui.txt diff --git a/src/logo/ascii/mauna.txt b/src/logo/ascii/m/mauna.txt similarity index 100% rename from src/logo/ascii/mauna.txt rename to src/logo/ascii/m/mauna.txt diff --git a/src/logo/ascii/meowix.txt b/src/logo/ascii/m/meowix.txt similarity index 100% rename from src/logo/ascii/meowix.txt rename to src/logo/ascii/m/meowix.txt diff --git a/src/logo/ascii/mer.txt b/src/logo/ascii/m/mer.txt similarity index 100% rename from src/logo/ascii/mer.txt rename to src/logo/ascii/m/mer.txt diff --git a/src/logo/ascii/midnightbsd.txt b/src/logo/ascii/m/midnightbsd.txt similarity index 100% rename from src/logo/ascii/midnightbsd.txt rename to src/logo/ascii/m/midnightbsd.txt diff --git a/src/logo/ascii/midos.txt b/src/logo/ascii/m/midos.txt similarity index 100% rename from src/logo/ascii/midos.txt rename to src/logo/ascii/m/midos.txt diff --git a/src/logo/ascii/midos_old.txt b/src/logo/ascii/m/midos_old.txt similarity index 100% rename from src/logo/ascii/midos_old.txt rename to src/logo/ascii/m/midos_old.txt diff --git a/src/logo/ascii/minimal.txt b/src/logo/ascii/m/minimal.txt similarity index 100% rename from src/logo/ascii/minimal.txt rename to src/logo/ascii/m/minimal.txt diff --git a/src/logo/ascii/minix.txt b/src/logo/ascii/m/minix.txt similarity index 100% rename from src/logo/ascii/minix.txt rename to src/logo/ascii/m/minix.txt diff --git a/src/logo/ascii/miracle_linux.txt b/src/logo/ascii/m/miracle_linux.txt similarity index 100% rename from src/logo/ascii/miracle_linux.txt rename to src/logo/ascii/m/miracle_linux.txt diff --git a/src/logo/ascii/mos.txt b/src/logo/ascii/m/mos.txt similarity index 100% rename from src/logo/ascii/mos.txt rename to src/logo/ascii/m/mos.txt diff --git a/src/logo/ascii/msys2.txt b/src/logo/ascii/m/msys2.txt similarity index 100% rename from src/logo/ascii/msys2.txt rename to src/logo/ascii/m/msys2.txt diff --git a/src/logo/ascii/mx.txt b/src/logo/ascii/m/mx.txt similarity index 100% rename from src/logo/ascii/mx.txt rename to src/logo/ascii/m/mx.txt diff --git a/src/logo/ascii/mx2.txt b/src/logo/ascii/m/mx2.txt similarity index 100% rename from src/logo/ascii/mx2.txt rename to src/logo/ascii/m/mx2.txt diff --git a/src/logo/ascii/mx_small.txt b/src/logo/ascii/m/mx_small.txt similarity index 100% rename from src/logo/ascii/mx_small.txt rename to src/logo/ascii/m/mx_small.txt diff --git a/src/logo/ascii/n.inc b/src/logo/ascii/n.inc new file mode 100644 index 0000000000..e45d33ed13 --- /dev/null +++ b/src/logo/ascii/n.inc @@ -0,0 +1,266 @@ +#include "../logo.h" +#include "logo_builtin.h" +#include "common/color.h" + +static const FFlogo N[] = { + #ifdef FASTFETCH_DATATEXT_LOGO_NAMIB + // Namib + { + .names = { "Namib" }, + .lines = FASTFETCH_DATATEXT_LOGO_NAMIB, + .colors = { + FF_COLOR_FG_RED, + FF_COLOR_FG_WHITE, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_NEBIOS + // NebiOS + { + .names = { "NebiOS" }, + .lines = FASTFETCH_DATATEXT_LOGO_NEBIOS, + .colors = { + FF_COLOR_FG_RGB "255;95;95", + FF_COLOR_FG_RGB "252;146;84", + FF_COLOR_FG_RGB "248;196;72", + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_NEKOS + // Nekos + { + .names = { "Nekos" }, + .lines = FASTFETCH_DATATEXT_LOGO_NEKOS, + .colors = { + FF_COLOR_FG_YELLOW, + FF_COLOR_FG_WHITE, + FF_COLOR_FG_RED, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_NEPTUNE + // Neptune + { + .names = { "Neptune" }, + .lines = FASTFETCH_DATATEXT_LOGO_NEPTUNE, + .colors = { + FF_COLOR_FG_WHITE, + FF_COLOR_FG_WHITE, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_NETRUNNER + // NetRunner + { + .names = { "NetRunner" }, + .lines = FASTFETCH_DATATEXT_LOGO_NETRUNNER, + .colors = { + FF_COLOR_FG_BLUE, + FF_COLOR_FG_WHITE, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_NEXALINUX + // NexaLinux + { + .names = { "nexalinux" }, + .lines = FASTFETCH_DATATEXT_LOGO_NEXALINUX, + .colors = { + FF_COLOR_FG_LIGHT_BLUE, + FF_COLOR_FG_LIGHT_BLUE, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_NITRUX + // Nitrux + { + .names = { "Nitrux" }, + .lines = FASTFETCH_DATATEXT_LOGO_NITRUX, + .colors = { + FF_COLOR_FG_BLUE, + FF_COLOR_FG_WHITE, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_NIXOS + // NixOS + { + .names = { "NixOS" }, + .lines = FASTFETCH_DATATEXT_LOGO_NIXOS, + .colors = { + FF_COLOR_FG_BLUE, + FF_COLOR_FG_CYAN, + FF_COLOR_FG_BLUE, + FF_COLOR_FG_CYAN, + FF_COLOR_FG_BLUE, + FF_COLOR_FG_CYAN, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_NIXOS_SMALL + // NixOSSmall + { + .names = { "NixOS_small" }, + .type = FF_LOGO_LINE_TYPE_SMALL_BIT, + .lines = FASTFETCH_DATATEXT_LOGO_NIXOS_SMALL, + .colors = { + FF_COLOR_FG_BLUE, + FF_COLOR_FG_CYAN, + FF_COLOR_FG_BLUE, + FF_COLOR_FG_CYAN, + FF_COLOR_FG_BLUE, + FF_COLOR_FG_CYAN, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_NIXOS_OLD + // NixOSOld + { + .names = { "nixos_old" }, + .type = FF_LOGO_LINE_TYPE_ALTER_BIT, + .lines = FASTFETCH_DATATEXT_LOGO_NIXOS_OLD, + .colors = { + FF_COLOR_FG_BLUE, + FF_COLOR_FG_CYAN, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_NIXOS_OLD_SMALL + // NixOsOldSmall + { + .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 = { + FF_COLOR_FG_BLUE, + FF_COLOR_FG_CYAN, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_NIXOS_OLD_SMALL + // NixOS2 + { + .names = { "NixOS2" }, + .lines = FASTFETCH_DATATEXT_LOGO_NIXOS2, + .colors = { + FF_COLOR_FG_BLUE, + FF_COLOR_FG_CYAN, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_NETBSD + // NetBSD + { + .names = { "NetBSD" }, + .lines = FASTFETCH_DATATEXT_LOGO_NETBSD, + .colors = { + FF_COLOR_FG_RED, + FF_COLOR_FG_WHITE, + }, + .colorKeys = FF_COLOR_FG_RED, + .colorTitle = FF_COLOR_FG_DEFAULT, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_NETBSD2 + // NetBSD2 + { + .names = { "NetBSD2" }, + .lines = FASTFETCH_DATATEXT_LOGO_NETBSD2, + .type = FF_LOGO_LINE_TYPE_ALTER_BIT, + .colors = { + FF_COLOR_FG_RED, + FF_COLOR_FG_WHITE, + }, + .colorKeys = FF_COLOR_FG_RED, + .colorTitle = FF_COLOR_FG_DEFAULT, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_NETBSD_SMALL + // NetBSD Small + { + .names = { "NetBSD_small" }, + .lines = FASTFETCH_DATATEXT_LOGO_NETBSD_SMALL, + .type = FF_LOGO_LINE_TYPE_SMALL_BIT, + .colors = { + FF_COLOR_FG_RED, + FF_COLOR_FG_WHITE, + }, + .colorKeys = FF_COLOR_FG_RED, + .colorTitle = FF_COLOR_FG_DEFAULT, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_NOBARA + // Nobara + { + .names = { "nobara" }, + .lines = FASTFETCH_DATATEXT_LOGO_NOBARA, + .colors = { + FF_COLOR_FG_DEFAULT, + }, + .colorKeys = FF_COLOR_FG_DEFAULT, + .colorTitle = FF_COLOR_FG_DEFAULT, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_NOMADBSD + // NomadBSD + { + .names = { "nomadbsd" }, + .lines = FASTFETCH_DATATEXT_LOGO_NOMADBSD, + .colors = { + FF_COLOR_FG_BLUE, + }, + .colorKeys = FF_COLOR_FG_BLUE, + .colorTitle = FF_COLOR_FG_DEFAULT, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_NUROS + // NurOS + { + .names = { "NurOS" }, + .lines = FASTFETCH_DATATEXT_LOGO_NUROS, + .colors = { + FF_COLOR_FG_RGB "41;19;182", + FF_COLOR_FG_RGB "31;59;205", + FF_COLOR_FG_RGB "18;95;225", + FF_COLOR_FG_RGB "13;125;250", + }, + .colorKeys = FF_COLOR_FG_RGB "13;125;250", + .colorTitle = FF_COLOR_FG_RGB "41;19;182", + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_NURUNNER + // Nurunner + { + .names = { "Nurunner" }, + .lines = FASTFETCH_DATATEXT_LOGO_NURUNNER, + .colors = { + FF_COLOR_FG_BLUE, + FF_COLOR_FG_WHITE, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_NUTYX + // NuTyX + { + .names = { "NuTyX" }, + .lines = FASTFETCH_DATATEXT_LOGO_NUTYX, + .colors = { + FF_COLOR_FG_BLUE, + FF_COLOR_FG_RED, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_NETHYDRA + // NetHydra + { + .names = { "NetHydra" }, + .lines = FASTFETCH_DATATEXT_LOGO_NETHYDRA, + .colors = { + FF_COLOR_FG_RED, + FF_COLOR_FG_DEFAULT, + }, + }, + #endif + // LAST + {}, +}; diff --git a/src/logo/ascii/namib.txt b/src/logo/ascii/n/namib.txt similarity index 100% rename from src/logo/ascii/namib.txt rename to src/logo/ascii/n/namib.txt diff --git a/src/logo/ascii/nebios.txt b/src/logo/ascii/n/nebios.txt similarity index 100% rename from src/logo/ascii/nebios.txt rename to src/logo/ascii/n/nebios.txt diff --git a/src/logo/ascii/nekos.txt b/src/logo/ascii/n/nekos.txt similarity index 100% rename from src/logo/ascii/nekos.txt rename to src/logo/ascii/n/nekos.txt diff --git a/src/logo/ascii/neptune.txt b/src/logo/ascii/n/neptune.txt similarity index 100% rename from src/logo/ascii/neptune.txt rename to src/logo/ascii/n/neptune.txt diff --git a/src/logo/ascii/netbsd.txt b/src/logo/ascii/n/netbsd.txt similarity index 100% rename from src/logo/ascii/netbsd.txt rename to src/logo/ascii/n/netbsd.txt diff --git a/src/logo/ascii/netbsd2.txt b/src/logo/ascii/n/netbsd2.txt similarity index 100% rename from src/logo/ascii/netbsd2.txt rename to src/logo/ascii/n/netbsd2.txt diff --git a/src/logo/ascii/netbsd_small.txt b/src/logo/ascii/n/netbsd_small.txt similarity index 100% rename from src/logo/ascii/netbsd_small.txt rename to src/logo/ascii/n/netbsd_small.txt diff --git a/src/logo/ascii/nethydra.txt b/src/logo/ascii/n/nethydra.txt similarity index 100% rename from src/logo/ascii/nethydra.txt rename to src/logo/ascii/n/nethydra.txt diff --git a/src/logo/ascii/netrunner.txt b/src/logo/ascii/n/netrunner.txt similarity index 100% rename from src/logo/ascii/netrunner.txt rename to src/logo/ascii/n/netrunner.txt diff --git a/src/logo/ascii/nexalinux.txt b/src/logo/ascii/n/nexalinux.txt similarity index 100% rename from src/logo/ascii/nexalinux.txt rename to src/logo/ascii/n/nexalinux.txt diff --git a/src/logo/ascii/nitrux.txt b/src/logo/ascii/n/nitrux.txt similarity index 100% rename from src/logo/ascii/nitrux.txt rename to src/logo/ascii/n/nitrux.txt diff --git a/src/logo/ascii/nixos.txt b/src/logo/ascii/n/nixos.txt similarity index 100% rename from src/logo/ascii/nixos.txt rename to src/logo/ascii/n/nixos.txt diff --git a/src/logo/ascii/n/nixos2.txt b/src/logo/ascii/n/nixos2.txt new file mode 100644 index 0000000000..0e875b326d --- /dev/null +++ b/src/logo/ascii/n/nixos2.txt @@ -0,0 +1,17 @@ +$1 __ $2____ __ +$1 / \ $2\ \ / \ +$1 \ \ $2\ \/ / +$1 ___\ \___$2\ / +$1 / $2\ / $1/\ +$1 /______________$2\ \ $1/ \ +$2 / / $2\ \$1/ / +$2 ______/ / $2\ $1/ /___ +$2/ / $2\$1/ \ +$2\____ /$1\ $1/ ______/ +$2 / /$1 \ $1/ / +$2 / /$1\ \$2______$1/$2___$1/$2_____ +$2 \ /$1 \ \$2 / +$2 \/$1 / \$2____ ____/ + $1 / \$2 \ \ + $1/ /\ \$2 \ \ + $1\__/ \___\$2 \__/ \ No newline at end of file diff --git a/src/logo/ascii/nixos_old.txt b/src/logo/ascii/n/nixos_old.txt similarity index 100% rename from src/logo/ascii/nixos_old.txt rename to src/logo/ascii/n/nixos_old.txt diff --git a/src/logo/ascii/nixos_old_small.txt b/src/logo/ascii/n/nixos_old_small.txt similarity index 100% rename from src/logo/ascii/nixos_old_small.txt rename to src/logo/ascii/n/nixos_old_small.txt diff --git a/src/logo/ascii/nixos_small.txt b/src/logo/ascii/n/nixos_small.txt similarity index 74% rename from src/logo/ascii/nixos_small.txt rename to src/logo/ascii/n/nixos_small.txt index 524f96c2ee..8c3b2a79e9 100644 --- a/src/logo/ascii/nixos_small.txt +++ b/src/logo/ascii/n/nixos_small.txt @@ -1,7 +1,7 @@ $1 ▗▄ $2▗▄ ▄▖ $1 ▄▄🬸█▄▄▄$2🬸█▛ $3▃ -$6 ▟▛ ▜$3▃▟🬕 +$6 ▟▛ $2▜$3▃▟🬕 $6🬋🬋🬫█ $3█🬛🬋🬋 -$6 🬷▛🮃$5▙ $4▟▛ +$6 🬷▛🮃$5▙ $3▟▛ $6 🮃 $5▟█🬴$4▀▀▀█🬴▀▀ $5▝▀ ▀▘ $4▀▘ \ No newline at end of file diff --git a/src/logo/ascii/nobara.txt b/src/logo/ascii/n/nobara.txt similarity index 100% rename from src/logo/ascii/nobara.txt rename to src/logo/ascii/n/nobara.txt diff --git a/src/logo/ascii/nomadbsd.txt b/src/logo/ascii/n/nomadbsd.txt similarity index 100% rename from src/logo/ascii/nomadbsd.txt rename to src/logo/ascii/n/nomadbsd.txt diff --git a/src/logo/ascii/n/nuros.txt b/src/logo/ascii/n/nuros.txt new file mode 100644 index 0000000000..28b2fac41b --- /dev/null +++ b/src/logo/ascii/n/nuros.txt @@ -0,0 +1,8 @@ + ⢀⣤⣶⠿⠿⠿⠿⢷⣶⣄⡀ + ⣰⡿⠋⠁⢀⣠⣤⣀⡀⠈⠙⢿⣄ +$2⣸⡿⠁⢀⣾⣿⣿⣿⣿⣿⣷⡀⠈⢿⡆ +⣿⠃ ⣾⣿⣿⣿⡿⣟⣾⡽⣷ ⠸⣿ +$3⣿⡄ ⢿⣿⣿⣟⣿⣻⣽⣻⡽ ⢰⣟ +⠸⣷⡀⠈⠿⣷⣻⢷⣻⣞⠷⠁⢀⣾⠇ +$4 ⠙⣷⣄⡀⠈⠉⠉⠁ ⢀⣤⡿⠋ + ⠙⠿⢷⣶⣶⣶⠾⠟⠋ diff --git a/src/logo/ascii/nurunner.txt b/src/logo/ascii/n/nurunner.txt similarity index 100% rename from src/logo/ascii/nurunner.txt rename to src/logo/ascii/n/nurunner.txt diff --git a/src/logo/ascii/nutyx.txt b/src/logo/ascii/n/nutyx.txt similarity index 100% rename from src/logo/ascii/nutyx.txt rename to src/logo/ascii/n/nutyx.txt diff --git a/src/logo/ascii/nuros.txt b/src/logo/ascii/nuros.txt deleted file mode 100644 index 577b9c4d57..0000000000 --- a/src/logo/ascii/nuros.txt +++ /dev/null @@ -1,12 +0,0 @@ - ___╓╓___ - _▄▄▓▓▀▀╜╜╨▀▓▓▓╗_ - ╓▓▓▀² `╙▓▓╖ - ╣▓▀ _▄▓▓▓▓▓▓W_ ╙▓▓ - ╣▓╜ ,▓▓▓▓▓▓▓▓▓▓▓▓_ ²▓▓ -╒▓▌ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ║▓m -╞▓▓ í▓▓▓▓▓▓▓▓▓▓▓▓▓▓h ╞▓╡ -²▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ║▓h - ║▓▄ ╙▓▓▓▓▓▓▓▓▓▓╜ ƒ▓▓ - ╙▓▓_ ⁿ╙╨╝╝╝╜² _╢▓╜ - ╙▓▓╗__ _╗▓▓╜ - `╙╝▓▓▓▓▓▓▓▓╝╙ \ No newline at end of file diff --git a/src/logo/ascii/o.inc b/src/logo/ascii/o.inc new file mode 100644 index 0000000000..0ddb7fdf42 --- /dev/null +++ b/src/logo/ascii/o.inc @@ -0,0 +1,460 @@ +#include "../logo.h" +#include "logo_builtin.h" +#include "common/color.h" + +static const FFlogo O[] = { + #ifdef FASTFETCH_DATATEXT_LOGO_OBARUN + // Obarun + { + .names = { "Obarun" }, + .lines = FASTFETCH_DATATEXT_LOGO_OBARUN, + .colors = { + FF_COLOR_FG_CYAN, + FF_COLOR_FG_WHITE, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_OBREVENGE + // OBRevenge + { + .names = { "OBRevenge" }, + .lines = FASTFETCH_DATATEXT_LOGO_OBREVENGE, + .colors = { + FF_COLOR_FG_RED, + FF_COLOR_FG_WHITE, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_OBSIDIANOS + // ObsidianOS + { + .names = { "ObsidianOS" }, + .lines = FASTFETCH_DATATEXT_LOGO_OBSIDIANOS, + .colors = { + FF_COLOR_FG_MAGENTA, + FF_COLOR_FG_CYAN, + FF_COLOR_FG_LIGHT_BLUE, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_OMNIOS + // OmniOS + { + .names = { "OmniOS" }, + .lines = FASTFETCH_DATATEXT_LOGO_OMNIOS, + .colors = { + FF_COLOR_FG_WHITE, + FF_COLOR_FG_YELLOW, + FF_COLOR_FG_LIGHT_BLACK, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_OPENKYLIN + // OpenKylin + { + .names = { "openkylin", "open-kylin" }, + .lines = FASTFETCH_DATATEXT_LOGO_OPENKYLIN, + .colors = { + FF_COLOR_FG_GREEN, + FF_COLOR_FG_WHITE, + }, + .colorKeys = FF_COLOR_FG_GREEN, + .colorTitle = FF_COLOR_FG_DEFAULT, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_OPENBSD + // OpenBSD + { + .names = { "openbsd" }, + .lines = FASTFETCH_DATATEXT_LOGO_OPENBSD, + .colors = { + FF_COLOR_FG_YELLOW, + FF_COLOR_FG_WHITE, + FF_COLOR_FG_CYAN, + FF_COLOR_FG_RED, + FF_COLOR_FG_LIGHT_BLACK, + }, + .colorKeys = FF_COLOR_FG_YELLOW, + .colorTitle = FF_COLOR_FG_DEFAULT, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_OPENBSD_SMALL + // OpenBSDSmall + { + .names = { "openbsd_small" }, + .type = FF_LOGO_LINE_TYPE_SMALL_BIT, + .lines = FASTFETCH_DATATEXT_LOGO_OPENBSD_SMALL, + .colors = { + FF_COLOR_FG_YELLOW, + FF_COLOR_FG_WHITE, + }, + .colorKeys = FF_COLOR_FG_YELLOW, + .colorTitle = FF_COLOR_FG_DEFAULT, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_OPENEULER + // OpenEuler + { + .names = { "OpenEuler" }, + .lines = FASTFETCH_DATATEXT_LOGO_OPENEULER, + .colors = { + FF_COLOR_FG_BLUE, + FF_COLOR_FG_WHITE, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_OPENINDIANA + // OpenIndiana + { + .names = { "OpenIndiana" }, + .lines = FASTFETCH_DATATEXT_LOGO_OPENINDIANA, + .colors = { + FF_COLOR_FG_BLUE, + FF_COLOR_FG_DEFAULT, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_OPENMAMBA + // OpenMamba + { + .names = { "OpenMamba" }, + .lines = FASTFETCH_DATATEXT_LOGO_OPENMAMBA, + .colors = { + FF_COLOR_FG_WHITE, + FF_COLOR_FG_GREEN, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_OPENRUYI + // openRuyi + { + .names = { "openRuyi" }, + .lines = FASTFETCH_DATATEXT_LOGO_OPENRUYI, + .colors = { + FF_COLOR_FG_BLUE, + FF_COLOR_FG_YELLOW, + FF_COLOR_FG_LIGHT_YELLOW, + }, + .colorKeys = FF_COLOR_FG_BLUE, + .colorTitle = FF_COLOR_FG_DEFAULT, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_OPENSTAGE + // OpenStage + { + .names = { "OpenStage" }, + .lines = FASTFETCH_DATATEXT_LOGO_OPENSTAGE, + .colors = { + FF_COLOR_FG_GREEN, + FF_COLOR_FG_WHITE, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_OPENSUSE + // OpenSuse + { + .names = { "opensuse" }, + .lines = FASTFETCH_DATATEXT_LOGO_OPENSUSE, + .colors = { + FF_COLOR_FG_GREEN, + FF_COLOR_FG_WHITE, + }, + .colorKeys = FF_COLOR_FG_GREEN, + .colorTitle = FF_COLOR_FG_GREEN, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_OPENSUSE_SMALL + // OpenSuseSmall + { + .names = { "opensuse_small" }, + .type = FF_LOGO_LINE_TYPE_SMALL_BIT, + .lines = FASTFETCH_DATATEXT_LOGO_OPENSUSE_SMALL, + .colors = { + FF_COLOR_FG_GREEN, + }, + .colorKeys = FF_COLOR_FG_GREEN, + .colorTitle = FF_COLOR_FG_GREEN, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_OPENSUSE_MICROOS + // openSuseMicroOS + { + .names = { "opensuse-microos" }, + .lines = FASTFETCH_DATATEXT_LOGO_OPENSUSE_MICROOS, + .colors = { + FF_COLOR_FG_GREEN, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_OPENSUSE_LEAP + // OpenSuseLeap + { + .names = { "opensuse-leap" }, + .lines = FASTFETCH_DATATEXT_LOGO_OPENSUSE_LEAP, + .colors = { + FF_COLOR_FG_DEFAULT, + }, + .colorKeys = FF_COLOR_FG_GREEN, + .colorTitle = FF_COLOR_FG_GREEN, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_OPENSUSE_LEAP_OLD + // OpenSuseLeapOld + { + .names = { "opensuse-leap_old" }, + .lines = FASTFETCH_DATATEXT_LOGO_OPENSUSE_LEAP_OLD, + .type = FF_LOGO_LINE_TYPE_ALTER_BIT, + .colors = { + FF_COLOR_FG_DEFAULT, + }, + .colorKeys = FF_COLOR_FG_GREEN, + .colorTitle = FF_COLOR_FG_GREEN, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_OPENSUSE_TUMBLEWEED + // OpenSuseTumbleweed + { + .names = { "opensuse-tumbleweed" }, + .lines = FASTFETCH_DATATEXT_LOGO_OPENSUSE_TUMBLEWEED, + .colors = { + FF_COLOR_FG_DEFAULT, + }, + .colorKeys = FF_COLOR_FG_GREEN, + .colorTitle = FF_COLOR_FG_GREEN, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_OPENSUSE_TUMBLEWEED_SMALL + // OpenSuseTumbleweedSmall + { + .names = { "opensuse-tumbleweed_small" }, + .lines = FASTFETCH_DATATEXT_LOGO_OPENSUSE_TUMBLEWEED_SMALL, + .type = FF_LOGO_LINE_TYPE_SMALL_BIT, + .colors = { + FF_COLOR_FG_DEFAULT, + }, + .colorKeys = FF_COLOR_FG_GREEN, + .colorTitle = FF_COLOR_FG_GREEN, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_OPENSUSE_TUMBLEWEED_OLD + // OpenSuseTumbleweedOld + { + .names = { "opensuse-tumbleweed_old" }, + .lines = FASTFETCH_DATATEXT_LOGO_OPENSUSE_TUMBLEWEED_OLD, + .type = FF_LOGO_LINE_TYPE_ALTER_BIT, + .colors = { + FF_COLOR_FG_DEFAULT, + }, + .colorKeys = FF_COLOR_FG_GREEN, + .colorTitle = FF_COLOR_FG_GREEN, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_OPENSUSE_TUMBLEWEED2 + // OpenSuseTumbleweed2 + { + .names = { "opensuse-tumbleweed2" }, + .lines = FASTFETCH_DATATEXT_LOGO_OPENSUSE_TUMBLEWEED2, + .type = FF_LOGO_LINE_TYPE_ALTER_BIT, + .colors = { + FF_COLOR_FG_DEFAULT, + }, + .colorKeys = FF_COLOR_FG_GREEN, + .colorTitle = FF_COLOR_FG_GREEN, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_OPENSUSE_SLOWROLL + // openSUSESlowroll + { + .names = { "opensuse-slowroll", "opensuse-tumbleweed-slowroll" }, + .lines = FASTFETCH_DATATEXT_LOGO_OPENSUSE_SLOWROLL, + .colors = { + FF_COLOR_FG_DEFAULT, + }, + .colorKeys = FF_COLOR_FG_GREEN, + .colorTitle = FF_COLOR_FG_GREEN, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_OPENMANDRIVA + // OpenMandriva + { + .names = { "openmandriva", "open-mandriva", "open_mandriva", "openmandriva lx" }, + .lines = FASTFETCH_DATATEXT_LOGO_OPENMANDRIVA, + .colors = { + FF_COLOR_FG_BLUE, + }, + .colorKeys = FF_COLOR_FG_BLUE, + .colorTitle = FF_COLOR_FG_BLUE, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_OPENWRT + // OpenWrt + { + .names = { "openwrt" }, + .lines = FASTFETCH_DATATEXT_LOGO_OPENWRT, + .colors = { + FF_COLOR_FG_BLUE, + }, + .colorKeys = FF_COLOR_FG_BLUE, + .colorTitle = FF_COLOR_FG_DEFAULT, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_OPNSENSE + // OPNsense + { + .names = { "OPNsense" }, + .lines = FASTFETCH_DATATEXT_LOGO_OPNSENSE, + .colors = { + FF_COLOR_FG_WHITE, + FF_COLOR_FG_256 "202", + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_ORACLE + // Oracle + { + .names = { "oracle", "oracle linux", "oracle linux server" }, + .lines = FASTFETCH_DATATEXT_LOGO_ORACLE, + .colors = { + FF_COLOR_FG_RED, + }, + .colorKeys = FF_COLOR_FG_RED, + .colorTitle = FF_COLOR_FG_DEFAULT, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_ORCHID + // Orchid + { + .names = { "orchid" }, + .lines = FASTFETCH_DATATEXT_LOGO_ORCHID, + .colors = { + FF_COLOR_FG_WHITE, + FF_COLOR_FG_MAGENTA, + FF_COLOR_FG_MAGENTA, + }, + .colorKeys = FF_COLOR_FG_DEFAULT, + .colorTitle = FF_COLOR_FG_MAGENTA, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_ORCHID_SMALL + // OrchidSmall + { + .names = { "orchid_small" }, + .type = FF_LOGO_LINE_TYPE_SMALL_BIT, + .lines = FASTFETCH_DATATEXT_LOGO_ORCHID_SMALL, + .colors = { + FF_COLOR_FG_WHITE, + FF_COLOR_FG_MAGENTA, + FF_COLOR_FG_MAGENTA, + }, + .colorKeys = FF_COLOR_FG_DEFAULT, + .colorTitle = FF_COLOR_FG_MAGENTA, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_OREON + // Oreon + { + .names = { "Oreon" }, + .lines = FASTFETCH_DATATEXT_LOGO_OREON, + .colors = { + FF_COLOR_FG_DEFAULT, + FF_COLOR_FG_DEFAULT, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_ORIGAMI + // Origami + { + .names = { "Origami" }, + .lines = FASTFETCH_DATATEXT_LOGO_ORIGAMI, + .colors = { + FF_COLOR_FG_RGB "185;210;235", // $1 sail — light sky blue + FF_COLOR_FG_RGB "40;90;160", // $2 hull — deeper navy + }, + .colorKeys = FF_COLOR_FG_BLUE, + .colorTitle = FF_COLOR_FG_DEFAULT, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_ORIGAMI_SMALL + // OrigamiSmall + { + .names = { "Origami_small" }, + .type = FF_LOGO_LINE_TYPE_SMALL_BIT, + .lines = FASTFETCH_DATATEXT_LOGO_ORIGAMI_SMALL, + .colors = { + FF_COLOR_FG_RGB "185;210;235", // $1 sail — light sky blue + FF_COLOR_FG_RGB "40;90;160", // $2 hull — deeper navy + }, + .colorKeys = FF_COLOR_FG_BLUE, + .colorTitle = FF_COLOR_FG_DEFAULT, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_OS2WARP + // OS/2 Warp + { + .names = { "OS2Warp" }, + .lines = FASTFETCH_DATATEXT_LOGO_OS2WARP, + .colors = { + FF_COLOR_FG_LIGHT_WHITE, + FF_COLOR_FG_LIGHT_BLUE, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_OS_ELBRUS + // OS_Elbrus + { + .names = { "OS Elbrus" }, + .lines = FASTFETCH_DATATEXT_LOGO_OS_ELBRUS, + .colors = { + FF_COLOR_FG_BLUE, + FF_COLOR_FG_WHITE, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_OSMC + // OSMC + { + .names = { "OSMC", "Open Source Media Center" }, + .lines = FASTFETCH_DATATEXT_LOGO_OSMC, + .colors = { + FF_COLOR_FG_BLUE, + FF_COLOR_FG_WHITE, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_MACOS + // OSX + { + .names = { "OSX" }, + .lines = FASTFETCH_DATATEXT_LOGO_MACOS, + .colors = { + FF_COLOR_FG_GREEN, + FF_COLOR_FG_YELLOW, + FF_COLOR_FG_LIGHT_RED, + FF_COLOR_FG_RED, + FF_COLOR_FG_MAGENTA, + FF_COLOR_FG_BLUE, + }, + .colorKeys = FF_COLOR_FG_YELLOW, + .colorTitle = FF_COLOR_FG_GREEN, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_MACOS_SMALL + // OSXSmall + { + .names = { "OSX_small" }, + .type = FF_LOGO_LINE_TYPE_SMALL_BIT, + .lines = FASTFETCH_DATATEXT_LOGO_MACOS_SMALL, + .colors = { + FF_COLOR_FG_GREEN, + FF_COLOR_FG_YELLOW, + FF_COLOR_FG_RED, + FF_COLOR_FG_MAGENTA, + FF_COLOR_FG_BLUE, + }, + .colorKeys = FF_COLOR_FG_YELLOW, + .colorTitle = FF_COLOR_FG_GREEN, + }, + #endif + // LAST + {}, +}; diff --git a/src/logo/ascii/obarun.txt b/src/logo/ascii/o/obarun.txt similarity index 100% rename from src/logo/ascii/obarun.txt rename to src/logo/ascii/o/obarun.txt diff --git a/src/logo/ascii/obrevenge.txt b/src/logo/ascii/o/obrevenge.txt similarity index 100% rename from src/logo/ascii/obrevenge.txt rename to src/logo/ascii/o/obrevenge.txt diff --git a/src/logo/ascii/obsidianos.txt b/src/logo/ascii/o/obsidianos.txt similarity index 100% rename from src/logo/ascii/obsidianos.txt rename to src/logo/ascii/o/obsidianos.txt diff --git a/src/logo/ascii/omnios.txt b/src/logo/ascii/o/omnios.txt similarity index 100% rename from src/logo/ascii/omnios.txt rename to src/logo/ascii/o/omnios.txt diff --git a/src/logo/ascii/openbsd.txt b/src/logo/ascii/o/openbsd.txt similarity index 100% rename from src/logo/ascii/openbsd.txt rename to src/logo/ascii/o/openbsd.txt diff --git a/src/logo/ascii/openbsd_small.txt b/src/logo/ascii/o/openbsd_small.txt similarity index 100% rename from src/logo/ascii/openbsd_small.txt rename to src/logo/ascii/o/openbsd_small.txt diff --git a/src/logo/ascii/openeuler.txt b/src/logo/ascii/o/openeuler.txt similarity index 100% rename from src/logo/ascii/openeuler.txt rename to src/logo/ascii/o/openeuler.txt diff --git a/src/logo/ascii/openindiana.txt b/src/logo/ascii/o/openindiana.txt similarity index 100% rename from src/logo/ascii/openindiana.txt rename to src/logo/ascii/o/openindiana.txt diff --git a/src/logo/ascii/openkylin.txt b/src/logo/ascii/o/openkylin.txt similarity index 100% rename from src/logo/ascii/openkylin.txt rename to src/logo/ascii/o/openkylin.txt diff --git a/src/logo/ascii/openmamba.txt b/src/logo/ascii/o/openmamba.txt similarity index 100% rename from src/logo/ascii/openmamba.txt rename to src/logo/ascii/o/openmamba.txt diff --git a/src/logo/ascii/openmandriva.txt b/src/logo/ascii/o/openmandriva.txt similarity index 100% rename from src/logo/ascii/openmandriva.txt rename to src/logo/ascii/o/openmandriva.txt diff --git a/src/logo/ascii/openruyi.txt b/src/logo/ascii/o/openruyi.txt similarity index 100% rename from src/logo/ascii/openruyi.txt rename to src/logo/ascii/o/openruyi.txt diff --git a/src/logo/ascii/openstage.txt b/src/logo/ascii/o/openstage.txt similarity index 100% rename from src/logo/ascii/openstage.txt rename to src/logo/ascii/o/openstage.txt diff --git a/src/logo/ascii/opensuse.txt b/src/logo/ascii/o/opensuse.txt similarity index 100% rename from src/logo/ascii/opensuse.txt rename to src/logo/ascii/o/opensuse.txt diff --git a/src/logo/ascii/opensuse_leap.txt b/src/logo/ascii/o/opensuse_leap.txt similarity index 100% rename from src/logo/ascii/opensuse_leap.txt rename to src/logo/ascii/o/opensuse_leap.txt diff --git a/src/logo/ascii/opensuse_leap_old.txt b/src/logo/ascii/o/opensuse_leap_old.txt similarity index 100% rename from src/logo/ascii/opensuse_leap_old.txt rename to src/logo/ascii/o/opensuse_leap_old.txt diff --git a/src/logo/ascii/opensuse_microos.txt b/src/logo/ascii/o/opensuse_microos.txt similarity index 100% rename from src/logo/ascii/opensuse_microos.txt rename to src/logo/ascii/o/opensuse_microos.txt diff --git a/src/logo/ascii/opensuse_slowroll.txt b/src/logo/ascii/o/opensuse_slowroll.txt similarity index 100% rename from src/logo/ascii/opensuse_slowroll.txt rename to src/logo/ascii/o/opensuse_slowroll.txt diff --git a/src/logo/ascii/opensuse_small.txt b/src/logo/ascii/o/opensuse_small.txt similarity index 100% rename from src/logo/ascii/opensuse_small.txt rename to src/logo/ascii/o/opensuse_small.txt diff --git a/src/logo/ascii/opensuse_tumbleweed.txt b/src/logo/ascii/o/opensuse_tumbleweed.txt similarity index 100% rename from src/logo/ascii/opensuse_tumbleweed.txt rename to src/logo/ascii/o/opensuse_tumbleweed.txt diff --git a/src/logo/ascii/opensuse_tumbleweed2.txt b/src/logo/ascii/o/opensuse_tumbleweed2.txt similarity index 100% rename from src/logo/ascii/opensuse_tumbleweed2.txt rename to src/logo/ascii/o/opensuse_tumbleweed2.txt diff --git a/src/logo/ascii/opensuse_tumbleweed_old.txt b/src/logo/ascii/o/opensuse_tumbleweed_old.txt similarity index 100% rename from src/logo/ascii/opensuse_tumbleweed_old.txt rename to src/logo/ascii/o/opensuse_tumbleweed_old.txt diff --git a/src/logo/ascii/opensuse_tumbleweed_small.txt b/src/logo/ascii/o/opensuse_tumbleweed_small.txt similarity index 100% rename from src/logo/ascii/opensuse_tumbleweed_small.txt rename to src/logo/ascii/o/opensuse_tumbleweed_small.txt diff --git a/src/logo/ascii/openwrt.txt b/src/logo/ascii/o/openwrt.txt similarity index 100% rename from src/logo/ascii/openwrt.txt rename to src/logo/ascii/o/openwrt.txt diff --git a/src/logo/ascii/opnsense.txt b/src/logo/ascii/o/opnsense.txt similarity index 100% rename from src/logo/ascii/opnsense.txt rename to src/logo/ascii/o/opnsense.txt diff --git a/src/logo/ascii/oracle.txt b/src/logo/ascii/o/oracle.txt similarity index 100% rename from src/logo/ascii/oracle.txt rename to src/logo/ascii/o/oracle.txt diff --git a/src/logo/ascii/orchid.txt b/src/logo/ascii/o/orchid.txt similarity index 100% rename from src/logo/ascii/orchid.txt rename to src/logo/ascii/o/orchid.txt diff --git a/src/logo/ascii/orchid_small.txt b/src/logo/ascii/o/orchid_small.txt similarity index 100% rename from src/logo/ascii/orchid_small.txt rename to src/logo/ascii/o/orchid_small.txt diff --git a/src/logo/ascii/oreon.txt b/src/logo/ascii/o/oreon.txt similarity index 100% rename from src/logo/ascii/oreon.txt rename to src/logo/ascii/o/oreon.txt diff --git a/src/logo/ascii/o/origami.txt b/src/logo/ascii/o/origami.txt new file mode 100644 index 0000000000..207f322f56 --- /dev/null +++ b/src/logo/ascii/o/origami.txt @@ -0,0 +1,12 @@ + -+: + =+++- + .=+++++= + :+++++++++. +$2.8....... $1-++++*++++++:$2 ...88 + .8888888..$1-+++++*+++++*+:$2..8888888 + .8888888=8===$1=++++==$2==8888888888 + .88888==========88888888888888 + .888========888=888888888888. + 8=======888888====88888888. + 8====88888888======88888. + 888888888888=========8. \ No newline at end of file diff --git a/src/logo/ascii/o/origami_small.txt b/src/logo/ascii/o/origami_small.txt new file mode 100644 index 0000000000..6cd4130176 --- /dev/null +++ b/src/logo/ascii/o/origami_small.txt @@ -0,0 +1,8 @@ + 00 + 01 00 + 0000 0000 + 000001 00000 +$211010011110 $100 $201111001011 + 01111100 $100000000 $200111110 + 0110 00010000001000 0110 + 000000000000000000 \ No newline at end of file diff --git a/src/logo/ascii/os2warp.txt b/src/logo/ascii/o/os2warp.txt similarity index 100% rename from src/logo/ascii/os2warp.txt rename to src/logo/ascii/o/os2warp.txt diff --git a/src/logo/ascii/os_elbrus.txt b/src/logo/ascii/o/os_elbrus.txt similarity index 100% rename from src/logo/ascii/os_elbrus.txt rename to src/logo/ascii/o/os_elbrus.txt diff --git a/src/logo/ascii/osmc.txt b/src/logo/ascii/o/osmc.txt similarity index 100% rename from src/logo/ascii/osmc.txt rename to src/logo/ascii/o/osmc.txt diff --git a/src/logo/ascii/p.inc b/src/logo/ascii/p.inc new file mode 100644 index 0000000000..be00006f1b --- /dev/null +++ b/src/logo/ascii/p.inc @@ -0,0 +1,369 @@ +#include "../logo.h" +#include "logo_builtin.h" +#include "common/color.h" + +static const FFlogo P[] = { + #ifdef FASTFETCH_DATATEXT_LOGO_PACBSD + // PacBSD + { + .names = { "PacBSD" }, + .lines = FASTFETCH_DATATEXT_LOGO_PACBSD, + .colors = { + FF_COLOR_FG_RED, + FF_COLOR_FG_WHITE, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_PANWAH + // Panwah + { + .names = { "Panwah" }, + .lines = FASTFETCH_DATATEXT_LOGO_PANWAH, + .colors = { + FF_COLOR_FG_WHITE, + FF_COLOR_FG_RED, + FF_COLOR_FG_BLACK, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_PARABOLA + // Parabola + { + .names = { "parabola", "parabola-gnulinux" }, + .lines = FASTFETCH_DATATEXT_LOGO_PARABOLA, + .colors = { + FF_COLOR_FG_MAGENTA, + }, + .colorKeys = FF_COLOR_FG_MAGENTA, + .colorTitle = FF_COLOR_FG_MAGENTA, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_PARABOLA_SMALL + // ParabolaSmall + { + .names = { "parabola_small", "parabola-gnulinux_small" }, + .type = FF_LOGO_LINE_TYPE_SMALL_BIT, + .lines = FASTFETCH_DATATEXT_LOGO_PARABOLA_SMALL, + .colors = { + FF_COLOR_FG_MAGENTA, + }, + .colorKeys = FF_COLOR_FG_MAGENTA, + .colorTitle = FF_COLOR_FG_MAGENTA, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_PARCH + // Parch + { + .names = { "Parch" }, + .lines = FASTFETCH_DATATEXT_LOGO_PARCH, + .colors = { + FF_COLOR_FG_BLUE, + FF_COLOR_FG_WHITE, + FF_COLOR_FG_RED, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_PARDUS + // Pardus + { + .names = { "Pardus" }, + .lines = FASTFETCH_DATATEXT_LOGO_PARDUS, + .colors = { + FF_COLOR_FG_BLUE, + FF_COLOR_FG_CYAN, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_PARROT + // Parrot + { + .names = { "Parrot" }, + .lines = FASTFETCH_DATATEXT_LOGO_PARROT, + .colors = { + FF_COLOR_FG_CYAN, + FF_COLOR_FG_WHITE, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_PARSIX + // Parsix + { + .names = { "Parsix" }, + .lines = FASTFETCH_DATATEXT_LOGO_PARSIX, + .colors = { + FF_COLOR_FG_YELLOW, + FF_COLOR_FG_RED, + FF_COLOR_FG_WHITE, + FF_COLOR_FG_LIGHT_BLACK, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_PCBSD + // PCBSD + { + .names = { "PCBSD", "TrueOS" }, + .lines = FASTFETCH_DATATEXT_LOGO_PCBSD, + .colors = { + FF_COLOR_FG_RED, + FF_COLOR_FG_WHITE, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_PCLINUXOS + // PCLinuxOS + { + .names = { "PCLinuxOS" }, + .lines = FASTFETCH_DATATEXT_LOGO_PCLINUXOS, + .colors = { + FF_COLOR_FG_BLUE, + FF_COLOR_FG_WHITE, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_PEAROS + // PearOS + { + .names = { "PearOS" }, + .lines = FASTFETCH_DATATEXT_LOGO_PEAROS, + .colors = { + FF_COLOR_FG_GREEN, + FF_COLOR_FG_YELLOW, + FF_COLOR_FG_RED, + FF_COLOR_FG_MAGENTA, + FF_COLOR_FG_BLUE, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_PENGWIN + // Pengwin + { + .names = { "Pengwin" }, + .lines = FASTFETCH_DATATEXT_LOGO_PENGWIN, + .colors = { + FF_COLOR_FG_MAGENTA, + FF_COLOR_FG_LIGHT_MAGENTA, + FF_COLOR_FG_MAGENTA, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_PENTOO + // Pentoo + { + .names = { "Pentoo" }, + .lines = FASTFETCH_DATATEXT_LOGO_PENTOO, + .colors = { + FF_COLOR_FG_MAGENTA, + FF_COLOR_FG_WHITE, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_PEPPERMINT + // Peppermint + { + .names = { "Peppermint" }, + .lines = FASTFETCH_DATATEXT_LOGO_PEPPERMINT, + .colors = { + FF_COLOR_FG_RED, + FF_COLOR_FG_WHITE, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_PEROPESIS + // Peropesis + { + .names = { "Peropesis", "Peropesis Linux" }, + .lines = FASTFETCH_DATATEXT_LOGO_PEROPESIS, + .colors = { + FF_COLOR_FG_WHITE, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_PHYOS + // PhyOS + { + .names = { "PhyOS" }, + .lines = FASTFETCH_DATATEXT_LOGO_PHYOS, + .colors = { + FF_COLOR_FG_BLUE, + FF_COLOR_FG_WHITE, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_PIKAOS + // PikaOS + { + .names = { "PikaOS" }, + .lines = FASTFETCH_DATATEXT_LOGO_PIKAOS, + .colors = { + FF_COLOR_FG_YELLOW, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_PISI + // PisiLinux + { + .names = { "PisiLinux" }, + .lines = FASTFETCH_DATATEXT_LOGO_PISI, + .colors = { + FF_COLOR_FG_BLUE, + FF_COLOR_FG_WHITE, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_PNM_LINUX + // PNMLinux + { + .names = { "PNM Linux" }, + .lines = FASTFETCH_DATATEXT_LOGO_PNM_LINUX, + .colors = { + FF_COLOR_FG_BLUE, + FF_COLOR_FG_RED, + FF_COLOR_FG_WHITE, + FF_COLOR_FG_256 "202", + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_POP + // Pop + { + .names = { "pop", "popos" }, + .lines = FASTFETCH_DATATEXT_LOGO_POP, + .colors = { + FF_COLOR_FG_CYAN, + FF_COLOR_FG_WHITE, + }, + .colorKeys = FF_COLOR_FG_CYAN, + .colorTitle = FF_COLOR_FG_CYAN, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_POP_SMALL + // PopSmall + { + .names = { "pop_small", "popos_small" }, + .type = FF_LOGO_LINE_TYPE_SMALL_BIT, + .lines = FASTFETCH_DATATEXT_LOGO_POP_SMALL, + .colors = { + FF_COLOR_FG_CYAN, + }, + .colorKeys = FF_COLOR_FG_CYAN, + .colorTitle = FF_COLOR_FG_CYAN, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_PORTEUS + // Porteus + { + .names = { "Porteus" }, + .lines = FASTFETCH_DATATEXT_LOGO_PORTEUS, + .colors = { + FF_COLOR_FG_CYAN, + FF_COLOR_FG_WHITE, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_POSTMARKETOS + // PostMarketOS + { + .names = { "PostMarketOS" }, + .lines = FASTFETCH_DATATEXT_LOGO_POSTMARKETOS, + .colors = { + FF_COLOR_FG_GREEN, + FF_COLOR_FG_WHITE, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_POSTMARKETOS_SMALL + // PostMarketOSSmall + { + .names = { "PostMarketOS_small" }, + .type = FF_LOGO_LINE_TYPE_SMALL_BIT, + .lines = FASTFETCH_DATATEXT_LOGO_POSTMARKETOS_SMALL, + .colors = { + FF_COLOR_FG_GREEN, + FF_COLOR_FG_WHITE, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_PROXMOX + // Proxmox + { + .names = { "Proxmox", "pve" }, + .lines = FASTFETCH_DATATEXT_LOGO_PROXMOX, + .colors = { + FF_COLOR_FG_WHITE, + FF_COLOR_FG_256 "202", + }, + .colorKeys = FF_COLOR_FG_DEFAULT, + .colorTitle = FF_COLOR_FG_256 "202", + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_PUFFOS + // PuffOS + { + .names = { "PuffOS" }, + .lines = FASTFETCH_DATATEXT_LOGO_PUFFOS, + .colors = { + FF_COLOR_FG_YELLOW, + FF_COLOR_FG_WHITE, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_PUPPY + // Puppy + { + .names = { "Puppy" }, + .lines = FASTFETCH_DATATEXT_LOGO_PUPPY, + .colors = { + FF_COLOR_FG_BLUE, + FF_COLOR_FG_WHITE, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_PUREOS + // PureOS + { + .names = { "PureOS" }, + .lines = FASTFETCH_DATATEXT_LOGO_PUREOS, + .colors = { + FF_COLOR_FG_GREEN, + FF_COLOR_FG_WHITE, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_PUREOS_SMALL + // PureOSSmall + { + .names = { "PureOS_small" }, + .type = FF_LOGO_LINE_TYPE_SMALL_BIT, + .lines = FASTFETCH_DATATEXT_LOGO_PUREOS_SMALL, + .colors = { + FF_COLOR_FG_GREEN, + FF_COLOR_FG_WHITE, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_PRISMLINUX + // PrismLinux + { + .names = { "PrismLinux" }, + .lines = FASTFETCH_DATATEXT_LOGO_PRISMLINUX, + .colors = { + FF_COLOR_FG_BLUE, + FF_COLOR_FG_BLUE, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_PRISMLINUX_SMALL + // PrismLinuxSmall + { + .names = { "PrismLinux_small" }, + .type = FF_LOGO_LINE_TYPE_SMALL_BIT, + .lines = FASTFETCH_DATATEXT_LOGO_PRISMLINUX_SMALL, + .colors = { + FF_COLOR_FG_BLUE, + FF_COLOR_FG_BLUE, + }, + }, + #endif + // LAST + {}, +}; diff --git a/src/logo/ascii/pacbsd.txt b/src/logo/ascii/p/pacbsd.txt similarity index 100% rename from src/logo/ascii/pacbsd.txt rename to src/logo/ascii/p/pacbsd.txt diff --git a/src/logo/ascii/panwah.txt b/src/logo/ascii/p/panwah.txt similarity index 100% rename from src/logo/ascii/panwah.txt rename to src/logo/ascii/p/panwah.txt diff --git a/src/logo/ascii/parabola.txt b/src/logo/ascii/p/parabola.txt similarity index 100% rename from src/logo/ascii/parabola.txt rename to src/logo/ascii/p/parabola.txt diff --git a/src/logo/ascii/parabola_small.txt b/src/logo/ascii/p/parabola_small.txt similarity index 100% rename from src/logo/ascii/parabola_small.txt rename to src/logo/ascii/p/parabola_small.txt diff --git a/src/logo/ascii/parch.txt b/src/logo/ascii/p/parch.txt similarity index 100% rename from src/logo/ascii/parch.txt rename to src/logo/ascii/p/parch.txt diff --git a/src/logo/ascii/pardus.txt b/src/logo/ascii/p/pardus.txt similarity index 100% rename from src/logo/ascii/pardus.txt rename to src/logo/ascii/p/pardus.txt diff --git a/src/logo/ascii/parrot.txt b/src/logo/ascii/p/parrot.txt similarity index 100% rename from src/logo/ascii/parrot.txt rename to src/logo/ascii/p/parrot.txt diff --git a/src/logo/ascii/parsix.txt b/src/logo/ascii/p/parsix.txt similarity index 100% rename from src/logo/ascii/parsix.txt rename to src/logo/ascii/p/parsix.txt diff --git a/src/logo/ascii/pcbsd.txt b/src/logo/ascii/p/pcbsd.txt similarity index 100% rename from src/logo/ascii/pcbsd.txt rename to src/logo/ascii/p/pcbsd.txt diff --git a/src/logo/ascii/pclinuxos.txt b/src/logo/ascii/p/pclinuxos.txt similarity index 100% rename from src/logo/ascii/pclinuxos.txt rename to src/logo/ascii/p/pclinuxos.txt diff --git a/src/logo/ascii/pearos.txt b/src/logo/ascii/p/pearos.txt similarity index 100% rename from src/logo/ascii/pearos.txt rename to src/logo/ascii/p/pearos.txt diff --git a/src/logo/ascii/pengwin.txt b/src/logo/ascii/p/pengwin.txt similarity index 100% rename from src/logo/ascii/pengwin.txt rename to src/logo/ascii/p/pengwin.txt diff --git a/src/logo/ascii/pentoo.txt b/src/logo/ascii/p/pentoo.txt similarity index 100% rename from src/logo/ascii/pentoo.txt rename to src/logo/ascii/p/pentoo.txt diff --git a/src/logo/ascii/peppermint.txt b/src/logo/ascii/p/peppermint.txt similarity index 100% rename from src/logo/ascii/peppermint.txt rename to src/logo/ascii/p/peppermint.txt diff --git a/src/logo/ascii/peropesis.txt b/src/logo/ascii/p/peropesis.txt similarity index 100% rename from src/logo/ascii/peropesis.txt rename to src/logo/ascii/p/peropesis.txt diff --git a/src/logo/ascii/phyos.txt b/src/logo/ascii/p/phyos.txt similarity index 100% rename from src/logo/ascii/phyos.txt rename to src/logo/ascii/p/phyos.txt diff --git a/src/logo/ascii/pikaos.txt b/src/logo/ascii/p/pikaos.txt similarity index 100% rename from src/logo/ascii/pikaos.txt rename to src/logo/ascii/p/pikaos.txt diff --git a/src/logo/ascii/pisi.txt b/src/logo/ascii/p/pisi.txt similarity index 100% rename from src/logo/ascii/pisi.txt rename to src/logo/ascii/p/pisi.txt diff --git a/src/logo/ascii/pnm_linux.txt b/src/logo/ascii/p/pnm_linux.txt similarity index 100% rename from src/logo/ascii/pnm_linux.txt rename to src/logo/ascii/p/pnm_linux.txt diff --git a/src/logo/ascii/pop.txt b/src/logo/ascii/p/pop.txt similarity index 100% rename from src/logo/ascii/pop.txt rename to src/logo/ascii/p/pop.txt diff --git a/src/logo/ascii/pop_small.txt b/src/logo/ascii/p/pop_small.txt similarity index 100% rename from src/logo/ascii/pop_small.txt rename to src/logo/ascii/p/pop_small.txt diff --git a/src/logo/ascii/porteus.txt b/src/logo/ascii/p/porteus.txt similarity index 100% rename from src/logo/ascii/porteus.txt rename to src/logo/ascii/p/porteus.txt diff --git a/src/logo/ascii/postmarketos.txt b/src/logo/ascii/p/postmarketos.txt similarity index 100% rename from src/logo/ascii/postmarketos.txt rename to src/logo/ascii/p/postmarketos.txt diff --git a/src/logo/ascii/postmarketos_small.txt b/src/logo/ascii/p/postmarketos_small.txt similarity index 100% rename from src/logo/ascii/postmarketos_small.txt rename to src/logo/ascii/p/postmarketos_small.txt diff --git a/src/logo/ascii/prismlinux.txt b/src/logo/ascii/p/prismlinux.txt similarity index 100% rename from src/logo/ascii/prismlinux.txt rename to src/logo/ascii/p/prismlinux.txt diff --git a/src/logo/ascii/prismlinux_small.txt b/src/logo/ascii/p/prismlinux_small.txt similarity index 100% rename from src/logo/ascii/prismlinux_small.txt rename to src/logo/ascii/p/prismlinux_small.txt diff --git a/src/logo/ascii/proxmox.txt b/src/logo/ascii/p/proxmox.txt similarity index 100% rename from src/logo/ascii/proxmox.txt rename to src/logo/ascii/p/proxmox.txt diff --git a/src/logo/ascii/puffos.txt b/src/logo/ascii/p/puffos.txt similarity index 100% rename from src/logo/ascii/puffos.txt rename to src/logo/ascii/p/puffos.txt diff --git a/src/logo/ascii/puppy.txt b/src/logo/ascii/p/puppy.txt similarity index 100% rename from src/logo/ascii/puppy.txt rename to src/logo/ascii/p/puppy.txt diff --git a/src/logo/ascii/pureos.txt b/src/logo/ascii/p/pureos.txt similarity index 100% rename from src/logo/ascii/pureos.txt rename to src/logo/ascii/p/pureos.txt diff --git a/src/logo/ascii/pureos_small.txt b/src/logo/ascii/p/pureos_small.txt similarity index 100% rename from src/logo/ascii/pureos_small.txt rename to src/logo/ascii/p/pureos_small.txt diff --git a/src/logo/ascii/q.inc b/src/logo/ascii/q.inc new file mode 100644 index 0000000000..732261e178 --- /dev/null +++ b/src/logo/ascii/q.inc @@ -0,0 +1,89 @@ +#include "../logo.h" +#include "logo_builtin.h" +#include "common/color.h" + +static const FFlogo Q[] = { + #ifdef FASTFETCH_DATATEXT_LOGO_QTS + // QTS + { + .names = { "qts" }, + .lines = FASTFETCH_DATATEXT_LOGO_QTS, + .colors = { + FF_COLOR_FG_BLUE, + FF_COLOR_FG_RED, + }, + .colorKeys = FF_COLOR_FG_BLUE, + .colorTitle = FF_COLOR_FG_BLUE, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_QUASAR + // Quasar + { + .names = { "Quasar" }, + .lines = FASTFETCH_DATATEXT_LOGO_QUASAR, + .colors = { + FF_COLOR_FG_DEFAULT, + }, + .colorKeys = FF_COLOR_FG_BLUE, + .colorTitle = FF_COLOR_FG_DEFAULT, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_Q4OS + // Q4OS + { + .names = { "Q4OS" }, + .lines = FASTFETCH_DATATEXT_LOGO_Q4OS, + .colors = { + FF_COLOR_FG_BLUE, + FF_COLOR_FG_RED, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_QUBES + // Qubes + { + .names = { "Qubes" }, + .lines = FASTFETCH_DATATEXT_LOGO_QUBES, + .colors = { + FF_COLOR_FG_BLUE, + FF_COLOR_FG_MAGENTA, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_QUBYT + // Qubyt + { + .names = { "Qubyt" }, + .lines = FASTFETCH_DATATEXT_LOGO_QUBYT, + .colors = { + FF_COLOR_FG_BLUE, + FF_COLOR_FG_MAGENTA, + FF_COLOR_FG_BLACK, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_QUIBIAN + // Quibian + { + .names = { "Quibian" }, + .lines = FASTFETCH_DATATEXT_LOGO_QUIBIAN, + .colors = { + FF_COLOR_FG_YELLOW, + FF_COLOR_FG_WHITE, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_QUIRINUX + // Quirinux + { + .names = { "Quirinux" }, + .lines = FASTFETCH_DATATEXT_LOGO_QUIRINUX, + .colors = { + FF_COLOR_FG_WHITE, + FF_COLOR_FG_MAGENTA, + }, + }, + #endif + // LAST + {}, +}; diff --git a/src/logo/ascii/q4os.txt b/src/logo/ascii/q/q4os.txt similarity index 100% rename from src/logo/ascii/q4os.txt rename to src/logo/ascii/q/q4os.txt diff --git a/src/logo/ascii/qts.txt b/src/logo/ascii/q/qts.txt similarity index 100% rename from src/logo/ascii/qts.txt rename to src/logo/ascii/q/qts.txt diff --git a/src/logo/ascii/q/quasar.txt b/src/logo/ascii/q/quasar.txt new file mode 100644 index 0000000000..c26ba5c455 --- /dev/null +++ b/src/logo/ascii/q/quasar.txt @@ -0,0 +1,25 @@ +### + ##### + ## #### + ## ##### + ## ##### + ## ### + ## #### + ## #### #### + ## ### ### #### + ##### ## + ### ## ### ## + ## ## ## ## + # ## ## ## + ## ## ## ## + ## #### ## ### + ### ##### + #### ### #### ### + ##### #### ## + ### ## + ### ## + ##### ## + ##### ## + #### ## + ###### + ### \ No newline at end of file diff --git a/src/logo/ascii/qubes.txt b/src/logo/ascii/q/qubes.txt similarity index 100% rename from src/logo/ascii/qubes.txt rename to src/logo/ascii/q/qubes.txt diff --git a/src/logo/ascii/qubyt.txt b/src/logo/ascii/q/qubyt.txt similarity index 100% rename from src/logo/ascii/qubyt.txt rename to src/logo/ascii/q/qubyt.txt diff --git a/src/logo/ascii/quibian.txt b/src/logo/ascii/q/quibian.txt similarity index 100% rename from src/logo/ascii/quibian.txt rename to src/logo/ascii/q/quibian.txt diff --git a/src/logo/ascii/quirinux.txt b/src/logo/ascii/q/quirinux.txt similarity index 100% rename from src/logo/ascii/quirinux.txt rename to src/logo/ascii/q/quirinux.txt diff --git a/src/logo/ascii/r.inc b/src/logo/ascii/r.inc new file mode 100644 index 0000000000..1052d2a1e9 --- /dev/null +++ b/src/logo/ascii/r.inc @@ -0,0 +1,297 @@ +#include "../logo.h" +#include "logo_builtin.h" +#include "common/color.h" + +static const FFlogo R[] = { + #ifdef FASTFETCH_DATATEXT_LOGO_RADIX + // Radix + { + .names = { "Radix" }, + .lines = FASTFETCH_DATATEXT_LOGO_RADIX, + .colors = { + FF_COLOR_FG_GREEN, + FF_COLOR_FG_RED, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_RASPBIAN + // Raspbian + { + .names = { "raspbian" }, + .lines = FASTFETCH_DATATEXT_LOGO_RASPBIAN, + .colors = { + FF_COLOR_FG_RED, + FF_COLOR_FG_GREEN, + }, + .colorKeys = FF_COLOR_FG_RED, + .colorTitle = FF_COLOR_FG_GREEN, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_RASPBIAN_SMALL + // RaspbianSmall + { + .names = { "raspbian_small" }, + .type = FF_LOGO_LINE_TYPE_SMALL_BIT, + .lines = FASTFETCH_DATATEXT_LOGO_RASPBIAN_SMALL, + .colors = { + FF_COLOR_FG_RED, + FF_COLOR_FG_GREEN, + }, + .colorKeys = FF_COLOR_FG_RED, + .colorTitle = FF_COLOR_FG_GREEN, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_RAVYNOS + // RavynOS + { + .names = { "RavynOS" }, + .lines = FASTFETCH_DATATEXT_LOGO_RAVYNOS, + .colors = { + FF_COLOR_FG_256 "15", + FF_COLOR_FG_WHITE, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_REBORNOS + // RebornOS + { + .names = { "RebornOS" }, + .lines = FASTFETCH_DATATEXT_LOGO_REBORNOS, + .colors = { + FF_COLOR_FG_BLACK, + FF_COLOR_FG_BLUE, + FF_COLOR_FG_CYAN, + }, + .colorKeys = FF_COLOR_FG_BLUE, + .colorTitle = FF_COLOR_FG_BLUE, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_REBORNOS_SMALL + // RebornSmall + { + .names = { "RebornOS_small" }, + .type = FF_LOGO_LINE_TYPE_SMALL_BIT, + .lines = FASTFETCH_DATATEXT_LOGO_REBORNOS_SMALL, + .colors = { + FF_COLOR_FG_BLUE, + }, + .colorKeys = FF_COLOR_FG_BLUE, + .colorTitle = FF_COLOR_FG_BLUE, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_REDCORE + // RedCore + { + .names = { "RedCore" }, + .lines = FASTFETCH_DATATEXT_LOGO_REDCORE, + .colors = { + FF_COLOR_FG_RED, + FF_COLOR_FG_WHITE, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_RHEL + // RedHatEnterpriseLinux + { + .names = { "rhel", "redhat" }, + .lines = FASTFETCH_DATATEXT_LOGO_RHEL, + .colors = { + FF_COLOR_FG_RED, + }, + .colorKeys = FF_COLOR_FG_RED, + .colorTitle = FF_COLOR_FG_RED, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_RHEL_SMALL + // RedHatEnterpriseLinux + { + .names = { "rhel_small", "redhat_small" }, + .type = FF_LOGO_LINE_TYPE_SMALL_BIT, + .lines = FASTFETCH_DATATEXT_LOGO_RHEL_SMALL, + .colors = { + FF_COLOR_FG_RED, + }, + .colorKeys = FF_COLOR_FG_RED, + .colorTitle = FF_COLOR_FG_RED, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_RHEL_OLD + // RedHatEnterpriseLinux_old + { + .names = { "rhel_old", "redhat_old" }, + .type = FF_LOGO_LINE_TYPE_ALTER_BIT, + .lines = FASTFETCH_DATATEXT_LOGO_RHEL_OLD, + .colors = { + FF_COLOR_FG_RED, + FF_COLOR_FG_WHITE, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_REDOS + // RedOS + { + .names = { "RedOS" }, + .lines = FASTFETCH_DATATEXT_LOGO_REDOS, + .colors = { + FF_COLOR_FG_RED, + FF_COLOR_FG_WHITE, + }, + .colorTitle = FF_COLOR_FG_RED, + .colorKeys = FF_COLOR_FG_RED, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_REDOS_SMALL + // RedOS small + { + .names = { "RedOS_small" }, + .type = FF_LOGO_LINE_TYPE_SMALL_BIT, + .lines = FASTFETCH_DATATEXT_LOGO_REDOS_SMALL, + .colors = { + FF_COLOR_FG_RED, + FF_COLOR_FG_WHITE, + }, + .colorTitle = FF_COLOR_FG_RED, + .colorKeys = FF_COLOR_FG_RED, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_REDSTAR + // RedstarOS + { + .names = { "redstar", "redstar-os", "redstaros" }, + .lines = FASTFETCH_DATATEXT_LOGO_REDSTAR, + .colors = { + FF_COLOR_FG_RED, + }, + .colorKeys = FF_COLOR_FG_RED, + .colorTitle = FF_COLOR_FG_RED, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_REDROSE + // Redrose + { + .names = { "Redrose" }, + .lines = FASTFETCH_DATATEXT_LOGO_REDROSE, + .colors = { + FF_COLOR_FG_RED, + FF_COLOR_FG_GREEN, + }, + .colorKeys = FF_COLOR_FG_RED, + .colorTitle = FF_COLOR_FG_RED, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_REFRACTA + // Refracta + { + .names = { "Refracta" }, + .lines = FASTFETCH_DATATEXT_LOGO_REFRACTA, + .colors = { + FF_COLOR_FG_WHITE, + FF_COLOR_FG_LIGHT_BLACK, + }, + .colorKeys = FF_COLOR_FG_LIGHT_BLACK, + .colorTitle = FF_COLOR_FG_DEFAULT, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_REGATA + // Regata + { + .names = { "Regata" }, + .lines = FASTFETCH_DATATEXT_LOGO_REGATA, + .colors = { + FF_COLOR_FG_WHITE, + FF_COLOR_FG_RED, + FF_COLOR_FG_BLUE, + FF_COLOR_FG_MAGENTA, + FF_COLOR_FG_YELLOW, + FF_COLOR_FG_GREEN, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_REGOLITH + // Regolith + { + .names = { "Regolith" }, + .lines = FASTFETCH_DATATEXT_LOGO_REGOLITH, + .colors = { + FF_COLOR_FG_RED, + FF_COLOR_FG_WHITE, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_RHAYMOS + // RhaymOS + { + .names = { "RhaymOS" }, + .lines = FASTFETCH_DATATEXT_LOGO_RHAYMOS, + .colors = { + FF_COLOR_FG_RED, + FF_COLOR_FG_WHITE, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_ROCKY + // RockyLinux + { + .names = { "rocky" }, + .lines = FASTFETCH_DATATEXT_LOGO_ROCKY, + .colors = { + FF_COLOR_FG_GREEN, + }, + .colorKeys = FF_COLOR_FG_GREEN, + .colorTitle = FF_COLOR_FG_GREEN, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_ROCKY_SMALL + // RockyLinuxSmall + { + .names = { "rocky_small" }, + .type = FF_LOGO_LINE_TYPE_SMALL_BIT, + .lines = FASTFETCH_DATATEXT_LOGO_ROCKY_SMALL, + .colors = { + FF_COLOR_FG_GREEN, + }, + .colorKeys = FF_COLOR_FG_GREEN, + .colorTitle = FF_COLOR_FG_GREEN, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_ROSA + // RosaLinux + { + .names = { "rosa", "rosa-linux", "rosalinux" }, + .lines = FASTFETCH_DATATEXT_LOGO_ROSA, + .colors = { + FF_COLOR_FG_RGB "250;250;250", + FF_COLOR_FG_RGB "100;165;225", + }, + .colorKeys = FF_COLOR_FG_RGB "100;165;225", + .colorTitle = FF_COLOR_FG_RGB "100;165;225", + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_RHINO + // RhinoLinux + { + .names = { "Rhino Linux" }, + .lines = FASTFETCH_DATATEXT_LOGO_RHINO, + .colors = { + FF_COLOR_FG_MAGENTA, + FF_COLOR_FG_LIGHT_BLUE, + FF_COLOR_FG_LIGHT_MAGENTA, + FF_COLOR_FG_MAGENTA, + }, + .colorKeys = FF_COLOR_FG_MAGENTA, + .colorTitle = FF_COLOR_FG_MAGENTA, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_RENGEOS + { + .names = { "RengeOS" }, + .lines = FASTFETCH_DATATEXT_LOGO_RENGEOS, + .colors = { + FF_COLOR_FG_MAGENTA, + FF_COLOR_FG_MAGENTA, + }, + }, + #endif + // LAST + {}, +}; diff --git a/src/logo/ascii/radix.txt b/src/logo/ascii/r/radix.txt similarity index 100% rename from src/logo/ascii/radix.txt rename to src/logo/ascii/r/radix.txt diff --git a/src/logo/ascii/raspbian.txt b/src/logo/ascii/r/raspbian.txt similarity index 100% rename from src/logo/ascii/raspbian.txt rename to src/logo/ascii/r/raspbian.txt diff --git a/src/logo/ascii/raspbian_small.txt b/src/logo/ascii/r/raspbian_small.txt similarity index 100% rename from src/logo/ascii/raspbian_small.txt rename to src/logo/ascii/r/raspbian_small.txt diff --git a/src/logo/ascii/ravynos.txt b/src/logo/ascii/r/ravynos.txt similarity index 100% rename from src/logo/ascii/ravynos.txt rename to src/logo/ascii/r/ravynos.txt diff --git a/src/logo/ascii/rebornos.txt b/src/logo/ascii/r/rebornos.txt similarity index 100% rename from src/logo/ascii/rebornos.txt rename to src/logo/ascii/r/rebornos.txt diff --git a/src/logo/ascii/rebornos_small.txt b/src/logo/ascii/r/rebornos_small.txt similarity index 100% rename from src/logo/ascii/rebornos_small.txt rename to src/logo/ascii/r/rebornos_small.txt diff --git a/src/logo/ascii/redcore.txt b/src/logo/ascii/r/redcore.txt similarity index 100% rename from src/logo/ascii/redcore.txt rename to src/logo/ascii/r/redcore.txt diff --git a/src/logo/ascii/redos.txt b/src/logo/ascii/r/redos.txt similarity index 100% rename from src/logo/ascii/redos.txt rename to src/logo/ascii/r/redos.txt diff --git a/src/logo/ascii/redos_small.txt b/src/logo/ascii/r/redos_small.txt similarity index 100% rename from src/logo/ascii/redos_small.txt rename to src/logo/ascii/r/redos_small.txt diff --git a/src/logo/ascii/redrose.txt b/src/logo/ascii/r/redrose.txt similarity index 100% rename from src/logo/ascii/redrose.txt rename to src/logo/ascii/r/redrose.txt diff --git a/src/logo/ascii/redstar.txt b/src/logo/ascii/r/redstar.txt similarity index 100% rename from src/logo/ascii/redstar.txt rename to src/logo/ascii/r/redstar.txt diff --git a/src/logo/ascii/refracta.txt b/src/logo/ascii/r/refracta.txt similarity index 100% rename from src/logo/ascii/refracta.txt rename to src/logo/ascii/r/refracta.txt diff --git a/src/logo/ascii/regata.txt b/src/logo/ascii/r/regata.txt similarity index 100% rename from src/logo/ascii/regata.txt rename to src/logo/ascii/r/regata.txt diff --git a/src/logo/ascii/regolith.txt b/src/logo/ascii/r/regolith.txt similarity index 100% rename from src/logo/ascii/regolith.txt rename to src/logo/ascii/r/regolith.txt diff --git a/src/logo/ascii/rengeos.txt b/src/logo/ascii/r/rengeos.txt similarity index 100% rename from src/logo/ascii/rengeos.txt rename to src/logo/ascii/r/rengeos.txt diff --git a/src/logo/ascii/rhaymos.txt b/src/logo/ascii/r/rhaymos.txt similarity index 100% rename from src/logo/ascii/rhaymos.txt rename to src/logo/ascii/r/rhaymos.txt diff --git a/src/logo/ascii/rhel.txt b/src/logo/ascii/r/rhel.txt similarity index 100% rename from src/logo/ascii/rhel.txt rename to src/logo/ascii/r/rhel.txt diff --git a/src/logo/ascii/rhel_old.txt b/src/logo/ascii/r/rhel_old.txt similarity index 100% rename from src/logo/ascii/rhel_old.txt rename to src/logo/ascii/r/rhel_old.txt diff --git a/src/logo/ascii/rhel_small.txt b/src/logo/ascii/r/rhel_small.txt similarity index 100% rename from src/logo/ascii/rhel_small.txt rename to src/logo/ascii/r/rhel_small.txt diff --git a/src/logo/ascii/rhino.txt b/src/logo/ascii/r/rhino.txt similarity index 100% rename from src/logo/ascii/rhino.txt rename to src/logo/ascii/r/rhino.txt diff --git a/src/logo/ascii/rocky.txt b/src/logo/ascii/r/rocky.txt similarity index 100% rename from src/logo/ascii/rocky.txt rename to src/logo/ascii/r/rocky.txt diff --git a/src/logo/ascii/rocky_small.txt b/src/logo/ascii/r/rocky_small.txt similarity index 100% rename from src/logo/ascii/rocky_small.txt rename to src/logo/ascii/r/rocky_small.txt diff --git a/src/logo/ascii/rosa.txt b/src/logo/ascii/r/rosa.txt similarity index 100% rename from src/logo/ascii/rosa.txt rename to src/logo/ascii/r/rosa.txt diff --git a/src/logo/ascii/s.inc b/src/logo/ascii/s.inc new file mode 100644 index 0000000000..78f64f2d80 --- /dev/null +++ b/src/logo/ascii/s.inc @@ -0,0 +1,530 @@ +#include "../logo.h" +#include "logo_builtin.h" +#include "common/color.h" + +static const FFlogo S[] = { + #ifdef FASTFETCH_DATATEXT_LOGO_SABAYON + // Sabayon + { + .names = { "Sabayon" }, + .lines = FASTFETCH_DATATEXT_LOGO_SABAYON, + .colors = { + FF_COLOR_FG_BLUE, + FF_COLOR_FG_WHITE, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_SABOTAGE + // Sabotage + { + .names = { "Sabotage" }, + .lines = FASTFETCH_DATATEXT_LOGO_SABOTAGE, + .colors = { + FF_COLOR_FG_DEFAULT, + }, + .colorKeys = FF_COLOR_FG_BLUE, + .colorTitle = FF_COLOR_FG_DEFAULT, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_SAILFISH + // Sailfish + { + .names = { "Sailfish" }, + .lines = FASTFETCH_DATATEXT_LOGO_SAILFISH, + .colors = { + FF_COLOR_FG_BLUE, + FF_COLOR_FG_MAGENTA, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_SALENTOS + // SalentOS + { + .names = { "SalentOS" }, + .lines = FASTFETCH_DATATEXT_LOGO_SALENTOS, + .colors = { + FF_COLOR_FG_GREEN, + FF_COLOR_FG_RED, + FF_COLOR_FG_YELLOW, + FF_COLOR_FG_WHITE, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_SALIENTOS + // SalientOS + { + .names = { "Salient OS", "SalientOS" }, + .lines = FASTFETCH_DATATEXT_LOGO_SALIENTOS, + .colors = { + FF_COLOR_FG_CYAN, + FF_COLOR_FG_WHITE, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_SALIX + // Salix + { + .names = { "Salix" }, + .lines = FASTFETCH_DATATEXT_LOGO_SALIX, + .colors = { + FF_COLOR_FG_GREEN, + FF_COLOR_FG_GREEN, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_SAMBABOX + // SambaBOX + { + .names = { "SambaBOX", "Profelis SambaBOX" }, + .lines = FASTFETCH_DATATEXT_LOGO_SAMBABOX, + .colors = { + FF_COLOR_FG_YELLOW, + FF_COLOR_FG_CYAN, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_SASANQUA + // Sasanqua + { + .names = { "Sasanqua" }, + .lines = FASTFETCH_DATATEXT_LOGO_SASANQUA, + .colors = { + FF_COLOR_FG_MAGENTA, + FF_COLOR_FG_RED, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_SCIENTIFIC + // Scientific + { + .names = { "Scientific" }, + .lines = FASTFETCH_DATATEXT_LOGO_SCIENTIFIC, + .colors = { + FF_COLOR_FG_BLUE, + FF_COLOR_FG_WHITE, + FF_COLOR_FG_RED, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_SECUREBLUE + // Secureblue + { + .names = { "secureblue" }, + .lines = FASTFETCH_DATATEXT_LOGO_SECUREBLUE, + .colors = { + FF_COLOR_FG_BLUE, + FF_COLOR_FG_MAGENTA, + FF_COLOR_FG_DEFAULT, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_SERPENT_OS + // Serpent OS + { + .names = { "Serpent OS" }, + .lines = FASTFETCH_DATATEXT_LOGO_SERPENT_OS, + .colors = { + FF_COLOR_FG_DEFAULT, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_SEMC + // Semc + { + .names = { "semc" }, + .lines = FASTFETCH_DATATEXT_LOGO_SEMC, + .colors = { + FF_COLOR_FG_GREEN, + FF_COLOR_FG_LIGHT_BLACK, + FF_COLOR_FG_RED, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_SEPTOR + // Septor + { + .names = { "Septor" }, + .lines = FASTFETCH_DATATEXT_LOGO_SEPTOR, + .colors = { + FF_COLOR_FG_BLUE, + FF_COLOR_FG_WHITE, + FF_COLOR_FG_BLUE, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_SERENE + // Serene + { + .names = { "Serene" }, + .lines = FASTFETCH_DATATEXT_LOGO_SERENE, + .colors = { + FF_COLOR_FG_CYAN, + FF_COLOR_FG_CYAN, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_SHARKLINUX + // SharkLinux + { + .names = { "SharkLinux" }, + .lines = FASTFETCH_DATATEXT_LOGO_SHARKLINUX, + .colors = { + FF_COLOR_FG_BLUE, + FF_COLOR_FG_WHITE, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_SHASTRAOS + // ShastraOS + { + .names = { "ShastraOS" }, + .lines = FASTFETCH_DATATEXT_LOGO_SHASTRAOS, + .colors = { + FF_COLOR_FG_CYAN, + FF_COLOR_FG_WHITE, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_SHEBANG + // Shebang + { + .names = { "Shebang" }, + .lines = FASTFETCH_DATATEXT_LOGO_SHEBANG, + .colors = { + FF_COLOR_FG_WHITE, + FF_COLOR_FG_WHITE, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_SIDUCTION + // Siduction + { + .names = { "Siduction" }, + .lines = FASTFETCH_DATATEXT_LOGO_SIDUCTION, + .colors = { + FF_COLOR_FG_BLUE, + FF_COLOR_FG_WHITE, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_SKIFFOS + // SkiffOS + { + .names = { "SkiffOS" }, + .lines = FASTFETCH_DATATEXT_LOGO_SKIFFOS, + .colors = { + FF_COLOR_FG_BLUE, + FF_COLOR_FG_WHITE, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_SLEEPEROS + // SleeperOS + { + .names = { "SleeperOS" }, + .lines = FASTFETCH_DATATEXT_LOGO_SLEEPEROS, + .colors = { + FF_COLOR_FG_CYAN, + FF_COLOR_FG_WHITE, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_SLEEPEROS_SMALL + // SleeperOSSmall + { + .names = { "SleeperOS_small" }, + .type = FF_LOGO_LINE_TYPE_SMALL_BIT, + .lines = FASTFETCH_DATATEXT_LOGO_SLEEPEROS_SMALL, + .colors = { + FF_COLOR_FG_CYAN, + FF_COLOR_FG_WHITE, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_SLITAZ + // Slitaz + { + .names = { "Slitaz" }, + .lines = FASTFETCH_DATATEXT_LOGO_SLITAZ, + .colors = { + FF_COLOR_FG_YELLOW, + FF_COLOR_FG_YELLOW, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_SPOINKOS + // SpoinkOS + { + .names = { "SpoinkOS", "spoink-os" }, + .lines = FASTFETCH_DATATEXT_LOGO_SPOINKOS, + .colors = { + FF_COLOR_FG_GREEN, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_SLACKEL + // Slackel + { + .names = { "Slackel" }, + .lines = FASTFETCH_DATATEXT_LOGO_SLACKEL, + .colors = { + FF_COLOR_FG_YELLOW, + FF_COLOR_FG_YELLOW, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_SLACKWARE + // Slackware + { + .names = { "Slackware" }, + .lines = FASTFETCH_DATATEXT_LOGO_SLACKWARE, + .colors = { + FF_COLOR_FG_BLUE, + FF_COLOR_FG_WHITE, + }, + .colorKeys = FF_COLOR_FG_BLUE, + .colorTitle = FF_COLOR_FG_BLUE, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_SLACKWARE_SMALL + // SlackwareSmall + { + .names = { "Slackware_small" }, + .type = FF_LOGO_LINE_TYPE_SMALL_BIT, + .lines = FASTFETCH_DATATEXT_LOGO_SLACKWARE_SMALL, + .colors = { + FF_COLOR_FG_BLUE, + FF_COLOR_FG_WHITE, + }, + .colorKeys = FF_COLOR_FG_BLUE, + .colorTitle = FF_COLOR_FG_DEFAULT, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_SMARTOS + // SmartOS + { + .names = { "SmartOS" }, + .lines = FASTFETCH_DATATEXT_LOGO_SMARTOS, + .colors = { + FF_COLOR_FG_CYAN, + FF_COLOR_FG_WHITE, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_SNIGDHAOS + // SnigdhaOS + { + .names = { "SnigdhaOS", "Snigdha" }, + .lines = FASTFETCH_DATATEXT_LOGO_SNIGDHAOS, + .colors = { + FF_COLOR_FG_CYAN, + FF_COLOR_FG_WHITE, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_SODA + // Soda + { + .names = { "Soda" }, + .lines = FASTFETCH_DATATEXT_LOGO_SODA, + .colors = { + FF_COLOR_FG_RED, + FF_COLOR_FG_WHITE, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_SOURCE_MAGE + // Source Mage + { + .names = { "Source Mage", "Source Mage GNU/Linux", "source_mage", "sourcemage" }, + .lines = FASTFETCH_DATATEXT_LOGO_SOURCE_MAGE, + .colors = { + FF_COLOR_FG_DEFAULT, + }, + .colorKeys = FF_COLOR_FG_RED, + .colorTitle = FF_COLOR_FG_DEFAULT, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_SOLARIS + // Solaris + { + .names = { "solaris", "sunos" }, + .lines = FASTFETCH_DATATEXT_LOGO_SOLARIS, + .colors = { + FF_COLOR_FG_YELLOW, + }, + .colorKeys = FF_COLOR_FG_YELLOW, + .colorTitle = FF_COLOR_FG_DEFAULT, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_SOLARIS_SMALL + // SolarisSmall + { + .names = { "solaris_small", "sunos_small" }, + .type = FF_LOGO_LINE_TYPE_SMALL_BIT, + .lines = FASTFETCH_DATATEXT_LOGO_SOLARIS_SMALL, + .colors = { + FF_COLOR_FG_YELLOW, + }, + .colorKeys = FF_COLOR_FG_YELLOW, + .colorTitle = FF_COLOR_FG_DEFAULT, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_SOLUS + // Solus + { + .names = { "Solus", "solus-linux" }, + .lines = FASTFETCH_DATATEXT_LOGO_SOLUS, + .colors = { + FF_COLOR_FG_BLUE, + FF_COLOR_FG_WHITE, + }, + .colorKeys = FF_COLOR_FG_BLUE, + .colorTitle = FF_COLOR_FG_DEFAULT, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_SPARKY + // Sparky + { + .names = { "Sparky" }, + .lines = FASTFETCH_DATATEXT_LOGO_SPARKY, + .colors = { + FF_COLOR_FG_RED, + FF_COLOR_FG_WHITE, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_STAR + // Star + { + .names = { "Star" }, + .lines = FASTFETCH_DATATEXT_LOGO_STAR, + .colors = { + FF_COLOR_FG_WHITE, + FF_COLOR_FG_WHITE, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_STOCK_LINUX + // StockLinux + { + .names = { "Stock Linux" }, + .lines = FASTFETCH_DATATEXT_LOGO_STOCK_LINUX, + .colors = { + FF_COLOR_FG_BLUE, + FF_COLOR_FG_WHITE, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_STEAMOS + // SteamOS + { + .names = { "SteamOS" }, + .lines = FASTFETCH_DATATEXT_LOGO_STEAMOS, + .colors = { + FF_COLOR_FG_BLUE, + FF_COLOR_FG_WHITE, + }, + .colorKeys = FF_COLOR_FG_BLUE, + .colorTitle = FF_COLOR_FG_BLUE, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_STEAMDECK + // Steam Deck + { + .names = { "SteamDeck" }, + .lines = FASTFETCH_DATATEXT_LOGO_STEAMDECK, + .colors = { + FF_COLOR_FG_BLUE, + FF_COLOR_FG_WHITE, + }, + .colorKeys = FF_COLOR_FG_BLUE, + .colorTitle = FF_COLOR_FG_BLUE, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_STEAMDECK_SMALL + // Steam Deck Small + { + .names = { "SteamDeck_small" }, + .lines = FASTFETCH_DATATEXT_LOGO_STEAMDECK_SMALL, + .colors = { + FF_COLOR_FG_BLUE, + FF_COLOR_FG_WHITE, + }, + .colorKeys = FF_COLOR_FG_BLUE, + .colorTitle = FF_COLOR_FG_BLUE, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_STEAMDECK + // Steam Deck OLED + { + .names = { "SteamDeckOled" }, + .lines = FASTFETCH_DATATEXT_LOGO_STEAMDECK, + .colors = { + FF_COLOR_FG_RED, + FF_COLOR_FG_WHITE, + }, + .colorKeys = FF_COLOR_FG_RED, + .colorTitle = FF_COLOR_FG_RED, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_SULIN + // Sulin + { + .names = { "Sulin" }, + .lines = FASTFETCH_DATATEXT_LOGO_SULIN, + .colors = { + FF_COLOR_FG_BLUE, + FF_COLOR_FG_WHITE, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_SUMMITOS + // SummitOS + { + .names = { "SummitOS" }, + .lines = FASTFETCH_DATATEXT_LOGO_SUMMITOS, + .colors = { + FF_COLOR_FG_RGB "143;191;80", + FF_COLOR_FG_RGB "160;205;102", + FF_COLOR_FG_RGB "181;225;102", + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_SUSE + // Suse + { + .names = { "suse", "suse-linux" }, + .lines = FASTFETCH_DATATEXT_LOGO_SUSE, + .colors = { + FF_COLOR_FG_GREEN, + FF_COLOR_FG_GREEN, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_OPENSUSE_SMALL + // SuseSmall + { + .names = { "suse_small", "suse-linux_small" }, + .type = FF_LOGO_LINE_TYPE_SMALL_BIT, + .lines = FASTFETCH_DATATEXT_LOGO_OPENSUSE_SMALL, + .colors = { + FF_COLOR_FG_GREEN, + FF_COLOR_FG_GREEN, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_SWAGARCH + // Swagarch + { + .names = { "Swagarch" }, + .lines = FASTFETCH_DATATEXT_LOGO_SWAGARCH, + .colors = { + FF_COLOR_FG_BLUE, + FF_COLOR_FG_WHITE, + }, + }, + #endif + // LAST + {}, +}; diff --git a/src/logo/ascii/sabayon.txt b/src/logo/ascii/s/sabayon.txt similarity index 100% rename from src/logo/ascii/sabayon.txt rename to src/logo/ascii/s/sabayon.txt diff --git a/src/logo/ascii/sabotage.txt b/src/logo/ascii/s/sabotage.txt similarity index 100% rename from src/logo/ascii/sabotage.txt rename to src/logo/ascii/s/sabotage.txt diff --git a/src/logo/ascii/sailfish.txt b/src/logo/ascii/s/sailfish.txt similarity index 100% rename from src/logo/ascii/sailfish.txt rename to src/logo/ascii/s/sailfish.txt diff --git a/src/logo/ascii/salentos.txt b/src/logo/ascii/s/salentos.txt similarity index 100% rename from src/logo/ascii/salentos.txt rename to src/logo/ascii/s/salentos.txt diff --git a/src/logo/ascii/salientos.txt b/src/logo/ascii/s/salientos.txt similarity index 100% rename from src/logo/ascii/salientos.txt rename to src/logo/ascii/s/salientos.txt diff --git a/src/logo/ascii/salix.txt b/src/logo/ascii/s/salix.txt similarity index 100% rename from src/logo/ascii/salix.txt rename to src/logo/ascii/s/salix.txt diff --git a/src/logo/ascii/sambabox.txt b/src/logo/ascii/s/sambabox.txt similarity index 100% rename from src/logo/ascii/sambabox.txt rename to src/logo/ascii/s/sambabox.txt diff --git a/src/logo/ascii/sasanqua.txt b/src/logo/ascii/s/sasanqua.txt similarity index 100% rename from src/logo/ascii/sasanqua.txt rename to src/logo/ascii/s/sasanqua.txt diff --git a/src/logo/ascii/scientific.txt b/src/logo/ascii/s/scientific.txt similarity index 100% rename from src/logo/ascii/scientific.txt rename to src/logo/ascii/s/scientific.txt diff --git a/src/logo/ascii/secureblue.txt b/src/logo/ascii/s/secureblue.txt similarity index 100% rename from src/logo/ascii/secureblue.txt rename to src/logo/ascii/s/secureblue.txt diff --git a/src/logo/ascii/semc.txt b/src/logo/ascii/s/semc.txt similarity index 100% rename from src/logo/ascii/semc.txt rename to src/logo/ascii/s/semc.txt diff --git a/src/logo/ascii/septor.txt b/src/logo/ascii/s/septor.txt similarity index 100% rename from src/logo/ascii/septor.txt rename to src/logo/ascii/s/septor.txt diff --git a/src/logo/ascii/serene.txt b/src/logo/ascii/s/serene.txt similarity index 100% rename from src/logo/ascii/serene.txt rename to src/logo/ascii/s/serene.txt diff --git a/src/logo/ascii/serpent_os.txt b/src/logo/ascii/s/serpent_os.txt similarity index 100% rename from src/logo/ascii/serpent_os.txt rename to src/logo/ascii/s/serpent_os.txt diff --git a/src/logo/ascii/sharklinux.txt b/src/logo/ascii/s/sharklinux.txt similarity index 100% rename from src/logo/ascii/sharklinux.txt rename to src/logo/ascii/s/sharklinux.txt diff --git a/src/logo/ascii/shastraos.txt b/src/logo/ascii/s/shastraos.txt similarity index 100% rename from src/logo/ascii/shastraos.txt rename to src/logo/ascii/s/shastraos.txt diff --git a/src/logo/ascii/shebang.txt b/src/logo/ascii/s/shebang.txt similarity index 100% rename from src/logo/ascii/shebang.txt rename to src/logo/ascii/s/shebang.txt diff --git a/src/logo/ascii/siduction.txt b/src/logo/ascii/s/siduction.txt similarity index 100% rename from src/logo/ascii/siduction.txt rename to src/logo/ascii/s/siduction.txt diff --git a/src/logo/ascii/skiffos.txt b/src/logo/ascii/s/skiffos.txt similarity index 100% rename from src/logo/ascii/skiffos.txt rename to src/logo/ascii/s/skiffos.txt diff --git a/src/logo/ascii/slackel.txt b/src/logo/ascii/s/slackel.txt similarity index 100% rename from src/logo/ascii/slackel.txt rename to src/logo/ascii/s/slackel.txt diff --git a/src/logo/ascii/slackware.txt b/src/logo/ascii/s/slackware.txt similarity index 100% rename from src/logo/ascii/slackware.txt rename to src/logo/ascii/s/slackware.txt diff --git a/src/logo/ascii/slackware_small.txt b/src/logo/ascii/s/slackware_small.txt similarity index 100% rename from src/logo/ascii/slackware_small.txt rename to src/logo/ascii/s/slackware_small.txt diff --git a/src/logo/ascii/sleeperos.txt b/src/logo/ascii/s/sleeperos.txt similarity index 100% rename from src/logo/ascii/sleeperos.txt rename to src/logo/ascii/s/sleeperos.txt diff --git a/src/logo/ascii/sleeperos_small.txt b/src/logo/ascii/s/sleeperos_small.txt similarity index 100% rename from src/logo/ascii/sleeperos_small.txt rename to src/logo/ascii/s/sleeperos_small.txt diff --git a/src/logo/ascii/slitaz.txt b/src/logo/ascii/s/slitaz.txt similarity index 100% rename from src/logo/ascii/slitaz.txt rename to src/logo/ascii/s/slitaz.txt diff --git a/src/logo/ascii/smartos.txt b/src/logo/ascii/s/smartos.txt similarity index 100% rename from src/logo/ascii/smartos.txt rename to src/logo/ascii/s/smartos.txt diff --git a/src/logo/ascii/snigdhaos.txt b/src/logo/ascii/s/snigdhaos.txt similarity index 100% rename from src/logo/ascii/snigdhaos.txt rename to src/logo/ascii/s/snigdhaos.txt diff --git a/src/logo/ascii/soda.txt b/src/logo/ascii/s/soda.txt similarity index 100% rename from src/logo/ascii/soda.txt rename to src/logo/ascii/s/soda.txt diff --git a/src/logo/ascii/solaris.txt b/src/logo/ascii/s/solaris.txt similarity index 100% rename from src/logo/ascii/solaris.txt rename to src/logo/ascii/s/solaris.txt diff --git a/src/logo/ascii/solaris_small.txt b/src/logo/ascii/s/solaris_small.txt similarity index 100% rename from src/logo/ascii/solaris_small.txt rename to src/logo/ascii/s/solaris_small.txt diff --git a/src/logo/ascii/solus.txt b/src/logo/ascii/s/solus.txt similarity index 100% rename from src/logo/ascii/solus.txt rename to src/logo/ascii/s/solus.txt diff --git a/src/logo/ascii/source_mage.txt b/src/logo/ascii/s/source_mage.txt similarity index 100% rename from src/logo/ascii/source_mage.txt rename to src/logo/ascii/s/source_mage.txt diff --git a/src/logo/ascii/sparky.txt b/src/logo/ascii/s/sparky.txt similarity index 100% rename from src/logo/ascii/sparky.txt rename to src/logo/ascii/s/sparky.txt diff --git a/src/logo/ascii/spoinkos.txt b/src/logo/ascii/s/spoinkos.txt similarity index 100% rename from src/logo/ascii/spoinkos.txt rename to src/logo/ascii/s/spoinkos.txt diff --git a/src/logo/ascii/star.txt b/src/logo/ascii/s/star.txt similarity index 100% rename from src/logo/ascii/star.txt rename to src/logo/ascii/s/star.txt diff --git a/src/logo/ascii/steamdeck.txt b/src/logo/ascii/s/steamdeck.txt similarity index 100% rename from src/logo/ascii/steamdeck.txt rename to src/logo/ascii/s/steamdeck.txt diff --git a/src/logo/ascii/steamdeck_small.txt b/src/logo/ascii/s/steamdeck_small.txt similarity index 100% rename from src/logo/ascii/steamdeck_small.txt rename to src/logo/ascii/s/steamdeck_small.txt diff --git a/src/logo/ascii/steamos.txt b/src/logo/ascii/s/steamos.txt similarity index 100% rename from src/logo/ascii/steamos.txt rename to src/logo/ascii/s/steamos.txt diff --git a/src/logo/ascii/stock_linux.txt b/src/logo/ascii/s/stock_linux.txt similarity index 100% rename from src/logo/ascii/stock_linux.txt rename to src/logo/ascii/s/stock_linux.txt diff --git a/src/logo/ascii/sulin.txt b/src/logo/ascii/s/sulin.txt similarity index 100% rename from src/logo/ascii/sulin.txt rename to src/logo/ascii/s/sulin.txt diff --git a/src/logo/ascii/summitos.txt b/src/logo/ascii/s/summitos.txt similarity index 100% rename from src/logo/ascii/summitos.txt rename to src/logo/ascii/s/summitos.txt diff --git a/src/logo/ascii/suse.txt b/src/logo/ascii/s/suse.txt similarity index 100% rename from src/logo/ascii/suse.txt rename to src/logo/ascii/s/suse.txt diff --git a/src/logo/ascii/swagarch.txt b/src/logo/ascii/s/swagarch.txt similarity index 100% rename from src/logo/ascii/swagarch.txt rename to src/logo/ascii/s/swagarch.txt diff --git a/src/logo/ascii/t.inc b/src/logo/ascii/t.inc new file mode 100644 index 0000000000..53947eab5a --- /dev/null +++ b/src/logo/ascii/t.inc @@ -0,0 +1,152 @@ +#include "../logo.h" +#include "logo_builtin.h" +#include "common/color.h" + +static const FFlogo T[] = { + #ifdef FASTFETCH_DATATEXT_LOGO_T2 + // T2 + { + .names = { "T2", "T2 SDE", "T2/Linux" }, + .lines = FASTFETCH_DATATEXT_LOGO_T2, + .colors = { + FF_COLOR_FG_RED, + FF_COLOR_FG_WHITE, + FF_COLOR_FG_YELLOW, + FF_COLOR_FG_BLUE, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_T2_SMALL + // T2Small + { + .names = { "T2_small", "T2 SDE_small", "T2/Linux_small" }, + .type = FF_LOGO_LINE_TYPE_SMALL_BIT, + .lines = FASTFETCH_DATATEXT_LOGO_T2_SMALL, + .colors = { + FF_COLOR_FG_WHITE, + FF_COLOR_FG_BLUE, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_TAILS + // Tails + { + .names = { "Tails" }, + .lines = FASTFETCH_DATATEXT_LOGO_TAILS, + .colors = { + FF_COLOR_FG_BLUE, + FF_COLOR_FG_WHITE, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_TATRA + // Tatra + { + .names = { "Tatra" }, + .lines = FASTFETCH_DATATEXT_LOGO_TATRA, + .colors = { + FF_COLOR_FG_BLUE, + FF_COLOR_FG_GREEN, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_TEARCH + // TeArch + { + .names = { "TeArch" }, + .lines = FASTFETCH_DATATEXT_LOGO_TEARCH, + .colors = { + FF_COLOR_FG_256 "39", + FF_COLOR_FG_WHITE, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_TEMPLEOS + // TempleOS + { + .names = { "TempleOS" }, + .lines = FASTFETCH_DATATEXT_LOGO_TEMPLEOS, + .colors = { + FF_COLOR_FG_YELLOW, + FF_COLOR_FG_RED, + FF_COLOR_FG_CYAN, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_TILEOS + // TileOS + { + .names = { "TileOS" }, + .lines = FASTFETCH_DATATEXT_LOGO_TILEOS, + .colors = { + FF_COLOR_FG_MAGENTA, + FF_COLOR_FG_BLUE, + FF_COLOR_FG_GREEN, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_TORIZONCORE + // Torizon OS + { + .names = { "Torizon OS", "TorizonCore" }, + .lines = FASTFETCH_DATATEXT_LOGO_TORIZONCORE, + .colors = { + FF_COLOR_FG_LIGHT_WHITE, + FF_COLOR_FG_YELLOW, + FF_COLOR_FG_BLUE, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_TRISQUEL + // Trisquel + { + .names = { "Trisquel" }, + .lines = FASTFETCH_DATATEXT_LOGO_TRISQUEL, + .colors = { + FF_COLOR_FG_BLUE, + FF_COLOR_FG_CYAN, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_TRUENAS_SCALE + // TrueNAS Scale + { + .names = { "TrueNAS-Scale" }, + .lines = FASTFETCH_DATATEXT_LOGO_TRUENAS_SCALE, + .colors = { + FF_COLOR_FG_256 "39", + FF_COLOR_FG_256 "32", + FF_COLOR_FG_256 "248", + }, + .colorKeys = FF_COLOR_FG_256 "248", + .colorTitle = FF_COLOR_FG_256 "32", + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_TUXEDO_OS + // TuxedoOS + { + .names = { "Tuxedo OS", "tuxedo" }, + .lines = FASTFETCH_DATATEXT_LOGO_TUXEDO_OS, + .colors = { + FF_COLOR_FG_WHITE, + FF_COLOR_FG_RED, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_TWISTER + // Twister + { + .names = { "Twister" }, + .lines = FASTFETCH_DATATEXT_LOGO_TWISTER, + .colors = { + FF_COLOR_FG_GREEN, + FF_COLOR_FG_RED, + FF_COLOR_FG_BLUE, + FF_COLOR_FG_MAGENTA, + FF_COLOR_FG_WHITE, + }, + }, + #endif + // LAST + {}, +}; diff --git a/src/logo/ascii/t2.txt b/src/logo/ascii/t/t2.txt similarity index 100% rename from src/logo/ascii/t2.txt rename to src/logo/ascii/t/t2.txt diff --git a/src/logo/ascii/t2_small.txt b/src/logo/ascii/t/t2_small.txt similarity index 100% rename from src/logo/ascii/t2_small.txt rename to src/logo/ascii/t/t2_small.txt diff --git a/src/logo/ascii/tails.txt b/src/logo/ascii/t/tails.txt similarity index 100% rename from src/logo/ascii/tails.txt rename to src/logo/ascii/t/tails.txt diff --git a/src/logo/ascii/tatra.txt b/src/logo/ascii/t/tatra.txt similarity index 100% rename from src/logo/ascii/tatra.txt rename to src/logo/ascii/t/tatra.txt diff --git a/src/logo/ascii/tearch.txt b/src/logo/ascii/t/tearch.txt similarity index 100% rename from src/logo/ascii/tearch.txt rename to src/logo/ascii/t/tearch.txt diff --git a/src/logo/ascii/templeos.txt b/src/logo/ascii/t/templeos.txt similarity index 100% rename from src/logo/ascii/templeos.txt rename to src/logo/ascii/t/templeos.txt diff --git a/src/logo/ascii/tileos.txt b/src/logo/ascii/t/tileos.txt similarity index 100% rename from src/logo/ascii/tileos.txt rename to src/logo/ascii/t/tileos.txt diff --git a/src/logo/ascii/torizoncore.txt b/src/logo/ascii/t/torizoncore.txt similarity index 100% rename from src/logo/ascii/torizoncore.txt rename to src/logo/ascii/t/torizoncore.txt diff --git a/src/logo/ascii/trisquel.txt b/src/logo/ascii/t/trisquel.txt similarity index 100% rename from src/logo/ascii/trisquel.txt rename to src/logo/ascii/t/trisquel.txt diff --git a/src/logo/ascii/truenas_scale.txt b/src/logo/ascii/t/truenas_scale.txt similarity index 100% rename from src/logo/ascii/truenas_scale.txt rename to src/logo/ascii/t/truenas_scale.txt diff --git a/src/logo/ascii/tuxedo_os.txt b/src/logo/ascii/t/tuxedo_os.txt similarity index 100% rename from src/logo/ascii/tuxedo_os.txt rename to src/logo/ascii/t/tuxedo_os.txt diff --git a/src/logo/ascii/twister.txt b/src/logo/ascii/t/twister.txt similarity index 100% rename from src/logo/ascii/twister.txt rename to src/logo/ascii/t/twister.txt diff --git a/src/logo/ascii/u.inc b/src/logo/ascii/u.inc new file mode 100644 index 0000000000..79bad1a23a --- /dev/null +++ b/src/logo/ascii/u.inc @@ -0,0 +1,316 @@ +#include "../logo.h" +#include "logo_builtin.h" +#include "common/color.h" + +static const FFlogo U[] = { + #ifdef FASTFETCH_DATATEXT_LOGO_UBLINUX + // UBLinux + { + .names = { "UBLinux" }, + .lines = FASTFETCH_DATATEXT_LOGO_UBLINUX, + .colors = { + FF_COLOR_FG_256 "38", + FF_COLOR_FG_WHITE, + FF_COLOR_FG_LIGHT_BLACK, + }, + .colorKeys = FF_COLOR_FG_256 "38", + .colorTitle = FF_COLOR_FG_DEFAULT, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_UBLINUX_SMALL + // UBLinuxSmall + { + .names = { "UBLinux_small" }, + .type = FF_LOGO_LINE_TYPE_SMALL_BIT, + .lines = FASTFETCH_DATATEXT_LOGO_UBLINUX_SMALL, + .colors = { + FF_COLOR_FG_256 "38", + FF_COLOR_FG_WHITE, + FF_COLOR_FG_LIGHT_BLACK, + }, + .colorKeys = FF_COLOR_FG_256 "38", + .colorTitle = FF_COLOR_FG_DEFAULT, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_UBUNTU + // Ubuntu + { + .names = { "ubuntu", "ubuntu-linux" }, + .lines = FASTFETCH_DATATEXT_LOGO_UBUNTU, + .colors = { + FF_COLOR_FG_RED, + FF_COLOR_FG_RED, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_UBUNTU_SMALL + // UbuntuSmall + { + .names = { "ubuntu_small", "ubuntu-linux_small" }, + .type = FF_LOGO_LINE_TYPE_SMALL_BIT, + .lines = FASTFETCH_DATATEXT_LOGO_UBUNTU_SMALL, + .colors = { + FF_COLOR_FG_RED, + FF_COLOR_FG_RED, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_UBUNTU_OLD + // UbuntuOld + { + .names = { "ubuntu_old", "ubuntu-linux_old" }, + .type = FF_LOGO_LINE_TYPE_ALTER_BIT, + .lines = FASTFETCH_DATATEXT_LOGO_UBUNTU_OLD, + .colors = { + FF_COLOR_FG_RED, + FF_COLOR_FG_WHITE, + }, + .colorKeys = FF_COLOR_FG_RED, + .colorTitle = FF_COLOR_FG_RED, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_UBUNTU_OLD2 + // UbuntuOld2 + { + .names = { "ubuntu_old2" }, + .type = FF_LOGO_LINE_TYPE_ALTER_BIT, + .lines = FASTFETCH_DATATEXT_LOGO_UBUNTU_OLD2, + .colors = { + FF_COLOR_FG_RED, + FF_COLOR_FG_WHITE, + FF_COLOR_FG_YELLOW, + }, + .colorKeys = FF_COLOR_FG_RED, + .colorTitle = FF_COLOR_FG_RED, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_UBUNTU_OLD2_SMALL + // UbuntuOld2Small + { + .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 = { + FF_COLOR_FG_RED, + }, + .colorKeys = FF_COLOR_FG_RED, + .colorTitle = FF_COLOR_FG_RED, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_UBUNTU_BUDGIE + // UbuntuBudgie + { + .names = { "ubuntu budgie", "ubuntu-budgie" }, + .lines = FASTFETCH_DATATEXT_LOGO_UBUNTU_BUDGIE, + .colors = { + FF_COLOR_FG_BLUE, + FF_COLOR_FG_WHITE, + FF_COLOR_FG_RED, + }, + .colorKeys = FF_COLOR_FG_BLUE, + .colorTitle = FF_COLOR_FG_DEFAULT, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_UBUNTU_CINNAMON + // UbuntuCinnamon + { + .names = { "ubuntu cinnamon", "ubuntu-cinnamon" }, + .lines = FASTFETCH_DATATEXT_LOGO_UBUNTU_CINNAMON, + .colors = { + FF_COLOR_FG_RED, + FF_COLOR_FG_WHITE, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_UBUNTU_GNOME + // UbuntuGNOME + { + .names = { "ubuntu gnome", "ubuntu-gnome" }, + .lines = FASTFETCH_DATATEXT_LOGO_UBUNTU_GNOME, + .colors = { + FF_COLOR_FG_BLUE, + FF_COLOR_FG_MAGENTA, + FF_COLOR_FG_WHITE, + FF_COLOR_FG_CYAN, + }, + .colorKeys = FF_COLOR_FG_BLUE, + .colorTitle = FF_COLOR_FG_MAGENTA, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_UBUNTU_KYLIN + // UbuntuKylin + { + .names = { "ubuntu kylin", "ubuntu-kylin" }, + .lines = FASTFETCH_DATATEXT_LOGO_UBUNTU_KYLIN, + .colors = { + FF_COLOR_FG_RED, + FF_COLOR_FG_WHITE, + FF_COLOR_FG_YELLOW, + }, + .colorKeys = FF_COLOR_FG_RED, + .colorTitle = FF_COLOR_FG_DEFAULT, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_UBUNTU_MATE + // UbuntuMate + { + .names = { "ubuntu mate", "ubuntu-mate" }, + .lines = FASTFETCH_DATATEXT_LOGO_UBUNTU_MATE, + .colors = { + FF_COLOR_FG_GREEN, + FF_COLOR_FG_WHITE, + }, + .colorKeys = FF_COLOR_FG_GREEN, + .colorTitle = FF_COLOR_FG_DEFAULT, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_UBUNTU_STUDIO + // UbuntuStudio + { + .names = { "ubuntu studio", "ubuntu-studio" }, + .lines = FASTFETCH_DATATEXT_LOGO_UBUNTU_STUDIO, + .colors = { + FF_COLOR_FG_CYAN, + FF_COLOR_FG_WHITE, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_UBUNTU_SWAY + // UbuntuSway + { + .names = { "ubuntu sway", "ubuntu-sway" }, + .lines = FASTFETCH_DATATEXT_LOGO_UBUNTU_SWAY, + .colors = { + FF_COLOR_FG_CYAN, + FF_COLOR_FG_WHITE, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_UBUNTU_TOUCH + // UbuntuTouch + { + .names = { "ubuntu touch", "ubuntu-touch" }, + .lines = FASTFETCH_DATATEXT_LOGO_UBUNTU_TOUCH, + .colors = { + FF_COLOR_FG_YELLOW, + FF_COLOR_FG_WHITE, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_UBUNTU_UNITY + // UbuntuUnity + { + .names = { "ubuntu unity", "ubuntu-unity" }, + .lines = FASTFETCH_DATATEXT_LOGO_UBUNTU_UNITY, + .colors = { + FF_COLOR_FG_MAGENTA, + FF_COLOR_FG_WHITE, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_ULTRAMARINE + // Ultramarine + { + .names = { "Ultramarine", "Ultramarine Linux" }, + .lines = FASTFETCH_DATATEXT_LOGO_ULTRAMARINE, + .colors = { + FF_COLOR_FG_BLUE, + FF_COLOR_FG_WHITE, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_ULTRAMARINE_SMALL + // Ultramarine Small + { + .names = { "Ultramarine_small" }, + .lines = FASTFETCH_DATATEXT_LOGO_ULTRAMARINE_SMALL, + .colors = { + FF_COLOR_FG_BLUE, + FF_COLOR_FG_WHITE, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_UNIFI + // Unifi + { + .names = { "Unifi" }, + .lines = FASTFETCH_DATATEXT_LOGO_UNIFI, + .colors = { + FF_COLOR_FG_WHITE, + FF_COLOR_FG_WHITE, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_UNIVALENT + // Univalent + { + .names = { "Univalent" }, + .lines = FASTFETCH_DATATEXT_LOGO_UNIVALENT, + .colors = { + FF_COLOR_FG_CYAN, + FF_COLOR_FG_CYAN, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_UNIVENTION + // Univention + { + .names = { "Univention" }, + .lines = FASTFETCH_DATATEXT_LOGO_UNIVENTION, + .colors = { + FF_COLOR_FG_RED, + FF_COLOR_FG_WHITE, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_UOS + // UOS + { + .names = { "UOS" }, + .lines = FASTFETCH_DATATEXT_LOGO_UOS, + .colors = { + FF_COLOR_FG_BLUE, + }, + .colorKeys = FF_COLOR_FG_DEFAULT, + .colorTitle = FF_COLOR_FG_BLUE, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_URUKOS + // UrukOS + { + .names = { "UrukOS" }, + .lines = FASTFETCH_DATATEXT_LOGO_URUKOS, + .colors = { + FF_COLOR_FG_LIGHT_BLUE, + FF_COLOR_FG_LIGHT_BLUE, + FF_COLOR_FG_WHITE, + FF_COLOR_FG_LIGHT_BLUE, + FF_COLOR_FG_BLUE, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_UWUNTU + // Uwuntu + { + .names = { "uwuntu" }, + .lines = FASTFETCH_DATATEXT_LOGO_UWUNTU, + .colors = { + FF_COLOR_FG_256 "225", + FF_COLOR_FG_256 "206", + FF_COLOR_FG_256 "52", + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_UZBEK + // Uzbek + { + .names = { "Uzbek" }, + .lines = FASTFETCH_DATATEXT_LOGO_UZBEK, + .colors = { + FF_COLOR_FG_GREEN, + }, + }, + #endif + // LAST + {}, +}; diff --git a/src/logo/ascii/ublinux.txt b/src/logo/ascii/u/ublinux.txt similarity index 100% rename from src/logo/ascii/ublinux.txt rename to src/logo/ascii/u/ublinux.txt diff --git a/src/logo/ascii/ublinux_small.txt b/src/logo/ascii/u/ublinux_small.txt similarity index 100% rename from src/logo/ascii/ublinux_small.txt rename to src/logo/ascii/u/ublinux_small.txt diff --git a/src/logo/ascii/ubuntu.txt b/src/logo/ascii/u/ubuntu.txt similarity index 100% rename from src/logo/ascii/ubuntu.txt rename to src/logo/ascii/u/ubuntu.txt diff --git a/src/logo/ascii/ubuntu_budgie.txt b/src/logo/ascii/u/ubuntu_budgie.txt similarity index 100% rename from src/logo/ascii/ubuntu_budgie.txt rename to src/logo/ascii/u/ubuntu_budgie.txt diff --git a/src/logo/ascii/ubuntu_cinnamon.txt b/src/logo/ascii/u/ubuntu_cinnamon.txt similarity index 100% rename from src/logo/ascii/ubuntu_cinnamon.txt rename to src/logo/ascii/u/ubuntu_cinnamon.txt diff --git a/src/logo/ascii/ubuntu_gnome.txt b/src/logo/ascii/u/ubuntu_gnome.txt similarity index 100% rename from src/logo/ascii/ubuntu_gnome.txt rename to src/logo/ascii/u/ubuntu_gnome.txt diff --git a/src/logo/ascii/ubuntu_kylin.txt b/src/logo/ascii/u/ubuntu_kylin.txt similarity index 100% rename from src/logo/ascii/ubuntu_kylin.txt rename to src/logo/ascii/u/ubuntu_kylin.txt diff --git a/src/logo/ascii/ubuntu_mate.txt b/src/logo/ascii/u/ubuntu_mate.txt similarity index 100% rename from src/logo/ascii/ubuntu_mate.txt rename to src/logo/ascii/u/ubuntu_mate.txt diff --git a/src/logo/ascii/ubuntu_old.txt b/src/logo/ascii/u/ubuntu_old.txt similarity index 100% rename from src/logo/ascii/ubuntu_old.txt rename to src/logo/ascii/u/ubuntu_old.txt diff --git a/src/logo/ascii/ubuntu_old2.txt b/src/logo/ascii/u/ubuntu_old2.txt similarity index 100% rename from src/logo/ascii/ubuntu_old2.txt rename to src/logo/ascii/u/ubuntu_old2.txt diff --git a/src/logo/ascii/ubuntu_old2_small.txt b/src/logo/ascii/u/ubuntu_old2_small.txt similarity index 100% rename from src/logo/ascii/ubuntu_old2_small.txt rename to src/logo/ascii/u/ubuntu_old2_small.txt diff --git a/src/logo/ascii/ubuntu_small.txt b/src/logo/ascii/u/ubuntu_small.txt similarity index 100% rename from src/logo/ascii/ubuntu_small.txt rename to src/logo/ascii/u/ubuntu_small.txt diff --git a/src/logo/ascii/ubuntu_studio.txt b/src/logo/ascii/u/ubuntu_studio.txt similarity index 100% rename from src/logo/ascii/ubuntu_studio.txt rename to src/logo/ascii/u/ubuntu_studio.txt diff --git a/src/logo/ascii/ubuntu_sway.txt b/src/logo/ascii/u/ubuntu_sway.txt similarity index 100% rename from src/logo/ascii/ubuntu_sway.txt rename to src/logo/ascii/u/ubuntu_sway.txt diff --git a/src/logo/ascii/ubuntu_touch.txt b/src/logo/ascii/u/ubuntu_touch.txt similarity index 100% rename from src/logo/ascii/ubuntu_touch.txt rename to src/logo/ascii/u/ubuntu_touch.txt diff --git a/src/logo/ascii/ubuntu_unity.txt b/src/logo/ascii/u/ubuntu_unity.txt similarity index 100% rename from src/logo/ascii/ubuntu_unity.txt rename to src/logo/ascii/u/ubuntu_unity.txt diff --git a/src/logo/ascii/ultramarine.txt b/src/logo/ascii/u/ultramarine.txt similarity index 100% rename from src/logo/ascii/ultramarine.txt rename to src/logo/ascii/u/ultramarine.txt diff --git a/src/logo/ascii/ultramarine_small.txt b/src/logo/ascii/u/ultramarine_small.txt similarity index 100% rename from src/logo/ascii/ultramarine_small.txt rename to src/logo/ascii/u/ultramarine_small.txt diff --git a/src/logo/ascii/unifi.txt b/src/logo/ascii/u/unifi.txt similarity index 100% rename from src/logo/ascii/unifi.txt rename to src/logo/ascii/u/unifi.txt diff --git a/src/logo/ascii/univalent.txt b/src/logo/ascii/u/univalent.txt similarity index 100% rename from src/logo/ascii/univalent.txt rename to src/logo/ascii/u/univalent.txt diff --git a/src/logo/ascii/univention.txt b/src/logo/ascii/u/univention.txt similarity index 100% rename from src/logo/ascii/univention.txt rename to src/logo/ascii/u/univention.txt diff --git a/src/logo/ascii/uos.txt b/src/logo/ascii/u/uos.txt similarity index 100% rename from src/logo/ascii/uos.txt rename to src/logo/ascii/u/uos.txt diff --git a/src/logo/ascii/urukos.txt b/src/logo/ascii/u/urukos.txt similarity index 100% rename from src/logo/ascii/urukos.txt rename to src/logo/ascii/u/urukos.txt diff --git a/src/logo/ascii/uwuntu.txt b/src/logo/ascii/u/uwuntu.txt similarity index 100% rename from src/logo/ascii/uwuntu.txt rename to src/logo/ascii/u/uwuntu.txt diff --git a/src/logo/ascii/uzbek.txt b/src/logo/ascii/u/uzbek.txt similarity index 100% rename from src/logo/ascii/uzbek.txt rename to src/logo/ascii/u/uzbek.txt diff --git a/src/logo/ascii/v.inc b/src/logo/ascii/v.inc new file mode 100644 index 0000000000..0ad596957f --- /dev/null +++ b/src/logo/ascii/v.inc @@ -0,0 +1,170 @@ +#include "../logo.h" +#include "logo_builtin.h" +#include "common/color.h" + +static const FFlogo V[] = { + #ifdef FASTFETCH_DATATEXT_LOGO_VALHALLA + // Valhalla + { + .names = { "Valhalla", "valhallaos", "valhalla-linux" }, + .lines = FASTFETCH_DATATEXT_LOGO_VALHALLA, + .colors = { + FF_COLOR_FG_DEFAULT, + }, + .colorKeys = FF_COLOR_FG_DEFAULT, + .colorTitle = FF_COLOR_FG_DEFAULT, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_VANILLA + // Vanilla + { + .names = { "vanilla" }, + .lines = FASTFETCH_DATATEXT_LOGO_VANILLA, + .colors = { + FF_COLOR_FG_YELLOW, + }, + .colorKeys = FF_COLOR_FG_YELLOW, + .colorTitle = FF_COLOR_FG_YELLOW, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_VANILLA2 + // Vanilla2 + { + .names = { "vanilla2" }, + .type = FF_LOGO_LINE_TYPE_ALTER_BIT, + .lines = FASTFETCH_DATATEXT_LOGO_VANILLA2, + .colors = { + FF_COLOR_FG_YELLOW, + }, + .colorKeys = FF_COLOR_FG_YELLOW, + .colorTitle = FF_COLOR_FG_YELLOW, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_VANILLA_SMALL + // VanillaSmall + { + .names = { "vanilla_small" }, + .type = FF_LOGO_LINE_TYPE_SMALL_BIT, + .lines = FASTFETCH_DATATEXT_LOGO_VANILLA_SMALL, + .colors = { + FF_COLOR_FG_LIGHT_YELLOW, + FF_COLOR_FG_YELLOW, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_VENOM + // Venom + { + .names = { "Venom" }, + .lines = FASTFETCH_DATATEXT_LOGO_VENOM, + .colors = { + FF_COLOR_FG_LIGHT_BLACK, + FF_COLOR_FG_BLUE, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_VENOM_SMALL + // VenomSmall + { + .names = { "Venom_small" }, + .type = FF_LOGO_LINE_TYPE_SMALL_BIT, + .lines = FASTFETCH_DATATEXT_LOGO_VENOM_SMALL, + .colors = { + FF_COLOR_FG_LIGHT_BLACK, + FF_COLOR_FG_BLUE, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_VINCENTOS + // VincentOS + { + .names = { "VincentOS" }, + .lines = FASTFETCH_DATATEXT_LOGO_VINCENTOS, + .colors = { + FF_COLOR_FG_GREEN, + FF_COLOR_FG_DEFAULT, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_VNUX + // Vnux + { + .names = { "Vnux" }, + .lines = FASTFETCH_DATATEXT_LOGO_VNUX, + .colors = { + FF_COLOR_FG_256 "11", + FF_COLOR_FG_256 "8", + FF_COLOR_FG_256 "15", + FF_COLOR_FG_RED, + FF_COLOR_FG_WHITE, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_VZLINUX + // Vzlinux + { + .names = { "Vzlinux" }, + .lines = FASTFETCH_DATATEXT_LOGO_VZLINUX, + .colors = { + FF_COLOR_FG_RED, + FF_COLOR_FG_WHITE, + FF_COLOR_FG_YELLOW, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_VOID + // Void + { + .names = { "void" }, + .lines = FASTFETCH_DATATEXT_LOGO_VOID, + .colors = { + FF_COLOR_FG_GREEN, + FF_COLOR_FG_LIGHT_BLACK, + }, + .colorKeys = FF_COLOR_FG_DEFAULT, + .colorTitle = FF_COLOR_FG_GREEN, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_VOID_SMALL + // VoidSmall + { + .names = { "void_small" }, + .type = FF_LOGO_LINE_TYPE_SMALL_BIT, + .lines = FASTFETCH_DATATEXT_LOGO_VOID_SMALL, + .colors = { + FF_COLOR_FG_GREEN, + }, + .colorKeys = FF_COLOR_FG_DEFAULT, + .colorTitle = FF_COLOR_FG_GREEN, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_VOID2 + // Void2 + { + .names = { "void2" }, + .lines = FASTFETCH_DATATEXT_LOGO_VOID2, + .colors = { + FF_COLOR_FG_YELLOW, + FF_COLOR_FG_DEFAULT, + FF_COLOR_FG_GREEN, + }, + .colorKeys = FF_COLOR_FG_DEFAULT, + .colorTitle = FF_COLOR_FG_GREEN, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_VOID2_SMALL + // Void2Small + { + .names = { "void2_small" }, + .type = FF_LOGO_LINE_TYPE_SMALL_BIT | FF_LOGO_LINE_TYPE_ALTER_BIT, + .lines = FASTFETCH_DATATEXT_LOGO_VOID2_SMALL, + .colors = { + FF_COLOR_FG_GREEN, + }, + .colorKeys = FF_COLOR_FG_DEFAULT, + .colorTitle = FF_COLOR_FG_GREEN, + }, + #endif + // LAST + {}, +}; diff --git a/src/logo/ascii/valhalla.txt b/src/logo/ascii/v/valhalla.txt similarity index 100% rename from src/logo/ascii/valhalla.txt rename to src/logo/ascii/v/valhalla.txt diff --git a/src/logo/ascii/vanilla.txt b/src/logo/ascii/v/vanilla.txt similarity index 100% rename from src/logo/ascii/vanilla.txt rename to src/logo/ascii/v/vanilla.txt diff --git a/src/logo/ascii/vanilla2.txt b/src/logo/ascii/v/vanilla2.txt similarity index 100% rename from src/logo/ascii/vanilla2.txt rename to src/logo/ascii/v/vanilla2.txt diff --git a/src/logo/ascii/vanilla_small.txt b/src/logo/ascii/v/vanilla_small.txt similarity index 100% rename from src/logo/ascii/vanilla_small.txt rename to src/logo/ascii/v/vanilla_small.txt diff --git a/src/logo/ascii/venom.txt b/src/logo/ascii/v/venom.txt similarity index 100% rename from src/logo/ascii/venom.txt rename to src/logo/ascii/v/venom.txt diff --git a/src/logo/ascii/venom_small.txt b/src/logo/ascii/v/venom_small.txt similarity index 100% rename from src/logo/ascii/venom_small.txt rename to src/logo/ascii/v/venom_small.txt diff --git a/src/logo/ascii/vincentos.txt b/src/logo/ascii/v/vincentos.txt similarity index 100% rename from src/logo/ascii/vincentos.txt rename to src/logo/ascii/v/vincentos.txt diff --git a/src/logo/ascii/vnux.txt b/src/logo/ascii/v/vnux.txt similarity index 100% rename from src/logo/ascii/vnux.txt rename to src/logo/ascii/v/vnux.txt diff --git a/src/logo/ascii/void.txt b/src/logo/ascii/v/void.txt similarity index 100% rename from src/logo/ascii/void.txt rename to src/logo/ascii/v/void.txt diff --git a/src/logo/ascii/void2.txt b/src/logo/ascii/v/void2.txt similarity index 100% rename from src/logo/ascii/void2.txt rename to src/logo/ascii/v/void2.txt diff --git a/src/logo/ascii/void2_small.txt b/src/logo/ascii/v/void2_small.txt similarity index 100% rename from src/logo/ascii/void2_small.txt rename to src/logo/ascii/v/void2_small.txt diff --git a/src/logo/ascii/void_small.txt b/src/logo/ascii/v/void_small.txt similarity index 100% rename from src/logo/ascii/void_small.txt rename to src/logo/ascii/v/void_small.txt diff --git a/src/logo/ascii/vzlinux.txt b/src/logo/ascii/v/vzlinux.txt similarity index 100% rename from src/logo/ascii/vzlinux.txt rename to src/logo/ascii/v/vzlinux.txt diff --git a/src/logo/ascii/w.inc b/src/logo/ascii/w.inc new file mode 100644 index 0000000000..dea8eaf53d --- /dev/null +++ b/src/logo/ascii/w.inc @@ -0,0 +1,123 @@ +#include "../logo.h" +#include "logo_builtin.h" +#include "common/color.h" + +static const FFlogo W[] = { + #ifdef FASTFETCH_DATATEXT_LOGO_WII_LINUX + // WiiLinux + { + .names = { "WiiLinuxNgx", "WiiLinux", "Wii-Linux", "Wii Linux" }, + .lines = FASTFETCH_DATATEXT_LOGO_WII_LINUX, + .colors = { + FF_COLOR_FG_CYAN, + FF_COLOR_FG_WHITE, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_WINDOWS_2025 + // Windows2025 + { + .names = { "Windows Server 2025" }, + .lines = FASTFETCH_DATATEXT_LOGO_WINDOWS_2025, + .colors = { + FF_COLOR_FG_BLUE, + FF_COLOR_FG_BLUE, + FF_COLOR_FG_BLUE, + FF_COLOR_FG_BLUE, + }, + .colorKeys = FF_COLOR_FG_YELLOW, + .colorTitle = FF_COLOR_FG_CYAN, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_WINDOWS_11 + // Windows11 + { + .names = { "Windows 11", "Windows Server 2022" }, + .lines = FASTFETCH_DATATEXT_LOGO_WINDOWS_11, + .colors = { + FF_COLOR_FG_BLUE, + FF_COLOR_FG_BLUE, + FF_COLOR_FG_BLUE, + FF_COLOR_FG_BLUE, + }, + .colorKeys = FF_COLOR_FG_YELLOW, + .colorTitle = FF_COLOR_FG_CYAN, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_WINDOWS_11_SMALL + // Windows11Small + { + .names = { "Windows 11_small" }, + .type = FF_LOGO_LINE_TYPE_SMALL_BIT, + .lines = FASTFETCH_DATATEXT_LOGO_WINDOWS_11_SMALL, + .colors = { + FF_COLOR_FG_BLUE, + FF_COLOR_FG_BLUE, + FF_COLOR_FG_BLUE, + FF_COLOR_FG_BLUE, + }, + .colorKeys = FF_COLOR_FG_YELLOW, + .colorTitle = FF_COLOR_FG_CYAN, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_WINDOWS_8 + // Windows8 + { + .names = { "Windows 8", "Windows 8.1", "Windows 10", "Windows Server 2012", "Windows Server 2012 R2", "Windows Server 2016", "Windows Server 2019" }, + .lines = FASTFETCH_DATATEXT_LOGO_WINDOWS_8, + .colors = { + FF_COLOR_FG_CYAN, + FF_COLOR_FG_CYAN, + FF_COLOR_FG_CYAN, + FF_COLOR_FG_CYAN, + }, + .colorKeys = FF_COLOR_FG_YELLOW, + .colorTitle = FF_COLOR_FG_DEFAULT, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_WINDOWS + // Windows + { + .names = { "Windows", "Windows 7", "Windows Server 2008", "Windows Server 2008 R2" }, + .lines = FASTFETCH_DATATEXT_LOGO_WINDOWS, + .colors = { + FF_COLOR_FG_RED, + FF_COLOR_FG_GREEN, + FF_COLOR_FG_BLUE, + FF_COLOR_FG_YELLOW, + }, + .colorKeys = FF_COLOR_FG_BLUE, + .colorTitle = FF_COLOR_FG_GREEN, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_WINDOWS_95 + // Windows95 + { + .names = { "Windows 95", "Windows 9x" }, + .lines = FASTFETCH_DATATEXT_LOGO_WINDOWS_95, + .colors = { + FF_COLOR_FG_CYAN, + FF_COLOR_FG_BLUE, + FF_COLOR_FG_YELLOW, + FF_COLOR_FG_GREEN, + FF_COLOR_FG_RED, + FF_COLOR_FG_BLACK, + }, + .colorKeys = FF_COLOR_FG_CYAN, + .colorTitle = FF_COLOR_FG_BLUE, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_WOLFOS + // WolfOS + { + .names = { "WolfOS" }, + .lines = FASTFETCH_DATATEXT_LOGO_WOLFOS, + .colors = { + FF_COLOR_FG_BLUE, + FF_COLOR_FG_GREEN, + }, + }, + #endif + // LAST + {}, +}; diff --git a/src/logo/ascii/wii_linux.txt b/src/logo/ascii/w/wii_linux.txt similarity index 100% rename from src/logo/ascii/wii_linux.txt rename to src/logo/ascii/w/wii_linux.txt diff --git a/src/logo/ascii/windows.txt b/src/logo/ascii/w/windows.txt similarity index 100% rename from src/logo/ascii/windows.txt rename to src/logo/ascii/w/windows.txt diff --git a/src/logo/ascii/windows_11.txt b/src/logo/ascii/w/windows_11.txt similarity index 100% rename from src/logo/ascii/windows_11.txt rename to src/logo/ascii/w/windows_11.txt diff --git a/src/logo/ascii/windows_11_small.txt b/src/logo/ascii/w/windows_11_small.txt similarity index 100% rename from src/logo/ascii/windows_11_small.txt rename to src/logo/ascii/w/windows_11_small.txt diff --git a/src/logo/ascii/windows_2025.txt b/src/logo/ascii/w/windows_2025.txt similarity index 100% rename from src/logo/ascii/windows_2025.txt rename to src/logo/ascii/w/windows_2025.txt diff --git a/src/logo/ascii/windows_8.txt b/src/logo/ascii/w/windows_8.txt similarity index 100% rename from src/logo/ascii/windows_8.txt rename to src/logo/ascii/w/windows_8.txt diff --git a/src/logo/ascii/windows_95.txt b/src/logo/ascii/w/windows_95.txt similarity index 100% rename from src/logo/ascii/windows_95.txt rename to src/logo/ascii/w/windows_95.txt diff --git a/src/logo/ascii/wolfos.txt b/src/logo/ascii/w/wolfos.txt similarity index 100% rename from src/logo/ascii/wolfos.txt rename to src/logo/ascii/w/wolfos.txt diff --git a/src/logo/ascii/x.inc b/src/logo/ascii/x.inc new file mode 100644 index 0000000000..8c2341ebeb --- /dev/null +++ b/src/logo/ascii/x.inc @@ -0,0 +1,132 @@ +#include "../logo.h" +#include "logo_builtin.h" +#include "common/color.h" + +static const FFlogo X[] = { + #ifdef FASTFETCH_DATATEXT_LOGO_XCP_NG + // XCP-ng + { + .names = { "XCP-ng", "xenenterprise" }, + .lines = FASTFETCH_DATATEXT_LOGO_XCP_NG, + .colors = { + FF_COLOR_FG_RED, + FF_COLOR_FG_RED, + FF_COLOR_FG_BLACK, + FF_COLOR_FG_BLACK, + FF_COLOR_FG_BLUE, + FF_COLOR_FG_YELLOW, + } }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_XENIA + // Xenia + { + .names = { "Xenia" }, + .lines = FASTFETCH_DATATEXT_LOGO_XENIA, + .colors = { + FF_COLOR_FG_RED, + FF_COLOR_FG_LIGHT_BLACK, + }, + .colorKeys = FF_COLOR_FG_DEFAULT, + .colorTitle = FF_COLOR_FG_RED, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_XENIA_OLD + // Xenia_old + { + .names = { "Xenia_old" }, + .lines = FASTFETCH_DATATEXT_LOGO_XENIA_OLD, + .type = FF_LOGO_LINE_TYPE_ALTER_BIT, + .colors = { + FF_COLOR_FG_YELLOW, + FF_COLOR_FG_GREEN, + FF_COLOR_FG_RED, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_XEROARCH + // XeroArch + { + .names = { "XeroArch" }, + .lines = FASTFETCH_DATATEXT_LOGO_XEROARCH, + .colors = { + FF_COLOR_FG_256 "50", + FF_COLOR_FG_256 "14", + FF_COLOR_FG_256 "50", + FF_COLOR_FG_256 "93", + FF_COLOR_FG_256 "16", + FF_COLOR_FG_256 "15", + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_XFERIENCE + // Xferience + { + .names = { "Xferience" }, + .lines = FASTFETCH_DATATEXT_LOGO_XFERIENCE, + .colors = { + FF_COLOR_FG_CYAN, + FF_COLOR_FG_CYAN, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_XUBUNTU + // Xubuntu + { + .names = { "Xubuntu" }, + .lines = FASTFETCH_DATATEXT_LOGO_XUBUNTU, + .colors = { + FF_COLOR_FG_256 "25", + FF_COLOR_FG_DEFAULT, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_XRAY_OS + // Xray_OS + { + .names = { "Xray_OS" }, + .lines = FASTFETCH_DATATEXT_LOGO_XRAY_OS, + .colors = { + FF_COLOR_FG_256 "15", + FF_COLOR_FG_256 "14", + FF_COLOR_FG_256 "16", + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_XINUX + // Xinux + { + .names = { "Xinux" }, + .lines = FASTFETCH_DATATEXT_LOGO_XINUX, + .colors = { + FF_COLOR_FG_BLUE, + FF_COLOR_FG_CYAN, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_XJ380 + // XJ380 + { + .names = { "XJ380" }, + .lines = FASTFETCH_DATATEXT_LOGO_XJ380, + .colors = { + FF_COLOR_FG_RGB "0;162;232", + FF_COLOR_FG_RGB "255;242;0", + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_XIMPER + // Ximper + { + .names = { "Ximper" }, + .lines = FASTFETCH_DATATEXT_LOGO_XIMPER, + .colors = { + FF_COLOR_FG_256 "21", + FF_COLOR_FG_256 "57", + FF_COLOR_FG_256 "92", + FF_COLOR_FG_256 "128", + }, + }, + #endif + // LAST + {}, +}; diff --git a/src/logo/ascii/xcp_ng.txt b/src/logo/ascii/x/xcp_ng.txt similarity index 100% rename from src/logo/ascii/xcp_ng.txt rename to src/logo/ascii/x/xcp_ng.txt diff --git a/src/logo/ascii/xenia.txt b/src/logo/ascii/x/xenia.txt similarity index 100% rename from src/logo/ascii/xenia.txt rename to src/logo/ascii/x/xenia.txt diff --git a/src/logo/ascii/xenia_old.txt b/src/logo/ascii/x/xenia_old.txt similarity index 100% rename from src/logo/ascii/xenia_old.txt rename to src/logo/ascii/x/xenia_old.txt diff --git a/src/logo/ascii/xeroarch.txt b/src/logo/ascii/x/xeroarch.txt similarity index 100% rename from src/logo/ascii/xeroarch.txt rename to src/logo/ascii/x/xeroarch.txt diff --git a/src/logo/ascii/xferience.txt b/src/logo/ascii/x/xferience.txt similarity index 100% rename from src/logo/ascii/xferience.txt rename to src/logo/ascii/x/xferience.txt diff --git a/src/logo/ascii/ximper.txt b/src/logo/ascii/x/ximper.txt similarity index 100% rename from src/logo/ascii/ximper.txt rename to src/logo/ascii/x/ximper.txt diff --git a/src/logo/ascii/xinux.txt b/src/logo/ascii/x/xinux.txt similarity index 100% rename from src/logo/ascii/xinux.txt rename to src/logo/ascii/x/xinux.txt diff --git a/src/logo/ascii/xj380.txt b/src/logo/ascii/x/xj380.txt similarity index 100% rename from src/logo/ascii/xj380.txt rename to src/logo/ascii/x/xj380.txt diff --git a/src/logo/ascii/xray_os.txt b/src/logo/ascii/x/xray_os.txt similarity index 100% rename from src/logo/ascii/xray_os.txt rename to src/logo/ascii/x/xray_os.txt diff --git a/src/logo/ascii/xubuntu.txt b/src/logo/ascii/x/xubuntu.txt similarity index 100% rename from src/logo/ascii/xubuntu.txt rename to src/logo/ascii/x/xubuntu.txt diff --git a/src/logo/ascii/y.inc b/src/logo/ascii/y.inc new file mode 100644 index 0000000000..6f44f5b064 --- /dev/null +++ b/src/logo/ascii/y.inc @@ -0,0 +1,19 @@ +#include "../logo.h" +#include "logo_builtin.h" +#include "common/color.h" + +static const FFlogo Y[] = { + #ifdef FASTFETCH_DATATEXT_LOGO_YIFFOS + // YiffOS + { + .names = { "YiffOS" }, + .lines = FASTFETCH_DATATEXT_LOGO_YIFFOS, + .colors = { + FF_COLOR_FG_256 "93", + FF_COLOR_FG_256 "92", + }, + }, + #endif + // LAST + {}, +}; diff --git a/src/logo/ascii/yiffos.txt b/src/logo/ascii/y/yiffos.txt similarity index 100% rename from src/logo/ascii/yiffos.txt rename to src/logo/ascii/y/yiffos.txt diff --git a/src/logo/ascii/z.inc b/src/logo/ascii/z.inc new file mode 100644 index 0000000000..393c906313 --- /dev/null +++ b/src/logo/ascii/z.inc @@ -0,0 +1,42 @@ +#include "../logo.h" +#include "logo_builtin.h" +#include "common/color.h" + +static const FFlogo Z[] = { + #ifdef FASTFETCH_DATATEXT_LOGO_ZORIN + // Zorin + { + .names = { "Zorin" }, + .lines = FASTFETCH_DATATEXT_LOGO_ZORIN, + .colors = { + FF_COLOR_FG_BLUE, + }, + .colorKeys = FF_COLOR_FG_BLUE, + .colorTitle = FF_COLOR_FG_BLUE, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_ZOS + // Z/OS + { + .names = { "z/OS", "zos" }, + .lines = FASTFETCH_DATATEXT_LOGO_ZOS, + .colors = { + FF_COLOR_FG_BLUE, + }, + }, + #endif + #ifdef FASTFETCH_DATATEXT_LOGO_ZRAXYL + // Zraxyl + { + .names = { "Zraxyl" }, + .lines = FASTFETCH_DATATEXT_LOGO_ZRAXYL, + .colors = { + FF_COLOR_FG_BLUE, + }, + .colorKeys = FF_COLOR_FG_BLUE, + .colorTitle = FF_COLOR_FG_BLUE, + }, + #endif + // LAST + {}, +}; diff --git a/src/logo/ascii/zorin.txt b/src/logo/ascii/z/zorin.txt similarity index 100% rename from src/logo/ascii/zorin.txt rename to src/logo/ascii/z/zorin.txt diff --git a/src/logo/ascii/zos.txt b/src/logo/ascii/z/zos.txt similarity index 100% rename from src/logo/ascii/zos.txt rename to src/logo/ascii/z/zos.txt diff --git a/src/logo/ascii/zraxyl.txt b/src/logo/ascii/z/zraxyl.txt similarity index 100% rename from src/logo/ascii/zraxyl.txt rename to src/logo/ascii/z/zraxyl.txt diff --git a/src/logo/builtin.c b/src/logo/builtin.c index 1775a62734..d0563153e8 100644 --- a/src/logo/builtin.c +++ b/src/logo/builtin.c @@ -10,5707 +10,32 @@ const FFlogo ffLogoUnknown = { }, }; -static const FFlogo A[] = { - // Adélie - { - .names = { "Adélie", "Adelie" }, - .lines = FASTFETCH_DATATEXT_LOGO_ADELIE, - .colors = { - FF_COLOR_FG_BLUE, - FF_COLOR_FG_WHITE, - FF_COLOR_FG_CYAN, - }, - }, - // AerOS - { - .names = { "aerOS" }, - .lines = FASTFETCH_DATATEXT_LOGO_AEROS, - .colors = { - FF_COLOR_FG_CYAN, - FF_COLOR_FG_CYAN, - }, - }, - // Aeon - { - .names = { "Aeon" }, - .lines = FASTFETCH_DATATEXT_LOGO_AEON, - .colors = { - FF_COLOR_FG_256 "36", - FF_COLOR_FG_256 "36", - }, - }, - // AerynOS - { - .names = { "AerynOS" }, - .lines = FASTFETCH_DATATEXT_LOGO_AERYNOS, - .colors = { - FF_COLOR_FG_GREEN, - FF_COLOR_FG_YELLOW, - }, - }, - // AerynOS_old - { - .names = { "AerynOS_old" }, - .lines = FASTFETCH_DATATEXT_LOGO_AERYNOS_OLD, - .type = FF_LOGO_LINE_TYPE_ALTER_BIT, - .colors = { - FF_COLOR_FG_DEFAULT, - FF_COLOR_FG_MAGENTA, - }, - }, - // Afterglow - { - .names = { "Afterglow" }, - .lines = FASTFETCH_DATATEXT_LOGO_AFTERGLOW, - .colors = { - FF_COLOR_FG_MAGENTA, - FF_COLOR_FG_RED, - FF_COLOR_FG_YELLOW, - FF_COLOR_FG_BLUE, - }, - }, - // AIX - { - .names = { "aix" }, - .lines = FASTFETCH_DATATEXT_LOGO_AIX, - .colors = { - FF_COLOR_FG_GREEN, - FF_COLOR_FG_WHITE, - }, - .colorKeys = FF_COLOR_FG_GREEN, - .colorTitle = FF_COLOR_FG_DEFAULT, - }, - // AlmaLinux - { - .names = { "Almalinux" }, - .lines = FASTFETCH_DATATEXT_LOGO_ALMALINUX, - .colors = { - FF_COLOR_FG_RED, - FF_COLOR_FG_LIGHT_YELLOW, - FF_COLOR_FG_BLUE, - FF_COLOR_FG_LIGHT_GREEN, - FF_COLOR_FG_CYAN, - }, - .colorKeys = FF_COLOR_FG_YELLOW, - .colorTitle = FF_COLOR_FG_RED, - }, - // Alpine - { - .names = { "Alpine" }, - .lines = FASTFETCH_DATATEXT_LOGO_ALPINE, - .colors = { - FF_COLOR_FG_BLUE, - }, - .colorKeys = FF_COLOR_FG_MAGENTA, - .colorTitle = FF_COLOR_FG_BLUE, - }, - // Alpine2 - { - .names = { "Alpine2" }, - .lines = FASTFETCH_DATATEXT_LOGO_ALPINE2, - .type = FF_LOGO_LINE_TYPE_ALTER_BIT, - .colors = { - FF_COLOR_FG_BLUE, - FF_COLOR_FG_WHITE, - }, - .colorKeys = FF_COLOR_FG_BLUE, - .colorTitle = FF_COLOR_FG_BLUE, - }, - // AlpineSmall - { - .names = { "Alpine_small" }, - .type = FF_LOGO_LINE_TYPE_SMALL_BIT, - .lines = FASTFETCH_DATATEXT_LOGO_ALPINE_SMALL, - .colors = { - FF_COLOR_FG_BLUE, - FF_COLOR_FG_WHITE, - }, - .colorKeys = FF_COLOR_FG_MAGENTA, - .colorTitle = FF_COLOR_FG_BLUE, - }, - // Alpine2Small - { - .names = { "alpine2_small" }, - .type = FF_LOGO_LINE_TYPE_SMALL_BIT | FF_LOGO_LINE_TYPE_ALTER_BIT, - .lines = FASTFETCH_DATATEXT_LOGO_ALPINE2_SMALL, - .colors = { - FF_COLOR_FG_BLUE, - FF_COLOR_FG_WHITE, - }, - .colorKeys = FF_COLOR_FG_MAGENTA, - .colorTitle = FF_COLOR_FG_BLUE, - }, - // Alpine3Small - { - .names = { "alpine3_small" }, - .type = FF_LOGO_LINE_TYPE_SMALL_BIT | FF_LOGO_LINE_TYPE_ALTER_BIT, - .lines = FASTFETCH_DATATEXT_LOGO_ALPINE3_SMALL, - .colors = { - FF_COLOR_FG_DEFAULT, - }, - .colorKeys = FF_COLOR_FG_BLUE, - .colorTitle = FF_COLOR_FG_BLUE, - }, - // Alter - { - .names = { "Alter" }, - .lines = FASTFETCH_DATATEXT_LOGO_ALTER, - .colors = { - FF_COLOR_FG_CYAN, - }, - .colorKeys = FF_COLOR_FG_CYAN, - .colorTitle = FF_COLOR_FG_CYAN, - }, - // ALTLinux - { - .names = { "ALTLinux" }, - .lines = FASTFETCH_DATATEXT_LOGO_ALTLINUX, - .colors = { - FF_COLOR_FG_YELLOW, - FF_COLOR_FG_BLACK, - FF_COLOR_FG_WHITE, - }, - .colorKeys = FF_COLOR_FG_YELLOW, - .colorTitle = FF_COLOR_FG_YELLOW, - }, - // Amazon - { - .names = { "Amazon" }, - .lines = FASTFETCH_DATATEXT_LOGO_AMAZON, - .colors = { - FF_COLOR_FG_YELLOW, - FF_COLOR_FG_WHITE, - }, - }, - // AmazonLinux - { - .names = { "Amazon Linux", "amzn" }, - .lines = FASTFETCH_DATATEXT_LOGO_AMAZON_LINUX, - .colors = { - FF_COLOR_FG_WHITE, - FF_COLOR_FG_256 "178", - }, - }, - // Amiga - { - .names = { "Amiga" }, - .lines = FASTFETCH_DATATEXT_LOGO_AMIGA, - .colors = { - FF_COLOR_FG_RED, - FF_COLOR_FG_LIGHT_RED, - FF_COLOR_FG_YELLOW, - FF_COLOR_FG_BLUE, - FF_COLOR_FG_CYAN, - FF_COLOR_FG_LIGHT_YELLOW, - FF_COLOR_FG_GREEN, - }, - }, - // AmogOS - { - .names = { "AmogOS" }, - .lines = FASTFETCH_DATATEXT_LOGO_AMOGOS, - .colors = { - FF_COLOR_FG_WHITE, - FF_COLOR_FG_CYAN, - }, - .colorKeys = FF_COLOR_FG_DEFAULT, - .colorTitle = FF_COLOR_FG_CYAN, - }, - // Anarchy - { - .names = { "Anarchy" }, - .lines = FASTFETCH_DATATEXT_LOGO_ANARCHY, - .colors = { - FF_COLOR_FG_WHITE, - FF_COLOR_FG_BLUE, - }, - .colorKeys = FF_COLOR_FG_DEFAULT, - .colorTitle = FF_COLOR_FG_BLUE, - }, - // Android - { - .names = { "android" }, - .lines = FASTFETCH_DATATEXT_LOGO_ANDROID, - .colors = { - FF_COLOR_FG_GREEN, - FF_COLOR_FG_WHITE, - }, - .colorKeys = FF_COLOR_FG_GREEN, - .colorTitle = FF_COLOR_FG_GREEN, - }, - // AndroidSmall - { - .names = { "android_small" }, - .type = FF_LOGO_LINE_TYPE_SMALL_BIT, - .lines = FASTFETCH_DATATEXT_LOGO_ANDROID_SMALL, - .colors = { - FF_COLOR_FG_GREEN, - }, - .colorKeys = FF_COLOR_FG_GREEN, - .colorTitle = FF_COLOR_FG_GREEN, - }, - // AnduinOS - { - .names = { "anduinos" }, - .lines = FASTFETCH_DATATEXT_LOGO_ANDUINOS, - .colors = { - FF_COLOR_FG_CYAN, - FF_COLOR_FG_BLUE, - }, - .colorKeys = FF_COLOR_FG_BLUE, - .colorTitle = FF_COLOR_FG_DEFAULT, - }, - // Antergos - { - .names = { "Antergos" }, - .lines = FASTFETCH_DATATEXT_LOGO_ANTERGOS, - .colors = { - FF_COLOR_FG_BLUE, - FF_COLOR_FG_CYAN, - }, - .colorKeys = FF_COLOR_FG_BLUE, - .colorTitle = FF_COLOR_FG_CYAN, - }, - // Antix - { - .names = { "antiX" }, - .lines = FASTFETCH_DATATEXT_LOGO_ANTIX, - .colors = { - FF_COLOR_FG_RED, - }, - .colorKeys = FF_COLOR_FG_RED, - .colorTitle = FF_COLOR_FG_DEFAULT, - }, - // AnushOS - { - .names = { "AnushOS" }, - .lines = FASTFETCH_DATATEXT_LOGO_ANUSHOS, - .colors = { - FF_COLOR_FG_WHITE, - FF_COLOR_FG_BLACK, - FF_COLOR_FG_YELLOW, - FF_COLOR_FG_CYAN, - FF_COLOR_FG_RED, - }, - .colorKeys = FF_COLOR_FG_DEFAULT, - .colorTitle = FF_COLOR_FG_DEFAULT, - }, - // AoscOsRetro - { - .names = { "Aosc OS/Retro", "aoscosretro" }, - .lines = FASTFETCH_DATATEXT_LOGO_AOSCOSRETRO, - .colors = { - FF_COLOR_FG_BLUE, - FF_COLOR_FG_WHITE, - }, - .colorKeys = FF_COLOR_FG_BLUE, - .colorTitle = FF_COLOR_FG_DEFAULT, - }, - // AoscOsRetro_small - { - .names = { "Aosc OS/Retro_small", "aoscosretro_small" }, - .type = FF_LOGO_LINE_TYPE_SMALL_BIT, - .lines = FASTFETCH_DATATEXT_LOGO_AOSCOSRETRO_SMALL, - .colors = { - FF_COLOR_FG_BLUE, - FF_COLOR_FG_WHITE, - }, - .colorKeys = FF_COLOR_FG_BLUE, - .colorTitle = FF_COLOR_FG_DEFAULT, - }, - // AoscOS - { - .names = { "Aosc OS", "aoscos" }, - .lines = FASTFETCH_DATATEXT_LOGO_AOSCOS, - .colors = { - FF_COLOR_FG_BLUE, - FF_COLOR_FG_BLACK, - FF_COLOR_FG_RED, - FF_COLOR_FG_YELLOW, - }, - }, - // AoscOS_old - { - .names = { "Aosc OS_old", "aoscos_old" }, - .lines = FASTFETCH_DATATEXT_LOGO_AOSCOS_OLD, - .type = FF_LOGO_LINE_TYPE_ALTER_BIT, - .colors = { - FF_COLOR_FG_DEFAULT, - }, - .colorKeys = FF_COLOR_FG_BLUE, - .colorTitle = FF_COLOR_FG_DEFAULT, - }, - // Aperture - { - .names = { "Aperture" }, - .lines = FASTFETCH_DATATEXT_LOGO_APERTURE, - .colors = { - FF_COLOR_FG_CYAN, - FF_COLOR_FG_CYAN, - FF_COLOR_FG_CYAN, - FF_COLOR_FG_CYAN, - FF_COLOR_FG_CYAN, - FF_COLOR_FG_CYAN, - FF_COLOR_FG_CYAN, - FF_COLOR_FG_CYAN, - }, - .colorKeys = FF_COLOR_FG_CYAN, - .colorTitle = FF_COLOR_FG_DEFAULT, - }, - // Apple - { - .names = { "Apple" }, - .lines = FASTFETCH_DATATEXT_LOGO_MACOS, - .colors = { - FF_COLOR_FG_GREEN, - FF_COLOR_FG_YELLOW, - FF_COLOR_FG_LIGHT_RED, - FF_COLOR_FG_RED, - FF_COLOR_FG_MAGENTA, - FF_COLOR_FG_BLUE, - }, - .colorKeys = FF_COLOR_FG_YELLOW, - .colorTitle = FF_COLOR_FG_GREEN, - }, - // AppleSmall - { - .names = { "Apple_small" }, - .type = FF_LOGO_LINE_TYPE_SMALL_BIT, - .lines = FASTFETCH_DATATEXT_LOGO_MACOS_SMALL, - .colors = { - FF_COLOR_FG_GREEN, - FF_COLOR_FG_YELLOW, - FF_COLOR_FG_RED, - FF_COLOR_FG_MAGENTA, - FF_COLOR_FG_BLUE, - }, - .colorKeys = FF_COLOR_FG_YELLOW, - .colorTitle = FF_COLOR_FG_GREEN, - }, - // Apricity - { - .names = { "Apricity" }, - .lines = FASTFETCH_DATATEXT_LOGO_APRICITY, - .colors = { - FF_COLOR_FG_DEFAULT, - }, - .colorKeys = FF_COLOR_FG_BLUE, - .colorTitle = FF_COLOR_FG_DEFAULT, - }, - // ArchBox - { - .names = { "ArchBox" }, - .lines = FASTFETCH_DATATEXT_LOGO_ARCHBOX, - .colors = { - FF_COLOR_FG_GREEN, - }, - .colorKeys = FF_COLOR_FG_GREEN, - .colorTitle = FF_COLOR_FG_DEFAULT, - }, - // Archcraft - { - .names = { "Archcraft" }, - .lines = FASTFETCH_DATATEXT_LOGO_ARCHCRAFT, - .colors = { - FF_COLOR_FG_CYAN, - }, - .colorKeys = FF_COLOR_FG_CYAN, - .colorTitle = FF_COLOR_FG_RED, - }, - // Archcraft2 - { - .names = { "Archcraft2" }, - .type = FF_LOGO_LINE_TYPE_ALTER_BIT, - .lines = FASTFETCH_DATATEXT_LOGO_ARCHCRAFT2, - .colors = { - FF_COLOR_FG_CYAN, - }, - .colorKeys = FF_COLOR_FG_CYAN, - .colorTitle = FF_COLOR_FG_RED, - }, - // Arch - { - .names = { "arch", "archmerge" }, - .lines = FASTFETCH_DATATEXT_LOGO_ARCH, - .colors = { - FF_COLOR_FG_CYAN, - FF_COLOR_FG_CYAN, - }, - }, - // Arch2 - { - .names = { "arch2" }, - .type = FF_LOGO_LINE_TYPE_ALTER_BIT, - .lines = FASTFETCH_DATATEXT_LOGO_ARCH2, - .colors = { - FF_COLOR_FG_CYAN, - FF_COLOR_FG_CYAN, - }, - }, - // Arch3 - { - .names = { "arch3" }, - .type = FF_LOGO_LINE_TYPE_ALTER_BIT, - .lines = FASTFETCH_DATATEXT_LOGO_ARCH3, - .colors = { - FF_COLOR_FG_CYAN, - FF_COLOR_FG_CYAN, - }, - }, - // ArchSmall - { - .names = { "arch_small" }, - .type = FF_LOGO_LINE_TYPE_SMALL_BIT, - .lines = FASTFETCH_DATATEXT_LOGO_ARCH_SMALL, - .colors = { - FF_COLOR_FG_CYAN, - FF_COLOR_FG_CYAN, - }, - }, - // ArchOld - { - .names = { "arch_old" }, - .type = FF_LOGO_LINE_TYPE_ALTER_BIT, - .lines = FASTFETCH_DATATEXT_LOGO_ARCH_OLD, - .colors = { - FF_COLOR_FG_BLUE, - FF_COLOR_FG_WHITE, - }, - .colorTitle = FF_COLOR_FG_DEFAULT, - .colorKeys = FF_COLOR_FG_BLUE, - }, - // Archlabs - { - .names = { "ARCHlabs" }, - .lines = FASTFETCH_DATATEXT_LOGO_ARCHLABS, - .colors = { - FF_COLOR_FG_CYAN, - FF_COLOR_FG_RED, - }, - .colorKeys = FF_COLOR_FG_CYAN, - .colorTitle = FF_COLOR_FG_RED, - }, - // ArchStrike - { - .names = { "ArchStrike" }, - .lines = FASTFETCH_DATATEXT_LOGO_ARCHSTRIKE, - .colors = { - FF_COLOR_FG_CYAN, - FF_COLOR_FG_BLACK, - }, - .colorKeys = FF_COLOR_FG_CYAN, - .colorTitle = FF_COLOR_FG_CYAN, - }, - // Arkane - { - .names = { "Arkane", "Arkane Linux" }, - .lines = FASTFETCH_DATATEXT_LOGO_ARKANE, - .colors = { - FF_COLOR_FG_256 "237", - FF_COLOR_FG_256 "130", - FF_COLOR_FG_WHITE, - }, - .colorKeys = FF_COLOR_FG_256 "130", - .colorTitle = FF_COLOR_FG_DEFAULT, - }, - // Armbian - { - .names = { "Armbian" }, - .lines = FASTFETCH_DATATEXT_LOGO_ARMBIAN, - .colors = { - FF_COLOR_FG_WHITE, - FF_COLOR_FG_RED, - }, - .colorKeys = FF_COLOR_FG_DEFAULT, - .colorTitle = FF_COLOR_FG_RED, - }, - // Armbian2 - { - .names = { "Armbian2" }, - .type = FF_LOGO_LINE_TYPE_ALTER_BIT, - .lines = FASTFETCH_DATATEXT_LOGO_ARMBIAN2, - .colors = { - FF_COLOR_FG_RED, - }, - .colorKeys = FF_COLOR_FG_DEFAULT, - .colorTitle = FF_COLOR_FG_RED, - }, - // Artix - { - .names = { "artix" }, - .lines = FASTFETCH_DATATEXT_LOGO_ARTIX, - .colors = { - FF_COLOR_FG_CYAN, - }, - .colorKeys = FF_COLOR_FG_CYAN, - .colorTitle = FF_COLOR_FG_CYAN, - }, - // ArtixSmall - { - .names = { "artix_small" }, - .type = FF_LOGO_LINE_TYPE_SMALL_BIT, - .lines = FASTFETCH_DATATEXT_LOGO_ARTIX_SMALL, - .colors = { - FF_COLOR_FG_CYAN, - }, - .colorKeys = FF_COLOR_FG_CYAN, - .colorTitle = FF_COLOR_FG_CYAN, - }, - // Artix2Small - { - .names = { "artix2_small" }, - .type = FF_LOGO_LINE_TYPE_SMALL_BIT | FF_LOGO_LINE_TYPE_ALTER_BIT, - .lines = FASTFETCH_DATATEXT_LOGO_ARTIX2_SMALL, - .colors = { - FF_COLOR_FG_CYAN, - }, - .colorKeys = FF_COLOR_FG_CYAN, - .colorTitle = FF_COLOR_FG_CYAN, - }, - // ArcoLinux (Discontinued) - { - .names = { "arco", "arcolinux" }, // ID=arcolinux - .lines = FASTFETCH_DATATEXT_LOGO_ARCO, - .colors = { - FF_COLOR_FG_BLUE, - FF_COLOR_FG_WHITE, - }, - .colorKeys = FF_COLOR_FG_BLUE, - .colorTitle = FF_COLOR_FG_BLUE, - }, - // ArcoLinuxSmall - { - .names = { "arco_small", "arcolinux_small" }, - .type = FF_LOGO_LINE_TYPE_SMALL_BIT, - .lines = FASTFETCH_DATATEXT_LOGO_ARCO_SMALL, - .colors = { - FF_COLOR_FG_BLUE, - FF_COLOR_FG_WHITE, - }, - .colorKeys = FF_COLOR_FG_BLUE, - .colorTitle = FF_COLOR_FG_BLUE, - }, - // ArseLinux - { - .names = { "arse", "arselinux", "arse-linux" }, - .lines = FASTFETCH_DATATEXT_LOGO_ARSELINUX, - .colors = { - FF_COLOR_FG_BLUE, - FF_COLOR_FG_WHITE, - }, - .colorKeys = FF_COLOR_FG_BLUE, - .colorTitle = FF_COLOR_FG_DEFAULT, - }, - // Arya - { - .names = { "Arya" }, - .lines = FASTFETCH_DATATEXT_LOGO_ARYA, - .colors = { - FF_COLOR_FG_GREEN, - FF_COLOR_FG_RED, - }, - .colorKeys = FF_COLOR_FG_GREEN, - .colorTitle = FF_COLOR_FG_RED, - }, - // Asahi - { - .names = { "asahi", "asahi-linux" }, - .lines = FASTFETCH_DATATEXT_LOGO_ASAHI, - .colors = { - FF_COLOR_FG_YELLOW, - FF_COLOR_FG_GREEN, - FF_COLOR_FG_RED, - FF_COLOR_FG_LIGHT_BLACK, - FF_COLOR_FG_WHITE, - FF_COLOR_FG_CYAN, - FF_COLOR_FG_BLUE, - }, - .colorKeys = FF_COLOR_FG_YELLOW, - .colorTitle = FF_COLOR_FG_GREEN, - }, - // Asahi2 - { - .names = { "asahi2", "asahi-linux2" }, - .lines = FASTFETCH_DATATEXT_LOGO_ASAHI2, - .type = FF_LOGO_LINE_TYPE_ALTER_BIT, - .colors = { - FF_COLOR_FG_LIGHT_YELLOW, - FF_COLOR_FG_CYAN, - FF_COLOR_FG_RED, - FF_COLOR_FG_LIGHT_RED, - FF_COLOR_FG_WHITE, - FF_COLOR_FG_BLACK, - FF_COLOR_FG_LIGHT_CYAN, - }, - .colorKeys = FF_COLOR_FG_YELLOW, - .colorTitle = FF_COLOR_FG_GREEN, - }, - // Aster - { - .names = { "aster" }, - .lines = FASTFETCH_DATATEXT_LOGO_ASTER, - .colors = { - FF_COLOR_FG_CYAN, - }, - .colorKeys = FF_COLOR_FG_CYAN, - .colorTitle = FF_COLOR_FG_CYAN, - }, - // AsteroidOS - { - .names = { "AsteroidOS" }, - .lines = FASTFETCH_DATATEXT_LOGO_ASTEROIDOS, - .colors = { - FF_COLOR_FG_256 "160", - FF_COLOR_FG_256 "208", - FF_COLOR_FG_256 "202", - FF_COLOR_FG_256 "214", - }, - .colorKeys = FF_COLOR_FG_256 "160", - .colorTitle = FF_COLOR_FG_256 "208", - }, - // AstOS - { - .names = { "astOS" }, - .lines = FASTFETCH_DATATEXT_LOGO_ASTOS, - .colors = { - FF_COLOR_FG_DEFAULT, - }, - .colorKeys = FF_COLOR_FG_DEFAULT, - .colorTitle = FF_COLOR_FG_DEFAULT, - }, - // Astra - { - .names = { "Astra", "Astra Linux", "astralinux" }, - .lines = FASTFETCH_DATATEXT_LOGO_ASTRA_LINUX, - .colors = { - FF_COLOR_FG_LIGHT_RED, - FF_COLOR_FG_WHITE, - }, - .colorKeys = FF_COLOR_FG_RED, - .colorTitle = FF_COLOR_FG_DEFAULT, - }, - // Ataraxia - { - .names = { "Ataraxia Linux", "Ataraxia" }, - .lines = FASTFETCH_DATATEXT_LOGO_JANUSLINUX, - .colors = { - FF_COLOR_FG_BLUE, - FF_COLOR_FG_MAGENTA, - }, - .colorKeys = FF_COLOR_FG_BLUE, - .colorTitle = FF_COLOR_FG_MAGENTA, - }, - // AthenaOS - { - .names = { "AthenaOS" }, - .lines = FASTFETCH_DATATEXT_LOGO_ATHENAOS, - .colors = { - FF_COLOR_FG_BLUE, - FF_COLOR_FG_LIGHT_BLUE, - }, - .colorKeys = FF_COLOR_FG_BLUE, - .colorTitle = FF_COLOR_FG_LIGHT_BLUE, - }, - // AthenaOS_old - { - .names = { "AthenaOS_old" }, - .lines = FASTFETCH_DATATEXT_LOGO_ATHENAOS_OLD, - .type = FF_LOGO_LINE_TYPE_ALTER_BIT, - .colors = { - FF_COLOR_FG_WHITE, - FF_COLOR_FG_YELLOW, - }, - .colorKeys = FF_COLOR_FG_YELLOW, - .colorTitle = FF_COLOR_FG_DEFAULT, - }, - // Aurora - { - .names = { "Aurora" }, - .lines = FASTFETCH_DATATEXT_LOGO_AURORA, - .colors = { - FF_COLOR_FG_BLUE, - FF_COLOR_FG_MAGENTA, - FF_COLOR_FG_RED, - FF_COLOR_FG_WHITE, - }, - }, - // AxOS - { - .names = { "AxOS" }, - .lines = FASTFETCH_DATATEXT_LOGO_AXOS, - .colors = { - FF_COLOR_FG_RGB "222;6;255", - FF_COLOR_FG_RGB "222;6;255", - }, - }, - // Azos - { - .names = { "Azos" }, - .lines = FASTFETCH_DATATEXT_LOGO_AZOS, - .colors = { - FF_COLOR_FG_CYAN, - FF_COLOR_FG_RED, - }, - }, - // LAST - {}, -}; - -static const FFlogo B[] = { - // Bedrock - { - .names = { "bedrock" }, - .lines = FASTFETCH_DATATEXT_LOGO_BEDROCK, - .colors = { - FF_COLOR_FG_LIGHT_BLACK, // grey - FF_COLOR_FG_DEFAULT, - }, - .colorKeys = FF_COLOR_FG_LIGHT_BLACK, // grey - .colorTitle = FF_COLOR_FG_DEFAULT, - }, - // BedrockSmall - { - .names = { "bedrock_small" }, - .lines = FASTFETCH_DATATEXT_LOGO_BEDROCK_SMALL, - .type = FF_LOGO_LINE_TYPE_SMALL_BIT, - .colors = { - FF_COLOR_FG_LIGHT_BLACK, // grey - FF_COLOR_FG_DEFAULT, - }, - .colorKeys = FF_COLOR_FG_LIGHT_BLACK, // grey - .colorTitle = FF_COLOR_FG_DEFAULT, - }, - // BigLinux - { - .names = { "BigLinux" }, - .lines = FASTFETCH_DATATEXT_LOGO_BIGLINUX, - .colors = { - FF_COLOR_FG_CYAN, - FF_COLOR_FG_YELLOW, - FF_COLOR_FG_BLUE, - }, - .colorKeys = FF_COLOR_FG_YELLOW, - .colorTitle = FF_COLOR_FG_CYAN, - }, - // Bitrig - { - .names = { "Bitrig" }, - .lines = FASTFETCH_DATATEXT_LOGO_BITRIG, - .colors = { - FF_COLOR_FG_GREEN, - }, - .colorKeys = FF_COLOR_FG_DEFAULT, - .colorTitle = FF_COLOR_FG_GREEN, - }, - // BlackArch - { - .names = { "Blackarch" }, - .lines = FASTFETCH_DATATEXT_LOGO_BLACKARCH, - .colors = { - FF_COLOR_FG_RED, - FF_COLOR_FG_LIGHT_RED, - FF_COLOR_FG_BLACK, - }, - .colorKeys = FF_COLOR_FG_LIGHT_RED, - .colorTitle = FF_COLOR_FG_RED, - }, - // BlackMesa - { - .names = { "BlackMesa", "black-mesa" }, - .lines = FASTFETCH_DATATEXT_LOGO_BLACKMESA, - .colors = { - FF_COLOR_FG_BLACK, - }, - .colorKeys = FF_COLOR_FG_BLACK, - .colorTitle = FF_COLOR_FG_DEFAULT, - }, - // BlackPanther - { - .names = { "BlackPanther" }, - .lines = FASTFETCH_DATATEXT_LOGO_BLACKPANTHER, - .colors = { - FF_COLOR_FG_RED, - FF_COLOR_FG_YELLOW, - FF_COLOR_FG_LIGHT_BLUE, - }, - .colorKeys = FF_COLOR_FG_RED, - .colorTitle = FF_COLOR_FG_YELLOW, - }, - // BLAG - { - .names = { "BLAG" }, - .lines = FASTFETCH_DATATEXT_LOGO_BLAG, - .colors = { - FF_COLOR_FG_MAGENTA, - }, - .colorKeys = FF_COLOR_FG_MAGENTA, - .colorTitle = FF_COLOR_FG_DEFAULT, - }, - // BlankOn - { - .names = { "BlankOn" }, - .lines = FASTFETCH_DATATEXT_LOGO_BLANKON, - .colors = { - FF_COLOR_FG_RED, - FF_COLOR_FG_WHITE, - }, - .colorKeys = FF_COLOR_FG_RED, - .colorTitle = FF_COLOR_FG_DEFAULT, - }, - // BlueLight - { - .names = { "BlueLight" }, - .lines = FASTFETCH_DATATEXT_LOGO_BLUELIGHT, - .colors = { - FF_COLOR_FG_WHITE, - FF_COLOR_FG_BLUE, - }, - .colorKeys = FF_COLOR_FG_DEFAULT, - .colorTitle = FF_COLOR_FG_BLUE, - }, - // Bodhi - { - .names = { "Bodhi" }, - .lines = FASTFETCH_DATATEXT_LOGO_BODHI, - .colors = { - FF_COLOR_FG_WHITE, - FF_COLOR_FG_LIGHT_YELLOW, - FF_COLOR_FG_GREEN, - }, - .colorKeys = FF_COLOR_FG_YELLOW, - .colorTitle = FF_COLOR_FG_GREEN, - }, - // Bonsai - { - .names = { "Bonsai" }, - .lines = FASTFETCH_DATATEXT_LOGO_BONSAI, - .colors = { - FF_COLOR_FG_CYAN, - FF_COLOR_FG_GREEN, - FF_COLOR_FG_YELLOW, - }, - .colorKeys = FF_COLOR_FG_CYAN, - .colorTitle = FF_COLOR_FG_GREEN, - }, - // BredOS - { - .names = { "Bredos" }, - .lines = FASTFETCH_DATATEXT_LOGO_BREDOS, - .colors = { - FF_COLOR_FG_RGB "198;151;66", // grey - }, - .colorKeys = FF_COLOR_FG_RGB "198;151;66", - .colorTitle = FF_COLOR_FG_RGB "198;151;66", - }, - // BSD - { - .names = { "BSD" }, - .lines = FASTFETCH_DATATEXT_LOGO_BSD, - .colors = { - FF_COLOR_FG_RED, - FF_COLOR_FG_WHITE, - FF_COLOR_FG_BLUE, - FF_COLOR_FG_YELLOW, - FF_COLOR_FG_CYAN, - }, - .colorKeys = FF_COLOR_FG_RED, - .colorTitle = FF_COLOR_FG_DEFAULT, - }, - // BunsenLabs - { - .names = { "BunsenLabs" }, - .lines = FASTFETCH_DATATEXT_LOGO_BUNSENLABS, - .colors = { - FF_COLOR_FG_DEFAULT, - }, - .colorKeys = FF_COLOR_FG_DEFAULT, - .colorTitle = FF_COLOR_FG_DEFAULT, - }, - // LAST - {}, -}; - -static const FFlogo C[] = { - // CachyOS - { - .names = { "CachyOS" }, - .lines = FASTFETCH_DATATEXT_LOGO_CACHYOS, - .colors = { - FF_COLOR_FG_CYAN, - FF_COLOR_FG_GREEN, - FF_COLOR_FG_BLACK, - }, - .colorKeys = FF_COLOR_FG_CYAN, - .colorTitle = FF_COLOR_FG_CYAN, - }, - // CachyOSSmall - { - .names = { "CachyOS_small" }, - .type = FF_LOGO_LINE_TYPE_SMALL_BIT, - .lines = FASTFETCH_DATATEXT_LOGO_CACHYOS_SMALL, - .colors = { - FF_COLOR_FG_CYAN, - }, - .colorKeys = FF_COLOR_FG_CYAN, - .colorTitle = FF_COLOR_FG_CYAN, - }, - // Calculate - { - .names = { "Calculate" }, - .lines = FASTFETCH_DATATEXT_LOGO_CALCULATE, - .colors = { - FF_COLOR_FG_WHITE, - FF_COLOR_FG_YELLOW, - }, - .colorKeys = FF_COLOR_FG_YELLOW, - .colorTitle = FF_COLOR_FG_DEFAULT, - }, - // CalinixOS - { - .names = { "Calinix", "calinixos" }, - .lines = FASTFETCH_DATATEXT_LOGO_CALINIXOS, - .colors = { - FF_COLOR_FG_MAGENTA, - }, - .colorKeys = FF_COLOR_FG_MAGENTA, - .colorTitle = FF_COLOR_FG_BLUE, - }, - // CalinixOSSmall - { - .names = { "Calinix_small", "calinixos_small" }, - .type = FF_LOGO_LINE_TYPE_SMALL_BIT, - .lines = FASTFETCH_DATATEXT_LOGO_CALINIXOS_SMALL, - .colors = { - FF_COLOR_FG_MAGENTA, - }, - .colorKeys = FF_COLOR_FG_MAGENTA, - .colorTitle = FF_COLOR_FG_BLUE, - }, - // Carbs - { - .names = { "Carbs" }, - .lines = FASTFETCH_DATATEXT_LOGO_CARBS, - .colors = { - FF_COLOR_FG_MAGENTA, - }, - .colorKeys = FF_COLOR_FG_MAGENTA, - .colorTitle = FF_COLOR_FG_BLUE, - }, - // CBL-Mariner - { - .names = { "CBL-Mariner" }, - .lines = FASTFETCH_DATATEXT_LOGO_CBL_MARINER, - .colors = { - FF_COLOR_FG_CYAN, - }, - .colorKeys = FF_COLOR_FG_CYAN, - .colorTitle = FF_COLOR_FG_CYAN, - }, - // CelOS - { - .names = { "Cel", "celos", "cel-linux", "celos-linux" }, - .lines = FASTFETCH_DATATEXT_LOGO_CELOS, - .colors = { - FF_COLOR_FG_MAGENTA, - FF_COLOR_FG_BLACK, - }, - .colorKeys = FF_COLOR_FG_CYAN, - .colorTitle = FF_COLOR_FG_BLUE, - }, - // Center - { - .names = { "Center" }, - .lines = FASTFETCH_DATATEXT_LOGO_CENTER, - .colors = { - FF_COLOR_FG_DEFAULT, - }, - .colorKeys = FF_COLOR_FG_DEFAULT, - .colorTitle = FF_COLOR_FG_DEFAULT, - }, - // CentOS - { - .names = { "CentOS" }, - .lines = FASTFETCH_DATATEXT_LOGO_CENTOS, - .colors = { - FF_COLOR_FG_YELLOW, - FF_COLOR_FG_GREEN, - FF_COLOR_FG_BLUE, - FF_COLOR_FG_MAGENTA, - FF_COLOR_FG_WHITE, - }, - .colorKeys = FF_COLOR_FG_GREEN, - .colorTitle = FF_COLOR_FG_YELLOW, - }, - // CentOSSmall - { - .names = { "CentOS_small" }, - .type = FF_LOGO_LINE_TYPE_SMALL_BIT, - .lines = FASTFETCH_DATATEXT_LOGO_CENTOS_SMALL, - .colors = { - FF_COLOR_FG_YELLOW, - FF_COLOR_FG_GREEN, - FF_COLOR_FG_BLUE, - FF_COLOR_FG_MAGENTA, - }, - .colorKeys = FF_COLOR_FG_GREEN, - .colorTitle = FF_COLOR_FG_YELLOW, - }, - // Cereus - { - .names = { "Cereus", "Cereus Linux" }, - .lines = FASTFETCH_DATATEXT_LOGO_CEREUS, - .colors = { - FF_COLOR_FG_256 "173", - FF_COLOR_FG_256 "108", - FF_COLOR_FG_256 "71", - FF_COLOR_FG_256 "151", - FF_COLOR_FG_256 "72", - }, - .colorKeys = FF_COLOR_FG_256 "108", - .colorTitle = FF_COLOR_MODE_BOLD FF_COLOR_FG_WHITE, - }, - // Chakra - { - .names = { "Chakra" }, - .lines = FASTFETCH_DATATEXT_LOGO_CHAKRA, - .colors = { - FF_COLOR_FG_BLUE, - }, - .colorKeys = FF_COLOR_FG_BLUE, - .colorTitle = FF_COLOR_FG_MAGENTA, - }, - // ChaletOS - { - .names = { "ChaletOS" }, - .lines = FASTFETCH_DATATEXT_LOGO_CHALETOS, - .colors = { - FF_COLOR_FG_BLUE, - FF_COLOR_FG_WHITE, - }, - .colorKeys = FF_COLOR_FG_BLUE, - .colorTitle = FF_COLOR_FG_DEFAULT, - }, - // Chapeau - { - .names = { "Chapeau" }, - .lines = FASTFETCH_DATATEXT_LOGO_CHAPEAU, - .colors = { - FF_COLOR_FG_GREEN, - FF_COLOR_FG_WHITE, - }, - .colorKeys = FF_COLOR_FG_GREEN, - .colorTitle = FF_COLOR_FG_DEFAULT, - }, - // Chimera - { - .names = { "Chimera" }, - .lines = FASTFETCH_DATATEXT_LOGO_CHIMERA_LINUX, - .colors = { - FF_COLOR_FG_RED, - FF_COLOR_FG_MAGENTA, - FF_COLOR_FG_BLUE, - FF_COLOR_FG_RED, - }, - .colorKeys = FF_COLOR_FG_MAGENTA, - .colorTitle = FF_COLOR_FG_RED, - }, - // ChonkySealOS - { - .names = { "ChonkySealOS" }, - .lines = FASTFETCH_DATATEXT_LOGO_CHONKYSEALOS, - .colors = { - FF_COLOR_FG_DEFAULT, - }, - .colorKeys = FF_COLOR_FG_DEFAULT, - .colorTitle = FF_COLOR_FG_DEFAULT, - }, - // Chrom - { - .names = { "Chrom", "ChromeOS" }, - .lines = FASTFETCH_DATATEXT_LOGO_CHROM, - .colors = { - FF_COLOR_FG_GREEN, - FF_COLOR_FG_RED, - FF_COLOR_FG_YELLOW, - FF_COLOR_FG_BLUE, - FF_COLOR_FG_WHITE, - }, - .colorKeys = FF_COLOR_FG_GREEN, - .colorTitle = FF_COLOR_FG_RED, - }, - // Cleanjaro - { - .names = { "Cleanjaro" }, - .lines = FASTFETCH_DATATEXT_LOGO_CLEANJARO, - .colors = { - FF_COLOR_FG_DEFAULT, - }, - .colorKeys = FF_COLOR_FG_DEFAULT, - .colorTitle = FF_COLOR_FG_DEFAULT, - }, - // CleanjaroSmall - { - .names = { "Cleanjaro_small" }, - .type = FF_LOGO_LINE_TYPE_SMALL_BIT, - .lines = FASTFETCH_DATATEXT_LOGO_CLEANJARO_SMALL, - .colors = { - FF_COLOR_FG_DEFAULT, - }, - .colorKeys = FF_COLOR_FG_DEFAULT, - .colorTitle = FF_COLOR_FG_DEFAULT, - }, - // ClearLinux - { - .names = { "Clear Linux", "clearlinux", "Clear Linux OS" }, - .lines = FASTFETCH_DATATEXT_LOGO_CLEAR_LINUX, - .colors = { - FF_COLOR_FG_BLUE, - FF_COLOR_FG_YELLOW, - }, - .colorKeys = FF_COLOR_FG_BLUE, - .colorTitle = FF_COLOR_FG_YELLOW, - }, - // ClearOS - { - .names = { "ClearOS" }, - .lines = FASTFETCH_DATATEXT_LOGO_CLEAROS, - .colors = { - FF_COLOR_FG_GREEN, - }, - .colorKeys = FF_COLOR_FG_GREEN, - .colorTitle = FF_COLOR_FG_GREEN, - }, - // Clover - { - .names = { "Clover" }, - .lines = FASTFETCH_DATATEXT_LOGO_CLOVER, - .colors = { - FF_COLOR_FG_GREEN, - FF_COLOR_FG_CYAN, - }, - .colorKeys = FF_COLOR_FG_GREEN, - .colorTitle = FF_COLOR_FG_CYAN, - }, - // Cobalt - { - .names = { "Cobalt" }, - .lines = FASTFETCH_DATATEXT_LOGO_COBALT, - .colors = { - FF_COLOR_FG_BLUE, - FF_COLOR_FG_BLUE, - FF_COLOR_FG_LIGHT_BLACK, - FF_COLOR_FG_LIGHT_BLUE, - FF_COLOR_FG_BLACK, - }, - .colorKeys = FF_COLOR_FG_BLUE, - .colorTitle = FF_COLOR_FG_BLUE, - }, - // Codex Linux (reMarkable OS) - { - .names = { "Codex Linux" }, - .lines = FASTFETCH_DATATEXT_LOGO_CODEX, - .colors = { - FF_COLOR_FG_WHITE, - }, - }, - // Condres - { - .names = { "Condres" }, - .lines = FASTFETCH_DATATEXT_LOGO_CONDRES, - .colors = { - FF_COLOR_FG_GREEN, - FF_COLOR_FG_YELLOW, - FF_COLOR_FG_CYAN, - }, - .colorKeys = FF_COLOR_FG_GREEN, - .colorTitle = FF_COLOR_FG_YELLOW, - }, - // ContainerLinux - { - .names = { "ContainerLinux", "Container Linux", "Container Linux by CoreOS" }, - .lines = FASTFETCH_DATATEXT_LOGO_FEDORA_COREOS, - .colors = { - FF_COLOR_FG_BLUE, - FF_COLOR_FG_WHITE, - FF_COLOR_FG_RED, - }, - .colorKeys = FF_COLOR_FG_BLUE, - .colorTitle = FF_COLOR_FG_DEFAULT, - }, - // Common Torizon - { - .names = { "common-torizon" }, - .lines = FASTFETCH_DATATEXT_LOGO_TORIZONCORE, - .colors = { - FF_COLOR_FG_LIGHT_WHITE, - FF_COLOR_FG_YELLOW, - FF_COLOR_FG_BLUE, - }, - }, - // Cosmic DE - { - .names = { "Cosmic" }, - .lines = FASTFETCH_DATATEXT_LOGO_COSMIC, - .colors = { - FF_COLOR_FG_WHITE, - FF_COLOR_FG_LIGHT_YELLOW, - FF_COLOR_FG_YELLOW, - FF_COLOR_FG_LIGHT_RED, - FF_COLOR_FG_RED, - }, - .colorKeys = FF_COLOR_FG_LIGHT_RED, - .colorTitle = FF_COLOR_FG_YELLOW, - }, - // CRUX - { - .names = { "CRUX" }, - .lines = FASTFETCH_DATATEXT_LOGO_CRUX, - .colors = { - FF_COLOR_FG_BLUE, - FF_COLOR_FG_MAGENTA, - FF_COLOR_FG_WHITE, - }, - .colorKeys = FF_COLOR_FG_MAGENTA, - .colorTitle = FF_COLOR_FG_BLUE, - }, - // CRUXSmall - { - .names = { "CRUX_small" }, - .type = FF_LOGO_LINE_TYPE_SMALL_BIT, - .lines = FASTFETCH_DATATEXT_LOGO_CRUX_SMALL, - .colors = { - FF_COLOR_FG_BLUE, - FF_COLOR_FG_MAGENTA, - FF_COLOR_FG_WHITE, - }, - .colorKeys = FF_COLOR_FG_MAGENTA, - .colorTitle = FF_COLOR_FG_BLUE, - }, - // CrystalLinux - { - .names = { "Crystal", "Crystal", "crystal-linux", "Crystal-Linux" }, - .lines = FASTFETCH_DATATEXT_LOGO_CRYSTAL, - .colors = { - FF_COLOR_FG_MAGENTA, - }, - .colorKeys = FF_COLOR_FG_MAGENTA, - .colorTitle = FF_COLOR_FG_MAGENTA, - }, - // Cucumber - { - .names = { "Cucumber", "CucumberOS" }, - .lines = FASTFETCH_DATATEXT_LOGO_CUCUMBER, - .colors = { - FF_COLOR_FG_GREEN, - FF_COLOR_FG_YELLOW, - }, - .colorKeys = FF_COLOR_FG_GREEN, - .colorTitle = FF_COLOR_FG_YELLOW, - }, - // CuerdOS - { - .names = { "CuerdOS", "CuerdOS GNU/Linux" }, - .lines = FASTFETCH_DATATEXT_LOGO_CUERDOS, - .colors = { - FF_COLOR_FG_YELLOW, - FF_COLOR_FG_GREEN, - }, - .colorKeys = FF_COLOR_FG_GREEN, - .colorTitle = FF_COLOR_FG_YELLOW, - }, - // CutefishOS - { - .names = { "CutefishOS" }, - .lines = FASTFETCH_DATATEXT_LOGO_CUTEFISHOS, - .colors = { - FF_COLOR_FG_CYAN, - FF_COLOR_FG_WHITE, - FF_COLOR_FG_BLUE, - }, - }, - // CuteOS - { - .names = { "CuteOS" }, - .lines = FASTFETCH_DATATEXT_LOGO_CUTEOS, - .colors = { - FF_COLOR_FG_BLUE, - FF_COLOR_FG_CYAN, - FF_COLOR_FG_256 "57", - }, - .colorKeys = FF_COLOR_FG_BLUE, - .colorTitle = FF_COLOR_FG_CYAN, - }, - // CyberOS - { - .names = { "CyberOS" }, - .lines = FASTFETCH_DATATEXT_LOGO_CYBEROS, - .colors = { - FF_COLOR_FG_BLUE, - FF_COLOR_FG_CYAN, - FF_COLOR_FG_256 "57", - }, - .colorKeys = FF_COLOR_FG_BLUE, - .colorTitle = FF_COLOR_FG_CYAN, - }, - // cycledream - { - .names = { "cycledream" }, - .lines = FASTFETCH_DATATEXT_LOGO_CYCLEDREAM, - .colors = { - FF_COLOR_FG_MAGENTA, - }, - .colorKeys = FF_COLOR_FG_MAGENTA, - .colorTitle = FF_COLOR_FG_MAGENTA, - }, - // LAST - {}, -}; - -static const FFlogo D[] = { - // DahliaOS - { - .names = { "dahliaOS" }, - .lines = FASTFETCH_DATATEXT_LOGO_DAHLIA, - .colors = { - FF_COLOR_FG_RED, - }, - .colorKeys = FF_COLOR_FG_RED, - .colorTitle = FF_COLOR_FG_DEFAULT, - }, - // DarkOS - { - .names = { "DarkOS" }, - .lines = FASTFETCH_DATATEXT_LOGO_DARKOS, - .colors = { - FF_COLOR_FG_RED, - FF_COLOR_FG_CYAN, - FF_COLOR_FG_MAGENTA, - FF_COLOR_FG_YELLOW, - FF_COLOR_FG_GREEN, - }, - .colorKeys = FF_COLOR_FG_RED, - .colorTitle = FF_COLOR_FG_CYAN, - }, - // Debian - { - .names = { "Debian" }, - .lines = FASTFETCH_DATATEXT_LOGO_DEBIAN, - .colors = { - FF_COLOR_FG_RED, - FF_COLOR_FG_WHITE, - }, - .colorKeys = FF_COLOR_FG_RED, - .colorTitle = FF_COLOR_FG_RED, - }, - // DebianSmall - { - .names = { "Debian_small" }, - .type = FF_LOGO_LINE_TYPE_SMALL_BIT, - .lines = FASTFETCH_DATATEXT_LOGO_DEBIAN_SMALL, - .colors = { - FF_COLOR_FG_RED, - }, - .colorKeys = FF_COLOR_FG_RED, - .colorTitle = FF_COLOR_FG_RED, - }, - // Deepin - { - .names = { "Deepin" }, - .lines = FASTFETCH_DATATEXT_LOGO_DEEPIN, - .colors = { - FF_COLOR_FG_BLUE, - }, - .colorKeys = FF_COLOR_FG_BLUE, - .colorTitle = FF_COLOR_FG_BLUE, - }, - // DesaOS - { - .names = { "DesaOS" }, - .lines = FASTFETCH_DATATEXT_LOGO_DESAOS, - .colors = { - FF_COLOR_FG_GREEN, - FF_COLOR_FG_WHITE, - }, - .colorKeys = FF_COLOR_FG_GREEN, - .colorTitle = FF_COLOR_FG_DEFAULT, - }, - // Devuan - { - .names = { "Devuan" }, - .lines = FASTFETCH_DATATEXT_LOGO_DEVUAN, - .colors = { - FF_COLOR_FG_MAGENTA, - }, - .colorKeys = FF_COLOR_FG_MAGENTA, - .colorTitle = FF_COLOR_FG_MAGENTA, - }, - // DevuanSmall - { - .names = { "Devuan_small" }, - .type = FF_LOGO_LINE_TYPE_SMALL_BIT, - .lines = FASTFETCH_DATATEXT_LOGO_DEVUAN_SMALL, - .colors = { - FF_COLOR_FG_MAGENTA, - }, - .colorKeys = FF_COLOR_FG_MAGENTA, - .colorTitle = FF_COLOR_FG_MAGENTA, - }, - // DietPi - { - .names = { "DietPi" }, - .lines = FASTFETCH_DATATEXT_LOGO_DIETPI, - .colors = { - FF_COLOR_FG_GREEN, - FF_COLOR_FG_LIGHT_BLACK, - }, - .colorKeys = FF_COLOR_FG_LIGHT_BLACK, - .colorTitle = FF_COLOR_FG_GREEN, - }, - // DracOS - { - .names = { "DracOS" }, - .lines = FASTFETCH_DATATEXT_LOGO_DRACOS, - .colors = { - FF_COLOR_FG_RED, - FF_COLOR_FG_WHITE, - }, - .colorKeys = FF_COLOR_FG_RED, - .colorTitle = FF_COLOR_FG_DEFAULT, - }, - // DragonFly - { - .names = { "DragonFly" }, - .lines = FASTFETCH_DATATEXT_LOGO_DRAGONFLY, - .colors = { - FF_COLOR_FG_RED, - FF_COLOR_FG_DEFAULT, - }, - .colorKeys = FF_COLOR_FG_RED, - .colorTitle = FF_COLOR_FG_DEFAULT, - }, - // DragonFlySmall - { - .names = { "DragonFly_small" }, - .type = FF_LOGO_LINE_TYPE_SMALL_BIT, - .lines = FASTFETCH_DATATEXT_LOGO_DRAGONFLY_SMALL, - .colors = { - FF_COLOR_FG_RED, - FF_COLOR_FG_DEFAULT, - }, - .colorKeys = FF_COLOR_FG_RED, - .colorTitle = FF_COLOR_FG_DEFAULT, - }, - // DragonFlyOld - { - .names = { "DragonFly_old" }, - .type = FF_LOGO_LINE_TYPE_ALTER_BIT, - .lines = FASTFETCH_DATATEXT_LOGO_DRAGONFLY_OLD, - .colors = { - FF_COLOR_FG_RED, - FF_COLOR_FG_DEFAULT, - FF_COLOR_FG_YELLOW, - }, - .colorKeys = FF_COLOR_FG_RED, - .colorTitle = FF_COLOR_FG_DEFAULT, - }, - // DraugerOS - { - .names = { "DraugerOS", "Drauger" }, - .lines = FASTFETCH_DATATEXT_LOGO_DRAUGER, - .colors = { - FF_COLOR_FG_RED, - FF_COLOR_FG_WHITE, - }, - .colorKeys = FF_COLOR_FG_RED, - .colorTitle = FF_COLOR_FG_DEFAULT, - }, - // Droidian - { - .names = { "Droidian" }, - .lines = FASTFETCH_DATATEXT_LOGO_DROIDIAN, - .colors = { - FF_COLOR_FG_GREEN, - FF_COLOR_FG_LIGHT_GREEN, - }, - .colorKeys = FF_COLOR_FG_GREEN, - .colorTitle = FF_COLOR_FG_LIGHT_GREEN, - }, - // LAST - {}, -}; - -static const FFlogo E[] = { - // Elbrus - { - .names = { "elbrus" }, - .lines = FASTFETCH_DATATEXT_LOGO_ELBRUS, - .colors = { - FF_COLOR_FG_BLUE, - }, - .colorKeys = FF_COLOR_FG_BLUE, - .colorTitle = FF_COLOR_FG_BLUE, - }, - // Elementary - { - .names = { "Elementary" }, - .lines = FASTFETCH_DATATEXT_LOGO_ELEMENTARY, - .colors = { - FF_COLOR_FG_DEFAULT, - }, - .colorKeys = FF_COLOR_FG_BLUE, - .colorTitle = FF_COLOR_FG_DEFAULT, - }, - // ElementarySmall - { - .names = { "Elementary_small" }, - .type = FF_LOGO_LINE_TYPE_SMALL_BIT, - .lines = FASTFETCH_DATATEXT_LOGO_ELEMENTARY_SMALL, - .colors = { - FF_COLOR_FG_DEFAULT, - }, - .colorKeys = FF_COLOR_FG_BLUE, - .colorTitle = FF_COLOR_FG_DEFAULT, - }, - // Elive - { - .names = { "Elive" }, - .lines = FASTFETCH_DATATEXT_LOGO_ELIVE, - .colors = { - FF_COLOR_FG_WHITE, - FF_COLOR_FG_LIGHT_CYAN, - FF_COLOR_FG_CYAN, - }, - .colorKeys = FF_COLOR_FG_DEFAULT, - .colorTitle = FF_COLOR_FG_CYAN, - }, - // Emmabuntüs - { - .names = { "Emmabuntus" }, - .lines = FASTFETCH_DATATEXT_LOGO_EMMABUNTUS, - .colors = { - FF_COLOR_FG_BLUE, - FF_COLOR_FG_YELLOW, - }, - }, - // EmperorOS - { - .names = { "Emperor" }, - .lines = FASTFETCH_DATATEXT_LOGO_EMPEROROS, - .colors = { - FF_COLOR_FG_YELLOW, - FF_COLOR_FG_DEFAULT, - }, - }, - // EN-OS - { - .names = { "ENOS" }, - .lines = FASTFETCH_DATATEXT_LOGO_ENOS, - .colors = { - FF_COLOR_FG_LIGHT_BLUE, - }, - .colorKeys = FF_COLOR_FG_LIGHT_BLUE, - .colorTitle = FF_COLOR_FG_LIGHT_BLUE, - }, - // EncryptOS - { - .names = { "EncryptOS" }, - .lines = FASTFETCH_DATATEXT_LOGO_ENCRYPTOS, - .colors = { - FF_COLOR_FG_MAGENTA, - }, - .colorKeys = FF_COLOR_FG_MAGENTA, - .colorTitle = FF_COLOR_FG_GREEN, - }, - // EndeavourOS - { - .names = { "EndeavourOS" }, - .lines = FASTFETCH_DATATEXT_LOGO_ENDEAVOUROS, - .colors = { - FF_COLOR_FG_MAGENTA, - FF_COLOR_FG_RED, - FF_COLOR_FG_BLUE, - }, - .colorKeys = FF_COLOR_FG_MAGENTA, - .colorTitle = FF_COLOR_FG_RED, - }, - // EndeavourOSSmall - { - .names = { "EndeavourOS_small" }, - .type = FF_LOGO_LINE_TYPE_SMALL_BIT, - .lines = FASTFETCH_DATATEXT_LOGO_ENDEAVOUROS_SMALL, - .colors = { - FF_COLOR_FG_RED, - FF_COLOR_FG_MAGENTA, - FF_COLOR_FG_BLUE, - }, - }, - // Endless - { - .names = { "Endless" }, - .lines = FASTFETCH_DATATEXT_LOGO_ENDLESS, - .colors = { - FF_COLOR_FG_RED, - FF_COLOR_FG_WHITE, - }, - .colorKeys = FF_COLOR_FG_RED, - .colorTitle = FF_COLOR_FG_DEFAULT, - }, - // Enso - { - .names = { "Enso" }, - .lines = FASTFETCH_DATATEXT_LOGO_ENSO, - .colors = { - FF_COLOR_FG_DEFAULT, - }, - .colorKeys = FF_COLOR_FG_DEFAULT, - .colorTitle = FF_COLOR_FG_DEFAULT, - }, - // EshanizedOS - { - .names = { "EshanizedOS" }, - .lines = FASTFETCH_DATATEXT_LOGO_ESHANIZEDOS, - .colors = { - FF_COLOR_FG_RED, - FF_COLOR_FG_WHITE, - }, - }, - // EuroLinux - { - .names = { "EuroLinux" }, - .lines = FASTFETCH_DATATEXT_LOGO_EUROLINUX, - .colors = { - FF_COLOR_FG_BLUE, - FF_COLOR_FG_WHITE, - }, - .colorKeys = FF_COLOR_FG_BLUE, - .colorTitle = FF_COLOR_FG_DEFAULT, - }, - // EvolutionOS - { - .names = { "EvolutionOS" }, - .lines = FASTFETCH_DATATEXT_LOGO_EVOLUTIONOS, - .colors = { - FF_COLOR_FG_GREEN, - FF_COLOR_FG_WHITE, - }, - }, - // EvolutionOSSmall - { - .names = { "EvolutionOS_small" }, - .type = FF_LOGO_LINE_TYPE_SMALL_BIT, - .lines = FASTFETCH_DATATEXT_LOGO_EVOLUTIONOS_SMALL, - .colors = { - FF_COLOR_FG_GREEN, - FF_COLOR_FG_WHITE, - }, - }, - // EvolutionOS_old - { - .names = { "EvolutionOS_old" }, - .type = FF_LOGO_LINE_TYPE_ALTER_BIT, - .lines = FASTFETCH_DATATEXT_LOGO_EVOLUTIONOS_OLD, - .colors = { - FF_COLOR_FG_LIGHT_BLUE, - FF_COLOR_FG_WHITE, - }, - }, - // eweOS - { - .names = { "eweOS" }, - .lines = FASTFETCH_DATATEXT_LOGO_EWEOS, - .colors = { - FF_COLOR_FG_WHITE, - FF_COLOR_FG_LIGHT_YELLOW, - FF_COLOR_FG_LIGHT_RED, - FF_COLOR_FG_LIGHT_BLACK, - FF_COLOR_FG_RED, - }, - }, - // Exherbo - { - .names = { "Exherbo" }, - .lines = FASTFETCH_DATATEXT_LOGO_EXHERBO, - .colors = { - FF_COLOR_FG_BLUE, - FF_COLOR_FG_WHITE, - FF_COLOR_FG_RED, - }, - .colorKeys = FF_COLOR_FG_BLUE, - .colorTitle = FF_COLOR_FG_BLUE, - }, - // ExodiaOS - { - .names = { "Exodia" }, - .lines = FASTFETCH_DATATEXT_LOGO_EXODIA_PREDATOR, - .colors = { - FF_COLOR_FG_MAGENTA, - }, - .colorKeys = FF_COLOR_FG_MAGENTA, - .colorTitle = FF_COLOR_FG_MAGENTA, - }, - // LAST - {}, -}; - -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" }, - .lines = FASTFETCH_DATATEXT_LOGO_FEDORA, - .colors = { - FF_COLOR_FG_BLUE, - FF_COLOR_FG_WHITE, - }, - .colorKeys = FF_COLOR_FG_BLUE, - .colorTitle = FF_COLOR_FG_DEFAULT, - }, - // FedoraAsahiRemix - { - .names = { "fedora-asahi-remix" }, - .lines = FASTFETCH_DATATEXT_LOGO_ASAHI, - .colors = { - FF_COLOR_FG_YELLOW, - FF_COLOR_FG_GREEN, - FF_COLOR_FG_RED, - FF_COLOR_FG_LIGHT_BLACK, - FF_COLOR_FG_WHITE, - FF_COLOR_FG_CYAN, - FF_COLOR_FG_BLUE, - }, - .colorKeys = FF_COLOR_FG_YELLOW, - .colorTitle = FF_COLOR_FG_GREEN, - }, - // FedoraSmall - { - .names = { "Fedora_small" }, - .type = FF_LOGO_LINE_TYPE_SMALL_BIT, - .lines = FASTFETCH_DATATEXT_LOGO_FEDORA_SMALL, - .colors = { - FF_COLOR_FG_BLUE, - }, - .colorKeys = FF_COLOR_FG_BLUE, - .colorTitle = FF_COLOR_FG_DEFAULT, - }, - { - .names = { "Fedora2_small" }, - .type = FF_LOGO_LINE_TYPE_SMALL_BIT | FF_LOGO_LINE_TYPE_ALTER_BIT, - .lines = FASTFETCH_DATATEXT_LOGO_FEDORA2_SMALL, - .colors = { - FF_COLOR_FG_BLUE, - }, - .colorKeys = FF_COLOR_FG_BLUE, - .colorTitle = FF_COLOR_FG_DEFAULT, - }, - // FedoraOld - { - .names = { "Fedora_old" }, - .type = FF_LOGO_LINE_TYPE_ALTER_BIT, - .lines = FASTFETCH_DATATEXT_LOGO_FEDORA_OLD, - .colors = { - FF_COLOR_FG_BLUE, - FF_COLOR_FG_WHITE, - }, - .colorKeys = FF_COLOR_FG_BLUE, - .colorTitle = FF_COLOR_FG_DEFAULT, - }, - // FedoraSilverblue - { - .names = { "Fedora-Silverblue" }, - .lines = FASTFETCH_DATATEXT_LOGO_FEDORA_SILVERBLUE, - .colors = { - FF_COLOR_FG_BLUE, - FF_COLOR_FG_WHITE, - FF_COLOR_FG_CYAN, - }, - .colorKeys = FF_COLOR_FG_BLUE, - .colorTitle = FF_COLOR_FG_DEFAULT, - }, - // FedoraKinoite - { - .names = { "Fedora-Kinoite" }, - .lines = FASTFETCH_DATATEXT_LOGO_FEDORA_KINOITE, - .colors = { - FF_COLOR_FG_BLUE, - FF_COLOR_FG_WHITE, - }, - .colorKeys = FF_COLOR_FG_BLUE, - .colorTitle = FF_COLOR_FG_DEFAULT, - }, - // FedoraSericea - { - .names = { "Fedora-Sericea" }, - .lines = FASTFETCH_DATATEXT_LOGO_FEDORA_SERICEA, - .colors = { - FF_COLOR_FG_BLUE, - FF_COLOR_FG_WHITE, - }, - .colorKeys = FF_COLOR_FG_BLUE, - .colorTitle = FF_COLOR_FG_DEFAULT, - }, - // FedoraCoreOS - { - .names = { "Fedora-CoreOS" }, - .lines = FASTFETCH_DATATEXT_LOGO_FEDORA_COREOS, - .colors = { - FF_COLOR_FG_BLUE, - FF_COLOR_FG_WHITE, - FF_COLOR_FG_RED, - }, - .colorKeys = FF_COLOR_FG_BLUE, - .colorTitle = FF_COLOR_FG_DEFAULT, - }, - // FemboyOS - { - .names = { "FemboyOS" }, - .lines = FASTFETCH_DATATEXT_LOGO_FEMBOYOS, - .colors = { - FF_COLOR_FG_BLUE, - }, - .colorKeys = FF_COLOR_FG_BLUE, - .colorTitle = FF_COLOR_FG_DEFAULT, - }, - // Feren - { - .names = { "Feren" }, - .lines = FASTFETCH_DATATEXT_LOGO_FEREN, - .colors = { - FF_COLOR_FG_BLUE, - }, - .colorKeys = FF_COLOR_FG_BLUE, - .colorTitle = FF_COLOR_FG_DEFAULT, - }, - // Filotimo - { - .names = { "filotimo" }, - .lines = FASTFETCH_DATATEXT_LOGO_FILOTIMO, - .colors = { - FF_COLOR_FG_BLUE, - }, - .colorKeys = FF_COLOR_FG_BLUE, - .colorTitle = FF_COLOR_FG_DEFAULT, - }, - // Finnix - { - .names = { "Finnix" }, - .lines = FASTFETCH_DATATEXT_LOGO_FINNIX, - .colors = { - FF_COLOR_FG_BLUE, - FF_COLOR_FG_WHITE, - }, - .colorKeys = FF_COLOR_FG_BLUE, - .colorTitle = FF_COLOR_FG_DEFAULT, - }, - // Floflis - { - .names = { "Floflis" }, - .lines = FASTFETCH_DATATEXT_LOGO_FLOFLIS, - .colors = { - FF_COLOR_FG_LIGHT_CYAN, - }, - .colorKeys = FF_COLOR_FG_RED, - .colorTitle = FF_COLOR_FG_DEFAULT, - }, - // FreeBSD - { - .names = { "Freebsd" }, - .lines = FASTFETCH_DATATEXT_LOGO_FREEBSD, - .colors = { - FF_COLOR_FG_WHITE, - FF_COLOR_FG_RED, - }, - .colorKeys = FF_COLOR_FG_RED, - .colorTitle = FF_COLOR_FG_RED, - }, - // FreeBSDSmall - { - .names = { "freebsd_small" }, - .type = FF_LOGO_LINE_TYPE_SMALL_BIT, - .lines = FASTFETCH_DATATEXT_LOGO_FREEBSD_SMALL, - .colors = { - FF_COLOR_FG_RED, - }, - .colorKeys = FF_COLOR_FG_RED, - .colorTitle = FF_COLOR_FG_RED, - }, - // FreeMiNT - { - .names = { "FreeMiNT" }, - .lines = FASTFETCH_DATATEXT_LOGO_FREEMINT, - .colors = { - FF_COLOR_FG_WHITE, - }, - .colorKeys = FF_COLOR_FG_DEFAULT, - .colorTitle = FF_COLOR_FG_DEFAULT, - }, - // Frugalware - { - .names = { "Frugalware", "frugalware-linux" }, - .lines = FASTFETCH_DATATEXT_LOGO_FRUGALWARE, - .colors = { - FF_COLOR_FG_BLUE, - FF_COLOR_FG_WHITE, - }, - .colorKeys = FF_COLOR_FG_BLUE, - .colorTitle = FF_COLOR_FG_DEFAULT, - }, - // Funtoo - { - .names = { "Funtoo" }, - .lines = FASTFETCH_DATATEXT_LOGO_FUNTOO, - .colors = { - FF_COLOR_FG_MAGENTA, - FF_COLOR_FG_WHITE, - }, - .colorKeys = FF_COLOR_FG_MAGENTA, - .colorTitle = FF_COLOR_FG_DEFAULT, - }, - // Furreto - { - .names = { "Furreto" }, - .lines = FASTFETCH_DATATEXT_LOGO_FURRETO, - .colors = { - FF_COLOR_FG_WHITE, - FF_COLOR_FG_LIGHT_MAGENTA, - }, - .colorKeys = FF_COLOR_FG_CYAN, - .colorTitle = FF_COLOR_FG_CYAN, - }, - // LAST - {}, -}; - -static const FFlogo G[] = { - // GalliumOS - { - .names = { "GalliumOS" }, - .lines = FASTFETCH_DATATEXT_LOGO_GALLIUMOS, - .colors = { - FF_COLOR_FG_BLUE, - FF_COLOR_FG_WHITE, - }, - .colorKeys = FF_COLOR_FG_BLUE, - .colorTitle = FF_COLOR_FG_DEFAULT, - }, - // Garuda - { - .names = { "Garuda", "garuda-linux" }, - .lines = FASTFETCH_DATATEXT_LOGO_GARUDA, - .colors = { - FF_COLOR_FG_RED, - }, - .colorKeys = FF_COLOR_FG_RED, - .colorTitle = FF_COLOR_FG_RED, - }, - // GarudaDragon - { - .names = { "GarudaDragon", "garuda-dragon" }, - .lines = FASTFETCH_DATATEXT_LOGO_GARUDA_DRAGON, - .colors = { - FF_COLOR_FG_RED, - }, - .colorKeys = FF_COLOR_FG_RED, - .colorTitle = FF_COLOR_FG_RED, - }, - // GarudaSmall - { - .names = { "Garuda_small", "garuda-linux_small" }, - .type = FF_LOGO_LINE_TYPE_SMALL_BIT, - .lines = FASTFETCH_DATATEXT_LOGO_GARUDA_SMALL, - .colors = { - FF_COLOR_FG_RED, - }, - .colorKeys = FF_COLOR_FG_RED, - .colorTitle = FF_COLOR_FG_RED, - }, - // Gentoo - { - .names = { "Gentoo" }, - .lines = FASTFETCH_DATATEXT_LOGO_GENTOO, - .colors = { - FF_COLOR_FG_MAGENTA, - FF_COLOR_FG_WHITE, - }, - .colorKeys = FF_COLOR_FG_MAGENTA, - .colorTitle = FF_COLOR_FG_MAGENTA, - }, - // GentooSmall - { - .names = { "Gentoo_small" }, - .type = FF_LOGO_LINE_TYPE_SMALL_BIT, - .lines = FASTFETCH_DATATEXT_LOGO_GENTOO_SMALL, - .colors = { - FF_COLOR_FG_MAGENTA, - FF_COLOR_FG_WHITE, - }, - .colorKeys = FF_COLOR_FG_MAGENTA, - .colorTitle = FF_COLOR_FG_MAGENTA, - }, - // GhostBSD - { - .names = { "GhostBSD" }, - .lines = FASTFETCH_DATATEXT_LOGO_GHOSTBSD, - .colors = { - FF_COLOR_FG_BLUE, - }, - .colorKeys = FF_COLOR_FG_BLUE, - .colorTitle = FF_COLOR_FG_RED, - }, - // GhostFreak - { - .names = { "GhostFreak" }, - .lines = FASTFETCH_DATATEXT_LOGO_GHOSTFREAK, - .colors = { - FF_COLOR_FG_DEFAULT, - }, - .colorKeys = FF_COLOR_FG_DEFAULT, - .colorTitle = FF_COLOR_FG_BLUE, - }, - // Glaucus - { - .names = { "Glaucus" }, - .lines = FASTFETCH_DATATEXT_LOGO_GLAUCUS, - .colors = { - FF_COLOR_FG_MAGENTA, - }, - .colorKeys = FF_COLOR_FG_MAGENTA, - .colorTitle = FF_COLOR_FG_MAGENTA, - }, - // GNewSense - { - .names = { "gNewSense" }, - .lines = FASTFETCH_DATATEXT_LOGO_GNEWSENSE, - .colors = { - FF_COLOR_FG_BLUE, - }, - .colorKeys = FF_COLOR_FG_BLUE, - .colorTitle = FF_COLOR_FG_BLUE, - }, - // GNOME OS - { - .names = { "GNOME OS" }, // matches "NAME" - .lines = FASTFETCH_DATATEXT_LOGO_GNOME, - .colors = { - FF_COLOR_FG_BLUE, - }, - .colorKeys = FF_COLOR_FG_BLUE, - .colorTitle = FF_COLOR_FG_RED, - }, - // GNU - { - .names = { "GNU" }, - .lines = FASTFETCH_DATATEXT_LOGO_GNU, - .colors = { - FF_COLOR_FG_DEFAULT, - }, - .colorKeys = FF_COLOR_FG_DEFAULT, - .colorTitle = FF_COLOR_FG_RED, - }, - // GoboLinux - { - .names = { "GoboLinux", "Gobo" }, - .lines = FASTFETCH_DATATEXT_LOGO_GOBOLINUX, - .colors = { - FF_COLOR_FG_MAGENTA, - }, - .colorKeys = FF_COLOR_FG_MAGENTA, - .colorTitle = FF_COLOR_FG_MAGENTA, - }, - // GoldenDogLinux - { - .names = { "GoldenDog Linux", "GDL", "goldendoglinux" }, - .lines = FASTFETCH_DATATEXT_LOGO_GOLDENDOGLINUX, - .colors = { - FF_COLOR_FG_YELLOW, - }, - .colorKeys = FF_COLOR_FG_MAGENTA, - .colorTitle = FF_COLOR_FG_DEFAULT, - }, - // GrapheneOS - { - .names = { "GrapheneOS" }, - .lines = FASTFETCH_DATATEXT_LOGO_GRAPHENEOS, - .colors = { - FF_COLOR_FG_DEFAULT, - }, - .colorKeys = FF_COLOR_FG_DEFAULT, - .colorTitle = FF_COLOR_FG_BLUE, - }, - // Grombyang - { - .names = { "Grombyang" }, - .lines = FASTFETCH_DATATEXT_LOGO_GROMBYANG, - .colors = { - FF_COLOR_FG_BLUE, - FF_COLOR_FG_GREEN, - FF_COLOR_FG_RED, - }, - .colorKeys = FF_COLOR_FG_BLUE, - .colorTitle = FF_COLOR_FG_GREEN, - }, - // Guix - { - .names = { "Guix" }, - .lines = FASTFETCH_DATATEXT_LOGO_GUIX, - .colors = { - FF_COLOR_FG_YELLOW, - }, - .colorKeys = FF_COLOR_FG_YELLOW, - .colorTitle = FF_COLOR_FG_DEFAULT, - }, - // GuixSmall - { - .names = { "Guix_small" }, - .type = FF_LOGO_LINE_TYPE_SMALL_BIT, - .lines = FASTFETCH_DATATEXT_LOGO_GUIX_SMALL, - .colors = { - FF_COLOR_FG_YELLOW, - }, - .colorKeys = FF_COLOR_FG_YELLOW, - .colorTitle = FF_COLOR_FG_DEFAULT, - }, - // GXDE - { - .names = { "GXDE" }, - .lines = FASTFETCH_DATATEXT_LOGO_GXDE, - .colors = { - FF_COLOR_FG_RED, - }, - .colorKeys = FF_COLOR_FG_RED, - .colorTitle = FF_COLOR_FG_RED, - }, - // LAST - {}, -}; - -static const FFlogo H[] = { - // Haiku - { - .names = { "Haiku" }, - .lines = FASTFETCH_DATATEXT_LOGO_HAIKU, - .colors = { - 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" }, - .type = FF_LOGO_LINE_TYPE_SMALL_BIT, - .lines = FASTFETCH_DATATEXT_LOGO_HAIKU_SMALL, - .colors = { - FF_COLOR_FG_GREEN, - }, - .colorKeys = FF_COLOR_FG_GREEN, - .colorTitle = FF_COLOR_FG_YELLOW, - }, - // HamoniKR - { - .names = { "HamoniKR" }, - .lines = FASTFETCH_DATATEXT_LOGO_HAMONIKR, - .colors = { - FF_COLOR_FG_BLUE, - FF_COLOR_FG_WHITE, - FF_COLOR_FG_256 "99", - }, - .colorKeys = FF_COLOR_FG_BLUE, - .colorTitle = FF_COLOR_FG_DEFAULT, - }, - // HarDClanZ - { - .names = { "HarDClanZ" }, - .lines = FASTFETCH_DATATEXT_LOGO_HARDCLANZ, - .colors = { - FF_COLOR_FG_BLUE, - FF_COLOR_FG_WHITE, - FF_COLOR_FG_RED, - }, - .colorKeys = FF_COLOR_FG_BLUE, - .colorTitle = FF_COLOR_FG_DEFAULT, - }, - // HardenedBSD - { - .names = { "HardenedBSD" }, - .lines = FASTFETCH_DATATEXT_LOGO_FREEBSD, - .colors = { - FF_COLOR_FG_WHITE, - FF_COLOR_FG_RED, - }, - .colorKeys = FF_COLOR_FG_RED, - .colorTitle = FF_COLOR_FG_RED, - }, - // HarmonyOS - { - .names = { "HarmonyOS" }, - .lines = FASTFETCH_DATATEXT_LOGO_HARMONYOS, - .colors = { - FF_COLOR_FG_WHITE, - FF_COLOR_FG_BLUE, - }, - .colorKeys = FF_COLOR_FG_BLUE, - .colorTitle = FF_COLOR_FG_BLUE, - }, - // Hash - { - .names = { "Hash" }, - .lines = FASTFETCH_DATATEXT_LOGO_HASH, - .colors = { - FF_COLOR_FG_256 "123", - FF_COLOR_FG_256 "123", - }, - }, - // HeliumOS - { - .names = { "HeliumOS" }, - .lines = FASTFETCH_DATATEXT_LOGO_HELIUMOS, - .colors = { - FF_COLOR_FG_256 "81", - }, - .colorKeys = FF_COLOR_FG_256 "81", - .colorTitle = FF_COLOR_FG_DEFAULT, - }, - // Huawei Cloud EulerOS - { - .names = { "Huawei Cloud EulerOS", "hce" }, - .lines = FASTFETCH_DATATEXT_LOGO_HCE, - .colors = { - FF_COLOR_FG_RED, - }, - .colorKeys = FF_COLOR_FG_RED, - .colorTitle = FF_COLOR_FG_RED, - }, - // Huayra - { - .names = { "Huayra" }, - .lines = FASTFETCH_DATATEXT_LOGO_HUAYRA, - .colors = { - FF_COLOR_FG_DEFAULT, - }, - .colorKeys = FF_COLOR_FG_DEFAULT, - .colorTitle = FF_COLOR_FG_BLUE, - }, - // Hybrid - { - .names = { "Hybrid" }, - .lines = FASTFETCH_DATATEXT_LOGO_HYBRID, - .colors = { - FF_COLOR_FG_BLUE, - FF_COLOR_FG_LIGHT_BLUE, - }, - .colorKeys = FF_COLOR_FG_LIGHT_BLUE, - .colorTitle = FF_COLOR_FG_BLUE, - }, - // HydroOS - { - .names = { "HydroOS" }, - .lines = FASTFETCH_DATATEXT_LOGO_HYDROOS, - .colors = { - FF_COLOR_FG_RED, - }, - .colorKeys = FF_COLOR_FG_RED, - .colorTitle = FF_COLOR_FG_GREEN, - }, - // HyprOS - { - .names = { "hypros" }, - .lines = FASTFETCH_DATATEXT_LOGO_HYPROS, - .colors = { - FF_COLOR_FG_RED, - FF_COLOR_FG_YELLOW, - FF_COLOR_FG_CYAN, - FF_COLOR_FG_BLUE, - }, - }, - // Hyperbola - { - .names = { "Hyperbola" }, - .lines = FASTFETCH_DATATEXT_LOGO_HYPERBOLA, - .colors = { - FF_COLOR_FG_LIGHT_BLACK, - }, - .colorKeys = FF_COLOR_FG_LIGHT_BLACK, - .colorTitle = FF_COLOR_FG_DEFAULT, - }, - // HyperbolaSmall - { - .names = { "Hyperbola_small" }, - .type = FF_LOGO_LINE_TYPE_SMALL_BIT, - .lines = FASTFETCH_DATATEXT_LOGO_HYPERBOLA_SMALL, - .colors = { - FF_COLOR_FG_LIGHT_BLACK, - }, - .colorKeys = FF_COLOR_FG_LIGHT_BLACK, - .colorTitle = FF_COLOR_FG_DEFAULT, - }, - // LAST - {}, -}; - -static const FFlogo I[] = { - // Iglunix - { - .names = { "Iglunix", "Iglu" }, - .lines = FASTFETCH_DATATEXT_LOGO_IGLUNIX, - .colors = { - FF_COLOR_FG_LIGHT_BLACK, - }, - .colorKeys = FF_COLOR_FG_LIGHT_BLACK, - .colorTitle = FF_COLOR_FG_DEFAULT, - }, - // InstantOS - { - .names = { "InstantOS" }, - .lines = FASTFETCH_DATATEXT_LOGO_INSTANTOS, - .colors = { - FF_COLOR_FG_BLUE, - FF_COLOR_FG_CYAN, - }, - .colorKeys = FF_COLOR_FG_BLUE, - .colorTitle = FF_COLOR_FG_CYAN, - }, - // Interix - { - .names = { "Interix" }, - .lines = FASTFETCH_DATATEXT_LOGO_INTERIX, - .colors = { - FF_COLOR_FG_RED, - FF_COLOR_FG_WHITE, - FF_COLOR_FG_BLUE, - FF_COLOR_FG_BLACK, - FF_COLOR_FG_YELLOW, - }, - }, - // IRIX - { - .names = { "IRIX" }, - .lines = FASTFETCH_DATATEXT_LOGO_IRIX, - .colors = { - FF_COLOR_FG_BLUE, - }, - .colorKeys = FF_COLOR_FG_BLUE, - .colorTitle = FF_COLOR_FG_DEFAULT, - }, - // Ironclad - { - .names = { "Ironclad" }, - .lines = FASTFETCH_DATATEXT_LOGO_IRONCLAD, - .colors = { - FF_COLOR_FG_BLACK, - }, - .colorKeys = FF_COLOR_FG_DEFAULT, - .colorTitle = FF_COLOR_FG_MAGENTA, - }, - // Itc - { - .names = { "Itc" }, - .lines = FASTFETCH_DATATEXT_LOGO_ITC, - .colors = { - FF_COLOR_FG_RED, - }, - .colorKeys = FF_COLOR_FG_DEFAULT, - .colorTitle = FF_COLOR_FG_RED, - }, - // LAST - {}, -}; - -static const FFlogo J[] = { - // Januslinux - { - .names = { "januslinux", "janus" }, - .lines = FASTFETCH_DATATEXT_LOGO_JANUSLINUX, - .colors = { - FF_COLOR_FG_BLUE, - FF_COLOR_FG_MAGENTA, - }, - .colorKeys = FF_COLOR_FG_BLUE, - .colorTitle = FF_COLOR_FG_MAGENTA, - }, - // LAST - {}, -}; - -static const FFlogo K[] = { - // Kaisen - { - .names = { "Kaisen" }, - .lines = FASTFETCH_DATATEXT_LOGO_KAISEN, - .colors = { - FF_COLOR_FG_RED, - FF_COLOR_FG_WHITE, - }, - .colorKeys = FF_COLOR_FG_RED, - .colorTitle = FF_COLOR_FG_DEFAULT, - }, - // Kali - { - .names = { "Kali" }, - .lines = FASTFETCH_DATATEXT_LOGO_KALI, - .colors = { - FF_COLOR_FG_BLUE, - FF_COLOR_FG_LIGHT_BLACK, - }, - .colorKeys = FF_COLOR_FG_BLUE, - .colorTitle = FF_COLOR_FG_DEFAULT, - }, - // KaliSmall - { - .names = { "Kali_small" }, - .type = FF_LOGO_LINE_TYPE_SMALL_BIT, - .lines = FASTFETCH_DATATEXT_LOGO_KALI_SMALL, - .colors = { - FF_COLOR_FG_BLUE, - FF_COLOR_FG_LIGHT_BLACK, - }, - .colorKeys = FF_COLOR_FG_BLUE, - .colorTitle = FF_COLOR_FG_DEFAULT, - }, - // Kalpa Desktop - { - .names = { "kalpa-desktop" }, - .lines = FASTFETCH_DATATEXT_LOGO_KALPA_DESKTOP, - .colors = { - FF_COLOR_FG_GREEN, - }, - .colorKeys = FF_COLOR_FG_GREEN, - .colorTitle = FF_COLOR_FG_DEFAULT, - }, - // KaOS - { - .names = { "KaOS" }, - .lines = FASTFETCH_DATATEXT_LOGO_KAOS, - .colors = { - FF_COLOR_FG_BLUE, - FF_COLOR_FG_WHITE, - }, - .colorKeys = FF_COLOR_FG_BLUE, - .colorTitle = FF_COLOR_FG_DEFAULT, - }, - // KernelOS - { - .names = { "KernelOS" }, - .lines = FASTFETCH_DATATEXT_LOGO_KERNELOS, - .colors = { - FF_COLOR_FG_RED, - FF_COLOR_FG_MAGENTA, - }, - }, - // KDELinux - { - .names = { "kdelinux", "kde-linux" }, - .lines = FASTFETCH_DATATEXT_LOGO_KDELINUX, - .colors = { - FF_COLOR_FG_YELLOW, - FF_COLOR_FG_WHITE, - }, - }, - // KDE Neon - { - .names = { "KDE Neon" }, // Distro ID is "neon"; Distro name is "KDE Neon" - .lines = FASTFETCH_DATATEXT_LOGO_KDENEON, - .colors = { - FF_COLOR_FG_GREEN, - FF_COLOR_FG_DEFAULT, - }, - }, - // KibaOS - { - .names = { "KibaOS" }, - .lines = FASTFETCH_DATATEXT_LOGO_KIBAOS, - .colors = { - FF_COLOR_BG_WHITE, - FF_COLOR_FG_BLUE, - }, - }, - // Kibojoe - { - .names = { "Kibojoe" }, - .lines = FASTFETCH_DATATEXT_LOGO_KIBOJOE, - .colors = { - FF_COLOR_FG_GREEN, - FF_COLOR_FG_WHITE, - FF_COLOR_FG_BLUE, - }, - .colorKeys = FF_COLOR_FG_GREEN, - .colorTitle = FF_COLOR_FG_DEFAULT, - }, - // KISSLinux - { - .names = { "KISS", "kiss-linux", "kisslinux" }, - .lines = FASTFETCH_DATATEXT_LOGO_KISS, - .colors = { - FF_COLOR_FG_MAGENTA, - FF_COLOR_FG_WHITE, - FF_COLOR_FG_BLUE, - }, - .colorKeys = FF_COLOR_FG_MAGENTA, - .colorTitle = FF_COLOR_FG_BLUE, - }, - // KISSLinux2 - { - .names = { "kiss2" }, - .lines = FASTFETCH_DATATEXT_LOGO_KISS2, - .colors = { - FF_COLOR_FG_BLACK, - FF_COLOR_FG_RED, - FF_COLOR_FG_WHITE, - }, - .colorKeys = FF_COLOR_FG_RED, - .colorTitle = FF_COLOR_FG_RED, - }, - // Kogaion - { - .names = { "Kogaion" }, - .lines = FASTFETCH_DATATEXT_LOGO_KOGAION, - .colors = { - FF_COLOR_FG_BLUE, - FF_COLOR_FG_WHITE, - }, - .colorKeys = FF_COLOR_FG_BLUE, - .colorTitle = FF_COLOR_FG_DEFAULT, - }, - // Korora - { - .names = { "Korora" }, - .lines = FASTFETCH_DATATEXT_LOGO_KORORA, - .colors = { - FF_COLOR_FG_BLUE, - FF_COLOR_FG_WHITE, - }, - .colorKeys = FF_COLOR_FG_BLUE, - .colorTitle = FF_COLOR_FG_DEFAULT, - }, - // KrassOS - { - .names = { "KrassOS", "Krass" }, - .lines = FASTFETCH_DATATEXT_LOGO_KRASSOS, - .colors = { - FF_COLOR_FG_BLUE, - FF_COLOR_FG_WHITE, - }, - .colorKeys = FF_COLOR_FG_BLUE, - .colorTitle = FF_COLOR_FG_DEFAULT, - }, - // KSLinux - { - .names = { "KSLinux" }, - .lines = FASTFETCH_DATATEXT_LOGO_KSLINUX, - .colors = { - FF_COLOR_FG_BLUE, - FF_COLOR_FG_WHITE, - }, - .colorKeys = FF_COLOR_FG_BLUE, - .colorTitle = FF_COLOR_FG_DEFAULT, - }, - // Kubuntu - { - .names = { "Kubuntu", "kubuntu-linux", "kde-ubuntu" }, - .lines = FASTFETCH_DATATEXT_LOGO_KUBUNTU, - .colors = { - FF_COLOR_FG_BLUE, - FF_COLOR_FG_WHITE, - }, - .colorKeys = FF_COLOR_FG_BLUE, - .colorTitle = FF_COLOR_FG_BLUE, - }, - // Kylin - { - .names = { "Kylin" }, - .lines = FASTFETCH_DATATEXT_LOGO_KYLIN, - .colors = { - FF_COLOR_FG_BLUE, - FF_COLOR_FG_CYAN, - FF_COLOR_FG_WHITE, - FF_COLOR_FG_LIGHT_BLACK, - }, - .colorKeys = FF_COLOR_FG_BLUE, - .colorTitle = FF_COLOR_FG_BLUE, - }, - // LAST - {}, -}; - -static const FFlogo L[] = { - // LainOS - { - .names = { "LainOS" }, - .lines = FASTFETCH_DATATEXT_LOGO_LAINOS, - .colors = { - FF_COLOR_FG_BLUE, - FF_COLOR_FG_256 "14", - FF_COLOR_FG_WHITE, - }, - }, - // LangitKetujuh - { - .names = { "langitketujuh", "l7" }, - .lines = FASTFETCH_DATATEXT_LOGO_LANGITKETUJUH, - .colors = { - FF_COLOR_FG_BLUE, - FF_COLOR_FG_WHITE, - }, - .colorKeys = FF_COLOR_FG_BLUE, - .colorTitle = FF_COLOR_FG_BLUE, - }, - // Laxeros - { - .names = { "Laxeros" }, - .lines = FASTFETCH_DATATEXT_LOGO_LAXEROS, - .colors = { - FF_COLOR_FG_BLUE, - FF_COLOR_FG_WHITE, - }, - .colorKeys = FF_COLOR_FG_BLUE, - .colorTitle = FF_COLOR_FG_DEFAULT, - }, - // LEDE - { - .names = { "LEDE" }, - .lines = FASTFETCH_DATATEXT_LOGO_LEDE, - .colors = { - FF_COLOR_FG_BLUE, - FF_COLOR_FG_WHITE, - }, - .colorKeys = FF_COLOR_FG_BLUE, - .colorTitle = FF_COLOR_FG_DEFAULT, - }, - // LibreELEC - { - .names = { "LibreELEC" }, - .lines = FASTFETCH_DATATEXT_LOGO_LIBREELEC, - .colors = { - FF_COLOR_FG_GREEN, - FF_COLOR_FG_YELLOW, - FF_COLOR_FG_WHITE, - FF_COLOR_FG_CYAN, - FF_COLOR_FG_MAGENTA, - }, - .colorKeys = FF_COLOR_FG_GREEN, - .colorTitle = FF_COLOR_FG_YELLOW, - }, - // Lilidog - { - .names = { "Lilidog" }, - .lines = FASTFETCH_DATATEXT_LOGO_LILIDOG, - .colors = { - FF_COLOR_FG_BLUE, - }, - .colorKeys = FF_COLOR_FG_RED, - .colorTitle = FF_COLOR_FG_DEFAULT, - }, - // Lingmo OS - { - .names = { "Lingmo", "LingmoOS" }, - .lines = FASTFETCH_DATATEXT_LOGO_LINGMO, - .colors = { - FF_COLOR_FG_BLUE, - FF_COLOR_FG_WHITE, - }, - .colorKeys = FF_COLOR_FG_BLUE, - .colorTitle = FF_COLOR_FG_BLUE, - }, - // LimeOS - { - .names = { "LimeOS" }, - .lines = FASTFETCH_DATATEXT_LOGO_LIMEOS, - .colors = { - FF_COLOR_FG_DEFAULT, - }, - .colorKeys = FF_COLOR_FG_DEFAULT, - .colorTitle = FF_COLOR_FG_DEFAULT, - }, - // Linspire - { - .names = { "Linspire", "Lindows" }, - .lines = FASTFETCH_DATATEXT_LOGO_LINSPIRE, - .colors = { - FF_COLOR_FG_BLUE, - FF_COLOR_FG_GREEN, - }, - .colorKeys = FF_COLOR_FG_BLUE, - .colorTitle = FF_COLOR_FG_GREEN, - }, - // Linux - { - .names = { "Linux", "linux-generic" }, - .lines = FASTFETCH_DATATEXT_LOGO_LINUX, - .colors = { - FF_COLOR_FG_WHITE, - FF_COLOR_FG_LIGHT_BLACK, - FF_COLOR_FG_YELLOW, - }, - .colorKeys = FF_COLOR_FG_DEFAULT, - .colorTitle = FF_COLOR_FG_YELLOW, - }, - // LinuxFromScratch - { - .names = { "LinuxFromScratch", "lfs" }, - .lines = FASTFETCH_DATATEXT_LOGO_LFS, - .colors = { - FF_COLOR_FG_WHITE, - FF_COLOR_FG_BLACK, - FF_COLOR_FG_YELLOW, - }, - .colorKeys = FF_COLOR_FG_BLACK, - .colorTitle = FF_COLOR_FG_YELLOW, - }, - // LinuxSmall - { - .names = { "Linux_small", "linux-generic_small" }, - .type = FF_LOGO_LINE_TYPE_SMALL_BIT, - .lines = FASTFETCH_DATATEXT_LOGO_LINUX_SMALL, - .colors = { - FF_COLOR_FG_BLACK, - FF_COLOR_FG_WHITE, - FF_COLOR_FG_YELLOW, - }, - .colorKeys = FF_COLOR_FG_DEFAULT, - .colorTitle = FF_COLOR_FG_DEFAULT, - }, - // LinuxLite - { - .names = { "LinuxLite" }, - .lines = FASTFETCH_DATATEXT_LOGO_LINUXLITE, - .colors = { - FF_COLOR_FG_GREEN, - FF_COLOR_FG_WHITE, - }, - .colorKeys = FF_COLOR_FG_GREEN, - .colorTitle = FF_COLOR_FG_DEFAULT, - }, - // LinuxLiteSmall - { - .names = { "LinuxLite_small" }, - .type = FF_LOGO_LINE_TYPE_SMALL_BIT, - .lines = FASTFETCH_DATATEXT_LOGO_LINUXLITE_SMALL, - .colors = { - FF_COLOR_FG_BLUE, - FF_COLOR_FG_WHITE, - }, - .colorKeys = FF_COLOR_FG_BLUE, - .colorTitle = FF_COLOR_FG_DEFAULT, - }, - // LinuxMint - { - .names = { "linuxmint" }, - .lines = FASTFETCH_DATATEXT_LOGO_LINUXMINT, - .colors = { - FF_COLOR_FG_GREEN, - FF_COLOR_FG_WHITE, - }, - .colorKeys = FF_COLOR_FG_GREEN, - .colorTitle = FF_COLOR_FG_GREEN, - }, - // LinuxMintSmall - { - .names = { "linuxmint_small" }, - .type = FF_LOGO_LINE_TYPE_SMALL_BIT, - .lines = FASTFETCH_DATATEXT_LOGO_LINUXMINT_SMALL, - .colors = { - FF_COLOR_FG_GREEN, - FF_COLOR_FG_WHITE, - }, - .colorKeys = FF_COLOR_FG_GREEN, - .colorTitle = FF_COLOR_FG_GREEN, - }, - // LinuxMint2 - { - .names = { "linuxmint2" }, - .type = FF_LOGO_LINE_TYPE_ALTER_BIT, - .lines = FASTFETCH_DATATEXT_LOGO_LINUXMINT2, - .colors = { - FF_COLOR_FG_GREEN, - FF_COLOR_FG_WHITE, - }, - .colorKeys = FF_COLOR_FG_GREEN, - .colorTitle = FF_COLOR_FG_GREEN, - }, - // LinuxMintOld - { - .names = { "linuxmint_old" }, - .type = FF_LOGO_LINE_TYPE_ALTER_BIT, - .lines = FASTFETCH_DATATEXT_LOGO_LINUXMINT_OLD, - .colors = { - FF_COLOR_FG_GREEN, - FF_COLOR_FG_WHITE, - }, - .colorKeys = FF_COLOR_FG_GREEN, - .colorTitle = FF_COLOR_FG_GREEN, - }, - // Live_Raizo - { - .names = { "Live Raizo", "Live_Raizo" }, - .lines = FASTFETCH_DATATEXT_LOGO_LIVE_RAIZO, - .colors = { - FF_COLOR_FG_YELLOW, - }, - .colorKeys = FF_COLOR_FG_YELLOW, - .colorTitle = FF_COLOR_FG_DEFAULT, - }, - // LliureX - { - .names = { "LliureX" }, - .lines = FASTFETCH_DATATEXT_LOGO_LLIUREX, - .colors = { - FF_COLOR_FG_BLUE, - }, - .colorKeys = FF_COLOR_FG_DEFAULT, - .colorTitle = FF_COLOR_FG_BLUE, - }, - // LMDE - { - .names = { "LMDE" }, - .lines = FASTFETCH_DATATEXT_LOGO_LMDE, - .colors = { - FF_COLOR_FG_GREEN, - FF_COLOR_FG_WHITE, - }, - .colorKeys = FF_COLOR_FG_GREEN, - .colorTitle = FF_COLOR_FG_DEFAULT, - }, - // Loc-OS - { - .names = { "locos", "loc-os", "Loc-OS Linux" }, - .lines = FASTFETCH_DATATEXT_LOGO_LOCOS, - .colors = { - FF_COLOR_FG_BLACK, - FF_COLOR_FG_YELLOW, - FF_COLOR_FG_WHITE, - }, - .colorKeys = FF_COLOR_FG_YELLOW, - .colorTitle = FF_COLOR_FG_RED, - }, - // Lubuntu - { - .names = { "lubuntu" }, - .lines = FASTFETCH_DATATEXT_LOGO_LUBUNTU, - .colors = { - FF_COLOR_FG_BLUE, - FF_COLOR_FG_WHITE, - }, - }, - // Lunar - { - .names = { "Lunar" }, - .lines = FASTFETCH_DATATEXT_LOGO_LUNAR, - .colors = { - FF_COLOR_FG_BLUE, - FF_COLOR_FG_WHITE, - FF_COLOR_FG_YELLOW, - }, - .colorKeys = FF_COLOR_FG_BLUE, - .colorTitle = FF_COLOR_FG_DEFAULT, - }, - // LAST - {}, -}; - -static const FFlogo M[] = { - // Macaroni - { - .names = { "Macaroni" }, - .lines = FASTFETCH_DATATEXT_LOGO_MACARONIOS, - .colors = { - FF_COLOR_FG_YELLOW, - FF_COLOR_FG_WHITE, - }, - .colorKeys = FF_COLOR_FG_YELLOW, - .colorTitle = FF_COLOR_FG_GREEN, - }, - // MacOS - { - .names = { "macOS" }, - .lines = FASTFETCH_DATATEXT_LOGO_MACOS, - .colors = { - FF_COLOR_FG_GREEN, - FF_COLOR_FG_YELLOW, - FF_COLOR_FG_LIGHT_RED, - FF_COLOR_FG_RED, - FF_COLOR_FG_MAGENTA, - FF_COLOR_FG_BLUE, - }, - .colorKeys = FF_COLOR_FG_YELLOW, - .colorTitle = FF_COLOR_FG_GREEN, - }, - // MacOSSmall - { - .names = { "macOS_small" }, - .type = FF_LOGO_LINE_TYPE_SMALL_BIT, - .lines = FASTFETCH_DATATEXT_LOGO_MACOS_SMALL, - .colors = { - FF_COLOR_FG_GREEN, - FF_COLOR_FG_YELLOW, - FF_COLOR_FG_RED, - FF_COLOR_FG_MAGENTA, - FF_COLOR_FG_BLUE, - }, - .colorKeys = FF_COLOR_FG_YELLOW, - .colorTitle = FF_COLOR_FG_GREEN, - }, - // MacOS2 - { - .names = { "macOS2" }, - .type = FF_LOGO_LINE_TYPE_ALTER_BIT, - .lines = FASTFETCH_DATATEXT_LOGO_MACOS2, - .colors = { - FF_COLOR_FG_GREEN, - FF_COLOR_FG_YELLOW, - FF_COLOR_FG_LIGHT_RED, - FF_COLOR_FG_RED, - FF_COLOR_FG_MAGENTA, - FF_COLOR_FG_BLUE, - }, - .colorKeys = FF_COLOR_FG_YELLOW, - .colorTitle = FF_COLOR_FG_GREEN, - }, - // MacOS2Small - { - .names = { "macOS2_small" }, - .type = FF_LOGO_LINE_TYPE_SMALL_BIT | FF_LOGO_LINE_TYPE_ALTER_BIT, - .lines = FASTFETCH_DATATEXT_LOGO_MACOS2_SMALL, - .colors = { - FF_COLOR_FG_GREEN, - FF_COLOR_FG_YELLOW, - FF_COLOR_FG_RED, - FF_COLOR_FG_MAGENTA, - FF_COLOR_FG_BLUE, - }, - .colorKeys = FF_COLOR_FG_YELLOW, - .colorTitle = FF_COLOR_FG_GREEN, - }, - // MacOS3 - { - .names = { "macOS3" }, - .type = FF_LOGO_LINE_TYPE_ALTER_BIT, - .lines = FASTFETCH_DATATEXT_LOGO_MACOS3, - .colors = { - FF_COLOR_FG_GREEN, - FF_COLOR_FG_YELLOW, - FF_COLOR_FG_LIGHT_RED, - FF_COLOR_FG_RED, - FF_COLOR_FG_MAGENTA, - FF_COLOR_FG_BLUE, - }, - .colorKeys = FF_COLOR_FG_YELLOW, - .colorTitle = FF_COLOR_FG_GREEN, - }, - // MainsailOS - { - .names = { "MainsailOS" }, - .lines = FASTFETCH_DATATEXT_LOGO_MAINSAILOS, - .colors = { - FF_COLOR_FG_RED, - }, - }, - // MainsailOSSmall - { - .names = { "MainsailOS_small" }, - .type = FF_LOGO_LINE_TYPE_SMALL_BIT, - .lines = FASTFETCH_DATATEXT_LOGO_MAINSAILOS_SMALL, - .colors = { - FF_COLOR_FG_RED, - }, - }, - // Mageia - { - .names = { "Mageia" }, - .lines = FASTFETCH_DATATEXT_LOGO_MAGEIA, - .colors = { - FF_COLOR_FG_CYAN, - FF_COLOR_FG_WHITE, - }, - .colorKeys = FF_COLOR_FG_CYAN, - .colorTitle = FF_COLOR_FG_DEFAULT, - }, - // MageiaSmall - { - .names = { "Mageia_small" }, - .type = FF_LOGO_LINE_TYPE_SMALL_BIT, - .lines = FASTFETCH_DATATEXT_LOGO_MAGEIA_SMALL, - .colors = { - FF_COLOR_FG_CYAN, - FF_COLOR_FG_WHITE, - }, - .colorKeys = FF_COLOR_FG_CYAN, - .colorTitle = FF_COLOR_FG_DEFAULT, - }, - // Magix - { - .names = { "Magix", "MagixOS" }, - .lines = FASTFETCH_DATATEXT_LOGO_MAGIX, - .colors = { - FF_COLOR_FG_LIGHT_MAGENTA, - FF_COLOR_FG_CYAN, - }, - .colorKeys = FF_COLOR_FG_CYAN, - .colorTitle = FF_COLOR_FG_LIGHT_MAGENTA, - }, - // MagpieOS - { - .names = { "MagpieOS", "Magpie" }, - .lines = FASTFETCH_DATATEXT_LOGO_MAGPIEOS, - .colors = { - FF_COLOR_FG_GREEN, - FF_COLOR_FG_RED, - FF_COLOR_FG_YELLOW, - FF_COLOR_FG_MAGENTA, - }, - .colorKeys = FF_COLOR_FG_GREEN, - .colorTitle = FF_COLOR_FG_RED, - }, - // Mandriva - { - .names = { "mandriva", "mandrake" }, - .lines = FASTFETCH_DATATEXT_LOGO_MANDRIVA, - .colors = { - FF_COLOR_FG_BLUE, - FF_COLOR_FG_YELLOW, - }, - .colorKeys = FF_COLOR_FG_BLUE, - .colorTitle = FF_COLOR_FG_YELLOW, - }, - // Manjaro - { - .names = { "manjaro", "manjaro-arm" }, - .lines = FASTFETCH_DATATEXT_LOGO_MANJARO, - .colors = { - FF_COLOR_FG_GREEN, - }, - .colorKeys = FF_COLOR_FG_GREEN, - .colorTitle = FF_COLOR_FG_GREEN, - }, - // ManjaroSmall - { - .names = { "manjaro_small", "manjaro-arm_small" }, - .type = FF_LOGO_LINE_TYPE_SMALL_BIT, - .lines = FASTFETCH_DATATEXT_LOGO_MANJARO_SMALL, - .colors = { - FF_COLOR_FG_GREEN, - }, - .colorKeys = FF_COLOR_FG_GREEN, - .colorTitle = FF_COLOR_FG_GREEN, - }, - // MassOS - { - .names = { "MassOS" }, - .lines = FASTFETCH_DATATEXT_LOGO_MASSOS, - .colors = { - FF_COLOR_FG_DEFAULT, - }, - .colorKeys = FF_COLOR_FG_DEFAULT, - .colorTitle = FF_COLOR_FG_DEFAULT, - }, - // MatuusOS - { - .names = { "MatuusOS", "Matuus" }, - .lines = FASTFETCH_DATATEXT_LOGO_MATUUSOS, - .colors = { - FF_COLOR_FG_YELLOW, - FF_COLOR_FG_RED, - }, - .colorKeys = FF_COLOR_FG_YELLOW, - .colorTitle = FF_COLOR_FG_RED, - }, - // MaUI - { - .names = { "MaUI" }, - .lines = FASTFETCH_DATATEXT_LOGO_MAUI, - .colors = { - FF_COLOR_FG_CYAN, - }, - .colorKeys = FF_COLOR_FG_CYAN, - .colorTitle = FF_COLOR_FG_DEFAULT, - }, - // Mauna - { - .names = { "Mauna" }, - .lines = FASTFETCH_DATATEXT_LOGO_MAUNA, - .colors = { - FF_COLOR_FG_BLUE, - FF_COLOR_FG_CYAN, - }, - }, - // Meowix - { - .names = { "Meowix" }, - .lines = FASTFETCH_DATATEXT_LOGO_MEOWIX, - .colors = { - FF_COLOR_FG_RED, - FF_COLOR_FG_YELLOW, - FF_COLOR_FG_YELLOW, - FF_COLOR_FG_BLUE, - }, - .colorKeys = FF_COLOR_FG_RED, - .colorTitle = FF_COLOR_FG_YELLOW, - }, - // Mer - { - .names = { "Mer" }, - .lines = FASTFETCH_DATATEXT_LOGO_MER, - .colors = { - FF_COLOR_FG_BLUE, - }, - .colorKeys = FF_COLOR_FG_BLUE, - .colorTitle = FF_COLOR_FG_DEFAULT, - }, - // MidnightBSD - { - .names = { "MidnightBSD" }, - .lines = FASTFETCH_DATATEXT_LOGO_MIDNIGHTBSD, - .colors = { - FF_COLOR_FG_DEFAULT, - }, - .colorKeys = FF_COLOR_FG_LIGHT_BLACK, - .colorTitle = FF_COLOR_FG_DEFAULT, - }, - // MidOS - { - .names = { "MidOS" }, - .lines = FASTFETCH_DATATEXT_LOGO_MIDOS, - .colors = { - FF_COLOR_FG_LIGHT_BLACK, - }, - .colorKeys = FF_COLOR_FG_LIGHT_BLACK, - .colorTitle = FF_COLOR_FG_DEFAULT, - }, - // MidOSOld - { - .names = { "MidOS_old" }, - .lines = FASTFETCH_DATATEXT_LOGO_MIDOS_OLD, - .type = FF_LOGO_LINE_TYPE_ALTER_BIT, - .colors = { - FF_COLOR_FG_LIGHT_BLACK, - FF_COLOR_FG_WHITE, - }, - .colorKeys = FF_COLOR_FG_LIGHT_BLACK, - .colorTitle = FF_COLOR_FG_DEFAULT, - }, - // Minimal System - { - .names = { "Minimal_System" }, - .lines = FASTFETCH_DATATEXT_LOGO_MINIMAL, - .colors = { - FF_COLOR_FG_RED, - }, - .colorKeys = FF_COLOR_FG_CYAN, - .colorTitle = FF_COLOR_FG_DEFAULT, - }, - // Minix - { - .names = { "Minix" }, - .lines = FASTFETCH_DATATEXT_LOGO_MINIX, - .colors = { - FF_COLOR_FG_RED, - FF_COLOR_FG_WHITE, - FF_COLOR_FG_YELLOW, - }, - .colorKeys = FF_COLOR_FG_RED, - .colorTitle = FF_COLOR_FG_YELLOW, - }, - // MiracleLinux - { - .names = { "miraclelinux" }, - .lines = FASTFETCH_DATATEXT_LOGO_MIRACLE_LINUX, - .colors = { - FF_COLOR_FG_256 "29", - }, - .colorKeys = FF_COLOR_FG_256 "29", - .colorTitle = FF_COLOR_FG_DEFAULT, - }, - // MOS - { - .names = { "MOS" }, - .lines = FASTFETCH_DATATEXT_LOGO_MOS, - .colors = { - FF_COLOR_FG_CYAN, - FF_COLOR_FG_BLUE, - }, - }, - // Msys2 - { - .names = { "Msys2" }, - .lines = FASTFETCH_DATATEXT_LOGO_MSYS2, - .colors = { - FF_COLOR_FG_MAGENTA, - FF_COLOR_FG_WHITE, - FF_COLOR_FG_RED, - }, - .colorKeys = FF_COLOR_FG_MAGENTA, - .colorTitle = FF_COLOR_FG_RED, - }, - // MX - { - .names = { "MX" }, - .lines = FASTFETCH_DATATEXT_LOGO_MX, - .colors = { - FF_COLOR_FG_DEFAULT, - }, - .colorKeys = FF_COLOR_FG_BLUE, - .colorTitle = FF_COLOR_FG_CYAN, - }, - // MXSmall - { - .names = { "MX_small" }, - .type = FF_LOGO_LINE_TYPE_SMALL_BIT, - .lines = FASTFETCH_DATATEXT_LOGO_MX_SMALL, - .colors = { - FF_COLOR_FG_DEFAULT, - }, - .colorKeys = FF_COLOR_FG_BLUE, - .colorTitle = FF_COLOR_FG_CYAN, - }, - // MX2 - { - .names = { "MX2" }, - .type = FF_LOGO_LINE_TYPE_ALTER_BIT, - .lines = FASTFETCH_DATATEXT_LOGO_MX2, - .colors = { - FF_COLOR_FG_DEFAULT, - }, - .colorKeys = FF_COLOR_FG_BLUE, - .colorTitle = FF_COLOR_FG_CYAN, - }, - // LAST - {}, -}; - -static const FFlogo N[] = { - // Namib - { - .names = { "Namib" }, - .lines = FASTFETCH_DATATEXT_LOGO_NAMIB, - .colors = { - FF_COLOR_FG_RED, - FF_COLOR_FG_WHITE, - }, - }, - // NebiOS - { - .names = { "NebiOS" }, - .lines = FASTFETCH_DATATEXT_LOGO_NEBIOS, - .colors = { - FF_COLOR_FG_RGB "255;95;95", - FF_COLOR_FG_RGB "252;146;84", - FF_COLOR_FG_RGB "248;196;72", - }, - }, - // Nekos - { - .names = { "Nekos" }, - .lines = FASTFETCH_DATATEXT_LOGO_NEKOS, - .colors = { - FF_COLOR_FG_YELLOW, - FF_COLOR_FG_WHITE, - FF_COLOR_FG_RED, - }, - }, - // Neptune - { - .names = { "Neptune" }, - .lines = FASTFETCH_DATATEXT_LOGO_NEPTUNE, - .colors = { - FF_COLOR_FG_WHITE, - FF_COLOR_FG_WHITE, - }, - }, - // NetRunner - { - .names = { "NetRunner" }, - .lines = FASTFETCH_DATATEXT_LOGO_NETRUNNER, - .colors = { - FF_COLOR_FG_BLUE, - FF_COLOR_FG_WHITE, - }, - }, - // NexaLinux - { - .names = { "nexalinux" }, - .lines = FASTFETCH_DATATEXT_LOGO_NEXALINUX, - .colors = { - FF_COLOR_FG_LIGHT_BLUE, - FF_COLOR_FG_LIGHT_BLUE, - }, - }, - // Nitrux - { - .names = { "Nitrux" }, - .lines = FASTFETCH_DATATEXT_LOGO_NITRUX, - .colors = { - FF_COLOR_FG_BLUE, - FF_COLOR_FG_WHITE, - }, - }, - // NixOS - { - .names = { "NixOS" }, - .lines = FASTFETCH_DATATEXT_LOGO_NIXOS, - .colors = { - FF_COLOR_FG_BLUE, - FF_COLOR_FG_CYAN, - FF_COLOR_FG_BLUE, - FF_COLOR_FG_CYAN, - FF_COLOR_FG_BLUE, - FF_COLOR_FG_CYAN, - }, - }, - // NixOSSmall - { - .names = { "NixOS_small" }, - .type = FF_LOGO_LINE_TYPE_SMALL_BIT, - .lines = FASTFETCH_DATATEXT_LOGO_NIXOS_SMALL, - .colors = { - FF_COLOR_FG_BLUE, - FF_COLOR_FG_CYAN, - FF_COLOR_FG_BLUE, - FF_COLOR_FG_CYAN, - FF_COLOR_FG_BLUE, - FF_COLOR_FG_CYAN, - }, - }, - // NixOSOld - { - .names = { "nixos_old" }, - .type = FF_LOGO_LINE_TYPE_ALTER_BIT, - .lines = FASTFETCH_DATATEXT_LOGO_NIXOS_OLD, - .colors = { - FF_COLOR_FG_BLUE, - FF_COLOR_FG_CYAN, - }, - }, - // NixOsOldSmall - { - .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 = { - FF_COLOR_FG_BLUE, - FF_COLOR_FG_CYAN, - }, - }, - // NetBSD - { - .names = { "NetBSD" }, - .lines = FASTFETCH_DATATEXT_LOGO_NETBSD, - .colors = { - FF_COLOR_FG_RED, - FF_COLOR_FG_WHITE, - }, - .colorKeys = FF_COLOR_FG_RED, - .colorTitle = FF_COLOR_FG_DEFAULT, - }, - // NetBSD2 - { - .names = { "NetBSD2" }, - .lines = FASTFETCH_DATATEXT_LOGO_NETBSD2, - .type = FF_LOGO_LINE_TYPE_ALTER_BIT, - .colors = { - FF_COLOR_FG_RED, - FF_COLOR_FG_WHITE, - }, - .colorKeys = FF_COLOR_FG_RED, - .colorTitle = FF_COLOR_FG_DEFAULT, - }, - // NetBSD Small - { - .names = { "NetBSD_small" }, - .lines = FASTFETCH_DATATEXT_LOGO_NETBSD_SMALL, - .type = FF_LOGO_LINE_TYPE_SMALL_BIT, - .colors = { - FF_COLOR_FG_RED, - FF_COLOR_FG_WHITE, - }, - .colorKeys = FF_COLOR_FG_RED, - .colorTitle = FF_COLOR_FG_DEFAULT, - }, - // Nobara - { - .names = { "nobara" }, - .lines = FASTFETCH_DATATEXT_LOGO_NOBARA, - .colors = { - FF_COLOR_FG_DEFAULT, - }, - .colorKeys = FF_COLOR_FG_DEFAULT, - .colorTitle = FF_COLOR_FG_DEFAULT, - }, - // NomadBSD - { - .names = { "nomadbsd" }, - .lines = FASTFETCH_DATATEXT_LOGO_NOMADBSD, - .colors = { - FF_COLOR_FG_BLUE, - }, - .colorKeys = FF_COLOR_FG_BLUE, - .colorTitle = FF_COLOR_FG_DEFAULT, - }, - // NurOS - { - .names = { "NurOS" }, - .lines = FASTFETCH_DATATEXT_LOGO_NUROS, - .colors = { - FF_COLOR_FG_BLUE, - FF_COLOR_FG_WHITE, - }, - }, - // Nurunner - { - .names = { "Nurunner" }, - .lines = FASTFETCH_DATATEXT_LOGO_NURUNNER, - .colors = { - FF_COLOR_FG_BLUE, - FF_COLOR_FG_WHITE, - }, - }, - // NuTyX - { - .names = { "NuTyX" }, - .lines = FASTFETCH_DATATEXT_LOGO_NUTYX, - .colors = { - FF_COLOR_FG_BLUE, - FF_COLOR_FG_RED, - }, - }, - // NetHydra - { - .names = { "NetHydra" }, - .lines = FASTFETCH_DATATEXT_LOGO_NETHYDRA, - .colors = { - FF_COLOR_FG_RED, - FF_COLOR_FG_DEFAULT, - }, - }, - // LAST - {}, -}; - -static const FFlogo O[] = { - // Obarun - { - .names = { "Obarun" }, - .lines = FASTFETCH_DATATEXT_LOGO_OBARUN, - .colors = { - FF_COLOR_FG_CYAN, - FF_COLOR_FG_WHITE, - }, - }, - // OBRevenge - { - .names = { "OBRevenge" }, - .lines = FASTFETCH_DATATEXT_LOGO_OBREVENGE, - .colors = { - FF_COLOR_FG_RED, - FF_COLOR_FG_WHITE, - }, - }, - // ObsidianOS - { - .names = { "ObsidianOS" }, - .lines = FASTFETCH_DATATEXT_LOGO_OBSIDIANOS, - .colors = { - FF_COLOR_FG_MAGENTA, - FF_COLOR_FG_CYAN, - FF_COLOR_FG_LIGHT_BLUE, - }, - }, - // OmniOS - { - .names = { "OmniOS" }, - .lines = FASTFETCH_DATATEXT_LOGO_OMNIOS, - .colors = { - FF_COLOR_FG_WHITE, - FF_COLOR_FG_YELLOW, - FF_COLOR_FG_LIGHT_BLACK, - }, - }, - // OpenKylin - { - .names = { "openkylin", "open-kylin" }, - .lines = FASTFETCH_DATATEXT_LOGO_OPENKYLIN, - .colors = { - FF_COLOR_FG_GREEN, - FF_COLOR_FG_WHITE, - }, - .colorKeys = FF_COLOR_FG_GREEN, - .colorTitle = FF_COLOR_FG_DEFAULT, - }, - // OpenBSD - { - .names = { "openbsd" }, - .lines = FASTFETCH_DATATEXT_LOGO_OPENBSD, - .colors = { - FF_COLOR_FG_YELLOW, - FF_COLOR_FG_WHITE, - FF_COLOR_FG_CYAN, - FF_COLOR_FG_RED, - FF_COLOR_FG_LIGHT_BLACK, - }, - .colorKeys = FF_COLOR_FG_YELLOW, - .colorTitle = FF_COLOR_FG_DEFAULT, - }, - // OpenBSDSmall - { - .names = { "openbsd_small" }, - .type = FF_LOGO_LINE_TYPE_SMALL_BIT, - .lines = FASTFETCH_DATATEXT_LOGO_OPENBSD_SMALL, - .colors = { - FF_COLOR_FG_YELLOW, - FF_COLOR_FG_WHITE, - }, - .colorKeys = FF_COLOR_FG_YELLOW, - .colorTitle = FF_COLOR_FG_DEFAULT, - }, - // OpenEuler - { - .names = { "OpenEuler" }, - .lines = FASTFETCH_DATATEXT_LOGO_OPENEULER, - .colors = { - FF_COLOR_FG_BLUE, - FF_COLOR_FG_WHITE, - }, - }, - // OpenIndiana - { - .names = { "OpenIndiana" }, - .lines = FASTFETCH_DATATEXT_LOGO_OPENINDIANA, - .colors = { - FF_COLOR_FG_BLUE, - FF_COLOR_FG_DEFAULT, - }, - }, - // OpenMamba - { - .names = { "OpenMamba" }, - .lines = FASTFETCH_DATATEXT_LOGO_OPENMAMBA, - .colors = { - FF_COLOR_FG_WHITE, - FF_COLOR_FG_GREEN, - }, - }, - // openRuyi - { - .names = { "openRuyi" }, - .lines = FASTFETCH_DATATEXT_LOGO_OPENRUYI, - .colors = { - FF_COLOR_FG_BLUE, - FF_COLOR_FG_YELLOW, - FF_COLOR_FG_LIGHT_YELLOW, - }, - .colorKeys = FF_COLOR_FG_BLUE, - .colorTitle = FF_COLOR_FG_DEFAULT, - }, - // OpenStage - { - .names = { "OpenStage" }, - .lines = FASTFETCH_DATATEXT_LOGO_OPENSTAGE, - .colors = { - FF_COLOR_FG_GREEN, - FF_COLOR_FG_WHITE, - }, - }, - // OpenSuse - { - .names = { "opensuse" }, - .lines = FASTFETCH_DATATEXT_LOGO_OPENSUSE, - .colors = { - FF_COLOR_FG_GREEN, - FF_COLOR_FG_WHITE, - }, - .colorKeys = FF_COLOR_FG_GREEN, - .colorTitle = FF_COLOR_FG_GREEN, - }, - // OpenSuseSmall - { - .names = { "opensuse_small" }, - .type = FF_LOGO_LINE_TYPE_SMALL_BIT, - .lines = FASTFETCH_DATATEXT_LOGO_OPENSUSE_SMALL, - .colors = { - FF_COLOR_FG_GREEN, - }, - .colorKeys = FF_COLOR_FG_GREEN, - .colorTitle = FF_COLOR_FG_GREEN, - }, - // openSuseMicroOS - { - .names = { "opensuse-microos" }, - .lines = FASTFETCH_DATATEXT_LOGO_OPENSUSE_MICROOS, - .colors = { - FF_COLOR_FG_GREEN, - }, - }, - // OpenSuseLeap - { - .names = { "opensuse-leap" }, - .lines = FASTFETCH_DATATEXT_LOGO_OPENSUSE_LEAP, - .colors = { - FF_COLOR_FG_DEFAULT, - }, - .colorKeys = FF_COLOR_FG_GREEN, - .colorTitle = FF_COLOR_FG_GREEN, - }, - // OpenSuseLeapOld - { - .names = { "opensuse-leap_old" }, - .lines = FASTFETCH_DATATEXT_LOGO_OPENSUSE_LEAP_OLD, - .type = FF_LOGO_LINE_TYPE_ALTER_BIT, - .colors = { - FF_COLOR_FG_DEFAULT, - }, - .colorKeys = FF_COLOR_FG_GREEN, - .colorTitle = FF_COLOR_FG_GREEN, - }, - // OpenSuseTumbleweed - { - .names = { "opensuse-tumbleweed" }, - .lines = FASTFETCH_DATATEXT_LOGO_OPENSUSE_TUMBLEWEED, - .colors = { - FF_COLOR_FG_DEFAULT, - }, - .colorKeys = FF_COLOR_FG_GREEN, - .colorTitle = FF_COLOR_FG_GREEN, - }, - // OpenSuseTumbleweedSmall - { - .names = { "opensuse-tumbleweed_small" }, - .lines = FASTFETCH_DATATEXT_LOGO_OPENSUSE_TUMBLEWEED_SMALL, - .type = FF_LOGO_LINE_TYPE_SMALL_BIT, - .colors = { - FF_COLOR_FG_DEFAULT, - }, - .colorKeys = FF_COLOR_FG_GREEN, - .colorTitle = FF_COLOR_FG_GREEN, - }, - // OpenSuseTumbleweedOld - { - .names = { "opensuse-tumbleweed_old" }, - .lines = FASTFETCH_DATATEXT_LOGO_OPENSUSE_TUMBLEWEED_OLD, - .type = FF_LOGO_LINE_TYPE_ALTER_BIT, - .colors = { - FF_COLOR_FG_DEFAULT, - }, - .colorKeys = FF_COLOR_FG_GREEN, - .colorTitle = FF_COLOR_FG_GREEN, - }, - // OpenSuseTumbleweed2 - { - .names = { "opensuse-tumbleweed2" }, - .lines = FASTFETCH_DATATEXT_LOGO_OPENSUSE_TUMBLEWEED2, - .type = FF_LOGO_LINE_TYPE_ALTER_BIT, - .colors = { - FF_COLOR_FG_DEFAULT, - }, - .colorKeys = FF_COLOR_FG_GREEN, - .colorTitle = FF_COLOR_FG_GREEN, - }, - // openSUSESlowroll - { - .names = { "opensuse-slowroll", "opensuse-tumbleweed-slowroll" }, - .lines = FASTFETCH_DATATEXT_LOGO_OPENSUSE_SLOWROLL, - .colors = { - FF_COLOR_FG_DEFAULT, - }, - .colorKeys = FF_COLOR_FG_GREEN, - .colorTitle = FF_COLOR_FG_GREEN, - }, - // OpenMandriva - { - .names = { "openmandriva", "open-mandriva", "open_mandriva", "openmandriva lx" }, - .lines = FASTFETCH_DATATEXT_LOGO_OPENMANDRIVA, - .colors = { - FF_COLOR_FG_BLUE, - }, - .colorKeys = FF_COLOR_FG_BLUE, - .colorTitle = FF_COLOR_FG_BLUE, - }, - // OpenWrt - { - .names = { "openwrt" }, - .lines = FASTFETCH_DATATEXT_LOGO_OPENWRT, - .colors = { - FF_COLOR_FG_BLUE, - }, - .colorKeys = FF_COLOR_FG_BLUE, - .colorTitle = FF_COLOR_FG_DEFAULT, - }, - // OPNsense - { - .names = { "OPNsense" }, - .lines = FASTFETCH_DATATEXT_LOGO_OPNSENSE, - .colors = { - FF_COLOR_FG_WHITE, - FF_COLOR_FG_256 "202", - }, - }, - // Oracle - { - .names = { "oracle", "oracle linux", "oracle linux server" }, - .lines = FASTFETCH_DATATEXT_LOGO_ORACLE, - .colors = { - FF_COLOR_FG_RED, - }, - .colorKeys = FF_COLOR_FG_RED, - .colorTitle = FF_COLOR_FG_DEFAULT, - }, - // Orchid - { - .names = { "orchid" }, - .lines = FASTFETCH_DATATEXT_LOGO_ORCHID, - .colors = { - FF_COLOR_FG_WHITE, - FF_COLOR_FG_MAGENTA, - FF_COLOR_FG_MAGENTA, - }, - .colorKeys = FF_COLOR_FG_DEFAULT, - .colorTitle = FF_COLOR_FG_MAGENTA, - }, - // OrchidSmall - { - .names = { "orchid_small" }, - .type = FF_LOGO_LINE_TYPE_SMALL_BIT, - .lines = FASTFETCH_DATATEXT_LOGO_ORCHID_SMALL, - .colors = { - FF_COLOR_FG_WHITE, - FF_COLOR_FG_MAGENTA, - FF_COLOR_FG_MAGENTA, - }, - .colorKeys = FF_COLOR_FG_DEFAULT, - .colorTitle = FF_COLOR_FG_MAGENTA, - }, - // Oreon - { - .names = { "Oreon" }, - .lines = FASTFETCH_DATATEXT_LOGO_OREON, - .colors = { - FF_COLOR_FG_DEFAULT, - FF_COLOR_FG_DEFAULT, - }, - }, - // OS/2 Warp - { - .names = { "OS2Warp" }, - .lines = FASTFETCH_DATATEXT_LOGO_OS2WARP, - .colors = { - FF_COLOR_FG_LIGHT_WHITE, - FF_COLOR_FG_LIGHT_BLUE, - }, - }, - // OS_Elbrus - { - .names = { "OS Elbrus" }, - .lines = FASTFETCH_DATATEXT_LOGO_OS_ELBRUS, - .colors = { - FF_COLOR_FG_BLUE, - FF_COLOR_FG_WHITE, - }, - }, - // OSMC - { - .names = { "OSMC", "Open Source Media Center" }, - .lines = FASTFETCH_DATATEXT_LOGO_OSMC, - .colors = { - FF_COLOR_FG_BLUE, - FF_COLOR_FG_WHITE, - }, - }, - // OSX - { - .names = { "OSX" }, - .lines = FASTFETCH_DATATEXT_LOGO_MACOS, - .colors = { - FF_COLOR_FG_GREEN, - FF_COLOR_FG_YELLOW, - FF_COLOR_FG_LIGHT_RED, - FF_COLOR_FG_RED, - FF_COLOR_FG_MAGENTA, - FF_COLOR_FG_BLUE, - }, - .colorKeys = FF_COLOR_FG_YELLOW, - .colorTitle = FF_COLOR_FG_GREEN, - }, - // OSXSmall - { - .names = { "OSX_small" }, - .type = FF_LOGO_LINE_TYPE_SMALL_BIT, - .lines = FASTFETCH_DATATEXT_LOGO_MACOS_SMALL, - .colors = { - FF_COLOR_FG_GREEN, - FF_COLOR_FG_YELLOW, - FF_COLOR_FG_RED, - FF_COLOR_FG_MAGENTA, - FF_COLOR_FG_BLUE, - }, - .colorKeys = FF_COLOR_FG_YELLOW, - .colorTitle = FF_COLOR_FG_GREEN, - }, - // LAST - {}, -}; - -static const FFlogo P[] = { - // PacBSD - { - .names = { "PacBSD" }, - .lines = FASTFETCH_DATATEXT_LOGO_PACBSD, - .colors = { - FF_COLOR_FG_RED, - FF_COLOR_FG_WHITE, - }, - }, - // Panwah - { - .names = { "Panwah" }, - .lines = FASTFETCH_DATATEXT_LOGO_PANWAH, - .colors = { - FF_COLOR_FG_WHITE, - FF_COLOR_FG_RED, - FF_COLOR_FG_BLACK, - }, - }, - // Parabola - { - .names = { "parabola", "parabola-gnulinux" }, - .lines = FASTFETCH_DATATEXT_LOGO_PARABOLA, - .colors = { - FF_COLOR_FG_MAGENTA, - }, - .colorKeys = FF_COLOR_FG_MAGENTA, - .colorTitle = FF_COLOR_FG_MAGENTA, - }, - // ParabolaSmall - { - .names = { "parabola_small", "parabola-gnulinux_small" }, - .type = FF_LOGO_LINE_TYPE_SMALL_BIT, - .lines = FASTFETCH_DATATEXT_LOGO_PARABOLA_SMALL, - .colors = { - FF_COLOR_FG_MAGENTA, - }, - .colorKeys = FF_COLOR_FG_MAGENTA, - .colorTitle = FF_COLOR_FG_MAGENTA, - }, - // Parch - { - .names = { "Parch" }, - .lines = FASTFETCH_DATATEXT_LOGO_PARCH, - .colors = { - FF_COLOR_FG_BLUE, - FF_COLOR_FG_WHITE, - FF_COLOR_FG_RED, - }, - }, - // Pardus - { - .names = { "Pardus" }, - .lines = FASTFETCH_DATATEXT_LOGO_PARDUS, - .colors = { - FF_COLOR_FG_BLUE, - FF_COLOR_FG_CYAN, - }, - }, - // Parrot - { - .names = { "Parrot" }, - .lines = FASTFETCH_DATATEXT_LOGO_PARROT, - .colors = { - FF_COLOR_FG_CYAN, - FF_COLOR_FG_WHITE, - }, - }, - // Parsix - { - .names = { "Parsix" }, - .lines = FASTFETCH_DATATEXT_LOGO_PARSIX, - .colors = { - FF_COLOR_FG_YELLOW, - FF_COLOR_FG_RED, - FF_COLOR_FG_WHITE, - FF_COLOR_FG_LIGHT_BLACK, - }, - }, - // PCBSD - { - .names = { "PCBSD", "TrueOS" }, - .lines = FASTFETCH_DATATEXT_LOGO_PCBSD, - .colors = { - FF_COLOR_FG_RED, - FF_COLOR_FG_WHITE, - }, - }, - // PCLinuxOS - { - .names = { "PCLinuxOS" }, - .lines = FASTFETCH_DATATEXT_LOGO_PCLINUXOS, - .colors = { - FF_COLOR_FG_BLUE, - FF_COLOR_FG_WHITE, - }, - }, - // PearOS - { - .names = { "PearOS" }, - .lines = FASTFETCH_DATATEXT_LOGO_PEAROS, - .colors = { - FF_COLOR_FG_GREEN, - FF_COLOR_FG_YELLOW, - FF_COLOR_FG_RED, - FF_COLOR_FG_MAGENTA, - FF_COLOR_FG_BLUE, - }, - }, - // Pengwin - { - .names = { "Pengwin" }, - .lines = FASTFETCH_DATATEXT_LOGO_PENGWIN, - .colors = { - FF_COLOR_FG_MAGENTA, - FF_COLOR_FG_LIGHT_MAGENTA, - FF_COLOR_FG_MAGENTA, - }, - }, - // Pentoo - { - .names = { "Pentoo" }, - .lines = FASTFETCH_DATATEXT_LOGO_PENTOO, - .colors = { - FF_COLOR_FG_MAGENTA, - FF_COLOR_FG_WHITE, - }, - }, - // Peppermint - { - .names = { "Peppermint" }, - .lines = FASTFETCH_DATATEXT_LOGO_PEPPERMINT, - .colors = { - FF_COLOR_FG_RED, - FF_COLOR_FG_WHITE, - }, - }, - // Peropesis - { - .names = { "Peropesis", "Peropesis Linux" }, - .lines = FASTFETCH_DATATEXT_LOGO_PEROPESIS, - .colors = { - FF_COLOR_FG_WHITE, - }, - }, - // PhyOS - { - .names = { "PhyOS" }, - .lines = FASTFETCH_DATATEXT_LOGO_PHYOS, - .colors = { - FF_COLOR_FG_BLUE, - FF_COLOR_FG_WHITE, - }, - }, - // PikaOS - { - .names = { "PikaOS" }, - .lines = FASTFETCH_DATATEXT_LOGO_PIKAOS, - .colors = { - FF_COLOR_FG_YELLOW, - }, - }, - // PisiLinux - { - .names = { "PisiLinux" }, - .lines = FASTFETCH_DATATEXT_LOGO_PISI, - .colors = { - FF_COLOR_FG_BLUE, - FF_COLOR_FG_WHITE, - }, - }, - // PNMLinux - { - .names = { "PNM Linux" }, - .lines = FASTFETCH_DATATEXT_LOGO_PNM_LINUX, - .colors = { - FF_COLOR_FG_BLUE, - FF_COLOR_FG_RED, - FF_COLOR_FG_WHITE, - FF_COLOR_FG_256 "202", - }, - }, - // Pop - { - .names = { "pop", "popos" }, - .lines = FASTFETCH_DATATEXT_LOGO_POP, - .colors = { - FF_COLOR_FG_CYAN, - FF_COLOR_FG_WHITE, - }, - .colorKeys = FF_COLOR_FG_CYAN, - .colorTitle = FF_COLOR_FG_CYAN, - }, - // PopSmall - { - .names = { "pop_small", "popos_small" }, - .type = FF_LOGO_LINE_TYPE_SMALL_BIT, - .lines = FASTFETCH_DATATEXT_LOGO_POP_SMALL, - .colors = { - FF_COLOR_FG_CYAN, - }, - .colorKeys = FF_COLOR_FG_CYAN, - .colorTitle = FF_COLOR_FG_CYAN, - }, - // Porteus - { - .names = { "Porteus" }, - .lines = FASTFETCH_DATATEXT_LOGO_PORTEUS, - .colors = { - FF_COLOR_FG_CYAN, - FF_COLOR_FG_WHITE, - }, - }, - // PostMarketOS - { - .names = { "PostMarketOS" }, - .lines = FASTFETCH_DATATEXT_LOGO_POSTMARKETOS, - .colors = { - FF_COLOR_FG_GREEN, - FF_COLOR_FG_WHITE, - }, - }, - // PostMarketOSSmall - { - .names = { "PostMarketOS_small" }, - .type = FF_LOGO_LINE_TYPE_SMALL_BIT, - .lines = FASTFETCH_DATATEXT_LOGO_POSTMARKETOS_SMALL, - .colors = { - FF_COLOR_FG_GREEN, - FF_COLOR_FG_WHITE, - }, - }, - // Proxmox - { - .names = { "Proxmox", "pve" }, - .lines = FASTFETCH_DATATEXT_LOGO_PROXMOX, - .colors = { - FF_COLOR_FG_WHITE, - FF_COLOR_FG_256 "202", - }, - .colorKeys = FF_COLOR_FG_DEFAULT, - .colorTitle = FF_COLOR_FG_256 "202", - }, - // PuffOS - { - .names = { "PuffOS" }, - .lines = FASTFETCH_DATATEXT_LOGO_PUFFOS, - .colors = { - FF_COLOR_FG_YELLOW, - FF_COLOR_FG_WHITE, - }, - }, - // Puppy - { - .names = { "Puppy" }, - .lines = FASTFETCH_DATATEXT_LOGO_PUPPY, - .colors = { - FF_COLOR_FG_BLUE, - FF_COLOR_FG_WHITE, - }, - }, - // PureOS - { - .names = { "PureOS" }, - .lines = FASTFETCH_DATATEXT_LOGO_PUREOS, - .colors = { - FF_COLOR_FG_GREEN, - FF_COLOR_FG_WHITE, - }, - }, - // PureOSSmall - { - .names = { "PureOS_small" }, - .type = FF_LOGO_LINE_TYPE_SMALL_BIT, - .lines = FASTFETCH_DATATEXT_LOGO_PUREOS_SMALL, - .colors = { - FF_COLOR_FG_GREEN, - FF_COLOR_FG_WHITE, - }, - }, - // PrismLinux - { - .names = { "PrismLinux" }, - .lines = FASTFETCH_DATATEXT_LOGO_PRISMLINUX, - .colors = { - FF_COLOR_FG_BLUE, - FF_COLOR_FG_BLUE, - }, - }, - // PrismLinuxSmall - { - .names = { "PrismLinux_small" }, - .type = FF_LOGO_LINE_TYPE_SMALL_BIT, - .lines = FASTFETCH_DATATEXT_LOGO_PRISMLINUX_SMALL, - .colors = { - FF_COLOR_FG_BLUE, - FF_COLOR_FG_BLUE, - }, - }, - // LAST - {}, -}; - -static const FFlogo Q[] = { - // QTS - { - .names = { "qts" }, - .lines = FASTFETCH_DATATEXT_LOGO_QTS, - .colors = { - FF_COLOR_FG_BLUE, - FF_COLOR_FG_RED, - }, - .colorKeys = FF_COLOR_FG_BLUE, - .colorTitle = FF_COLOR_FG_BLUE, - }, - // Q4OS - { - .names = { "Q4OS" }, - .lines = FASTFETCH_DATATEXT_LOGO_Q4OS, - .colors = { - FF_COLOR_FG_BLUE, - FF_COLOR_FG_RED, - }, - }, - // Qubes - { - .names = { "Qubes" }, - .lines = FASTFETCH_DATATEXT_LOGO_QUBES, - .colors = { - FF_COLOR_FG_BLUE, - FF_COLOR_FG_MAGENTA, - }, - }, - // Qubyt - { - .names = { "Qubyt" }, - .lines = FASTFETCH_DATATEXT_LOGO_QUBYT, - .colors = { - FF_COLOR_FG_BLUE, - FF_COLOR_FG_MAGENTA, - FF_COLOR_FG_BLACK, - }, - }, - // Quibian - { - .names = { "Quibian" }, - .lines = FASTFETCH_DATATEXT_LOGO_QUIBIAN, - .colors = { - FF_COLOR_FG_YELLOW, - FF_COLOR_FG_WHITE, - }, - }, - // Quirinux - { - .names = { "Quirinux" }, - .lines = FASTFETCH_DATATEXT_LOGO_QUIRINUX, - .colors = { - FF_COLOR_FG_WHITE, - FF_COLOR_FG_MAGENTA, - }, - }, - // LAST - {}, -}; - -static const FFlogo R[] = { - // Radix - { - .names = { "Radix" }, - .lines = FASTFETCH_DATATEXT_LOGO_RADIX, - .colors = { - FF_COLOR_FG_GREEN, - FF_COLOR_FG_RED, - }, - }, - // Raspbian - { - .names = { "raspbian" }, - .lines = FASTFETCH_DATATEXT_LOGO_RASPBIAN, - .colors = { - FF_COLOR_FG_RED, - FF_COLOR_FG_GREEN, - }, - .colorKeys = FF_COLOR_FG_RED, - .colorTitle = FF_COLOR_FG_GREEN, - }, - // RaspbianSmall - { - .names = { "raspbian_small" }, - .type = FF_LOGO_LINE_TYPE_SMALL_BIT, - .lines = FASTFETCH_DATATEXT_LOGO_RASPBIAN_SMALL, - .colors = { - FF_COLOR_FG_RED, - FF_COLOR_FG_GREEN, - }, - .colorKeys = FF_COLOR_FG_RED, - .colorTitle = FF_COLOR_FG_GREEN, - }, - // RavynOS - { - .names = { "RavynOS" }, - .lines = FASTFETCH_DATATEXT_LOGO_RAVYNOS, - .colors = { - FF_COLOR_FG_256 "15", - FF_COLOR_FG_WHITE, - }, - }, - // RebornOS - { - .names = { "RebornOS" }, - .lines = FASTFETCH_DATATEXT_LOGO_REBORNOS, - .colors = { - FF_COLOR_FG_BLACK, - FF_COLOR_FG_BLUE, - FF_COLOR_FG_CYAN, - }, - .colorKeys = FF_COLOR_FG_BLUE, - .colorTitle = FF_COLOR_FG_BLUE, - }, - // RebornSmall - { - .names = { "RebornOS_small" }, - .type = FF_LOGO_LINE_TYPE_SMALL_BIT, - .lines = FASTFETCH_DATATEXT_LOGO_REBORNOS_SMALL, - .colors = { - FF_COLOR_FG_BLUE, - }, - .colorKeys = FF_COLOR_FG_BLUE, - .colorTitle = FF_COLOR_FG_BLUE, - }, - // RedCore - { - .names = { "RedCore" }, - .lines = FASTFETCH_DATATEXT_LOGO_REDCORE, - .colors = { - FF_COLOR_FG_RED, - FF_COLOR_FG_WHITE, - }, - }, - // RedHatEnterpriseLinux - { - .names = { "rhel", "redhat" }, - .lines = FASTFETCH_DATATEXT_LOGO_RHEL, - .colors = { - FF_COLOR_FG_RED, - }, - .colorKeys = FF_COLOR_FG_RED, - .colorTitle = FF_COLOR_FG_RED, - }, - // RedHatEnterpriseLinux - { - .names = { "rhel_small", "redhat_small" }, - .type = FF_LOGO_LINE_TYPE_SMALL_BIT, - .lines = FASTFETCH_DATATEXT_LOGO_RHEL_SMALL, - .colors = { - FF_COLOR_FG_RED, - }, - .colorKeys = FF_COLOR_FG_RED, - .colorTitle = FF_COLOR_FG_RED, - }, - // RedHatEnterpriseLinux_old - { - .names = { "rhel_old", "redhat_old" }, - .type = FF_LOGO_LINE_TYPE_ALTER_BIT, - .lines = FASTFETCH_DATATEXT_LOGO_RHEL_OLD, - .colors = { - FF_COLOR_FG_RED, - FF_COLOR_FG_WHITE, - }, - }, - // RedOS - { - .names = { "RedOS" }, - .lines = FASTFETCH_DATATEXT_LOGO_REDOS, - .colors = { - FF_COLOR_FG_RED, - FF_COLOR_FG_WHITE, - }, - .colorTitle = FF_COLOR_FG_RED, - .colorKeys = FF_COLOR_FG_RED, - }, - // RedOS small - { - .names = { "RedOS_small" }, - .type = FF_LOGO_LINE_TYPE_SMALL_BIT, - .lines = FASTFETCH_DATATEXT_LOGO_REDOS_SMALL, - .colors = { - FF_COLOR_FG_RED, - FF_COLOR_FG_WHITE, - }, - .colorTitle = FF_COLOR_FG_RED, - .colorKeys = FF_COLOR_FG_RED, - }, - // RedstarOS - { - .names = { "redstar", "redstar-os", "redstaros" }, - .lines = FASTFETCH_DATATEXT_LOGO_REDSTAR, - .colors = { - FF_COLOR_FG_RED, - }, - .colorKeys = FF_COLOR_FG_RED, - .colorTitle = FF_COLOR_FG_RED, - }, - // Redrose - { - .names = { "Redrose" }, - .lines = FASTFETCH_DATATEXT_LOGO_REDROSE, - .colors = { - FF_COLOR_FG_RED, - FF_COLOR_FG_GREEN, - }, - .colorKeys = FF_COLOR_FG_RED, - .colorTitle = FF_COLOR_FG_RED, - }, - // Refracta - { - .names = { "Refracta" }, - .lines = FASTFETCH_DATATEXT_LOGO_REFRACTA, - .colors = { - FF_COLOR_FG_WHITE, - FF_COLOR_FG_LIGHT_BLACK, - }, - .colorKeys = FF_COLOR_FG_LIGHT_BLACK, - .colorTitle = FF_COLOR_FG_DEFAULT, - }, - // Regata - { - .names = { "Regata" }, - .lines = FASTFETCH_DATATEXT_LOGO_REGATA, - .colors = { - FF_COLOR_FG_WHITE, - FF_COLOR_FG_RED, - FF_COLOR_FG_BLUE, - FF_COLOR_FG_MAGENTA, - FF_COLOR_FG_YELLOW, - FF_COLOR_FG_GREEN, - }, - }, - // Regolith - { - .names = { "Regolith" }, - .lines = FASTFETCH_DATATEXT_LOGO_REGOLITH, - .colors = { - FF_COLOR_FG_RED, - FF_COLOR_FG_WHITE, - }, - }, - // RhaymOS - { - .names = { "RhaymOS" }, - .lines = FASTFETCH_DATATEXT_LOGO_RHAYMOS, - .colors = { - FF_COLOR_FG_RED, - FF_COLOR_FG_WHITE, - }, - }, - // RockyLinux - { - .names = { "rocky" }, - .lines = FASTFETCH_DATATEXT_LOGO_ROCKY, - .colors = { - FF_COLOR_FG_GREEN, - }, - .colorKeys = FF_COLOR_FG_GREEN, - .colorTitle = FF_COLOR_FG_GREEN, - }, - // RockyLinuxSmall - { - .names = { "rocky_small" }, - .type = FF_LOGO_LINE_TYPE_SMALL_BIT, - .lines = FASTFETCH_DATATEXT_LOGO_ROCKY_SMALL, - .colors = { - FF_COLOR_FG_GREEN, - }, - .colorKeys = FF_COLOR_FG_GREEN, - .colorTitle = FF_COLOR_FG_GREEN, - }, - // RosaLinux - { - .names = { "rosa", "rosa-linux", "rosalinux" }, - .lines = FASTFETCH_DATATEXT_LOGO_ROSA, - .colors = { - FF_COLOR_FG_RGB "250;250;250", - FF_COLOR_FG_RGB "100;165;225", - }, - .colorKeys = FF_COLOR_FG_RGB "100;165;225", - .colorTitle = FF_COLOR_FG_RGB "100;165;225", - }, - // RhinoLinux - { - .names = { "Rhino Linux" }, - .lines = FASTFETCH_DATATEXT_LOGO_RHINO, - .colors = { - FF_COLOR_FG_MAGENTA, - FF_COLOR_FG_LIGHT_BLUE, - FF_COLOR_FG_LIGHT_MAGENTA, - FF_COLOR_FG_MAGENTA, - }, - .colorKeys = FF_COLOR_FG_MAGENTA, - .colorTitle = FF_COLOR_FG_MAGENTA, - }, - { - .names = { "RengeOS" }, - .lines = FASTFETCH_DATATEXT_LOGO_RENGEOS, - .colors = { - FF_COLOR_FG_MAGENTA, - FF_COLOR_FG_MAGENTA, - }, - }, - // LAST - {}, -}; - -static const FFlogo S[] = { - // Sabayon - { - .names = { "Sabayon" }, - .lines = FASTFETCH_DATATEXT_LOGO_SABAYON, - .colors = { - FF_COLOR_FG_BLUE, - FF_COLOR_FG_WHITE, - }, - }, - // Sabotage - { - .names = { "Sabotage" }, - .lines = FASTFETCH_DATATEXT_LOGO_SABOTAGE, - .colors = { - FF_COLOR_FG_DEFAULT, - }, - .colorKeys = FF_COLOR_FG_BLUE, - .colorTitle = FF_COLOR_FG_DEFAULT, - }, - // Sailfish - { - .names = { "Sailfish" }, - .lines = FASTFETCH_DATATEXT_LOGO_SAILFISH, - .colors = { - FF_COLOR_FG_BLUE, - FF_COLOR_FG_MAGENTA, - }, - }, - // SalentOS - { - .names = { "SalentOS" }, - .lines = FASTFETCH_DATATEXT_LOGO_SALENTOS, - .colors = { - FF_COLOR_FG_GREEN, - FF_COLOR_FG_RED, - FF_COLOR_FG_YELLOW, - FF_COLOR_FG_WHITE, - }, - }, - // SalientOS - { - .names = { "Salient OS", "SalientOS" }, - .lines = FASTFETCH_DATATEXT_LOGO_SALIENTOS, - .colors = { - FF_COLOR_FG_CYAN, - FF_COLOR_FG_WHITE, - }, - }, - // Salix - { - .names = { "Salix" }, - .lines = FASTFETCH_DATATEXT_LOGO_SALIX, - .colors = { - FF_COLOR_FG_GREEN, - FF_COLOR_FG_GREEN, - }, - }, - // SambaBOX - { - .names = { "SambaBOX", "Profelis SambaBOX" }, - .lines = FASTFETCH_DATATEXT_LOGO_SAMBABOX, - .colors = { - FF_COLOR_FG_YELLOW, - FF_COLOR_FG_CYAN, - }, - }, - // Sasanqua - { - .names = { "Sasanqua" }, - .lines = FASTFETCH_DATATEXT_LOGO_SASANQUA, - .colors = { - FF_COLOR_FG_MAGENTA, - FF_COLOR_FG_RED, - }, - }, - // Scientific - { - .names = { "Scientific" }, - .lines = FASTFETCH_DATATEXT_LOGO_SCIENTIFIC, - .colors = { - FF_COLOR_FG_BLUE, - FF_COLOR_FG_WHITE, - FF_COLOR_FG_RED, - }, - }, - // Secureblue - { - .names = { "secureblue" }, - .lines = FASTFETCH_DATATEXT_LOGO_SECUREBLUE, - .colors = { - FF_COLOR_FG_BLUE, - FF_COLOR_FG_MAGENTA, - FF_COLOR_FG_DEFAULT, - }, - }, - // Serpent OS - { - .names = { "Serpent OS" }, - .lines = FASTFETCH_DATATEXT_LOGO_SERPENT_OS, - .colors = { - FF_COLOR_FG_DEFAULT, - }, - }, - // Semc - { - .names = { "semc" }, - .lines = FASTFETCH_DATATEXT_LOGO_SEMC, - .colors = { - FF_COLOR_FG_GREEN, - FF_COLOR_FG_LIGHT_BLACK, - FF_COLOR_FG_RED, - }, - }, - // Septor - { - .names = { "Septor" }, - .lines = FASTFETCH_DATATEXT_LOGO_SEPTOR, - .colors = { - FF_COLOR_FG_BLUE, - FF_COLOR_FG_WHITE, - FF_COLOR_FG_BLUE, - }, - }, - // Serene - { - .names = { "Serene" }, - .lines = FASTFETCH_DATATEXT_LOGO_SERENE, - .colors = { - FF_COLOR_FG_CYAN, - FF_COLOR_FG_CYAN, - }, - }, - // SharkLinux - { - .names = { "SharkLinux" }, - .lines = FASTFETCH_DATATEXT_LOGO_SHARKLINUX, - .colors = { - FF_COLOR_FG_BLUE, - FF_COLOR_FG_WHITE, - }, - }, - // ShastraOS - { - .names = { "ShastraOS" }, - .lines = FASTFETCH_DATATEXT_LOGO_SHASTRAOS, - .colors = { - FF_COLOR_FG_CYAN, - FF_COLOR_FG_WHITE, - }, - }, - // Shebang - { - .names = { "Shebang" }, - .lines = FASTFETCH_DATATEXT_LOGO_SHEBANG, - .colors = { - FF_COLOR_FG_WHITE, - FF_COLOR_FG_WHITE, - }, - }, - // Siduction - { - .names = { "Siduction" }, - .lines = FASTFETCH_DATATEXT_LOGO_SIDUCTION, - .colors = { - FF_COLOR_FG_BLUE, - FF_COLOR_FG_WHITE, - }, - }, - // SkiffOS - { - .names = { "SkiffOS" }, - .lines = FASTFETCH_DATATEXT_LOGO_SKIFFOS, - .colors = { - FF_COLOR_FG_BLUE, - FF_COLOR_FG_WHITE, - }, - }, - // SleeperOS - { - .names = { "SleeperOS" }, - .lines = FASTFETCH_DATATEXT_LOGO_SLEEPEROS, - .colors = { - FF_COLOR_FG_CYAN, - FF_COLOR_FG_WHITE, - }, - }, - // SleeperOSSmall - { - .names = { "SleeperOS_small" }, - .type = FF_LOGO_LINE_TYPE_SMALL_BIT, - .lines = FASTFETCH_DATATEXT_LOGO_SLEEPEROS_SMALL, - .colors = { - FF_COLOR_FG_CYAN, - FF_COLOR_FG_WHITE, - }, - }, - // Slitaz - { - .names = { "Slitaz" }, - .lines = FASTFETCH_DATATEXT_LOGO_SLITAZ, - .colors = { - FF_COLOR_FG_YELLOW, - FF_COLOR_FG_YELLOW, - }, - }, - // SpoinkOS - { - .names = { "SpoinkOS", "spoink-os" }, - .lines = FASTFETCH_DATATEXT_LOGO_SPOINKOS, - .colors = { - FF_COLOR_FG_GREEN, - }, - }, - // Slackel - { - .names = { "Slackel" }, - .lines = FASTFETCH_DATATEXT_LOGO_SLACKEL, - .colors = { - FF_COLOR_FG_YELLOW, - FF_COLOR_FG_YELLOW, - }, - }, - // Slackware - { - .names = { "Slackware" }, - .lines = FASTFETCH_DATATEXT_LOGO_SLACKWARE, - .colors = { - FF_COLOR_FG_BLUE, - FF_COLOR_FG_WHITE, - }, - .colorKeys = FF_COLOR_FG_BLUE, - .colorTitle = FF_COLOR_FG_BLUE, - }, - // SlackwareSmall - { - .names = { "Slackware_small" }, - .type = FF_LOGO_LINE_TYPE_SMALL_BIT, - .lines = FASTFETCH_DATATEXT_LOGO_SLACKWARE_SMALL, - .colors = { - FF_COLOR_FG_BLUE, - FF_COLOR_FG_WHITE, - }, - .colorKeys = FF_COLOR_FG_BLUE, - .colorTitle = FF_COLOR_FG_DEFAULT, - }, - // SmartOS - { - .names = { "SmartOS" }, - .lines = FASTFETCH_DATATEXT_LOGO_SMARTOS, - .colors = { - FF_COLOR_FG_CYAN, - FF_COLOR_FG_WHITE, - }, - }, - // SnigdhaOS - { - .names = { "SnigdhaOS", "Snigdha" }, - .lines = FASTFETCH_DATATEXT_LOGO_SNIGDHAOS, - .colors = { - FF_COLOR_FG_CYAN, - FF_COLOR_FG_WHITE, - }, - }, - // Soda - { - .names = { "Soda" }, - .lines = FASTFETCH_DATATEXT_LOGO_SODA, - .colors = { - FF_COLOR_FG_RED, - FF_COLOR_FG_WHITE, - }, - }, - // Source Mage - { - .names = { "Source Mage", "Source Mage GNU/Linux", "source_mage", "sourcemage" }, - .lines = FASTFETCH_DATATEXT_LOGO_SOURCE_MAGE, - .colors = { - FF_COLOR_FG_DEFAULT, - }, - .colorKeys = FF_COLOR_FG_RED, - .colorTitle = FF_COLOR_FG_DEFAULT, - }, - // Solaris - { - .names = { "solaris", "sunos" }, - .lines = FASTFETCH_DATATEXT_LOGO_SOLARIS, - .colors = { - FF_COLOR_FG_YELLOW, - }, - .colorKeys = FF_COLOR_FG_YELLOW, - .colorTitle = FF_COLOR_FG_DEFAULT, - }, - // SolarisSmall - { - .names = { "solaris_small", "sunos_small" }, - .type = FF_LOGO_LINE_TYPE_SMALL_BIT, - .lines = FASTFETCH_DATATEXT_LOGO_SOLARIS_SMALL, - .colors = { - FF_COLOR_FG_YELLOW, - }, - .colorKeys = FF_COLOR_FG_YELLOW, - .colorTitle = FF_COLOR_FG_DEFAULT, - }, - // Solus - { - .names = { "Solus", "solus-linux" }, - .lines = FASTFETCH_DATATEXT_LOGO_SOLUS, - .colors = { - FF_COLOR_FG_BLUE, - FF_COLOR_FG_WHITE, - }, - .colorKeys = FF_COLOR_FG_BLUE, - .colorTitle = FF_COLOR_FG_DEFAULT, - }, - // Sparky - { - .names = { "Sparky" }, - .lines = FASTFETCH_DATATEXT_LOGO_SPARKY, - .colors = { - FF_COLOR_FG_RED, - FF_COLOR_FG_WHITE, - }, - }, - // Star - { - .names = { "Star" }, - .lines = FASTFETCH_DATATEXT_LOGO_STAR, - .colors = { - FF_COLOR_FG_WHITE, - FF_COLOR_FG_WHITE, - }, - }, - // StockLinux - { - .names = { "Stock Linux" }, - .lines = FASTFETCH_DATATEXT_LOGO_STOCK_LINUX, - .colors = { - FF_COLOR_FG_BLUE, - FF_COLOR_FG_WHITE, - }, - }, - // SteamOS - { - .names = { "SteamOS" }, - .lines = FASTFETCH_DATATEXT_LOGO_STEAMOS, - .colors = { - FF_COLOR_FG_BLUE, - FF_COLOR_FG_WHITE, - }, - .colorKeys = FF_COLOR_FG_BLUE, - .colorTitle = FF_COLOR_FG_BLUE, - }, - // Steam Deck - { - .names = { "SteamDeck" }, - .lines = FASTFETCH_DATATEXT_LOGO_STEAMDECK, - .colors = { - FF_COLOR_FG_BLUE, - FF_COLOR_FG_WHITE, - }, - .colorKeys = FF_COLOR_FG_BLUE, - .colorTitle = FF_COLOR_FG_BLUE, - }, - // Steam Deck Small - { - .names = { "SteamDeck_small" }, - .lines = FASTFETCH_DATATEXT_LOGO_STEAMDECK_SMALL, - .colors = { - FF_COLOR_FG_BLUE, - FF_COLOR_FG_WHITE, - }, - .colorKeys = FF_COLOR_FG_BLUE, - .colorTitle = FF_COLOR_FG_BLUE, - }, - // Steam Deck OLED - { - .names = { "SteamDeckOled" }, - .lines = FASTFETCH_DATATEXT_LOGO_STEAMDECK, - .colors = { - FF_COLOR_FG_RED, - FF_COLOR_FG_WHITE, - }, - .colorKeys = FF_COLOR_FG_RED, - .colorTitle = FF_COLOR_FG_RED, - }, - // Sulin - { - .names = { "Sulin" }, - .lines = FASTFETCH_DATATEXT_LOGO_SULIN, - .colors = { - FF_COLOR_FG_BLUE, - FF_COLOR_FG_WHITE, - }, - }, - // SummitOS - { - .names = { "SummitOS" }, - .lines = FASTFETCH_DATATEXT_LOGO_SUMMITOS, - .colors = { - FF_COLOR_FG_RGB "143;191;80", - FF_COLOR_FG_RGB "160;205;102", - FF_COLOR_FG_RGB "181;225;102", - }, - }, - // Suse - { - .names = { "suse", "suse-linux" }, - .lines = FASTFETCH_DATATEXT_LOGO_SUSE, - .colors = { - FF_COLOR_FG_GREEN, - FF_COLOR_FG_GREEN, - }, - }, - // SuseSmall - { - .names = { "suse_small", "suse-linux_small" }, - .type = FF_LOGO_LINE_TYPE_SMALL_BIT, - .lines = FASTFETCH_DATATEXT_LOGO_OPENSUSE_SMALL, - .colors = { - FF_COLOR_FG_GREEN, - FF_COLOR_FG_GREEN, - }, - }, - // Swagarch - { - .names = { "Swagarch" }, - .lines = FASTFETCH_DATATEXT_LOGO_SWAGARCH, - .colors = { - FF_COLOR_FG_BLUE, - FF_COLOR_FG_WHITE, - }, - }, - // LAST - {}, -}; - -static const FFlogo T[] = { - // T2 - { - .names = { "T2", "T2 SDE", "T2/Linux" }, - .lines = FASTFETCH_DATATEXT_LOGO_T2, - .colors = { - FF_COLOR_FG_RED, - FF_COLOR_FG_WHITE, - FF_COLOR_FG_YELLOW, - FF_COLOR_FG_BLUE, - }, - }, - // T2Small - { - .names = { "T2_small", "T2 SDE_small", "T2/Linux_small" }, - .type = FF_LOGO_LINE_TYPE_SMALL_BIT, - .lines = FASTFETCH_DATATEXT_LOGO_T2_SMALL, - .colors = { - FF_COLOR_FG_WHITE, - FF_COLOR_FG_BLUE, - }, - }, - // Tails - { - .names = { "Tails" }, - .lines = FASTFETCH_DATATEXT_LOGO_TAILS, - .colors = { - FF_COLOR_FG_BLUE, - FF_COLOR_FG_WHITE, - }, - }, - // Tatra - { - .names = { "Tatra" }, - .lines = FASTFETCH_DATATEXT_LOGO_TATRA, - .colors = { - FF_COLOR_FG_BLUE, - FF_COLOR_FG_GREEN, - }, - }, - // TeArch - { - .names = { "TeArch" }, - .lines = FASTFETCH_DATATEXT_LOGO_TEARCH, - .colors = { - FF_COLOR_FG_256 "39", - FF_COLOR_FG_WHITE, - }, - }, - // TempleOS - { - .names = { "TempleOS" }, - .lines = FASTFETCH_DATATEXT_LOGO_TEMPLEOS, - .colors = { - FF_COLOR_FG_YELLOW, - FF_COLOR_FG_RED, - FF_COLOR_FG_CYAN, - }, - }, - // TileOS - { - .names = { "TileOS" }, - .lines = FASTFETCH_DATATEXT_LOGO_TILEOS, - .colors = { - FF_COLOR_FG_MAGENTA, - FF_COLOR_FG_BLUE, - FF_COLOR_FG_GREEN, - }, - }, - // Torizon OS - { - .names = { "Torizon OS", "TorizonCore" }, - .lines = FASTFETCH_DATATEXT_LOGO_TORIZONCORE, - .colors = { - FF_COLOR_FG_LIGHT_WHITE, - FF_COLOR_FG_YELLOW, - FF_COLOR_FG_BLUE, - }, - }, - // Trisquel - { - .names = { "Trisquel" }, - .lines = FASTFETCH_DATATEXT_LOGO_TRISQUEL, - .colors = { - FF_COLOR_FG_BLUE, - FF_COLOR_FG_CYAN, - }, - }, - // TrueNAS Scale - { - .names = { "TrueNAS-Scale" }, - .lines = FASTFETCH_DATATEXT_LOGO_TRUENAS_SCALE, - .colors = { - FF_COLOR_FG_256 "39", - FF_COLOR_FG_256 "32", - FF_COLOR_FG_256 "248", - }, - .colorKeys = FF_COLOR_FG_256 "248", - .colorTitle = FF_COLOR_FG_256 "32", - }, - // TuxedoOS - { - .names = { "Tuxedo OS", "tuxedo" }, - .lines = FASTFETCH_DATATEXT_LOGO_TUXEDO_OS, - .colors = { - FF_COLOR_FG_WHITE, - FF_COLOR_FG_RED, - }, - }, - // Twister - { - .names = { "Twister" }, - .lines = FASTFETCH_DATATEXT_LOGO_TWISTER, - .colors = { - FF_COLOR_FG_GREEN, - FF_COLOR_FG_RED, - FF_COLOR_FG_BLUE, - FF_COLOR_FG_MAGENTA, - FF_COLOR_FG_WHITE, - }, - }, - // LAST - {}, -}; - -static const FFlogo U[] = { - // UBLinux - { - .names = { "UBLinux" }, - .lines = FASTFETCH_DATATEXT_LOGO_UBLINUX, - .colors = { - FF_COLOR_FG_256 "38", - FF_COLOR_FG_WHITE, - FF_COLOR_FG_LIGHT_BLACK, - }, - .colorKeys = FF_COLOR_FG_256 "38", - .colorTitle = FF_COLOR_FG_DEFAULT, - }, - // UBLinuxSmall - { - .names = { "UBLinux_small" }, - .type = FF_LOGO_LINE_TYPE_SMALL_BIT, - .lines = FASTFETCH_DATATEXT_LOGO_UBLINUX_SMALL, - .colors = { - FF_COLOR_FG_256 "38", - FF_COLOR_FG_WHITE, - FF_COLOR_FG_LIGHT_BLACK, - }, - .colorKeys = FF_COLOR_FG_256 "38", - .colorTitle = FF_COLOR_FG_DEFAULT, - }, - // Ubuntu - { - .names = { "ubuntu", "ubuntu-linux" }, - .lines = FASTFETCH_DATATEXT_LOGO_UBUNTU, - .colors = { - FF_COLOR_FG_RED, - FF_COLOR_FG_RED, - }, - }, - // UbuntuSmall - { - .names = { "ubuntu_small", "ubuntu-linux_small" }, - .type = FF_LOGO_LINE_TYPE_SMALL_BIT, - .lines = FASTFETCH_DATATEXT_LOGO_UBUNTU_SMALL, - .colors = { - FF_COLOR_FG_RED, - FF_COLOR_FG_RED, - }, - }, - // UbuntuOld - { - .names = { "ubuntu_old", "ubuntu-linux_old" }, - .type = FF_LOGO_LINE_TYPE_ALTER_BIT, - .lines = FASTFETCH_DATATEXT_LOGO_UBUNTU_OLD, - .colors = { - FF_COLOR_FG_RED, - FF_COLOR_FG_WHITE, - }, - .colorKeys = FF_COLOR_FG_RED, - .colorTitle = FF_COLOR_FG_RED, - }, - // UbuntuOld2 - { - .names = { "ubuntu_old2" }, - .type = FF_LOGO_LINE_TYPE_ALTER_BIT, - .lines = FASTFETCH_DATATEXT_LOGO_UBUNTU_OLD2, - .colors = { - FF_COLOR_FG_RED, - FF_COLOR_FG_WHITE, - FF_COLOR_FG_YELLOW, - }, - .colorKeys = FF_COLOR_FG_RED, - .colorTitle = FF_COLOR_FG_RED, - }, - // UbuntuOld2Small - { - .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 = { - FF_COLOR_FG_RED, - }, - .colorKeys = FF_COLOR_FG_RED, - .colorTitle = FF_COLOR_FG_RED, - }, - // UbuntuBudgie - { - .names = { "ubuntu budgie", "ubuntu-budgie" }, - .lines = FASTFETCH_DATATEXT_LOGO_UBUNTU_BUDGIE, - .colors = { - FF_COLOR_FG_BLUE, - FF_COLOR_FG_WHITE, - FF_COLOR_FG_RED, - }, - .colorKeys = FF_COLOR_FG_BLUE, - .colorTitle = FF_COLOR_FG_DEFAULT, - }, - // UbuntuCinnamon - { - .names = { "ubuntu cinnamon", "ubuntu-cinnamon" }, - .lines = FASTFETCH_DATATEXT_LOGO_UBUNTU_CINNAMON, - .colors = { - FF_COLOR_FG_RED, - FF_COLOR_FG_WHITE, - }, - }, - // UbuntuGNOME - { - .names = { "ubuntu gnome", "ubuntu-gnome" }, - .lines = FASTFETCH_DATATEXT_LOGO_UBUNTU_GNOME, - .colors = { - FF_COLOR_FG_BLUE, - FF_COLOR_FG_MAGENTA, - FF_COLOR_FG_WHITE, - FF_COLOR_FG_CYAN, - }, - .colorKeys = FF_COLOR_FG_BLUE, - .colorTitle = FF_COLOR_FG_MAGENTA, - }, - // UbuntuKylin - { - .names = { "ubuntu kylin", "ubuntu-kylin" }, - .lines = FASTFETCH_DATATEXT_LOGO_UBUNTU_KYLIN, - .colors = { - FF_COLOR_FG_RED, - FF_COLOR_FG_WHITE, - FF_COLOR_FG_YELLOW, - }, - .colorKeys = FF_COLOR_FG_RED, - .colorTitle = FF_COLOR_FG_DEFAULT, - }, - // UbuntuMate - { - .names = { "ubuntu mate", "ubuntu-mate" }, - .lines = FASTFETCH_DATATEXT_LOGO_UBUNTU_MATE, - .colors = { - FF_COLOR_FG_GREEN, - FF_COLOR_FG_WHITE, - }, - .colorKeys = FF_COLOR_FG_GREEN, - .colorTitle = FF_COLOR_FG_DEFAULT, - }, - // UbuntuStudio - { - .names = { "ubuntu studio", "ubuntu-studio" }, - .lines = FASTFETCH_DATATEXT_LOGO_UBUNTU_STUDIO, - .colors = { - FF_COLOR_FG_CYAN, - FF_COLOR_FG_WHITE, - }, - }, - // UbuntuSway - { - .names = { "ubuntu sway", "ubuntu-sway" }, - .lines = FASTFETCH_DATATEXT_LOGO_UBUNTU_SWAY, - .colors = { - FF_COLOR_FG_CYAN, - FF_COLOR_FG_WHITE, - }, - }, - // UbuntuTouch - { - .names = { "ubuntu touch", "ubuntu-touch" }, - .lines = FASTFETCH_DATATEXT_LOGO_UBUNTU_TOUCH, - .colors = { - FF_COLOR_FG_YELLOW, - FF_COLOR_FG_WHITE, - }, - }, - // UbuntuUnity - { - .names = { "ubuntu unity", "ubuntu-unity" }, - .lines = FASTFETCH_DATATEXT_LOGO_UBUNTU_UNITY, - .colors = { - FF_COLOR_FG_MAGENTA, - FF_COLOR_FG_WHITE, - }, - }, - // Ultramarine - { - .names = { "Ultramarine", "Ultramarine Linux" }, - .lines = FASTFETCH_DATATEXT_LOGO_ULTRAMARINE, - .colors = { - FF_COLOR_FG_BLUE, - FF_COLOR_FG_WHITE, - }, - }, - // Ultramarine Small - { - .names = { "Ultramarine_small" }, - .lines = FASTFETCH_DATATEXT_LOGO_ULTRAMARINE_SMALL, - .colors = { - FF_COLOR_FG_BLUE, - FF_COLOR_FG_WHITE, - }, - }, - // Unifi - { - .names = { "Unifi" }, - .lines = FASTFETCH_DATATEXT_LOGO_UNIFI, - .colors = { - FF_COLOR_FG_WHITE, - FF_COLOR_FG_WHITE, - }, - }, - // Univalent - { - .names = { "Univalent" }, - .lines = FASTFETCH_DATATEXT_LOGO_UNIVALENT, - .colors = { - FF_COLOR_FG_CYAN, - FF_COLOR_FG_CYAN, - }, - }, - // Univention - { - .names = { "Univention" }, - .lines = FASTFETCH_DATATEXT_LOGO_UNIVENTION, - .colors = { - FF_COLOR_FG_RED, - FF_COLOR_FG_WHITE, - }, - }, - // UOS - { - .names = { "UOS" }, - .lines = FASTFETCH_DATATEXT_LOGO_UOS, - .colors = { - FF_COLOR_FG_BLUE, - }, - .colorKeys = FF_COLOR_FG_DEFAULT, - .colorTitle = FF_COLOR_FG_BLUE, - }, - // UrukOS - { - .names = { "UrukOS" }, - .lines = FASTFETCH_DATATEXT_LOGO_URUKOS, - .colors = { - FF_COLOR_FG_LIGHT_BLUE, - FF_COLOR_FG_LIGHT_BLUE, - FF_COLOR_FG_WHITE, - FF_COLOR_FG_LIGHT_BLUE, - FF_COLOR_FG_BLUE, - }, - }, - // Uwuntu - { - .names = { "uwuntu" }, - .lines = FASTFETCH_DATATEXT_LOGO_UWUNTU, - .colors = { - FF_COLOR_FG_256 "225", - FF_COLOR_FG_256 "206", - FF_COLOR_FG_256 "52", - }, - }, - // Uzbek - { - .names = { "Uzbek" }, - .lines = FASTFETCH_DATATEXT_LOGO_UZBEK, - .colors = { - FF_COLOR_FG_GREEN, - }, - }, - // LAST - {}, -}; - -static const FFlogo V[] = { - // Valhalla - { - .names = { "Valhalla", "valhallaos", "valhalla-linux" }, - .lines = FASTFETCH_DATATEXT_LOGO_VALHALLA, - .colors = { - FF_COLOR_FG_DEFAULT, - }, - .colorKeys = FF_COLOR_FG_DEFAULT, - .colorTitle = FF_COLOR_FG_DEFAULT, - }, - // Vanilla - { - .names = { "vanilla" }, - .lines = FASTFETCH_DATATEXT_LOGO_VANILLA, - .colors = { - FF_COLOR_FG_YELLOW, - }, - .colorKeys = FF_COLOR_FG_YELLOW, - .colorTitle = FF_COLOR_FG_YELLOW, - }, - // Vanilla2 - { - .names = { "vanilla2" }, - .type = FF_LOGO_LINE_TYPE_ALTER_BIT, - .lines = FASTFETCH_DATATEXT_LOGO_VANILLA2, - .colors = { - FF_COLOR_FG_YELLOW, - }, - .colorKeys = FF_COLOR_FG_YELLOW, - .colorTitle = FF_COLOR_FG_YELLOW, - }, - // VanillaSmall - { - .names = { "vanilla_small" }, - .type = FF_LOGO_LINE_TYPE_SMALL_BIT, - .lines = FASTFETCH_DATATEXT_LOGO_VANILLA_SMALL, - .colors = { - FF_COLOR_FG_LIGHT_YELLOW, - FF_COLOR_FG_YELLOW, - }, - }, - // Venom - { - .names = { "Venom" }, - .lines = FASTFETCH_DATATEXT_LOGO_VENOM, - .colors = { - FF_COLOR_FG_LIGHT_BLACK, - FF_COLOR_FG_BLUE, - }, - }, - // VenomSmall - { - .names = { "Venom_small" }, - .type = FF_LOGO_LINE_TYPE_SMALL_BIT, - .lines = FASTFETCH_DATATEXT_LOGO_VENOM_SMALL, - .colors = { - FF_COLOR_FG_LIGHT_BLACK, - FF_COLOR_FG_BLUE, - }, - }, - // VincentOS - { - .names = { "VincentOS" }, - .lines = FASTFETCH_DATATEXT_LOGO_VINCENTOS, - .colors = { - FF_COLOR_FG_GREEN, - FF_COLOR_FG_DEFAULT, - }, - }, - // Vnux - { - .names = { "Vnux" }, - .lines = FASTFETCH_DATATEXT_LOGO_VNUX, - .colors = { - FF_COLOR_FG_256 "11", - FF_COLOR_FG_256 "8", - FF_COLOR_FG_256 "15", - FF_COLOR_FG_RED, - FF_COLOR_FG_WHITE, - }, - }, - // Vzlinux - { - .names = { "Vzlinux" }, - .lines = FASTFETCH_DATATEXT_LOGO_VZLINUX, - .colors = { - FF_COLOR_FG_RED, - FF_COLOR_FG_WHITE, - FF_COLOR_FG_YELLOW, - }, - }, - // Void - { - .names = { "void" }, - .lines = FASTFETCH_DATATEXT_LOGO_VOID, - .colors = { - FF_COLOR_FG_GREEN, - FF_COLOR_FG_LIGHT_BLACK, - }, - .colorKeys = FF_COLOR_FG_DEFAULT, - .colorTitle = FF_COLOR_FG_GREEN, - }, - // VoidSmall - { - .names = { "void_small" }, - .type = FF_LOGO_LINE_TYPE_SMALL_BIT, - .lines = FASTFETCH_DATATEXT_LOGO_VOID_SMALL, - .colors = { - FF_COLOR_FG_GREEN, - }, - .colorKeys = FF_COLOR_FG_DEFAULT, - .colorTitle = FF_COLOR_FG_GREEN, - }, - // Void2 - { - .names = { "void2" }, - .lines = FASTFETCH_DATATEXT_LOGO_VOID2, - .colors = { - FF_COLOR_FG_YELLOW, - FF_COLOR_FG_DEFAULT, - FF_COLOR_FG_GREEN, - }, - .colorKeys = FF_COLOR_FG_DEFAULT, - .colorTitle = FF_COLOR_FG_GREEN, - }, - // Void2Small - { - .names = { "void2_small" }, - .type = FF_LOGO_LINE_TYPE_SMALL_BIT | FF_LOGO_LINE_TYPE_ALTER_BIT, - .lines = FASTFETCH_DATATEXT_LOGO_VOID2_SMALL, - .colors = { - FF_COLOR_FG_GREEN, - }, - .colorKeys = FF_COLOR_FG_DEFAULT, - .colorTitle = FF_COLOR_FG_GREEN, - }, - // LAST - {}, -}; - -static const FFlogo W[] = { - // WiiLinux - { - .names = { "WiiLinuxNgx", "WiiLinux", "Wii-Linux", "Wii Linux" }, - .lines = FASTFETCH_DATATEXT_LOGO_WII_LINUX, - .colors = { - FF_COLOR_FG_CYAN, - FF_COLOR_FG_WHITE, - }, - }, - // Windows2025 - { - .names = { "Windows Server 2025" }, - .lines = FASTFETCH_DATATEXT_LOGO_WINDOWS_2025, - .colors = { - FF_COLOR_FG_BLUE, - FF_COLOR_FG_BLUE, - FF_COLOR_FG_BLUE, - FF_COLOR_FG_BLUE, - }, - .colorKeys = FF_COLOR_FG_YELLOW, - .colorTitle = FF_COLOR_FG_CYAN, - }, - // Windows11 - { - .names = { "Windows 11", "Windows Server 2022" }, - .lines = FASTFETCH_DATATEXT_LOGO_WINDOWS_11, - .colors = { - FF_COLOR_FG_BLUE, - FF_COLOR_FG_BLUE, - FF_COLOR_FG_BLUE, - FF_COLOR_FG_BLUE, - }, - .colorKeys = FF_COLOR_FG_YELLOW, - .colorTitle = FF_COLOR_FG_CYAN, - }, - // Windows11Small - { - .names = { "Windows 11_small" }, - .type = FF_LOGO_LINE_TYPE_SMALL_BIT, - .lines = FASTFETCH_DATATEXT_LOGO_WINDOWS_11_SMALL, - .colors = { - FF_COLOR_FG_BLUE, - FF_COLOR_FG_BLUE, - FF_COLOR_FG_BLUE, - FF_COLOR_FG_BLUE, - }, - .colorKeys = FF_COLOR_FG_YELLOW, - .colorTitle = FF_COLOR_FG_CYAN, - }, - // Windows8 - { - .names = { "Windows 8", "Windows 8.1", "Windows 10", "Windows Server 2012", "Windows Server 2012 R2", "Windows Server 2016", "Windows Server 2019" }, - .lines = FASTFETCH_DATATEXT_LOGO_WINDOWS_8, - .colors = { - FF_COLOR_FG_CYAN, - FF_COLOR_FG_CYAN, - FF_COLOR_FG_CYAN, - FF_COLOR_FG_CYAN, - }, - .colorKeys = FF_COLOR_FG_YELLOW, - .colorTitle = FF_COLOR_FG_DEFAULT, - }, - // Windows - { - .names = { "Windows", "Windows 7", "Windows Server 2008", "Windows Server 2008 R2" }, - .lines = FASTFETCH_DATATEXT_LOGO_WINDOWS, - .colors = { - FF_COLOR_FG_RED, - FF_COLOR_FG_GREEN, - FF_COLOR_FG_BLUE, - FF_COLOR_FG_YELLOW, - }, - .colorKeys = FF_COLOR_FG_BLUE, - .colorTitle = FF_COLOR_FG_GREEN, - }, - // Windows95 - { - .names = { "Windows 95", "Windows 9x" }, - .lines = FASTFETCH_DATATEXT_LOGO_WINDOWS_95, - .colors = { - FF_COLOR_FG_CYAN, - FF_COLOR_FG_BLUE, - FF_COLOR_FG_YELLOW, - FF_COLOR_FG_GREEN, - FF_COLOR_FG_RED, - FF_COLOR_FG_BLACK, - }, - .colorKeys = FF_COLOR_FG_CYAN, - .colorTitle = FF_COLOR_FG_BLUE, - }, - // WolfOS - { - .names = { "WolfOS" }, - .lines = FASTFETCH_DATATEXT_LOGO_WOLFOS, - .colors = { - FF_COLOR_FG_BLUE, - FF_COLOR_FG_GREEN, - }, - }, - // LAST - {}, -}; - -static const FFlogo X[] = { - // XCP-ng - { - .names = { "XCP-ng", "xenenterprise" }, - .lines = FASTFETCH_DATATEXT_LOGO_XCP_NG, - .colors = { - FF_COLOR_FG_RED, - FF_COLOR_FG_RED, - FF_COLOR_FG_BLACK, - FF_COLOR_FG_BLACK, - FF_COLOR_FG_BLUE, - FF_COLOR_FG_YELLOW, - } }, - // Xenia - { - .names = { "Xenia" }, - .lines = FASTFETCH_DATATEXT_LOGO_XENIA, - .colors = { - FF_COLOR_FG_RED, - FF_COLOR_FG_LIGHT_BLACK, - }, - .colorKeys = FF_COLOR_FG_DEFAULT, - .colorTitle = FF_COLOR_FG_RED, - }, - // Xenia_old - { - .names = { "Xenia_old" }, - .lines = FASTFETCH_DATATEXT_LOGO_XENIA_OLD, - .type = FF_LOGO_LINE_TYPE_ALTER_BIT, - .colors = { - FF_COLOR_FG_YELLOW, - FF_COLOR_FG_GREEN, - FF_COLOR_FG_RED, - }, - }, - // XeroArch - { - .names = { "XeroArch" }, - .lines = FASTFETCH_DATATEXT_LOGO_XEROARCH, - .colors = { - FF_COLOR_FG_256 "50", - FF_COLOR_FG_256 "14", - FF_COLOR_FG_256 "50", - FF_COLOR_FG_256 "93", - FF_COLOR_FG_256 "16", - FF_COLOR_FG_256 "15", - }, - }, - // Xferience - { - .names = { "Xferience" }, - .lines = FASTFETCH_DATATEXT_LOGO_XFERIENCE, - .colors = { - FF_COLOR_FG_CYAN, - FF_COLOR_FG_CYAN, - }, - }, - // Xubuntu - { - .names = { "Xubuntu" }, - .lines = FASTFETCH_DATATEXT_LOGO_XUBUNTU, - .colors = { - FF_COLOR_FG_256 "25", - FF_COLOR_FG_DEFAULT, - }, - }, - // Xray_OS - { - .names = { "Xray_OS" }, - .lines = FASTFETCH_DATATEXT_LOGO_XRAY_OS, - .colors = { - FF_COLOR_FG_256 "15", - FF_COLOR_FG_256 "14", - FF_COLOR_FG_256 "16", - }, - }, - // Xinux - { - .names = { "Xinux" }, - .lines = FASTFETCH_DATATEXT_LOGO_XINUX, - .colors = { - FF_COLOR_FG_BLUE, - FF_COLOR_FG_CYAN, - }, - }, - // XJ380 - { - .names = { "XJ380" }, - .lines = FASTFETCH_DATATEXT_LOGO_XJ380, - .colors = { - FF_COLOR_FG_RGB "0;162;232", - FF_COLOR_FG_RGB "255;242;0", - }, - }, - // Ximper - { - .names = { "Ximper" }, - .lines = FASTFETCH_DATATEXT_LOGO_XIMPER, - .colors = { - FF_COLOR_FG_256 "21", - FF_COLOR_FG_256 "57", - FF_COLOR_FG_256 "92", - FF_COLOR_FG_256 "128", - }, - }, - // LAST - {}, -}; - -static const FFlogo Y[] = { - // YiffOS - { - .names = { "YiffOS" }, - .lines = FASTFETCH_DATATEXT_LOGO_YIFFOS, - .colors = { - FF_COLOR_FG_256 "93", - FF_COLOR_FG_256 "92", - }, - }, - // LAST - {}, -}; - -static const FFlogo Z[] = { - // Zorin - { - .names = { "Zorin" }, - .lines = FASTFETCH_DATATEXT_LOGO_ZORIN, - .colors = { - FF_COLOR_FG_BLUE, - }, - .colorKeys = FF_COLOR_FG_BLUE, - .colorTitle = FF_COLOR_FG_BLUE, - }, - // Z/OS - { - .names = { "z/OS", "zos" }, - .lines = FASTFETCH_DATATEXT_LOGO_ZOS, - .colors = { - FF_COLOR_FG_BLUE, - }, - }, - // Zraxyl - { - .names = { "Zraxyl" }, - .lines = FASTFETCH_DATATEXT_LOGO_ZRAXYL, - .colors = { - FF_COLOR_FG_BLUE, - }, - .colorKeys = FF_COLOR_FG_BLUE, - .colorTitle = FF_COLOR_FG_BLUE, - }, - // LAST - {}, -}; +#include "./ascii/a.inc" +#include "./ascii/b.inc" +#include "./ascii/c.inc" +#include "./ascii/d.inc" +#include "./ascii/e.inc" +#include "./ascii/f.inc" +#include "./ascii/g.inc" +#include "./ascii/h.inc" +#include "./ascii/i.inc" +#include "./ascii/j.inc" +#include "./ascii/k.inc" +#include "./ascii/l.inc" +#include "./ascii/m.inc" +#include "./ascii/n.inc" +#include "./ascii/o.inc" +#include "./ascii/p.inc" +#include "./ascii/q.inc" +#include "./ascii/r.inc" +#include "./ascii/s.inc" +#include "./ascii/t.inc" +#include "./ascii/u.inc" +#include "./ascii/v.inc" +#include "./ascii/w.inc" +#include "./ascii/x.inc" +#include "./ascii/y.inc" +#include "./ascii/z.inc" const FFlogo* ffLogoBuiltins[] = { A, diff --git a/src/logo/image/image.c b/src/logo/image/image.c index 60dc777414..78083e68e8 100644 --- a/src/logo/image/image.c +++ b/src/logo/image/image.c @@ -2,7 +2,7 @@ #include "common/io.h" #include "common/printing.h" #include "common/processing.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include "common/base64.h" #include "detection/terminalsize/terminalsize.h" diff --git a/src/logo/logo.c b/src/logo/logo.c index 9efc3b6ecb..9f2c89244f 100644 --- a/src/logo/logo.c +++ b/src/logo/logo.c @@ -3,7 +3,7 @@ #include "common/printing.h" #include "common/processing.h" #include "common/textModifier.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include "detection/media/media.h" #include "detection/os/os.h" #include "detection/terminalshell/terminalshell.h" @@ -12,6 +12,185 @@ #include #include +typedef struct FFLogoCachedLine { + FFstrbuf chars; + uint32_t width; +} FFLogoCachedLine; + +static void logoLineCacheClear(FFLogoLineCacheState* cache) { + FF_LIST_FOR_EACH (FFLogoCachedLine, line, cache->lines) { + ffStrbufDestroy(&line->chars); + } + ffListDestroy(&cache->lines); + cache->nextLine = 0; + cache->rightOffset = 0; +} + +static void logoLineCachePush(const FFstrbuf* chars, uint32_t width, FFLogoLineCacheState* cache) { + FFLogoCachedLine* line = FF_LIST_ADD(FFLogoCachedLine, cache->lines); + if (width > 0) { + ffStrbufInitCopy(&line->chars, chars); + if (!instance.config.display.pipe) { + ffStrbufAppendS(&line->chars, FASTFETCH_TEXT_MODIFIER_RESET); + } + } else { + ffStrbufInit(&line->chars); + } + line->width = width; +} + +static void logoLineCacheBuild(FFLogoLineCacheState* cache, const char* data, bool doColorReplacement) { + FFOptionsLogo* options = &instance.config.logo; + bool keepCarryColor = options->type != FF_LOGO_TYPE_IMAGE_CHAFA; + + logoLineCacheClear(cache); + + // Overrides the auto detected max-width with the configured width, if set. + // In case we fail to get the actual width of the logo, as we don't use `wcwidth` + uint32_t maxLineWidth = options->width; + uint32_t parsedHeight = 0; + + FF_STRBUF_AUTO_DESTROY carryColor = ffStrbufCreate(); + if (keepCarryColor && doColorReplacement && !instance.config.display.pipe) { + ffStrbufSetF(&carryColor, "\e[%sm", options->colors[0].chars); + } + + for (uint32_t i = 0; i < options->paddingTop; ++i) { + logoLineCachePush(NULL, 0, cache); + } + + if (*data != '\0') { + while (true) { + FF_STRBUF_AUTO_DESTROY line = ffStrbufCreateA(256); + uint32_t lineWidth = 0; + + if (!instance.config.display.pipe && instance.config.display.brightColor) { + ffStrbufAppendS(&line, FASTFETCH_TEXT_MODIFIER_BOLT); + } + + if (keepCarryColor && carryColor.length > 0) { + ffStrbufAppend(&line, &carryColor); + } + + if ((options->position != FF_LOGO_POSITION_RIGHT) && options->paddingLeft > 0) { + ffStrbufAppendNC(&line, options->paddingLeft, ' '); + lineWidth += options->paddingLeft; + } + + while (*data != '\0' && *data != '\n' && !(*data == '\r' && *(data + 1) == '\n')) { + if (*data == '\t') { + ffStrbufAppendNC(&line, 4, ' '); + lineWidth += 4; + ++data; + continue; + } + + if (*data == '\e' && *(data + 1) == '[') { + const char* start = data; + data += 2; + + while (ffCharIsDigit(*data) || *data == ';') { + ++data; + } + + if (isascii(*data)) { + ++data; + + uint32_t escLen = (uint32_t) (data - start); + ffStrbufAppendNS(&line, escLen, start); + + if (keepCarryColor && start[escLen - 1] == 'm') { + ffStrbufSetNS(&carryColor, escLen, start); + } + continue; + } + + lineWidth += (uint32_t) (data - start - 1); + } + + if (doColorReplacement && *data == '$') { + ++data; + + if (*data == '$' || *data == '\0') { + ffStrbufAppendC(&line, '$'); + ++lineWidth; + ++data; + continue; + } + + if (!instance.config.display.pipe) { + int index = *data - '1'; + if (index >= 0 && index < FASTFETCH_LOGO_MAX_COLORS) { + if (keepCarryColor) { + ffStrbufSetF(&carryColor, "\e[%sm", options->colors[index].chars); + ffStrbufAppend(&line, &carryColor); + } else { + ffStrbufAppendF(&line, "\e[%sm", options->colors[index].chars); + } + ++data; + continue; + } + + ffStrbufAppendC(&line, '$'); + ++lineWidth; + } else { + ++data; + continue; + } + } + + uint8_t charWidth; + uint8_t bytes = ffUtf8CharLenWidth(data, UINT32_MAX, &charWidth); + lineWidth += charWidth; + + for (uint8_t i = 0; i < bytes; ++i) { + if (*data == '\0') { + break; + } + + ffStrbufAppendC(&line, *data); + ++data; + } + } + + logoLineCachePush(&line, lineWidth, cache); + if (lineWidth > maxLineWidth) { + maxLineWidth = lineWidth; + } + + if (*data == '\n' || (*data == '\r' && *(data + 1) == '\n')) { + if (*data == '\r') { + ++data; + } + ++data; + ++parsedHeight; + continue; + } + + break; + } + } + + if (options->type != FF_LOGO_TYPE_IMAGE_CHAFA && options->height > parsedHeight) { + parsedHeight = options->height; + } + + instance.state.logoHeight = options->paddingTop + parsedHeight; + if (options->position == FF_LOGO_POSITION_LEFT) { + instance.state.logoWidth = maxLineWidth + options->paddingRight; + } else { + instance.state.logoWidth = 0; + } + + uint32_t totalLines = instance.state.logoHeight + 1; + while (cache->lines.length < totalLines) { + logoLineCachePush(NULL, 0, cache); + } + + cache->nextLine = 0; + cache->rightOffset = maxLineWidth + options->paddingRight - 1; +} + static bool ffLogoPrintCharsRaw(const char* data, size_t length, bool printError) { FFOptionsLogo* options = &instance.config.logo; FF_STRBUF_AUTO_DESTROY buf = ffStrbufCreate(); @@ -85,209 +264,25 @@ static bool ffLogoPrintCharsRaw(const char* data, size_t length, bool printError return true; } -// If result is NULL, calculate logo width -// Returns logo height -static uint32_t logoAppendChars(const char* data, bool doColorReplacement, FFstrbuf* result) { - FFOptionsLogo* options = &instance.config.logo; - uint32_t currentlineLength = options->type == FF_LOGO_TYPE_IMAGE_CHAFA ? 0 : options->width; // For chafa, unit of options->width is pixels - uint32_t logoHeight = 0; - - if (result) { - if (options->position != FF_LOGO_POSITION_RIGHT) { - ffStrbufAppendNC(result, options->paddingLeft, ' '); - } else { - ffStrbufAppendF(result, "\e[9999999C\e[%dD", options->paddingRight + instance.state.logoWidth); - } - } - - while (*data != '\0') { - // We are at the end of a line. Print paddings and update max line length - if (*data == '\n' || (*data == '\r' && *(data + 1) == '\n')) { - // We have \r\n, skip the \r - if (*data == '\r') { - ++data; - } - - if (result) { - ffStrbufAppendC(result, '\n'); - } - ++data; - - if (result) { - if (options->position != FF_LOGO_POSITION_RIGHT) { - ffStrbufAppendNC(result, options->paddingLeft, ' '); - } else { - ffStrbufAppendF(result, "\e[9999999C\e[%dD", options->paddingRight + instance.state.logoWidth); - } - } - - if (currentlineLength > instance.state.logoWidth) { - instance.state.logoWidth = currentlineLength; - } - - currentlineLength = 0; - ++logoHeight; - continue; - } - - // Always print tabs as 4 spaces, to have consistent spacing - if (*data == '\t') { - if (result) { - ffStrbufAppendNC(result, 4, ' '); - } - ++data; - continue; - } - - // We have an escape sequence directly as bytes. We print it, but don't increase the line length - if (*data == '\e' && *(data + 1) == '[') { - const char* start = data; - - if (result) { - ffStrbufAppendS(result, "\e["); - } - data += 2; - - while (ffCharIsDigit(*data) || *data == ';') { - if (result) { - ffStrbufAppendC(result, *data); // number - } - ++data; - } - - // We have a valid control sequence, print it and continue with next char - if (isascii(*data)) { - if (result) { - ffStrbufAppendC(result, *data); // single letter, end of control sequence - } - ++data; - continue; - } - - // Invalid control sequence, try to get most accurate length - currentlineLength += (uint32_t) (data - start - 1); //-1 for \033 which for sure doesn't take any space - - // Don't continue here, print the char after the letters with the unicode printing - } - - // We have a fastfetch color placeholder. Replace it with the esacape sequence, don't increase the line length - if (doColorReplacement && *data == '$') { - ++data; - - // If we have $$, or $\0, print it as single $ - if (*data == '$' || *data == '\0') { - if (result) { - ffStrbufAppendC(result, '$'); - } - ++currentlineLength; - ++data; - continue; - } - - if (!instance.config.display.pipe) { - // Map the number to an array index, so that '1' -> 0, '2' -> 1, etc. - int index = *data - '1'; - - // If the index is valid, print the color. Otherwise continue as normal - if (index < 0 || index >= FASTFETCH_LOGO_MAX_COLORS) { - if (result) { - ffStrbufAppendC(result, '$'); - } - ++currentlineLength; - // Don't continue here, we want to print the current char as unicode - } else { - if (result) { - ffStrbufAppendF(result, "\e[%sm", options->colors[index].chars); - } - ++data; - continue; - } - } else { - ++data; - continue; - } - } - - // Do the printing, respecting unicode - - ++currentlineLength; - - int codepoint = (unsigned char) *data; - uint8_t bytes; - - if (codepoint <= 127) { - bytes = 1; - } else if ((codepoint & 0xE0) == 0xC0) { - bytes = 2; - } else if ((codepoint & 0xF0) == 0xE0) { - bytes = 3; - } else if ((codepoint & 0xF8) == 0xF0) { - bytes = 4; - } else { - bytes = 1; // Invalid utf8, print it as is, byte by byte - } - - for (uint8_t i = 0; i < bytes; ++i) { - if (*data == '\0') { - break; - } - - if (result) { - ffStrbufAppendC(result, *data); - } - ++data; - } - } - // Happens if the last line is the longest - if (currentlineLength > instance.state.logoWidth) { - instance.state.logoWidth = currentlineLength; - } - - return options->type != FF_LOGO_TYPE_IMAGE_CHAFA && options->height > logoHeight ? options->height : logoHeight; -} - void ffLogoPrintChars(const char* data, bool doColorReplacement) { FFOptionsLogo* options = &instance.config.logo; + FFLogoLineCacheState* cache = &instance.state.logoLineCache; - if (options->position == FF_LOGO_POSITION_RIGHT) { - logoAppendChars(data, doColorReplacement, NULL); - } - - FF_STRBUF_AUTO_DESTROY result = ffStrbufCreateA(2048); + logoLineCacheBuild(cache, data, doColorReplacement); - if (!instance.config.display.pipe && instance.config.display.brightColor) { - ffStrbufAppendS(&result, FASTFETCH_TEXT_MODIFIER_BOLT); - } - - ffStrbufAppendNC(&result, options->paddingTop, '\n'); - - // Use logoColor[0] as the default color - if (doColorReplacement && !instance.config.display.pipe) { - ffStrbufAppendF(&result, "\e[%sm", options->colors[0].chars); - } - - instance.state.logoHeight = options->paddingTop + logoAppendChars(data, doColorReplacement, &result); - - if (!instance.config.display.pipe) { - ffStrbufAppendS(&result, FASTFETCH_TEXT_MODIFIER_RESET); + if (options->position != FF_LOGO_POSITION_TOP) { + return; } - if (options->position == FF_LOGO_POSITION_LEFT) { - instance.state.logoWidth += options->paddingLeft + options->paddingRight; - - // Go to the leftmost position and go up the height - ffStrbufAppendF(&result, "\e[1G\e[%uA", instance.state.logoHeight); - } else if (options->position == FF_LOGO_POSITION_RIGHT) { - instance.state.logoWidth = 0; - - // Go to the leftmost position and go up the height - ffStrbufAppendF(&result, "\e[1G\e[%uA", instance.state.logoHeight); - } else if (options->position == FF_LOGO_POSITION_TOP) { - instance.state.logoWidth = instance.state.logoHeight = 0; - ffStrbufAppendNC(&result, options->paddingRight, '\n'); + FF_STRBUF_AUTO_DESTROY result = ffStrbufCreateA(4096); + FF_LIST_FOR_EACH (FFLogoCachedLine, line, cache->lines) { + ffStrbufAppend(&result, &line->chars); + ffStrbufAppendC(&result, '\n'); } - + ffStrbufAppendNC(&result, options->paddingBottom, '\n'); ffWriteFDBuffer(FFUnixFD2NativeFD(STDOUT_FILENO), &result); + instance.state.logoWidth = instance.state.logoHeight = 0; + logoLineCacheClear(cache); } static void logoApplyColors(const FFlogo* logo, bool replacement) { @@ -441,7 +436,7 @@ static bool logoPrintBuiltinIfExists(const FFstrbuf* name, FFLogoSize size) { return true; } -static inline void logoPrintDetected(FFLogoSize size) { +void ffLogoPrintDetected(FFLogoSize size) { logoPrintStruct(logoGetBuiltinDetected(size)); } @@ -466,6 +461,7 @@ static bool updateLogoPath(void) { return true; } + #if !FF_MODULE_DISABLE_MEDIA if (ffStrbufIgnCaseEqualS(&options->source, "media-cover")) { const FFMediaResult* media = ffDetectMedia(true); if (media->cover.length == 0) { @@ -474,6 +470,7 @@ static bool updateLogoPath(void) { ffStrbufSet(&options->source, &media->cover); return true; } + #endif FF_STRBUF_AUTO_DESTROY fullPath = ffStrbufCreateA(128); if (ffPathExpandEnv(options->source.chars, &fullPath) && ffPathExists(fullPath.chars, FF_PATHTYPE_FILE)) { @@ -557,7 +554,7 @@ static bool logoTryKnownType(void) { if (options->type == FF_LOGO_TYPE_COMMAND_RAW) { FF_STRBUF_AUTO_DESTROY source = ffStrbufCreate(); - const char* error = ffProcessAppendStdOut(&source, (char* const[]) { + const char* error = ffProcessAppendStdOut(&source, (char* const[]){ #ifdef _WIN32 "cmd.exe", "/c", #else @@ -609,7 +606,7 @@ void ffLogoPrint(void) { // If the source is not set, we can directly print the detected logo. if (options->source.length == 0) { - logoPrintDetected(options->type == FF_LOGO_TYPE_SMALL ? FF_LOGO_SIZE_SMALL : FF_LOGO_SIZE_NORMAL); + ffLogoPrintDetected(options->type == FF_LOGO_TYPE_SMALL ? FF_LOGO_SIZE_SMALL : FF_LOGO_SIZE_NORMAL); return; } @@ -623,7 +620,7 @@ void ffLogoPrint(void) { } } - logoPrintDetected(FF_LOGO_SIZE_UNKNOWN); + ffLogoPrintDetected(FF_LOGO_SIZE_UNKNOWN); } return; } @@ -642,6 +639,7 @@ void ffLogoPrint(void) { } if (!ffStrbufEndsWithIgnCaseS(&options->source, ".txt")) { + #if !FF_MODULE_DISABLE_TERMINAL const FFTerminalResult* terminal = ffDetectTerminal(); bool supportsIterm2 = ffStrbufEqualS(&terminal->prettyName, "iTerm"); @@ -663,6 +661,9 @@ void ffLogoPrint(void) { ffStrbufIgnCaseEqualS(&terminal->processName, "warp") || #endif false; + #else + bool supportsKitty = false; + #endif // Try to load the logo as an image. If it succeeds, print it and return. if (logoPrintImageIfExists(supportsKitty ? FF_LOGO_TYPE_IMAGE_KITTY : FF_LOGO_TYPE_IMAGE_CHAFA, false)) { @@ -680,12 +681,37 @@ void ffLogoPrint(void) { } } - logoPrintDetected(FF_LOGO_SIZE_UNKNOWN); + ffLogoPrintDetected(FF_LOGO_SIZE_UNKNOWN); } void ffLogoPrintLine(void) { + uint32_t printedLineWidth = 0; + FFLogoLineCacheState* cache = &instance.state.logoLineCache; + FFOptionsLogo* logo = &instance.config.logo; + + if (cache->lines.length > 0 && (logo->position == FF_LOGO_POSITION_LEFT || logo->position == FF_LOGO_POSITION_RIGHT) && cache->nextLine < cache->lines.length) { + FFLogoCachedLine* line = FF_LIST_GET(FFLogoCachedLine, cache->lines, cache->nextLine); + + if (logo->position == FF_LOGO_POSITION_RIGHT && line->chars.length > 0) { + printf("\033[9999999C\033[%uD", cache->rightOffset); + ffStrbufWriteTo(&line->chars, stdout); + fputs("\033[G", stdout); + } else { + ffStrbufWriteTo(&line->chars, stdout); + printedLineWidth = line->width; + } + + ++cache->nextLine; + } + if (instance.state.logoWidth > 0) { - printf("\033[%uC", instance.state.logoWidth); + if (instance.config.logo.position == FF_LOGO_POSITION_LEFT) { + uint32_t remaining = instance.state.logoWidth; + remaining = printedLineWidth < remaining ? remaining - printedLineWidth : 0; + ffPrintCharTimes(' ', remaining); + } else { + printf("\033[%uC", instance.state.logoWidth); + } } if (instance.state.dynamicInterval > 0) { @@ -696,6 +722,30 @@ void ffLogoPrintLine(void) { } void ffLogoPrintRemaining(void) { + FFLogoLineCacheState* cache = &instance.state.logoLineCache; + FFOptionsLogo* logo = &instance.config.logo; + + if (cache->lines.length > 0 && (logo->position == FF_LOGO_POSITION_LEFT || logo->position == FF_LOGO_POSITION_RIGHT)) { + while (cache->nextLine < cache->lines.length) { + FFLogoCachedLine* line = FF_LIST_GET(FFLogoCachedLine, cache->lines, cache->nextLine); + + if (logo->position == FF_LOGO_POSITION_RIGHT) { + printf("\033[9999999C\033[%uD", cache->rightOffset); + } + ffStrbufPutTo(&line->chars, stdout); + + ++cache->nextLine; + } + + if (!instance.config.display.pipe) { + fputs(FASTFETCH_TEXT_MODIFIER_RESET, stdout); + } + + instance.state.keysHeight = instance.state.logoHeight + 1; + logoLineCacheClear(cache); + return; + } + if (instance.state.keysHeight <= instance.state.logoHeight) { ffPrintCharTimes('\n', instance.state.logoHeight - instance.state.keysHeight + 1); } diff --git a/src/logo/logo.h b/src/logo/logo.h index 94c9c59e6f..105b96499f 100644 --- a/src/logo/logo.h +++ b/src/logo/logo.h @@ -32,6 +32,7 @@ void ffLogoPrintRemaining(void); void ffLogoBuiltinPrint(void); void ffLogoBuiltinList(void); void ffLogoBuiltinListAutocompletion(void); +void ffLogoPrintDetected(FFLogoSize size); const FFlogo* ffLogoGetBuiltinForName(const FFstrbuf* name, FFLogoSize size); const FFlogo* ffLogoGetBuiltinDetected(FFLogoSize size); diff --git a/src/modules/battery/battery.c b/src/modules/battery/battery.c index f59375c9c7..61cef84bb4 100644 --- a/src/modules/battery/battery.c +++ b/src/modules/battery/battery.c @@ -3,7 +3,7 @@ #include "common/percent.h" #include "common/duration.h" #include "common/temps.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include "detection/battery/battery.h" #include "modules/battery/battery.h" diff --git a/src/modules/bios/bios.c b/src/modules/bios/bios.c index 34ba73840d..8f8700ff1b 100644 --- a/src/modules/bios/bios.c +++ b/src/modules/bios/bios.c @@ -1,6 +1,6 @@ #include "common/printing.h" #include "common/jsonconfig.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include "detection/bios/bios.h" #include "modules/bios/bios.h" diff --git a/src/modules/bluetooth/bluetooth.c b/src/modules/bluetooth/bluetooth.c index b771c30956..641acebdc6 100644 --- a/src/modules/bluetooth/bluetooth.c +++ b/src/modules/bluetooth/bluetooth.c @@ -1,7 +1,7 @@ #include "common/percent.h" #include "common/printing.h" #include "common/jsonconfig.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include "detection/bluetooth/bluetooth.h" #include "modules/bluetooth/bluetooth.h" diff --git a/src/modules/bluetoothradio/bluetoothradio.c b/src/modules/bluetoothradio/bluetoothradio.c index d3b9f17453..713931ab9e 100644 --- a/src/modules/bluetoothradio/bluetoothradio.c +++ b/src/modules/bluetoothradio/bluetoothradio.c @@ -1,7 +1,7 @@ #include "common/percent.h" #include "common/printing.h" #include "common/jsonconfig.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include "detection/bluetoothradio/bluetoothradio.h" #include "modules/bluetoothradio/bluetoothradio.h" diff --git a/src/modules/board/board.c b/src/modules/board/board.c index 3723ad7a83..a0801a2747 100644 --- a/src/modules/board/board.c +++ b/src/modules/board/board.c @@ -1,6 +1,6 @@ #include "common/printing.h" #include "common/jsonconfig.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include "detection/board/board.h" #include "modules/board/board.h" diff --git a/src/modules/bootmgr/bootmgr.c b/src/modules/bootmgr/bootmgr.c index b5fcfcc203..f44d67a8d0 100644 --- a/src/modules/bootmgr/bootmgr.c +++ b/src/modules/bootmgr/bootmgr.c @@ -1,6 +1,6 @@ #include "common/printing.h" #include "common/jsonconfig.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include "detection/bootmgr/bootmgr.h" #include "modules/bootmgr/bootmgr.h" diff --git a/src/modules/brightness/brightness.c b/src/modules/brightness/brightness.c index 0da4c8d2b6..54bb989401 100644 --- a/src/modules/brightness/brightness.c +++ b/src/modules/brightness/brightness.c @@ -1,7 +1,7 @@ #include "common/percent.h" #include "common/printing.h" #include "common/jsonconfig.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include "detection/brightness/brightness.h" #include "modules/brightness/brightness.h" @@ -113,7 +113,11 @@ void ffParseBrightnessJsonObject(FFBrightnessOptions* options, yyjson_val* modul } if (unsafe_yyjson_equals_str(key, "ddcciSleep")) { - options->ddcciSleep = (uint32_t) yyjson_get_uint(val); + if (yyjson_is_null(val)) { + options->ddcciSleep = FF_BRIGHTNESS_DDCCI_SLEEP_SKIP; + } else { + options->ddcciSleep = (uint32_t) yyjson_get_uint(val); + } continue; } @@ -133,7 +137,11 @@ void ffParseBrightnessJsonObject(FFBrightnessOptions* options, yyjson_val* modul void ffGenerateBrightnessJsonConfig(FFBrightnessOptions* options, yyjson_mut_doc* doc, yyjson_mut_val* module) { ffJsonConfigGenerateModuleArgsConfig(doc, module, &options->moduleArgs); - yyjson_mut_obj_add_uint(doc, module, "ddcciSleep", options->ddcciSleep); + if (options->ddcciSleep == FF_BRIGHTNESS_DDCCI_SLEEP_SKIP) { + yyjson_mut_obj_add_null(doc, module, "ddcciSleep"); + } else { + yyjson_mut_obj_add_uint(doc, module, "ddcciSleep", options->ddcciSleep); + } ffPercentGenerateJsonConfig(doc, module, options->percent); diff --git a/src/modules/btrfs/btrfs.c b/src/modules/btrfs/btrfs.c index 30cadd346e..238d177674 100644 --- a/src/modules/btrfs/btrfs.c +++ b/src/modules/btrfs/btrfs.c @@ -2,7 +2,7 @@ #include "common/jsonconfig.h" #include "common/percent.h" #include "common/size.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include "detection/btrfs/btrfs.h" #include "modules/btrfs/btrfs.h" diff --git a/src/modules/camera/camera.c b/src/modules/camera/camera.c index fbabfa3293..7067bbc2fe 100644 --- a/src/modules/camera/camera.c +++ b/src/modules/camera/camera.c @@ -1,6 +1,6 @@ #include "common/printing.h" #include "common/jsonconfig.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include "detection/libc/libc.h" #include "detection/camera/camera.h" #include "modules/camera/camera.h" diff --git a/src/modules/chassis/chassis.c b/src/modules/chassis/chassis.c index fc00dd9444..d944baa443 100644 --- a/src/modules/chassis/chassis.c +++ b/src/modules/chassis/chassis.c @@ -1,6 +1,6 @@ #include "common/printing.h" #include "common/jsonconfig.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include "detection/chassis/chassis.h" #include "modules/chassis/chassis.h" diff --git a/src/modules/codec/codec.c b/src/modules/codec/codec.c new file mode 100644 index 0000000000..640d3e665b --- /dev/null +++ b/src/modules/codec/codec.c @@ -0,0 +1,270 @@ +#include "common/printing.h" +#include "common/jsonconfig.h" +#include "detection/codec/codec.h" +#include "modules/codec/codec.h" + +static const char* ffCodecTypeToString(FFCodecType type) { + switch (type) { + case FF_CODEC_TYPE_H261: + return "H.261"; + case FF_CODEC_TYPE_H263: + return "H.263"; + case FF_CODEC_TYPE_MJPEG: + return "MJPEG"; + case FF_CODEC_TYPE_MPEG1: + return "MPEG-1"; + case FF_CODEC_TYPE_MPEG2: + return "MPEG-2"; + case FF_CODEC_TYPE_DIVX_XVID: + return "DivX / Xvid"; + case FF_CODEC_TYPE_H264: + return "H.264"; + case FF_CODEC_TYPE_WMV8: + return "WMV-8"; + case FF_CODEC_TYPE_WMV9: + return "WMV-9"; + case FF_CODEC_TYPE_VC1: + return "VC-1"; + case FF_CODEC_TYPE_VP8: + return "VP8"; + case FF_CODEC_TYPE_HEVC: + return "HEVC / H.265"; + case FF_CODEC_TYPE_VP9: + return "VP9"; + case FF_CODEC_TYPE_AV1: + return "AV1"; + case FF_CODEC_TYPE_VVC: + return "VVC / H.266"; + case FF_CODEC_TYPE_DOLBY_VISION_HEVC: + return "Dolby Vision (HEVC)"; + case FF_CODEC_TYPE_PRORES: + return "Apple ProRes"; + case FF_CODEC_TYPE_PRORES_RAW: + return "Apple ProRes RAW"; + case FF_CODEC_TYPE_JPEG_XL: + return "JPEG XL"; + case FF_CODEC_TYPE_UNKNOWN: + default: + return "Unknown"; + } +} + +static void printCodecLine(const FFCodecOptions* options, uint8_t index, FFstrbuf* gpu, const char* direction, FFCodecType types, const char* platformApi) { + FF_STRBUF_AUTO_DESTROY key = ffStrbufCreate(); + if (options->moduleArgs.key.length == 0) { + if (gpu->length > 0) { + ffStrbufSetF(&key, "%s (%s - %s)", FF_CODEC_MODULE_NAME, direction, gpu->chars); + } else { + ffStrbufSetF(&key, "%s (%s)", FF_CODEC_MODULE_NAME, direction); + } + } else { + FF_PARSE_FORMAT_STRING_CHECKED(&key, &options->moduleArgs.key, ((FFformatarg[]){ + FF_ARG(index, "index"), + FF_ARG(*gpu, "gpu"), + FF_ARG(direction, "direction"), + FF_ARG(options->moduleArgs.keyIcon, "icon"), + })); + } + + if (options->moduleArgs.outputFormat.length == 0) { + FF_STRBUF_AUTO_DESTROY typesJoined = ffStrbufCreate(); + for (FFCodecType type = FF_CODEC_TYPE_H261; type <= FF_CODEC_TYPE_MAX; type <<= 1) { + if ((types & type) == 0) { + continue; + } + if (typesJoined.length > 0) { + ffStrbufAppendS(&typesJoined, ", "); + } + ffStrbufAppendS(&typesJoined, ffCodecTypeToString(type)); + } + ffPrintLogoAndKey(key.chars, 0, &options->moduleArgs, FF_PRINT_TYPE_NO_CUSTOM_KEY); + puts(typesJoined.length ? typesJoined.chars : "None"); + } else { + FF_LIST_AUTO_DESTROY typeList = ffListCreate(); // Use list instead of pre-joined string for qjs and lua + for (FFCodecType type = FF_CODEC_TYPE_H261; type <= FF_CODEC_TYPE_MAX; type <<= 1) { + if ((types & type) == 0) { + continue; + } + ffStrbufInitStatic(FF_LIST_ADD(FFstrbuf, typeList), ffCodecTypeToString(type)); + } + FF_PRINT_FORMAT_CHECKED(key.chars, 0, &options->moduleArgs, FF_PRINT_TYPE_NO_CUSTOM_KEY, ((FFformatarg[]){ + FF_ARG(*gpu, "gpu"), + FF_ARG(direction, "direction"), + FF_ARG(typeList, "types"), + FF_ARG(platformApi, "platform-api"), + })); + // No need to destroy strings in lists, as they are static strings + } +} + +bool ffPrintCodec(FFCodecOptions* options) { + FF_LIST_AUTO_DESTROY result = ffListCreate(); + const char* error = ffDetectCodec(options, &result); + + if (error) { + ffPrintError(FF_CODEC_MODULE_NAME, 0, &options->moduleArgs, FF_PRINT_TYPE_DEFAULT, "%s", error); + return false; + } + + if (result.length == 0) { + ffPrintError(FF_CODEC_MODULE_NAME, 0, &options->moduleArgs, FF_PRINT_TYPE_DEFAULT, "No hardware video acceleration found"); + return false; + } + + FF_STRBUF_AUTO_DESTROY key = ffStrbufCreate(); + if (options->splitGPU) { + for (uint32_t i = 0; i < result.length; ++i) { + FFCodecResult* item = FF_LIST_GET(FFCodecResult, result, i); + uint8_t index = (uint8_t) (result.length == 1 ? 0 : i + 1); + if (options->showType & FF_CODEC_SHOW_TYPE_ENCODER) { + printCodecLine(options, index, &item->gpu, "Encoder", item->encoders, item->platformApi); + } + if (options->showType & FF_CODEC_SHOW_TYPE_DECODER) { + printCodecLine(options, index, &item->gpu, "Decoder", item->decoders, item->platformApi); + } + } + } else { + FFCodecResult merged = { + .gpu = ffStrbufCreate(), + .decoders = FF_CODEC_TYPE_NONE, + .encoders = FF_CODEC_TYPE_NONE, + }; + + FF_LIST_FOR_EACH (FFCodecResult, item, result) { + merged.decoders |= item->decoders; + merged.encoders |= item->encoders; + merged.platformApi = item->platformApi; + } + if (options->showType & FF_CODEC_SHOW_TYPE_ENCODER) { + printCodecLine(options, 0, &merged.gpu, "Encoder", merged.encoders, merged.platformApi); + } + if (options->showType & FF_CODEC_SHOW_TYPE_DECODER) { + printCodecLine(options, 0, &merged.gpu, "Decoder", merged.decoders, merged.platformApi); + } + } + + FF_LIST_FOR_EACH (FFCodecResult, item, result) { + ffStrbufDestroy(&item->gpu); + } + return true; +} + +void ffParseCodecJsonObject(FFCodecOptions* options, yyjson_val* module) { + yyjson_val *key, *val; + size_t idx, max; + yyjson_obj_foreach (module, idx, max, key, val) { + if (ffJsonConfigParseModuleArgs(key, val, &options->moduleArgs)) { + continue; + } + + if (unsafe_yyjson_equals_str(key, "splitGPU")) { + options->splitGPU = yyjson_get_bool(val); + continue; + } + + if (unsafe_yyjson_equals_str(key, "useVulkan")) { + options->useVulkan = yyjson_get_bool(val); + continue; + } + + if (unsafe_yyjson_equals_str(key, "showType")) { + int value; + const char* error = ffJsonConfigParseEnum(val, &value, (FFKeyValuePair[]){ + { "encoder", FF_CODEC_SHOW_TYPE_ENCODER }, + { "decoder", FF_CODEC_SHOW_TYPE_DECODER }, + { "both", FF_CODEC_SHOW_TYPE_BOTH }, + {}, + }); + if (error) { + ffPrintError(FF_CODEC_MODULE_NAME, 0, NULL, FF_PRINT_TYPE_NO_CUSTOM_KEY, "Invalid %s value: %s", unsafe_yyjson_get_str(key), error); + } else { + options->showType = (FFCodecShowType) value; + } + continue; + } + + ffPrintError(FF_CODEC_MODULE_NAME, 0, &options->moduleArgs, FF_PRINT_TYPE_DEFAULT, "Unknown JSON key %s", unsafe_yyjson_get_str(key)); + } +} + +void ffGenerateCodecJsonConfig(FFCodecOptions* options, yyjson_mut_doc* doc, yyjson_mut_val* module) { + ffJsonConfigGenerateModuleArgsConfig(doc, module, &options->moduleArgs); + yyjson_mut_obj_add_bool(doc, module, "splitGPU", options->splitGPU); + yyjson_mut_obj_add_bool(doc, module, "useVulkan", options->useVulkan); + switch (options->showType) { + case FF_CODEC_SHOW_TYPE_ENCODER: + yyjson_mut_obj_add_str(doc, module, "showType", "encoder"); + break; + case FF_CODEC_SHOW_TYPE_DECODER: + yyjson_mut_obj_add_str(doc, module, "showType", "decoder"); + break; + case FF_CODEC_SHOW_TYPE_BOTH: + yyjson_mut_obj_add_str(doc, module, "showType", "both"); + break; + default: + break; + } +} + +bool ffGenerateCodecJsonResult(FFCodecOptions* options, yyjson_mut_doc* doc, yyjson_mut_val* module) { + FF_LIST_AUTO_DESTROY result = ffListCreate(); + const char* error = ffDetectCodec(options, &result); + + if (error) { + yyjson_mut_obj_add_str(doc, module, "error", error); + return false; + } + + yyjson_mut_val* arr = yyjson_mut_obj_add_arr(doc, module, "result"); + + FF_LIST_FOR_EACH (FFCodecResult, item, result) { + yyjson_mut_val* obj = yyjson_mut_arr_add_obj(doc, arr); + yyjson_mut_obj_add_strbuf(doc, obj, "gpu", &item->gpu); + + yyjson_mut_val* encoders = yyjson_mut_obj_add_arr(doc, obj, "encoders"); + yyjson_mut_val* decoders = yyjson_mut_obj_add_arr(doc, obj, "decoders"); + + for (FFCodecType type = FF_CODEC_TYPE_UNKNOWN; type <= FF_CODEC_TYPE_MAX; type <<= 1) { + if (item->encoders & type) { + yyjson_mut_arr_add_str(doc, encoders, ffCodecTypeToString(type)); + } + if (item->decoders & type) { + yyjson_mut_arr_add_str(doc, decoders, ffCodecTypeToString(type)); + } + } + yyjson_mut_obj_add_str(doc, obj, "platformApi", item->platformApi); + } + + FF_LIST_FOR_EACH (FFCodecResult, item, result) { + ffStrbufDestroy(&item->gpu); + } + return true; +} + +void ffInitCodecOptions(FFCodecOptions* options) { + ffOptionInitModuleArg(&options->moduleArgs, "󰈫"); + options->splitGPU = false; + options->useVulkan = false; + options->showType = FF_CODEC_SHOW_TYPE_BOTH; +} + +void ffDestroyCodecOptions(FFCodecOptions* options) { + ffOptionDestroyModuleArg(&options->moduleArgs); +} + +FFModuleBaseInfo ffCodecModuleInfo = { + .name = FF_CODEC_MODULE_NAME, + .description = "Print hardware video acceleration codec types (decode / encode)", + .initOptions = (void*) ffInitCodecOptions, + .destroyOptions = (void*) ffDestroyCodecOptions, + .parseJsonObject = (void*) ffParseCodecJsonObject, + .printModule = (void*) ffPrintCodec, + .generateJsonResult = (void*) ffGenerateCodecJsonResult, + .generateJsonConfig = (void*) ffGenerateCodecJsonConfig, + .formatArgs = FF_FORMAT_ARG_LIST(((FFModuleFormatArg[]){ + { "GPU name", "gpu" }, + { "Decoder / Encoder", "direction" }, + { "Compatibility alias of codec types", "types" }, + { "Platform API used for detection", "platform-api" }, + })) +}; diff --git a/src/modules/codec/codec.h b/src/modules/codec/codec.h new file mode 100644 index 0000000000..efd3d7c018 --- /dev/null +++ b/src/modules/codec/codec.h @@ -0,0 +1,11 @@ +#pragma once + +#include "option.h" + +#define FF_CODEC_MODULE_NAME "Codec" + +bool ffPrintCodec(FFCodecOptions* options); +void ffInitCodecOptions(FFCodecOptions* options); +void ffDestroyCodecOptions(FFCodecOptions* options); + +extern FFModuleBaseInfo ffCodecModuleInfo; diff --git a/src/modules/codec/option.h b/src/modules/codec/option.h new file mode 100644 index 0000000000..bcc9201274 --- /dev/null +++ b/src/modules/codec/option.h @@ -0,0 +1,20 @@ +#pragma once + +#include "common/option.h" + +typedef enum FF_A_PACKED FFCodecShowType { + FF_CODEC_SHOW_TYPE_NONE = 0, + FF_CODEC_SHOW_TYPE_ENCODER = 1 << 0, + FF_CODEC_SHOW_TYPE_DECODER = 1 << 1, + FF_CODEC_SHOW_TYPE_BOTH = FF_CODEC_SHOW_TYPE_ENCODER | FF_CODEC_SHOW_TYPE_DECODER, + FF_CODEC_SHOW_TYPE_FORCE_UNSIGNED = UINT8_MAX, +} FFCodecShowType; + +typedef struct FFCodecOptions { + FFModuleArgs moduleArgs; + bool splitGPU; + bool useVulkan; + FFCodecShowType showType; +} FFCodecOptions; + +static_assert(sizeof(FFCodecOptions) <= FF_OPTION_MAX_SIZE, "FFCodecOptions size exceeds maximum allowed size"); diff --git a/src/modules/colors/colors.c b/src/modules/colors/colors.c index 168fc0fe7d..ff821d12f6 100644 --- a/src/modules/colors/colors.c +++ b/src/modules/colors/colors.c @@ -2,7 +2,7 @@ #include "common/jsonconfig.h" #include "common/textModifier.h" #include "common/color.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include "logo/logo.h" #include "modules/colors/colors.h" diff --git a/src/modules/cpucache/cpucache.c b/src/modules/cpucache/cpucache.c index 0224a21e71..7263a51604 100644 --- a/src/modules/cpucache/cpucache.c +++ b/src/modules/cpucache/cpucache.c @@ -1,7 +1,7 @@ #include "common/printing.h" #include "common/jsonconfig.h" #include "common/size.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include "detection/cpucache/cpucache.h" #include "modules/cpucache/cpucache.h" diff --git a/src/modules/cpuusage/cpuusage.c b/src/modules/cpuusage/cpuusage.c index 83ea0887a9..5c01e914ac 100644 --- a/src/modules/cpuusage/cpuusage.c +++ b/src/modules/cpuusage/cpuusage.c @@ -1,7 +1,7 @@ #include "common/printing.h" #include "common/jsonconfig.h" #include "common/percent.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include "detection/cpuusage/cpuusage.h" #include "modules/cpuusage/cpuusage.h" diff --git a/src/modules/cursor/cursor.c b/src/modules/cursor/cursor.c index e99a9b6121..0b6f6c7358 100644 --- a/src/modules/cursor/cursor.c +++ b/src/modules/cursor/cursor.c @@ -1,6 +1,6 @@ #include "common/printing.h" #include "common/jsonconfig.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include "detection/cursor/cursor.h" #include "modules/cursor/cursor.h" diff --git a/src/modules/custom/custom.c b/src/modules/custom/custom.c index 0369215531..054f3704ca 100644 --- a/src/modules/custom/custom.c +++ b/src/modules/custom/custom.c @@ -1,7 +1,7 @@ #include "common/printing.h" #include "common/jsonconfig.h" #include "common/textModifier.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include "modules/custom/custom.h" bool ffPrintCustom(FFCustomOptions* options) { diff --git a/src/modules/datetime/datetime.c b/src/modules/datetime/datetime.c index be1188a103..e902fff42d 100644 --- a/src/modules/datetime/datetime.c +++ b/src/modules/datetime/datetime.c @@ -1,7 +1,7 @@ #include "common/time.h" #include "common/printing.h" #include "common/jsonconfig.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include "modules/datetime/datetime.h" #include diff --git a/src/modules/de/de.c b/src/modules/de/de.c index e3b50ac815..d66d205281 100644 --- a/src/modules/de/de.c +++ b/src/modules/de/de.c @@ -1,6 +1,6 @@ #include "common/printing.h" #include "common/jsonconfig.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include "detection/displayserver/displayserver.h" #include "detection/de/de.h" #include "modules/de/de.h" diff --git a/src/modules/diskio/diskio.c b/src/modules/diskio/diskio.c index f008db01a9..3ff31fad4f 100644 --- a/src/modules/diskio/diskio.c +++ b/src/modules/diskio/diskio.c @@ -1,7 +1,7 @@ #include "common/printing.h" #include "common/jsonconfig.h" #include "common/size.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include "detection/diskio/diskio.h" #include "modules/diskio/diskio.h" diff --git a/src/modules/display/display.c b/src/modules/display/display.c index 07b5356ba8..b11a2aabc2 100644 --- a/src/modules/display/display.c +++ b/src/modules/display/display.c @@ -1,7 +1,7 @@ #include "common/printing.h" #include "common/jsonconfig.h" #include "common/size.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include "detection/displayserver/displayserver.h" #include "modules/display/display.h" diff --git a/src/modules/dns/dns.c b/src/modules/dns/dns.c index 7612fcac9b..d7c90c4d80 100644 --- a/src/modules/dns/dns.c +++ b/src/modules/dns/dns.c @@ -1,6 +1,6 @@ #include "common/printing.h" #include "common/jsonconfig.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include "detection/dns/dns.h" #include "modules/dns/dns.h" diff --git a/src/modules/editor/editor.c b/src/modules/editor/editor.c index 1e0c20c32d..23b19372a1 100644 --- a/src/modules/editor/editor.c +++ b/src/modules/editor/editor.c @@ -1,6 +1,6 @@ #include "common/printing.h" #include "common/jsonconfig.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include "detection/libc/libc.h" #include "detection/editor/editor.h" #include "modules/editor/editor.h" diff --git a/src/modules/font/font.c b/src/modules/font/font.c index 6994c693ec..a32a7e80c2 100644 --- a/src/modules/font/font.c +++ b/src/modules/font/font.c @@ -1,6 +1,6 @@ #include "common/printing.h" #include "common/jsonconfig.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include "detection/font/font.h" #include "modules/font/font.h" diff --git a/src/modules/gamepad/gamepad.c b/src/modules/gamepad/gamepad.c index a9e1d2035a..d34dcca85a 100644 --- a/src/modules/gamepad/gamepad.c +++ b/src/modules/gamepad/gamepad.c @@ -1,7 +1,7 @@ #include "common/percent.h" #include "common/printing.h" #include "common/jsonconfig.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include "detection/gamepad/gamepad.h" #include "modules/gamepad/gamepad.h" diff --git a/src/modules/gpu/gpu.c b/src/modules/gpu/gpu.c index 64705926b7..b0ace20006 100644 --- a/src/modules/gpu/gpu.c +++ b/src/modules/gpu/gpu.c @@ -4,7 +4,7 @@ #include "common/temps.h" #include "common/size.h" #include "common/frequency.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include "detection/host/host.h" #include "detection/gpu/gpu.h" #include "modules/gpu/gpu.h" diff --git a/src/modules/host/host.c b/src/modules/host/host.c index b22673a123..2a53cd398b 100644 --- a/src/modules/host/host.c +++ b/src/modules/host/host.c @@ -1,6 +1,6 @@ #include "common/printing.h" #include "common/jsonconfig.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include "detection/host/host.h" #include "modules/host/host.h" diff --git a/src/modules/icons/icons.c b/src/modules/icons/icons.c index af73954f92..d3764ad079 100644 --- a/src/modules/icons/icons.c +++ b/src/modules/icons/icons.c @@ -1,6 +1,6 @@ #include "common/printing.h" #include "common/jsonconfig.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include "detection/icons/icons.h" #include "modules/icons/icons.h" diff --git a/src/modules/initsystem/initsystem.c b/src/modules/initsystem/initsystem.c index 957dafeda3..3c3f3677e9 100644 --- a/src/modules/initsystem/initsystem.c +++ b/src/modules/initsystem/initsystem.c @@ -1,6 +1,6 @@ #include "common/printing.h" #include "common/jsonconfig.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include "detection/initsystem/initsystem.h" #include "modules/initsystem/initsystem.h" diff --git a/src/modules/kernel/kernel.c b/src/modules/kernel/kernel.c index 102c454692..c405cbfa4b 100644 --- a/src/modules/kernel/kernel.c +++ b/src/modules/kernel/kernel.c @@ -1,7 +1,7 @@ #include "common/printing.h" #include "common/jsonconfig.h" #include "common/size.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include "modules/kernel/kernel.h" bool ffPrintKernel(FFKernelOptions* options) { diff --git a/src/modules/keyboard/keyboard.c b/src/modules/keyboard/keyboard.c index b28e8d6880..09c3cd5a37 100644 --- a/src/modules/keyboard/keyboard.c +++ b/src/modules/keyboard/keyboard.c @@ -1,7 +1,7 @@ #include "common/percent.h" #include "common/printing.h" #include "common/jsonconfig.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include "detection/keyboard/keyboard.h" #include "modules/keyboard/keyboard.h" diff --git a/src/modules/lm/lm.c b/src/modules/lm/lm.c index 40f2522212..a1317d2852 100644 --- a/src/modules/lm/lm.c +++ b/src/modules/lm/lm.c @@ -1,6 +1,6 @@ #include "common/printing.h" #include "common/jsonconfig.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include "detection/lm/lm.h" #include "modules/lm/lm.h" diff --git a/src/modules/loadavg/loadavg.c b/src/modules/loadavg/loadavg.c index d384eaaf24..32ced1261a 100644 --- a/src/modules/loadavg/loadavg.c +++ b/src/modules/loadavg/loadavg.c @@ -1,7 +1,7 @@ #include "common/printing.h" #include "common/jsonconfig.h" #include "common/percent.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include "detection/loadavg/loadavg.h" #include "detection/cpu/cpu.h" #include "modules/loadavg/loadavg.h" diff --git a/src/modules/localip/localip.c b/src/modules/localip/localip.c index e73e2c5edc..ef4a110cd8 100644 --- a/src/modules/localip/localip.c +++ b/src/modules/localip/localip.c @@ -1,6 +1,6 @@ #include "common/printing.h" #include "common/jsonconfig.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include "detection/localip/localip.h" #include "modules/localip/localip.h" diff --git a/src/modules/memory/memory.c b/src/modules/memory/memory.c index 34b9ac61d3..4fbdf75fb2 100644 --- a/src/modules/memory/memory.c +++ b/src/modules/memory/memory.c @@ -2,7 +2,7 @@ #include "common/jsonconfig.h" #include "common/percent.h" #include "common/size.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include "detection/memory/memory.h" #include "modules/memory/memory.h" diff --git a/src/modules/modules.c b/src/modules/modules.c index fe72923af7..837871187d 100644 --- a/src/modules/modules.c +++ b/src/modules/modules.c @@ -1,69 +1,139 @@ #include "modules/modules.h" +// Note: +// FF_MODULE_DISABLE_ only controls if the module is registered, +// the module code itself is still compiled. +// We rely `LTO` to remove the unused code (only enabled in Release mode) + static FFModuleBaseInfo* A[] = { NULL, }; static FFModuleBaseInfo* B[] = { +#if !FF_MODULE_DISABLE_BATTERY &ffBatteryModuleInfo, +#endif +#if !FF_MODULE_DISABLE_BIOS &ffBiosModuleInfo, +#endif +#if !FF_MODULE_DISABLE_BLUETOOTH &ffBluetoothModuleInfo, +#endif +#if !FF_MODULE_DISABLE_BLUETOOTHRADIO &ffBluetoothRadioModuleInfo, +#endif +#if !FF_MODULE_DISABLE_BOARD &ffBoardModuleInfo, +#endif +#if !FF_MODULE_DISABLE_BOOTMGR &ffBootmgrModuleInfo, +#endif +#if !FF_MODULE_DISABLE_BREAK &ffBreakModuleInfo, +#endif +#if !FF_MODULE_DISABLE_BRIGHTNESS &ffBrightnessModuleInfo, +#endif +#if !FF_MODULE_DISABLE_BTRFS &ffBtrfsModuleInfo, +#endif NULL, }; static FFModuleBaseInfo* C[] = { +#if !FF_MODULE_DISABLE_CAMERA &ffCameraModuleInfo, +#endif +#if !FF_MODULE_DISABLE_CHASSIS &ffChassisModuleInfo, +#endif +#if !FF_MODULE_DISABLE_CODEC + &ffCodecModuleInfo, +#endif +#if !FF_MODULE_DISABLE_COMMAND &ffCommandModuleInfo, +#endif +#if !FF_MODULE_DISABLE_COLORS &ffColorsModuleInfo, +#endif +#if !FF_MODULE_DISABLE_CPU &ffCPUModuleInfo, +#endif +#if !FF_MODULE_DISABLE_CPUCACHE &ffCPUCacheModuleInfo, +#endif +#if !FF_MODULE_DISABLE_CPUUSAGE &ffCPUUsageModuleInfo, +#endif +#if !FF_MODULE_DISABLE_CURSOR &ffCursorModuleInfo, +#endif +#if !FF_MODULE_DISABLE_CUSTOM &ffCustomModuleInfo, +#endif NULL, }; static FFModuleBaseInfo* D[] = { +#if !FF_MODULE_DISABLE_DATETIME &ffDateTimeModuleInfo, +#endif +#if !FF_MODULE_DISABLE_DE &ffDEModuleInfo, +#endif +#if !FF_MODULE_DISABLE_DISPLAY &ffDisplayModuleInfo, +#endif +#if !FF_MODULE_DISABLE_DISK &ffDiskModuleInfo, +#endif +#if !FF_MODULE_DISABLE_DISKIO &ffDiskIOModuleInfo, +#endif +#if !FF_MODULE_DISABLE_DNS &ffDNSModuleInfo, +#endif NULL, }; static FFModuleBaseInfo* E[] = { +#if !FF_MODULE_DISABLE_EDITOR &ffEditorModuleInfo, +#endif NULL, }; static FFModuleBaseInfo* F[] = { +#if !FF_MODULE_DISABLE_FONT &ffFontModuleInfo, +#endif NULL, }; static FFModuleBaseInfo* G[] = { +#if !FF_MODULE_DISABLE_GAMEPAD &ffGamepadModuleInfo, +#endif +#if !FF_MODULE_DISABLE_GPU &ffGPUModuleInfo, +#endif NULL, }; static FFModuleBaseInfo* H[] = { +#if !FF_MODULE_DISABLE_HOST &ffHostModuleInfo, +#endif NULL, }; static FFModuleBaseInfo* I[] = { +#if !FF_MODULE_DISABLE_ICONS &ffIconsModuleInfo, +#endif +#if !FF_MODULE_DISABLE_INITSYSTEM &ffInitSystemModuleInfo, +#endif NULL, }; @@ -72,48 +142,92 @@ static FFModuleBaseInfo* J[] = { }; static FFModuleBaseInfo* K[] = { +#if !FF_MODULE_DISABLE_KERNEL &ffKernelModuleInfo, +#endif +#if !FF_MODULE_DISABLE_KEYBOARD &ffKeyboardModuleInfo, +#endif NULL, }; static FFModuleBaseInfo* L[] = { +#if !FF_MODULE_DISABLE_LM &ffLMModuleInfo, +#endif +#if !FF_MODULE_DISABLE_LOADAVG &ffLoadavgModuleInfo, +#endif +#if !FF_MODULE_DISABLE_LOCALE &ffLocaleModuleInfo, +#endif +#if !FF_MODULE_DISABLE_LOCALIP &ffLocalIPModuleInfo, +#endif +#if !FF_MODULE_DISABLE_LOGO &ffLogoModuleInfo, +#endif NULL, }; static FFModuleBaseInfo* M[] = { +#if !FF_MODULE_DISABLE_MEDIA &ffMediaModuleInfo, +#endif +#if !FF_MODULE_DISABLE_MEMORY &ffMemoryModuleInfo, +#endif +#if !FF_MODULE_DISABLE_MONITOR &ffMonitorModuleInfo, +#endif +#if !FF_MODULE_DISABLE_MOUSE &ffMouseModuleInfo, +#endif NULL, }; static FFModuleBaseInfo* N[] = { +#if !FF_MODULE_DISABLE_NETIO &ffNetIOModuleInfo, +#endif NULL, }; static FFModuleBaseInfo* O[] = { +#if !FF_MODULE_DISABLE_OPENCL &ffOpenCLModuleInfo, +#endif +#if !FF_MODULE_DISABLE_OPENGL &ffOpenGLModuleInfo, +#endif +#if !FF_MODULE_DISABLE_OS &ffOSModuleInfo, +#endif NULL, }; static FFModuleBaseInfo* P[] = { +#if !FF_MODULE_DISABLE_PACKAGES &ffPackagesModuleInfo, +#endif +#if !FF_MODULE_DISABLE_PHYSICALDISK &ffPhysicalDiskModuleInfo, +#endif +#if !FF_MODULE_DISABLE_PHYSICALMEMORY &ffPhysicalMemoryModuleInfo, +#endif +#if !FF_MODULE_DISABLE_PLAYER &ffPlayerModuleInfo, +#endif +#if !FF_MODULE_DISABLE_POWERADAPTER &ffPowerAdapterModuleInfo, +#endif +#if !FF_MODULE_DISABLE_PROCESSES &ffProcessesModuleInfo, +#endif +#if !FF_MODULE_DISABLE_PUBLICIP &ffPublicIPModuleInfo, +#endif NULL, }; @@ -126,42 +240,82 @@ static FFModuleBaseInfo* R[] = { }; static FFModuleBaseInfo* S[] = { +#if !FF_MODULE_DISABLE_SEPARATOR &ffSeparatorModuleInfo, +#endif +#if !FF_MODULE_DISABLE_SHELL &ffShellModuleInfo, +#endif +#if !FF_MODULE_DISABLE_SOUND &ffSoundModuleInfo, +#endif +#if !FF_MODULE_DISABLE_SWAP &ffSwapModuleInfo, +#endif NULL, }; static FFModuleBaseInfo* T[] = { +#if !FF_MODULE_DISABLE_TERMINAL &ffTerminalModuleInfo, +#endif +#if !FF_MODULE_DISABLE_TERMINALFONT &ffTerminalFontModuleInfo, +#endif +#if !FF_MODULE_DISABLE_TERMINALSIZE &ffTerminalSizeModuleInfo, +#endif +#if !FF_MODULE_DISABLE_TERMINALTHEME &ffTerminalThemeModuleInfo, +#endif +#if !FF_MODULE_DISABLE_TITLE &ffTitleModuleInfo, +#endif +#if !FF_MODULE_DISABLE_THEME &ffThemeModuleInfo, +#endif +#if !FF_MODULE_DISABLE_TPM &ffTPMModuleInfo, +#endif NULL, }; static FFModuleBaseInfo* U[] = { +#if !FF_MODULE_DISABLE_UPTIME &ffUptimeModuleInfo, +#endif +#if !FF_MODULE_DISABLE_USERS &ffUsersModuleInfo, +#endif NULL, }; static FFModuleBaseInfo* V[] = { +#if !FF_MODULE_DISABLE_VERSION &ffVersionModuleInfo, +#endif +#if !FF_MODULE_DISABLE_VULKAN &ffVulkanModuleInfo, +#endif NULL, }; static FFModuleBaseInfo* W[] = { +#if !FF_MODULE_DISABLE_WALLPAPER &ffWallpaperModuleInfo, +#endif +#if !FF_MODULE_DISABLE_WEATHER &ffWeatherModuleInfo, +#endif +#if !FF_MODULE_DISABLE_WM &ffWMModuleInfo, +#endif +#if !FF_MODULE_DISABLE_WIFI &ffWifiModuleInfo, +#endif +#if !FF_MODULE_DISABLE_WMTHEME &ffWMThemeModuleInfo, +#endif NULL, }; @@ -174,7 +328,9 @@ static FFModuleBaseInfo* Y[] = { }; static FFModuleBaseInfo* Z[] = { +#if !FF_MODULE_DISABLE_ZPOOL &ffZpoolModuleInfo, +#endif NULL, }; diff --git a/src/modules/modules.h b/src/modules/modules.h index 2579ad90e5..37ee242f0c 100644 --- a/src/modules/modules.h +++ b/src/modules/modules.h @@ -15,6 +15,7 @@ #include "modules/cpucache/cpucache.h" #include "modules/cpuusage/cpuusage.h" #include "modules/command/command.h" +#include "modules/codec/codec.h" #include "modules/colors/colors.h" #include "modules/cursor/cursor.h" #include "modules/custom/custom.h" diff --git a/src/modules/monitor/monitor.c b/src/modules/monitor/monitor.c index a88532ecd3..105ee67c62 100644 --- a/src/modules/monitor/monitor.c +++ b/src/modules/monitor/monitor.c @@ -1,6 +1,6 @@ #include "common/printing.h" #include "common/jsonconfig.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include "detection/displayserver/displayserver.h" #include "modules/monitor/monitor.h" diff --git a/src/modules/mouse/mouse.c b/src/modules/mouse/mouse.c index c3856c9ec8..abc4678323 100644 --- a/src/modules/mouse/mouse.c +++ b/src/modules/mouse/mouse.c @@ -1,7 +1,7 @@ #include "common/percent.h" #include "common/printing.h" #include "common/jsonconfig.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include "detection/mouse/mouse.h" #include "modules/mouse/mouse.h" diff --git a/src/modules/netio/netio.c b/src/modules/netio/netio.c index 00d58dffa4..17047fffd9 100644 --- a/src/modules/netio/netio.c +++ b/src/modules/netio/netio.c @@ -1,7 +1,7 @@ #include "common/printing.h" #include "common/jsonconfig.h" #include "common/size.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include "detection/netio/netio.h" #include "modules/netio/netio.h" diff --git a/src/modules/opencl/opencl.c b/src/modules/opencl/opencl.c index 1ba5bf3588..d69b3fe795 100644 --- a/src/modules/opencl/opencl.c +++ b/src/modules/opencl/opencl.c @@ -1,6 +1,6 @@ #include "common/printing.h" #include "common/jsonconfig.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include "detection/opencl/opencl.h" #include "detection/gpu/gpu.h" #include "modules/opencl/opencl.h" diff --git a/src/modules/opengl/opengl.c b/src/modules/opengl/opengl.c index 4ce2313a45..0754cb20cb 100644 --- a/src/modules/opengl/opengl.c +++ b/src/modules/opengl/opengl.c @@ -1,6 +1,6 @@ #include "common/printing.h" #include "common/jsonconfig.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include "detection/opengl/opengl.h" #include "modules/opengl/opengl.h" diff --git a/src/modules/os/os.c b/src/modules/os/os.c index 6744fbe8c3..e402699b0d 100644 --- a/src/modules/os/os.c +++ b/src/modules/os/os.c @@ -1,7 +1,7 @@ #include "common/printing.h" #include "common/jsonconfig.h" #include "common/option.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include "detection/os/os.h" #include "modules/os/os.h" diff --git a/src/modules/packages/packages.c b/src/modules/packages/packages.c index a0012047a8..dc8e0be56f 100644 --- a/src/modules/packages/packages.c +++ b/src/modules/packages/packages.c @@ -1,6 +1,6 @@ #include "common/printing.h" #include "common/jsonconfig.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include "detection/packages/packages.h" #include "modules/packages/packages.h" diff --git a/src/modules/player/player.c b/src/modules/player/player.c index 8391e4a53b..58d1b3b00a 100644 --- a/src/modules/player/player.c +++ b/src/modules/player/player.c @@ -1,6 +1,6 @@ #include "common/printing.h" #include "common/jsonconfig.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include "detection/media/media.h" #include "modules/player/player.h" diff --git a/src/modules/poweradapter/poweradapter.c b/src/modules/poweradapter/poweradapter.c index 03d4053729..2e70c000d9 100644 --- a/src/modules/poweradapter/poweradapter.c +++ b/src/modules/poweradapter/poweradapter.c @@ -1,6 +1,6 @@ #include "common/printing.h" #include "common/jsonconfig.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include "detection/poweradapter/poweradapter.h" #include "modules/poweradapter/poweradapter.h" diff --git a/src/modules/processes/processes.c b/src/modules/processes/processes.c index 0a3c1329b6..44ab59d4d5 100644 --- a/src/modules/processes/processes.c +++ b/src/modules/processes/processes.c @@ -1,6 +1,6 @@ #include "common/printing.h" #include "common/jsonconfig.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include "detection/processes/processes.h" #include "modules/processes/processes.h" diff --git a/src/modules/publicip/publicip.c b/src/modules/publicip/publicip.c index 8e9aee277d..552173395e 100644 --- a/src/modules/publicip/publicip.c +++ b/src/modules/publicip/publicip.c @@ -1,6 +1,6 @@ #include "common/printing.h" #include "common/jsonconfig.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include "modules/publicip/publicip.h" #include "detection/publicip/publicip.h" diff --git a/src/modules/separator/separator.c b/src/modules/separator/separator.c index 7be01919cc..4c5b4bc92c 100644 --- a/src/modules/separator/separator.c +++ b/src/modules/separator/separator.c @@ -1,64 +1,10 @@ #include "common/printing.h" #include "common/jsonconfig.h" -#include "common/stringUtils.h" -#include "common/mallocHelper.h" -#include "common/wcwidth.h" +#include "common/strutil.h" #include "common/textModifier.h" #include "logo/logo.h" #include "modules/separator/separator.h" -#include - -#if __SIZEOF_WCHAR_T__ == 4 -static inline size_t mbrtoc32(uint32_t* restrict pc32, const char* restrict s, size_t n, mbstate_t* restrict ps) { - return mbrtowc((wchar_t*) pc32, s, n, ps); -} -#else - #include -#endif - -static uint8_t getMbrWidth(const char* mbstr, uint32_t length, const char** next, mbstate_t* state) { - if (__builtin_expect((uint8_t) *mbstr < 0x80, true)) // ASCII fast path - { - if (next) { - *next = mbstr + 1; - } - return 1; - } - - uint32_t c32; - uint32_t len = (uint32_t) mbrtoc32(&c32, mbstr, length, state); - if (len >= (uint32_t) -3) { - // Invalid or incomplete multibyte sequence - if (next) { - *next = mbstr + 1; - } - return 1; - } - - if (next) { - *next = mbstr + len; - } - int width = mk_wcwidth(c32); - return width < 0 ? 0 : (uint8_t) width; -} - -static uint32_t getWcsWidth(const FFstrbuf* mbstr) { - mbstate_t state = {}; - uint32_t remainLength = mbstr->length; - uint32_t result = 0; - - const char* ptr = mbstr->chars; - while (remainLength > 0 && *ptr != '\0') { - const char* lastPtr = NULL; - result += getMbrWidth(ptr, remainLength, &lastPtr, &state); - remainLength -= (uint32_t) (lastPtr - ptr); - ptr = lastPtr; - } - - return result > 0 ? (uint32_t) result : mbstr->length; -} - bool ffPrintSeparator(FFSeparatorOptions* options) { ffLogoPrintLine(); @@ -75,17 +21,16 @@ bool ffPrintSeparator(FFSeparatorOptions* options) { } } } else { - setlocale(LC_CTYPE, ""); const FFPlatform* platform = &instance.state.platform; uint32_t titleLength = 1 // @ - + getWcsWidth(&platform->userName) // user name + + ffUtf8StrWidth(platform->userName.chars, platform->userName.length) // user name + (instance.state.titleFqdn ? platform->hostName.length : ffStrbufFirstIndexC(&platform->hostName, '.')); // host name if (__builtin_expect(options->string.length == 1, 1)) { ffPrintCharTimes(options->string.chars[0], titleLength); } else { - uint32_t wcsLength = getWcsWidth(&options->string); + uint32_t wcsLength = ffUtf8StrWidth(options->string.chars, options->string.length); int remaining = (int) titleLength; // Write the whole separator as often as it fits fully into titleLength @@ -98,11 +43,17 @@ bool ffPrintSeparator(FFSeparatorOptions* options) { if (wcsLength != options->string.length) { // Unicode chars const char* ptr = options->string.chars; - mbstate_t state = {}; - const char* next = NULL; - while (remaining > 0 && *ptr != '\0') { - remaining -= (int) getMbrWidth(ptr, (uint32_t) (options->string.length - (ptr - options->string.chars)), &next, &state); - ptr = next; + uint32_t remainBytes = options->string.length; + while (remaining > 0 && remainBytes > 0 && *ptr != '\0') { + uint8_t charWidth = 0; + uint8_t bytes = ffUtf8CharLenWidth(ptr, remainBytes, &charWidth); + if (__builtin_expect(bytes == 0, false)) { + break; + } + + remaining -= (int) charWidth; + ptr += bytes; + remainBytes -= bytes; } fwrite(options->string.chars, (size_t) (ptr - options->string.chars), 1, stdout); } else { @@ -110,7 +61,6 @@ bool ffPrintSeparator(FFSeparatorOptions* options) { } } } - setlocale(LC_CTYPE, "C"); } if (options->outputColor.length && !instance.config.display.pipe) { diff --git a/src/modules/shell/shell.c b/src/modules/shell/shell.c index 59f55d6f31..f18c1bfd8b 100644 --- a/src/modules/shell/shell.c +++ b/src/modules/shell/shell.c @@ -1,6 +1,6 @@ #include "common/printing.h" #include "common/jsonconfig.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include "detection/terminalshell/terminalshell.h" #include "modules/shell/shell.h" diff --git a/src/modules/sound/sound.c b/src/modules/sound/sound.c index f4d47be746..bf37c1f1bc 100644 --- a/src/modules/sound/sound.c +++ b/src/modules/sound/sound.c @@ -1,7 +1,7 @@ #include "common/percent.h" #include "common/printing.h" #include "common/jsonconfig.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include "detection/sound/sound.h" #include "modules/sound/sound.h" diff --git a/src/modules/swap/swap.c b/src/modules/swap/swap.c index a612b413d5..78af475583 100644 --- a/src/modules/swap/swap.c +++ b/src/modules/swap/swap.c @@ -2,7 +2,7 @@ #include "common/jsonconfig.h" #include "common/percent.h" #include "common/size.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include "detection/swap/swap.h" #include "modules/swap/swap.h" diff --git a/src/modules/terminal/terminal.c b/src/modules/terminal/terminal.c index 1a6308cd14..8dc6f4c4b2 100644 --- a/src/modules/terminal/terminal.c +++ b/src/modules/terminal/terminal.c @@ -1,6 +1,6 @@ #include "common/printing.h" #include "common/jsonconfig.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include "detection/terminalshell/terminalshell.h" #include "modules/terminal/terminal.h" diff --git a/src/modules/terminalfont/terminalfont.c b/src/modules/terminalfont/terminalfont.c index 883abd8c1d..91e45c747b 100644 --- a/src/modules/terminalfont/terminalfont.c +++ b/src/modules/terminalfont/terminalfont.c @@ -1,6 +1,6 @@ #include "common/printing.h" #include "common/jsonconfig.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include "detection/terminalfont/terminalfont.h" #include "modules/terminalfont/terminalfont.h" diff --git a/src/modules/terminalsize/terminalsize.c b/src/modules/terminalsize/terminalsize.c index c83d9580d9..4a7c555ad6 100644 --- a/src/modules/terminalsize/terminalsize.c +++ b/src/modules/terminalsize/terminalsize.c @@ -1,6 +1,6 @@ #include "common/printing.h" #include "common/jsonconfig.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include "detection/terminalsize/terminalsize.h" #include "modules/terminalsize/terminalsize.h" diff --git a/src/modules/terminaltheme/terminaltheme.c b/src/modules/terminaltheme/terminaltheme.c index 6455d9ff00..80bcd2950d 100644 --- a/src/modules/terminaltheme/terminaltheme.c +++ b/src/modules/terminaltheme/terminaltheme.c @@ -1,6 +1,6 @@ #include "common/printing.h" #include "common/jsonconfig.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include "detection/terminaltheme/terminaltheme.h" #include "modules/terminaltheme/terminaltheme.h" diff --git a/src/modules/theme/theme.c b/src/modules/theme/theme.c index d11c3bc708..70cb778ab8 100644 --- a/src/modules/theme/theme.c +++ b/src/modules/theme/theme.c @@ -1,6 +1,6 @@ #include "common/printing.h" #include "common/jsonconfig.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include "detection/theme/theme.h" #include "modules/theme/theme.h" diff --git a/src/modules/tpm/tpm.c b/src/modules/tpm/tpm.c index c9196d8da2..ecdd386094 100644 --- a/src/modules/tpm/tpm.c +++ b/src/modules/tpm/tpm.c @@ -1,6 +1,6 @@ #include "common/printing.h" #include "common/jsonconfig.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include "detection/tpm/tpm.h" #include "modules/tpm/tpm.h" diff --git a/src/modules/uptime/uptime.c b/src/modules/uptime/uptime.c index 8d7b954920..e096bfc2f2 100644 --- a/src/modules/uptime/uptime.c +++ b/src/modules/uptime/uptime.c @@ -2,7 +2,7 @@ #include "common/printing.h" #include "common/jsonconfig.h" #include "common/time.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include "detection/uptime/uptime.h" #include "modules/uptime/uptime.h" diff --git a/src/modules/users/users.c b/src/modules/users/users.c index d0c608383b..5575bbeaab 100644 --- a/src/modules/users/users.c +++ b/src/modules/users/users.c @@ -1,7 +1,7 @@ #include "common/printing.h" #include "common/jsonconfig.h" #include "common/time.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include "detection/users/users.h" #include "modules/users/users.h" diff --git a/src/modules/version/version.c b/src/modules/version/version.c index c4f3a5c383..dcc4bbef12 100644 --- a/src/modules/version/version.c +++ b/src/modules/version/version.c @@ -1,6 +1,6 @@ #include "common/printing.h" #include "common/jsonconfig.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include "detection/libc/libc.h" #include "detection/version/version.h" #include "modules/version/version.h" diff --git a/src/modules/vulkan/vulkan.c b/src/modules/vulkan/vulkan.c index 73b1a30426..9ecbd32cf4 100644 --- a/src/modules/vulkan/vulkan.c +++ b/src/modules/vulkan/vulkan.c @@ -1,6 +1,6 @@ #include "common/printing.h" #include "common/jsonconfig.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include "detection/gpu/gpu.h" #include "detection/vulkan/vulkan.h" #include "modules/vulkan/vulkan.h" diff --git a/src/modules/wallpaper/wallpaper.c b/src/modules/wallpaper/wallpaper.c index 159684c305..a4d17c01a9 100644 --- a/src/modules/wallpaper/wallpaper.c +++ b/src/modules/wallpaper/wallpaper.c @@ -1,6 +1,6 @@ #include "common/printing.h" #include "common/jsonconfig.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include "detection/wallpaper/wallpaper.h" #include "modules/wallpaper/wallpaper.h" diff --git a/src/modules/weather/weather.c b/src/modules/weather/weather.c index c0bc393733..6c156929d8 100644 --- a/src/modules/weather/weather.c +++ b/src/modules/weather/weather.c @@ -1,6 +1,6 @@ #include "common/printing.h" #include "common/jsonconfig.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include "detection/weather/weather.h" #include "modules/weather/weather.h" diff --git a/src/modules/wifi/wifi.c b/src/modules/wifi/wifi.c index 26284a32b7..42485dce6b 100644 --- a/src/modules/wifi/wifi.c +++ b/src/modules/wifi/wifi.c @@ -1,6 +1,6 @@ #include "common/printing.h" #include "common/jsonconfig.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include "detection/wifi/wifi.h" #include "modules/wifi/wifi.h" diff --git a/src/modules/wm/wm.c b/src/modules/wm/wm.c index bb0ff1da0e..5ec66463b6 100644 --- a/src/modules/wm/wm.c +++ b/src/modules/wm/wm.c @@ -1,6 +1,6 @@ #include "common/printing.h" #include "common/jsonconfig.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include "detection/displayserver/displayserver.h" #include "detection/wm/wm.h" #include "modules/wm/wm.h" diff --git a/src/modules/wmtheme/wmtheme.c b/src/modules/wmtheme/wmtheme.c index 51166ffd56..775e88a9dc 100644 --- a/src/modules/wmtheme/wmtheme.c +++ b/src/modules/wmtheme/wmtheme.c @@ -1,6 +1,6 @@ #include "common/printing.h" #include "common/jsonconfig.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include "detection/wmtheme/wmtheme.h" #include "modules/wmtheme/wmtheme.h" diff --git a/src/modules/zpool/zpool.c b/src/modules/zpool/zpool.c index c0e2cd39fc..44a6de2a18 100644 --- a/src/modules/zpool/zpool.c +++ b/src/modules/zpool/zpool.c @@ -3,7 +3,7 @@ #include "common/percent.h" #include "common/size.h" #include "common/FFstrbuf.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include "detection/zpool/zpool.h" #include "modules/zpool/zpool.h" diff --git a/src/options/display.c b/src/options/display.c index e4498ca3a4..ec80a37237 100644 --- a/src/options/display.c +++ b/src/options/display.c @@ -2,7 +2,7 @@ #include "common/color.h" #include "common/jsonconfig.h" #include "common/percent.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include "options/display.h" #include diff --git a/src/options/general.c b/src/options/general.c index ae268ccf7c..6257a0f174 100644 --- a/src/options/general.c +++ b/src/options/general.c @@ -1,7 +1,7 @@ #include "fastfetch.h" #include "common/jsonconfig.h" #include "common/processing.h" -#include "common/stringUtils.h" +#include "common/strutil.h" #include "options/general.h" #include diff --git a/src/options/logo.c b/src/options/logo.c index d04f1e2fb1..6205b8ea8c 100644 --- a/src/options/logo.c +++ b/src/options/logo.c @@ -1,7 +1,7 @@ #include "logo/logo.h" #include "common/jsonconfig.h" -#include "common/stringUtils.h" +#include "common/strutil.h" void ffOptionsInitLogo(FFOptionsLogo* options) { ffStrbufInit(&options->source); @@ -12,6 +12,7 @@ void ffOptionsInitLogo(FFOptionsLogo* options) { options->width = 0; options->height = 0; // preserve aspect ratio options->paddingTop = 0; + options->paddingBottom = 0; options->paddingLeft = 0; options->paddingRight = 4; options->printRemaining = true; @@ -92,6 +93,8 @@ bool ffOptionsParseLogoCommandLine(FFOptionsLogo* options, const char* key, cons options->paddingRight = padding; } else if (ffStrEqualsIgnCase(subKey, "padding-top")) { options->paddingTop = ffOptionParseUInt32(key, value); + } else if (ffStrEqualsIgnCase(subKey, "padding-bottom")) { + options->paddingBottom = ffOptionParseUInt32(key, value); } else if (ffStrEqualsIgnCase(subKey, "padding-left")) { options->paddingLeft = ffOptionParseUInt32(key, value); } else if (ffStrEqualsIgnCase(subKey, "padding-right")) { @@ -212,6 +215,7 @@ const char* ffOptionsParseLogoJsonConfig(FFOptionsLogo* options, yyjson_val* roo if (yyjson_is_null(object)) { options->type = FF_LOGO_TYPE_NONE; options->paddingTop = 0; + options->paddingBottom = 0; options->paddingRight = 0; options->paddingLeft = 0; return NULL; @@ -312,6 +316,7 @@ const char* ffOptionsParseLogoJsonConfig(FFOptionsLogo* options, yyjson_val* roo FF_PARSE_PADDING_POSITON(left, paddingLeft); FF_PARSE_PADDING_POSITON(top, paddingTop); FF_PARSE_PADDING_POSITON(right, paddingRight); + FF_PARSE_PADDING_POSITON(bottom, paddingBottom); #undef FF_PARSE_PADDING_POSITON continue; } else if (unsafe_yyjson_equals_str(key, "printRemaining")) { @@ -494,6 +499,7 @@ void ffOptionsGenerateLogoJsonConfig(FFdata* data, FFOptionsLogo* options) { yyjson_mut_val* padding = yyjson_mut_obj_add_obj(doc, obj, "padding"); yyjson_mut_obj_add_uint(doc, padding, "top", options->paddingTop); yyjson_mut_obj_add_uint(doc, padding, "left", options->paddingLeft); + yyjson_mut_obj_add_uint(doc, padding, "bottom", options->paddingBottom); yyjson_mut_obj_add_uint(doc, padding, "right", options->paddingRight); } diff --git a/src/options/logo.h b/src/options/logo.h index 62e47ea810..21b63fff77 100644 --- a/src/options/logo.h +++ b/src/options/logo.h @@ -40,6 +40,7 @@ typedef struct FFOptionsLogo { uint32_t paddingTop; uint32_t paddingLeft; uint32_t paddingRight; + uint32_t paddingBottom; bool printRemaining; bool preserveAspectRatio; bool recache; diff --git a/tests/format.c b/tests/format.c index b29b6be79e..2366f55883 100644 --- a/tests/format.c +++ b/tests/format.c @@ -62,6 +62,18 @@ int main(void) { VERIFY("output({>})", "12345 67890", "output()"); } + { + VERIFY("output({1|20})", "12345 67890", "output( 12345 67890 )"); + VERIFY("output({1|-20})", "12345 67890", "output( 12345 67890 )"); + VERIFY("output({1|11})", "12345 67890", "output(12345 67890)"); + VERIFY("output({1|-11})", "12345 67890", "output(12345 67890)"); + VERIFY("output({1|6})", "12345 67890", "output(12345 )"); + VERIFY("output({|6})", "12345 67890", "output(12345 )"); + VERIFY("output({|-6})", "12345 67890", "output(12345…)"); + VERIFY("output({|0})", "12345 67890", "output()"); + VERIFY("output({|})", "12345 67890", "output()"); + } + { VERIFY("output({1n>20})", "12345 67890", "output({1n>20})"); VERIFY("output({120})", "12345 67890", "output({120})"); @@ -110,6 +122,31 @@ int main(void) { VERIFY("output({?1}OK{?}{/1}NOT OK{/})", "", "output(NOT OK)"); } + { + VERIFY("output({1:3})", "\e[1m12345", "output(\e[1m123)"); + VERIFY("output({1:-3})", "\e[1m12345", "output(\e[1m123…)"); + VERIFY("output({1:3})", "\e[1m12345\e[m", "output(\e[1m123\e[m)"); + VERIFY("output({1:-3})", "\e[1m12345\e[m", "output(\e[1m123…\e[m)"); + } + + { + VERIFY("output({1<8})", "\e[1m12345", "output(\e[1m12345 )"); + VERIFY("output({1>8})", "\e[1m12345", "output(\e[1m 12345)"); + VERIFY("output({1<8})", "\e[1m12345\e[m", "output(\e[1m12345 \e[m)"); + VERIFY("output({1>8})", "\e[1m12345\e[m", "output(\e[1m 12345\e[m)"); + VERIFY("output({1<1})", "\e[30;47m12345\e[m", "output(\e[30;47m1\e[m)"); + VERIFY("output({1|8})", "\e[1m12345\e[m", "output(\e[1m 12345 \e[m)"); + VERIFY("output({1|1})", "\e[30;47m12345\e[m", "output(\e[30;47m1\e[m)"); + } + + { + VERIFY("output({1~0})", "\e[1m12345", "output(\e[1m12345)"); + VERIFY("output({1~1})", "\e[1m12345", "output(\e[1m2345)"); + VERIFY("output({1~0})", "\e[1m12345\e[m", "output(\e[1m12345\e[m)"); + VERIFY("output({1~1})", "\e[1m12345\e[m", "output(\e[1m2345\e[m)"); + VERIFY("output({1~2})", "\e[30;47m12345\e[m", "output(\e[30;47m345\e[m)"); + } + #ifndef _WIN32 // Windows doesn't have setenv { ffListInit(&instance.config.display.constants); diff --git a/tests/strutil.c b/tests/strutil.c new file mode 100644 index 0000000000..3d065eee67 --- /dev/null +++ b/tests/strutil.c @@ -0,0 +1,108 @@ +#include "common/strutil.h" +#include "common/textModifier.h" + +#include +#include +#include + +static void verify(bool expression, const char* expressionStr, int lineNo) { + if (expression) { + return; + } + + fprintf(stderr, FASTFETCH_TEXT_MODIFIER_ERROR "[%d] %s\n" FASTFETCH_TEXT_MODIFIER_RESET, lineNo, expressionStr); + exit(1); +} + +#define VERIFY(expression) verify((expression), #expression, __LINE__) + +int main(void) { + #if FF_ENABLE_WCWIDTH + { + uint8_t width = 255; + uint8_t bytes = ffUtf8CharLenWidth("", 0, &width); + VERIFY(bytes == 0); + VERIFY(width == 0); + } + + { + uint8_t width = 0; + uint8_t bytes = ffUtf8CharLenWidth("A", 1, &width); + VERIFY(bytes == 1); + VERIFY(width == 1); + } + + { + const char* ch = "\xE6\x96\x87"; // 文 U+6587 + uint8_t width = 0; + uint8_t bytes = ffUtf8CharLenWidth(ch, 3, &width); + VERIFY(bytes == 3); + VERIFY(width == 2); + } + + { + const char* combining = "\xCC\x81"; // ◌́ U+0301 + uint8_t width = 0; + uint8_t bytes = ffUtf8CharLenWidth(combining, 2, &width); + VERIFY(bytes == 2); + VERIFY(width == 0); // Should be 1 since there's no base character + } + + { + uint8_t width = 0; + uint8_t bytes = ffUtf8CharLenWidth("\xE6\x96\x87", 1, &width); // truncated + VERIFY(bytes == 1); + VERIFY(width == 1); + } + + { + uint8_t width = 0; + uint8_t bytes = ffUtf8CharLenWidth("\xE6" + "A", + 2, + &width); // invalid continuation + VERIFY(bytes == 1); + VERIFY(width == 1); + } + + { + VERIFY(ffUtf8StrWidth("abc", 3) == 3); + } + + { + const char* mixed = "A" + "\xE6\x96\x87" // 文 U+6587 + "B"; + VERIFY(ffUtf8StrWidth(mixed, 5) == 4); + } + + { + const char* combining = "A\xCC\x81"; // Á + VERIFY(ffUtf8StrWidth(combining, 3) == 1); + } + + { + VERIFY(ffUtf8StrWidth("\xE6" + "A", + 2) == 2); + } + + { + VERIFY(ffUtf8StrWidth("", 0) == 0); + VERIFY(ffUtf8StrWidth("A\0B", 3) == 1); + } + + { + const char* emoji = "\xF0\x9F\x98\x80"; // U+1F600 😀 + uint8_t width = 0; + uint8_t bytes = ffUtf8CharLenWidth(emoji, 4, &width); + VERIFY(bytes == 4); + VERIFY(width == 2); + } + + puts("\033[32mAll tests passed!" FASTFETCH_TEXT_MODIFIER_RESET); + #else + puts("\033[33mTests skipped because wcwidth support is disabled." FASTFETCH_TEXT_MODIFIER_RESET); + #endif + return 0; +}