Compare commits

..

271 Commits

Author SHA1 Message Date
Carter Li c0774b89d6 Merge pull request #1184 from fastfetch-cli/dev
Release: v2.21.2
2024-08-14 10:55:42 +08:00
李通洲 030f34d405 Doc: fix changelog [ci skip] 2024-08-14 10:44:40 +08:00
李通洲 cedc93fe7b CI: try fixing FreeBSD 2024-08-14 10:25:59 +08:00
李通洲 e155767289 Logo (Builtin): add GoldenDog Linux
Fix #1183
2024-08-14 10:14:33 +08:00
李通洲 4e41223b81 Colors (Linux): only apply work around in Linux Console 2024-08-14 10:03:12 +08:00
李通洲 2ee4d7daac Release v2.21.2 2024-08-14 09:28:46 +08:00
李通洲 a6a0a03b44 Doc: update changelog 2024-08-14 09:19:27 +08:00
李通洲 4b3241a286 CMake: try fixing detection of pthread_timedjoin_np 2024-08-14 09:02:18 +08:00
李通洲 d37bf7252d Logo (Builtin): trim final new line 2024-08-14 08:45:02 +08:00
李通洲 dd66626165 Display: remove detection of WCG enabled 2024-08-14 08:32:13 +08:00
李通洲 fe7e684e85 GPU (Windows): fix missing GPUs sometimes 2024-08-13 19:25:25 +08:00
李通洲 2281caaff8 Fastfetch: fix bug that stat info is unexpectly printed 2024-08-13 15:28:17 +08:00
李通洲 96c838d3f3 GPU (Windows): code refactor 2024-08-13 14:51:41 +08:00
李通洲 c6e1677369 BootMgr (Windows): ControlSet001 -> CurrentControlSet 2024-08-13 14:46:24 +08:00
李通洲 ea18d93a40 Display / Monitor (macOS): code refactor 2024-08-13 08:41:32 +08:00
李通洲 f6e1e5c96b Fastfetch: support --stat <num> 2024-08-13 08:41:32 +08:00
Carter Li 0b85fc74eb Fastfetch: increase precision of --stat 2024-08-13 08:41:32 +08:00
李通洲 946eb0eacd GPU (Windows): don't skip GPU silently
Ref: #1181
2024-08-13 06:32:38 +08:00
Princess-Sunset-Shimmer a11ec589f0 Logo (Builtin): HyprOS logo (#1180)
* Update builtin.c

* Create hypros.txt
2024-08-12 19:58:09 +08:00
Carter Li a89955b080 Logo (Image): try support tmux (doesn't work yet) 2024-08-12 10:29:31 +08:00
Carter Li df4350666a CPU (Linux): embed the arm part codes of lscpu
Fix #1175
2024-08-12 10:25:54 +08:00
Carter Li 55b1603b83 GPU (BSD): fix build 2024-08-10 23:31:29 +08:00
Carter Li fb1c727641 GPU (Linux): ensure we correctly get the marketing name 2024-08-10 21:59:03 +08:00
李通洲 87d964c7ca GPU (Linux): fix uninited struct fields 2024-08-10 21:08:35 +08:00
李通洲 bdb0a9262c GPU (Linux): fix intel GPU type detection
Ref: #1177
2024-08-10 21:03:56 +08:00
Carter Li e42dfe63c3 GPU (Linux): fix bad Intel Arc GPU name
Fix #1177
2024-08-10 12:13:21 +08:00
Carter Li e8932895e8 CMake (Linux): complain about pthread_timedjoin_np is not found 2024-08-10 07:41:31 +08:00
Carter Li 4091d33c56 Packaging: update debian stuff [ci skip] 2024-08-09 14:28:55 +08:00
Carter Li 5df2a751ea Merge pull request #1173 from fastfetch-cli/dev
Release v2.21.1
2024-08-09 10:49:50 +08:00
李通洲 65b9f0005b TerminalFont (Linux): when detecting st, report an error if fails to load libelf 2024-08-09 10:11:38 +08:00
李通洲 a3e4b4fe22 Release v2.21.1 2024-08-09 09:54:49 +08:00
李通洲 0749704400 Version: report git commit hash 2024-08-09 09:54:49 +08:00
李通洲 9977cb688d Presets: set timeout to publicip
Fix #1170
2024-08-09 08:47:48 +08:00
李通洲 8c26e776c2 InitSystem (Android): don't break build 2024-08-09 08:40:41 +08:00
李通洲 e174eddef1 GPU (Linux): always try directx 2024-08-08 18:53:56 +08:00
李通洲 f866c90687 GPU: defaults to --gpu-detection-method pci on x86 to detect disabled gpus 2024-08-08 16:23:58 +08:00
李通洲 a61a956b84 CI (Linux): fix libelf dep installation on musl 2024-08-08 16:09:48 +08:00
李通洲 ef73c4a97d CI: build with libelf 2024-08-08 15:49:51 +08:00
Carter Li 79c02ebf7c CI: fix build on FreeBSD & SunOS 2024-08-08 15:36:17 +08:00
李通洲 1394a0ae2e InitSystem (macOS): fix compiling 2024-08-08 15:23:40 +08:00
Carter Li e8ebae7ee9 TerminalFont (Linux): improve performance of st terminal font detection 2024-08-08 15:09:37 +08:00
Carter Li 3fae29ba8f InitSystem (Linux): add fast path for systemd version detection 2024-08-08 15:09:37 +08:00
Carter Li a9373fb4e4 Util (Linux): add elf helper 2024-08-08 15:09:37 +08:00
Carter Li 2e2cf64452 Terminal (Linux): add kitty version detection fast path back 2024-08-08 14:58:56 +08:00
Carter Li 7c3835bd9f DBus: increase dbus timeout 2024-08-08 09:01:41 +08:00
Princess-Sunset-Shimmer 945fd3a402 Logo (Builtin): add vanilla OS 2 logo (#1168)
* Create vanilla_small.txt

* Update builtin.c

for new vanilla small logo

* Update builtin.c

* Create 23.jsonc

* Update 23.jsonc

* Update builtin.c

* Create vanilla2.txt

new byte bloat is comming

* Update builtin.c

* Update builtin.c

---------

Co-authored-by: Carter Li <CarterLi@users.noreply.github.com>
2024-08-07 19:34:05 +08:00
AlbydS 53d2dbd420 Logo (Builtin): Add support for Linux From Scratch (#1165)
* Add Linux From Scratch logo

Added ASCII logo for Linux From Scratch

* Add Linux From Scratch to builtin.c

I added Linux From Scratch support to builtin.c

* Update builtin.c

---------

Co-authored-by: Carter Li <CarterLi@users.noreply.github.com>
2024-08-07 14:46:24 +08:00
李通洲 eaa4721b36 Chore: update editorconfig [ci skip] 2024-08-07 10:59:14 +08:00
TheCourierNV f695ae9116 Locale (Linux): Add LC_ALL check (#1166)
`LC_ALL`, if set, overrides every other locale-related environment
variable.
2024-08-07 10:53:57 +08:00
Princess-Sunset-Shimmer b0270f36f9 Logo (Builtin): add new small vanilla logo (#1167)
* Create vanilla_small.txt

* Update builtin.c

for new vanilla small logo

* Update builtin.c

* Create 23.jsonc

* Update 23.jsonc

* Update builtin.c

---------

Co-authored-by: Carter Li <CarterLi@users.noreply.github.com>
2024-08-07 10:49:44 +08:00
Carter Li fe5b07e0d0 Colors (Linux): fix light color doesn't work on Linux tty
Ref: https://github.com/fastfetch-cli/fastfetch/issues/1141#issuecomment-2271060911
2024-08-07 10:15:01 +08:00
Carter Li 8396f000e1 DisplayServer (Linux): don't rely on $XDG_SESSION_TYPE for detecting wm protocol
Fix #1162
2024-08-06 16:34:01 +08:00
Carter Li 1361e8cd18 GPU (Linux): fix wrong GPU max frequency on asahi 2024-08-06 10:14:39 +08:00
李通洲 b3ac696312 Wifi (Linux): fix building error without linux/wireless.h
Fix #1160
2024-08-05 22:01:40 +08:00
Linus Dierheimer 2205712bc0 Update FUNDING.yml [ci skip]
So he is shown on the front page
2024-08-05 10:52:40 +02:00
Carter Li f1741c66bf Packaging: update debian stuff [ci skip] 2024-08-05 14:36:44 +08:00
Carter Li 3247aabd74 Merge pull request #1151 from fastfetch-cli/dev
Release v2.21.0
2024-08-05 14:21:00 +08:00
李通洲 312d4cc518 Monitor: improve refreshRate formatting 2024-08-05 13:49:41 +08:00
Carter Li b24877af0b CMake: Release v2.21.0 2024-08-05 10:53:28 +08:00
李通洲 1de97fa3ed Doc: update changelog for v2.21.0 2024-08-05 10:09:40 +08:00
李通洲 6ca65b9166 GPU (BSD): improve type detection for Intel integrated GPUs 2024-08-05 10:07:17 +08:00
李通洲 b2cc5c4f04 CMake: clarify BSD is FreeBSD
Fix #1154
2024-08-05 08:54:25 +08:00
keklick1337 f683351fe3 Logo (Builtin): QTS logo (#1152) 2024-08-04 21:50:49 +08:00
Leah Amelia Chen d81cd50f64 Shell (Linux): don't detect hyfetch as shell on NixOS (#1149)
On NixOS, Hyfetch has been placed in a "wrapper script" in order to set the correct PATH that it needs to run correctly.
As a result, the actual Hyfetch executable has been renamed `.hyfetch-wrapped`, which results in this check failing to detect Hyfetch on NixOS properly.

With this patch the logic has been changed to check if the program name contains the string `hyfetch`, which should work for the NixOS case.
2024-08-04 20:13:28 +08:00
Sergey Fedorov 1101d2e90e Disk (BSD): minor fix for a type, fixes calculation of disk usage on 32-bit (#1150) 2024-08-04 20:08:21 +08:00
李通洲 8284d73cc9 Doc (Logo): metion size requirement [ci skip] 2024-08-04 14:12:32 +08:00
Carter Li 6b0db6fa74 Wifi (Linux): fix compiling without dbus 2024-08-03 22:16:07 +08:00
Carter Li 3a61b31e0a Wifi (Linux): implement libnm stuff with plain dbus calls 2024-08-03 22:06:37 +08:00
Carter Li 493cf8ff6c Media (Linux): detect playing status; update dbus api change 2024-08-03 22:05:29 +08:00
Carter Li e6cf7fdb9f Bluetooth (Linux): update for DBus api changes 2024-08-03 22:04:53 +08:00
Carter Li 831d2a05ce DBus: code cleanup; prepare for future commits 2024-08-03 22:03:34 +08:00
Carter Li d0b72c5457 Shell (Linux): remove version detection for unknown shells
It's a dangerous operation. Should fix #1144
2024-08-03 08:18:43 +08:00
Carter Li 0c82a84266 Global: remove using of libnm 2024-08-03 07:50:15 +08:00
李通洲 d501c8b41a GPU (Windows): fix missing vendor string 2024-08-02 22:23:29 +08:00
李通洲 0354fd5d9d GPU (Windows): use setupapi to find GPU devices
Ref: https://github.com/gpustack/gpustack/pull/97#issuecomment-2264678404
2024-08-02 21:52:24 +08:00
李通洲 a856350416 GPU (MT): fix segfault at program exit 2024-08-02 19:04:53 +08:00
Carter Li 4efe12c0d2 GPU (BSD): correctly detect GPU type 2024-08-02 16:47:57 +08:00
Carter Li 1a66bc4ec0 GPU: code cleanup; port MT specific code to Windows 2024-08-02 16:29:23 +08:00
R0CKSTAR d96d794d1f GPU (Linux): Support Moore Threads GPU (#1142)
* feat: Support Moore Threads GPU

Signed-off-by: Xiaodong Ye <yeahdongcn@gmail.com>

* Fix spell check

Signed-off-by: Xiaodong Ye <yeahdongcn@gmail.com>

* Fix frequency and add back util

Signed-off-by: Xiaodong Ye <yeahdongcn@gmail.com>

* Add name field

Signed-off-by: Xiaodong Ye <yeahdongcn@gmail.com>

---------

Signed-off-by: Xiaodong Ye <yeahdongcn@gmail.com>
2024-08-02 16:00:54 +08:00
Carter Li 45659854d2 GPU (Linux): don't ignore disabled GPU
Should fix #1140
2024-08-02 15:24:29 +08:00
Carter Li b111626fe9 GPU (Linux): use the device name that driver provides 2024-08-02 15:21:54 +08:00
Carter Li dccbdba242 Wifi (Linux): remove libnm dependency 2024-08-02 15:10:04 +08:00
Carter Li 884fd097c6 GPU (Linux): fix compiling (2) 2024-08-02 14:13:33 +08:00
Carter Li 08dea9fe21 GPU (Linux): fix compiling
oops...
2024-08-02 14:10:07 +08:00
Carter Li 98fc793386 GPU (Linux): embed part of asahi_drm.h code 2024-08-02 14:07:04 +08:00
Carter Li 121e9b911e GPU (Windows): fix bug that assuming pci bus id > 0 2024-08-02 13:48:02 +08:00
李通洲 b9fe2fb4dd Logo (Builtin): update endeavour_small 2024-08-02 10:18:01 +08:00
李通洲 812a13c871 Display (macOS): fix invalid refresh rate in old mac 2024-08-01 16:41:02 +08:00
李通洲 dcbfae7f72 Wifi (macOS): use private property to fetch ssid 2024-08-01 16:04:37 +08:00
李通洲 65883766a0 Display (macOS): don't parse string 2024-08-01 16:02:41 +08:00
李通洲 104cb43158 Wifi: rename macAddress to bssid 2024-08-01 15:45:53 +08:00
李通洲 114cc753d9 Option: print error when finding invalid color code
Fix #1138
2024-08-01 14:19:24 +08:00
李通洲 d68c4cef13 GPU (WSL): fix building 2024-08-01 14:10:07 +08:00
李通洲 c549a5cab8 GPU (macOS): report core usage 2024-08-01 13:54:03 +08:00
李通洲 cbf8fdf3fc GPU (macOS): ensure we only detects GPU
May fix #1066
2024-08-01 08:54:12 +08:00
Carter Li 1e8b9aa461 GPU (Linux): detect if nvidia driver is open source or proprietary 2024-08-01 00:06:22 +08:00
李通洲 5d32eba1a6 GPU (Nvidia): detect GPU core usage 2024-07-31 23:42:02 +08:00
李通洲 2ce7c8c60d GPU (Windows): use pci bus id to match Nvidia cards
Fix multi-gpu device
2024-07-31 22:23:30 +08:00
Carter Li 7eaaed6024 WM (Linux): don't use wl-restart as WM name
Fix #1135
2024-07-31 14:19:42 +08:00
Carter Li bd5012edc8 PhysicalMemory: make sure to detect all memory devices 2024-07-31 11:13:04 +08:00
Carter Li cf0d1cf294 DisplayServer (Linux): don't print unknown as display name 2024-07-31 10:13:29 +08:00
Carter Li a070519721 IO: disallow input echo 2024-07-31 09:40:00 +08:00
Carter Li fa0007ac6f CPU (Android): add SD 4s Gen 2 2024-07-31 08:58:03 +08:00
Carter Li ced67e81a5 DisplayServer (Linux): ensure $XDG_RUNTIME_DIR is set before connecting
wayland
2024-07-30 23:50:19 +08:00
Carter Li 88a7468489 GPU (Linux): fix apple gpu support 2024-07-30 16:43:56 +08:00
李通洲 ec8391f6c6 Global: don't use __has_include
It reports false results in ubuntu 20.04. Details unknown.
2024-07-30 11:06:42 +08:00
李通洲 4371e719ae CI (Linux): build aarch64 version with ubuntu 20.04 2024-07-29 21:47:32 +08:00
李通洲 bbbb493cdf BluetoothRadio (Windows): fix segfault 2024-07-29 18:55:43 +08:00
Carter Li 6cb565e379 BluetoothRadio: don't print unnecessary index 2024-07-29 18:42:24 +08:00
李通洲 2bb988a7f8 CPU: fix freq max formatting 2024-07-29 16:44:54 +08:00
李通洲 0929b940c8 BluetoothRadio (macOS): detect more info 2024-07-29 16:32:36 +08:00
Carter Li c14ba32b82 BluetoothRadio: add more props; remove hciVersion; code cleanup 2024-07-28 15:59:32 +08:00
李通洲 7a75615d9e BluetoothRadio (macOS): add dirty support 2024-07-28 13:06:29 +08:00
Carter Li 96c58148f6 BluetoothRadio (Linux): add support 2024-07-28 10:57:46 +08:00
Carter Li 2c7cd6df98 Bluetooth (Linux): more strict checks 2024-07-28 10:54:49 +08:00
Carter Li db1fbe0a30 DBus: rename ffDBusGetValue to ffDBusGetString; add ffDBusGetUint16 2024-07-28 10:54:26 +08:00
李通洲 a102f0505c CI: silence spell checks 2024-07-28 00:16:30 +08:00
李通洲 8a3af14d22 BluetoothRadio (Windows): new module 2024-07-28 00:12:29 +08:00
李通洲 ce648e9e44 Bluetooth (Windows): tidy; update module description 2024-07-28 00:04:25 +08:00
李通洲 2cc94ee095 DisplayServer (Linux): fix build with no wayland support 2024-07-27 19:53:25 +08:00
李通洲 16dd9fb213 Terminal (Windows): fix build 2024-07-27 18:52:17 +08:00
Carter Li 873285b083 TerminalShell: improve SSH detection 2024-07-26 23:53:46 +08:00
李通洲 ce43f06863 DisplayServer (Linux): don't try to connect wayland and X11 in tty mode
Fix #1110
2024-07-26 23:53:18 +08:00
李通洲 3c92e7013d Doc: fix changelog [ci skip] 2024-07-26 13:47:10 +08:00
Carter Li 8e5017aa3a Merge pull request #1123 from fastfetch-cli/dev
Release: v2.20.0
2024-07-26 10:27:31 +08:00
李通洲 dc89336fc1 Release: v2.20.0 2024-07-26 09:51:51 +08:00
李通洲 952152edf0 Global (macOS): always check NULL after IORegistryEntryCreateCFProperty 2024-07-26 08:46:34 +08:00
李通洲 6862747c48 GPU (macOS): fix possible segfault when detecting GPU frequency (M1 Air)
Fix #1122
2024-07-26 08:46:34 +08:00
李通洲 f91be6442d Android (Linux): detect MTK CPU part name 2024-07-26 08:46:34 +08:00
Carter Li bdce8ea3a1 Logo (Image): fix paddingTop doesn't work with position: right 2024-07-25 21:41:15 +08:00
Carter Li 44c8fa0470 Logo (Image): fix padding* not working correctly
Fix #1121
2024-07-25 21:27:53 +08:00
李通洲 9f9a5ba39a Android (Linux): report Snapdragon SOC marketing name 2024-07-25 10:33:06 +08:00
李通洲 7c37d719e5 Doc: update help message 2024-07-24 16:41:22 +08:00
李通洲 cc78d6b16c Presets: update some presets 2024-07-24 16:37:35 +08:00
李通洲 e7b7645f08 Presets: remove meaningless presets 2024-07-24 16:25:33 +08:00
李通洲 6a17ef6a54 Presets: update examples 2024-07-24 16:25:16 +08:00
李通洲 5b687727c0 Global: update icon 2024-07-24 15:46:41 +08:00
李通洲 9b038dc848 Global: fix JSON option modules.keyIcon doesn't work 2024-07-24 15:38:54 +08:00
李通洲 597dd32caf Presets: simplify examples/2.jsonc with builtin icon feature 2024-07-24 15:32:20 +08:00
李通洲 8d08a65611 Sound: update icon 2024-07-24 15:31:37 +08:00
李通洲 263c54a81e Global: add option display.key.paddingLeft
Also rename `display.keyWidth` to `display.key.width`
2024-07-24 15:12:25 +08:00
李通洲 cba5560068 LM: change icon 2024-07-24 14:36:13 +08:00
李通洲 0703b2b88f NetIO: don't use the same icon as DiskIO 2024-07-24 14:34:50 +08:00
李通洲 86e5572a7e Custom: fix using icon as key 2024-07-24 14:32:03 +08:00
李通洲 3b3c1a9f63 Global: support display predefined icon in custom key format 2024-07-24 14:27:46 +08:00
李通洲 14b9e88a82 Editor: fix printing editor type 2024-07-24 14:17:47 +08:00
李通洲 bee7c62000 Global: add option --<module>-key-icon 2024-07-24 14:05:46 +08:00
李通洲 8fa4d7ae6e Fastfetch: add option --key-type <enum> 2024-07-24 11:13:37 +08:00
李通洲 640d0666fc Logo (Image): don't require logo height when using position right
Fix #1119
2024-07-24 09:59:23 +08:00
李通洲 165b0b0a69 TerminalFont (Linux): remove Windows Terminal support for WSL
Fix #1113
2024-07-24 09:33:17 +08:00
李通洲 dc216362d5 TerminalFont (Linux): detect system mono font 2024-07-24 09:21:16 +08:00
李通洲 57ffe3bad2 Fastfetch: add icons 2024-07-23 23:02:35 +08:00
Carter Li cdee6e2997 Display (Linux): don't wake up suspended GPU 2024-07-23 19:06:04 +08:00
Carter Li fb03c95d68 LM (Linux): improve ssh version detection code 2024-07-23 18:38:07 +08:00
Carter Li 5b76a0b45a Packaging: update debian stuff [ci skip] 2024-07-23 10:27:33 +08:00
Carter Li fa5a74c746 Merge pull request #1115 from fastfetch-cli/dev
Release: v2.19.1
2024-07-23 10:10:49 +08:00
李通洲 4c6e14bcc2 Release: v2.19.1 2024-07-23 09:56:17 +08:00
李通洲 deacecdc11 Fastfetch: print error when invalid freq option is found 2024-07-23 09:55:48 +08:00
李通洲 83dcdaa726 GPU: fix frequency printing when using custom formation 2024-07-23 09:50:51 +08:00
李通洲 2c29465f69 Doc: update README [ci skip] 2024-07-23 09:39:22 +08:00
李通洲 f3e48a00a0 Display (Android): fix MiUI
560 is density dpi, not physical dpi
2024-07-23 09:27:07 +08:00
李通洲 9559db556d Display: print [HDR] if enabled 2024-07-23 09:27:07 +08:00
Carter Li b89eeaa954 CPU: fix double frequency value when using custom formation
Fix #1111
2024-07-22 22:14:43 +08:00
Carter Li 7c15d0ce88 Merge pull request #1105 from fastfetch-cli/dev
Release: v2.19.0
2024-07-22 13:46:40 +08:00
李通洲 036d407708 Doc: update README [ci skip] 2024-07-22 13:44:29 +08:00
李通洲 52715a0ec5 Fastfetch: rename binaryPrefixType to sizeBinaryPrefix 2024-07-22 10:59:23 +08:00
李通洲 4a6209e0e3 JsonConfig: rename display.binaryPrefix to display.size.binaryPrefix 2024-07-22 10:54:24 +08:00
李通洲 93bdaf10c4 Release: v2.19.0 2024-07-22 10:17:23 +08:00
李通洲 4a75123eb1 Host (macOS): tidy 2024-07-22 09:23:06 +08:00
李通洲 7f2ab7310a Terminal: fix possible buffer overflow 2024-07-22 09:22:01 +08:00
Carter Li 3c9d9b3c67 Brightness (Linux): use brightness instead of actual_brightness
`actual_brightness` are above `max_brightness` on asahi. See also https://bugzilla.kernel.org/show_bug.cgi?id=203905
2024-07-21 12:44:31 +08:00
李通洲 7a1b214ffe Monitor (Windows): if current refresh rate is higher than preferred refresh rate, use it.
No better methods. I have tried EnumDisplaySettings and winrt DisplayPath::GetModes but none of them work.
2024-07-20 23:29:40 +08:00
李通洲 4fe1bb0b7e Display: detect if WCG enabled 2024-07-20 11:52:07 +08:00
李通洲 2f26045d30 Common: fix compiler warnings 2024-07-19 23:57:44 +08:00
李通洲 40e67a1d93 Doc: fix typo [ci skip] 2024-07-19 23:56:18 +08:00
李通洲 d7018c2fd3 DateTime: try fixing 32bit linux
Fix #1108
2024-07-19 22:53:10 +08:00
XhmikosR 9e1ba0d104 Doc: README.md: link to issue (#1107) [ci skip] 2024-07-19 22:22:36 +08:00
Carter Li 9f23ce93bd Doc: update changelog [ci skip] 2024-07-19 16:42:15 +08:00
李通洲 f89cbf6bc8 Monitor: enable module on FreeBSD and SunOS
Fix #1101
2024-07-19 16:04:46 +08:00
李通洲 e12c6e6fd7 Colors: fix bug with --pipe enabled 2024-07-19 15:02:17 +08:00
Carter Li 7ba1e3d3d9 Monitor (Linux): detect by Xrandr if EDID is not available 2024-07-19 05:43:15 +00:00
李通洲 672bf0ef54 Display: update JSON output structure 2024-07-18 22:51:46 +08:00
Carter Li 96ec2b662c Display (Linux): support HDR detection for KDE; fix build 2024-07-18 18:51:33 +08:00
李通洲 c3de293450 Display: print more information 2024-07-18 16:43:19 +08:00
李通洲 f11b07ba8a DisplayServer (macOS): detect bit depth 2024-07-18 16:41:57 +08:00
李通洲 4e84153e9d Display (Windows): check for hdr enabled & bit depth 2024-07-18 16:40:45 +08:00
李通洲 121cbde661 Monitor (Windows): detect maximum refresh rate 2024-07-18 15:10:15 +08:00
李通洲 0d71ae7f97 Monitor (macOS): detect maximum refresh rate 2024-07-18 13:52:12 +08:00
mhkdepauw 2a49f1d0eb Doc: Small typo corrected in man page (#1102) 2024-07-17 22:55:31 +08:00
李通洲 6b7403281b JsonSchema: fix typo [ci skip] 2024-07-17 16:01:12 +08:00
李通洲 63a0faa1d9 GPU (macOS): support GPU frequency detection for Apple Silicon
Also refactor CPU freq detection code
2024-07-17 15:51:15 +08:00
李通洲 408a2d731a GPU: support printing frequency in MHz 2024-07-17 15:49:12 +08:00
李通洲 46abc4f5f7 CPU: move option freqNdigits into display section 2024-07-17 15:49:12 +08:00
李通洲 7393bcdf05 CI: disable --stat which messes output 2024-07-17 14:11:52 +08:00
李通洲 d282050130 CPU: support display frequency in MHz 2024-07-17 14:09:06 +08:00
Carter Li c0de618177 CPU: remove support of min freq detection 2024-07-17 10:19:12 +08:00
Carter Li d1609ea96b Separator: add option --separator-length 2024-07-17 09:16:35 +08:00
李通洲 d869164d6b Display: show inches instead of full size
Which is shorter
2024-07-16 22:10:05 +08:00
李通洲 3b361c663d Logo (Builtin): add ALT Linux 2024-07-16 21:56:37 +08:00
Carter Li 5bc9a5dc4e Display: rotate physical demensions 2024-07-16 16:36:19 +08:00
李通洲 c0781dd5f8 Display: print physical size 2024-07-16 16:11:26 +08:00
李通洲 c795c20723 FFstrbuf: improve ffStrbufSubstr* 2024-07-16 15:39:06 +08:00
李通洲 0776dac95b TerminalFont: improve wezterm detection 2024-07-16 15:06:25 +08:00
李通洲 3433043604 Terminal: support zed version detection 2024-07-16 14:53:14 +08:00
李通洲 bd0b108c04 Colors: don't disable color if --color-symbol background is set in --pipe mode 2024-07-16 14:32:51 +08:00
李通洲 2a9f9d5a34 Colors: add and default to --colors-symbol background 2024-07-16 11:07:26 +08:00
李通洲 4f3649e96e Doc: update README [ci skip] 2024-07-16 10:03:01 +08:00
Carter Li e4f0efd58c Logo (Builtin): update void logo 2024-07-16 09:13:44 +08:00
李通洲 25577a6e58 Disk (Android): ignore /apex/* 2024-07-15 22:56:14 +08:00
Carter Li 801bd7c879 GPU: fix --gpu-hide-type doesn't work
Fix #1098
2024-07-15 18:34:43 +08:00
李通洲 89ce598800 Revert "TerminalFont (Linux): improve detection for xterm"
Committed by accident

This reverts commit 64c53e2cdc.
2024-07-15 16:19:39 +08:00
李通洲 9268d8449e IO (Windows): remove debug output
Fix #1097
2024-07-15 16:01:19 +08:00
李通洲 179341c30c Presets: clean up examples 2024-07-15 14:01:35 +08:00
李通洲 1947aa2b0e Formating: support specifying costant strings 2024-07-15 13:35:59 +08:00
李通洲 64c53e2cdc TerminalFont (Linux): improve detection for xterm
Fix #1095
2024-07-15 10:24:32 +08:00
李通洲 7eaefe163a TerminalFont (Linux): improve detection for xterm
Fix #1095
2024-07-15 10:21:30 +08:00
Carter Li beabaa90f1 InitSystem (Android): fix detection 2024-07-12 20:24:59 +08:00
Carter Li 2f42d64dc9 GPU (Linux): support intel xe driver 2024-07-12 19:24:55 +08:00
Carter Li 7d452cc460 Presets: fix examples/19.jsonc
Fix #1090
2024-07-12 18:47:00 +08:00
Carter Li 5b064f2e7b Display (Linux); improve display type detection
1. assume `DP-x` is external (false possitive alert);
2. detect display type for X11
2024-07-12 15:29:12 +08:00
Carter Li e786cd5d33 Display: detect physical width and height 2024-07-11 20:33:25 +08:00
Carter Li 6c7efea2fd Packaging: update debian stuff [ci skip] 2024-07-11 14:33:46 +08:00
Carter Li efd9e94138 Merge pull request #1086 from fastfetch-cli/dev
Release: v2.18.1
2024-07-11 10:43:24 +08:00
Carter Li 0707b29326 Release: v2.18.1 2024-07-11 10:19:20 +08:00
Carter Li 560e061c25 CI: upgrade freebsd version 2024-07-11 10:11:48 +08:00
Carter Li 1d83743259 GPU (Linux): detect more GPU driver versions 2024-07-11 10:04:23 +08:00
Carter Li 48bb38ca85 GPU (Linux): fix GPU driver detection
Regression of e5a04ee814

Fix #1084
2024-07-11 08:59:07 +08:00
李通洲 d9f084894e General: support more module for --detect-version 2024-07-10 22:09:28 +08:00
Carter Li 765c7b42b6 General: rename --ts-version to --detect-version
And use it in more modules
2024-07-10 21:55:37 +08:00
Carter Li 5060c265a9 Merge pull request #1083 from fastfetch-cli/dev
Release: v2.18.0
2024-07-10 15:39:24 +08:00
李通洲 fca4b3eee8 CI: remove freebsd-aarch64
It's unstable and I don't think anyone uses it
2024-07-10 14:41:52 +08:00
Carter Li eefed2be9c Release: v2.18.0 2024-07-10 13:57:57 +08:00
Carter Li 6a33027892 Fastfetch: use the official function instead of our local copy 2024-07-10 13:37:11 +08:00
Carter Li 5e9c0d03ff 3rdparty: upgrade yyjson to 0.10.0 2024-07-10 13:36:23 +08:00
Carter Li ab84c2ca76 Doc: update json schema and help message 2024-07-10 11:13:28 +08:00
李通洲 4777f7bec3 OpenGL (Windows): support EGL via ANGLE 2024-07-10 11:01:37 +08:00
李通洲 1038668db9 OpenGL: detect library version 2024-07-09 20:39:15 +08:00
Carter Li 49639b6719 OpenGL (Linux): fix flag --opengl-library doesn't work 2024-07-09 14:27:25 +08:00
Carter Li e5a04ee814 GPU (Linux): ignore disabled PCI devices 2024-07-09 06:06:46 +00:00
李通洲 fea2d80743 Doc: update changelog 2024-07-09 11:10:39 +08:00
Carter Li 39eccf189c Presets: add missing modules to all & ci
Fix #1081
2024-07-08 18:29:39 +08:00
Carter Li 1652ec3512 Display (Linux): remove debug output 2024-07-08 18:27:42 +08:00
李通洲 5a39b69d1d Wifi: print signal quality 2024-07-08 16:08:20 +08:00
Carter Li fa872d7c9b Display: fix build on FreeBSD 2024-07-08 15:32:09 +08:00
李通洲 545267bb7e Percentage: support percent bar in custom formatting
Fix #1075
2024-07-08 15:21:12 +08:00
李通洲 789f1e34ef Fastfetch: don't mess output with --stat in --pipe mode 2024-07-08 15:05:42 +08:00
李通洲 9c095967fc Separator: don't print color in --pipe mode 2024-07-08 15:04:28 +08:00
李通洲 ddc910e924 Base64: silence warnings 2024-07-08 14:21:10 +08:00
Carter Li d628bdea5a Display (Linux): support primary display detection for GNOME & Cinnamon 2024-07-08 14:11:45 +08:00
Carter Li f9ce2fae0e Display (Linux): improve id generation for wayland 2024-07-08 11:04:27 +08:00
Carter Li 4f70c16d63 Editor: don't print () 2024-07-08 09:12:18 +08:00
Carter Li f8d5f56dee GPU (Linux): remove possible overhead 2024-07-08 09:11:53 +08:00
Carter Li 4d1c62947b GPU (Linux): don't detect frequency for AMD cards
It's current frequency and may hang for some reason
2024-07-08 08:54:51 +08:00
Carter Li 8402dba0d9 Util (Base64): silence compiler warnings 2024-07-08 08:32:47 +08:00
David Adam 94b6f0fbd1 fish completion: pipe straight to Python (#1076)
In https://github.com/fish-shell/fish-shell/issues/10599, a user of an older version of fish has run into an issue with the fastfetch completion requiring a relatively new version.

Rewrite the (really quite clever) embedded Python into a straight pipe, dropping the string transformation entirely. Does require some escaping of quotes to support Python < 3.12.
2024-07-07 22:36:52 +08:00
李通洲 3b1b81437e Battery (Linux): add comments [ci skip] 2024-07-06 09:04:23 +08:00
李通洲 a61765c8b1 Display (Linux): try fix building for old wayland version 2024-07-06 00:10:59 +08:00
李通洲 065b44ff59 Display (Linux): better zxdg manager handling 2024-07-06 00:03:14 +08:00
李通洲 b0e51ba91d Global: fix memleaks 2024-07-05 23:27:13 +08:00
李通洲 b6fff0c946 Display (Wayland): code refactor 2024-07-05 23:13:28 +08:00
李通洲 c16373a7d7 Display (Linux): support primary display detection for GNOME 2024-07-05 23:11:27 +08:00
李通洲 73875de6a1 LocalIP: don't print * if defaultRouteOnly is set 2024-07-05 23:11:27 +08:00
Carter Li 5f1cb16534 Display (Linux): support primary display detection for KDE 2024-07-05 23:11:27 +08:00
Carter Li 013320bcde Display (Wayland): support fractional scale for KDE 2024-07-05 19:13:09 +08:00
李通洲 3415d8197c PhysicalMemory: don't print (null) in property locator 2024-07-05 11:01:04 +08:00
李通洲 c5fdcc5cfc PhysicalDisk (Linux): detect revision of USB devices 2024-07-05 02:40:15 +00:00
Carter Li f894856407 Disk: update module description 2024-07-05 10:16:25 +08:00
Dennis ten Hoove 313bb02188 Fix Arkane Linux color code (#1072) 2024-07-05 00:14:13 +08:00
李通洲 4dc0bd583c Logo (Builtin): add Opak
Fix #1070
2024-07-04 21:21:26 +08:00
Dennis ten Hoove 0ae1bd57bd Add Arkane Linux logo (#1071) 2024-07-04 20:58:16 +08:00
Carter Li 02f3789eaa Packaging: update debian stuff [ci skip] 2024-07-04 10:24:23 +08:00
590 changed files with 9274 additions and 3507 deletions
+1 -1
View File
@@ -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
+2 -2
View File
@@ -7,10 +7,10 @@ tab_width = 4
insert_final_newline = true
trim_trailing_whitespace = true
[*.{md,fflogo}]
[*.md]
trim_trailing_whitespace = false
[*.{fflogo}]
[*.txt]
insert_final_newline = false
[*.yml]
+1 -1
View File
@@ -1 +1 @@
github: [LinusDierheimer, CarterLi]
github: [CarterLi, LinusDierheimer]
+3
View File
@@ -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.
```
+21 -59
View File
@@ -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_ELF=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 libelf-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 libelf-dev directx-headers-dev rpm
cmake -DSET_TWEAK=Off -DBUILD_TESTS=On -DCMAKE_INSTALL_PREFIX=/usr .
cmake --build . --target package --verbose -j4
./fastfetch --list-features
time ./fastfetch -c presets/ci.jsonc
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 libelf-dev directx-headers-dev rpm
cmake -DSET_TWEAK=Off -DBUILD_TESTS=On -DCMAKE_INSTALL_PREFIX=/usr .
cmake --build . --target package --verbose -j4
./fastfetch --list-features
time ./fastfetch -c presets/ci.jsonc
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 libelf-dev directx-headers-dev rpm
cmake -DSET_TWEAK=Off -DBUILD_TESTS=On -DCMAKE_INSTALL_PREFIX=/usr .
cmake --build . --target package --verbose -j4
./fastfetch --list-features
time ./fastfetch -c presets/ci.jsonc
time ./fastfetch -c presets/ci.jsonc --stat false
time ./fastfetch -c presets/ci.jsonc --format json
time ./flashfetch
ldd fastfetch
@@ -247,7 +247,7 @@ jobs:
run: |
cat /etc/alpine-release
uname -a
apk add cmake samurai vulkan-loader-dev libxcb-dev wayland-dev libdrm-dev dconf-dev imagemagick-dev chafa-dev zlib-dev dbus-dev mesa-dev opencl-dev xfconf-dev sqlite-dev networkmanager-dev pulseaudio-dev ddcutil-dev gcc g++
apk add cmake samurai vulkan-loader-dev libxcb-dev wayland-dev libdrm-dev dconf-dev imagemagick-dev chafa-dev zlib-dev dbus-dev mesa-dev opencl-dev xfconf-dev sqlite-dev networkmanager-dev pulseaudio-dev ddcutil-dev elfutils-dev gcc g++
shell: alpine.sh --root {0}
- name: build
@@ -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
@@ -288,7 +288,7 @@ jobs:
run: |
cat /etc/alpine-release
uname -a
apk add cmake samurai vulkan-loader-dev libxcb-dev wayland-dev libdrm-dev dconf-dev imagemagick-dev chafa-dev zlib-dev dbus-dev mesa-dev opencl-dev xfconf-dev sqlite-dev networkmanager-dev pulseaudio-dev ddcutil-dev gcc g++
apk add cmake samurai vulkan-loader-dev libxcb-dev wayland-dev libdrm-dev dconf-dev imagemagick-dev chafa-dev zlib-dev dbus-dev mesa-dev opencl-dev xfconf-dev sqlite-dev networkmanager-dev pulseaudio-dev ddcutil-dev elfutils-dev gcc g++
shell: alpine.sh --root {0}
- name: build
@@ -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,13 +416,13 @@ 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
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
sudo pkg install -y cmake git pkgconf binutils wayland vulkan-headers vulkan-loader libxcb libXrandr libX11 libdrm libelf glib dconf dbus sqlite3-tcl xfce4-conf egl libosmesa opencl ocl-icd v4l_compat
cmake -DSET_TWEAK=Off -DBUILD_TESTS=On .
cmake --build . --target package --verbose -j4
./fastfetch --list-features
@@ -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
+225
View File
@@ -1,3 +1,228 @@
# 2.21.2
Features:
* Support `--stat <num_in_ms>` to display long running modules in yellow or red
Bugfixes:
* Fix bad Intel Arc GPU name and type detection (GPU, Linux)
* Fix uninited struct fields (GPU, Linux)
* Skip cpu model smbios detection on ARM platforms (CPU, Linux)
* Always use `CurrentControlSet` instead of `ControlSet001` when querying registry (Windows)
* Fix NVIDIA GPUs are missing in GPU detection sometimes (GPU, Windows)
* Fixing detection of `pthread_timedjoin_np` (Linux)
Logos:
* Add HyprOS
* Add GoldenDog Linux
# 2.21.1
Hotfix for a regression that breaks WM detection when running `startx` from TTY (Regression from 2.21.0, #1172 / #1162)
Changes:
* On Linux, FreeBSD and SunOS, a new recommended dependency `libelf` is introduced to extract strings in ELF binary, used for
* st term font detection when the term font is compiled directly into the binary
* fast path of systemd version detection
Features:
* Improve performance of
* kitty version detection (Terminal, Linux)
* st term font detection (TerminalFont, Linux)
* systemd version detection (InitSystem, Linux)
Bugfixes:
* Fix building error without `linux/wireless.h` (Wifi, Linux)
* Fix wrong GPU max frequency on Asahi Linux (GPU, Linux)
* Don't rely `$XDG_SESSION_TYPE` for detecting wm protocol (#1172 / #1162, WM, Linux)
* Fix light color doesn't work on Linux console (Colors, Linux)
* `LC_ALL`, if set, overrides every other locale-related environment variable (Locale)
* Increase timeout of DBus calls (Linux)
Logos:
* Add vanilla_small and vanilla2
* Add LFS (Linux From Scratch)
# 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:
+94 -35
View File
@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.12.0) # target_link_libraries with OBJECT libs & project homepage url
project(fastfetch
VERSION 2.17.2
VERSION 2.21.2
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,32 +44,32 @@ 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)
cmake_dependent_option(ENABLE_DIRECTX_HEADERS "Enable DirectX headers for WSL" ON "LINUX" OFF)
cmake_dependent_option(ENABLE_ELF "Enable libelf" ON "LINUX OR FreeBSD OR SunOS" OFF)
cmake_dependent_option(ENABLE_THREADS "Enable multithreading" ON "Threads_FOUND" OFF)
option(ENABLE_SYSTEM_YYJSON "Use system provided (instead of fastfetch embedded) yyjson library" OFF)
@@ -202,10 +202,10 @@ if (SET_TWEAK AND EXISTS "${CMAKE_SOURCE_DIR}/.git")
execute_process(
COMMAND git describe --tags
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
OUTPUT_VARIABLE PROJECT_VERSION_TWEAK
OUTPUT_VARIABLE PROJECT_VERSION_GIT
OUTPUT_STRIP_TRAILING_WHITESPACE
)
string(REGEX MATCH "-[0-9]+" PROJECT_VERSION_TWEAK "${PROJECT_VERSION_TWEAK}")
string(REGEX MATCH "-[0-9]+" PROJECT_VERSION_TWEAK "${PROJECT_VERSION_GIT}")
endif()
if(PROJECT_VERSION_TWEAK)
string(REGEX MATCH "[0-9]+" PROJECT_VERSION_TWEAK_NUM "${PROJECT_VERSION_TWEAK}")
@@ -294,6 +294,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 +308,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 +327,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 +398,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 +423,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 +434,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
@@ -472,6 +481,7 @@ if(LINUX)
src/detection/wmtheme/wmtheme_linux.c
src/detection/camera/camera_linux.c
src/util/platform/FFPlatform_unix.c
src/util/linux/elf.c
)
elseif(ANDROID)
list(APPEND LIBFASTFETCH_SRC
@@ -482,6 +492,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 +544,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 +555,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 +574,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 +597,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
@@ -605,6 +621,7 @@ elseif(BSD)
src/detection/wmtheme/wmtheme_linux.c
src/detection/camera/camera_linux.c
src/util/platform/FFPlatform_unix.c
src/util/linux/elf.c
)
elseif(APPLE)
list(APPEND LIBFASTFETCH_SRC
@@ -616,6 +633,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 +697,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 +772,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 +783,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 +806,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
@@ -805,6 +829,7 @@ elseif(SunOS)
src/detection/wmtheme/wmtheme_linux.c
src/detection/camera/camera_nosupport.c
src/util/platform/FFPlatform_unix.c
src/util/linux/elf.c
)
endif()
@@ -814,14 +839,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 +899,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 +1067,6 @@ ff_lib_enable(OPENCL
"OpenCL"
"OpenCL"
)
ff_lib_enable(LIBNM
"libnm"
"libnm"
)
ff_lib_enable(FREETYPE
"freetype2"
"FreeType2"
@@ -1058,6 +1079,10 @@ ff_lib_enable(DDCUTIL
"ddcutil"
"Ddcutil"
)
ff_lib_enable(ELF
"libelf"
"libelf"
)
ff_lib_enable(DIRECTX_HEADERS
"DirectX-Headers"
"DirectX-Headers"
@@ -1111,7 +1136,7 @@ elseif(WIN32)
PRIVATE "hid"
PRIVATE "wtsapi32"
)
elseif(BSD)
elseif(FreeBSD)
target_link_libraries(libfastfetch
PRIVATE "m"
PRIVATE "usbhid"
@@ -1164,7 +1189,41 @@ 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()
if(ENABLE_THREADS AND CMAKE_USE_PTHREADS_INIT)
CHECK_INCLUDE_FILE("pthread_np.h" HAVE_PTHREAD_NP)
if(HAVE_PTHREAD_NP)
target_compile_definitions(libfastfetch PRIVATE FF_HAVE_PTHREAD_NP=1)
set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} pthread_np.h)
endif()
set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} Threads::Threads)
check_function_exists("pthread_timedjoin_np" HAVE_TIMEDJOIN_NP)
if(HAVE_TIMEDJOIN_NP)
target_compile_definitions(libfastfetch PRIVATE FF_HAVE_TIMEDJOIN_NP=1)
else()
message(WARNING "pthread_timedjoin_np was not found; networking timeout will not work")
endif()
endif()
endif()
######################
+10
View File
@@ -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)
[![asciicast](https://asciinema.org/a/1uF6sTPGKrHKI1MVaFcikINSQ.svg)](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:
+2 -3
View File
@@ -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
View File
@@ -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
+48
View File
@@ -1,3 +1,51 @@
fastfetch (2.21.1) jammy; urgency=medium
* Update to 2.21.1
-- Carter Li <zhangsongcui@live.cn> Fri, 09 Aug 2024 14:27:10 +0800
fastfetch (2.21.0) jammy; urgency=medium
* Update to 2.21.0
-- Carter Li <zhangsongcui@live.cn> Mon, 05 Aug 2024 14:35:43 +0800
fastfetch (2.20.0) jammy; urgency=medium
* Update to 2.20.0
-- Carter Li <zhangsongcui@live.cn> Fri, 26 Jul 2024 14:02:50 +0800
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
+1 -1
View File
@@ -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
+1 -1
View File
@@ -1 +1 @@
fastfetch_2.17.1_source.buildinfo universe/utils optional
fastfetch_2.21.1_source.buildinfo universe/utils optional
+1 -1
View File
@@ -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
+304 -119
View File
@@ -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
}
}
},
@@ -348,9 +357,17 @@
"additionalProperties": false,
"properties": {
"stat": {
"type": "boolean",
"description": "Show time usage (in ms) for individual modules",
"default": false
"description": "Show time usage (in ms) for individual modules with optional threshold",
"oneOf": [
{
"type": "boolean",
"default": false
},
{
"type": "integer",
"minimum": 1
}
]
},
"pipe": {
"type": "boolean",
@@ -413,35 +430,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 +610,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 +643,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 +657,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 +701,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": {
@@ -685,6 +738,10 @@
"ddcutil": {
"description": "Used for brightness detection of external displays (Linux)",
"type": "string"
},
"elf": {
"description": "Used for st terminal font detection and systemd version detection (Linux)",
"type": "string"
}
}
},
@@ -700,6 +757,7 @@
"battery",
"bios",
"bluetooth",
"bluetoothradio",
"board",
"bootmgr",
"break",
@@ -944,12 +1002,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 +1042,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 +1062,7 @@
"additionalProperties": false,
"properties": {
"type": {
"description": "List bluetooth devices",
"description": "List (connected) bluetooth devices",
"const": "bluetooth"
},
"showDisconnected": {
@@ -1015,12 +1079,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 +1147,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 +1176,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 +1202,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 +1213,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 +1250,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 +1278,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 +1319,9 @@
},
"key": {
"$ref": "#/$defs/key"
},
"keyIcon": {
"$ref": "#/$defs/keyIcon"
}
}
},
@@ -1243,12 +1348,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 +1378,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 +1433,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 +1499,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 +1537,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 +1571,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 +1609,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 +1641,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 +1699,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 +1772,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 +1804,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 +1848,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 +1891,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 +1915,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 +1930,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 +1967,9 @@
"emerge",
"eopkg",
"flatpak",
"guix",
"lpkg",
"lpkgbuild",
"macports",
"nix",
"opkg",
@@ -1830,6 +1980,7 @@
"rpm",
"scoop",
"snap",
"sorcery",
"winget",
"xbps"
],
@@ -1843,12 +1994,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 +2030,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 +2076,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 +2100,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 +2144,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 +2176,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 +2229,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 +2268,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 +2312,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 +2346,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"
}
+7 -1
View File
@@ -47,6 +47,7 @@
"cpuusage",
{
"type": "gpu",
"driverSpecific": true,
"temp": true
},
"memory",
@@ -57,12 +58,16 @@
"poweradapter",
"player",
"media",
"publicip",
{
"type": "publicip",
"timeout": 1000
},
{
"type": "localip",
"showIpv6": true,
"showMac": true
},
"dns",
"wifi",
"datetime",
"locale",
@@ -71,6 +76,7 @@
"opencl",
"users",
"bluetooth",
"bluetoothradio",
"sound",
"camera",
"gamepad",
+11 -13
View File
@@ -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",
@@ -78,7 +75,8 @@
},
{
"type": "publicip",
"key": "WAN IP"
"key": "WAN IP",
"timeout": 1000
}
]
}
-42
View File
@@ -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"
]
}
+7 -1
View File
@@ -49,6 +49,7 @@
"cpuusage",
{
"type": "gpu",
"driverSpecific": true,
"temp": true
},
"memory",
@@ -59,12 +60,16 @@
"poweradapter",
"player",
"media",
"publicip",
{
"type": "publicip",
"timeout": 1000
},
{
"type": "localip",
"showIpv6": true,
"showMac": true
},
"dns",
"wifi",
"datetime",
"locale",
@@ -73,6 +78,7 @@
"opencl",
"users",
"bluetooth",
"bluetoothradio",
"sound",
"camera",
"gamepad",
+9 -6
View File
@@ -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",
+27 -19
View File
@@ -6,96 +6,104 @@
"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"
"type": "publicip",
"timeout": 1000
},
"break",
{
"type": "custom",
"format": "└──────────────────────────────────────────────────────────────────────────────┘"
"format": "└{$1}────────────────────{$1}┘"
},
"break",
{
+17 -19
View File
@@ -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"
},
+7 -5
View File
@@ -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
View File
@@ -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"
},
+4 -4
View File
@@ -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
View File
@@ -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
View File
@@ -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"
}
]
+1 -1
View File
@@ -12,7 +12,7 @@
"logo": {
"source": " _____ _____ _____ _____ _____ _____ _____ _____ _____\n| __| _ | __|_ _| __| __|_ _| | | |\n| __| |__ | | | | __| __| | | | --| |\n|__| |__|__|_____| |_| |__| |_____| |_| |_____|__|__|",
"type": "data",
"separate": true,
"position": "top",
"padding": {
"right": 2
}
+44 -123
View File
@@ -10,153 +10,74 @@
// "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": " 󰩠"
"timeout": 1000
},
{
"type": "wifi",
"key": " ",
"format": "{4}" // ssid
},
{
"type": "locale",
"key": " "
"format": "{ssid}"
},
"locale",
{
"type": "custom", // InformationEnd
"format": "└────────────────────────────────────────────┘"
"format": "└{$1}──────────────────────{$1}┘"
},
{
"type": "colors",
+26 -21
View File
@@ -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",
+12 -7
View File
@@ -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"
}
+8 -4
View File
@@ -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",
+57
View File
@@ -0,0 +1,57 @@
// designed for presenting Vanilla Linux
// inspired from imstilllearnin's Vanilla Logo Ultra
{
"$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json",
"logo": {
"type": "small"
},
"display": {
"color": {
"output": "cyan"
},
"separator": ""
},
"modules": [
{
"type": "kernel",
"key": "Vanilla ",
"keyColor": "blue"
},
{
"type": "packages",
"key": " [_Packages_> ",
"keyColor": "green"
},
{
"type": "localip",
"key": " [_Local_IP_> ",
"keyColor": "green"
},
{
"type": "cpu",
"key": " [_CPU______> ",
"keyColor": "magenta"
},
{
"type": "memory",
"key": " [_RAM______> ",
"keyColor": "magenta"
},
{
"type": "swap",
"key": " [_SWAP_____> ",
"keyColor": "magenta"
},
{
"type": "disk",
"key": " [_Disk_____> ",
"keyColor": "magenta"
},
"break",
{
"type":"colors",
"paddingLeft": 9,
"symbol": "circle"
}
]
}
+6 -2
View File
@@ -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",
+4 -2
View File
@@ -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": "  "
},
+1 -1
View File
@@ -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": [
{
+6 -12
View File
@@ -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"
},
{
@@ -168,12 +161,13 @@
{
"type": "publicip",
"key": "├─󰩠",
"keyColor": "blue"
"keyColor": "blue",
"timeout": 1000
},
{
"type": "wifi",
"key": "├─",
"format": "{4}", // ssid
"format": "{ssid}",
"keyColor": "blue"
},
{
+6 -7
View File
@@ -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
View File
@@ -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]
}
}
]
}
+3 -1
View File
@@ -4,7 +4,9 @@
"type": "small"
},
"display": {
"keyWidth": 11,
"key": {
"width": 11
},
"bar": {
"charElapsed": "=",
"charTotal": "-",
-37
View File
@@ -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"
]
}
+6 -3
View File
@@ -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"
-17
View File
@@ -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"
]
}
+1 -1
View File
@@ -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"
}
+152 -57
View File
@@ -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;
+21 -3
View File
@@ -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);
/**
+11 -10
View File
@@ -1,4 +1,5 @@
#include "commandoption.h"
#include "common/color.h"
#include "common/printing.h"
#include "common/time.h"
#include "common/jsonconfig.h"
@@ -105,35 +106,35 @@ static void parseStructureCommand(
void ffPrintCommandOption(FFdata* data, yyjson_mut_doc* jsonDoc)
{
//Parse the structure and call the modules
int32_t thres = instance.config.display.stat;
uint32_t startIndex = 0;
while (startIndex < data->structure.length)
{
uint32_t colonIndex = ffStrbufNextIndexC(&data->structure, startIndex, ':');
data->structure.chars[colonIndex] = '\0';
uint64_t ms = 0;
if(instance.config.display.stat)
double ms = 0;
if(thres >= 0)
ms = ffTimeGetTick();
parseStructureCommand(data->structure.chars + startIndex, genJsonResult, jsonDoc);
if(instance.config.display.stat)
if(thres >= 0)
{
ms = ffTimeGetTick() - ms;
if (jsonDoc)
{
yyjson_mut_val* moduleJson = yyjson_mut_arr_get_last(jsonDoc->root);
yyjson_mut_obj_add_uint(jsonDoc, moduleJson, "stat", ms);
yyjson_mut_obj_add_real(jsonDoc, moduleJson, "stat", ms);
}
else
{
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
char str[64];
int len = snprintf(str, sizeof str, "%.3fms", ms);
if (thres > 0)
snprintf(str, sizeof str, "\e[%sm%.3fms\e[m", (ms <= thres ? FF_COLOR_FG_GREEN : ms <= 2 * thres ? FF_COLOR_FG_YELLOW : FF_COLOR_FG_RED), ms);
printf("\e[s\e[1A\e[9999999C\e[%dD%s\e[u", len, str); // Save; Up 1; Right 9999999; Left <len>; Print <str>; Load
}
}
+64 -29
View File
@@ -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);
+6 -18
View File
@@ -6,23 +6,14 @@
#include "util/FFstrbuf.h"
#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; \
}
#define FF_DBUS_TIMEOUT_MILLISECONDS 100
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 +21,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 +30,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
+21
View File
@@ -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)
+2
View File
@@ -1,5 +1,7 @@
#pragma once
#include "util/FFstrbuf.h"
typedef enum FFformatargtype
{
FF_FORMAT_ARG_TYPE_NULL = 0,
+32 -32
View File
@@ -173,94 +173,94 @@ 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_ELF
"libelf\n"
#endif
#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
View File
@@ -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
View File
@@ -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";
-1
View File
@@ -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);
}
+18 -10
View File
@@ -1,4 +1,5 @@
#include "fastfetch.h"
#include "common/color.h"
#include "common/jsonconfig.h"
#include "common/printing.h"
#include "common/io/io.h"
@@ -37,6 +38,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 +56,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[])
@@ -174,12 +182,13 @@ static const char* printJsonConfig(bool prepare, yyjson_mut_doc* jsonDoc)
if (!modules) return NULL;
if (!yyjson_is_arr(modules)) return "Property 'modules' must be an array of strings or objects";
int32_t thres = instance.config.display.stat;
yyjson_val* item;
size_t idx, max;
yyjson_arr_foreach(modules, idx, max, item)
{
uint64_t ms = 0;
if(!prepare && instance.config.display.stat)
double ms = 0;
if(!prepare && thres >= 0)
ms = ffTimeGetTick();
yyjson_val* module = item;
@@ -201,22 +210,21 @@ static const char* printJsonConfig(bool prepare, yyjson_mut_doc* jsonDoc)
else if(!parseModuleJsonObject(type, module, jsonDoc))
return "Unknown module type";
if(!prepare && instance.config.display.stat)
if(!prepare && thres >= 0)
{
ms = ffTimeGetTick() - ms;
if (jsonDoc)
{
yyjson_mut_val* moduleJson = yyjson_mut_arr_get_last(jsonDoc->root);
yyjson_mut_obj_add_uint(jsonDoc, moduleJson, "stat", ms);
yyjson_mut_obj_add_real(jsonDoc, moduleJson, "stat", ms);
}
else
{
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
char str[64];
int len = snprintf(str, sizeof str, "%.3fms", ms);
if (thres > 0)
snprintf(str, sizeof str, "\e[%sm%.3fms\e[m", (ms <= thres ? FF_COLOR_FG_GREEN : ms <= 2 * thres ? FF_COLOR_FG_YELLOW : FF_COLOR_FG_RED), ms);
printf("\e[s\e[1A\e[9999999C\e[%dD%s\e[u", len, str); // Save; Up 1; Right 9999999; Left <len>; Print <str>; Load
}
}
+1
View File
@@ -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
View File
@@ -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
View File
@@ -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
View File
@@ -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)
+1
View File
@@ -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
View File
@@ -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 -8
View File
@@ -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;
+7 -1
View File
@@ -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
View File
@@ -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;
+5 -5
View File
@@ -9,22 +9,22 @@
#include <sysinfoapi.h>
#endif
static inline uint64_t ffTimeGetTick() //In msec
static inline double ffTimeGetTick(void) //In msec
{
#ifdef _WIN32
LARGE_INTEGER frequency;
QueryPerformanceFrequency(&frequency);
LARGE_INTEGER start;
QueryPerformanceCounter(&start);
return (uint64_t)(start.QuadPart * 1000 / frequency.QuadPart);
return (double) start.QuadPart * 1000 / (double) frequency.QuadPart;
#else
struct timespec timeNow;
clock_gettime(CLOCK_MONOTONIC, &timeNow);
return (uint64_t)((timeNow.tv_sec * 1000) + (timeNow.tv_nsec / 1000000));
return (double) timeNow.tv_sec * 1000. + (double) timeNow.tv_nsec / 1000000.;
#endif
}
static inline uint64_t ffTimeGetNow()
static inline uint64_t ffTimeGetNow(void)
{
#ifdef _WIN32
uint64_t timeNow;
@@ -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
}
+80 -41
View File
@@ -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",
@@ -913,6 +935,13 @@
"arg": {
"type": "path"
}
},
{
"long": "lib-elf",
"desc": "Used for st terminal font detection and systemd version detection",
"arg": {
"type": "path"
}
}
],
"Module specific": [
@@ -954,7 +983,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 +991,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 +1213,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 +1575,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 +1665,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",
+1 -1
View File
@@ -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)
+19 -18
View File
@@ -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";
+13 -21
View File
@@ -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;
}
+1 -1
View File
@@ -46,7 +46,7 @@ const char* ffDetectBootmgr(FFBootmgrResult* result)
ffEfiFillLoadOption((FFEfiLoadOption *)buffer, result);
DWORD uefiSecureBootEnabled = 0, bufSize = 0;
if (RegGetValueW(HKEY_LOCAL_MACHINE, L"SYSTEM\\ControlSet001\\Control\\SecureBoot\\State", L"UEFISecureBootEnabled", RRF_RT_REG_DWORD, NULL, &uefiSecureBootEnabled, &bufSize) == ERROR_SUCCESS)
if (RegGetValueW(HKEY_LOCAL_MACHINE, L"SYSTEM\\CurrentControlSet\\Control\\SecureBoot\\State", L"UEFISecureBootEnabled", RRF_RT_REG_DWORD, NULL, &uefiSecureBootEnabled, &bufSize) == ERROR_SUCCESS)
result->secureBoot = !!uefiSecureBootEnabled;
return NULL;
+1 -1
View File
@@ -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);
+2 -2
View File
@@ -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)
+3 -4
View File
@@ -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.
+18 -19
View File
@@ -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, &current, &size, NULL, 0) == 0)
cpu->frequencyBase = (double) current / 1000.0 / 1000.0 / 1000.0;
cpu->frequencyBase = (uint32_t) (current / 1000 / 1000);
}
return NULL;
}
+358
View File
@@ -0,0 +1,358 @@
#pragma once
#include "fastfetch.h"
// https://github.com/util-linux/util-linux/blob/master/sys-utils/lscpu-arm.c
// We use the util-linux's data but not its code. Call me if it violates util-linux's GPL license.
static const char* hwImplId2Vendor(uint32_t implId)
{
switch (implId)
{
case 0x41: return "ARM";
case 0x42: return "Broadcom";
case 0x43: return "Cavium";
case 0x44: return "DEC";
case 0x46: return "FUJITSU";
case 0x48: return "HiSilicon";
case 0x49: return "Infineon";
case 0x4d: return "Motorola";
case 0x4e: return "NVIDIA";
case 0x50: return "APM";
case 0x51: return "Qualcomm";
case 0x53: return "Samsung";
case 0x56: return "Marvell";
case 0x61: return "Apple";
case 0x66: return "Faraday";
case 0x69: return "Intel";
case 0x6D: return "Microsoft";
case 0x70: return "Phytium";
case 0xc0: return "Ampere";
default: return 0;
}
}
static const char* armPartId2name(uint32_t partId)
{
switch (partId)
{
case 0x810: return "ARM810";
case 0x920: return "ARM920";
case 0x922: return "ARM922";
case 0x926: return "ARM926";
case 0x940: return "ARM940";
case 0x946: return "ARM946";
case 0x966: return "ARM966";
case 0xa20: return "ARM1020";
case 0xa22: return "ARM1022";
case 0xa26: return "ARM1026";
case 0xb02: return "ARM11 MPCore";
case 0xb36: return "ARM1136";
case 0xb56: return "ARM1156";
case 0xb76: return "ARM1176";
case 0xc05: return "Cortex-A5";
case 0xc07: return "Cortex-A7";
case 0xc08: return "Cortex-A8";
case 0xc09: return "Cortex-A9";
case 0xc0d: return "Cortex-A17"; /* Originally A12 */
case 0xc0f: return "Cortex-A15";
case 0xc0e: return "Cortex-A17";
case 0xc14: return "Cortex-R4";
case 0xc15: return "Cortex-R5";
case 0xc17: return "Cortex-R7";
case 0xc18: return "Cortex-R8";
case 0xc20: return "Cortex-M0";
case 0xc21: return "Cortex-M1";
case 0xc23: return "Cortex-M3";
case 0xc24: return "Cortex-M4";
case 0xc27: return "Cortex-M7";
case 0xc60: return "Cortex-M0+";
case 0xd01: return "Cortex-A32";
case 0xd02: return "Cortex-A34";
case 0xd03: return "Cortex-A53";
case 0xd04: return "Cortex-A35";
case 0xd05: return "Cortex-A55";
case 0xd06: return "Cortex-A65";
case 0xd07: return "Cortex-A57";
case 0xd08: return "Cortex-A72";
case 0xd09: return "Cortex-A73";
case 0xd0a: return "Cortex-A75";
case 0xd0b: return "Cortex-A76";
case 0xd0c: return "Neoverse-N1";
case 0xd0d: return "Cortex-A77";
case 0xd0e: return "Cortex-A76AE";
case 0xd13: return "Cortex-R52";
case 0xd15: return "Cortex-R82";
case 0xd16: return "Cortex-R52+";
case 0xd20: return "Cortex-M23";
case 0xd21: return "Cortex-M33";
case 0xd22: return "Cortex-M55";
case 0xd23: return "Cortex-M85";
case 0xd40: return "Neoverse-V1";
case 0xd41: return "Cortex-A78";
case 0xd42: return "Cortex-A78AE";
case 0xd43: return "Cortex-A65AE";
case 0xd44: return "Cortex-X1";
case 0xd46: return "Cortex-A510";
case 0xd47: return "Cortex-A710";
case 0xd48: return "Cortex-X2";
case 0xd49: return "Neoverse-N2";
case 0xd4a: return "Neoverse-E1";
case 0xd4b: return "Cortex-A78C";
case 0xd4c: return "Cortex-X1C";
case 0xd4d: return "Cortex-A715";
case 0xd4e: return "Cortex-X3";
case 0xd4f: return "Neoverse-V2";
case 0xd80: return "Cortex-A520";
case 0xd81: return "Cortex-A720";
case 0xd82: return "Cortex-X4";
default: return "Unknown";
}
}
static const char* brcmPartId2name(uint32_t partId)
{
switch (partId)
{
case 0x0f: return "Brahma-B15";
case 0x100: return "Brahma-B53";
case 0x516: return "ThunderX2";
default: return "Unknown";
}
}
static const char* decPartId2name(uint32_t partId)
{
switch (partId)
{
case 0xa10: return "SA110";
case 0xa11: return "SA1100";
default: return "Unknown";
}
}
static const char* caviumPartId2name(uint32_t partId)
{
switch (partId)
{
case 0x0a0: return "ThunderX";
case 0x0a1: return "ThunderX-88XX";
case 0x0a2: return "ThunderX-81XX";
case 0x0a3: return "ThunderX-83XX";
case 0x0af: return "ThunderX2-99xx";
case 0x0b0: return "OcteonTX2";
case 0x0b1: return "OcteonTX2-98XX";
case 0x0b2: return "OcteonTX2-96XX";
case 0x0b3: return "OcteonTX2-95XX";
case 0x0b4: return "OcteonTX2-95XXN";
case 0x0b5: return "OcteonTX2-95XXMM";
case 0x0b6: return "OcteonTX2-95XXO";
case 0x0b8: return "ThunderX3-T110";
default: return "Unknown";
}
}
static const char* apmPartId2name(uint32_t partId)
{
switch (partId)
{
case 0x000: return "X-Gene";
default: return "Unknown";
}
}
static const char* qcomPartId2name(uint32_t partId)
{
switch (partId)
{
case 0x001: return "Oryon";
case 0x00f: return "Scorpion";
case 0x02d: return "Scorpion";
case 0x04d: return "Krait";
case 0x06f: return "Krait";
case 0x201: return "Kryo";
case 0x205: return "Kryo";
case 0x211: return "Kryo";
case 0x800: return "Falkor-V1/Kryo";
case 0x801: return "Kryo-V2";
case 0x802: return "Kryo-3XX-Gold";
case 0x803: return "Kryo-3XX-Silver";
case 0x804: return "Kryo-4XX-Gold";
case 0x805: return "Kryo-4XX-Silver";
case 0xc00: return "Falkor";
case 0xc01: return "Saphira";
default: return "Unknown";
}
}
static const char* samsungPartId2name(uint32_t partId)
{
switch (partId)
{
case 0x001: return "exynos-m1";
case 0x002: return "exynos-m3";
case 0x003: return "exynos-m4";
case 0x004: return "exynos-m5";
default: return "Unknown";
}
}
static const char* nvidiaPartId2name(uint32_t partId)
{
switch (partId)
{
case 0x000: return "Denver";
case 0x003: return "Denver 2";
case 0x004: return "Carmel";
default: return "Unknown";
}
}
static const char* marvellPartId2name(uint32_t partId)
{
switch (partId)
{
case 0x131: return "Feroceon-88FR131";
case 0x581: return "PJ4/PJ4b";
case 0x584: return "PJ4B-MP";
default: return "Unknown";
}
}
static const char* applePartId2name(uint32_t partId)
{
switch (partId)
{
case 0x000: return "Swift";
case 0x001: return "Cyclone";
case 0x002: return "Typhoon";
case 0x003: return "Typhoon/Capri";
case 0x004: return "Twister";
case 0x005: return "Twister/Elba/Malta";
case 0x006: return "Hurricane";
case 0x007: return "Hurricane/Myst";
case 0x008: return "Monsoon";
case 0x009: return "Mistral";
case 0x00b: return "Vortex";
case 0x00c: return "Tempest";
case 0x00f: return "Tempest-M9";
case 0x010: return "Vortex/Aruba";
case 0x011: return "Tempest/Aruba";
case 0x012: return "Lightning";
case 0x013: return "Thunder";
case 0x020: return "Icestorm-A14";
case 0x021: return "Firestorm-A14";
case 0x022: return "Icestorm-M1";
case 0x023: return "Firestorm-M1";
case 0x024: return "Icestorm-M1-Pro";
case 0x025: return "Firestorm-M1-Pro";
case 0x026: return "Thunder-M10";
case 0x028: return "Icestorm-M1-Max";
case 0x029: return "Firestorm-M1-Max";
case 0x030: return "Blizzard-A15";
case 0x031: return "Avalanche-A15";
case 0x032: return "Blizzard-M2";
case 0x033: return "Avalanche-M2";
case 0x034: return "Blizzard-M2-Pro";
case 0x035: return "Avalanche-M2-Pro";
case 0x036: return "Sawtooth-A16";
case 0x037: return "Everest-A16";
case 0x038: return "Blizzard-M2-Max";
case 0x039: return "Avalanche-M2-Max";
default: return "Unknown";
}
}
static const char* faradayPartId2name(uint32_t partId)
{
switch (partId)
{
case 0x526: return "FA526";
case 0x626: return "FA626";
default: return "Unknown";
}
}
static const char* intelPartId2name(uint32_t partId)
{
switch (partId)
{
case 0x200: return "i80200";
case 0x210: return "PXA250A";
case 0x212: return "PXA210A";
case 0x242: return "i80321-400";
case 0x243: return "i80321-600";
case 0x290: return "PXA250B/PXA26x";
case 0x292: return "PXA210B";
case 0x2c2: return "i80321-400-B0";
case 0x2c3: return "i80321-600-B0";
case 0x2d0: return "PXA250C/PXA255/PXA26x";
case 0x2d2: return "PXA210C";
case 0x411: return "PXA27x";
case 0x41c: return "IPX425-533";
case 0x41d: return "IPX425-400";
case 0x41f: return "IPX425-266";
case 0x682: return "PXA32x";
case 0x683: return "PXA930/PXA935";
case 0x688: return "PXA30x";
case 0x689: return "PXA31x";
case 0xb11: return "SA1110";
case 0xc12: return "IPX1200";
default: return "Unknown";
}
}
static const char* fujitsuPartId2name(uint32_t partId)
{
switch (partId)
{
case 0x001: return "A64FX";
default: return "Unknown";
}
}
static const char* hisiPartId2name(uint32_t partId)
{
switch (partId)
{
case 0xd01: return "TaiShan-v110"; /* used in Kunpeng-920 SoC */
case 0xd02: return "TaiShan-v120"; /* used in Kirin 990A and 9000S SoCs */
case 0xd40: return "Cortex-A76"; /* HiSilicon uses this ID though advertises A76 */
case 0xd41: return "Cortex-A77"; /* HiSilicon uses this ID though advertises A77 */
default: return "Unknown";
}
}
static const char* amperePartId2name(uint32_t partId)
{
switch (partId)
{
case 0xac3: return "Ampere-1";
case 0xac4: return "Ampere-1a";
default: return "Unknown";
}
}
static const char* ftPartId2name(uint32_t partId)
{
switch (partId)
{
case 0x303: return "FTC310";
case 0x660: return "FTC660";
case 0x661: return "FTC661";
case 0x662: return "FTC662";
case 0x663: return "FTC663";
case 0x664: return "FTC664";
case 0x862: return "FTC862";
default: return "Unknown";
}
}
static const char* msPartId2name(uint32_t partId)
{
switch (partId)
{
case 0xd49: return "Azure-Cobalt-100";
default: return "Unknown";
}
}
+7 -11
View File
@@ -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)
+139 -138
View File
@@ -13,34 +13,128 @@
#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
static const char* parseCpuInfo(FFCPUResult* cpu, FFstrbuf* physicalCoresBuffer, FFstrbuf* cpuMHz, FFstrbuf* cpuIsa, FFstrbuf* cpuUarch)
{
FF_AUTO_CLOSE_FILE FILE* cpuinfo = fopen("/proc/cpuinfo", "r");
if(cpuinfo == NULL)
return "fopen(\"/proc/cpuinfo\", \"r\") failed";
#ifdef __aarch64__
#include "cpu_arm.h"
static void detectArmName(FILE* cpuinfo, FFCPUResult* cpu, uint32_t implId)
{
FF_AUTO_FREE char* line = NULL;
rewind(cpuinfo);
size_t len = 0;
const char* lastName = NULL;
uint32_t num = 0;
while(getline(&line, &len, cpuinfo) != -1)
{
if (!ffStrStartsWith(line, "CPU part\t: ")) continue;
uint32_t partId = (uint32_t) strtoul(line + strlen("CPU part\t: "), NULL, 16);
const char* name = NULL;
switch (implId)
{
case 0x41: name = armPartId2name(partId); break;
case 0x42: name = brcmPartId2name(partId); break;
case 0x43: name = caviumPartId2name(partId); break;
case 0x44: name = decPartId2name(partId); break;
case 0x46: name = fujitsuPartId2name(partId); break;
case 0x48: name = hisiPartId2name(partId); break;
case 0x4e: name = nvidiaPartId2name(partId); break;
case 0x50: name = apmPartId2name(partId); break;
case 0x51: name = qcomPartId2name(partId); break;
case 0x53: name = samsungPartId2name(partId); break;
case 0x56: name = marvellPartId2name(partId); break;
case 0x61: name = applePartId2name(partId); break;
case 0x66: name = faradayPartId2name(partId); break;
case 0x69: name = intelPartId2name(partId); break;
case 0x6d: name = msPartId2name(partId); break;
case 0x70: name = ftPartId2name(partId); break;
case 0xc0: name = amperePartId2name(partId); break;
default: name = "Unknown"; break;
}
if (lastName != name)
{
if (lastName)
{
if (num > 1)
ffStrbufAppendF(&cpu->name, "*%u", num);
ffStrbufAppendS(&cpu->name, " + ");
}
ffStrbufAppendS(&cpu->name, name);
lastName = name;
num = 1;
}
else
++num;
}
if (num > 1)
ffStrbufAppendF(&cpu->name, "*%u", num);
}
#endif
static const char* parseCpuInfo(FILE* cpuinfo, FFCPUResult* cpu, FFstrbuf* physicalCoresBuffer, FFstrbuf* cpuMHz, FFstrbuf* cpuIsa, FFstrbuf* cpuUarch, FFstrbuf* cpuImplementer)
{
FF_AUTO_FREE char* line = NULL;
size_t len = 0;
#ifdef __aarch64__
FF_STRBUF_AUTO_DESTROY implementer = ffStrbufCreate();
#endif
while(getline(&line, &len, cpuinfo) != -1)
{
//Stop after the first CPU
@@ -55,35 +149,22 @@ static const char* parseCpuInfo(FFCPUResult* cpu, FFstrbuf* physicalCoresBuffer,
ffParsePropLine(line, "isa :", cpuIsa) ||
ffParsePropLine(line, "uarch :", cpuUarch) ||
#ifdef __aarch64__
(cpu->vendor.length == 0 && ffParsePropLine(line, "CPU implementer :", &implementer)) ||
#if __aarch64__
(cpu->vendor.length == 0 && ffParsePropLine(line, "CPU implementer :", cpuImplementer)) ||
#endif
#if __ANDROID__
(cpu->name.length == 0 && ffParsePropLine(line, "Hardware :", &cpu->name)) || //For Android devices
#endif
#if __powerpc__ || __powerpc
(cpu->name.length == 0 && ffParsePropLine(line, "cpu :", &cpu->name)) || //For POWER
(cpu->name.length == 0 && ffParsePropLine(line, "cpu model :", &cpu->name)) //For MIPS
#endif
#if __mips__
(cpu->name.length == 0 && ffParsePropLine(line, "cpu model :", &cpu->name)) || //For MIPS
#endif
false
);
}
#ifdef __aarch64__
// https://github.com/util-linux/util-linux/blob/2cd89de14549d2b2c079a4f8b73f75500d229fee/sys-utils/lscpu-arm.c#L286
if (cpu->vendor.length == 0 && implementer.length > 2 /* 0xX */)
{
uint32_t implId = (uint32_t) strtoul(implementer.chars, NULL, 16);
switch (implId)
{
case 0x41: ffStrbufSetStatic(&cpu->vendor, "ARM"); break;
case 0x42: ffStrbufSetStatic(&cpu->vendor, "Broadcom"); break;
case 0x48: ffStrbufSetStatic(&cpu->vendor, "HiSilicon"); break;
case 0x4e: ffStrbufSetStatic(&cpu->vendor, "Nvidia"); break;
case 0x51: ffStrbufSetStatic(&cpu->vendor, "Qualcomm"); break;
case 0x53: ffStrbufSetStatic(&cpu->vendor, "Samsung"); break;
case 0x61: ffStrbufSetStatic(&cpu->vendor, "Apple"); break;
case 0x69: ffStrbufSetStatic(&cpu->vendor, "Intel"); break;
}
}
#endif
return NULL;
}
@@ -94,7 +175,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 +183,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 +224,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 +247,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;
}
@@ -258,22 +314,27 @@ void detectAsahi(FFCPUResult* cpu)
const char* ffDetectCPUImpl(const FFCPUOptions* options, FFCPUResult* cpu)
{
FF_AUTO_CLOSE_FILE FILE* cpuinfo = fopen("/proc/cpuinfo", "r");
if(cpuinfo == NULL)
return "fopen(\"/proc/cpuinfo\", \"r\") failed";
cpu->temperature = options->temp ? detectCPUTemp() : FF_CPU_TEMP_UNSET;
FF_STRBUF_AUTO_DESTROY physicalCoresBuffer = ffStrbufCreate();
FF_STRBUF_AUTO_DESTROY cpuMHz = ffStrbufCreate();
FF_STRBUF_AUTO_DESTROY cpuIsa = ffStrbufCreate();
FF_STRBUF_AUTO_DESTROY cpuUarch = ffStrbufCreate();
FF_STRBUF_AUTO_DESTROY cpuImplementerStr = ffStrbufCreate();
const char* error = parseCpuInfo(cpu, &physicalCoresBuffer, &cpuMHz, &cpuIsa, &cpuUarch);
const char* error = parseCpuInfo(cpuinfo, cpu, &physicalCoresBuffer, &cpuMHz, &cpuIsa, &cpuUarch, &cpuImplementerStr);
if (error) return error;
cpu->coresLogical = (uint16_t) get_nprocs_conf();
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)
{
@@ -290,83 +351,23 @@ const char* ffDetectCPUImpl(const FFCPUOptions* options, FFCPUResult* cpu)
ffStrbufAppend(&cpu->name, &cpuIsa);
}
#ifdef __aarch64__
uint32_t cpuImplementer = (uint32_t) strtoul(cpuImplementerStr.chars, NULL, 16);
ffStrbufSetStatic(&cpu->vendor, hwImplId2Vendor(cpuImplementer));
#endif
#ifdef __ANDROID__
detectAndroid(cpu);
#endif
#if defined(__linux__) && defined(__aarch64__)
#if defined(__linux__) && defined(__aarch64__) && !defined(__ANDROID__)
detectAsahi(cpu);
#endif
#ifdef __aarch64__
if (cpu->name.length == 0)
{
FF_STRBUF_AUTO_DESTROY buffer = ffStrbufCreate();
if (ffProcessAppendStdOut(&buffer, (char *const[]) { "lscpu", NULL }) == NULL)
{
char* pstart = buffer.chars;
if (cpu->vendor.length == 0)
{
pstart = strstr(pstart, "Vendor ID:");
if (pstart)
{
pstart += strlen("Vendor ID:");
while (isspace(*pstart)) ++pstart;
if (*pstart)
{
char* pend = strchr(pstart, '\n');
if (pend != NULL)
ffStrbufAppendNS(&cpu->vendor, (uint32_t) (pend - pstart), pstart);
else
{
ffStrbufAppendS(&cpu->vendor, pstart);
}
pstart = pend + 1;
if (pstart >= buffer.chars + buffer.length)
return NULL;
}
}
else
{
pstart = buffer.chars;
}
}
while ((pstart = strstr(pstart, "Model name:")))
{
pstart += strlen("Model name:");
while (isspace(*pstart)) ++pstart;
if (*pstart == '\0')
break;
if (cpu->name.length > 0)
ffStrbufAppendS(&cpu->name, " + ");
if (*pstart == '-')
{
if (cpu->vendor.length > 0)
ffStrbufAppend(&cpu->name, &cpu->vendor);
else
ffStrbufAppendS(&cpu->name, "Unknown");
++pstart;
continue;
}
char* pend = strchr(pstart, '\n');
if (pend != NULL)
ffStrbufAppendNS(&cpu->name, (uint32_t) (pend - pstart), pstart);
else
{
ffStrbufAppendS(&cpu->name, pstart);
break;
}
pstart = pend + 1;
if (pstart >= buffer.chars + buffer.length)
return NULL;
}
}
}
detectArmName(cpuinfo, cpu, cpuImplementer);
#endif
return NULL;
}
+1 -1
View File
@@ -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");
+7 -7
View File
@@ -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)
+2
View File
@@ -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))
+1 -1
View File
@@ -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
+4
View File
@@ -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;
+12 -5
View File
@@ -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,15 @@ 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;
return display;
}
void ffConnectDisplayServerImpl(FFDisplayServerResult* ds);
+9 -3
View File
@@ -58,8 +58,12 @@ 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;
} FFDisplayResult;
typedef struct FFDisplayServerResult
@@ -74,7 +78,7 @@ typedef struct FFDisplayServerResult
const FFDisplayServerResult* ffConnectDisplayServer();
bool ffdsAppendDisplay(
FFDisplayResult* ffdsAppendDisplay(
FFDisplayServerResult* result,
uint32_t width,
uint32_t height,
@@ -85,4 +89,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>
@@ -7,10 +8,11 @@
#include <CoreGraphics/CGDirectDisplay.h>
#include <CoreVideo/CVDisplayLink.h>
#ifdef MAC_OS_X_VERSION_10_15
extern CFDictionaryRef CoreDisplay_DisplayCreateInfoDictionary(CGDirectDisplayID display) __attribute__((weak_import));
#ifndef MAC_OS_X_VERSION_10_15
#import <IOKit/graphics/IOGraphicsLib.h>
extern CFDictionaryRef CoreDisplay_IODisplayCreateInfoDictionary(io_service_t framebuffer, IOOptionBits options) __attribute__((weak_import));
extern Boolean CoreDisplay_Display_IsHDRModeEnabled(CGDirectDisplayID display) __attribute__((weak_import));
#else
#include <IOKit/graphics/IOGraphicsLib.h>
#endif
static void detectDisplays(FFDisplayServerResult* ds)
@@ -36,38 +38,32 @@ 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);
}
}
FF_STRBUF_AUTO_DESTROY name = ffStrbufCreate();
CFDictionaryRef FF_CFTYPE_AUTO_RELEASE displayInfo = NULL;
#ifdef MAC_OS_X_VERSION_10_15
if(CoreDisplay_DisplayCreateInfoDictionary)
{
CFDictionaryRef FF_CFTYPE_AUTO_RELEASE displayInfo = CoreDisplay_DisplayCreateInfoDictionary(screen);
if(displayInfo)
{
CFDictionaryRef productNames;
if(!ffCfDictGetDict(displayInfo, CFSTR(kDisplayProductName), &productNames))
ffCfDictGetString(productNames, CFSTR("en_US"), &name);
}
}
displayInfo = CoreDisplay_DisplayCreateInfoDictionary(screen);
#else
if(CoreDisplay_IODisplayCreateInfoDictionary)
{
io_service_t servicePort = CGDisplayIOServicePort(screen);
CFDictionaryRef FF_CFTYPE_AUTO_RELEASE displayInfo = CoreDisplay_IODisplayCreateInfoDictionary(servicePort, kIODisplayOnlyPreferredName);
if(displayInfo)
{
CFDictionaryRef productNames;
if(!ffCfDictGetDict(displayInfo, CFSTR(kDisplayProductName), &productNames))
ffCfDictGetString(productNames, CFSTR("en_US"), &name);
}
displayInfo = IODisplayCreateInfoDictionary(servicePort, kIODisplayOnlyPreferredName);
}
#endif
if(displayInfo)
{
CFDictionaryRef productNames;
if(!ffCfDictGetDict(displayInfo, CFSTR(kDisplayProductName), &productNames))
ffCfDictGetString(productNames, CFSTR("en_US"), &name);
}
ffdsAppendDisplay(ds,
CGSize size = CGDisplayScreenSize(screen);
FFDisplayResult* display = ffdsAppendDisplay(ds,
(uint32_t)CGDisplayModeGetPixelWidth(mode),
(uint32_t)CGDisplayModeGetPixelHeight(mode),
refreshRate,
@@ -77,8 +73,27 @@ 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;
}
if (CoreDisplay_Display_IsHDRModeEnabled)
{
display->hdrEnabled = CoreDisplay_Display_IsHDRModeEnabled(screen);
}
}
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,27 @@ 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->bitDepth = (uint8_t) advColorInfo.bitsPerColorChannel;
}
}
}
}
}
@@ -7,6 +7,43 @@
#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)
@@ -50,15 +87,21 @@ 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 (ds->wmProtocolName.length == 0)
getWMProtocolNameFromEnv(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 +111,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 +133,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
+21 -6
View File
@@ -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

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