Compare commits

..

446 Commits

Author SHA1 Message Date
Carter Li cec38b9501 Merge pull request #1069 from fastfetch-cli/dev
Release: v2.17.2
2024-07-04 08:33:15 +08:00
李通洲 3453b72f0c Release: v2.17.2 2024-07-03 20:03:06 +08:00
李通洲 060544b899 Packages (Linux): detect flatpak-app only
The runtime packages detection was inaccurate. The official `flatpak
list` ignores some packages (notablily *.Locale) but the logic is
currently unknown.
2024-07-03 20:01:27 +08:00
李通洲 14c6b6d7e2 Doc: update changelog 2024-07-03 16:42:55 +08:00
李通洲 9df394bba3 Revert "OS (Linux): prioritize prettyName over name"
This reverts commit ecd69370ab.
2024-07-03 16:37:51 +08:00
李通洲 b25ffda90b PhysicalDisk: silence compiler warnings 2024-07-03 16:24:17 +08:00
李通洲 db9cf4ef29 CMake: add option ENABLE_LTO 2024-07-03 16:10:34 +08:00
李通洲 7b2d4b7a0d Wifi: silence compiler warnings 2024-07-03 15:27:06 +08:00
李通洲 64cdb3f058 LocalIP: silence compiler warnings 2024-07-03 15:26:53 +08:00
李通洲 66e7924fa3 Logo (Image): fix building on SunOS 2024-07-03 15:12:48 +08:00
李通洲 84540250f7 Editor: make --ts-version false disable version detection 2024-07-03 13:59:39 +08:00
李通洲 96e7f65902 DE (Linux): fix silly bug 2024-07-03 13:56:35 +08:00
Carter Li 321d3e5574 CMake: don't error out if we fail to detect glibc version 2024-07-03 09:54:48 +08:00
Carter Li 2bba2eaa16 WM: minor code cleanup 2024-07-03 09:54:48 +08:00
Carter Li 58ebde422a WMTheme: support cinnamon-wayland 2024-07-03 09:54:48 +08:00
Carter Li 06f3b9a96d DE (Linux): improve Cinnamon version detection
Fix #1068
2024-07-03 09:54:21 +08:00
李通洲 fa5aaa692f Doc: update copyright [ci skip] 2024-07-02 15:12:28 +08:00
李通洲 9d2c4f52d2 CI: clean up 2024-07-02 15:00:39 +08:00
李通洲 9946a5d758 CI: add stale.yml [ci skip] 2024-07-02 14:14:16 +08:00
Carter Li a749014e7c Kernel: code refactor 2024-07-02 10:47:14 +08:00
LinuxOnTheDesktop 2cd421fc2e Doc: correct various errors of English (#1065)
Including but not limited to: number agreement; punctuation
2024-07-02 10:45:36 +08:00
李通洲 4db6aebcc9 TerminalFont (Linux): support Ptyxis 2024-07-01 23:56:53 +08:00
李通洲 3b156e819b Terminal (Linux): support ptyxis version detection 2024-07-01 23:56:19 +08:00
Diego Viola 7ffed9e911 DE: Fix spelling of LXQt (#1063)
Signed-off-by: Diego Viola <diego.viola@gmail.com>
2024-07-01 16:00:35 +08:00
李通洲 9042950ee8 Color: if value is already an ANSI escape code, use it 2024-07-01 15:04:51 +08:00
Diego Viola 7aad0dc32f Theme: Fix spelling of Qt (#1062)
Signed-off-by: Diego Viola <diego.viola@gmail.com>
2024-07-01 14:38:29 +08:00
李通洲 01d04a8fa2 PhysicalMemory: remove an unused variable 2024-07-01 13:54:57 +08:00
Carter Li d3e50fe595 Packaging: update debian stuff [ci skip] 2024-07-01 13:34:28 +08:00
Carter Li ecd69370ab OS (Linux): prioritize prettyName over name 2024-07-01 08:56:00 +08:00
李通洲 abd2522268 JsonSchema: add formattion keys for CpuUsage module
Fix #1060
2024-06-30 20:01:57 +08:00
李通洲 2e1261bc21 PhysicalMemory: fix incorrect size value for large memory sticks
Fix #1061 (integer overflow)
2024-06-30 19:13:58 +08:00
李通洲 0e597a2ded Battery: fix index format with multiple batteries 2024-06-29 21:59:57 +08:00
scarf 2781a0ab93 docs: document --logo none (#1059) 2024-06-29 19:32:36 +08:00
李通洲 02d7f2693b Doc: fix document of --pipe [ci skip]
Fix #1058
2024-06-29 18:53:52 +08:00
Carter Li b001ea409b Merge pull request #1056 from fastfetch-cli/dev
Release: v2.17.1
2024-06-29 08:20:39 +08:00
李通洲 f97a9fdfc0 GPU: don't print 16 EiB 2024-06-29 07:55:01 +08:00
李通洲 2c8d5292d7 Release: v2.17.1 2024-06-29 07:29:53 +08:00
李通洲 88e4579f1e Fastfetch: fix segfaults with --show-errors and an invalid module
Fix #1055
2024-06-29 07:16:35 +08:00
Carlos & 8f97e61f67 Theme (QT): ignore QVariant format (#1054)
Closes: #1053

---------

Co-authored-by: Carter Li <CarterLi@users.noreply.github.com>
2024-06-29 07:14:36 +08:00
李通洲 0b943bb25e GPU: print formatted size when --gpu-format is used
Fix #1052
2024-06-28 22:24:02 +08:00
李通洲 19590003e1 GPU: guard GPU frequency behind driverSpecific 2024-06-28 22:17:37 +08:00
李通洲 27a1d9f8c6 Logo (Image): fix building on Windows 2024-06-28 18:08:16 +08:00
李通洲 d50ebc86c7 CMake (Windows): don't generate libffwinrt.dll.a 2024-06-28 15:15:49 +08:00
Carter Li 74616c79f5 Merge pull request #1050 from fastfetch-cli/dev
Release: v2.17.0
2024-06-28 11:31:00 +08:00
Carter Li 0c1462898b TerminalShell / TerminalFont: fix CodeQL warnings 2024-06-28 10:50:37 +08:00
Carter Li b94a322dfc Release: v2.17.0 2024-06-28 10:34:42 +08:00
Carter Li adb6dc537c Doc: update readme & changelog 2024-06-28 10:33:18 +08:00
Carter Li debcc3ca7f Logo (Image): improve performance when image is cached 2024-06-28 10:28:43 +08:00
Carter Li 3d7d02b5c5 Logo (Image): support --logo-position right 2024-06-28 10:28:43 +08:00
Carter Li 3f0ae13505 JsonConfig: clarify the breaking change 2024-06-28 10:28:43 +08:00
李通洲 4370c0944b Format: trim white spaces after truncation 2024-06-27 23:20:31 +08:00
李通洲 a9df048d49 Logo (Image): support --logo-position right for iterm and kitty-direct 2024-06-27 20:49:56 +08:00
Carlos Eduardo 09782d67e5 QT: add qt[56]ct support 2024-06-27 17:55:48 +08:00
Carlos Eduardo 165aa93fd3 QT: import kvantum theme name 2024-06-27 17:55:48 +08:00
李通洲 d979f55c8e Modules: fix custom key not working if the key is formatted outside
Fix #1049
2024-06-27 17:51:57 +08:00
李通洲 4f261509a0 Logo (Builtin): support --logo-position right
Fix #1034
2024-06-27 17:51:16 +08:00
李通洲 6413656cea Logo: rename --logo-separate to --logo-position 2024-06-27 13:49:35 +08:00
Jack Nolddor a334b805fd CMake: Use Coordinated Universal Time rather than timezone-varying local date (#1046) 2024-06-26 21:08:47 +08:00
李通洲 f940ef0592 Doc: fix typo [ci skip] 2024-06-26 21:07:39 +08:00
Jack Nolddor 963b5c6c4e Doc: Make format description more clear at json_schema.json (#1045) [ci skip] 2024-06-26 20:17:09 +08:00
李通洲 4a74f69c96 Doc: clearify that we don't support truncate multi-byte chars [ci skip] 2024-06-26 16:24:06 +08:00
李通洲 18d36c5054 Format: support argument truncation
Fix #1043
2024-06-26 16:15:26 +08:00
李通洲 a4614ec412 IO (Windows): implement ffSuppressIO 2024-06-26 13:50:42 +08:00
李通洲 e257f876ae TerminalSize (Windows): make it work when stdin or stdout is redirected 2024-06-26 10:51:44 +08:00
李通洲 e9031171c0 Doc: update changelog [ci skip] 2024-06-26 10:14:03 +08:00
李通洲 47a9cf0450 IO: enable terminal query in --pipe mode 2024-06-26 10:01:36 +08:00
李通洲 1704dc62e0 Doc: add debian in README [ci skip] 2024-06-25 18:15:14 +08:00
李通洲 abf6c403d4 Fastfetch: add JSON config general.preRun 2024-06-25 16:15:35 +08:00
李通洲 0606cde061 TerminalFont (Linux): fix XTGETTCAP response is printed in console when query kitty term font 2024-06-25 16:10:54 +08:00
李通洲 0bc9149a23 IO: improve ffGetTerminalResponse 2024-06-25 16:09:19 +08:00
李通洲 071be4794f Builtin (Asahi): fix logo color 2024-06-25 10:03:19 +08:00
李通洲 b5e199d2b2 IO (Linux): make sure stdin and stdout are tty when querying terminal 2024-06-25 09:43:31 +08:00
李通洲 a210128592 OS (macOS): correctly set pretty name 2024-06-25 08:41:44 +08:00
李通洲 63a28cc8f4 CI (Windows): bundle amd_ags dlls 2024-06-24 16:57:10 +08:00
李通洲 a6c006221d GPU (AMD): fix use-after-free crashes
Ref: https://github.com/fastfetch-cli/fastfetch/issues/1032
2024-06-23 09:14:00 +08:00
李通洲 42b84161d9 GPU (Windows): don't assume revId is not 0 2024-06-23 08:57:06 +08:00
李通洲 88e075ad9d CMake: remove option ENABLE_PROPRIETARY_GPU_DRIVER_API 2024-06-22 22:03:28 +08:00
李通洲 e37ad26729 GPU (Nvidia): fix definition of nvmlMemory_v2 2024-06-22 21:52:20 +08:00
李通洲 b500e9c09b Terminal: add fast path of version and font detection for kitty
Ref: https://github.com/fastfetch-cli/fastfetch/discussions/1030#discussioncomment-9845233
2024-06-22 15:43:25 +08:00
李通洲 77fbfd3fbd GPU (Windows): detect GPU type with AMD driver
Ref: #1032
2024-06-22 08:10:52 +08:00
Carter Li 63cdc47d18 GPU (SunOS): fix detection 2024-06-21 23:29:08 +08:00
Carter Li edf24d9820 CPUCache: add detection by SMBIOS 2024-06-21 23:07:07 +08:00
李通洲 becd9b7f26 LM (Linux): fix invalid path
Fix #1031
2024-06-21 20:28:06 +08:00
李通洲 672604081a Doc: update json_schema [ci skip] 2024-06-21 10:49:29 +08:00
李通洲 3185969974 CMake (Windows): install libffwinrt.dll 2024-06-21 09:43:18 +08:00
李通洲 ddbafd1cca OpenCL: use the newest supported OpenCL version 2024-06-21 09:18:08 +08:00
李通洲 16d70eed03 GPU: report deviceId in JSON output 2024-06-21 08:57:08 +08:00
李通洲 bf15adf57a OpenCL (Linux): fix crashing on AlpineLinux 2024-06-21 08:45:21 +08:00
李通洲 dbd1f96353 OpenCL: don't use NULL as platform id 2024-06-20 19:44:08 +08:00
李通洲 8b3cff33da OpenCL: use strong typing 2024-06-20 15:54:08 +08:00
李通洲 146c9b2bc6 OpenCL: fix building when OpenCL is disabled 2024-06-20 15:34:09 +08:00
李通洲 3c7cb339e2 OpenCL: fix building on non-apple platforms 2024-06-20 15:14:52 +08:00
李通洲 6318668d0b GPU: support detect gpu devices with OpenCL 2024-06-20 15:14:52 +08:00
李通洲 6737896038 CMake: enable OpenCL detection on Android
doesn't work on my smartphone
2024-06-20 15:14:52 +08:00
李通洲 96fc1db85e OpenCL: detect GPU info 2024-06-20 15:14:52 +08:00
李通洲 03e6b47eda CMake: remove unused dependencies 2024-06-20 15:14:52 +08:00
李通洲 067396d3a0 CI (Windows): add missing opencl headers 2024-06-20 15:14:52 +08:00
Robin Candau a8c3979696 Add the missing '--users-myself-only' option in bash completions (#1027)
undefined
2024-06-19 15:35:40 +08:00
Carter Li 786b23ef52 Packaging: update debian stuff [ci skip] 2024-06-19 14:55:57 +08:00
Carter Li ca6e889a63 Merge pull request #1026 from fastfetch-cli/dev
Release: v2.16.0
2024-06-19 14:38:23 +08:00
李通洲 439ed07660 Doc: update readme; fix typo [ci skip] 2024-06-19 14:35:51 +08:00
李通洲 d435ef6a77 Release: v2.16.0 2024-06-19 14:07:12 +08:00
李通洲 e7e5e89207 Presets: add Inspired by [ci skip] 2024-06-19 13:54:39 +08:00
李通洲 eb1f378a6e Presets: add a new example 2024-06-19 13:48:53 +08:00
Carter Li e2ce06dda2 Doc: update changelog [ci skip] 2024-06-19 13:24:49 +08:00
Carter Li e9bc312b38 LocalIP: support MTU in localip-format 2024-06-19 10:58:05 +08:00
Carter Li 9351c48d57 OS (Windows): set idLike to Windows 2024-06-19 10:14:38 +08:00
Carter Li 07b3cf325b Logo (Builtin): update arch3 2024-06-19 09:59:26 +08:00
Princess-Sunset-Shimmer 616c99a05d Logo: Create arch3.txt (#1022)
the third /\rch logo
2024-06-19 09:55:51 +08:00
Carter Li e554ff6e4f SunOS: remove unused files [ci skip] 2024-06-19 09:55:10 +08:00
李通洲 f013a60cf5 CI: add SunOS 2024-06-18 23:00:06 +08:00
李通洲 bb1586e9a2 CMake (SunOS): enable more things 2024-06-18 22:10:22 +08:00
李通洲 edba2492e1 OS (SunOS): don't parse unstructured text 2024-06-18 22:06:40 +08:00
李通洲 57b3c3951e CPU (SunOS): remove trailing \0 2024-06-18 22:06:40 +08:00
李通洲 cd2a6e0906 GPU (SunOS): parse scanpci -v, which doesn't require root permission 2024-06-18 21:52:25 +08:00
Carter Li c180ddab28 SunOS: improve WM detection 2024-06-18 10:51:26 +08:00
Carter Li 77ab00a4f4 SunOS: support NetIO detection 2024-06-18 10:18:12 +08:00
李通洲 4e5c93315a OpenGL: print used ogl library 2024-06-17 23:55:32 +08:00
Carter Li 935bea962f SunOS: support DiskIO 2024-06-17 23:41:53 +08:00
Carter Li 1b29f5b3a5 SunOS: support CPUUsage detection 2024-06-17 22:51:40 +08:00
Carter Li d296e53213 CPUUsage (BSD): fix totalAll calculation 2024-06-17 22:51:02 +08:00
Carter Li 5926c259ed SunOS: support MTU & MAC addr detection 2024-06-17 22:29:18 +08:00
Carter Li 2a19067ce7 SunOS: detect default route, so that LocalIP module works 2024-06-17 21:30:56 +08:00
Carter Li 06aaf0f3fd SunOS: support disk detection; fix a small bug 2024-06-17 19:32:54 +08:00
Carter Li 1d6a48e49a SunOS: support swap & opengl detection 2024-06-17 16:43:52 +08:00
Carter Li 72d332772d SunOS: support memory usage detection 2024-06-17 15:52:45 +08:00
Carter Li 255c6a09ac CPU (SunOS): optimise ncpu detection 2024-06-17 15:49:59 +08:00
Carter Li 74a364e3f2 SunOS: support loadavg detection 2024-06-17 15:23:35 +08:00
Carter Li 76b8446d15 InitSystem (SunOS): fix crashes 2024-06-17 15:18:02 +08:00
Carter Li 94fb7eabfd SunOS: enable a lot of features 2024-06-17 15:13:26 +08:00
Carter Li 6473db86a3 SunOS: support shell & terminal detection 2024-06-17 14:47:47 +08:00
Carter Li 804c61b7c1 Platform (Linux): fix invalid call to realpath(3) 2024-06-17 14:47:47 +08:00
Carter Li 898bf1edd9 SunOS: support InitSystem 2024-06-17 14:47:47 +08:00
Carter Li 507caa7b49 Editor: detect version of pluma 2024-06-17 14:47:47 +08:00
Carter Li d05b6a25c3 SunOS: support GPU detection 2024-06-17 14:47:47 +08:00
李通洲 a11f99cce5 Android: fix build 2024-06-17 01:20:04 +08:00
Carter Li 1841e1a99d SunOS: support CPU & packages detection 2024-06-17 01:01:21 +08:00
Carter Li d727547b1c SunOS: make SMBIOS related modules work 2024-06-16 22:25:16 +08:00
Carter Li d35490aeef Fastfetch: make it compile on SunOS 2024-06-16 01:02:48 +08:00
李通洲 5539fecb99 LocalIP: detect MTU 2024-06-14 18:23:04 +08:00
Антон cff2a18466 Logo: Added logos (standard and small) for RedOS (#1015)
* Add logo files

* Add RedOS logos to `builtin.c`
2024-06-13 19:31:58 +08:00
Gabry 8a923835ad Logo: Add support for Manjaro ARM to logo detection (#1013) 2024-06-13 19:20:41 +08:00
李通洲 2bd507c890 Presets: add a new example [ci skip]
Ref: https://www.reddit.com/r/fastfetch/comments/1dditqj/how_can_i_config_fastfetch_like_this/
2024-06-12 22:46:11 +08:00
李通洲 19690656a2 Presets: update examples/20 2024-06-12 21:26:04 +08:00
李通洲 36dc3c7263 Loadavg: add option --loadavg-compact and --loadavg-percent-<color> 2024-06-12 21:26:04 +08:00
李通洲 b38eb705f9 Users: add config gen for myselfOnly 2024-06-12 20:48:41 +08:00
李通洲 0a899e1e80 DNS: add option --dns-show-type 2024-06-12 20:48:41 +08:00
李通洲 218c553841 Presets: dont show empty mac addrs 2024-06-12 17:22:44 +08:00
李通洲 e284fee4aa Presets: print DNS info in examples/20; optimise 2024-06-12 16:41:47 +08:00
李通洲 124823e643 DNS: print IPv4 first 2024-06-12 16:39:09 +08:00
李通洲 dafc4ed3fb DNS (Windows): add support
Currently reports IPv4 addrs only
2024-06-12 16:33:13 +08:00
李通洲 1c05e65bc0 DNS (Linux): parse /etc/resolv.conf directly 2024-06-12 15:52:09 +08:00
Carter Li e0910777af DNS: add new module 2024-06-12 15:52:09 +08:00
李通洲 df0fb93542 Media (macOS): optimise 2024-06-12 15:52:09 +08:00
李通洲 30135570c7 OS (macOS): add code name of Sequoia 2024-06-12 15:52:09 +08:00
Carter Li 20cef09c73 Presets: add a new example 2024-06-12 15:52:09 +08:00
Carter Li 5bb4dabaec Users: add new option --users-myself-only 2024-06-12 15:52:09 +08:00
Carter Li ebfcd7195e Fastfetch: fix display.bar.border{Left,Right} doesn't work in JSON config 2024-06-12 13:40:06 +08:00
李通洲 671f5e2cec Media (Windows): fix compiling for GCC 2024-06-11 19:48:25 +08:00
李通洲 cf4ed9d9dc Media (Windows): finalize Windows support 2024-06-11 16:41:57 +08:00
李通洲 c4751eb834 Media (Windows): build winrt stuff statically 2024-06-11 15:46:30 +08:00
李通洲 ff3ddc774e Media (Windows): detect with external DLL
For backup only
2024-06-11 15:24:33 +08:00
李通洲 9104db0d21 Builtin (Logo): add tuxdeo
Fix #1000
2024-06-09 11:42:44 +08:00
李通洲 7eb86b4e95 OS (Linux): don't priortitize lsb-release over os-release 2024-06-09 11:33:42 +08:00
李通洲 06fa6033f0 Sound (Linux): trim white spaces in device name
Fix #1005
2024-06-08 18:45:34 +08:00
李通洲 f058d70d89 Logo (Mauna): add new logo 2024-06-08 09:15:45 +08:00
李通洲 58f7d6fed4 CPUCache (Linux): report error if cache size is unavailable (Android) 2024-06-07 20:43:26 +08:00
李通洲 95f8eccebb CPUCache: silence warnings 2024-06-07 19:28:35 +08:00
李通洲 e1245fe2e5 CI: add riscv64 build 2024-06-07 15:56:36 +08:00
李通洲 4332b09c8c Presets: add one more example [ci skip]
Ref: https://github.com/fastfetch-cli/fastfetch/issues/728#issuecomment-2154162576
2024-06-07 15:07:22 +08:00
Carter Li 13b488a33c Packaging: update debian stuff [ci skip] 2024-06-07 13:55:00 +08:00
Carter Li 80fb41a5c8 Merge pull request #1001 from fastfetch-cli/dev
Release: v2.15.0
2024-06-07 03:42:06 +00:00
李通洲 8371153e79 CPUCache: silence CodeQL warnings 2024-06-07 11:18:03 +08:00
李通洲 df0608c774 SMBIOS: ignore more trashes 2024-06-07 11:06:47 +08:00
李通洲 9a6961a706 Release: v2.15.0 2024-06-07 10:43:04 +08:00
李通洲 dbe0c84c48 OS (Linux): don't display duplicate entries 2024-06-07 10:37:33 +08:00
Carter Li 91724c0170 OS (Linux): fix kubuntu detection
Ref: #1000
2024-06-07 10:18:31 +08:00
Carter Li 5df5bbf85b Global: better handling locales 2024-06-07 10:00:30 +08:00
Carter Li 896468195a Doc: update changelog 2024-06-07 09:08:31 +08:00
Carter Li b324e4f664 Global: only enable locale if necessary
Fix  #995
2024-06-07 08:59:58 +08:00
李通洲 550eeb850c Doc: update changelog [ci skip] 2024-06-06 20:24:59 +08:00
李通洲 43cb5f3d0c Presets: update examples [ci skip] 2024-06-06 20:22:46 +08:00
Dariqq 999f52b0b7 Packages (Linux): Improve speed of Guix package detection. (#999)
Instead of waiting for guix to parse the manifest file of a profile
parse it directly by counting "/gnu/store" entries and fitlering out duplicates.

The new implementation now also accounts for propagated-inputs of packages.

Co-authored-by: Carter Li <zhangsongcui3371@sina.com>
2024-06-06 10:06:56 +00:00
李通洲 eae73883db DE (Linux): correctly capitalize GNOME
Fix #997
2024-06-06 16:43:55 +08:00
Skye Chappelle 92ffaf77de Doc: update bug_report.md (#998)
A bunch of pedantic, silly changes to the bug report template.
2024-06-06 16:39:20 +08:00
李通洲 10f5fa1e7d Percentage: add --bar-border-{left|right}; remove --bar-border 2024-06-06 16:36:57 +08:00
李通洲 3f4c03b172 Presets: update 9.jsonc to show percent bars 2024-06-06 16:12:21 +08:00
李通洲 ce2280ae54 Presets: add more examples 2024-06-06 16:03:00 +08:00
李通洲 25cdd9969f Color: support {#keys} and {#title} in --<module>-format 2024-06-06 15:17:10 +08:00
李通洲 bf17854535 Presets: more examples 2024-06-06 11:00:47 +08:00
李通洲 8440142d75 InitSystem: fix memory leaks 2024-06-06 09:25:02 +08:00
李通洲 2e865ad511 Doc: update changelog 2024-06-05 19:22:27 +08:00
李通洲 51953e4818 Doc: update cpucache and initsystem 2024-06-05 19:15:25 +08:00
李通洲 10fd7d61ae CPUCache: support format output
Fix #992
2024-06-05 18:55:08 +08:00
李通洲 a4c7278f36 wip 2024-06-05 16:18:54 +08:00
李通洲 93792822c0 Shell: fix fastfetch is detected as shell when abused
Fix #994
2024-06-05 16:11:52 +08:00
李通洲 b308ded1e1 Global (Linux): silence some compiler warnings 2024-06-05 16:11:52 +08:00
Carter Li f2ff20d69c CPUCache (Linux): detect cache line size 2024-06-05 16:11:52 +08:00
李通洲 e8ddd33614 CPUCache (macOS): detect cache line size 2024-06-05 16:11:52 +08:00
李通洲 1e5a6b2eef CPUCache (FreeBSD): fix build 2024-06-05 15:45:26 +08:00
李通洲 84c2564c54 CPUCache (Windows): detect cache line size 2024-06-05 15:44:36 +08:00
李通洲 00f7334a3a CPUCache (macOS): add support 2024-06-05 14:35:25 +08:00
Carter Li df9144ea31 CpuCache: move to a new module; add linux impl 2024-06-05 14:35:25 +08:00
李通洲 f1eaeddfe1 CPU (Windows): detect CPU caches 2024-06-04 23:56:00 +08:00
李通洲 2c537c836c Colors: normalize bright colors
Fix #991
2024-06-04 16:42:58 +08:00
李通洲 cc1359b1c8 3rdparty (igcl): write our implementation 2024-06-04 16:32:50 +08:00
李通洲 d25470e312 3rdparty (mk_wcwidch): clarify it's MIT compatible 2024-06-04 16:32:35 +08:00
李通洲 899f176f21 Logo: fix while chars not visible in terminal of light theme 2024-06-04 14:23:30 +08:00
李通洲 2557b0033d Logo: use -l '?' to show a question mark as logo 2024-06-04 10:18:07 +08:00
李通洲 add3047d1a Presets: add examples/14 2024-06-03 16:37:47 +08:00
李通洲 5cc4379bdf Presets: add screenfetch 2024-06-03 16:35:22 +08:00
李通洲 5290dd0187 Global: fix building 2024-06-03 14:54:55 +08:00
李通洲 69181c063e Doc: update document of --format json 2024-06-03 14:49:31 +08:00
李通洲 0b75caaf96 Chore: strcasecmp => ffStrEqualsIgnCase 2024-06-03 14:17:01 +08:00
李通洲 d860ce528a Logo: code clean up 2024-06-03 14:15:45 +08:00
Carter Li 678e9471e5 Icons: make it possible to shorten the icons name 2024-06-03 11:05:01 +08:00
Carter Li 4328508e21 Theme: make it possible to shorten the theme name
Fix #724
2024-06-03 10:48:50 +08:00
Carter Li 96c70ffc8a Doc: document --format json 2024-06-03 08:42:28 +08:00
李通洲 6d71d3037f WM (macOS): assume wm plugins are daemon process
For reducing mis-detection
2024-05-31 14:54:43 +08:00
Maytham ba15324849 Remove shebangs from completions (#980)
Shebangs are only used for scripts that are intended to be executed, but
completions are meant to be sourced by the shell, and so shebangs are
not required.

I've also renamed the completions so that editors can continue to detect
the correct file format.
2024-05-30 21:37:05 +08:00
Maytham 231c277555 Add ability to skip installing license with INSTALL_LICENSE option (#981)
This is useful for Debian, where the package already includes copyright
information and therefore installing the license into
/usr/share/licenses is not needed.

Upstream support for an option to disable installing the license is much
better than patching it on the packaging side (which needs to be
continuously updated).
2024-05-30 21:36:57 +08:00
Carter Li c3e5222bcd Merge pull request #978 from fastfetch-cli/dev
Release: v2.14.0
2024-05-30 02:54:50 +00:00
李通洲 c0c76292cb Release: v2.14.0 2024-05-30 10:20:22 +08:00
李通洲 49840a8f70 Vulkan: print reason on error
Ref: #976
2024-05-30 10:13:19 +08:00
李通洲 44257b7ede Shell: don't try to get arg1 if python was executed without extra args 2024-05-30 09:58:06 +08:00
李通洲 d7e9094297 Shell (macOS): better xonsh detection
Fix #977
2024-05-30 09:31:25 +08:00
李通洲 1863bde916 InitSystem: better systemd version detection 2024-05-30 08:45:14 +08:00
李通洲 7c1b6c6a10 CI: test initsystem 2024-05-29 19:13:04 +08:00
李通洲 7e8b204644 InitSystem: resolve real path of exe path 2024-05-29 19:12:43 +08:00
李通洲 e8dc500f24 Processing (Linux): return errors more actively
fix assertion errors
2024-05-29 16:24:18 +08:00
李通洲 bb11cff700 InitSystem: detect version 2024-05-29 14:36:28 +08:00
李通洲 90690ba315 InitSystem: add new module
Fix #974
2024-05-29 11:14:39 +08:00
李通洲 3811bb1be4 TerminalShell: move process info query logic into common place 2024-05-28 23:43:15 +08:00
李通洲 1f3d18cdbc Doc: document --color-separator 2024-05-28 19:13:01 +08:00
李通洲 3ae2047364 Doc: update changelog 2024-05-28 19:12:08 +08:00
Carter Li 66ba5d0a5f Doc: document named placeholders 2024-05-28 16:34:11 +08:00
Carter Li 983e5c680f Display: add option --color-separator 2024-05-28 16:13:06 +08:00
Carter Li 745865d66a Presets: convert hard coded ANSI escape code to formatting placeholders 2024-05-28 16:10:24 +08:00
Carter Li 8bdca1b1a8 Formatting: small optimizations 2024-05-28 15:38:45 +08:00
Carter Li 5172a13b15 Global: fix outputColor doesn't work if module keys are disabled 2024-05-28 15:37:00 +08:00
Carter Li 3ba899261f Util: add ffCharIsDigit and use it 2024-05-28 15:34:59 +08:00
Carter Li 5fa18a8a1c Custom: detect & convert color placeholders ({#xxx}) 2024-05-28 14:23:19 +08:00
Carter Li 81e0af8999 Format: support named color placeholders 2024-05-28 14:03:51 +08:00
Carter Li a14a73b259 Doc: update changelog 2024-05-28 10:25:41 +08:00
Carter Li c8451cab52 Global: support for named format arguments
Fix #796
2024-05-28 10:23:29 +08:00
Dariqq 965777323e Packages (Linux): Add Guix package manager. (#972)
- Add 3 new count results: guixHome, guixSystem and guixUser.
- Add initial detection logic based on neofetch.
- Add a guixAll variable as sum of all guix results.
- Add options to disable guix detection.
2024-05-28 08:50:18 +08:00
Carter Li ad709c4153 README: update screenshot [ci skip] 2024-05-27 10:25:37 +08:00
李通洲 0869bfaeed Doc: update changelog [ci skip] 2024-05-27 09:40:58 +08:00
李通洲 dee208f3e3 Chore: remove unnecessary files [ci skip] 2024-05-27 08:49:47 +08:00
李通洲 7e1c426e34 README: add more installation methods [ci skip] 2024-05-26 10:16:32 +08:00
Carter Li 0ae2d389da CMake: we support FreeBSD only, not OpenBSD nor NetBSD 2024-05-26 10:16:32 +08:00
Anonyzard 20b433f40a Logo: Cereus Linux (#968)
* Logo: Add Cereus Linux

* Update cereus.txt

---------

Co-authored-by: Carter Li <CarterLi@users.noreply.github.com>
2024-05-26 09:39:44 +08:00
李通洲 152f5d3fa6 Revert "OS (Linux): remove special handling of Loc-OS"
This reverts commit 5ec272acff.
2024-05-26 09:38:35 +08:00
李通洲 b030bd6751 README: add example of FIGlet text logo [ci skip] 2024-05-25 15:22:28 +08:00
李通洲 e0d5a9024a Logo (File / Data): apply default color palettes 2024-05-25 14:36:20 +08:00
李通洲 f83a31e0a6 Presets: update examples/7.jsonc to fix archlinux compatibility 2024-05-25 09:54:42 +08:00
李通洲 099e2b5f8f Editor (Windows): support editor version detection 2024-05-24 23:50:19 +08:00
lucsansag 374997b599 Board: fix typo (#965) 2024-05-24 19:50:26 +08:00
李通洲 f938f5e03b CMake: remove useless code 2024-05-24 16:44:15 +08:00
李通洲 d7098e728d CMake: set link library dirs 2024-05-24 15:48:18 +08:00
Carter Li 5302a82444 Fastfetch: disable dlsym function call if dlopen is disabled 2024-05-24 15:30:35 +08:00
Carter Li 64a3573c49 Packaging: update debian stuff 2024-05-24 14:44:15 +08:00
Carter Li 3d48de8c98 CMake: be able to build as a dynamic linked binary 2024-05-24 14:40:14 +08:00
李通洲 4b33e1b691 Terminal (Windows): don't try to detect terminals in MSYS shell
May fix CI hanging
2024-05-24 11:07:52 +08:00
李通洲 6326405c26 Percentage: support monochrome bar type
Fix #961
2024-05-24 10:19:58 +08:00
李通洲 b25e8c2721 Fastfetch: list available presets in exe path
For better winget support
2024-05-24 09:18:48 +08:00
李通洲 81318f45bb Fastfetch: don't detect .conf in --list-config-paths 2024-05-24 09:09:12 +08:00
Carter Li 2f6cabb839 Library: prepare for static linking 2024-05-23 16:35:16 +08:00
李通洲 4fd65ad0b8 CI: try fixing musl build 2024-05-23 13:31:53 +08:00
李通洲 6ecb383a6a Editor: remove unused functions 2024-05-23 09:00:16 +08:00
Carter Li 1b3977fc47 Merge pull request #958 from fastfetch-cli/dev
Release v2.13.2
2024-05-22 12:12:15 +00:00
李通洲 f00969cb81 Editor: fix path detection not working on Android 2024-05-22 18:38:25 +08:00
李通洲 b3e79477a6 EDITOR: always print exe in JSON results 2024-05-22 16:40:37 +08:00
李通洲 82c7f27ae7 Release: v2.13.2 2024-05-22 16:32:35 +08:00
李通洲 624a4956fc CI: test more functions 2024-05-22 16:32:35 +08:00
李通洲 30a5dd52b1 Editor: add new module
Fix #430
2024-05-22 16:32:27 +08:00
李通洲 92136370bb CI: add bootmgr 2024-05-22 16:09:09 +08:00
李通洲 d196b8079e GPU (Linux): don't query DRM drivers for driver version
Fix #956
2024-05-22 13:37:50 +08:00
李通洲 a3dbac7dfc Completion (Fish): fix compatibility for old python versions 2024-05-22 10:34:07 +08:00
李通洲 59c853fb01 GPU: write & use our own simplified nvml header 2024-05-21 22:31:36 +08:00
李通洲 5ec272acff OS (Linux): remove special handling of Loc-OS
Unless a proper reason is provided
2024-05-21 18:53:31 +08:00
CuerdOS c72fdab301 Logo (Builtin): Added CuerdOS support (#954)
* Added CuerdOS support

* Update os_linux.c

* Update os_linux.c

---------

Co-authored-by: Carter Li <CarterLi@users.noreply.github.com>
2024-05-21 18:51:48 +08:00
李通洲 183f12d8b5 Presets: fix bad nerd icons 2024-05-21 15:47:37 +08:00
Carter Li 395810cd79 DisplayServer (Wayland): don't display eDP-1-unknown 2024-05-21 14:25:09 +08:00
Carter Li 36cf5856b5 Merge pull request #952 from fastfetch-cli/dev
Release: v2.13.1
2024-05-21 01:42:10 +00:00
李通洲 01d1336cf0 CPU (FreeBSD): remove unused variables 2024-05-21 09:28:21 +08:00
李通洲 28f2e9ea96 Release: v2.13.1 2024-05-21 09:24:53 +08:00
Carter Li 2d4e7f10c4 CPU: add option --show-pe-core-count 2024-05-21 09:21:03 +08:00
Carter Li aa1a5b8c36 CPU: fix CPU frequency not displayed if bios_limit doesn't exist
Regression of 264b6794f3
2024-05-21 08:44:49 +08:00
Carter Li 43bdb68cbf Merge pull request #949 from fastfetch-cli/dev
Release: v2.13.0
2024-05-20 13:28:45 +00:00
李通洲 8b43e331e3 GPU (Linux): silence compiler warnings 2024-05-20 21:07:28 +08:00
李通洲 302716fa61 GPU: silence compiler warnings 2024-05-20 20:43:24 +08:00
李通洲 188b6aba10 Release: v2.13.0 2024-05-20 20:40:25 +08:00
李通洲 7af9cab688 CI: try fixing Win32 build 2024-05-20 19:37:14 +08:00
李通洲 714b88c638 Packages (Linux): try fixing nix-user detection
Fix #937
2024-05-20 19:14:32 +08:00
李通洲 d9f1db10aa Completions (Fish): disable enum value suggestion 2024-05-20 19:05:38 +08:00
李通洲 bb10e1c9a3 Doc: update help message of --gpu-detection-method 2024-05-20 19:04:57 +08:00
李通洲 264b6794f3 CPU (Linux): detect bios limited frequency and print it by default
To match neofetch's behavior

Fix #947
2024-05-20 18:35:10 +08:00
Carter Li a8b734c877 GPU: change option --gpu-force-vulkan to --gpu-detection-method 2024-05-20 16:46:04 +08:00
Carter Li 10ca77610e GPU (Linux): detect GPU core count and freq for asahi linux 2024-05-20 15:32:13 +08:00
Carter Li c2eaea3665 Logo (Builtin): fix KDE neon
Fix #948
2024-05-20 15:31:18 +08:00
Carter Li 1619f0ab6c GPU (Linux): fix memory leaks 2024-05-20 11:00:51 +08:00
李通洲 aba211221b Doc: update README [ci skip] 2024-05-19 23:07:10 +08:00
李通洲 81485baadb CPU: better compatibility for Intel CPUs 2024-05-19 22:18:07 +08:00
李通洲 1b4fc38330 GPU (Linux): detect drm driver version 2024-05-19 22:18:06 +08:00
李通洲 3571d9277d CPU (Linux): take --cpu-freq-ndigits into account in --cpu-format 2024-05-19 22:18:06 +08:00
李通洲 e9b535d277 GPU (Linux): improve perf 2024-05-19 22:18:06 +08:00
李通洲 09ffd32144 GPU (Linux): improve Intel GPU detection code 2024-05-19 22:18:06 +08:00
Sergey Fedorov 27aa5c0343 opencl.c: unbreak build on macOS with no OpenCL support (#940)
Fixes: https://github.com/fastfetch-cli/fastfetch/issues/939
2024-05-19 21:51:46 +08:00
Sergey Fedorov 1d95f9b224 CMakeLists: unbreak build with GCC on macOS (#941) 2024-05-19 21:46:34 +08:00
李通洲 4f1cb779ab OS (Linux): fix BUILD_ID not parsed 2024-05-19 11:12:38 +08:00
Shu Niu 758ddae344 macOS: Add support for old MacOS version (#936)
* Add support for old MacOS version,  fix-1.

* Add support for old MacOS version,  fix-2.

* Add support for old MacOS version with fixing metal gpu api.

* Update disk_bsd.c

* Update disk_bsd.c

* Update gpu_apple.m

* Update monitor_apple.m

* Update os_apple.m

* Update wifi_apple.m

* Update camera_apple.m

* Update camera_apple.m

---------

Co-authored-by: Carter Li <CarterLi@users.noreply.github.com>
2024-05-19 09:31:08 +08:00
李通洲 14969b31d0 CPU (Windows): fix silly mistake 2024-05-18 20:53:11 +08:00
李通洲 d88e2eeb36 CPU (macOS): fix compiling 2024-05-18 19:57:24 +08:00
李通洲 7946e69a66 CPU: print core count for different core types 2024-05-18 18:08:38 +08:00
Carter Li 15766f5266 Disk (BSD): dont set createTime if stat fails to detect it 2024-05-18 13:38:07 +08:00
Carter Li ed02845c40 OS (Linux): better code name detection 2024-05-18 13:11:22 +08:00
Carter Li 4ffa0ffcb7 Disk (FreeBSD): ensure createTime is inited 2024-05-18 13:09:37 +08:00
Carter Li c04c040713 Wifi (FreeBSD): fix bssid & status detection 2024-05-18 11:58:35 +08:00
Matheus Castello c763896b49 Logo (builtin): Fix TorizonCore logo colors (#934)
You can verify the colors of the logo from https://www.torizon.io/

Signed-off-by: Matheus Castello <matheus.castello@toradex.com>
2024-05-18 11:57:21 +08:00
李通洲 e9a44f71b2 Bootmgr (Android): fix compiling 2024-05-18 11:08:21 +08:00
李通洲 5078c8d910 Revert "GPU (Windows): try removing limitation"
This reverts commit eda9496479.
2024-05-18 10:39:51 +08:00
李通洲 f9e0efb7ee Smbios: improve SMBIOS data reading code 2024-05-18 10:35:17 +08:00
Carter Li 926390508e CPU (FreeBSD): fix core count detection 2024-05-18 16:43:33 +08:00
Carter Li 45446c1c1d Bootmgr (FreeBSD): silence compiler warnings 2024-05-18 16:41:30 +08:00
Carter Li b79c47cac9 CPU (BSD): fix max freq detection 2024-05-18 01:50:21 +08:00
Carter Li fd16e69464 CPU (macOS): fix core count detection 2024-05-18 01:46:56 +08:00
李通洲 92abf3e063 TerminalShell (Linux): ignore valgrind 2024-05-18 00:34:08 +08:00
Carter Li 90a242a4aa CPU (BSD): detect max / min frequency; detect core count of different core types 2024-05-18 00:34:08 +08:00
furretpaws 1118c57d8f Logo (Builtin): Added "Furreto Linux" support (#927)
* added furreto

* fixed

* fix i think

* Update furreto.txt

Remove left padding and empty lines. Replace `${cN}` with `$N`

* Update builtin.c

---------

Co-authored-by: Carter Li <CarterLi@users.noreply.github.com>
2024-05-18 00:28:34 +08:00
李通洲 eda9496479 GPU (Windows): try removing limitation 2024-05-17 21:42:11 +08:00
李通洲 0b94ff5adb CPU (Windows): detect core count of different core types 2024-05-17 21:31:24 +08:00
李通洲 62bf3ec021 Util (Windows): add nt.h and use it 2024-05-17 21:30:47 +08:00
李通洲 ab2268a927 CPU (macOS): detect core count for different core types 2024-05-17 16:47:26 +08:00
Carter Li 1421627a47 CPU (Linux): detect core count for different core types 2024-05-17 08:35:22 +00:00
李通洲 02e5232bda TerminalShell: ignore clifm
Ref: https://github.com/leo-arch/clifm/issues/289
2024-05-17 13:57:07 +08:00
李通洲 289d03cfb2 Kernel (Windows): detect old release code name for Windows 10 2024-05-17 10:34:04 +08:00
李通洲 965ab1abc4 Packages: don't break existing config 2024-05-17 09:28:17 +08:00
Anonyzard 06b2ff9a08 Add Loc-OS Linux support (#926)
* Logo (Builtin): add Loc-OS

* Packages (Linux): add lpkg and lpkgbuild detection
2024-05-17 09:19:26 +08:00
李通洲 b4a6606faf Doc: update FAQ [ci skip] 2024-05-16 23:47:25 +08:00
李通洲 def758580f Doc: update FAQ [ci skip] 2024-05-16 23:34:40 +08:00
李通洲 5ea2b2ecc9 Doc: update FAQ [ci skip] 2024-05-16 23:26:07 +08:00
李通洲 b3886c6c47 Doc: update FAQ section [ci skip] 2024-05-16 21:58:43 +08:00
李通洲 bc76220a5b Doc: update JSON schema [ci skip] 2024-05-16 18:48:27 +08:00
李通洲 60fa7946f5 Logo (Builtin): fix build 2024-05-16 18:30:40 +08:00
SpoinkOSDevs b6a703bd56 Logo (builtin): Add SpoinkOS Logo [FIXED!] (#925)
* Update builtin.c

* Create spoinkos.txt

* Fix coding style

* Remove left padding

---------

Co-authored-by: Carter Li <CarterLi@users.noreply.github.com>
2024-05-16 16:44:01 +08:00
李通洲 462c3b0e06 Bios / Bootmgr: update descriptions 2024-05-16 16:37:57 +08:00
李通洲 72138dbde5 Bootmgr (macOS): add support 2024-05-16 16:27:37 +08:00
李通洲 b2ea5d8f3e Bootmgr: reuse shared code 2024-05-16 13:24:34 +08:00
Carter Li 49080c5361 Bootmgr (FreeBSD): add support
Requires root permission
2024-05-16 11:01:11 +08:00
李通洲 445dd94b53 Bootmgr: add new module 2024-05-15 21:49:15 +08:00
李通洲 7c03fc1550 Bios: move bootmgr detection to a new module 2024-05-15 21:40:18 +08:00
李通洲 06a8f12d6a Bios (Windows): detect secure boot state & boot manager
Boot manager detection requires Administrator privilege to work
2024-05-15 20:39:22 +08:00
Carter Li 8c7edf4d2d Bios (Linux): detect boot manager & secure boot 2024-05-15 19:00:26 +08:00
李通洲 85b4679373 Logo: fix Manjaro Linux
Fix #921
2024-05-14 22:04:37 +08:00
Carter Li 215029ea27 Merge pull request #919 from fastfetch-cli/dev
Release: v2.12.0
2024-05-14 15:53:45 +08:00
李通洲 533f54fb73 Doc: update changelog [ci skip] 2024-05-14 15:20:22 +08:00
李通洲 a6212c5b01 PhysicalMemory: add Ramaxel vendor id support 2024-05-14 14:11:12 +08:00
李通洲 ba76b18367 Fastfetch: remove support of flag based config 2024-05-14 14:08:54 +08:00
李通洲 4290efb49d Release: v2.12.0 2024-05-14 10:48:21 +08:00
李通洲 30b85fc169 JsonConfig: report row and column on JSON parsing errors 2024-05-14 10:47:20 +08:00
李通洲 dc94ac8d0c Doc: update json_schema 2024-05-14 10:25:29 +08:00
李通洲 1d9e612262 Presets: update [ci skip] 2024-05-14 09:11:27 +08:00
李通洲 be1791e386 LocalIP: add option --localip-show-all-ips 2024-05-13 23:33:06 +08:00
李通洲 3b8c2d6ee6 Logo (Builtin): add Quirinux 2024-05-13 22:27:35 +08:00
Null-Ping c661e55053 PhysicalMemory: Fix ram vendor names from ids. (#917)
Change 0x0198 from HyperX to Kingston to match https://www.jedec.org/standards-documents/docs/jep-106ab. (The standard does not contain an entry for HyperX at all).
Remove the ambiguous 0x1315 - according to the standard, it belongs to Tioga Technologies and not Crucial.
Rename Hynix to SK Hynix to match the standard.
2024-05-13 22:20:27 +08:00
李通洲 56403bab5c PhysicalMemory: try converting vendor ID to name 2024-05-13 20:29:46 +08:00
李通洲 caef317ade GPU: a tiny optimization 2024-05-13 19:33:31 +08:00
李通洲 131e01f35b Presets: add archey
Ref: https://github.com/HorlogeSkynet/archey4
2024-05-13 16:45:14 +08:00
李通洲 c8e3c6882a Kernel: print kernel name in default format 2024-05-13 16:41:00 +08:00
李通洲 c985bdbbfd Logo: add macOS3 2024-05-13 15:50:10 +08:00
李通洲 b80eb47ecd PhysicalMemory: better Linux compatibility 2024-05-13 15:08:27 +08:00
Carter Li 68942c1d3f PhysicalMemory (FreeBSD): fix EFAULT errors 2024-05-13 11:06:05 +08:00
李通洲 b36b74448f Doc: update changelog 2024-05-12 20:24:56 +08:00
李通洲 217bb6657e PhysicalMemory: fix output format 2024-05-12 20:17:57 +08:00
李通洲 df2862996b PhysicalMemory: detect ecc & bank locator 2024-05-12 19:55:04 +08:00
李通洲 df6ab6427e PhysicalMemory: improve default output format; detect part number 2024-05-12 19:15:03 +08:00
李通洲 82d848727c Logo (Builtin): fix alternate logo doesn't work with type builtin
Fix #914
2024-05-12 18:32:05 +08:00
李通洲 d0d6323b1f PhysicalMemory (FreeBSD): add support 2024-05-12 18:32:05 +08:00
李通洲 6439921f85 Smbios (Windows): check if getting SMBIOS data succeeds 2024-05-11 18:07:56 +08:00
李通洲 d28907ee9d PhysicalMemory (Linux): add support
Note: this module requires root permission to work in Linux
2024-05-11 18:05:30 +08:00
李通洲 41f0971570 PhysicalMemory: ignore trash values 2024-05-11 15:12:28 +08:00
李通洲 ab0bd79bb8 PhysicalMemory: add module to ci.jsonc and all.jsonc 2024-05-11 15:05:43 +08:00
李通洲 07747aa819 PhysicalMemory (macOS): add support 2024-05-11 15:05:43 +08:00
李通洲 68efcdd0dd PhysicalMemory: add new module 2024-05-11 15:05:43 +08:00
李通洲 fef3100fd7 Smbios: add struct layout check 2024-05-11 15:05:43 +08:00
Bernhard M. Wiedemann 08a940bfd4 Logo: Add the openSUSE Slowroll distribution (#913) 2024-05-11 15:03:13 +08:00
李通洲 d6a99c631e Image: support specifying --logo-width only for --kitty-direct and --iterm
Fix: #836

Ref: https://github.com/kovidgoyal/kitty/issues/7424
2024-05-10 14:30:00 +08:00
李通洲 3d4077c2d0 Config: support more color prefixes 2024-05-10 13:39:06 +08:00
djinnalexio ce6b595421 🔧 JsonConfig: add missing brightness properties 2024-05-10 11:13:47 +08:00
djinnalexio 7d8c085254 🔧 JsonConfig: add dim colors to validation 2024-05-10 11:13:47 +08:00
Souma ec0af17fb5 Terminal (macOS): fix compatibility with (*term) (#909)
Ignore <shell> (<char>term).
This is because Fig(<shell> (figterm)) migrated to CodeWhisperer(<shell> (cwterm)) and CodeWhisperer renamed to Q(<shell> (qterm)).
Future changes will all be ignored by this change.
Related: #676
2024-05-09 19:39:17 +08:00
李通洲 2accfbc894 Networking (Windows): fix compiling 2024-05-09 16:35:51 +08:00
李通洲 01d2fa1228 Doc: update changelog (ci skip) 2024-05-09 16:32:10 +08:00
李通洲 f16843d60f Doc: update changelog 2024-05-09 16:27:24 +08:00
李通洲 acc77ebddd PublicIP: add option --publicip-ipv6 2024-05-09 15:54:49 +08:00
李通洲 7eb145fb7f Presets: add loadavg to all.jsonc and ci.jsonc 2024-05-09 09:56:34 +08:00
Carter Li 34a6eb13c6 Loadavg (BSD): add missing headers 2024-05-09 09:51:41 +08:00
李通洲 0f5e746fe2 Loadavg: add option --loadavg-ndigits 2024-05-09 09:40:53 +08:00
李通洲 b62ad16aa6 Loadavg (BSD): use sysctl 2024-05-09 09:20:18 +08:00
李通洲 f79498e4b5 PublicIP / Weather: clarify error messages
Fix #907
2024-05-09 08:49:25 +08:00
李通洲 31c433b353 Display: rename --temperature-* to --temp-* as stated in help messages
Fix #908
2024-05-09 08:46:59 +08:00
李通洲 852c6abf2e Loadavg (Android): fix compiling 2024-05-08 21:54:13 +08:00
Quinten Van Damme df3fa6f8a8 Logo: Fix dahliaOS detection (#906) 2024-05-08 19:30:25 +08:00
李通洲 738daa1c77 Loadavg: new module 2024-05-08 18:34:34 +08:00
李通洲 4204cfc500 Doc: update help message for --module-output-color 2024-05-08 16:17:05 +08:00
李通洲 9cb08d115a Separator: add --separator-output-color 2024-05-08 16:11:16 +08:00
李通洲 459f159b1b Fastfetch: revert to module color after printing custom colors 2024-05-08 15:25:59 +08:00
李通洲 2880536513 Fastfetch: support --module-ouput-color (WIP) 2024-05-08 15:01:57 +08:00
李通洲 64cb1bfdfd Doc: remove duplicated entry 2024-05-08 14:33:00 +08:00
李通洲 b80c30ace3 Doc: default --hide-cursor to false 2024-05-08 11:06:38 +08:00
李通洲 19b8849bfc Fastfetch: remove the long deprecated flag --set & `-set-keyless 2024-05-08 11:06:03 +08:00
Carter Li 8f457f047c TerminalFont (Linux): searching for font config in st binary 2024-05-08 09:54:33 +08:00
Carter Li 299bc7468f Terminal (Linux): fix exePath detection 2024-05-08 09:54:33 +08:00
Carter Li c213b0769b Merge remote-tracking branch 'origin/master' into dev 2024-05-07 09:34:02 +08:00
AcatXIo 260c883d07 Presets: Update hardware.jsonc (#899)
Update hardware.jsonc preset, fix logo being forced to arch, add more hardware information.
2024-05-07 08:54:36 +08:00
Carter Li da0db042fa Merge pull request #897 from fastfetch-cli/dev
Release: 2.11.5
2024-05-07 00:41:44 +08:00
李通洲 ae5732e2a8 Release: v2.11.5 2024-05-07 00:38:08 +08:00
李通洲 1f05a33807 Logo (Builtin): temp fix for openmandriva logo detection
Fix #896
2024-05-07 00:19:07 +08:00
李通洲 f090951abc Doc: remove --os-file completely 2024-05-06 22:48:46 +08:00
Carter Li 855fd6edee Merge pull request #890 from fastfetch-cli/dev
Release v2.11.4
2024-05-06 20:06:58 +08:00
李通洲 d4bd4401a8 Release: v2.11.4 2024-05-06 19:45:45 +08:00
李通洲 689feb39a4 OS (Linux): don't detect debian version on debian derived distros 2024-05-06 18:42:19 +08:00
Carter Li 0f64e2830a OS (Linux): detect pve & armbian 2024-05-06 16:46:27 +08:00
Carter Li 3e24cdc752 CMake: add option CUSTOM_OS_RELEASE_PATH
And remove `--os-file`
2024-05-06 16:25:08 +08:00
李通洲 dc9c285a0b Doc: update README
Who cares how people install a package...

Close #883
2024-05-06 15:56:46 +08:00
李通洲 1d03c9c85e Logo (Builtin): add armbian
Fix #842
2024-05-06 15:22:43 +08:00
李通洲 4eae11df64 Presets: fix neofetch 2024-05-06 15:09:12 +08:00
李通洲 eba13d5485 JsonConfig: fix setting size.ndigits doesn't work
Silly copy & paste error
2024-05-06 15:08:58 +08:00
apocelipes 16b875ef5a Fastfetch: fix memory leaks when passing informative options
Informative options (e.g. "--help", "--list-module") make fastfetch
exit before calling ffDestroyInstance. Using "atexit" to avoid this
kind of leak.
2024-05-06 14:40:27 +08:00
李通洲 366138e1bd CI: try fixing Linux armv7 2024-05-06 14:08:29 +08:00
李通洲 7fe18a5b7c CI: build armv7 package using ubuntu22.04
Hopefully make it usable on RaspberryPi

Fix #884
2024-05-06 09:33:58 +08:00
李通洲 39cd8cfb4c Camera: fix deprecation warning for macOS 14.0 hopefully
Fix #860
2024-05-06 09:25:06 +08:00
李通洲 8b441c85e5 Logo (Builtin): update ubuntu 2024-05-05 23:31:23 +08:00
李通洲 f66e901c44 Presets: remove unsupported format placeholders 2024-05-05 22:12:33 +08:00
李通洲 3815823a20 CMake: enforce glibc version 2024-05-05 21:29:49 +08:00
李通洲 33ff4870dc Fastfetch: enable pipe mode if $NO_COLOR is set 2024-05-05 20:16:43 +08:00
李通洲 479731f076 Custom: don't print ANSI escape code in pipe mode 2024-05-05 20:14:24 +08:00
李通洲 d2f3f47457 Colors: print non-colored blocks in pipe mode 2024-05-05 20:14:24 +08:00
李通洲 5ea89ecba5 Fastfetch: print non-colored logo in pipe mode 2024-05-05 20:14:23 +08:00
Carter Li 865f57bd76 Revert "FFstrbuf: avoid redundant checks (#881)" (#882)
This reverts commit e98e2a3d52.
2024-05-05 18:46:22 +08:00
Nour1248 e98e2a3d52 FFstrbuf: avoid redundant checks (#881) 2024-05-05 18:40:59 +08:00
Carter Li 6bb748869e Terminal (macOS): fix Apple Terminal detection
Fix #878
2024-05-05 13:36:14 +08:00
李通洲 654721b8c5 Doc: remove (kind of) outdated information
Fix #867
2024-05-05 08:39:51 +08:00
Carter Li 0542eac1b9 Doc: metion ANSI 256 colors
Fix #869
2024-05-05 07:33:32 +08:00
apocelipes b9faf8d77f fastfetch: fix #868 (#871)
Fix #868.
2024-05-05 07:10:51 +08:00
371 changed files with 11380 additions and 22065 deletions
+13 -16
View File
@@ -7,7 +7,9 @@ assignees: ''
---
<!-- We will try hard to solve the issue. However since platforms and hardwares vary greatly, it can be hard to find the root cause is. Providing following information may help us greatly. Thanks in advance -->
Be sure to read the [FAQ](https://github.com/fastfetch-cli/fastfetch?tab=readme-ov-file#faq) before submitting a new issue.
<!-- We will try hard to solve the issue. However since platforms and hardwares vary greatly, it can be hard to find the root cause of an issue. Providing the following information may help us greatly. Thanks in advance! -->
# General description of bug:
@@ -15,8 +17,8 @@ assignees: ''
* What should happen:
* Fastfetch version used: <!-- please use the latest version, if possible -->
* Did it work in an older version: <!-- if yes, which version -->
* Where did you get the binary: <!-- Github Release / Github Actions / Installed with a package manager (What package manager) / Built from source yourself -->
* Does this issue still occurs in [the latest dev build](https://github.com/fastfetch-cli/fastfetch/actions/)?
* Where did you get the binary: <!-- GitHub release / GitHub Actions / installed with a package manager (please tell us which package manager you used!) / built from source yourself -->
* Does this issue still occur in [the latest dev build](https://github.com/fastfetch-cli/fastfetch/actions/)?
# Often helpful information:
@@ -25,7 +27,7 @@ Screenshot:
The content of the configuration file you use (if any):
```
//paste here
// Paste here
```
Output of `fastfetch -c ci.jsonc --format json`:
@@ -34,15 +36,15 @@ Note that this output will contain you public IP. If it is not relevant for the
-->
```
//paste here
// Paste here
```
Output of `fastfetch --list-features`:
```
//paste here
// Paste here
```
## If fastfatch crashed or freezed
## If fastfatch crashed or froze
Paste the stacktrace here. You may get it with:
@@ -63,21 +65,16 @@ If you cannot do the instructions above, please upload the core dump file:
Use `time fastfetch --stat` to show time usage for each module.
## If my image logo didn't show / work
## If an image or logo didn't show
<!-- Please make sure the terminal does support the image protocol you used. Note Gnome terminal doesn't support any image protocols -->
<!-- Please make sure your terminal supports the image protocol you used. Note that GNOME Terminal doesn't support any image protocols. -->
* The image protocol you used:
* The terminal you used:
* Upload the image file here, or paste the image URL:
* Does it work with `--logo-width {WIDTH} --logo-height {HEIGHT}`?
## If fastfetch behaves incorrectly on shell starting
## If fastfetch behaves incorrectly on shell startup
<!-- NOTE for zsh / p10k users:
There are known incompatibility between fastfetch and p10k instant prompt.
The p10k doc clearly states that you should NOT print anything to stdout after p10k-instant-prompt is initialized.
You should either put `fastfetch` before initialization of p10k-instant-prompt (recommended), remove it or use `fastfetch --pipe false` -->
* The bug is reproduceable with fresh / clean shell configuration (i.e. `fastfetch` is the single line of `.zshrc` or `~/.config/fish/config.fish`):
* The bug is reproducible with a clean shell configuration (i.e. `fastfetch` is the only line in `.zshrc` or `~/.config/fish/config.fish`):
* Does `sleep 1` before running `fastfetch` work?
+1 -17
View File
@@ -7,23 +7,7 @@ assignees: ''
---
## Before requesting a new feature
* A lot of features are not enabled by default. Please try `fastfetch --list-modules` and `fastfetch -c all.jsonc` to see if it has been supported
* Fastfetch supports `Command` module, which can be used to grab output from a custom shell script. Please check if it fits your needs
```jsonc
// ~/.config/fastfetch/fastfetch.jsonc
{
"modules": [
{
"type": "command",
"text": "/path/to/your/script",
"key": "Feature Title"
}
]
}
```
Be sure to read [FAQ](https://github.com/fastfetch-cli/fastfetch?tab=readme-ov-file#faq) before submitting a new issue.
## Wanted features:
+21
View File
@@ -0,0 +1,21 @@
# Number of days of inactivity before an issue becomes stale
daysUntilStale: 60
# Number of days of inactivity before a stale issue is closed
daysUntilClose: 7
# Issues with these labels will never be considered stale
exemptLabels:
- keepalive
# Label to use when marking an issue as stale
staleLabel: stale
# Comment to post when marking an issue as stale. Set to `false` to disable
markComment: >
This issue has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs. Thank you
for your contributions.
# Comment to post when closing a stale issue. Set to `false` to disable
closeComment: false
+90 -7
View File
@@ -173,6 +173,45 @@ jobs:
id: runcmd
with:
arch: armv7
distro: ubuntu20.04
githubToken: ${{ github.token }}
run: |
uname -a
apt-get update && apt-get install -y wget
# 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
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 --format json
time ./flashfetch
ldd fastfetch
ctest
- name: upload artifacts
uses: actions/upload-artifact@v4
with:
name: fastfetch-linux-armv7
path: ./fastfetch-*.*
linux-riscv64:
name: Linux-riscv64
runs-on: ubuntu-22.04
permissions:
security-events: write
contents: read
steps:
- name: checkout repository
uses: actions/checkout@v4
- name: run VM
uses: uraimo/run-on-arch-action@v2
id: runcmd
with:
arch: riscv64
distro: ubuntu22.04
githubToken: ${{ github.token }}
run: |
@@ -190,7 +229,7 @@ jobs:
- name: upload artifacts
uses: actions/upload-artifact@v4
with:
name: fastfetch-linux-armv7
name: fastfetch-linux-riscv64
path: ./fastfetch-*.*
musl-amd64:
@@ -201,6 +240,8 @@ jobs:
- name: setup alpine linux
uses: jirutka/setup-alpine@master
with:
branch: v3.19
- name: install dependencies
run: |
@@ -240,6 +281,7 @@ jobs:
- name: setup alpine linux
uses: jirutka/setup-alpine@master
with:
branch: v3.19
arch: aarch64
- name: install dependencies
@@ -326,6 +368,39 @@ jobs:
name: fastfetch-macos-universal
path: ./fastfetch-*.*
sunos-amd64:
runs-on: ubuntu-latest
name: SunOS-amd64
steps:
- name: checkout repository
uses: actions/checkout@v4
- name: run VM
uses: vmactions/omnios-vm@v1
with:
usesh: true
prepare: |
uname -a
pkg update --accept
pkg install gcc13 cmake git pkg-config glib2 dbus sqlite-3 imagemagick
run: |
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
cpack
- name: upload artifacts
uses: actions/upload-artifact@v4
with:
name: fastfetch-sunos-amd64
path: ./fastfetch-*.*
freebsd-amd64:
name: FreeBSD-amd64
runs-on: ubuntu-latest
@@ -418,7 +493,7 @@ jobs:
with:
msystem: CLANG64
update: true
install: git mingw-w64-clang-x86_64-7zip mingw-w64-clang-x86_64-cmake mingw-w64-clang-x86_64-clang mingw-w64-clang-x86_64-vulkan-loader mingw-w64-clang-x86_64-vulkan-headers mingw-w64-clang-x86_64-opencl-icd
install: git mingw-w64-clang-x86_64-7zip mingw-w64-clang-x86_64-cmake mingw-w64-clang-x86_64-clang mingw-w64-clang-x86_64-vulkan-loader mingw-w64-clang-x86_64-vulkan-headers mingw-w64-clang-x86_64-opencl-icd mingw-w64-clang-x86_64-opencl-headers mingw-w64-clang-x86_64-cppwinrt
- name: print msys version
run: uname -a
@@ -432,6 +507,9 @@ jobs:
- name: copy necessary dlls
run: cp /clang64/bin/{OpenCL,vulkan-1}.dll .
- name: download amd_ags
run: curl -LO https://github.com/GPUOpen-LibrariesAndSDKs/AGS_SDK/raw/master/ags_lib/lib/amd_ags_x64.dll
- name: list features
run: ./fastfetch --list-features
@@ -451,10 +529,10 @@ jobs:
run: ctest
- name: create zip archive
run: 7z a -tzip -mx9 -bd -y fastfetch-windows-amd64.zip *.dll fastfetch.exe flashfetch.exe presets
run: 7z a -tzip -mx9 -bd -y fastfetch-windows-amd64.zip LICENSE *.dll fastfetch.exe flashfetch.exe presets
- name: create 7z archive
run: 7z a -t7z -mx9 -bd -y fastfetch-windows-amd64.7z *.dll fastfetch.exe flashfetch.exe presets
run: 7z a -t7z -mx9 -bd -y fastfetch-windows-amd64.7z LICENSE *.dll fastfetch.exe flashfetch.exe presets
- name: upload artifacts
uses: actions/upload-artifact@v4
@@ -480,7 +558,7 @@ jobs:
with:
msystem: CLANG32
update: true
install: git mingw-w64-clang-i686-7zip mingw-w64-clang-i686-cmake mingw-w64-clang-i686-clang mingw-w64-clang-i686-vulkan-loader mingw-w64-clang-i686-vulkan-headers mingw-w64-clang-i686-opencl-icd
install: git p7zip mingw-w64-clang-i686-cmake mingw-w64-clang-i686-clang mingw-w64-clang-i686-vulkan-loader mingw-w64-clang-i686-vulkan-headers mingw-w64-clang-i686-opencl-icd mingw-w64-clang-i686-opencl-headers
- name: print msys version
run: uname -a
@@ -502,6 +580,9 @@ jobs:
- name: copy necessary dlls
run: cp /clang32/bin/{OpenCL,vulkan-1}.dll .
- name: download amd_ags
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
@@ -518,10 +599,10 @@ jobs:
run: ctest
- name: create zip archive
run: 7z a -tzip -mx9 -bd -y fastfetch-windows-i686.zip *.dll fastfetch.exe flashfetch.exe presets
run: 7z a -tzip -mx9 -bd -y fastfetch-windows-i686.zip LICENSE *.dll fastfetch.exe flashfetch.exe presets
- name: create 7z archive
run: 7z a -t7z -mx9 -bd -y fastfetch-windows-i686.7z *.dll fastfetch.exe flashfetch.exe presets
run: 7z a -t7z -mx9 -bd -y fastfetch-windows-i686.7z LICENSE *.dll fastfetch.exe flashfetch.exe presets
- name: upload artifacts
uses: actions/upload-artifact@v4
@@ -537,11 +618,13 @@ jobs:
- linux-amd64
- linux-aarch64
- linux-armv7
- linux-riscv64
- musl-amd64
- musl-aarch64
- macos-universal
- freebsd-amd64
- freebsd-aarch64
- sunos-amd64
- windows-amd64
- windows-i686
permissions:
+1
View File
@@ -8,3 +8,4 @@ cscope.*
tags
fastfetch.kdev4
*.user
*.user.*
+293 -6
View File
@@ -1,3 +1,290 @@
# 2.17.2
Changes:
* Flatpak package count no longer takes runtime packages into account (Packages, Linux)
Bugfixes:
* Fix formattion with multiple batteries (Battery)
* Fix incorrect size value for large memory sticks (PhysicalMemory)
* Fix spelling of `Qt` and `LXQt`
* Fix building on SunOS if imagemagick support is enabled (Logo, SunOS)
* Fix typos
Features:
* Support Ptyxis terminal version and font detection (Terminal / TerminalFont, Linux)
* Improve Cinnamon version detection (DE)
* Support `cinnamon-wayland` (WMTheme)
* `--ts-version false` will disable editor version detection (Editor)
# 2.17.1
Hotfix for a regression that breaks Qt font detection
Bugfixes:
* Don't generate and install `libffwinrt.dll.a` on MinGW (Windows)
* Fix building on Windows when imagemagick support is enabled (Logo, Windows)
* Don't print GPU frequency with `--gpu-temp` for Nvidia cards (#1052, GPU)
* `--gpu-driver-specific` needs to be specified
* Print formatted size when `--gpu-format` is used (#1052, GPU)
* Ignore QVariant format; fix unreadable Qt font (#1053, Theme, Linux)
* Fix segfaults with `--show-errors` and an invalid module (#1055)
# 2.17.0
Changes:
* CMake option `ENABLE_PROPRIETARY_GPU_DRIVER_API` is removed. The GPU driver APIs are now enabled by default.
* The option was introduced to reduce the license concerns. Since all non MIT proprietary code has been rewritten manually from scratch, it is no longer necessary.
* See <https://github.com/fastfetch-cli/fastfetch/issues/533#issuecomment-2122830958> for detail
* Option `--logo-separate true` is changed to `--logo-position top` for better readability
* Builtin ascii logos can be positioned on the right side now with`--logo-position right`
Features:
* Add support for `--gpu-detection-method opencl` which uses OpenCL to detect GPUs.
* Support detecting CPU cache size by using SMBIOS as fallback (CPUCache)
* Support GPU detection (SunOS)
* Support GPU type detection with AMD GPU driver (GPU, Windows)
* Add fast path of version and font detection for kitty (Terminal / TerminalFont)
* Make sure `stdin` and `stdout` are TTYs when querying terminal
* So modules like `TerminalSize` should work when `stdin` or `stdout` is redirected
* Support argument truncation in `--<module>-format` (#1043)
* See `fastfetch --help format` for detail
* Improve Qt theme detection (#1047, Theme, Linux)
* Add new JSON config option `general.preRun`, which is executed before fastfetch prints output.
* It can be used to generate a temp logo file. For example
```jsonc
{
"general": {
"preRun": "kitten icat --align=left /path/to/image > /tmp/logo.kitty"
},
"logo": {
"source": "/tmp/logo.kitty",
"type": "raw"
}
}
```
Bugfixes:
* Fix invalid path (#1031, LM, Linux)
* Fix VMEM detection for Nvidia GPU (requires `--gpu-driver-specific`) (GPU)
* Fix AMD `--gpu-driver-specific` for AMD cards (#1032, GPU, Windows)
* Use Coordinated Universal Time rather than timezone-varying local date (#1046)
Logo:
* Fix colors of Asahi Linux
# 2.16.0
This release added basic support for SunOS (Solaris, illumos). The binaries provided in the release lack a few useful features (such as Display detection). People who use SunOS should consider building fastfetch themselves.
Changes:
* Fastfetch now prefers `/etc/os-release` over `/etc/lsb-release` when detecting distro info.
* This may break some distros (notably some debian based distros). File a bug with the content of `os-release` and `lsb-release` if it breaks your distro.
Features:
* Support Media detection in Windows (Media / Player, Windows)
* Requires Windows 10 and later
* Add new option `--users-myself-only` to display current login user only (Users)
* Add code name of macOS Sequoia (OS, macOS)
* Add new module `DNS` to show active DNS servers (DNS)
* Add new option `--loadavg-compact`. Defaults to true (Loadavg)
* Use `--loadavg-compact false` to display load averages in different lines
* Detect MTU size (LocalIP)
* Support version detection of pluma, which is the default editor of OpenIndiana (Editor)
* Print used OGL library, eg EGL, GLX or OSMesa (OpenGL)
Bugfixes:
* Report error if cache size is unavailable (CPUCache, Android)
* Trim white spaces in device name (Sound, Linux, #1005)
* Fix `display.bar.border{Left,Right}` doesn't work in JSON config files (Config)
* Fix invalid call to `realpath(3)` (Platform, Linux)
* Fix result calculation (CPUUsage, FreeBSD)
Logos:
* Add Mauna
* Add Tuxdeo
* Add Manjaro ARM
* Add RedOS
* Add Arch3
# 2.15.0
Changes:
* `--bar-border <?bool>` has been changed to `--bar-border-left <string>` and `--bar-border-right <string>`, which are used for customizing the style of bar border.
* `--bar-border-left '' --bar-border-right ''` can be used to disable the border
Features:
* Add ability to skip installing license with INSTALL_LICENSE option (CMake)
* Make it possible to shorten the theme and icons output (Theme / Icons)
* Support `-l '?'` to show a question mark
* Add new module `CPUCache` to display CPU cache sizes (CPUCache)
* In `--<module>-format`, `{#keys}` and `{#title}` can be used to reference the color of keys and title
* Improve speed of Guix package detection (Packages, Linux)
* Assume wm plugins are daemon processes to improve performance (WM, macOS)
Bugfixes:
* Remove shebangs from completions (#980)
* Fix while chars not visible in terminal of light theme (Logo)
* Normalize bright colors to fix color display in Apple Terminal (#991, Colors)
* Correctly capitalize GNOME (#997, DE, Linux)
* Fix segfault on system using turkish language (#995, InitSystem, Linux)
* Fix kubuntu detection (#1000, OS, Linux)
* Don't display duplicate entries (OS, Linux)
# 2.14.0
Features:
* Support monochrome bar type (#960)
* Support editor version detection on Windows (Editor, Windows)
* Apply default color palettes in `--file` and `--data` (Logo)
* Print all presets in `--list-presets` for better Windows support (Windows)
* Support for guix package manager detection (Packages, Linux)
* Support named variable placeholders in custom module formattion string (#796)
* `--title-format '{user-name-colored}{at-symbol-colored}{host-name-colored}'` is now equivalent to `--title-format '{6}{7}{8}'`
* Support named color placeholders in custom module formattion string
* `--<module>-format '{#red}'` is now equivalent to `--<module>-format '{#31}'`
* `'{#red}'` or `'{#31}'` is preferred over `\u001b[31m` because is more readable and `--pipe` aware (will be ignored in pipe mode)
* Supported in `Custom` module too
* See `fastfetch -h format` for detail
* Add new module `InitSystem`, which detects the name of init system
* i.e. process name of pid1. `init`, `systemd`, etc
* Add option `--color-separator` to set the color of key-value separators
* Support Guix package manager count (#792, Packages, Linux)
* Improve python based shell detection (#977, Shell, macOS)
* Print error reason when vulkan init fails (Vulkan)
Bugfixes:
* Don't detect `.conf` files in `--list-config-paths`
* Don't try to detect terminals in MSYS shell with process backtracing (Windows)
* Fix `outputColor` doesn't work if module keys are disabled
Logos:
* Add Cereus Linux
* Re-add special handling of Loc-OS
# 2.13.2
Another hotfix release :(
Bugfixes:
* Remove DRM driver version detection feature, which caused a performance regression for nouveau drivers (#956, Display, Linux)
* Fix compatibility for old python versions. Regression of `2.13.0`
* Don't use `*-unknown` as display name for Wayland protocol (Display, Linux)
Features:
* Add new module `Editor` which prints information of the default editor, i.e. $VISUAL or $EDITOR (#430, Editor)
Logos:
* Added CuerdOS
* Remove special handling of Loc-OS
# 2.13.1
Fix a regression introduced in v2.13.0
Bugfixes:
* Fix CPU frequency not displayed if `bios_limit` is not available (CPU, Linux)
Features:
* Add `--cpu-show-pe-core-count` to detect and display core count for performance / efficiency cores (CPU, FreeBSD)
# 2.13.0
Changes:
* Option `--gpu-force-vulkan <?bool>` has been changed to `--gpu-detection-method <enum>`
* Use `--gpu-detection-method vulkan` to get the old behavior
* See `fastfetch -h gpu-detection-method` for detail
* In Linux, BIOS limited CPU frequency is printed by default to match the behavior of neofetch (CPU, Linux, #947)
Features:
* Add new module `Bootmgr` which prints information of stage 2 bootloader (grub, system-boot, etc)
* Requires root permission to work on Windows and FreeBSD
* Requires booting in UEFI mode
* Add package manager lpkg and lpkg-build support (Packages, Linux)
* Improve macOS 10.13 compatibility (macOS)
* Detect core count for performance / efficiency cores (CPU)
* Test it with `fastfetch -s cpu --cpu-format '{9}'`
* Support min / max frequency and physical core count detection in FreeBSD, if kernel supports it (CPU, FreeBSD)
* Detect DRM driver version if DRM detection method is used (GPU, Linux)
Bugfixes:
* Don't detect `clifm` and `valgrind` as a terminal (Terminal, Linux)
* Improve stability (PhysicalMemory, FreeBSD)
* Fix bssid & status detection (Wifi, FreeBSD)
* Ensure createTime is correctly initialized (Disk, FreeBSD / macOS)
* Fix `--cpu-freq-ndigits` not working if `--cpu-format` is used
* Fix `nix-user` package count detection (Packages, Linux)
* Fix some memory leaks
Logos:
* Fix Manjaro logo not displayed
* Add SpoinkOS
* Add Loc-OS
* Add Furreto Linux
* Fix TorizonCore logo colors
* Fix KDE neon logo not displayed
# 2.12.0
Changes:
* The long deprecated flag based config files are removed.
* They can still be used with `xargs fastfetch < /path/to/config.conf`
* `--gen-config` can be used to migrate them to json based config files
* The long deprecated options `--set` and `--set-keyless` are removed.
* `Kernel` module now prints kernel name by default
Features:
* Support `st` terminal font detection for font configuration compiled in `st` binary (TerminalFont, Linux)
* Add option `--color-output` to change output color of all modules except `Title`, `Separator`
* `display.color.output` in JSONC config file
* Add option `--<module>-output-color` to change output color of one specified module, which overrides the global option `--color-output`
* Add option `--publicip-ipv6` to print IPv6 address (PublicIP)
* Add new module `Loadavg` to print load averages (Loadavg)
* Add new module `PhysicalMemory` to print information of physical memory devices (PhysicalMemory)
* Requires root permission to work on Linux and FreeBSD
* Support specifying `--logo-width` only for `--kitty-direct` and `--iterm` (Logo)
* Add option `--localip-show-all-ips` to show all IPs assigned to the same interface (LocalIP)
* Default to `false`
* Improve compatibility with `(*term)` (#909, Terminal, macOS)
* Support GPU core count and frequency detection for Asahi Linux (GPU, Linux)
Bugfixes:
* Rename option `--temperature-unit` to `--temp-unit` as documented in help messages
* Fix alternate logo doesn't work with `{ "type": "builtin" }` (#914, Logo)
Logos:
* Fix DahliaOS detection
* Add openSUSE Slowroll
* Add macOS3
* Add Quirinux
# 2.11.5
Bugfix:
* Fix logo printing for OpenMandriva (#896)
* Remove `--os-file` in help messages
# 2.11.4
Changes:
* Fastfetch will print a colorless ascii logo in `--pipe` mode for better `lolcat` compatibility. `fastfetch | lolcat` should work and no `--pipe false` needed.
* Previously the logo would be disabled in `--pipe` mode.
* Use `--pipe -l none` to get the old beheavior
* `--os-file` was removed and CMake option `-DCUSTOM_OS_RELEASE_PATH=/path/to/os-release` was introduced for configuring at compile time by package managers if needed. This option should not used in most cases.
Bugfixes:
* Fix possible out-of-bound memory access (#868)
* Fix Apple Terminal detection (#878, macOS, Terminal)
* Fix deprecation warning for macOS 14.0 hopefully (#860, macOS, Camera)
* Fix memory leaks when passing informative options (#888)
* Fix JSON config `size.ndigits` doesn't work
Features:
* Enable `--pipe` mode if environment variable `$NO_COLOR` is set
* Support Armbian and Proxmox distro detection (OS, Linux)
Logo:
* Add Armbian
# 2.11.3
Hotfix for nix (https://github.com/NixOS/nixpkgs/issues/308849#issuecomment-2093962376)
@@ -101,7 +388,7 @@ Features:
* Improve GPU detection on Linux (GPU, Linux)
* Support GPU memory usage detection for AMD GPUs
* Support GPU frequency detection for Intel GPUs
* Improve performance of Gnome version detection (DE, Linux)
* Improve performance of GNOME version detection (DE, Linux)
* Improve performance of kitty version detection (Terminal, Linux)
* Detect refresh rate when using `--ds-force-drm sysfs-only` (Display, Linux)
* Add option `--ts-version` to disable terminal and shell version detection. Mainly for benchmarking purposes
@@ -792,7 +1079,7 @@ Bugfixes:
This release backports some changes from dev branch, and fixes 2 crashing issues
Features:
* Support KDE / LXQT / MATE / Cinnamon wallpaper detection (Wallpaper, Linux)
* Support KDE / LXQt / MATE / Cinnamon wallpaper detection (Wallpaper, Linux)
* Support QTerminal version & terminal font detection
* Support MATE Terminal version & terminal font detection
* Set `--pipe true` automatically if stdout is not a tty
@@ -808,7 +1095,7 @@ Bugfixes:
* Fix Windows drives detection in WSL (Linux, Disk)
* Fix CPU temp detection (FreeBSD, CPU)
* Fix disk detection (Android, Disk)
* Fix Gnome Terminal version and font detection (FreeBSD, TerminalFont)
* Fix GNOME Terminal version and font detection (FreeBSD, TerminalFont)
* Fix crash on newer wayland desktops (Linux, Display, #477)
* Fix vendor detection for Intel GPU (macOS, GPU)
* Fix possible crashes on Windows Server (Windows, GPU, #484)
@@ -834,11 +1121,11 @@ Features:
* Add mac address detection `--localip-show-mac` (LocalIP, #451)
Bugfixes:
* Fix Gnome version detection on Fedora (DE)
* Fix GNOME version detection on Fedora (DE)
* Fix Windows drives detection in WSL (Disk)
Changes:
* In order to make Icons module consistent between different platforms, `--icons-format` no longer supports individual GTK / QT icon params.
* In order to make Icons module consistent between different platforms, `--icons-format` no longer supports individual GTK / Qt icon params.
* `--theme-format` no longer supports individual GTK / plasma theme params.
* `--local-ip-*` and `--public-ip-*` have been changed to `--localip-*` and `--publicip-*`
* `--localip-compact-type` is no longer supported. Fastfetch now display IPs as `--localip-compat-type multiline` by default, with `--local-compact true` can be set as an alias of `--localip-compact-type oneline`
@@ -1212,7 +1499,7 @@ Fixes build on android (#205)
# 1.6.0
Features:
* Detect QT on more DEs than just KDE Plasma. The [Plasma] category was therefore renamed to [QT]
* Detect Qt on more DEs than just KDE Plasma. The [Plasma] category was therefore renamed to [Qt]
* Alacritty font detection
* Load `/etc/fastfetch/config.conf` before user config
* Disk: print one decimal point if size < 100GB
+233 -52
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.11.3
VERSION 2.17.2
LANGUAGES C
DESCRIPTION "Fast neofetch-like system information tool"
HOMEPAGE_URL "https://github.com/fastfetch-cli/fastfetch"
@@ -14,10 +14,12 @@ set(PROJECT_LICENSE "MIT license")
###################
if(ANDROID)
set(LINUX FALSE)
elseif("${CMAKE_SYSTEM_NAME}" MATCHES ".*[Ll]inux.*")
elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
set(LINUX TRUE CACHE BOOL "..." FORCE) # LINUX means GNU/Linux, not just the kernel
elseif("${CMAKE_SYSTEM_NAME}" MATCHES ".*[Bb][Ss][Dd].*")
elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "FreeBSD")
set(BSD TRUE CACHE BOOL "..." FORCE)
elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "SunOS")
set(SunOS TRUE CACHE BOOL "..." FORCE)
elseif(NOT APPLE AND NOT WIN32)
message(FATAL_ERROR "Unsupported platform: ${CMAKE_SYSTEM_NAME}")
endif()
@@ -42,44 +44,53 @@ include(CheckIncludeFile)
include(CMakeDependentOption)
cmake_dependent_option(ENABLE_VULKAN "Enable vulkan" ON "LINUX OR APPLE OR BSD OR WIN32 OR ANDROID" OFF)
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" OFF)
cmake_dependent_option(ENABLE_XCB "Enable xcb" ON "LINUX OR BSD" OFF)
cmake_dependent_option(ENABLE_XRANDR "Enable xrandr" ON "LINUX OR BSD" OFF)
cmake_dependent_option(ENABLE_X11 "Enable x11" ON "LINUX OR BSD" OFF)
cmake_dependent_option(ENABLE_DRM "Enable libdrm" ON "LINUX OR BSD" OFF)
cmake_dependent_option(ENABLE_GIO "Enable gio-2.0" ON "LINUX OR BSD" OFF)
cmake_dependent_option(ENABLE_DCONF "Enable dconf" ON "LINUX OR BSD" OFF)
cmake_dependent_option(ENABLE_DBUS "Enable dbus-1" ON "LINUX OR BSD" OFF)
cmake_dependent_option(ENABLE_XFCONF "Enable libxfconf-0" ON "LINUX OR BSD" OFF)
cmake_dependent_option(ENABLE_SQLITE3 "Enable sqlite3" ON "LINUX OR BSD OR APPLE" 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_RPM "Enable rpm" ON "LINUX" OFF)
cmake_dependent_option(ENABLE_IMAGEMAGICK7 "Enable imagemagick 7" ON "LINUX OR BSD OR APPLE OR WIN32" OFF)
cmake_dependent_option(ENABLE_IMAGEMAGICK6 "Enable imagemagick 6" ON "LINUX OR BSD OR APPLE" 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_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" OFF)
cmake_dependent_option(ENABLE_GLX "Enable glx" ON "LINUX OR BSD" OFF)
cmake_dependent_option(ENABLE_OSMESA "Enable osmesa" ON "LINUX OR BSD" OFF)
cmake_dependent_option(ENABLE_OPENCL "Enable opencl" ON "LINUX OR BSD OR WIN32" 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_FREETYPE "Enable freetype" ON "ANDROID" OFF)
cmake_dependent_option(ENABLE_PULSE "Enable pulse" ON "LINUX" 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_THREADS "Enable multithreading" ON "Threads_FOUND" OFF)
option(ENABLE_SYSTEM_YYJSON "Use system provided (instead of fastfetch embedded) yyjson library" OFF)
option(ENABLE_ASAN "Build fastfetch with ASAN (address sanitizer)" OFF)
option(ENABLE_PROPRIETARY_GPU_DRIVER_API "Enable proprietary GPU driver API (NVML, IGCL and AGS)" ON)
option(ENABLE_LTO "Enable link-time optimization in release mode if supported" ON)
option(BUILD_TESTS "Build tests" OFF) # Also create test executables
option(SET_TWEAK "Add tweak to project version" ON) # This is set to off by github actions for release builds
option(IS_MUSL "Build with musl libc" OFF) # Used by Github Actions
option(INSTALL_LICENSE "Install license into /usr/share/licenses" ON)
set(BINARY_LINK_TYPE_OPTIONS dlopen dynamic static)
set(BINARY_LINK_TYPE dlopen CACHE STRING "How to link fastfetch")
set_property(CACHE BINARY_LINK_TYPE PROPERTY STRINGS ${BINARY_LINK_TYPE_OPTIONS})
if(NOT BINARY_LINK_TYPE IN_LIST BINARY_LINK_TYPE_OPTIONS)
message(FATAL_ERROR "BINARY_LINK_TYPE must be one of ${BINARY_LINK_TYPE_OPTIONS}")
endif()
if (LINUX)
set(CUSTOM_PCI_IDS_PATH "" CACHE STRING "Custom path to file pci.ids, defaults to `/usr/share/hwdata/pci.ids`")
set(CUSTOM_AMDGPU_IDS_PATH "" CACHE STRING "Custom path to file amdgpu.ids, defaults to `/usr/share/libdrm/amdgpu.ids`")
set(CUSTOM_OS_RELEASE_PATH "" CACHE STRING "Custom path to file os-release, defaults to `/etc/os-release`")
endif()
####################
@@ -109,12 +120,12 @@ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${WARNING_FLAGS} -Werror=incompatible-pointe
if(WIN32 OR ENABLE_DIRECTX_HEADERS)
enable_language(CXX)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${WARNING_FLAGS} -fno-exceptions -fno-rtti")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${WARNING_FLAGS}")
endif()
if(WIN32)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--tsaware -Wl,--build-id -Wl,--subsystem,console:6.1,--major-os-version,6,--minor-os-version,1")
elseif(APPLE)
elseif(APPLE AND CMAKE_C_COMPILER_ID MATCHES "Clang")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fobjc-arc")
endif()
@@ -129,7 +140,7 @@ if(NOT WIN32)
set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} -rdynamic")
endif()
if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
if(ENABLE_LTO AND NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
message(STATUS "Enabling LTO")
include(CheckIPOSupported)
check_ipo_supported(RESULT IPO_SUPPORTED)
@@ -245,7 +256,7 @@ if(APPLE)
configure_file(src/util/apple/Info.plist.in Info.plist @ONLY)
endif()
string(TIMESTAMP FASTFETCH_BUILD_DATE "%d %B %Y")
string(TIMESTAMP FASTFETCH_BUILD_DATE "%d %B %Y" UTC)
configure_file(doc/fastfetch.1.in fastfetch.1 @ONLY)
####################
@@ -283,12 +294,14 @@ set(LIBFASTFETCH_SRC
src/common/properties.c
src/common/settings.c
src/common/temps.c
src/detection/bootmgr/bootmgr.c
src/detection/chassis/chassis.c
src/detection/cpu/cpu.c
src/detection/cpuusage/cpuusage.c
src/detection/disk/disk.c
src/detection/diskio/diskio.c
src/detection/displayserver/displayserver.c
src/detection/editor/editor.c
src/detection/font/font.c
src/detection/gpu/gpu.c
src/detection/media/media.c
@@ -296,6 +309,7 @@ set(LIBFASTFETCH_SRC
src/detection/opencl/opencl.c
src/detection/os/os.c
src/detection/packages/packages.c
src/detection/physicalmemory/physicalmemory.c
src/detection/publicip/publicip.c
src/detection/terminaltheme/terminaltheme.c
src/detection/terminalfont/terminalfont.c
@@ -312,12 +326,14 @@ set(LIBFASTFETCH_SRC
src/modules/bios/bios.c
src/modules/bluetooth/bluetooth.c
src/modules/board/board.c
src/modules/bootmgr/bootmgr.c
src/modules/brightness/brightness.c
src/modules/break/break.c
src/modules/camera/camera.c
src/modules/chassis/chassis.c
src/modules/colors/colors.c
src/modules/cpu/cpu.c
src/modules/cpucache/cpucache.c
src/modules/cpuusage/cpuusage.c
src/modules/cursor/cursor.c
src/modules/custom/custom.c
@@ -326,13 +342,17 @@ set(LIBFASTFETCH_SRC
src/modules/de/de.c
src/modules/disk/disk.c
src/modules/diskio/diskio.c
src/modules/dns/dns.c
src/modules/editor/editor.c
src/modules/font/font.c
src/modules/gpu/gpu.c
src/modules/host/host.c
src/modules/icons/icons.c
src/modules/initsystem/initsystem.c
src/modules/gamepad/gamepad.c
src/modules/kernel/kernel.c
src/modules/lm/lm.c
src/modules/loadavg/loadavg.c
src/modules/locale/locale.c
src/modules/localip/localip.c
src/modules/memory/memory.c
@@ -343,6 +363,7 @@ set(LIBFASTFETCH_SRC
src/modules/os/os.c
src/modules/packages/packages.c
src/modules/physicaldisk/physicaldisk.c
src/modules/physicalmemory/physicalmemory.c
src/modules/processes/processes.c
src/modules/player/player.c
src/modules/poweradapter/poweradapter.c
@@ -390,14 +411,18 @@ if(LINUX)
src/detection/battery/battery_linux.c
src/detection/bios/bios_linux.c
src/detection/board/board_linux.c
src/detection/bootmgr/bootmgr_linux.c
src/detection/brightness/brightness_linux.c
src/detection/chassis/chassis_linux.c
src/detection/cpu/cpu_linux.c
src/detection/cpucache/cpucache_linux.c
src/detection/cpuusage/cpuusage_linux.c
src/detection/cursor/cursor_linux.c
src/detection/bluetooth/bluetooth_linux.c
src/detection/disk/disk_linux.c
src/detection/dns/dns_linux.c
src/detection/physicaldisk/physicaldisk_linux.c
src/detection/physicalmemory/physicalmemory_linux.c
src/detection/diskio/diskio_linux.c
src/detection/displayserver/linux/displayserver_linux.c
src/detection/displayserver/linux/drm.c
@@ -414,8 +439,10 @@ if(LINUX)
src/detection/gtk_qt/gtk.c
src/detection/host/host_linux.c
src/detection/icons/icons_linux.c
src/detection/initsystem/initsystem_linux.c
src/detection/libc/libc_linux.c
src/detection/lm/lm_linux.c
src/detection/loadavg/loadavg_linux.c
src/detection/locale/locale_linux.c
src/detection/localip/localip_linux.c
src/detection/gamepad/gamepad_linux.c
@@ -456,21 +483,27 @@ elseif(ANDROID)
src/detection/bios/bios_android.c
src/detection/bluetooth/bluetooth_nosupport.c
src/detection/board/board_android.c
src/detection/bootmgr/bootmgr_nosupport.c
src/detection/brightness/brightness_nosupport.c
src/detection/chassis/chassis_nosupport.c
src/detection/cpu/cpu_linux.c
src/detection/cpucache/cpucache_linux.c
src/detection/cursor/cursor_nosupport.c
src/detection/cpuusage/cpuusage_linux.c
src/detection/disk/disk_linux.c
src/detection/dns/dns_linux.c
src/detection/physicaldisk/physicaldisk_linux.c
src/detection/physicalmemory/physicalmemory_nosupport.c
src/detection/diskio/diskio_linux.c
src/detection/displayserver/displayserver_android.c
src/detection/font/font_nosupport.c
src/detection/gpu/gpu_nosupport.c
src/detection/host/host_android.c
src/detection/icons/icons_nosupport.c
src/detection/initsystem/initsystem_linux.c
src/detection/libc/libc_android.c
src/detection/lm/lm_nosupport.c
src/detection/loadavg/loadavg_linux.c
src/detection/locale/locale_linux.c
src/detection/localip/localip_linux.c
src/detection/gamepad/gamepad_nosupport.c
@@ -512,13 +545,17 @@ elseif(BSD)
src/detection/bios/bios_bsd.c
src/detection/bluetooth/bluetooth_linux.c
src/detection/board/board_bsd.c
src/detection/bootmgr/bootmgr_bsd.c
src/detection/brightness/brightness_bsd.c
src/detection/chassis/chassis_bsd.c
src/detection/cpu/cpu_bsd.c
src/detection/cpucache/cpucache_shared.c
src/detection/cpuusage/cpuusage_bsd.c
src/detection/cursor/cursor_linux.c
src/detection/disk/disk_bsd.c
src/detection/dns/dns_linux.c
src/detection/physicaldisk/physicaldisk_bsd.c
src/detection/physicalmemory/physicalmemory_linux.c
src/detection/diskio/diskio_bsd.c
src/detection/displayserver/linux/displayserver_linux.c
src/detection/displayserver/linux/drm.c
@@ -536,7 +573,9 @@ elseif(BSD)
src/detection/host/host_bsd.c
src/detection/lm/lm_linux.c
src/detection/icons/icons_linux.c
src/detection/initsystem/initsystem_linux.c
src/detection/libc/libc_bsd.c
src/detection/loadavg/loadavg_bsd.c
src/detection/locale/locale_linux.c
src/detection/localip/localip_linux.c
src/detection/gamepad/gamepad_bsd.c
@@ -578,21 +617,27 @@ elseif(APPLE)
src/detection/bios/bios_apple.c
src/detection/bluetooth/bluetooth_apple.m
src/detection/board/board_apple.c
src/detection/bootmgr/bootmgr_apple.c
src/detection/brightness/brightness_apple.c
src/detection/chassis/chassis_nosupport.c
src/detection/cpu/cpu_apple.c
src/detection/cpucache/cpucache_apple.c
src/detection/cpuusage/cpuusage_apple.c
src/detection/cursor/cursor_apple.m
src/detection/disk/disk_bsd.c
src/detection/dns/dns_linux.c
src/detection/physicaldisk/physicaldisk_apple.c
src/detection/physicalmemory/physicalmemory_apple.m
src/detection/diskio/diskio_apple.c
src/detection/displayserver/displayserver_apple.c
src/detection/font/font_apple.m
src/detection/gpu/gpu_apple.c
src/detection/gpu/gpu_apple.m
src/detection/host/host_apple.c
src/detection/lm/lm_nosupport.c
src/detection/icons/icons_nosupport.c
src/detection/initsystem/initsystem_linux.c
src/detection/lm/lm_nosupport.c
src/detection/loadavg/loadavg_bsd.c
src/detection/libc/libc_apple.c
src/detection/locale/locale_linux.c
src/detection/localip/localip_linux.c
@@ -635,26 +680,32 @@ elseif(WIN32)
src/detection/bios/bios_windows.c
src/detection/bluetooth/bluetooth_windows.c
src/detection/board/board_windows.c
src/detection/bootmgr/bootmgr_windows.c
src/detection/brightness/brightness_windows.cpp
src/detection/chassis/chassis_windows.c
src/detection/cpu/cpu_windows.c
src/detection/cpucache/cpucache_windows.c
src/detection/cpuusage/cpuusage_windows.c
src/detection/cursor/cursor_windows.c
src/detection/disk/disk_windows.c
src/detection/physicaldisk/physicaldisk_windows.c
src/detection/diskio/diskio_windows.c
src/detection/displayserver/displayserver_windows.c
src/detection/dns/dns_windows.c
src/detection/font/font_windows.c
src/detection/gpu/gpu_windows.c
src/detection/host/host_windows.c
src/detection/icons/icons_windows.c
src/detection/initsystem/initsystem_nosupport.c
src/detection/libc/libc_windows.cpp
src/detection/lm/lm_nosupport.c
src/detection/loadavg/loadavg_nosupport.c
src/detection/locale/locale_windows.c
src/detection/localip/localip_windows.c
src/detection/gamepad/gamepad_windows.c
src/detection/media/media_nosupport.c
src/detection/media/media_windows.c
src/detection/memory/memory_windows.c
src/detection/physicalmemory/physicalmemory_linux.c
src/detection/monitor/monitor_windows.c
src/detection/netio/netio_windows.c
src/detection/opengl/opengl_windows.c
@@ -684,6 +735,77 @@ elseif(WIN32)
src/util/windows/wmi.cpp
src/util/platform/FFPlatform_windows.c
)
elseif(SunOS)
list(APPEND LIBFASTFETCH_SRC
src/common/dbus.c
src/common/io/io_unix.c
src/common/netif/netif_bsd.c
src/common/networking_linux.c
src/common/processing_linux.c
src/detection/battery/battery_nosupport.c
src/detection/bios/bios_windows.c
src/detection/board/board_windows.c
src/detection/bootmgr/bootmgr_nosupport.c
src/detection/brightness/brightness_nosupport.c
src/detection/chassis/chassis_windows.c
src/detection/cpu/cpu_sunos.c
src/detection/cpucache/cpucache_shared.c
src/detection/cpuusage/cpuusage_sunos.c
src/detection/cursor/cursor_linux.c
src/detection/bluetooth/bluetooth_nosupport.c
src/detection/disk/disk_sunos.c
src/detection/dns/dns_linux.c
src/detection/physicaldisk/physicaldisk_nosupport.c
src/detection/physicalmemory/physicalmemory_linux.c
src/detection/diskio/diskio_sunos.c
src/detection/displayserver/linux/displayserver_linux.c
src/detection/displayserver/linux/drm.c
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/wlr-output-management-unstable-v1-protocol.c
src/detection/displayserver/linux/wmde.c
src/detection/displayserver/linux/xcb.c
src/detection/displayserver/linux/xlib.c
src/detection/font/font_linux.c
src/detection/gpu/gpu_sunos.c
src/detection/gpu/gpu_pci.c
src/detection/gtk_qt/gtk.c
src/detection/host/host_windows.c
src/detection/icons/icons_linux.c
src/detection/initsystem/initsystem_linux.c
src/detection/libc/libc_nosupport.c
src/detection/lm/lm_nosupport.c
src/detection/loadavg/loadavg_sunos.c
src/detection/locale/locale_linux.c
src/detection/localip/localip_linux.c
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/netio/netio_sunos.c
src/detection/opengl/opengl_linux.c
src/detection/os/os_sunos.c
src/detection/packages/packages_sunos.c
src/detection/poweradapter/poweradapter_nosupport.c
src/detection/processes/processes_linux.c
src/detection/gtk_qt/qt.c
src/detection/sound/sound_linux.c
src/detection/swap/swap_sunos.c
src/detection/terminalfont/terminalfont_linux.c
src/detection/terminalshell/terminalshell_linux.c
src/detection/terminalsize/terminalsize_linux.c
src/detection/theme/theme_linux.c
src/detection/uptime/uptime_sunos.c
src/detection/users/users_linux.c
src/detection/wallpaper/wallpaper_linux.c
src/detection/wifi/wifi_nosupport.c
src/detection/wm/wm_nosupport.c
src/detection/de/de_linux.c
src/detection/wmtheme/wmtheme_linux.c
src/detection/camera/camera_nosupport.c
src/util/platform/FFPlatform_unix.c
)
endif()
if(ENABLE_DIRECTX_HEADERS)
@@ -691,15 +813,13 @@ if(ENABLE_DIRECTX_HEADERS)
list(APPEND LIBFASTFETCH_SRC src/detection/gpu/gpu_wsl.cpp)
endif()
if(ENABLE_PROPRIETARY_GPU_DRIVER_API AND (LINUX OR BSD OR WIN32))
message(STATUS "Enabling proprietary GPU driver API")
if(LINUX OR BSD OR WIN32)
list(APPEND LIBFASTFETCH_SRC src/detection/gpu/gpu_nvidia.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()
# Proprietary GPU driver APIs
if(LINUX OR BSD OR WIN32)
list(APPEND LIBFASTFETCH_SRC src/detection/gpu/gpu_nvidia.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)
@@ -728,10 +848,6 @@ add_library(libfastfetch OBJECT
${LIBFASTFETCH_SRC}
)
if(ENABLE_PROPRIETARY_GPU_DRIVER_API AND (LINUX OR BSD OR WIN32))
target_compile_definitions(libfastfetch PRIVATE FF_USE_PROPRIETARY_GPU_DRIVER_API)
endif()
if(yyjson_FOUND)
target_compile_definitions(libfastfetch PRIVATE FF_USE_SYSTEM_YYJSON)
target_link_libraries(libfastfetch PRIVATE yyjson::yyjson)
@@ -766,11 +882,13 @@ if(BSD AND EXISTS "/usr/local/bin/objdump")
endif()
endif()
target_compile_definitions(libfastfetch PUBLIC _GNU_SOURCE _XOPEN_SOURCE __STDC_WANT_LIB_EXT1__=1)
target_compile_definitions(libfastfetch PUBLIC _GNU_SOURCE _XOPEN_SOURCE __STDC_WANT_LIB_EXT1__=1 _FILE_OFFSET_BITS=64)
if(WIN32)
target_compile_definitions(libfastfetch PUBLIC WIN32_LEAN_AND_MEAN=1)
elseif(APPLE)
target_compile_definitions(libfastfetch PUBLIC _DARWIN_C_SOURCE)
elseif(SunOS)
target_compile_definitions(libfastfetch PUBLIC __EXTENSIONS__ _POSIX_C_SOURCE=1)
endif()
if(HAVE_STATX)
@@ -789,6 +907,15 @@ if(NOT "${CUSTOM_AMDGPU_IDS_PATH}" STREQUAL "")
message(STATUS "Custom file path of amdgpu.ids: ${CUSTOM_AMDGPU_IDS_PATH}")
target_compile_definitions(libfastfetch PRIVATE FF_CUSTOM_AMDGPU_IDS_PATH=${CUSTOM_AMDGPU_IDS_PATH})
endif()
if(NOT "${CUSTOM_OS_RELEASE_PATH}" STREQUAL "")
message(STATUS "Custom file path of os_release: ${CUSTOM_OS_RELEASE_PATH}")
target_compile_definitions(libfastfetch PRIVATE FF_CUSTOM_OS_RELEASE_PATH=${CUSTOM_OS_RELEASE_PATH})
endif()
if(NOT BINARY_LINK_TYPE STREQUAL "dlopen")
message(STATUS "Enabling custom link type: ${BINARY_LINK_TYPE}")
target_compile_definitions(libfastfetch PRIVATE FF_DISABLE_DLOPEN=1)
endif()
function(ff_lib_enable VARNAME PKGCONFIG_NAMES CMAKE_NAME)
if(NOT ENABLE_${VARNAME})
@@ -818,6 +945,11 @@ function(ff_lib_enable VARNAME PKGCONFIG_NAMES CMAKE_NAME)
target_compile_definitions(libfastfetch PRIVATE FF_HAVE_${VARNAME}=1)
target_include_directories(libfastfetch PRIVATE ${${VARNAME}_INCLUDE_DIRS})
if(NOT BINARY_LINK_TYPE STREQUAL "dlopen")
target_link_directories(libfastfetch PUBLIC ${${VARNAME}_LIBRARY_DIRS})
target_link_libraries(libfastfetch PRIVATE ${${VARNAME}_LIBRARIES})
endif()
foreach(FLAG ${${VARNAME}_CFLAGS_OTHER})
if(FLAG MATCHES "-D.*")
string(SUBSTRING ${FLAG} 2 -1 FLAG)
@@ -985,6 +1117,13 @@ elseif(BSD)
PRIVATE "usbhid"
PRIVATE "geom"
)
elseif(SunOS)
target_link_libraries(libfastfetch
PRIVATE "m"
PRIVATE "socket"
PRIVATE "kstat"
PRIVATE "proc"
)
elseif(ANDROID)
CHECK_LIBRARY_EXISTS(-l:libandroid-wordexp.a wordexp "" HAVE_LIBANDROID_WORDEXP_STATIC)
if(HAVE_LIBANDROID_WORDEXP_STATIC)
@@ -1010,6 +1149,24 @@ target_link_libraries(libfastfetch
PRIVATE ${CMAKE_DL_LIBS}
)
target_compile_options(libfastfetch PRIVATE
$<$<COMPILE_LANGUAGE:CXX>:-fno-exceptions -fno-rtti>)
if(WIN32)
set(CMAKE_CXX_STANDARD 20)
include(CheckIncludeFileCXX)
CHECK_INCLUDE_FILE_CXX("winrt/Windows.Foundation.h" HAVE_WINRT)
if(HAVE_WINRT)
add_library(ffwinrt MODULE src/detection/media/media_windows.dll.cpp)
target_link_libraries(ffwinrt PRIVATE "RuntimeObject")
target_compile_definitions(ffwinrt PRIVATE WIN32_LEAN_AND_MEAN=1 WINRT_LEAN_AND_MEAN=1)
target_link_options(ffwinrt
PRIVATE "-static" # stdc++, winpthread, gcc_s, etc.
)
endif()
set(CMAKE_CXX_STANDARD 17)
endif()
######################
# Executable targets #
######################
@@ -1048,12 +1205,9 @@ if(yyjson_FOUND)
endif()
if(WIN32)
set(TARGET_NAME fastfetch)
target_sources(fastfetch
PRIVATE src/util/windows/version.rc
)
set(TARGET_NAME flashfetch)
target_sources(flashfetch
PRIVATE src/util/windows/version.rc
)
@@ -1066,6 +1220,11 @@ elseif(APPLE)
)
endif()
if(BINARY_LINK_TYPE STREQUAL "static")
target_link_options(fastfetch PRIVATE "-static")
target_link_options(flashfetch PRIVATE "-static")
endif()
###################
# Testing targets #
###################
@@ -1101,14 +1260,21 @@ install(
DESTINATION "${CMAKE_INSTALL_BINDIR}"
)
if (TARGET ffwinrt)
install(
TARGETS ffwinrt
DESTINATION "${CMAKE_INSTALL_BINDIR}"
)
endif()
install(
FILES "${CMAKE_SOURCE_DIR}/completions/bash"
FILES "${CMAKE_SOURCE_DIR}/completions/${CMAKE_PROJECT_NAME}.bash"
DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/bash-completion/completions"
RENAME "${CMAKE_PROJECT_NAME}"
)
install(
FILES "${CMAKE_SOURCE_DIR}/completions/fish"
FILES "${CMAKE_SOURCE_DIR}/completions/${CMAKE_PROJECT_NAME}.fish"
DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/fish/vendor_completions.d"
RENAME "${CMAKE_PROJECT_NAME}.fish"
)
@@ -1118,10 +1284,12 @@ install(
DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/${CMAKE_PROJECT_NAME}"
)
install(
FILES "${CMAKE_SOURCE_DIR}/LICENSE"
DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/licenses/${CMAKE_PROJECT_NAME}"
)
if(INSTALL_LICENSE)
install(
FILES "${CMAKE_SOURCE_DIR}/LICENSE"
DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/licenses/${CMAKE_PROJECT_NAME}"
)
endif()
install(
FILES "${PROJECT_BINARY_DIR}/fastfetch.1"
@@ -1153,7 +1321,20 @@ if(LINUX)
set(CPACK_DEBIAN_PACKAGE_SECTION, "utils")
set(CPACK_DEBIAN_PACKAGE_PRIORITY "optional")
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libc6")
if(NOT IS_MUSL)
EXECUTE_PROCESS(
COMMAND getconf GNU_LIBC_VERSION
OUTPUT_VARIABLE GLIBC_VERSION
OUTPUT_STRIP_TRAILING_WHITESPACE)
if(GLIBC_VERSION)
STRING(REPLACE "glibc " "" GLIBC_VERSION ${GLIBC_VERSION})
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libc6 (>= ${GLIBC_VERSION})")
message(STATUS "found glibc ${GLIBC_VERSION}")
else()
message(WARNING "Could not determine glibc version. If `musl` is used, `-DIS_MUSL=ON` should be set")
endif()
endif()
endif()
find_program(HAVE_RPMBUILD "rpmbuild")
-34
View File
@@ -1,34 +0,0 @@
# Development help
This file is not an official documentation!
Here i just add things that are easy to forget.
## Features i am planning to implement
### Specific
- [ ] Split the project in different libs / executables, all linking static by default:
- `libffdetect`: contains all the detection stuff. To be used by anything that needs system information
- `libffprint`: contains the printing functions, logos, format etc
- `fastfetch` and `flashfetch`: Executables, that initialize the config of libffprint. Fist one at runtime, second one at compile time
- [ ] Make LocalIP module more configurable
- [ ] Automatic migrate old config files to newer versions
- [ ] ZSH completions
- [ ] Fish completions
- [ ] Make CPU usage detection much faster and more accurate
- [ ] Detect CPU usage in a common detection method and expose it both to the cpuUsage module and the cpu format string
- [ ] Per session caching
### General
- More presets
- More logos
- More package managers
- More DE detections
- More WM theme detections
- More terminal font detections
- Performance optimizations
- More module specific options
- Better error handling, especially the messages shown when using --show-errors
- Using package managers libraries for package count detection instead own. E.g. using libalpm instead of counting files in /var/lib/pacman/local
- Better documentation (especially default config file and the various --help options. Colored output?)
- General feature parity with neofetch, to demonstrate supremity of c
+2 -1
View File
@@ -1,6 +1,7 @@
MIT License
Copyright (c) 2021 Linus Dierheimer
Copyright (c) 2021-2023 Linus Dierheimer
Copyright (c) 2022-2024 Carter Li
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
+107 -21
View File
@@ -11,7 +11,7 @@
[![latest packaged version(s)](https://repology.org/badge/latest-versions/fastfetch.svg)](https://repology.org/project/fastfetch/versions)
[![Packaging status](https://repology.org/badge/tiny-repos/fastfetch.svg)](https://repology.org/project/fastfetch/versions)
Fastfetch is a [neofetch](https://github.com/dylanaraps/neofetch)-like tool for fetching system information and displaying them in a pretty way. It is written mainly in C, with performance and customizability in mind. Currently, Linux, Android, FreeBSD, MacOS and Windows 7+ are supported.
Fastfetch is a [neofetch](https://github.com/dylanaraps/neofetch)-like tool for fetching system information and displaying it prettily. It is written mainly in C, with performance and customizability in mind. Currently, Linux, Android, FreeBSD, macOS, SunOS and Windows 7+ are supported.
<img src="screenshots/example1.png" width="49%" align="left" />
<img src="https://upload.wikimedia.org/wikipedia/commons/2/24/Transparent_Square_Tiles_Texture.png" width="49%" height="16px" align="left" />
@@ -21,16 +21,17 @@ Fastfetch is a [neofetch](https://github.com/dylanaraps/neofetch)-like tool for
<img src="screenshots/example3.png" width="48%" align="top" />
<img src="screenshots/example5.png" height="15%" align="top" />
There are [screenshots on different platforms](https://github.com/fastfetch-cli/fastfetch/wiki)
There are [screenshots on different platforms](https://github.com/fastfetch-cli/fastfetch/wiki).
## Installation
### Linux
Some distros packaged an outdated fastfetch version. Older version is not supported, please always ensure that the latest version is used.
Some distros packaged an outdated fastfetch version. Older version receive no support, so please try always to use the latest version.
* Ubuntu: [`ppa:zhangsongcui3371/fastfetch`](https://launchpad.net/~zhangsongcui3371/+archive/ubuntu/fastfetch) (for Ubuntu 22.04 or newer)
* Debian / Ubuntu: Download `fastfetch-linux-<proper architecture>.deb` from [Github release page](https://github.com/fastfetch-cli/fastfetch/releases/latest) and `dpkg -i fastfetch-linux-<proper architecture>.deb` (for Ubuntu 20.04 or newer and Debian 11 or newer).
* Debian: `sudo apt install fastfetch` (for Debian 13 or newer)
* Debian / Ubuntu: Download `fastfetch-linux-<proper architecture>.deb` from [Github release page](https://github.com/fastfetch-cli/fastfetch/releases/latest) and double-click it (for Ubuntu 20.04 or newer and Debian 11 or newer).
* Arch Linux: `sudo pacman -S fastfetch`
* Fedora: `sudo dnf install fastfetch`
* Gentoo: `sudo emerge --ask app-misc/fastfetch`
@@ -43,31 +44,28 @@ Replace sudo with doas depending on what you use.
[See also if fastfetch has been packaged for your favorite Linux distro](#Packaging).
If fastfetch is not packaged for your distro or an outdated version is packaged, [linuxbrew](https://brew.sh/) is a good alternate: `brew install fastfetch`
If fastfetch is not packaged for your distro or an outdated version is packaged, [linuxbrew](https://brew.sh/) is a good alternative: `brew install fastfetch`
### macOS
...via [HomeBrew](https://brew.sh):
`brew install fastfetch`
...via [MacPorts](https://www.macports.org):
`sudo port install fastfetch`
* [HomeBrew](https://formulae.brew.sh/formula/fastfetch#default): `brew install fastfetch`
* [MacPorts](https://ports.macports.org/port/fastfetch/): `sudo port install fastfetch`
### Windows
`scoop install fastfetch`
* [scoop](https://scoop.sh/#/apps?q=fastfetch): `scoop install fastfetch`
* [winget](https://github.com/microsoft/winget-pkgs/tree/master/manifests/f/Fastfetch-cli/Fastfetch): `winget install fastfetch`
* [MSYS2 MinGW](https://github.com/msys2/MINGW-packages/tree/master/mingw-w64-fastfetch): `pacman -S mingw-w64-<subsystem>-<arch>-fastfetch`
You may also download it directly from [GitHub releases page](https://github.com/fastfetch-cli/fastfetch/releases/latest) and extract the archive.
You may also download the program directly from [the GitHub releases page](https://github.com/fastfetch-cli/fastfetch/releases/latest) in the form of an archive file.
### FreeBSD
`pkg install fastfetch`
* `pkg install fastfetch`
### Android (Termux)
`pkg install fastfetch`
* `pkg install fastfetch`
## Build from source
@@ -83,7 +81,7 @@ See Wiki: https://github.com/fastfetch-cli/fastfetch/wiki/Building
## Customization
Fastfetch uses the JSONC (or JSON with comments) for configuration. [See Wiki for detail](https://github.com/fastfetch-cli/fastfetch/wiki/Configuration). There are some premade config files in [`presets`](presets), including the ones used for the screenshots above. You can load them using `-c <filename>`. They may also serve as a good example for format arguments.
Fastfetch uses the JSONC (or JSON with comments) for configuration. [See Wiki for detail](https://github.com/fastfetch-cli/fastfetch/wiki/Configuration). There are some premade config files in [`presets`](presets), including the ones used for the screenshots above. You can load them using `-c <filename>`. Those files can serve as examples of the configuration syntax.
Logos can be heavily customized too; see the [logo documentation](https://github.com/fastfetch-cli/fastfetch/wiki/Logo-options) for more information.
@@ -101,11 +99,99 @@ Logos can be heavily customized too; see the [logo documentation](https://github
## FAQ
Q: Why do you need a very performant version of neofetch?
> I like putting neofetch in my ~/.bashrc to have a system overview whenever I use the terminal, but the slow speed annoyed me, so I created this. Also neofetch didn't output everything correctly (e.g Font is displayed as "[Plasma], Noto Sans, 10 [GTK2/3]") and writing my own tool gave me the possibility to fine tune it to run perfectly on at least my configuration.
### Q: Neofetch is good enough. Why do I need fastfetch?
Q: It does not display [*] correctly for me, what can I do?
> This is most likely because your system is not implemented (yet). At the moment I am focusing more on making the core app better, than adding more configurations. Feel free to open a pull request if you want to add support for your configuration
1. Fastfetch is actively maintained.
2. Fastfetch is faster. As the name suggests.
3. Fastfetch has a greater number of features, though by default fastfetch only has a few modules enabled; use `fastfetch -c all` to find what you want.
4. Fastfetch is more configurable. You can find more information in the Wiki: <https://github.com/fastfetch-cli/fastfetch/wiki/Configuration>.
5. Fastfetch is more polished. For example, neofetch prints `555MiB` in `Memory` module and `23G` in `Disk` module, whereas fastfetch prints `555.00 MiB` and `22.97 GiB` respectively.
6. Fastfetch is more accurate. For example, [neofetch never actually supports the Wayland protocol](https://github.com/dylanaraps/neofetch/pull/2395).
### Q: Fastfetch shows my local IP address. It leaks my privacy!
A local IP (10.x.x.x, 172.x.x.x, 192.168.x.x) has nothing to do with privacy. It only makes sense if you are on the same network, for example, if you connect to the same Wi-Fi network.
Actually the `Local IP` module is the most useful module for me personally. I (@CarterLi) have several VMs installed to test fastfetch and often need to SSH into them. I have fastfetch running on shell startup and I never need to type `ip addr` manually.
If you really don't like it, you can disable the `Local IP` module in `config.jsonc`.
### Q: Where is the config file? I can't find it.
`Fastfetch` does not generate config file automatically. You can use `fastfetch --gen-config` to generate one. The config file will be saved in `~/.config/fastfetch/config.jsonc` by default. See [Wiki for detail](https://github.com/fastfetch-cli/fastfetch/wiki/Configuration).
### Q: The configuration is so complex. Where is the documentation?
Fastfetch uses JSON (with comments) for configuration. I suggest you use an IDE with JSON schema support (like VSCode) to edit it.
Alternatively, you can refer to the presets in [`presets` directory](https://github.com/fastfetch-cli/fastfetch/tree/dev/presets).
### 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.
### Q: How can I customize the module output?
Fastfetch uses `format` to generate output. For example, to make the `GPU` module show only the GPU name (leaving other information undisplayed), you can use
```jsonc
{
"modules": [
{
"type": "gpu",
"format": "{2}" // See `fastfetch -h gpu-format` for detail
}
]
}
```
. . which is equivalent to `fastfetch -s gpu --gpu-format '{2}'`
See `fastfetch -h format` for information on basic usage. For module specific formattion, see `fastfetch -h <module>-format`
### Q: I have my own ascii-art / image file. How can I show it with fastfetch?
Try `fastfetch -l /path/to/logo`. See [logo documentation](https://github.com/fastfetch-cli/fastfetch/wiki/Logo-options) for detail.
If you just want to display distro name in [FIGlet text](https://github.com/pwaller/pyfiglet):
```bash
# install pyfiglet and jq first
pyfiglet -s -f small_slant $(fastfetch -s os --format json | jq -r '.[0].result.name') && fastfetch -l none
```
![image](https://github.com/fastfetch-cli/fastfetch/assets/6134068/6466524e-ab8c-484f-848d-eec7ddeb7df2)
### Q: Fastfetch runs in white and black on shell startup. Why?
This issue usually happens when using fastfetch with `p10k`. There are known incompatibility between fastfetch and p10k instant prompt.
The p10k doc clearly states that you should NOT print anything to stdout after `p10k-instant-prompt` is initialized. You should either put `fastfetch` before initialization of `p10k-instant-prompt` (recommended)
You can always use `fastfetch --pipe false` to force fastfetch running in colorful mode.
### 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:
```jsonc
// This module shows the default editor
{
"modules": [
{
"type": "command",
"text": "$EDITOR --version | head -1",
"key": "Editor"
}
]
}
```
Otherwise, open a feature request in [GitHub Issues](https://github.com/fastfetch-cli/fastfetch/issues).
### Q: I have questions. Where can I get help?
* For usage questions, please start a discussion in [GitHub Discussions](https://github.com/fastfetch-cli/fastfetch/discussions).
* For possible bugs, please open an issue in [GitHub Issues](https://github.com/fastfetch-cli/fastfetch/issues). Be sure to fill the bug-report template carefully for developers to investigate.
## Star History
@@ -1,5 +1,3 @@
#!/usr/bin/env bash
__fastfetch_complete_help()
{
local __ff_helps=(
@@ -191,14 +189,13 @@ __fastfetch_completion()
"--escape-bedrock"
"--pipe"
"--title-fqdn"
"--escape-bedrock"
"--disk-folders"
"--disk-show-external"
"--disk-show-hidden"
"--disk-show-subvolumes"
"--gpu-hide-integrated"
"--gpu-hide-discrete"
"--gpu-force-vulkan"
"--gpu-force-method"
"--disk-show-unknown"
"--bluetooth-show-disconnected"
)
@@ -227,8 +224,6 @@ __fastfetch_completion()
"--separator"
"-s"
"--structure"
"--set"
"--set-keyless"
"--player-name"
"--percent-type"
"--publicip-url"
@@ -352,6 +347,7 @@ __fastfetch_completion()
"--users-key"
"--users-format"
"--users-key-color"
"--users-myself-only"
"--bluetooth-key"
"--bluetooth-format"
"--bluetooth-key-color"
@@ -360,7 +356,6 @@ __fastfetch_completion()
local FF_OPTIONS_PATH=(
"-c"
"--config"
"--os-file"
"--lib-pci"
"--lib-vulkan"
"--lib-wayland"
@@ -1,5 +1,3 @@
#!/usr/bin/env fish
if not type -q fastfetch
exit
end
@@ -85,7 +83,7 @@ string match -r -a -g "^###> ?(.*)" < (status -f) | string collect | python3 | s
###> elif type == 'config':
###> print(f'{command_prefix} -x -a "(__fastfetch_complete_config)"')
###> elif type == 'enum':
###> temp: str = ' '.join(map(lambda x: f"{x[0]}\\t{x[1]}", flag["arg"]["enum"].items()))
###> 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)"')
+72
View File
@@ -1,3 +1,75 @@
fastfetch (2.17.1) jammy; urgency=medium
* Update to 2.17.1
-- Carter Li <zhangsongcui@live.cn> Mon, 01 Jul 2024 08:56:29 +0800
fastfetch (2.17.0) jammy; urgency=medium
* Update to 2.17.0
-- Carter Li <zhangsongcui@live.cn> Fri, 28 Jun 2024 13:43:18 +0800
fastfetch (2.16.0) jammy; urgency=medium
* Update to 2.16.0
-- Carter Li <zhangsongcui@live.cn> Wed, 19 Jun 2024 14:53:43 +0800
fastfetch (2.15.0) jammy; urgency=medium
* Update to 2.15.0
-- Carter Li <zhangsongcui@live.cn> Fri, 07 Jun 2024 13:52:43 +0800
fastfetch (2.14.0) jammy; urgency=medium
* Update to 2.14.0
-- Carter Li <zhangsongcui@live.cn> Thu, 30 May 2024 14:27:54 +0800
fastfetch (2.13.2) jammy; urgency=medium
* Update to 2.13.2
-- Carter Li <zhangsongcui@live.cn> Fri, 24 May 2024 13:48:59 +0800
fastfetch (2.13.1) jammy; urgency=medium
* Update to 2.13.1
-- Carter Li <zhangsongcui@live.cn> Tue, 21 May 2024 15:10:37 +0800
fastfetch (2.12.0) jammy; urgency=medium
* Update to 2.12.0
-- Carter Li <zhangsongcui@live.cn> Tue, 14 May 2024 16:33:33 +0800
fastfetch (2.11.5) jammy; urgency=medium
* Update to 2.11.5
-- Carter Li <zhangsongcui@live.cn> Tue, 07 May 2024 09:30:05 +0800
fastfetch (2.11.3) jammy; urgency=medium
* Update to 2.11.3
-- Carter Li <zhangsongcui@live.cn> Mon, 06 May 2024 08:46:45 +0800
fastfetch (2.10.2) jammy; urgency=medium
* Update to 2.10.2
-- Carter Li <zhangsongcui@live.cn> Tue, 23 Apr 2024 15:18:23 +0800
fastfetch (2.10.1) jammy; urgency=medium
* Update to 2.10.1
-- Carter Li <zhangsongcui@live.cn> Tue, 23 Apr 2024 09:55:02 +0800
fastfetch (2.9.2) jammy; urgency=medium
* Update to 2.9.2
+1 -1
View File
@@ -1 +1 @@
fastfetch_2.9.2_source.buildinfo universe/utils optional
fastfetch_2.17.1_source.buildinfo universe/utils optional
+28 -18
View File
@@ -26,7 +26,7 @@ the exit code will be non\-zero.
.SS "Informative Options"
.TP
.B \-h, \-\-help \fI [command]
.B \-h, \-\-help \fI[command]
Show help output, displaying all available options or help for given command
.TP
@@ -43,7 +43,7 @@ List search paths of presets and logos
.TP
.B \-\-list\-logos
List available logos, they can be loaded with \fI \-\-logo
List available logos, they can be loaded with \fI\-\-logo
.TP
.B \-\-list\-modules
@@ -51,7 +51,7 @@ List available modules
.TP
.B \-\-list\-presets
List available presets, they can be loaded with \fI \-\-config
List available presets, they can be loaded with \fI\-\-config
.TP
.B \-\-list\-features
@@ -64,16 +64,24 @@ Print available logos
.B \-\-print\-structure
Print the default structure
.TP
.B \-\-format \fI<type>
Set the output format. Besides the
.I default
format, only
.I json
is supported currently.
.SS "Display Options"
.TP
.B \-l, \-\-logo \fI <logo>
.B \-l, \-\-logo \fI<logo>
Set the logo to display
.TP
.B \-s, \-\-structure \fI <structure>
.B \-s, \-\-structure \fI<structure>
Set the structure of the fetch. For details about the structure,
see the CONFIGURATION section.
@@ -81,38 +89,40 @@ see the CONFIGURATION section.
.SS "Config Options"
.TP
.B \-c, \-\-config \fI <config>
Use the specified config file or preset. If "none", disable further config
loading. For details about config files, see the CONFIGURATION section
.B \-c, \-\-config \fI<config>
Use the specified config file or preset. If
.I none
is specified, disable further config loading. For details about
config files, see the CONFIGURATION section
.TP
.B \-\-gen\-config \fI [file]
.B \-\-gen\-config \fI[file]
Generate a config file with options specified on the command line.
If \fI file \fR is specified, the configuration will written to the
If \fIfile\fR is specified, the configuration will written to the
file, otherwise it will be written to stdout.
.TP
.B \-\-gen\-config\-force \fI [file]
Same as \fB \-\-gen\-config\fR, but overwrites existing config
.B \-\-gen\-config\-force \fI[file]
Same as \fB\-\-gen\-config\fR, but overwrites existing config
.TP
To list all options, use \fB \-\-help\fR this will also print all available module options.
To list all options, use \fB\-\-help\fR. It will also print all available module options.
.SH CONFIGURATION
.SS "Fetch Structure"
The structure of a fetch describes the modules that should be included in
the output. It consists of a string of modules, separated by a colon (:).
To list all available modules, use \fB \-\-list\-modules \fR
To list all available modules, use \fB\-\-list\-modules\fR
.SS "Config Files"
Fastfetch uses JSONC based format for configuration. Fastfetch doesn't generate
config file automatically; it should be generated manually by \fB \-\-gen\-config\fR.
config file automatically; it should be generated manually by \fB\-\-gen\-config\fR.
The config file will be saved in \fB~/.config/fastfetch/config.jsonc\fR by default.
A JSONC config file is a JSON file that also supports comments with (//). Those
files must have the extension '.jsonc'.
A JSONC config file is a JSON file that also supports comments with (// and /* */).
Those files must have the extension '.jsonc'.
The specified configuration/preset files are searched in the following order:
@@ -128,4 +138,4 @@ Fastfetch provides some default presets. List them with \fB\-\-list\-presets\fR.
.BR neofetch (1)
.SH BUGS
Please report bugs to:\fI https://github.com/fastfetch\-cli/fastfetch/issues \fR
Please report bugs to: \fIhttps://github.com/fastfetch\-cli/fastfetch/issues\fR
+318 -29
View File
@@ -4,9 +4,8 @@
"colors": {
"type": "string",
"enum": [
"reset_", "bright_", "dim_",
"black", "red", "green", "yellow", "blue", "magenta", "cyan", "white", "default",
"bright_black", "bright_red", "bright_green", "bright_yellow", "bright_blue", "bright_magenta", "bright_cyan", "bright_white"
"reset_", "bright_", "dim_", "italic_", "underline_", "blink_", "inverse_", "hidden_", "strike_", "light_",
"black", "red", "green", "yellow", "blue", "magenta", "cyan", "white", "default"
]
},
"key": {
@@ -24,9 +23,13 @@
"default": 0
},
"format": {
"description": "Output format of the module",
"description": "Output format of the module. See `-h <module>-format` for detail. I.e: fastfetch -h disk-format",
"type": "string"
},
"outputColor": {
"description": "Output color of the module. Left empty to use `display.color.output`",
"$ref": "#/$defs/colors"
},
"percent": {
"description": "Threshold of percentage colors",
"type": "object",
@@ -86,10 +89,12 @@
"default": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json"
},
"logo": {
"description": "Fastfetch logo configurations\nSee also https://github.com/fastfetch-cli/fastfetch/wiki/Logo-options",
"oneOf": [
{
"description": "Disable logo",
"type": "null"
"type": "null",
"const": null
},
{
"description": "Set the source file of the logo",
@@ -214,10 +219,15 @@
"description": "If true, regenerate image logo cache",
"default": false
},
"separate": {
"type": "boolean",
"description": "If true, print modules at bottom of the logo",
"default": false
"position": {
"type": "string",
"description": "Set the position of the logo should be displayed",
"enum": [
"left",
"top",
"right"
],
"default": "left"
},
"chafa": {
"type": "object",
@@ -294,10 +304,6 @@
"type": "string",
"description": "The name of the player to use for module Media and Player. Linux only"
},
"osFile": {
"type": "string",
"description": "Set the path to the file containing OS information. Linux only"
},
"dsForceDrm": {
"description": "Force display detection to use DRM. Linux only",
"oneOf": [
@@ -328,6 +334,11 @@
"type": "integer",
"description": "Set the timeout (ms) when waiting for child processes, `-1` for no timeout",
"default": 1000
},
"preRun": {
"type": "string",
"description": "Set the command to be executed before printing logos",
"default": ""
}
}
},
@@ -384,6 +395,14 @@
"title": {
"description": "Set the color of the title",
"$ref": "#/$defs/colors"
},
"output": {
"description": "Set the color of the module output",
"$ref": "#/$defs/colors"
},
"separator": {
"description": "Set the color of the key-value separator",
"$ref": "#/$defs/colors"
}
}
}
@@ -492,10 +511,15 @@
"description": "Set the character to use in total part",
"default": "-"
},
"border": {
"type": "boolean",
"description": "Whether to show a border around the bar",
"default": true
"borderLeft": {
"type": "string",
"description": "Set the string to use at left border",
"default": "[ "
},
"borderRight": {
"type": "string",
"description": "Set the string to use at right border",
"default": " ]"
},
"width": {
"type": "integer",
@@ -512,7 +536,7 @@
"properties": {
"type": {
"type": "number",
"description": "Set the percentage output type. 1 for percentage number, 2 for bar, 3 for both, 6 for bar only, 9 for colored number",
"description": "Set the percentage output type. 1 for percentage number, 2 for multi-color bar, 3 for both, 6 for bar only, 9 for colored number, 10 for monochrome bar",
"minimum": 0,
"maximum": 255,
"default": 9
@@ -552,7 +576,7 @@
},
"tsVersion": {
"type": "boolean",
"description": "Whether to detect and display the version of terminal and shell. Mainly for benchmarking",
"description": "Whether to detect and display the version of terminal, shell and editor. Mainly for benchmarking",
"default": true
}
}
@@ -677,11 +701,13 @@
"bios",
"bluetooth",
"board",
"bootmgr",
"break",
"brightness",
"camera",
"chassis",
"cpu",
"cpucache",
"cpuusage",
"command",
"colors",
@@ -691,13 +717,17 @@
"disk",
"diskio",
"de",
"dns",
"editor",
"font",
"gamepad",
"gpu",
"host",
"icons",
"initsystem",
"kernel",
"lm",
"loadavg",
"locale",
"localip",
"media",
@@ -709,6 +739,7 @@
"os",
"packages",
"physicaldisk",
"physicalmemory",
"player",
"poweradapter",
"processes",
@@ -767,16 +798,24 @@
"anyOf": [
{
"const": "bios",
"description": "Print BIOS name, version, release date, etc"
"description": "Print information of 1st-stage bootloader (name, version, release date, etc)"
},
{
"const": "board",
"description": "Print mather board name and other info"
"description": "Print motherboard name and other info"
},
{
"const": "bootmgr",
"description": "Print information of 2nd-stage bootloader (name, firmware, etc)"
},
{
"const": "camera",
"description": "Print available cameras"
},
{
"const": "cpucache",
"description": "Print CPU cache sizes"
},
{
"const": "cursor",
"description": "Print cursor style name"
@@ -785,6 +824,10 @@
"const": "datetime",
"description": "Print current date and time"
},
{
"const": "editor",
"description": "Print information of the default editor ($VISUAL or $EDITOR)"
},
{
"const": "font",
"description": "Print system font name"
@@ -797,6 +840,10 @@
"const": "icons",
"description": "Print icon style name"
},
{
"const": "initsystem",
"description": "Print init system (pid 1) name and version"
},
{
"const": "kernel",
"description": "Print system kernel version"
@@ -825,6 +872,10 @@
"const": "os",
"description": "Print operating system name and version"
},
{
"const": "physicalmemory",
"description": "Print system physical memory devices"
},
{
"const": "player",
"description": "Print music player name"
@@ -865,10 +916,6 @@
"const": "uptime",
"description": "Print how long system has been running"
},
{
"const": "users",
"description": "Print users currently logged in"
},
{
"const": "version",
"description": "Print Fastfetch version"
@@ -897,6 +944,9 @@
"keyColor": {
"$ref": "#/$defs/keyColor"
},
"outputColor": {
"$ref": "#/$defs/outputColor"
},
"keyWidth": {
"$ref": "#/$defs/keyWidth"
},
@@ -931,6 +981,9 @@
"keyColor": {
"$ref": "#/$defs/keyColor"
},
"outputColor": {
"$ref": "#/$defs/outputColor"
},
"keyWidth": {
"$ref": "#/$defs/keyWidth"
},
@@ -962,6 +1015,9 @@
"keyColor": {
"$ref": "#/$defs/keyColor"
},
"outputColor": {
"$ref": "#/$defs/outputColor"
},
"keyWidth": {
"$ref": "#/$defs/keyWidth"
},
@@ -988,6 +1044,21 @@
"minimum": 0,
"maximum": 400,
"default": 10
},
"key": {
"$ref": "#/$defs/key"
},
"keyColor": {
"$ref": "#/$defs/keyColor"
},
"outputColor": {
"$ref": "#/$defs/outputColor"
},
"keyWidth": {
"$ref": "#/$defs/keyWidth"
},
"format": {
"$ref": "#/$defs/format"
}
}
},
@@ -1006,6 +1077,9 @@
"keyColor": {
"$ref": "#/$defs/keyColor"
},
"outputColor": {
"$ref": "#/$defs/outputColor"
},
"keyWidth": {
"$ref": "#/$defs/keyWidth"
},
@@ -1033,12 +1107,20 @@
"maximum": 9,
"default": 2
},
"showPeCoreCount": {
"description": "Detect and display CPU frequency of different core types (eg. Pcore and Ecore) if supported",
"type": "boolean",
"default": false
},
"key": {
"$ref": "#/$defs/key"
},
"keyColor": {
"$ref": "#/$defs/keyColor"
},
"outputColor": {
"$ref": "#/$defs/outputColor"
},
"keyWidth": {
"$ref": "#/$defs/keyWidth"
},
@@ -1063,6 +1145,21 @@
"type": "boolean",
"description": "Display CPU usage per CPU logical core, instead of an average result",
"default": false
},
"key": {
"$ref": "#/$defs/key"
},
"keyColor": {
"$ref": "#/$defs/keyColor"
},
"outputColor": {
"$ref": "#/$defs/outputColor"
},
"keyWidth": {
"$ref": "#/$defs/keyWidth"
},
"format": {
"$ref": "#/$defs/format"
}
}
},
@@ -1146,6 +1243,9 @@
"keyColor": {
"$ref": "#/$defs/keyColor"
},
"outputColor": {
"$ref": "#/$defs/outputColor"
},
"keyWidth": {
"$ref": "#/$defs/keyWidth"
},
@@ -1170,6 +1270,9 @@
"keyColor": {
"$ref": "#/$defs/keyColor"
},
"outputColor": {
"$ref": "#/$defs/outputColor"
},
"keyWidth": {
"$ref": "#/$defs/keyWidth"
},
@@ -1219,6 +1322,9 @@
"keyColor": {
"$ref": "#/$defs/keyColor"
},
"outputColor": {
"$ref": "#/$defs/outputColor"
},
"keyWidth": {
"$ref": "#/$defs/keyWidth"
},
@@ -1279,6 +1385,9 @@
"keyColor": {
"$ref": "#/$defs/keyColor"
},
"outputColor": {
"$ref": "#/$defs/outputColor"
},
"keyWidth": {
"$ref": "#/$defs/keyWidth"
},
@@ -1311,6 +1420,9 @@
"keyColor": {
"$ref": "#/$defs/keyColor"
},
"outputColor": {
"$ref": "#/$defs/outputColor"
},
"keyWidth": {
"$ref": "#/$defs/keyWidth"
},
@@ -1339,6 +1451,44 @@
"keyColor": {
"$ref": "#/$defs/keyColor"
},
"outputColor": {
"$ref": "#/$defs/outputColor"
},
"keyWidth": {
"$ref": "#/$defs/keyWidth"
},
"format": {
"$ref": "#/$defs/format"
}
}
},
{
"title": "DNS",
"type": "object",
"additionalProperties": false,
"properties": {
"type": {
"const": "dns",
"description": "Print DNS servers"
},
"showType": {
"enum": [
"ipv4",
"ipv6",
"both"
],
"default": "both",
"description": "Specify the type of DNS servers should be detected"
},
"key": {
"$ref": "#/$defs/key"
},
"keyColor": {
"$ref": "#/$defs/keyColor"
},
"outputColor": {
"$ref": "#/$defs/outputColor"
},
"keyWidth": {
"$ref": "#/$defs/keyWidth"
},
@@ -1365,6 +1515,9 @@
"keyColor": {
"$ref": "#/$defs/keyColor"
},
"outputColor": {
"$ref": "#/$defs/outputColor"
},
"keyWidth": {
"$ref": "#/$defs/keyWidth"
},
@@ -1390,10 +1543,17 @@
"type": "boolean",
"default": false
},
"forceVulkan": {
"description": "Force using vulkan to detect GPUs, which support video memory usage detection with `--allow-slow-operations`",
"type": "boolean",
"default": false
"detectionMethod": {
"description": "Force using a specified method to detect GPUs",
"type": "string",
"enum": [
"auto",
"pci",
"vulkan",
"opencl",
"opengl"
],
"default": "auto"
},
"hideType": {
"description": "Specify the type of GPUs should not be printed",
@@ -1410,6 +1570,9 @@
"keyColor": {
"$ref": "#/$defs/keyColor"
},
"outputColor": {
"$ref": "#/$defs/outputColor"
},
"keyWidth": {
"$ref": "#/$defs/keyWidth"
},
@@ -1452,6 +1615,11 @@
"type": "boolean",
"default": true
},
"showAllIps": {
"description": "Show all IPs bound to the same interface.\nBy default only the first IP is shown",
"type": "boolean",
"default": false
},
"compact": {
"description": "Show all IPs in one line",
"type": "boolean",
@@ -1472,6 +1640,9 @@
"keyColor": {
"$ref": "#/$defs/keyColor"
},
"outputColor": {
"$ref": "#/$defs/outputColor"
},
"keyWidth": {
"$ref": "#/$defs/keyWidth"
},
@@ -1498,6 +1669,50 @@
"keyColor": {
"$ref": "#/$defs/keyColor"
},
"outputColor": {
"$ref": "#/$defs/outputColor"
},
"keyWidth": {
"$ref": "#/$defs/keyWidth"
},
"format": {
"$ref": "#/$defs/format"
}
}
},
{
"title": "Loadavg",
"type": "object",
"additionalProperties": false,
"properties": {
"type": {
"const": "loadavg",
"description": "Print system load averages"
},
"ndigits": {
"type": "integer",
"description": "Set the number of digits to keep after the decimal point",
"minimum": 0,
"maximum": 9,
"default": 2
},
"compact": {
"type": "boolean",
"description": "Show values in one line",
"default": true
},
"percent": {
"$ref": "#/$defs/percent"
},
"key": {
"$ref": "#/$defs/key"
},
"keyColor": {
"$ref": "#/$defs/keyColor"
},
"outputColor": {
"$ref": "#/$defs/outputColor"
},
"keyWidth": {
"$ref": "#/$defs/keyWidth"
},
@@ -1535,6 +1750,9 @@
"keyColor": {
"$ref": "#/$defs/keyColor"
},
"outputColor": {
"$ref": "#/$defs/outputColor"
},
"keyWidth": {
"$ref": "#/$defs/keyWidth"
},
@@ -1568,6 +1786,9 @@
"keyColor": {
"$ref": "#/$defs/keyColor"
},
"outputColor": {
"$ref": "#/$defs/outputColor"
},
"keyWidth": {
"$ref": "#/$defs/keyWidth"
},
@@ -1622,6 +1843,9 @@
"keyColor": {
"$ref": "#/$defs/keyColor"
},
"outputColor": {
"$ref": "#/$defs/outputColor"
},
"keyWidth": {
"$ref": "#/$defs/keyWidth"
},
@@ -1652,6 +1876,9 @@
"keyColor": {
"$ref": "#/$defs/keyColor"
},
"outputColor": {
"$ref": "#/$defs/outputColor"
},
"keyWidth": {
"$ref": "#/$defs/keyWidth"
},
@@ -1681,12 +1908,20 @@
"minimum": 0,
"default": "disabled (0)"
},
"ipv6": {
"description": "Whether to use IPv6 for public IP detection server",
"type": "boolean",
"default": false
},
"key": {
"$ref": "#/$defs/key"
},
"keyColor": {
"$ref": "#/$defs/keyColor"
},
"outputColor": {
"$ref": "#/$defs/outputColor"
},
"keyWidth": {
"$ref": "#/$defs/keyWidth"
},
@@ -1708,6 +1943,9 @@
"description": "Set the string to be printed",
"type": "string",
"default": "-"
},
"outputColor": {
"$ref": "#/$defs/outputColor"
}
}
},
@@ -1739,6 +1977,9 @@
"keyColor": {
"$ref": "#/$defs/keyColor"
},
"outputColor": {
"$ref": "#/$defs/outputColor"
},
"keyWidth": {
"$ref": "#/$defs/keyWidth"
},
@@ -1765,6 +2006,9 @@
"keyColor": {
"$ref": "#/$defs/keyColor"
},
"outputColor": {
"$ref": "#/$defs/outputColor"
},
"keyWidth": {
"$ref": "#/$defs/keyWidth"
},
@@ -1812,6 +2056,45 @@
"keyColor": {
"$ref": "#/$defs/keyColor"
},
"outputColor": {
"$ref": "#/$defs/outputColor"
},
"keyWidth": {
"$ref": "#/$defs/keyWidth"
},
"format": {
"$ref": "#/$defs/format"
}
}
},
{
"title": "Users",
"type": "object",
"additionalProperties": false,
"properties": {
"type": {
"const": "users",
"description": "Print users currently logged in"
},
"compact": {
"type": "boolean",
"description": "Show all active users in one line",
"default": false
},
"myselfOnly": {
"type": "boolean",
"description": "Show only the current user",
"default": false
},
"key": {
"$ref": "#/$defs/key"
},
"keyColor": {
"$ref": "#/$defs/keyColor"
},
"outputColor": {
"$ref": "#/$defs/outputColor"
},
"keyWidth": {
"$ref": "#/$defs/keyWidth"
},
@@ -1850,6 +2133,9 @@
"keyColor": {
"$ref": "#/$defs/keyColor"
},
"outputColor": {
"$ref": "#/$defs/outputColor"
},
"keyWidth": {
"$ref": "#/$defs/keyWidth"
},
@@ -1878,6 +2164,9 @@
"keyColor": {
"$ref": "#/$defs/keyColor"
},
"outputColor": {
"$ref": "#/$defs/outputColor"
},
"keyWidth": {
"$ref": "#/$defs/keyWidth"
},
+33 -5
View File
@@ -1,18 +1,27 @@
{
"$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json",
"logo": {
"padding": {
"top": 2
}
},
"modules": [
"title",
"separator",
"os",
"host",
"bios",
"bootmgr",
"board",
"chassis",
"kernel",
"initsystem",
"uptime",
"loadavg",
"processes",
"packages",
"shell",
"editor",
"display",
"brightness",
"monitor",
@@ -29,10 +38,19 @@
"terminalfont",
"terminalsize",
"terminaltheme",
"cpu",
{
"type": "cpu",
"showPeCoreCount": true,
"temp": true
},
"cpucache",
"cpuusage",
"gpu",
{
"type": "gpu",
"temp": true
},
"memory",
"physicalmemory",
"swap",
"disk",
"battery",
@@ -40,7 +58,11 @@
"player",
"media",
"publicip",
"localip",
{
"type": "localip",
"showIpv6": true,
"showMac": true
},
"wifi",
"datetime",
"locale",
@@ -52,10 +74,16 @@
"sound",
"camera",
"gamepad",
"weather",
{
"type": "weather",
"timeout": 1000
},
"netio",
"diskio",
"physicaldisk",
{
"type": "physicaldisk",
"temp": true
},
"version",
"break",
"colors"
+84
View File
@@ -0,0 +1,84 @@
{
"$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json",
"modules": [
{
"type": "title",
"key": "User",
"format": "{1}"
},
{
"type": "title",
"key": "Hostname",
"format": "{2}"
},
{
"type": "host",
"key": "Model"
},
{
"type": "os",
"format": "{3} {9} {12}"
},
"kernel",
"uptime",
{
"type": "loadavg",
"key": "Load Average"
},
"processes",
{
"type": "wm",
"key": "Window Manager"
},
{
"type": "de",
"key": "Desktop Environment"
},
{
"type": "shell",
"format": "{7}"
},
{
"type": "terminal",
"format": "{5} {6} {#37}█{#97}█ {#36}█{#96}█ {#35}█{#95}█ {#34}█{#94}█ {#33}█{#93}█ {#32}█{#92}█ {#31}█{#91}█ {#30}█{#90}█"
},
{
"type": "packages",
"format": "{1}"
},
{
"type": "cpu",
"key": "Temperature",
"temp": true,
"format": "{8}"
},
{
"type": "cpu",
"key": "CPU",
"format": "{4} x {1}"
},
{
"type": "gpu",
"format": "{2}"
},
{
"type": "memory",
"key": "RAM"
},
{
"type": "disk",
"key": "Disk",
"folders": "/"
},
{
"type": "localip",
"key": "LAN IP",
"showIpv6": true,
"showPrefixLen": false
},
{
"type": "publicip",
"key": "WAN IP"
}
]
}
+25 -4
View File
@@ -6,19 +6,24 @@
"showErrors": true,
"noBuffer": true
},
"logo": null,
"modules": [
"title",
"separator",
"os",
"host",
"bios",
"bootmgr",
"board",
"chassis",
"kernel",
"initsystem",
"uptime",
"loadavg",
"processes",
"packages",
"shell",
"editor",
"display",
"brightness",
"monitor",
@@ -35,10 +40,19 @@
"terminalfont",
"terminalsize",
"terminaltheme",
"cpu",
{
"type": "cpu",
"showPeCoreCount": true,
"temp": true
},
"cpucache",
"cpuusage",
"gpu",
{
"type": "gpu",
"temp": true
},
"memory",
"physicalmemory",
"swap",
"disk",
"battery",
@@ -46,7 +60,11 @@
"player",
"media",
"publicip",
"localip",
{
"type": "localip",
"showIpv6": true,
"showMac": true
},
"wifi",
"datetime",
"locale",
@@ -64,7 +82,10 @@
},
"netio",
"diskio",
"physicaldisk",
{
"type": "physicaldisk",
"temp": true
},
"version",
"break",
"colors"
+10 -6
View File
@@ -14,7 +14,8 @@
"modules": [
{
"type": "custom",
"format": "\u001b[90m┌────────────────────────────────────────────────────────────┐"
"format": "┌────────────────────────────────────────────────────────────┐",
"outputColor": "90"
},
{
"type": "title",
@@ -22,15 +23,17 @@
},
{
"type": "custom",
"format": "\u001b[90m└────────────────────────────────────────────────────────────┘"
"format": "└────────────────────────────────────────────────────────────┘",
"outputColor": "90"
},
{
"type": "custom",
"format": " \u001b[90m\u001b[31m\u001b[32m\u001b[33m\u001b[34m\u001b[35m\u001b[36m\u001b[37m\u001b[38m\u001b[39m  \u001b[38m\u001b[37m\u001b[36m\u001b[35m\u001b[34m\u001b[33m\u001b[32m\u001b[31m\u001b[90m"
"format": " {#90}{#31}{#32}{#33}{#34}{#35}{#36}{#37}{#38}{#39}  {#38}{#37}{#36}{#35}{#34}{#33}{#32}{#31}{#90}"
},
{
"type": "custom",
"format": "\u001b[90m┌────────────────────────────────────────────────────────────┐"
"format": "┌────────────────────────────────────────────────────────────┐",
"outputColor": "90"
},
{
"type": "os",
@@ -139,12 +142,13 @@
},
{
"type": "custom",
"format": "\u001b[90m└────────────────────────────────────────────────────────────┘"
"format": "└────────────────────────────────────────────────────────────┘",
"outputColor": "90"
},
"break",
{
"type": "custom",
"format": " \u001b[90m\u001b[31m\u001b[32m\u001b[33m\u001b[34m\u001b[35m\u001b[36m\u001b[37m\u001b[38m\u001b[39m  \u001b[38m\u001b[37m\u001b[36m\u001b[35m\u001b[34m\u001b[33m\u001b[32m\u001b[31m\u001b[90m"
"format": " {#90}{#31}{#32}{#33}{#34}{#35}{#36}{#37}{#38}{#39}  {#38}{#37}{#36}{#35}{#34}{#33}{#32}{#31}{#90}"
}
]
}
+4 -1
View File
@@ -4,7 +4,10 @@
"type": "small"
},
"display": {
"separator": "\u001b[31m-> "
"separator": "-> ",
"color": {
"separator": "red"
}
},
"modules": [
{
+6 -3
View File
@@ -4,7 +4,10 @@
"type": "none"
},
"display": {
"separator": "-> "
"separator": "-> ",
"color": {
"separator": "1"
}
},
"modules": [
{
@@ -14,7 +17,7 @@
"break",
{
"type": "custom",
"format": "┌───────────────────────────── \u001b[1mSystem Information\u001b[0m ─────────────────────────────┐" // `\u001b` is `\033`, or `\e`
"format": "┌───────────────────────────── {#1}System Information{#} ─────────────────────────────┐"
},
"break",
{
@@ -92,7 +95,7 @@
"break",
{
"type": "custom",
"format": "└──────────────────────────────────────────────────────────────────────────────┘" // `\u001b` is `\033`, or `\e`
"format": "└──────────────────────────────────────────────────────────────────────────────┘"
},
"break",
{
+16 -14
View File
@@ -1,3 +1,4 @@
// Inspired by Catnap
{
"$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json",
"logo": {
@@ -17,54 +18,55 @@
},
{
// draw borders first to make colors of left and right border consistant
"key": "│ │\u001b[11D\u001b[31m user",
"key": "│ │\u001b[11D{#31} user",
"type": "title",
"format": "{1}"
},
{
"key": "│ │\u001b[11D\u001b[32m󰇅 hname",
"key": "│ │\u001b[11D{#32}󰇅 hname",
"type": "title",
"format": "{2}"
},
{
"key": "│ │\u001b[11D\u001b[33m󰅐 uptime",
"key": "│ │\u001b[11D{#33}󰅐 uptime",
"type": "uptime"
},
{
"key": "│ │\u001b[11D\u001b[34m󰟾 distro",
"key": "│ │\u001b[11D{#34}󰟾 distro",
"type": "os"
},
{
"key": "│ │\u001b[11D\u001b[35m kernel",
"key": "│ │\u001b[11D{#35} kernel",
"type": "kernel"
},
{
"key": "│ │\u001b[11D\u001b[36m󰇄 desktop",
"key": "│ │\u001b[11D{#36}󰇄 desktop",
"type": "de"
},
{
"key": "│ │\u001b[11D\u001b[31m term",
"key": "│ │\u001b[11D{#31} term",
"type": "terminal"
},
{
"key": "│ │\u001b[11D\u001b[32m shell",
"key": "│ │\u001b[11D{#32} shell",
"type": "shell"
},
{
"key": "│ │\u001b[11D\u001b[33m󰍛 cpu",
"type": "cpu"
"key": "│ │\u001b[11D{#33}󰍛 cpu",
"type": "cpu",
"showPeCoreCount": true
},
{
"key": "│ │\u001b[11D\u001b[34m󰉉 disk",
"key": "│ │\u001b[11D{#34}󰉉 disk",
"type": "disk",
"folders": "/"
},
{
"key": "│ │\u001b[11D\u001b[35m memory",
"key": "│ │\u001b[11D{#35} memory",
"type": "memory"
},
{
"key": "│ │\u001b[11D\u001b[36m󰩟 network",
"key": "│ │\u001b[11D{#36}󰩟 network",
"type": "localip",
"format": "{1} ({4})"
},
@@ -73,7 +75,7 @@
"type": "custom"
},
{
"key": "│ │\u001b[11D\u001b[m colors",
"key": "│ │\u001b[11D{#39} colors",
"type": "colors",
"symbol": "circle"
},
+86
View File
@@ -0,0 +1,86 @@
// Inspired by Catnap
{
"$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json",
"logo": {
"type": "small"
},
"display": {
"separator": "",
"keyWidth": 12
},
"modules": [
{
// draw borders first to make colors of left and right border consistant
"key": " user",
"type": "title",
"format": "{1}",
"keyColor": "31"
},
{
"key": "󰇅 hname",
"type": "title",
"format": "{2}",
"keyColor": "32"
},
{
"key": "󰅐 uptime",
"type": "uptime",
"keyColor": "33"
},
{
"key": "󰟾 distro",
"type": "os",
"keyColor": "34"
},
{
"key": " kernel",
"type": "kernel",
"keyColor": "35"
},
{
"key": "󰇄 desktop",
"type": "de",
"keyColor": "36"
},
{
"key": " term",
"type": "terminal",
"keyColor": "31"
},
{
"key": " shell",
"type": "shell",
"keyColor": "32"
},
{
"key": "󰍛 cpu",
"type": "cpu",
"showPeCoreCount": true,
"keyColor": "33"
},
{
"key": "󰉉 disk",
"type": "disk",
"folders": "/",
"keyColor": "34"
},
{
"key": " memory",
"type": "memory",
"keyColor": "35"
},
{
"key": "󰩟 network",
"type": "localip",
"format": "{1} ({4})",
"keyColor": "36"
},
{
"key": " colors",
"type": "colors",
"symbol": "circle",
"keyColor": "39"
}
]
}
+87
View File
@@ -0,0 +1,87 @@
// Inspired by Catnap
{
"$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json",
"logo": {
"type": "small",
"padding": {
"top": 1
}
},
"display": {
"separator": "",
"keyWidth": 15
},
"modules": [
{
"key": "•••••••••••••",
"type": "custom"
},
{
// draw borders first to make colors of left and right border consistant
"key": "• •\u001b[11D{#31} user",
"type": "title",
"format": "{1}"
},
{
"key": "• •\u001b[11D{#32}󰇅 hname",
"type": "title",
"format": "{2}"
},
{
"key": "• •\u001b[11D{#33}󰅐 uptime",
"type": "uptime"
},
{
"key": "• •\u001b[11D{#34}󰟾 distro",
"type": "os"
},
{
"key": "• •\u001b[11D{#35} kernel",
"type": "kernel"
},
{
"key": "• •\u001b[11D{#36}󰇄 desktop",
"type": "de"
},
{
"key": "• •\u001b[11D{#31} term",
"type": "terminal"
},
{
"key": "• •\u001b[11D{#32} shell",
"type": "shell"
},
{
"key": "• •\u001b[11D{#33}󰍛 cpu",
"type": "cpu",
"showPeCoreCount": true
},
{
"key": "• •\u001b[11D{#34}󰉉 disk",
"type": "disk",
"folders": "/"
},
{
"key": "• •\u001b[11D{#35} memory",
"type": "memory"
},
{
"key": "• •\u001b[11D{#36}󰩟 network",
"type": "localip",
"format": "{1} ({4})"
},
{
"key": "•••••••••••••",
"type": "custom"
},
{
"key": "• •\u001b[11D{#39} colors",
"type": "colors",
"symbol": "circle"
},
{
"key": "•••••••••••••",
"type": "custom"
}
]
}
+85
View File
@@ -0,0 +1,85 @@
// Inspired by Catnap
{
"$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json",
"logo": {
"type": "small",
"padding": {
"top": 1
}
},
"display": {
"separator": " "
},
"modules": [
{
"key": "╔═══════════╗",
"type": "custom"
},
{
"key": "║ {#31} user {#keys}║",
"type": "title",
"format": "{1}"
},
{
"key": "║ {#32}󰇅 hname {#keys}║",
"type": "title",
"format": "{2}"
},
{
"key": "║ {#33}󰅐 uptime {#keys}║",
"type": "uptime"
},
{
"key": "║ {#34}󰟾 distro {#keys}║",
"type": "os"
},
{
"key": "║ {#35} kernel {#keys}║",
"type": "kernel"
},
{
"key": "║ {#36}󰇄 desktop {#keys}║",
"type": "de"
},
{
"key": "║ {#31} term {#keys}║",
"type": "terminal"
},
{
"key": "║ {#32} shell {#keys}║",
"type": "shell"
},
{
"key": "║ {#33}󰍛 cpu {#keys}║",
"type": "cpu",
"showPeCoreCount": true
},
{
"key": "║ {#34}󰉉 disk {#keys}║",
"type": "disk",
"folders": "/"
},
{
"key": "║ {#35} memory {#keys}║",
"type": "memory"
},
{
"key": "║ {#36}󰩟 network {#keys}║",
"type": "localip",
"format": "{1} ({4})"
},
{
"key": "╠═══════════╣",
"type": "custom"
},
{
"key": "║ {#39} colors {#keys}║",
"type": "colors",
"symbol": "circle"
},
{
"key": "╚═══════════╝",
"type": "custom"
}
]
}
+83
View File
@@ -0,0 +1,83 @@
{
"$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json",
"logo": {
"type": "small",
"padding": {
"top": 1,
"right": 2
}
},
"display": {
"separator": "> ",
"color": {
"separator": "red"
}
},
"modules": [
{
"format": "{#1}{#keys}╭───────────────────────────────────────────────────────────────────────────╮\u001b[76D {6}{7}{8} 🖥 ",
"type": "title"
},
{
"key": "│\u001b[75C│\u001b[75D{#31} kernel ",
"type": "kernel"
},
{
"key": "│\u001b[75C│\u001b[75D{#32}󰅐 uptime ",
"type": "uptime"
},
{
"key": "│\u001b[75C│\u001b[75D{#33}󰟾 distro ",
"type": "os"
},
{
"key": "│\u001b[75C│\u001b[75D{#34}󰇄 desktop ",
"type": "de"
},
{
"key": "│\u001b[75C│\u001b[75D{#35} term ",
"type": "terminal"
},
{
"key": "│\u001b[75C│\u001b[75D{#36} shell ",
"type": "shell"
},
{
"key": "│\u001b[75C│\u001b[75D{#35}󰍛 cpu ",
"type": "cpu",
"showPeCoreCount": true,
"temp": true
},
{
"key": "│\u001b[75C│\u001b[75D{#34}󰍛 gpu ",
"type": "gpu"
},
{
"key": "│\u001b[75C│\u001b[75D{#33}󰉉 disk ",
"type": "disk",
"folders": "/"
},
{
"key": "│\u001b[75C│\u001b[75D{#32} memory ",
"type": "memory"
},
{
"key": "│\u001b[75C│\u001b[75D{#31}󰩟 network ",
"type": "localip",
"format": "{1} ({4})"
},
{
"format": "{#1}{#keys}├───────────────────────────────────────────────────────────────────────────┤",
"type": "custom"
},
{
"key": "│\u001b[75C│\u001b[75D{#39} colors ",
"type": "colors",
"symbol": "circle"
},
{
"format": "{#1}{#keys}╰───────────────────────────────────────────────────────────────────────────╯",
"type": "custom"
}
]
}
+83
View File
@@ -0,0 +1,83 @@
{
"$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json",
"logo": {
"type": "small",
"padding": {
"top": 1,
"right": 2
}
},
"display": {
"separator": "> ",
"color": {
"separator": "red"
}
},
"modules": [
{
"format": "{#1}{#keys}╔═══════════════════════════════════════════════════════════════════════════╗\u001b[76D {6}{7}{8} 💻 ",
"type": "title"
},
{
"key": "║\u001b[75C║\u001b[75D{#31} kernel ",
"type": "kernel"
},
{
"key": "║\u001b[75C║\u001b[75D{#32}󰅐 uptime ",
"type": "uptime"
},
{
"key": "║\u001b[75C║\u001b[75D{#33}󰟾 distro ",
"type": "os"
},
{
"key": "║\u001b[75C║\u001b[75D{#34}󰇄 desktop ",
"type": "de"
},
{
"key": "║\u001b[75C║\u001b[75D{#35} term ",
"type": "terminal"
},
{
"key": "║\u001b[75C║\u001b[75D{#36} shell ",
"type": "shell"
},
{
"key": "║\u001b[75C║\u001b[75D{#35}󰍛 cpu ",
"type": "cpu",
"showPeCoreCount": true,
"temp": true
},
{
"key": "║\u001b[75C║\u001b[75D{#34}󰍛 gpu ",
"type": "gpu"
},
{
"key": "║\u001b[75C║\u001b[75D{#33}󰉉 disk ",
"type": "disk",
"folders": "/"
},
{
"key": "║\u001b[75C║\u001b[75D{#32} memory ",
"type": "memory"
},
{
"key": "║\u001b[75C║\u001b[75D{#31}󰩟 network ",
"type": "localip",
"format": "{1} ({4})"
},
{
"format": "{#1}{#keys}╠═══════════════════════════════════════════════════════════════════════════╣",
"type": "custom"
},
{
"key": "║\u001b[75C║\u001b[75D{#39} colors ",
"type": "colors",
"symbol": "circle"
},
{
"format": "{#1}{#keys}╚═══════════════════════════════════════════════════════════════════════════╝",
"type": "custom"
}
]
}
+188
View File
@@ -0,0 +1,188 @@
// _____ _____ _____ _____ _____ _____ _____ _____ _____
// | __| _ | __|_ _| __| __|_ _| | | |
// | __| |__ | | | | __| __| | | | --| |
// |__| |__|__|_____| |_| |__| |_____| |_| |_____|__|__|
//
// By CarterLi - https://github.com/CarterLi
// Homepage - https://github.com/fastfetch-cli/fastfetch
// config.jsonc - ニリ @niri-san
// pokemon-colorscripts - https://gitlab.com/phoneybadger/pokemon-colorscripts
{
"$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json",
"logo": {
"source": " _____ _____ _____ _____ _____ _____ _____ _____ _____\n| __| _ | __|_ _| __| __|_ _| | | |\n| __| |__ | | | | __| __| | | | --| |\n|__| |__|__|_____| |_| |__| |_____| |_| |_____|__|__|",
"type": "data",
"separate": true,
"padding": {
"right": 2
}
},
"display": {
"separator": " - "
},
"modules": [
{
"type": "custom", // HardwareInfo
"format": "• {#green}SYSTEM INFORMATION"
},
{
"type": "host",
"key": "HOST",
"format": "{name}{?vendor} ({vendor}){?}",
"keyColor": "green"
},
{
"type": "chassis",
"key": "COMPUTER TYPE",
"keyColor": "green"
},
{
"type": "cpu",
"key": "CPU",
"keyColor": "green"
},
{
"type": "gpu",
"key": "GPU",
"keyColor": "green"
},
{
"type": "memory",
"key": "MEMORY USED",
"keyColor": "green"
},
{
"type": "swap",
"key": "SWAP USED",
"keyColor": "green"
},
{
"type": "disk",
"key": "DISK",
"folders": "/",
"keyColor": "green"
},
{
"type": "custom", // SoftwareInfo
"format": "• {#red}SOFTWARE INFORMATION"
},
{
"type": "os",
"key": "DISTRO",
"keyColor": "red"
},
{
"type": "disk",
"folders": "/", // Use "/System/Volumes/VM" or something else on macOS
"format": "{create-time}",
"key": "INSTALLED DATE",
"keyColor": "red"
},
{
"type": "kernel",
"key": "KERNEL",
"keyColor": "red"
},
{
"type": "packages",
"key": "PACKAGES",
"keyColor": "red"
},
{
"type": "uptime",
"key": "UPTIME",
"keyColor": "red"
},
{
"type": "custom", // DisplayInfo
"format": "• {#blue}DISPLAY INFORMATION"
},
{
"type": "de",
"key": "DESKTOP ENVIRONMENT",
"keyColor": "blue"
},
{
"type": "lm",
"key": "LOGIN MANAGER",
"format": "{type}",
"keyColor": "blue"
},
{
"type": "wm",
"key": "WM",
"keyColor": "blue"
},
{
"type": "wmtheme",
"key": "WM THEME",
"keyColor": "blue"
},
{
"type": "monitor",
"key": "MONITOR ({name})",
"keyColor": "blue"
},
{
"type": "custom", // DesignInfo
"format": "• {#yellow}DESIGN INFORMATION"
},
{
"type": "wallpaper",
"key": "WALLPAPER",
"keyColor": "yellow"
},
{
"type": "theme",
"key": "KDE THEME",
"format": "{1}",
"keyColor": "yellow"
},
{
"type": "icons",
"key": "ICON THEME",
"format": "{1}",
"keyColor": "yellow"
},
{
"type": "font",
"key": "FONT",
"format": "{?1}{1} [Qt]{?}{/1}Unknown", // Remove "[Qt]" if not using Qt
"keyColor": "yellow"
},
{
"type": "terminalfont",
"key": "TERMINAL FONT",
"keyColor": "yellow"
},
{
"type": "cursor",
"key": "CURSOR",
"keyColor": "yellow"
},
{
"type": "custom", // OtherInfo
"format": "• {#cyan}VARIOUS INFORMATION"
},
{
"type": "media",
"key": "NOW PLAYING",
"format": "{?artist}{artist} - {?}{title}",
"keyColor": "cyan"
},
{
"type": "weather",
"key": "WEATHER",
"timeout": 1000,
"keyColor": "cyan"
},
{
"type": "version",
"key": "INFO",
"keyColor": "cyan"
},
"break",
"colors",
"break"
]
}
+4 -3
View File
@@ -5,7 +5,7 @@
"$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json",
// "logo": {
// "type": "iterm",
// "source": "/Users/carter/Desktop/apple1.png",
// "source": "~/Desktop/apple1.png",
// "width": 28,
// "height": 12
// },
@@ -15,7 +15,8 @@
"modules": [
{
"type": "custom", // HardwareStart
"format": "┌─────────── \u001b[1mHardware Information\u001b[0m ───────────┐" // `\u001b` is `\033`, or `\e`
// {#1} is equivalent to `\u001b[1m`. {#} is equivalent to `\u001b[m`
"format": "┌─────────── {#1}Hardware Information{#} ───────────┐"
},
{
"type": "host",
@@ -71,7 +72,7 @@
},
{
"type": "custom", // SoftwareStart
"format": "├─────────── \u001b[1mSoftware Information\u001b[0m ───────────┤"
"format": "├─────────── {#1}Software Information{#} ───────────┤"
},
{
"type": "title",
+160
View File
@@ -0,0 +1,160 @@
// Inspired by https://github.com/usgraphics/TR-100
{
"$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json",
"logo": null,
"display": {
"pipe": true,
"keyWidth": 16,
"separator": "│ ",
"percent": {
"type": 6
},
"bar": {
"borderLeft": "",
"borderRight": "",
"charElapsed": "█",
"charTotal": "░",
"width": 40
}
},
"modules": [
{
"type": "custom",
"format": "┌┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┐"
},
{
"type": "custom",
"format": "├┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┤"
},
{
"type": "version",
"key": " ",
"format": "│ FASTFETCH v{version} │"
},
{
"type": "custom",
"format": "│ TR-100 MACHINE REPORT │"
},
{
"type": "custom",
"format": "├────────────┬──────────────────────────────────────────┤"
},
{
"type": "os",
"key": "│ OS │\u001b[42C"
},
{
"type": "kernel",
"key": "│ KERNEL │\u001b[42C"
},
{
"type": "custom",
"format": "├────────────┼──────────────────────────────────────────┤"
},
{
"type": "title",
"key": "│ HOSTNAME │\u001b[42C",
"format": "{host-name}"
},
{
"type": "localip",
"key": "│ CLIENT IP │\u001b[42C",
"format": "{ipv4}"
},
{
"type": "localip",
"key": "│ MAC ADDR │\u001b[42C",
"format": "{mac} ({ifname})",
"showIPv4": false,
"showMac": true
},
{
"type": "dns",
"key": "│ DNS │\u001b[42C",
"showType": "ipv4"
},
{
"type": "title",
"key": "│ USER │\u001b[42C",
"format": "{user-name}"
},
{
"type": "host",
"key": "│ MACHINE │\u001b[42C",
"format": "{name}"
},
{
"type": "custom",
"format": "├────────────┼──────────────────────────────────────────┤"
},
{
"type": "cpu",
"key": "│ PROCESSOR │\u001b[42C",
"format": "{name}"
},
{
"type": "cpu",
"key": "│ CORES │\u001b[42C",
"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"
},
{
"type": "loadavg",
"compact": false,
// {duration} is not fixed length, hack it
"key": "│ LOAD \u001b[s{duration}m\u001b[u\u001b[6C│\u001b[42C"
},
{
"type": "custom",
"format": "├────────────┼──────────────────────────────────────────┤"
},
{
"type": "memory",
"key": "│ MEMORY │\u001b[42C",
"format": "{used} / {total} [{percentage}]"
},
{
"type": "memory",
"key": "│ USAGE │\u001b[42C",
"format": ""
},
{
"type": "custom",
"format": "├────────────┼──────────────────────────────────────────┤"
},
{
"type": "disk",
"key": "│ VOLUME │\u001b[42C",
"format": "{size-used} / {size-total} [{size-percentage}]",
"folders": "/"
},
{
"type": "disk",
"key": "│ DISK USAGE │\u001b[42C",
"format": ""
},
{
"type": "custom",
"format": "├────────────┼──────────────────────────────────────────┤"
},
{
"type": "users",
"key": "│ LAST LOGIN │\u001b[42C",
"format": "{login-time}{?client-ip} ({client-ip})",
"myselfOnly": true
},
{
"type": "uptime",
"key": "│ UPTIME │\u001b[42C"
},
{
"type": "custom",
"format": "└────────────┴──────────────────────────────────────────┘"
}
]
}
+43
View File
@@ -0,0 +1,43 @@
{
"$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json",
"logo": {
"type": "small"
},
"modules": [
{
"key": "██ Distro",
"keyColor": "38;5;210",
"type": "os"
},
{
"key": "██ Kernel",
"keyColor": "38;5;84",
"type": "kernel"
},
{
"key": "██ Shell",
"keyColor": "38;5;147",
"type": "shell"
},
{
"key": "██ Packages",
"keyColor": "38;5;200",
"type": "packages"
},
{
"key": "██ WM",
"keyColor": "38;5;44",
"type": "wm"
},
{
"key": "██ CPU",
"keyColor": "38;5;75",
"type": "cpu"
},
{
"key": "██ Memory",
"keyColor": "38;5;123",
"type": "memory"
}
]
}
+109
View File
@@ -0,0 +1,109 @@
// 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",
"logo": {
"source": "arch3",
"color": {
"1": "red",
"2": "yellow"
}
},
"display": {
"color": {
"separator": "blue"
},
"separator": " | "
},
"modules": [
{
"type": "kernel",
"key": " /\\rch Linux",
"keyColor": "magenta"
},
{
"type": "custom",
"format": ">-----------<+>------------------------------------------<",
"outputColor": "separator"
},
{
"type": "uptime",
"key": " Uptime ",
"keyColor": "green"
},
{
"type": "shell",
"key": " Shell ",
"keyColor": "green"
},
{
"type": "terminal",
"key": " Terminal ",
"keyColor": "green"
},
{
"type": "terminalfont",
"key": " Font ",
"keyColor": "green"
},
{
"type": "packages",
"key": " Packages ",
"keyColor": "green"
},
{
"type": "localip",
"key": " Local IP ",
"keyColor": "green"
},
{
"type": "custom",
"format": ">-----------<+>------------------------------------------<",
"outputColor": "separator"
},
{
"type": "display",
"key": " Display ",
"keyColor": "cyan"
},
{
"type": "cpu",
"key": " CPU ",
"keyColor": "cyan"
},
{
"type": "gpu",
"key": " GPU ",
"keyColor": "cyan"
},
{
"type": "memory",
"key": " RAM ",
"keyColor": "cyan"
},
{
"type": "swap",
"key": " SWAP ",
"keyColor": "cyan"
},
{
"type": "disk",
"key": " Disk ",
"keyColor": "cyan"
},
{
"type": "battery",
"key": " Battery ",
"keyColor": "cyan"
},
{
"type": "custom",
"format": ">-----------<+>------------------------------------------<",
"outputColor": "separator"
},
"break",
{
"type": "colors",
"paddingLeft": 15
}
]
}
+1 -2
View File
@@ -9,8 +9,7 @@
"modules": [
{
"type": "theme",
"key": "T",
"format": "{7}"
"key": "T"
},
{
"type": "icons",
+1 -1
View File
@@ -24,7 +24,7 @@
"type": "os",
"key": "├", // Just get your distro's logo off nerdfonts.com
"keyColor": "yellow",
"format": "{6}{?6} {?}{10} {8}"
"format": "{6}{?6} {?}{10}{?10} {?}{8}{?8} {?}{11}"
},
{
"type": "kernel",
+6 -6
View File
@@ -24,29 +24,29 @@
},
{
"type": "os",
"key": "",
"key": "",
"format": "{2} {8}"
},
{
"type": "kernel",
"key": ""
"key": ""
},
{
"type": "memory",
"key": "󰻠"
"key": ""
},
{
"type": "packages",
"key": ""
"key": "󰏖"
},
{
"type": "uptime",
"key": ""
"key": "󰅐"
},
{
"type": "custom",
"key": "",
"format": "\u001b[31m███\u001b[32m███\u001b[33m███\u001b[34m███\u001b[35m███\u001b[36m███"
"format": "{#31}███{#32}███{#33}███{#34}███{#35}███{#36}███"
}
]
}
+8 -2
View File
@@ -9,6 +9,9 @@
"charElapsed": "=",
"charTotal": "-",
"width": 13
},
"percent": {
"type": 2
}
},
"modules": [
@@ -16,11 +19,14 @@
"separator",
"memory",
"swap",
"disk",
{
"type": "disk",
"folders": "/"
},
"battery",
{
"type": "colors",
"paddingLeft": 11,
"paddingLeft": 10,
"symbol": "circle"
}
]
+25 -13
View File
@@ -1,25 +1,37 @@
{
"$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json",
"logo": {
"type": "builtin",
"source": "arch"
},
"modules": [
"host",
"display",
{
"type": "host",
"format": "{?2}{2}{?}{?5} ({5}){?}"
},
"chassis",
{
"type": "board",
"format": "{?1}{1}{?}{?2} ({2}){?}"
},
"cpu",
"gpu",
{
"type": "memory",
"format": "{?2}{2}{?}"
},
{
"type": "disk",
"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}){?}"
}
"format": "{?1}{1}{?}{?2} {2}{?}{?3} ({3}){?}"
},
"poweradapter"
]
}
+9 -12
View File
@@ -1,16 +1,16 @@
{
"$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json",
"display": {
"size": {
"maxPrefix": "MB",
"ndigits": 0
}
},
"modules": [
"title",
"separator",
{
"type": "os",
"format": "{3} {12}"
},
{
"type": "host",
"format": "{/2}{-}{/}{2}{?3} {3}{?}"
},
"os",
"host",
"kernel",
"uptime",
"packages",
@@ -23,10 +23,7 @@
"de",
"wm",
"wmtheme",
{
"type": "theme",
"format": "{?1}{1}{?3} {3}{?} [Plasma], {?}{7}"
},
"theme",
"icons",
"terminal",
{
+1 -4
View File
@@ -17,10 +17,7 @@
"break",
"packages",
"shell",
{
"type": "display",
"key": "Display"
},
"display",
"terminal",
"break",
"cpu",
+37
View File
@@ -0,0 +1,37 @@
{
"$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json",
"modules": [
"title",
"os",
"kernel",
"uptime",
{
"type": "packages",
"format": "{all}"
},
"shell",
{
"type": "display",
"key": "Resolution",
"compactType": "original"
},
"de",
"wm",
"wmtheme",
{
"type": "terminalfont",
"key": "font"
},
{
"type": "disk",
"folders": "/",
"key": "Disk"
},
"cpu",
"gpu",
{
"type": "memory",
"key": "RAM"
}
]
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 341 KiB

After

Width:  |  Height:  |  Size: 285 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 133 KiB

-27
View File
@@ -1,27 +0,0 @@
Intel Software License Agreement
10.07.21
Use and Redistribution. You may use and redistribute Intels Control API software and the header files for the Intel® Graphics Control Library (collectively, the “Software”), solely for use on Intel platforms, provided the following conditions are met:
* Redistributions must reproduce the above copyright notice and the following terms of use in the Software and in the documentation and/or other materials provided with the distribution.
* Neither the name of Intel nor the names of its suppliers may be used to endorse or promote products derived from this Software without specific prior written permission.
* No reverse engineering, decompilation, or disassembly of Software provided to you in binary form is permitted.
Third Party Software. The Software may contain Third Party Software. “Third Party Software” is third party software, open source software or other Intel software listed in the “third-party-software.txt” or other similarly named text file that is included with the Software. Third Party Software, even if included with the distribution of the Software, may be governed by separate license terms, including without limitation, third party license terms, open source software notices and terms, and/or other Intel software license terms. These separate license terms solely govern your use of the Third Party Software.
Ownership. Title to the Software and all copies remain with Intel or its suppliers.
DISCLAIMER. THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT ARE DISCLAIMED. THIS SOFTWARE IS NOT INTENDED FOR USE IN SYSTEMS OR APPLICATIONS WHERE FAILURE OF THE SOFTWARE MAY CAUSE PERSONAL INJURY OR DEATH AND YOU AGREE THAT YOU ARE FULLY RESPONSIBLE FOR ANY CLAIMS, COSTS, DAMAGES, EXPENSES, AND ATTORNEYS FEES ARISING OUT OF ANY SUCH USE, EVEN IF ANY CLAIM ALLEGES THAT INTEL WAS NEGLIGENT REGARDING THE DESIGN OR MANUFACTURE OF THE SOFTWARE.
LIMITATION OF LIABILITY; INDEMNITY. IN NO EVENT WILL INTEL BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. YOU AGREE TO INDEMNIFY, DEFEND, AND HOLD INTEL HARMLESS AGAINST ANY CLAIMS, DAMAGES, AND EXPENSES RESULTING FROM YOUR USE OR UNAUTHORIZED USE OF THE SOFTWARE.
No support. Intel may make changes to the Software, at any time without notice, and is not obligated to support, update or provide training for the Software.
Termination. Your right to use the Software is terminated immediately in the event of your breach of this agreement.
Feedback. Should you provide Intel with comments, modifications, corrections, enhancements or other input (“Feedback”) related to the Software Intel will be free to use, disclose, reproduce, license or otherwise distribute or exploit the Feedback in its sole discretion without any obligations or restrictions of any kind, including without limitation, intellectual property rights or licensing obligations.
Compliance with laws. You agree to comply with all applicable laws and regulations governing your use, transfer, import or export (or prohibition thereof) of the Software.
Governing law. All disputes will be governed by the laws of the United States of America and the State of Delaware without reference to conflict of law principles and subject to the exclusive jurisdiction of the state or federal courts sitting in the State of Delaware, and each party agrees that it submits to the personal jurisdiction and venue of those courts and waives any objections. The United Nations Convention on Contracts for the International Sale of Goods (1980) is specifically excluded and will not apply to the Software.
Severability. The parties intend that if a court holds that any provision of this agreement is invalid or unenforceable under applicable law, the court will modify the provision to the minimum extent necessary to make it valid and enforceable or sever and delete the provision from this agreement. Any change to or deletion of a provision of this agreement under this Section will not affect the validity or enforceability of the remainder of this agreement, which will continue in full force and effect.
-7906
View File
File diff suppressed because it is too large Load Diff
-6
View File
@@ -1,6 +0,0 @@
{
"home": "https://github.com/intel/drivers.gpu.control-library",
"license": "./LICENSE",
"version": "v184",
"author": "Intel Corporation"
}
+1 -1
View File
@@ -1,6 +1,6 @@
{
"home": "https://www.cl.cam.ac.uk/~mgk25/ucs/wcwidth.c",
"license": "Embed in source",
"license": "MIT compatible (embed in source)",
"version": "2007-05-26 (Unicode 5.0)",
"author": "Markus Kuhn",
"modified": "CarterLi"
-11074
View File
File diff suppressed because it is too large Load Diff
-6
View File
@@ -1,6 +0,0 @@
{
"home": "https://github.com/NVIDIA/nvidia-settings/blob/main/src/nvml.h",
"license": "Embed in source",
"version": "550.54.14",
"author": "NVIDIA Corporation"
}
+4 -23
View File
@@ -11,7 +11,7 @@
bool ffParseModuleOptions(const char* key, const char* value)
{
if (!ffStrStartsWith(key, "--") || !isalpha(key[2])) return false;
if (!ffStrStartsWith(key, "--") || !ffCharIsEnglishAlphabet(key[2])) return false;
for (FFModuleBaseInfo** modules = ffModuleInfos[toupper(key[2]) - 'A']; *modules; ++modules)
{
@@ -79,30 +79,11 @@ static void genJsonResult(FFModuleBaseInfo* baseInfo, yyjson_mut_doc* doc)
static void parseStructureCommand(
const char* line,
FFlist* customValues,
void (*fn)(FFModuleBaseInfo *baseInfo, yyjson_mut_doc* jsonDoc),
yyjson_mut_doc* jsonDoc
)
{
// handle `--set` and `--set-keyless`
FF_LIST_FOR_EACH(FFCustomValue, customValue, *customValues)
{
if (ffStrbufEqualS(&customValue->key, line))
{
__attribute__((__cleanup__(ffDestroyCustomOptions))) FFCustomOptions options;
ffInitCustomOptions(&options);
if (customValue->printKey)
ffStrbufAppend(&options.moduleArgs.key, &customValue->key);
ffStrbufAppend(&options.moduleArgs.outputFormat, &customValue->value);
if (__builtin_expect(jsonDoc != NULL, false))
fn((FFModuleBaseInfo*) &options, jsonDoc);
else
ffPrintCustom(&options);
return;
}
}
if(isalpha(line[0]))
if(ffCharIsEnglishAlphabet(line[0]))
{
for (FFModuleBaseInfo** modules = ffModuleInfos[toupper(line[0]) - 'A']; *modules; ++modules)
{
@@ -134,7 +115,7 @@ void ffPrintCommandOption(FFdata* data, yyjson_mut_doc* jsonDoc)
if(instance.config.display.stat)
ms = ffTimeGetTick();
parseStructureCommand(data->structure.chars + startIndex, &data->customValues, genJsonResult, jsonDoc);
parseStructureCommand(data->structure.chars + startIndex, genJsonResult, jsonDoc);
if(instance.config.display.stat)
{
@@ -177,7 +158,7 @@ void ffMigrateCommandOptionToJsonc(FFdata* data, yyjson_mut_doc* jsonDoc)
uint32_t colonIndex = ffStrbufNextIndexC(&data->structure, startIndex, ':');
data->structure.chars[colonIndex] = '\0';
parseStructureCommand(data->structure.chars + startIndex, &data->customValues, genJsonConfig, jsonDoc);
parseStructureCommand(data->structure.chars + startIndex, genJsonConfig, jsonDoc);
startIndex = colonIndex + 1;
}
-8
View File
@@ -2,18 +2,10 @@
#include "fastfetch.h"
typedef struct FFCustomValue
{
bool printKey;
FFstrbuf key;
FFstrbuf value;
} FFCustomValue;
// Things only needed by fastfetch
typedef struct FFdata
{
FFstrbuf structure;
FFlist customValues; // List of FFCustomValue
bool configLoaded;
} FFdata;
+115 -81
View File
@@ -52,14 +52,33 @@ void ffFormatAppendFormatArg(FFstrbuf* buffer, const FFformatarg* formatarg)
* @param placeholderValue the string to parse
* @return uint32_t the parsed value
*/
static inline uint32_t getArgumentIndex(const FFstrbuf* placeholderValue)
static uint32_t getArgumentIndex(const char* placeholderValue, uint32_t numArgs, const FFformatarg* arguments)
{
uint32_t result = UINT32_MAX;
char firstChar = placeholderValue[0];
if (firstChar == '\0')
return 0; // use arg counter
if(placeholderValue->chars[0] != '-')
sscanf(placeholderValue->chars, "%" PRIu32, &result);
if (firstChar >= '0' && firstChar <= '9')
{
char* pEnd = NULL;
uint32_t result = (uint32_t) strtoul(placeholderValue, &pEnd, 10);
if (result > numArgs)
return UINT32_MAX;
if (*pEnd != '\0')
return UINT32_MAX;
return result;
}
else if (ffCharIsEnglishAlphabet(firstChar))
{
for (uint32_t i = 0; i < numArgs; ++i)
{
const FFformatarg* arg = &arguments[i];
if (arg->name && strcasecmp(placeholderValue, arg->name) == 0)
return i + 1;
}
}
return result == 0 ? UINT32_MAX : result;
return UINT32_MAX;
}
static inline void appendInvalidPlaceholder(FFstrbuf* buffer, const char* start, const FFstrbuf* placeholderValue, uint32_t index, uint32_t formatStringLength)
@@ -71,16 +90,6 @@ static inline void appendInvalidPlaceholder(FFstrbuf* buffer, const char* start,
ffStrbufAppendC(buffer, '}');
}
static inline void appendEmptyPlaceholder(FFstrbuf* buffer, const char* placeholder, uint32_t* argCounter, uint32_t numArgs, const FFformatarg* arguments)
{
if(*argCounter >= numArgs)
ffStrbufAppendS(buffer, placeholder);
else
ffFormatAppendFormatArg(buffer, arguments + *argCounter);
(*argCounter)++;
}
static inline bool formatArgSet(const FFformatarg* arg)
{
return arg->value != NULL && (
@@ -101,7 +110,8 @@ void ffParseFormatString(FFstrbuf* buffer, const FFstrbuf* formatstr, uint32_t n
uint32_t numOpenIfs = 0;
uint32_t numOpenNotIfs = 0;
uint32_t numOpenColors = 0;
FF_STRBUF_AUTO_DESTROY placeholderValue = ffStrbufCreate();
for(uint32_t i = 0; i < formatstr->length; ++i)
{
@@ -112,13 +122,6 @@ void ffParseFormatString(FFstrbuf* buffer, const FFstrbuf* formatstr, uint32_t n
continue;
}
// if we have an { at the end handle it as {}
if(i == formatstr->length - 1)
{
appendEmptyPlaceholder(buffer, "{", &argCounter, numArgs, arguments);
continue;
}
// jump to next char, the start of the placeholder value
++i;
@@ -129,74 +132,70 @@ void ffParseFormatString(FFstrbuf* buffer, const FFstrbuf* formatstr, uint32_t n
continue;
}
// placeholder is {}
if(formatstr->chars[i] == '}')
ffStrbufClear(&placeholderValue);
{
appendEmptyPlaceholder(buffer, "{}", &argCounter, numArgs, arguments);
continue;
uint32_t iEnd = ffStrbufNextIndexC(formatstr, i, '}');
ffStrbufAppendNS(&placeholderValue, iEnd - i, &formatstr->chars[i]);
i = iEnd;
}
FF_STRBUF_AUTO_DESTROY placeholderValue = ffStrbufCreate();
char firstChar = placeholderValue.chars[0];
while(i < formatstr->length && formatstr->chars[i] != '}')
ffStrbufAppendC(&placeholderValue, formatstr->chars[i++]);
// test if for stop, if so break the loop
if(placeholderValue.length == 1 && placeholderValue.chars[0] == '-')
break;
// test for end of an if, if so do nothing
if(placeholderValue.length == 1 && placeholderValue.chars[0] == '?')
if (placeholderValue.length == 1)
{
if(numOpenIfs == 0)
appendInvalidPlaceholder(buffer, "{", &placeholderValue, i, formatstr->length);
else
--numOpenIfs;
// test if for stop, if so break the loop
if (firstChar == '-')
break;
continue;
}
// test for end of a not if, if so do nothing
if(placeholderValue.length == 1 && placeholderValue.chars[0] == '/')
{
if(numOpenNotIfs == 0)
appendInvalidPlaceholder(buffer, "{", &placeholderValue, i, formatstr->length);
else
--numOpenNotIfs;
continue;
}
// test for end of a color, if so do nothing
if(placeholderValue.length == 1 && placeholderValue.chars[0] == '#')
{
if(numOpenColors == 0)
appendInvalidPlaceholder(buffer, "{", &placeholderValue, i, formatstr->length);
else
// test for end of an if, if so do nothing
if (firstChar == '?')
{
ffStrbufAppendS(buffer, FASTFETCH_TEXT_MODIFIER_RESET);
--numOpenColors;
if(numOpenIfs == 0)
appendInvalidPlaceholder(buffer, "{", &placeholderValue, i, formatstr->length);
else
--numOpenIfs;
continue;
}
continue;
// test for end of a not if, if so do nothing
if (firstChar == '/')
{
if(numOpenNotIfs == 0)
appendInvalidPlaceholder(buffer, "{", &placeholderValue, i, formatstr->length);
else
--numOpenNotIfs;
continue;
}
// test for end of a color, if so do nothing
if (firstChar == '#')
{
if (!instance.config.display.pipe)
ffStrbufAppendS(buffer, FASTFETCH_TEXT_MODIFIER_RESET);
continue;
}
}
// test for if, if so evaluate it
if(placeholderValue.chars[0] == '?')
if (firstChar == '?')
{
ffStrbufSubstrAfter(&placeholderValue, 0);
uint32_t index = getArgumentIndex(&placeholderValue);
uint32_t index = getArgumentIndex(placeholderValue.chars, numArgs, arguments);
// testing for an invalid index
if(index > numArgs)
if (index > numArgs)
{
appendInvalidPlaceholder(buffer, "{?", &placeholderValue, i, formatstr->length);
continue;
}
// continue normally if an format arg is set and the value is > 0
if(formatArgSet(&arguments[index - 1]))
if (formatArgSet(&arguments[index - 1]))
{
++numOpenIfs;
continue;
@@ -208,21 +207,21 @@ void ffParseFormatString(FFstrbuf* buffer, const FFstrbuf* formatstr, uint32_t n
}
// test for not if, if so evaluate it
if(placeholderValue.chars[0] == '/')
if (firstChar == '/')
{
ffStrbufSubstrAfter(&placeholderValue, 0);
uint32_t index = getArgumentIndex(&placeholderValue);
uint32_t index = getArgumentIndex(placeholderValue.chars, numArgs, arguments);
// testing for an invalid index
if(index > numArgs)
if (index > numArgs)
{
appendInvalidPlaceholder(buffer, "{/", &placeholderValue, i, formatstr->length);
continue;
}
//continue normally if an format arg is not set or the value is 0
if(!formatArgSet(&arguments[index - 1]))
if (!formatArgSet(&arguments[index - 1]))
{
++numOpenNotIfs;
continue;
@@ -234,27 +233,62 @@ void ffParseFormatString(FFstrbuf* buffer, const FFstrbuf* formatstr, uint32_t n
}
//test for color, if so evaluate it
if(placeholderValue.chars[0] == '#')
if (firstChar == '#')
{
++numOpenColors;
ffStrbufSubstrAfter(&placeholderValue, 0);
ffStrbufAppendS(buffer, "\033[");
ffStrbufAppend(buffer, &placeholderValue);
ffStrbufAppendC(buffer, 'm');
if (!instance.config.display.pipe)
{
ffStrbufAppendS(buffer, "\e[");
ffOptionParseColorNoClear(placeholderValue.chars + 1, buffer);
ffStrbufAppendC(buffer, 'm');
}
continue;
}
uint32_t index = getArgumentIndex(&placeholderValue);
int32_t truncLength = INT32_MAX;
char* pColon = memchr(placeholderValue.chars, ':', placeholderValue.length);
if (pColon != NULL)
{
char* pEnd = NULL;
truncLength = (int32_t) strtol(pColon + 1, &pEnd, 10);
if (*pEnd != '\0')
{
appendInvalidPlaceholder(buffer, "{", &placeholderValue, i, formatstr->length);
continue;
}
*pColon = '\0';
}
uint32_t index = getArgumentIndex(placeholderValue.chars, numArgs, arguments);
// test for invalid index
if(index > numArgs)
if (index == 0)
index = ++argCounter;
if (index > numArgs)
{
if (pColon) *pColon = ':';
appendInvalidPlaceholder(buffer, "{", &placeholderValue, i, formatstr->length);
continue;
}
bool ellipsis = false;
if (truncLength < 0)
{
ellipsis = true;
truncLength = -truncLength;
}
uint32_t oldLength = buffer->length;
ffFormatAppendFormatArg(buffer, &arguments[index - 1]);
if (buffer->length - oldLength > (uint32_t) truncLength)
{
ffStrbufSubstrBefore(buffer, oldLength + (uint32_t) truncLength);
ffStrbufTrimRightSpace(buffer);
if (ellipsis)
ffStrbufAppendS(buffer, "");
}
}
ffStrbufAppendS(buffer, FASTFETCH_TEXT_MODIFIER_RESET);
if (!instance.config.display.pipe)
ffStrbufAppendS(buffer, FASTFETCH_TEXT_MODIFIER_RESET);
}
+1
View File
@@ -20,6 +20,7 @@ typedef struct FFformatarg
{
FFformatargtype type;
const void* value;
const char* name; // argument name, must start with an alphabet
} FFformatarg;
void ffFormatAppendFormatArg(FFstrbuf* buffer, const FFformatarg* formatarg);
+15 -5
View File
@@ -2,6 +2,7 @@
#include "common/parsing.h"
#include "common/thread.h"
#include "detection/displayserver/displayserver.h"
#include "detection/terminaltheme/terminaltheme.h"
#include "util/textModifier.h"
#include "logo/logo.h"
@@ -22,10 +23,18 @@ static void initState(FFstate* state)
state->logoWidth = 0;
state->logoHeight = 0;
state->keysHeight = 0;
state->terminalLightTheme = false;
ffPlatformInit(&state->platform);
state->configDoc = NULL;
state->resultDoc = NULL;
{
// don't enable bright color if the terminal is in light mode
FFTerminalThemeResult result;
if (ffDetectTerminalTheme(&result, true /* forceEnv for performance */) && !result.bg.dark)
state->terminalLightTheme = true;
}
}
static void defaultConfig(void)
@@ -43,8 +52,12 @@ void ffInitInstance(void)
//https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/setlocale-wsetlocale?source=recommendations&view=msvc-170#utf-8-support
setlocale(LC_ALL, ".UTF8");
#else
// used for mbsrtowcs in Module `separator`
setlocale(LC_ALL, "");
// Never use `setlocale(LC_ALL, "")`
setlocale(LC_TIME, "");
setlocale(LC_NUMERIC, "");
#ifdef LC_MESSAGES
setlocale(LC_MESSAGES, "");
#endif
#endif
initState(&instance.state);
@@ -241,9 +254,6 @@ void ffListFeatures(void)
#ifdef FF_HAVE_DIRECTX_HEADERS
"Directx Headers\n"
#endif
#ifdef FF_USE_PROPRIETARY_GPU_DRIVER_API
"Proprietary GPU driver API\n"
#endif
#ifdef FF_USE_SYSTEM_YYJSON
"System yyjson\n"
#endif
+2
View File
@@ -8,11 +8,13 @@
#include <handleapi.h>
#include <io.h>
typedef HANDLE FFNativeFD;
#define FF_INVALID_FD INVALID_HANDLE_VALUE
#else
#include <unistd.h>
#include <dirent.h>
#include <sys/stat.h>
typedef int FFNativeFD;
#define FF_INVALID_FD (-1)
// procfs's file can be changed between read calls such as /proc/meminfo and /proc/uptime.
// one safe way to read correct data is reading the whole file in a single read syscall
// 8192 comes from procps-ng: https://gitlab.com/procps-ng/procps/-/blob/master/library/meminfo.c?ref_type=heads#L39
+46 -16
View File
@@ -133,32 +133,44 @@ bool ffPathExpandEnv(FF_MAYBE_UNUSED const char* in, FF_MAYBE_UNUSED FFstrbuf* o
const char* ffGetTerminalResponse(const char* request, const char* format, ...)
{
if (instance.config.display.pipe)
return "Not supported in --pipe mode";
int fin = STDIN_FILENO, fout = STDOUT_FILENO;
FF_AUTO_CLOSE_FD int ftty = -1;
struct termios oldTerm, newTerm;
if(tcgetattr(STDIN_FILENO, &oldTerm) == -1)
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;
}
struct termios oldTerm;
if(tcgetattr(fin, &oldTerm) == -1)
return "tcgetattr(STDIN_FILENO, &oldTerm) failed";
newTerm = oldTerm;
struct termios newTerm = oldTerm;
newTerm.c_lflag &= (tcflag_t) ~(ICANON | ECHO);
if(tcsetattr(STDIN_FILENO, TCSANOW, &newTerm) == -1)
return "tcsetattr(STDIN_FILENO, TCSANOW, &newTerm)";
if(tcsetattr(fin, TCSAFLUSH, &newTerm) == -1)
return "tcsetattr(STDIN_FILENO, TCSAFLUSH, &newTerm)";
fputs(request, stdout);
fflush(stdout);
ffWriteFDData(fout, strlen(request), request);
//Give the terminal 35ms to respond
if(poll(&(struct pollfd) { .fd = STDIN_FILENO, .events = POLLIN }, 1, FF_IO_TERM_RESP_WAIT_MS) <= 0)
//Give the terminal some time to respond
if(poll(&(struct pollfd) { .fd = fin, .events = POLLIN }, 1, FF_IO_TERM_RESP_WAIT_MS) <= 0)
{
tcsetattr(STDIN_FILENO, TCSANOW, &oldTerm);
tcsetattr(fin, TCSANOW, &oldTerm);
return "poll() timeout or failed";
}
char buffer[512];
ssize_t bytesRead = read(STDIN_FILENO, buffer, sizeof(buffer) - 1);
ssize_t bytesRead = read(fin, buffer, sizeof(buffer) - 1);
tcsetattr(STDIN_FILENO, TCSANOW, &oldTerm);
tcsetattr(fin, TCSANOW, &oldTerm);
if(bytesRead <= 0)
return "read(STDIN_FILENO, buffer, sizeof(buffer) - 1) failed";
@@ -204,7 +216,11 @@ bool ffSuppressIO(bool suppress)
void listFilesRecursively(uint32_t baseLength, FFstrbuf* folder, uint8_t indentation, const char* folderName, bool pretty)
{
DIR* dir = opendir(folder->chars);
FF_AUTO_CLOSE_FD int dfd = open(folder->chars, O_RDONLY);
if (dfd < 0)
return;
DIR* dir = fdopendir(dfd);
if(dir == NULL)
return;
@@ -221,7 +237,21 @@ void listFilesRecursively(uint32_t baseLength, FFstrbuf* folder, uint8_t indenta
while((entry = readdir(dir)) != NULL)
{
if(entry->d_type == DT_DIR)
bool isDir = false;
#ifdef _DIRENT_HAVE_D_TYPE
if(entry->d_type != DT_UNKNOWN && entry->d_type != DT_LNK)
isDir = entry->d_type == DT_DIR;
else
#else
{
struct stat stbuf;
if (fstatat(dfd, entry->d_name, &stbuf, 0) < 0)
isDir = false;
else
isDir = S_ISDIR(stbuf.st_mode);
}
#endif
if (isDir)
{
if(ffStrEquals(entry->d_name, ".") || ffStrEquals(entry->d_name, ".."))
continue;
+57 -12
View File
@@ -114,8 +114,40 @@ bool ffPathExpandEnv(const char* in, FFstrbuf* out)
bool ffSuppressIO(bool suppress)
{
(void) suppress; //Not implemented.
return false;
static bool init = false;
static HANDLE hOrigOut = INVALID_HANDLE_VALUE;
static HANDLE hOrigErr = INVALID_HANDLE_VALUE;
static HANDLE hNullFile = INVALID_HANDLE_VALUE;
static int fOrigOut = -1;
static int fOrigErr = -1;
static int fNullFile = -1;
if (!init)
{
if(!suppress)
return true;
hOrigOut = GetStdHandle(STD_OUTPUT_HANDLE);
hOrigErr = GetStdHandle(STD_ERROR_HANDLE);
hNullFile = CreateFileW(L"NUL", GENERIC_READ | GENERIC_WRITE, FILE_SHARE_WRITE, 0, OPEN_EXISTING, 0, NULL);
fOrigOut = _dup(STDOUT_FILENO);
fOrigErr = _dup(STDERR_FILENO);
fNullFile = _open_osfhandle((intptr_t) hNullFile, 0);
init = true;
}
if (hNullFile == INVALID_HANDLE_VALUE || fNullFile == -1)
return false;
fflush(stdout);
fflush(stderr);
SetStdHandle(STD_OUTPUT_HANDLE, suppress ? hNullFile : hOrigOut);
SetStdHandle(STD_ERROR_HANDLE, suppress ? hNullFile : hOrigErr);
_dup2(suppress ? fNullFile : fOrigOut, STDOUT_FILENO);
_dup2(suppress ? fNullFile : fOrigErr, STDERR_FILENO);
return true;
}
void listFilesRecursively(uint32_t baseLength, FFstrbuf* folder, uint8_t indentation, const char* folderName, bool pretty)
@@ -175,24 +207,37 @@ void ffListFilesRecursively(const char* path, bool pretty)
const char* ffGetTerminalResponse(const char* request, const char* format, ...)
{
if (instance.config.display.pipe)
return "Not supported in --pipe mode";
HANDLE hInput = GetStdHandle(STD_INPUT_HANDLE);
DWORD prev_mode;
GetConsoleMode(hInput, &prev_mode);
FF_AUTO_CLOSE_FD HANDLE hConin = INVALID_HANDLE_VALUE;
DWORD inputMode;
if (!GetConsoleMode(hInput, &inputMode))
{
hConin = CreateFileW(L"CONIN$", GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ, 0, OPEN_EXISTING, 0, NULL);
hInput = hConin;
}
SetConsoleMode(hInput, 0);
FlushConsoleInputBuffer(hInput);
DWORD bytes = 0;
WriteFile(GetStdHandle(STD_OUTPUT_HANDLE), request, (DWORD) strlen(request), &bytes, NULL);
{
DWORD bytes = 0;
HANDLE hOutput = GetStdHandle(STD_OUTPUT_HANDLE);
FF_AUTO_CLOSE_FD HANDLE hConout = INVALID_HANDLE_VALUE;
DWORD outputMode;
if (!GetConsoleMode(hOutput, &outputMode))
{
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);
}
while (true)
{
if (WaitForSingleObjectEx(hInput, FF_IO_TERM_RESP_WAIT_MS, TRUE) != WAIT_OBJECT_0)
{
SetConsoleMode(hInput, prev_mode);
SetConsoleMode(hInput, inputMode);
return "WaitForSingleObject() failed or timeout";
}
@@ -213,10 +258,10 @@ const char* ffGetTerminalResponse(const char* request, const char* format, ...)
}
char buffer[512];
bytes = 0;
DWORD bytes = 0;
ReadFile(hInput, buffer, sizeof(buffer) - 1, &bytes, NULL);
SetConsoleMode(hInput, prev_mode);
SetConsoleMode(hInput, inputMode);
if(bytes <= 0)
return "ReadFile() failed";
+6 -1
View File
@@ -22,6 +22,11 @@ bool ffJsonConfigParseModuleArgs(const char* key, yyjson_val* val, FFModuleArgs*
ffStrbufSetNS(&moduleArgs->outputFormat, (uint32_t) yyjson_get_len(val), yyjson_get_str(val));
return true;
}
else if(ffStrEqualsIgnCase(key, "outputColor"))
{
ffOptionParseColor(yyjson_get_str(val), &moduleArgs->outputColor);
return true;
}
else if(ffStrEqualsIgnCase(key, "keyColor"))
{
ffOptionParseColor(yyjson_get_str(val), &moduleArgs->keyColor);
@@ -94,7 +99,7 @@ static inline void genJsonResult(FFModuleBaseInfo* baseInfo, yyjson_mut_doc* doc
static bool parseModuleJsonObject(const char* type, yyjson_val* jsonVal, yyjson_mut_doc* jsonDoc)
{
if(!isalpha(type[0])) return false;
if(!ffCharIsEnglishAlphabet(type[0])) return false;
for (FFModuleBaseInfo** modules = ffModuleInfos[toupper(type[0]) - 'A']; *modules; ++modules)
{
+4
View File
@@ -1,6 +1,8 @@
#include "fastfetch.h"
#include "common/library.h"
#ifndef FF_DISABLE_DLOPEN
#include <stdarg.h>
//Clang doesn't define __SANITIZE_ADDRESS__ but defines __has_feature(address_sanitizer)
@@ -77,3 +79,5 @@ void* ffLibraryLoad(const FFstrbuf* userProvidedName, ...)
return result;
}
#endif
+44
View File
@@ -3,6 +3,8 @@
#include "fastfetch.h"
#include "util/FFcheckmacros.h"
#ifndef FF_DISABLE_DLOPEN
#if defined(_WIN32)
#include <libloaderapi.h>
#define FF_DLOPEN_FLAGS 0
@@ -71,3 +73,45 @@ static inline void ffLibraryUnload(void** handle)
FF_LIBRARY_LOAD_SYMBOL_ADDRESS(library, (varName)->ff ## symbolName, symbolName, returnValue);
void* ffLibraryLoad(const FFstrbuf* userProvidedName, ...);
#else
#define FF_LIBRARY_EXTENSION ""
#define FF_LIBRARY_SYMBOL(symbolName) \
__typeof__(&symbolName) ff ## symbolName;
#define FF_LIBRARY_LOAD(libraryObjectName, userLibraryName, returnValue, ...) \
FF_MAYBE_UNUSED void* libraryObjectName = NULL; // Placeholder
#define FF_LIBRARY_LOAD_SYMBOL_ADDRESS(library, symbolMapping, symbolName, returnValue) \
symbolMapping = (__typeof__(&symbolName)) &symbolName
#define FF_LIBRARY_LOAD_SYMBOL_ADDRESS2(library, symbolMapping, symbolName, alternateName, returnValue) \
symbolMapping = (__typeof__(&symbolName)) &symbolName
#define FF_LIBRARY_LOAD_SYMBOL(library, symbolName, returnValue) \
FF_MAYBE_UNUSED __typeof__(&symbolName) FF_LIBRARY_LOAD_SYMBOL_ADDRESS(library, ff ## symbolName, symbolName, returnValue);
#define FF_LIBRARY_LOAD_SYMBOL_LAZY(library, symbolName) \
FF_MAYBE_UNUSED __typeof__(&symbolName) ff ## symbolName = (__typeof__(&symbolName)) &symbolName;
#define FF_LIBRARY_LOAD_SYMBOL_MESSAGE(library, symbolName) \
FF_MAYBE_UNUSED __typeof__(&symbolName) FF_LIBRARY_LOAD_SYMBOL_ADDRESS(library, ff ## symbolName, symbolName, "dlsym " #symbolName " failed");
#define FF_LIBRARY_LOAD_SYMBOL_MESSAGE2(library, symbolName, alternateName) \
FF_MAYBE_UNUSED __typeof__(&symbolName) FF_LIBRARY_LOAD_SYMBOL_ADDRESS2(library, ff ## symbolName, symbolName, alternateName, "dlsym " #symbolName " failed");
#define FF_LIBRARY_LOAD_SYMBOL_VAR(library, varName, symbolName, returnValue) \
FF_LIBRARY_LOAD_SYMBOL_ADDRESS(library, (varName).ff ## symbolName, symbolName, returnValue);
#define FF_LIBRARY_LOAD_SYMBOL_VAR_MESSAGE(library, varName, symbolName) \
FF_LIBRARY_LOAD_SYMBOL_ADDRESS(library, (varName).ff ## symbolName, symbolName, "dlsym " #symbolName " failed");
#define FF_LIBRARY_LOAD_SYMBOL_VAR_MESSAGE2(library, varName, symbolName, alternateName) \
FF_LIBRARY_LOAD_SYMBOL_ADDRESS2(library, (varName).ff ## symbolName, symbolName, alternateName, "dlsym " #symbolName " failed");
#define FF_LIBRARY_LOAD_SYMBOL_PTR(library, varName, symbolName, returnValue) \
FF_LIBRARY_LOAD_SYMBOL_ADDRESS(library, (varName)->ff ## symbolName, symbolName, returnValue);
#endif
+7
View File
@@ -9,6 +9,7 @@ static FFModuleBaseInfo* B[] = {
(void*) &instance.config.modules.bios,
(void*) &instance.config.modules.bluetooth,
(void*) &instance.config.modules.board,
(void*) &instance.config.modules.bootmgr,
(void*) &instance.config.modules.break_,
(void*) &instance.config.modules.brightness,
NULL,
@@ -20,6 +21,7 @@ static FFModuleBaseInfo* C[] = {
(void*) &instance.config.modules.command,
(void*) &instance.config.modules.colors,
(void*) &instance.config.modules.cpu,
(void*) &instance.config.modules.cpuCache,
(void*) &instance.config.modules.cpuUsage,
(void*) &instance.config.modules.cursor,
(void*) &instance.config.modules.custom,
@@ -32,10 +34,12 @@ static FFModuleBaseInfo* D[] = {
(void*) &instance.config.modules.display,
(void*) &instance.config.modules.disk,
(void*) &instance.config.modules.diskIo,
(void*) &instance.config.modules.dns,
NULL,
};
static FFModuleBaseInfo* E[] = {
(void*) &instance.config.modules.editor,
NULL,
};
@@ -57,6 +61,7 @@ static FFModuleBaseInfo* H[] = {
static FFModuleBaseInfo* I[] = {
(void*) &instance.config.modules.icons,
(void*) &instance.config.modules.initSystem,
NULL,
};
@@ -71,6 +76,7 @@ static FFModuleBaseInfo* K[] = {
static FFModuleBaseInfo* L[] = {
(void*) &instance.config.modules.lm,
(void*) &instance.config.modules.loadavg,
(void*) &instance.config.modules.locale,
(void*) &instance.config.modules.localIP,
NULL,
@@ -98,6 +104,7 @@ static FFModuleBaseInfo* O[] = {
static FFModuleBaseInfo* P[] = {
(void*) &instance.config.modules.packages,
(void*) &instance.config.modules.physicalDisk,
(void*) &instance.config.modules.physicalMemory,
(void*) &instance.config.modules.player,
(void*) &instance.config.modules.powerAdapter,
(void*) &instance.config.modules.processes,
+9 -1
View File
@@ -18,6 +18,8 @@
# define ROUNDUP(a) ROUNDUP2((a), sizeof(int))
#elif defined(__OpenBSD__)
# define ROUNDUP(a) ROUNDUP2((a), sizeof(int))
#elif defined(__sun)
# define ROUNDUP(a) ROUNDUP2((a), _SS_ALIGNSIZE)
#else
# error unknown platform
#endif
@@ -31,9 +33,13 @@ get_rt_address(struct rt_msghdr *rtm, int desired)
{
if (rtm->rtm_addrs & (1 << i))
{
if ((1 <<i ) == desired)
if ((1 << i) == desired)
return sa;
#ifdef __sun
sa = (struct sockaddr *)(ROUNDUP(sizeof(struct sockaddr)) + (char *)sa);
#else
sa = (struct sockaddr *)(ROUNDUP(sa->sa_len) + (char *)sa);
#endif
}
}
return NULL;
@@ -71,7 +77,9 @@ bool ffNetifGetDefaultRouteImpl(char iface[IF_NAMESIZE + 1], uint32_t* ifIndex)
},
.dst = {
.sin_family = AF_INET,
#ifndef __sun
.sin_len = sizeof(rtmsg.dst),
#endif
},
};
+1
View File
@@ -22,6 +22,7 @@ typedef struct FFNetworkingState {
#endif
uint32_t timeout;
bool ipv6;
} FFNetworkingState;
const char* ffNetworkingSendHttpRequest(FFNetworkingState* state, const char* host, const char* path, const char* headers);
+1 -1
View File
@@ -14,7 +14,7 @@ static const char* connectAndSend(FFNetworkingState* state)
struct addrinfo* addr;
if(getaddrinfo(state->host.chars, "80", &(struct addrinfo) {
.ai_family = AF_INET,
.ai_family = state->ipv6 ? AF_INET6 : AF_INET,
.ai_socktype = SOCK_STREAM,
}, &addr) != 0)
{
+1 -1
View File
@@ -51,7 +51,7 @@ const char* ffNetworkingSendHttpRequest(FFNetworkingState* state, const char* ho
struct addrinfo* addr;
if(getaddrinfo(host, "80", &(struct addrinfo) {
.ai_family = AF_INET,
.ai_family = state->ipv6 ? AF_INET6 : AF_INET,
.ai_socktype = SOCK_STREAM,
}, &addr) != 0)
return "getaddrinfo() failed";
+59 -26
View File
@@ -1,3 +1,4 @@
#include "fastfetch.h"
#include "common/option.h"
#include "common/color.h"
#include "util/stringUtils.h"
@@ -39,6 +40,16 @@ bool ffOptionParseModuleArgs(const char* argumentKey, const char* subKey, const
ffOptionParseString(argumentKey, value, &result->outputFormat);
return true;
}
else if(ffStrEqualsIgnCase(subKey, "output-color"))
{
if(value == NULL)
{
fprintf(stderr, "Error: usage: %s <str>\n", argumentKey);
exit(477);
}
ffOptionParseColor(value, &result->outputColor);
return true;
}
else if(ffStrEqualsIgnCase(subKey, "key-color"))
{
if(value == NULL)
@@ -135,43 +146,63 @@ bool ffOptionParseBoolean(const char* str)
);
}
void ffOptionParseColor(const char* value, FFstrbuf* buffer)
void ffOptionParseColorNoClear(const char* value, FFstrbuf* buffer)
{
ffStrbufClear(buffer);
// If value is already an ANSI escape code, use it
if (value[0] == '\e' && value[1] == '[')
{
ffStrbufAppendS(buffer, value + 2);
ffStrbufTrimRight(buffer, 'm');
return;
}
ffStrbufEnsureFree(buffer, 63);
while(*value != '\0')
{
#define FF_APPEND_COLOR_CODE_COND(prefix, code) \
if(ffStrStartsWithIgnCase(value, #prefix)) { ffStrbufAppendS(buffer, code); value += strlen(#prefix); }
if(ffStrStartsWithIgnCase(value, #prefix)) { ffStrbufAppendS(buffer, code); value += strlen(#prefix); continue; }
#define FF_APPEND_COLOR_PROP_COND(prefix, prop) \
if(ffStrStartsWithIgnCase(value, #prefix)) { if (instance.config.display.prop.length) ffStrbufAppend(buffer, &instance.config.display.prop); else ffStrbufAppendS(buffer, FF_COLOR_FG_DEFAULT); value += strlen(#prefix); continue; }
FF_APPEND_COLOR_CODE_COND(reset_, FF_COLOR_MODE_RESET)
else FF_APPEND_COLOR_CODE_COND(bright_, FF_COLOR_MODE_BOLD)
else FF_APPEND_COLOR_CODE_COND(dim_, FF_COLOR_MODE_DIM)
else FF_APPEND_COLOR_CODE_COND(black, FF_COLOR_FG_BLACK)
else FF_APPEND_COLOR_CODE_COND(red, FF_COLOR_FG_RED)
else FF_APPEND_COLOR_CODE_COND(green, FF_COLOR_FG_GREEN)
else FF_APPEND_COLOR_CODE_COND(yellow, FF_COLOR_FG_YELLOW)
else FF_APPEND_COLOR_CODE_COND(blue, FF_COLOR_FG_BLUE)
else FF_APPEND_COLOR_CODE_COND(magenta, FF_COLOR_FG_MAGENTA)
else FF_APPEND_COLOR_CODE_COND(cyan, FF_COLOR_FG_CYAN)
else FF_APPEND_COLOR_CODE_COND(white, FF_COLOR_FG_WHITE)
else FF_APPEND_COLOR_CODE_COND(default, FF_COLOR_FG_DEFAULT)
else FF_APPEND_COLOR_CODE_COND(light_black, FF_COLOR_FG_LIGHT_BLACK)
else FF_APPEND_COLOR_CODE_COND(light_red, FF_COLOR_FG_LIGHT_RED)
else FF_APPEND_COLOR_CODE_COND(light_green, FF_COLOR_FG_LIGHT_GREEN)
else FF_APPEND_COLOR_CODE_COND(light_yellow, FF_COLOR_FG_LIGHT_YELLOW)
else FF_APPEND_COLOR_CODE_COND(light_blue, FF_COLOR_FG_LIGHT_BLUE)
else FF_APPEND_COLOR_CODE_COND(light_magenta, FF_COLOR_FG_LIGHT_MAGENTA)
else FF_APPEND_COLOR_CODE_COND(light_cyan, FF_COLOR_FG_LIGHT_CYAN)
else FF_APPEND_COLOR_CODE_COND(light_white, FF_COLOR_FG_LIGHT_WHITE)
else
if (ffCharIsEnglishAlphabet(value[0]))
{
ffStrbufAppendC(buffer, *value);
++value;
FF_APPEND_COLOR_CODE_COND(reset_, FF_COLOR_MODE_RESET)
else FF_APPEND_COLOR_CODE_COND(bright_, FF_COLOR_MODE_BOLD)
else FF_APPEND_COLOR_CODE_COND(dim_, FF_COLOR_MODE_DIM)
else FF_APPEND_COLOR_CODE_COND(italic_, FF_COLOR_MODE_ITALIC)
else FF_APPEND_COLOR_CODE_COND(underline_, FF_COLOR_MODE_UNDERLINE)
else FF_APPEND_COLOR_CODE_COND(blink_, FF_COLOR_MODE_BLINK)
else FF_APPEND_COLOR_CODE_COND(inverse_, FF_COLOR_MODE_INVERSE)
else FF_APPEND_COLOR_CODE_COND(hidden_, FF_COLOR_MODE_HIDDEN)
else FF_APPEND_COLOR_CODE_COND(strike_, FF_COLOR_MODE_STRIKETHROUGH)
else FF_APPEND_COLOR_CODE_COND(black, FF_COLOR_FG_BLACK)
else FF_APPEND_COLOR_CODE_COND(red, FF_COLOR_FG_RED)
else FF_APPEND_COLOR_CODE_COND(green, FF_COLOR_FG_GREEN)
else FF_APPEND_COLOR_CODE_COND(yellow, FF_COLOR_FG_YELLOW)
else FF_APPEND_COLOR_CODE_COND(blue, FF_COLOR_FG_BLUE)
else FF_APPEND_COLOR_CODE_COND(magenta, FF_COLOR_FG_MAGENTA)
else FF_APPEND_COLOR_CODE_COND(cyan, FF_COLOR_FG_CYAN)
else FF_APPEND_COLOR_CODE_COND(white, FF_COLOR_FG_WHITE)
else FF_APPEND_COLOR_CODE_COND(default, FF_COLOR_FG_DEFAULT)
else FF_APPEND_COLOR_CODE_COND(light_black, FF_COLOR_FG_LIGHT_BLACK)
else FF_APPEND_COLOR_CODE_COND(light_red, FF_COLOR_FG_LIGHT_RED)
else FF_APPEND_COLOR_CODE_COND(light_green, FF_COLOR_FG_LIGHT_GREEN)
else FF_APPEND_COLOR_CODE_COND(light_yellow, FF_COLOR_FG_LIGHT_YELLOW)
else FF_APPEND_COLOR_CODE_COND(light_blue, FF_COLOR_FG_LIGHT_BLUE)
else FF_APPEND_COLOR_CODE_COND(light_magenta, FF_COLOR_FG_LIGHT_MAGENTA)
else FF_APPEND_COLOR_CODE_COND(light_cyan, FF_COLOR_FG_LIGHT_CYAN)
else FF_APPEND_COLOR_CODE_COND(light_white, FF_COLOR_FG_LIGHT_WHITE)
else FF_APPEND_COLOR_PROP_COND(keys, colorKeys)
else FF_APPEND_COLOR_PROP_COND(title, colorTitle)
else FF_APPEND_COLOR_PROP_COND(output, colorOutput)
else FF_APPEND_COLOR_PROP_COND(separator, colorSeparator)
}
ffStrbufAppendC(buffer, *value);
++value;
#undef FF_APPEND_COLOR_CODE_COND
#undef FF_APPEND_COLOR_PROP_COND
}
}
@@ -180,6 +211,7 @@ void ffOptionInitModuleArg(FFModuleArgs* args)
ffStrbufInit(&args->key);
ffStrbufInit(&args->keyColor);
ffStrbufInit(&args->outputFormat);
ffStrbufInit(&args->outputColor);
args->keyWidth = 0;
}
@@ -188,4 +220,5 @@ void ffOptionDestroyModuleArg(FFModuleArgs* args)
ffStrbufDestroy(&args->key);
ffStrbufDestroy(&args->keyColor);
ffStrbufDestroy(&args->outputFormat);
ffStrbufDestroy(&args->outputColor);
}
+7 -1
View File
@@ -50,6 +50,7 @@ typedef struct FFModuleArgs
FFstrbuf key;
FFstrbuf keyColor;
FFstrbuf outputFormat;
FFstrbuf outputColor;
uint32_t keyWidth;
} FFModuleArgs;
@@ -66,6 +67,11 @@ FF_C_NODISCARD uint32_t ffOptionParseUInt32(const char* argumentKey, const char*
FF_C_NODISCARD int32_t ffOptionParseInt32(const char* argumentKey, const char* value);
FF_C_NODISCARD int ffOptionParseEnum(const char* argumentKey, const char* requestedKey, FFKeyValuePair pairs[]);
FF_C_NODISCARD bool ffOptionParseBoolean(const char* str);
void ffOptionParseColor(const char* value, FFstrbuf* buffer);
void ffOptionParseColorNoClear(const char* value, FFstrbuf* buffer);
static inline void ffOptionParseColor(const char* value, FFstrbuf* buffer)
{
ffStrbufClear(buffer);
ffOptionParseColorNoClear(value, buffer);
}
void ffOptionInitModuleArg(FFModuleArgs* args);
void ffOptionDestroyModuleArg(FFModuleArgs* args);
+48 -18
View File
@@ -6,7 +6,15 @@
#include "util/textModifier.h"
#include "util/stringUtils.h"
void ffPercentAppendBar(FFstrbuf* buffer, double percent, FFColorRangeConfig config)
static void appendOutputColor(FFstrbuf* buffer, const FFModuleArgs* module)
{
if (module->outputColor.length)
ffStrbufAppendF(buffer, "\e[%sm", module->outputColor.chars);
else if (instance.config.display.colorOutput.length)
ffStrbufAppendF(buffer, "\e[%sm", instance.config.display.colorOutput.chars);
}
void ffPercentAppendBar(FFstrbuf* buffer, double percent, FFColorRangeConfig config, const FFModuleArgs* module)
{
uint8_t green = config.green, yellow = config.yellow;
assert(green <= 100 && yellow <= 100);
@@ -16,12 +24,11 @@ void ffPercentAppendBar(FFstrbuf* buffer, double percent, FFColorRangeConfig con
uint32_t blocksPercent = (uint32_t) (percent / 100.0 * options->barWidth + 0.5);
assert(blocksPercent <= options->barWidth);
if(options->barBorder)
if(options->barBorderLeft.length)
{
if(!options->pipe)
ffStrbufAppendS(buffer, "\e[" FF_COLOR_FG_LIGHT_WHITE "m[ ");
else
ffStrbufAppendS(buffer, "[ ");
ffStrbufAppendS(buffer, "\e[" FF_COLOR_FG_LIGHT_WHITE "m");
ffStrbufAppend(buffer, &options->barBorderLeft);
}
if (percent != percent)
@@ -42,14 +49,34 @@ void ffPercentAppendBar(FFstrbuf* buffer, double percent, FFColorRangeConfig con
{
if(!options->pipe)
{
uint32_t section1Begin = (uint32_t) ((green <= yellow ? green : yellow) / 100.0 * options->barWidth + 0.5);
uint32_t section2Begin = (uint32_t) ((green > yellow ? green : yellow) / 100.0 * options->barWidth + 0.5);
if (i == section2Begin)
ffStrbufAppendF(buffer, "\e[%sm", (green > yellow ? colorGreen : colorRed));
else if (i == section1Begin)
ffStrbufAppendF(buffer, "\e[%sm", colorYellow);
else if (i == 0)
ffStrbufAppendF(buffer, "\e[%sm", (green <= yellow ? colorGreen : colorRed));
if (options->percentType & FF_PERCENTAGE_TYPE_BAR_MONOCHROME_BIT)
{
const char* color = NULL;
if (green <= yellow)
{
if (percent < green) color = colorGreen;
else if (percent < yellow) color = colorYellow;
else color = colorRed;
}
else
{
if (percent < yellow) color = colorRed;
else if (percent < green) color = colorYellow;
else color = colorGreen;
}
ffStrbufAppendF(buffer, "\e[%sm", color);
}
else
{
uint32_t section1Begin = (uint32_t) ((green <= yellow ? green : yellow) / 100.0 * options->barWidth + 0.5);
uint32_t section2Begin = (uint32_t) ((green > yellow ? green : yellow) / 100.0 * options->barWidth + 0.5);
if (i == section2Begin)
ffStrbufAppendF(buffer, "\e[%sm", (green > yellow ? colorGreen : colorRed));
else if (i == section1Begin)
ffStrbufAppendF(buffer, "\e[%sm", colorYellow);
else if (i == 0)
ffStrbufAppendF(buffer, "\e[%sm", (green <= yellow ? colorGreen : colorRed));
}
}
ffStrbufAppend(buffer, &options->barCharElapsed);
}
@@ -63,19 +90,21 @@ void ffPercentAppendBar(FFstrbuf* buffer, double percent, FFColorRangeConfig con
}
}
if(options->barBorder)
if(options->barBorderRight.length)
{
if(!options->pipe)
ffStrbufAppendS(buffer, "\e[" FF_COLOR_FG_LIGHT_WHITE "m ]");
else
ffStrbufAppendS(buffer, " ]");
ffStrbufAppendS(buffer, "\e[" FF_COLOR_FG_LIGHT_WHITE "m");
ffStrbufAppend(buffer, &options->barBorderRight);
}
if(!options->pipe)
{
ffStrbufAppendS(buffer, FASTFETCH_TEXT_MODIFIER_RESET);
appendOutputColor(buffer, module);
}
}
void ffPercentAppendNum(FFstrbuf* buffer, double percent, FFColorRangeConfig config, bool parentheses)
void ffPercentAppendNum(FFstrbuf* buffer, double percent, FFColorRangeConfig config, bool parentheses, const FFModuleArgs* module)
{
uint8_t green = config.green, yellow = config.yellow;
assert(green <= 100 && yellow <= 100);
@@ -120,6 +149,7 @@ void ffPercentAppendNum(FFstrbuf* buffer, double percent, FFColorRangeConfig con
if (colored && !options->pipe)
{
ffStrbufAppendS(buffer, FASTFETCH_TEXT_MODIFIER_RESET);
appendOutputColor(buffer, module);
}
if (parentheses)
+5 -3
View File
@@ -2,13 +2,15 @@
#include "util/FFstrbuf.h"
#include "common/parsing.h"
#include "common/option.h"
enum
enum FFPercentageTypeFlags
{
FF_PERCENTAGE_TYPE_NUM_BIT = 1 << 0,
FF_PERCENTAGE_TYPE_BAR_BIT = 1 << 1,
FF_PERCENTAGE_TYPE_HIDE_OTHERS_BIT = 1 << 2,
FF_PERCENTAGE_TYPE_NUM_COLOR_BIT = 1 << 3,
FF_PERCENTAGE_TYPE_BAR_MONOCHROME_BIT = FF_PERCENTAGE_TYPE_NUM_COLOR_BIT,
};
// if (green <= yellow)
@@ -21,8 +23,8 @@ enum
// [yellow, green): print yellow
// [0, yellow): print red
void ffPercentAppendBar(FFstrbuf* buffer, double percent, FFColorRangeConfig config);
void ffPercentAppendNum(FFstrbuf* buffer, double percent, FFColorRangeConfig config, bool parentheses);
void ffPercentAppendBar(FFstrbuf* buffer, double percent, FFColorRangeConfig config, const FFModuleArgs* module);
void ffPercentAppendNum(FFstrbuf* buffer, double percent, FFColorRangeConfig config, bool parentheses, const FFModuleArgs* module);
typedef struct yyjson_val yyjson_val;
typedef struct yyjson_mut_doc yyjson_mut_doc;
+50 -42
View File
@@ -11,52 +11,63 @@ 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, " "))
return;
if(!instance.config.display.pipe)
if (!(moduleArgs && ffStrbufEqualS(&moduleArgs->key, " ")))
{
fputs(FASTFETCH_TEXT_MODIFIER_RESET, stdout);
if (instance.config.display.brightColor)
fputs(FASTFETCH_TEXT_MODIFIER_BOLT, stdout);
if(!instance.config.display.pipe)
{
fputs(FASTFETCH_TEXT_MODIFIER_RESET, stdout);
if (instance.config.display.brightColor)
fputs(FASTFETCH_TEXT_MODIFIER_BOLT, stdout);
if(moduleArgs && !(printType & FF_PRINT_TYPE_NO_CUSTOM_KEY_COLOR) && moduleArgs->keyColor.length > 0)
ffPrintColor(&moduleArgs->keyColor);
if(moduleArgs && !(printType & FF_PRINT_TYPE_NO_CUSTOM_KEY_COLOR) && moduleArgs->keyColor.length > 0)
ffPrintColor(&moduleArgs->keyColor);
else
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)
{
fputs(moduleName, stdout);
if(moduleIndex > 0)
printf(" %hhu", moduleIndex);
}
else
ffPrintColor(&instance.config.display.colorKeys);
}
{
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);
}
//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(!instance.config.display.pipe)
{
fputs(FASTFETCH_TEXT_MODIFIER_RESET, stdout);
ffPrintColor(&instance.config.display.colorSeparator);
}
if(moduleIndex > 0)
printf(" %hhu", moduleIndex);
}
else
{
FF_STRBUF_AUTO_DESTROY key = ffStrbufCreate();
FF_PARSE_FORMAT_STRING_CHECKED(&key, &moduleArgs->key, 1, ((FFformatarg[]){
{FF_FORMAT_ARG_TYPE_UINT8, &moduleIndex}
}));
ffStrbufWriteTo(&key, stdout);
ffStrbufWriteTo(&instance.config.display.keyValueSeparator, stdout);
if(!instance.config.display.pipe && instance.config.display.colorSeparator.length)
fputs(FASTFETCH_TEXT_MODIFIER_RESET, stdout);
if (!(printType & FF_PRINT_TYPE_NO_CUSTOM_KEY_WIDTH))
{
uint32_t keyWidth = moduleArgs && moduleArgs->keyWidth > 0 ? moduleArgs->keyWidth : instance.config.display.keyWidth;
if (keyWidth > 0)
printf("\e[%uG", (unsigned) (keyWidth + instance.state.logoWidth));
}
}
if(!instance.config.display.pipe)
fputs(FASTFETCH_TEXT_MODIFIER_RESET, stdout);
ffStrbufWriteTo(&instance.config.display.keyValueSeparator, stdout);
if(!instance.config.display.pipe)
fputs(FASTFETCH_TEXT_MODIFIER_RESET, stdout);
if (!instance.config.display.pipe && !(printType & FF_PRINT_TYPE_NO_CUSTOM_KEY_WIDTH))
{
uint32_t keyWidth = moduleArgs && moduleArgs->keyWidth > 0 ? moduleArgs->keyWidth : instance.config.display.keyWidth;
if (keyWidth > 0)
printf("\e[%uG", (unsigned) (keyWidth + instance.state.logoWidth));
fputs(FASTFETCH_TEXT_MODIFIER_RESET, stdout);
if (moduleArgs && moduleArgs->outputColor.length)
ffPrintColor(&moduleArgs->outputColor);
else if (instance.config.display.colorOutput.length)
ffPrintColor(&instance.config.display.colorOutput);
}
}
@@ -68,11 +79,8 @@ void ffPrintFormat(const char* moduleName, uint8_t moduleIndex, const FFModuleAr
else
ffStrbufAppendS(&buffer, "unknown");
if(buffer.length > 0)
{
ffPrintLogoAndKey(moduleName, moduleIndex, moduleArgs, printType);
ffStrbufPutTo(&buffer, stdout);
}
ffPrintLogoAndKey(moduleName, moduleIndex, moduleArgs, printType);
ffStrbufPutTo(&buffer, stdout);
}
static void printError(const char* moduleName, uint8_t moduleIndex, const FFModuleArgs* moduleArgs, FFPrintType printType, const char* message, va_list arguments)
+1 -1
View File
@@ -5,7 +5,7 @@
typedef enum FFPrintType {
FF_PRINT_TYPE_DEFAULT = 0,
FF_PRINT_TYPE_NO_CUSTOM_KEY = 1 << 0,
FF_PRINT_TYPE_NO_CUSTOM_KEY = 1 << 0, // key has been formatted outside
FF_PRINT_TYPE_NO_CUSTOM_KEY_COLOR = 1 << 1,
FF_PRINT_TYPE_NO_CUSTOM_KEY_WIDTH = 1 << 2,
FF_PRINT_TYPE_NO_CUSTOM_OUTPUT_FORMAT = 1 << 3, // reserved
+9
View File
@@ -2,6 +2,8 @@
#include "util/FFstrbuf.h"
#include <sys/types.h>
const char* ffProcessAppendOutput(FFstrbuf* buffer, char* const argv[], bool useStdErr);
static inline const char* ffProcessAppendStdOut(FFstrbuf* buffer, char* const argv[])
@@ -19,3 +21,10 @@ static inline const char* ffProcessAppendStdErr(FFstrbuf* buffer, char* const ar
ffStrbufTrimRightSpace(buffer);
return error;
}
#ifdef _WIN32
bool ffProcessGetInfoWindows(uint32_t pid, uint32_t* ppid, FFstrbuf* pname, FFstrbuf* exe, const char** exeName, FFstrbuf* exePath, bool* gui);
#else
void ffProcessGetInfoLinux(pid_t pid, FFstrbuf* processName, FFstrbuf* exe, const char** exeName, FFstrbuf* exePath);
const char* ffProcessGetBasicInfoLinux(pid_t pid, FFstrbuf* name, pid_t* ppid, int32_t* tty);
#endif
+280
View File
@@ -2,6 +2,8 @@
#include "common/processing.h"
#include "common/io/io.h"
#include "common/time.h"
#include "util/stringUtils.h"
#include "util/mallocHelper.h"
#include <stdlib.h>
#include <unistd.h>
@@ -11,6 +13,17 @@
#include <errno.h>
#include <sys/wait.h>
#if defined(__FreeBSD__) || defined(__APPLE__)
#include <sys/types.h>
#include <sys/user.h>
#include <sys/sysctl.h>
#endif
#if defined(__APPLE__)
#include <libproc.h>
#elif defined(__sun)
#include <procfs.h>
#endif
enum { FF_PIPE_BUFSIZ = 8192 };
static inline int ffPipe2(int *fds, int flags)
@@ -101,3 +114,270 @@ const char* ffProcessAppendOutput(FFstrbuf* buffer, char* const argv[], bool use
return "read(childPipeFd, str, FF_PIPE_BUFSIZ) failed";
}
void ffProcessGetInfoLinux(pid_t pid, FFstrbuf* processName, FFstrbuf* exe, const char** exeName, FFstrbuf* exePath)
{
assert(processName->length > 0);
ffStrbufClear(exe);
#ifdef __linux__
char filePath[64];
snprintf(filePath, sizeof(filePath), "/proc/%d/cmdline", (int)pid);
if(ffReadFileBuffer(filePath, exe))
{
ffStrbufRecalculateLength(exe); //Trim the arguments
ffStrbufTrimRightSpace(exe);
ffStrbufTrimLeft(exe, '-'); //Login shells start with a dash
}
if (exePath)
{
snprintf(filePath, sizeof(filePath), "/proc/%d/exe", (int)pid);
ffStrbufEnsureFixedLengthFree(exePath, PATH_MAX);
ssize_t length = readlink(filePath, exePath->chars, exePath->allocated - 1);
if (length > 0) // doesn't contain trailing NUL
{
exePath->chars[length] = '\0';
exePath->length = (uint32_t) length;
}
}
#elif defined(__APPLE__)
size_t len = 0;
int mibs[] = { CTL_KERN, KERN_PROCARGS2, pid };
if (sysctl(mibs, sizeof(mibs) / sizeof(*mibs), NULL, &len, NULL, 0) == 0)
{// try get arg0
#ifndef MAC_OS_X_VERSION_10_15
//don't know why if don't let len longer, proArgs2 and len will change during the following sysctl() in old MacOS version.
len++;
#endif
FF_AUTO_FREE char* const procArgs2 = malloc(len);
if (sysctl(mibs, sizeof(mibs) / sizeof(*mibs), procArgs2, &len, NULL, 0) == 0)
{
// https://gist.github.com/nonowarn/770696#file-getargv-c-L46
uint32_t argc = *(uint32_t*) procArgs2;
const char* realExePath = procArgs2 + sizeof(argc);
const char* arg0 = memchr(realExePath, '\0', len - (size_t) (realExePath - procArgs2));
if (exePath)
ffStrbufSetNS(exePath, (uint32_t) (arg0 - realExePath), realExePath);
do arg0++; while (*arg0 == '\0');
assert(arg0 < procArgs2 + len);
if (argc > 1)
{
// #977
const char* p = strrchr(arg0, '/');
if (p)
p++;
else
p = arg0;
if (ffStrStartsWithIgnCase(p, "python")) // /opt/homebrew/Cellar/python@3.12/3.12.3/Frameworks/Python.framework/Versions/3.12/Resources/Python.app/Contents/MacOS/Python /Users/carter/.local/bin/xonsh
arg0 = p + strlen(p) + 1;
}
if (*arg0 == '-') arg0++; // Login shells
ffStrbufSetS(exe, arg0);
}
}
else
{
ffStrbufEnsureFixedLengthFree(exe, PATH_MAX);
int length = proc_pidpath(pid, exe->chars, exe->allocated);
if (length > 0)
{
exe->length = (uint32_t) length;
if (exePath)
ffStrbufSet(exePath, exe);
}
}
#elif defined(__FreeBSD__)
size_t size = ARG_MAX;
FF_AUTO_FREE char* args = malloc(size);
static_assert(ARG_MAX > PATH_MAX, "");
if(exePath && sysctl(
(int[]){CTL_KERN, KERN_PROC, KERN_PROC_PATHNAME, pid}, 4,
args, &size,
NULL, 0
) == 0)
ffStrbufSetNS(exePath, (uint32_t) (size - 1), args);
size = ARG_MAX;
if(sysctl(
(int[]){CTL_KERN, KERN_PROC, KERN_PROC_ARGS, pid}, 4,
args, &size,
NULL, 0
) == 0)
{
char* arg0 = args;
size_t arg0Len = strlen(args);
if (size > arg0Len + 1)
{
char* p = (char*) memrchr(args, '/', arg0Len);
if (p)
p++;
else
p = arg0;
if (ffStrStartsWith(p, "python")) // /usr/local/bin/python3.9 /home/carter/.local/bin/xonsh
{
arg0 += arg0Len + 1;
}
}
if (arg0[0] == '-') arg0++;
ffStrbufSetS(exe, arg0);
}
#elif defined(__sun)
char filePath[PATH_MAX];
snprintf(filePath, sizeof(filePath), "/proc/%d/psinfo", (int) pid);
psinfo_t proc;
if (ffReadFileData(filePath, sizeof(proc), &proc) == sizeof(proc))
{
ffStrbufSetS(exe, proc.pr_psargs);
ffStrbufSubstrBeforeFirstC(exe, ' ');
}
if (exePath)
{
snprintf(filePath, sizeof(filePath), "/proc/%d/path/a.out", (int) pid);
ffStrbufEnsureFixedLengthFree(exePath, PATH_MAX);
ssize_t length = readlink(filePath, exePath->chars, exePath->allocated - 1);
if (length > 0) // doesn't contain trailing NUL
{
exePath->chars[length] = '\0';
exePath->length = (uint32_t) length;
}
}
#endif
if(exe->length == 0)
ffStrbufSet(exe, processName);
assert(exe->length > 0);
uint32_t lastSlashIndex = ffStrbufLastIndexC(exe, '/');
if(lastSlashIndex < exe->length)
*exeName = exe->chars + lastSlashIndex + 1;
}
const char* ffProcessGetBasicInfoLinux(pid_t pid, FFstrbuf* name, pid_t* ppid, int32_t* tty)
{
if (pid <= 0)
return "Invalid pid";
#ifdef __linux__
char procFilePath[64];
if (ppid)
{
snprintf(procFilePath, sizeof(procFilePath), "/proc/%d/stat", (int)pid);
char buf[PROC_FILE_BUFFSIZ];
ssize_t nRead = ffReadFileData(procFilePath, sizeof(buf) - 1, buf);
if(nRead <= 8)
return "ffReadFileData(/proc/pid/stat, PROC_FILE_BUFFSIZ-1, buf) failed";
buf[nRead] = '\0';
*ppid = 0;
static_assert(sizeof(*ppid) == sizeof(int), "");
ffStrbufEnsureFixedLengthFree(name, 255);
int tty_;
if(
sscanf(buf, "%*s (%255[^)]) %*c %d %*d %*d %d", name->chars, ppid, &tty_) < 2 || //stat (comm) state ppid pgrp session tty
name->chars[0] == '\0'
)
return "sscanf(stat) failed";
ffStrbufRecalculateLength(name);
if (tty)
*tty = tty_ & 0xFF;
}
else
{
snprintf(procFilePath, sizeof(procFilePath), "/proc/%d/comm", (int)pid);
ssize_t nRead = ffReadFileBuffer(procFilePath, name);
if(nRead <= 0)
return "ffReadFileBuffer(/proc/pid/comm, name) failed";
ffStrbufTrimRightSpace(name);
}
#elif defined(__APPLE__)
struct kinfo_proc proc;
size_t size = sizeof(proc);
if(sysctl(
(int[]){CTL_KERN, KERN_PROC, KERN_PROC_PID, pid}, 4,
&proc, &size,
NULL, 0
))
return "sysctl(KERN_PROC_PID) failed";
ffStrbufSetS(name, proc.kp_proc.p_comm); //trancated to 16 chars
if (ppid)
*ppid = (pid_t)proc.kp_eproc.e_ppid;
if (tty)
{
*tty = ((proc.kp_eproc.e_tdev >> 24) & 0xFF) == 0x10
? proc.kp_eproc.e_tdev & 0xFFFFFF
: -1;
}
#elif defined(__FreeBSD__)
struct kinfo_proc proc;
size_t size = sizeof(proc);
if(sysctl(
(int[]){CTL_KERN, KERN_PROC, KERN_PROC_PID, pid}, 4,
&proc, &size,
NULL, 0
))
return "sysctl(KERN_PROC_PID) failed";
ffStrbufSetS(name, proc.ki_comm);
if (ppid)
*ppid = (pid_t)proc.ki_ppid;
if (tty)
{
if (proc.ki_tdev != NODEV && proc.ki_flag & P_CONTROLT)
{
const char* ttyName = devname(proc.ki_tdev, S_IFCHR);
if (ffStrStartsWith(ttyName, "pts/"))
*tty = (int32_t) strtol(ttyName + strlen("pts/"), NULL, 10);
else
*tty = -1;
}
else
*tty = -1;
}
#elif defined(__sun)
char path[128];
snprintf(path, sizeof(path), "/proc/%d/psinfo", (int) pid);
psinfo_t proc;
if (ffReadFileData(path, sizeof(proc), &proc) != sizeof(proc))
return "ffReadFileData(psinfo) failed";
ffStrbufSetS(name, proc.pr_fname);
if (ppid)
*ppid = proc.pr_ppid;
if (tty)
*tty = (int) proc.pr_ttydev;
#else
return "Unsupported platform";
#endif
return NULL;
}
+45
View File
@@ -3,6 +3,8 @@
#include "common/io/io.h"
#include <Windows.h>
#include <ntstatus.h>
#include <winternl.h>
enum { FF_PIPE_BUFSIZ = 8192 };
@@ -124,3 +126,46 @@ const char* ffProcessAppendOutput(FFstrbuf* buffer, char* const argv[], bool use
return NULL;
}
bool ffProcessGetInfoWindows(uint32_t pid, uint32_t* ppid, FFstrbuf* pname, FFstrbuf* exe, const char** exeName, FFstrbuf* exePath, bool* gui)
{
FF_AUTO_CLOSE_FD HANDLE hProcess = pid == 0
? GetCurrentProcess()
: OpenProcess(PROCESS_QUERY_LIMITED_INFORMATION, FALSE, pid);
if (gui)
*gui = GetGuiResources(hProcess, GR_GDIOBJECTS) > 0;
if(ppid)
{
PROCESS_BASIC_INFORMATION info = {};
ULONG size;
if(NT_SUCCESS(NtQueryInformationProcess(hProcess, ProcessBasicInformation, &info, sizeof(info), &size)))
{
assert(size == sizeof(info));
*ppid = (uint32_t)info.InheritedFromUniqueProcessId;
}
else
return false;
}
if(exe)
{
DWORD bufSize = exe->allocated;
if(QueryFullProcessImageNameA(hProcess, 0, exe->chars, &bufSize))
{
// We use full path here
// Querying command line of remote processes in Windows requires either WMI or ReadProcessMemory
exe->length = bufSize;
if (exePath) ffStrbufSet(exePath, exe);
}
else
return false;
}
if(pname && exeName)
{
*exeName = exe->chars + ffStrbufLastIndexC(exe, '\\') + 1;
ffStrbufSetS(pname, *exeName);
}
return true;
}
+88 -90
View File
@@ -6,45 +6,6 @@
#include <string.h>
typedef enum FFInitState
{
FF_INITSTATE_UNINITIALIZED = 0,
FF_INITSTATE_SUCCESSFUL = 1,
FF_INITSTATE_FAILED = 2
} FFInitState;
#define FF_LIBRARY_DATA_LOAD_INIT(dataObject, userLibraryName, ...) \
static dataObject data; \
static FFInitState initState = FF_INITSTATE_UNINITIALIZED; \
if(initState != FF_INITSTATE_UNINITIALIZED) {\
return initState == FF_INITSTATE_SUCCESSFUL ? &data : NULL; \
} \
initState = FF_INITSTATE_SUCCESSFUL; \
void* libraryHandle = ffLibraryLoad(&userLibraryName, __VA_ARGS__, NULL); \
if(libraryHandle == NULL) { \
initState = FF_INITSTATE_FAILED; \
return NULL; \
} \
#define FF_LIBRARY_DATA_LOAD_SYMBOL(symbolName) \
data.ff ## symbolName = dlsym(libraryHandle, #symbolName); \
if(data.ff ## symbolName == NULL) { \
dlclose(libraryHandle); \
initState = FF_INITSTATE_FAILED; \
return NULL; \
}
#define FF_LIBRARY_DATA_LOAD_RETURN \
initState = FF_INITSTATE_SUCCESSFUL; \
return &data;
#define FF_LIBRARY_DATA_LOAD_ERROR \
{ \
dlclose(libraryHandle); \
initState = FF_INITSTATE_FAILED; \
return NULL; \
}
#ifdef FF_HAVE_GIO
#include <gio/gio.h>
@@ -88,32 +49,39 @@ typedef struct GSettingsData
FF_LIBRARY_SYMBOL(g_settings_schema_source_get_default)
GSettingsSchemaSource* schemaSource;
GVariantGetters variantGetters;
bool inited;
} GSettingsData;
static const GSettingsData* getGSettingsData(void)
{
FF_LIBRARY_DATA_LOAD_INIT(GSettingsData, instance.config.library.libGIO, "libgio-2.0" FF_LIBRARY_EXTENSION, 1);
static GSettingsData data;
FF_LIBRARY_DATA_LOAD_SYMBOL(g_settings_schema_source_lookup)
FF_LIBRARY_DATA_LOAD_SYMBOL(g_settings_schema_has_key)
FF_LIBRARY_DATA_LOAD_SYMBOL(g_settings_new_full)
FF_LIBRARY_DATA_LOAD_SYMBOL(g_settings_get_value)
FF_LIBRARY_DATA_LOAD_SYMBOL(g_settings_get_user_value)
FF_LIBRARY_DATA_LOAD_SYMBOL(g_settings_get_default_value)
FF_LIBRARY_DATA_LOAD_SYMBOL(g_settings_schema_source_get_default)
if (!data.inited)
{
data.inited = true;
FF_LIBRARY_LOAD(libgsettings, &instance.config.library.libGIO, NULL, "libgio-2.0" FF_LIBRARY_EXTENSION, 1);
FF_LIBRARY_LOAD_SYMBOL_VAR(libgsettings, data, g_settings_schema_source_lookup, NULL)
FF_LIBRARY_LOAD_SYMBOL_VAR(libgsettings, data, g_settings_schema_has_key, NULL)
FF_LIBRARY_LOAD_SYMBOL_VAR(libgsettings, data, g_settings_new_full, NULL)
FF_LIBRARY_LOAD_SYMBOL_VAR(libgsettings, data, g_settings_get_value, NULL)
FF_LIBRARY_LOAD_SYMBOL_VAR(libgsettings, data, g_settings_get_user_value, NULL)
FF_LIBRARY_LOAD_SYMBOL_VAR(libgsettings, data, g_settings_get_default_value, NULL)
FF_LIBRARY_LOAD_SYMBOL_VAR(libgsettings, data, g_settings_schema_source_get_default, NULL)
#define data data.variantGetters
FF_LIBRARY_DATA_LOAD_SYMBOL(g_variant_dup_string)
FF_LIBRARY_DATA_LOAD_SYMBOL(g_variant_get_boolean)
FF_LIBRARY_DATA_LOAD_SYMBOL(g_variant_get_int32)
FF_LIBRARY_DATA_LOAD_SYMBOL(g_variant_unref);
#undef data
FF_LIBRARY_LOAD_SYMBOL_VAR(libgsettings, data.variantGetters, g_variant_dup_string, NULL)
FF_LIBRARY_LOAD_SYMBOL_VAR(libgsettings, data.variantGetters, g_variant_get_boolean, NULL)
FF_LIBRARY_LOAD_SYMBOL_VAR(libgsettings, data.variantGetters, g_variant_get_int32, NULL)
FF_LIBRARY_LOAD_SYMBOL_VAR(libgsettings, data.variantGetters, g_variant_unref, NULL);
data.schemaSource = data.ffg_settings_schema_source_get_default();
if(data.schemaSource == NULL)
FF_LIBRARY_DATA_LOAD_ERROR
data.schemaSource = data.ffg_settings_schema_source_get_default();
if (data.schemaSource)
libgsettings = NULL;
}
if(!data.schemaSource)
return NULL;
FF_LIBRARY_DATA_LOAD_RETURN
return &data;
}
FFvariant ffSettingsGetGSettings(const char* schemaName, const char* path, const char* key, FFvarianttype type)
@@ -161,27 +129,34 @@ typedef struct DConfData
FF_LIBRARY_SYMBOL(dconf_client_new)
GVariantGetters variantGetters;
DConfClient* client;
bool inited;
} DConfData;
static const DConfData* getDConfData(void)
{
FF_LIBRARY_DATA_LOAD_INIT(DConfData, instance.config.library.libDConf, "libdconf" FF_LIBRARY_EXTENSION, 2);
static DConfData data;
FF_LIBRARY_DATA_LOAD_SYMBOL(dconf_client_read_full)
FF_LIBRARY_DATA_LOAD_SYMBOL(dconf_client_new)
if (!data.inited)
{
data.inited = true;
#define data data.variantGetters
FF_LIBRARY_DATA_LOAD_SYMBOL(g_variant_dup_string)
FF_LIBRARY_DATA_LOAD_SYMBOL(g_variant_get_boolean)
FF_LIBRARY_DATA_LOAD_SYMBOL(g_variant_get_int32)
FF_LIBRARY_DATA_LOAD_SYMBOL(g_variant_unref)
#undef data
FF_LIBRARY_LOAD(libdconf, &instance.config.library.libDConf, NULL, "libdconf" FF_LIBRARY_EXTENSION, 2);
FF_LIBRARY_LOAD_SYMBOL_VAR(libdconf, data, dconf_client_read_full, NULL)
FF_LIBRARY_LOAD_SYMBOL_VAR(libdconf, data, dconf_client_new, NULL)
FF_LIBRARY_LOAD_SYMBOL_VAR(libdconf, data.variantGetters, g_variant_dup_string, NULL)
FF_LIBRARY_LOAD_SYMBOL_VAR(libdconf, data.variantGetters, g_variant_get_boolean, NULL)
FF_LIBRARY_LOAD_SYMBOL_VAR(libdconf, data.variantGetters, g_variant_get_int32, NULL)
FF_LIBRARY_LOAD_SYMBOL_VAR(libdconf, data.variantGetters, g_variant_unref, NULL)
data.client = data.ffdconf_client_new();
if(data.client == NULL)
FF_LIBRARY_DATA_LOAD_ERROR
data.client = data.ffdconf_client_new();
if (data.client)
libdconf = NULL;
}
if(!data.client)
return NULL;
FF_LIBRARY_DATA_LOAD_RETURN
return &data;
}
FFvariant ffSettingsGetDConf(const char* key, FFvarianttype type)
@@ -232,23 +207,35 @@ typedef struct XFConfData
FF_LIBRARY_SYMBOL(xfconf_channel_get_bool)
FF_LIBRARY_SYMBOL(xfconf_channel_get_int)
FF_LIBRARY_SYMBOL(xfconf_init)
bool inited;
} XFConfData;
static const XFConfData* getXFConfData(void)
{
FF_LIBRARY_DATA_LOAD_INIT(XFConfData, instance.config.library.libXFConf, "libxfconf-0" FF_LIBRARY_EXTENSION, 4);
static XFConfData data;
FF_LIBRARY_DATA_LOAD_SYMBOL(xfconf_channel_get)
FF_LIBRARY_DATA_LOAD_SYMBOL(xfconf_channel_has_property)
FF_LIBRARY_DATA_LOAD_SYMBOL(xfconf_channel_get_string)
FF_LIBRARY_DATA_LOAD_SYMBOL(xfconf_channel_get_bool)
FF_LIBRARY_DATA_LOAD_SYMBOL(xfconf_channel_get_int)
FF_LIBRARY_DATA_LOAD_SYMBOL(xfconf_init)
if (!data.inited)
{
data.inited = true;
FF_LIBRARY_LOAD(libxfconf, &instance.config.library.libXFConf, NULL, "libxfconf-0" FF_LIBRARY_EXTENSION, 4);
if(data.ffxfconf_init(NULL) == false)
FF_LIBRARY_DATA_LOAD_ERROR
FF_LIBRARY_LOAD_SYMBOL_VAR(libxfconf, data, xfconf_channel_get, NULL)
FF_LIBRARY_LOAD_SYMBOL_VAR(libxfconf, data, xfconf_channel_has_property, NULL)
FF_LIBRARY_LOAD_SYMBOL_VAR(libxfconf, data, xfconf_channel_get_string, NULL)
FF_LIBRARY_LOAD_SYMBOL_VAR(libxfconf, data, xfconf_channel_get_bool, NULL)
FF_LIBRARY_LOAD_SYMBOL_VAR(libxfconf, data, xfconf_channel_get_int, NULL)
FF_LIBRARY_LOAD_SYMBOL_VAR(libxfconf, data, xfconf_init, NULL)
if(!data.ffxfconf_init(NULL))
data.ffxfconf_init = NULL;
else
libxfconf = NULL;
}
FF_LIBRARY_DATA_LOAD_RETURN
if(!data.ffxfconf_init)
return NULL;
return &data;
}
FFvariant ffSettingsGetXFConf(const char* channelName, const char* propertyName, FFvarianttype type)
@@ -294,22 +281,33 @@ typedef struct SQLiteData
FF_LIBRARY_SYMBOL(sqlite3_column_text)
FF_LIBRARY_SYMBOL(sqlite3_finalize)
FF_LIBRARY_SYMBOL(sqlite3_close)
bool inited;
} SQLiteData;
static const SQLiteData* getSQLiteData(void)
{
FF_LIBRARY_DATA_LOAD_INIT(SQLiteData, instance.config.library.libSQLite3, "libsqlite3" FF_LIBRARY_EXTENSION, 1);
static SQLiteData data;
FF_LIBRARY_DATA_LOAD_SYMBOL(sqlite3_open_v2)
FF_LIBRARY_DATA_LOAD_SYMBOL(sqlite3_prepare_v2)
FF_LIBRARY_DATA_LOAD_SYMBOL(sqlite3_step)
FF_LIBRARY_DATA_LOAD_SYMBOL(sqlite3_data_count)
FF_LIBRARY_DATA_LOAD_SYMBOL(sqlite3_column_int)
FF_LIBRARY_DATA_LOAD_SYMBOL(sqlite3_column_text)
FF_LIBRARY_DATA_LOAD_SYMBOL(sqlite3_finalize)
FF_LIBRARY_DATA_LOAD_SYMBOL(sqlite3_close)
if (!data.inited)
{
data.inited = true;
FF_LIBRARY_LOAD(libsqlite, &instance.config.library.libSQLite3, NULL, "libsqlite3" FF_LIBRARY_EXTENSION, 1);
FF_LIBRARY_LOAD_SYMBOL_VAR(libsqlite, data, sqlite3_open_v2, NULL)
FF_LIBRARY_LOAD_SYMBOL_VAR(libsqlite, data, sqlite3_prepare_v2, NULL)
FF_LIBRARY_LOAD_SYMBOL_VAR(libsqlite, data, sqlite3_step, NULL)
FF_LIBRARY_LOAD_SYMBOL_VAR(libsqlite, data, sqlite3_data_count, NULL)
FF_LIBRARY_LOAD_SYMBOL_VAR(libsqlite, data, sqlite3_column_int, NULL)
FF_LIBRARY_LOAD_SYMBOL_VAR(libsqlite, data, sqlite3_column_text, NULL)
FF_LIBRARY_LOAD_SYMBOL_VAR(libsqlite, data, sqlite3_finalize, NULL)
FF_LIBRARY_LOAD_SYMBOL_VAR(libsqlite, data, sqlite3_close, NULL)
libsqlite = NULL;
}
FF_LIBRARY_DATA_LOAD_RETURN
if (!data.ffsqlite3_close)
return NULL;
return &data;
}
int ffSettingsGetSQLite3Int(const char* dbPath, const char* query)
+8 -2
View File
@@ -3,7 +3,7 @@
#include "util/textModifier.h"
#include "util/stringUtils.h"
void ffTempsAppendNum(double celsius, FFstrbuf* buffer, FFColorRangeConfig config)
void ffTempsAppendNum(double celsius, FFstrbuf* buffer, FFColorRangeConfig config, const FFModuleArgs* module)
{
if (celsius != celsius) // ignores NaN
return;
@@ -37,7 +37,7 @@ void ffTempsAppendNum(double celsius, FFstrbuf* buffer, FFColorRangeConfig confi
}
}
switch (options->temperatureUnit)
switch (options->tempUnit)
{
case FF_TEMPERATURE_UNIT_CELSIUS:
ffStrbufAppendF(buffer, "%.*f°C", options->tempNdigits, celsius);
@@ -51,7 +51,13 @@ void ffTempsAppendNum(double celsius, FFstrbuf* buffer, FFColorRangeConfig confi
}
if (!options->pipe)
{
ffStrbufAppendS(buffer, FASTFETCH_TEXT_MODIFIER_RESET);
if (module->outputColor.length)
ffStrbufAppendF(buffer, "\e[%sm", module->outputColor.chars);
else if (instance.config.display.colorOutput.length)
ffStrbufAppendF(buffer, "\e[%sm", instance.config.display.colorOutput.chars);
}
}
bool ffTempsParseCommandOptions(const char* key, const char* subkey, const char* value, bool* useTemp, FFColorRangeConfig* config)
+2 -1
View File
@@ -1,8 +1,9 @@
#pragma once
#include "common/parsing.h"
#include "common/option.h"
void ffTempsAppendNum(double celsius, FFstrbuf* buffer, FFColorRangeConfig config);
void ffTempsAppendNum(double celsius, FFstrbuf* buffer, FFColorRangeConfig config, const FFModuleArgs* module);
bool ffTempsParseCommandOptions(const char* key, const char* subkey, const char* value, bool* useTemp, FFColorRangeConfig* config);
bool ffTempsParseJsonObject(const char* key, yyjson_val* value, bool* useTemp, FFColorRangeConfig* config);
void ffTempsGenerateJsonConfig(yyjson_mut_doc* doc, yyjson_mut_val* module, FF_MAYBE_UNUSED bool defaultTemp, FFColorRangeConfig defaultConfig, bool temp, FFColorRangeConfig config);
+167 -47
View File
@@ -51,6 +51,18 @@
{
"long": "print-structure",
"desc": "Print the default structure"
},
{
"long": "format",
"desc": "Set output format",
"arg": {
"type": "enum",
"enum": {
"default": "Default format",
"json": "JSON format"
},
"default": "default"
}
}
],
"Config": [
@@ -142,7 +154,7 @@
{
"short": "l",
"long": "logo",
"desc": "Set the logo source",
"desc": "Set the logo source. Use \"none\" to disable the logo",
"remark": "Should be the name of a builtin logo, or a path to an image file. See also https://github.com/fastfetch-cli/fastfetch/wiki/Logo-options",
"arg": {
"type": "logo"
@@ -245,12 +257,15 @@
}
},
{
"long": "logo-separate",
"desc": "If true, print modules at bottom of the logo",
"long": "logo-position",
"desc": "Set the position of the logo should be displayed",
"arg": {
"type": "bool",
"optional": true,
"default": false
"type": "enum",
"enum": {
"left": "Left",
"top": "Top",
"right": "Right"
}
}
},
{
@@ -426,7 +441,7 @@
},
{
"long": "pipe",
"desc": "Disable logo and all escape sequences",
"desc": "Disable colors",
"remark": "Auto detection based on isatty(1)",
"arg": {
"type": "bool",
@@ -436,7 +451,7 @@
{
"long": "color-keys",
"desc": "Set the color of the keys",
"remark": "See `-h color` for the list of available colors",
"remark": "Doesn't affect module Title, Separator and Colors. See `-h color` for the list of available colors",
"arg": {
"type": "color"
}
@@ -449,6 +464,22 @@
"type": "color"
}
},
{
"long": "color-output",
"desc": "Set the color of module output",
"remark": "See `-h color` for the list of available colors",
"arg": {
"type": "color"
}
},
{
"long": "color-separator",
"desc": "Set the color of the key-value separator",
"remark": "See `-h color` for the list of available colors",
"arg": {
"type": "color"
}
},
{
"long": "color",
"desc": "Set the color of both the keys and title",
@@ -481,22 +512,6 @@
"default": ": "
}
},
{
"long": "set",
"desc": "Hard set the value of a key",
"remark": "Deprecated. Use \"Custom\" module instead",
"arg": {
"type": "key=value"
}
},
{
"long": "set-keyless",
"desc": "Hard set the value of a key, but don't print the key or the separator",
"remark": "Deprecated. Use \"Custom\" module instead",
"arg": {
"type": "key=value"
}
},
{
"long": "show-errors",
"desc": "Print occurring errors",
@@ -521,7 +536,7 @@
"arg": {
"type": "bool",
"optional": true,
"default": true
"default": false
}
},
{
@@ -542,10 +557,11 @@
"desc": "Set the percentage output type",
"remark": [
"1 for percentage number",
"2 for bar",
"2 for multi-color bar",
"3 for both",
"6 for bar only",
"9 for colored number"
"9 for colored number",
"10 for monochrome bar"
],
"arg": {
"type": "num",
@@ -603,6 +619,22 @@
"default": "-"
}
},
{
"long": "bar-border-left",
"desc": "Set the string to use at left border of percentage bars",
"arg": {
"type": "string",
"default": "[ "
}
},
{
"long": "bar-border-right",
"desc": "Set the string to use at right border of percentage bars",
"arg": {
"type": "string",
"default": " ]"
}
},
{
"long": "bar-width",
"desc": "Set the width of percentage bars, in number of characters",
@@ -611,15 +643,6 @@
"default": 10
}
},
{
"long": "bar-border",
"desc": "Whether to show a border around percentage bars",
"arg": {
"type": "bool",
"optional": true,
"default": true
}
},
{
"long": "no-buffer",
"desc": "Set if the stdout application buffer should be disabled",
@@ -705,7 +728,7 @@
},
{
"long": "ts-version",
"desc": "Whether to detect and display the version of terminal and shell",
"desc": "Whether to detect and display the version of terminal, shell and editor",
"remark": "Mainly for benchmarking",
"arg": {
"type": "bool",
@@ -938,11 +961,11 @@
}
},
{
"long": "os-file",
"desc": "Set the additional file path which containing OS information",
"remark": "Linux only",
"long": "separator-output-color",
"desc": "Set the color of the separator module",
"arg": {
"type": "path"
"type": "color",
"default": "default"
}
},
{
@@ -1160,6 +1183,24 @@
"default": 2
}
},
{
"long": "cpu-show-pe-core-count",
"desc": "Detect and display CPU frequency of different core types (eg. Pcore and Ecore) if supported",
"arg": {
"type": "bool",
"optional": true,
"default": false
}
},
{
"long": "cpucache-compact",
"desc": "Show all CPU caches in one line",
"arg": {
"type": "bool",
"optional": true,
"default": false
}
},
{
"long": "cpuusage-separate",
"desc": "Display CPU usage per CPU logical core, instead of an average result",
@@ -1205,13 +1246,19 @@
}
},
{
"long": "gpu-force-vulkan",
"desc": "Force using vulkan to detect GPUs",
"remark": "Vulkan supports video memory usage detection",
"long": "gpu-detection-method",
"desc": "Force using a specified method to detect GPUs",
"remark": "Will fall back to next methods if the specified method fails",
"arg": {
"type": "bool",
"optional": true,
"default": false
"type": "enum",
"enum": {
"auto": "Query platform specific graphic APIs. Requires proper GPU drivers installed. Not supported on FreeBSD",
"pci": "Search PCI devices, which do not requires GPU driver installed. Not supported on Windows and macOS",
"vulkan": "Use Vulkan API. Slow and requires proper vulkan driver installed. Used for Android",
"opencl": "Use OpenCL API. Slow and requires proper OpenCL driver installed",
"opengl": "Use OpenGL API. Slow and only detects one GPU"
},
"default": "auto"
}
},
{
@@ -1236,6 +1283,23 @@
"default": false
}
},
{
"long": "loadavg-ndigits",
"desc": "Set the number of digits to keep after the decimal point when printing load average",
"arg": {
"type": "num",
"default": 2
}
},
{
"long": "loadavg-compact",
"desc": "Show load average values in one line",
"arg": {
"type": "bool",
"optional": true,
"default": true
}
},
{
"long": "localip-show-ipv4",
"desc": "Show IPv4 addresses in local ip module",
@@ -1298,6 +1362,15 @@
"default": true
}
},
{
"long": "localip-show-all-ips",
"desc": "Show all IPs bound to the same interface. By default only the first IP is shown",
"arg": {
"type": "bool",
"optional": true,
"default": false
}
},
{
"long": "localip-compact",
"desc": "Show all IPs in one line",
@@ -1307,6 +1380,19 @@
"default": false
}
},
{
"long": "dns-show-type",
"desc": "Specify the type of DNS servers should be detected",
"arg": {
"type": "enum",
"enum": {
"ipv4": "Show IPv4 addresses only",
"ipv6": "Show IPv6 addresses only",
"both": "Show both IPv4 and IPv6 addresses"
},
"default": "both"
}
},
{
"long": "netio-name-prefix",
"desc": "Show interfaces with given name prefix only",
@@ -1348,6 +1434,14 @@
"type": "str"
}
},
{
"long": "publicip-ipv6",
"desc": "Whether to use IPv6 for public IP detection server",
"arg": {
"type": "bool",
"default": false
}
},
{
"long": "weather-location",
"desc": "Set the location to be used",
@@ -1382,6 +1476,24 @@
"default": false
}
},
{
"long": "users-compact",
"desc": "Show all active users in one line",
"arg": {
"type": "bool",
"optional": true,
"default": false
}
},
{
"long": "users-myself-only",
"desc": "Show only current user",
"arg": {
"type": "bool",
"optional": true,
"default": false
}
},
{
"long": "player-name",
"desc": "The name of the player to use for module Media and Player",
@@ -1522,6 +1634,14 @@
},
"pseudo": true
},
{
"long": "<module>-output-color",
"desc": "Override the global \"--color-output\" option for each specific module",
"arg": {
"type": "color"
},
"pseudo": true
},
{
"long": "<module>-key-width",
"desc": "Override the global \"--key-width\" option for each specific module",
+19 -4
View File
@@ -1,9 +1,24 @@
Usage: fastfetch --color <color>
Shortcut of `fastfetch --color-keys <color> --color-title <color>`.
If no color is set, the main color of the logo will be used.
Following information applies to all settings
<color> must be a color encoding as ANSI escape sequences. It is inserted between "ESC[" and "m".
Infos about them can be found here: https://en.wikipedia.org/wiki/ANSI_escape_code#SGR_(Select_Graphic_Rendition)_parameters.
Examples:
--color 35: sets the color to magenta. `--color magenta` is also supported
--color 4;92: sets the color to bright Green with underline
--color 5;104: blinking text on a blue background
If no color is set, the main color of the logo will be used.
35: sets the color to magenta
38;5;38: sets the color to 38th color of ANSI 256 colors
4;92: sets the color to bright green with underline
5;104: blinking text on a blue background
ANSI named colors are also supported:
magenta: equivalent to `35`
underline_bright_green: equivalent to `4;92`
After v2.15.0, some special keys can be used:
keys: use the color set by `--color-keys`
title: use the color set by `--color-title`
output: use the color set by `--color-output`
separator: use the color set by `--color-separator`
+11 -2
View File
@@ -4,6 +4,15 @@ For example the format string "Values: {1} ({2})", with the values "First" and "
The format string can contain placeholders in any order and have multiple occurrences.
To include spaces when setting from the command line, surround the whole string with double quotes (").
In 2.14.0 or newer, the value indices can be meaningful named tags.
For example: "--title-format '{user-name-colored}{at-symbol-colored}{host-name-colored}'" is equivalent to "--title-format '{6}{7}{8}'"
See "fastfetch -h title-format" for all supported tags.
In 2.17.0 or newer, a truncation length can be specified using syntax '<arg>:<trunc-length>`
For example: "--title-format '{user-name:5}'" will truncate user name into 5-length string.
If '<trunc-length>' is negative, an ellipsis … will be appended at the end when the original string is truncated.
Note: The string length is counted in raw bytes. Multi-byte unicode characters and ANSI escape codes are not taken into account.
If the value index is missing, meaning the placeholder is "{}", an internal counter sets the value index.
This means that the format string "Values: {1} ({2})" is equivalent to "Values: {} ({})".
Note that this counter only counts empty placeholders, so the format string "{2} {} {}" will contain the second value, then the first, and then the second again.
@@ -16,7 +25,7 @@ To only print something if a variable is set, use "{?<index>} ... {?}".
For example, to only print a second value if it is set, use "{?2} Second value: {2}{?}".
If a "{?}" is found without an opener, it is printed as is.
To only print something if a variable is not set, do the same as with if, just replace every '?' with a '!'.
To only print something if a variable is not set, do the same as with if, just replace every '?' with a '/'.
For example to print a fallback for a second value if it is not set, use "{?2}{2}{?}{/2}Second value fallback{/}".
To stop formatting at any point in the format string, use "{-}".
@@ -24,7 +33,7 @@ To stop formatting at any point in the format string, use "{-}".
To print something with color, start a placeholder with a '#' and then the linux terminal color encoding.
"\033[" at the start, and an 'm' at the end is automatically added, so don't do that.
A "{#}" is equivalent to a "{#0}" and resets everything to normal.
For example to print something pink and underline, use "{#4;35}...{#}".
For example to print something pink and underline, use "{#4;35}...{#}". "{#underline_magenta}" is also supported. See `fastfetch -h color` for detail.
Information about what the numbers mean can be found here: https://en.wikipedia.org/wiki/ANSI_escape_code#SGR_(Select_Graphic_Rendition)_parameters.
Which escape codes are supported and how they look is defined by your terminal.
+11 -15
View File
@@ -1,6 +1,7 @@
#include "battery.h"
#include "common/io/io.h"
#include "util/windows/nt.h"
#include "util/windows/unicode.h"
#include "util/mallocHelper.h"
#include "util/smbiosHelper.h"
@@ -12,16 +13,6 @@
#include <devguid.h>
#include <winternl.h>
NTSYSCALLAPI
NTSTATUS
NTAPI
NtPowerInformation(
IN POWER_INFORMATION_LEVEL InformationLevel,
IN PVOID InputBuffer OPTIONAL,
IN ULONG InputBufferLength,
OUT PVOID OutputBuffer OPTIONAL,
IN ULONG OutputBufferLength);
static inline void wrapSetupDiDestroyDeviceInfoList(HDEVINFO* hdev)
{
if(*hdev)
@@ -154,8 +145,6 @@ static const char* detectWithSetupApi(FFBatteryOptions* options, FFlist* results
return NULL;
}
typedef struct FFSmbiosPortableBattery
{
FFSmbiosHeader Header;
@@ -178,11 +167,18 @@ typedef struct FFSmbiosPortableBattery
uint8_t SbdsDeviceChemistry; // string
uint8_t DesignCapacityMultiplier; // varies
uint16_t OEMSpecific; // varies
} FFSmbiosPortableBattery;
} __attribute__((__packed__)) FFSmbiosPortableBattery;
const char* detectBySmbios(FFBatteryResult* battery)
static_assert(offsetof(FFSmbiosPortableBattery, OEMSpecific) == 0x16,
"FFSmbiosPortableBattery: Wrong struct alignment");
static const char* detectBySmbios(FFBatteryResult* battery)
{
const FFSmbiosPortableBattery* data = (const FFSmbiosPortableBattery*) (*ffGetSmbiosHeaderTable())[FF_SMBIOS_TYPE_PORTABLE_BATTERY];
const FFSmbiosHeaderTable* smbiosTable = ffGetSmbiosHeaderTable();
if (!smbiosTable)
return "Failed to get SMBIOS data";
const FFSmbiosPortableBattery* data = (const FFSmbiosPortableBattery*) (*smbiosTable)[FF_SMBIOS_TYPE_PORTABLE_BATTERY];
if (!data)
return "Portable battery section is not found in SMBIOS data";
+1 -1
View File
@@ -4,7 +4,7 @@
#include <stdlib.h>
const char* ffDetectBios(FFBiosResult* bios)
const char *ffDetectBios(FFBiosResult *bios)
{
ffGetSmbiosValue("/sys/devices/virtual/dmi/id/bios_date", "/sys/class/dmi/id/bios_date", &bios->date);
ffGetSmbiosValue("/sys/devices/virtual/dmi/id/bios_release", "/sys/class/dmi/id/bios_release", &bios->release);
+6
View File
@@ -0,0 +1,6 @@
#include "bios.h"
const char* ffDetectBios(FFBiosResult* bios)
{
return "Not supported on this platform";
}
+16 -4
View File
@@ -1,6 +1,9 @@
#include "bios.h"
#include "util/smbiosHelper.h"
#ifdef _WIN32
#include "util/windows/registry.h"
#include <ntstatus.h>
#include <winternl.h>
@@ -24,7 +27,7 @@ typedef struct _SYSTEM_BOOT_ENVIRONMENT_INFORMATION
};
};
} SYSTEM_BOOT_ENVIRONMENT_INFORMATION;
#endif
typedef struct FFSmbiosBios
{
@@ -35,7 +38,7 @@ typedef struct FFSmbiosBios
uint16_t BiosStartingAddressSegment; // varies
uint8_t BiosReleaseDate; // string
uint8_t BiosRomSize; // string
uint32_t BiosCharacteristics; // bit field
uint64_t BiosCharacteristics; // bit field
// 2.4+
uint8_t BiosCharacteristicsExtensionBytes[2]; // bit field
@@ -46,11 +49,18 @@ typedef struct FFSmbiosBios
// 3.1+
uint16_t ExtendedBiosRomSize; // bit field
} FFSmbiosBios;
} __attribute__((__packed__)) FFSmbiosBios;
static_assert(offsetof(FFSmbiosBios, ExtendedBiosRomSize) == 0x18,
"FFSmbiosBios: Wrong struct alignment");
const char* ffDetectBios(FFBiosResult* bios)
{
const FFSmbiosBios* data = (const FFSmbiosBios*) (*ffGetSmbiosHeaderTable())[FF_SMBIOS_TYPE_BIOS];
const FFSmbiosHeaderTable* smbiosTable = ffGetSmbiosHeaderTable();
if (!smbiosTable)
return "Failed to get SMBIOS data";
const FFSmbiosBios* data = (const FFSmbiosBios*) (*smbiosTable)[FF_SMBIOS_TYPE_BIOS];
if (!data)
return "BIOS section is not found in SMBIOS data";
@@ -66,6 +76,7 @@ const char* ffDetectBios(FFBiosResult* bios)
if (data->Header.Length > offsetof(FFSmbiosBios, SystemBiosMajorRelease))
ffStrbufSetF(&bios->release, "%u.%u", data->SystemBiosMajorRelease, data->SystemBiosMinorRelease);
#ifdef _WIN32
// Same as GetFirmwareType, but support (?) Windows 7
// https://ntdoc.m417z.com/system_information_class
SYSTEM_BOOT_ENVIRONMENT_INFORMATION sbei;
@@ -78,6 +89,7 @@ const char* ffDetectBios(FFBiosResult* bios)
default: break;
}
}
#endif
return NULL;
}
+11 -4
View File
@@ -14,13 +14,20 @@ typedef struct FFSmbiosBaseboard
uint8_t LocationInChassis; // string
uint16_t ChassisHandle; // varies
uint8_t BoardType; // enum
uint8_t NumberOfContainedObjectHandle; // varies
uint16_t ContainedObjectHandle[]; // varies
} FFSmbiosBaseboard;
uint8_t NumberOfContainedObjectHandles; // varies
uint16_t ContainedObjectHandles[]; // varies
} __attribute__((__packed__)) FFSmbiosBaseboard;
static_assert(offsetof(FFSmbiosBaseboard, ContainedObjectHandles) == 0x0F,
"FFSmbiosBaseboard: Wrong struct alignment");
const char* ffDetectBoard(FFBoardResult* board)
{
const FFSmbiosBaseboard* data = (const FFSmbiosBaseboard*) (*ffGetSmbiosHeaderTable())[FF_SMBIOS_TYPE_BASEBOARD_INFO];
const FFSmbiosHeaderTable* smbiosTable = ffGetSmbiosHeaderTable();
if (!smbiosTable)
return "Failed to get SMBIOS data";
const FFSmbiosBaseboard* data = (const FFSmbiosBaseboard*) (*smbiosTable)[FF_SMBIOS_TYPE_BASEBOARD_INFO];
if (!data)
return "Baseboard information section is not found in SMBIOS data";
+50
View File
@@ -0,0 +1,50 @@
#include "efi_helper.h"
static inline uint8_t evBits(uint16_t val, uint8_t mask, uint8_t shift)
{
return (uint8_t) ((val & (mask << shift)) >> shift);
}
static void ffEfiUcs2ToUtf8(const uint16_t *const chars, FFstrbuf* result)
{
for (uint32_t i = 0; chars[i]; i++)
{
if (chars[i] <= 0x007f)
ffStrbufAppendC(result, (char) chars[i]);
else if (chars[i] > 0x007f && chars[i] <= 0x07ff)
{
ffStrbufAppendC(result, (char) (0xc0 | evBits(chars[i], 0x1f, 6)));
ffStrbufAppendC(result, (char) (0x80 | evBits(chars[i], 0x3f, 0)));
}
else
{
ffStrbufAppendC(result, (char) (0xe0 | evBits(chars[i], 0xf, 12)));
ffStrbufAppendC(result, (char) (0x80 | evBits(chars[i], 0x3f, 6)));
ffStrbufAppendC(result, (char) (0x80 | evBits(chars[i], 0x3f, 0)));
}
}
}
bool ffEfiFillLoadOption(const FFEfiLoadOption* efiOption, FFBootmgrResult* result)
{
uint32_t descLen = 0;
while (efiOption->Description[descLen]) ++descLen;
if (descLen)
ffEfiUcs2ToUtf8(efiOption->Description, &result->name);
for (
ffEfiDevicePathProtocol* filePathList = (void*) &efiOption->Description[descLen + 1];
filePathList->Type != 0x7F; // End of Hardware Device Path
filePathList = (void*) ((uint8_t*) filePathList + filePathList->Length))
{
if (filePathList->Type == 4 && filePathList->SubType == 4)
{
// https://uefi.org/specs/UEFI/2.10/10_Protocols_Device_Path_Protocol.html#file-path-media-device-path
ffEfiUcs2ToUtf8((uint16_t*) filePathList->SpecificDevicePathData, &result->firmware);
return true;
}
}
return false;
}
+12
View File
@@ -0,0 +1,12 @@
#pragma once
#include "fastfetch.h"
typedef struct FFBootmgrResult
{
FFstrbuf name;
FFstrbuf firmware;
bool secureBoot;
} FFBootmgrResult;
const char* ffDetectBootmgr(FFBootmgrResult* bios);
+12
View File
@@ -0,0 +1,12 @@
#include "bootmgr.h"
#include "common/io/io.h"
const char* ffDetectBootmgr(FFBootmgrResult* result)
{
if (ffPathExists("/System/Library/CoreServices/boot.efi", FF_PATHTYPE_FILE))
ffStrbufSetStatic(&result->firmware, "/System/Library/CoreServices/boot.efi");
ffStrbufSetStatic(&result->name, "iBoot");
return NULL;
}
+43
View File
@@ -0,0 +1,43 @@
#include "bootmgr.h"
#include "efi_helper.h"
#include "common/io/io.h"
#include <sys/efiio.h>
#include <sys/ioctl.h>
#include <fcntl.h>
const char* ffDetectBootmgr(FFBootmgrResult* result)
{
FF_AUTO_CLOSE_FD int efifd = open("/dev/efi", O_RDWR);
if (efifd < 0) return "open(/dev/efi) failed";
uint8_t buffer[2048];
struct efi_var_ioc ioc = {
.vendor = { 0x8be4df61, 0x93ca, 0x11d2, 0xaa, 0x0d, { 0x00, 0xe0, 0x98, 0x03, 0x2b, 0x8c } },
.data = buffer,
};
ioc.datasize = sizeof(buffer);
ioc.name = (efi_char[]){ 'B', 'o', 'o', 't', 'C', 'u', 'r', 'r', 'e', 'n', 't', '\0' };
ioc.namesize = sizeof("BootCurrent") * 2;
if (ioctl(efifd, EFIIOC_VAR_GET, &ioc) < 0 || ioc.datasize != 2)
return "ioctl(EFIIOC_VAR_GET, BootCurrent) failed";
unsigned char hex[5];
snprintf((char*) hex, sizeof(hex), "%04X", *(uint16_t*)buffer);
ioc.datasize = sizeof(buffer);
ioc.name = (efi_char[]){ 'B', 'o', 'o', 't', hex[0], hex[1], hex[2], hex[3], '\0' };
ioc.namesize = sizeof("Boot####") * 2;
if (ioctl(efifd, EFIIOC_VAR_GET, &ioc) < 0 || ioc.datasize == sizeof(buffer))
return "ioctl(EFIIOC_VAR_GET, Boot####) failed";
ffEfiFillLoadOption((FFEfiLoadOption *)buffer, result);
ioc.name = (efi_char[]){ 'S', 'e', 'c', 'u', 'r', 'e', 'B', 'o', 'o', 't', '\0' };
ioc.namesize = sizeof("SecureBoot") * 2;
ioc.datasize = sizeof(buffer);
if (ioctl(efifd, EFIIOC_VAR_GET, &ioc) == 0 && ioc.datasize == 1)
result->secureBoot = !!buffer[0];
return NULL;
}
+27
View File
@@ -0,0 +1,27 @@
#include "bootmgr.h"
#include "common/io/io.h"
#include "efi_helper.h"
#define FF_EFIVARS_PATH_PREFIX "/sys/firmware/efi/efivars/"
const char* ffDetectBootmgr(FFBootmgrResult* result)
{
uint8_t buffer[2048];
if (ffReadFileData(FF_EFIVARS_PATH_PREFIX "BootCurrent-" FF_EFI_GLOBAL_GUID, sizeof(buffer), buffer) != 6)
return "Failed to read efivar: BootCurrent";
uint16_t value = *(uint16_t *)&buffer[4];
snprintf((char*) buffer, sizeof(buffer), FF_EFIVARS_PATH_PREFIX "Boot%04X-" FF_EFI_GLOBAL_GUID, value);
ssize_t size = ffReadFileData((const char*) buffer, sizeof(buffer), buffer);
if (size < 5 + (int) sizeof(FFEfiLoadOption) || size == (ssize_t) sizeof(buffer))
return "Failed to read efivar: Boot####";
ffEfiFillLoadOption((FFEfiLoadOption *)&buffer[4], result);
if (ffReadFileData(FF_EFIVARS_PATH_PREFIX "SecureBoot-" FF_EFI_GLOBAL_GUID, sizeof(buffer), buffer) == 6)
result->secureBoot = buffer[4] == 1;
return NULL;
}
@@ -0,0 +1,6 @@
#include "bootmgr.h"
const char* ffDetectBootmgr(FF_MAYBE_UNUSED FFBootmgrResult* result)
{
return "Not supported on this platform";
}
+53
View File
@@ -0,0 +1,53 @@
#include "bootmgr.h"
#include "efi_helper.h"
#include <windows.h>
const char* enablePrivilege(const wchar_t* privilege)
{
HANDLE token;
if (!OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, &token))
return "OpenProcessToken() failed";
TOKEN_PRIVILEGES tp = {
.PrivilegeCount = 1,
.Privileges = {
(LUID_AND_ATTRIBUTES) { .Attributes = SE_PRIVILEGE_ENABLED }
},
};
if (!LookupPrivilegeValueW(NULL, privilege, &tp.Privileges[0].Luid))
return "LookupPrivilegeValue() failed";
if (!AdjustTokenPrivileges(token, false, &tp, sizeof(tp), NULL, NULL))
return "AdjustTokenPrivileges() failed";
if (GetLastError() == ERROR_NOT_ALL_ASSIGNED)
return "The token does not have the specified privilege";
return NULL;
}
const char* ffDetectBootmgr(FFBootmgrResult* result)
{
if (enablePrivilege(L"SeSystemEnvironmentPrivilege") != NULL)
return "Failed to enable SeSystemEnvironmentPrivilege";
uint16_t value;
if (GetFirmwareEnvironmentVariableW(L"BootCurrent", L"{" FF_EFI_GLOBAL_GUID L"}", &value, sizeof(value)) != 2)
return "GetFirmwareEnvironmentVariableW(BootCurrent) failed";
uint8_t buffer[2048];
wchar_t key[16];
wsprintfW(key, L"Boot%04X", value);
uint32_t size = GetFirmwareEnvironmentVariableW(key, L"{" FF_EFI_GLOBAL_GUID L"}", buffer, sizeof(buffer));
if (size < sizeof(FFEfiLoadOption) || size == sizeof(buffer))
return "GetFirmwareEnvironmentVariableW(Boot####) failed";
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)
result->secureBoot = !!uefiSecureBootEnabled;
return NULL;
}
+24
View File
@@ -0,0 +1,24 @@
#include "bootmgr.h"
// https://uefi.org/specs/UEFI/2.10/10_Protocols_Device_Path_Protocol.html#generic-device-path-structures
typedef struct ffEfiDevicePathProtocol
{
uint8_t Type;
uint8_t SubType;
uint16_t Length;
uint8_t SpecificDevicePathData[];
} ffEfiDevicePathProtocol;
// https://uefi.org/specs/UEFI/2.10/03_Boot_Manager.html#load-options
typedef struct FFEfiLoadOption
{
uint32_t Attributes;
uint16_t FilePathListLength;
uint16_t Description[];
// ffEfiDevicePathProtocol FilePathList[];
// uint8_t OptionalData[];
} FFEfiLoadOption;
bool ffEfiFillLoadOption(const FFEfiLoadOption* efiOption, FFBootmgrResult* result);
#define FF_EFI_GLOBAL_GUID "8be4df61-93ca-11d2-aa0d-00e098032b8c"
+8 -3
View File
@@ -4,7 +4,6 @@
#include "util/stringUtils.h"
#include <dirent.h>
#include <ctype.h>
#include <limits.h>
static const char* detectWithBacklight(FFlist* result)
@@ -58,14 +57,14 @@ static const char* detectWithBacklight(FFlist* result)
{
ffStrbufSubstrBeforeLastC(&brightness->name, '/'); // remove "/edid"
ffStrbufSubstrAfterLastC(&brightness->name, '/'); // try getting DRM connector name
if(isdigit(brightness->name.chars[0]))
if(ffCharIsDigit(brightness->name.chars[0]))
{
// PCI address or some unknown path, give up
ffStrbufSetS(&brightness->name, entry->d_name);
}
else
{
if(ffStrbufStartsWithS(&brightness->name, "card") && isdigit(brightness->name.chars[4]))
if(ffStrbufStartsWithS(&brightness->name, "card") && ffCharIsDigit(brightness->name.chars[4]))
ffStrbufSubstrAfterFirstC(&brightness->name, '-');
}
}
@@ -109,14 +108,19 @@ static const char* detectWithDdcci(FFBrightnessOptions* options, FFlist* result)
FF_LIBRARY_LOAD_SYMBOL_MESSAGE(libddcutil, ddca_free_any_vcp_value)
FF_LIBRARY_LOAD_SYMBOL_MESSAGE(libddcutil, ddca_close_display)
#ifndef FF_DISABLE_DLOPEN
__typeof__(&ddca_init) ffddca_init = dlsym(libddcutil, "ddca_init");
if (ffddca_init)
#else
__typeof__(&ddca_init) ffddca_init = ddca_init;
#endif
{
FF_SUPPRESS_IO();
// Ref: https://github.com/rockowitz/ddcutil/issues/344
if (ffddca_init(NULL, -1 /*DDCA_SYSLOG_NOT_SET*/, 1 /*DDCA_INIT_OPTIONS_DISABLE_CONFIG_FILE*/) < 0)
return "ddca_init() failed";
}
#ifndef FF_DISABLE_DLOPEN
else
{
__typeof__(&ddca_set_default_sleep_multiplier) ffddca_set_default_sleep_multiplier = dlsym(libddcutil, "ddca_set_default_sleep_multiplier");
@@ -125,6 +129,7 @@ static const char* detectWithDdcci(FFBrightnessOptions* options, FFlist* result)
libddcutil = NULL; // Don't dlclose libddcutil. See https://github.com/rockowitz/ddcutil/issues/330
}
#endif
FF_AUTO_FREE DDCA_Display_Info_List* infoList = NULL;
if (ffddca_get_display_info_list2(false, &infoList) < 0)
+22 -2
View File
@@ -3,10 +3,28 @@
#import <AVFoundation/AVCaptureDevice.h>
// warning: 'AVCaptureDeviceTypeExternalUnknown' is deprecated
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
const char* ffDetectCamera(FFlist* result)
{
#ifdef MAC_OS_X_VERSION_10_15
FF_SUPPRESS_IO(); // #822
AVCaptureDeviceDiscoverySession* session = [AVCaptureDeviceDiscoverySession discoverySessionWithDeviceTypes:@[AVCaptureDeviceTypeBuiltInWideAngleCamera, AVCaptureDeviceTypeExternalUnknown]
AVCaptureDeviceType deviceType;
#ifdef MAC_OS_VERSION_14_0
if (@available(macOS 14.0, *))
{
deviceType = AVCaptureDeviceTypeExternal;
}
else
#endif
{
deviceType = AVCaptureDeviceTypeExternalUnknown;
}
AVCaptureDeviceDiscoverySession* session = [AVCaptureDeviceDiscoverySession discoverySessionWithDeviceTypes:@[AVCaptureDeviceTypeBuiltInWideAngleCamera, deviceType]
mediaType:AVMediaTypeVideo
position:AVCaptureDevicePositionUnspecified];
if (!session)
@@ -30,6 +48,8 @@ const char* ffDetectCamera(FFlist* result)
camera->width = size.width < 0 ? 0 : (uint32_t) size.width;
camera->height = size.height < 0 ? 0 : (uint32_t) size.height;
}
return NULL;
#else
return "No support for old MacOS version";
#endif
}
+6
View File
@@ -0,0 +1,6 @@
#include "camera.h"
const char* ffDetectCamera(FF_MAYBE_UNUSED FFlist* result)
{
return "Not support on this platform";
}
+9 -2
View File
@@ -25,11 +25,18 @@ typedef struct FFSmbiosSystemEnclosure
uint8_t ContainedElementCount; // varies
uint8_t ContainedRecordLength; // varies
uint8_t ContainedElements[]; // varies
} FFSmbiosSystemEnclosure;
} __attribute__((__packed__)) FFSmbiosSystemEnclosure;
static_assert(offsetof(FFSmbiosSystemEnclosure, ContainedElements) == 0x15,
"FFSmbiosSystemEnclosure: Wrong struct alignment");
const char* ffDetectChassis(FFChassisResult* result)
{
const FFSmbiosSystemEnclosure* data = (const FFSmbiosSystemEnclosure*) (*ffGetSmbiosHeaderTable())[FF_SMBIOS_TYPE_SYSTEM_ENCLOSURE];
const FFSmbiosHeaderTable* smbiosTable = ffGetSmbiosHeaderTable();
if (!smbiosTable)
return "Failed to get SMBIOS data";
const FFSmbiosSystemEnclosure* data = (const FFSmbiosSystemEnclosure*) (*smbiosTable)[FF_SMBIOS_TYPE_SYSTEM_ENCLOSURE];
if (!data)
return "System enclosure is not found in SMBIOS data";
+9 -1
View File
@@ -4,6 +4,12 @@
#define FF_CPU_TEMP_UNSET (0/0.0)
typedef struct FFCPUCore
{
uint32_t freq;
uint32_t count;
} FFCPUCore;
typedef struct FFCPUResult
{
FFstrbuf name;
@@ -16,10 +22,12 @@ typedef struct FFCPUResult
double frequencyBase; // GHz
double frequencyMax; // GHz
double frequencyMin; // GHz
double frequencyBiosLimit; // GHz
FFCPUCore coreTypes[16]; // number of P cores, E cores, etc.
double temperature;
} FFCPUResult;
const char* ffCPUDetectByCpuid(FFCPUResult* cpu);
const char* ffDetectCPU(const FFCPUOptions* options, FFCPUResult* cpu);
const char* ffCPUAppleCodeToName(uint32_t code);
+23 -5
View File
@@ -68,20 +68,37 @@ 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);
if(cpu->frequencyMax > 0.0)
cpu->frequencyMax /= 1000.0 * 1000.0 * 1000.0;
else
cpu->frequencyMax = ffSysctlGetInt64("hw.cpufrequency_max", 0) / 1000.0 / 1000.0 / 1000.0;
if(cpu->frequencyBase != cpu->frequencyBase)
{
unsigned current = 0;
size_t size = sizeof(current);
if (sysctl((int[]){ CTL_HW, HW_CPU_FREQ }, 2, &current, &size, NULL, 0) == 0)
cpu->frequencyMax = (double) current / 1000.0 / 1000.0 / 1000.0;
cpu->frequencyBase = (double) current / 1000.0 / 1000.0 / 1000.0;
}
return NULL;
}
#endif
static const char* detectCoreCount(FFCPUResult* cpu)
{
uint32_t nPerfLevels = (uint32_t) ffSysctlGetInt("hw.nperflevels", 0);
if (nPerfLevels <= 0) return "sysctl(hw.nperflevels) failed";
char sysctlKey[] = "hw.perflevelN.logicalcpu";
if (nPerfLevels > sizeof(cpu->coreTypes) / sizeof(cpu->coreTypes[0]))
nPerfLevels = sizeof(cpu->coreTypes) / sizeof(cpu->coreTypes[0]);
for (uint32_t i = 0; i < nPerfLevels; ++i)
{
sysctlKey[strlen("hw.perflevel")] = (char) ('0' + i);
cpu->coreTypes[i] = (FFCPUCore) {
.freq = nPerfLevels - i,
.count = (uint32_t) ffSysctlGetInt(sysctlKey, 0),
};
}
return NULL;
}
const char* ffDetectCPUImpl(const FFCPUOptions* options, FFCPUResult* cpu)
{
if (ffSysctlGetString("machdep.cpu.brand_string", &cpu->name) != NULL)
@@ -104,6 +121,7 @@ const char* ffDetectCPUImpl(const FFCPUOptions* options, FFCPUResult* cpu)
cpu->coresOnline = (uint16_t) ffSysctlGetInt("hw.activecpu", 1);
detectFrequency(cpu);
if (options->showPeCoreCount) detectCoreCount(cpu);
cpu->temperature = options->temp ? detectCpuTemp(&cpu->name) : FF_CPU_TEMP_UNSET;
+58
View File
@@ -11,6 +11,64 @@ const char* ffDetectCPUImpl(const FFCPUOptions* options, FFCPUResult* cpu)
cpu->coresLogical = cpu->coresPhysical;
cpu->coresOnline = cpu->coresPhysical;
FF_STRBUF_AUTO_DESTROY buffer = ffStrbufCreate();
if (ffSysctlGetString("kern.sched.topology_spec", &buffer) == NULL && buffer.length > 0)
{
// <groups>
// <group level="1" cache-level="3">
// <cpu count="4" mask="f,0,0,0">0, 1, 2, 3</cpu>
// <children>
// <group level="2" cache-level="2">
// <cpu count="2" mask="3,0,0,0">0, 1</cpu>
// <flags><flag name="THREAD">THREAD group</flag><flag name="SMT">SMT group</flag></flags>
// </group>
// <group level="2" cache-level="2">
// <cpu count="2" mask="c,0,0,0">2, 3</cpu>
// <flags><flag name="THREAD">THREAD group</flag><flag name="SMT">SMT group</flag></flags>
// </group>
// </children>
// </group>
// </groups>
uint32_t i = 0;
while (true)
{
i = ffStrbufNextIndexS(&buffer, i, "<flag name=\"THREAD\">THREAD group</flag>"); // Find physical core with hyper-threading enabled
if (i >= buffer.length) break;
cpu->coresPhysical--;
i += (uint32_t) strlen("<flag name=\"THREAD\">THREAD group</flag>");
}
}
for (uint16_t i = 0; i < cpu->coresLogical; ++i)
{
ffStrbufClear(&buffer);
char key[32];
snprintf(key, sizeof(key), "dev.cpu.%u.freq_levels", i);
if (ffSysctlGetString(key, &buffer) == NULL && buffer.length > 0)
{
// 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 (options->showPeCoreCount)
{
uint32_t ifreq = 0;
while (cpu->coreTypes[ifreq].freq != fmax && cpu->coreTypes[ifreq].freq > 0)
++ifreq;
if (cpu->coreTypes[ifreq].freq == 0)
cpu->coreTypes[ifreq].freq = fmax;
cpu->coreTypes[ifreq].count++;
}
}
}
cpu->frequencyMin /= 1000;
cpu->frequencyMax /= 1000;
int clockRate = ffSysctlGetInt("hw.clockrate", 0);
cpu->frequencyBase = clockRate <= 0 ? 0.0/0.0 : clockRate / 1000.0;
cpu->temperature = FF_CPU_TEMP_UNSET;

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