mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-09-12 18:32:10 +02:00
Compare commits
215 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 3247aabd74 | |||
| 312d4cc518 | |||
| b24877af0b | |||
| 1de97fa3ed | |||
| 6ca65b9166 | |||
| b2cc5c4f04 | |||
| f683351fe3 | |||
| d81cd50f64 | |||
| 1101d2e90e | |||
| 8284d73cc9 | |||
| 6b0db6fa74 | |||
| 3a61b31e0a | |||
| 493cf8ff6c | |||
| e6cf7fdb9f | |||
| 831d2a05ce | |||
| d0b72c5457 | |||
| 0c82a84266 | |||
| d501c8b41a | |||
| 0354fd5d9d | |||
| a856350416 | |||
| 4efe12c0d2 | |||
| 1a66bc4ec0 | |||
| d96d794d1f | |||
| 45659854d2 | |||
| b111626fe9 | |||
| dccbdba242 | |||
| 884fd097c6 | |||
| 08dea9fe21 | |||
| 98fc793386 | |||
| 121e9b911e | |||
| b9fe2fb4dd | |||
| 812a13c871 | |||
| dcbfae7f72 | |||
| 65883766a0 | |||
| 104cb43158 | |||
| 114cc753d9 | |||
| d68c4cef13 | |||
| c549a5cab8 | |||
| cbf8fdf3fc | |||
| 1e8b9aa461 | |||
| 5d32eba1a6 | |||
| 2ce7c8c60d | |||
| 7eaaed6024 | |||
| bd5012edc8 | |||
| cf0d1cf294 | |||
| a070519721 | |||
| fa0007ac6f | |||
| ced67e81a5 | |||
| 88a7468489 | |||
| ec8391f6c6 | |||
| 4371e719ae | |||
| bbbb493cdf | |||
| 6cb565e379 | |||
| 2bb988a7f8 | |||
| 0929b940c8 | |||
| c14ba32b82 | |||
| 7a75615d9e | |||
| 96c58148f6 | |||
| 2c7cd6df98 | |||
| db1fbe0a30 | |||
| a102f0505c | |||
| 8a3af14d22 | |||
| ce648e9e44 | |||
| 2cc94ee095 | |||
| 16dd9fb213 | |||
| 873285b083 | |||
| ce43f06863 | |||
| 3c92e7013d | |||
| 8e5017aa3a | |||
| dc89336fc1 | |||
| 952152edf0 | |||
| 6862747c48 | |||
| f91be6442d | |||
| bdce8ea3a1 | |||
| 44c8fa0470 | |||
| 9f9a5ba39a | |||
| 7c37d719e5 | |||
| cc78d6b16c | |||
| e7b7645f08 | |||
| 6a17ef6a54 | |||
| 5b687727c0 | |||
| 9b038dc848 | |||
| 597dd32caf | |||
| 8d08a65611 | |||
| 263c54a81e | |||
| cba5560068 | |||
| 0703b2b88f | |||
| 86e5572a7e | |||
| 3b3c1a9f63 | |||
| 14b9e88a82 | |||
| bee7c62000 | |||
| 8fa4d7ae6e | |||
| 640d0666fc | |||
| 165b0b0a69 | |||
| dc216362d5 | |||
| 57ffe3bad2 | |||
| cdee6e2997 | |||
| fb03c95d68 | |||
| 5b76a0b45a | |||
| fa5a74c746 | |||
| 4c6e14bcc2 | |||
| deacecdc11 | |||
| 83dcdaa726 | |||
| 2c29465f69 | |||
| f3e48a00a0 | |||
| 9559db556d | |||
| b89eeaa954 | |||
| 7c15d0ce88 | |||
| 036d407708 | |||
| 52715a0ec5 | |||
| 4a6209e0e3 | |||
| 93bdaf10c4 | |||
| 4a75123eb1 | |||
| 7f2ab7310a | |||
| 3c9d9b3c67 | |||
| 7a1b214ffe | |||
| 4fe1bb0b7e | |||
| 2f26045d30 | |||
| 40e67a1d93 | |||
| d7018c2fd3 | |||
| 9e1ba0d104 | |||
| 9f23ce93bd | |||
| f89cbf6bc8 | |||
| e12c6e6fd7 | |||
| 7ba1e3d3d9 | |||
| 672bf0ef54 | |||
| 96ec2b662c | |||
| c3de293450 | |||
| f11b07ba8a | |||
| 4e84153e9d | |||
| 121cbde661 | |||
| 0d71ae7f97 | |||
| 2a49f1d0eb | |||
| 6b7403281b | |||
| 63a0faa1d9 | |||
| 408a2d731a | |||
| 46abc4f5f7 | |||
| 7393bcdf05 | |||
| d282050130 | |||
| c0de618177 | |||
| d1609ea96b | |||
| d869164d6b | |||
| 3b361c663d | |||
| 5bc9a5dc4e | |||
| c0781dd5f8 | |||
| c795c20723 | |||
| 0776dac95b | |||
| 3433043604 | |||
| bd0b108c04 | |||
| 2a9f9d5a34 | |||
| 4f3649e96e | |||
| e4f0efd58c | |||
| 25577a6e58 | |||
| 801bd7c879 | |||
| 89ce598800 | |||
| 9268d8449e | |||
| 179341c30c | |||
| 1947aa2b0e | |||
| 64c53e2cdc | |||
| 7eaefe163a | |||
| beabaa90f1 | |||
| 2f42d64dc9 | |||
| 7d452cc460 | |||
| 5b064f2e7b | |||
| e786cd5d33 | |||
| 6c7efea2fd | |||
| efd9e94138 | |||
| 0707b29326 | |||
| 560e061c25 | |||
| 1d83743259 | |||
| 48bb38ca85 | |||
| d9f084894e | |||
| 765c7b42b6 | |||
| 5060c265a9 | |||
| fca4b3eee8 | |||
| eefed2be9c | |||
| 6a33027892 | |||
| 5e9c0d03ff | |||
| ab84c2ca76 | |||
| 4777f7bec3 | |||
| 1038668db9 | |||
| 49639b6719 | |||
| e5a04ee814 | |||
| fea2d80743 | |||
| 39eccf189c | |||
| 1652ec3512 | |||
| 5a39b69d1d | |||
| fa872d7c9b | |||
| 545267bb7e | |||
| 789f1e34ef | |||
| 9c095967fc | |||
| ddc910e924 | |||
| d628bdea5a | |||
| f9ce2fae0e | |||
| 4f70c16d63 | |||
| f8d5f56dee | |||
| 4d1c62947b | |||
| 8402dba0d9 | |||
| 94b6f0fbd1 | |||
| 3b1b81437e | |||
| a61765c8b1 | |||
| 065b44ff59 | |||
| b0e51ba91d | |||
| b6fff0c946 | |||
| c16373a7d7 | |||
| 73875de6a1 | |||
| 5f1cb16534 | |||
| 013320bcde | |||
| 3415d8197c | |||
| c5fdcc5cfc | |||
| f894856407 | |||
| 313bb02188 | |||
| 4dc0bd583c | |||
| 0ae1bd57bd | |||
| 02f3789eaa |
+1
-1
@@ -2,4 +2,4 @@
|
||||
check-filenames =
|
||||
builtin = clear,rare,usage,informal
|
||||
skip = */.git,*/cmake-build-*,*/.idea,*/completions,*/presets,*/screenshots,*/tests,*/3rdparty,*/logo/ascii
|
||||
ignore-words-list = iterm,compiletime,unknwn,pengwin,siduction,master,sur,doas
|
||||
ignore-words-list = iterm,compiletime,unknwn,pengwin,siduction,master,sur,doas,conexant
|
||||
|
||||
@@ -15,6 +15,9 @@ Paste content of /etc/os-release and /etc/lsb-release here. If none of these fil
|
||||
```
|
||||
|
||||
# Ascii
|
||||
|
||||
An ASCII logo should not take up too much space (smaller than 50x20 characters). Please also include the color codes if not available in `os-release`
|
||||
|
||||
```
|
||||
Paste ascii art here.
|
||||
```
|
||||
|
||||
+18
-56
@@ -35,7 +35,7 @@ jobs:
|
||||
run: uname -a
|
||||
|
||||
- name: configure project
|
||||
run: cmake -DSET_TWEAK=Off -DBUILD_TESTS=On -DCMAKE_INSTALL_PREFIX=/usr . -DENABLE_VULKAN=OFF -DENABLE_WAYLAND=OFF -DENABLE_XCB_RANDR=OFF -DENABLE_XCB=OFF -DENABLE_XRANDR=OFF -DENABLE_X11=OFF -DENABLE_DRM=OFF -DENABLE_GIO=OFF -DENABLE_DCONF=OFF -DENABLE_DBUS=OFF -DENABLE_XFCONF=OFF -DENABLE_SQLITE3=OFF -DENABLE_RPM=OFF -DENABLE_IMAGEMAGICK7=OFF -DENABLE_IMAGEMAGICK6=OFF -DENABLE_CHAFA=OFF -DENABLE_ZLIB=OFF -DENABLE_EGL=OFF -DENABLE_GLX=OFF -DENABLE_OSMESA=OFF -DENABLE_OPENCL=OFF -DENABLE_LIBNM=OFF -DENABLE_FREETYPE=OFF -DENABLE_PULSE=OFF -DENABLE_DDCUTIL=OFF -DENABLE_DIRECTX_HEADERS=OFF -DENABLE_THREADS=OFF
|
||||
run: cmake -DSET_TWEAK=Off -DBUILD_TESTS=On -DCMAKE_INSTALL_PREFIX=/usr . -DENABLE_VULKAN=OFF -DENABLE_WAYLAND=OFF -DENABLE_XCB_RANDR=OFF -DENABLE_XCB=OFF -DENABLE_XRANDR=OFF -DENABLE_X11=OFF -DENABLE_DRM=OFF -DENABLE_GIO=OFF -DENABLE_DCONF=OFF -DENABLE_DBUS=OFF -DENABLE_XFCONF=OFF -DENABLE_SQLITE3=OFF -DENABLE_RPM=OFF -DENABLE_IMAGEMAGICK7=OFF -DENABLE_IMAGEMAGICK6=OFF -DENABLE_CHAFA=OFF -DENABLE_ZLIB=OFF -DENABLE_EGL=OFF -DENABLE_GLX=OFF -DENABLE_OSMESA=OFF -DENABLE_OPENCL=OFF -DENABLE_FREETYPE=OFF -DENABLE_PULSE=OFF -DENABLE_DDCUTIL=OFF -DENABLE_DIRECTX_HEADERS=OFF -DENABLE_THREADS=OFF
|
||||
|
||||
- name: build project
|
||||
run: cmake --build . --target package --verbose -j4
|
||||
@@ -44,7 +44,7 @@ jobs:
|
||||
run: ./fastfetch --list-features
|
||||
|
||||
- name: run fastfetch
|
||||
run: time ./fastfetch -c presets/ci.jsonc
|
||||
run: time ./fastfetch -c presets/ci.jsonc --stat false
|
||||
|
||||
- name: run fastfetch --format json
|
||||
run: time ./fastfetch -c presets/ci.jsonc --format json
|
||||
@@ -74,7 +74,7 @@ jobs:
|
||||
run: uname -a
|
||||
|
||||
- name: install required packages
|
||||
run: sudo apt-get update && sudo apt-get install -y libvulkan-dev libwayland-dev libxrandr-dev libxcb-randr0-dev libdconf-dev libdbus-1-dev libmagickcore-dev libxfconf-0-dev libsqlite3-dev librpm-dev libegl-dev libglx-dev libosmesa6-dev ocl-icd-opencl-dev libnm-dev libpulse-dev libdrm-dev directx-headers-dev
|
||||
run: sudo apt-get update && sudo apt-get install -y libvulkan-dev libwayland-dev libxrandr-dev libxcb-randr0-dev libdconf-dev libdbus-1-dev libmagickcore-dev libxfconf-0-dev libsqlite3-dev librpm-dev libegl-dev libglx-dev libosmesa6-dev ocl-icd-opencl-dev libpulse-dev libdrm-dev directx-headers-dev
|
||||
|
||||
- name: install linuxbrew packages
|
||||
run: |
|
||||
@@ -99,7 +99,7 @@ jobs:
|
||||
run: ./fastfetch --list-features
|
||||
|
||||
- name: run fastfetch
|
||||
run: time ./fastfetch -c presets/ci.jsonc
|
||||
run: time ./fastfetch -c presets/ci.jsonc --stat false
|
||||
|
||||
- name: run fastfetch --format json
|
||||
run: time ./fastfetch -c presets/ci.jsonc --format json
|
||||
@@ -138,15 +138,15 @@ jobs:
|
||||
id: runcmd
|
||||
with:
|
||||
arch: aarch64
|
||||
distro: ubuntu22.04
|
||||
distro: ubuntu20.04
|
||||
githubToken: ${{ github.token }}
|
||||
run: |
|
||||
uname -a
|
||||
apt-get update && apt-get install -y cmake make g++ libvulkan-dev libwayland-dev libxrandr-dev libxcb-randr0-dev libdconf-dev libdbus-1-dev libmagickcore-dev libxfconf-0-dev libsqlite3-dev librpm-dev libegl-dev libglx-dev libosmesa6-dev ocl-icd-opencl-dev libnm-dev libpulse-dev libdrm-dev libddcutil-dev libchafa-dev directx-headers-dev rpm
|
||||
apt-get update && apt-get install -y cmake make g++ libvulkan-dev libwayland-dev libxrandr-dev libxcb-randr0-dev libdconf-dev libdbus-1-dev libmagickcore-dev libxfconf-0-dev libsqlite3-dev librpm-dev libegl-dev libglx-dev libosmesa6-dev ocl-icd-opencl-dev libpulse-dev libdrm-dev directx-headers-dev rpm
|
||||
cmake -DSET_TWEAK=Off -DBUILD_TESTS=On -DCMAKE_INSTALL_PREFIX=/usr .
|
||||
cmake --build . --target package --verbose -j4
|
||||
./fastfetch --list-features
|
||||
time ./fastfetch -c presets/ci.jsonc
|
||||
time ./fastfetch -c presets/ci.jsonc --stat false
|
||||
time ./fastfetch -c presets/ci.jsonc --format json
|
||||
time ./flashfetch
|
||||
ldd fastfetch
|
||||
@@ -181,11 +181,11 @@ jobs:
|
||||
# CMake installed by apt has bug `list sub-command REMOVE_ITEM requires two or more arguments`
|
||||
wget --no-check-certificate https://apt.kitware.com/ubuntu/pool/main/c/cmake/{cmake_3.29.2-0kitware1ubuntu20.04.1_armhf.deb,cmake-data_3.29.2-0kitware1ubuntu20.04.1_all.deb}
|
||||
dpkg -i *.deb
|
||||
apt-get install -y make g++ libvulkan-dev libwayland-dev libxrandr-dev libxcb-randr0-dev libdconf-dev libdbus-1-dev libmagickcore-dev libxfconf-0-dev libsqlite3-dev librpm-dev libegl-dev libglx-dev libosmesa6-dev ocl-icd-opencl-dev libnm-dev libpulse-dev libdrm-dev directx-headers-dev rpm
|
||||
apt-get install -y make g++ libvulkan-dev libwayland-dev libxrandr-dev libxcb-randr0-dev libdconf-dev libdbus-1-dev libmagickcore-dev libxfconf-0-dev libsqlite3-dev librpm-dev libegl-dev libglx-dev libosmesa6-dev ocl-icd-opencl-dev libpulse-dev libdrm-dev directx-headers-dev rpm
|
||||
cmake -DSET_TWEAK=Off -DBUILD_TESTS=On -DCMAKE_INSTALL_PREFIX=/usr .
|
||||
cmake --build . --target package --verbose -j4
|
||||
./fastfetch --list-features
|
||||
time ./fastfetch -c presets/ci.jsonc
|
||||
time ./fastfetch -c presets/ci.jsonc --stat false
|
||||
time ./fastfetch -c presets/ci.jsonc --format json
|
||||
time ./flashfetch
|
||||
ldd fastfetch
|
||||
@@ -216,11 +216,11 @@ jobs:
|
||||
githubToken: ${{ github.token }}
|
||||
run: |
|
||||
uname -a
|
||||
apt-get update && apt-get install -y cmake make g++ libvulkan-dev libwayland-dev libxrandr-dev libxcb-randr0-dev libdconf-dev libdbus-1-dev libmagickcore-dev libxfconf-0-dev libsqlite3-dev librpm-dev libegl-dev libglx-dev libosmesa6-dev ocl-icd-opencl-dev libnm-dev libpulse-dev libdrm-dev libddcutil-dev libchafa-dev directx-headers-dev rpm
|
||||
apt-get update && apt-get install -y cmake make g++ libvulkan-dev libwayland-dev libxrandr-dev libxcb-randr0-dev libdconf-dev libdbus-1-dev libmagickcore-dev libxfconf-0-dev libsqlite3-dev librpm-dev libegl-dev libglx-dev libosmesa6-dev ocl-icd-opencl-dev libpulse-dev libdrm-dev libddcutil-dev libchafa-dev directx-headers-dev rpm
|
||||
cmake -DSET_TWEAK=Off -DBUILD_TESTS=On -DCMAKE_INSTALL_PREFIX=/usr .
|
||||
cmake --build . --target package --verbose -j4
|
||||
./fastfetch --list-features
|
||||
time ./fastfetch -c presets/ci.jsonc
|
||||
time ./fastfetch -c presets/ci.jsonc --stat false
|
||||
time ./fastfetch -c presets/ci.jsonc --format json
|
||||
time ./flashfetch
|
||||
ldd fastfetch
|
||||
@@ -259,7 +259,7 @@ jobs:
|
||||
- name: run
|
||||
run: |
|
||||
./fastfetch --list-features
|
||||
time ./fastfetch -c presets/ci.jsonc
|
||||
time ./fastfetch -c presets/ci.jsonc --stat false
|
||||
time ./fastfetch -c presets/ci.jsonc --format json
|
||||
time ./flashfetch
|
||||
ldd fastfetch
|
||||
@@ -300,7 +300,7 @@ jobs:
|
||||
- name: run
|
||||
run: |
|
||||
./fastfetch --list-features
|
||||
time ./fastfetch -c presets/ci.jsonc
|
||||
time ./fastfetch -c presets/ci.jsonc --stat false
|
||||
time ./fastfetch -c presets/ci.jsonc --format json
|
||||
time ./flashfetch
|
||||
ldd fastfetch
|
||||
@@ -348,7 +348,7 @@ jobs:
|
||||
run: ./fastfetch --list-features
|
||||
|
||||
- name: run fastfetch
|
||||
run: time ./fastfetch -c presets/ci.jsonc
|
||||
run: time ./fastfetch -c presets/ci.jsonc --stat false
|
||||
|
||||
- name: run fastfetch --format json
|
||||
run: time ./fastfetch -c presets/ci.jsonc --format json
|
||||
@@ -416,9 +416,9 @@ jobs:
|
||||
with:
|
||||
operating_system: freebsd
|
||||
architecture: x86-64
|
||||
cpu_count: 3
|
||||
cpu_count: 4
|
||||
shell: bash
|
||||
version: '13.2'
|
||||
version: '14.1'
|
||||
run: |
|
||||
uname -a
|
||||
sudo pkg update
|
||||
@@ -438,43 +438,6 @@ jobs:
|
||||
name: fastfetch-freebsd-amd64
|
||||
path: ./fastfetch-*.*
|
||||
|
||||
freebsd-aarch64:
|
||||
name: FreeBSD-aarch64
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
security-events: write
|
||||
contents: read
|
||||
steps:
|
||||
- name: checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: run VM
|
||||
uses: cross-platform-actions/action@master
|
||||
with:
|
||||
operating_system: freebsd
|
||||
architecture: arm64
|
||||
cpu_count: 3
|
||||
shell: bash
|
||||
version: '13.2'
|
||||
run: |
|
||||
uname -a
|
||||
sudo pkg update
|
||||
sudo pkg install -y cmake git pkgconf binutils wayland vulkan-headers vulkan-loader libxcb libXrandr libX11 libdrm glib dconf dbus sqlite3-tcl xfce4-conf ImageMagick6 ImageMagick7 chafa egl libosmesa opencl ocl-icd v4l_compat
|
||||
cmake -DSET_TWEAK=Off -DBUILD_TESTS=On .
|
||||
cmake --build . --target package --verbose -j4
|
||||
./fastfetch --list-features
|
||||
time ./fastfetch
|
||||
time ./fastfetch --format json
|
||||
time ./flashfetch
|
||||
ldd fastfetch
|
||||
ctest
|
||||
|
||||
- name: upload artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: fastfetch-freebsd-aarch64
|
||||
path: ./fastfetch-*.*
|
||||
|
||||
windows-amd64:
|
||||
name: Windows-amd64
|
||||
runs-on: windows-latest
|
||||
@@ -514,7 +477,7 @@ jobs:
|
||||
run: ./fastfetch --list-features
|
||||
|
||||
- name: run fastfetch
|
||||
run: time ./fastfetch -c presets/ci.jsonc
|
||||
run: time ./fastfetch -c presets/ci.jsonc --stat false
|
||||
|
||||
- name: run fastfetch --format json
|
||||
run: time ./fastfetch -c presets/ci.jsonc --format json
|
||||
@@ -584,7 +547,7 @@ jobs:
|
||||
run: curl -LO https://github.com/GPUOpen-LibrariesAndSDKs/AGS_SDK/raw/master/ags_lib/lib/amd_ags_x86.dll
|
||||
|
||||
- name: run fastfetch
|
||||
run: time ./fastfetch -c presets/ci.jsonc
|
||||
run: time ./fastfetch -c presets/ci.jsonc --stat false
|
||||
|
||||
- name: run fastfetch --format json
|
||||
run: time ./fastfetch -c presets/ci.jsonc --format json
|
||||
@@ -623,7 +586,6 @@ jobs:
|
||||
- musl-aarch64
|
||||
- macos-universal
|
||||
- freebsd-amd64
|
||||
- freebsd-aarch64
|
||||
- sunos-amd64
|
||||
- windows-amd64
|
||||
- windows-i686
|
||||
|
||||
+181
@@ -1,3 +1,184 @@
|
||||
# 2.21.0
|
||||
|
||||
Changes:
|
||||
* We no longer use `libnm` for Wifi detection on Linux. Instead, we use `libdbus` to communicate with NetworkManager directly
|
||||
* To package managers: libnm dependency should be removed
|
||||
|
||||
Features:
|
||||
* Add module `BluetoothRadio` that prints bluetooth radios installed on the system
|
||||
* Don't confuse with module `Bluetooth` which lists connected bluetooth devices
|
||||
* Detect more information when `--gpu-driver-specific` is used (GPU)
|
||||
* Detect which type of nvidia driver (open source or proprietary) is used (GPU, Linux)
|
||||
* `--gpu-driver-specific` adds supports for Moore Threads GPU (#1142, GPU, Linux / Windows)
|
||||
* Use SetupAPI for detecting GPUs to support GPU detection when running fastfetch as a Windows Service (GPU, Windows)
|
||||
* See https://github.com/gpustack/gpustack/pull/97#issuecomment-2264699787 for detail
|
||||
* Detect playback status (Media, Linux)
|
||||
|
||||
Bugfixes:
|
||||
* Don't try to connect display server in tty mode (Linux, #1110)
|
||||
* Improve ssh detection
|
||||
* Fix max frequency printing in custom format (CPU)
|
||||
* Fix displaying random characters when detecting kitty term font (#1136 / #1145, TerminalFont, Linux)
|
||||
* Make sure to detect all physical memory devices (#1137)
|
||||
* Don't detect `wl-restart` as WM (#1135, WM, Linux)
|
||||
* Use PCI bus ID to match Nvidia cards; fix multi-GPU detection (GPU)
|
||||
* Ignore invalid GPU (#1066, GPU, macOS)
|
||||
* Print error when invalid color code is found (#1138)
|
||||
* Fix invalid refresh rate detection on old macOS versions (Display, macOS)
|
||||
* Fix disk size detection on 32-bit systems (Disk, BSD)
|
||||
* Don't ignore disabled GPUs (#1140, GPU, Linux)
|
||||
* Fix GPU type detection on FreeBSD (GPU, FreeBSD)
|
||||
* Remove shell version detection for unknown shells (#1144, Shell)
|
||||
* Don't detect hyfetch as shell on NixOS (Shell, NixOS)
|
||||
|
||||
Logos:
|
||||
* Update EndeavourOS_small
|
||||
* Add QTS
|
||||
|
||||
# 2.20.0
|
||||
|
||||
This release fixes regression of `2.19.0` on M1 MacBook Air. It also introduces a new option `--key-type icon` to display predefined icons in keys (requires newest nerd font). See `fastfetch -h key-type` for detail.
|
||||
|
||||
Changes:
|
||||
* JSON option `display.keyWidth` has been renamed to `display.key.width`
|
||||
* Previously: `{ "display": { "keyWidth": 3 } }`
|
||||
* Now: `{ "display": { "key": { "width": 3 } } }`
|
||||
* Windows Terminal font detection **in WSL** has been removed due to [issue #1113](https://github.com/fastfetch-cli/fastfetch/issues/1113)
|
||||
|
||||
Features:
|
||||
* Add option `display.key.type: <enum>` to print icons in keys
|
||||
* Supported value `string`, `icon` and `both`. Default to `string` (don't display icons)
|
||||
* Example: `{ "display": { "key": { "type": "icon" } } }`
|
||||
* Add option `display.key.paddingLeft: <num>` to print left padding (whitespaces) in keys
|
||||
* Example: `{ "display": { "key": { "paddingLeft": 2 } } }`
|
||||
* Add option `modules.keyIcon` to set icon for specified module
|
||||
* Example: `{ "modules": { "type": "command", "keyIcon": "🔑" } }`
|
||||
* Report system mono font name for Terminator if used (TerminalFont, Linux)
|
||||
* Don't require logo height to be set when using `--logo-position right`
|
||||
* Report Snapdragon SOC marketing name for newer Android phones (CPU, Android)
|
||||
* Detect MTK SOC part name (CPU, Android)
|
||||
|
||||
Bugfixes:
|
||||
* Don't wake up suspended GPUs when using `--ds-force-drm` (Display, Linux)
|
||||
* Fix printing editor type in JSON result (Editor)
|
||||
* Fix `--logo-padding-*` not working correctly (#1121, Logo)
|
||||
* Fix possible segfault when detecting GPU frequency (#1121, macOS, GPU)
|
||||
|
||||
# 2.19.1
|
||||
|
||||
Bugfixes
|
||||
* Fix frequency value printing when using custom format (#1111, CPU / GPU)
|
||||
* Fix display detection for XiaoMi Android phone (Display, Android)
|
||||
|
||||
Features:
|
||||
* Display if HDR mode is enabled for screens (Display)
|
||||
* Supported in Windows and Linux (KDE) correctly
|
||||
|
||||
# 2.19.0
|
||||
|
||||
Changes:
|
||||
* JSON option `modules.cpu.freqNdigits` has been renamed and moved to `display.freq.ndigits`
|
||||
* Previously: `{ "modules": { "type": "cpu", "freqNdigits": 2 } }`
|
||||
* Now: `{ "display": { "freq": { "ndigits": 2 } } }`
|
||||
* This option now affects GPU frequency too
|
||||
* By default, frequencies are displayed in *GHz*. Set `display.freq.ndigits` to `-1` to display them in *MHz*
|
||||
* JSON option `display.binaryPrefix` has been moved to `display.size.binaryPrefix`
|
||||
* Previously: `{ "display": { "binaryPrefix": "IEC" } }`
|
||||
* Now: `{ "display": { "size": { "binaryPrefix": "IEC" } } }`
|
||||
|
||||
Features:
|
||||
* Print physical diagonal length if supported (Display)
|
||||
* Detect display type in X11 mode (Display)
|
||||
* Assume displays connected via DisplayPort are external monitors (Display, Linux)
|
||||
* Support GPU frequency detection for Intel XE driver (GPU, Linux)
|
||||
* Detect init system on Android (InitSystem, Android)
|
||||
* Use background to display color blocks (Colors)
|
||||
* To fix weird vertical black lines in some terminals and match the behavior of neofetch (#1094)
|
||||
* Can be reverted to old behavior with `--colors-symbol block`
|
||||
* Support Zed terminal version detection (Terminal)
|
||||
* Improve wezterm font detection (TerminalFont)
|
||||
* Add option `--separator-length`
|
||||
* Support GPU frequency detection for Apple Silicon (GPU, macOS)
|
||||
* Detect maximum refresh rate (#1101, Monitor)
|
||||
* Detect if HDR mode is supported and enabled (Windows, Display / Monitor)
|
||||
* Support physical monitor info detection for FreeBSD and SunOS (Monitor)
|
||||
* Support defining constant strings in JSON config file, which can be used to dedupe formattion strings
|
||||
```jsonc
|
||||
{
|
||||
"display": {
|
||||
"constants": [
|
||||
"Hello", // {$1}
|
||||
"world" // {$2}
|
||||
]
|
||||
},
|
||||
"modules": [
|
||||
{
|
||||
"type": "custom",
|
||||
"format": "{$1} {$2}!" // print "Hello world!"
|
||||
},
|
||||
{
|
||||
"type": "custom",
|
||||
"format": "{$2} {$1}" // print "world Hello"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
Bugfixes:
|
||||
* Fix some presets
|
||||
* Better detection for XTerm terminal fonts (#1095, TerminalFont, Linux)
|
||||
* Remove debug output (#1097, Windows)
|
||||
* Fix command line option `--gpu-hide-type` doesn't work (#1098, GPU)
|
||||
* Fix wrong date on Raspbian 10 (#1108, DateTime, Linux)
|
||||
* Use `brightness` instead of `actuall_brightness` when detecting current brightness level (Brightness, Linux)
|
||||
* Ref: https://bugzilla.kernel.org/show_bug.cgi?id=203905
|
||||
* Fix buffer overflow with long font family names when detecting kitty term font (TerminalFont)
|
||||
* Fix some typos
|
||||
|
||||
Logos:
|
||||
* Update void_small
|
||||
* Add ALT Linux
|
||||
|
||||
# 2.18.1
|
||||
|
||||
Fix a regression introduced in v2.18.0
|
||||
|
||||
Changes:
|
||||
* `--ts-version` has been renamed to `--detect-version`
|
||||
* `general.detectVersion` in JSON config file
|
||||
|
||||
Bugfixes:
|
||||
* Fix and improve GPU driver detection (#1084, GPU, Linux)
|
||||
|
||||
# 2.18.0
|
||||
|
||||
Changes:
|
||||
* `yyjson 0.10.0` is required
|
||||
* Fastfetch no longer prints `*` (which means it's the default route) if `defaultRouteOnly` is set (LocalIP)
|
||||
|
||||
Bugfixes:
|
||||
* Fix some memory leaks
|
||||
* Fix compatibility with old Python versions
|
||||
* Don't detect frequency for AMD cards (GPU, Linux)
|
||||
* Fix possible hang with discrete AMD cards (#1077)
|
||||
* Don't print colors in `--pipe` mode (Separator)
|
||||
* Don't print `(null)` in property `locator` (PhysicalMemory)
|
||||
* Ignore disabled PCI devices (GPU)
|
||||
* Fix flag `--opengl-library` doesn't work (OpenGL)
|
||||
|
||||
Features:
|
||||
* Detect revision of USB drives (#1048, Disk)
|
||||
* Support fractional scale factor detection (Display, Linux)
|
||||
* Support primary display detection for KDE and GNOME (Display, Linux)
|
||||
* Support percent bar in custom formatting
|
||||
* Print signal quality by default (Wifi)
|
||||
* Detect used OpenGL library version (OpenGL)
|
||||
* Support detecting OpenGL version by `EGL` (ANGLE) on Windows (OpenGL)
|
||||
|
||||
Logos:
|
||||
* Add Arkane Linux
|
||||
* Add Opak
|
||||
|
||||
# 2.17.2
|
||||
|
||||
Changes:
|
||||
|
||||
+78
-33
@@ -1,7 +1,7 @@
|
||||
cmake_minimum_required(VERSION 3.12.0) # target_link_libraries with OBJECT libs & project homepage url
|
||||
|
||||
project(fastfetch
|
||||
VERSION 2.17.2
|
||||
VERSION 2.21.0
|
||||
LANGUAGES C
|
||||
DESCRIPTION "Fast neofetch-like system information tool"
|
||||
HOMEPAGE_URL "https://github.com/fastfetch-cli/fastfetch"
|
||||
@@ -17,7 +17,7 @@ if(ANDROID)
|
||||
elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
|
||||
set(LINUX TRUE CACHE BOOL "..." FORCE) # LINUX means GNU/Linux, not just the kernel
|
||||
elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "FreeBSD")
|
||||
set(BSD TRUE CACHE BOOL "..." FORCE)
|
||||
set(FreeBSD TRUE CACHE BOOL "..." FORCE)
|
||||
elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "SunOS")
|
||||
set(SunOS TRUE CACHE BOOL "..." FORCE)
|
||||
elseif(NOT APPLE AND NOT WIN32)
|
||||
@@ -44,28 +44,27 @@ include(CheckIncludeFile)
|
||||
|
||||
include(CMakeDependentOption)
|
||||
|
||||
cmake_dependent_option(ENABLE_VULKAN "Enable vulkan" ON "LINUX OR APPLE OR BSD OR WIN32 OR ANDROID OR SunOS" OFF)
|
||||
cmake_dependent_option(ENABLE_WAYLAND "Enable wayland-client" ON "LINUX OR BSD" OFF)
|
||||
cmake_dependent_option(ENABLE_XCB_RANDR "Enable xcb-randr" ON "LINUX OR BSD OR SunOS" OFF)
|
||||
cmake_dependent_option(ENABLE_XCB "Enable xcb" ON "LINUX OR BSD OR SunOS" OFF)
|
||||
cmake_dependent_option(ENABLE_XRANDR "Enable xrandr" ON "LINUX OR BSD OR SunOS" OFF)
|
||||
cmake_dependent_option(ENABLE_X11 "Enable x11" ON "LINUX OR BSD OR SunOS" OFF)
|
||||
cmake_dependent_option(ENABLE_DRM "Enable libdrm" ON "LINUX OR BSD OR SunOS" OFF)
|
||||
cmake_dependent_option(ENABLE_GIO "Enable gio-2.0" ON "LINUX OR BSD OR SunOS" OFF)
|
||||
cmake_dependent_option(ENABLE_DCONF "Enable dconf" ON "LINUX OR BSD OR SunOS" OFF)
|
||||
cmake_dependent_option(ENABLE_DBUS "Enable dbus-1" ON "LINUX OR BSD OR SunOS" OFF)
|
||||
cmake_dependent_option(ENABLE_XFCONF "Enable libxfconf-0" ON "LINUX OR BSD OR SunOS" OFF)
|
||||
cmake_dependent_option(ENABLE_SQLITE3 "Enable sqlite3" ON "LINUX OR BSD OR APPLE OR SunOS" OFF)
|
||||
cmake_dependent_option(ENABLE_VULKAN "Enable vulkan" ON "LINUX OR APPLE OR FreeBSD OR WIN32 OR ANDROID OR SunOS" OFF)
|
||||
cmake_dependent_option(ENABLE_WAYLAND "Enable wayland-client" ON "LINUX OR FreeBSD" OFF)
|
||||
cmake_dependent_option(ENABLE_XCB_RANDR "Enable xcb-randr" ON "LINUX OR FreeBSD OR SunOS" OFF)
|
||||
cmake_dependent_option(ENABLE_XCB "Enable xcb" ON "LINUX OR FreeBSD OR SunOS" OFF)
|
||||
cmake_dependent_option(ENABLE_XRANDR "Enable xrandr" ON "LINUX OR FreeBSD OR SunOS" OFF)
|
||||
cmake_dependent_option(ENABLE_X11 "Enable x11" ON "LINUX OR FreeBSD OR SunOS" OFF)
|
||||
cmake_dependent_option(ENABLE_DRM "Enable libdrm" ON "LINUX OR FreeBSD OR SunOS" OFF)
|
||||
cmake_dependent_option(ENABLE_GIO "Enable gio-2.0" ON "LINUX OR FreeBSD OR SunOS" OFF)
|
||||
cmake_dependent_option(ENABLE_DCONF "Enable dconf" ON "LINUX OR FreeBSD OR SunOS" OFF)
|
||||
cmake_dependent_option(ENABLE_DBUS "Enable dbus-1" ON "LINUX OR FreeBSD OR SunOS" OFF)
|
||||
cmake_dependent_option(ENABLE_XFCONF "Enable libxfconf-0" ON "LINUX OR FreeBSD OR SunOS" OFF)
|
||||
cmake_dependent_option(ENABLE_SQLITE3 "Enable sqlite3" ON "LINUX OR FreeBSD OR APPLE OR SunOS" OFF)
|
||||
cmake_dependent_option(ENABLE_RPM "Enable rpm" ON "LINUX" OFF)
|
||||
cmake_dependent_option(ENABLE_IMAGEMAGICK7 "Enable imagemagick 7" ON "LINUX OR BSD OR APPLE OR WIN32 OR SunOS" OFF)
|
||||
cmake_dependent_option(ENABLE_IMAGEMAGICK6 "Enable imagemagick 6" ON "LINUX OR BSD OR APPLE OR SunOS" OFF)
|
||||
cmake_dependent_option(ENABLE_IMAGEMAGICK7 "Enable imagemagick 7" ON "LINUX OR FreeBSD OR APPLE OR WIN32 OR SunOS" OFF)
|
||||
cmake_dependent_option(ENABLE_IMAGEMAGICK6 "Enable imagemagick 6" ON "LINUX OR FreeBSD OR APPLE OR SunOS" OFF)
|
||||
cmake_dependent_option(ENABLE_CHAFA "Enable chafa" ON "ENABLE_IMAGEMAGICK6 OR ENABLE_IMAGEMAGICK7" OFF)
|
||||
cmake_dependent_option(ENABLE_ZLIB "Enable zlib" ON "ENABLE_IMAGEMAGICK6 OR ENABLE_IMAGEMAGICK7" OFF)
|
||||
cmake_dependent_option(ENABLE_EGL "Enable egl" ON "LINUX OR BSD OR SunOS" OFF)
|
||||
cmake_dependent_option(ENABLE_GLX "Enable glx" ON "LINUX OR BSD OR SunOS" OFF)
|
||||
cmake_dependent_option(ENABLE_OSMESA "Enable osmesa" ON "LINUX OR BSD OR SunOS" OFF)
|
||||
cmake_dependent_option(ENABLE_OPENCL "Enable opencl" ON "LINUX OR BSD OR WIN32 OR ANDROID OR SunOS" OFF)
|
||||
cmake_dependent_option(ENABLE_LIBNM "Enable libnm" ON "LINUX" OFF)
|
||||
cmake_dependent_option(ENABLE_EGL "Enable egl" ON "LINUX OR FreeBSD OR WIN32 OR SunOS" OFF)
|
||||
cmake_dependent_option(ENABLE_GLX "Enable glx" ON "LINUX OR FreeBSD OR SunOS" OFF)
|
||||
cmake_dependent_option(ENABLE_OSMESA "Enable osmesa" ON "LINUX OR FreeBSD OR SunOS" OFF)
|
||||
cmake_dependent_option(ENABLE_OPENCL "Enable opencl" ON "LINUX OR FreeBSD OR WIN32 OR ANDROID OR SunOS" OFF)
|
||||
cmake_dependent_option(ENABLE_FREETYPE "Enable freetype" ON "ANDROID" OFF)
|
||||
cmake_dependent_option(ENABLE_PULSE "Enable pulse" ON "LINUX OR SunOS" OFF)
|
||||
cmake_dependent_option(ENABLE_DDCUTIL "Enable ddcutil" ON "LINUX" OFF)
|
||||
@@ -294,6 +293,7 @@ set(LIBFASTFETCH_SRC
|
||||
src/common/properties.c
|
||||
src/common/settings.c
|
||||
src/common/temps.c
|
||||
src/detection/bluetoothradio/bluetoothradio.c
|
||||
src/detection/bootmgr/bootmgr.c
|
||||
src/detection/chassis/chassis.c
|
||||
src/detection/cpu/cpu.c
|
||||
@@ -307,6 +307,7 @@ set(LIBFASTFETCH_SRC
|
||||
src/detection/media/media.c
|
||||
src/detection/netio/netio.c
|
||||
src/detection/opencl/opencl.c
|
||||
src/detection/opengl/opengl_shared.c
|
||||
src/detection/os/os.c
|
||||
src/detection/packages/packages.c
|
||||
src/detection/physicalmemory/physicalmemory.c
|
||||
@@ -325,6 +326,7 @@ set(LIBFASTFETCH_SRC
|
||||
src/modules/battery/battery.c
|
||||
src/modules/bios/bios.c
|
||||
src/modules/bluetooth/bluetooth.c
|
||||
src/modules/bluetoothradio/bluetoothradio.c
|
||||
src/modules/board/board.c
|
||||
src/modules/bootmgr/bootmgr.c
|
||||
src/modules/brightness/brightness.c
|
||||
@@ -395,6 +397,7 @@ set(LIBFASTFETCH_SRC
|
||||
src/options/general.c
|
||||
src/options/library.c
|
||||
src/util/edidHelper.c
|
||||
src/util/base64.c
|
||||
src/util/FFlist.c
|
||||
src/util/FFstrbuf.c
|
||||
src/util/platform/FFPlatform.c
|
||||
@@ -419,6 +422,7 @@ if(LINUX)
|
||||
src/detection/cpuusage/cpuusage_linux.c
|
||||
src/detection/cursor/cursor_linux.c
|
||||
src/detection/bluetooth/bluetooth_linux.c
|
||||
src/detection/bluetoothradio/bluetoothradio_linux.c
|
||||
src/detection/disk/disk_linux.c
|
||||
src/detection/dns/dns_linux.c
|
||||
src/detection/physicaldisk/physicaldisk_linux.c
|
||||
@@ -429,7 +433,11 @@ if(LINUX)
|
||||
src/detection/displayserver/linux/wayland/wayland.c
|
||||
src/detection/displayserver/linux/wayland/global-output.c
|
||||
src/detection/displayserver/linux/wayland/zwlr-output.c
|
||||
src/detection/displayserver/linux/wayland/kde-output.c
|
||||
src/detection/displayserver/linux/wayland/wlr-output-management-unstable-v1-protocol.c
|
||||
src/detection/displayserver/linux/wayland/kde-output-device-v2-protocol.c
|
||||
src/detection/displayserver/linux/wayland/kde-output-order-v1-protocol.c
|
||||
src/detection/displayserver/linux/wayland/xdg-output-unstable-v1-protocol.c
|
||||
src/detection/displayserver/linux/wmde.c
|
||||
src/detection/displayserver/linux/xcb.c
|
||||
src/detection/displayserver/linux/xlib.c
|
||||
@@ -482,6 +490,7 @@ elseif(ANDROID)
|
||||
src/detection/battery/battery_android.c
|
||||
src/detection/bios/bios_android.c
|
||||
src/detection/bluetooth/bluetooth_nosupport.c
|
||||
src/detection/bluetoothradio/bluetoothradio_nosupport.c
|
||||
src/detection/board/board_android.c
|
||||
src/detection/bootmgr/bootmgr_nosupport.c
|
||||
src/detection/brightness/brightness_nosupport.c
|
||||
@@ -533,7 +542,7 @@ elseif(ANDROID)
|
||||
src/detection/camera/camera_android.c
|
||||
src/util/platform/FFPlatform_unix.c
|
||||
)
|
||||
elseif(BSD)
|
||||
elseif(FreeBSD)
|
||||
list(APPEND LIBFASTFETCH_SRC
|
||||
src/common/dbus.c
|
||||
src/common/io/io_unix.c
|
||||
@@ -544,6 +553,7 @@ elseif(BSD)
|
||||
src/detection/battery/battery_bsd.c
|
||||
src/detection/bios/bios_bsd.c
|
||||
src/detection/bluetooth/bluetooth_linux.c
|
||||
src/detection/bluetoothradio/bluetoothradio_linux.c
|
||||
src/detection/board/board_bsd.c
|
||||
src/detection/bootmgr/bootmgr_bsd.c
|
||||
src/detection/brightness/brightness_bsd.c
|
||||
@@ -562,7 +572,11 @@ elseif(BSD)
|
||||
src/detection/displayserver/linux/wayland/wayland.c
|
||||
src/detection/displayserver/linux/wayland/global-output.c
|
||||
src/detection/displayserver/linux/wayland/zwlr-output.c
|
||||
src/detection/displayserver/linux/wayland/kde-output.c
|
||||
src/detection/displayserver/linux/wayland/wlr-output-management-unstable-v1-protocol.c
|
||||
src/detection/displayserver/linux/wayland/kde-output-device-v2-protocol.c
|
||||
src/detection/displayserver/linux/wayland/kde-output-order-v1-protocol.c
|
||||
src/detection/displayserver/linux/wayland/xdg-output-unstable-v1-protocol.c
|
||||
src/detection/displayserver/linux/wmde.c
|
||||
src/detection/displayserver/linux/xcb.c
|
||||
src/detection/displayserver/linux/xlib.c
|
||||
@@ -581,7 +595,7 @@ elseif(BSD)
|
||||
src/detection/gamepad/gamepad_bsd.c
|
||||
src/detection/media/media_linux.c
|
||||
src/detection/memory/memory_bsd.c
|
||||
src/detection/monitor/monitor_nosupport.c
|
||||
src/detection/monitor/monitor_linux.c
|
||||
src/detection/netio/netio_bsd.c
|
||||
src/detection/opengl/opengl_linux.c
|
||||
src/detection/os/os_linux.c
|
||||
@@ -616,6 +630,7 @@ elseif(APPLE)
|
||||
src/detection/battery/battery_apple.c
|
||||
src/detection/bios/bios_apple.c
|
||||
src/detection/bluetooth/bluetooth_apple.m
|
||||
src/detection/bluetoothradio/bluetoothradio_apple.m
|
||||
src/detection/board/board_apple.c
|
||||
src/detection/bootmgr/bootmgr_apple.c
|
||||
src/detection/brightness/brightness_apple.c
|
||||
@@ -679,6 +694,7 @@ elseif(WIN32)
|
||||
src/detection/battery/battery_windows.c
|
||||
src/detection/bios/bios_windows.c
|
||||
src/detection/bluetooth/bluetooth_windows.c
|
||||
src/detection/bluetoothradio/bluetoothradio_windows.c
|
||||
src/detection/board/board_windows.c
|
||||
src/detection/bootmgr/bootmgr_windows.c
|
||||
src/detection/brightness/brightness_windows.cpp
|
||||
@@ -753,6 +769,7 @@ elseif(SunOS)
|
||||
src/detection/cpuusage/cpuusage_sunos.c
|
||||
src/detection/cursor/cursor_linux.c
|
||||
src/detection/bluetooth/bluetooth_nosupport.c
|
||||
src/detection/bluetoothradio/bluetoothradio_nosupport.c
|
||||
src/detection/disk/disk_sunos.c
|
||||
src/detection/dns/dns_linux.c
|
||||
src/detection/physicaldisk/physicaldisk_nosupport.c
|
||||
@@ -763,7 +780,11 @@ elseif(SunOS)
|
||||
src/detection/displayserver/linux/wayland/wayland.c
|
||||
src/detection/displayserver/linux/wayland/global-output.c
|
||||
src/detection/displayserver/linux/wayland/zwlr-output.c
|
||||
src/detection/displayserver/linux/wayland/kde-output.c
|
||||
src/detection/displayserver/linux/wayland/wlr-output-management-unstable-v1-protocol.c
|
||||
src/detection/displayserver/linux/wayland/kde-output-device-v2-protocol.c
|
||||
src/detection/displayserver/linux/wayland/kde-output-order-v1-protocol.c
|
||||
src/detection/displayserver/linux/wayland/xdg-output-unstable-v1-protocol.c
|
||||
src/detection/displayserver/linux/wmde.c
|
||||
src/detection/displayserver/linux/xcb.c
|
||||
src/detection/displayserver/linux/xlib.c
|
||||
@@ -782,7 +803,7 @@ elseif(SunOS)
|
||||
src/detection/gamepad/gamepad_nosupport.c
|
||||
src/detection/media/media_linux.c
|
||||
src/detection/memory/memory_sunos.c
|
||||
src/detection/monitor/monitor_nosupport.c
|
||||
src/detection/monitor/monitor_linux.c
|
||||
src/detection/netio/netio_sunos.c
|
||||
src/detection/opengl/opengl_linux.c
|
||||
src/detection/os/os_sunos.c
|
||||
@@ -814,14 +835,14 @@ if(ENABLE_DIRECTX_HEADERS)
|
||||
endif()
|
||||
|
||||
# Proprietary GPU driver APIs
|
||||
if(LINUX OR BSD OR WIN32)
|
||||
if(LINUX OR FreeBSD OR WIN32)
|
||||
list(APPEND LIBFASTFETCH_SRC src/detection/gpu/gpu_nvidia.c)
|
||||
list(APPEND LIBFASTFETCH_SRC src/detection/gpu/gpu_mthreads.c)
|
||||
endif()
|
||||
if(WIN32)
|
||||
list(APPEND LIBFASTFETCH_SRC src/detection/gpu/gpu_intel.c)
|
||||
list(APPEND LIBFASTFETCH_SRC src/detection/gpu/gpu_amd.c)
|
||||
endif()
|
||||
|
||||
include(CheckFunctionExists)
|
||||
check_function_exists(wcwidth HAVE_WCWIDTH)
|
||||
if(NOT HAVE_WCWIDTH)
|
||||
@@ -874,7 +895,7 @@ if(APPLE AND EXISTS "/usr/bin/otool")
|
||||
target_compile_definitions(libfastfetch PUBLIC FF_LIBSYSTEM_VERSION="${CMAKE_MATCH_1}")
|
||||
endif()
|
||||
endif()
|
||||
if(BSD AND EXISTS "/usr/local/bin/objdump")
|
||||
if(FreeBSD AND EXISTS "/usr/local/bin/objdump")
|
||||
execute_process(COMMAND /bin/sh -c "/usr/local/bin/objdump -T /lib/libc.so.* | grep 'FBSD_[^ )]*' -o | sort -Vru | head -1"
|
||||
OUTPUT_VARIABLE OBJDUMP_T_RESULT)
|
||||
if("${OBJDUMP_T_RESULT}" MATCHES "FBSD_([0-9]+\\.[0-9]+)")
|
||||
@@ -1042,10 +1063,6 @@ ff_lib_enable(OPENCL
|
||||
"OpenCL"
|
||||
"OpenCL"
|
||||
)
|
||||
ff_lib_enable(LIBNM
|
||||
"libnm"
|
||||
"libnm"
|
||||
)
|
||||
ff_lib_enable(FREETYPE
|
||||
"freetype2"
|
||||
"FreeType2"
|
||||
@@ -1111,7 +1128,7 @@ elseif(WIN32)
|
||||
PRIVATE "hid"
|
||||
PRIVATE "wtsapi32"
|
||||
)
|
||||
elseif(BSD)
|
||||
elseif(FreeBSD)
|
||||
target_link_libraries(libfastfetch
|
||||
PRIVATE "m"
|
||||
PRIVATE "usbhid"
|
||||
@@ -1164,7 +1181,35 @@ if(WIN32)
|
||||
PRIVATE "-static" # stdc++, winpthread, gcc_s, etc.
|
||||
)
|
||||
endif()
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
endif()
|
||||
if(LINUX)
|
||||
CHECK_INCLUDE_FILE("linux/videodev2.h" HAVE_LINUX_VIDEODEV2)
|
||||
if(HAVE_LINUX_VIDEODEV2)
|
||||
target_compile_definitions(libfastfetch PRIVATE FF_HAVE_LINUX_VIDEODEV2=1)
|
||||
endif()
|
||||
CHECK_INCLUDE_FILE("linux/wireless.h" HAVE_LINUX_WIRELESS)
|
||||
if(HAVE_LINUX_WIRELESS)
|
||||
target_compile_definitions(libfastfetch PRIVATE FF_HAVE_LINUX_WIRELESS=1)
|
||||
endif()
|
||||
endif()
|
||||
if(NOT WIN32)
|
||||
CHECK_INCLUDE_FILE("utmpx.h" HAVE_UTMPX)
|
||||
if(HAVE_UTMPX)
|
||||
target_compile_definitions(libfastfetch PRIVATE FF_HAVE_UTMPX=1)
|
||||
endif()
|
||||
CHECK_INCLUDE_FILE("wordexp.h" HAVE_WORDEXP)
|
||||
if(HAVE_WORDEXP)
|
||||
target_compile_definitions(libfastfetch PRIVATE FF_HAVE_WORDEXP=1)
|
||||
endif()
|
||||
CHECK_INCLUDE_FILE("pthread_np.h" HAVE_PTHREAD_NP)
|
||||
if(HAVE_PTHREAD_NP)
|
||||
target_compile_definitions(libfastfetch PRIVATE FF_HAVE_PTHREAD_NP=1)
|
||||
endif()
|
||||
check_function_exists("pthread_timedjoin_np" HAVE_TIMEDJOIN_NP)
|
||||
if(HAVE_TIMEDJOIN_NP)
|
||||
target_compile_definitions(libfastfetch PRIVATE FF_HAVE_TIMEDJOIN_NP=1)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
######################
|
||||
|
||||
@@ -126,6 +126,12 @@ Fastfetch uses JSON (with comments) for configuration. I suggest you use an IDE
|
||||
|
||||
Alternatively, you can refer to the presets in [`presets` directory](https://github.com/fastfetch-cli/fastfetch/tree/dev/presets).
|
||||
|
||||
The **correct** way to edit the configuration:
|
||||
|
||||
This is an example that [changes size prefix from MiB / GiB to MB / GB](https://github.com/fastfetch-cli/fastfetch/discussions/1014). Editor used: [helix](https://github.com/helix-editor/helix)
|
||||
|
||||
[](https://asciinema.org/a/1uF6sTPGKrHKI1MVaFcikINSQ)
|
||||
|
||||
### Q: I WANT THE DOCUMENTATION!
|
||||
|
||||
[Here is the documentation](https://github.com/fastfetch-cli/fastfetch/wiki/Json-Schema). It is generated from [JSON schema](https://github.com/fastfetch-cli/fastfetch/blob/dev/doc/json_schema.json) but you won't like it.
|
||||
@@ -169,6 +175,10 @@ The p10k doc clearly states that you should NOT print anything to stdout after `
|
||||
|
||||
You can always use `fastfetch --pipe false` to force fastfetch running in colorful mode.
|
||||
|
||||
### Q: Why do fastfetch and neofetch show different memory usage result?
|
||||
|
||||
See [#1096](https://github.com/fastfetch-cli/fastfetch/issues/1096).
|
||||
|
||||
### Q: I want feature A / B / C. Will fastfetch support it?
|
||||
|
||||
Fastfetch is a system information tool. We only accept hardware or system level software feature requests. For most personal uses, I recommend using `Command` module to detect it yourself, which can be used to grab output from a custom shell script:
|
||||
|
||||
@@ -83,12 +83,12 @@ __fastfetch_complete_logo_type()
|
||||
|
||||
__fastfetch_complete_binary_prefix()
|
||||
{
|
||||
local __ff_binary_prefixes=(
|
||||
local __ff_size_binary_prefixes=(
|
||||
"iec"
|
||||
"si"
|
||||
"jedec"
|
||||
)
|
||||
COMPREPLY=($(compgen -W "${__ff_binary_prefixes[*]}" -- "$CURRENT_WORD"))
|
||||
COMPREPLY=($(compgen -W "${__ff_size_binary_prefixes[*]}" -- "$CURRENT_WORD"))
|
||||
}
|
||||
|
||||
__fastfetch_complete_gl()
|
||||
@@ -356,7 +356,6 @@ __fastfetch_completion()
|
||||
local FF_OPTIONS_PATH=(
|
||||
"-c"
|
||||
"--config"
|
||||
"--lib-pci"
|
||||
"--lib-vulkan"
|
||||
"--lib-wayland"
|
||||
"--lib-xcb-randr"
|
||||
|
||||
+44
-47
@@ -54,51 +54,48 @@ function __fastfetch_complete_structure
|
||||
end
|
||||
end
|
||||
|
||||
string match -r -a -g "^###> ?(.*)" < (status -f) | string collect | python3 | source
|
||||
echo '
|
||||
import json, subprocess, sys
|
||||
|
||||
###> #!/usr/bin/env python3
|
||||
###>
|
||||
###> import json, subprocess, sys
|
||||
###>
|
||||
###> def main():
|
||||
###> data: dict[str, list[dict]] = json.loads(subprocess.check_output(['fastfetch', '--help-raw']))
|
||||
###>
|
||||
###> for key in data:
|
||||
###> for flag in data[key]:
|
||||
###> if flag.get('pseudo', False):
|
||||
###> continue
|
||||
###>
|
||||
###> command_prefix: str = f'complete -c fastfetch -d "{flag["desc"]}" -l "{flag["long"]}"';
|
||||
###> if 'short' in flag:
|
||||
###> command_prefix += f' -o "{flag["short"]}"'
|
||||
###>
|
||||
###> if 'arg' in flag:
|
||||
###> type: str = flag['arg']['type'];
|
||||
###> if type == 'bool':
|
||||
###> print(f'{command_prefix} -x -a "(__fastfetch_complete_bool)"')
|
||||
###> elif type == 'color':
|
||||
###> print(f'{command_prefix} -x -a "(__fastfetch_complete_color)"')
|
||||
###> elif type == 'command':
|
||||
###> print(f'{command_prefix} -x -a "(__fastfetch_complete_command)"')
|
||||
###> elif type == 'config':
|
||||
###> print(f'{command_prefix} -x -a "(__fastfetch_complete_config)"')
|
||||
###> elif type == 'enum':
|
||||
###> temp: str = ' '.join(flag["arg"]["enum"])
|
||||
###> print(f'{command_prefix} -x -a "{temp}"')
|
||||
###> elif type == 'logo':
|
||||
###> print(f'{command_prefix} -x -a "(__fastfetch_complete_logo)"')
|
||||
###> elif type == 'structure':
|
||||
###> print(f'{command_prefix} -x -a "(__fish_complete_list : __fastfetch_complete_structure)"')
|
||||
###> elif type == 'path':
|
||||
###> print(f'{command_prefix} -r -F')
|
||||
###> else:
|
||||
###> print(f'{command_prefix} -x')
|
||||
###> else:
|
||||
###> print(f'{command_prefix} -f')
|
||||
###>
|
||||
###> if __name__ == "__main__":
|
||||
###> try:
|
||||
###> main()
|
||||
###> except:
|
||||
###> sys.exit(1)
|
||||
###>
|
||||
def main():
|
||||
data: dict[str, list[dict]] = json.loads(subprocess.check_output(["fastfetch", "--help-raw"]))
|
||||
|
||||
for key in data:
|
||||
for flag in data[key]:
|
||||
if flag.get("pseudo", False):
|
||||
continue
|
||||
|
||||
command_prefix = f"""complete -c fastfetch -d "{flag["desc"]}" -l "{flag["long"]}\""""
|
||||
if "short" in flag:
|
||||
command_prefix += f""" -o {flag["short"]}"""
|
||||
|
||||
if "arg" in flag:
|
||||
type: str = flag["arg"]["type"];
|
||||
if type == "bool":
|
||||
print(f"{command_prefix} -x -a \"(__fastfetch_complete_bool)\"")
|
||||
elif type == "color":
|
||||
print(f"{command_prefix} -x -a \"(__fastfetch_complete_color)\"")
|
||||
elif type == "command":
|
||||
print(f"{command_prefix} -x -a \"(__fastfetch_complete_command)\"")
|
||||
elif type == "config":
|
||||
print(f"{command_prefix} -x -a \"(__fastfetch_complete_config)\"")
|
||||
elif type == "enum":
|
||||
temp: str = " ".join(flag["arg"]["enum"])
|
||||
print(f"{command_prefix} -x -a \"{temp}\"")
|
||||
elif type == "logo":
|
||||
print(f"{command_prefix} -x -a \"(__fastfetch_complete_logo)\"")
|
||||
elif type == "structure":
|
||||
print(f"{command_prefix} -x -a \"(__fish_complete_list : __fastfetch_complete_structure)\"")
|
||||
elif type == "path":
|
||||
print(f"{command_prefix} -r -F")
|
||||
else:
|
||||
print(f"{command_prefix} -x")
|
||||
else:
|
||||
print(f"{command_prefix} -f")
|
||||
|
||||
if __name__ == "__main__":
|
||||
try:
|
||||
main()
|
||||
except:
|
||||
sys.exit(1)
|
||||
' | python3 | source
|
||||
|
||||
Vendored
+30
@@ -1,3 +1,33 @@
|
||||
fastfetch (2.19.1) jammy; urgency=medium
|
||||
|
||||
* Update to 2.19.1
|
||||
|
||||
-- Carter Li <zhangsongcui@live.cn> Tue, 23 Jul 2024 10:25:14 +0800
|
||||
|
||||
fastfetch (2.19.0) jammy; urgency=medium
|
||||
|
||||
* Update to 2.19.0
|
||||
|
||||
-- Carter Li <zhangsongcui@live.cn> Mon, 22 Jul 2024 14:17:55 +0800
|
||||
|
||||
fastfetch (2.18.1) jammy; urgency=medium
|
||||
|
||||
* Update to 2.18.1
|
||||
|
||||
-- Carter Li <zhangsongcui@live.cn> Thu, 11 Jul 2024 14:32:15 +0800
|
||||
|
||||
fastfetch (2.18.0) jammy; urgency=medium
|
||||
|
||||
* Update to 2.18.0
|
||||
|
||||
-- Carter Li <zhangsongcui@live.cn> Wed, 10 Jul 2024 16:46:32 +0800
|
||||
|
||||
fastfetch (2.17.2) jammy; urgency=medium
|
||||
|
||||
* Update to 2.17.2
|
||||
|
||||
-- Carter Li <zhangsongcui@live.cn> Thu, 04 Jul 2024 10:22:44 +0800
|
||||
|
||||
fastfetch (2.17.1) jammy; urgency=medium
|
||||
|
||||
* Update to 2.17.1
|
||||
|
||||
Vendored
+1
-1
@@ -2,7 +2,7 @@ Source: fastfetch
|
||||
Section: universe/utils
|
||||
Priority: optional
|
||||
Maintainer: Carter Li <zhangsongcui@live.cn>
|
||||
Build-Depends: libvulkan-dev, libwayland-dev, libxrandr-dev, libxcb-randr0-dev, libdconf-dev, libdbus-1-dev, libmagickcore-dev, libxfconf-0-dev, libsqlite3-dev, librpm-dev, libegl-dev, libglx-dev, libosmesa6-dev, ocl-icd-opencl-dev, libnm-dev, libpulse-dev, libdrm-dev, libddcutil-dev, libchafa-dev, directx-headers-dev, pkgconf, cmake (>= 3.12), debhelper (>= 11.2), dh-cmake, dh-cmake-compat (= 1), dh-sequence-cmake, dh-sequence-ctest, ninja-build
|
||||
Build-Depends: libvulkan-dev, libwayland-dev, libxrandr-dev, libxcb-randr0-dev, libdconf-dev, libdbus-1-dev, libmagickcore-dev, libxfconf-0-dev, libsqlite3-dev, librpm-dev, libegl-dev, libglx-dev, libosmesa6-dev, ocl-icd-opencl-dev, libpulse-dev, libdrm-dev, libddcutil-dev, libchafa-dev, directx-headers-dev, pkgconf, cmake (>= 3.12), debhelper (>= 11.2), dh-cmake, dh-cmake-compat (= 1), dh-sequence-cmake, dh-sequence-ctest, ninja-build
|
||||
Standards-Version: 4.0.0
|
||||
Homepage: https://github.com/fastfetch-cli/fastfetch
|
||||
|
||||
|
||||
Vendored
+1
-1
@@ -1 +1 @@
|
||||
fastfetch_2.17.1_source.buildinfo universe/utils optional
|
||||
fastfetch_2.19.1_source.buildinfo universe/utils optional
|
||||
|
||||
+1
-1
@@ -98,7 +98,7 @@ config files, see the CONFIGURATION section
|
||||
|
||||
.B \-\-gen\-config \fI[file]
|
||||
Generate a config file with options specified on the command line.
|
||||
If \fIfile\fR is specified, the configuration will written to the
|
||||
If \fIfile\fR is specified, the configuration will be written to the
|
||||
file, otherwise it will be written to stdout.
|
||||
.TP
|
||||
|
||||
|
||||
+289
-116
@@ -22,6 +22,10 @@
|
||||
"minimum": 0,
|
||||
"default": 0
|
||||
},
|
||||
"keyIcon": {
|
||||
"description": "Set the icon to be displayed by `display.keyType: \"icon\"`",
|
||||
"type": "string"
|
||||
},
|
||||
"format": {
|
||||
"description": "Output format of the module. See `-h <module>-format` for detail. I.e: fastfetch -h disk-format",
|
||||
"type": "string"
|
||||
@@ -339,6 +343,11 @@
|
||||
"type": "string",
|
||||
"description": "Set the command to be executed before printing logos",
|
||||
"default": ""
|
||||
},
|
||||
"showVersion": {
|
||||
"type": "boolean",
|
||||
"description": "Whether to detect and display component versions. Mainly for benchmarking",
|
||||
"default": true
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -413,35 +422,59 @@
|
||||
"type": "boolean",
|
||||
"default": true
|
||||
},
|
||||
"keyWidth": {
|
||||
"description": "Align the width of keys to number of characters, 0 to disable",
|
||||
"type": "integer",
|
||||
"minimum": 0,
|
||||
"default": 0
|
||||
},
|
||||
"binaryPrefix": {
|
||||
"type": "string",
|
||||
"description": "Set the binary prefix to used when printing bytes",
|
||||
"oneOf": [
|
||||
{
|
||||
"const": "iec",
|
||||
"description": "1024 Bytes = 1 KiB, 1024 KiB = 1 MiB, ... (standard)"
|
||||
"key": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"description": "Set how module keys should be displayed",
|
||||
"properties": {
|
||||
"width": {
|
||||
"description": "Align the width of keys to number of characters, 0 to disable",
|
||||
"type": "integer",
|
||||
"minimum": 0,
|
||||
"default": 0
|
||||
},
|
||||
{
|
||||
"const": "si",
|
||||
"description": "1000 Bytes = 1 KB, 1000 KB = 1 MB, ..."
|
||||
"type": {
|
||||
"type": "string",
|
||||
"description": "Set whether to show icon before string keys",
|
||||
"enum": [
|
||||
"none",
|
||||
"string",
|
||||
"icon",
|
||||
"both"
|
||||
],
|
||||
"default": "string"
|
||||
},
|
||||
{
|
||||
"const": "jedec",
|
||||
"description": "1024 Bytes = 1 kB, 1024 K = 1 MB, ..."
|
||||
"paddingLeft": {
|
||||
"type": "integer",
|
||||
"description": "Set the left padding of keys",
|
||||
"minimum": 0,
|
||||
"default": 0
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"size": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"description": "Set how a size value should be displayed",
|
||||
"properties": {
|
||||
"binaryPrefix": {
|
||||
"type": "string",
|
||||
"description": "Set the binary prefix to used when formatting sizes",
|
||||
"oneOf": [
|
||||
{
|
||||
"const": "iec",
|
||||
"description": "1024 Bytes = 1 KiB, 1024 KiB = 1 MiB, ... (standard)"
|
||||
},
|
||||
{
|
||||
"const": "si",
|
||||
"description": "1000 Bytes = 1 KB, 1000 KB = 1 MB, ..."
|
||||
},
|
||||
{
|
||||
"const": "jedec",
|
||||
"description": "1024 Bytes = 1 kB, 1024 K = 1 MB, ..."
|
||||
}
|
||||
]
|
||||
},
|
||||
"maxPrefix": {
|
||||
"type": "string",
|
||||
"description": "Set the largest binary prefix to use when formatting sizes",
|
||||
@@ -569,15 +602,31 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"freq": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"description": "Set how frequency values should be displayed",
|
||||
"properties": {
|
||||
"ndigits": {
|
||||
"type": "integer",
|
||||
"description": "Set the number of digits to keep after the decimal point when formatting frequency values\nA positive value will show the frequency in GHz of decimal\n-1 will show the frequency in MHz",
|
||||
"minimum": -1,
|
||||
"maximum": 9,
|
||||
"default": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
"noBuffer": {
|
||||
"type": "boolean",
|
||||
"description": "Whether to disable the stdout application buffer",
|
||||
"default": false
|
||||
},
|
||||
"tsVersion": {
|
||||
"type": "boolean",
|
||||
"description": "Whether to detect and display the version of terminal, shell and editor. Mainly for benchmarking",
|
||||
"default": true
|
||||
"constants": {
|
||||
"type": "array",
|
||||
"description": "List of strings to be used in custom format of modules",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -586,10 +635,6 @@
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"pci": {
|
||||
"type": "string",
|
||||
"description": "GPU output (Linux and FreeBSD)"
|
||||
},
|
||||
"vulkan": {
|
||||
"type": "string",
|
||||
"description": "Vulkan module & fallback for GPU output"
|
||||
@@ -604,39 +649,39 @@
|
||||
},
|
||||
"xcbRandr": {
|
||||
"type": "string",
|
||||
"description": "X11 sessions for better display detection and faster WM detection.\nThe *randr ones provide multi monitor support The libxcb* ones usually have better performance.\n (Linux, FreeBSD)"
|
||||
"description": "X11 sessions for better display detection and faster WM detection.\nThe *randr ones provide multi monitor support The libxcb* ones usually have better performance.\n (Linux, FreeBSD, SunOS)"
|
||||
},
|
||||
"xcb": {
|
||||
"type": "string",
|
||||
"description": "X11 sessions for better display detection and faster WM detection.\nThe *randr ones provide multi monitor support The libxcb* ones usually have better performance.\n (Linux, FreeBSD)"
|
||||
"description": "X11 sessions for better display detection and faster WM detection.\nThe *randr ones provide multi monitor support The libxcb* ones usually have better performance.\n (Linux, FreeBSD, SunOS)"
|
||||
},
|
||||
"xrandr": {
|
||||
"type": "string",
|
||||
"description": "X11 sessions for better display detection and faster WM detection.\nThe *randr ones provide multi monitor support The libxcb* ones usually have better performance.\n (Linux, FreeBSD)"
|
||||
"description": "X11 sessions for better display detection and faster WM detection.\nThe *randr ones provide multi monitor support The libxcb* ones usually have better performance.\n (Linux, FreeBSD, SunOS)"
|
||||
},
|
||||
"x11": {
|
||||
"type": "string",
|
||||
"description": "X11 sessions for better display detection and faster WM detection.\nThe *randr ones provide multi monitor support The libxcb* ones usually have better performance.\n (Linux, FreeBSD)"
|
||||
"description": "X11 sessions for better display detection and faster WM detection.\nThe *randr ones provide multi monitor support The libxcb* ones usually have better performance.\n (Linux, FreeBSD, SunOS)"
|
||||
},
|
||||
"drm": {
|
||||
"type": "string",
|
||||
"description": "Used for fast resolution and refresh rate detection (Linux)"
|
||||
"description": "Used for fast resolution and refresh rate detection (Linux, FreeBSD)"
|
||||
},
|
||||
"gio": {
|
||||
"type": "string",
|
||||
"description": "Needed for values that are only stored GSettings (Linux, FreeBSD)"
|
||||
"description": "Needed for values that are only stored GSettings (Linux, FreeBSD, SunOS)"
|
||||
},
|
||||
"dconf": {
|
||||
"type": "string",
|
||||
"description": "Needed for values that are only stored in DConf + Fallback for GSettings (Linux, FreeBSD)"
|
||||
"description": "Needed for values that are only stored in DConf + Fallback for GSettings (Linux, FreeBSD, SunOS)"
|
||||
},
|
||||
"dbus": {
|
||||
"type": "string",
|
||||
"description": "Bluetooth, Player & Media detection (Linux, FreeBSD)"
|
||||
"description": "Bluetooth, Player & Media detection (Linux, FreeBSD, SunOS)"
|
||||
},
|
||||
"xfconf": {
|
||||
"type": "string",
|
||||
"description": "Needed for XFWM theme and XFCE Terminal font (Linux, FreeBSD)"
|
||||
"description": "Needed for XFWM theme and XFCE Terminal font (Linux, FreeBSD, SunOS)"
|
||||
},
|
||||
"sqlite3": {
|
||||
"type": "string",
|
||||
@@ -648,34 +693,34 @@
|
||||
},
|
||||
"imagemagick": {
|
||||
"type": "string",
|
||||
"description": "Images in terminal using sixel or kitty graphics protocol (Linux, FreeBSD, macOS)"
|
||||
"description": "Images in terminal using sixel or kitty graphics protocol (Linux, FreeBSD, SunOS, macOS)"
|
||||
},
|
||||
"z": {
|
||||
"description": "Libz. Faster image output when using kitty graphics protocol (Linux, FreeBSD, macOS)",
|
||||
"description": "Libz. Faster image output when using kitty graphics protocol (Linux, FreeBSD, SunOS, macOS)",
|
||||
"type": "string"
|
||||
},
|
||||
"chafa": {
|
||||
"type": "string",
|
||||
"description": "Image output as ascii art (Linux, FreeBSD, macOS)"
|
||||
"description": "Image output as ascii art (Linux, FreeBSD, SunOS, macOS)"
|
||||
},
|
||||
"egl": {
|
||||
"type": "string",
|
||||
"description": "Needed by the OpenGL module for gl context creation (Linux, FreeBSD)"
|
||||
"description": "Library used by the OpenGL module for gl context creation (Linux, FreeBSD, SunOS, Windows)"
|
||||
},
|
||||
"glx": {
|
||||
"type": "string",
|
||||
"description": "Needed by the OpenGL module for gl context creation (Linux, FreeBSD)"
|
||||
"description": "Library used by the OpenGL module for gl context creation (Linux, FreeBSD, SunOS)"
|
||||
},
|
||||
"osmesa": {
|
||||
"type": "string",
|
||||
"description": "Needed by the OpenGL module for gl context creation (Linux, FreeBSD)"
|
||||
"description": "Library used by the OpenGL module for gl context creation (Linux, FreeBSD, SunOS)"
|
||||
},
|
||||
"opencl": {
|
||||
"type": "string",
|
||||
"description": "OpenCL module (Linux, FreeBSD, Windows)"
|
||||
"description": "OpenCL module (Linux, FreeBSD, SunOS, Windows)"
|
||||
},
|
||||
"pulse": {
|
||||
"description": "Pulseaudio. Used for Sound detection (Linux, FreeBSD)",
|
||||
"description": "Pulseaudio. Used for Sound detection (Linux, FreeBSD, SunOS)",
|
||||
"type": "string"
|
||||
},
|
||||
"nm": {
|
||||
@@ -700,6 +745,7 @@
|
||||
"battery",
|
||||
"bios",
|
||||
"bluetooth",
|
||||
"bluetoothradio",
|
||||
"board",
|
||||
"bootmgr",
|
||||
"break",
|
||||
@@ -944,12 +990,15 @@
|
||||
"keyColor": {
|
||||
"$ref": "#/$defs/keyColor"
|
||||
},
|
||||
"outputColor": {
|
||||
"$ref": "#/$defs/outputColor"
|
||||
"keyIcon": {
|
||||
"$ref": "#/$defs/keyIcon"
|
||||
},
|
||||
"keyWidth": {
|
||||
"$ref": "#/$defs/keyWidth"
|
||||
},
|
||||
"outputColor": {
|
||||
"$ref": "#/$defs/outputColor"
|
||||
},
|
||||
"format": {
|
||||
"$ref": "#/$defs/format"
|
||||
}
|
||||
@@ -981,12 +1030,15 @@
|
||||
"keyColor": {
|
||||
"$ref": "#/$defs/keyColor"
|
||||
},
|
||||
"outputColor": {
|
||||
"$ref": "#/$defs/outputColor"
|
||||
"keyIcon": {
|
||||
"$ref": "#/$defs/keyIcon"
|
||||
},
|
||||
"keyWidth": {
|
||||
"$ref": "#/$defs/keyWidth"
|
||||
},
|
||||
"outputColor": {
|
||||
"$ref": "#/$defs/outputColor"
|
||||
},
|
||||
"format": {
|
||||
"$ref": "#/$defs/format"
|
||||
}
|
||||
@@ -998,7 +1050,7 @@
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"type": {
|
||||
"description": "List bluetooth devices",
|
||||
"description": "List (connected) bluetooth devices",
|
||||
"const": "bluetooth"
|
||||
},
|
||||
"showDisconnected": {
|
||||
@@ -1015,12 +1067,44 @@
|
||||
"keyColor": {
|
||||
"$ref": "#/$defs/keyColor"
|
||||
},
|
||||
"outputColor": {
|
||||
"$ref": "#/$defs/outputColor"
|
||||
"keyIcon": {
|
||||
"$ref": "#/$defs/keyIcon"
|
||||
},
|
||||
"keyWidth": {
|
||||
"$ref": "#/$defs/keyWidth"
|
||||
},
|
||||
"outputColor": {
|
||||
"$ref": "#/$defs/outputColor"
|
||||
},
|
||||
"format": {
|
||||
"$ref": "#/$defs/format"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"title": "Bluetooth Radio",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"type": {
|
||||
"description": "List bluetooth radios width supported version and vendor",
|
||||
"const": "bluetoothradio"
|
||||
},
|
||||
"key": {
|
||||
"$ref": "#/$defs/key"
|
||||
},
|
||||
"keyColor": {
|
||||
"$ref": "#/$defs/keyColor"
|
||||
},
|
||||
"keyIcon": {
|
||||
"$ref": "#/$defs/keyIcon"
|
||||
},
|
||||
"keyWidth": {
|
||||
"$ref": "#/$defs/keyWidth"
|
||||
},
|
||||
"outputColor": {
|
||||
"$ref": "#/$defs/outputColor"
|
||||
},
|
||||
"format": {
|
||||
"$ref": "#/$defs/format"
|
||||
}
|
||||
@@ -1051,12 +1135,15 @@
|
||||
"keyColor": {
|
||||
"$ref": "#/$defs/keyColor"
|
||||
},
|
||||
"outputColor": {
|
||||
"$ref": "#/$defs/outputColor"
|
||||
"keyIcon": {
|
||||
"$ref": "#/$defs/keyIcon"
|
||||
},
|
||||
"keyWidth": {
|
||||
"$ref": "#/$defs/keyWidth"
|
||||
},
|
||||
"outputColor": {
|
||||
"$ref": "#/$defs/outputColor"
|
||||
},
|
||||
"format": {
|
||||
"$ref": "#/$defs/format"
|
||||
}
|
||||
@@ -1077,12 +1164,15 @@
|
||||
"keyColor": {
|
||||
"$ref": "#/$defs/keyColor"
|
||||
},
|
||||
"outputColor": {
|
||||
"$ref": "#/$defs/outputColor"
|
||||
"keyIcon": {
|
||||
"$ref": "#/$defs/keyIcon"
|
||||
},
|
||||
"keyWidth": {
|
||||
"$ref": "#/$defs/keyWidth"
|
||||
},
|
||||
"outputColor": {
|
||||
"$ref": "#/$defs/outputColor"
|
||||
},
|
||||
"format": {
|
||||
"$ref": "#/$defs/format"
|
||||
}
|
||||
@@ -1100,13 +1190,6 @@
|
||||
"temp": {
|
||||
"$ref": "#/$defs/temperature"
|
||||
},
|
||||
"freqNdigits": {
|
||||
"description": "Set the number of digits to keep after the decimal point when printing CPU frequency",
|
||||
"type": "integer",
|
||||
"minimum": 0,
|
||||
"maximum": 9,
|
||||
"default": 2
|
||||
},
|
||||
"showPeCoreCount": {
|
||||
"description": "Detect and display CPU frequency of different core types (eg. Pcore and Ecore) if supported",
|
||||
"type": "boolean",
|
||||
@@ -1118,12 +1201,15 @@
|
||||
"keyColor": {
|
||||
"$ref": "#/$defs/keyColor"
|
||||
},
|
||||
"outputColor": {
|
||||
"$ref": "#/$defs/outputColor"
|
||||
"keyIcon": {
|
||||
"$ref": "#/$defs/keyIcon"
|
||||
},
|
||||
"keyWidth": {
|
||||
"$ref": "#/$defs/keyWidth"
|
||||
},
|
||||
"outputColor": {
|
||||
"$ref": "#/$defs/outputColor"
|
||||
},
|
||||
"format": {
|
||||
"$ref": "#/$defs/format"
|
||||
}
|
||||
@@ -1152,12 +1238,15 @@
|
||||
"keyColor": {
|
||||
"$ref": "#/$defs/keyColor"
|
||||
},
|
||||
"outputColor": {
|
||||
"$ref": "#/$defs/outputColor"
|
||||
"keyIcon": {
|
||||
"$ref": "#/$defs/keyIcon"
|
||||
},
|
||||
"keyWidth": {
|
||||
"$ref": "#/$defs/keyWidth"
|
||||
},
|
||||
"outputColor": {
|
||||
"$ref": "#/$defs/outputColor"
|
||||
},
|
||||
"format": {
|
||||
"$ref": "#/$defs/format"
|
||||
}
|
||||
@@ -1177,13 +1266,14 @@
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"block",
|
||||
"background",
|
||||
"circle",
|
||||
"diamond",
|
||||
"triangle",
|
||||
"square",
|
||||
"star"
|
||||
],
|
||||
"default": "block"
|
||||
"default": "background"
|
||||
},
|
||||
"paddingLeft": {
|
||||
"description": "Set the number of white spaces to print before the symbol",
|
||||
@@ -1217,6 +1307,9 @@
|
||||
},
|
||||
"key": {
|
||||
"$ref": "#/$defs/key"
|
||||
},
|
||||
"keyIcon": {
|
||||
"$ref": "#/$defs/keyIcon"
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -1243,12 +1336,15 @@
|
||||
"keyColor": {
|
||||
"$ref": "#/$defs/keyColor"
|
||||
},
|
||||
"outputColor": {
|
||||
"$ref": "#/$defs/outputColor"
|
||||
"keyIcon": {
|
||||
"$ref": "#/$defs/keyIcon"
|
||||
},
|
||||
"keyWidth": {
|
||||
"$ref": "#/$defs/keyWidth"
|
||||
},
|
||||
"outputColor": {
|
||||
"$ref": "#/$defs/outputColor"
|
||||
},
|
||||
"format": {
|
||||
"$ref": "#/$defs/format"
|
||||
}
|
||||
@@ -1270,12 +1366,15 @@
|
||||
"keyColor": {
|
||||
"$ref": "#/$defs/keyColor"
|
||||
},
|
||||
"outputColor": {
|
||||
"$ref": "#/$defs/outputColor"
|
||||
"keyIcon": {
|
||||
"$ref": "#/$defs/keyIcon"
|
||||
},
|
||||
"keyWidth": {
|
||||
"$ref": "#/$defs/keyWidth"
|
||||
},
|
||||
"outputColor": {
|
||||
"$ref": "#/$defs/outputColor"
|
||||
},
|
||||
"format": {
|
||||
"description": "Text to print",
|
||||
"type": "string"
|
||||
@@ -1322,12 +1421,15 @@
|
||||
"keyColor": {
|
||||
"$ref": "#/$defs/keyColor"
|
||||
},
|
||||
"outputColor": {
|
||||
"$ref": "#/$defs/outputColor"
|
||||
"keyIcon": {
|
||||
"$ref": "#/$defs/keyIcon"
|
||||
},
|
||||
"keyWidth": {
|
||||
"$ref": "#/$defs/keyWidth"
|
||||
},
|
||||
"outputColor": {
|
||||
"$ref": "#/$defs/outputColor"
|
||||
},
|
||||
"format": {
|
||||
"$ref": "#/$defs/format"
|
||||
}
|
||||
@@ -1385,12 +1487,15 @@
|
||||
"keyColor": {
|
||||
"$ref": "#/$defs/keyColor"
|
||||
},
|
||||
"outputColor": {
|
||||
"$ref": "#/$defs/outputColor"
|
||||
"keyIcon": {
|
||||
"$ref": "#/$defs/keyIcon"
|
||||
},
|
||||
"keyWidth": {
|
||||
"$ref": "#/$defs/keyWidth"
|
||||
},
|
||||
"outputColor": {
|
||||
"$ref": "#/$defs/outputColor"
|
||||
},
|
||||
"format": {
|
||||
"$ref": "#/$defs/format"
|
||||
}
|
||||
@@ -1420,12 +1525,15 @@
|
||||
"keyColor": {
|
||||
"$ref": "#/$defs/keyColor"
|
||||
},
|
||||
"outputColor": {
|
||||
"$ref": "#/$defs/outputColor"
|
||||
"keyIcon": {
|
||||
"$ref": "#/$defs/keyIcon"
|
||||
},
|
||||
"keyWidth": {
|
||||
"$ref": "#/$defs/keyWidth"
|
||||
},
|
||||
"outputColor": {
|
||||
"$ref": "#/$defs/outputColor"
|
||||
},
|
||||
"format": {
|
||||
"$ref": "#/$defs/format"
|
||||
}
|
||||
@@ -1451,12 +1559,15 @@
|
||||
"keyColor": {
|
||||
"$ref": "#/$defs/keyColor"
|
||||
},
|
||||
"outputColor": {
|
||||
"$ref": "#/$defs/outputColor"
|
||||
"keyIcon": {
|
||||
"$ref": "#/$defs/keyIcon"
|
||||
},
|
||||
"keyWidth": {
|
||||
"$ref": "#/$defs/keyWidth"
|
||||
},
|
||||
"outputColor": {
|
||||
"$ref": "#/$defs/outputColor"
|
||||
},
|
||||
"format": {
|
||||
"$ref": "#/$defs/format"
|
||||
}
|
||||
@@ -1486,12 +1597,15 @@
|
||||
"keyColor": {
|
||||
"$ref": "#/$defs/keyColor"
|
||||
},
|
||||
"outputColor": {
|
||||
"$ref": "#/$defs/outputColor"
|
||||
"keyIcon": {
|
||||
"$ref": "#/$defs/keyIcon"
|
||||
},
|
||||
"keyWidth": {
|
||||
"$ref": "#/$defs/keyWidth"
|
||||
},
|
||||
"outputColor": {
|
||||
"$ref": "#/$defs/outputColor"
|
||||
},
|
||||
"format": {
|
||||
"$ref": "#/$defs/format"
|
||||
}
|
||||
@@ -1515,12 +1629,15 @@
|
||||
"keyColor": {
|
||||
"$ref": "#/$defs/keyColor"
|
||||
},
|
||||
"outputColor": {
|
||||
"$ref": "#/$defs/outputColor"
|
||||
"keyIcon": {
|
||||
"$ref": "#/$defs/keyIcon"
|
||||
},
|
||||
"keyWidth": {
|
||||
"$ref": "#/$defs/keyWidth"
|
||||
},
|
||||
"outputColor": {
|
||||
"$ref": "#/$defs/outputColor"
|
||||
},
|
||||
"format": {
|
||||
"$ref": "#/$defs/format"
|
||||
}
|
||||
@@ -1570,12 +1687,15 @@
|
||||
"keyColor": {
|
||||
"$ref": "#/$defs/keyColor"
|
||||
},
|
||||
"outputColor": {
|
||||
"$ref": "#/$defs/outputColor"
|
||||
"keyIcon": {
|
||||
"$ref": "#/$defs/keyIcon"
|
||||
},
|
||||
"keyWidth": {
|
||||
"$ref": "#/$defs/keyWidth"
|
||||
},
|
||||
"outputColor": {
|
||||
"$ref": "#/$defs/outputColor"
|
||||
},
|
||||
"format": {
|
||||
"$ref": "#/$defs/format"
|
||||
}
|
||||
@@ -1640,12 +1760,15 @@
|
||||
"keyColor": {
|
||||
"$ref": "#/$defs/keyColor"
|
||||
},
|
||||
"outputColor": {
|
||||
"$ref": "#/$defs/outputColor"
|
||||
"keyIcon": {
|
||||
"$ref": "#/$defs/keyIcon"
|
||||
},
|
||||
"keyWidth": {
|
||||
"$ref": "#/$defs/keyWidth"
|
||||
},
|
||||
"outputColor": {
|
||||
"$ref": "#/$defs/outputColor"
|
||||
},
|
||||
"format": {
|
||||
"$ref": "#/$defs/format"
|
||||
}
|
||||
@@ -1669,12 +1792,15 @@
|
||||
"keyColor": {
|
||||
"$ref": "#/$defs/keyColor"
|
||||
},
|
||||
"outputColor": {
|
||||
"$ref": "#/$defs/outputColor"
|
||||
"keyIcon": {
|
||||
"$ref": "#/$defs/keyIcon"
|
||||
},
|
||||
"keyWidth": {
|
||||
"$ref": "#/$defs/keyWidth"
|
||||
},
|
||||
"outputColor": {
|
||||
"$ref": "#/$defs/outputColor"
|
||||
},
|
||||
"format": {
|
||||
"$ref": "#/$defs/format"
|
||||
}
|
||||
@@ -1710,12 +1836,15 @@
|
||||
"keyColor": {
|
||||
"$ref": "#/$defs/keyColor"
|
||||
},
|
||||
"outputColor": {
|
||||
"$ref": "#/$defs/outputColor"
|
||||
"keyIcon": {
|
||||
"$ref": "#/$defs/keyIcon"
|
||||
},
|
||||
"keyWidth": {
|
||||
"$ref": "#/$defs/keyWidth"
|
||||
},
|
||||
"outputColor": {
|
||||
"$ref": "#/$defs/outputColor"
|
||||
},
|
||||
"format": {
|
||||
"$ref": "#/$defs/format"
|
||||
}
|
||||
@@ -1750,12 +1879,15 @@
|
||||
"keyColor": {
|
||||
"$ref": "#/$defs/keyColor"
|
||||
},
|
||||
"outputColor": {
|
||||
"$ref": "#/$defs/outputColor"
|
||||
"keyIcon": {
|
||||
"$ref": "#/$defs/keyIcon"
|
||||
},
|
||||
"keyWidth": {
|
||||
"$ref": "#/$defs/keyWidth"
|
||||
},
|
||||
"outputColor": {
|
||||
"$ref": "#/$defs/outputColor"
|
||||
},
|
||||
"format": {
|
||||
"$ref": "#/$defs/format"
|
||||
}
|
||||
@@ -1771,7 +1903,7 @@
|
||||
"const": "opengl"
|
||||
},
|
||||
"library": {
|
||||
"description": "Set the OpenGL context creation library to use. Linux only",
|
||||
"description": "Set the OpenGL context creation library to use",
|
||||
"enum": [
|
||||
"auto",
|
||||
"egl",
|
||||
@@ -1786,12 +1918,15 @@
|
||||
"keyColor": {
|
||||
"$ref": "#/$defs/keyColor"
|
||||
},
|
||||
"outputColor": {
|
||||
"$ref": "#/$defs/outputColor"
|
||||
"keyIcon": {
|
||||
"$ref": "#/$defs/keyIcon"
|
||||
},
|
||||
"keyWidth": {
|
||||
"$ref": "#/$defs/keyWidth"
|
||||
},
|
||||
"outputColor": {
|
||||
"$ref": "#/$defs/outputColor"
|
||||
},
|
||||
"format": {
|
||||
"$ref": "#/$defs/format"
|
||||
}
|
||||
@@ -1820,6 +1955,9 @@
|
||||
"emerge",
|
||||
"eopkg",
|
||||
"flatpak",
|
||||
"guix",
|
||||
"lpkg",
|
||||
"lpkgbuild",
|
||||
"macports",
|
||||
"nix",
|
||||
"opkg",
|
||||
@@ -1830,6 +1968,7 @@
|
||||
"rpm",
|
||||
"scoop",
|
||||
"snap",
|
||||
"sorcery",
|
||||
"winget",
|
||||
"xbps"
|
||||
],
|
||||
@@ -1843,12 +1982,15 @@
|
||||
"keyColor": {
|
||||
"$ref": "#/$defs/keyColor"
|
||||
},
|
||||
"outputColor": {
|
||||
"$ref": "#/$defs/outputColor"
|
||||
"keyIcon": {
|
||||
"$ref": "#/$defs/keyIcon"
|
||||
},
|
||||
"keyWidth": {
|
||||
"$ref": "#/$defs/keyWidth"
|
||||
},
|
||||
"outputColor": {
|
||||
"$ref": "#/$defs/outputColor"
|
||||
},
|
||||
"format": {
|
||||
"$ref": "#/$defs/format"
|
||||
}
|
||||
@@ -1876,12 +2018,15 @@
|
||||
"keyColor": {
|
||||
"$ref": "#/$defs/keyColor"
|
||||
},
|
||||
"outputColor": {
|
||||
"$ref": "#/$defs/outputColor"
|
||||
"keyIcon": {
|
||||
"$ref": "#/$defs/keyIcon"
|
||||
},
|
||||
"keyWidth": {
|
||||
"$ref": "#/$defs/keyWidth"
|
||||
},
|
||||
"outputColor": {
|
||||
"$ref": "#/$defs/outputColor"
|
||||
},
|
||||
"format": {
|
||||
"$ref": "#/$defs/format"
|
||||
}
|
||||
@@ -1919,12 +2064,15 @@
|
||||
"keyColor": {
|
||||
"$ref": "#/$defs/keyColor"
|
||||
},
|
||||
"outputColor": {
|
||||
"$ref": "#/$defs/outputColor"
|
||||
"keyIcon": {
|
||||
"$ref": "#/$defs/keyIcon"
|
||||
},
|
||||
"keyWidth": {
|
||||
"$ref": "#/$defs/keyWidth"
|
||||
},
|
||||
"outputColor": {
|
||||
"$ref": "#/$defs/outputColor"
|
||||
},
|
||||
"format": {
|
||||
"$ref": "#/$defs/format"
|
||||
}
|
||||
@@ -1940,12 +2088,19 @@
|
||||
"const": "separator"
|
||||
},
|
||||
"string": {
|
||||
"description": "Set the string to be printed",
|
||||
"description": "Set the string to be printed by the separator line",
|
||||
"type": "string",
|
||||
"default": "-"
|
||||
},
|
||||
"outputColor": {
|
||||
"description": "Set the color of the separator line",
|
||||
"$ref": "#/$defs/outputColor"
|
||||
},
|
||||
"length": {
|
||||
"description": "Set the length of the separator line, or 0 to auto-detect",
|
||||
"type": "integer",
|
||||
"minimum": 0,
|
||||
"default": 0
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -1977,12 +2132,15 @@
|
||||
"keyColor": {
|
||||
"$ref": "#/$defs/keyColor"
|
||||
},
|
||||
"outputColor": {
|
||||
"$ref": "#/$defs/outputColor"
|
||||
"keyIcon": {
|
||||
"$ref": "#/$defs/keyIcon"
|
||||
},
|
||||
"keyWidth": {
|
||||
"$ref": "#/$defs/keyWidth"
|
||||
},
|
||||
"outputColor": {
|
||||
"$ref": "#/$defs/outputColor"
|
||||
},
|
||||
"format": {
|
||||
"$ref": "#/$defs/format"
|
||||
}
|
||||
@@ -2006,12 +2164,15 @@
|
||||
"keyColor": {
|
||||
"$ref": "#/$defs/keyColor"
|
||||
},
|
||||
"outputColor": {
|
||||
"$ref": "#/$defs/outputColor"
|
||||
"keyIcon": {
|
||||
"$ref": "#/$defs/keyIcon"
|
||||
},
|
||||
"keyWidth": {
|
||||
"$ref": "#/$defs/keyWidth"
|
||||
},
|
||||
"outputColor": {
|
||||
"$ref": "#/$defs/outputColor"
|
||||
},
|
||||
"format": {
|
||||
"$ref": "#/$defs/format"
|
||||
}
|
||||
@@ -2056,12 +2217,15 @@
|
||||
"keyColor": {
|
||||
"$ref": "#/$defs/keyColor"
|
||||
},
|
||||
"outputColor": {
|
||||
"$ref": "#/$defs/outputColor"
|
||||
"keyIcon": {
|
||||
"$ref": "#/$defs/keyIcon"
|
||||
},
|
||||
"keyWidth": {
|
||||
"$ref": "#/$defs/keyWidth"
|
||||
},
|
||||
"outputColor": {
|
||||
"$ref": "#/$defs/outputColor"
|
||||
},
|
||||
"format": {
|
||||
"$ref": "#/$defs/format"
|
||||
}
|
||||
@@ -2092,12 +2256,15 @@
|
||||
"keyColor": {
|
||||
"$ref": "#/$defs/keyColor"
|
||||
},
|
||||
"outputColor": {
|
||||
"$ref": "#/$defs/outputColor"
|
||||
"keyIcon": {
|
||||
"$ref": "#/$defs/keyIcon"
|
||||
},
|
||||
"keyWidth": {
|
||||
"$ref": "#/$defs/keyWidth"
|
||||
},
|
||||
"outputColor": {
|
||||
"$ref": "#/$defs/outputColor"
|
||||
},
|
||||
"format": {
|
||||
"$ref": "#/$defs/format"
|
||||
}
|
||||
@@ -2133,12 +2300,15 @@
|
||||
"keyColor": {
|
||||
"$ref": "#/$defs/keyColor"
|
||||
},
|
||||
"outputColor": {
|
||||
"$ref": "#/$defs/outputColor"
|
||||
"keyIcon": {
|
||||
"$ref": "#/$defs/keyIcon"
|
||||
},
|
||||
"keyWidth": {
|
||||
"$ref": "#/$defs/keyWidth"
|
||||
},
|
||||
"outputColor": {
|
||||
"$ref": "#/$defs/outputColor"
|
||||
},
|
||||
"format": {
|
||||
"$ref": "#/$defs/format"
|
||||
}
|
||||
@@ -2164,12 +2334,15 @@
|
||||
"keyColor": {
|
||||
"$ref": "#/$defs/keyColor"
|
||||
},
|
||||
"outputColor": {
|
||||
"$ref": "#/$defs/outputColor"
|
||||
"keyIcon": {
|
||||
"$ref": "#/$defs/keyIcon"
|
||||
},
|
||||
"keyWidth": {
|
||||
"$ref": "#/$defs/keyWidth"
|
||||
},
|
||||
"outputColor": {
|
||||
"$ref": "#/$defs/outputColor"
|
||||
},
|
||||
"format": {
|
||||
"$ref": "#/$defs/format"
|
||||
}
|
||||
|
||||
@@ -47,6 +47,7 @@
|
||||
"cpuusage",
|
||||
{
|
||||
"type": "gpu",
|
||||
"driverSpecific": true,
|
||||
"temp": true
|
||||
},
|
||||
"memory",
|
||||
@@ -63,6 +64,7 @@
|
||||
"showIpv6": true,
|
||||
"showMac": true
|
||||
},
|
||||
"dns",
|
||||
"wifi",
|
||||
"datetime",
|
||||
"locale",
|
||||
@@ -71,6 +73,7 @@
|
||||
"opencl",
|
||||
"users",
|
||||
"bluetooth",
|
||||
"bluetoothradio",
|
||||
"sound",
|
||||
"camera",
|
||||
"gamepad",
|
||||
|
||||
+9
-12
@@ -4,12 +4,12 @@
|
||||
{
|
||||
"type": "title",
|
||||
"key": "User",
|
||||
"format": "{1}"
|
||||
"format": "{user-name}"
|
||||
},
|
||||
{
|
||||
"type": "title",
|
||||
"key": "Hostname",
|
||||
"format": "{2}"
|
||||
"format": "{host-name}"
|
||||
},
|
||||
{
|
||||
"type": "host",
|
||||
@@ -17,7 +17,7 @@
|
||||
},
|
||||
{
|
||||
"type": "os",
|
||||
"format": "{3} {9} {12}"
|
||||
"format": "{pretty-name} {version-id} {arch}"
|
||||
},
|
||||
"kernel",
|
||||
"uptime",
|
||||
@@ -34,32 +34,29 @@
|
||||
"type": "de",
|
||||
"key": "Desktop Environment"
|
||||
},
|
||||
{
|
||||
"type": "shell",
|
||||
"format": "{7}"
|
||||
},
|
||||
"shell",
|
||||
{
|
||||
"type": "terminal",
|
||||
"format": "{5} {6} {#37}█{#97}█ {#36}█{#96}█ {#35}█{#95}█ {#34}█{#94}█ {#33}█{#93}█ {#32}█{#92}█ {#31}█{#91}█ {#30}█{#90}█"
|
||||
"format": "{pretty-name} {version} {#37}█{#97}█ {#36}█{#96}█ {#35}█{#95}█ {#34}█{#94}█ {#33}█{#93}█ {#32}█{#92}█ {#31}█{#91}█ {#30}█{#90}█"
|
||||
},
|
||||
{
|
||||
"type": "packages",
|
||||
"format": "{1}"
|
||||
"format": "{all}"
|
||||
},
|
||||
{
|
||||
"type": "cpu",
|
||||
"key": "Temperature",
|
||||
"temp": true,
|
||||
"format": "{8}"
|
||||
"format": "{temperature}"
|
||||
},
|
||||
{
|
||||
"type": "cpu",
|
||||
"key": "CPU",
|
||||
"format": "{4} x {1}"
|
||||
"format": "{cores-logical} x {name}"
|
||||
},
|
||||
{
|
||||
"type": "gpu",
|
||||
"format": "{2}"
|
||||
"format": "{name}"
|
||||
},
|
||||
{
|
||||
"type": "memory",
|
||||
|
||||
@@ -1,42 +0,0 @@
|
||||
{
|
||||
"$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json",
|
||||
"logo": {
|
||||
"type": "builtin",
|
||||
"source": "arch"
|
||||
},
|
||||
"modules": [
|
||||
"title",
|
||||
"separator",
|
||||
{
|
||||
"type": "os",
|
||||
"format": "Arch Linux ({12})"
|
||||
},
|
||||
"host",
|
||||
"kernel",
|
||||
"uptime",
|
||||
{
|
||||
"type": "packages",
|
||||
"format": "{} (pacman)"
|
||||
},
|
||||
"shell",
|
||||
"display",
|
||||
"de",
|
||||
"wm",
|
||||
"wmtheme",
|
||||
"theme",
|
||||
"icons",
|
||||
"font",
|
||||
"cursor",
|
||||
"terminal",
|
||||
"terminalfont",
|
||||
"cpu",
|
||||
"gpu",
|
||||
"memory",
|
||||
"disk",
|
||||
"battery",
|
||||
"poweradapter",
|
||||
"locale",
|
||||
"break",
|
||||
"colors"
|
||||
]
|
||||
}
|
||||
@@ -49,6 +49,7 @@
|
||||
"cpuusage",
|
||||
{
|
||||
"type": "gpu",
|
||||
"driverSpecific": true,
|
||||
"temp": true
|
||||
},
|
||||
"memory",
|
||||
@@ -65,6 +66,7 @@
|
||||
"showIpv6": true,
|
||||
"showMac": true
|
||||
},
|
||||
"dns",
|
||||
"wifi",
|
||||
"datetime",
|
||||
"locale",
|
||||
@@ -73,6 +75,7 @@
|
||||
"opencl",
|
||||
"users",
|
||||
"bluetooth",
|
||||
"bluetoothradio",
|
||||
"sound",
|
||||
"camera",
|
||||
"gamepad",
|
||||
|
||||
@@ -9,12 +9,15 @@
|
||||
}
|
||||
},
|
||||
"display": {
|
||||
"separator": " -> "
|
||||
"separator": " -> ",
|
||||
"constants": [
|
||||
"──────────────────────────────"
|
||||
]
|
||||
},
|
||||
"modules": [
|
||||
{
|
||||
"type": "custom",
|
||||
"format": "┌────────────────────────────────────────────────────────────┐",
|
||||
"format": "┌{$1}{$1}┐",
|
||||
"outputColor": "90"
|
||||
},
|
||||
{
|
||||
@@ -23,7 +26,7 @@
|
||||
},
|
||||
{
|
||||
"type": "custom",
|
||||
"format": "└────────────────────────────────────────────────────────────┘",
|
||||
"format": "└{$1}{$1}┘",
|
||||
"outputColor": "90"
|
||||
},
|
||||
{
|
||||
@@ -32,12 +35,12 @@
|
||||
},
|
||||
{
|
||||
"type": "custom",
|
||||
"format": "┌────────────────────────────────────────────────────────────┐",
|
||||
"format": "┌{$1}{$1}┐",
|
||||
"outputColor": "90"
|
||||
},
|
||||
{
|
||||
"type": "os",
|
||||
"key": " OS",
|
||||
"key": "{icon} OS",
|
||||
"keyColor": "yellow"
|
||||
},
|
||||
{
|
||||
@@ -142,7 +145,7 @@
|
||||
},
|
||||
{
|
||||
"type": "custom",
|
||||
"format": "└────────────────────────────────────────────────────────────┘",
|
||||
"format": "└{$1}{$1}┘",
|
||||
"outputColor": "90"
|
||||
},
|
||||
"break",
|
||||
|
||||
+25
-18
@@ -6,96 +6,103 @@
|
||||
"display": {
|
||||
"separator": "-> ",
|
||||
"color": {
|
||||
"separator": "1"
|
||||
"separator": "1" // Bold
|
||||
},
|
||||
"constants": [
|
||||
"───────────────────────────"
|
||||
],
|
||||
"key": {
|
||||
"type": "both",
|
||||
"paddingLeft": 4
|
||||
}
|
||||
},
|
||||
"modules": [
|
||||
{
|
||||
"type": "title",
|
||||
"format": " {6}{7}{8}"
|
||||
"format": " {user-name-colored}{at-symbol-colored}{host-name-colored}"
|
||||
},
|
||||
"break",
|
||||
{
|
||||
"type": "custom",
|
||||
"format": "┌───────────────────────────── {#1}System Information{#} ─────────────────────────────┐"
|
||||
"format": "┌{$1} {#1}System Information{#} {$1}┐"
|
||||
},
|
||||
"break",
|
||||
{
|
||||
"key": " OS ",
|
||||
"key": "OS ",
|
||||
"keyColor": "red",
|
||||
"type": "os"
|
||||
},
|
||||
{
|
||||
"key": " Machine ",
|
||||
"key": "Machine ",
|
||||
"keyColor": "green",
|
||||
"type": "host"
|
||||
},
|
||||
{
|
||||
"key": " Kernel ",
|
||||
"key": "Kernel ",
|
||||
"keyColor": "magenta",
|
||||
"type": "kernel"
|
||||
},
|
||||
{
|
||||
"key": " Uptime ",
|
||||
"key": "Uptime ",
|
||||
"keyColor": "red",
|
||||
"type": "uptime"
|
||||
},
|
||||
{
|
||||
"key": " Resolution ",
|
||||
"key": "Resolution ",
|
||||
"keyColor": "yellow",
|
||||
"type": "display",
|
||||
"compactType": "original-with-refresh-rate"
|
||||
},
|
||||
{
|
||||
"key": " WM ",
|
||||
"key": "WM ",
|
||||
"keyColor": "blue",
|
||||
"type": "wm"
|
||||
},
|
||||
{
|
||||
"key": " DE ",
|
||||
"key": "DE ",
|
||||
"keyColor": "green",
|
||||
"type": "de"
|
||||
},
|
||||
{
|
||||
"key": " Shell ",
|
||||
"key": "Shell ",
|
||||
"keyColor": "cyan",
|
||||
"type": "shell"
|
||||
},
|
||||
{
|
||||
"key": " Terminal ",
|
||||
"key": "Terminal ",
|
||||
"keyColor": "red",
|
||||
"type": "terminal"
|
||||
},
|
||||
{
|
||||
"key": " CPU ",
|
||||
"key": "CPU ",
|
||||
"keyColor": "yellow",
|
||||
"type": "cpu"
|
||||
},
|
||||
{
|
||||
"key": " GPU ",
|
||||
"key": "GPU ",
|
||||
"keyColor": "blue",
|
||||
"type": "gpu"
|
||||
},
|
||||
{
|
||||
"key": " Memory ",
|
||||
"key": "Memory ",
|
||||
"keyColor": "magenta",
|
||||
"type": "memory"
|
||||
},
|
||||
{
|
||||
"key": " Local IP ",
|
||||
"key": "Local IP ",
|
||||
"keyColor": "red",
|
||||
"type": "localip",
|
||||
"compact": true
|
||||
},
|
||||
{
|
||||
"key": " Public IP ",
|
||||
"key": "Public IP ",
|
||||
"keyColor": "cyan",
|
||||
"type": "publicip"
|
||||
},
|
||||
"break",
|
||||
{
|
||||
"type": "custom",
|
||||
"format": "└──────────────────────────────────────────────────────────────────────────────┘"
|
||||
"format": "└{$1}────────────────────{$1}┘"
|
||||
},
|
||||
"break",
|
||||
{
|
||||
|
||||
+17
-19
@@ -8,8 +8,7 @@
|
||||
}
|
||||
},
|
||||
"display": {
|
||||
"separator": "",
|
||||
"keyWidth": 15
|
||||
"separator": " "
|
||||
},
|
||||
"modules": [
|
||||
{
|
||||
@@ -17,65 +16,64 @@
|
||||
"type": "custom"
|
||||
},
|
||||
{
|
||||
// draw borders first to make colors of left and right border consistant
|
||||
"key": "│ │\u001b[11D{#31} user",
|
||||
"key": "│ {#31} user {#keys}│",
|
||||
"type": "title",
|
||||
"format": "{1}"
|
||||
"format": "{user-name}"
|
||||
},
|
||||
{
|
||||
"key": "│ │\u001b[11D{#32} hname",
|
||||
"key": "│ {#32} hname {#keys}│",
|
||||
"type": "title",
|
||||
"format": "{2}"
|
||||
"format": "{host-name}"
|
||||
},
|
||||
{
|
||||
"key": "│ │\u001b[11D{#33} uptime",
|
||||
"key": "│ {#33} uptime {#keys}│",
|
||||
"type": "uptime"
|
||||
},
|
||||
{
|
||||
"key": "│ │\u001b[11D{#34} distro",
|
||||
"key": "│ {#34}{icon} distro {#keys}│",
|
||||
"type": "os"
|
||||
},
|
||||
{
|
||||
"key": "│ │\u001b[11D{#35} kernel",
|
||||
"key": "│ {#35} kernel {#keys}│",
|
||||
"type": "kernel"
|
||||
},
|
||||
{
|
||||
"key": "│ │\u001b[11D{#36} desktop",
|
||||
"key": "│ {#36} desktop {#keys}│",
|
||||
"type": "de"
|
||||
},
|
||||
{
|
||||
"key": "│ │\u001b[11D{#31} term",
|
||||
"key": "│ {#31} term {#keys}│",
|
||||
"type": "terminal"
|
||||
},
|
||||
{
|
||||
"key": "│ │\u001b[11D{#32} shell",
|
||||
"key": "│ {#32} shell {#keys}│",
|
||||
"type": "shell"
|
||||
},
|
||||
{
|
||||
"key": "│ │\u001b[11D{#33} cpu",
|
||||
"key": "│ {#33} cpu {#keys}│",
|
||||
"type": "cpu",
|
||||
"showPeCoreCount": true
|
||||
},
|
||||
{
|
||||
"key": "│ │\u001b[11D{#34} disk",
|
||||
"key": "│ {#34} disk {#keys}│",
|
||||
"type": "disk",
|
||||
"folders": "/"
|
||||
},
|
||||
{
|
||||
"key": "│ │\u001b[11D{#35} memory",
|
||||
"key": "│ {#35} memory {#keys}│",
|
||||
"type": "memory"
|
||||
},
|
||||
{
|
||||
"key": "│ │\u001b[11D{#36} network",
|
||||
"key": "│ {#36} network {#keys}│",
|
||||
"type": "localip",
|
||||
"format": "{1} ({4})"
|
||||
"format": "{ipv4} ({ifname})"
|
||||
},
|
||||
{
|
||||
"key": "├───────────┤",
|
||||
"type": "custom"
|
||||
},
|
||||
{
|
||||
"key": "│ │\u001b[11D{#39} colors",
|
||||
"key": "│ {#39} colors {#keys}│",
|
||||
"type": "colors",
|
||||
"symbol": "circle"
|
||||
},
|
||||
|
||||
@@ -6,20 +6,22 @@
|
||||
},
|
||||
"display": {
|
||||
"separator": "",
|
||||
"keyWidth": 12
|
||||
"key": {
|
||||
"width": 15
|
||||
}
|
||||
},
|
||||
"modules": [
|
||||
{
|
||||
// draw borders first to make colors of left and right border consistant
|
||||
"key": " user",
|
||||
"type": "title",
|
||||
"format": "{1}",
|
||||
"format": "{user-name}",
|
||||
"keyColor": "31"
|
||||
},
|
||||
{
|
||||
"key": " hname",
|
||||
"type": "title",
|
||||
"format": "{2}",
|
||||
"format": "{host-name}",
|
||||
"keyColor": "32"
|
||||
|
||||
},
|
||||
@@ -29,7 +31,7 @@
|
||||
"keyColor": "33"
|
||||
},
|
||||
{
|
||||
"key": " distro",
|
||||
"key": "{icon} distro",
|
||||
"type": "os",
|
||||
"keyColor": "34"
|
||||
},
|
||||
@@ -73,7 +75,7 @@
|
||||
{
|
||||
"key": " network",
|
||||
"type": "localip",
|
||||
"format": "{1} ({4})",
|
||||
"format": "{ipv4} ({ifname})",
|
||||
"keyColor": "36"
|
||||
},
|
||||
{
|
||||
|
||||
+17
-19
@@ -8,8 +8,7 @@
|
||||
}
|
||||
},
|
||||
"display": {
|
||||
"separator": "",
|
||||
"keyWidth": 15
|
||||
"separator": " "
|
||||
},
|
||||
"modules": [
|
||||
{
|
||||
@@ -17,65 +16,64 @@
|
||||
"type": "custom"
|
||||
},
|
||||
{
|
||||
// draw borders first to make colors of left and right border consistant
|
||||
"key": "• •\u001b[11D{#31} user",
|
||||
"key": "• {#31} user {#keys}•",
|
||||
"type": "title",
|
||||
"format": "{1}"
|
||||
"format": "{user-name}"
|
||||
},
|
||||
{
|
||||
"key": "• •\u001b[11D{#32} hname",
|
||||
"key": "• {#32} hname {#keys}•",
|
||||
"type": "title",
|
||||
"format": "{2}"
|
||||
"format": "{host-name}"
|
||||
},
|
||||
{
|
||||
"key": "• •\u001b[11D{#33} uptime",
|
||||
"key": "• {#33} uptime {#keys}•",
|
||||
"type": "uptime"
|
||||
},
|
||||
{
|
||||
"key": "• •\u001b[11D{#34} distro",
|
||||
"key": "• {#34}{icon} distro {#keys}•",
|
||||
"type": "os"
|
||||
},
|
||||
{
|
||||
"key": "• •\u001b[11D{#35} kernel",
|
||||
"key": "• {#35} kernel {#keys}•",
|
||||
"type": "kernel"
|
||||
},
|
||||
{
|
||||
"key": "• •\u001b[11D{#36} desktop",
|
||||
"key": "• {#36} desktop {#keys}•",
|
||||
"type": "de"
|
||||
},
|
||||
{
|
||||
"key": "• •\u001b[11D{#31} term",
|
||||
"key": "• {#31} term {#keys}•",
|
||||
"type": "terminal"
|
||||
},
|
||||
{
|
||||
"key": "• •\u001b[11D{#32} shell",
|
||||
"key": "• {#32} shell {#keys}•",
|
||||
"type": "shell"
|
||||
},
|
||||
{
|
||||
"key": "• •\u001b[11D{#33} cpu",
|
||||
"key": "• {#33} cpu {#keys}•",
|
||||
"type": "cpu",
|
||||
"showPeCoreCount": true
|
||||
},
|
||||
{
|
||||
"key": "• •\u001b[11D{#34} disk",
|
||||
"key": "• {#34} disk {#keys}•",
|
||||
"type": "disk",
|
||||
"folders": "/"
|
||||
},
|
||||
{
|
||||
"key": "• •\u001b[11D{#35} memory",
|
||||
"key": "• {#35} memory {#keys}•",
|
||||
"type": "memory"
|
||||
},
|
||||
{
|
||||
"key": "• •\u001b[11D{#36} network",
|
||||
"key": "• {#36} network {#keys}•",
|
||||
"type": "localip",
|
||||
"format": "{1} ({4})"
|
||||
"format": "{ipv4} ({ifname})"
|
||||
},
|
||||
{
|
||||
"key": "•••••••••••••",
|
||||
"type": "custom"
|
||||
},
|
||||
{
|
||||
"key": "• •\u001b[11D{#39} colors",
|
||||
"key": "• {#39} colors {#keys}•",
|
||||
"type": "colors",
|
||||
"symbol": "circle"
|
||||
},
|
||||
|
||||
@@ -18,19 +18,19 @@
|
||||
{
|
||||
"key": "║ {#31} user {#keys}║",
|
||||
"type": "title",
|
||||
"format": "{1}"
|
||||
"format": "{user-name}"
|
||||
},
|
||||
{
|
||||
"key": "║ {#32} hname {#keys}║",
|
||||
"type": "title",
|
||||
"format": "{2}"
|
||||
"format": "{host-name}"
|
||||
},
|
||||
{
|
||||
"key": "║ {#33} uptime {#keys}║",
|
||||
"type": "uptime"
|
||||
},
|
||||
{
|
||||
"key": "║ {#34} distro {#keys}║",
|
||||
"key": "║ {#34}{icon} distro {#keys}║",
|
||||
"type": "os"
|
||||
},
|
||||
{
|
||||
@@ -66,7 +66,7 @@
|
||||
{
|
||||
"key": "║ {#36} network {#keys}║",
|
||||
"type": "localip",
|
||||
"format": "{1} ({4})"
|
||||
"format": "{ipv4} ({ifname})"
|
||||
},
|
||||
{
|
||||
"key": "╠═══════════╣",
|
||||
|
||||
+21
-17
@@ -11,72 +11,76 @@
|
||||
"separator": "> ",
|
||||
"color": {
|
||||
"separator": "red"
|
||||
}
|
||||
},
|
||||
"constants": [
|
||||
"───────────────────────────────────────────────────────────────────────────",
|
||||
"│\u001b[75C│\u001b[75D"
|
||||
]
|
||||
},
|
||||
"modules": [
|
||||
{
|
||||
"format": "{#1}{#keys}╭───────────────────────────────────────────────────────────────────────────╮\u001b[76D {6}{7}{8} 🖥 ",
|
||||
"format": "{#1}{#keys}╭{$1}╮\u001b[76D {user-name-colored}{at-symbol-colored}{host-name-colored} 🖥 ",
|
||||
"type": "title"
|
||||
},
|
||||
{
|
||||
"key": "│\u001b[75C│\u001b[75D{#31} kernel ",
|
||||
"key": "{$2}{#31} kernel ",
|
||||
"type": "kernel"
|
||||
},
|
||||
{
|
||||
"key": "│\u001b[75C│\u001b[75D{#32} uptime ",
|
||||
"key": "{$2}{#32} uptime ",
|
||||
"type": "uptime"
|
||||
},
|
||||
{
|
||||
"key": "│\u001b[75C│\u001b[75D{#33} distro ",
|
||||
"key": "{$2}{#33}{icon} distro ",
|
||||
"type": "os"
|
||||
},
|
||||
{
|
||||
"key": "│\u001b[75C│\u001b[75D{#34} desktop ",
|
||||
"key": "{$2}{#34} desktop ",
|
||||
"type": "de"
|
||||
},
|
||||
{
|
||||
"key": "│\u001b[75C│\u001b[75D{#35} term ",
|
||||
"key": "{$2}{#35} term ",
|
||||
"type": "terminal"
|
||||
},
|
||||
{
|
||||
"key": "│\u001b[75C│\u001b[75D{#36} shell ",
|
||||
"key": "{$2}{#36} shell ",
|
||||
"type": "shell"
|
||||
},
|
||||
{
|
||||
"key": "│\u001b[75C│\u001b[75D{#35} cpu ",
|
||||
"key": "{$2}{#35} cpu ",
|
||||
"type": "cpu",
|
||||
"showPeCoreCount": true,
|
||||
"temp": true
|
||||
},
|
||||
{
|
||||
"key": "│\u001b[75C│\u001b[75D{#34} gpu ",
|
||||
"key": "{$2}{#34} gpu ",
|
||||
"type": "gpu"
|
||||
},
|
||||
{
|
||||
"key": "│\u001b[75C│\u001b[75D{#33} disk ",
|
||||
"key": "{$2}{#33} disk ",
|
||||
"type": "disk",
|
||||
"folders": "/"
|
||||
},
|
||||
{
|
||||
"key": "│\u001b[75C│\u001b[75D{#32} memory ",
|
||||
"key": "{$2}{#32} memory ",
|
||||
"type": "memory"
|
||||
},
|
||||
{
|
||||
"key": "│\u001b[75C│\u001b[75D{#31} network ",
|
||||
"key": "{$2}{#31} network ",
|
||||
"type": "localip",
|
||||
"format": "{1} ({4})"
|
||||
"format": "{ipv4} ({ifname})"
|
||||
},
|
||||
{
|
||||
"format": "{#1}{#keys}├───────────────────────────────────────────────────────────────────────────┤",
|
||||
"format": "{#1}{#keys}├{$1}┤",
|
||||
"type": "custom"
|
||||
},
|
||||
{
|
||||
"key": "│\u001b[75C│\u001b[75D{#39} colors ",
|
||||
"key": "{$2}{#39} colors ",
|
||||
"type": "colors",
|
||||
"symbol": "circle"
|
||||
},
|
||||
{
|
||||
"format": "{#1}{#keys}╰───────────────────────────────────────────────────────────────────────────╯",
|
||||
"format": "{#1}{#keys}╰{$1}╯",
|
||||
"type": "custom"
|
||||
}
|
||||
]
|
||||
|
||||
+21
-17
@@ -11,72 +11,76 @@
|
||||
"separator": "> ",
|
||||
"color": {
|
||||
"separator": "red"
|
||||
}
|
||||
},
|
||||
"constants": [
|
||||
"═══════════════════════════════════════════════════════════════════════════",
|
||||
"║\u001b[75C║\u001b[75D"
|
||||
]
|
||||
},
|
||||
"modules": [
|
||||
{
|
||||
"format": "{#1}{#keys}╔═══════════════════════════════════════════════════════════════════════════╗\u001b[76D {6}{7}{8} 💻 ",
|
||||
"format": "{#1}{#keys}╔{$1}╗\u001b[76D {user-name-colored}{at-symbol-colored}{host-name-colored} 💻 ",
|
||||
"type": "title"
|
||||
},
|
||||
{
|
||||
"key": "║\u001b[75C║\u001b[75D{#31} kernel ",
|
||||
"key": "{$2}{#31} kernel ",
|
||||
"type": "kernel"
|
||||
},
|
||||
{
|
||||
"key": "║\u001b[75C║\u001b[75D{#32} uptime ",
|
||||
"key": "{$2}{#32} uptime ",
|
||||
"type": "uptime"
|
||||
},
|
||||
{
|
||||
"key": "║\u001b[75C║\u001b[75D{#33} distro ",
|
||||
"key": "{$2}{#33}{icon} distro ",
|
||||
"type": "os"
|
||||
},
|
||||
{
|
||||
"key": "║\u001b[75C║\u001b[75D{#34} desktop ",
|
||||
"key": "{$2}{#34} desktop ",
|
||||
"type": "de"
|
||||
},
|
||||
{
|
||||
"key": "║\u001b[75C║\u001b[75D{#35} term ",
|
||||
"key": "{$2}{#35} term ",
|
||||
"type": "terminal"
|
||||
},
|
||||
{
|
||||
"key": "║\u001b[75C║\u001b[75D{#36} shell ",
|
||||
"key": "{$2}{#36} shell ",
|
||||
"type": "shell"
|
||||
},
|
||||
{
|
||||
"key": "║\u001b[75C║\u001b[75D{#35} cpu ",
|
||||
"key": "{$2}{#35} cpu ",
|
||||
"type": "cpu",
|
||||
"showPeCoreCount": true,
|
||||
"temp": true
|
||||
},
|
||||
{
|
||||
"key": "║\u001b[75C║\u001b[75D{#34} gpu ",
|
||||
"key": "{$2}{#34} gpu ",
|
||||
"type": "gpu"
|
||||
},
|
||||
{
|
||||
"key": "║\u001b[75C║\u001b[75D{#33} disk ",
|
||||
"key": "{$2}{#33} disk ",
|
||||
"type": "disk",
|
||||
"folders": "/"
|
||||
},
|
||||
{
|
||||
"key": "║\u001b[75C║\u001b[75D{#32} memory ",
|
||||
"key": "{$2}{#32} memory ",
|
||||
"type": "memory"
|
||||
},
|
||||
{
|
||||
"key": "║\u001b[75C║\u001b[75D{#31} network ",
|
||||
"key": "{$2}{#31} network ",
|
||||
"type": "localip",
|
||||
"format": "{1} ({4})"
|
||||
"format": "{ipv4} ({ifname})"
|
||||
},
|
||||
{
|
||||
"format": "{#1}{#keys}╠═══════════════════════════════════════════════════════════════════════════╣",
|
||||
"format": "{#1}{#keys}╠{$1}╣",
|
||||
"type": "custom"
|
||||
},
|
||||
{
|
||||
"key": "║\u001b[75C║\u001b[75D{#39} colors ",
|
||||
"key": "{$2}{#39} colors ",
|
||||
"type": "colors",
|
||||
"symbol": "circle"
|
||||
},
|
||||
{
|
||||
"format": "{#1}{#keys}╚═══════════════════════════════════════════════════════════════════════════╝",
|
||||
"format": "{#1}{#keys}╚{$1}╝",
|
||||
"type": "custom"
|
||||
}
|
||||
]
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
"logo": {
|
||||
"source": " _____ _____ _____ _____ _____ _____ _____ _____ _____\n| __| _ | __|_ _| __| __|_ _| | | |\n| __| |__ | | | | __| __| | | | --| |\n|__| |__|__|_____| |_| |__| |_____| |_| |_____|__|__|",
|
||||
"type": "data",
|
||||
"separate": true,
|
||||
"position": "top",
|
||||
"padding": {
|
||||
"right": 2
|
||||
}
|
||||
|
||||
+44
-126
@@ -10,153 +10,71 @@
|
||||
// "height": 12
|
||||
// },
|
||||
"display": {
|
||||
"separator": " "
|
||||
"separator": " ",
|
||||
"constants": [
|
||||
"─────────────────" // {$1}, used in Custom module
|
||||
],
|
||||
"key": {
|
||||
"type": "icon",
|
||||
"paddingLeft": 2
|
||||
}
|
||||
},
|
||||
"modules": [
|
||||
{
|
||||
"type": "custom", // HardwareStart
|
||||
// {#1} is equivalent to `\u001b[1m`. {#} is equivalent to `\u001b[m`
|
||||
"format": "┌─────────── {#1}Hardware Information{#} ───────────┐"
|
||||
},
|
||||
{
|
||||
"type": "host",
|
||||
"key": " "
|
||||
},
|
||||
{
|
||||
"type": "cpu",
|
||||
"key": " "
|
||||
},
|
||||
{
|
||||
"type": "gpu",
|
||||
"key": " "
|
||||
},
|
||||
{
|
||||
"type": "disk",
|
||||
"key": " "
|
||||
},
|
||||
{
|
||||
"type": "memory",
|
||||
"key": " "
|
||||
},
|
||||
{
|
||||
"type": "swap",
|
||||
"key": " "
|
||||
},
|
||||
{
|
||||
"type": "display",
|
||||
"key": " "
|
||||
},
|
||||
{
|
||||
"type": "brightness",
|
||||
"key": " "
|
||||
},
|
||||
{
|
||||
"type": "battery",
|
||||
"key": " "
|
||||
},
|
||||
{
|
||||
"type": "poweradapter",
|
||||
"key": " "
|
||||
},
|
||||
{
|
||||
"type": "bluetooth",
|
||||
"key": " "
|
||||
},
|
||||
{
|
||||
"type": "sound",
|
||||
"key": " "
|
||||
},
|
||||
{
|
||||
"type": "gamepad",
|
||||
"key": " "
|
||||
"format": "┌{$1} {#1}Hardware Information{#} {$1}┐"
|
||||
},
|
||||
"host",
|
||||
"cpu",
|
||||
"gpu",
|
||||
"disk",
|
||||
"memory",
|
||||
"swap",
|
||||
"display",
|
||||
"brightness",
|
||||
"battery",
|
||||
"poweradapter",
|
||||
"bluetooth",
|
||||
"sound",
|
||||
"gamepad",
|
||||
{
|
||||
"type": "custom", // SoftwareStart
|
||||
"format": "├─────────── {#1}Software Information{#} ───────────┤"
|
||||
"format": "├{$1} {#1}Software Information{#} {$1}┤"
|
||||
},
|
||||
{
|
||||
"type": "title",
|
||||
"key": " ",
|
||||
"format": "{1}@{2}"
|
||||
},
|
||||
{
|
||||
"type": "os",
|
||||
"key": " " // Just get your distro's logo off nerdfonts.com
|
||||
},
|
||||
{
|
||||
"type": "kernel",
|
||||
"key": " ",
|
||||
"format": "{1} {2}"
|
||||
},
|
||||
{
|
||||
"type": "lm",
|
||||
"key": " "
|
||||
},
|
||||
{
|
||||
"type": "de",
|
||||
"key": " "
|
||||
},
|
||||
{
|
||||
"type": "wm",
|
||||
"key": " "
|
||||
},
|
||||
{
|
||||
"type": "shell",
|
||||
"key": " "
|
||||
},
|
||||
{
|
||||
"type": "terminal",
|
||||
"key": " "
|
||||
},
|
||||
{
|
||||
"type": "terminalfont",
|
||||
"key": " "
|
||||
},
|
||||
{
|
||||
"type": "theme",
|
||||
"key": " "
|
||||
},
|
||||
{
|
||||
"type": "icons",
|
||||
"key": " "
|
||||
},
|
||||
{
|
||||
"type": "wallpaper",
|
||||
"key": " "
|
||||
},
|
||||
{
|
||||
"type": "packages",
|
||||
"key": " "
|
||||
},
|
||||
{
|
||||
"type": "uptime",
|
||||
"key": " "
|
||||
},
|
||||
{
|
||||
"type": "media",
|
||||
"key": " "
|
||||
"keyIcon": "",
|
||||
"key": "Title", // Title module has no key by default, so that icon is not displayed
|
||||
"format": "{user-name}@{host-name}"
|
||||
},
|
||||
"os",
|
||||
"kernel",
|
||||
"lm",
|
||||
"de",
|
||||
"wm",
|
||||
"shell",
|
||||
"terminal",
|
||||
"terminalfont",
|
||||
"theme",
|
||||
"icons",
|
||||
"wallpaper",
|
||||
"packages",
|
||||
"uptime",
|
||||
"media",
|
||||
{
|
||||
"type": "localip",
|
||||
"key": " ",
|
||||
"compact": true
|
||||
},
|
||||
{
|
||||
"type": "publicip",
|
||||
"key": " "
|
||||
},
|
||||
"publicip",
|
||||
{
|
||||
"type": "wifi",
|
||||
"key": " ",
|
||||
"format": "{4}" // ssid
|
||||
},
|
||||
{
|
||||
"type": "locale",
|
||||
"key": " "
|
||||
"format": "{ssid}"
|
||||
},
|
||||
"locale",
|
||||
{
|
||||
"type": "custom", // InformationEnd
|
||||
"format": "└────────────────────────────────────────────┘"
|
||||
"format": "└{$1}──────────────────────{$1}┘"
|
||||
},
|
||||
{
|
||||
"type": "colors",
|
||||
|
||||
+26
-21
@@ -4,7 +4,9 @@
|
||||
"logo": null,
|
||||
"display": {
|
||||
"pipe": true,
|
||||
"keyWidth": 16,
|
||||
"key": {
|
||||
"width": 16
|
||||
},
|
||||
"separator": "│ ",
|
||||
"percent": {
|
||||
"type": 6
|
||||
@@ -15,7 +17,10 @@
|
||||
"charElapsed": "█",
|
||||
"charTotal": "░",
|
||||
"width": 40
|
||||
}
|
||||
},
|
||||
"constants": [
|
||||
"\u001b[42C"
|
||||
]
|
||||
},
|
||||
"modules": [
|
||||
{
|
||||
@@ -41,11 +46,11 @@
|
||||
},
|
||||
{
|
||||
"type": "os",
|
||||
"key": "│ OS │\u001b[42C"
|
||||
"key": "│ OS │{$1}"
|
||||
},
|
||||
{
|
||||
"type": "kernel",
|
||||
"key": "│ KERNEL │\u001b[42C"
|
||||
"key": "│ KERNEL │{$1}"
|
||||
},
|
||||
{
|
||||
"type": "custom",
|
||||
@@ -53,34 +58,34 @@
|
||||
},
|
||||
{
|
||||
"type": "title",
|
||||
"key": "│ HOSTNAME │\u001b[42C",
|
||||
"key": "│ HOSTNAME │{$1}",
|
||||
"format": "{host-name}"
|
||||
},
|
||||
{
|
||||
"type": "localip",
|
||||
"key": "│ CLIENT IP │\u001b[42C",
|
||||
"key": "│ CLIENT IP │{$1}",
|
||||
"format": "{ipv4}"
|
||||
},
|
||||
{
|
||||
"type": "localip",
|
||||
"key": "│ MAC ADDR │\u001b[42C",
|
||||
"key": "│ MAC ADDR │{$1}",
|
||||
"format": "{mac} ({ifname})",
|
||||
"showIPv4": false,
|
||||
"showMac": true
|
||||
},
|
||||
{
|
||||
"type": "dns",
|
||||
"key": "│ DNS │\u001b[42C",
|
||||
"key": "│ DNS │{$1}",
|
||||
"showType": "ipv4"
|
||||
},
|
||||
{
|
||||
"type": "title",
|
||||
"key": "│ USER │\u001b[42C",
|
||||
"key": "│ USER │{$1}",
|
||||
"format": "{user-name}"
|
||||
},
|
||||
{
|
||||
"type": "host",
|
||||
"key": "│ MACHINE │\u001b[42C",
|
||||
"key": "│ MACHINE │{$1}",
|
||||
"format": "{name}"
|
||||
},
|
||||
{
|
||||
@@ -89,25 +94,25 @@
|
||||
},
|
||||
{
|
||||
"type": "cpu",
|
||||
"key": "│ PROCESSOR │\u001b[42C",
|
||||
"key": "│ PROCESSOR │{$1}",
|
||||
"format": "{name}"
|
||||
},
|
||||
{
|
||||
"type": "cpu",
|
||||
"key": "│ CORES │\u001b[42C",
|
||||
"key": "│ CORES │{$1}",
|
||||
"format": "{cores-physical} PHYSICAL CORES / {cores-logical} THREADS",
|
||||
"showPeCoreCount": false
|
||||
},
|
||||
{
|
||||
"type": "cpu",
|
||||
"key": "│ CPU FREQ │\u001b[42C",
|
||||
"format": "{freq-max}{/freq-max}{freq-base}{/} GHz"
|
||||
"key": "│ CPU FREQ │{$1}",
|
||||
"format": "{freq-max}{/freq-max}{freq-base}{/}"
|
||||
},
|
||||
{
|
||||
"type": "loadavg",
|
||||
"compact": false,
|
||||
// {duration} is not fixed length, hack it
|
||||
"key": "│ LOAD \u001b[s{duration}m\u001b[u\u001b[6C│\u001b[42C"
|
||||
"key": "│ LOAD \u001b[s{duration}m\u001b[u\u001b[6C│{$1}"
|
||||
},
|
||||
{
|
||||
"type": "custom",
|
||||
@@ -115,12 +120,12 @@
|
||||
},
|
||||
{
|
||||
"type": "memory",
|
||||
"key": "│ MEMORY │\u001b[42C",
|
||||
"key": "│ MEMORY │{$1}",
|
||||
"format": "{used} / {total} [{percentage}]"
|
||||
},
|
||||
{
|
||||
"type": "memory",
|
||||
"key": "│ USAGE │\u001b[42C",
|
||||
"key": "│ USAGE │{$1}",
|
||||
"format": ""
|
||||
},
|
||||
{
|
||||
@@ -129,13 +134,13 @@
|
||||
},
|
||||
{
|
||||
"type": "disk",
|
||||
"key": "│ VOLUME │\u001b[42C",
|
||||
"key": "│ VOLUME │{$1}",
|
||||
"format": "{size-used} / {size-total} [{size-percentage}]",
|
||||
"folders": "/"
|
||||
},
|
||||
{
|
||||
"type": "disk",
|
||||
"key": "│ DISK USAGE │\u001b[42C",
|
||||
"key": "│ DISK USAGE │{$1}",
|
||||
"format": ""
|
||||
},
|
||||
{
|
||||
@@ -144,13 +149,13 @@
|
||||
},
|
||||
{
|
||||
"type": "users",
|
||||
"key": "│ LAST LOGIN │\u001b[42C",
|
||||
"key": "│ LAST LOGIN │{$1}",
|
||||
"format": "{login-time}{?client-ip} ({client-ip})",
|
||||
"myselfOnly": true
|
||||
},
|
||||
{
|
||||
"type": "uptime",
|
||||
"key": "│ UPTIME │\u001b[42C"
|
||||
"key": "│ UPTIME │{$1}"
|
||||
},
|
||||
{
|
||||
"type": "custom",
|
||||
|
||||
@@ -3,39 +3,44 @@
|
||||
"logo": {
|
||||
"type": "small"
|
||||
},
|
||||
"display": {
|
||||
"constants": [
|
||||
"██ "
|
||||
]
|
||||
},
|
||||
"modules": [
|
||||
{
|
||||
"key": "██ Distro",
|
||||
"key": "{$1}Distro",
|
||||
"keyColor": "38;5;210",
|
||||
"type": "os"
|
||||
},
|
||||
{
|
||||
"key": "██ Kernel",
|
||||
"key": "{$1}Kernel",
|
||||
"keyColor": "38;5;84",
|
||||
"type": "kernel"
|
||||
},
|
||||
{
|
||||
"key": "██ Shell",
|
||||
"key": "{$1}Shell",
|
||||
"keyColor": "38;5;147",
|
||||
"type": "shell"
|
||||
},
|
||||
{
|
||||
"key": "██ Packages",
|
||||
"key": "{$1}Packages",
|
||||
"keyColor": "38;5;200",
|
||||
"type": "packages"
|
||||
},
|
||||
{
|
||||
"key": "██ WM",
|
||||
"key": "{$1}WM",
|
||||
"keyColor": "38;5;44",
|
||||
"type": "wm"
|
||||
},
|
||||
{
|
||||
"key": "██ CPU",
|
||||
"key": "{$1}CPU",
|
||||
"keyColor": "38;5;75",
|
||||
"type": "cpu"
|
||||
},
|
||||
{
|
||||
"key": "██ Memory",
|
||||
"key": "{$1}Memory",
|
||||
"keyColor": "38;5;123",
|
||||
"type": "memory"
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Designed for Arch Linux
|
||||
// Modified from: https://github.com/fastfetch-cli/fastfetch/pull/1025#issuecomment-2177566138
|
||||
{
|
||||
"$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json",
|
||||
@@ -12,7 +13,10 @@
|
||||
"color": {
|
||||
"separator": "blue"
|
||||
},
|
||||
"separator": " | "
|
||||
"separator": " | ",
|
||||
"constants": [
|
||||
">-----------<+>---------------------------------------------<"
|
||||
]
|
||||
},
|
||||
"modules": [
|
||||
{
|
||||
@@ -22,7 +26,7 @@
|
||||
},
|
||||
{
|
||||
"type": "custom",
|
||||
"format": ">-----------<+>------------------------------------------<",
|
||||
"format": "{$1}",
|
||||
"outputColor": "separator"
|
||||
},
|
||||
{
|
||||
@@ -57,7 +61,7 @@
|
||||
},
|
||||
{
|
||||
"type": "custom",
|
||||
"format": ">-----------<+>------------------------------------------<",
|
||||
"format": "{$1}",
|
||||
"outputColor": "separator"
|
||||
},
|
||||
{
|
||||
@@ -97,7 +101,7 @@
|
||||
},
|
||||
{
|
||||
"type": "custom",
|
||||
"format": ">-----------<+>------------------------------------------<",
|
||||
"format": "{$1}",
|
||||
"outputColor": "separator"
|
||||
},
|
||||
"break",
|
||||
|
||||
@@ -2,9 +2,13 @@
|
||||
|
||||
{
|
||||
"$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json",
|
||||
"logo": "debian_small",
|
||||
"logo": {
|
||||
"type": "small"
|
||||
},
|
||||
"display": {
|
||||
"binaryPrefix": "si"
|
||||
"size": {
|
||||
"binaryPrefix": "si"
|
||||
}
|
||||
},
|
||||
"modules": [
|
||||
"vulkan",
|
||||
|
||||
@@ -3,13 +3,15 @@
|
||||
{
|
||||
"$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json",
|
||||
"logo": {
|
||||
"source": "arch_small",
|
||||
"type": "small",
|
||||
"padding": {
|
||||
"right": 1
|
||||
}
|
||||
},
|
||||
"display": {
|
||||
"binaryPrefix": "si",
|
||||
"size": {
|
||||
"binaryPrefix": "si"
|
||||
},
|
||||
"color": "blue",
|
||||
"separator": " "
|
||||
},
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
"$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json",
|
||||
"logo": null,
|
||||
"display": {
|
||||
"color": "reset_magenta"
|
||||
"color": "magenta"
|
||||
},
|
||||
"modules": [
|
||||
{
|
||||
|
||||
@@ -3,12 +3,6 @@
|
||||
|
||||
{
|
||||
"$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json",
|
||||
// "logo": {
|
||||
// "type": "iterm",
|
||||
// "source": "/Users/carter/Desktop/apple1.png",
|
||||
// "width": 28,
|
||||
// "height": 12
|
||||
// },
|
||||
"display": {
|
||||
"separator": " "
|
||||
},
|
||||
@@ -125,23 +119,22 @@
|
||||
"key": "╰─",
|
||||
"keyColor": "yellow"
|
||||
},
|
||||
|
||||
"break",
|
||||
|
||||
{
|
||||
"type": "title",
|
||||
"key": "╭─",
|
||||
"format": "{1}@{2}",
|
||||
"format": "{user-name}@{host-name}",
|
||||
"keyColor": "blue"
|
||||
},
|
||||
{
|
||||
"type": "os",
|
||||
"key": "├─", // Just get your distro's logo off nerdfonts.com
|
||||
"key": "├─{icon}", // Just get your distro's logo off nerdfonts.com
|
||||
"keyColor": "blue"
|
||||
},
|
||||
{
|
||||
"type": "kernel",
|
||||
"key": "├─",
|
||||
"format": "{1} {2}",
|
||||
"keyColor": "blue"
|
||||
},
|
||||
{
|
||||
@@ -173,7 +166,7 @@
|
||||
{
|
||||
"type": "wifi",
|
||||
"key": "├─",
|
||||
"format": "{4}", // ssid
|
||||
"format": "{ssid}",
|
||||
"keyColor": "blue"
|
||||
},
|
||||
{
|
||||
|
||||
@@ -22,9 +22,8 @@
|
||||
},
|
||||
{
|
||||
"type": "os",
|
||||
"key": "├", // Just get your distro's logo off nerdfonts.com
|
||||
"keyColor": "yellow",
|
||||
"format": "{6}{?6} {?}{10}{?10} {?}{8}{?8} {?}{11}"
|
||||
"key": "├{icon}", // Just get your distro's logo off nerdfonts.com
|
||||
"keyColor": "yellow"
|
||||
},
|
||||
{
|
||||
"type": "kernel",
|
||||
@@ -106,13 +105,13 @@
|
||||
"keyColor": "green"
|
||||
},
|
||||
{
|
||||
"type": "uptime",
|
||||
"key": "├",
|
||||
"type": "display",
|
||||
"key": "├",
|
||||
"keyColor": "green"
|
||||
},
|
||||
{
|
||||
"type": "display",
|
||||
"key": "└",
|
||||
"type": "uptime",
|
||||
"key": "└",
|
||||
"keyColor": "green"
|
||||
},
|
||||
|
||||
|
||||
+13
-24
@@ -11,6 +11,9 @@
|
||||
"size": {
|
||||
"ndigits": 0,
|
||||
"maxPrefix": "MB"
|
||||
},
|
||||
"key": {
|
||||
"type": "icon"
|
||||
}
|
||||
},
|
||||
"modules": [
|
||||
@@ -22,31 +25,17 @@
|
||||
"host": "blue"
|
||||
}
|
||||
},
|
||||
"os",
|
||||
"kernel",
|
||||
"memory",
|
||||
"packages",
|
||||
"uptime",
|
||||
{
|
||||
"type": "os",
|
||||
"key": "",
|
||||
"format": "{2} {8}"
|
||||
},
|
||||
{
|
||||
"type": "kernel",
|
||||
"key": ""
|
||||
},
|
||||
{
|
||||
"type": "memory",
|
||||
"key": ""
|
||||
},
|
||||
{
|
||||
"type": "packages",
|
||||
"key": ""
|
||||
},
|
||||
{
|
||||
"type": "uptime",
|
||||
"key": ""
|
||||
},
|
||||
{
|
||||
"type": "custom",
|
||||
"key": "",
|
||||
"format": "{#31}███{#32}███{#33}███{#34}███{#35}███{#36}███"
|
||||
"type": "colors",
|
||||
"key": "Colors", // For printing icon
|
||||
"block": {
|
||||
"range": [1, 6]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -4,7 +4,9 @@
|
||||
"type": "small"
|
||||
},
|
||||
"display": {
|
||||
"keyWidth": 11,
|
||||
"key": {
|
||||
"width": 11
|
||||
},
|
||||
"bar": {
|
||||
"charElapsed": "=",
|
||||
"charTotal": "-",
|
||||
|
||||
@@ -1,37 +0,0 @@
|
||||
{
|
||||
"$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json",
|
||||
"modules": [
|
||||
{
|
||||
"type": "host",
|
||||
"format": "{?2}{2}{?}{?5} ({5}){?}"
|
||||
},
|
||||
"chassis",
|
||||
{
|
||||
"type": "board",
|
||||
"format": "{?1}{1}{?}{?2} ({2}){?}"
|
||||
},
|
||||
"cpu",
|
||||
{
|
||||
"type": "memory",
|
||||
"format": "{?2}{2}{?}"
|
||||
},
|
||||
"physicaldisk",
|
||||
"gpu",
|
||||
"display",
|
||||
"monitor",
|
||||
{
|
||||
"type": "wifi",
|
||||
"format": "{?1}{1}{?}{?6} - {6}{?}"
|
||||
},
|
||||
{
|
||||
"type": "sound",
|
||||
"format": "{?2}{2}{?}"
|
||||
},
|
||||
"camera",
|
||||
{
|
||||
"type": "battery",
|
||||
"format": "{?1}{1}{?}{?2} {2}{?}{?3} ({3}){?}"
|
||||
},
|
||||
"poweradapter"
|
||||
]
|
||||
}
|
||||
@@ -11,7 +11,10 @@
|
||||
"separator",
|
||||
"os",
|
||||
"host",
|
||||
"kernel",
|
||||
{
|
||||
"type": "kernel",
|
||||
"format": "{release}"
|
||||
},
|
||||
"uptime",
|
||||
"packages",
|
||||
"shell",
|
||||
@@ -28,7 +31,7 @@
|
||||
"terminal",
|
||||
{
|
||||
"type": "terminalfont",
|
||||
"format": "{/2}{-}{/}{2}{?3} {3}{?}"
|
||||
"format": "{/name}{-}{/}{name}{?size} {size}{?}"
|
||||
},
|
||||
"cpu",
|
||||
{
|
||||
@@ -37,7 +40,7 @@
|
||||
},
|
||||
{
|
||||
"type": "memory",
|
||||
"format": "{/1}{-}{/}{/2}{-}{/}{} / {}"
|
||||
"format": "{} / {}"
|
||||
},
|
||||
"break",
|
||||
"colors"
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
{
|
||||
"$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json",
|
||||
"modules": [
|
||||
"os",
|
||||
"kernel",
|
||||
"shell",
|
||||
"de",
|
||||
"wm",
|
||||
"wmtheme",
|
||||
"theme",
|
||||
"icons",
|
||||
"font",
|
||||
"cursor",
|
||||
"terminal",
|
||||
"terminalfont"
|
||||
]
|
||||
}
|
||||
Vendored
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"home": "https://github.com/ibireme/yyjson",
|
||||
"license": "MIT ( embed in source )",
|
||||
"version": "0.9.0",
|
||||
"version": "0.10.0",
|
||||
"author": "ibireme"
|
||||
}
|
||||
|
||||
Vendored
+152
-57
@@ -1831,6 +1831,42 @@ bool unsafe_yyjson_mut_equals(yyjson_mut_val *lhs, yyjson_mut_val *rhs) {
|
||||
}
|
||||
}
|
||||
|
||||
bool yyjson_locate_pos(const char *str, size_t len, size_t pos,
|
||||
size_t *line, size_t *col, size_t *chr) {
|
||||
usize line_sum = 0, line_pos = 0, chr_sum = 0;
|
||||
const u8 *cur = (const u8 *)str;
|
||||
const u8 *end = cur + pos;
|
||||
|
||||
if (!str || pos > len) {
|
||||
if (line) *line = 0;
|
||||
if (col) *col = 0;
|
||||
if (chr) *chr = 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
while (cur < end) {
|
||||
u8 c = *cur;
|
||||
chr_sum += 1;
|
||||
if (likely(c < 0x80)) { /* 0xxxxxxx (0x00-0x7F) ASCII */
|
||||
if (c == '\n') {
|
||||
line_sum += 1;
|
||||
line_pos = chr_sum;
|
||||
}
|
||||
cur += 1;
|
||||
}
|
||||
else if (c < 0xC0) cur += 1; /* 10xxxxxx (0x80-0xBF) Invalid */
|
||||
else if (c < 0xE0) cur += 2; /* 110xxxxx (0xC0-0xDF) 2-byte UTF-8 */
|
||||
else if (c < 0xF0) cur += 3; /* 1110xxxx (0xE0-0xEF) 3-byte UTF-8 */
|
||||
else if (c < 0xF8) cur += 4; /* 11110xxx (0xF0-0xF7) 4-byte UTF-8 */
|
||||
else cur += 1; /* 11111xxx (0xF8-0xFF) Invalid */
|
||||
}
|
||||
|
||||
if (line) *line = line_sum + 1;
|
||||
if (col) *col = chr_sum - line_pos + 1;
|
||||
if (chr) *chr = chr_sum;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
#if !YYJSON_DISABLE_UTILS
|
||||
@@ -4434,7 +4470,7 @@ static_inline bool read_number(u8 **ptr,
|
||||
bool sign;
|
||||
|
||||
/* read number as raw string if has `YYJSON_READ_NUMBER_AS_RAW` flag */
|
||||
if (unlikely(pre && !has_read_flag(BIGNUM_AS_RAW))) {
|
||||
if (has_read_flag(NUMBER_AS_RAW)) {
|
||||
return read_number_raw(ptr, pre, flg, val, msg);
|
||||
}
|
||||
|
||||
@@ -5036,7 +5072,7 @@ static_inline bool read_number(u8 **ptr,
|
||||
bool sign;
|
||||
|
||||
/* read number as raw string if has `YYJSON_READ_NUMBER_AS_RAW` flag */
|
||||
if (unlikely(pre && !has_read_flag(BIGNUM_AS_RAW))) {
|
||||
if (has_read_flag(NUMBER_AS_RAW)) {
|
||||
return read_number_raw(ptr, pre, flg, val, msg);
|
||||
}
|
||||
|
||||
@@ -5744,18 +5780,18 @@ static_noinline yyjson_doc *read_root_single(u8 *hdr,
|
||||
}
|
||||
if (*cur == 't') {
|
||||
if (likely(read_true(&cur, val))) goto doc_end;
|
||||
goto fail_literal;
|
||||
goto fail_literal_true;
|
||||
}
|
||||
if (*cur == 'f') {
|
||||
if (likely(read_false(&cur, val))) goto doc_end;
|
||||
goto fail_literal;
|
||||
goto fail_literal_false;
|
||||
}
|
||||
if (*cur == 'n') {
|
||||
if (likely(read_null(&cur, val))) goto doc_end;
|
||||
if (has_read_flag(ALLOW_INF_AND_NAN)) {
|
||||
if (read_nan(false, &cur, pre, val)) goto doc_end;
|
||||
}
|
||||
goto fail_literal;
|
||||
goto fail_literal_null;
|
||||
}
|
||||
if (has_read_flag(ALLOW_INF_AND_NAN)) {
|
||||
if (read_inf_or_nan(false, &cur, pre, val)) goto doc_end;
|
||||
@@ -5789,15 +5825,26 @@ fail_string:
|
||||
fail_number:
|
||||
return_err(cur, INVALID_NUMBER, msg);
|
||||
fail_alloc:
|
||||
return_err(cur, MEMORY_ALLOCATION, "memory allocation failed");
|
||||
fail_literal:
|
||||
return_err(cur, LITERAL, "invalid literal");
|
||||
fail_comment:
|
||||
return_err(cur, INVALID_COMMENT, "unclosed multiline comment");
|
||||
return_err(cur, MEMORY_ALLOCATION,
|
||||
"memory allocation failed");
|
||||
fail_literal_true:
|
||||
return_err(cur, LITERAL,
|
||||
"invalid literal, expected a valid literal such as 'true'");
|
||||
fail_literal_false:
|
||||
return_err(cur, LITERAL,
|
||||
"invalid literal, expected a valid literal such as 'false'");
|
||||
fail_literal_null:
|
||||
return_err(cur, LITERAL,
|
||||
"invalid literal, expected a valid literal such as 'null'");
|
||||
fail_character:
|
||||
return_err(cur, UNEXPECTED_CHARACTER, "unexpected character");
|
||||
return_err(cur, UNEXPECTED_CHARACTER,
|
||||
"unexpected character, expected a valid root value");
|
||||
fail_comment:
|
||||
return_err(cur, INVALID_COMMENT,
|
||||
"unclosed multiline comment");
|
||||
fail_garbage:
|
||||
return_err(cur, UNEXPECTED_CONTENT, "unexpected content after document");
|
||||
return_err(cur, UNEXPECTED_CONTENT,
|
||||
"unexpected content after document");
|
||||
|
||||
#undef return_err
|
||||
}
|
||||
@@ -5927,13 +5974,13 @@ arr_val_begin:
|
||||
val_incr();
|
||||
ctn_len++;
|
||||
if (likely(read_true(&cur, val))) goto arr_val_end;
|
||||
goto fail_literal;
|
||||
goto fail_literal_true;
|
||||
}
|
||||
if (*cur == 'f') {
|
||||
val_incr();
|
||||
ctn_len++;
|
||||
if (likely(read_false(&cur, val))) goto arr_val_end;
|
||||
goto fail_literal;
|
||||
goto fail_literal_false;
|
||||
}
|
||||
if (*cur == 'n') {
|
||||
val_incr();
|
||||
@@ -5942,7 +5989,7 @@ arr_val_begin:
|
||||
if (has_read_flag(ALLOW_INF_AND_NAN)) {
|
||||
if (read_nan(false, &cur, pre, val)) goto arr_val_end;
|
||||
}
|
||||
goto fail_literal;
|
||||
goto fail_literal_null;
|
||||
}
|
||||
if (*cur == ']') {
|
||||
cur++;
|
||||
@@ -5960,13 +6007,13 @@ arr_val_begin:
|
||||
val_incr();
|
||||
ctn_len++;
|
||||
if (read_inf_or_nan(false, &cur, pre, val)) goto arr_val_end;
|
||||
goto fail_character;
|
||||
goto fail_character_val;
|
||||
}
|
||||
if (has_read_flag(ALLOW_COMMENTS)) {
|
||||
if (skip_spaces_and_comments(&cur)) goto arr_val_begin;
|
||||
if (byte_match_2(cur, "/*")) goto fail_comment;
|
||||
}
|
||||
goto fail_character;
|
||||
goto fail_character_val;
|
||||
|
||||
arr_val_end:
|
||||
if (*cur == ',') {
|
||||
@@ -5985,7 +6032,7 @@ arr_val_end:
|
||||
if (skip_spaces_and_comments(&cur)) goto arr_val_end;
|
||||
if (byte_match_2(cur, "/*")) goto fail_comment;
|
||||
}
|
||||
goto fail_character;
|
||||
goto fail_character_arr_end;
|
||||
|
||||
arr_end:
|
||||
/* get parent container */
|
||||
@@ -6038,7 +6085,7 @@ obj_key_begin:
|
||||
if (skip_spaces_and_comments(&cur)) goto obj_key_begin;
|
||||
if (byte_match_2(cur, "/*")) goto fail_comment;
|
||||
}
|
||||
goto fail_character;
|
||||
goto fail_character_obj_key;
|
||||
|
||||
obj_key_end:
|
||||
if (*cur == ':') {
|
||||
@@ -6053,7 +6100,7 @@ obj_key_end:
|
||||
if (skip_spaces_and_comments(&cur)) goto obj_key_end;
|
||||
if (byte_match_2(cur, "/*")) goto fail_comment;
|
||||
}
|
||||
goto fail_character;
|
||||
goto fail_character_obj_sep;
|
||||
|
||||
obj_val_begin:
|
||||
if (*cur == '"') {
|
||||
@@ -6080,13 +6127,13 @@ obj_val_begin:
|
||||
val++;
|
||||
ctn_len++;
|
||||
if (likely(read_true(&cur, val))) goto obj_val_end;
|
||||
goto fail_literal;
|
||||
goto fail_literal_true;
|
||||
}
|
||||
if (*cur == 'f') {
|
||||
val++;
|
||||
ctn_len++;
|
||||
if (likely(read_false(&cur, val))) goto obj_val_end;
|
||||
goto fail_literal;
|
||||
goto fail_literal_false;
|
||||
}
|
||||
if (*cur == 'n') {
|
||||
val++;
|
||||
@@ -6095,7 +6142,7 @@ obj_val_begin:
|
||||
if (has_read_flag(ALLOW_INF_AND_NAN)) {
|
||||
if (read_nan(false, &cur, pre, val)) goto obj_val_end;
|
||||
}
|
||||
goto fail_literal;
|
||||
goto fail_literal_null;
|
||||
}
|
||||
if (char_is_space(*cur)) {
|
||||
while (char_is_space(*++cur));
|
||||
@@ -6106,13 +6153,13 @@ obj_val_begin:
|
||||
val++;
|
||||
ctn_len++;
|
||||
if (read_inf_or_nan(false, &cur, pre, val)) goto obj_val_end;
|
||||
goto fail_character;
|
||||
goto fail_character_val;
|
||||
}
|
||||
if (has_read_flag(ALLOW_COMMENTS)) {
|
||||
if (skip_spaces_and_comments(&cur)) goto obj_val_begin;
|
||||
if (byte_match_2(cur, "/*")) goto fail_comment;
|
||||
}
|
||||
goto fail_character;
|
||||
goto fail_character_val;
|
||||
|
||||
obj_val_end:
|
||||
if (likely(*cur == ',')) {
|
||||
@@ -6131,7 +6178,7 @@ obj_val_end:
|
||||
if (skip_spaces_and_comments(&cur)) goto obj_val_end;
|
||||
if (byte_match_2(cur, "/*")) goto fail_comment;
|
||||
}
|
||||
goto fail_character;
|
||||
goto fail_character_obj_end;
|
||||
|
||||
obj_end:
|
||||
/* pop container */
|
||||
@@ -6174,17 +6221,41 @@ fail_string:
|
||||
fail_number:
|
||||
return_err(cur, INVALID_NUMBER, msg);
|
||||
fail_alloc:
|
||||
return_err(cur, MEMORY_ALLOCATION, "memory allocation failed");
|
||||
return_err(cur, MEMORY_ALLOCATION,
|
||||
"memory allocation failed");
|
||||
fail_trailing_comma:
|
||||
return_err(cur, JSON_STRUCTURE, "trailing comma is not allowed");
|
||||
fail_literal:
|
||||
return_err(cur, LITERAL, "invalid literal");
|
||||
return_err(cur, JSON_STRUCTURE,
|
||||
"trailing comma is not allowed");
|
||||
fail_literal_true:
|
||||
return_err(cur, LITERAL,
|
||||
"invalid literal, expected a valid literal such as 'true'");
|
||||
fail_literal_false:
|
||||
return_err(cur, LITERAL,
|
||||
"invalid literal, expected a valid literal such as 'false'");
|
||||
fail_literal_null:
|
||||
return_err(cur, LITERAL,
|
||||
"invalid literal, expected a valid literal such as 'null'");
|
||||
fail_character_val:
|
||||
return_err(cur, UNEXPECTED_CHARACTER,
|
||||
"unexpected character, expected a valid JSON value");
|
||||
fail_character_arr_end:
|
||||
return_err(cur, UNEXPECTED_CHARACTER,
|
||||
"unexpected character, expected a comma or a closing bracket");
|
||||
fail_character_obj_key:
|
||||
return_err(cur, UNEXPECTED_CHARACTER,
|
||||
"unexpected character, expected a string for object key");
|
||||
fail_character_obj_sep:
|
||||
return_err(cur, UNEXPECTED_CHARACTER,
|
||||
"unexpected character, expected a colon after object key");
|
||||
fail_character_obj_end:
|
||||
return_err(cur, UNEXPECTED_CHARACTER,
|
||||
"unexpected character, expected a comma or a closing brace");
|
||||
fail_comment:
|
||||
return_err(cur, INVALID_COMMENT, "unclosed multiline comment");
|
||||
fail_character:
|
||||
return_err(cur, UNEXPECTED_CHARACTER, "unexpected character");
|
||||
return_err(cur, INVALID_COMMENT,
|
||||
"unclosed multiline comment");
|
||||
fail_garbage:
|
||||
return_err(cur, UNEXPECTED_CONTENT, "unexpected content after document");
|
||||
return_err(cur, UNEXPECTED_CONTENT,
|
||||
"unexpected content after document");
|
||||
|
||||
#undef val_incr
|
||||
#undef return_err
|
||||
@@ -6330,13 +6401,13 @@ arr_val_begin:
|
||||
val_incr();
|
||||
ctn_len++;
|
||||
if (likely(read_true(&cur, val))) goto arr_val_end;
|
||||
goto fail_literal;
|
||||
goto fail_literal_true;
|
||||
}
|
||||
if (*cur == 'f') {
|
||||
val_incr();
|
||||
ctn_len++;
|
||||
if (likely(read_false(&cur, val))) goto arr_val_end;
|
||||
goto fail_literal;
|
||||
goto fail_literal_false;
|
||||
}
|
||||
if (*cur == 'n') {
|
||||
val_incr();
|
||||
@@ -6345,7 +6416,7 @@ arr_val_begin:
|
||||
if (has_read_flag(ALLOW_INF_AND_NAN)) {
|
||||
if (read_nan(false, &cur, pre, val)) goto arr_val_end;
|
||||
}
|
||||
goto fail_literal;
|
||||
goto fail_literal_null;
|
||||
}
|
||||
if (*cur == ']') {
|
||||
cur++;
|
||||
@@ -6363,13 +6434,13 @@ arr_val_begin:
|
||||
val_incr();
|
||||
ctn_len++;
|
||||
if (read_inf_or_nan(false, &cur, pre, val)) goto arr_val_end;
|
||||
goto fail_character;
|
||||
goto fail_character_val;
|
||||
}
|
||||
if (has_read_flag(ALLOW_COMMENTS)) {
|
||||
if (skip_spaces_and_comments(&cur)) goto arr_val_begin;
|
||||
if (byte_match_2(cur, "/*")) goto fail_comment;
|
||||
}
|
||||
goto fail_character;
|
||||
goto fail_character_val;
|
||||
|
||||
arr_val_end:
|
||||
if (byte_match_2(cur, ",\n")) {
|
||||
@@ -6392,7 +6463,7 @@ arr_val_end:
|
||||
if (skip_spaces_and_comments(&cur)) goto arr_val_end;
|
||||
if (byte_match_2(cur, "/*")) goto fail_comment;
|
||||
}
|
||||
goto fail_character;
|
||||
goto fail_character_arr_end;
|
||||
|
||||
arr_end:
|
||||
/* get parent container */
|
||||
@@ -6458,7 +6529,7 @@ obj_key_begin:
|
||||
if (skip_spaces_and_comments(&cur)) goto obj_key_begin;
|
||||
if (byte_match_2(cur, "/*")) goto fail_comment;
|
||||
}
|
||||
goto fail_character;
|
||||
goto fail_character_obj_key;
|
||||
|
||||
obj_key_end:
|
||||
if (byte_match_2(cur, ": ")) {
|
||||
@@ -6477,7 +6548,7 @@ obj_key_end:
|
||||
if (skip_spaces_and_comments(&cur)) goto obj_key_end;
|
||||
if (byte_match_2(cur, "/*")) goto fail_comment;
|
||||
}
|
||||
goto fail_character;
|
||||
goto fail_character_obj_sep;
|
||||
|
||||
obj_val_begin:
|
||||
if (*cur == '"') {
|
||||
@@ -6504,13 +6575,13 @@ obj_val_begin:
|
||||
val++;
|
||||
ctn_len++;
|
||||
if (likely(read_true(&cur, val))) goto obj_val_end;
|
||||
goto fail_literal;
|
||||
goto fail_literal_true;
|
||||
}
|
||||
if (*cur == 'f') {
|
||||
val++;
|
||||
ctn_len++;
|
||||
if (likely(read_false(&cur, val))) goto obj_val_end;
|
||||
goto fail_literal;
|
||||
goto fail_literal_false;
|
||||
}
|
||||
if (*cur == 'n') {
|
||||
val++;
|
||||
@@ -6519,7 +6590,7 @@ obj_val_begin:
|
||||
if (has_read_flag(ALLOW_INF_AND_NAN)) {
|
||||
if (read_nan(false, &cur, pre, val)) goto obj_val_end;
|
||||
}
|
||||
goto fail_literal;
|
||||
goto fail_literal_null;
|
||||
}
|
||||
if (char_is_space(*cur)) {
|
||||
while (char_is_space(*++cur));
|
||||
@@ -6530,13 +6601,13 @@ obj_val_begin:
|
||||
val++;
|
||||
ctn_len++;
|
||||
if (read_inf_or_nan(false, &cur, pre, val)) goto obj_val_end;
|
||||
goto fail_character;
|
||||
goto fail_character_val;
|
||||
}
|
||||
if (has_read_flag(ALLOW_COMMENTS)) {
|
||||
if (skip_spaces_and_comments(&cur)) goto obj_val_begin;
|
||||
if (byte_match_2(cur, "/*")) goto fail_comment;
|
||||
}
|
||||
goto fail_character;
|
||||
goto fail_character_val;
|
||||
|
||||
obj_val_end:
|
||||
if (byte_match_2(cur, ",\n")) {
|
||||
@@ -6559,7 +6630,7 @@ obj_val_end:
|
||||
if (skip_spaces_and_comments(&cur)) goto obj_val_end;
|
||||
if (byte_match_2(cur, "/*")) goto fail_comment;
|
||||
}
|
||||
goto fail_character;
|
||||
goto fail_character_obj_end;
|
||||
|
||||
obj_end:
|
||||
/* pop container */
|
||||
@@ -6603,17 +6674,41 @@ fail_string:
|
||||
fail_number:
|
||||
return_err(cur, INVALID_NUMBER, msg);
|
||||
fail_alloc:
|
||||
return_err(cur, MEMORY_ALLOCATION, "memory allocation failed");
|
||||
return_err(cur, MEMORY_ALLOCATION,
|
||||
"memory allocation failed");
|
||||
fail_trailing_comma:
|
||||
return_err(cur, JSON_STRUCTURE, "trailing comma is not allowed");
|
||||
fail_literal:
|
||||
return_err(cur, LITERAL, "invalid literal");
|
||||
return_err(cur, JSON_STRUCTURE,
|
||||
"trailing comma is not allowed");
|
||||
fail_literal_true:
|
||||
return_err(cur, LITERAL,
|
||||
"invalid literal, expected a valid literal such as 'true'");
|
||||
fail_literal_false:
|
||||
return_err(cur, LITERAL,
|
||||
"invalid literal, expected a valid literal such as 'false'");
|
||||
fail_literal_null:
|
||||
return_err(cur, LITERAL,
|
||||
"invalid literal, expected a valid literal such as 'null'");
|
||||
fail_character_val:
|
||||
return_err(cur, UNEXPECTED_CHARACTER,
|
||||
"unexpected character, expected a valid JSON value");
|
||||
fail_character_arr_end:
|
||||
return_err(cur, UNEXPECTED_CHARACTER,
|
||||
"unexpected character, expected a comma or a closing bracket");
|
||||
fail_character_obj_key:
|
||||
return_err(cur, UNEXPECTED_CHARACTER,
|
||||
"unexpected character, expected a string for object key");
|
||||
fail_character_obj_sep:
|
||||
return_err(cur, UNEXPECTED_CHARACTER,
|
||||
"unexpected character, expected a colon after object key");
|
||||
fail_character_obj_end:
|
||||
return_err(cur, UNEXPECTED_CHARACTER,
|
||||
"unexpected character, expected a comma or a closing brace");
|
||||
fail_comment:
|
||||
return_err(cur, INVALID_COMMENT, "unclosed multiline comment");
|
||||
fail_character:
|
||||
return_err(cur, UNEXPECTED_CHARACTER, "unexpected character");
|
||||
return_err(cur, INVALID_COMMENT,
|
||||
"unclosed multiline comment");
|
||||
fail_garbage:
|
||||
return_err(cur, UNEXPECTED_CONTENT, "unexpected content after document");
|
||||
return_err(cur, UNEXPECTED_CONTENT,
|
||||
"unexpected content after document");
|
||||
|
||||
#undef val_incr
|
||||
#undef return_err
|
||||
@@ -7835,7 +7930,7 @@ static const u8 esc_single_char_table[512] = {
|
||||
|
||||
/** Returns the encode table with options. */
|
||||
static_inline const char_enc_type *get_enc_table_with_flag(
|
||||
yyjson_read_flag flg) {
|
||||
yyjson_write_flag flg) {
|
||||
if (has_write_flag(ESCAPE_UNICODE)) {
|
||||
if (has_write_flag(ESCAPE_SLASHES)) {
|
||||
return enc_table_esc_slash;
|
||||
|
||||
Vendored
+21
-3
@@ -527,16 +527,16 @@ extern "C" {
|
||||
#define YYJSON_VERSION_MAJOR 0
|
||||
|
||||
/** The minor version of yyjson. */
|
||||
#define YYJSON_VERSION_MINOR 9
|
||||
#define YYJSON_VERSION_MINOR 10
|
||||
|
||||
/** The patch version of yyjson. */
|
||||
#define YYJSON_VERSION_PATCH 0
|
||||
|
||||
/** The version of yyjson in hex: `(major << 16) | (minor << 8) | (patch)`. */
|
||||
#define YYJSON_VERSION_HEX 0x000900
|
||||
#define YYJSON_VERSION_HEX 0x000A00
|
||||
|
||||
/** The version string of yyjson. */
|
||||
#define YYJSON_VERSION_STRING "0.9.0"
|
||||
#define YYJSON_VERSION_STRING "0.10.0"
|
||||
|
||||
/** The version of yyjson in hex, same as `YYJSON_VERSION_HEX`. */
|
||||
yyjson_api uint32_t yyjson_version(void);
|
||||
@@ -841,6 +841,24 @@ typedef struct yyjson_read_err {
|
||||
size_t pos;
|
||||
} yyjson_read_err;
|
||||
|
||||
/**
|
||||
Locate the line and column number for a byte position in a string.
|
||||
This can be used to get better description for error position.
|
||||
|
||||
@param str The input string.
|
||||
@param len The byte length of the input string.
|
||||
@param pos The byte position within the input string.
|
||||
@param line A pointer to receive the line number, starting from 1.
|
||||
@param col A pointer to receive the column number, starting from 1.
|
||||
@param chr A pointer to receive the character index, starting from 0.
|
||||
@return true on success, false if `str` is NULL or `pos` is out of bounds.
|
||||
@note Line/column/character are calculated based on Unicode characters for
|
||||
compatibility with text editors. For multi-byte UTF-8 characters,
|
||||
the returned value may not directly correspond to the byte position.
|
||||
*/
|
||||
yyjson_api bool yyjson_locate_pos(const char *str, size_t len, size_t pos,
|
||||
size_t *line, size_t *col, size_t *chr);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -130,10 +130,7 @@ void ffPrintCommandOption(FFdata* data, yyjson_mut_doc* jsonDoc)
|
||||
{
|
||||
char str[32];
|
||||
int len = snprintf(str, sizeof str, "%" PRIu64 "ms", ms);
|
||||
if(instance.config.display.pipe)
|
||||
puts(str);
|
||||
else
|
||||
printf("\033[s\033[1A\033[9999999C\033[%dD%s\033[u", len, str); // Save; Up 1; Right 9999999; Left <len>; Print <str>; Load
|
||||
printf("\033[s\033[1A\033[9999999C\033[%dD%s\033[u", len, str); // Save; Up 1; Right 9999999; Left <len>; Print <str>; Load
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+64
-29
@@ -10,9 +10,8 @@ static bool loadLibSymbols(FFDBusLibrary* lib)
|
||||
FF_LIBRARY_LOAD(dbus, &instance.config.library.libDBus, false, "libdbus-1" FF_LIBRARY_EXTENSION, 4);
|
||||
FF_LIBRARY_LOAD_SYMBOL_PTR(dbus, lib, dbus_bus_get, false)
|
||||
FF_LIBRARY_LOAD_SYMBOL_PTR(dbus, lib, dbus_message_new_method_call, false)
|
||||
FF_LIBRARY_LOAD_SYMBOL_PTR(dbus, lib, dbus_message_append_args, false)
|
||||
FF_LIBRARY_LOAD_SYMBOL_PTR(dbus, lib, dbus_message_iter_init, false)
|
||||
FF_LIBRARY_LOAD_SYMBOL_PTR(dbus, lib, dbus_message_iter_init_append, false)
|
||||
FF_LIBRARY_LOAD_SYMBOL_PTR(dbus, lib, dbus_message_iter_append_basic, false)
|
||||
FF_LIBRARY_LOAD_SYMBOL_PTR(dbus, lib, dbus_message_iter_get_arg_type, false)
|
||||
FF_LIBRARY_LOAD_SYMBOL_PTR(dbus, lib, dbus_message_iter_get_basic, false)
|
||||
FF_LIBRARY_LOAD_SYMBOL_PTR(dbus, lib, dbus_message_iter_recurse, false)
|
||||
@@ -20,10 +19,6 @@ static bool loadLibSymbols(FFDBusLibrary* lib)
|
||||
FF_LIBRARY_LOAD_SYMBOL_PTR(dbus, lib, dbus_message_iter_next, false)
|
||||
FF_LIBRARY_LOAD_SYMBOL_PTR(dbus, lib, dbus_message_unref, false)
|
||||
FF_LIBRARY_LOAD_SYMBOL_PTR(dbus, lib, dbus_connection_send_with_reply_and_block, false)
|
||||
FF_LIBRARY_LOAD_SYMBOL_PTR(dbus, lib, dbus_connection_flush, false)
|
||||
FF_LIBRARY_LOAD_SYMBOL_PTR(dbus, lib, dbus_pending_call_block, false)
|
||||
FF_LIBRARY_LOAD_SYMBOL_PTR(dbus, lib, dbus_pending_call_steal_reply, false)
|
||||
FF_LIBRARY_LOAD_SYMBOL_PTR(dbus, lib, dbus_pending_call_unref, false)
|
||||
dbus = NULL; // don't auto dlclose
|
||||
return true;
|
||||
}
|
||||
@@ -56,11 +51,11 @@ const char* ffDBusLoadData(DBusBusType busType, FFDBusData* data)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
bool ffDBusGetValue(FFDBusData* dbus, DBusMessageIter* iter, FFstrbuf* result)
|
||||
bool ffDBusGetString(FFDBusData* dbus, DBusMessageIter* iter, FFstrbuf* result)
|
||||
{
|
||||
int argType = dbus->lib->ffdbus_message_iter_get_arg_type(iter);
|
||||
|
||||
if(argType == DBUS_TYPE_STRING)
|
||||
if(argType == DBUS_TYPE_STRING || argType == DBUS_TYPE_OBJECT_PATH)
|
||||
{
|
||||
const char* value = NULL;
|
||||
dbus->lib->ffdbus_message_iter_get_basic(iter, &value);
|
||||
@@ -72,6 +67,14 @@ bool ffDBusGetValue(FFDBusData* dbus, DBusMessageIter* iter, FFstrbuf* result)
|
||||
return true;
|
||||
}
|
||||
|
||||
if (argType == DBUS_TYPE_BYTE)
|
||||
{
|
||||
uint8_t value;
|
||||
dbus->lib->ffdbus_message_iter_get_basic(iter, &value);
|
||||
ffStrbufAppendC(result, (char) value);
|
||||
return false; // Don't append a comma
|
||||
}
|
||||
|
||||
if(argType != DBUS_TYPE_VARIANT && argType != DBUS_TYPE_ARRAY)
|
||||
return false;
|
||||
|
||||
@@ -79,7 +82,7 @@ bool ffDBusGetValue(FFDBusData* dbus, DBusMessageIter* iter, FFstrbuf* result)
|
||||
dbus->lib->ffdbus_message_iter_recurse(iter, &subIter);
|
||||
|
||||
if(argType == DBUS_TYPE_VARIANT)
|
||||
return ffDBusGetValue(dbus, &subIter, result);
|
||||
return ffDBusGetString(dbus, &subIter, result);
|
||||
|
||||
//At this point we have an array
|
||||
|
||||
@@ -87,13 +90,16 @@ bool ffDBusGetValue(FFDBusData* dbus, DBusMessageIter* iter, FFstrbuf* result)
|
||||
|
||||
while(true)
|
||||
{
|
||||
if(ffDBusGetValue(dbus, &subIter, result))
|
||||
if(ffDBusGetString(dbus, &subIter, result))
|
||||
{
|
||||
foundAValue = true;
|
||||
ffStrbufAppendS(result, ", ");
|
||||
}
|
||||
|
||||
FF_DBUS_ITER_CONTINUE(dbus, &subIter);
|
||||
if(!dbus->lib->ffdbus_message_iter_next(&subIter))
|
||||
break;
|
||||
else
|
||||
continue;
|
||||
}
|
||||
|
||||
if(foundAValue)
|
||||
@@ -122,11 +128,27 @@ bool ffDBusGetBool(FFDBusData* dbus, DBusMessageIter* iter, bool* result)
|
||||
return ffDBusGetBool(dbus, &subIter, result);
|
||||
}
|
||||
|
||||
bool ffDBusGetByte(FFDBusData* dbus, DBusMessageIter* iter, uint8_t* result)
|
||||
bool ffDBusGetUint(FFDBusData* dbus, DBusMessageIter* iter, uint32_t* result)
|
||||
{
|
||||
int argType = dbus->lib->ffdbus_message_iter_get_arg_type(iter);
|
||||
|
||||
if(argType == DBUS_TYPE_BYTE)
|
||||
{
|
||||
uint8_t value = 0;
|
||||
dbus->lib->ffdbus_message_iter_get_basic(iter, &value);
|
||||
*result = value;
|
||||
return true;
|
||||
}
|
||||
|
||||
if(argType == DBUS_TYPE_UINT16)
|
||||
{
|
||||
uint16_t value = 0;
|
||||
dbus->lib->ffdbus_message_iter_get_basic(iter, &value);
|
||||
*result = value;
|
||||
return true;
|
||||
}
|
||||
|
||||
if(argType == DBUS_TYPE_UINT32)
|
||||
{
|
||||
dbus->lib->ffdbus_message_iter_get_basic(iter, result);
|
||||
return true;
|
||||
@@ -137,15 +159,18 @@ bool ffDBusGetByte(FFDBusData* dbus, DBusMessageIter* iter, uint8_t* result)
|
||||
|
||||
DBusMessageIter subIter;
|
||||
dbus->lib->ffdbus_message_iter_recurse(iter, &subIter);
|
||||
return ffDBusGetByte(dbus, &subIter, result);
|
||||
return ffDBusGetUint(dbus, &subIter, result);
|
||||
}
|
||||
|
||||
DBusMessage* ffDBusGetMethodReply(FFDBusData* dbus, const char* busName, const char* objectPath, const char* interface, const char* method)
|
||||
DBusMessage* ffDBusGetMethodReply(FFDBusData* dbus, const char* busName, const char* objectPath, const char* interface, const char* method, const char* arg)
|
||||
{
|
||||
DBusMessage* message = dbus->lib->ffdbus_message_new_method_call(busName, objectPath, interface, method);
|
||||
if(message == NULL)
|
||||
return NULL;
|
||||
|
||||
if (arg)
|
||||
dbus->lib->ffdbus_message_append_args(message, DBUS_TYPE_STRING, &arg, DBUS_TYPE_INVALID);
|
||||
|
||||
DBusMessage* reply = dbus->lib->ffdbus_connection_send_with_reply_and_block(dbus->connection, message, FF_DBUS_TIMEOUT_MILLISECONDS, NULL);
|
||||
|
||||
dbus->lib->ffdbus_message_unref(message);
|
||||
@@ -159,20 +184,10 @@ DBusMessage* ffDBusGetProperty(FFDBusData* dbus, const char* busName, const char
|
||||
if(message == NULL)
|
||||
return NULL;
|
||||
|
||||
DBusMessageIter requestIterator;
|
||||
dbus->lib->ffdbus_message_iter_init_append(message, &requestIterator);
|
||||
|
||||
if(!dbus->lib->ffdbus_message_iter_append_basic(&requestIterator, DBUS_TYPE_STRING, &interface))
|
||||
{
|
||||
dbus->lib->ffdbus_message_unref(message);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if(!dbus->lib->ffdbus_message_iter_append_basic(&requestIterator, DBUS_TYPE_STRING, &property))
|
||||
{
|
||||
dbus->lib->ffdbus_message_unref(message);
|
||||
return NULL;
|
||||
}
|
||||
dbus->lib->ffdbus_message_append_args(message,
|
||||
DBUS_TYPE_STRING, &interface,
|
||||
DBUS_TYPE_STRING, &property,
|
||||
DBUS_TYPE_INVALID);
|
||||
|
||||
DBusMessage* reply = dbus->lib->ffdbus_connection_send_with_reply_and_block(dbus->connection, message, FF_DBUS_TIMEOUT_MILLISECONDS, NULL);
|
||||
|
||||
@@ -194,7 +209,27 @@ bool ffDBusGetPropertyString(FFDBusData* dbus, const char* busName, const char*
|
||||
return false;
|
||||
}
|
||||
|
||||
bool ret = ffDBusGetValue(dbus, &rootIterator, result);
|
||||
bool ret = ffDBusGetString(dbus, &rootIterator, result);
|
||||
|
||||
dbus->lib->ffdbus_message_unref(reply);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
bool ffDBusGetPropertyUint(FFDBusData* dbus, const char* busName, const char* objectPath, const char* interface, const char* property, uint32_t* result)
|
||||
{
|
||||
DBusMessage* reply = ffDBusGetProperty(dbus, busName, objectPath, interface, property);
|
||||
if(reply == NULL)
|
||||
return false;
|
||||
|
||||
DBusMessageIter rootIterator;
|
||||
if(!dbus->lib->ffdbus_message_iter_init(reply, &rootIterator))
|
||||
{
|
||||
dbus->lib->ffdbus_message_unref(reply);
|
||||
return false;
|
||||
}
|
||||
|
||||
bool ret = ffDBusGetUint(dbus, &rootIterator, result);
|
||||
|
||||
dbus->lib->ffdbus_message_unref(reply);
|
||||
|
||||
|
||||
+5
-18
@@ -7,22 +7,12 @@
|
||||
#include "common/library.h"
|
||||
|
||||
#define FF_DBUS_TIMEOUT_MILLISECONDS 35
|
||||
|
||||
#define FF_DBUS_ITER_CONTINUE(dbus, iterator) \
|
||||
{ \
|
||||
if(!(dbus)->lib->ffdbus_message_iter_has_next(iterator)) \
|
||||
break; \
|
||||
(dbus)->lib->ffdbus_message_iter_next(iterator); \
|
||||
continue; \
|
||||
}
|
||||
|
||||
typedef struct FFDBusLibrary
|
||||
{
|
||||
FF_LIBRARY_SYMBOL(dbus_bus_get)
|
||||
FF_LIBRARY_SYMBOL(dbus_message_new_method_call)
|
||||
FF_LIBRARY_SYMBOL(dbus_message_append_args)
|
||||
FF_LIBRARY_SYMBOL(dbus_message_iter_init)
|
||||
FF_LIBRARY_SYMBOL(dbus_message_iter_init_append)
|
||||
FF_LIBRARY_SYMBOL(dbus_message_iter_append_basic)
|
||||
FF_LIBRARY_SYMBOL(dbus_message_iter_get_arg_type)
|
||||
FF_LIBRARY_SYMBOL(dbus_message_iter_get_basic)
|
||||
FF_LIBRARY_SYMBOL(dbus_message_iter_recurse)
|
||||
@@ -30,10 +20,6 @@ typedef struct FFDBusLibrary
|
||||
FF_LIBRARY_SYMBOL(dbus_message_iter_next)
|
||||
FF_LIBRARY_SYMBOL(dbus_message_unref)
|
||||
FF_LIBRARY_SYMBOL(dbus_connection_send_with_reply_and_block)
|
||||
FF_LIBRARY_SYMBOL(dbus_connection_flush)
|
||||
FF_LIBRARY_SYMBOL(dbus_pending_call_block)
|
||||
FF_LIBRARY_SYMBOL(dbus_pending_call_steal_reply)
|
||||
FF_LIBRARY_SYMBOL(dbus_pending_call_unref)
|
||||
} FFDBusLibrary;
|
||||
|
||||
typedef struct FFDBusData
|
||||
@@ -43,11 +29,12 @@ typedef struct FFDBusData
|
||||
} FFDBusData;
|
||||
|
||||
const char* ffDBusLoadData(DBusBusType busType, FFDBusData* data); //Returns an error message or NULL on success
|
||||
bool ffDBusGetValue(FFDBusData* dbus, DBusMessageIter* iter, FFstrbuf* result);
|
||||
bool ffDBusGetString(FFDBusData* dbus, DBusMessageIter* iter, FFstrbuf* result);
|
||||
bool ffDBusGetBool(FFDBusData* dbus, DBusMessageIter* iter, bool* result);
|
||||
bool ffDBusGetByte(FFDBusData* dbus, DBusMessageIter* iter, uint8_t* result);
|
||||
DBusMessage* ffDBusGetMethodReply(FFDBusData* dbus, const char* busName, const char* objectPath, const char* interface, const char* method);
|
||||
bool ffDBusGetUint(FFDBusData* dbus, DBusMessageIter* iter, uint32_t* result);
|
||||
DBusMessage* ffDBusGetMethodReply(FFDBusData* dbus, const char* busName, const char* objectPath, const char* interface, const char* method, const char* arg);
|
||||
DBusMessage* ffDBusGetProperty(FFDBusData* dbus, const char* busName, const char* objectPath, const char* interface, const char* property);
|
||||
bool ffDBusGetPropertyString(FFDBusData* dbus, const char* busName, const char* objectPath, const char* interface, const char* property, FFstrbuf* result);
|
||||
bool ffDBusGetPropertyUint(FFDBusData* dbus, const char* busName, const char* objectPath, const char* interface, const char* property, uint32_t* result);
|
||||
|
||||
#endif // FF_HAVE_DBUS
|
||||
|
||||
@@ -244,6 +244,27 @@ void ffParseFormatString(FFstrbuf* buffer, const FFstrbuf* formatstr, uint32_t n
|
||||
continue;
|
||||
}
|
||||
|
||||
//test for constant, if so evaluate it
|
||||
if (firstChar == '$')
|
||||
{
|
||||
char* pend = NULL;
|
||||
int32_t indexSigned = (int32_t) strtol(placeholderValue.chars + 1, &pend, 10);
|
||||
uint32_t index = (uint32_t) indexSigned;
|
||||
bool backward = indexSigned < 0;
|
||||
|
||||
if (indexSigned == 0 || *pend != '\0' || instance.config.display.constants.length < index)
|
||||
{
|
||||
appendInvalidPlaceholder(buffer, "{", &placeholderValue, i, formatstr->length);
|
||||
continue;
|
||||
}
|
||||
|
||||
FFstrbuf* item = FF_LIST_GET(FFstrbuf, instance.config.display.constants, backward
|
||||
? instance.config.display.constants.length - index
|
||||
: index - 1);
|
||||
ffStrbufAppend(buffer, item);
|
||||
continue;
|
||||
}
|
||||
|
||||
int32_t truncLength = INT32_MAX;
|
||||
char* pColon = memchr(placeholderValue.chars, ':', placeholderValue.length);
|
||||
if (pColon != NULL)
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "util/FFstrbuf.h"
|
||||
|
||||
typedef enum FFformatargtype
|
||||
{
|
||||
FF_FORMAT_ARG_TYPE_NULL = 0,
|
||||
|
||||
+29
-32
@@ -173,94 +173,91 @@ void ffDestroyInstance(void)
|
||||
void ffListFeatures(void)
|
||||
{
|
||||
fputs(
|
||||
#ifdef FF_HAVE_THREADS
|
||||
#if FF_HAVE_THREADS
|
||||
"threads\n"
|
||||
#endif
|
||||
#ifdef FF_HAVE_VULKAN
|
||||
#if FF_HAVE_VULKAN
|
||||
"vulkan\n"
|
||||
#endif
|
||||
#ifdef FF_HAVE_WAYLAND
|
||||
#if FF_HAVE_WAYLAND
|
||||
"wayland\n"
|
||||
#endif
|
||||
#ifdef FF_HAVE_XCB_RANDR
|
||||
#if FF_HAVE_XCB_RANDR
|
||||
"xcb-randr\n"
|
||||
#endif
|
||||
#ifdef FF_HAVE_XCB
|
||||
#if FF_HAVE_XCB
|
||||
"xcb\n"
|
||||
#endif
|
||||
#ifdef FF_HAVE_XRANDR
|
||||
#if FF_HAVE_XRANDR
|
||||
"xrandr\n"
|
||||
#endif
|
||||
#ifdef FF_HAVE_X11
|
||||
#if FF_HAVE_X11
|
||||
"x11\n"
|
||||
#endif
|
||||
#ifdef FF_HAVE_DRM
|
||||
#if FF_HAVE_DRM
|
||||
"drm\n"
|
||||
#endif
|
||||
#ifdef FF_HAVE_GIO
|
||||
#if FF_HAVE_GIO
|
||||
"gio\n"
|
||||
#endif
|
||||
#ifdef FF_HAVE_DCONF
|
||||
#if FF_HAVE_DCONF
|
||||
"dconf\n"
|
||||
#endif
|
||||
#ifdef FF_HAVE_DBUS
|
||||
#if FF_HAVE_DBUS
|
||||
"dbus\n"
|
||||
#endif
|
||||
#ifdef FF_HAVE_IMAGEMAGICK7
|
||||
#if FF_HAVE_IMAGEMAGICK7
|
||||
"imagemagick7\n"
|
||||
#endif
|
||||
#ifdef FF_HAVE_IMAGEMAGICK6
|
||||
#if FF_HAVE_IMAGEMAGICK6
|
||||
"imagemagick6\n"
|
||||
#endif
|
||||
#ifdef FF_HAVE_CHAFA
|
||||
#if FF_HAVE_CHAFA
|
||||
"chafa\n"
|
||||
#endif
|
||||
#ifdef FF_HAVE_ZLIB
|
||||
#if FF_HAVE_ZLIB
|
||||
"zlib\n"
|
||||
#endif
|
||||
#ifdef FF_HAVE_XFCONF
|
||||
#if FF_HAVE_XFCONF
|
||||
"xfconf\n"
|
||||
#endif
|
||||
#ifdef FF_HAVE_SQLITE3
|
||||
#if FF_HAVE_SQLITE3
|
||||
"sqlite3\n"
|
||||
#endif
|
||||
#ifdef FF_HAVE_RPM
|
||||
#if FF_HAVE_RPM
|
||||
"rpm\n"
|
||||
#endif
|
||||
#ifdef FF_HAVE_EGL
|
||||
#if FF_HAVE_EGL
|
||||
"egl\n"
|
||||
#endif
|
||||
#ifdef FF_HAVE_GLX
|
||||
#if FF_HAVE_GLX
|
||||
"glx\n"
|
||||
#endif
|
||||
#ifdef FF_HAVE_OSMESA
|
||||
#if FF_HAVE_OSMESA
|
||||
"osmesa\n"
|
||||
#endif
|
||||
#ifdef FF_HAVE_OPENCL
|
||||
#if FF_HAVE_OPENCL
|
||||
"opencl\n"
|
||||
#endif
|
||||
#ifdef FF_HAVE_FREETYPE
|
||||
#if FF_HAVE_FREETYPE
|
||||
"freetype\n"
|
||||
#endif
|
||||
#ifdef FF_HAVE_PULSE
|
||||
#if FF_HAVE_PULSE
|
||||
"libpulse\n"
|
||||
#endif
|
||||
#ifdef FF_HAVE_LIBNM
|
||||
"libnm\n"
|
||||
#endif
|
||||
#ifdef FF_HAVE_DDCUTIL
|
||||
#if FF_HAVE_DDCUTIL
|
||||
"libddcutil\n"
|
||||
#endif
|
||||
#ifdef FF_HAVE_DIRECTX_HEADERS
|
||||
#if FF_HAVE_DIRECTX_HEADERS
|
||||
"Directx Headers\n"
|
||||
#endif
|
||||
#ifdef FF_USE_SYSTEM_YYJSON
|
||||
#if FF_USE_SYSTEM_YYJSON
|
||||
"System yyjson\n"
|
||||
#endif
|
||||
#if __has_include(<linux/videodev2.h>)
|
||||
#if FF_HAVE_LINUX_VIDEODEV2
|
||||
"linux/videodev2\n"
|
||||
#endif
|
||||
#if __has_include(<linux/wireless.h>)
|
||||
#if FF_HAVE_LINUX_WIRELESS
|
||||
"linux/wireless\n"
|
||||
#endif
|
||||
""
|
||||
|
||||
+16
-8
@@ -101,17 +101,25 @@ static inline bool ffPathExists(const char* path, FFPathType pathType)
|
||||
|
||||
#else
|
||||
|
||||
struct stat fileStat;
|
||||
if(stat(path, &fileStat) != 0)
|
||||
return false;
|
||||
if (pathType == FF_PATHTYPE_ANY)
|
||||
{
|
||||
// Zero overhead
|
||||
return access(path, F_OK) == 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
struct stat fileStat;
|
||||
if(stat(path, &fileStat) != 0)
|
||||
return false;
|
||||
|
||||
unsigned int mode = fileStat.st_mode & S_IFMT;
|
||||
unsigned int mode = fileStat.st_mode & S_IFMT;
|
||||
|
||||
if(pathType & FF_PATHTYPE_FILE && mode != S_IFDIR)
|
||||
return true;
|
||||
if(pathType & FF_PATHTYPE_FILE && mode != S_IFDIR)
|
||||
return true;
|
||||
|
||||
if(pathType & FF_PATHTYPE_DIRECTORY && mode == S_IFDIR)
|
||||
return true;
|
||||
if(pathType & FF_PATHTYPE_DIRECTORY && mode == S_IFDIR)
|
||||
return true;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
+28
-33
@@ -8,8 +8,10 @@
|
||||
#include <dirent.h>
|
||||
#include <errno.h>
|
||||
|
||||
#if __has_include(<wordexp.h>)
|
||||
#include <wordexp.h>
|
||||
#if FF_HAVE_WORDEXP
|
||||
#include <wordexp.h>
|
||||
#else
|
||||
#warning "<wordexp.h> not available"
|
||||
#endif
|
||||
|
||||
static void createSubfolders(const char* fileName)
|
||||
@@ -112,7 +114,7 @@ bool ffPathExpandEnv(FF_MAYBE_UNUSED const char* in, FF_MAYBE_UNUSED FFstrbuf* o
|
||||
{
|
||||
bool result = false;
|
||||
|
||||
#if __has_include(<wordexp.h>) // https://github.com/termux/termux-packages/pull/7056
|
||||
#if FF_HAVE_WORDEXP // https://github.com/termux/termux-packages/pull/7056
|
||||
|
||||
wordexp_t exp;
|
||||
if(wordexp(in, &exp, 0) != 0)
|
||||
@@ -131,46 +133,39 @@ bool ffPathExpandEnv(FF_MAYBE_UNUSED const char* in, FF_MAYBE_UNUSED FFstrbuf* o
|
||||
return result;
|
||||
}
|
||||
|
||||
static int ftty = -1;
|
||||
static struct termios oldTerm;
|
||||
void restoreTerm(void)
|
||||
{
|
||||
tcsetattr(ftty, TCSAFLUSH, &oldTerm);
|
||||
}
|
||||
|
||||
const char* ffGetTerminalResponse(const char* request, const char* format, ...)
|
||||
{
|
||||
int fin = STDIN_FILENO, fout = STDOUT_FILENO;
|
||||
FF_AUTO_CLOSE_FD int ftty = -1;
|
||||
if (ftty < 0)
|
||||
{
|
||||
ftty = open("/dev/tty", O_RDWR | O_NOCTTY | O_CLOEXEC);
|
||||
if (ftty < 0)
|
||||
return "open(\"/dev/tty\", O_RDWR | O_NOCTTY | O_CLOEXEC) failed";
|
||||
|
||||
if (!isatty(STDIN_FILENO))
|
||||
{
|
||||
if (ftty < 0)
|
||||
ftty = open("/dev/tty", O_RDWR | O_NOCTTY | O_CLOEXEC);
|
||||
fin = ftty;
|
||||
}
|
||||
if (!isatty(STDOUT_FILENO))
|
||||
{
|
||||
if (ftty < 0)
|
||||
ftty = open("/dev/tty", O_RDWR | O_NOCTTY | O_CLOEXEC);
|
||||
fout = ftty;
|
||||
if(tcgetattr(ftty, &oldTerm) == -1)
|
||||
return "tcgetattr(STDIN_FILENO, &oldTerm) failed";
|
||||
|
||||
struct termios newTerm = oldTerm;
|
||||
newTerm.c_lflag &= (tcflag_t) ~(ICANON | ECHO);
|
||||
if(tcsetattr(ftty, TCSAFLUSH, &newTerm) == -1)
|
||||
return "tcsetattr(STDIN_FILENO, TCSAFLUSH, &newTerm)";
|
||||
atexit(restoreTerm);
|
||||
}
|
||||
|
||||
struct termios oldTerm;
|
||||
if(tcgetattr(fin, &oldTerm) == -1)
|
||||
return "tcgetattr(STDIN_FILENO, &oldTerm) failed";
|
||||
|
||||
struct termios newTerm = oldTerm;
|
||||
newTerm.c_lflag &= (tcflag_t) ~(ICANON | ECHO);
|
||||
if(tcsetattr(fin, TCSAFLUSH, &newTerm) == -1)
|
||||
return "tcsetattr(STDIN_FILENO, TCSAFLUSH, &newTerm)";
|
||||
|
||||
ffWriteFDData(fout, strlen(request), request);
|
||||
ffWriteFDData(ftty, strlen(request), request);
|
||||
|
||||
//Give the terminal some time to respond
|
||||
if(poll(&(struct pollfd) { .fd = fin, .events = POLLIN }, 1, FF_IO_TERM_RESP_WAIT_MS) <= 0)
|
||||
{
|
||||
tcsetattr(fin, TCSANOW, &oldTerm);
|
||||
if(poll(&(struct pollfd) { .fd = ftty, .events = POLLIN }, 1, FF_IO_TERM_RESP_WAIT_MS) <= 0)
|
||||
return "poll() timeout or failed";
|
||||
}
|
||||
|
||||
char buffer[512];
|
||||
ssize_t bytesRead = read(fin, buffer, sizeof(buffer) - 1);
|
||||
|
||||
tcsetattr(fin, TCSANOW, &oldTerm);
|
||||
ssize_t bytesRead = read(ftty, buffer, sizeof(buffer) - 1);
|
||||
|
||||
if(bytesRead <= 0)
|
||||
return "read(STDIN_FILENO, buffer, sizeof(buffer) - 1) failed";
|
||||
|
||||
@@ -229,7 +229,6 @@ const char* ffGetTerminalResponse(const char* request, const char* format, ...)
|
||||
hConout = CreateFileW(L"CONOUT$", GENERIC_READ | GENERIC_WRITE, FILE_SHARE_WRITE, 0, OPEN_EXISTING, 0, NULL);
|
||||
hOutput = hConout;
|
||||
}
|
||||
WriteFile(hOutput, "TEST\n", 5, &bytes, NULL);
|
||||
WriteFile(hOutput, request, (DWORD) strlen(request), &bytes, NULL);
|
||||
}
|
||||
|
||||
|
||||
@@ -37,6 +37,11 @@ bool ffJsonConfigParseModuleArgs(const char* key, yyjson_val* val, FFModuleArgs*
|
||||
moduleArgs->keyWidth = (uint32_t) yyjson_get_uint(val);
|
||||
return true;
|
||||
}
|
||||
else if(ffStrEqualsIgnCase(key, "keyIcon"))
|
||||
{
|
||||
ffStrbufSetS(&moduleArgs->keyIcon, yyjson_get_str(val));
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -50,6 +55,8 @@ void ffJsonConfigGenerateModuleArgsConfig(yyjson_mut_doc* doc, yyjson_mut_val* m
|
||||
yyjson_mut_obj_add_strbuf(doc, module, "keyColor", &moduleArgs->keyColor);
|
||||
if (moduleArgs->keyWidth != defaultModuleArgs->keyWidth)
|
||||
yyjson_mut_obj_add_uint(doc, module, "keyWidth", moduleArgs->keyWidth);
|
||||
if (!ffStrbufEqual(&defaultModuleArgs->keyIcon, &moduleArgs->keyIcon))
|
||||
yyjson_mut_obj_add_strbuf(doc, module, "keyIcon", &moduleArgs->keyIcon);
|
||||
}
|
||||
|
||||
const char* ffJsonConfigParseEnum(yyjson_val* val, int* result, FFKeyValuePair pairs[])
|
||||
@@ -213,10 +220,7 @@ static const char* printJsonConfig(bool prepare, yyjson_mut_doc* jsonDoc)
|
||||
{
|
||||
char str[32];
|
||||
int len = snprintf(str, sizeof str, "%" PRIu64 "ms", ms);
|
||||
if(instance.config.display.pipe)
|
||||
puts(str);
|
||||
else
|
||||
printf("\033[s\033[1A\033[9999999C\033[%dD%s\033[u", len, str); // Save; Up 1; Right 9999999; Left <len>; Print <str>; Load
|
||||
printf("\033[s\033[1A\033[9999999C\033[%dD%s\033[u", len, str); // Save; Up 1; Right 9999999; Left <len>; Print <str>; Load
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@ static FFModuleBaseInfo* B[] = {
|
||||
(void*) &instance.config.modules.battery,
|
||||
(void*) &instance.config.modules.bios,
|
||||
(void*) &instance.config.modules.bluetooth,
|
||||
(void*) &instance.config.modules.bluetoothRadio,
|
||||
(void*) &instance.config.modules.board,
|
||||
(void*) &instance.config.modules.bootmgr,
|
||||
(void*) &instance.config.modules.break_,
|
||||
|
||||
+25
-28
@@ -50,20 +50,29 @@ bool ffOptionParseModuleArgs(const char* argumentKey, const char* subKey, const
|
||||
ffOptionParseColor(value, &result->outputColor);
|
||||
return true;
|
||||
}
|
||||
else if(ffStrEqualsIgnCase(subKey, "key-color"))
|
||||
else if(ffStrStartsWithIgnCase(subKey, "key-"))
|
||||
{
|
||||
if(value == NULL)
|
||||
const char* subKey2 = subKey + strlen("key-");
|
||||
if(ffStrEqualsIgnCase(subKey2, "color"))
|
||||
{
|
||||
fprintf(stderr, "Error: usage: %s <str>\n", argumentKey);
|
||||
exit(477);
|
||||
if(value == NULL)
|
||||
{
|
||||
fprintf(stderr, "Error: usage: %s <str>\n", argumentKey);
|
||||
exit(477);
|
||||
}
|
||||
ffOptionParseColor(value, &result->keyColor);
|
||||
return true;
|
||||
}
|
||||
else if(ffStrEqualsIgnCase(subKey2, "width"))
|
||||
{
|
||||
result->keyWidth = ffOptionParseUInt32(argumentKey, value);
|
||||
return true;
|
||||
}
|
||||
else if(ffStrEqualsIgnCase(subKey2, "icon"))
|
||||
{
|
||||
ffOptionParseString(argumentKey, value, &result->keyIcon);
|
||||
return true;
|
||||
}
|
||||
ffOptionParseColor(value, &result->keyColor);
|
||||
return true;
|
||||
}
|
||||
else if(ffStrEqualsIgnCase(subKey, "key-width"))
|
||||
{
|
||||
result->keyWidth = ffOptionParseUInt32(argumentKey, value);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -197,6 +206,11 @@ void ffOptionParseColorNoClear(const char* value, FFstrbuf* buffer)
|
||||
else FF_APPEND_COLOR_PROP_COND(title, colorTitle)
|
||||
else FF_APPEND_COLOR_PROP_COND(output, colorOutput)
|
||||
else FF_APPEND_COLOR_PROP_COND(separator, colorSeparator)
|
||||
else
|
||||
{
|
||||
fprintf(stderr, "Error: invalid color code found: %s\n", value);
|
||||
exit(479);
|
||||
}
|
||||
}
|
||||
ffStrbufAppendC(buffer, *value);
|
||||
++value;
|
||||
@@ -205,20 +219,3 @@ void ffOptionParseColorNoClear(const char* value, FFstrbuf* buffer)
|
||||
#undef FF_APPEND_COLOR_PROP_COND
|
||||
}
|
||||
}
|
||||
|
||||
void ffOptionInitModuleArg(FFModuleArgs* args)
|
||||
{
|
||||
ffStrbufInit(&args->key);
|
||||
ffStrbufInit(&args->keyColor);
|
||||
ffStrbufInit(&args->outputFormat);
|
||||
ffStrbufInit(&args->outputColor);
|
||||
args->keyWidth = 0;
|
||||
}
|
||||
|
||||
void ffOptionDestroyModuleArg(FFModuleArgs* args)
|
||||
{
|
||||
ffStrbufDestroy(&args->key);
|
||||
ffStrbufDestroy(&args->keyColor);
|
||||
ffStrbufDestroy(&args->outputFormat);
|
||||
ffStrbufDestroy(&args->outputColor);
|
||||
}
|
||||
|
||||
+28
-2
@@ -45,10 +45,19 @@ static inline void ffOptionInitModuleBaseInfo(
|
||||
baseInfo->generateJsonConfig = (__typeof__(baseInfo->generateJsonConfig)) generateJsonConfig;
|
||||
}
|
||||
|
||||
typedef enum FFModuleKeyType
|
||||
{
|
||||
FF_MODULE_KEY_TYPE_NONE = 0,
|
||||
FF_MODULE_KEY_TYPE_STRING = 1 << 0,
|
||||
FF_MODULE_KEY_TYPE_ICON = 1 << 1,
|
||||
FF_MODULE_KEY_TYPE_BOTH = FF_MODULE_KEY_TYPE_STRING | FF_MODULE_KEY_TYPE_ICON,
|
||||
} FFModuleKeyType;
|
||||
|
||||
typedef struct FFModuleArgs
|
||||
{
|
||||
FFstrbuf key;
|
||||
FFstrbuf keyColor;
|
||||
FFstrbuf keyIcon;
|
||||
FFstrbuf outputFormat;
|
||||
FFstrbuf outputColor;
|
||||
uint32_t keyWidth;
|
||||
@@ -73,5 +82,22 @@ static inline void ffOptionParseColor(const char* value, FFstrbuf* buffer)
|
||||
ffStrbufClear(buffer);
|
||||
ffOptionParseColorNoClear(value, buffer);
|
||||
}
|
||||
void ffOptionInitModuleArg(FFModuleArgs* args);
|
||||
void ffOptionDestroyModuleArg(FFModuleArgs* args);
|
||||
|
||||
static inline void ffOptionInitModuleArg(FFModuleArgs* args, const char* icon)
|
||||
{
|
||||
ffStrbufInit(&args->key);
|
||||
ffStrbufInit(&args->keyColor);
|
||||
ffStrbufInitStatic(&args->keyIcon, icon);
|
||||
ffStrbufInit(&args->outputFormat);
|
||||
ffStrbufInit(&args->outputColor);
|
||||
args->keyWidth = 0;
|
||||
}
|
||||
|
||||
static inline void ffOptionDestroyModuleArg(FFModuleArgs* args)
|
||||
{
|
||||
ffStrbufDestroy(&args->key);
|
||||
ffStrbufDestroy(&args->keyColor);
|
||||
ffStrbufDestroy(&args->keyIcon);
|
||||
ffStrbufDestroy(&args->outputFormat);
|
||||
ffStrbufDestroy(&args->outputColor);
|
||||
}
|
||||
|
||||
+18
-4
@@ -79,15 +79,15 @@ static void parseSize(FFstrbuf* result, uint64_t bytes, uint32_t base, const cha
|
||||
|
||||
void ffParseSize(uint64_t bytes, FFstrbuf* result)
|
||||
{
|
||||
switch (instance.config.display.binaryPrefixType)
|
||||
switch (instance.config.display.sizeBinaryPrefix)
|
||||
{
|
||||
case FF_BINARY_PREFIX_TYPE_IEC:
|
||||
case FF_SIZE_BINARY_PREFIX_TYPE_IEC:
|
||||
parseSize(result, bytes, 1024, (const char*[]) {"B", "KiB", "MiB", "GiB", "TiB", "PiB", "EiB", "ZiB", "YiB", NULL});
|
||||
break;
|
||||
case FF_BINARY_PREFIX_TYPE_SI:
|
||||
case FF_SIZE_BINARY_PREFIX_TYPE_SI:
|
||||
parseSize(result, bytes, 1000, (const char*[]) {"B", "kB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB", NULL});
|
||||
break;
|
||||
case FF_BINARY_PREFIX_TYPE_JEDEC:
|
||||
case FF_SIZE_BINARY_PREFIX_TYPE_JEDEC:
|
||||
parseSize(result, bytes, 1024, (const char*[]) {"B", "KB", "MB", "GB", "TB", NULL});
|
||||
break;
|
||||
default:
|
||||
@@ -96,6 +96,20 @@ void ffParseSize(uint64_t bytes, FFstrbuf* result)
|
||||
}
|
||||
}
|
||||
|
||||
bool ffParseFrequency(uint32_t mhz, FFstrbuf* result)
|
||||
{
|
||||
if (mhz == 0)
|
||||
return false;
|
||||
|
||||
int8_t ndigits = instance.config.display.freqNdigits;
|
||||
|
||||
if (ndigits >= 0)
|
||||
ffStrbufAppendF(result, "%.*f GHz", ndigits, mhz / 1000.);
|
||||
else
|
||||
ffStrbufAppendF(result, "%u MHz", (unsigned) mhz);
|
||||
return true;
|
||||
}
|
||||
|
||||
void ffParseGTK(FFstrbuf* buffer, const FFstrbuf* gtk2, const FFstrbuf* gtk3, const FFstrbuf* gtk4)
|
||||
{
|
||||
if(gtk2->length > 0 && gtk3->length > 0 && gtk4->length > 0)
|
||||
|
||||
@@ -26,3 +26,4 @@ void ffVersionToPretty(const FFVersion* version, FFstrbuf* pretty);
|
||||
int8_t ffVersionCompare(const FFVersion* version1, const FFVersion* version2);
|
||||
|
||||
void ffParseSize(uint64_t bytes, FFstrbuf* result);
|
||||
bool ffParseFrequency(uint32_t mhz, FFstrbuf* result);
|
||||
|
||||
+29
-13
@@ -11,8 +11,10 @@ void ffPrintLogoAndKey(const char* moduleName, uint8_t moduleIndex, const FFModu
|
||||
return;
|
||||
|
||||
//This is used as a magic value for hiding keys
|
||||
if (!(moduleArgs && ffStrbufEqualS(&moduleArgs->key, " ")))
|
||||
if (!(moduleArgs && ffStrbufEqualS(&moduleArgs->key, " ")) && instance.config.display.keyType != FF_MODULE_KEY_TYPE_NONE)
|
||||
{
|
||||
ffPrintCharTimes(' ', instance.config.display.keyPaddingLeft);
|
||||
|
||||
if(!instance.config.display.pipe)
|
||||
{
|
||||
fputs(FASTFETCH_TEXT_MODIFIER_RESET, stdout);
|
||||
@@ -25,21 +27,35 @@ void ffPrintLogoAndKey(const char* moduleName, uint8_t moduleIndex, const FFModu
|
||||
ffPrintColor(&instance.config.display.colorKeys);
|
||||
}
|
||||
|
||||
//NULL check is required for modules with custom keys, e.g. disk with the folder path
|
||||
if((printType & FF_PRINT_TYPE_NO_CUSTOM_KEY) || !moduleArgs || moduleArgs->key.length == 0)
|
||||
bool hasIcon = false;
|
||||
if (instance.config.display.keyType & FF_MODULE_KEY_TYPE_ICON && moduleArgs && moduleArgs->keyIcon.length > 0)
|
||||
{
|
||||
fputs(moduleName, stdout);
|
||||
|
||||
if(moduleIndex > 0)
|
||||
printf(" %hhu", moduleIndex);
|
||||
ffStrbufWriteTo(&moduleArgs->keyIcon, stdout);
|
||||
hasIcon = true;
|
||||
}
|
||||
else
|
||||
|
||||
if (instance.config.display.keyType & FF_MODULE_KEY_TYPE_STRING)
|
||||
{
|
||||
FF_STRBUF_AUTO_DESTROY key = ffStrbufCreate();
|
||||
FF_PARSE_FORMAT_STRING_CHECKED(&key, &moduleArgs->key, 1, ((FFformatarg[]){
|
||||
{FF_FORMAT_ARG_TYPE_UINT8, &moduleIndex, "index"},
|
||||
}));
|
||||
ffStrbufWriteTo(&key, stdout);
|
||||
if(hasIcon)
|
||||
putchar(' ');
|
||||
|
||||
//NULL check is required for modules with custom keys, e.g. disk with the folder path
|
||||
if((printType & FF_PRINT_TYPE_NO_CUSTOM_KEY) || !moduleArgs || moduleArgs->key.length == 0)
|
||||
{
|
||||
fputs(moduleName, stdout);
|
||||
|
||||
if(moduleIndex > 0)
|
||||
printf(" %hhu", moduleIndex);
|
||||
}
|
||||
else
|
||||
{
|
||||
FF_STRBUF_AUTO_DESTROY key = ffStrbufCreate();
|
||||
FF_PARSE_FORMAT_STRING_CHECKED(&key, &moduleArgs->key, 2, ((FFformatarg[]){
|
||||
{FF_FORMAT_ARG_TYPE_UINT8, &moduleIndex, "index"},
|
||||
{FF_FORMAT_ARG_TYPE_STRBUF, &moduleArgs->keyIcon, "icon"},
|
||||
}));
|
||||
ffStrbufWriteTo(&key, stdout);
|
||||
}
|
||||
}
|
||||
|
||||
if(!instance.config.display.pipe)
|
||||
|
||||
@@ -4,11 +4,12 @@
|
||||
#include "util/mallocHelper.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <ctype.h>
|
||||
#ifdef _WIN32
|
||||
#include "util/windows/getline.h"
|
||||
#endif
|
||||
|
||||
static bool parsePropLinePointer(const char** line, const char* start, FFstrbuf* buffer)
|
||||
bool ffParsePropLinePointer(const char** line, const char* start, FFstrbuf* buffer)
|
||||
{
|
||||
if(**line == '\0')
|
||||
return false;
|
||||
@@ -32,7 +33,7 @@ static bool parsePropLinePointer(const char** line, const char* start, FFstrbuf*
|
||||
}
|
||||
|
||||
//Line doesn't match start, skip it
|
||||
if(**line != *start || **line == '\0')
|
||||
if(tolower(**line) != tolower(*start) || **line == '\0')
|
||||
return false;
|
||||
|
||||
//Line and start match, continue testing
|
||||
@@ -69,14 +70,9 @@ static bool parsePropLinePointer(const char** line, const char* start, FFstrbuf*
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ffParsePropLine(const char* line, const char* start, FFstrbuf* buffer)
|
||||
{
|
||||
return parsePropLinePointer(&line, start, buffer);
|
||||
}
|
||||
|
||||
bool ffParsePropLines(const char* lines, const char* start, FFstrbuf* buffer)
|
||||
{
|
||||
while(!parsePropLinePointer(&lines, start, buffer))
|
||||
while(!ffParsePropLinePointer(&lines, start, buffer))
|
||||
{
|
||||
while(*lines != '\0' && *lines != '\n')
|
||||
++lines;
|
||||
|
||||
@@ -8,12 +8,18 @@ typedef struct FFpropquery
|
||||
FFstrbuf* buffer;
|
||||
} FFpropquery;
|
||||
|
||||
bool ffParsePropLine(const char* line, const char* start, FFstrbuf* buffer);
|
||||
bool ffParsePropLines(const char* lines, const char* start, FFstrbuf* buffer);
|
||||
bool ffParsePropFileValues(const char* filename, uint32_t numQueries, FFpropquery* queries);
|
||||
bool ffParsePropFileHomeValues(const char* relativeFile, uint32_t numQueries, FFpropquery* queries);
|
||||
bool ffParsePropFileListValues(const FFlist* list, const char* relativeFile, uint32_t numQueries, FFpropquery* queries);
|
||||
|
||||
bool ffParsePropLinePointer(const char** line, const char* start, FFstrbuf* buffer);
|
||||
|
||||
static inline bool ffParsePropLine(const char* line, const char* start, FFstrbuf* buffer)
|
||||
{
|
||||
return ffParsePropLinePointer(&line, start, buffer);
|
||||
}
|
||||
|
||||
static inline bool ffParsePropFile(const char* filename, const char* start, FFstrbuf* buffer)
|
||||
{
|
||||
return ffParsePropFileValues(filename, 1, (FFpropquery[]){{start, buffer}});
|
||||
|
||||
+2
-2
@@ -33,7 +33,7 @@
|
||||
#else
|
||||
#include <pthread.h>
|
||||
#include <signal.h>
|
||||
#if __has_include(<pthread_np.h>)
|
||||
#if FF_HAVE_PTHREAD_NP
|
||||
#include <pthread_np.h>
|
||||
#endif
|
||||
#define FF_THREAD_MUTEX_INITIALIZER PTHREAD_MUTEX_INITIALIZER
|
||||
@@ -51,7 +51,7 @@
|
||||
static inline void ffThreadDetach(FFThreadType thread) { pthread_detach(thread); }
|
||||
static inline bool ffThreadJoin(FFThreadType thread, FF_MAYBE_UNUSED uint32_t timeout)
|
||||
{
|
||||
#if (defined(__linux__) && !defined(__ANDROID__)) || __has_include(<pthread_np.h>)
|
||||
#if HAVE_TIMEDJOIN_NP
|
||||
if (timeout > 0)
|
||||
{
|
||||
struct timespec ts;
|
||||
|
||||
+2
-2
@@ -20,7 +20,7 @@ static inline uint64_t ffTimeGetTick() //In msec
|
||||
#else
|
||||
struct timespec timeNow;
|
||||
clock_gettime(CLOCK_MONOTONIC, &timeNow);
|
||||
return (uint64_t)((timeNow.tv_sec * 1000) + (timeNow.tv_nsec / 1000000));
|
||||
return (uint64_t)(((uint64_t) timeNow.tv_sec * 1000u) + ((uint64_t) timeNow.tv_nsec / 1000000u));
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ static inline uint64_t ffTimeGetNow()
|
||||
#else
|
||||
struct timespec timeNow;
|
||||
clock_gettime(CLOCK_REALTIME, &timeNow);
|
||||
return (uint64_t)((timeNow.tv_sec * 1000) + (timeNow.tv_nsec / 1000000));
|
||||
return (uint64_t)(((uint64_t) timeNow.tv_sec * 1000u) + ((uint64_t) timeNow.tv_nsec / 1000000u));
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
+73
-41
@@ -148,6 +148,16 @@
|
||||
"false": "Try `wayland`, then `x11`, then `drm`"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"long": "detect-version",
|
||||
"desc": "Whether to detect and display the version of terminal, shell and editor",
|
||||
"remark": "Mainly for benchmarking",
|
||||
"arg": {
|
||||
"type": "bool",
|
||||
"optional": true,
|
||||
"default": true
|
||||
}
|
||||
}
|
||||
],
|
||||
"Logo": [
|
||||
@@ -495,6 +505,27 @@
|
||||
"type": "num"
|
||||
}
|
||||
},
|
||||
{
|
||||
"long": "key-padding-left",
|
||||
"desc": "Set the left padding of keys to <num> characters",
|
||||
"arg": {
|
||||
"type": "num"
|
||||
}
|
||||
},
|
||||
{
|
||||
"long": "key-type",
|
||||
"desc": "Set whether to show icon before string keys",
|
||||
"arg": {
|
||||
"type": "enum",
|
||||
"enum": {
|
||||
"none": "Disable keys",
|
||||
"string": "Show string",
|
||||
"icon": "Show icon (requires newest nerd font)",
|
||||
"both": "Show both icon and string"
|
||||
},
|
||||
"default": "string"
|
||||
}
|
||||
},
|
||||
{
|
||||
"long": "bright-color",
|
||||
"desc": "Set if the keys, title and ASCII logo should be printed in bright color",
|
||||
@@ -539,19 +570,6 @@
|
||||
"default": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"long": "binary-prefix",
|
||||
"desc": "Set the binary prefix to used",
|
||||
"arg": {
|
||||
"type": "enum",
|
||||
"enum": {
|
||||
"IEC": "1024 Bytes = 1 KiB, 1024 KiB = 1 MiB, ...",
|
||||
"SI": "1000 Bytes = 1 KB, 1000 KB = 1 MB, ...",
|
||||
"JEDEC": "1024 Bytes = 1 kB, 1024 kB = 1 MB, ..."
|
||||
},
|
||||
"default": "IEC"
|
||||
}
|
||||
},
|
||||
{
|
||||
"long": "percent-type",
|
||||
"desc": "Set the percentage output type",
|
||||
@@ -659,6 +677,19 @@
|
||||
"type": "num"
|
||||
}
|
||||
},
|
||||
{
|
||||
"long": "size-binary-prefix",
|
||||
"desc": "Set the binary prefix to used when formatting sizes",
|
||||
"arg": {
|
||||
"type": "enum",
|
||||
"enum": {
|
||||
"IEC": "1024 Bytes = 1 KiB, 1024 KiB = 1 MiB, ...",
|
||||
"SI": "1000 Bytes = 1 KB, 1000 KB = 1 MB, ...",
|
||||
"JEDEC": "1024 Bytes = 1 kB, 1024 kB = 1 MB, ..."
|
||||
},
|
||||
"default": "IEC"
|
||||
}
|
||||
},
|
||||
{
|
||||
"long": "size-max-prefix",
|
||||
"desc": "Set the largest binary prefix to use when formatting sizes",
|
||||
@@ -678,6 +709,14 @@
|
||||
"default": "YB"
|
||||
}
|
||||
},
|
||||
{
|
||||
"long": "freq-ndigits",
|
||||
"desc": "Set the number of digits to keep after the decimal point when printing CPU / GPU frequency in GHz",
|
||||
"arg": {
|
||||
"type": "num",
|
||||
"default": 2
|
||||
}
|
||||
},
|
||||
{
|
||||
"long": "temp-unit",
|
||||
"desc": "Set the unit of the temperature",
|
||||
@@ -725,26 +764,9 @@
|
||||
"type": "color",
|
||||
"default": "light_red"
|
||||
}
|
||||
},
|
||||
{
|
||||
"long": "ts-version",
|
||||
"desc": "Whether to detect and display the version of terminal, shell and editor",
|
||||
"remark": "Mainly for benchmarking",
|
||||
"arg": {
|
||||
"type": "bool",
|
||||
"optional": true,
|
||||
"default": true
|
||||
}
|
||||
}
|
||||
],
|
||||
"Library path": [
|
||||
{
|
||||
"long": "lib-pci",
|
||||
"desc": "Pciutils. Used for GPU output",
|
||||
"arg": {
|
||||
"type": "path"
|
||||
}
|
||||
},
|
||||
{
|
||||
"long": "lib-vulkan",
|
||||
"desc": "Vulkan module & fallback for GPU output",
|
||||
@@ -954,7 +976,7 @@
|
||||
},
|
||||
{
|
||||
"long": "separator-string",
|
||||
"desc": "Set the string printed by the separator module",
|
||||
"desc": "Set the string to be printed by the separator line",
|
||||
"arg": {
|
||||
"type": "str",
|
||||
"default": "-"
|
||||
@@ -962,12 +984,21 @@
|
||||
},
|
||||
{
|
||||
"long": "separator-output-color",
|
||||
"desc": "Set the color of the separator module",
|
||||
"desc": "Set the color of the separator line",
|
||||
"arg": {
|
||||
"type": "color",
|
||||
"default": "default"
|
||||
}
|
||||
},
|
||||
{
|
||||
"long": "separator-length",
|
||||
"desc": "Set the length of the separator line",
|
||||
"remark": "Set to 0 to automatically calculate it with the title length",
|
||||
"arg": {
|
||||
"type": "num",
|
||||
"default": "0"
|
||||
}
|
||||
},
|
||||
{
|
||||
"long": "disk-folders",
|
||||
"desc": "A colon (semicolon on Windows) separated list of folder paths to be detected",
|
||||
@@ -1175,14 +1206,6 @@
|
||||
"default": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"long": "cpu-freq-ndigits",
|
||||
"desc": "Set the number of digits to keep after the decimal point when printing CPU frequency",
|
||||
"arg": {
|
||||
"type": "num",
|
||||
"default": 2
|
||||
}
|
||||
},
|
||||
{
|
||||
"long": "cpu-show-pe-core-count",
|
||||
"desc": "Detect and display CPU frequency of different core types (eg. Pcore and Ecore) if supported",
|
||||
@@ -1545,13 +1568,14 @@
|
||||
"type": "enum",
|
||||
"enum": {
|
||||
"block": "\u2588\u2588\u2588",
|
||||
"background": "(whitespaces with background)",
|
||||
"circle": "\u25cf",
|
||||
"diamond": "\u25c6",
|
||||
"triangle": "\u25b2",
|
||||
"square": "\u25a0",
|
||||
"star": "\u2605"
|
||||
},
|
||||
"default": "block"
|
||||
"default": "background"
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -1634,6 +1658,14 @@
|
||||
},
|
||||
"pseudo": true
|
||||
},
|
||||
{
|
||||
"long": "<module>-key-icon",
|
||||
"desc": "Set the icon to be displayed by \"--key-type icon\"",
|
||||
"arg": {
|
||||
"type": "string"
|
||||
},
|
||||
"pseudo": true
|
||||
},
|
||||
{
|
||||
"long": "<module>-output-color",
|
||||
"desc": "Override the global \"--color-output\" option for each specific module",
|
||||
|
||||
@@ -33,7 +33,7 @@ static void parseBattery(FFstrbuf* dir, const char* id, FFBatteryOptions* option
|
||||
|
||||
//capacity must exist and be not empty
|
||||
ffStrbufAppendS(dir, "/capacity");
|
||||
bool available = ffReadFileBuffer(dir->chars, &tmpBuffer);
|
||||
bool available = ffReadFileBuffer(dir->chars, &tmpBuffer); // This is expensive in my laptop
|
||||
ffStrbufSubstrBefore(dir, dirLength);
|
||||
|
||||
if (!available)
|
||||
|
||||
@@ -61,13 +61,17 @@ static void detectBluetoothValue(FFDBusData* dbus, DBusMessageIter* iter, FFBlue
|
||||
dbus->lib->ffdbus_message_iter_next(&dictIter);
|
||||
|
||||
if(ffStrEquals(deviceProperty, "Address"))
|
||||
ffDBusGetValue(dbus, &dictIter, &device->address);
|
||||
ffDBusGetString(dbus, &dictIter, &device->address);
|
||||
else if(ffStrEquals(deviceProperty, "Name"))
|
||||
ffDBusGetValue(dbus, &dictIter, &device->name);
|
||||
ffDBusGetString(dbus, &dictIter, &device->name);
|
||||
else if(ffStrEquals(deviceProperty, "Icon"))
|
||||
ffDBusGetValue(dbus, &dictIter, &device->type);
|
||||
ffDBusGetString(dbus, &dictIter, &device->type);
|
||||
else if(ffStrEquals(deviceProperty, "Percentage"))
|
||||
ffDBusGetByte(dbus, &dictIter, &device->battery);
|
||||
{
|
||||
uint32_t percentage;
|
||||
if (ffDBusGetUint(dbus, &dictIter, &percentage))
|
||||
device->battery = (uint8_t) percentage;
|
||||
}
|
||||
else if(ffStrEquals(deviceProperty, "Connected"))
|
||||
ffDBusGetBool(dbus, &dictIter, &device->connected);
|
||||
}
|
||||
@@ -86,8 +90,8 @@ static void detectBluetoothProperty(FFDBusData* dbus, DBusMessageIter* iter, FFB
|
||||
const char* propertyType;
|
||||
dbus->lib->ffdbus_message_iter_get_basic(&dictIter, &propertyType);
|
||||
|
||||
if(strstr(propertyType, "Device") == NULL && strstr(propertyType, "Battery") == NULL)
|
||||
return; //We don't care about other properties
|
||||
if(!ffStrContains(propertyType, ".Device") && !ffStrContains(propertyType, ".Battery"))
|
||||
return; // We don't care about other properties
|
||||
|
||||
dbus->lib->ffdbus_message_iter_next(&dictIter);
|
||||
|
||||
@@ -97,11 +101,10 @@ static void detectBluetoothProperty(FFDBusData* dbus, DBusMessageIter* iter, FFB
|
||||
DBusMessageIter arrayIter;
|
||||
dbus->lib->ffdbus_message_iter_recurse(&dictIter, &arrayIter);
|
||||
|
||||
while(true)
|
||||
do
|
||||
{
|
||||
detectBluetoothValue(dbus, &arrayIter, device);
|
||||
FF_DBUS_ITER_CONTINUE(dbus, &arrayIter);
|
||||
}
|
||||
} while (dbus->lib->ffdbus_message_iter_next(&arrayIter));
|
||||
}
|
||||
|
||||
static void detectBluetoothObject(FFlist* devices, FFDBusData* dbus, DBusMessageIter* iter)
|
||||
@@ -118,8 +121,8 @@ static void detectBluetoothObject(FFlist* devices, FFDBusData* dbus, DBusMessage
|
||||
const char* objectPath;
|
||||
dbus->lib->ffdbus_message_iter_get_basic(&dictIter, &objectPath);
|
||||
|
||||
//We don't want adapter objects
|
||||
if(strstr(objectPath, "dev_") == NULL)
|
||||
// We don't want adapter objects
|
||||
if(!ffStrContains(objectPath, "/dev_"))
|
||||
return;
|
||||
|
||||
dbus->lib->ffdbus_message_iter_next(&dictIter);
|
||||
@@ -137,11 +140,10 @@ static void detectBluetoothObject(FFlist* devices, FFDBusData* dbus, DBusMessage
|
||||
device->battery = 0;
|
||||
device->connected = false;
|
||||
|
||||
while(true)
|
||||
do
|
||||
{
|
||||
detectBluetoothProperty(dbus, &arrayIter, device);
|
||||
FF_DBUS_ITER_CONTINUE(dbus, &arrayIter);
|
||||
}
|
||||
} while (dbus->lib->ffdbus_message_iter_next(&arrayIter));
|
||||
|
||||
if(device->name.length == 0)
|
||||
{
|
||||
@@ -160,11 +162,10 @@ static void detectBluetoothRoot(FFlist* devices, FFDBusData* dbus, DBusMessageIt
|
||||
DBusMessageIter arrayIter;
|
||||
dbus->lib->ffdbus_message_iter_recurse(iter, &arrayIter);
|
||||
|
||||
while(true)
|
||||
do
|
||||
{
|
||||
detectBluetoothObject(devices, dbus, &arrayIter);
|
||||
FF_DBUS_ITER_CONTINUE(dbus, &arrayIter);
|
||||
}
|
||||
} while (dbus->lib->ffdbus_message_iter_next(&arrayIter));
|
||||
}
|
||||
|
||||
static const char* detectBluetooth(FFlist* devices)
|
||||
@@ -174,7 +175,7 @@ static const char* detectBluetooth(FFlist* devices)
|
||||
if(error)
|
||||
return error;
|
||||
|
||||
DBusMessage* managedObjects = ffDBusGetMethodReply(&dbus, "org.bluez", "/", "org.freedesktop.DBus.ObjectManager", "GetManagedObjects");
|
||||
DBusMessage* managedObjects = ffDBusGetMethodReply(&dbus, "org.bluez", "/", "org.freedesktop.DBus.ObjectManager", "GetManagedObjects", NULL);
|
||||
if(!managedObjects)
|
||||
return "Failed to call GetManagedObjects";
|
||||
|
||||
|
||||
@@ -15,43 +15,35 @@ const char* ffDetectBluetooth(FFlist* devices /* FFBluetoothResult */)
|
||||
FF_LIBRARY_LOAD_SYMBOL_MESSAGE(bluetoothapis, BluetoothFindNextDevice)
|
||||
FF_LIBRARY_LOAD_SYMBOL_MESSAGE(bluetoothapis, BluetoothFindDeviceClose)
|
||||
|
||||
BLUETOOTH_DEVICE_SEARCH_PARAMS btsp = {
|
||||
BLUETOOTH_DEVICE_INFO btdi = {
|
||||
.dwSize = sizeof(btdi)
|
||||
};
|
||||
HBLUETOOTH_DEVICE_FIND hFind = ffBluetoothFindFirstDevice(&(BLUETOOTH_DEVICE_SEARCH_PARAMS) {
|
||||
.fReturnConnected = TRUE,
|
||||
.fReturnRemembered = TRUE,
|
||||
.fReturnAuthenticated = TRUE,
|
||||
.fReturnUnknown = TRUE,
|
||||
.dwSize = sizeof(btsp)
|
||||
};
|
||||
|
||||
BLUETOOTH_DEVICE_INFO btdi = {
|
||||
.dwSize = sizeof(btdi)
|
||||
};
|
||||
HBLUETOOTH_DEVICE_FIND hFind = ffBluetoothFindFirstDevice(&btsp, &btdi);
|
||||
.dwSize = sizeof(BLUETOOTH_DEVICE_SEARCH_PARAMS)
|
||||
}, &btdi);
|
||||
if(!hFind)
|
||||
{
|
||||
if (GetLastError() == ERROR_NO_MORE_ITEMS)
|
||||
return "No Bluetooth devices found";
|
||||
else
|
||||
return "BluetoothFindFirstDevice() failed";
|
||||
return "BluetoothFindFirstDevice() failed";
|
||||
}
|
||||
|
||||
do {
|
||||
FFBluetoothResult* device = ffListAdd(devices);
|
||||
ffStrbufInit(&device->name);
|
||||
ffStrbufInit(&device->address);
|
||||
ffStrbufInit(&device->type);
|
||||
device->battery = 0;
|
||||
device->connected = !!btdi.fConnected;
|
||||
|
||||
ffStrbufSetWS(&device->name, btdi.szName);
|
||||
|
||||
ffStrbufAppendF(&device->address, "%02x:%02x:%02x:%02x:%02x:%02x",
|
||||
ffStrbufInitWS(&device->name, btdi.szName);
|
||||
ffStrbufInitF(&device->address, "%02x:%02x:%02x:%02x:%02x:%02x",
|
||||
btdi.Address.rgBytes[0],
|
||||
btdi.Address.rgBytes[1],
|
||||
btdi.Address.rgBytes[2],
|
||||
btdi.Address.rgBytes[3],
|
||||
btdi.Address.rgBytes[4],
|
||||
btdi.Address.rgBytes[5]);
|
||||
ffStrbufInit(&device->type);
|
||||
device->battery = 0;
|
||||
device->connected = !!btdi.fConnected;
|
||||
|
||||
//https://btprodspecificationrefs.blob.core.windows.net/assigned-numbers/Assigned%20Number%20Types/Assigned%20Numbers.pdf
|
||||
|
||||
if(BitTest(&btdi.ulClassofDevice, 13))
|
||||
|
||||
@@ -0,0 +1,112 @@
|
||||
#include "bluetoothradio.h"
|
||||
|
||||
// https://github.com/ziglang/zig/blob/a84951465b409495095a9598db0cae745f34fa7b/lib/libc/include/any-windows-any/bthdef.h#L187-L236
|
||||
|
||||
#define BTH_MFG_ERICSSON 0
|
||||
#define BTH_MFG_NOKIA 1
|
||||
#define BTH_MFG_INTEL 2
|
||||
#define BTH_MFG_IBM 3
|
||||
#define BTH_MFG_TOSHIBA 4
|
||||
#define BTH_MFG_3COM 5
|
||||
#define BTH_MFG_MICROSOFT 6
|
||||
#define BTH_MFG_LUCENT 7
|
||||
#define BTH_MFG_MOTOROLA 8
|
||||
#define BTH_MFG_INFINEON 9
|
||||
#define BTH_MFG_CSR 10
|
||||
#define BTH_MFG_SILICONWAVE 11
|
||||
#define BTH_MFG_DIGIANSWER 12
|
||||
#define BTH_MFG_TI 13
|
||||
#define BTH_MFG_PARTHUS 14
|
||||
#define BTH_MFG_BROADCOM 15
|
||||
#define BTH_MFG_MITEL 16
|
||||
#define BTH_MFG_WIDCOMM 17
|
||||
#define BTH_MFG_ZEEVO 18
|
||||
#define BTH_MFG_ATMEL 19
|
||||
#define BTH_MFG_MITSIBUSHI 20
|
||||
#define BTH_MFG_RTX_TELECOM 21
|
||||
#define BTH_MFG_KC_TECHNOLOGY 22
|
||||
#define BTH_MFG_NEWLOGIC 23
|
||||
#define BTH_MFG_TRANSILICA 24
|
||||
#define BTH_MFG_ROHDE_SCHWARZ 25
|
||||
#define BTH_MFG_TTPCOM 26
|
||||
#define BTH_MFG_SIGNIA 27
|
||||
#define BTH_MFG_CONEXANT 28
|
||||
#define BTH_MFG_QUALCOMM 29
|
||||
#define BTH_MFG_INVENTEL 30
|
||||
#define BTH_MFG_AVM_BERLIN 31
|
||||
#define BTH_MFG_BANDSPEED 32
|
||||
#define BTH_MFG_MANSELLA 33
|
||||
#define BTH_MFG_NEC 34
|
||||
#define BTH_MFG_WAVEPLUS_TECHNOLOGY_CO 35
|
||||
#define BTH_MFG_ALCATEL 36
|
||||
#define BTH_MFG_PHILIPS_SEMICONDUCTOR 37
|
||||
#define BTH_MFG_C_TECHNOLOGIES 38
|
||||
#define BTH_MFG_OPEN_INTERFACE 39
|
||||
#define BTH_MFG_RF_MICRO_DEVICES 40
|
||||
#define BTH_MFG_HITACHI 41
|
||||
#define BTH_MFG_SYMBOL_TECHNOLOGIES 42
|
||||
#define BTH_MFG_TENOVIS 43
|
||||
#define BTH_MFG_MACRONIX_INTERNATIONAL 44
|
||||
#define BTH_MFG_MARVELL 72
|
||||
#define BTH_MFG_APPLE 76
|
||||
#define BTH_MFG_NORDIC_SEMICONDUCTORS_ASA 89
|
||||
#define BTH_MFG_ARUBA_NETWORKS 283
|
||||
#define BTH_MFG_INTERNAL_USE 65535
|
||||
|
||||
const char* ffBluetoothRadioGetVendor(uint32_t manufacturerId)
|
||||
{
|
||||
switch (manufacturerId)
|
||||
{
|
||||
case BTH_MFG_ERICSSON: return "Ericsson";
|
||||
case BTH_MFG_NOKIA: return "Nokia";
|
||||
case BTH_MFG_INTEL: return "Intel";
|
||||
case BTH_MFG_IBM: return "IBM";
|
||||
case BTH_MFG_TOSHIBA: return "Toshiba";
|
||||
case BTH_MFG_3COM: return "3Com";
|
||||
case BTH_MFG_MICROSOFT: return "Microsoft";
|
||||
case BTH_MFG_LUCENT: return "Lucent";
|
||||
case BTH_MFG_MOTOROLA: return "Motorola";
|
||||
case BTH_MFG_INFINEON: return "Infineon";
|
||||
case BTH_MFG_CSR: return "CSR";
|
||||
case BTH_MFG_SILICONWAVE: return "Silicon-Wave";
|
||||
case BTH_MFG_DIGIANSWER: return "Digi-Answer";
|
||||
case BTH_MFG_TI: return "Ti";
|
||||
case BTH_MFG_PARTHUS: return "Parthus";
|
||||
case BTH_MFG_BROADCOM: return "Broadcom";
|
||||
case BTH_MFG_MITEL: return "Mitel";
|
||||
case BTH_MFG_WIDCOMM: return "Widcomm";
|
||||
case BTH_MFG_ZEEVO: return "Zeevo";
|
||||
case BTH_MFG_ATMEL: return "Atmel";
|
||||
case BTH_MFG_MITSIBUSHI: return "Mitsubishi";
|
||||
case BTH_MFG_RTX_TELECOM: return "RTX Telecom";
|
||||
case BTH_MFG_KC_TECHNOLOGY: return "KC Technology";
|
||||
case BTH_MFG_NEWLOGIC: return "Newlogic";
|
||||
case BTH_MFG_TRANSILICA: return "Transilica";
|
||||
case BTH_MFG_ROHDE_SCHWARZ: return "Rohde-Schwarz";
|
||||
case BTH_MFG_TTPCOM: return "TTPCom";
|
||||
case BTH_MFG_SIGNIA: return "Signia";
|
||||
case BTH_MFG_CONEXANT: return "Conexant";
|
||||
case BTH_MFG_QUALCOMM: return "Qualcomm";
|
||||
case BTH_MFG_INVENTEL: return "Inventel";
|
||||
case BTH_MFG_AVM_BERLIN: return "AVM Berlin";
|
||||
case BTH_MFG_BANDSPEED: return "Bandspeed";
|
||||
case BTH_MFG_MANSELLA: return "Mansella";
|
||||
case BTH_MFG_NEC: return "NEC";
|
||||
case BTH_MFG_WAVEPLUS_TECHNOLOGY_CO: return "Waveplus";
|
||||
case BTH_MFG_ALCATEL: return "Alcatel";
|
||||
case BTH_MFG_PHILIPS_SEMICONDUCTOR: return "Philips Semiconductors";
|
||||
case BTH_MFG_C_TECHNOLOGIES: return "C Technologies";
|
||||
case BTH_MFG_OPEN_INTERFACE: return "Open Interface";
|
||||
case BTH_MFG_RF_MICRO_DEVICES: return "RF Micro Devices";
|
||||
case BTH_MFG_HITACHI: return "Hitachi";
|
||||
case BTH_MFG_SYMBOL_TECHNOLOGIES: return "Symbol Technologies";
|
||||
case BTH_MFG_TENOVIS: return "Tenovis";
|
||||
case BTH_MFG_MACRONIX_INTERNATIONAL: return "Macronix International";
|
||||
case BTH_MFG_MARVELL: return "Marvell";
|
||||
case BTH_MFG_APPLE: return "Apple";
|
||||
case BTH_MFG_NORDIC_SEMICONDUCTORS_ASA: return "Nordic Semiconductor ASA";
|
||||
case BTH_MFG_ARUBA_NETWORKS: return "Aruba Networks";
|
||||
case BTH_MFG_INTERNAL_USE: return "Internal Use";
|
||||
default: return "Unknown";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
#pragma once
|
||||
|
||||
#include "fastfetch.h"
|
||||
|
||||
typedef struct FFBluetoothRadioResult
|
||||
{
|
||||
FFstrbuf name;
|
||||
FFstrbuf address;
|
||||
FFstrbuf vendor;
|
||||
int32_t lmpVersion;
|
||||
int32_t lmpSubversion;
|
||||
bool enabled;
|
||||
bool discoverable;
|
||||
bool connectable;
|
||||
} FFBluetoothRadioResult;
|
||||
|
||||
const char* ffDetectBluetoothRadio(FFlist* devices /* FFBluetoothRadioResult */);
|
||||
const char* ffBluetoothRadioGetVendor(uint32_t manufacturerId);
|
||||
@@ -0,0 +1,69 @@
|
||||
#include "bluetoothradio.h"
|
||||
#include "common/processing.h"
|
||||
|
||||
#import <IOBluetooth/IOBluetooth.h>
|
||||
|
||||
// For some reason the official declaration of IOBluetoothHostController don't include property `controllers`
|
||||
@interface IOBluetoothHostController()
|
||||
+ (id)controllers;
|
||||
@end
|
||||
|
||||
const char* ffDetectBluetoothRadio(FFlist* devices /* FFBluetoothResult */)
|
||||
{
|
||||
NSArray<IOBluetoothHostController*>* ctrls = IOBluetoothHostController.controllers;
|
||||
if(!ctrls)
|
||||
return "IOBluetoothHostController.controllers returns nil";
|
||||
|
||||
FF_STRBUF_AUTO_DESTROY buffer = ffStrbufCreate();
|
||||
if (ffProcessAppendStdOut(&buffer, (char* const[]) {
|
||||
"system_profiler",
|
||||
"SPBluetoothDataType",
|
||||
"-xml",
|
||||
"-detailLevel",
|
||||
"basic",
|
||||
NULL
|
||||
}) != NULL)
|
||||
return "Starting `system_profiler SPBluetoothDataType -xml -detailLevel basic` failed";
|
||||
|
||||
NSArray* arr = [NSPropertyListSerialization propertyListWithData:[NSData dataWithBytes:buffer.chars length:buffer.length]
|
||||
options:NSPropertyListImmutable
|
||||
format:nil
|
||||
error:nil];
|
||||
if (!arr || !arr.count)
|
||||
return "system_profiler SPBluetoothDataType returned an empty array";
|
||||
|
||||
for (IOBluetoothHostController* ctrl in ctrls)
|
||||
{
|
||||
FFBluetoothRadioResult* device = ffListAdd(devices);
|
||||
ffStrbufInitS(&device->name, ctrl.nameAsString.UTF8String);
|
||||
ffStrbufInitS(&device->address, ctrl.addressAsString.UTF8String);
|
||||
ffStrbufInitStatic(&device->vendor, "Apple");
|
||||
device->lmpVersion = INT_MIN;
|
||||
device->lmpSubversion = INT_MIN;
|
||||
device->enabled = ctrl.powerState == kBluetoothHCIPowerStateON;
|
||||
device->discoverable = false;
|
||||
device->connectable = true;
|
||||
|
||||
for (NSDictionary* itemDict in arr[0][@"_items"])
|
||||
{
|
||||
NSDictionary* props = itemDict[@"controller_properties"];
|
||||
if (!props) continue;
|
||||
|
||||
if (![ctrl.addressAsString isEqualToString:props[@"controller_address"]]) continue;
|
||||
|
||||
NSString* services = props[@"controller_supportedServices"];
|
||||
if ([services containsString:@" LEA "])
|
||||
device->lmpVersion = -11;
|
||||
else if ([services containsString:@" GATT "])
|
||||
device->lmpVersion = -6;
|
||||
|
||||
device->discoverable = ![props[@"controller_discoverable"] isEqualToString:@"attrib_off"];
|
||||
ffStrbufSetS(&device->vendor, ((NSString*) props[@"controller_vendorID"]).UTF8String);
|
||||
ffStrbufSubstrAfterFirstC(&device->vendor, '(');
|
||||
ffStrbufTrimRight(&device->vendor, ')');
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
@@ -0,0 +1,207 @@
|
||||
#include "bluetoothradio.h"
|
||||
#include "util/stringUtils.h"
|
||||
|
||||
#ifdef FF_HAVE_DBUS
|
||||
#include "common/dbus.h"
|
||||
|
||||
/* Example dbus reply, striped to only the relevant parts:
|
||||
array [ //root
|
||||
dict entry(
|
||||
object path "/org/bluez/hci0"
|
||||
array [
|
||||
dict entry(
|
||||
string "org.bluez.Adapter1"
|
||||
array [
|
||||
dict entry(
|
||||
string "Address"
|
||||
variant string "XX:XX:XX:XX:XX:XX"
|
||||
)
|
||||
dict entry(
|
||||
string "Name"
|
||||
variant string "xxxxxxxx"
|
||||
)
|
||||
dict entry(
|
||||
string "Powered"
|
||||
variant boolean true
|
||||
)
|
||||
dict entry(
|
||||
string "PowerState"
|
||||
variant string "on"
|
||||
)
|
||||
dict entry(
|
||||
string "Manufacturer"
|
||||
variant uint16 2
|
||||
)
|
||||
dict entry(
|
||||
string "Version"
|
||||
variant byte 12
|
||||
)
|
||||
]
|
||||
)
|
||||
]
|
||||
)
|
||||
]
|
||||
*/
|
||||
|
||||
static void detectBluetoothValue(FFDBusData* dbus, DBusMessageIter* iter, FFBluetoothRadioResult* device)
|
||||
{
|
||||
if(dbus->lib->ffdbus_message_iter_get_arg_type(iter) != DBUS_TYPE_DICT_ENTRY)
|
||||
return;
|
||||
|
||||
DBusMessageIter dictIter;
|
||||
dbus->lib->ffdbus_message_iter_recurse(iter, &dictIter);
|
||||
|
||||
if(dbus->lib->ffdbus_message_iter_get_arg_type(&dictIter) != DBUS_TYPE_STRING)
|
||||
return;
|
||||
|
||||
const char* deviceProperty;
|
||||
dbus->lib->ffdbus_message_iter_get_basic(&dictIter, &deviceProperty);
|
||||
|
||||
dbus->lib->ffdbus_message_iter_next(&dictIter);
|
||||
|
||||
if(ffStrEquals(deviceProperty, "Address"))
|
||||
ffDBusGetString(dbus, &dictIter, &device->address);
|
||||
else if(ffStrEquals(deviceProperty, "Alias"))
|
||||
ffDBusGetString(dbus, &dictIter, &device->name);
|
||||
else if(ffStrEquals(deviceProperty, "Manufacturer"))
|
||||
{
|
||||
uint32_t vendorId;
|
||||
if (ffDBusGetUint(dbus, &dictIter, &vendorId))
|
||||
ffStrbufSetStatic(&device->vendor, ffBluetoothRadioGetVendor(vendorId));
|
||||
}
|
||||
else if(ffStrEquals(deviceProperty, "Version"))
|
||||
ffDBusGetUint(dbus, &dictIter, (uint32_t*) &device->lmpVersion);
|
||||
else if(ffStrEquals(deviceProperty, "Powered"))
|
||||
ffDBusGetBool(dbus, &dictIter, &device->enabled);
|
||||
else if(ffStrEquals(deviceProperty, "Discoverable"))
|
||||
ffDBusGetBool(dbus, &dictIter, &device->discoverable);
|
||||
else if(ffStrEquals(deviceProperty, "Pairable"))
|
||||
ffDBusGetBool(dbus, &dictIter, &device->connectable);
|
||||
}
|
||||
|
||||
static void detectBluetoothProperty(FFDBusData* dbus, DBusMessageIter* iter, FFBluetoothRadioResult* device)
|
||||
{
|
||||
if(dbus->lib->ffdbus_message_iter_get_arg_type(iter) != DBUS_TYPE_DICT_ENTRY)
|
||||
return;
|
||||
|
||||
DBusMessageIter dictIter;
|
||||
dbus->lib->ffdbus_message_iter_recurse(iter, &dictIter);
|
||||
|
||||
if(dbus->lib->ffdbus_message_iter_get_arg_type(&dictIter) != DBUS_TYPE_STRING)
|
||||
return;
|
||||
|
||||
const char* propertyType;
|
||||
dbus->lib->ffdbus_message_iter_get_basic(&dictIter, &propertyType);
|
||||
|
||||
if(!ffStrContains(propertyType, ".Adapter"))
|
||||
return; //We don't care about other properties
|
||||
|
||||
dbus->lib->ffdbus_message_iter_next(&dictIter);
|
||||
|
||||
if(dbus->lib->ffdbus_message_iter_get_arg_type(&dictIter) != DBUS_TYPE_ARRAY)
|
||||
return;
|
||||
|
||||
DBusMessageIter arrayIter;
|
||||
dbus->lib->ffdbus_message_iter_recurse(&dictIter, &arrayIter);
|
||||
|
||||
do
|
||||
{
|
||||
detectBluetoothValue(dbus, &arrayIter, device);
|
||||
} while (dbus->lib->ffdbus_message_iter_next(&arrayIter));
|
||||
}
|
||||
|
||||
static void detectBluetoothObject(FFlist* devices, FFDBusData* dbus, DBusMessageIter* iter)
|
||||
{
|
||||
if(dbus->lib->ffdbus_message_iter_get_arg_type(iter) != DBUS_TYPE_DICT_ENTRY)
|
||||
return;
|
||||
|
||||
DBusMessageIter dictIter;
|
||||
dbus->lib->ffdbus_message_iter_recurse(iter, &dictIter);
|
||||
|
||||
if(dbus->lib->ffdbus_message_iter_get_arg_type(&dictIter) != DBUS_TYPE_OBJECT_PATH)
|
||||
return;
|
||||
|
||||
const char* objectPath;
|
||||
dbus->lib->ffdbus_message_iter_get_basic(&dictIter, &objectPath);
|
||||
|
||||
//We want adapter objects
|
||||
if(!ffStrStartsWith(objectPath, "/org/bluez/hci") || ffStrContains(objectPath, "/dev_"))
|
||||
return;
|
||||
|
||||
dbus->lib->ffdbus_message_iter_next(&dictIter);
|
||||
|
||||
if(dbus->lib->ffdbus_message_iter_get_arg_type(&dictIter) != DBUS_TYPE_ARRAY)
|
||||
return;
|
||||
|
||||
DBusMessageIter arrayIter;
|
||||
dbus->lib->ffdbus_message_iter_recurse(&dictIter, &arrayIter);
|
||||
|
||||
FFBluetoothRadioResult* device = ffListAdd(devices);
|
||||
ffStrbufInit(&device->name);
|
||||
ffStrbufInit(&device->address);
|
||||
ffStrbufInitStatic(&device->vendor, "Unknown");
|
||||
device->lmpVersion = INT_MIN;
|
||||
device->lmpSubversion = INT_MIN;
|
||||
device->enabled = false;
|
||||
|
||||
do
|
||||
{
|
||||
detectBluetoothProperty(dbus, &arrayIter, device);
|
||||
} while (dbus->lib->ffdbus_message_iter_next(&arrayIter));
|
||||
|
||||
if(device->name.length == 0)
|
||||
{
|
||||
ffStrbufDestroy(&device->name);
|
||||
ffStrbufDestroy(&device->address);
|
||||
--devices->length;
|
||||
}
|
||||
}
|
||||
|
||||
static void detectBluetoothRoot(FFlist* devices, FFDBusData* dbus, DBusMessageIter* iter)
|
||||
{
|
||||
if(dbus->lib->ffdbus_message_iter_get_arg_type(iter) != DBUS_TYPE_ARRAY)
|
||||
return;
|
||||
|
||||
DBusMessageIter arrayIter;
|
||||
dbus->lib->ffdbus_message_iter_recurse(iter, &arrayIter);
|
||||
|
||||
do
|
||||
{
|
||||
detectBluetoothObject(devices, dbus, &arrayIter);
|
||||
} while (dbus->lib->ffdbus_message_iter_next(&arrayIter));
|
||||
}
|
||||
|
||||
static const char* detectBluetooth(FFlist* devices)
|
||||
{
|
||||
FFDBusData dbus;
|
||||
const char* error = ffDBusLoadData(DBUS_BUS_SYSTEM, &dbus);
|
||||
if(error)
|
||||
return error;
|
||||
|
||||
DBusMessage* managedObjects = ffDBusGetMethodReply(&dbus, "org.bluez", "/", "org.freedesktop.DBus.ObjectManager", "GetManagedObjects", NULL);
|
||||
if(!managedObjects)
|
||||
return "Failed to call GetManagedObjects";
|
||||
|
||||
DBusMessageIter rootIter;
|
||||
if(!dbus.lib->ffdbus_message_iter_init(managedObjects, &rootIter))
|
||||
{
|
||||
dbus.lib->ffdbus_message_unref(managedObjects);
|
||||
return "Failed to get root iterator of GetManagedObjects";
|
||||
}
|
||||
|
||||
detectBluetoothRoot(devices, &dbus, &rootIter);
|
||||
|
||||
dbus.lib->ffdbus_message_unref(managedObjects);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
const char* ffDetectBluetoothRadio(FFlist* devices /* FFBluetoothRadioResult */)
|
||||
{
|
||||
#ifdef FF_HAVE_DBUS
|
||||
return detectBluetooth(devices);
|
||||
#else
|
||||
return "Fastfetch was compiled without DBus support";
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
#include "bluetoothradio.h"
|
||||
|
||||
const char* ffDetectBluetoothRadio(FF_MAYBE_UNUSED FFlist* devices /* FFBluetoothRadioResult */)
|
||||
{
|
||||
return "Not supported on this platform";
|
||||
}
|
||||
@@ -0,0 +1,105 @@
|
||||
#include "bluetoothradio.h"
|
||||
#include "common/library.h"
|
||||
#include "common/io/io.h"
|
||||
#include "util/windows/unicode.h"
|
||||
|
||||
#include <windows.h>
|
||||
#include <bluetoothapis.h>
|
||||
#include <winioctl.h>
|
||||
|
||||
// #include <bthioctl.h>
|
||||
|
||||
#define BTH_IOCTL_BASE 0
|
||||
#define BTH_CTL(id) CTL_CODE(FILE_DEVICE_BLUETOOTH, (id), METHOD_BUFFERED, FILE_ANY_ACCESS)
|
||||
#define IOCTL_BTH_GET_LOCAL_INFO BTH_CTL(BTH_IOCTL_BASE+0x00)
|
||||
#define LMP_LE_SUPPORTED(x) ((x >> 38) & 1)
|
||||
|
||||
typedef struct _BTH_RADIO_INFO
|
||||
{
|
||||
// Supported LMP features of the radio. Use LMP_XXX() to extract
|
||||
// the desired bits.
|
||||
ULONGLONG lmpSupportedFeatures;
|
||||
|
||||
// Manufacturer ID (possibly BTH_MFG_XXX)
|
||||
USHORT mfg;
|
||||
|
||||
// LMP subversion
|
||||
USHORT lmpSubversion;
|
||||
|
||||
// LMP version
|
||||
UCHAR lmpVersion;
|
||||
} __attribute__((__packed__)) BTH_RADIO_INFO;
|
||||
|
||||
typedef struct _BTH_LOCAL_RADIO_INFO
|
||||
{
|
||||
// Local BTH_ADDR, class of device, and radio name
|
||||
BTH_DEVICE_INFO localInfo;
|
||||
|
||||
// Combo of LOCAL_RADIO_XXX values
|
||||
ULONG flags;
|
||||
|
||||
// HCI revision, see core spec
|
||||
USHORT hciRevision;
|
||||
|
||||
// HCI version, see core spec
|
||||
UCHAR hciVersion;
|
||||
|
||||
// More information about the local radio (LMP, MFG)
|
||||
BTH_RADIO_INFO radioInfo;
|
||||
} __attribute__((__packed__)) BTH_LOCAL_RADIO_INFO;
|
||||
static_assert(sizeof(BTH_LOCAL_RADIO_INFO) == 292, "BTH_LOCAL_RADIO_INFO should be 292 bytes");
|
||||
|
||||
#pragma GCC diagnostic ignored "-Wpointer-sign"
|
||||
|
||||
const char* ffDetectBluetoothRadio(FFlist* devices /* FFBluetoothRadioResult */)
|
||||
{
|
||||
// Actually bluetoothapis.dll, but it's missing on Windows 7
|
||||
FF_LIBRARY_LOAD(bluetoothapis, NULL, "dlopen bthprops.cpl failed", "bthprops.cpl", 1)
|
||||
FF_LIBRARY_LOAD_SYMBOL_MESSAGE(bluetoothapis, BluetoothFindFirstRadio)
|
||||
FF_LIBRARY_LOAD_SYMBOL_MESSAGE(bluetoothapis, BluetoothFindNextRadio)
|
||||
FF_LIBRARY_LOAD_SYMBOL_MESSAGE(bluetoothapis, BluetoothFindRadioClose)
|
||||
FF_LIBRARY_LOAD_SYMBOL_MESSAGE(bluetoothapis, BluetoothIsConnectable)
|
||||
FF_LIBRARY_LOAD_SYMBOL_MESSAGE(bluetoothapis, BluetoothIsDiscoverable)
|
||||
|
||||
HANDLE hRadio = NULL;
|
||||
HBLUETOOTH_DEVICE_FIND hFind = ffBluetoothFindFirstRadio(&(BLUETOOTH_FIND_RADIO_PARAMS) {
|
||||
.dwSize = sizeof(BLUETOOTH_FIND_RADIO_PARAMS)
|
||||
}, &hRadio);
|
||||
if(!hFind)
|
||||
{
|
||||
if (GetLastError() == ERROR_NO_MORE_ITEMS)
|
||||
return "No Bluetooth radios found or service disabled";
|
||||
else
|
||||
return "BluetoothFindFirstRadio() failed";
|
||||
}
|
||||
|
||||
do {
|
||||
BTH_LOCAL_RADIO_INFO blri;
|
||||
DWORD returned;
|
||||
if (!DeviceIoControl(hRadio, IOCTL_BTH_GET_LOCAL_INFO, NULL, 0, &blri, sizeof(blri), &returned, NULL))
|
||||
continue;
|
||||
|
||||
FFBluetoothRadioResult* device = ffListAdd(devices);
|
||||
ffStrbufInitS(&device->name, blri.localInfo.name);
|
||||
|
||||
BLUETOOTH_ADDRESS_STRUCT addr = { .ullLong = blri.localInfo.address };
|
||||
ffStrbufInitF(&device->address, "%02x:%02x:%02x:%02x:%02x:%02x",
|
||||
addr.rgBytes[0],
|
||||
addr.rgBytes[1],
|
||||
addr.rgBytes[2],
|
||||
addr.rgBytes[3],
|
||||
addr.rgBytes[4],
|
||||
addr.rgBytes[5]);
|
||||
|
||||
device->lmpVersion = blri.radioInfo.lmpVersion;
|
||||
device->lmpSubversion = blri.radioInfo.lmpSubversion;
|
||||
ffStrbufInitStatic(&device->vendor, ffBluetoothRadioGetVendor(blri.radioInfo.mfg));
|
||||
device->enabled = true;
|
||||
device->connectable = ffBluetoothIsConnectable(hRadio);
|
||||
device->discoverable = ffBluetoothIsDiscoverable(hRadio);
|
||||
} while (ffBluetoothFindNextRadio(hFind, &hRadio));
|
||||
|
||||
ffBluetoothFindRadioClose(hFind);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
@@ -29,7 +29,7 @@ static const char* detectWithBacklight(FFlist* result)
|
||||
continue;
|
||||
|
||||
ffStrbufAppendS(&backlightDir, entry->d_name);
|
||||
ffStrbufAppendS(&backlightDir, "/actual_brightness");
|
||||
ffStrbufAppendS(&backlightDir, "/brightness");
|
||||
if(ffReadFileBuffer(backlightDir.chars, &buffer))
|
||||
{
|
||||
double actualBrightness = ffStrbufToDouble(&buffer);
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
#include <fcntl.h>
|
||||
#include <sys/ioctl.h>
|
||||
|
||||
#if __has_include(<linux/videodev2.h>)
|
||||
#if FF_HAVE_LINUX_VIDEODEV2
|
||||
#include <linux/videodev2.h>
|
||||
#endif
|
||||
|
||||
const char* ffDetectCamera(FFlist* result)
|
||||
{
|
||||
#if __has_include(<linux/videodev2.h>)
|
||||
#if FF_HAVE_LINUX_VIDEODEV2
|
||||
char path[] = "/dev/videoN";
|
||||
|
||||
for (uint32_t i = 0; i <= 9; ++i)
|
||||
|
||||
@@ -19,10 +19,9 @@ typedef struct FFCPUResult
|
||||
uint16_t coresLogical;
|
||||
uint16_t coresOnline;
|
||||
|
||||
double frequencyBase; // GHz
|
||||
double frequencyMax; // GHz
|
||||
double frequencyMin; // GHz
|
||||
double frequencyBiosLimit; // GHz
|
||||
uint32_t frequencyBase; // GHz
|
||||
uint32_t frequencyMax; // GHz
|
||||
uint32_t frequencyBiosLimit; // GHz
|
||||
|
||||
FFCPUCore coreTypes[16]; // number of P cores, E cores, etc.
|
||||
|
||||
|
||||
@@ -43,38 +43,37 @@ static const char* detectFrequency(FFCPUResult* cpu)
|
||||
if (!IOObjectConformsTo(entryDevice, "AppleARMIODevice"))
|
||||
return "\"pmgr\" should conform to \"AppleARMIODevice\"";
|
||||
|
||||
FF_CFTYPE_AUTO_RELEASE CFMutableDictionaryRef properties = NULL;
|
||||
if (IORegistryEntryCreateCFProperties(entryDevice, &properties, kCFAllocatorDefault, kNilOptions) != kIOReturnSuccess)
|
||||
return "IORegistryEntryCreateCFProperties() failed";
|
||||
|
||||
uint32_t pMin, eMin, aMax, pCoreLength;
|
||||
if (ffCfDictGetData(properties, CFSTR("voltage-states5-sram"), 0, 4, (uint8_t*) &pMin, &pCoreLength) != NULL) // pCore
|
||||
FF_CFTYPE_AUTO_RELEASE CFDataRef freqProperty = (CFDataRef) IORegistryEntryCreateCFProperty(entryDevice, CFSTR("voltage-states5-sram"), kCFAllocatorDefault, kNilOptions);
|
||||
if (!freqProperty || CFGetTypeID(freqProperty) != CFDataGetTypeID())
|
||||
return "\"voltage-states5-sram\" in \"pmgr\" is not found";
|
||||
if (ffCfDictGetData(properties, CFSTR("voltage-states1-sram"), 0, 4, (uint8_t*) &eMin, NULL) != NULL) // eCore
|
||||
return "\"voltage-states1-sram\" in \"pmgr\" is not found";
|
||||
|
||||
cpu->frequencyMin = (pMin < eMin ? pMin : eMin) / (1000.0 * 1000 * 1000);
|
||||
// voltage-states5-sram stores supported <frequency / voltage> pairs of pcores from the lowest to the highest
|
||||
// voltage-states1-sram stores ecores'
|
||||
CFIndex propLength = CFDataGetLength(freqProperty);
|
||||
if (propLength == 0 || propLength % (CFIndex) sizeof(uint32_t) * 2 != 0)
|
||||
return "Invalid \"voltage-states5-sram\" length";
|
||||
|
||||
if (pCoreLength >= 8)
|
||||
{
|
||||
ffCfDictGetData(properties, CFSTR("voltage-states5-sram"), pCoreLength - 8, 4, (uint8_t*) &aMax, NULL);
|
||||
cpu->frequencyMax = aMax / (1000.0 * 1000 * 1000);
|
||||
}
|
||||
uint32_t* pStart = (uint32_t*) CFDataGetBytePtr(freqProperty);
|
||||
uint32_t pMax = *pStart;
|
||||
for (CFIndex i = 2; i < propLength / (CFIndex) sizeof(uint32_t) && pStart[i] > 0; i += 2 /* skip voltage */)
|
||||
pMax = pMax > pStart[i] ? pMax : pStart[i];
|
||||
|
||||
if (pMax > 0)
|
||||
cpu->frequencyMax = pMax / 1000 / 1000;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
#else
|
||||
static const char* detectFrequency(FFCPUResult* cpu)
|
||||
{
|
||||
cpu->frequencyBase = ffSysctlGetInt64("hw.cpufrequency", 0) / 1000.0 / 1000.0 / 1000.0;
|
||||
cpu->frequencyMin = ffSysctlGetInt64("hw.cpufrequency_min", 0) / 1000.0 / 1000.0 / 1000.0;
|
||||
cpu->frequencyMax = ffSysctlGetInt64("hw.cpufrequency_max", 0) / 1000.0 / 1000.0 / 1000.0;
|
||||
if(cpu->frequencyBase != cpu->frequencyBase)
|
||||
cpu->frequencyBase = (uint32_t) (ffSysctlGetInt64("hw.cpufrequency", 0) / 1000 / 1000);
|
||||
cpu->frequencyMax = (uint32_t) (ffSysctlGetInt64("hw.cpufrequency_max", 0) / 1000 / 1000);
|
||||
if(cpu->frequencyBase == 0)
|
||||
{
|
||||
unsigned current = 0;
|
||||
size_t size = sizeof(current);
|
||||
if (sysctl((int[]){ CTL_HW, HW_CPU_FREQ }, 2, ¤t, &size, NULL, 0) == 0)
|
||||
cpu->frequencyBase = (double) current / 1000.0 / 1000.0 / 1000.0;
|
||||
cpu->frequencyBase = (uint32_t) (current / 1000 / 1000);
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -44,16 +44,13 @@ const char* ffDetectCPUImpl(const FFCPUOptions* options, FFCPUResult* cpu)
|
||||
ffStrbufClear(&buffer);
|
||||
char key[32];
|
||||
snprintf(key, sizeof(key), "dev.cpu.%u.freq_levels", i);
|
||||
if (ffSysctlGetString(key, &buffer) == NULL && buffer.length > 0)
|
||||
if (ffSysctlGetString(key, &buffer) == NULL)
|
||||
{
|
||||
if (buffer.length == 0) continue;
|
||||
|
||||
// MHz/Watts pairs like: 2501/32000 2187/27125 2000/24000
|
||||
uint32_t fmax = (uint32_t) strtoul(buffer.chars, NULL, 10);
|
||||
uint32_t fmin = fmax;
|
||||
uint32_t i = ffStrbufLastIndexC(&buffer, ' ');
|
||||
if (i < buffer.length)
|
||||
fmin = (uint32_t) strtoul(buffer.chars + i + 1, NULL, 10);
|
||||
if (!(cpu->frequencyMin <= fmin)) cpu->frequencyMin = fmin; // Counting for NaN
|
||||
if (!(cpu->frequencyMax >= fmax)) cpu->frequencyMax = fmax;
|
||||
if (cpu->frequencyMax < fmax) cpu->frequencyMax = fmax;
|
||||
|
||||
if (options->showPeCoreCount)
|
||||
{
|
||||
@@ -65,12 +62,11 @@ const char* ffDetectCPUImpl(const FFCPUOptions* options, FFCPUResult* cpu)
|
||||
cpu->coreTypes[ifreq].count++;
|
||||
}
|
||||
}
|
||||
else
|
||||
break;
|
||||
}
|
||||
cpu->frequencyMin /= 1000;
|
||||
cpu->frequencyMax /= 1000;
|
||||
|
||||
int clockRate = ffSysctlGetInt("hw.clockrate", 0);
|
||||
cpu->frequencyBase = clockRate <= 0 ? 0.0/0.0 : clockRate / 1000.0;
|
||||
cpu->frequencyBase = (uint32_t) ffSysctlGetInt("hw.clockrate", 0);
|
||||
cpu->temperature = FF_CPU_TEMP_UNSET;
|
||||
|
||||
if (options->temp)
|
||||
|
||||
@@ -13,18 +13,64 @@
|
||||
#ifdef __ANDROID__
|
||||
#include "common/settings.h"
|
||||
|
||||
static void detectQualcomm(FFCPUResult* cpu)
|
||||
{
|
||||
if (ffStrbufEqualS(&cpu->name, "SM8635"))
|
||||
ffStrbufSetStatic(&cpu->name, "Qualcomm Snapdragon 8s Gen 3 [SM8635]");
|
||||
else if (ffStrbufEqualS(&cpu->name, "SM8650-AC"))
|
||||
ffStrbufSetStatic(&cpu->name, "Qualcomm Snapdragon 8 Gen 3 for Galaxy [SM8650-AC]");
|
||||
else if (ffStrbufEqualS(&cpu->name, "SM8650"))
|
||||
ffStrbufSetStatic(&cpu->name, "Qualcomm Snapdragon 8 Gen 3 [SM8650]");
|
||||
else if (ffStrbufEqualS(&cpu->name, "SM8550-AC"))
|
||||
ffStrbufSetStatic(&cpu->name, "Qualcomm Snapdragon 8 Gen 2 for Galaxy [SM8550-AC]");
|
||||
else if (ffStrbufEqualS(&cpu->name, "SM8550"))
|
||||
ffStrbufSetStatic(&cpu->name, "Qualcomm Snapdragon 8 Gen 2 [SM8550]");
|
||||
else if (ffStrbufEqualS(&cpu->name, "SM8475"))
|
||||
ffStrbufSetStatic(&cpu->name, "Qualcomm Snapdragon 8+ Gen 1 [SM8475]");
|
||||
else if (ffStrbufEqualS(&cpu->name, "SM8450"))
|
||||
ffStrbufSetStatic(&cpu->name, "Qualcomm Snapdragon 8 Gen 1 [SM8450]");
|
||||
|
||||
else if (ffStrbufEqualS(&cpu->name, "SM7675"))
|
||||
ffStrbufSetStatic(&cpu->name, "Qualcomm Snapdragon 7+ Gen 3 [SM7675]");
|
||||
else if (ffStrbufEqualS(&cpu->name, "SM7550"))
|
||||
ffStrbufSetStatic(&cpu->name, "Qualcomm Snapdragon 7 Gen 3 [SM7550]");
|
||||
else if (ffStrbufEqualS(&cpu->name, "SM7475"))
|
||||
ffStrbufSetStatic(&cpu->name, "Qualcomm Snapdragon 7+ Gen 2 [SM7550]");
|
||||
else if (ffStrbufEqualS(&cpu->name, "SM7435"))
|
||||
ffStrbufSetStatic(&cpu->name, "Qualcomm Snapdragon 7s Gen 2 [SM7435]");
|
||||
else if (ffStrbufEqualS(&cpu->name, "SM7450"))
|
||||
ffStrbufSetStatic(&cpu->name, "Qualcomm Snapdragon 7 Gen 1 [SM7450]");
|
||||
|
||||
else if (ffStrbufEqualS(&cpu->name, "SM6375-AC"))
|
||||
ffStrbufSetStatic(&cpu->name, "Qualcomm Snapdragon 6s Gen 3 [SM6375-AC]");
|
||||
else if (ffStrbufEqualS(&cpu->name, "SM6450"))
|
||||
ffStrbufSetStatic(&cpu->name, "Qualcomm Snapdragon 6 Gen 1 [SM6450]");
|
||||
|
||||
else if (ffStrbufEqualS(&cpu->name, "SM4635"))
|
||||
ffStrbufSetStatic(&cpu->name, "Qualcomm Snapdragon 4s Gen 2 [SM4635]");
|
||||
else if (ffStrbufEqualS(&cpu->name, "SM4450"))
|
||||
ffStrbufSetStatic(&cpu->name, "Qualcomm Snapdragon 4 Gen 2 [SM4450]");
|
||||
else if (ffStrbufEqualS(&cpu->name, "SM4375"))
|
||||
ffStrbufSetStatic(&cpu->name, "Qualcomm Snapdragon 4 Gen 1 [SM4375]");
|
||||
}
|
||||
|
||||
static void detectAndroid(FFCPUResult* cpu)
|
||||
{
|
||||
if (cpu->name.length == 0)
|
||||
{
|
||||
ffSettingsGetAndroidProperty("ro.soc.model", &cpu->name);
|
||||
ffStrbufClear(&cpu->vendor); // We usually detect the vendor of CPU core as ARM, but instead we want the vendor of SOC
|
||||
if (ffSettingsGetAndroidProperty("ro.soc.model", &cpu->name))
|
||||
ffStrbufClear(&cpu->vendor); // We usually detect the vendor of CPU core as ARM, but instead we want the vendor of SOC
|
||||
else if(ffSettingsGetAndroidProperty("ro.mediatek.platform", &cpu->name))
|
||||
ffStrbufSetStatic(&cpu->vendor, "MTK");
|
||||
}
|
||||
if (cpu->vendor.length == 0)
|
||||
{
|
||||
if (!ffSettingsGetAndroidProperty("ro.soc.manufacturer", &cpu->vendor))
|
||||
ffSettingsGetAndroidProperty("ro.product.product.manufacturer", &cpu->vendor);
|
||||
}
|
||||
|
||||
if (ffStrbufEqualS(&cpu->vendor, "QTI") && ffStrbufStartsWithS(&cpu->name, "SM"))
|
||||
detectQualcomm(cpu);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -94,7 +140,7 @@ static uint32_t getFrequency(FFstrbuf* basePath, const char* cpuinfoFileName, co
|
||||
bool ok = ffReadFileBuffer(basePath->chars, buffer);
|
||||
ffStrbufSubstrBefore(basePath, baseLen);
|
||||
if (ok)
|
||||
return (uint32_t) ffStrbufToUInt(buffer, 0);
|
||||
return (uint32_t) (ffStrbufToUInt(buffer, 0) / 1000);
|
||||
|
||||
if (scalingFileName)
|
||||
{
|
||||
@@ -102,7 +148,7 @@ static uint32_t getFrequency(FFstrbuf* basePath, const char* cpuinfoFileName, co
|
||||
ok = ffReadFileBuffer(basePath->chars, buffer);
|
||||
ffStrbufSubstrBefore(basePath, baseLen);
|
||||
if (ok)
|
||||
return (uint32_t) ffStrbufToUInt(buffer, 0);
|
||||
return (uint32_t) (ffStrbufToUInt(buffer, 0) / 1000);
|
||||
}
|
||||
|
||||
return 0;
|
||||
@@ -143,36 +189,15 @@ static bool detectFrequency(FFCPUResult* cpu, const FFCPUOptions* options)
|
||||
ffStrbufAppendS(&path, entry->d_name);
|
||||
uint32_t fbase = getFrequency(&path, "/base_frequency", NULL, &buffer);
|
||||
if (fbase > 0)
|
||||
{
|
||||
if (cpu->frequencyBase == cpu->frequencyBase)
|
||||
cpu->frequencyBase = cpu->frequencyBase > fbase ? cpu->frequencyBase : fbase;
|
||||
else
|
||||
cpu->frequencyBase = fbase;
|
||||
}
|
||||
cpu->frequencyBase = cpu->frequencyBase > fbase ? cpu->frequencyBase : fbase;
|
||||
|
||||
uint32_t fbioslimit = getFrequency(&path, "/bios_limit", NULL, &buffer);
|
||||
if (fbioslimit > 0)
|
||||
{
|
||||
if (cpu->frequencyBiosLimit == cpu->frequencyBiosLimit)
|
||||
cpu->frequencyBiosLimit = cpu->frequencyBiosLimit > fbioslimit ? cpu->frequencyBiosLimit : fbioslimit;
|
||||
else
|
||||
cpu->frequencyBiosLimit = fbioslimit;
|
||||
}
|
||||
cpu->frequencyBiosLimit = cpu->frequencyBiosLimit > fbioslimit ? cpu->frequencyBiosLimit : fbioslimit;
|
||||
|
||||
uint32_t fmax = getFrequency(&path, "/cpuinfo_max_freq", "/scaling_max_freq", &buffer);
|
||||
if (fmax > 0)
|
||||
{
|
||||
if (cpu->frequencyMax == cpu->frequencyMax)
|
||||
cpu->frequencyMax = cpu->frequencyMax > fmax ? cpu->frequencyMax : fmax;
|
||||
else
|
||||
cpu->frequencyMax = fmax;
|
||||
}
|
||||
uint32_t fmin = getFrequency(&path, "/cpuinfo_min_freq", "/scaling_min_freq", &buffer);
|
||||
if (fmin > 0)
|
||||
{
|
||||
if (cpu->frequencyMin == cpu->frequencyMin)
|
||||
cpu->frequencyMin = cpu->frequencyMin < fmin ? cpu->frequencyMin : fmin;
|
||||
else
|
||||
cpu->frequencyMin = fmin;
|
||||
}
|
||||
cpu->frequencyMax = cpu->frequencyMax > fmax ? cpu->frequencyMax : fmax;
|
||||
|
||||
if (options->showPeCoreCount)
|
||||
{
|
||||
@@ -187,10 +212,6 @@ static bool detectFrequency(FFCPUResult* cpu, const FFCPUOptions* options)
|
||||
ffStrbufSubstrBefore(&path, baseLen);
|
||||
}
|
||||
}
|
||||
cpu->frequencyBase /= 1e6;
|
||||
cpu->frequencyMax /= 1e6;
|
||||
cpu->frequencyMin /= 1e6;
|
||||
cpu->frequencyBiosLimit /= 1e6;
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -272,8 +293,8 @@ const char* ffDetectCPUImpl(const FFCPUOptions* options, FFCPUResult* cpu)
|
||||
cpu->coresOnline = (uint16_t) get_nprocs();
|
||||
cpu->coresPhysical = (uint16_t) ffStrbufToUInt(&physicalCoresBuffer, cpu->coresLogical);
|
||||
|
||||
if (!detectFrequency(cpu, options) || cpu->frequencyBase != cpu->frequencyBase)
|
||||
cpu->frequencyBase = ffStrbufToDouble(&cpuMHz) / 1000;
|
||||
if (!detectFrequency(cpu, options) || cpu->frequencyBase == 0)
|
||||
cpu->frequencyBase = (uint32_t) ffStrbufToUInt(&cpuMHz, 0);
|
||||
|
||||
if(cpuUarch.length > 0)
|
||||
{
|
||||
|
||||
@@ -31,7 +31,7 @@ const char* ffDetectCPUImpl(FF_MAYBE_UNUSED const FFCPUOptions* options, FFCPURe
|
||||
}
|
||||
{
|
||||
kstat_named_t* kn = kstat_data_lookup(ks, "clock_MHz");
|
||||
cpu->frequencyBase = kn->value.ui32 / 1000.;
|
||||
cpu->frequencyBase = kn->value.ui32;
|
||||
}
|
||||
|
||||
ks = kstat_lookup(kc, "unix", -1, "system_misc");
|
||||
|
||||
@@ -65,8 +65,8 @@ inline static const char* detectSpeedByCpuid(FFCPUResult* cpu)
|
||||
return "Unsupported instruction";
|
||||
|
||||
// cpuid returns 0 MHz when hyper-v is enabled
|
||||
if (base) cpu->frequencyBase = base / 1000.0;
|
||||
if (max) cpu->frequencyMax = max / 1000.0;
|
||||
if (base) cpu->frequencyBase = base;
|
||||
if (max) cpu->frequencyMax = max;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -97,7 +97,7 @@ static const char* detectMaxSpeedBySmbios(FFCPUResult* cpu)
|
||||
return "No active CPU is found in SMBIOS data";
|
||||
}
|
||||
|
||||
double speed = data->MaxSpeed / 1000.0;
|
||||
uint32_t speed = data->MaxSpeed;
|
||||
// Sometimes SMBIOS reports invalid value. We assume that max speed is small than 2x of base
|
||||
if (speed < cpu->frequencyBase || speed > cpu->frequencyBase * 2)
|
||||
return "Possible invalid CPU max speed in SMBIOS data. See #800";
|
||||
@@ -159,7 +159,7 @@ static const char* detectByRegistry(FFCPUResult* cpu)
|
||||
|
||||
uint32_t mhz;
|
||||
if(ffRegReadUint(hKey, L"~MHz", &mhz, NULL))
|
||||
cpu->frequencyBase = mhz / 1000.0;
|
||||
cpu->frequencyBase = mhz;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
@@ -180,8 +180,8 @@ static const char* detectCoreTypes(FFCPUResult* cpu)
|
||||
++cpu->coreTypes[ifreq].count;
|
||||
}
|
||||
|
||||
if (cpu->frequencyBase != cpu->frequencyBase)
|
||||
cpu->frequencyBase = pinfo->MaxMhz / 1000.0;
|
||||
if (cpu->frequencyBase == 0)
|
||||
cpu->frequencyBase = pinfo->MaxMhz;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -196,7 +196,7 @@ const char* ffDetectCPUImpl(const FFCPUOptions* options, FFCPUResult* cpu)
|
||||
detectSpeedByCpuid(cpu);
|
||||
if (options->showPeCoreCount) detectCoreTypes(cpu);
|
||||
|
||||
if (cpu->frequencyMax != cpu->frequencyMax)
|
||||
if (cpu->frequencyMax == 0)
|
||||
detectMaxSpeedBySmbios(cpu);
|
||||
|
||||
if(options->temp)
|
||||
|
||||
@@ -180,6 +180,8 @@ static void getBudgie(FFstrbuf* result, FF_MAYBE_UNUSED FFDEOptions* options)
|
||||
|
||||
const char* ffDetectDEVersion(const FFstrbuf* deName, FFstrbuf* result, FFDEOptions* options)
|
||||
{
|
||||
if (!instance.config.general.detectVersion) return "Disabled by config";
|
||||
|
||||
if (ffStrbufEqualS(deName, FF_DE_PRETTY_PLASMA))
|
||||
getKDE(result, options);
|
||||
else if (ffStrbufEqualS(deName, FF_DE_PRETTY_GNOME))
|
||||
|
||||
@@ -123,7 +123,7 @@ const char* ffDetectDisksImpl(FFDiskOptions* options, FFlist* disks)
|
||||
|
||||
FFDisk* disk = ffListAdd(disks);
|
||||
|
||||
disk->bytesTotal = fs->f_blocks * fs->f_bsize;
|
||||
disk->bytesTotal = (uint64_t)fs->f_blocks * fs->f_bsize;
|
||||
disk->bytesFree = (uint64_t)fs->f_bfree * fs->f_bsize;
|
||||
disk->bytesAvailable = (uint64_t)fs->f_bavail * fs->f_bsize;
|
||||
disk->bytesUsed = 0; // To be filled in ./disk.c
|
||||
|
||||
@@ -71,6 +71,10 @@ static bool isPhysicalDevice(const struct mntent* device)
|
||||
ffStrStartsWith(device->mnt_fsname + 5, "fd") //Ignore fd devices
|
||||
) return false;
|
||||
|
||||
// https://source.android.com/docs/core/ota/apex?hl=zh-cn
|
||||
if(ffStrStartsWith(device->mnt_dir, "/apex/"))
|
||||
return false;
|
||||
|
||||
#endif // __ANDROID__
|
||||
|
||||
return true;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include "displayserver.h"
|
||||
|
||||
bool ffdsAppendDisplay(
|
||||
FFDisplayResult* ffdsAppendDisplay(
|
||||
FFDisplayServerResult* result,
|
||||
uint32_t width,
|
||||
uint32_t height,
|
||||
@@ -11,10 +11,12 @@ bool ffdsAppendDisplay(
|
||||
FFstrbuf* name,
|
||||
FFDisplayType type,
|
||||
bool primary,
|
||||
uint64_t id)
|
||||
uint64_t id,
|
||||
uint32_t physicalWidth,
|
||||
uint32_t physicalHeight)
|
||||
{
|
||||
if(width == 0 || height == 0)
|
||||
return false;
|
||||
return NULL;
|
||||
|
||||
FFDisplayResult* display = ffListAdd(&result->displays);
|
||||
display->width = width;
|
||||
@@ -25,10 +27,16 @@ bool ffdsAppendDisplay(
|
||||
display->rotation = rotation;
|
||||
ffStrbufInitMove(&display->name, name);
|
||||
display->type = type;
|
||||
display->primary = primary;
|
||||
display->id = id;
|
||||
display->physicalWidth = physicalWidth;
|
||||
display->physicalHeight = physicalHeight;
|
||||
display->primary = primary;
|
||||
|
||||
return true;
|
||||
display->bitDepth = 0;
|
||||
display->hdrEnabled = false;
|
||||
display->wcgEnabled = false;
|
||||
|
||||
return display;
|
||||
}
|
||||
|
||||
void ffConnectDisplayServerImpl(FFDisplayServerResult* ds);
|
||||
|
||||
@@ -58,8 +58,13 @@ typedef struct FFDisplayResult
|
||||
FFstrbuf name;
|
||||
FFDisplayType type;
|
||||
uint32_t rotation;
|
||||
bool primary;
|
||||
uint64_t id; // platform dependent
|
||||
uint32_t physicalWidth;
|
||||
uint32_t physicalHeight;
|
||||
bool primary;
|
||||
uint8_t bitDepth;
|
||||
bool hdrEnabled;
|
||||
bool wcgEnabled;
|
||||
} FFDisplayResult;
|
||||
|
||||
typedef struct FFDisplayServerResult
|
||||
@@ -74,7 +79,7 @@ typedef struct FFDisplayServerResult
|
||||
|
||||
const FFDisplayServerResult* ffConnectDisplayServer();
|
||||
|
||||
bool ffdsAppendDisplay(
|
||||
FFDisplayResult* ffdsAppendDisplay(
|
||||
FFDisplayServerResult* result,
|
||||
uint32_t width,
|
||||
uint32_t height,
|
||||
@@ -85,4 +90,6 @@ bool ffdsAppendDisplay(
|
||||
FFstrbuf* name,
|
||||
FFDisplayType type,
|
||||
bool primary,
|
||||
uint64_t id);
|
||||
uint64_t id,
|
||||
uint32_t physicalWidth,
|
||||
uint32_t physicalHeight);
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
#include "displayserver.h"
|
||||
#include "common/settings.h"
|
||||
|
||||
#include "common/processing.h"
|
||||
|
||||
#include <math.h>
|
||||
|
||||
static void detectWithDumpsys(FFDisplayServerResult* ds)
|
||||
{
|
||||
FF_STRBUF_AUTO_DESTROY buf = ffStrbufCreate();
|
||||
@@ -63,6 +64,8 @@ static void detectWithDumpsys(FFDisplayServerResult* ds)
|
||||
&name,
|
||||
FF_DISPLAY_TYPE_UNKNOWN,
|
||||
false,
|
||||
0,
|
||||
0,
|
||||
0
|
||||
);
|
||||
}
|
||||
@@ -79,20 +82,24 @@ static bool detectWithGetprop(FFDisplayServerResult* ds)
|
||||
if (ffSettingsGetAndroidProperty("persist.sys.miui_resolution", &buffer) &&
|
||||
ffStrbufContainC(&buffer, ','))
|
||||
{
|
||||
// 1440,3200,560 => width,height,ppi
|
||||
// 1440,3200,560 => width,height,densityDpi
|
||||
uint32_t width = (uint32_t) ffStrbufToUInt(&buffer, 0);
|
||||
ffStrbufSubstrAfterFirstC(&buffer, ',');
|
||||
uint32_t height = (uint32_t) ffStrbufToUInt(&buffer, 0);
|
||||
ffStrbufSubstrAfterFirstC(&buffer, ',');
|
||||
double scaleFactor = (double) ffStrbufToUInt(&buffer, 0) / 160.;
|
||||
return ffdsAppendDisplay(ds,
|
||||
width,
|
||||
height,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
(uint32_t) (width / scaleFactor + .5),
|
||||
(uint32_t) (height / scaleFactor + .5),
|
||||
0,
|
||||
0,
|
||||
FF_DISPLAY_TYPE_BUILTIN,
|
||||
false,
|
||||
0,
|
||||
0,
|
||||
0
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#include "displayserver.h"
|
||||
#include "util/apple/cf_helpers.h"
|
||||
#include "util/stringUtils.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
@@ -36,7 +37,7 @@ static void detectDisplays(FFDisplayServerResult* ds)
|
||||
{
|
||||
const CVTime time = CVDisplayLinkGetNominalOutputVideoRefreshPeriod(link);
|
||||
if (!(time.flags & kCVTimeIsIndefinite))
|
||||
refreshRate = time.timeScale / (double) time.timeValue + 0.5; //59.97...
|
||||
refreshRate = time.timeScale / (double) time.timeValue; //59.97...
|
||||
CVDisplayLinkRelease(link);
|
||||
}
|
||||
}
|
||||
@@ -57,7 +58,7 @@ static void detectDisplays(FFDisplayServerResult* ds)
|
||||
if(CoreDisplay_IODisplayCreateInfoDictionary)
|
||||
{
|
||||
io_service_t servicePort = CGDisplayIOServicePort(screen);
|
||||
CFDictionaryRef FF_CFTYPE_AUTO_RELEASE displayInfo = CoreDisplay_IODisplayCreateInfoDictionary(servicePort, kIODisplayOnlyPreferredName);
|
||||
CFDictionaryRef FF_CFTYPE_AUTO_RELEASE displayInfo = CoreDisplay_IODisplayCreateInfoDictionary(servicePort, kIODisplayOnlyPreferredName);
|
||||
if(displayInfo)
|
||||
{
|
||||
CFDictionaryRef productNames;
|
||||
@@ -67,7 +68,9 @@ static void detectDisplays(FFDisplayServerResult* ds)
|
||||
}
|
||||
#endif
|
||||
|
||||
ffdsAppendDisplay(ds,
|
||||
CGSize size = CGDisplayScreenSize(screen);
|
||||
|
||||
FFDisplayResult* display = ffdsAppendDisplay(ds,
|
||||
(uint32_t)CGDisplayModeGetPixelWidth(mode),
|
||||
(uint32_t)CGDisplayModeGetPixelHeight(mode),
|
||||
refreshRate,
|
||||
@@ -77,8 +80,22 @@ static void detectDisplays(FFDisplayServerResult* ds)
|
||||
&name,
|
||||
CGDisplayIsBuiltin(screen) ? FF_DISPLAY_TYPE_BUILTIN : FF_DISPLAY_TYPE_EXTERNAL,
|
||||
CGDisplayIsMain(screen),
|
||||
(uint64_t)screen
|
||||
(uint64_t)screen,
|
||||
(uint32_t) (size.width + 0.5),
|
||||
(uint32_t) (size.height + 0.5)
|
||||
);
|
||||
if (display)
|
||||
{
|
||||
// https://stackoverflow.com/a/33519316/9976392
|
||||
// Also shitty, but better than parsing `CFCopyDescription(mode)`
|
||||
CFDictionaryRef dict = (CFDictionaryRef) *((int64_t *)mode + 2);
|
||||
if (CFGetTypeID(dict) == CFDictionaryGetTypeID())
|
||||
{
|
||||
int32_t bitDepth;
|
||||
ffCfDictGetInt(dict, kCGDisplayBitsPerSample, &bitDepth);
|
||||
display->bitDepth = (uint8_t) bitDepth;
|
||||
}
|
||||
}
|
||||
CGDisplayModeRelease(mode);
|
||||
}
|
||||
CGDisplayRelease(screen);
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
#include "displayserver.h"
|
||||
#include "detection/os/os.h"
|
||||
#include "util/windows/unicode.h"
|
||||
#include "util/windows/registry.h"
|
||||
#include "util/mallocHelper.h"
|
||||
#include "util/edidHelper.h"
|
||||
|
||||
#include <dwmapi.h>
|
||||
#include <WinUser.h>
|
||||
@@ -73,6 +76,7 @@ static void detectDisplays(FFDisplayServerResult* ds)
|
||||
if (!monitorInfo) continue;
|
||||
|
||||
FF_STRBUF_AUTO_DESTROY name = ffStrbufCreate();
|
||||
uint32_t physicalWidth = 0, physicalHeight = 0;
|
||||
|
||||
DISPLAYCONFIG_TARGET_DEVICE_NAME targetName = {
|
||||
.header = {
|
||||
@@ -84,13 +88,39 @@ static void detectDisplays(FFDisplayServerResult* ds)
|
||||
};
|
||||
if(DisplayConfigGetDeviceInfo(&targetName.header) == ERROR_SUCCESS)
|
||||
{
|
||||
if (targetName.flags.friendlyNameFromEdid)
|
||||
ffStrbufSetWS(&name, targetName.monitorFriendlyDeviceName);
|
||||
wchar_t regPath[256] = L"SYSTEM\\CurrentControlSet\\Enum";
|
||||
wchar_t* pRegPath = regPath + strlen("SYSTEM\\CurrentControlSet\\Enum");
|
||||
wchar_t* pDevPath = targetName.monitorDevicePath + strlen("\\\\?");
|
||||
while (*pDevPath && *pDevPath != L'{')
|
||||
{
|
||||
if (*pDevPath == L'#')
|
||||
*pRegPath = L'\\';
|
||||
else
|
||||
*pRegPath = *pDevPath;
|
||||
++pRegPath;
|
||||
++pDevPath;
|
||||
assert(pRegPath < regPath + sizeof(regPath) / sizeof(wchar_t) + strlen("Device Parameters"));
|
||||
}
|
||||
wcscpy(pRegPath, L"Device Parameters");
|
||||
|
||||
uint8_t edidData[1024];
|
||||
DWORD edidLength = sizeof(edidData);
|
||||
if (RegGetValueW(HKEY_LOCAL_MACHINE, regPath, L"EDID", RRF_RT_REG_BINARY, NULL, edidData, &edidLength) == ERROR_SUCCESS &&
|
||||
edidLength > 0 && edidLength % 128 == 0)
|
||||
{
|
||||
ffEdidGetName(edidData, &name);
|
||||
ffEdidGetPhysicalSize(edidData, &physicalWidth, &physicalHeight);
|
||||
}
|
||||
else
|
||||
{
|
||||
ffStrbufSetWS(&name, targetName.monitorDevicePath);
|
||||
ffStrbufSubstrAfterFirstC(&name, '#');
|
||||
ffStrbufSubstrBeforeFirstC(&name, '#');
|
||||
if (targetName.flags.friendlyNameFromEdid)
|
||||
ffStrbufSetWS(&name, targetName.monitorFriendlyDeviceName);
|
||||
else
|
||||
{
|
||||
ffStrbufSetWS(&name, targetName.monitorDevicePath);
|
||||
ffStrbufSubstrAfterFirstC(&name, '#');
|
||||
ffStrbufSubstrBeforeFirstC(&name, '#');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -102,26 +132,21 @@ static void detectDisplays(FFDisplayServerResult* ds)
|
||||
uint32_t temp = width;
|
||||
width = height;
|
||||
height = temp;
|
||||
temp = physicalWidth;
|
||||
physicalWidth = physicalHeight;
|
||||
physicalHeight = temp;
|
||||
}
|
||||
|
||||
uint32_t rotation;
|
||||
switch (path->targetInfo.rotation)
|
||||
{
|
||||
case DISPLAYCONFIG_ROTATION_ROTATE90:
|
||||
rotation = 90;
|
||||
break;
|
||||
case DISPLAYCONFIG_ROTATION_ROTATE180:
|
||||
rotation = 180;
|
||||
break;
|
||||
case DISPLAYCONFIG_ROTATION_ROTATE270:
|
||||
rotation = 270;
|
||||
break;
|
||||
default:
|
||||
rotation = 0;
|
||||
break;
|
||||
case DISPLAYCONFIG_ROTATION_ROTATE90: rotation = 90; break;
|
||||
case DISPLAYCONFIG_ROTATION_ROTATE180: rotation = 180; break;
|
||||
case DISPLAYCONFIG_ROTATION_ROTATE270: rotation = 270; break;
|
||||
default: rotation = 0; break;
|
||||
}
|
||||
|
||||
ffdsAppendDisplay(ds,
|
||||
FFDisplayResult* display = ffdsAppendDisplay(ds,
|
||||
width,
|
||||
height,
|
||||
path->targetInfo.refreshRate.Numerator / (double) path->targetInfo.refreshRate.Denominator,
|
||||
@@ -135,8 +160,28 @@ static void detectDisplays(FFDisplayServerResult* ds)
|
||||
path->targetInfo.outputTechnology == DISPLAYCONFIG_OUTPUT_TECHNOLOGY_UDI_EMBEDDED
|
||||
? FF_DISPLAY_TYPE_BUILTIN : FF_DISPLAY_TYPE_EXTERNAL,
|
||||
!!(monitorInfo->info.dwFlags & MONITORINFOF_PRIMARY),
|
||||
(uint64_t)(uintptr_t) monitorInfo->handle
|
||||
(uint64_t)(uintptr_t) monitorInfo->handle,
|
||||
physicalWidth,
|
||||
physicalHeight
|
||||
);
|
||||
|
||||
if (display)
|
||||
{
|
||||
DISPLAYCONFIG_GET_ADVANCED_COLOR_INFO advColorInfo = {
|
||||
.header = {
|
||||
.type = DISPLAYCONFIG_DEVICE_INFO_GET_ADVANCED_COLOR_INFO,
|
||||
.size = sizeof(advColorInfo),
|
||||
.adapterId = path->targetInfo.adapterId,
|
||||
.id = path->targetInfo.id,
|
||||
}
|
||||
};
|
||||
if (DisplayConfigGetDeviceInfo(&advColorInfo.header) == ERROR_SUCCESS)
|
||||
{
|
||||
display->hdrEnabled = !!advColorInfo.advancedColorEnabled;
|
||||
display->wcgEnabled = !!advColorInfo.wideColorEnforced;
|
||||
display->bitDepth = (uint8_t) advColorInfo.bitsPerColorChannel;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,9 +7,48 @@
|
||||
#include "common/settings.h"
|
||||
#endif
|
||||
|
||||
static void getWMProtocolNameFromEnv(FFDisplayServerResult* result)
|
||||
{
|
||||
const char* env = getenv("XDG_SESSION_TYPE");
|
||||
if(env)
|
||||
{
|
||||
if(ffStrEqualsIgnCase(env, "wayland"))
|
||||
ffStrbufSetS(&result->wmProtocolName, FF_WM_PROTOCOL_WAYLAND);
|
||||
else if(ffStrEqualsIgnCase(env, "x11") || ffStrEqualsIgnCase(env, "xorg"))
|
||||
ffStrbufSetS(&result->wmProtocolName, FF_WM_PROTOCOL_X11);
|
||||
else if(ffStrEqualsIgnCase(env, "tty"))
|
||||
ffStrbufSetS(&result->wmProtocolName, FF_WM_PROTOCOL_TTY);
|
||||
else
|
||||
ffStrbufSetS(&result->wmProtocolName, env);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if(getenv("WAYLAND_DISPLAY") != NULL || getenv("WAYLAND_SOCKET") != NULL)
|
||||
{
|
||||
ffStrbufSetStatic(&result->wmProtocolName, FF_WM_PROTOCOL_WAYLAND);
|
||||
return;
|
||||
}
|
||||
|
||||
if(getenv("DISPLAY") != NULL) // XWayland also set this
|
||||
{
|
||||
ffStrbufSetStatic(&result->wmProtocolName, FF_WM_PROTOCOL_X11);
|
||||
return;
|
||||
}
|
||||
|
||||
env = getenv("TERM");
|
||||
if(ffStrSet(env) && ffStrEqualsIgnCase(env, "linux"))
|
||||
{
|
||||
ffStrbufSetStatic(&result->wmProtocolName, FF_WM_PROTOCOL_TTY);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
void ffConnectDisplayServerImpl(FFDisplayServerResult* ds)
|
||||
{
|
||||
if (instance.config.general.dsForceDrm == FF_DS_FORCE_DRM_TYPE_FALSE)
|
||||
getWMProtocolNameFromEnv(ds);
|
||||
|
||||
if (!ffStrbufEqualS(&ds->wmProtocolName, FF_WM_PROTOCOL_TTY) &&instance.config.general.dsForceDrm == FF_DS_FORCE_DRM_TYPE_FALSE)
|
||||
{
|
||||
//We try wayland as our preferred display server, as it supports the most features.
|
||||
//This method can't detect the name of our WM / DE
|
||||
@@ -50,15 +89,18 @@ void ffConnectDisplayServerImpl(FFDisplayServerResult* ds)
|
||||
if (ffSettingsGetFreeBSDKenv("screen.height", &buf))
|
||||
{
|
||||
uint32_t height = (uint32_t) ffStrbufToUInt(&buf, 0);
|
||||
ffdsAppendDisplay(ds, width, height, 0, 0, 0, 0, NULL, FF_DISPLAY_TYPE_UNKNOWN, false, 0);
|
||||
ffdsAppendDisplay(ds, width, height, 0, 0, 0, 0, NULL, FF_DISPLAY_TYPE_UNKNOWN, false, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
//This fills in missing information about WM / DE by using env vars and iterating processes
|
||||
ffdsDetectWMDE(ds);
|
||||
if(!ffStrbufEqualS(&ds->wmProtocolName, FF_WM_PROTOCOL_TTY))
|
||||
{
|
||||
//This fills in missing information about WM / DE by using env vars and iterating processes
|
||||
ffdsDetectWMDE(ds);
|
||||
}
|
||||
}
|
||||
|
||||
bool ffdsMatchDrmConnector(const char* connName, FFstrbuf* edidName)
|
||||
@@ -68,7 +110,7 @@ bool ffdsMatchDrmConnector(const char* connName, FFstrbuf* edidName)
|
||||
// However I can't find a better method to get the edid data
|
||||
const char* drmDirPath = "/sys/class/drm/";
|
||||
|
||||
DIR* dirp = opendir(drmDirPath);
|
||||
FF_AUTO_CLOSE_DIR DIR* dirp = opendir(drmDirPath);
|
||||
if(dirp == NULL)
|
||||
return false;
|
||||
|
||||
@@ -90,13 +132,25 @@ bool ffdsMatchDrmConnector(const char* connName, FFstrbuf* edidName)
|
||||
{
|
||||
ffStrbufClear(edidName);
|
||||
ffEdidGetName(edidData, edidName);
|
||||
closedir(dirp);
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
ffStrbufClear(edidName);
|
||||
closedir(dirp);
|
||||
return false;
|
||||
}
|
||||
|
||||
FFDisplayType ffdsGetDisplayType(const char* name)
|
||||
{
|
||||
if(ffStrStartsWith(name, "eDP-") || ffStrStartsWith(name, "LVDS-"))
|
||||
return FF_DISPLAY_TYPE_BUILTIN;
|
||||
else if(ffStrStartsWith(name, "HDMI-") ||
|
||||
ffStrStartsWith(name, "DP-") ||
|
||||
ffStrStartsWith(name, "DisplayPort-") ||
|
||||
ffStrStartsWith(name, "DVI-") ||
|
||||
ffStrStartsWith(name, "VGA-"))
|
||||
return FF_DISPLAY_TYPE_EXTERNAL;
|
||||
|
||||
return FF_DISPLAY_TYPE_UNKNOWN;
|
||||
}
|
||||
|
||||
@@ -7,8 +7,7 @@
|
||||
|
||||
bool ffdsMatchDrmConnector(const char* connName, FFstrbuf* edidName);
|
||||
|
||||
const char* ffdsConnectWlroots(FFDisplayServerResult* result);
|
||||
void ffdsConnectWayland(FFDisplayServerResult* result);
|
||||
const char* ffdsConnectWayland(FFDisplayServerResult* result);
|
||||
|
||||
void ffdsConnectXcbRandr(FFDisplayServerResult* result);
|
||||
void ffdsConnectXcb(FFDisplayServerResult* result);
|
||||
@@ -20,4 +19,6 @@ void ffdsConnectDrm(FFDisplayServerResult* result);
|
||||
|
||||
void ffdsDetectWMDE(FFDisplayServerResult* result);
|
||||
|
||||
FFDisplayType ffdsGetDisplayType(const char* drmConnectorName);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -37,7 +37,7 @@ static const char* drmParseSysfs(FFDisplayServerResult* result)
|
||||
continue;
|
||||
}
|
||||
|
||||
unsigned width = 0, height = 0;
|
||||
unsigned width = 0, height = 0, physicalWidth = 0, physicalHeight = 0;
|
||||
double refreshRate = 0;
|
||||
FF_STRBUF_AUTO_DESTROY name = ffStrbufCreate();
|
||||
|
||||
@@ -49,6 +49,7 @@ static const char* drmParseSysfs(FFDisplayServerResult* result)
|
||||
{
|
||||
ffEdidGetName(edidData, &name);
|
||||
ffEdidGetPreferredResolutionAndRefreshRate(edidData, &width, &height, &refreshRate);
|
||||
ffEdidGetPhysicalSize(edidData, &physicalWidth, &physicalHeight);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -78,7 +79,9 @@ static const char* drmParseSysfs(FFDisplayServerResult* result)
|
||||
&name,
|
||||
FF_DISPLAY_TYPE_UNKNOWN,
|
||||
false,
|
||||
0
|
||||
0,
|
||||
physicalWidth,
|
||||
physicalHeight
|
||||
);
|
||||
|
||||
ffStrbufSubstrBefore(&drmDir, drmDirLength);
|
||||
@@ -217,6 +220,8 @@ static const char* drmConnectLibdrm(FFDisplayServerResult* result)
|
||||
if (nDevices < 0)
|
||||
return "drmGetDevices() failed";
|
||||
|
||||
FF_STRBUF_AUTO_DESTROY name = ffStrbufCreate();
|
||||
|
||||
for (int iDev = 0; iDev < nDevices; ++iDev)
|
||||
{
|
||||
drmDevice* dev = devices[iDev];
|
||||
@@ -225,6 +230,13 @@ static const char* drmConnectLibdrm(FFDisplayServerResult* result)
|
||||
continue;
|
||||
|
||||
const char* path = dev->nodes[DRM_NODE_PRIMARY];
|
||||
|
||||
ffStrbufSetF(&name, "/sys/class/drm/%s/device/power/runtime_status", strrchr(path, '/') + 1);
|
||||
|
||||
char buffer[8] = "";
|
||||
if (ffReadFileData(name.chars, strlen("suspend"), buffer) > 0 && ffStrStartsWith(buffer, "suspend"))
|
||||
continue;
|
||||
|
||||
FF_AUTO_CLOSE_FD int fd = open(path, O_RDONLY | O_CLOEXEC);
|
||||
if (fd < 0)
|
||||
continue;
|
||||
@@ -289,7 +301,8 @@ static const char* drmConnectLibdrm(FFDisplayServerResult* result)
|
||||
}
|
||||
}
|
||||
|
||||
FF_STRBUF_AUTO_DESTROY name = ffStrbufCreate();
|
||||
|
||||
ffStrbufClear(&name);
|
||||
|
||||
for (int iProp = 0; iProp < conn->count_props; ++iProp)
|
||||
{
|
||||
@@ -339,12 +352,14 @@ static const char* drmConnectLibdrm(FFDisplayServerResult* result)
|
||||
0,
|
||||
0,
|
||||
&name,
|
||||
conn->connector_type == DRM_MODE_CONNECTOR_eDP
|
||||
conn->connector_type == DRM_MODE_CONNECTOR_eDP || conn->connector_type == DRM_MODE_CONNECTOR_LVDS
|
||||
? FF_DISPLAY_TYPE_BUILTIN
|
||||
: conn->connector_type == DRM_MODE_CONNECTOR_HDMIA || conn->connector_type == DRM_MODE_CONNECTOR_HDMIB
|
||||
: conn->connector_type == DRM_MODE_CONNECTOR_HDMIA || conn->connector_type == DRM_MODE_CONNECTOR_HDMIB || conn->connector_type == DRM_MODE_CONNECTOR_DisplayPort
|
||||
? FF_DISPLAY_TYPE_EXTERNAL : FF_DISPLAY_TYPE_UNKNOWN,
|
||||
false,
|
||||
conn->connector_id
|
||||
conn->connector_id,
|
||||
conn->mmWidth,
|
||||
conn->mmHeight
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
#include "wayland.h"
|
||||
#include "util/stringUtils.h"
|
||||
#include "xdg-output-unstable-v1-client-protocol.h"
|
||||
|
||||
static void waylandOutputModeListener(void* data, FF_MAYBE_UNUSED struct wl_output* output, uint32_t flags, int32_t width, int32_t height, int32_t refreshRate)
|
||||
{
|
||||
@@ -24,17 +25,52 @@ static void waylandOutputGeometryListener(void *data,
|
||||
FF_MAYBE_UNUSED struct wl_output *output,
|
||||
FF_MAYBE_UNUSED int32_t x,
|
||||
FF_MAYBE_UNUSED int32_t y,
|
||||
FF_MAYBE_UNUSED int32_t physical_width,
|
||||
FF_MAYBE_UNUSED int32_t physical_height,
|
||||
int32_t physical_width,
|
||||
int32_t physical_height,
|
||||
FF_MAYBE_UNUSED int32_t subpixel,
|
||||
FF_MAYBE_UNUSED const char *make,
|
||||
FF_MAYBE_UNUSED const char *model,
|
||||
int32_t transform)
|
||||
{
|
||||
WaylandDisplay* display = data;
|
||||
display->physicalWidth = physical_width;
|
||||
display->physicalHeight = physical_height;
|
||||
display->transform = (enum wl_output_transform) transform;
|
||||
}
|
||||
|
||||
static void handleXdgLogicalSize(void *data, FF_MAYBE_UNUSED struct zxdg_output_v1 *_, int32_t width, FF_MAYBE_UNUSED int32_t height)
|
||||
{
|
||||
WaylandDisplay* display = data;
|
||||
// Seems the values are only useful when ractional scale is enabled
|
||||
if (width < display->width)
|
||||
{
|
||||
display->scale = (double) display->width / width;
|
||||
}
|
||||
}
|
||||
|
||||
// Dirty hack for #477
|
||||
// The order of these callbacks MUST follow `struct wl_output_listener`
|
||||
static void* outputListener[] = {
|
||||
waylandOutputGeometryListener, // geometry
|
||||
waylandOutputModeListener, // mode
|
||||
stubListener, // done
|
||||
waylandOutputScaleListener, // scale
|
||||
ffWaylandOutputNameListener, // name
|
||||
ffWaylandOutputDescriptionListener, // description
|
||||
};
|
||||
static_assert(
|
||||
sizeof(outputListener) >= sizeof(struct wl_output_listener),
|
||||
"sizeof(outputListener) is too small. Please report it to fastfetch github issue"
|
||||
);
|
||||
|
||||
static struct zxdg_output_v1_listener zxdgOutputListener = {
|
||||
.logical_position = (void*) stubListener,
|
||||
.logical_size = handleXdgLogicalSize,
|
||||
.done = (void*) stubListener,
|
||||
.name = (void*) ffWaylandOutputNameListener,
|
||||
.description = (void*) ffWaylandOutputDescriptionListener,
|
||||
};
|
||||
|
||||
void ffWaylandHandleGlobalOutput(WaylandData* wldata, struct wl_registry* registry, uint32_t name, uint32_t version)
|
||||
{
|
||||
struct wl_proxy* output = wldata->ffwl_proxy_marshal_constructor_versioned((struct wl_proxy*) registry, WL_REGISTRY_BIND, wldata->ffwl_output_interface, version, name, wldata->ffwl_output_interface->name, version, NULL);
|
||||
@@ -54,60 +90,27 @@ void ffWaylandHandleGlobalOutput(WaylandData* wldata, struct wl_registry* regist
|
||||
.edidName = ffStrbufCreate(),
|
||||
};
|
||||
|
||||
// Dirty hack for #477
|
||||
// The order of these callbacks MUST follow `struct wl_output_listener`
|
||||
void* outputListener[] = {
|
||||
waylandOutputGeometryListener, // geometry
|
||||
waylandOutputModeListener, // mode
|
||||
stubListener, // done
|
||||
waylandOutputScaleListener, // scale
|
||||
ffWaylandOutputNameListener, // name
|
||||
ffWaylandOutputDescriptionListener, // description
|
||||
};
|
||||
static_assert(
|
||||
sizeof(outputListener) >= sizeof(struct wl_output_listener),
|
||||
"sizeof(outputListener) is too small. Please report it to fastfetch github issue"
|
||||
);
|
||||
|
||||
wldata->ffwl_proxy_add_listener(output, (void(**)(void)) &outputListener, &display);
|
||||
wldata->ffwl_display_roundtrip(wldata->display);
|
||||
|
||||
if (wldata->zxdgOutputManager)
|
||||
{
|
||||
struct wl_proxy* zxdgOutput = wldata->ffwl_proxy_marshal_constructor_versioned(wldata->zxdgOutputManager, ZXDG_OUTPUT_MANAGER_V1_GET_XDG_OUTPUT, &zxdg_output_v1_interface, version, NULL, output);
|
||||
|
||||
if (zxdgOutput)
|
||||
{
|
||||
wldata->ffwl_proxy_add_listener(zxdgOutput, (void(**)(void)) &zxdgOutputListener, &display);
|
||||
wldata->ffwl_display_roundtrip(wldata->display);
|
||||
wldata->ffwl_proxy_destroy(zxdgOutput);
|
||||
}
|
||||
}
|
||||
|
||||
wldata->ffwl_proxy_destroy(output);
|
||||
|
||||
if(display.width <= 0 || display.height <= 0)
|
||||
return;
|
||||
|
||||
uint32_t rotation;
|
||||
switch(display.transform)
|
||||
{
|
||||
case WL_OUTPUT_TRANSFORM_FLIPPED_90:
|
||||
case WL_OUTPUT_TRANSFORM_90:
|
||||
rotation = 90;
|
||||
break;
|
||||
case WL_OUTPUT_TRANSFORM_FLIPPED_180:
|
||||
case WL_OUTPUT_TRANSFORM_180:
|
||||
rotation = 180;
|
||||
break;
|
||||
case WL_OUTPUT_TRANSFORM_FLIPPED_270:
|
||||
case WL_OUTPUT_TRANSFORM_270:
|
||||
rotation = 270;
|
||||
break;
|
||||
default:
|
||||
rotation = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
switch(rotation)
|
||||
{
|
||||
case 90:
|
||||
case 270: {
|
||||
int32_t temp = display.width;
|
||||
display.width = display.height;
|
||||
display.height = temp;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
uint32_t rotation = ffWaylandHandleRotation(&display);
|
||||
|
||||
ffdsAppendDisplay(wldata->result,
|
||||
(uint32_t) display.width,
|
||||
@@ -119,12 +122,14 @@ void ffWaylandHandleGlobalOutput(WaylandData* wldata, struct wl_registry* regist
|
||||
display.edidName.length
|
||||
? &display.edidName
|
||||
// Try ignoring `eDP-1-unknown`, where `unknown` is localized
|
||||
: display.description.length && !(ffStrbufStartsWithS(&display.description, display.name.chars) && display.description.chars[display.name.length] == '-')
|
||||
: display.description.length && !ffStrbufContain(&display.description, &display.name)
|
||||
? &display.description
|
||||
: &display.name,
|
||||
display.type,
|
||||
false,
|
||||
0
|
||||
display.id,
|
||||
(uint32_t) display.physicalWidth,
|
||||
(uint32_t) display.physicalHeight
|
||||
);
|
||||
|
||||
ffStrbufDestroy(&display.description);
|
||||
@@ -132,4 +137,13 @@ void ffWaylandHandleGlobalOutput(WaylandData* wldata, struct wl_registry* regist
|
||||
ffStrbufDestroy(&display.edidName);
|
||||
}
|
||||
|
||||
void ffWaylandHandleZxdgOutput(WaylandData* wldata, struct wl_registry* registry, uint32_t name, uint32_t version)
|
||||
{
|
||||
struct wl_proxy* manager = wldata->ffwl_proxy_marshal_constructor_versioned((struct wl_proxy*) registry, WL_REGISTRY_BIND, &zxdg_output_manager_v1_interface, version, name, zxdg_output_manager_v1_interface.name, version, NULL);
|
||||
if(manager == NULL)
|
||||
return;
|
||||
|
||||
wldata->zxdgOutputManager = manager;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,845 @@
|
||||
/* Generated by wayland-scanner 1.22.0 */
|
||||
|
||||
#ifndef KDE_OUTPUT_DEVICE_V2_CLIENT_PROTOCOL_H
|
||||
#define KDE_OUTPUT_DEVICE_V2_CLIENT_PROTOCOL_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
#include <wayland-util.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @page page_kde_output_device_v2 The kde_output_device_v2 protocol
|
||||
* @section page_ifaces_kde_output_device_v2 Interfaces
|
||||
* - @subpage page_iface_kde_output_device_v2 - output configuration representation
|
||||
* - @subpage page_iface_kde_output_device_mode_v2 - output mode
|
||||
* @section page_copyright_kde_output_device_v2 Copyright
|
||||
* <pre>
|
||||
*
|
||||
* SPDX-FileCopyrightText: 2008-2011 Kristian Høgsberg
|
||||
* SPDX-FileCopyrightText: 2010-2011 Intel Corporation
|
||||
* SPDX-FileCopyrightText: 2012-2013 Collabora, Ltd.
|
||||
* SPDX-FileCopyrightText: 2015 Sebastian Kügler <sebas@kde.org>
|
||||
* SPDX-FileCopyrightText: 2021 Méven Car <meven.car@enioka.com>
|
||||
*
|
||||
* SPDX-License-Identifier: MIT-CMU
|
||||
* </pre>
|
||||
*/
|
||||
struct kde_output_device_mode_v2;
|
||||
struct kde_output_device_v2;
|
||||
|
||||
#ifndef KDE_OUTPUT_DEVICE_V2_INTERFACE
|
||||
#define KDE_OUTPUT_DEVICE_V2_INTERFACE
|
||||
/**
|
||||
* @page page_iface_kde_output_device_v2 kde_output_device_v2
|
||||
* @section page_iface_kde_output_device_v2_desc Description
|
||||
*
|
||||
* An output device describes a display device available to the compositor.
|
||||
* output_device is similar to wl_output, but focuses on output
|
||||
* configuration management.
|
||||
*
|
||||
* A client can query all global output_device objects to enlist all
|
||||
* available display devices, even those that may currently not be
|
||||
* represented by the compositor as a wl_output.
|
||||
*
|
||||
* The client sends configuration changes to the server through the
|
||||
* outputconfiguration interface, and the server applies the configuration
|
||||
* changes to the hardware and signals changes to the output devices
|
||||
* accordingly.
|
||||
*
|
||||
* This object is published as global during start up for every available
|
||||
* display devices, or when one later becomes available, for example by
|
||||
* being hotplugged via a physical connector.
|
||||
* @section page_iface_kde_output_device_v2_api API
|
||||
* See @ref iface_kde_output_device_v2.
|
||||
*/
|
||||
/**
|
||||
* @defgroup iface_kde_output_device_v2 The kde_output_device_v2 interface
|
||||
*
|
||||
* An output device describes a display device available to the compositor.
|
||||
* output_device is similar to wl_output, but focuses on output
|
||||
* configuration management.
|
||||
*
|
||||
* A client can query all global output_device objects to enlist all
|
||||
* available display devices, even those that may currently not be
|
||||
* represented by the compositor as a wl_output.
|
||||
*
|
||||
* The client sends configuration changes to the server through the
|
||||
* outputconfiguration interface, and the server applies the configuration
|
||||
* changes to the hardware and signals changes to the output devices
|
||||
* accordingly.
|
||||
*
|
||||
* This object is published as global during start up for every available
|
||||
* display devices, or when one later becomes available, for example by
|
||||
* being hotplugged via a physical connector.
|
||||
*/
|
||||
extern const struct wl_interface kde_output_device_v2_interface;
|
||||
#endif
|
||||
#ifndef KDE_OUTPUT_DEVICE_MODE_V2_INTERFACE
|
||||
#define KDE_OUTPUT_DEVICE_MODE_V2_INTERFACE
|
||||
/**
|
||||
* @page page_iface_kde_output_device_mode_v2 kde_output_device_mode_v2
|
||||
* @section page_iface_kde_output_device_mode_v2_desc Description
|
||||
*
|
||||
* This object describes an output mode.
|
||||
*
|
||||
* Some heads don't support output modes, in which case modes won't be
|
||||
* advertised.
|
||||
*
|
||||
* Properties sent via this interface are applied atomically via the
|
||||
* kde_output_device.done event. No guarantees are made regarding the order
|
||||
* in which properties are sent.
|
||||
* @section page_iface_kde_output_device_mode_v2_api API
|
||||
* See @ref iface_kde_output_device_mode_v2.
|
||||
*/
|
||||
/**
|
||||
* @defgroup iface_kde_output_device_mode_v2 The kde_output_device_mode_v2 interface
|
||||
*
|
||||
* This object describes an output mode.
|
||||
*
|
||||
* Some heads don't support output modes, in which case modes won't be
|
||||
* advertised.
|
||||
*
|
||||
* Properties sent via this interface are applied atomically via the
|
||||
* kde_output_device.done event. No guarantees are made regarding the order
|
||||
* in which properties are sent.
|
||||
*/
|
||||
extern const struct wl_interface kde_output_device_mode_v2_interface;
|
||||
#endif
|
||||
|
||||
#ifndef KDE_OUTPUT_DEVICE_V2_SUBPIXEL_ENUM
|
||||
#define KDE_OUTPUT_DEVICE_V2_SUBPIXEL_ENUM
|
||||
/**
|
||||
* @ingroup iface_kde_output_device_v2
|
||||
* subpixel geometry information
|
||||
*
|
||||
* This enumeration describes how the physical pixels on an output are
|
||||
* laid out.
|
||||
*/
|
||||
enum kde_output_device_v2_subpixel {
|
||||
KDE_OUTPUT_DEVICE_V2_SUBPIXEL_UNKNOWN = 0,
|
||||
KDE_OUTPUT_DEVICE_V2_SUBPIXEL_NONE = 1,
|
||||
KDE_OUTPUT_DEVICE_V2_SUBPIXEL_HORIZONTAL_RGB = 2,
|
||||
KDE_OUTPUT_DEVICE_V2_SUBPIXEL_HORIZONTAL_BGR = 3,
|
||||
KDE_OUTPUT_DEVICE_V2_SUBPIXEL_VERTICAL_RGB = 4,
|
||||
KDE_OUTPUT_DEVICE_V2_SUBPIXEL_VERTICAL_BGR = 5,
|
||||
};
|
||||
#endif /* KDE_OUTPUT_DEVICE_V2_SUBPIXEL_ENUM */
|
||||
|
||||
#ifndef KDE_OUTPUT_DEVICE_V2_TRANSFORM_ENUM
|
||||
#define KDE_OUTPUT_DEVICE_V2_TRANSFORM_ENUM
|
||||
/**
|
||||
* @ingroup iface_kde_output_device_v2
|
||||
* transform from framebuffer to output
|
||||
*
|
||||
* This describes the transform, that a compositor will apply to a
|
||||
* surface to compensate for the rotation or mirroring of an
|
||||
* output device.
|
||||
*
|
||||
* The flipped values correspond to an initial flip around a
|
||||
* vertical axis followed by rotation.
|
||||
*
|
||||
* The purpose is mainly to allow clients to render accordingly and
|
||||
* tell the compositor, so that for fullscreen surfaces, the
|
||||
* compositor is still able to scan out directly client surfaces.
|
||||
*/
|
||||
enum kde_output_device_v2_transform {
|
||||
KDE_OUTPUT_DEVICE_V2_TRANSFORM_NORMAL = 0,
|
||||
KDE_OUTPUT_DEVICE_V2_TRANSFORM_90 = 1,
|
||||
KDE_OUTPUT_DEVICE_V2_TRANSFORM_180 = 2,
|
||||
KDE_OUTPUT_DEVICE_V2_TRANSFORM_270 = 3,
|
||||
KDE_OUTPUT_DEVICE_V2_TRANSFORM_FLIPPED = 4,
|
||||
KDE_OUTPUT_DEVICE_V2_TRANSFORM_FLIPPED_90 = 5,
|
||||
KDE_OUTPUT_DEVICE_V2_TRANSFORM_FLIPPED_180 = 6,
|
||||
KDE_OUTPUT_DEVICE_V2_TRANSFORM_FLIPPED_270 = 7,
|
||||
};
|
||||
#endif /* KDE_OUTPUT_DEVICE_V2_TRANSFORM_ENUM */
|
||||
|
||||
#ifndef KDE_OUTPUT_DEVICE_V2_CAPABILITY_ENUM
|
||||
#define KDE_OUTPUT_DEVICE_V2_CAPABILITY_ENUM
|
||||
/**
|
||||
* @ingroup iface_kde_output_device_v2
|
||||
* describes capabilities of the outputdevice
|
||||
*
|
||||
* Describes what capabilities this device has.
|
||||
*/
|
||||
enum kde_output_device_v2_capability {
|
||||
/**
|
||||
* if this output_device can use overscan
|
||||
*/
|
||||
KDE_OUTPUT_DEVICE_V2_CAPABILITY_OVERSCAN = 0x1,
|
||||
/**
|
||||
* if this outputdevice supports variable refresh rate
|
||||
*/
|
||||
KDE_OUTPUT_DEVICE_V2_CAPABILITY_VRR = 0x2,
|
||||
/**
|
||||
* if setting the rgb range is possible
|
||||
*/
|
||||
KDE_OUTPUT_DEVICE_V2_CAPABILITY_RGB_RANGE = 0x4,
|
||||
/**
|
||||
* if this outputdevice supports high dynamic range
|
||||
* @since 3
|
||||
*/
|
||||
KDE_OUTPUT_DEVICE_V2_CAPABILITY_HIGH_DYNAMIC_RANGE = 0x8,
|
||||
/**
|
||||
* if this outputdevice supports a wide color gamut
|
||||
* @since 3
|
||||
*/
|
||||
KDE_OUTPUT_DEVICE_V2_CAPABILITY_WIDE_COLOR_GAMUT = 0x10,
|
||||
/**
|
||||
* if this outputdevice supports autorotation
|
||||
* @since 4
|
||||
*/
|
||||
KDE_OUTPUT_DEVICE_V2_CAPABILITY_AUTO_ROTATE = 0x20,
|
||||
/**
|
||||
* if this outputdevice supports icc profiles
|
||||
* @since 5
|
||||
*/
|
||||
KDE_OUTPUT_DEVICE_V2_CAPABILITY_ICC_PROFILE = 0x40,
|
||||
};
|
||||
/**
|
||||
* @ingroup iface_kde_output_device_v2
|
||||
*/
|
||||
#define KDE_OUTPUT_DEVICE_V2_CAPABILITY_HIGH_DYNAMIC_RANGE_SINCE_VERSION 3
|
||||
/**
|
||||
* @ingroup iface_kde_output_device_v2
|
||||
*/
|
||||
#define KDE_OUTPUT_DEVICE_V2_CAPABILITY_WIDE_COLOR_GAMUT_SINCE_VERSION 3
|
||||
/**
|
||||
* @ingroup iface_kde_output_device_v2
|
||||
*/
|
||||
#define KDE_OUTPUT_DEVICE_V2_CAPABILITY_AUTO_ROTATE_SINCE_VERSION 4
|
||||
/**
|
||||
* @ingroup iface_kde_output_device_v2
|
||||
*/
|
||||
#define KDE_OUTPUT_DEVICE_V2_CAPABILITY_ICC_PROFILE_SINCE_VERSION 5
|
||||
#endif /* KDE_OUTPUT_DEVICE_V2_CAPABILITY_ENUM */
|
||||
|
||||
#ifndef KDE_OUTPUT_DEVICE_V2_VRR_POLICY_ENUM
|
||||
#define KDE_OUTPUT_DEVICE_V2_VRR_POLICY_ENUM
|
||||
/**
|
||||
* @ingroup iface_kde_output_device_v2
|
||||
* describes vrr policy
|
||||
*
|
||||
* Describes when the compositor may employ variable refresh rate
|
||||
*/
|
||||
enum kde_output_device_v2_vrr_policy {
|
||||
KDE_OUTPUT_DEVICE_V2_VRR_POLICY_NEVER = 0,
|
||||
KDE_OUTPUT_DEVICE_V2_VRR_POLICY_ALWAYS = 1,
|
||||
KDE_OUTPUT_DEVICE_V2_VRR_POLICY_AUTOMATIC = 2,
|
||||
};
|
||||
#endif /* KDE_OUTPUT_DEVICE_V2_VRR_POLICY_ENUM */
|
||||
|
||||
#ifndef KDE_OUTPUT_DEVICE_V2_RGB_RANGE_ENUM
|
||||
#define KDE_OUTPUT_DEVICE_V2_RGB_RANGE_ENUM
|
||||
/**
|
||||
* @ingroup iface_kde_output_device_v2
|
||||
* describes RGB range policy
|
||||
*
|
||||
* Whether full or limited color range should be used
|
||||
*/
|
||||
enum kde_output_device_v2_rgb_range {
|
||||
KDE_OUTPUT_DEVICE_V2_RGB_RANGE_AUTOMATIC = 0,
|
||||
KDE_OUTPUT_DEVICE_V2_RGB_RANGE_FULL = 1,
|
||||
KDE_OUTPUT_DEVICE_V2_RGB_RANGE_LIMITED = 2,
|
||||
};
|
||||
#endif /* KDE_OUTPUT_DEVICE_V2_RGB_RANGE_ENUM */
|
||||
|
||||
#ifndef KDE_OUTPUT_DEVICE_V2_AUTO_ROTATE_POLICY_ENUM
|
||||
#define KDE_OUTPUT_DEVICE_V2_AUTO_ROTATE_POLICY_ENUM
|
||||
/**
|
||||
* @ingroup iface_kde_output_device_v2
|
||||
* describes when auto rotate should be used
|
||||
*/
|
||||
enum kde_output_device_v2_auto_rotate_policy {
|
||||
KDE_OUTPUT_DEVICE_V2_AUTO_ROTATE_POLICY_NEVER = 0,
|
||||
KDE_OUTPUT_DEVICE_V2_AUTO_ROTATE_POLICY_IN_TABLET_MODE = 1,
|
||||
KDE_OUTPUT_DEVICE_V2_AUTO_ROTATE_POLICY_ALWAYS = 2,
|
||||
};
|
||||
#endif /* KDE_OUTPUT_DEVICE_V2_AUTO_ROTATE_POLICY_ENUM */
|
||||
|
||||
#ifndef KDE_OUTPUT_DEVICE_V2_COLOR_PROFILE_SOURCE_ENUM
|
||||
#define KDE_OUTPUT_DEVICE_V2_COLOR_PROFILE_SOURCE_ENUM
|
||||
/**
|
||||
* @ingroup iface_kde_output_device_v2
|
||||
* which source the compositor should use for the color profile on an output
|
||||
*/
|
||||
enum kde_output_device_v2_color_profile_source {
|
||||
KDE_OUTPUT_DEVICE_V2_COLOR_PROFILE_SOURCE_SRGB = 0,
|
||||
KDE_OUTPUT_DEVICE_V2_COLOR_PROFILE_SOURCE_ICC = 1,
|
||||
KDE_OUTPUT_DEVICE_V2_COLOR_PROFILE_SOURCE_EDID = 2,
|
||||
};
|
||||
#endif /* KDE_OUTPUT_DEVICE_V2_COLOR_PROFILE_SOURCE_ENUM */
|
||||
|
||||
/**
|
||||
* @ingroup iface_kde_output_device_v2
|
||||
* @struct kde_output_device_v2_listener
|
||||
*/
|
||||
struct kde_output_device_v2_listener {
|
||||
/**
|
||||
* geometric properties of the output
|
||||
*
|
||||
* The geometry event describes geometric properties of the
|
||||
* output. The event is sent when binding to the output object and
|
||||
* whenever any of the properties change.
|
||||
* @param x x position within the global compositor space
|
||||
* @param y y position within the global compositor space
|
||||
* @param physical_width width in millimeters of the output
|
||||
* @param physical_height height in millimeters of the output
|
||||
* @param subpixel subpixel orientation of the output
|
||||
* @param make textual description of the manufacturer
|
||||
* @param model textual description of the model
|
||||
* @param transform transform that maps framebuffer to output
|
||||
*/
|
||||
void (*geometry)(void *data,
|
||||
struct kde_output_device_v2 *kde_output_device_v2,
|
||||
int32_t x,
|
||||
int32_t y,
|
||||
int32_t physical_width,
|
||||
int32_t physical_height,
|
||||
int32_t subpixel,
|
||||
const char *make,
|
||||
const char *model,
|
||||
int32_t transform);
|
||||
/**
|
||||
* current mode
|
||||
*
|
||||
* This event describes the mode currently in use for this head.
|
||||
* It is only sent if the output is enabled.
|
||||
*/
|
||||
void (*current_mode)(void *data,
|
||||
struct kde_output_device_v2 *kde_output_device_v2,
|
||||
struct kde_output_device_mode_v2 *mode);
|
||||
/**
|
||||
* advertise available output modes and current one
|
||||
*
|
||||
* The mode event describes an available mode for the output.
|
||||
*
|
||||
* When the client binds to the output_device object, the server
|
||||
* sends this event once for every available mode the output_device
|
||||
* can be operated by.
|
||||
*
|
||||
* There will always be at least one event sent out on initial
|
||||
* binding, which represents the current mode.
|
||||
*
|
||||
* Later if an output changes, its mode event is sent again for the
|
||||
* eventual added modes and lastly the current mode. In other
|
||||
* words, the current mode is always represented by the latest
|
||||
* event sent with the current flag set.
|
||||
*
|
||||
* The size of a mode is given in physical hardware units of the
|
||||
* output device. This is not necessarily the same as the output
|
||||
* size in the global compositor space. For instance, the output
|
||||
* may be scaled, as described in kde_output_device_v2.scale, or
|
||||
* transformed, as described in kde_output_device_v2.transform.
|
||||
*/
|
||||
void (*mode)(void *data,
|
||||
struct kde_output_device_v2 *kde_output_device_v2,
|
||||
struct kde_output_device_mode_v2 *mode);
|
||||
/**
|
||||
* sent all information about output
|
||||
*
|
||||
* This event is sent after all other properties have been sent
|
||||
* on binding to the output object as well as after any other
|
||||
* output property change have been applied later on. This allows
|
||||
* to see changes to the output properties as atomic, even if
|
||||
* multiple events successively announce them.
|
||||
*/
|
||||
void (*done)(void *data,
|
||||
struct kde_output_device_v2 *kde_output_device_v2);
|
||||
/**
|
||||
* output scaling properties
|
||||
*
|
||||
* This event contains scaling geometry information that is not
|
||||
* in the geometry event. It may be sent after binding the output
|
||||
* object or if the output scale changes later. If it is not sent,
|
||||
* the client should assume a scale of 1.
|
||||
*
|
||||
* A scale larger than 1 means that the compositor will
|
||||
* automatically scale surface buffers by this amount when
|
||||
* rendering. This is used for high resolution displays where
|
||||
* applications rendering at the native resolution would be too
|
||||
* small to be legible.
|
||||
*
|
||||
* It is intended that scaling aware clients track the current
|
||||
* output of a surface, and if it is on a scaled output it should
|
||||
* use wl_surface.set_buffer_scale with the scale of the output.
|
||||
* That way the compositor can avoid scaling the surface, and the
|
||||
* client can supply a higher detail image.
|
||||
* @param factor scaling factor of output
|
||||
*/
|
||||
void (*scale)(void *data,
|
||||
struct kde_output_device_v2 *kde_output_device_v2,
|
||||
wl_fixed_t factor);
|
||||
/**
|
||||
* advertise EDID data for the output
|
||||
*
|
||||
* The edid event encapsulates the EDID data for the
|
||||
* outputdevice.
|
||||
*
|
||||
* The event is sent when binding to the output object. The EDID
|
||||
* data may be empty, in which case this event is sent anyway. If
|
||||
* the EDID information is empty, you can fall back to the name et
|
||||
* al. properties of the outputdevice.
|
||||
* @param raw base64-encoded EDID string
|
||||
*/
|
||||
void (*edid)(void *data,
|
||||
struct kde_output_device_v2 *kde_output_device_v2,
|
||||
const char *raw);
|
||||
/**
|
||||
* output is enabled or disabled
|
||||
*
|
||||
* The enabled event notifies whether this output is currently
|
||||
* enabled and used for displaying content by the server. The event
|
||||
* is sent when binding to the output object and whenever later on
|
||||
* an output changes its state by becoming enabled or disabled.
|
||||
* @param enabled output enabled state
|
||||
*/
|
||||
void (*enabled)(void *data,
|
||||
struct kde_output_device_v2 *kde_output_device_v2,
|
||||
int32_t enabled);
|
||||
/**
|
||||
* A unique id for this outputdevice
|
||||
*
|
||||
* The uuid can be used to identify the output. It's controlled
|
||||
* by the server entirely. The server should make sure the uuid is
|
||||
* persistent across restarts. An empty uuid is considered invalid.
|
||||
* @param uuid output devices ID
|
||||
*/
|
||||
void (*uuid)(void *data,
|
||||
struct kde_output_device_v2 *kde_output_device_v2,
|
||||
const char *uuid);
|
||||
/**
|
||||
* Serial Number
|
||||
*
|
||||
* Serial ID of the monitor, sent on startup before the first
|
||||
* done event.
|
||||
* @param serialNumber textual representation of serial number
|
||||
*/
|
||||
void (*serial_number)(void *data,
|
||||
struct kde_output_device_v2 *kde_output_device_v2,
|
||||
const char *serialNumber);
|
||||
/**
|
||||
* EISA ID
|
||||
*
|
||||
* EISA ID of the monitor, sent on startup before the first done
|
||||
* event.
|
||||
* @param eisaId textual representation of EISA identifier
|
||||
*/
|
||||
void (*eisa_id)(void *data,
|
||||
struct kde_output_device_v2 *kde_output_device_v2,
|
||||
const char *eisaId);
|
||||
/**
|
||||
* capability flags
|
||||
*
|
||||
* What capabilities this device has, sent on startup before the
|
||||
* first done event.
|
||||
*/
|
||||
void (*capabilities)(void *data,
|
||||
struct kde_output_device_v2 *kde_output_device_v2,
|
||||
uint32_t flags);
|
||||
/**
|
||||
* overscan
|
||||
*
|
||||
* Overscan value of the monitor in percent, sent on startup
|
||||
* before the first done event.
|
||||
* @param overscan amount of overscan of the monitor
|
||||
*/
|
||||
void (*overscan)(void *data,
|
||||
struct kde_output_device_v2 *kde_output_device_v2,
|
||||
uint32_t overscan);
|
||||
/**
|
||||
* Variable Refresh Rate Policy
|
||||
*
|
||||
* What policy the compositor will employ regarding its use of
|
||||
* variable refresh rate.
|
||||
*/
|
||||
void (*vrr_policy)(void *data,
|
||||
struct kde_output_device_v2 *kde_output_device_v2,
|
||||
uint32_t vrr_policy);
|
||||
/**
|
||||
* RGB range
|
||||
*
|
||||
* What rgb range the compositor is using for this output
|
||||
*/
|
||||
void (*rgb_range)(void *data,
|
||||
struct kde_output_device_v2 *kde_output_device_v2,
|
||||
uint32_t rgb_range);
|
||||
/**
|
||||
* Output's name
|
||||
*
|
||||
* Name of the output, it's useful to cross-reference to an
|
||||
* zxdg_output_v1 and ultimately QScreen
|
||||
* @since 2
|
||||
*/
|
||||
void (*name)(void *data,
|
||||
struct kde_output_device_v2 *kde_output_device_v2,
|
||||
const char *name);
|
||||
/**
|
||||
* if HDR is enabled
|
||||
*
|
||||
* Whether or not high dynamic range is enabled for this output
|
||||
* @param hdr_enabled 1 if enabled, 0 if disabled
|
||||
* @since 3
|
||||
*/
|
||||
void (*high_dynamic_range)(void *data,
|
||||
struct kde_output_device_v2 *kde_output_device_v2,
|
||||
uint32_t hdr_enabled);
|
||||
/**
|
||||
* the brightness of sdr if hdr is enabled
|
||||
*
|
||||
* If high dynamic range is used, this value defines the
|
||||
* brightness in nits for content that's in standard dynamic range
|
||||
* format. Note that while the value is in nits, that doesn't
|
||||
* necessarily translate to the same brightness on the screen.
|
||||
* @since 3
|
||||
*/
|
||||
void (*sdr_brightness)(void *data,
|
||||
struct kde_output_device_v2 *kde_output_device_v2,
|
||||
uint32_t sdr_brightness);
|
||||
/**
|
||||
* if WCG is enabled
|
||||
*
|
||||
* Whether or not the use of a wide color gamut is enabled for
|
||||
* this output
|
||||
* @param wcg_enabled 1 if enabled, 0 if disabled
|
||||
* @since 3
|
||||
*/
|
||||
void (*wide_color_gamut)(void *data,
|
||||
struct kde_output_device_v2 *kde_output_device_v2,
|
||||
uint32_t wcg_enabled);
|
||||
/**
|
||||
* describes when auto rotate is used
|
||||
*
|
||||
*
|
||||
* @since 4
|
||||
*/
|
||||
void (*auto_rotate_policy)(void *data,
|
||||
struct kde_output_device_v2 *kde_output_device_v2,
|
||||
uint32_t policy);
|
||||
/**
|
||||
* describes when auto rotate is used
|
||||
*
|
||||
*
|
||||
* @since 5
|
||||
*/
|
||||
void (*icc_profile_path)(void *data,
|
||||
struct kde_output_device_v2 *kde_output_device_v2,
|
||||
const char *profile_path);
|
||||
/**
|
||||
* metadata about the screen's brightness limits
|
||||
*
|
||||
*
|
||||
* @param max_peak_brightness in nits
|
||||
* @param max_frame_average_brightness in nits
|
||||
* @param min_brightness in 0.0001 nits
|
||||
* @since 6
|
||||
*/
|
||||
void (*brightness_metadata)(void *data,
|
||||
struct kde_output_device_v2 *kde_output_device_v2,
|
||||
uint32_t max_peak_brightness,
|
||||
uint32_t max_frame_average_brightness,
|
||||
uint32_t min_brightness);
|
||||
/**
|
||||
* overrides for the screen's brightness limits
|
||||
*
|
||||
*
|
||||
* @param max_peak_brightness -1 for no override, positive values are the brightness in nits
|
||||
* @param max_average_brightness -1 for no override, positive values are the brightness in nits
|
||||
* @param min_brightness -1 for no override, positive values are the brightness in 0.0001 nits
|
||||
* @since 6
|
||||
*/
|
||||
void (*brightness_overrides)(void *data,
|
||||
struct kde_output_device_v2 *kde_output_device_v2,
|
||||
int32_t max_peak_brightness,
|
||||
int32_t max_average_brightness,
|
||||
int32_t min_brightness);
|
||||
/**
|
||||
* describes which gamut is assumed for sRGB applications
|
||||
*
|
||||
* This can be used to provide the colors users assume sRGB
|
||||
* applications should have based on the default experience on many
|
||||
* modern sRGB screens.
|
||||
* @param gamut_wideness 0 means rec.709 primaries, 10000 means native primaries
|
||||
* @since 6
|
||||
*/
|
||||
void (*sdr_gamut_wideness)(void *data,
|
||||
struct kde_output_device_v2 *kde_output_device_v2,
|
||||
uint32_t gamut_wideness);
|
||||
/**
|
||||
* describes which source the compositor uses for the color profile on an output
|
||||
*
|
||||
*
|
||||
* @since 7
|
||||
*/
|
||||
void (*color_profile_source)(void *data,
|
||||
struct kde_output_device_v2 *kde_output_device_v2,
|
||||
uint32_t source);
|
||||
/**
|
||||
* brightness multiplier
|
||||
*
|
||||
* This is the brightness modifier of the output. It doesn't
|
||||
* specify any absolute values, but is merely a multiplier on top
|
||||
* of other brightness values, like sdr_brightness and
|
||||
* brightness_metadata. 0 is the minimum brightness (not completely
|
||||
* dark) and 10000 is the maximum brightness. This is currently
|
||||
* only supported / meaningful while HDR is active.
|
||||
* @param brightness brightness in 0-10000
|
||||
* @since 8
|
||||
*/
|
||||
void (*brightness)(void *data,
|
||||
struct kde_output_device_v2 *kde_output_device_v2,
|
||||
uint32_t brightness);
|
||||
};
|
||||
|
||||
/**
|
||||
* @ingroup iface_kde_output_device_v2
|
||||
*/
|
||||
static inline int
|
||||
kde_output_device_v2_add_listener(struct kde_output_device_v2 *kde_output_device_v2,
|
||||
const struct kde_output_device_v2_listener *listener, void *data)
|
||||
{
|
||||
return wl_proxy_add_listener((struct wl_proxy *) kde_output_device_v2,
|
||||
(void (**)(void)) listener, data);
|
||||
}
|
||||
|
||||
/**
|
||||
* @ingroup iface_kde_output_device_v2
|
||||
*/
|
||||
#define KDE_OUTPUT_DEVICE_V2_GEOMETRY_SINCE_VERSION 1
|
||||
/**
|
||||
* @ingroup iface_kde_output_device_v2
|
||||
*/
|
||||
#define KDE_OUTPUT_DEVICE_V2_CURRENT_MODE_SINCE_VERSION 1
|
||||
/**
|
||||
* @ingroup iface_kde_output_device_v2
|
||||
*/
|
||||
#define KDE_OUTPUT_DEVICE_V2_MODE_SINCE_VERSION 1
|
||||
/**
|
||||
* @ingroup iface_kde_output_device_v2
|
||||
*/
|
||||
#define KDE_OUTPUT_DEVICE_V2_DONE_SINCE_VERSION 1
|
||||
/**
|
||||
* @ingroup iface_kde_output_device_v2
|
||||
*/
|
||||
#define KDE_OUTPUT_DEVICE_V2_SCALE_SINCE_VERSION 1
|
||||
/**
|
||||
* @ingroup iface_kde_output_device_v2
|
||||
*/
|
||||
#define KDE_OUTPUT_DEVICE_V2_EDID_SINCE_VERSION 1
|
||||
/**
|
||||
* @ingroup iface_kde_output_device_v2
|
||||
*/
|
||||
#define KDE_OUTPUT_DEVICE_V2_ENABLED_SINCE_VERSION 1
|
||||
/**
|
||||
* @ingroup iface_kde_output_device_v2
|
||||
*/
|
||||
#define KDE_OUTPUT_DEVICE_V2_UUID_SINCE_VERSION 1
|
||||
/**
|
||||
* @ingroup iface_kde_output_device_v2
|
||||
*/
|
||||
#define KDE_OUTPUT_DEVICE_V2_SERIAL_NUMBER_SINCE_VERSION 1
|
||||
/**
|
||||
* @ingroup iface_kde_output_device_v2
|
||||
*/
|
||||
#define KDE_OUTPUT_DEVICE_V2_EISA_ID_SINCE_VERSION 1
|
||||
/**
|
||||
* @ingroup iface_kde_output_device_v2
|
||||
*/
|
||||
#define KDE_OUTPUT_DEVICE_V2_CAPABILITIES_SINCE_VERSION 1
|
||||
/**
|
||||
* @ingroup iface_kde_output_device_v2
|
||||
*/
|
||||
#define KDE_OUTPUT_DEVICE_V2_OVERSCAN_SINCE_VERSION 1
|
||||
/**
|
||||
* @ingroup iface_kde_output_device_v2
|
||||
*/
|
||||
#define KDE_OUTPUT_DEVICE_V2_VRR_POLICY_SINCE_VERSION 1
|
||||
/**
|
||||
* @ingroup iface_kde_output_device_v2
|
||||
*/
|
||||
#define KDE_OUTPUT_DEVICE_V2_RGB_RANGE_SINCE_VERSION 1
|
||||
/**
|
||||
* @ingroup iface_kde_output_device_v2
|
||||
*/
|
||||
#define KDE_OUTPUT_DEVICE_V2_NAME_SINCE_VERSION 2
|
||||
/**
|
||||
* @ingroup iface_kde_output_device_v2
|
||||
*/
|
||||
#define KDE_OUTPUT_DEVICE_V2_HIGH_DYNAMIC_RANGE_SINCE_VERSION 3
|
||||
/**
|
||||
* @ingroup iface_kde_output_device_v2
|
||||
*/
|
||||
#define KDE_OUTPUT_DEVICE_V2_SDR_BRIGHTNESS_SINCE_VERSION 3
|
||||
/**
|
||||
* @ingroup iface_kde_output_device_v2
|
||||
*/
|
||||
#define KDE_OUTPUT_DEVICE_V2_WIDE_COLOR_GAMUT_SINCE_VERSION 3
|
||||
/**
|
||||
* @ingroup iface_kde_output_device_v2
|
||||
*/
|
||||
#define KDE_OUTPUT_DEVICE_V2_AUTO_ROTATE_POLICY_SINCE_VERSION 4
|
||||
/**
|
||||
* @ingroup iface_kde_output_device_v2
|
||||
*/
|
||||
#define KDE_OUTPUT_DEVICE_V2_ICC_PROFILE_PATH_SINCE_VERSION 5
|
||||
/**
|
||||
* @ingroup iface_kde_output_device_v2
|
||||
*/
|
||||
#define KDE_OUTPUT_DEVICE_V2_BRIGHTNESS_METADATA_SINCE_VERSION 6
|
||||
/**
|
||||
* @ingroup iface_kde_output_device_v2
|
||||
*/
|
||||
#define KDE_OUTPUT_DEVICE_V2_BRIGHTNESS_OVERRIDES_SINCE_VERSION 6
|
||||
/**
|
||||
* @ingroup iface_kde_output_device_v2
|
||||
*/
|
||||
#define KDE_OUTPUT_DEVICE_V2_SDR_GAMUT_WIDENESS_SINCE_VERSION 6
|
||||
/**
|
||||
* @ingroup iface_kde_output_device_v2
|
||||
*/
|
||||
#define KDE_OUTPUT_DEVICE_V2_COLOR_PROFILE_SOURCE_SINCE_VERSION 7
|
||||
/**
|
||||
* @ingroup iface_kde_output_device_v2
|
||||
*/
|
||||
#define KDE_OUTPUT_DEVICE_V2_BRIGHTNESS_SINCE_VERSION 8
|
||||
|
||||
|
||||
// /** @ingroup iface_kde_output_device_v2 */
|
||||
// static inline void
|
||||
// kde_output_device_v2_set_user_data(struct kde_output_device_v2 *kde_output_device_v2, void *user_data)
|
||||
// {
|
||||
// wl_proxy_set_user_data((struct wl_proxy *) kde_output_device_v2, user_data);
|
||||
// }
|
||||
|
||||
// /** @ingroup iface_kde_output_device_v2 */
|
||||
// static inline void *
|
||||
// kde_output_device_v2_get_user_data(struct kde_output_device_v2 *kde_output_device_v2)
|
||||
// {
|
||||
// return wl_proxy_get_user_data((struct wl_proxy *) kde_output_device_v2);
|
||||
// }
|
||||
|
||||
// static inline uint32_t
|
||||
// kde_output_device_v2_get_version(struct kde_output_device_v2 *kde_output_device_v2)
|
||||
// {
|
||||
// return wl_proxy_get_version((struct wl_proxy *) kde_output_device_v2);
|
||||
// }
|
||||
|
||||
// /** @ingroup iface_kde_output_device_v2 */
|
||||
// static inline void
|
||||
// kde_output_device_v2_destroy(struct kde_output_device_v2 *kde_output_device_v2)
|
||||
// {
|
||||
// wl_proxy_destroy((struct wl_proxy *) kde_output_device_v2);
|
||||
// }
|
||||
|
||||
/**
|
||||
* @ingroup iface_kde_output_device_mode_v2
|
||||
* @struct kde_output_device_mode_v2_listener
|
||||
*/
|
||||
struct kde_output_device_mode_v2_listener {
|
||||
/**
|
||||
* mode size
|
||||
*
|
||||
* This event describes the mode size. The size is given in
|
||||
* physical hardware units of the output device. This is not
|
||||
* necessarily the same as the output size in the global compositor
|
||||
* space. For instance, the output may be scaled or transformed.
|
||||
* @param width width of the mode in hardware units
|
||||
* @param height height of the mode in hardware units
|
||||
*/
|
||||
void (*size)(void *data,
|
||||
struct kde_output_device_mode_v2 *kde_output_device_mode_v2,
|
||||
int32_t width,
|
||||
int32_t height);
|
||||
/**
|
||||
* mode refresh rate
|
||||
*
|
||||
* This event describes the mode's fixed vertical refresh rate.
|
||||
* It is only sent if the mode has a fixed refresh rate.
|
||||
* @param refresh vertical refresh rate in mHz
|
||||
*/
|
||||
void (*refresh)(void *data,
|
||||
struct kde_output_device_mode_v2 *kde_output_device_mode_v2,
|
||||
int32_t refresh);
|
||||
/**
|
||||
* mode is preferred
|
||||
*
|
||||
* This event advertises this mode as preferred.
|
||||
*/
|
||||
void (*preferred)(void *data,
|
||||
struct kde_output_device_mode_v2 *kde_output_device_mode_v2);
|
||||
/**
|
||||
* the mode has been destroyed
|
||||
*
|
||||
* The compositor will destroy the object immediately after
|
||||
* sending this event, so it will become invalid and the client
|
||||
* should release any resources associated with it.
|
||||
*/
|
||||
void (*removed)(void *data,
|
||||
struct kde_output_device_mode_v2 *kde_output_device_mode_v2);
|
||||
};
|
||||
|
||||
/**
|
||||
* @ingroup iface_kde_output_device_mode_v2
|
||||
*/
|
||||
static inline int
|
||||
kde_output_device_mode_v2_add_listener(struct kde_output_device_mode_v2 *kde_output_device_mode_v2,
|
||||
const struct kde_output_device_mode_v2_listener *listener, void *data)
|
||||
{
|
||||
return wl_proxy_add_listener((struct wl_proxy *) kde_output_device_mode_v2,
|
||||
(void (**)(void)) listener, data);
|
||||
}
|
||||
|
||||
/**
|
||||
* @ingroup iface_kde_output_device_mode_v2
|
||||
*/
|
||||
#define KDE_OUTPUT_DEVICE_MODE_V2_SIZE_SINCE_VERSION 1
|
||||
/**
|
||||
* @ingroup iface_kde_output_device_mode_v2
|
||||
*/
|
||||
#define KDE_OUTPUT_DEVICE_MODE_V2_REFRESH_SINCE_VERSION 1
|
||||
/**
|
||||
* @ingroup iface_kde_output_device_mode_v2
|
||||
*/
|
||||
#define KDE_OUTPUT_DEVICE_MODE_V2_PREFERRED_SINCE_VERSION 1
|
||||
/**
|
||||
* @ingroup iface_kde_output_device_mode_v2
|
||||
*/
|
||||
#define KDE_OUTPUT_DEVICE_MODE_V2_REMOVED_SINCE_VERSION 1
|
||||
|
||||
|
||||
// /** @ingroup iface_kde_output_device_mode_v2 */
|
||||
// static inline void
|
||||
// kde_output_device_mode_v2_set_user_data(struct kde_output_device_mode_v2 *kde_output_device_mode_v2, void *user_data)
|
||||
// {
|
||||
// wl_proxy_set_user_data((struct wl_proxy *) kde_output_device_mode_v2, user_data);
|
||||
// }
|
||||
|
||||
// /** @ingroup iface_kde_output_device_mode_v2 */
|
||||
// static inline void *
|
||||
// kde_output_device_mode_v2_get_user_data(struct kde_output_device_mode_v2 *kde_output_device_mode_v2)
|
||||
// {
|
||||
// return wl_proxy_get_user_data((struct wl_proxy *) kde_output_device_mode_v2);
|
||||
// }
|
||||
|
||||
// static inline uint32_t
|
||||
// kde_output_device_mode_v2_get_version(struct kde_output_device_mode_v2 *kde_output_device_mode_v2)
|
||||
// {
|
||||
// return wl_proxy_get_version((struct wl_proxy *) kde_output_device_mode_v2);
|
||||
// }
|
||||
|
||||
// /** @ingroup iface_kde_output_device_mode_v2 */
|
||||
// static inline void
|
||||
// kde_output_device_mode_v2_destroy(struct kde_output_device_mode_v2 *kde_output_device_mode_v2)
|
||||
// {
|
||||
// wl_proxy_destroy((struct wl_proxy *) kde_output_device_mode_v2);
|
||||
// }
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,81 @@
|
||||
#ifdef FF_HAVE_WAYLAND
|
||||
|
||||
/* Generated by wayland-scanner 1.22.0 */
|
||||
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2008-2011 Kristian Høgsberg
|
||||
* SPDX-FileCopyrightText: 2010-2011 Intel Corporation
|
||||
* SPDX-FileCopyrightText: 2012-2013 Collabora, Ltd.
|
||||
* SPDX-FileCopyrightText: 2015 Sebastian Kügler <sebas@kde.org>
|
||||
* SPDX-FileCopyrightText: 2021 Méven Car <meven.car@enioka.com>
|
||||
*
|
||||
* SPDX-License-Identifier: MIT-CMU
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
#include <wayland-util.h>
|
||||
|
||||
extern const struct wl_interface kde_output_device_mode_v2_interface;
|
||||
|
||||
static const struct wl_interface *kde_output_device_v2_types[] = {
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
&kde_output_device_mode_v2_interface,
|
||||
&kde_output_device_mode_v2_interface,
|
||||
};
|
||||
|
||||
static const struct wl_message kde_output_device_v2_events[] = {
|
||||
{ "geometry", "iiiiissi", kde_output_device_v2_types + 0 },
|
||||
{ "current_mode", "o", kde_output_device_v2_types + 8 },
|
||||
{ "mode", "n", kde_output_device_v2_types + 9 },
|
||||
{ "done", "", kde_output_device_v2_types + 0 },
|
||||
{ "scale", "f", kde_output_device_v2_types + 0 },
|
||||
{ "edid", "s", kde_output_device_v2_types + 0 },
|
||||
{ "enabled", "i", kde_output_device_v2_types + 0 },
|
||||
{ "uuid", "s", kde_output_device_v2_types + 0 },
|
||||
{ "serial_number", "s", kde_output_device_v2_types + 0 },
|
||||
{ "eisa_id", "s", kde_output_device_v2_types + 0 },
|
||||
{ "capabilities", "u", kde_output_device_v2_types + 0 },
|
||||
{ "overscan", "u", kde_output_device_v2_types + 0 },
|
||||
{ "vrr_policy", "u", kde_output_device_v2_types + 0 },
|
||||
{ "rgb_range", "u", kde_output_device_v2_types + 0 },
|
||||
{ "name", "2s", kde_output_device_v2_types + 0 },
|
||||
{ "high_dynamic_range", "3u", kde_output_device_v2_types + 0 },
|
||||
{ "sdr_brightness", "3u", kde_output_device_v2_types + 0 },
|
||||
{ "wide_color_gamut", "3u", kde_output_device_v2_types + 0 },
|
||||
{ "auto_rotate_policy", "4u", kde_output_device_v2_types + 0 },
|
||||
{ "icc_profile_path", "5s", kde_output_device_v2_types + 0 },
|
||||
{ "brightness_metadata", "6uuu", kde_output_device_v2_types + 0 },
|
||||
{ "brightness_overrides", "6iii", kde_output_device_v2_types + 0 },
|
||||
{ "sdr_gamut_wideness", "6u", kde_output_device_v2_types + 0 },
|
||||
{ "color_profile_source", "7u", kde_output_device_v2_types + 0 },
|
||||
{ "brightness", "8u", kde_output_device_v2_types + 0 },
|
||||
};
|
||||
|
||||
WL_EXPORT const struct wl_interface kde_output_device_v2_interface = {
|
||||
"kde_output_device_v2", 8,
|
||||
0, NULL,
|
||||
25, kde_output_device_v2_events,
|
||||
};
|
||||
|
||||
static const struct wl_message kde_output_device_mode_v2_events[] = {
|
||||
{ "size", "ii", kde_output_device_v2_types + 0 },
|
||||
{ "refresh", "i", kde_output_device_v2_types + 0 },
|
||||
{ "preferred", "", kde_output_device_v2_types + 0 },
|
||||
{ "removed", "", kde_output_device_v2_types + 0 },
|
||||
};
|
||||
|
||||
WL_EXPORT const struct wl_interface kde_output_device_mode_v2_interface = {
|
||||
"kde_output_device_mode_v2", 1,
|
||||
0, NULL,
|
||||
4, kde_output_device_mode_v2_events,
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,133 @@
|
||||
/* Generated by wayland-scanner 1.22.0 */
|
||||
|
||||
#ifndef KDE_OUTPUT_ORDER_V1_CLIENT_PROTOCOL_H
|
||||
#define KDE_OUTPUT_ORDER_V1_CLIENT_PROTOCOL_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
#include "wayland-client.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @page page_kde_output_order_v1 The kde_output_order_v1 protocol
|
||||
* @section page_ifaces_kde_output_order_v1 Interfaces
|
||||
* - @subpage page_iface_kde_output_order_v1 - announce order of outputs
|
||||
* @section page_copyright_kde_output_order_v1 Copyright
|
||||
* <pre>
|
||||
*
|
||||
* SPDX-FileCopyrightText: 2022 Xaver Hugl <xaver.hugl@gmail.com>
|
||||
*
|
||||
* SPDX-License-Identifier: MIT-CMU
|
||||
* </pre>
|
||||
*/
|
||||
struct kde_output_order_v1;
|
||||
|
||||
#ifndef KDE_OUTPUT_ORDER_V1_INTERFACE
|
||||
#define KDE_OUTPUT_ORDER_V1_INTERFACE
|
||||
/**
|
||||
* @page page_iface_kde_output_order_v1 kde_output_order_v1
|
||||
* @section page_iface_kde_output_order_v1_desc Description
|
||||
*
|
||||
* Announce the order in which desktop environment components should be placed on outputs.
|
||||
* The compositor will send the list of outputs when the global is bound and whenever there is a change.
|
||||
* @section page_iface_kde_output_order_v1_api API
|
||||
* See @ref iface_kde_output_order_v1.
|
||||
*/
|
||||
/**
|
||||
* @defgroup iface_kde_output_order_v1 The kde_output_order_v1 interface
|
||||
*
|
||||
* Announce the order in which desktop environment components should be placed on outputs.
|
||||
* The compositor will send the list of outputs when the global is bound and whenever there is a change.
|
||||
*/
|
||||
extern const struct wl_interface kde_output_order_v1_interface;
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @ingroup iface_kde_output_order_v1
|
||||
* @struct kde_output_order_v1_listener
|
||||
*/
|
||||
struct kde_output_order_v1_listener {
|
||||
/**
|
||||
* output name
|
||||
*
|
||||
* Specifies the output identified by their wl_output.name.
|
||||
* @param output_name the name of the output
|
||||
*/
|
||||
void (*output)(void *data,
|
||||
struct kde_output_order_v1 *kde_output_order_v1,
|
||||
const char *output_name);
|
||||
/**
|
||||
* done
|
||||
*
|
||||
* Specifies that the output list is complete. On the next output
|
||||
* event, a new list begins.
|
||||
*/
|
||||
void (*done)(void *data,
|
||||
struct kde_output_order_v1 *kde_output_order_v1);
|
||||
};
|
||||
|
||||
/**
|
||||
* @ingroup iface_kde_output_order_v1
|
||||
*/
|
||||
static inline int
|
||||
kde_output_order_v1_add_listener(struct kde_output_order_v1 *kde_output_order_v1,
|
||||
const struct kde_output_order_v1_listener *listener, void *data)
|
||||
{
|
||||
return wl_proxy_add_listener((struct wl_proxy *) kde_output_order_v1,
|
||||
(void (**)(void)) listener, data);
|
||||
}
|
||||
|
||||
#define KDE_OUTPUT_ORDER_V1_DESTROY 0
|
||||
|
||||
/**
|
||||
* @ingroup iface_kde_output_order_v1
|
||||
*/
|
||||
#define KDE_OUTPUT_ORDER_V1_OUTPUT_SINCE_VERSION 1
|
||||
/**
|
||||
* @ingroup iface_kde_output_order_v1
|
||||
*/
|
||||
#define KDE_OUTPUT_ORDER_V1_DONE_SINCE_VERSION 1
|
||||
|
||||
/**
|
||||
* @ingroup iface_kde_output_order_v1
|
||||
*/
|
||||
#define KDE_OUTPUT_ORDER_V1_DESTROY_SINCE_VERSION 1
|
||||
|
||||
// /** @ingroup iface_kde_output_order_v1 */
|
||||
// static inline void
|
||||
// kde_output_order_v1_set_user_data(struct kde_output_order_v1 *kde_output_order_v1, void *user_data)
|
||||
// {
|
||||
// wl_proxy_set_user_data((struct wl_proxy *) kde_output_order_v1, user_data);
|
||||
// }
|
||||
|
||||
// /** @ingroup iface_kde_output_order_v1 */
|
||||
// static inline void *
|
||||
// kde_output_order_v1_get_user_data(struct kde_output_order_v1 *kde_output_order_v1)
|
||||
// {
|
||||
// return wl_proxy_get_user_data((struct wl_proxy *) kde_output_order_v1);
|
||||
// }
|
||||
|
||||
// static inline uint32_t
|
||||
// kde_output_order_v1_get_version(struct kde_output_order_v1 *kde_output_order_v1)
|
||||
// {
|
||||
// return wl_proxy_get_version((struct wl_proxy *) kde_output_order_v1);
|
||||
// }
|
||||
|
||||
// /**
|
||||
// * @ingroup iface_kde_output_order_v1
|
||||
// */
|
||||
// static inline void
|
||||
// kde_output_order_v1_destroy(struct kde_output_order_v1 *kde_output_order_v1)
|
||||
// {
|
||||
// wl_proxy_marshal_flags((struct wl_proxy *) kde_output_order_v1,
|
||||
// KDE_OUTPUT_ORDER_V1_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) kde_output_order_v1), WL_MARSHAL_FLAG_DESTROY);
|
||||
// }
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,35 @@
|
||||
#ifdef FF_HAVE_WAYLAND
|
||||
|
||||
/* Generated by wayland-scanner 1.22.0 */
|
||||
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2022 Xaver Hugl <xaver.hugl@gmail.com>
|
||||
*
|
||||
* SPDX-License-Identifier: MIT-CMU
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
#include "wayland-util.h"
|
||||
|
||||
|
||||
static const struct wl_interface *kde_output_order_v1_types[] = {
|
||||
NULL,
|
||||
};
|
||||
|
||||
static const struct wl_message kde_output_order_v1_requests[] = {
|
||||
{ "destroy", "", kde_output_order_v1_types + 0 },
|
||||
};
|
||||
|
||||
static const struct wl_message kde_output_order_v1_events[] = {
|
||||
{ "output", "s", kde_output_order_v1_types + 0 },
|
||||
{ "done", "", kde_output_order_v1_types + 0 },
|
||||
};
|
||||
|
||||
WL_EXPORT const struct wl_interface kde_output_order_v1_interface = {
|
||||
"kde_output_order_v1", 1,
|
||||
1, kde_output_order_v1_requests,
|
||||
2, kde_output_order_v1_events,
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,237 @@
|
||||
#ifdef FF_HAVE_WAYLAND
|
||||
|
||||
#include "wayland.h"
|
||||
#include "kde-output-device-v2-client-protocol.h"
|
||||
#include "kde-output-order-v1-client-protocol.h"
|
||||
#include "util/edidHelper.h"
|
||||
#include "util/base64.h"
|
||||
|
||||
typedef struct WaylandKdeMode
|
||||
{
|
||||
int32_t width;
|
||||
int32_t height;
|
||||
int32_t refreshRate;
|
||||
struct kde_output_device_mode_v2* pMode;
|
||||
} WaylandKdeMode;
|
||||
|
||||
static void waylandKdeSizeListener(void* data, FF_MAYBE_UNUSED struct kde_output_device_mode_v2 *_, int32_t width, int32_t height)
|
||||
{
|
||||
WaylandKdeMode* mode = (WaylandKdeMode*) data;
|
||||
mode->width = width;
|
||||
mode->height = height;
|
||||
}
|
||||
|
||||
static void waylandKdeRefreshListener(void* data, FF_MAYBE_UNUSED struct kde_output_device_mode_v2 *_, int32_t rate)
|
||||
{
|
||||
WaylandKdeMode* mode = (WaylandKdeMode*) data;
|
||||
mode->refreshRate = rate;
|
||||
}
|
||||
|
||||
static const struct kde_output_device_mode_v2_listener modeListener = {
|
||||
.size = waylandKdeSizeListener,
|
||||
.refresh = waylandKdeRefreshListener,
|
||||
.preferred = (void*) stubListener,
|
||||
.removed = (void*) stubListener,
|
||||
};
|
||||
|
||||
static void waylandKdeModeListener(void* data, FF_MAYBE_UNUSED struct kde_output_device_v2* _, struct kde_output_device_mode_v2 *mode)
|
||||
{
|
||||
WaylandDisplay* wldata = (WaylandDisplay*) data;
|
||||
if (!wldata->internal) return;
|
||||
|
||||
WaylandKdeMode* newMode = ffListAdd((FFlist*) wldata->internal);
|
||||
newMode->pMode = mode;
|
||||
|
||||
// Strangely, the listener is called only in this function, but not in `waylandKdeCurrentModeListener`
|
||||
wldata->parent->ffwl_proxy_add_listener((struct wl_proxy *) mode, (void (**)(void)) &modeListener, newMode);
|
||||
}
|
||||
|
||||
static void waylandKdeCurrentModeListener(void* data, FF_MAYBE_UNUSED struct kde_output_device_v2 *_, struct kde_output_device_mode_v2 *mode)
|
||||
{
|
||||
// waylandKdeModeListener is always run before this
|
||||
WaylandDisplay* wldata = (WaylandDisplay*) data;
|
||||
if (!wldata->internal) return;
|
||||
|
||||
WaylandKdeMode* current = NULL;
|
||||
FF_LIST_FOR_EACH(WaylandKdeMode, m, *(FFlist*) wldata->internal)
|
||||
{
|
||||
if (m->pMode == mode)
|
||||
{
|
||||
current = m;
|
||||
break;
|
||||
}
|
||||
}
|
||||
wldata->width = current->width;
|
||||
wldata->height = current->height;
|
||||
wldata->refreshRate = current->refreshRate;
|
||||
}
|
||||
|
||||
static void waylandKdeScaleListener(void* data, FF_MAYBE_UNUSED struct kde_output_device_v2* _, wl_fixed_t scale)
|
||||
{
|
||||
WaylandDisplay* wldata = (WaylandDisplay*) data;
|
||||
wldata->scale = wl_fixed_to_double(scale);
|
||||
}
|
||||
|
||||
static void waylandKdeEdidListener(void* data, FF_MAYBE_UNUSED struct kde_output_device_v2* _, const char* raw)
|
||||
{
|
||||
if (!*raw) return;
|
||||
WaylandDisplay* wldata = (WaylandDisplay*) data;
|
||||
FF_STRBUF_AUTO_DESTROY b64 = ffStrbufCreateStatic(raw);
|
||||
FF_STRBUF_AUTO_DESTROY edid = ffBase64DecodeStrbuf(&b64);
|
||||
if (edid.length < 128) return;
|
||||
ffEdidGetName((const uint8_t*) edid.chars, &wldata->edidName);
|
||||
}
|
||||
|
||||
static void waylandKdeEnabledListener(void* data, FF_MAYBE_UNUSED struct kde_output_device_v2* _, int32_t enabled)
|
||||
{
|
||||
WaylandDisplay* wldata = (WaylandDisplay*) data;
|
||||
if (!enabled) wldata->internal = NULL;
|
||||
}
|
||||
|
||||
static void waylandKdeGeometryListener(void *data,
|
||||
FF_MAYBE_UNUSED struct kde_output_device_v2 *kde_output_device_v2,
|
||||
FF_MAYBE_UNUSED int32_t x,
|
||||
FF_MAYBE_UNUSED int32_t y,
|
||||
int32_t physical_width,
|
||||
int32_t physical_height,
|
||||
FF_MAYBE_UNUSED int32_t subpixel,
|
||||
FF_MAYBE_UNUSED const char *make,
|
||||
FF_MAYBE_UNUSED const char *model,
|
||||
int32_t transform)
|
||||
{
|
||||
WaylandDisplay* display = data;
|
||||
display->physicalWidth = physical_width;
|
||||
display->physicalHeight = physical_height;
|
||||
display->transform = (enum wl_output_transform) transform;
|
||||
}
|
||||
|
||||
static void waylandKdeNameListener(void* data, FF_MAYBE_UNUSED struct kde_output_device_v2* kde_output_device_v2, const char *name)
|
||||
{
|
||||
WaylandDisplay* display = data;
|
||||
display->type = ffdsGetDisplayType(name);
|
||||
strncpy((char*) &display->id, name, sizeof(display->id));
|
||||
ffStrbufAppendS(&display->name, name);
|
||||
}
|
||||
|
||||
static void waylandKdeHdrListener(void *data, FF_MAYBE_UNUSED struct kde_output_device_v2 *kde_output_device_v2, uint32_t hdr_enabled)
|
||||
{
|
||||
WaylandDisplay* display = data;
|
||||
display->hdrEnabled = !!hdr_enabled;
|
||||
}
|
||||
|
||||
static void waylandKdeWcgListener(void *data, FF_MAYBE_UNUSED struct kde_output_device_v2 *kde_output_device_v2, uint32_t wcg_enabled)
|
||||
{
|
||||
WaylandDisplay* display = data;
|
||||
display->wcgEnabled = !!wcg_enabled;
|
||||
}
|
||||
|
||||
static struct kde_output_device_v2_listener outputListener = {
|
||||
.geometry = waylandKdeGeometryListener,
|
||||
.current_mode = waylandKdeCurrentModeListener,
|
||||
.mode = waylandKdeModeListener,
|
||||
.done = (void*) stubListener,
|
||||
.scale = waylandKdeScaleListener,
|
||||
.edid = waylandKdeEdidListener,
|
||||
.enabled = waylandKdeEnabledListener,
|
||||
.uuid = (void*) stubListener,
|
||||
.serial_number = (void*) stubListener,
|
||||
.eisa_id = (void*) stubListener,
|
||||
.capabilities = (void*) stubListener,
|
||||
.overscan = (void*) stubListener,
|
||||
.vrr_policy = (void*) stubListener,
|
||||
.rgb_range = (void*) stubListener,
|
||||
.name = waylandKdeNameListener,
|
||||
.high_dynamic_range = waylandKdeHdrListener,
|
||||
.sdr_brightness = (void*) stubListener,
|
||||
.wide_color_gamut = waylandKdeWcgListener,
|
||||
.auto_rotate_policy = (void*) stubListener,
|
||||
.icc_profile_path = (void*) stubListener,
|
||||
.brightness_metadata = (void*) stubListener,
|
||||
.brightness_overrides = (void*) stubListener,
|
||||
.sdr_gamut_wideness = (void*) stubListener,
|
||||
.color_profile_source = (void*) stubListener,
|
||||
.brightness = (void*) stubListener,
|
||||
};
|
||||
|
||||
void ffWaylandHandleKdeOutput(WaylandData* wldata, struct wl_registry* registry, uint32_t name, uint32_t version)
|
||||
{
|
||||
struct wl_proxy* output = wldata->ffwl_proxy_marshal_constructor_versioned((struct wl_proxy*) registry, WL_REGISTRY_BIND, &kde_output_device_v2_interface, version, name, kde_output_device_v2_interface.name, version, NULL);
|
||||
if(output == NULL)
|
||||
return;
|
||||
|
||||
FF_LIST_AUTO_DESTROY modes = ffListCreate(sizeof(WaylandKdeMode));
|
||||
WaylandDisplay display = {
|
||||
.parent = wldata,
|
||||
.width = 0,
|
||||
.height = 0,
|
||||
.refreshRate = 0,
|
||||
.scale = 1,
|
||||
.transform = WL_OUTPUT_TRANSFORM_NORMAL,
|
||||
.type = FF_DISPLAY_TYPE_UNKNOWN,
|
||||
.name = ffStrbufCreate(),
|
||||
.description = ffStrbufCreate(),
|
||||
.edidName = ffStrbufCreate(),
|
||||
.internal = &modes,
|
||||
};
|
||||
|
||||
wldata->ffwl_proxy_add_listener(output, (void(**)(void)) &outputListener, &display);
|
||||
wldata->ffwl_display_roundtrip(wldata->display);
|
||||
wldata->ffwl_proxy_destroy(output);
|
||||
|
||||
if(display.width <= 0 || display.height <= 0 || !display.internal)
|
||||
return;
|
||||
|
||||
uint32_t rotation = ffWaylandHandleRotation(&display);
|
||||
|
||||
FFDisplayResult* item = ffdsAppendDisplay(wldata->result,
|
||||
(uint32_t) display.width,
|
||||
(uint32_t) display.height,
|
||||
display.refreshRate / 1000.0,
|
||||
(uint32_t) (display.width / display.scale),
|
||||
(uint32_t) (display.height / display.scale),
|
||||
rotation,
|
||||
display.edidName.length
|
||||
? &display.edidName
|
||||
: &display.name,
|
||||
display.type,
|
||||
false,
|
||||
display.id,
|
||||
(uint32_t) display.physicalWidth,
|
||||
(uint32_t) display.physicalHeight
|
||||
);
|
||||
if (item)
|
||||
{
|
||||
item->hdrEnabled = display.hdrEnabled;
|
||||
item->wcgEnabled = display.wcgEnabled;
|
||||
}
|
||||
|
||||
ffStrbufDestroy(&display.description);
|
||||
ffStrbufDestroy(&display.name);
|
||||
ffStrbufDestroy(&display.edidName);
|
||||
}
|
||||
|
||||
|
||||
static void waylandKdeOutputOrderListener(void *data, FF_MAYBE_UNUSED struct kde_output_order_v1 *_, const char *output_name)
|
||||
{
|
||||
uint64_t* id = (uint64_t*) data;
|
||||
if (*id == 0)
|
||||
*id = ffWaylandGenerateIdFromName(output_name);
|
||||
}
|
||||
|
||||
void ffWaylandHandleKdeOutputOrder(WaylandData* wldata, struct wl_registry* registry, uint32_t name, uint32_t version)
|
||||
{
|
||||
struct wl_proxy* output = wldata->ffwl_proxy_marshal_constructor_versioned((struct wl_proxy*) registry, WL_REGISTRY_BIND, &kde_output_order_v1_interface, version, name, kde_output_order_v1_interface.name, version, NULL);
|
||||
if(output == NULL)
|
||||
return;
|
||||
|
||||
struct kde_output_order_v1_listener orderListener = {
|
||||
.output = waylandKdeOutputOrderListener,
|
||||
.done = (void*) stubListener,
|
||||
};
|
||||
|
||||
wldata->ffwl_proxy_add_listener(output, (void(**)(void)) &orderListener, &wldata->primaryDisplayId);
|
||||
wldata->ffwl_display_roundtrip(wldata->display);
|
||||
wldata->ffwl_proxy_destroy(output);
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -9,27 +9,47 @@
|
||||
|
||||
#include <sys/socket.h>
|
||||
|
||||
#include "common/properties.h"
|
||||
|
||||
#include "wayland.h"
|
||||
#include "wlr-output-management-unstable-v1-client-protocol.h"
|
||||
#include "kde-output-device-v2-client-protocol.h"
|
||||
#include "kde-output-order-v1-client-protocol.h"
|
||||
#include "xdg-output-unstable-v1-client-protocol.h"
|
||||
|
||||
#ifndef __FreeBSD__
|
||||
static void waylandDetectWM(int fd, FFDisplayServerResult* result)
|
||||
#ifdef __linux__
|
||||
static bool waylandDetectWM(int fd, FFDisplayServerResult* result)
|
||||
{
|
||||
struct ucred ucred;
|
||||
socklen_t len = sizeof(struct ucred);
|
||||
if (getsockopt(fd, SOL_SOCKET, SO_PEERCRED, &ucred, &len) == -1)
|
||||
return;
|
||||
if (getsockopt(fd, SOL_SOCKET, SO_PEERCRED, &ucred, &len) == -1 || ucred.pid <= 0)
|
||||
return false;
|
||||
|
||||
FF_STRBUF_AUTO_DESTROY procPath = ffStrbufCreate();
|
||||
ffStrbufAppendF(&procPath, "/proc/%d/cmdline", ucred.pid); //We check the cmdline for the process name, because it is not trimmed.
|
||||
ffReadFileBuffer(procPath.chars, &result->wmProcessName);
|
||||
if (!ffReadFileBuffer(procPath.chars, &result->wmProcessName))
|
||||
return false;
|
||||
|
||||
// #1135: wl-restart is a special case
|
||||
const char* filename = strrchr(result->wmProcessName.chars, '/');
|
||||
if (filename)
|
||||
filename++;
|
||||
else
|
||||
filename = result->wmProcessName.chars;
|
||||
|
||||
if (ffStrEquals(filename, "wl-restart"))
|
||||
ffStrbufSubstrAfterFirstC(&result->wmProcessName, '\0');
|
||||
|
||||
ffStrbufSubstrBeforeFirstC(&result->wmProcessName, '\0'); //Trim the arguments
|
||||
ffStrbufSubstrAfterLastC(&result->wmProcessName, '/'); //Trim the path
|
||||
|
||||
return true;
|
||||
}
|
||||
#else
|
||||
static void waylandDetectWM(int fd, FFDisplayServerResult* result)
|
||||
static bool waylandDetectWM(int fd, FFDisplayServerResult* result)
|
||||
{
|
||||
FF_UNUSED(fd, result);
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -47,29 +67,108 @@ static void waylandGlobalAddListener(void* data, struct wl_registry* registry, u
|
||||
wldata->protocolType = FF_WAYLAND_PROTOCOL_TYPE_ZWLR;
|
||||
ffWaylandHandleZwlrOutput(wldata, registry, name, version);
|
||||
}
|
||||
else if((wldata->protocolType == FF_WAYLAND_PROTOCOL_TYPE_NONE || wldata->protocolType == FF_WAYLAND_PROTOCOL_TYPE_KDE) && ffStrEquals(interface, kde_output_device_v2_interface.name))
|
||||
{
|
||||
wldata->protocolType = FF_WAYLAND_PROTOCOL_TYPE_KDE;
|
||||
ffWaylandHandleKdeOutput(wldata, registry, name, version);
|
||||
}
|
||||
else if(ffStrEquals(interface, kde_output_order_v1_interface.name))
|
||||
{
|
||||
ffWaylandHandleKdeOutputOrder(wldata, registry, name, version);
|
||||
}
|
||||
else if((wldata->protocolType == FF_WAYLAND_PROTOCOL_TYPE_GLOBAL || wldata->protocolType == FF_WAYLAND_PROTOCOL_TYPE_NONE) && ffStrEquals(interface, zxdg_output_manager_v1_interface.name))
|
||||
{
|
||||
ffWaylandHandleZxdgOutput(wldata, registry, name, version);
|
||||
}
|
||||
}
|
||||
|
||||
bool detectWayland(FFDisplayServerResult* result)
|
||||
void ffWaylandOutputNameListener(void* data, FF_MAYBE_UNUSED void* output, const char *name)
|
||||
{
|
||||
WaylandDisplay* display = data;
|
||||
if (display->id) return;
|
||||
|
||||
display->type = ffdsGetDisplayType(name);
|
||||
if (!display->edidName.length)
|
||||
ffdsMatchDrmConnector(name, &display->edidName);
|
||||
display->id = ffWaylandGenerateIdFromName(name);
|
||||
ffStrbufAppendS(&display->name, name);
|
||||
}
|
||||
|
||||
void ffWaylandOutputDescriptionListener(void* data, FF_MAYBE_UNUSED void* output, const char* description)
|
||||
{
|
||||
WaylandDisplay* display = data;
|
||||
if (display->description.length) return;
|
||||
|
||||
while (*description == ' ') ++description;
|
||||
if (!ffStrEquals(description, "Unknown Display") && !ffStrContains(description, "(null)"))
|
||||
ffStrbufAppendS(&display->description, description);
|
||||
}
|
||||
|
||||
uint32_t ffWaylandHandleRotation(WaylandDisplay* display)
|
||||
{
|
||||
uint32_t rotation;
|
||||
switch(display->transform)
|
||||
{
|
||||
case WL_OUTPUT_TRANSFORM_FLIPPED_90:
|
||||
case WL_OUTPUT_TRANSFORM_90:
|
||||
rotation = 90;
|
||||
break;
|
||||
case WL_OUTPUT_TRANSFORM_FLIPPED_180:
|
||||
case WL_OUTPUT_TRANSFORM_180:
|
||||
rotation = 180;
|
||||
break;
|
||||
case WL_OUTPUT_TRANSFORM_FLIPPED_270:
|
||||
case WL_OUTPUT_TRANSFORM_270:
|
||||
rotation = 270;
|
||||
break;
|
||||
default:
|
||||
rotation = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
switch(rotation)
|
||||
{
|
||||
case 90:
|
||||
case 270: {
|
||||
int32_t temp = display->width;
|
||||
display->width = display->height;
|
||||
display->height = temp;
|
||||
|
||||
temp = display->physicalWidth;
|
||||
display->physicalWidth = display->physicalHeight;
|
||||
display->physicalHeight = temp;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return rotation;
|
||||
}
|
||||
|
||||
const char* ffdsConnectWayland(FFDisplayServerResult* result)
|
||||
{
|
||||
if (getenv("XDG_RUNTIME_DIR") == NULL)
|
||||
return "Wayland requires $XDG_RUNTIME_DIR being set";
|
||||
|
||||
FF_LIBRARY_LOAD(wayland, &instance.config.library.libWayland, false, "libwayland-client" FF_LIBRARY_EXTENSION, 1)
|
||||
|
||||
FF_LIBRARY_LOAD_SYMBOL(wayland, wl_display_connect, false)
|
||||
FF_LIBRARY_LOAD_SYMBOL(wayland, wl_display_get_fd, false)
|
||||
FF_LIBRARY_LOAD_SYMBOL(wayland, wl_proxy_marshal_constructor, false)
|
||||
FF_LIBRARY_LOAD_SYMBOL(wayland, wl_display_disconnect, false)
|
||||
FF_LIBRARY_LOAD_SYMBOL(wayland, wl_registry_interface, false)
|
||||
FF_LIBRARY_LOAD_SYMBOL_MESSAGE(wayland, wl_display_connect)
|
||||
FF_LIBRARY_LOAD_SYMBOL_MESSAGE(wayland, wl_display_get_fd)
|
||||
FF_LIBRARY_LOAD_SYMBOL_MESSAGE(wayland, wl_proxy_marshal_constructor)
|
||||
FF_LIBRARY_LOAD_SYMBOL_MESSAGE(wayland, wl_display_disconnect)
|
||||
FF_LIBRARY_LOAD_SYMBOL_MESSAGE(wayland, wl_registry_interface)
|
||||
|
||||
WaylandData data = {};
|
||||
|
||||
FF_LIBRARY_LOAD_SYMBOL_VAR(wayland, data, wl_proxy_marshal_constructor_versioned, false)
|
||||
FF_LIBRARY_LOAD_SYMBOL_VAR(wayland, data, wl_proxy_add_listener, false)
|
||||
FF_LIBRARY_LOAD_SYMBOL_VAR(wayland, data, wl_proxy_destroy, false)
|
||||
FF_LIBRARY_LOAD_SYMBOL_VAR(wayland, data, wl_display_roundtrip, false)
|
||||
FF_LIBRARY_LOAD_SYMBOL_VAR(wayland, data, wl_output_interface, false)
|
||||
FF_LIBRARY_LOAD_SYMBOL_VAR_MESSAGE(wayland, data, wl_proxy_marshal_constructor_versioned)
|
||||
FF_LIBRARY_LOAD_SYMBOL_VAR_MESSAGE(wayland, data, wl_proxy_add_listener)
|
||||
FF_LIBRARY_LOAD_SYMBOL_VAR_MESSAGE(wayland, data, wl_proxy_destroy)
|
||||
FF_LIBRARY_LOAD_SYMBOL_VAR_MESSAGE(wayland, data, wl_display_roundtrip)
|
||||
FF_LIBRARY_LOAD_SYMBOL_VAR_MESSAGE(wayland, data, wl_output_interface)
|
||||
|
||||
data.display = ffwl_display_connect(NULL);
|
||||
if(data.display == NULL)
|
||||
return false;
|
||||
return "wl_display_connect returned NULL";
|
||||
|
||||
waylandDetectWM(ffwl_display_get_fd(data.display), result);
|
||||
|
||||
@@ -77,7 +176,7 @@ bool detectWayland(FFDisplayServerResult* result)
|
||||
if(registry == NULL)
|
||||
{
|
||||
ffwl_display_disconnect(data.display);
|
||||
return false;
|
||||
return "wl_display_get_registry returned NULL";
|
||||
}
|
||||
|
||||
data.result = result;
|
||||
@@ -90,59 +189,97 @@ bool detectWayland(FFDisplayServerResult* result)
|
||||
data.ffwl_proxy_add_listener(registry, (void(**)(void)) ®istry_listener, &data);
|
||||
data.ffwl_display_roundtrip(data.display);
|
||||
|
||||
if (data.zxdgOutputManager)
|
||||
data.ffwl_proxy_destroy(data.zxdgOutputManager);
|
||||
|
||||
data.ffwl_proxy_destroy(registry);
|
||||
ffwl_display_disconnect(data.display);
|
||||
|
||||
if(data.primaryDisplayId == 0 && result->wmProcessName.length > 0)
|
||||
{
|
||||
const char* fileName = ffStrbufEqualS(&result->wmProcessName, "gnome-shell")
|
||||
? "monitors.xml"
|
||||
: ffStrbufEqualS(&result->wmProcessName, "cinnamon")
|
||||
? "cinnamon-monitors.xml"
|
||||
: NULL;
|
||||
if (fileName)
|
||||
{
|
||||
FF_STRBUF_AUTO_DESTROY monitorsXml = ffStrbufCreate();
|
||||
FF_LIST_FOR_EACH(FFstrbuf, basePath, instance.state.platform.configDirs)
|
||||
{
|
||||
char path[1024];
|
||||
snprintf(path, sizeof(path) - 1, "%s%s", basePath->chars, fileName);
|
||||
if (ffReadFileBuffer(path, &monitorsXml))
|
||||
break;
|
||||
}
|
||||
if (monitorsXml.length)
|
||||
{
|
||||
// <monitors version="2">
|
||||
// <configuration>
|
||||
// <logicalmonitor>
|
||||
// <x>0</x>
|
||||
// <y>0</y>
|
||||
// <scale>1.7489879131317139</scale>
|
||||
// <primary>yes</primary>
|
||||
// <monitor>
|
||||
// <monitorspec>
|
||||
// <connector>Virtual-1</connector>
|
||||
// <vendor>unknown</vendor>
|
||||
// <product>unknown</product>
|
||||
// <serial>unknown</serial>
|
||||
// </monitorspec>
|
||||
// <mode>
|
||||
// <width>3456</width>
|
||||
// <height>2160</height>
|
||||
// <rate>60.000068664550781</rate>
|
||||
// </mode>
|
||||
// </monitor>
|
||||
// </logicalmonitor>
|
||||
// </configuration>
|
||||
// </monitors>
|
||||
uint32_t start = ffStrbufFirstIndexS(&monitorsXml, "<primary>yes</primary>");
|
||||
if (start < monitorsXml.length)
|
||||
{
|
||||
start = ffStrbufNextIndexS(&monitorsXml, start, "<connector>");
|
||||
if (start < monitorsXml.length)
|
||||
{
|
||||
uint32_t end = ffStrbufNextIndexS(&monitorsXml, start, "</connector>");
|
||||
if (end < monitorsXml.length)
|
||||
{
|
||||
ffStrbufSubstrBefore(&monitorsXml, end);
|
||||
const char* name = monitorsXml.chars + start + strlen("<connector>");
|
||||
data.primaryDisplayId = ffWaylandGenerateIdFromName(name);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(data.primaryDisplayId)
|
||||
{
|
||||
FF_LIST_FOR_EACH(FFDisplayResult, d, data.result->displays)
|
||||
{
|
||||
if(d->id == data.primaryDisplayId)
|
||||
{
|
||||
d->primary = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//We successfully connected to wayland and detected the display.
|
||||
//So we can set set the session type to wayland.
|
||||
//This is used as an indicator that we are running wayland by the x11 backends.
|
||||
ffStrbufSetS(&result->wmProtocolName, FF_WM_PROTOCOL_WAYLAND);
|
||||
return true;
|
||||
ffStrbufSetStatic(&result->wmProtocolName, FF_WM_PROTOCOL_WAYLAND);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void ffWaylandOutputNameListener(void* data, FF_MAYBE_UNUSED void* output, const char *name)
|
||||
#else
|
||||
|
||||
const char* ffdsConnectWayland(FF_MAYBE_UNUSED FFDisplayServerResult* result)
|
||||
{
|
||||
WaylandDisplay* display = data;
|
||||
if(ffStrStartsWith(name, "eDP-"))
|
||||
display->type = FF_DISPLAY_TYPE_BUILTIN;
|
||||
else if(ffStrStartsWith(name, "HDMI-"))
|
||||
display->type = FF_DISPLAY_TYPE_EXTERNAL;
|
||||
ffdsMatchDrmConnector(name, &display->edidName);
|
||||
ffStrbufAppendS(&display->name, name);
|
||||
return "Fastfetch was compiled without Wayland support";
|
||||
}
|
||||
|
||||
void ffWaylandOutputDescriptionListener(void* data, FF_MAYBE_UNUSED void* output, const char* description)
|
||||
{
|
||||
WaylandDisplay* display = data;
|
||||
while (*description == ' ') ++description;
|
||||
if (!ffStrEquals(description, "Unknown Display") && !ffStrContains(description, "(null)"))
|
||||
ffStrbufAppendS(&display->description, description);
|
||||
}
|
||||
#endif
|
||||
|
||||
void ffdsConnectWayland(FFDisplayServerResult* result)
|
||||
{
|
||||
//Wayland requires this to be set
|
||||
if(getenv("XDG_RUNTIME_DIR") == NULL)
|
||||
return;
|
||||
|
||||
#ifdef FF_HAVE_WAYLAND
|
||||
if(detectWayland(result))
|
||||
return;
|
||||
#endif
|
||||
|
||||
const char* xdgSessionType = getenv("XDG_SESSION_TYPE");
|
||||
|
||||
//If XDG_SESSION_TYPE is set, and doesn't contain "wayland", we are probably not running in a wayland session.
|
||||
if(xdgSessionType != NULL && !ffStrEqualsIgnCase(xdgSessionType, "wayland"))
|
||||
return;
|
||||
|
||||
//If XDG_SESSION_TYPE is not set, check if WAYLAND_DISPLAY or WAYLAND_SOCKET is set.
|
||||
//If not, there is no indicator for a wayland session
|
||||
if(xdgSessionType == NULL && getenv("WAYLAND_DISPLAY") == NULL && getenv("WAYLAND_SOCKET") == NULL)
|
||||
return;
|
||||
|
||||
//We are probably running a wayland compositor at this point,
|
||||
//but fastfetch was compiled without the required library, or loading the library failed.
|
||||
ffStrbufSetS(&result->wmProtocolName, FF_WM_PROTOCOL_WAYLAND);
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@ typedef enum WaylandProtocolType
|
||||
FF_WAYLAND_PROTOCOL_TYPE_NONE,
|
||||
FF_WAYLAND_PROTOCOL_TYPE_GLOBAL,
|
||||
FF_WAYLAND_PROTOCOL_TYPE_ZWLR,
|
||||
FF_WAYLAND_PROTOCOL_TYPE_KDE,
|
||||
} WaylandProtocolType;
|
||||
|
||||
typedef struct WaylandData
|
||||
@@ -26,6 +27,8 @@ typedef struct WaylandData
|
||||
struct wl_display* display;
|
||||
const struct wl_interface* ffwl_output_interface;
|
||||
WaylandProtocolType protocolType;
|
||||
uint64_t primaryDisplayId;
|
||||
struct wl_proxy* zxdgOutputManager;
|
||||
} WaylandData;
|
||||
|
||||
typedef struct WaylandDisplay
|
||||
@@ -33,6 +36,8 @@ typedef struct WaylandDisplay
|
||||
WaylandData* parent;
|
||||
int32_t width;
|
||||
int32_t height;
|
||||
int32_t physicalWidth;
|
||||
int32_t physicalHeight;
|
||||
int32_t refreshRate;
|
||||
double scale;
|
||||
enum wl_output_transform transform;
|
||||
@@ -40,6 +45,9 @@ typedef struct WaylandDisplay
|
||||
FFstrbuf name;
|
||||
FFstrbuf description;
|
||||
FFstrbuf edidName;
|
||||
uint64_t id;
|
||||
bool hdrEnabled;
|
||||
bool wcgEnabled;
|
||||
void* internal;
|
||||
} WaylandDisplay;
|
||||
|
||||
@@ -48,10 +56,26 @@ inline static void stubListener(void* data, ...)
|
||||
(void) data;
|
||||
}
|
||||
|
||||
inline static uint64_t ffWaylandGenerateIdFromName(const char* name)
|
||||
{
|
||||
uint64_t id = 0;
|
||||
size_t len = strlen(name);
|
||||
if (len > sizeof(id))
|
||||
memcpy(&id, name + (len - sizeof(id)), sizeof(id)); // copy the last 8 bytes
|
||||
else if (len > 0)
|
||||
memcpy(&id, name, len);
|
||||
return id;
|
||||
}
|
||||
|
||||
void ffWaylandOutputNameListener(void* data, FF_MAYBE_UNUSED void* output, const char *name);
|
||||
void ffWaylandOutputDescriptionListener(void* data, FF_MAYBE_UNUSED void* output, const char* description);
|
||||
// Modifies content of display. Don't call this function when calling ffdsAppendDisplay
|
||||
uint32_t ffWaylandHandleRotation(WaylandDisplay* display);
|
||||
|
||||
void ffWaylandHandleGlobalOutput(WaylandData* wldata, struct wl_registry* registry, uint32_t name, uint32_t version);
|
||||
void ffWaylandHandleZwlrOutput(WaylandData* wldata, struct wl_registry* registry, uint32_t name, uint32_t version);
|
||||
void ffWaylandHandleKdeOutput(WaylandData* wldata, struct wl_registry* registry, uint32_t name, uint32_t version);
|
||||
void ffWaylandHandleKdeOutputOrder(WaylandData* wldata, struct wl_registry* registry, uint32_t name, uint32_t version);
|
||||
void ffWaylandHandleZxdgOutput(WaylandData* wldata, struct wl_registry* registry, uint32_t name, uint32_t version);
|
||||
|
||||
#endif
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user