Compare commits

...

39 Commits

Author SHA1 Message Date
Carter Li 8e5017aa3a Merge pull request #1123 from fastfetch-cli/dev
Release: v2.20.0
2024-07-26 10:27:31 +08:00
李通洲 dc89336fc1 Release: v2.20.0 2024-07-26 09:51:51 +08:00
李通洲 952152edf0 Global (macOS): always check NULL after IORegistryEntryCreateCFProperty 2024-07-26 08:46:34 +08:00
李通洲 6862747c48 GPU (macOS): fix possible segfault when detecting GPU frequency (M1 Air)
Fix #1122
2024-07-26 08:46:34 +08:00
李通洲 f91be6442d Android (Linux): detect MTK CPU part name 2024-07-26 08:46:34 +08:00
Carter Li bdce8ea3a1 Logo (Image): fix paddingTop doesn't work with position: right 2024-07-25 21:41:15 +08:00
Carter Li 44c8fa0470 Logo (Image): fix padding* not working correctly
Fix #1121
2024-07-25 21:27:53 +08:00
李通洲 9f9a5ba39a Android (Linux): report Snapdragon SOC marketing name 2024-07-25 10:33:06 +08:00
李通洲 7c37d719e5 Doc: update help message 2024-07-24 16:41:22 +08:00
李通洲 cc78d6b16c Presets: update some presets 2024-07-24 16:37:35 +08:00
李通洲 e7b7645f08 Presets: remove meaningless presets 2024-07-24 16:25:33 +08:00
李通洲 6a17ef6a54 Presets: update examples 2024-07-24 16:25:16 +08:00
李通洲 5b687727c0 Global: update icon 2024-07-24 15:46:41 +08:00
李通洲 9b038dc848 Global: fix JSON option modules.keyIcon doesn't work 2024-07-24 15:38:54 +08:00
李通洲 597dd32caf Presets: simplify examples/2.jsonc with builtin icon feature 2024-07-24 15:32:20 +08:00
李通洲 8d08a65611 Sound: update icon 2024-07-24 15:31:37 +08:00
李通洲 263c54a81e Global: add option display.key.paddingLeft
Also rename `display.keyWidth` to `display.key.width`
2024-07-24 15:12:25 +08:00
李通洲 cba5560068 LM: change icon 2024-07-24 14:36:13 +08:00
李通洲 0703b2b88f NetIO: don't use the same icon as DiskIO 2024-07-24 14:34:50 +08:00
李通洲 86e5572a7e Custom: fix using icon as key 2024-07-24 14:32:03 +08:00
李通洲 3b3c1a9f63 Global: support display predefined icon in custom key format 2024-07-24 14:27:46 +08:00
李通洲 14b9e88a82 Editor: fix printing editor type 2024-07-24 14:17:47 +08:00
李通洲 bee7c62000 Global: add option --<module>-key-icon 2024-07-24 14:05:46 +08:00
李通洲 8fa4d7ae6e Fastfetch: add option --key-type <enum> 2024-07-24 11:13:37 +08:00
李通洲 640d0666fc Logo (Image): don't require logo height when using position right
Fix #1119
2024-07-24 09:59:23 +08:00
李通洲 165b0b0a69 TerminalFont (Linux): remove Windows Terminal support for WSL
Fix #1113
2024-07-24 09:33:17 +08:00
李通洲 dc216362d5 TerminalFont (Linux): detect system mono font 2024-07-24 09:21:16 +08:00
李通洲 57ffe3bad2 Fastfetch: add icons 2024-07-23 23:02:35 +08:00
Carter Li cdee6e2997 Display (Linux): don't wake up suspended GPU 2024-07-23 19:06:04 +08:00
Carter Li fb03c95d68 LM (Linux): improve ssh version detection code 2024-07-23 18:38:07 +08:00
Carter Li 5b76a0b45a Packaging: update debian stuff [ci skip] 2024-07-23 10:27:33 +08:00
Carter Li fa5a74c746 Merge pull request #1115 from fastfetch-cli/dev
Release: v2.19.1
2024-07-23 10:10:49 +08:00
李通洲 4c6e14bcc2 Release: v2.19.1 2024-07-23 09:56:17 +08:00
李通洲 deacecdc11 Fastfetch: print error when invalid freq option is found 2024-07-23 09:55:48 +08:00
李通洲 83dcdaa726 GPU: fix frequency printing when using custom formation 2024-07-23 09:50:51 +08:00
李通洲 2c29465f69 Doc: update README [ci skip] 2024-07-23 09:39:22 +08:00
李通洲 f3e48a00a0 Display (Android): fix MiUI
560 is density dpi, not physical dpi
2024-07-23 09:27:07 +08:00
李通洲 9559db556d Display: print [HDR] if enabled 2024-07-23 09:27:07 +08:00
Carter Li b89eeaa954 CPU: fix double frequency value when using custom formation
Fix #1111
2024-07-22 22:14:43 +08:00
110 changed files with 1050 additions and 796 deletions
+39
View File
@@ -1,3 +1,42 @@
# 2.20.0
This release fixes regression of `2.19.0` on M1 MacBook Air. It also introduces a new option `--key-type icon` to display predefined icons in keys (requires newest nerd font). See `fastfetch -h key-type` for detail.
Changes:
* JSON option `display.keyWidth` has been renamed to `display.key.width`
* Previously: `{ "display": { "keyWidth": 3 } }`
* Now: `{ "display": { "key": { "width": 3 } } }`
* Windows Terminal font detection **in WSL** has been removed due to [issue #1113](https://github.com/fastfetch/fastfetch/issues/1113)
Features:
* Add option `display.key.type: <enum>` to print icons in keys
* Supported value `string`, `icon` and `both`. Default to `string` (don't display icons)
* Example: `{ "display": { "key": { "type": "icon" } } }`
* Add option `display.key.paddingLeft: <num>` to print left padding (whitespaces) in keys
* Example: `{ "display": { "key": { "paddingLeft": 2 } } }`
* Add option `modules.keyIcon` to set icon for specified module
* Example: `{ "modules": { "type": "command", "keyIcon": "🔑" } }`
* Report system mono font name for Terminator if used (TerminalFont, Linux)
* Don't require logo height to be set when using `--logo-position right`
* Report Snapdragon SOC marketing name for newer Android phones (CPU, Android)
* Detect MTK SOC part name (CPU, Android)
Bugfixes:
* Don't wake up suspended GPUs when using `--ds-force-drm` (Display, Linux)
* Fix printing editor type in JSON result (Editor)
* Fix `--logo-padding-*` not working correctly (#1121, Logo)
* Fix possible segfault when detecting GPU frequency (#1121, macOS, GPU)
# 2.19.1
Bugfixes
* Fix frequency value printing when using custom format (#1111, CPU / GPU)
* Fix display detection for XiaoMi Android phone (Display, Android)
Features:
* Display if HDR mode is enabled for screens (Display)
* Supported in Windows and Linux (KDE) correctly
# 2.19.0
Changes:
+1 -1
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.19.0
VERSION 2.20.0
LANGUAGES C
DESCRIPTION "Fast neofetch-like system information tool"
HOMEPAGE_URL "https://github.com/fastfetch-cli/fastfetch"
+2
View File
@@ -128,6 +128,8 @@ Alternatively, you can refer to the presets in [`presets` directory](https://git
The **correct** way to edit the configuration:
This is an example that [changes size prefix from MiB / GiB to MB / GB](https://github.com/fastfetch-cli/fastfetch/discussions/1014). Editor used: [helix](https://github.com/helix-editor/helix)
[![asciicast](https://asciinema.org/a/1uF6sTPGKrHKI1MVaFcikINSQ.svg)](https://asciinema.org/a/1uF6sTPGKrHKI1MVaFcikINSQ)
### Q: I WANT THE DOCUMENTATION!
+12
View File
@@ -1,3 +1,15 @@
fastfetch (2.19.1) jammy; urgency=medium
* Update to 2.19.1
-- Carter Li <zhangsongcui@live.cn> Tue, 23 Jul 2024 10:25:14 +0800
fastfetch (2.19.0) jammy; urgency=medium
* Update to 2.19.0
-- Carter Li <zhangsongcui@live.cn> Mon, 22 Jul 2024 14:17:55 +0800
fastfetch (2.18.1) jammy; urgency=medium
* Update to 2.18.1
+1 -1
View File
@@ -1 +1 @@
fastfetch_2.18.1_source.buildinfo universe/utils optional
fastfetch_2.19.1_source.buildinfo universe/utils optional
+186 -65
View File
@@ -22,6 +22,10 @@
"minimum": 0,
"default": 0
},
"keyIcon": {
"description": "Set the icon to be displayed by `display.keyType: \"icon\"`",
"type": "string"
},
"format": {
"description": "Output format of the module. See `-h <module>-format` for detail. I.e: fastfetch -h disk-format",
"type": "string"
@@ -418,11 +422,35 @@
"type": "boolean",
"default": true
},
"keyWidth": {
"description": "Align the width of keys to number of characters, 0 to disable",
"type": "integer",
"minimum": 0,
"default": 0
"key": {
"type": "object",
"additionalProperties": false,
"description": "Set how module keys should be displayed",
"properties": {
"width": {
"description": "Align the width of keys to number of characters, 0 to disable",
"type": "integer",
"minimum": 0,
"default": 0
},
"type": {
"type": "string",
"description": "Set whether to show icon before string keys",
"enum": [
"none",
"string",
"icon",
"both"
],
"default": "string"
},
"paddingLeft": {
"type": "integer",
"description": "Set the left padding of keys",
"minimum": 0,
"default": 0
}
}
},
"size": {
"type": "object",
@@ -961,12 +989,15 @@
"keyColor": {
"$ref": "#/$defs/keyColor"
},
"outputColor": {
"$ref": "#/$defs/outputColor"
"keyIcon": {
"$ref": "#/$defs/keyIcon"
},
"keyWidth": {
"$ref": "#/$defs/keyWidth"
},
"outputColor": {
"$ref": "#/$defs/outputColor"
},
"format": {
"$ref": "#/$defs/format"
}
@@ -998,12 +1029,15 @@
"keyColor": {
"$ref": "#/$defs/keyColor"
},
"outputColor": {
"$ref": "#/$defs/outputColor"
"keyIcon": {
"$ref": "#/$defs/keyIcon"
},
"keyWidth": {
"$ref": "#/$defs/keyWidth"
},
"outputColor": {
"$ref": "#/$defs/outputColor"
},
"format": {
"$ref": "#/$defs/format"
}
@@ -1032,12 +1066,15 @@
"keyColor": {
"$ref": "#/$defs/keyColor"
},
"outputColor": {
"$ref": "#/$defs/outputColor"
"keyIcon": {
"$ref": "#/$defs/keyIcon"
},
"keyWidth": {
"$ref": "#/$defs/keyWidth"
},
"outputColor": {
"$ref": "#/$defs/outputColor"
},
"format": {
"$ref": "#/$defs/format"
}
@@ -1068,12 +1105,15 @@
"keyColor": {
"$ref": "#/$defs/keyColor"
},
"outputColor": {
"$ref": "#/$defs/outputColor"
"keyIcon": {
"$ref": "#/$defs/keyIcon"
},
"keyWidth": {
"$ref": "#/$defs/keyWidth"
},
"outputColor": {
"$ref": "#/$defs/outputColor"
},
"format": {
"$ref": "#/$defs/format"
}
@@ -1094,12 +1134,15 @@
"keyColor": {
"$ref": "#/$defs/keyColor"
},
"outputColor": {
"$ref": "#/$defs/outputColor"
"keyIcon": {
"$ref": "#/$defs/keyIcon"
},
"keyWidth": {
"$ref": "#/$defs/keyWidth"
},
"outputColor": {
"$ref": "#/$defs/outputColor"
},
"format": {
"$ref": "#/$defs/format"
}
@@ -1128,12 +1171,15 @@
"keyColor": {
"$ref": "#/$defs/keyColor"
},
"outputColor": {
"$ref": "#/$defs/outputColor"
"keyIcon": {
"$ref": "#/$defs/keyIcon"
},
"keyWidth": {
"$ref": "#/$defs/keyWidth"
},
"outputColor": {
"$ref": "#/$defs/outputColor"
},
"format": {
"$ref": "#/$defs/format"
}
@@ -1162,12 +1208,15 @@
"keyColor": {
"$ref": "#/$defs/keyColor"
},
"outputColor": {
"$ref": "#/$defs/outputColor"
"keyIcon": {
"$ref": "#/$defs/keyIcon"
},
"keyWidth": {
"$ref": "#/$defs/keyWidth"
},
"outputColor": {
"$ref": "#/$defs/outputColor"
},
"format": {
"$ref": "#/$defs/format"
}
@@ -1228,6 +1277,9 @@
},
"key": {
"$ref": "#/$defs/key"
},
"keyIcon": {
"$ref": "#/$defs/keyIcon"
}
}
},
@@ -1254,12 +1306,15 @@
"keyColor": {
"$ref": "#/$defs/keyColor"
},
"outputColor": {
"$ref": "#/$defs/outputColor"
"keyIcon": {
"$ref": "#/$defs/keyIcon"
},
"keyWidth": {
"$ref": "#/$defs/keyWidth"
},
"outputColor": {
"$ref": "#/$defs/outputColor"
},
"format": {
"$ref": "#/$defs/format"
}
@@ -1281,12 +1336,15 @@
"keyColor": {
"$ref": "#/$defs/keyColor"
},
"outputColor": {
"$ref": "#/$defs/outputColor"
"keyIcon": {
"$ref": "#/$defs/keyIcon"
},
"keyWidth": {
"$ref": "#/$defs/keyWidth"
},
"outputColor": {
"$ref": "#/$defs/outputColor"
},
"format": {
"description": "Text to print",
"type": "string"
@@ -1333,12 +1391,15 @@
"keyColor": {
"$ref": "#/$defs/keyColor"
},
"outputColor": {
"$ref": "#/$defs/outputColor"
"keyIcon": {
"$ref": "#/$defs/keyIcon"
},
"keyWidth": {
"$ref": "#/$defs/keyWidth"
},
"outputColor": {
"$ref": "#/$defs/outputColor"
},
"format": {
"$ref": "#/$defs/format"
}
@@ -1396,12 +1457,15 @@
"keyColor": {
"$ref": "#/$defs/keyColor"
},
"outputColor": {
"$ref": "#/$defs/outputColor"
"keyIcon": {
"$ref": "#/$defs/keyIcon"
},
"keyWidth": {
"$ref": "#/$defs/keyWidth"
},
"outputColor": {
"$ref": "#/$defs/outputColor"
},
"format": {
"$ref": "#/$defs/format"
}
@@ -1431,12 +1495,15 @@
"keyColor": {
"$ref": "#/$defs/keyColor"
},
"outputColor": {
"$ref": "#/$defs/outputColor"
"keyIcon": {
"$ref": "#/$defs/keyIcon"
},
"keyWidth": {
"$ref": "#/$defs/keyWidth"
},
"outputColor": {
"$ref": "#/$defs/outputColor"
},
"format": {
"$ref": "#/$defs/format"
}
@@ -1462,12 +1529,15 @@
"keyColor": {
"$ref": "#/$defs/keyColor"
},
"outputColor": {
"$ref": "#/$defs/outputColor"
"keyIcon": {
"$ref": "#/$defs/keyIcon"
},
"keyWidth": {
"$ref": "#/$defs/keyWidth"
},
"outputColor": {
"$ref": "#/$defs/outputColor"
},
"format": {
"$ref": "#/$defs/format"
}
@@ -1497,12 +1567,15 @@
"keyColor": {
"$ref": "#/$defs/keyColor"
},
"outputColor": {
"$ref": "#/$defs/outputColor"
"keyIcon": {
"$ref": "#/$defs/keyIcon"
},
"keyWidth": {
"$ref": "#/$defs/keyWidth"
},
"outputColor": {
"$ref": "#/$defs/outputColor"
},
"format": {
"$ref": "#/$defs/format"
}
@@ -1526,12 +1599,15 @@
"keyColor": {
"$ref": "#/$defs/keyColor"
},
"outputColor": {
"$ref": "#/$defs/outputColor"
"keyIcon": {
"$ref": "#/$defs/keyIcon"
},
"keyWidth": {
"$ref": "#/$defs/keyWidth"
},
"outputColor": {
"$ref": "#/$defs/outputColor"
},
"format": {
"$ref": "#/$defs/format"
}
@@ -1581,12 +1657,15 @@
"keyColor": {
"$ref": "#/$defs/keyColor"
},
"outputColor": {
"$ref": "#/$defs/outputColor"
"keyIcon": {
"$ref": "#/$defs/keyIcon"
},
"keyWidth": {
"$ref": "#/$defs/keyWidth"
},
"outputColor": {
"$ref": "#/$defs/outputColor"
},
"format": {
"$ref": "#/$defs/format"
}
@@ -1651,12 +1730,15 @@
"keyColor": {
"$ref": "#/$defs/keyColor"
},
"outputColor": {
"$ref": "#/$defs/outputColor"
"keyIcon": {
"$ref": "#/$defs/keyIcon"
},
"keyWidth": {
"$ref": "#/$defs/keyWidth"
},
"outputColor": {
"$ref": "#/$defs/outputColor"
},
"format": {
"$ref": "#/$defs/format"
}
@@ -1680,12 +1762,15 @@
"keyColor": {
"$ref": "#/$defs/keyColor"
},
"outputColor": {
"$ref": "#/$defs/outputColor"
"keyIcon": {
"$ref": "#/$defs/keyIcon"
},
"keyWidth": {
"$ref": "#/$defs/keyWidth"
},
"outputColor": {
"$ref": "#/$defs/outputColor"
},
"format": {
"$ref": "#/$defs/format"
}
@@ -1721,12 +1806,15 @@
"keyColor": {
"$ref": "#/$defs/keyColor"
},
"outputColor": {
"$ref": "#/$defs/outputColor"
"keyIcon": {
"$ref": "#/$defs/keyIcon"
},
"keyWidth": {
"$ref": "#/$defs/keyWidth"
},
"outputColor": {
"$ref": "#/$defs/outputColor"
},
"format": {
"$ref": "#/$defs/format"
}
@@ -1761,12 +1849,15 @@
"keyColor": {
"$ref": "#/$defs/keyColor"
},
"outputColor": {
"$ref": "#/$defs/outputColor"
"keyIcon": {
"$ref": "#/$defs/keyIcon"
},
"keyWidth": {
"$ref": "#/$defs/keyWidth"
},
"outputColor": {
"$ref": "#/$defs/outputColor"
},
"format": {
"$ref": "#/$defs/format"
}
@@ -1797,12 +1888,15 @@
"keyColor": {
"$ref": "#/$defs/keyColor"
},
"outputColor": {
"$ref": "#/$defs/outputColor"
"keyIcon": {
"$ref": "#/$defs/keyIcon"
},
"keyWidth": {
"$ref": "#/$defs/keyWidth"
},
"outputColor": {
"$ref": "#/$defs/outputColor"
},
"format": {
"$ref": "#/$defs/format"
}
@@ -1858,12 +1952,15 @@
"keyColor": {
"$ref": "#/$defs/keyColor"
},
"outputColor": {
"$ref": "#/$defs/outputColor"
"keyIcon": {
"$ref": "#/$defs/keyIcon"
},
"keyWidth": {
"$ref": "#/$defs/keyWidth"
},
"outputColor": {
"$ref": "#/$defs/outputColor"
},
"format": {
"$ref": "#/$defs/format"
}
@@ -1891,12 +1988,15 @@
"keyColor": {
"$ref": "#/$defs/keyColor"
},
"outputColor": {
"$ref": "#/$defs/outputColor"
"keyIcon": {
"$ref": "#/$defs/keyIcon"
},
"keyWidth": {
"$ref": "#/$defs/keyWidth"
},
"outputColor": {
"$ref": "#/$defs/outputColor"
},
"format": {
"$ref": "#/$defs/format"
}
@@ -1934,12 +2034,15 @@
"keyColor": {
"$ref": "#/$defs/keyColor"
},
"outputColor": {
"$ref": "#/$defs/outputColor"
"keyIcon": {
"$ref": "#/$defs/keyIcon"
},
"keyWidth": {
"$ref": "#/$defs/keyWidth"
},
"outputColor": {
"$ref": "#/$defs/outputColor"
},
"format": {
"$ref": "#/$defs/format"
}
@@ -1999,12 +2102,15 @@
"keyColor": {
"$ref": "#/$defs/keyColor"
},
"outputColor": {
"$ref": "#/$defs/outputColor"
"keyIcon": {
"$ref": "#/$defs/keyIcon"
},
"keyWidth": {
"$ref": "#/$defs/keyWidth"
},
"outputColor": {
"$ref": "#/$defs/outputColor"
},
"format": {
"$ref": "#/$defs/format"
}
@@ -2028,12 +2134,15 @@
"keyColor": {
"$ref": "#/$defs/keyColor"
},
"outputColor": {
"$ref": "#/$defs/outputColor"
"keyIcon": {
"$ref": "#/$defs/keyIcon"
},
"keyWidth": {
"$ref": "#/$defs/keyWidth"
},
"outputColor": {
"$ref": "#/$defs/outputColor"
},
"format": {
"$ref": "#/$defs/format"
}
@@ -2078,12 +2187,15 @@
"keyColor": {
"$ref": "#/$defs/keyColor"
},
"outputColor": {
"$ref": "#/$defs/outputColor"
"keyIcon": {
"$ref": "#/$defs/keyIcon"
},
"keyWidth": {
"$ref": "#/$defs/keyWidth"
},
"outputColor": {
"$ref": "#/$defs/outputColor"
},
"format": {
"$ref": "#/$defs/format"
}
@@ -2114,12 +2226,15 @@
"keyColor": {
"$ref": "#/$defs/keyColor"
},
"outputColor": {
"$ref": "#/$defs/outputColor"
"keyIcon": {
"$ref": "#/$defs/keyIcon"
},
"keyWidth": {
"$ref": "#/$defs/keyWidth"
},
"outputColor": {
"$ref": "#/$defs/outputColor"
},
"format": {
"$ref": "#/$defs/format"
}
@@ -2155,12 +2270,15 @@
"keyColor": {
"$ref": "#/$defs/keyColor"
},
"outputColor": {
"$ref": "#/$defs/outputColor"
"keyIcon": {
"$ref": "#/$defs/keyIcon"
},
"keyWidth": {
"$ref": "#/$defs/keyWidth"
},
"outputColor": {
"$ref": "#/$defs/outputColor"
},
"format": {
"$ref": "#/$defs/format"
}
@@ -2186,12 +2304,15 @@
"keyColor": {
"$ref": "#/$defs/keyColor"
},
"outputColor": {
"$ref": "#/$defs/outputColor"
"keyIcon": {
"$ref": "#/$defs/keyIcon"
},
"keyWidth": {
"$ref": "#/$defs/keyWidth"
},
"outputColor": {
"$ref": "#/$defs/outputColor"
},
"format": {
"$ref": "#/$defs/format"
}
+9 -12
View File
@@ -4,12 +4,12 @@
{
"type": "title",
"key": "User",
"format": "{1}"
"format": "{user-name}"
},
{
"type": "title",
"key": "Hostname",
"format": "{2}"
"format": "{host-name}"
},
{
"type": "host",
@@ -17,7 +17,7 @@
},
{
"type": "os",
"format": "{3} {9} {12}"
"format": "{pretty-name} {version-id} {arch}"
},
"kernel",
"uptime",
@@ -34,32 +34,29 @@
"type": "de",
"key": "Desktop Environment"
},
{
"type": "shell",
"format": "{7}"
},
"shell",
{
"type": "terminal",
"format": "{5} {6} {#37}█{#97}█ {#36}█{#96}█ {#35}█{#95}█ {#34}█{#94}█ {#33}█{#93}█ {#32}█{#92}█ {#31}█{#91}█ {#30}█{#90}█"
"format": "{pretty-name} {version} {#37}█{#97}█ {#36}█{#96}█ {#35}█{#95}█ {#34}█{#94}█ {#33}█{#93}█ {#32}█{#92}█ {#31}█{#91}█ {#30}█{#90}█"
},
{
"type": "packages",
"format": "{1}"
"format": "{all}"
},
{
"type": "cpu",
"key": "Temperature",
"temp": true,
"format": "{8}"
"format": "{temperature}"
},
{
"type": "cpu",
"key": "CPU",
"format": "{4} x {1}"
"format": "{cores-logical} x {name}"
},
{
"type": "gpu",
"format": "{2}"
"format": "{name}"
},
{
"type": "memory",
-42
View File
@@ -1,42 +0,0 @@
{
"$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json",
"logo": {
"type": "builtin",
"source": "arch"
},
"modules": [
"title",
"separator",
{
"type": "os",
"format": "Arch Linux ({12})"
},
"host",
"kernel",
"uptime",
{
"type": "packages",
"format": "{} (pacman)"
},
"shell",
"display",
"de",
"wm",
"wmtheme",
"theme",
"icons",
"font",
"cursor",
"terminal",
"terminalfont",
"cpu",
"gpu",
"memory",
"disk",
"battery",
"poweradapter",
"locale",
"break",
"colors"
]
}
+1 -1
View File
@@ -40,7 +40,7 @@
},
{
"type": "os",
"key": " OS",
"key": "{icon} OS",
"keyColor": "yellow"
},
{
+22 -18
View File
@@ -6,16 +6,20 @@
"display": {
"separator": "-> ",
"color": {
"separator": "1"
"separator": "1" // Bold
},
"constants": [
"─────────────────────────────"
]
"───────────────────────────"
],
"key": {
"type": "both",
"paddingLeft": 4
}
},
"modules": [
{
"type": "title",
"format": " {6}{7}{8}"
"format": " {user-name-colored}{at-symbol-colored}{host-name-colored}"
},
"break",
{
@@ -24,74 +28,74 @@
},
"break",
{
"key": "OS ",
"key": "OS ",
"keyColor": "red",
"type": "os"
},
{
"key": " 󰌢 Machine ",
"key": "Machine ",
"keyColor": "green",
"type": "host"
},
{
"key": "Kernel ",
"key": "Kernel ",
"keyColor": "magenta",
"type": "kernel"
},
{
"key": " 󰅐 Uptime ",
"key": "Uptime ",
"keyColor": "red",
"type": "uptime"
},
{
"key": " 󰍹 Resolution ",
"key": "Resolution ",
"keyColor": "yellow",
"type": "display",
"compactType": "original-with-refresh-rate"
},
{
"key": "WM ",
"key": "WM ",
"keyColor": "blue",
"type": "wm"
},
{
"key": "DE ",
"key": "DE ",
"keyColor": "green",
"type": "de"
},
{
"key": "Shell ",
"key": "Shell ",
"keyColor": "cyan",
"type": "shell"
},
{
"key": "Terminal ",
"key": "Terminal ",
"keyColor": "red",
"type": "terminal"
},
{
"key": " 󰻠 CPU ",
"key": "CPU ",
"keyColor": "yellow",
"type": "cpu"
},
{
"key": " 󰍛 GPU ",
"key": "GPU ",
"keyColor": "blue",
"type": "gpu"
},
{
"key": " 󰑭 Memory ",
"key": "Memory ",
"keyColor": "magenta",
"type": "memory"
},
{
"key": " 󰩟 Local IP ",
"key": "Local IP ",
"keyColor": "red",
"type": "localip",
"compact": true
},
{
"key": " 󰩠 Public IP ",
"key": "Public IP ",
"keyColor": "cyan",
"type": "publicip"
},
+5 -6
View File
@@ -8,8 +8,7 @@
}
},
"display": {
"separator": "",
"keyWidth": 15
"separator": " "
},
"modules": [
{
@@ -19,19 +18,19 @@
{
"key": "│ {#31} user {#keys}│",
"type": "title",
"format": "{1}"
"format": "{user-name}"
},
{
"key": "│ {#32}󰇅 hname {#keys}│",
"type": "title",
"format": "{2}"
"format": "{host-name}"
},
{
"key": "│ {#33}󰅐 uptime {#keys}│",
"type": "uptime"
},
{
"key": "│ {#34}󰟾 distro {#keys}│",
"key": "│ {#34}{icon} distro {#keys}│",
"type": "os"
},
{
@@ -67,7 +66,7 @@
{
"key": "│ {#36}󰩟 network {#keys}│",
"type": "localip",
"format": "{1} ({4})"
"format": "{ipv4} ({ifname})"
},
{
"key": "├───────────┤",
+7 -5
View File
@@ -6,20 +6,22 @@
},
"display": {
"separator": "",
"keyWidth": 12
"key": {
"width": 15
}
},
"modules": [
{
// draw borders first to make colors of left and right border consistant
"key": " user",
"type": "title",
"format": "{1}",
"format": "{user-name}",
"keyColor": "31"
},
{
"key": "󰇅 hname",
"type": "title",
"format": "{2}",
"format": "{host-name}",
"keyColor": "32"
},
@@ -29,7 +31,7 @@
"keyColor": "33"
},
{
"key": "󰟾 distro",
"key": "{icon} distro",
"type": "os",
"keyColor": "34"
},
@@ -73,7 +75,7 @@
{
"key": "󰩟 network",
"type": "localip",
"format": "{1} ({4})",
"format": "{ipv4} ({ifname})",
"keyColor": "36"
},
{
+5 -6
View File
@@ -8,8 +8,7 @@
}
},
"display": {
"separator": "",
"keyWidth": 15
"separator": " "
},
"modules": [
{
@@ -19,19 +18,19 @@
{
"key": "• {#31} user {#keys}•",
"type": "title",
"format": "{1}"
"format": "{user-name}"
},
{
"key": "• {#32}󰇅 hname {#keys}•",
"type": "title",
"format": "{2}"
"format": "{host-name}"
},
{
"key": "• {#33}󰅐 uptime {#keys}•",
"type": "uptime"
},
{
"key": "• {#34}󰟾 distro {#keys}•",
"key": "• {#34}{icon} distro {#keys}•",
"type": "os"
},
{
@@ -67,7 +66,7 @@
{
"key": "• {#36}󰩟 network {#keys}•",
"type": "localip",
"format": "{1} ({4})"
"format": "{ipv4} ({ifname})"
},
{
"key": "•••••••••••••",
+4 -4
View File
@@ -18,19 +18,19 @@
{
"key": "║ {#31} user {#keys}║",
"type": "title",
"format": "{1}"
"format": "{user-name}"
},
{
"key": "║ {#32}󰇅 hname {#keys}║",
"type": "title",
"format": "{2}"
"format": "{host-name}"
},
{
"key": "║ {#33}󰅐 uptime {#keys}║",
"type": "uptime"
},
{
"key": "║ {#34}󰟾 distro {#keys}║",
"key": "║ {#34}{icon} distro {#keys}║",
"type": "os"
},
{
@@ -66,7 +66,7 @@
{
"key": "║ {#36}󰩟 network {#keys}║",
"type": "localip",
"format": "{1} ({4})"
"format": "{ipv4} ({ifname})"
},
{
"key": "╠═══════════╣",
+3 -3
View File
@@ -19,7 +19,7 @@
},
"modules": [
{
"format": "{#1}{#keys}╭{$1}╮\u001b[76D {6}{7}{8} 🖥 ",
"format": "{#1}{#keys}╭{$1}╮\u001b[76D {user-name-colored}{at-symbol-colored}{host-name-colored} 🖥 ",
"type": "title"
},
{
@@ -31,7 +31,7 @@
"type": "uptime"
},
{
"key": "{$2}{#33}󰟾 distro ",
"key": "{$2}{#33}{icon} distro ",
"type": "os"
},
{
@@ -68,7 +68,7 @@
{
"key": "{$2}{#31}󰩟 network ",
"type": "localip",
"format": "{1} ({4})"
"format": "{ipv4} ({ifname})"
},
{
"format": "{#1}{#keys}├{$1}┤",
+3 -3
View File
@@ -19,7 +19,7 @@
},
"modules": [
{
"format": "{#1}{#keys}╔{$1}╗\u001b[76D {6}{7}{8} 💻 ",
"format": "{#1}{#keys}╔{$1}╗\u001b[76D {user-name-colored}{at-symbol-colored}{host-name-colored} 💻 ",
"type": "title"
},
{
@@ -31,7 +31,7 @@
"type": "uptime"
},
{
"key": "{$2}{#33}󰟾 distro ",
"key": "{$2}{#33}{icon} distro ",
"type": "os"
},
{
@@ -68,7 +68,7 @@
{
"key": "{$2}{#31}󰩟 network ",
"type": "localip",
"format": "{1} ({4})"
"format": "{ipv4} ({ifname})"
},
{
"format": "{#1}{#keys}╠{$1}╣",
+39 -124
View File
@@ -12,8 +12,12 @@
"display": {
"separator": "  ",
"constants": [
"───────────────"
]
"─────────────────" // {$1}, used in Custom module
],
"key": {
"type": "icon",
"paddingLeft": 2
}
},
"modules": [
{
@@ -21,142 +25,53 @@
// {#1} is equivalent to `\u001b[1m`. {#} is equivalent to `\u001b[m`
"format": "┌{$1} {#1}Hardware Information{#} {$1}┐"
},
{
"type": "host",
"key": " 󰌢"
},
{
"type": "cpu",
"key": " 󰻠"
},
{
"type": "gpu",
"key": " 󰍛"
},
{
"type": "disk",
"key": " "
},
{
"type": "memory",
"key": " 󰑭"
},
{
"type": "swap",
"key": " 󰓡"
},
{
"type": "display",
"key": " 󰍹"
},
{
"type": "brightness",
"key": " 󰃞"
},
{
"type": "battery",
"key": " "
},
{
"type": "poweradapter",
"key": " "
},
{
"type": "bluetooth",
"key": " "
},
{
"type": "sound",
"key": " "
},
{
"type": "gamepad",
"key": " "
},
"host",
"cpu",
"gpu",
"disk",
"memory",
"swap",
"display",
"brightness",
"battery",
"poweradapter",
"bluetooth",
"sound",
"gamepad",
{
"type": "custom", // SoftwareStart
"format": "├{$1} {#1}Software Information{#} {$1}┤"
},
{
"type": "title",
"key": " ",
"format": "{1}${2}"
},
{
"type": "os",
"key": " " // Just get your distro's logo off nerdfonts.com
},
{
"type": "kernel",
"key": " ",
"format": "{1} {2}"
},
{
"type": "lm",
"key": " 󰧨"
},
{
"type": "de",
"key": " "
},
{
"type": "wm",
"key": " "
},
{
"type": "shell",
"key": " "
},
{
"type": "terminal",
"key": " "
},
{
"type": "terminalfont",
"key": " "
},
{
"type": "theme",
"key": " 󰉼"
},
{
"type": "icons",
"key": " 󰀻"
},
{
"type": "wallpaper",
"key": " 󰸉"
},
{
"type": "packages",
"key": " 󰏖"
},
{
"type": "uptime",
"key": " 󰅐"
},
{
"type": "media",
"key": " 󰝚"
"keyIcon": "",
"key": "Title", // Title module has no key by default, so that icon is not displayed
"format": "{user-name}@{host-name}"
},
"os",
"kernel",
"lm",
"de",
"wm",
"shell",
"terminal",
"terminalfont",
"theme",
"icons",
"wallpaper",
"packages",
"uptime",
"media",
{
"type": "localip",
"key": " 󰩟",
"compact": true
},
{
"type": "publicip",
"key": " 󰩠"
},
"publicip",
{
"type": "wifi",
"key": " ",
"format": "{4}" // ssid
},
{
"type": "locale",
"key": " "
"format": "{ssid}"
},
"locale",
{
"type": "custom", // InformationEnd
"format": "└{$1}──────────────────────{$1}┘"
+3 -1
View File
@@ -4,7 +4,9 @@
"logo": null,
"display": {
"pipe": true,
"keyWidth": 16,
"key": {
"width": 16
},
"separator": "│ ",
"percent": {
"type": 6
+1
View File
@@ -1,3 +1,4 @@
// Designed for Arch Linux
// Modified from: https://github.com/fastfetch-cli/fastfetch/pull/1025#issuecomment-2177566138
{
"$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json",
+3 -4
View File
@@ -124,18 +124,17 @@
{
"type": "title",
"key": "╭─",
"format": "{1}@{2}",
"format": "{user-name}@{host-name}",
"keyColor": "blue"
},
{
"type": "os",
"key": "├─", // Just get your distro's logo off nerdfonts.com
"key": "├─{icon}", // Just get your distro's logo off nerdfonts.com
"keyColor": "blue"
},
{
"type": "kernel",
"key": "├─",
"format": "{1} {2}",
"keyColor": "blue"
},
{
@@ -167,7 +166,7 @@
{
"type": "wifi",
"key": "├─",
"format": "{4}", // ssid
"format": "{ssid}",
"keyColor": "blue"
},
{
+6 -7
View File
@@ -22,9 +22,8 @@
},
{
"type": "os",
"key": "├", // Just get your distro's logo off nerdfonts.com
"keyColor": "yellow",
"format": "{6}{?6} {?}{10}{?10} {?}{8}{?8} {?}{11}"
"key": "├{icon}", // Just get your distro's logo off nerdfonts.com
"keyColor": "yellow"
},
{
"type": "kernel",
@@ -106,13 +105,13 @@
"keyColor": "green"
},
{
"type": "uptime",
"key": "├󰅐",
"type": "display",
"key": "├󰍹",
"keyColor": "green"
},
{
"type": "display",
"key": "└󰍹",
"type": "uptime",
"key": "└󰅐",
"keyColor": "green"
},
+13 -24
View File
@@ -11,6 +11,9 @@
"size": {
"ndigits": 0,
"maxPrefix": "MB"
},
"key": {
"type": "icon"
}
},
"modules": [
@@ -22,31 +25,17 @@
"host": "blue"
}
},
"os",
"kernel",
"memory",
"packages",
"uptime",
{
"type": "os",
"key": "",
"format": "{2} {8}"
},
{
"type": "kernel",
"key": ""
},
{
"type": "memory",
"key": ""
},
{
"type": "packages",
"key": "󰏖"
},
{
"type": "uptime",
"key": "󰅐"
},
{
"type": "custom",
"key": "",
"format": "{#31}███{#32}███{#33}███{#34}███{#35}███{#36}███"
"type": "colors",
"key": "Colors", // For printing icon
"block": {
"range": [1, 6]
}
}
]
}
+3 -1
View File
@@ -4,7 +4,9 @@
"type": "small"
},
"display": {
"keyWidth": 11,
"key": {
"width": 11
},
"bar": {
"charElapsed": "=",
"charTotal": "-",
-37
View File
@@ -1,37 +0,0 @@
{
"$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json",
"modules": [
{
"type": "host",
"format": "{?2}{2}{?}{?5} ({5}){?}"
},
"chassis",
{
"type": "board",
"format": "{?1}{1}{?}{?2} ({2}){?}"
},
"cpu",
{
"type": "memory",
"format": "{?2}{2}{?}"
},
"physicaldisk",
"gpu",
"display",
"monitor",
{
"type": "wifi",
"format": "{?1}{1}{?}{?6} - {6}{?}"
},
{
"type": "sound",
"format": "{?2}{2}{?}"
},
"camera",
{
"type": "battery",
"format": "{?1}{1}{?}{?2} {2}{?}{?3} ({3}){?}"
},
"poweradapter"
]
}
+6 -3
View File
@@ -11,7 +11,10 @@
"separator",
"os",
"host",
"kernel",
{
"type": "kernel",
"format": "{release}"
},
"uptime",
"packages",
"shell",
@@ -28,7 +31,7 @@
"terminal",
{
"type": "terminalfont",
"format": "{/2}{-}{/}{2}{?3} {3}{?}"
"format": "{/name}{-}{/}{name}{?size} {size}{?}"
},
"cpu",
{
@@ -37,7 +40,7 @@
},
{
"type": "memory",
"format": "{/1}{-}{/}{/2}{-}{/}{} / {}"
"format": "{} / {}"
},
"break",
"colors"
-17
View File
@@ -1,17 +0,0 @@
{
"$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json",
"modules": [
"os",
"kernel",
"shell",
"de",
"wm",
"wmtheme",
"theme",
"icons",
"font",
"cursor",
"terminal",
"terminalfont"
]
}
+7
View File
@@ -37,6 +37,11 @@ bool ffJsonConfigParseModuleArgs(const char* key, yyjson_val* val, FFModuleArgs*
moduleArgs->keyWidth = (uint32_t) yyjson_get_uint(val);
return true;
}
else if(ffStrEqualsIgnCase(key, "keyIcon"))
{
ffStrbufSetS(&moduleArgs->keyIcon, yyjson_get_str(val));
return true;
}
return false;
}
@@ -50,6 +55,8 @@ void ffJsonConfigGenerateModuleArgsConfig(yyjson_mut_doc* doc, yyjson_mut_val* m
yyjson_mut_obj_add_strbuf(doc, module, "keyColor", &moduleArgs->keyColor);
if (moduleArgs->keyWidth != defaultModuleArgs->keyWidth)
yyjson_mut_obj_add_uint(doc, module, "keyWidth", moduleArgs->keyWidth);
if (!ffStrbufEqual(&defaultModuleArgs->keyIcon, &moduleArgs->keyIcon))
yyjson_mut_obj_add_strbuf(doc, module, "keyIcon", &moduleArgs->keyIcon);
}
const char* ffJsonConfigParseEnum(yyjson_val* val, int* result, FFKeyValuePair pairs[])
+20 -28
View File
@@ -50,20 +50,29 @@ bool ffOptionParseModuleArgs(const char* argumentKey, const char* subKey, const
ffOptionParseColor(value, &result->outputColor);
return true;
}
else if(ffStrEqualsIgnCase(subKey, "key-color"))
else if(ffStrStartsWithIgnCase(subKey, "key-"))
{
if(value == NULL)
const char* subKey2 = subKey + strlen("key-");
if(ffStrEqualsIgnCase(subKey2, "color"))
{
fprintf(stderr, "Error: usage: %s <str>\n", argumentKey);
exit(477);
if(value == NULL)
{
fprintf(stderr, "Error: usage: %s <str>\n", argumentKey);
exit(477);
}
ffOptionParseColor(value, &result->keyColor);
return true;
}
else if(ffStrEqualsIgnCase(subKey2, "width"))
{
result->keyWidth = ffOptionParseUInt32(argumentKey, value);
return true;
}
else if(ffStrEqualsIgnCase(subKey2, "icon"))
{
ffOptionParseString(argumentKey, value, &result->keyIcon);
return true;
}
ffOptionParseColor(value, &result->keyColor);
return true;
}
else if(ffStrEqualsIgnCase(subKey, "key-width"))
{
result->keyWidth = ffOptionParseUInt32(argumentKey, value);
return true;
}
return false;
}
@@ -205,20 +214,3 @@ void ffOptionParseColorNoClear(const char* value, FFstrbuf* buffer)
#undef FF_APPEND_COLOR_PROP_COND
}
}
void ffOptionInitModuleArg(FFModuleArgs* args)
{
ffStrbufInit(&args->key);
ffStrbufInit(&args->keyColor);
ffStrbufInit(&args->outputFormat);
ffStrbufInit(&args->outputColor);
args->keyWidth = 0;
}
void ffOptionDestroyModuleArg(FFModuleArgs* args)
{
ffStrbufDestroy(&args->key);
ffStrbufDestroy(&args->keyColor);
ffStrbufDestroy(&args->outputFormat);
ffStrbufDestroy(&args->outputColor);
}
+28 -2
View File
@@ -45,10 +45,19 @@ static inline void ffOptionInitModuleBaseInfo(
baseInfo->generateJsonConfig = (__typeof__(baseInfo->generateJsonConfig)) generateJsonConfig;
}
typedef enum FFModuleKeyType
{
FF_MODULE_KEY_TYPE_NONE = 0,
FF_MODULE_KEY_TYPE_STRING = 1 << 0,
FF_MODULE_KEY_TYPE_ICON = 1 << 1,
FF_MODULE_KEY_TYPE_BOTH = FF_MODULE_KEY_TYPE_STRING | FF_MODULE_KEY_TYPE_ICON,
} FFModuleKeyType;
typedef struct FFModuleArgs
{
FFstrbuf key;
FFstrbuf keyColor;
FFstrbuf keyIcon;
FFstrbuf outputFormat;
FFstrbuf outputColor;
uint32_t keyWidth;
@@ -73,5 +82,22 @@ static inline void ffOptionParseColor(const char* value, FFstrbuf* buffer)
ffStrbufClear(buffer);
ffOptionParseColorNoClear(value, buffer);
}
void ffOptionInitModuleArg(FFModuleArgs* args);
void ffOptionDestroyModuleArg(FFModuleArgs* args);
static inline void ffOptionInitModuleArg(FFModuleArgs* args, const char* icon)
{
ffStrbufInit(&args->key);
ffStrbufInit(&args->keyColor);
ffStrbufInitStatic(&args->keyIcon, icon);
ffStrbufInit(&args->outputFormat);
ffStrbufInit(&args->outputColor);
args->keyWidth = 0;
}
static inline void ffOptionDestroyModuleArg(FFModuleArgs* args)
{
ffStrbufDestroy(&args->key);
ffStrbufDestroy(&args->keyColor);
ffStrbufDestroy(&args->keyIcon);
ffStrbufDestroy(&args->outputFormat);
ffStrbufDestroy(&args->outputColor);
}
+29 -13
View File
@@ -11,8 +11,10 @@ void ffPrintLogoAndKey(const char* moduleName, uint8_t moduleIndex, const FFModu
return;
//This is used as a magic value for hiding keys
if (!(moduleArgs && ffStrbufEqualS(&moduleArgs->key, " ")))
if (!(moduleArgs && ffStrbufEqualS(&moduleArgs->key, " ")) && instance.config.display.keyType != FF_MODULE_KEY_TYPE_NONE)
{
ffPrintCharTimes(' ', instance.config.display.keyPaddingLeft);
if(!instance.config.display.pipe)
{
fputs(FASTFETCH_TEXT_MODIFIER_RESET, stdout);
@@ -25,21 +27,35 @@ void ffPrintLogoAndKey(const char* moduleName, uint8_t moduleIndex, const FFModu
ffPrintColor(&instance.config.display.colorKeys);
}
//NULL check is required for modules with custom keys, e.g. disk with the folder path
if((printType & FF_PRINT_TYPE_NO_CUSTOM_KEY) || !moduleArgs || moduleArgs->key.length == 0)
bool hasIcon = false;
if (instance.config.display.keyType & FF_MODULE_KEY_TYPE_ICON && moduleArgs && moduleArgs->keyIcon.length > 0)
{
fputs(moduleName, stdout);
if(moduleIndex > 0)
printf(" %hhu", moduleIndex);
ffStrbufWriteTo(&moduleArgs->keyIcon, stdout);
hasIcon = true;
}
else
if (instance.config.display.keyType & FF_MODULE_KEY_TYPE_STRING)
{
FF_STRBUF_AUTO_DESTROY key = ffStrbufCreate();
FF_PARSE_FORMAT_STRING_CHECKED(&key, &moduleArgs->key, 1, ((FFformatarg[]){
{FF_FORMAT_ARG_TYPE_UINT8, &moduleIndex, "index"},
}));
ffStrbufWriteTo(&key, stdout);
if(hasIcon)
putchar(' ');
//NULL check is required for modules with custom keys, e.g. disk with the folder path
if((printType & FF_PRINT_TYPE_NO_CUSTOM_KEY) || !moduleArgs || moduleArgs->key.length == 0)
{
fputs(moduleName, stdout);
if(moduleIndex > 0)
printf(" %hhu", moduleIndex);
}
else
{
FF_STRBUF_AUTO_DESTROY key = ffStrbufCreate();
FF_PARSE_FORMAT_STRING_CHECKED(&key, &moduleArgs->key, 2, ((FFformatarg[]){
{FF_FORMAT_ARG_TYPE_UINT8, &moduleIndex, "index"},
{FF_FORMAT_ARG_TYPE_STRBUF, &moduleArgs->keyIcon, "icon"},
}));
ffStrbufWriteTo(&key, stdout);
}
}
if(!instance.config.display.pipe)
+29
View File
@@ -505,6 +505,27 @@
"type": "num"
}
},
{
"long": "key-padding-left",
"desc": "Set the left padding of keys to <num> characters",
"arg": {
"type": "num"
}
},
{
"long": "key-type",
"desc": "Set whether to show icon before string keys",
"arg": {
"type": "enum",
"enum": {
"none": "Disable keys",
"string": "Show string",
"icon": "Show icon (requires newest nerd font)",
"both": "Show both icon and string"
},
"default": "string"
}
},
{
"long": "bright-color",
"desc": "Set if the keys, title and ASCII logo should be printed in bright color",
@@ -1637,6 +1658,14 @@
},
"pseudo": true
},
{
"long": "<module>-key-icon",
"desc": "Set the icon to be displayed by \"--key-type icon\"",
"arg": {
"type": "string"
},
"pseudo": true
},
{
"long": "<module>-output-color",
"desc": "Override the global \"--color-output\" option for each specific module",
+1 -1
View File
@@ -44,7 +44,7 @@ static const char* detectFrequency(FFCPUResult* cpu)
return "\"pmgr\" should conform to \"AppleARMIODevice\"";
FF_CFTYPE_AUTO_RELEASE CFDataRef freqProperty = (CFDataRef) IORegistryEntryCreateCFProperty(entryDevice, CFSTR("voltage-states5-sram"), kCFAllocatorDefault, kNilOptions);
if (CFGetTypeID(freqProperty) != CFDataGetTypeID())
if (!freqProperty || CFGetTypeID(freqProperty) != CFDataGetTypeID())
return "\"voltage-states5-sram\" in \"pmgr\" is not found";
// voltage-states5-sram stores supported <frequency / voltage> pairs of pcores from the lowest to the highest
+46 -2
View File
@@ -13,18 +13,62 @@
#ifdef __ANDROID__
#include "common/settings.h"
static void detectQualcomm(FFCPUResult* cpu)
{
if (ffStrbufEqualS(&cpu->name, "SM8635"))
ffStrbufSetStatic(&cpu->name, "Qualcomm Snapdragon 8s Gen 3 [SM8635]");
else if (ffStrbufEqualS(&cpu->name, "SM8650-AC"))
ffStrbufSetStatic(&cpu->name, "Qualcomm Snapdragon 8 Gen 3 for Galaxy [SM8650-AC]");
else if (ffStrbufEqualS(&cpu->name, "SM8650"))
ffStrbufSetStatic(&cpu->name, "Qualcomm Snapdragon 8 Gen 3 [SM8650]");
else if (ffStrbufEqualS(&cpu->name, "SM8550-AC"))
ffStrbufSetStatic(&cpu->name, "Qualcomm Snapdragon 8 Gen 2 for Galaxy [SM8550-AC]");
else if (ffStrbufEqualS(&cpu->name, "SM8550"))
ffStrbufSetStatic(&cpu->name, "Qualcomm Snapdragon 8 Gen 2 [SM8550]");
else if (ffStrbufEqualS(&cpu->name, "SM8475"))
ffStrbufSetStatic(&cpu->name, "Qualcomm Snapdragon 8+ Gen 1 [SM8475]");
else if (ffStrbufEqualS(&cpu->name, "SM8450"))
ffStrbufSetStatic(&cpu->name, "Qualcomm Snapdragon 8 Gen 1 [SM8450]");
else if (ffStrbufEqualS(&cpu->name, "SM7675"))
ffStrbufSetStatic(&cpu->name, "Qualcomm Snapdragon 7+ Gen 3 [SM7675]");
else if (ffStrbufEqualS(&cpu->name, "SM7550"))
ffStrbufSetStatic(&cpu->name, "Qualcomm Snapdragon 7 Gen 3 [SM7550]");
else if (ffStrbufEqualS(&cpu->name, "SM7475"))
ffStrbufSetStatic(&cpu->name, "Qualcomm Snapdragon 7+ Gen 2 [SM7550]");
else if (ffStrbufEqualS(&cpu->name, "SM7435"))
ffStrbufSetStatic(&cpu->name, "Qualcomm Snapdragon 7s Gen 2 [SM7435]");
else if (ffStrbufEqualS(&cpu->name, "SM7450"))
ffStrbufSetStatic(&cpu->name, "Qualcomm Snapdragon 7 Gen 1 [SM7450]");
else if (ffStrbufEqualS(&cpu->name, "SM6375-AC"))
ffStrbufSetStatic(&cpu->name, "Qualcomm Snapdragon 6s Gen 3 [SM6375-AC]");
else if (ffStrbufEqualS(&cpu->name, "SM6450"))
ffStrbufSetStatic(&cpu->name, "Qualcomm Snapdragon 6 Gen 1 [SM6450]");
else if (ffStrbufEqualS(&cpu->name, "SM4450"))
ffStrbufSetStatic(&cpu->name, "Qualcomm Snapdragon 4 Gen 2 [SM4450]");
else if (ffStrbufEqualS(&cpu->name, "SM4375"))
ffStrbufSetStatic(&cpu->name, "Qualcomm Snapdragon 4 Gen 1 [SM4375]");
}
static void detectAndroid(FFCPUResult* cpu)
{
if (cpu->name.length == 0)
{
ffSettingsGetAndroidProperty("ro.soc.model", &cpu->name);
ffStrbufClear(&cpu->vendor); // We usually detect the vendor of CPU core as ARM, but instead we want the vendor of SOC
if (ffSettingsGetAndroidProperty("ro.soc.model", &cpu->name))
ffStrbufClear(&cpu->vendor); // We usually detect the vendor of CPU core as ARM, but instead we want the vendor of SOC
else if(ffSettingsGetAndroidProperty("ro.mediatek.platform", &cpu->name))
ffStrbufSetStatic(&cpu->vendor, "MTK");
}
if (cpu->vendor.length == 0)
{
if (!ffSettingsGetAndroidProperty("ro.soc.manufacturer", &cpu->vendor))
ffSettingsGetAndroidProperty("ro.product.product.manufacturer", &cpu->vendor);
}
if (ffStrbufEqualS(&cpu->vendor, "QTI") && ffStrbufStartsWithS(&cpu->name, "SM"))
detectQualcomm(cpu);
}
#endif
@@ -82,25 +82,25 @@ static bool detectWithGetprop(FFDisplayServerResult* ds)
if (ffSettingsGetAndroidProperty("persist.sys.miui_resolution", &buffer) &&
ffStrbufContainC(&buffer, ','))
{
// 1440,3200,560 => width,height,ppi
// 1440,3200,560 => width,height,densityDpi
uint32_t width = (uint32_t) ffStrbufToUInt(&buffer, 0);
ffStrbufSubstrAfterFirstC(&buffer, ',');
uint32_t height = (uint32_t) ffStrbufToUInt(&buffer, 0);
ffStrbufSubstrAfterFirstC(&buffer, ',');
uint32_t ppi = (uint32_t) ffStrbufToUInt(&buffer, 0);
double scaleFactor = (double) ffStrbufToUInt(&buffer, 0) / 160.;
return ffdsAppendDisplay(ds,
width,
height,
0,
0,
0,
(uint32_t) (width / scaleFactor + .5),
(uint32_t) (height / scaleFactor + .5),
0,
0,
FF_DISPLAY_TYPE_BUILTIN,
false,
0,
(uint32_t) (width / ppi * 25.4),
(uint32_t) (height / ppi * 25.4)
0,
0
);
}
+11 -1
View File
@@ -220,6 +220,8 @@ static const char* drmConnectLibdrm(FFDisplayServerResult* result)
if (nDevices < 0)
return "drmGetDevices() failed";
FF_STRBUF_AUTO_DESTROY name = ffStrbufCreate();
for (int iDev = 0; iDev < nDevices; ++iDev)
{
drmDevice* dev = devices[iDev];
@@ -228,6 +230,13 @@ static const char* drmConnectLibdrm(FFDisplayServerResult* result)
continue;
const char* path = dev->nodes[DRM_NODE_PRIMARY];
ffStrbufSetF(&name, "/sys/class/drm/%s/device/power/runtime_status", strrchr(path, '/') + 1);
char buffer[8] = "";
if (ffReadFileData(name.chars, strlen("suspend"), buffer) > 0 && ffStrStartsWith(buffer, "suspend"))
continue;
FF_AUTO_CLOSE_FD int fd = open(path, O_RDONLY | O_CLOEXEC);
if (fd < 0)
continue;
@@ -292,7 +301,8 @@ static const char* drmConnectLibdrm(FFDisplayServerResult* result)
}
}
FF_STRBUF_AUTO_DESTROY name = ffStrbufCreate();
ffStrbufClear(&name);
for (int iProp = 0; iProp < conn->count_props; ++iProp)
{
+1 -1
View File
@@ -53,7 +53,7 @@ static const char* detectFrequency(FFGPUResult* gpu)
return "\"pmgr\" should conform to \"AppleARMIODevice\"";
FF_CFTYPE_AUTO_RELEASE CFDataRef freqProperty = (CFDataRef) IORegistryEntryCreateCFProperty(entryDevice, CFSTR("voltage-states9-sram"), kCFAllocatorDefault, kNilOptions);
if (CFGetTypeID(freqProperty) != CFDataGetTypeID())
if (!freqProperty || CFGetTypeID(freqProperty) != CFDataGetTypeID())
return "\"voltage-states9-sram\" in \"pmgr\" is not found";
// voltage-states5-sram stores supported <frequency / voltage> pairs of gpu from the lowest to the highest
+1 -2
View File
@@ -35,13 +35,12 @@ static const char* getSshdVersion(FFstrbuf* version)
{
const char* error = ffProcessAppendStdErr(version, (char* const[]) {
"sshd",
"-qv",
"-V",
NULL
});
if (error)
return error;
// unknown option -- v
// OpenSSH_9.0p1, OpenSSL 3.0.9 30 May 2023...
ffStrbufSubstrBeforeFirstC(version, ',');
ffStrbufSubstrAfterFirstC(version, '_');
@@ -18,7 +18,7 @@ static inline void wrapIoDestroyPlugInInterface(IOCFPlugInInterface*** pluginInf
if (*pluginInf)
IODestroyPlugInInterface(*pluginInf);
}
#endif
#endif
static const char* detectSsdTemp(io_service_t entryPhysical, double* temp)
{
@@ -82,10 +82,12 @@ const char* ffDetectPhysicalDisk(FFlist* result, FFPhysicalDiskOptions* options)
device->temperature = FF_PHYSICALDISK_TEMP_UNSET;
FF_CFTYPE_AUTO_RELEASE CFBooleanRef removable = IORegistryEntryCreateCFProperty(entryPartition, CFSTR(kIOMediaRemovableKey), kCFAllocatorDefault, kNilOptions);
device->type |= CFBooleanGetValue(removable) ? FF_PHYSICALDISK_TYPE_REMOVABLE : FF_PHYSICALDISK_TYPE_FIXED;
if (removable)
device->type |= CFBooleanGetValue(removable) ? FF_PHYSICALDISK_TYPE_REMOVABLE : FF_PHYSICALDISK_TYPE_FIXED;
FF_CFTYPE_AUTO_RELEASE CFBooleanRef writable = IORegistryEntryCreateCFProperty(entryPartition, CFSTR(kIOMediaWritableKey), kCFAllocatorDefault, kNilOptions);
device->type |= CFBooleanGetValue(writable) ? FF_PHYSICALDISK_TYPE_READWRITE : FF_PHYSICALDISK_TYPE_READONLY;
if (writable)
device->type |= CFBooleanGetValue(writable) ? FF_PHYSICALDISK_TYPE_READWRITE : FF_PHYSICALDISK_TYPE_READONLY;
FF_CFTYPE_AUTO_RELEASE CFStringRef bsdName = IORegistryEntryCreateCFProperty(entryPartition, CFSTR(kIOBSDNameKey), kCFAllocatorDefault, kNilOptions);
if (bsdName)
@@ -125,7 +127,7 @@ const char* ffDetectPhysicalDisk(FFlist* result, FFPhysicalDiskOptions* options)
}
}
#ifdef MAC_OS_X_VERSION_10_15
#ifdef MAC_OS_X_VERSION_10_15
if (options->temp)
{
FF_CFTYPE_AUTO_RELEASE CFBooleanRef nvmeSMARTCapable = IORegistryEntryCreateCFProperty(entryPhysical, CFSTR(kIOPropertyNVMeSMARTCapableKey), kCFAllocatorDefault, kNilOptions);
-224
View File
@@ -72,193 +72,6 @@ FF_MAYBE_UNUSED static void detectTTY(FFTerminalFontResult* terminalFont)
ffStrbufAppendS(&terminalFont->error, "Couldn't find Font in "FASTFETCH_TARGET_DIR_ETC"/vconsole.conf");
}
#if defined(_WIN32) || defined(__linux__)
#include "common/library.h"
#include <stdlib.h>
static const char* detectWTProfile(yyjson_val* profile, FFstrbuf* name, double* size)
{
yyjson_val* font = yyjson_obj_get(profile, "font");
if (!font)
return "yyjson_obj_get(profile, \"font\"); failed";
if (!yyjson_is_obj(font))
return "yyjson_is_obj(font) returns false";
if (name->length == 0)
{
yyjson_val* pface = yyjson_obj_get(font, "face");
if(yyjson_is_str(pface))
ffStrbufAppendS(name, unsafe_yyjson_get_str(pface));
}
if (*size < 0)
{
yyjson_val* psize = yyjson_obj_get(font, "size");
if (yyjson_is_num(psize))
*size = yyjson_get_num(psize);
}
return NULL;
}
static inline void wrapYyjsonFree(yyjson_doc** doc)
{
assert(doc);
if (*doc)
yyjson_doc_free(*doc);
}
static const char* detectFromWTImpl(FFstrbuf* content, FFstrbuf* name, double* size)
{
yyjson_doc* __attribute__((__cleanup__(wrapYyjsonFree))) doc = yyjson_read_opts(content->chars, content->length, YYJSON_READ_ALLOW_COMMENTS | YYJSON_READ_ALLOW_TRAILING_COMMAS | YYJSON_READ_ALLOW_INF_AND_NAN, NULL, NULL);
if (!doc)
return "Failed to parse WT JSON config file";
yyjson_val* const root = yyjson_doc_get_root(doc);
assert(root);
yyjson_val* profiles = yyjson_obj_get(root, "profiles");
if (!profiles)
return "yyjson_obj_get(root, \"profiles\") failed";
FF_STRBUF_AUTO_DESTROY wtProfileId = ffStrbufCreateS(getenv("WT_PROFILE_ID"));
ffStrbufTrim(&wtProfileId, '\'');
if (wtProfileId.length > 0)
{
yyjson_val* list = yyjson_obj_get(profiles, "list");
if (yyjson_is_arr(list))
{
yyjson_val* profile;
size_t idx, max;
yyjson_arr_foreach(list, idx, max, profile)
{
yyjson_val* guid = yyjson_obj_get(profile, "guid");
if(ffStrbufEqualS(&wtProfileId, yyjson_get_str(guid)))
{
detectWTProfile(profile, name, size);
break;
}
}
}
}
yyjson_val* defaults = yyjson_obj_get(profiles, "defaults");
if (defaults)
detectWTProfile(defaults, name, size);
if(name->length == 0)
ffStrbufSetS(name, "Cascadia Mono");
if(*size < 0)
*size = 12;
return NULL;
}
#ifdef _WIN32
#include "common/io/io.h"
#include <shlobj.h>
#endif
static void detectFromWindowsTerminal(const FFstrbuf* terminalExe, FFTerminalFontResult* terminalFont)
{
//https://learn.microsoft.com/en-us/windows/terminal/install#settings-json-file
FF_STRBUF_AUTO_DESTROY json = ffStrbufCreate();
const char* error = NULL;
#ifdef _WIN32
if(terminalExe && terminalExe->length > 0 && !ffStrbufEqualS(terminalExe, "Windows Terminal"))
{
char jsonPath[MAX_PATH + 1];
strncpy(jsonPath, terminalExe->chars, ffStrbufLastIndexC(terminalExe, '\\') + 1);
char* pathEnd = jsonPath + strlen(jsonPath);
strncpy(pathEnd, ".portable", sizeof(jsonPath) - (size_t) (pathEnd - jsonPath) - 1);
if(ffPathExists(jsonPath, FF_PATHTYPE_ANY))
{
strncpy(pathEnd, "settings\\settings.json", sizeof(jsonPath) - (size_t) (pathEnd - jsonPath) - 1);
if(!ffAppendFileBuffer(jsonPath, &json))
error = "Error reading Windows Terminal portable settings JSON file";
}
else if(SUCCEEDED(SHGetFolderPathA(NULL, CSIDL_LOCAL_APPDATA, NULL, 0, jsonPath)))
{
size_t remaining = sizeof(jsonPath) - strlen(jsonPath) - 1;
if(ffStrbufContainIgnCaseS(terminalExe, "_8wekyb3d8bbwe\\"))
{
// Microsoft Store version
if(ffStrbufContainIgnCaseS(terminalExe, ".WindowsTerminalPreview_"))
{
// Preview version
strncat(jsonPath, "\\Packages\\Microsoft.WindowsTerminalPreview_8wekyb3d8bbwe\\LocalState\\settings.json", remaining);
if(!ffAppendFileBuffer(jsonPath, &json))
error = "Error reading Windows Terminal Preview settings JSON file";
}
else
{
// Stable version
strncat(jsonPath, "\\Packages\\Microsoft.WindowsTerminal_8wekyb3d8bbwe\\LocalState\\settings.json", remaining);
if(!ffAppendFileBuffer(jsonPath, &json))
error = "Error reading Windows Terminal settings JSON file";
}
}
else
{
strncat(jsonPath, "\\Microsoft\\Windows Terminal\\settings.json", remaining);
if(!ffAppendFileBuffer(jsonPath, &json))
error = "Error reading Windows Terminal settings JSON file";
}
}
}
#else
FF_UNUSED(terminalExe);
#endif
if(!error && json.length == 0)
{
error = ffProcessAppendStdOut(&json, (char* const[]) {
"cmd.exe",
"/c",
//print the file content directly, so we don't need to handle the difference of Windows and POSIX path
"if exist %LOCALAPPDATA%\\Packages\\Microsoft.WindowsTerminal_8wekyb3d8bbwe\\LocalState\\settings.json "
"( type %LOCALAPPDATA%\\Packages\\Microsoft.WindowsTerminal_8wekyb3d8bbwe\\LocalState\\settings.json ) "
"else if exist %LOCALAPPDATA%\\Packages\\Microsoft.WindowsTerminalPreview_8wekyb3d8bbwe\\LocalState\\settings.json "
"( type %LOCALAPPDATA%\\Packages\\Microsoft.WindowsTerminalPreview_8wekyb3d8bbwe\\LocalState\\settings.json ) "
"else if exist \"%LOCALAPPDATA%\\Microsoft\\Windows Terminal\\settings.json\" "
"( type %LOCALAPPDATA%\\Microsoft\\Windows Terminal\\settings.json ) "
"else ( call )",
NULL
});
}
if(error)
{
ffStrbufAppendS(&terminalFont->error, error);
return;
}
ffStrbufTrimRight(&json, '\n');
if(json.length == 0)
{
ffStrbufAppendS(&terminalFont->error, "Cannot find file \"settings.json\"");
return;
}
FF_STRBUF_AUTO_DESTROY name = ffStrbufCreate();
double size = -1;
error = detectFromWTImpl(&json, &name, &size);
if(error)
ffStrbufAppendS(&terminalFont->error, error);
else
{
char sizeStr[16];
snprintf(sizeStr, sizeof(sizeStr), "%g", size);
ffFontInitValues(&terminalFont->font, name.chars, sizeStr);
}
}
#endif //defined(_WIN32) || defined(__linux__)
static bool queryKittyTerm(const char* query, FFstrbuf* res)
{
// https://github.com/fastfetch-cli/fastfetch/discussions/1030#discussioncomment-9845233
@@ -322,34 +135,6 @@ FF_MAYBE_UNUSED static bool detectKitty(const FFstrbuf* exe, FFTerminalFontResul
return true;
}
static void detectTerminator(FFTerminalFontResult* result)
{
FF_STRBUF_AUTO_DESTROY useSystemFont = ffStrbufCreate();
FF_STRBUF_AUTO_DESTROY fontName = ffStrbufCreate();
FFpropquery fontQuery[] = {
{"use_system_font =", &useSystemFont},
{"font =", &fontName},
};
if(!ffParsePropFileConfigValues("terminator/config", 2, fontQuery))
{
ffStrbufAppendS(&result->error, "Couldn't read Terminator config file");
return;
}
if(ffStrbufIgnCaseEqualS(&useSystemFont, "True"))
{
ffFontInitCopy(&result->font, "System");
return;
}
if(fontName.length == 0)
ffFontInitValues(&result->font, "mono", "8");
else
ffFontInitPango(&result->font, fontName.chars);
}
static bool detectWezterm(const FFstrbuf* exe, FFTerminalFontResult* result)
{
FF_STRBUF_AUTO_DESTROY cli = ffStrbufCreateCopy(exe);
@@ -442,8 +227,6 @@ static bool detectTerminalFontCommon(const FFTerminalResult* terminal, FFTermina
{
if(ffStrbufStartsWithIgnCaseS(&terminal->processName, "alacritty"))
detectAlacritty(terminalFont);
else if(ffStrbufStartsWithIgnCaseS(&terminal->processName, "terminator"))
detectTerminator(terminalFont);
else if(ffStrbufStartsWithIgnCaseS(&terminal->processName, "wezterm-gui"))
detectWezterm(&terminal->exe, terminalFont);
else if(ffStrbufStartsWithIgnCaseS(&terminal->processName, "tabby"))
@@ -460,13 +243,6 @@ static bool detectTerminalFontCommon(const FFTerminalResult* terminal, FFTermina
detectTTY(terminalFont);
#endif
#if defined(_WIN32) || defined(__linux__)
//Used by both Linux (WSL) and Windows
else if(ffStrbufIgnCaseEqualS(&terminal->processName, "Windows Terminal") ||
ffStrbufIgnCaseEqualS(&terminal->processName, "WindowsTerminal.exe"))
detectFromWindowsTerminal(&terminal->exe, terminalFont);
#endif
else
return false;
@@ -379,6 +379,30 @@ static void detectWarp(FFTerminalFontResult* terminalFont)
}
}
static void detectTerminator(FFTerminalFontResult* result)
{
FF_STRBUF_AUTO_DESTROY useSystemFont = ffStrbufCreate();
FF_STRBUF_AUTO_DESTROY fontName = ffStrbufCreate();
if(!ffParsePropFileConfigValues("terminator/config", 2, (FFpropquery[]) {
{"use_system_font =", &useSystemFont},
{"font =", &fontName},
}) || ffStrbufIgnCaseEqualS(&useSystemFont, "True"))
{
FF_AUTO_FREE const char* fontName = getSystemMonospaceFont();
if(ffStrSet(fontName))
ffFontInitPango(&result->font, fontName);
else
ffStrbufAppendS(&result->error, "Couldn't get system monospace font name from GSettings / DConf");
return;
}
if(fontName.length == 0)
ffFontInitValues(&result->font, "Mono", "10");
else
ffFontInitPango(&result->font, fontName.chars);
}
static void detectWestonTerminal(FFTerminalFontResult* terminalFont)
{
FF_STRBUF_AUTO_DESTROY font = ffStrbufCreate();
@@ -426,4 +450,6 @@ void ffDetectTerminalFontPlatform(const FFTerminalResult* terminal, FFTerminalFo
detectWarp(terminalFont);
else if(ffStrbufIgnCaseEqualS(&terminal->processName, "weston-terminal"))
detectWestonTerminal(terminalFont);
else if(ffStrbufStartsWithIgnCaseS(&terminal->processName, "terminator"))
detectTerminator(terminalFont);
}
@@ -1,10 +1,184 @@
#include "common/properties.h"
#include "common/library.h"
#include "common/io/io.h"
#include "common/processing.h"
#include "common/properties.h"
#include "detection/terminalshell/terminalshell.h"
#include "terminalfont.h"
#include "util/windows/unicode.h"
#include "terminalfont.h"
#include <shlobj.h>
#include <windows.h>
#include <stdlib.h>
static const char* detectWTProfile(yyjson_val* profile, FFstrbuf* name, double* size)
{
yyjson_val* font = yyjson_obj_get(profile, "font");
if (!font)
return "yyjson_obj_get(profile, \"font\"); failed";
if (!yyjson_is_obj(font))
return "yyjson_is_obj(font) returns false";
if (name->length == 0)
{
yyjson_val* pface = yyjson_obj_get(font, "face");
if(yyjson_is_str(pface))
ffStrbufAppendS(name, unsafe_yyjson_get_str(pface));
}
if (*size < 0)
{
yyjson_val* psize = yyjson_obj_get(font, "size");
if (yyjson_is_num(psize))
*size = yyjson_get_num(psize);
}
return NULL;
}
static inline void wrapYyjsonFree(yyjson_doc** doc)
{
assert(doc);
if (*doc)
yyjson_doc_free(*doc);
}
static const char* detectFromWTImpl(FFstrbuf* content, FFstrbuf* name, double* size)
{
yyjson_doc* __attribute__((__cleanup__(wrapYyjsonFree))) doc = yyjson_read_opts(content->chars, content->length, YYJSON_READ_ALLOW_COMMENTS | YYJSON_READ_ALLOW_TRAILING_COMMAS | YYJSON_READ_ALLOW_INF_AND_NAN, NULL, NULL);
if (!doc)
return "Failed to parse WT JSON config file";
yyjson_val* const root = yyjson_doc_get_root(doc);
assert(root);
yyjson_val* profiles = yyjson_obj_get(root, "profiles");
if (!profiles)
return "yyjson_obj_get(root, \"profiles\") failed";
FF_STRBUF_AUTO_DESTROY wtProfileId = ffStrbufCreateS(getenv("WT_PROFILE_ID"));
ffStrbufTrim(&wtProfileId, '\'');
if (wtProfileId.length > 0)
{
yyjson_val* list = yyjson_obj_get(profiles, "list");
if (yyjson_is_arr(list))
{
yyjson_val* profile;
size_t idx, max;
yyjson_arr_foreach(list, idx, max, profile)
{
yyjson_val* guid = yyjson_obj_get(profile, "guid");
if(ffStrbufEqualS(&wtProfileId, yyjson_get_str(guid)))
{
detectWTProfile(profile, name, size);
break;
}
}
}
}
yyjson_val* defaults = yyjson_obj_get(profiles, "defaults");
if (defaults)
detectWTProfile(defaults, name, size);
if(name->length == 0)
ffStrbufSetS(name, "Cascadia Mono");
if(*size < 0)
*size = 12;
return NULL;
}
static void detectFromWindowsTerminal(const FFstrbuf* terminalExe, FFTerminalFontResult* terminalFont)
{
//https://learn.microsoft.com/en-us/windows/terminal/install#settings-json-file
FF_STRBUF_AUTO_DESTROY json = ffStrbufCreate();
const char* error = NULL;
if(terminalExe && terminalExe->length > 0 && !ffStrbufEqualS(terminalExe, "Windows Terminal"))
{
char jsonPath[MAX_PATH + 1];
strncpy(jsonPath, terminalExe->chars, ffStrbufLastIndexC(terminalExe, '\\') + 1);
char* pathEnd = jsonPath + strlen(jsonPath);
strncpy(pathEnd, ".portable", sizeof(jsonPath) - (size_t) (pathEnd - jsonPath) - 1);
if(ffPathExists(jsonPath, FF_PATHTYPE_ANY))
{
strncpy(pathEnd, "settings\\settings.json", sizeof(jsonPath) - (size_t) (pathEnd - jsonPath) - 1);
if(!ffAppendFileBuffer(jsonPath, &json))
error = "Error reading Windows Terminal portable settings JSON file";
}
else if(SUCCEEDED(SHGetFolderPathA(NULL, CSIDL_LOCAL_APPDATA, NULL, 0, jsonPath)))
{
size_t remaining = sizeof(jsonPath) - strlen(jsonPath) - 1;
if(ffStrbufContainIgnCaseS(terminalExe, "_8wekyb3d8bbwe\\"))
{
// Microsoft Store version
if(ffStrbufContainIgnCaseS(terminalExe, ".WindowsTerminalPreview_"))
{
// Preview version
strncat(jsonPath, "\\Packages\\Microsoft.WindowsTerminalPreview_8wekyb3d8bbwe\\LocalState\\settings.json", remaining);
if(!ffAppendFileBuffer(jsonPath, &json))
error = "Error reading Windows Terminal Preview settings JSON file";
}
else
{
// Stable version
strncat(jsonPath, "\\Packages\\Microsoft.WindowsTerminal_8wekyb3d8bbwe\\LocalState\\settings.json", remaining);
if(!ffAppendFileBuffer(jsonPath, &json))
error = "Error reading Windows Terminal settings JSON file";
}
}
else
{
strncat(jsonPath, "\\Microsoft\\Windows Terminal\\settings.json", remaining);
if(!ffAppendFileBuffer(jsonPath, &json))
error = "Error reading Windows Terminal settings JSON file";
}
}
}
if(!error && json.length == 0)
{
error = ffProcessAppendStdOut(&json, (char* const[]) {
"cmd.exe",
"/c",
//print the file content directly, so we don't need to handle the difference of Windows and POSIX path
"if exist %LOCALAPPDATA%\\Packages\\Microsoft.WindowsTerminal_8wekyb3d8bbwe\\LocalState\\settings.json "
"( type %LOCALAPPDATA%\\Packages\\Microsoft.WindowsTerminal_8wekyb3d8bbwe\\LocalState\\settings.json ) "
"else if exist %LOCALAPPDATA%\\Packages\\Microsoft.WindowsTerminalPreview_8wekyb3d8bbwe\\LocalState\\settings.json "
"( type %LOCALAPPDATA%\\Packages\\Microsoft.WindowsTerminalPreview_8wekyb3d8bbwe\\LocalState\\settings.json ) "
"else if exist \"%LOCALAPPDATA%\\Microsoft\\Windows Terminal\\settings.json\" "
"( type %LOCALAPPDATA%\\Microsoft\\Windows Terminal\\settings.json ) "
"else ( call )",
NULL
});
}
if(error)
{
ffStrbufAppendS(&terminalFont->error, error);
return;
}
ffStrbufTrimRight(&json, '\n');
if(json.length == 0)
{
ffStrbufAppendS(&terminalFont->error, "Cannot find file \"settings.json\"");
return;
}
FF_STRBUF_AUTO_DESTROY name = ffStrbufCreate();
double size = -1;
error = detectFromWTImpl(&json, &name, &size);
if(error)
ffStrbufAppendS(&terminalFont->error, error);
else
{
char sizeStr[16];
snprintf(sizeStr, sizeof(sizeStr), "%g", size);
ffFontInitValues(&terminalFont->font, name.chars, sizeStr);
}
}
static void detectMintty(FFTerminalFontResult* terminalFont)
{
@@ -87,7 +261,10 @@ static void detectConEmu(FFTerminalFontResult* terminalFont)
void ffDetectTerminalFontPlatform(const FFTerminalResult* terminal, FFTerminalFontResult* terminalFont)
{
if(ffStrbufIgnCaseEqualS(&terminal->processName, "mintty"))
if(ffStrbufIgnCaseEqualS(&terminal->processName, "Windows Terminal") ||
ffStrbufIgnCaseEqualS(&terminal->processName, "WindowsTerminal.exe"))
detectFromWindowsTerminal(&terminal->exe, terminalFont);
else if(ffStrbufIgnCaseEqualS(&terminal->processName, "mintty"))
detectMintty(terminalFont);
else if(ffStrbufIgnCaseEqualS(&terminal->processName, "conhost.exe"))
detectConhost(terminalFont);
+30 -19
View File
@@ -38,8 +38,8 @@ static bool printImageIterm(bool printError)
if (options->position == FF_LOGO_POSITION_LEFT)
{
ffStrbufAppendF(&buf, "\e[2J\e[3J\e[%u;%uH",
(unsigned) options->paddingTop,
(unsigned) options->paddingLeft
(unsigned) options->paddingTop + 1,
(unsigned) options->paddingLeft + 1
);
}
else if (options->position == FF_LOGO_POSITION_TOP)
@@ -49,9 +49,13 @@ static bool printImageIterm(bool printError)
}
else if (options->position == FF_LOGO_POSITION_RIGHT)
{
if (printError)
fputs("Logo (iterm): Must set logo width and height\n", stderr);
return false;
if (!options->width)
{
if (printError)
fputs("Logo (iterm): Must set logo width when using position right\n", stderr);
return false;
}
ffStrbufAppendF(&buf, "\e[2J\e[3J\e[%u;9999999H\e[%uD", (unsigned) options->paddingTop + 1, (unsigned) options->paddingRight + options->width);
}
if (options->width)
ffStrbufAppendF(&buf, "\e]1337;File=inline=1;width=%u:%s\a", (unsigned) options->width, base64.chars);
@@ -59,7 +63,7 @@ static bool printImageIterm(bool printError)
ffStrbufAppendF(&buf, "\e]1337;File=inline=1:%s\a", base64.chars);
ffWriteFDBuffer(FFUnixFD2NativeFD(STDOUT_FILENO), &buf);
if (options->position == FF_LOGO_POSITION_LEFT)
if (options->position == FF_LOGO_POSITION_LEFT || options->position == FF_LOGO_POSITION_RIGHT)
{
uint16_t X = 0, Y = 0;
const char* error = ffGetTerminalResponse("\e[6n", "\e[%hu;%huR", &Y, &X);
@@ -68,7 +72,8 @@ static bool printImageIterm(bool printError)
fprintf(stderr, "\nLogo (iterm): fail to query cursor position: %s\n", error);
return true; // We already printed image logo, don't print ascii logo then
}
instance.state.logoWidth = X + options->paddingRight;
if (options->position == FF_LOGO_POSITION_LEFT)
instance.state.logoWidth = X + options->paddingRight - 1;
instance.state.logoHeight = Y;
fputs("\e[H", stdout);
}
@@ -83,7 +88,7 @@ static bool printImageIterm(bool printError)
ffStrbufAppendNC(&buf, options->paddingTop, '\n');
if (options->position == FF_LOGO_POSITION_RIGHT)
ffStrbufAppendF(&buf, "\e[9999999C\e[%uD", (unsigned) options->paddingRight + options->width);
else
else if (options->paddingLeft)
ffStrbufAppendF(&buf, "\e[%uC", (unsigned) options->paddingLeft);
ffStrbufAppendF(&buf, "\e]1337;File=inline=1;width=%u;height=%u;preserveAspectRatio=%u:%s\a\n",
(unsigned) options->width,
@@ -133,8 +138,8 @@ static bool printImageKittyDirect(bool printError)
{
// We must clear the entre screen to make sure that terminal buffer won't scroll up
printf("\e[2J\e[3J\e[%u;%uH",
(unsigned) options->paddingTop,
(unsigned) options->paddingLeft
(unsigned) options->paddingTop + 1,
(unsigned) options->paddingLeft + 1
);
}
else if (options->position == FF_LOGO_POSITION_TOP)
@@ -144,9 +149,13 @@ static bool printImageKittyDirect(bool printError)
}
else if (options->position == FF_LOGO_POSITION_RIGHT)
{
if (printError)
fputs("Logo (iterm): Must set logo width and height\n", stderr);
return false;
if (!options->width)
{
if (printError)
fputs("Logo (iterm): Must set logo width when using position right\n", stderr);
return false;
}
printf("\e[2J\e[3J\e[%u;9999999H\e[%uD", (unsigned) options->paddingTop + 1, (unsigned) options->paddingRight + options->width);
}
if (options->width)
@@ -154,16 +163,18 @@ static bool printImageKittyDirect(bool printError)
else
printf("\e_Ga=T,f=100,t=f;%s\e\\", base64.chars);
fflush(stdout);
if (options->position == FF_LOGO_POSITION_LEFT)
if (options->position == FF_LOGO_POSITION_LEFT || options->position == FF_LOGO_POSITION_RIGHT)
{
uint16_t X = 0, Y = 0;
const char* error = ffGetTerminalResponse("\e[6n", "\e[%hu;%huR", &Y, &X);
if (error)
{
fprintf(stderr, "\nLogo (kitty-direct): fail to query cursor position: %s\n", error);
if (printError)
fprintf(stderr, "\nLogo (kitty-direct): fail to query cursor position: %s\n", error);
return true; // We already printed image logo, don't print ascii logo then
}
instance.state.logoWidth = X + options->paddingRight;
if (options->position == FF_LOGO_POSITION_LEFT)
instance.state.logoWidth = X + options->paddingRight - 1;
instance.state.logoHeight = Y;
fputs("\e[H", stdout);
}
@@ -178,7 +189,7 @@ static bool printImageKittyDirect(bool printError)
ffPrintCharTimes('\n', options->paddingTop);
if (options->position == FF_LOGO_POSITION_RIGHT)
printf("\e[9999999C\e[%uD", (unsigned) options->paddingRight + options->width);
else
else if (options->paddingLeft)
printf("\e[%uC", (unsigned) options->paddingLeft);
printf("\e_Ga=T,f=100,t=f,c=%u,r=%u;%s\e\\\n",
@@ -338,7 +349,7 @@ static void printImagePixels(FFLogoRequestData* requestData, const FFstrbuf* res
ffPrintCharTimes('\n', options->paddingTop);
if (options->position == FF_LOGO_POSITION_RIGHT)
printf("\e[9999999C\e[%uD", (unsigned) options->paddingRight + requestData->logoCharacterWidth);
else
else if (options->paddingLeft)
printf("\e[%uC", (unsigned) options->paddingLeft);
fflush(stdout);
ffWriteFDBuffer(FFUnixFD2NativeFD(STDOUT_FILENO), result);
@@ -722,7 +733,7 @@ static bool printCachedPixel(FFLogoRequestData* requestData)
ffPrintCharTimes('\n', options->paddingTop);
if (options->position == FF_LOGO_POSITION_RIGHT)
printf("\e[9999999C\e[%uD", (unsigned) options->paddingRight + requestData->logoCharacterWidth);
else
else if (options->paddingLeft)
printf("\e[%uC", (unsigned) options->paddingLeft);
fflush(stdout);
+69 -20
View File
@@ -16,41 +16,91 @@ typedef enum FFLogoSize
FF_LOGO_SIZE_SMALL,
} FFLogoSize;
static void ffLogoPrintCharsRaw(const char* data, size_t length)
static bool ffLogoPrintCharsRaw(const char* data, size_t length, bool printError)
{
FFOptionsLogo* options = &instance.config.logo;
FF_STRBUF_AUTO_DESTROY buf = ffStrbufCreate();
if (!options->width || !options->height)
{
ffStrbufAppendF(&buf, "\e[2J\e[3J\e[%u;%uH",
(unsigned) options->paddingTop,
(unsigned) options->paddingLeft
);
if (options->position == FF_LOGO_POSITION_LEFT)
{
ffStrbufAppendF(&buf, "\e[2J\e[3J\e[%u;%uH",
(unsigned) options->paddingTop + 1,
(unsigned) options->paddingLeft + 1
);
}
else if (options->position == FF_LOGO_POSITION_TOP)
{
ffStrbufAppendNC(&buf, options->paddingTop, '\n');
ffStrbufAppendNC(&buf, options->paddingLeft, ' ');
}
else if (options->position == FF_LOGO_POSITION_RIGHT)
{
if (!options->width)
{
if (printError)
fputs("Logo (iterm): Must set logo width when using position right\n", stderr);
return false;
}
ffStrbufAppendF(&buf, "\e[2J\e[3J\e[%u;9999999H\e[%uD", (unsigned) options->paddingTop + 1, (unsigned) options->paddingRight + options->width);
}
ffStrbufAppendNS(&buf, (uint32_t) length, data);
ffWriteFDBuffer(FFUnixFD2NativeFD(STDOUT_FILENO), &buf);
uint16_t X = 0, Y = 0;
const char* error = ffGetTerminalResponse("\e[6n", "\e[%hu;%huR", &Y, &X);
if (error)
if (options->position == FF_LOGO_POSITION_LEFT || options->position == FF_LOGO_POSITION_RIGHT)
{
fprintf(stderr, "\nLogo (image-raw): fail to query cursor position: %s\n", error);
return;
uint16_t X = 0, Y = 0;
const char* error = ffGetTerminalResponse("\e[6n", "\e[%hu;%huR", &Y, &X);
if (error)
{
if (printError)
fprintf(stderr, "\nLogo (image-raw): fail to query cursor position: %s\n", error);
return true;
}
if (options->position == FF_LOGO_POSITION_LEFT)
instance.state.logoWidth = X + instance.config.logo.paddingRight - 1;
instance.state.logoHeight = Y;
fputs("\e[H", stdout);
}
else if (options->position == FF_LOGO_POSITION_TOP)
{
instance.state.logoWidth = instance.state.logoHeight = 0;
ffPrintCharTimes('\n', options->paddingRight);
}
instance.state.logoWidth = X + instance.config.logo.paddingRight;
instance.state.logoHeight = Y;
fputs("\e[H", stdout);
}
else
{
ffStrbufAppendNC(&buf, options->paddingTop, '\n');
ffStrbufAppendNC(&buf, options->paddingLeft, ' ');
if (options->position == FF_LOGO_POSITION_RIGHT)
ffStrbufAppendF(&buf, "\e[9999999C\e[%uD", (unsigned) options->paddingRight + options->width);
else if (options->paddingLeft)
ffStrbufAppendF(&buf, "\e[%uC", (unsigned) options->paddingLeft);
ffStrbufAppendNS(&buf, (uint32_t) length, data);
instance.state.logoHeight = options->paddingTop + options->height;
instance.state.logoWidth = options->paddingLeft + options->width + options->paddingRight;
ffStrbufAppendF(&buf, "\n\e[%uA", instance.state.logoHeight);
ffStrbufAppendC(&buf, '\n');
if (options->position == FF_LOGO_POSITION_LEFT)
{
instance.state.logoWidth = options->width + options->paddingLeft + options->paddingRight;
instance.state.logoHeight = options->paddingTop + options->height;
ffStrbufAppendF(&buf, "\e[%uA", (unsigned) instance.state.logoHeight);
}
else if (options->position == FF_LOGO_POSITION_TOP)
{
instance.state.logoWidth = instance.state.logoHeight = 0;
ffStrbufAppendNC(&buf, options->paddingRight, '\n');
}
else if (options->position == FF_LOGO_POSITION_RIGHT)
{
instance.state.logoWidth = instance.state.logoHeight = 0;
ffStrbufAppendF(&buf, "\e[%uA", (unsigned) options->height);
}
ffWriteFDBuffer(FFUnixFD2NativeFD(STDOUT_FILENO), &buf);
}
return true;
}
// If result is NULL, calculate logo width
@@ -441,10 +491,9 @@ static bool logoPrintFileIfExists(bool doColorReplacement, bool raw)
logoApplyColors(logoGetBuiltinDetected(FF_LOGO_SIZE_NORMAL), doColorReplacement);
if(raw)
ffLogoPrintCharsRaw(content.chars, content.length);
else
ffLogoPrintChars(content.chars, doColorReplacement);
return ffLogoPrintCharsRaw(content.chars, content.length, instance.config.display.showErrors);
ffLogoPrintChars(content.chars, doColorReplacement);
return true;
}
+1 -1
View File
@@ -251,7 +251,7 @@ void ffInitBatteryOptions(FFBatteryOptions* options)
ffPrintBatteryHelpFormat,
ffGenerateBatteryJsonConfig
);
ffOptionInitModuleArg(&options->moduleArgs);
ffOptionInitModuleArg(&options->moduleArgs, "");
options->temp = false;
options->tempConfig = (FFColorRangeConfig) { 60, 80 };
options->percent = (FFColorRangeConfig) { 50, 20 };
+3 -2
View File
@@ -43,8 +43,9 @@ void ffPrintBios(FFBiosOptions* options)
else
{
ffStrbufClear(&key);
FF_PARSE_FORMAT_STRING_CHECKED(&key, &options->moduleArgs.key, 1, ((FFformatarg[]){
FF_PARSE_FORMAT_STRING_CHECKED(&key, &options->moduleArgs.key, 2, ((FFformatarg[]){
{FF_FORMAT_ARG_TYPE_STRBUF, &bios.type, "type"},
{FF_FORMAT_ARG_TYPE_STRBUF, &options->moduleArgs.keyIcon, "icon"},
}));
}
@@ -167,7 +168,7 @@ void ffInitBiosOptions(FFBiosOptions* options)
ffPrintBiosHelpFormat,
ffGenerateBiosJsonConfig
);
ffOptionInitModuleArg(&options->moduleArgs);
ffOptionInitModuleArg(&options->moduleArgs, "");
}
void ffDestroyBiosOptions(FFBiosOptions* options)
+1 -1
View File
@@ -200,7 +200,7 @@ void ffInitBluetoothOptions(FFBluetoothOptions* options)
ffPrintBluetoothHelpFormat,
ffGenerateBluetoothJsonConfig
);
ffOptionInitModuleArg(&options->moduleArgs);
ffOptionInitModuleArg(&options->moduleArgs, "");
options->showDisconnected = false;
options->percent = (FFColorRangeConfig) { 50, 20 };
}
+1 -1
View File
@@ -145,7 +145,7 @@ void ffInitBoardOptions(FFBoardOptions* options)
ffPrintBoardHelpFormat,
ffGenerateBoardJsonConfig
);
ffOptionInitModuleArg(&options->moduleArgs);
ffOptionInitModuleArg(&options->moduleArgs, "");
}
void ffDestroyBoardOptions(FFBoardOptions* options)
+1 -1
View File
@@ -134,7 +134,7 @@ void ffInitBootmgrOptions(FFBootmgrOptions* options)
ffPrintBootmgrHelpFormat,
ffGenerateBootmgrJsonConfig
);
ffOptionInitModuleArg(&options->moduleArgs);
ffOptionInitModuleArg(&options->moduleArgs, "");
}
void ffDestroyBootmgrOptions(FFBootmgrOptions* options)
+3 -2
View File
@@ -37,9 +37,10 @@ void ffPrintBrightness(FFBrightnessOptions* options)
else
{
uint32_t moduleIndex = result.length == 1 ? 0 : index + 1;
FF_PARSE_FORMAT_STRING_CHECKED(&key, &options->moduleArgs.key, 2, ((FFformatarg[]){
FF_PARSE_FORMAT_STRING_CHECKED(&key, &options->moduleArgs.key, 3, ((FFformatarg[]){
{FF_FORMAT_ARG_TYPE_UINT, &moduleIndex, "index"},
{FF_FORMAT_ARG_TYPE_STRBUF, &item->name, "name"},
{FF_FORMAT_ARG_TYPE_STRBUF, &options->moduleArgs.keyIcon, "icon"},
}));
}
@@ -200,7 +201,7 @@ void ffInitBrightnessOptions(FFBrightnessOptions* options)
ffPrintBrightnessHelpFormat,
ffGenerateBrightnessJsonConfig
);
ffOptionInitModuleArg(&options->moduleArgs);
ffOptionInitModuleArg(&options->moduleArgs, "󰯪");
options->ddcciSleep = 10;
options->percent = (FFColorRangeConfig) { 100, 100 };
+1 -1
View File
@@ -161,7 +161,7 @@ void ffInitCameraOptions(FFCameraOptions* options)
ffPrintCameraHelpFormat,
ffGenerateCameraJsonConfig
);
ffOptionInitModuleArg(&options->moduleArgs);
ffOptionInitModuleArg(&options->moduleArgs, "󰄀");
}
void ffDestroyCameraOptions(FFCameraOptions* options)
+1 -1
View File
@@ -146,7 +146,7 @@ void ffInitChassisOptions(FFChassisOptions* options)
ffPrintChassisHelpFormat,
ffGenerateChassisJsonConfig
);
ffOptionInitModuleArg(&options->moduleArgs);
ffOptionInitModuleArg(&options->moduleArgs, "");
}
void ffDestroyChassisOptions(FFChassisOptions* options)
+1 -1
View File
@@ -293,7 +293,7 @@ void ffInitColorsOptions(FFColorsOptions* options)
NULL,
ffGenerateColorsJsonConfig
);
ffOptionInitModuleArg(&options->moduleArgs);
ffOptionInitModuleArg(&options->moduleArgs, "");
ffStrbufSetStatic(&options->moduleArgs.key, " ");
options->symbol = FF_COLORS_SYMBOL_BACKGROUND;
options->paddingLeft = 0;
+1 -1
View File
@@ -159,7 +159,7 @@ void ffInitCommandOptions(FFCommandOptions* options)
ffPrintCommandHelpFormat,
ffGenerateCommandJsonConfig
);
ffOptionInitModuleArg(&options->moduleArgs);
ffOptionInitModuleArg(&options->moduleArgs, "");
ffStrbufInitStatic(&options->shell,
#ifdef _WIN32
+2 -2
View File
@@ -95,7 +95,7 @@ void ffPrintCPU(FFCPUOptions* options)
FF_STRBUF_AUTO_DESTROY freqBase = ffStrbufCreate();
ffParseFrequency(cpu.frequencyBase, &freqBase);
FF_STRBUF_AUTO_DESTROY freqMax = ffStrbufCreate();
ffParseFrequency(cpu.frequencyBase, &freqBase);
ffParseFrequency(cpu.frequencyBase, &freqMax);
FF_STRBUF_AUTO_DESTROY freqBioslimit = ffStrbufCreate();
ffParseFrequency(cpu.frequencyBiosLimit, &freqBioslimit);
@@ -265,7 +265,7 @@ void ffInitCPUOptions(FFCPUOptions* options)
ffPrintCPUHelpFormat,
ffGenerateCPUJsonConfig
);
ffOptionInitModuleArg(&options->moduleArgs);
ffOptionInitModuleArg(&options->moduleArgs, "");
options->temp = false;
options->tempConfig = (FFColorRangeConfig) { 60, 80 };
options->showPeCoreCount = false;
+3 -2
View File
@@ -22,9 +22,10 @@ static void printCPUCacheNormal(const FFCPUCacheResult* result, FFCPUCacheOption
else
{
uint32_t index = i + 1;
FF_PARSE_FORMAT_STRING_CHECKED(&key, &options->moduleArgs.key, 2, ((FFformatarg[]){
FF_PARSE_FORMAT_STRING_CHECKED(&key, &options->moduleArgs.key, 3, ((FFformatarg[]){
{FF_FORMAT_ARG_TYPE_UINT, &index, "index"},
{FF_FORMAT_ARG_TYPE_STRING, levelStr, "level"},
{FF_FORMAT_ARG_TYPE_STRBUF, &options->moduleArgs.keyIcon, "icon"},
}));
}
@@ -248,7 +249,7 @@ void ffInitCPUCacheOptions(FFCPUCacheOptions* options)
ffPrintCPUCacheHelpFormat,
ffGenerateCPUCacheJsonConfig
);
ffOptionInitModuleArg(&options->moduleArgs);
ffOptionInitModuleArg(&options->moduleArgs, "");
options->compact = false;
}
+1 -1
View File
@@ -200,7 +200,7 @@ void ffInitCPUUsageOptions(FFCPUUsageOptions* options)
ffPrintCPUUsageHelpFormat,
ffGenerateCPUUsageJsonConfig
);
ffOptionInitModuleArg(&options->moduleArgs);
ffOptionInitModuleArg(&options->moduleArgs, "󰓅");
options->separate = false;
options->percent = (FFColorRangeConfig) { 50, 80 };
}
+1 -1
View File
@@ -131,7 +131,7 @@ void ffInitCursorOptions(FFCursorOptions* options)
ffPrintCursorHelpFormat,
ffGenerateCursorJsonConfig
);
ffOptionInitModuleArg(&options->moduleArgs);
ffOptionInitModuleArg(&options->moduleArgs, "󰆿");
}
void ffDestroyCursorOptions(FFCursorOptions* options)
+1 -1
View File
@@ -57,7 +57,7 @@ void ffInitCustomOptions(FFCustomOptions* options)
NULL,
ffGenerateCustomJsonConfig
);
ffOptionInitModuleArg(&options->moduleArgs);
ffOptionInitModuleArg(&options->moduleArgs, "");
ffStrbufSetStatic(&options->moduleArgs.key, " ");
}
+1 -1
View File
@@ -196,7 +196,7 @@ void ffInitDateTimeOptions(FFDateTimeOptions* options)
ffPrintDateTimeHelpFormat,
ffGenerateDateTimeJsonConfig
);
ffOptionInitModuleArg(&options->moduleArgs);
ffOptionInitModuleArg(&options->moduleArgs, "");
}
void ffDestroyDateTimeOptions(FFDateTimeOptions* options)
+1 -1
View File
@@ -135,7 +135,7 @@ void ffInitDEOptions(FFDEOptions* options)
ffPrintDEHelpFormat,
ffGenerateDEJsonConfig
);
ffOptionInitModuleArg(&options->moduleArgs);
ffOptionInitModuleArg(&options->moduleArgs, "");
options->slowVersionDetection = false;
}
+3 -2
View File
@@ -35,10 +35,11 @@ static void printDisk(FFDiskOptions* options, const FFDisk* disk)
}
else
{
FF_PARSE_FORMAT_STRING_CHECKED(&key, &options->moduleArgs.key, 3, ((FFformatarg[]){
FF_PARSE_FORMAT_STRING_CHECKED(&key, &options->moduleArgs.key, 4, ((FFformatarg[]){
{FF_FORMAT_ARG_TYPE_STRBUF, &disk->mountpoint, "mountpoint"},
{FF_FORMAT_ARG_TYPE_STRBUF, &disk->name, "name"},
{FF_FORMAT_ARG_TYPE_STRBUF, &disk->mountFrom, "mount-from"},
{FF_FORMAT_ARG_TYPE_STRBUF, &options->moduleArgs.keyIcon, "icon"},
}));
}
@@ -465,7 +466,7 @@ void ffInitDiskOptions(FFDiskOptions* options)
ffPrintDiskHelpFormat,
ffGenerateDiskJsonConfig
);
ffOptionInitModuleArg(&options->moduleArgs);
ffOptionInitModuleArg(&options->moduleArgs, "");
ffStrbufInit(&options->folders);
options->showTypes = FF_DISK_VOLUME_TYPE_REGULAR_BIT | FF_DISK_VOLUME_TYPE_EXTERNAL_BIT | FF_DISK_VOLUME_TYPE_READONLY_BIT;
+3 -2
View File
@@ -22,10 +22,11 @@ static void formatKey(const FFDiskIOOptions* options, FFDiskIOResult* dev, uint3
else
{
ffStrbufClear(key);
FF_PARSE_FORMAT_STRING_CHECKED(key, &options->moduleArgs.key, 3, ((FFformatarg[]){
FF_PARSE_FORMAT_STRING_CHECKED(key, &options->moduleArgs.key, 4, ((FFformatarg[]){
{FF_FORMAT_ARG_TYPE_UINT, &index, "index"},
{FF_FORMAT_ARG_TYPE_STRBUF, &dev->name, "name"},
{FF_FORMAT_ARG_TYPE_STRBUF, &dev->devPath, "dev-path"},
{FF_FORMAT_ARG_TYPE_STRBUF, &options->moduleArgs.keyIcon, "icon"},
}));
}
}
@@ -217,7 +218,7 @@ void ffInitDiskIOOptions(FFDiskIOOptions* options)
ffPrintDiskIOHelpFormat,
ffGenerateDiskIOJsonConfig
);
ffOptionInitModuleArg(&options->moduleArgs);
ffOptionInitModuleArg(&options->moduleArgs, "󰓅");
ffStrbufInit(&options->namePrefix);
options->detectTotal = false;
+13 -3
View File
@@ -6,7 +6,7 @@
#include <math.h>
#define FF_DISPLAY_NUM_FORMAT_ARGS 13
#define FF_DISPLAY_NUM_FORMAT_ARGS 16
static int sortByNameAsc(FFDisplayResult* a, FFDisplayResult* b)
{
@@ -91,10 +91,11 @@ void ffPrintDisplay(FFDisplayOptions* options)
}
else
{
FF_PARSE_FORMAT_STRING_CHECKED(&key, &options->moduleArgs.key, 3, ((FFformatarg[]){
FF_PARSE_FORMAT_STRING_CHECKED(&key, &options->moduleArgs.key, 4, ((FFformatarg[]){
{FF_FORMAT_ARG_TYPE_UINT, &moduleIndex, "index"},
{FF_FORMAT_ARG_TYPE_STRBUF, &result->name, "name"},
{FF_FORMAT_ARG_TYPE_STRING, displayType, "type"},
{FF_FORMAT_ARG_TYPE_STRBUF, &options->moduleArgs.keyIcon, "icon"},
}));
}
@@ -126,6 +127,9 @@ void ffPrintDisplay(FFDisplayOptions* options)
if(result->type != FF_DISPLAY_TYPE_UNKNOWN)
ffStrbufAppendS(&buffer, result->type == FF_DISPLAY_TYPE_BUILTIN ? " [Built-in]" : " [External]");
if (result->hdrEnabled)
ffStrbufAppendS(&buffer, " [HDR]");
if(moduleIndex > 0 && result->primary)
ffStrbufAppendS(&buffer, " *");
@@ -150,6 +154,9 @@ void ffPrintDisplay(FFDisplayOptions* options)
{FF_FORMAT_ARG_TYPE_UINT, &result->physicalHeight, "physical-height"},
{FF_FORMAT_ARG_TYPE_DOUBLE, &inch, "inch"},
{FF_FORMAT_ARG_TYPE_DOUBLE, &ppi, "ppi"},
{FF_FORMAT_ARG_TYPE_UINT8, &result->bitDepth, "bit-depth"},
{FF_FORMAT_ARG_TYPE_BOOL, &result->hdrEnabled, "hdr-enabled"},
{FF_FORMAT_ARG_TYPE_BOOL, &result->wcgEnabled, "wcg-enabled"},
}));
}
}
@@ -352,6 +359,9 @@ void ffPrintDisplayHelpFormat(void)
"Screen physical height (in millimeters) - physical-height",
"Physical diagonal length in inches - inch",
"Pixels per inch (PPI) - ppi",
"Bits per color channel - bit-depth",
"True if high dynamic range (HDR) is enabled - hdr-enabled",
"True if wide color gamut (WCG) is enabled - wcg-enabled",
}));
}
@@ -368,7 +378,7 @@ void ffInitDisplayOptions(FFDisplayOptions* options)
ffPrintDisplayHelpFormat,
ffGenerateDisplayJsonConfig
);
ffOptionInitModuleArg(&options->moduleArgs);
ffOptionInitModuleArg(&options->moduleArgs, "󰍹");
options->compactType = FF_DISPLAY_COMPACT_TYPE_NONE;
options->preciseRefreshRate = false;
}
+1 -1
View File
@@ -183,7 +183,7 @@ void ffInitDNSOptions(FFDNSOptions* options)
ffPrintDNSHelpFormat,
ffGenerateDNSJsonConfig
);
ffOptionInitModuleArg(&options->moduleArgs);
ffOptionInitModuleArg(&options->moduleArgs, "󰇖");
options->showType = FF_DNS_TYPE_BOTH;
}
+5 -3
View File
@@ -10,6 +10,7 @@
void ffPrintEditor(FFEditorOptions* options)
{
FFEditorResult result = {
.type = "Unknown",
.name = ffStrbufCreate(),
.path = ffStrbufCreate(),
.exe = ffStrbufCreate(),
@@ -40,8 +41,8 @@ void ffPrintEditor(FFEditorOptions* options)
}
else
{
FF_PRINT_FORMAT_CHECKED(FF_EDITOR_MODULE_NAME, 0, &options->moduleArgs, FF_PRINT_TYPE_NO_CUSTOM_KEY, FF_EDITOR_NUM_FORMAT_ARGS, ((FFformatarg[]){
{FF_FORMAT_ARG_TYPE_STRING, &result.type, "type"},
FF_PRINT_FORMAT_CHECKED(FF_EDITOR_MODULE_NAME, 0, &options->moduleArgs, FF_PRINT_TYPE_DEFAULT, FF_EDITOR_NUM_FORMAT_ARGS, ((FFformatarg[]){
{FF_FORMAT_ARG_TYPE_STRING, result.type, "type"},
{FF_FORMAT_ARG_TYPE_STRBUF, &result.name, "name"},
{FF_FORMAT_ARG_TYPE_STRBUF, &result.exe, "exe-name"},
{FF_FORMAT_ARG_TYPE_STRBUF, &result.path, "path"},
@@ -107,6 +108,7 @@ void ffGenerateEditorJsonResult(FF_MAYBE_UNUSED FFEditorOptions* options, yyjson
}
yyjson_mut_val* obj = yyjson_mut_obj_add_obj(doc, module, "result");
yyjson_mut_obj_add_str(doc, obj, "type", result.type);
yyjson_mut_obj_add_strbuf(doc, obj, "name", &result.name);
yyjson_mut_obj_add_strbuf(doc, obj, "path", &result.path);
yyjson_mut_obj_add_strbuf(doc, obj, "exe", &result.exe);
@@ -142,7 +144,7 @@ void ffInitEditorOptions(FFEditorOptions* options)
ffPrintEditorHelpFormat,
ffGenerateEditorJsonConfig
);
ffOptionInitModuleArg(&options->moduleArgs);
ffOptionInitModuleArg(&options->moduleArgs, "󱞎");
}
void ffDestroyEditorOptions(FFEditorOptions* options)
+1 -1
View File
@@ -128,7 +128,7 @@ void ffInitFontOptions(FFFontOptions* options)
ffPrintFontHelpFormat,
ffGenerateFontJsonConfig
);
ffOptionInitModuleArg(&options->moduleArgs);
ffOptionInitModuleArg(&options->moduleArgs, "");
}
void ffDestroyFontOptions(FFFontOptions* options)
+1 -1
View File
@@ -159,7 +159,7 @@ void ffInitGamepadOptions(FFGamepadOptions* options)
ffPrintGamepadHelpFormat,
ffGenerateGamepadJsonConfig
);
ffOptionInitModuleArg(&options->moduleArgs);
ffOptionInitModuleArg(&options->moduleArgs, "󰺵");
options->percent = (FFColorRangeConfig) { 50, 20 };
}
+5 -2
View File
@@ -87,6 +87,9 @@ static void printGPUResult(FFGPUOptions* options, uint8_t index, const FFGPUResu
if (gpu->shared.total != FF_GPU_VMEM_SIZE_UNSET) ffParseSize(gpu->shared.total, &sTotal);
if (gpu->shared.used != FF_GPU_VMEM_SIZE_UNSET) ffParseSize(gpu->shared.used, &sUsed);
FF_STRBUF_AUTO_DESTROY frequency = ffStrbufCreate();
ffParseFrequency(gpu->frequency, &frequency);
FF_PRINT_FORMAT_CHECKED(FF_GPU_MODULE_NAME, index, &options->moduleArgs, FF_PRINT_TYPE_DEFAULT, FF_GPU_NUM_FORMAT_ARGS, ((FFformatarg[]) {
{FF_FORMAT_ARG_TYPE_STRBUF, &gpu->vendor, "vendor"},
{FF_FORMAT_ARG_TYPE_STRBUF, &gpu->name, "name"},
@@ -99,7 +102,7 @@ static void printGPUResult(FFGPUOptions* options, uint8_t index, const FFGPUResu
{FF_FORMAT_ARG_TYPE_STRBUF, &sTotal, "shared-total"},
{FF_FORMAT_ARG_TYPE_STRBUF, &sUsed, "shared-used"},
{FF_FORMAT_ARG_TYPE_STRBUF, &gpu->platformApi, "platform-api"},
{FF_FORMAT_ARG_TYPE_DOUBLE, &gpu->frequency, "frequency"},
{FF_FORMAT_ARG_TYPE_STRBUF, &frequency, "frequency"},
}));
}
}
@@ -413,7 +416,7 @@ void ffInitGPUOptions(FFGPUOptions* options)
ffPrintGPUHelpFormat,
ffGenerateGPUJsonConfig
);
ffOptionInitModuleArg(&options->moduleArgs);
ffOptionInitModuleArg(&options->moduleArgs, "󰾲");
options->driverSpecific = false;
options->detectionMethod = FF_GPU_DETECTION_METHOD_AUTO;
+1 -1
View File
@@ -173,7 +173,7 @@ void ffInitHostOptions(FFHostOptions* options)
ffPrintHostHelpFormat,
ffGenerateHostJsonConfig
);
ffOptionInitModuleArg(&options->moduleArgs);
ffOptionInitModuleArg(&options->moduleArgs, "󰌢");
}
void ffDestroyHostOptions(FFHostOptions* options)
+1 -1
View File
@@ -123,7 +123,7 @@ void ffInitIconsOptions(FFIconsOptions* options)
ffPrintIconsHelpFormat,
ffGenerateIconsJsonConfig
);
ffOptionInitModuleArg(&options->moduleArgs);
ffOptionInitModuleArg(&options->moduleArgs, "");
}
void ffDestroyIconsOptions(FFIconsOptions* options)
+1 -1
View File
@@ -136,7 +136,7 @@ void ffInitInitSystemOptions(FFInitSystemOptions* options)
ffPrintInitSystemHelpFormat,
ffGenerateInitSystemJsonConfig
);
ffOptionInitModuleArg(&options->moduleArgs);
ffOptionInitModuleArg(&options->moduleArgs, "󰿄");
}
void ffDestroyInitSystemOptions(FFInitSystemOptions* options)
+1 -1
View File
@@ -106,7 +106,7 @@ void ffInitKernelOptions(FFKernelOptions* options)
ffPrintKernelHelpFormat,
ffGenerateKernelJsonConfig
);
ffOptionInitModuleArg(&options->moduleArgs);
ffOptionInitModuleArg(&options->moduleArgs, "");
}
void ffDestroyKernelOptions(FFKernelOptions* options)
+1 -1
View File
@@ -137,7 +137,7 @@ void ffInitLMOptions(FFLMOptions* options)
ffPrintLMHelpFormat,
ffGenerateLMJsonConfig
);
ffOptionInitModuleArg(&options->moduleArgs);
ffOptionInitModuleArg(&options->moduleArgs, "󰧨");
}
void ffDestroyLMOptions(FFLMOptions* options)
+3 -2
View File
@@ -49,9 +49,10 @@ void ffPrintLoadavg(FFLoadavgOptions* options)
else
{
ffStrbufClear(&buffer);
FF_PARSE_FORMAT_STRING_CHECKED(&buffer, &options->moduleArgs.key, 2, ((FFformatarg[]){
FF_PARSE_FORMAT_STRING_CHECKED(&buffer, &options->moduleArgs.key, 3, ((FFformatarg[]){
{FF_FORMAT_ARG_TYPE_UINT, &index, "index"},
{FF_FORMAT_ARG_TYPE_UINT, &duration, "duration"},
{FF_FORMAT_ARG_TYPE_STRBUF, &options->moduleArgs.keyIcon, "icon"},
}));
}
@@ -202,7 +203,7 @@ void ffInitLoadavgOptions(FFLoadavgOptions* options)
ffPrintLoadavgHelpFormat,
ffGenerateLoadavgJsonConfig
);
ffOptionInitModuleArg(&options->moduleArgs);
ffOptionInitModuleArg(&options->moduleArgs, "");
options->percent = (FFColorRangeConfig) { 50, 80 };
options->ndigits = 2;
+1 -1
View File
@@ -99,7 +99,7 @@ void ffInitLocaleOptions(FFLocaleOptions* options)
ffPrintLocaleHelpFormat,
ffGenerateLocaleJsonConfig
);
ffOptionInitModuleArg(&options->moduleArgs);
ffOptionInitModuleArg(&options->moduleArgs, "");
}
void ffDestroyLocaleOptions(FFLocaleOptions* options)
+3 -2
View File
@@ -25,10 +25,11 @@ static void formatKey(const FFLocalIpOptions* options, FFLocalIpResult* ip, uint
else
{
ffStrbufClear(key);
FF_PARSE_FORMAT_STRING_CHECKED(key, &options->moduleArgs.key, 3, ((FFformatarg[]){
FF_PARSE_FORMAT_STRING_CHECKED(key, &options->moduleArgs.key, 4, ((FFformatarg[]){
{FF_FORMAT_ARG_TYPE_UINT, &index, "index"},
{FF_FORMAT_ARG_TYPE_STRBUF, &ip->name, "name"},
{FF_FORMAT_ARG_TYPE_STRBUF, &ip->mac, "mac"},
{FF_FORMAT_ARG_TYPE_STRBUF, &options->moduleArgs.keyIcon, "icon"},
}));
}
}
@@ -411,7 +412,7 @@ void ffInitLocalIpOptions(FFLocalIpOptions* options)
ffPrintLocalIpHelpFormat,
ffGenerateLocalIpJsonConfig
);
ffOptionInitModuleArg(&options->moduleArgs);
ffOptionInitModuleArg(&options->moduleArgs, "󰩟");
options->showType = FF_LOCALIP_TYPE_IPV4_BIT | FF_LOCALIP_TYPE_PREFIX_LEN_BIT
#ifndef __ANDROID__
+1 -1
View File
@@ -181,7 +181,7 @@ void ffInitMediaOptions(FFMediaOptions* options)
ffPrintMediaHelpFormat,
ffGenerateMediaJsonConfig
);
ffOptionInitModuleArg(&options->moduleArgs);
ffOptionInitModuleArg(&options->moduleArgs, "");
}
void ffDestroyMediaOptions(FFMediaOptions* options)
+1 -1
View File
@@ -151,7 +151,7 @@ void ffInitMemoryOptions(FFMemoryOptions* options)
ffPrintMemoryHelpFormat,
ffGenerateMemoryJsonConfig
);
ffOptionInitModuleArg(&options->moduleArgs);
ffOptionInitModuleArg(&options->moduleArgs, "");
options->percent = (FFColorRangeConfig) { 50, 80 };
}
+3 -2
View File
@@ -41,9 +41,10 @@ void ffPrintMonitor(FFMonitorOptions* options)
else
{
uint32_t moduleIndex = result.length == 1 ? 0 : index + 1;
FF_PARSE_FORMAT_STRING_CHECKED(&key, &options->moduleArgs.key, 2, ((FFformatarg[]){
FF_PARSE_FORMAT_STRING_CHECKED(&key, &options->moduleArgs.key, 3, ((FFformatarg[]){
{FF_FORMAT_ARG_TYPE_UINT, &moduleIndex, "index"},
{FF_FORMAT_ARG_TYPE_STRBUF, &display->name, "name"},
{FF_FORMAT_ARG_TYPE_STRBUF, &options->moduleArgs.keyIcon, "icon"},
}));
}
@@ -212,7 +213,7 @@ void ffInitMonitorOptions(FFMonitorOptions* options)
ffPrintMonitorHelpFormat,
ffGenerateMonitorJsonConfig
);
ffOptionInitModuleArg(&options->moduleArgs);
ffOptionInitModuleArg(&options->moduleArgs, "󰹑");
}
void ffDestroyMonitorOptions(FFMonitorOptions* options)
+3 -2
View File
@@ -25,9 +25,10 @@ static void formatKey(const FFNetIOOptions* options, FFNetIOResult* inf, uint32_
else
{
ffStrbufClear(key);
FF_PARSE_FORMAT_STRING_CHECKED(key, &options->moduleArgs.key, 2, ((FFformatarg[]){
FF_PARSE_FORMAT_STRING_CHECKED(key, &options->moduleArgs.key, 3, ((FFformatarg[]){
{FF_FORMAT_ARG_TYPE_UINT, &index, "index"},
{FF_FORMAT_ARG_TYPE_STRBUF, &inf->name, "name"},
{FF_FORMAT_ARG_TYPE_STRBUF, &options->moduleArgs.keyIcon, "icon"},
}));
}
}
@@ -247,7 +248,7 @@ void ffInitNetIOOptions(FFNetIOOptions* options)
ffPrintNetIOHelpFormat,
ffGenerateNetIOJsonConfig
);
ffOptionInitModuleArg(&options->moduleArgs);
ffOptionInitModuleArg(&options->moduleArgs, "󰾆");
ffStrbufInit(&options->namePrefix);
options->defaultRouteOnly =
+1 -1
View File
@@ -152,7 +152,7 @@ void ffInitOpenCLOptions(FFOpenCLOptions* options)
ffPrintOpenCLHelpFormat,
ffGenerateOpenCLJsonConfig
);
ffOptionInitModuleArg(&options->moduleArgs);
ffOptionInitModuleArg(&options->moduleArgs, "");
}
void ffDestroyOpenCLOptions(FFOpenCLOptions* options)
+1 -1
View File
@@ -183,7 +183,7 @@ void ffInitOpenGLOptions(FFOpenGLOptions* options)
ffPrintOpenGLHelpFormat,
ffGenerateOpenGLJsonConfig
);
ffOptionInitModuleArg(&options->moduleArgs);
ffOptionInitModuleArg(&options->moduleArgs, "");
options->library = FF_OPENGL_LIBRARY_AUTO;
}
+17 -1
View File
@@ -217,7 +217,23 @@ void ffInitOSOptions(FFOSOptions* options)
ffPrintOSHelpFormat,
ffGenerateOSJsonConfig
);
ffOptionInitModuleArg(&options->moduleArgs);
ffOptionInitModuleArg(&options->moduleArgs,
#ifdef _WIN32
""
#elif __APPLE__
""
#elif __FreeBSD__
"󰣠"
#elif __linux__
""
#elif __ANDROID__
""
#elif __sun
""
#else
"?"
#endif
);
}
void ffDestroyOSOptions(FFOSOptions* options)
+1 -1
View File
@@ -464,7 +464,7 @@ void ffInitPackagesOptions(FFPackagesOptions* options)
ffPrintPackagesHelpFormat,
ffGeneratePackagesJsonConfig
);
ffOptionInitModuleArg(&options->moduleArgs);
ffOptionInitModuleArg(&options->moduleArgs, "󰏖");
options->disabled = FF_PACKAGES_FLAG_WINGET_BIT;
}
+3 -2
View File
@@ -23,10 +23,11 @@ static void formatKey(const FFPhysicalDiskOptions* options, FFPhysicalDiskResult
else
{
ffStrbufClear(key);
FF_PARSE_FORMAT_STRING_CHECKED(key, &options->moduleArgs.key, 3, ((FFformatarg[]){
FF_PARSE_FORMAT_STRING_CHECKED(key, &options->moduleArgs.key, 4, ((FFformatarg[]){
{FF_FORMAT_ARG_TYPE_UINT, &index, "index"},
{FF_FORMAT_ARG_TYPE_STRBUF, &dev->name, "name"},
{FF_FORMAT_ARG_TYPE_STRBUF, &dev->devPath, "dev-path"},
{FF_FORMAT_ARG_TYPE_STRBUF, &options->moduleArgs.keyIcon, "icon"},
}));
}
}
@@ -278,7 +279,7 @@ void ffInitPhysicalDiskOptions(FFPhysicalDiskOptions* options)
ffPrintPhysicalDiskHelpFormat,
ffGeneratePhysicalDiskJsonConfig
);
ffOptionInitModuleArg(&options->moduleArgs);
ffOptionInitModuleArg(&options->moduleArgs, "󰋊");
ffStrbufInit(&options->namePrefix);
options->temp = false;
+1 -1
View File
@@ -178,7 +178,7 @@ void ffInitPhysicalMemoryOptions(FFPhysicalMemoryOptions* options)
ffPrintPhysicalMemoryHelpFormat,
ffGeneratePhysicalMemoryJsonConfig
);
ffOptionInitModuleArg(&options->moduleArgs);
ffOptionInitModuleArg(&options->moduleArgs, "󰑭");
}
void ffDestroyPhysicalMemoryOptions(FFPhysicalMemoryOptions* options)
+1 -1
View File
@@ -156,7 +156,7 @@ void ffInitPlayerOptions(FFPlayerOptions* options)
ffPrintPlayerHelpFormat,
ffGeneratePlayerJsonConfig
);
ffOptionInitModuleArg(&options->moduleArgs);
ffOptionInitModuleArg(&options->moduleArgs, "󰥠");
}
void ffDestroyPlayerOptions(FFPlayerOptions* options)
+1 -1
View File
@@ -151,7 +151,7 @@ void ffInitPowerAdapterOptions(FFPowerAdapterOptions* options)
ffPrintPowerAdapterHelpFormat,
ffGeneratePowerAdapterJsonConfig
);
ffOptionInitModuleArg(&options->moduleArgs);
ffOptionInitModuleArg(&options->moduleArgs, "󰚥");
}
void ffDestroyPowerAdapterOptions(FFPowerAdapterOptions* options)
+1 -1
View File
@@ -100,7 +100,7 @@ void ffInitProcessesOptions(FFProcessesOptions* options)
ffPrintProcessesHelpFormat,
ffGenerateProcessesJsonConfig
);
ffOptionInitModuleArg(&options->moduleArgs);
ffOptionInitModuleArg(&options->moduleArgs, "");
}
void ffDestroyProcessesOptions(FFProcessesOptions* options)
+1 -1
View File
@@ -162,7 +162,7 @@ void ffInitPublicIpOptions(FFPublicIpOptions* options)
ffPrintPublicIpHelpFormat,
ffGeneratePublicIpJsonConfig
);
ffOptionInitModuleArg(&options->moduleArgs);
ffOptionInitModuleArg(&options->moduleArgs, "󰩠");
ffStrbufInit(&options->url);
options->timeout = 0;
+1 -1
View File
@@ -131,7 +131,7 @@ void ffInitShellOptions(FFShellOptions* options)
ffPrintShellHelpFormat,
ffGenerateShellJsonConfig
);
ffOptionInitModuleArg(&options->moduleArgs);
ffOptionInitModuleArg(&options->moduleArgs, "");
}
void ffDestroyShellOptions(FFShellOptions* options)
+1 -1
View File
@@ -250,7 +250,7 @@ void ffInitSoundOptions(FFSoundOptions* options)
ffPrintSoundHelpFormat,
ffGenerateSoundJsonConfig
);
ffOptionInitModuleArg(&options->moduleArgs);
ffOptionInitModuleArg(&options->moduleArgs, "");
options->soundType = FF_SOUND_TYPE_MAIN;
options->percent = (FFColorRangeConfig) { 80, 90 };
+1 -1
View File
@@ -160,7 +160,7 @@ void ffInitSwapOptions(FFSwapOptions* options)
ffPrintSwapHelpFormat,
ffGenerateSwapJsonConfig
);
ffOptionInitModuleArg(&options->moduleArgs);
ffOptionInitModuleArg(&options->moduleArgs, "󰓡");
options->percent = (FFColorRangeConfig) { 50, 80 };
}
+1 -1
View File
@@ -126,7 +126,7 @@ void ffInitTerminalOptions(FFTerminalOptions* options)
ffPrintTerminalHelpFormat,
ffGenerateTerminalJsonConfig
);
ffOptionInitModuleArg(&options->moduleArgs);
ffOptionInitModuleArg(&options->moduleArgs, "");
}
void ffDestroyTerminalOptions(FFTerminalOptions* options)
+1 -1
View File
@@ -144,7 +144,7 @@ void ffInitTerminalFontOptions(FFTerminalFontOptions* options)
ffPrintTerminalFontHelpFormat,
ffGenerateTerminalFontJsonConfig
);
ffOptionInitModuleArg(&options->moduleArgs);
ffOptionInitModuleArg(&options->moduleArgs, "");
}
void ffDestroyTerminalFontOptions(FFTerminalFontOptions* options)
+1 -1
View File
@@ -114,7 +114,7 @@ void ffInitTerminalSizeOptions(FFTerminalSizeOptions* options)
ffPrintTerminalSizeHelpFormat,
ffGenerateTerminalSizeJsonConfig
);
ffOptionInitModuleArg(&options->moduleArgs);
ffOptionInitModuleArg(&options->moduleArgs, "󰲎");
}
void ffDestroyTerminalSizeOptions(FFTerminalSizeOptions* options)
+1 -1
View File
@@ -125,7 +125,7 @@ void ffInitTerminalThemeOptions(FFTerminalThemeOptions* options)
ffPrintTerminalThemeHelpFormat,
ffGenerateTerminalThemeJsonConfig
);
ffOptionInitModuleArg(&options->moduleArgs);
ffOptionInitModuleArg(&options->moduleArgs, "󰔎");
}
void ffDestroyTerminalThemeOptions(FFTerminalThemeOptions* options)
+1 -1
View File
@@ -123,7 +123,7 @@ void ffInitThemeOptions(FFThemeOptions* options)
ffPrintThemeHelpFormat,
ffGenerateThemeJsonConfig
);
ffOptionInitModuleArg(&options->moduleArgs);
ffOptionInitModuleArg(&options->moduleArgs, "󰉼");
}
void ffDestroyThemeOptions(FFThemeOptions* options)
+1 -1
View File
@@ -205,7 +205,7 @@ void ffInitTitleOptions(FFTitleOptions* options)
ffPrintTitleHelpFormat,
ffGenerateTitleJsonConfig
);
ffOptionInitModuleArg(&options->moduleArgs);
ffOptionInitModuleArg(&options->moduleArgs, "");
ffStrbufSetStatic(&options->moduleArgs.key, " ");
options->fqdn = false;
+1 -1
View File
@@ -165,7 +165,7 @@ void ffInitUptimeOptions(FFUptimeOptions* options)
ffPrintUptimeHelpFormat,
ffGenerateUptimeJsonConfig
);
ffOptionInitModuleArg(&options->moduleArgs);
ffOptionInitModuleArg(&options->moduleArgs, "");
}
void ffDestroyUptimeOptions(FFUptimeOptions* options)

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