mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-09-12 18:32:10 +02:00
Compare commits
527 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 5df2a751ea | |||
| 65b9f0005b | |||
| a3e4b4fe22 | |||
| 0749704400 | |||
| 9977cb688d | |||
| 8c26e776c2 | |||
| e174eddef1 | |||
| f866c90687 | |||
| a61a956b84 | |||
| ef73c4a97d | |||
| 79c02ebf7c | |||
| 1394a0ae2e | |||
| e8ebae7ee9 | |||
| 3fae29ba8f | |||
| a9373fb4e4 | |||
| 2e2cf64452 | |||
| 7c3835bd9f | |||
| 945fd3a402 | |||
| 53d2dbd420 | |||
| eaa4721b36 | |||
| f695ae9116 | |||
| b0270f36f9 | |||
| fe5b07e0d0 | |||
| 8396f000e1 | |||
| 1361e8cd18 | |||
| b3ac696312 | |||
| 2205712bc0 | |||
| f1741c66bf | |||
| 3247aabd74 | |||
| 312d4cc518 | |||
| b24877af0b | |||
| 1de97fa3ed | |||
| 6ca65b9166 | |||
| b2cc5c4f04 | |||
| f683351fe3 | |||
| d81cd50f64 | |||
| 1101d2e90e | |||
| 8284d73cc9 | |||
| 6b0db6fa74 | |||
| 3a61b31e0a | |||
| 493cf8ff6c | |||
| e6cf7fdb9f | |||
| 831d2a05ce | |||
| d0b72c5457 | |||
| 0c82a84266 | |||
| d501c8b41a | |||
| 0354fd5d9d | |||
| a856350416 | |||
| 4efe12c0d2 | |||
| 1a66bc4ec0 | |||
| d96d794d1f | |||
| 45659854d2 | |||
| b111626fe9 | |||
| dccbdba242 | |||
| 884fd097c6 | |||
| 08dea9fe21 | |||
| 98fc793386 | |||
| 121e9b911e | |||
| b9fe2fb4dd | |||
| 812a13c871 | |||
| dcbfae7f72 | |||
| 65883766a0 | |||
| 104cb43158 | |||
| 114cc753d9 | |||
| d68c4cef13 | |||
| c549a5cab8 | |||
| cbf8fdf3fc | |||
| 1e8b9aa461 | |||
| 5d32eba1a6 | |||
| 2ce7c8c60d | |||
| 7eaaed6024 | |||
| bd5012edc8 | |||
| cf0d1cf294 | |||
| a070519721 | |||
| fa0007ac6f | |||
| ced67e81a5 | |||
| 88a7468489 | |||
| ec8391f6c6 | |||
| 4371e719ae | |||
| bbbb493cdf | |||
| 6cb565e379 | |||
| 2bb988a7f8 | |||
| 0929b940c8 | |||
| c14ba32b82 | |||
| 7a75615d9e | |||
| 96c58148f6 | |||
| 2c7cd6df98 | |||
| db1fbe0a30 | |||
| a102f0505c | |||
| 8a3af14d22 | |||
| ce648e9e44 | |||
| 2cc94ee095 | |||
| 16dd9fb213 | |||
| 873285b083 | |||
| ce43f06863 | |||
| 3c92e7013d | |||
| 8e5017aa3a | |||
| dc89336fc1 | |||
| 952152edf0 | |||
| 6862747c48 | |||
| f91be6442d | |||
| bdce8ea3a1 | |||
| 44c8fa0470 | |||
| 9f9a5ba39a | |||
| 7c37d719e5 | |||
| cc78d6b16c | |||
| e7b7645f08 | |||
| 6a17ef6a54 | |||
| 5b687727c0 | |||
| 9b038dc848 | |||
| 597dd32caf | |||
| 8d08a65611 | |||
| 263c54a81e | |||
| cba5560068 | |||
| 0703b2b88f | |||
| 86e5572a7e | |||
| 3b3c1a9f63 | |||
| 14b9e88a82 | |||
| bee7c62000 | |||
| 8fa4d7ae6e | |||
| 640d0666fc | |||
| 165b0b0a69 | |||
| dc216362d5 | |||
| 57ffe3bad2 | |||
| cdee6e2997 | |||
| fb03c95d68 | |||
| 5b76a0b45a | |||
| fa5a74c746 | |||
| 4c6e14bcc2 | |||
| deacecdc11 | |||
| 83dcdaa726 | |||
| 2c29465f69 | |||
| f3e48a00a0 | |||
| 9559db556d | |||
| b89eeaa954 | |||
| 7c15d0ce88 | |||
| 036d407708 | |||
| 52715a0ec5 | |||
| 4a6209e0e3 | |||
| 93bdaf10c4 | |||
| 4a75123eb1 | |||
| 7f2ab7310a | |||
| 3c9d9b3c67 | |||
| 7a1b214ffe | |||
| 4fe1bb0b7e | |||
| 2f26045d30 | |||
| 40e67a1d93 | |||
| d7018c2fd3 | |||
| 9e1ba0d104 | |||
| 9f23ce93bd | |||
| f89cbf6bc8 | |||
| e12c6e6fd7 | |||
| 7ba1e3d3d9 | |||
| 672bf0ef54 | |||
| 96ec2b662c | |||
| c3de293450 | |||
| f11b07ba8a | |||
| 4e84153e9d | |||
| 121cbde661 | |||
| 0d71ae7f97 | |||
| 2a49f1d0eb | |||
| 6b7403281b | |||
| 63a0faa1d9 | |||
| 408a2d731a | |||
| 46abc4f5f7 | |||
| 7393bcdf05 | |||
| d282050130 | |||
| c0de618177 | |||
| d1609ea96b | |||
| d869164d6b | |||
| 3b361c663d | |||
| 5bc9a5dc4e | |||
| c0781dd5f8 | |||
| c795c20723 | |||
| 0776dac95b | |||
| 3433043604 | |||
| bd0b108c04 | |||
| 2a9f9d5a34 | |||
| 4f3649e96e | |||
| e4f0efd58c | |||
| 25577a6e58 | |||
| 801bd7c879 | |||
| 89ce598800 | |||
| 9268d8449e | |||
| 179341c30c | |||
| 1947aa2b0e | |||
| 64c53e2cdc | |||
| 7eaefe163a | |||
| beabaa90f1 | |||
| 2f42d64dc9 | |||
| 7d452cc460 | |||
| 5b064f2e7b | |||
| e786cd5d33 | |||
| 6c7efea2fd | |||
| efd9e94138 | |||
| 0707b29326 | |||
| 560e061c25 | |||
| 1d83743259 | |||
| 48bb38ca85 | |||
| d9f084894e | |||
| 765c7b42b6 | |||
| 5060c265a9 | |||
| fca4b3eee8 | |||
| eefed2be9c | |||
| 6a33027892 | |||
| 5e9c0d03ff | |||
| ab84c2ca76 | |||
| 4777f7bec3 | |||
| 1038668db9 | |||
| 49639b6719 | |||
| e5a04ee814 | |||
| fea2d80743 | |||
| 39eccf189c | |||
| 1652ec3512 | |||
| 5a39b69d1d | |||
| fa872d7c9b | |||
| 545267bb7e | |||
| 789f1e34ef | |||
| 9c095967fc | |||
| ddc910e924 | |||
| d628bdea5a | |||
| f9ce2fae0e | |||
| 4f70c16d63 | |||
| f8d5f56dee | |||
| 4d1c62947b | |||
| 8402dba0d9 | |||
| 94b6f0fbd1 | |||
| 3b1b81437e | |||
| a61765c8b1 | |||
| 065b44ff59 | |||
| b0e51ba91d | |||
| b6fff0c946 | |||
| c16373a7d7 | |||
| 73875de6a1 | |||
| 5f1cb16534 | |||
| 013320bcde | |||
| 3415d8197c | |||
| c5fdcc5cfc | |||
| f894856407 | |||
| 313bb02188 | |||
| 4dc0bd583c | |||
| 0ae1bd57bd | |||
| 02f3789eaa | |||
| cec38b9501 | |||
| 3453b72f0c | |||
| 060544b899 | |||
| 14c6b6d7e2 | |||
| 9df394bba3 | |||
| b25ffda90b | |||
| db9cf4ef29 | |||
| 7b2d4b7a0d | |||
| 64cdb3f058 | |||
| 66e7924fa3 | |||
| 84540250f7 | |||
| 96e7f65902 | |||
| 321d3e5574 | |||
| 2bba2eaa16 | |||
| 58ebde422a | |||
| 06f3b9a96d | |||
| fa5aaa692f | |||
| 9d2c4f52d2 | |||
| 9946a5d758 | |||
| a749014e7c | |||
| 2cd421fc2e | |||
| 4db6aebcc9 | |||
| 3b156e819b | |||
| 7ffed9e911 | |||
| 9042950ee8 | |||
| 7aad0dc32f | |||
| 01d04a8fa2 | |||
| d3e50fe595 | |||
| ecd69370ab | |||
| abd2522268 | |||
| 2e1261bc21 | |||
| 0e597a2ded | |||
| 2781a0ab93 | |||
| 02d7f2693b | |||
| b001ea409b | |||
| f97a9fdfc0 | |||
| 2c8d5292d7 | |||
| 88e4579f1e | |||
| 8f97e61f67 | |||
| 0b943bb25e | |||
| 19590003e1 | |||
| 27a1d9f8c6 | |||
| d50ebc86c7 | |||
| 74616c79f5 | |||
| 0c1462898b | |||
| b94a322dfc | |||
| adb6dc537c | |||
| debcc3ca7f | |||
| 3d7d02b5c5 | |||
| 3f0ae13505 | |||
| 4370c0944b | |||
| a9df048d49 | |||
| 09782d67e5 | |||
| 165aa93fd3 | |||
| d979f55c8e | |||
| 4f261509a0 | |||
| 6413656cea | |||
| a334b805fd | |||
| f940ef0592 | |||
| 963b5c6c4e | |||
| 4a74f69c96 | |||
| 18d36c5054 | |||
| a4614ec412 | |||
| e257f876ae | |||
| e9031171c0 | |||
| 47a9cf0450 | |||
| 1704dc62e0 | |||
| abf6c403d4 | |||
| 0606cde061 | |||
| 0bc9149a23 | |||
| 071be4794f | |||
| b5e199d2b2 | |||
| a210128592 | |||
| 63a28cc8f4 | |||
| a6c006221d | |||
| 42b84161d9 | |||
| 88e075ad9d | |||
| e37ad26729 | |||
| b500e9c09b | |||
| 77fbfd3fbd | |||
| 63cdc47d18 | |||
| edf24d9820 | |||
| becd9b7f26 | |||
| 672604081a | |||
| 3185969974 | |||
| ddbafd1cca | |||
| 16d70eed03 | |||
| bf15adf57a | |||
| dbd1f96353 | |||
| 8b3cff33da | |||
| 146c9b2bc6 | |||
| 3c7cb339e2 | |||
| 6318668d0b | |||
| 6737896038 | |||
| 96fc1db85e | |||
| 03e6b47eda | |||
| 067396d3a0 | |||
| a8c3979696 | |||
| 786b23ef52 | |||
| ca6e889a63 | |||
| 439ed07660 | |||
| d435ef6a77 | |||
| e7e5e89207 | |||
| eb1f378a6e | |||
| e2ce06dda2 | |||
| e9bc312b38 | |||
| 9351c48d57 | |||
| 07b3cf325b | |||
| 616c99a05d | |||
| e554ff6e4f | |||
| f013a60cf5 | |||
| bb1586e9a2 | |||
| edba2492e1 | |||
| 57b3c3951e | |||
| cd2a6e0906 | |||
| c180ddab28 | |||
| 77ab00a4f4 | |||
| 4e5c93315a | |||
| 935bea962f | |||
| 1b29f5b3a5 | |||
| d296e53213 | |||
| 5926c259ed | |||
| 2a19067ce7 | |||
| 06aaf0f3fd | |||
| 1d6a48e49a | |||
| 72d332772d | |||
| 255c6a09ac | |||
| 74a364e3f2 | |||
| 76b8446d15 | |||
| 94fb7eabfd | |||
| 6473db86a3 | |||
| 804c61b7c1 | |||
| 898bf1edd9 | |||
| 507caa7b49 | |||
| d05b6a25c3 | |||
| a11f99cce5 | |||
| 1841e1a99d | |||
| d727547b1c | |||
| d35490aeef | |||
| 5539fecb99 | |||
| cff2a18466 | |||
| 8a923835ad | |||
| 2bd507c890 | |||
| 19690656a2 | |||
| 36dc3c7263 | |||
| b38eb705f9 | |||
| 0a899e1e80 | |||
| 218c553841 | |||
| e284fee4aa | |||
| 124823e643 | |||
| dafc4ed3fb | |||
| 1c05e65bc0 | |||
| e0910777af | |||
| df0fb93542 | |||
| 30135570c7 | |||
| 20cef09c73 | |||
| 5bb4dabaec | |||
| ebfcd7195e | |||
| 671f5e2cec | |||
| cf4ed9d9dc | |||
| c4751eb834 | |||
| ff3ddc774e | |||
| 9104db0d21 | |||
| 7eb86b4e95 | |||
| 06fa6033f0 | |||
| f058d70d89 | |||
| 58f7d6fed4 | |||
| 95f8eccebb | |||
| e1245fe2e5 | |||
| 4332b09c8c | |||
| 13b488a33c | |||
| 80fb41a5c8 | |||
| 8371153e79 | |||
| df0608c774 | |||
| 9a6961a706 | |||
| dbe0c84c48 | |||
| 91724c0170 | |||
| 5df5bbf85b | |||
| 896468195a | |||
| b324e4f664 | |||
| 550eeb850c | |||
| 43cb5f3d0c | |||
| 999f52b0b7 | |||
| eae73883db | |||
| 92ffaf77de | |||
| 10f5fa1e7d | |||
| 3f4c03b172 | |||
| ce2280ae54 | |||
| 25cdd9969f | |||
| bf17854535 | |||
| 8440142d75 | |||
| 2e865ad511 | |||
| 51953e4818 | |||
| 10fd7d61ae | |||
| a4c7278f36 | |||
| 93792822c0 | |||
| b308ded1e1 | |||
| f2ff20d69c | |||
| e8ddd33614 | |||
| 1e5a6b2eef | |||
| 84c2564c54 | |||
| 00f7334a3a | |||
| df9144ea31 | |||
| f1eaeddfe1 | |||
| 2c537c836c | |||
| cc1359b1c8 | |||
| d25470e312 | |||
| 899f176f21 | |||
| 2557b0033d | |||
| add3047d1a | |||
| 5cc4379bdf | |||
| 5290dd0187 | |||
| 69181c063e | |||
| 0b75caaf96 | |||
| d860ce528a | |||
| 678e9471e5 | |||
| 4328508e21 | |||
| 96c70ffc8a | |||
| 6d71d3037f | |||
| ba15324849 | |||
| 231c277555 | |||
| c3e5222bcd | |||
| c0c76292cb | |||
| 49840a8f70 | |||
| 44257b7ede | |||
| d7e9094297 | |||
| 1863bde916 | |||
| 7c1b6c6a10 | |||
| 7e8b204644 | |||
| e8dc500f24 | |||
| bb11cff700 | |||
| 90690ba315 | |||
| 3811bb1be4 | |||
| 1f3d18cdbc | |||
| 3ae2047364 | |||
| 66ba5d0a5f | |||
| 983e5c680f | |||
| 745865d66a | |||
| 8bdca1b1a8 | |||
| 5172a13b15 | |||
| 3ba899261f | |||
| 5fa18a8a1c | |||
| 81e0af8999 | |||
| a14a73b259 | |||
| c8451cab52 | |||
| 965777323e | |||
| ad709c4153 | |||
| 0869bfaeed | |||
| dee208f3e3 | |||
| 7e1c426e34 | |||
| 0ae2d389da | |||
| 20b433f40a | |||
| 152f5d3fa6 | |||
| b030bd6751 | |||
| e0d5a9024a | |||
| f83a31e0a6 | |||
| 099e2b5f8f | |||
| 374997b599 | |||
| f938f5e03b | |||
| d7098e728d | |||
| 5302a82444 | |||
| 64a3573c49 | |||
| 3d48de8c98 | |||
| 4b33e1b691 | |||
| 6326405c26 | |||
| b25e8c2721 | |||
| 81318f45bb | |||
| 2f6cabb839 | |||
| 4fd65ad0b8 | |||
| 6ecb383a6a | |||
| 1b3977fc47 | |||
| f00969cb81 | |||
| b3e79477a6 | |||
| 82c7f27ae7 | |||
| 624a4956fc | |||
| 30a5dd52b1 | |||
| 92136370bb | |||
| d196b8079e | |||
| a3dbac7dfc | |||
| 59c853fb01 | |||
| 5ec272acff | |||
| c72fdab301 | |||
| 183f12d8b5 | |||
| 395810cd79 |
+1
-1
@@ -2,4 +2,4 @@
|
||||
check-filenames =
|
||||
builtin = clear,rare,usage,informal
|
||||
skip = */.git,*/cmake-build-*,*/.idea,*/completions,*/presets,*/screenshots,*/tests,*/3rdparty,*/logo/ascii
|
||||
ignore-words-list = iterm,compiletime,unknwn,pengwin,siduction,master,sur,doas
|
||||
ignore-words-list = iterm,compiletime,unknwn,pengwin,siduction,master,sur,doas,conexant
|
||||
|
||||
+2
-2
@@ -7,10 +7,10 @@ tab_width = 4
|
||||
insert_final_newline = true
|
||||
trim_trailing_whitespace = true
|
||||
|
||||
[*.{md,fflogo}]
|
||||
[*.md]
|
||||
trim_trailing_whitespace = false
|
||||
|
||||
[*.{fflogo}]
|
||||
[*.txt]
|
||||
insert_final_newline = false
|
||||
|
||||
[*.yml]
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
github: [LinusDierheimer, CarterLi]
|
||||
github: [CarterLi, LinusDierheimer]
|
||||
|
||||
@@ -7,9 +7,9 @@ assignees: ''
|
||||
|
||||
---
|
||||
|
||||
Be sure to read [FAQ](https://github.com/fastfetch-cli/fastfetch?tab=readme-ov-file#faq) before submitting a new issue.
|
||||
Be sure to read the [FAQ](https://github.com/fastfetch-cli/fastfetch?tab=readme-ov-file#faq) before submitting a new issue.
|
||||
|
||||
<!-- We will try hard to solve the issue. However since platforms and hardwares vary greatly, it can be hard to find the root cause is. Providing following information may help us greatly. Thanks in advance -->
|
||||
<!-- We will try hard to solve the issue. However since platforms and hardwares vary greatly, it can be hard to find the root cause of an issue. Providing the following information may help us greatly. Thanks in advance! -->
|
||||
|
||||
# General description of bug:
|
||||
|
||||
@@ -17,8 +17,8 @@ Be sure to read [FAQ](https://github.com/fastfetch-cli/fastfetch?tab=readme-ov-f
|
||||
* What should happen:
|
||||
* Fastfetch version used: <!-- please use the latest version, if possible -->
|
||||
* Did it work in an older version: <!-- if yes, which version -->
|
||||
* Where did you get the binary: <!-- Github Release / Github Actions / Installed with a package manager (What package manager) / Built from source yourself -->
|
||||
* Does this issue still occurs in [the latest dev build](https://github.com/fastfetch-cli/fastfetch/actions/)?
|
||||
* Where did you get the binary: <!-- GitHub release / GitHub Actions / installed with a package manager (please tell us which package manager you used!) / built from source yourself -->
|
||||
* Does this issue still occur in [the latest dev build](https://github.com/fastfetch-cli/fastfetch/actions/)?
|
||||
|
||||
# Often helpful information:
|
||||
|
||||
@@ -27,7 +27,7 @@ Screenshot:
|
||||
|
||||
The content of the configuration file you use (if any):
|
||||
```
|
||||
//paste here
|
||||
// Paste here
|
||||
```
|
||||
|
||||
Output of `fastfetch -c ci.jsonc --format json`:
|
||||
@@ -36,15 +36,15 @@ Note that this output will contain you public IP. If it is not relevant for the
|
||||
-->
|
||||
|
||||
```
|
||||
//paste here
|
||||
// Paste here
|
||||
```
|
||||
|
||||
Output of `fastfetch --list-features`:
|
||||
```
|
||||
//paste here
|
||||
// Paste here
|
||||
```
|
||||
|
||||
## If fastfatch crashed or freezed
|
||||
## If fastfatch crashed or froze
|
||||
|
||||
Paste the stacktrace here. You may get it with:
|
||||
|
||||
@@ -65,16 +65,16 @@ If you cannot do the instructions above, please upload the core dump file:
|
||||
|
||||
Use `time fastfetch --stat` to show time usage for each module.
|
||||
|
||||
## If my image logo didn't show / work
|
||||
## If an image or logo didn't show
|
||||
|
||||
<!-- Please make sure the terminal does support the image protocol you used. Note Gnome terminal doesn't support any image protocols -->
|
||||
<!-- Please make sure your terminal supports the image protocol you used. Note that GNOME Terminal doesn't support any image protocols. -->
|
||||
|
||||
* The image protocol you used:
|
||||
* The terminal you used:
|
||||
* Upload the image file here, or paste the image URL:
|
||||
* Does it work with `--logo-width {WIDTH} --logo-height {HEIGHT}`?
|
||||
|
||||
## If fastfetch behaves incorrectly on shell starting
|
||||
## If fastfetch behaves incorrectly on shell startup
|
||||
|
||||
* The bug is reproduceable with fresh / clean shell configuration (i.e. `fastfetch` is the single line of `.zshrc` or `~/.config/fish/config.fish`):
|
||||
* The bug is reproducible with a clean shell configuration (i.e. `fastfetch` is the only line in `.zshrc` or `~/.config/fish/config.fish`):
|
||||
* Does `sleep 1` before running `fastfetch` work?
|
||||
|
||||
@@ -7,23 +7,7 @@ assignees: ''
|
||||
|
||||
---
|
||||
|
||||
## Before requesting a new feature
|
||||
|
||||
* A lot of features are not enabled by default. Please try `fastfetch --list-modules` and `fastfetch -c all.jsonc` to see if it has been supported
|
||||
* Fastfetch supports `Command` module, which can be used to grab output from a custom shell script. Please check if it fits your needs
|
||||
|
||||
```jsonc
|
||||
// ~/.config/fastfetch/fastfetch.jsonc
|
||||
{
|
||||
"modules": [
|
||||
{
|
||||
"type": "command",
|
||||
"text": "/path/to/your/script",
|
||||
"key": "Feature Title"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
Be sure to read [FAQ](https://github.com/fastfetch-cli/fastfetch?tab=readme-ov-file#faq) before submitting a new issue.
|
||||
|
||||
## Wanted features:
|
||||
|
||||
|
||||
@@ -15,6 +15,9 @@ Paste content of /etc/os-release and /etc/lsb-release here. If none of these fil
|
||||
```
|
||||
|
||||
# Ascii
|
||||
|
||||
An ASCII logo should not take up too much space (smaller than 50x20 characters). Please also include the color codes if not available in `os-release`
|
||||
|
||||
```
|
||||
Paste ascii art here.
|
||||
```
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
# Number of days of inactivity before an issue becomes stale
|
||||
daysUntilStale: 60
|
||||
|
||||
# Number of days of inactivity before a stale issue is closed
|
||||
daysUntilClose: 7
|
||||
|
||||
# Issues with these labels will never be considered stale
|
||||
exemptLabels:
|
||||
- keepalive
|
||||
|
||||
# Label to use when marking an issue as stale
|
||||
staleLabel: stale
|
||||
|
||||
# Comment to post when marking an issue as stale. Set to `false` to disable
|
||||
markComment: >
|
||||
This issue has been automatically marked as stale because it has not had
|
||||
recent activity. It will be closed if no further activity occurs. Thank you
|
||||
for your contributions.
|
||||
|
||||
# Comment to post when closing a stale issue. Set to `false` to disable
|
||||
closeComment: false
|
||||
+104
-63
@@ -35,7 +35,7 @@ jobs:
|
||||
run: uname -a
|
||||
|
||||
- name: configure project
|
||||
run: cmake -DSET_TWEAK=Off -DBUILD_TESTS=On -DCMAKE_INSTALL_PREFIX=/usr . -DENABLE_VULKAN=OFF -DENABLE_WAYLAND=OFF -DENABLE_XCB_RANDR=OFF -DENABLE_XCB=OFF -DENABLE_XRANDR=OFF -DENABLE_X11=OFF -DENABLE_DRM=OFF -DENABLE_GIO=OFF -DENABLE_DCONF=OFF -DENABLE_DBUS=OFF -DENABLE_XFCONF=OFF -DENABLE_SQLITE3=OFF -DENABLE_RPM=OFF -DENABLE_IMAGEMAGICK7=OFF -DENABLE_IMAGEMAGICK6=OFF -DENABLE_CHAFA=OFF -DENABLE_ZLIB=OFF -DENABLE_EGL=OFF -DENABLE_GLX=OFF -DENABLE_OSMESA=OFF -DENABLE_OPENCL=OFF -DENABLE_LIBNM=OFF -DENABLE_FREETYPE=OFF -DENABLE_PULSE=OFF -DENABLE_DDCUTIL=OFF -DENABLE_DIRECTX_HEADERS=OFF -DENABLE_THREADS=OFF
|
||||
run: cmake -DSET_TWEAK=Off -DBUILD_TESTS=On -DCMAKE_INSTALL_PREFIX=/usr . -DENABLE_VULKAN=OFF -DENABLE_WAYLAND=OFF -DENABLE_XCB_RANDR=OFF -DENABLE_XCB=OFF -DENABLE_XRANDR=OFF -DENABLE_X11=OFF -DENABLE_DRM=OFF -DENABLE_GIO=OFF -DENABLE_DCONF=OFF -DENABLE_DBUS=OFF -DENABLE_XFCONF=OFF -DENABLE_SQLITE3=OFF -DENABLE_RPM=OFF -DENABLE_IMAGEMAGICK7=OFF -DENABLE_IMAGEMAGICK6=OFF -DENABLE_CHAFA=OFF -DENABLE_ZLIB=OFF -DENABLE_EGL=OFF -DENABLE_GLX=OFF -DENABLE_OSMESA=OFF -DENABLE_OPENCL=OFF -DENABLE_FREETYPE=OFF -DENABLE_PULSE=OFF -DENABLE_DDCUTIL=OFF -DENABLE_ELF=OFF -DENABLE_DIRECTX_HEADERS=OFF -DENABLE_THREADS=OFF
|
||||
|
||||
- name: build project
|
||||
run: cmake --build . --target package --verbose -j4
|
||||
@@ -44,7 +44,7 @@ jobs:
|
||||
run: ./fastfetch --list-features
|
||||
|
||||
- name: run fastfetch
|
||||
run: time ./fastfetch -c presets/ci.jsonc
|
||||
run: time ./fastfetch -c presets/ci.jsonc --stat false
|
||||
|
||||
- name: run fastfetch --format json
|
||||
run: time ./fastfetch -c presets/ci.jsonc --format json
|
||||
@@ -74,7 +74,7 @@ jobs:
|
||||
run: uname -a
|
||||
|
||||
- name: install required packages
|
||||
run: sudo apt-get update && sudo apt-get install -y libvulkan-dev libwayland-dev libxrandr-dev libxcb-randr0-dev libdconf-dev libdbus-1-dev libmagickcore-dev libxfconf-0-dev libsqlite3-dev librpm-dev libegl-dev libglx-dev libosmesa6-dev ocl-icd-opencl-dev libnm-dev libpulse-dev libdrm-dev directx-headers-dev
|
||||
run: sudo apt-get update && sudo apt-get install -y libvulkan-dev libwayland-dev libxrandr-dev libxcb-randr0-dev libdconf-dev libdbus-1-dev libmagickcore-dev libxfconf-0-dev libsqlite3-dev librpm-dev libegl-dev libglx-dev libosmesa6-dev ocl-icd-opencl-dev libpulse-dev libdrm-dev libelf-dev directx-headers-dev
|
||||
|
||||
- name: install linuxbrew packages
|
||||
run: |
|
||||
@@ -99,7 +99,7 @@ jobs:
|
||||
run: ./fastfetch --list-features
|
||||
|
||||
- name: run fastfetch
|
||||
run: time ./fastfetch -c presets/ci.jsonc
|
||||
run: time ./fastfetch -c presets/ci.jsonc --stat false
|
||||
|
||||
- name: run fastfetch --format json
|
||||
run: time ./fastfetch -c presets/ci.jsonc --format json
|
||||
@@ -138,15 +138,15 @@ jobs:
|
||||
id: runcmd
|
||||
with:
|
||||
arch: aarch64
|
||||
distro: ubuntu22.04
|
||||
distro: ubuntu20.04
|
||||
githubToken: ${{ github.token }}
|
||||
run: |
|
||||
uname -a
|
||||
apt-get update && apt-get install -y cmake make g++ libvulkan-dev libwayland-dev libxrandr-dev libxcb-randr0-dev libdconf-dev libdbus-1-dev libmagickcore-dev libxfconf-0-dev libsqlite3-dev librpm-dev libegl-dev libglx-dev libosmesa6-dev ocl-icd-opencl-dev libnm-dev libpulse-dev libdrm-dev libddcutil-dev libchafa-dev directx-headers-dev rpm
|
||||
apt-get update && apt-get install -y cmake make g++ libvulkan-dev libwayland-dev libxrandr-dev libxcb-randr0-dev libdconf-dev libdbus-1-dev libmagickcore-dev libxfconf-0-dev libsqlite3-dev librpm-dev libegl-dev libglx-dev libosmesa6-dev ocl-icd-opencl-dev libpulse-dev libdrm-dev libelf-dev directx-headers-dev rpm
|
||||
cmake -DSET_TWEAK=Off -DBUILD_TESTS=On -DCMAKE_INSTALL_PREFIX=/usr .
|
||||
cmake --build . --target package --verbose -j4
|
||||
./fastfetch --list-features
|
||||
time ./fastfetch -c presets/ci.jsonc
|
||||
time ./fastfetch -c presets/ci.jsonc --stat false
|
||||
time ./fastfetch -c presets/ci.jsonc --format json
|
||||
time ./flashfetch
|
||||
ldd fastfetch
|
||||
@@ -181,11 +181,11 @@ jobs:
|
||||
# CMake installed by apt has bug `list sub-command REMOVE_ITEM requires two or more arguments`
|
||||
wget --no-check-certificate https://apt.kitware.com/ubuntu/pool/main/c/cmake/{cmake_3.29.2-0kitware1ubuntu20.04.1_armhf.deb,cmake-data_3.29.2-0kitware1ubuntu20.04.1_all.deb}
|
||||
dpkg -i *.deb
|
||||
apt-get install -y make g++ libvulkan-dev libwayland-dev libxrandr-dev libxcb-randr0-dev libdconf-dev libdbus-1-dev libmagickcore-dev libxfconf-0-dev libsqlite3-dev librpm-dev libegl-dev libglx-dev libosmesa6-dev ocl-icd-opencl-dev libnm-dev libpulse-dev libdrm-dev directx-headers-dev rpm
|
||||
apt-get install -y make g++ libvulkan-dev libwayland-dev libxrandr-dev libxcb-randr0-dev libdconf-dev libdbus-1-dev libmagickcore-dev libxfconf-0-dev libsqlite3-dev librpm-dev libegl-dev libglx-dev libosmesa6-dev ocl-icd-opencl-dev libpulse-dev libdrm-dev libelf-dev directx-headers-dev rpm
|
||||
cmake -DSET_TWEAK=Off -DBUILD_TESTS=On -DCMAKE_INSTALL_PREFIX=/usr .
|
||||
cmake --build . --target package --verbose -j4
|
||||
./fastfetch --list-features
|
||||
time ./fastfetch -c presets/ci.jsonc
|
||||
time ./fastfetch -c presets/ci.jsonc --stat false
|
||||
time ./fastfetch -c presets/ci.jsonc --format json
|
||||
time ./flashfetch
|
||||
ldd fastfetch
|
||||
@@ -197,6 +197,41 @@ jobs:
|
||||
name: fastfetch-linux-armv7
|
||||
path: ./fastfetch-*.*
|
||||
|
||||
linux-riscv64:
|
||||
name: Linux-riscv64
|
||||
runs-on: ubuntu-22.04
|
||||
permissions:
|
||||
security-events: write
|
||||
contents: read
|
||||
steps:
|
||||
- name: checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: run VM
|
||||
uses: uraimo/run-on-arch-action@v2
|
||||
id: runcmd
|
||||
with:
|
||||
arch: riscv64
|
||||
distro: ubuntu22.04
|
||||
githubToken: ${{ github.token }}
|
||||
run: |
|
||||
uname -a
|
||||
apt-get update && apt-get install -y cmake make g++ libvulkan-dev libwayland-dev libxrandr-dev libxcb-randr0-dev libdconf-dev libdbus-1-dev libmagickcore-dev libxfconf-0-dev libsqlite3-dev librpm-dev libegl-dev libglx-dev libosmesa6-dev ocl-icd-opencl-dev libpulse-dev libdrm-dev libddcutil-dev libchafa-dev libelf-dev directx-headers-dev rpm
|
||||
cmake -DSET_TWEAK=Off -DBUILD_TESTS=On -DCMAKE_INSTALL_PREFIX=/usr .
|
||||
cmake --build . --target package --verbose -j4
|
||||
./fastfetch --list-features
|
||||
time ./fastfetch -c presets/ci.jsonc --stat false
|
||||
time ./fastfetch -c presets/ci.jsonc --format json
|
||||
time ./flashfetch
|
||||
ldd fastfetch
|
||||
ctest
|
||||
|
||||
- name: upload artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: fastfetch-linux-riscv64
|
||||
path: ./fastfetch-*.*
|
||||
|
||||
musl-amd64:
|
||||
name: Musl-amd64
|
||||
runs-on: ubuntu-latest
|
||||
@@ -205,12 +240,14 @@ jobs:
|
||||
|
||||
- name: setup alpine linux
|
||||
uses: jirutka/setup-alpine@master
|
||||
with:
|
||||
branch: v3.19
|
||||
|
||||
- name: install dependencies
|
||||
run: |
|
||||
cat /etc/alpine-release
|
||||
uname -a
|
||||
apk add cmake samurai vulkan-loader-dev libxcb-dev wayland-dev libdrm-dev dconf-dev imagemagick-dev chafa-dev zlib-dev dbus-dev mesa-dev opencl-dev xfconf-dev sqlite-dev networkmanager-dev pulseaudio-dev ddcutil-dev gcc g++
|
||||
apk add cmake samurai vulkan-loader-dev libxcb-dev wayland-dev libdrm-dev dconf-dev imagemagick-dev chafa-dev zlib-dev dbus-dev mesa-dev opencl-dev xfconf-dev sqlite-dev networkmanager-dev pulseaudio-dev ddcutil-dev elfutils-dev gcc g++
|
||||
shell: alpine.sh --root {0}
|
||||
|
||||
- name: build
|
||||
@@ -222,7 +259,7 @@ jobs:
|
||||
- name: run
|
||||
run: |
|
||||
./fastfetch --list-features
|
||||
time ./fastfetch -c presets/ci.jsonc
|
||||
time ./fastfetch -c presets/ci.jsonc --stat false
|
||||
time ./fastfetch -c presets/ci.jsonc --format json
|
||||
time ./flashfetch
|
||||
ldd fastfetch
|
||||
@@ -244,13 +281,14 @@ jobs:
|
||||
- name: setup alpine linux
|
||||
uses: jirutka/setup-alpine@master
|
||||
with:
|
||||
branch: v3.19
|
||||
arch: aarch64
|
||||
|
||||
- name: install dependencies
|
||||
run: |
|
||||
cat /etc/alpine-release
|
||||
uname -a
|
||||
apk add cmake samurai vulkan-loader-dev libxcb-dev wayland-dev libdrm-dev dconf-dev imagemagick-dev chafa-dev zlib-dev dbus-dev mesa-dev opencl-dev xfconf-dev sqlite-dev networkmanager-dev pulseaudio-dev ddcutil-dev gcc g++
|
||||
apk add cmake samurai vulkan-loader-dev libxcb-dev wayland-dev libdrm-dev dconf-dev imagemagick-dev chafa-dev zlib-dev dbus-dev mesa-dev opencl-dev xfconf-dev sqlite-dev networkmanager-dev pulseaudio-dev ddcutil-dev elfutils-dev gcc g++
|
||||
shell: alpine.sh --root {0}
|
||||
|
||||
- name: build
|
||||
@@ -262,7 +300,7 @@ jobs:
|
||||
- name: run
|
||||
run: |
|
||||
./fastfetch --list-features
|
||||
time ./fastfetch -c presets/ci.jsonc
|
||||
time ./fastfetch -c presets/ci.jsonc --stat false
|
||||
time ./fastfetch -c presets/ci.jsonc --format json
|
||||
time ./flashfetch
|
||||
ldd fastfetch
|
||||
@@ -310,7 +348,7 @@ jobs:
|
||||
run: ./fastfetch --list-features
|
||||
|
||||
- name: run fastfetch
|
||||
run: time ./fastfetch -c presets/ci.jsonc
|
||||
run: time ./fastfetch -c presets/ci.jsonc --stat false
|
||||
|
||||
- name: run fastfetch --format json
|
||||
run: time ./fastfetch -c presets/ci.jsonc --format json
|
||||
@@ -330,6 +368,39 @@ jobs:
|
||||
name: fastfetch-macos-universal
|
||||
path: ./fastfetch-*.*
|
||||
|
||||
sunos-amd64:
|
||||
runs-on: ubuntu-latest
|
||||
name: SunOS-amd64
|
||||
steps:
|
||||
- name: checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: run VM
|
||||
uses: vmactions/omnios-vm@v1
|
||||
with:
|
||||
usesh: true
|
||||
prepare: |
|
||||
uname -a
|
||||
pkg update --accept
|
||||
pkg install gcc13 cmake git pkg-config glib2 dbus sqlite-3 imagemagick
|
||||
|
||||
run: |
|
||||
cmake -DSET_TWEAK=Off -DBUILD_TESTS=On .
|
||||
cmake --build . --target package --verbose -j4
|
||||
./fastfetch --list-features
|
||||
time ./fastfetch
|
||||
time ./fastfetch --format json
|
||||
time ./flashfetch
|
||||
ldd fastfetch
|
||||
ctest
|
||||
cpack
|
||||
|
||||
- name: upload artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: fastfetch-sunos-amd64
|
||||
path: ./fastfetch-*.*
|
||||
|
||||
freebsd-amd64:
|
||||
name: FreeBSD-amd64
|
||||
runs-on: ubuntu-latest
|
||||
@@ -345,13 +416,13 @@ jobs:
|
||||
with:
|
||||
operating_system: freebsd
|
||||
architecture: x86-64
|
||||
cpu_count: 3
|
||||
cpu_count: 4
|
||||
shell: bash
|
||||
version: '13.2'
|
||||
version: '14.1'
|
||||
run: |
|
||||
uname -a
|
||||
sudo pkg update
|
||||
sudo pkg install -y cmake git pkgconf binutils wayland vulkan-headers vulkan-loader libxcb libXrandr libX11 libdrm glib dconf dbus sqlite3-tcl xfce4-conf ImageMagick6 ImageMagick7 chafa egl libosmesa opencl ocl-icd v4l_compat
|
||||
sudo pkg install -y cmake git pkgconf binutils wayland vulkan-headers vulkan-loader libxcb libXrandr libX11 libdrm libelf glib dconf dbus sqlite3-tcl xfce4-conf ImageMagick6 ImageMagick7 chafa egl libosmesa opencl ocl-icd v4l_compat
|
||||
cmake -DSET_TWEAK=Off -DBUILD_TESTS=On .
|
||||
cmake --build . --target package --verbose -j4
|
||||
./fastfetch --list-features
|
||||
@@ -367,43 +438,6 @@ jobs:
|
||||
name: fastfetch-freebsd-amd64
|
||||
path: ./fastfetch-*.*
|
||||
|
||||
freebsd-aarch64:
|
||||
name: FreeBSD-aarch64
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
security-events: write
|
||||
contents: read
|
||||
steps:
|
||||
- name: checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: run VM
|
||||
uses: cross-platform-actions/action@master
|
||||
with:
|
||||
operating_system: freebsd
|
||||
architecture: arm64
|
||||
cpu_count: 3
|
||||
shell: bash
|
||||
version: '13.2'
|
||||
run: |
|
||||
uname -a
|
||||
sudo pkg update
|
||||
sudo pkg install -y cmake git pkgconf binutils wayland vulkan-headers vulkan-loader libxcb libXrandr libX11 libdrm glib dconf dbus sqlite3-tcl xfce4-conf ImageMagick6 ImageMagick7 chafa egl libosmesa opencl ocl-icd v4l_compat
|
||||
cmake -DSET_TWEAK=Off -DBUILD_TESTS=On .
|
||||
cmake --build . --target package --verbose -j4
|
||||
./fastfetch --list-features
|
||||
time ./fastfetch
|
||||
time ./fastfetch --format json
|
||||
time ./flashfetch
|
||||
ldd fastfetch
|
||||
ctest
|
||||
|
||||
- name: upload artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: fastfetch-freebsd-aarch64
|
||||
path: ./fastfetch-*.*
|
||||
|
||||
windows-amd64:
|
||||
name: Windows-amd64
|
||||
runs-on: windows-latest
|
||||
@@ -422,7 +456,7 @@ jobs:
|
||||
with:
|
||||
msystem: CLANG64
|
||||
update: true
|
||||
install: git mingw-w64-clang-x86_64-7zip mingw-w64-clang-x86_64-cmake mingw-w64-clang-x86_64-clang mingw-w64-clang-x86_64-vulkan-loader mingw-w64-clang-x86_64-vulkan-headers mingw-w64-clang-x86_64-opencl-icd
|
||||
install: git mingw-w64-clang-x86_64-7zip mingw-w64-clang-x86_64-cmake mingw-w64-clang-x86_64-clang mingw-w64-clang-x86_64-vulkan-loader mingw-w64-clang-x86_64-vulkan-headers mingw-w64-clang-x86_64-opencl-icd mingw-w64-clang-x86_64-opencl-headers mingw-w64-clang-x86_64-cppwinrt
|
||||
|
||||
- name: print msys version
|
||||
run: uname -a
|
||||
@@ -436,11 +470,14 @@ jobs:
|
||||
- name: copy necessary dlls
|
||||
run: cp /clang64/bin/{OpenCL,vulkan-1}.dll .
|
||||
|
||||
- name: download amd_ags
|
||||
run: curl -LO https://github.com/GPUOpen-LibrariesAndSDKs/AGS_SDK/raw/master/ags_lib/lib/amd_ags_x64.dll
|
||||
|
||||
- name: list features
|
||||
run: ./fastfetch --list-features
|
||||
|
||||
- name: run fastfetch
|
||||
run: time ./fastfetch -c presets/ci.jsonc
|
||||
run: time ./fastfetch -c presets/ci.jsonc --stat false
|
||||
|
||||
- name: run fastfetch --format json
|
||||
run: time ./fastfetch -c presets/ci.jsonc --format json
|
||||
@@ -455,10 +492,10 @@ jobs:
|
||||
run: ctest
|
||||
|
||||
- name: create zip archive
|
||||
run: 7z a -tzip -mx9 -bd -y fastfetch-windows-amd64.zip *.dll fastfetch.exe flashfetch.exe presets
|
||||
run: 7z a -tzip -mx9 -bd -y fastfetch-windows-amd64.zip LICENSE *.dll fastfetch.exe flashfetch.exe presets
|
||||
|
||||
- name: create 7z archive
|
||||
run: 7z a -t7z -mx9 -bd -y fastfetch-windows-amd64.7z *.dll fastfetch.exe flashfetch.exe presets
|
||||
run: 7z a -t7z -mx9 -bd -y fastfetch-windows-amd64.7z LICENSE *.dll fastfetch.exe flashfetch.exe presets
|
||||
|
||||
- name: upload artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
@@ -484,7 +521,7 @@ jobs:
|
||||
with:
|
||||
msystem: CLANG32
|
||||
update: true
|
||||
install: git p7zip mingw-w64-clang-i686-cmake mingw-w64-clang-i686-clang mingw-w64-clang-i686-vulkan-loader mingw-w64-clang-i686-vulkan-headers mingw-w64-clang-i686-opencl-icd
|
||||
install: git p7zip mingw-w64-clang-i686-cmake mingw-w64-clang-i686-clang mingw-w64-clang-i686-vulkan-loader mingw-w64-clang-i686-vulkan-headers mingw-w64-clang-i686-opencl-icd mingw-w64-clang-i686-opencl-headers
|
||||
|
||||
- name: print msys version
|
||||
run: uname -a
|
||||
@@ -506,8 +543,11 @@ jobs:
|
||||
- name: copy necessary dlls
|
||||
run: cp /clang32/bin/{OpenCL,vulkan-1}.dll .
|
||||
|
||||
- name: download amd_ags
|
||||
run: curl -LO https://github.com/GPUOpen-LibrariesAndSDKs/AGS_SDK/raw/master/ags_lib/lib/amd_ags_x86.dll
|
||||
|
||||
- name: run fastfetch
|
||||
run: time ./fastfetch -c presets/ci.jsonc
|
||||
run: time ./fastfetch -c presets/ci.jsonc --stat false
|
||||
|
||||
- name: run fastfetch --format json
|
||||
run: time ./fastfetch -c presets/ci.jsonc --format json
|
||||
@@ -522,10 +562,10 @@ jobs:
|
||||
run: ctest
|
||||
|
||||
- name: create zip archive
|
||||
run: 7z a -tzip -mx9 -bd -y fastfetch-windows-i686.zip *.dll fastfetch.exe flashfetch.exe presets
|
||||
run: 7z a -tzip -mx9 -bd -y fastfetch-windows-i686.zip LICENSE *.dll fastfetch.exe flashfetch.exe presets
|
||||
|
||||
- name: create 7z archive
|
||||
run: 7z a -t7z -mx9 -bd -y fastfetch-windows-i686.7z *.dll fastfetch.exe flashfetch.exe presets
|
||||
run: 7z a -t7z -mx9 -bd -y fastfetch-windows-i686.7z LICENSE *.dll fastfetch.exe flashfetch.exe presets
|
||||
|
||||
- name: upload artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
@@ -541,11 +581,12 @@ jobs:
|
||||
- linux-amd64
|
||||
- linux-aarch64
|
||||
- linux-armv7
|
||||
- linux-riscv64
|
||||
- musl-amd64
|
||||
- musl-aarch64
|
||||
- macos-universal
|
||||
- freebsd-amd64
|
||||
- freebsd-aarch64
|
||||
- sunos-amd64
|
||||
- windows-amd64
|
||||
- windows-i686
|
||||
permissions:
|
||||
|
||||
@@ -8,3 +8,4 @@ cscope.*
|
||||
tags
|
||||
fastfetch.kdev4
|
||||
*.user
|
||||
*.user.*
|
||||
|
||||
+393
-6
@@ -1,3 +1,390 @@
|
||||
# 2.21.1
|
||||
|
||||
Hotfix for a regression that breaks WM detection when running `startx` from TTY (Regression from 2.21.0, #1172 / #1162)
|
||||
|
||||
Changes:
|
||||
* On Linux, FreeBSD and SunOS, a new recommended dependency `libelf` is introduced to extract strings in ELF binary, used for
|
||||
* st term font detection when the term font is compiled directly into the binary
|
||||
* fast path of systemd version detection
|
||||
|
||||
Features:
|
||||
* Improve performance of
|
||||
* kitty version detection (Terminal, Linux)
|
||||
* st term font detection (TerminalFont, Linux)
|
||||
* systemd version detection (InitSystem, Linux)
|
||||
|
||||
Bugfixes:
|
||||
* Fix building error without `linux/wireless.h` (Wifi, Linux)
|
||||
* Fix wrong GPU max frequency on Asahi Linux (GPU, Linux)
|
||||
* Don't rely `$XDG_SESSION_TYPE` for detecting wm protocol (#1172 / #1162, WM, Linux)
|
||||
* Fix light color doesn't work on Linux console (Colors, Linux)
|
||||
* `LC_ALL`, if set, overrides every other locale-related environment variable (Locale)
|
||||
* Increase timeout of DBus calls (Linux)
|
||||
|
||||
Logos:
|
||||
* Add vanilla_small and vanilla2
|
||||
* Add LFS (Linux From Scratch)
|
||||
|
||||
# 2.21.0
|
||||
|
||||
Changes:
|
||||
* We no longer use `libnm` for Wifi detection on Linux. Instead, we use `libdbus` to communicate with NetworkManager directly
|
||||
* To package managers: libnm dependency should be removed
|
||||
|
||||
Features:
|
||||
* Add module `BluetoothRadio` that prints bluetooth radios installed on the system
|
||||
* Don't confuse with module `Bluetooth` which lists connected bluetooth devices
|
||||
* Detect more information when `--gpu-driver-specific` is used (GPU)
|
||||
* Detect which type of nvidia driver (open source or proprietary) is used (GPU, Linux)
|
||||
* `--gpu-driver-specific` adds supports for Moore Threads GPU (#1142, GPU, Linux / Windows)
|
||||
* Use SetupAPI for detecting GPUs to support GPU detection when running fastfetch as a Windows Service (GPU, Windows)
|
||||
* See https://github.com/gpustack/gpustack/pull/97#issuecomment-2264699787 for detail
|
||||
* Detect playback status (Media, Linux)
|
||||
|
||||
Bugfixes:
|
||||
* Don't try to connect display server in tty mode (Linux, #1110)
|
||||
* Improve ssh detection
|
||||
* Fix max frequency printing in custom format (CPU)
|
||||
* Fix displaying random characters when detecting kitty term font (#1136 / #1145, TerminalFont, Linux)
|
||||
* Make sure to detect all physical memory devices (#1137)
|
||||
* Don't detect `wl-restart` as WM (#1135, WM, Linux)
|
||||
* Use PCI bus ID to match Nvidia cards; fix multi-GPU detection (GPU)
|
||||
* Ignore invalid GPU (#1066, GPU, macOS)
|
||||
* Print error when invalid color code is found (#1138)
|
||||
* Fix invalid refresh rate detection on old macOS versions (Display, macOS)
|
||||
* Fix disk size detection on 32-bit systems (Disk, BSD)
|
||||
* Don't ignore disabled GPUs (#1140, GPU, Linux)
|
||||
* Fix GPU type detection on FreeBSD (GPU, FreeBSD)
|
||||
* Remove shell version detection for unknown shells (#1144, Shell)
|
||||
* Don't detect hyfetch as shell on NixOS (Shell, NixOS)
|
||||
|
||||
Logos:
|
||||
* Update EndeavourOS_small
|
||||
* Add QTS
|
||||
|
||||
# 2.20.0
|
||||
|
||||
This release fixes regression of `2.19.0` on M1 MacBook Air. It also introduces a new option `--key-type icon` to display predefined icons in keys (requires newest nerd font). See `fastfetch -h key-type` for detail.
|
||||
|
||||
Changes:
|
||||
* JSON option `display.keyWidth` has been renamed to `display.key.width`
|
||||
* Previously: `{ "display": { "keyWidth": 3 } }`
|
||||
* Now: `{ "display": { "key": { "width": 3 } } }`
|
||||
* Windows Terminal font detection **in WSL** has been removed due to [issue #1113](https://github.com/fastfetch-cli/fastfetch/issues/1113)
|
||||
|
||||
Features:
|
||||
* Add option `display.key.type: <enum>` to print icons in keys
|
||||
* Supported value `string`, `icon` and `both`. Default to `string` (don't display icons)
|
||||
* Example: `{ "display": { "key": { "type": "icon" } } }`
|
||||
* Add option `display.key.paddingLeft: <num>` to print left padding (whitespaces) in keys
|
||||
* Example: `{ "display": { "key": { "paddingLeft": 2 } } }`
|
||||
* Add option `modules.keyIcon` to set icon for specified module
|
||||
* Example: `{ "modules": { "type": "command", "keyIcon": "🔑" } }`
|
||||
* Report system mono font name for Terminator if used (TerminalFont, Linux)
|
||||
* Don't require logo height to be set when using `--logo-position right`
|
||||
* Report Snapdragon SOC marketing name for newer Android phones (CPU, Android)
|
||||
* Detect MTK SOC part name (CPU, Android)
|
||||
|
||||
Bugfixes:
|
||||
* Don't wake up suspended GPUs when using `--ds-force-drm` (Display, Linux)
|
||||
* Fix printing editor type in JSON result (Editor)
|
||||
* Fix `--logo-padding-*` not working correctly (#1121, Logo)
|
||||
* Fix possible segfault when detecting GPU frequency (#1121, macOS, GPU)
|
||||
|
||||
# 2.19.1
|
||||
|
||||
Bugfixes
|
||||
* Fix frequency value printing when using custom format (#1111, CPU / GPU)
|
||||
* Fix display detection for XiaoMi Android phone (Display, Android)
|
||||
|
||||
Features:
|
||||
* Display if HDR mode is enabled for screens (Display)
|
||||
* Supported in Windows and Linux (KDE) correctly
|
||||
|
||||
# 2.19.0
|
||||
|
||||
Changes:
|
||||
* JSON option `modules.cpu.freqNdigits` has been renamed and moved to `display.freq.ndigits`
|
||||
* Previously: `{ "modules": { "type": "cpu", "freqNdigits": 2 } }`
|
||||
* Now: `{ "display": { "freq": { "ndigits": 2 } } }`
|
||||
* This option now affects GPU frequency too
|
||||
* By default, frequencies are displayed in *GHz*. Set `display.freq.ndigits` to `-1` to display them in *MHz*
|
||||
* JSON option `display.binaryPrefix` has been moved to `display.size.binaryPrefix`
|
||||
* Previously: `{ "display": { "binaryPrefix": "IEC" } }`
|
||||
* Now: `{ "display": { "size": { "binaryPrefix": "IEC" } } }`
|
||||
|
||||
Features:
|
||||
* Print physical diagonal length if supported (Display)
|
||||
* Detect display type in X11 mode (Display)
|
||||
* Assume displays connected via DisplayPort are external monitors (Display, Linux)
|
||||
* Support GPU frequency detection for Intel XE driver (GPU, Linux)
|
||||
* Detect init system on Android (InitSystem, Android)
|
||||
* Use background to display color blocks (Colors)
|
||||
* To fix weird vertical black lines in some terminals and match the behavior of neofetch (#1094)
|
||||
* Can be reverted to old behavior with `--colors-symbol block`
|
||||
* Support Zed terminal version detection (Terminal)
|
||||
* Improve wezterm font detection (TerminalFont)
|
||||
* Add option `--separator-length`
|
||||
* Support GPU frequency detection for Apple Silicon (GPU, macOS)
|
||||
* Detect maximum refresh rate (#1101, Monitor)
|
||||
* Detect if HDR mode is supported and enabled (Windows, Display / Monitor)
|
||||
* Support physical monitor info detection for FreeBSD and SunOS (Monitor)
|
||||
* Support defining constant strings in JSON config file, which can be used to dedupe formattion strings
|
||||
```jsonc
|
||||
{
|
||||
"display": {
|
||||
"constants": [
|
||||
"Hello", // {$1}
|
||||
"world" // {$2}
|
||||
]
|
||||
},
|
||||
"modules": [
|
||||
{
|
||||
"type": "custom",
|
||||
"format": "{$1} {$2}!" // print "Hello world!"
|
||||
},
|
||||
{
|
||||
"type": "custom",
|
||||
"format": "{$2} {$1}" // print "world Hello"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
Bugfixes:
|
||||
* Fix some presets
|
||||
* Better detection for XTerm terminal fonts (#1095, TerminalFont, Linux)
|
||||
* Remove debug output (#1097, Windows)
|
||||
* Fix command line option `--gpu-hide-type` doesn't work (#1098, GPU)
|
||||
* Fix wrong date on Raspbian 10 (#1108, DateTime, Linux)
|
||||
* Use `brightness` instead of `actuall_brightness` when detecting current brightness level (Brightness, Linux)
|
||||
* Ref: https://bugzilla.kernel.org/show_bug.cgi?id=203905
|
||||
* Fix buffer overflow with long font family names when detecting kitty term font (TerminalFont)
|
||||
* Fix some typos
|
||||
|
||||
Logos:
|
||||
* Update void_small
|
||||
* Add ALT Linux
|
||||
|
||||
# 2.18.1
|
||||
|
||||
Fix a regression introduced in v2.18.0
|
||||
|
||||
Changes:
|
||||
* `--ts-version` has been renamed to `--detect-version`
|
||||
* `general.detectVersion` in JSON config file
|
||||
|
||||
Bugfixes:
|
||||
* Fix and improve GPU driver detection (#1084, GPU, Linux)
|
||||
|
||||
# 2.18.0
|
||||
|
||||
Changes:
|
||||
* `yyjson 0.10.0` is required
|
||||
* Fastfetch no longer prints `*` (which means it's the default route) if `defaultRouteOnly` is set (LocalIP)
|
||||
|
||||
Bugfixes:
|
||||
* Fix some memory leaks
|
||||
* Fix compatibility with old Python versions
|
||||
* Don't detect frequency for AMD cards (GPU, Linux)
|
||||
* Fix possible hang with discrete AMD cards (#1077)
|
||||
* Don't print colors in `--pipe` mode (Separator)
|
||||
* Don't print `(null)` in property `locator` (PhysicalMemory)
|
||||
* Ignore disabled PCI devices (GPU)
|
||||
* Fix flag `--opengl-library` doesn't work (OpenGL)
|
||||
|
||||
Features:
|
||||
* Detect revision of USB drives (#1048, Disk)
|
||||
* Support fractional scale factor detection (Display, Linux)
|
||||
* Support primary display detection for KDE and GNOME (Display, Linux)
|
||||
* Support percent bar in custom formatting
|
||||
* Print signal quality by default (Wifi)
|
||||
* Detect used OpenGL library version (OpenGL)
|
||||
* Support detecting OpenGL version by `EGL` (ANGLE) on Windows (OpenGL)
|
||||
|
||||
Logos:
|
||||
* Add Arkane Linux
|
||||
* Add Opak
|
||||
|
||||
# 2.17.2
|
||||
|
||||
Changes:
|
||||
* Flatpak package count no longer takes runtime packages into account (Packages, Linux)
|
||||
|
||||
Bugfixes:
|
||||
* Fix formattion with multiple batteries (Battery)
|
||||
* Fix incorrect size value for large memory sticks (PhysicalMemory)
|
||||
* Fix spelling of `Qt` and `LXQt`
|
||||
* Fix building on SunOS if imagemagick support is enabled (Logo, SunOS)
|
||||
* Fix typos
|
||||
|
||||
Features:
|
||||
* Support Ptyxis terminal version and font detection (Terminal / TerminalFont, Linux)
|
||||
* Improve Cinnamon version detection (DE)
|
||||
* Support `cinnamon-wayland` (WMTheme)
|
||||
* `--ts-version false` will disable editor version detection (Editor)
|
||||
|
||||
# 2.17.1
|
||||
|
||||
Hotfix for a regression that breaks Qt font detection
|
||||
|
||||
Bugfixes:
|
||||
* Don't generate and install `libffwinrt.dll.a` on MinGW (Windows)
|
||||
* Fix building on Windows when imagemagick support is enabled (Logo, Windows)
|
||||
* Don't print GPU frequency with `--gpu-temp` for Nvidia cards (#1052, GPU)
|
||||
* `--gpu-driver-specific` needs to be specified
|
||||
* Print formatted size when `--gpu-format` is used (#1052, GPU)
|
||||
* Ignore QVariant format; fix unreadable Qt font (#1053, Theme, Linux)
|
||||
* Fix segfaults with `--show-errors` and an invalid module (#1055)
|
||||
|
||||
# 2.17.0
|
||||
|
||||
Changes:
|
||||
* CMake option `ENABLE_PROPRIETARY_GPU_DRIVER_API` is removed. The GPU driver APIs are now enabled by default.
|
||||
* The option was introduced to reduce the license concerns. Since all non MIT proprietary code has been rewritten manually from scratch, it is no longer necessary.
|
||||
* See <https://github.com/fastfetch-cli/fastfetch/issues/533#issuecomment-2122830958> for detail
|
||||
* Option `--logo-separate true` is changed to `--logo-position top` for better readability
|
||||
* Builtin ascii logos can be positioned on the right side now with`--logo-position right`
|
||||
|
||||
Features:
|
||||
* Add support for `--gpu-detection-method opencl` which uses OpenCL to detect GPUs.
|
||||
* Support detecting CPU cache size by using SMBIOS as fallback (CPUCache)
|
||||
* Support GPU detection (SunOS)
|
||||
* Support GPU type detection with AMD GPU driver (GPU, Windows)
|
||||
* Add fast path of version and font detection for kitty (Terminal / TerminalFont)
|
||||
* Make sure `stdin` and `stdout` are TTYs when querying terminal
|
||||
* So modules like `TerminalSize` should work when `stdin` or `stdout` is redirected
|
||||
* Support argument truncation in `--<module>-format` (#1043)
|
||||
* See `fastfetch --help format` for detail
|
||||
* Improve Qt theme detection (#1047, Theme, Linux)
|
||||
* Add new JSON config option `general.preRun`, which is executed before fastfetch prints output.
|
||||
* It can be used to generate a temp logo file. For example
|
||||
```jsonc
|
||||
{
|
||||
"general": {
|
||||
"preRun": "kitten icat --align=left /path/to/image > /tmp/logo.kitty"
|
||||
},
|
||||
"logo": {
|
||||
"source": "/tmp/logo.kitty",
|
||||
"type": "raw"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Bugfixes:
|
||||
* Fix invalid path (#1031, LM, Linux)
|
||||
* Fix VMEM detection for Nvidia GPU (requires `--gpu-driver-specific`) (GPU)
|
||||
* Fix AMD `--gpu-driver-specific` for AMD cards (#1032, GPU, Windows)
|
||||
* Use Coordinated Universal Time rather than timezone-varying local date (#1046)
|
||||
|
||||
Logo:
|
||||
* Fix colors of Asahi Linux
|
||||
|
||||
# 2.16.0
|
||||
|
||||
This release added basic support for SunOS (Solaris, illumos). The binaries provided in the release lack a few useful features (such as Display detection). People who use SunOS should consider building fastfetch themselves.
|
||||
|
||||
Changes:
|
||||
* Fastfetch now prefers `/etc/os-release` over `/etc/lsb-release` when detecting distro info.
|
||||
* This may break some distros (notably some debian based distros). File a bug with the content of `os-release` and `lsb-release` if it breaks your distro.
|
||||
|
||||
Features:
|
||||
* Support Media detection in Windows (Media / Player, Windows)
|
||||
* Requires Windows 10 and later
|
||||
* Add new option `--users-myself-only` to display current login user only (Users)
|
||||
* Add code name of macOS Sequoia (OS, macOS)
|
||||
* Add new module `DNS` to show active DNS servers (DNS)
|
||||
* Add new option `--loadavg-compact`. Defaults to true (Loadavg)
|
||||
* Use `--loadavg-compact false` to display load averages in different lines
|
||||
* Detect MTU size (LocalIP)
|
||||
* Support version detection of pluma, which is the default editor of OpenIndiana (Editor)
|
||||
* Print used OGL library, eg EGL, GLX or OSMesa (OpenGL)
|
||||
|
||||
Bugfixes:
|
||||
* Report error if cache size is unavailable (CPUCache, Android)
|
||||
* Trim white spaces in device name (Sound, Linux, #1005)
|
||||
* Fix `display.bar.border{Left,Right}` doesn't work in JSON config files (Config)
|
||||
* Fix invalid call to `realpath(3)` (Platform, Linux)
|
||||
* Fix result calculation (CPUUsage, FreeBSD)
|
||||
|
||||
Logos:
|
||||
* Add Mauna
|
||||
* Add Tuxdeo
|
||||
* Add Manjaro ARM
|
||||
* Add RedOS
|
||||
* Add Arch3
|
||||
|
||||
# 2.15.0
|
||||
|
||||
Changes:
|
||||
* `--bar-border <?bool>` has been changed to `--bar-border-left <string>` and `--bar-border-right <string>`, which are used for customizing the style of bar border.
|
||||
* `--bar-border-left '' --bar-border-right ''` can be used to disable the border
|
||||
|
||||
Features:
|
||||
* Add ability to skip installing license with INSTALL_LICENSE option (CMake)
|
||||
* Make it possible to shorten the theme and icons output (Theme / Icons)
|
||||
* Support `-l '?'` to show a question mark
|
||||
* Add new module `CPUCache` to display CPU cache sizes (CPUCache)
|
||||
* In `--<module>-format`, `{#keys}` and `{#title}` can be used to reference the color of keys and title
|
||||
* Improve speed of Guix package detection (Packages, Linux)
|
||||
* Assume wm plugins are daemon processes to improve performance (WM, macOS)
|
||||
|
||||
Bugfixes:
|
||||
* Remove shebangs from completions (#980)
|
||||
* Fix while chars not visible in terminal of light theme (Logo)
|
||||
* Normalize bright colors to fix color display in Apple Terminal (#991, Colors)
|
||||
* Correctly capitalize GNOME (#997, DE, Linux)
|
||||
* Fix segfault on system using turkish language (#995, InitSystem, Linux)
|
||||
* Fix kubuntu detection (#1000, OS, Linux)
|
||||
* Don't display duplicate entries (OS, Linux)
|
||||
|
||||
# 2.14.0
|
||||
|
||||
Features:
|
||||
* Support monochrome bar type (#960)
|
||||
* Support editor version detection on Windows (Editor, Windows)
|
||||
* Apply default color palettes in `--file` and `--data` (Logo)
|
||||
* Print all presets in `--list-presets` for better Windows support (Windows)
|
||||
* Support for guix package manager detection (Packages, Linux)
|
||||
* Support named variable placeholders in custom module formattion string (#796)
|
||||
* `--title-format '{user-name-colored}{at-symbol-colored}{host-name-colored}'` is now equivalent to `--title-format '{6}{7}{8}'`
|
||||
* Support named color placeholders in custom module formattion string
|
||||
* `--<module>-format '{#red}'` is now equivalent to `--<module>-format '{#31}'`
|
||||
* `'{#red}'` or `'{#31}'` is preferred over `\u001b[31m` because is more readable and `--pipe` aware (will be ignored in pipe mode)
|
||||
* Supported in `Custom` module too
|
||||
* See `fastfetch -h format` for detail
|
||||
* Add new module `InitSystem`, which detects the name of init system
|
||||
* i.e. process name of pid1. `init`, `systemd`, etc
|
||||
* Add option `--color-separator` to set the color of key-value separators
|
||||
* Support Guix package manager count (#792, Packages, Linux)
|
||||
* Improve python based shell detection (#977, Shell, macOS)
|
||||
* Print error reason when vulkan init fails (Vulkan)
|
||||
|
||||
Bugfixes:
|
||||
* Don't detect `.conf` files in `--list-config-paths`
|
||||
* Don't try to detect terminals in MSYS shell with process backtracing (Windows)
|
||||
* Fix `outputColor` doesn't work if module keys are disabled
|
||||
|
||||
Logos:
|
||||
* Add Cereus Linux
|
||||
* Re-add special handling of Loc-OS
|
||||
|
||||
# 2.13.2
|
||||
|
||||
Another hotfix release :(
|
||||
|
||||
Bugfixes:
|
||||
* Remove DRM driver version detection feature, which caused a performance regression for nouveau drivers (#956, Display, Linux)
|
||||
* Fix compatibility for old python versions. Regression of `2.13.0`
|
||||
* Don't use `*-unknown` as display name for Wayland protocol (Display, Linux)
|
||||
|
||||
Features:
|
||||
* Add new module `Editor` which prints information of the default editor, i.e. $VISUAL or $EDITOR (#430, Editor)
|
||||
|
||||
Logos:
|
||||
* Added CuerdOS
|
||||
* Remove special handling of Loc-OS
|
||||
|
||||
# 2.13.1
|
||||
|
||||
Fix a regression introduced in v2.13.0
|
||||
@@ -209,7 +596,7 @@ Features:
|
||||
* Improve GPU detection on Linux (GPU, Linux)
|
||||
* Support GPU memory usage detection for AMD GPUs
|
||||
* Support GPU frequency detection for Intel GPUs
|
||||
* Improve performance of Gnome version detection (DE, Linux)
|
||||
* Improve performance of GNOME version detection (DE, Linux)
|
||||
* Improve performance of kitty version detection (Terminal, Linux)
|
||||
* Detect refresh rate when using `--ds-force-drm sysfs-only` (Display, Linux)
|
||||
* Add option `--ts-version` to disable terminal and shell version detection. Mainly for benchmarking purposes
|
||||
@@ -900,7 +1287,7 @@ Bugfixes:
|
||||
This release backports some changes from dev branch, and fixes 2 crashing issues
|
||||
|
||||
Features:
|
||||
* Support KDE / LXQT / MATE / Cinnamon wallpaper detection (Wallpaper, Linux)
|
||||
* Support KDE / LXQt / MATE / Cinnamon wallpaper detection (Wallpaper, Linux)
|
||||
* Support QTerminal version & terminal font detection
|
||||
* Support MATE Terminal version & terminal font detection
|
||||
* Set `--pipe true` automatically if stdout is not a tty
|
||||
@@ -916,7 +1303,7 @@ Bugfixes:
|
||||
* Fix Windows drives detection in WSL (Linux, Disk)
|
||||
* Fix CPU temp detection (FreeBSD, CPU)
|
||||
* Fix disk detection (Android, Disk)
|
||||
* Fix Gnome Terminal version and font detection (FreeBSD, TerminalFont)
|
||||
* Fix GNOME Terminal version and font detection (FreeBSD, TerminalFont)
|
||||
* Fix crash on newer wayland desktops (Linux, Display, #477)
|
||||
* Fix vendor detection for Intel GPU (macOS, GPU)
|
||||
* Fix possible crashes on Windows Server (Windows, GPU, #484)
|
||||
@@ -942,11 +1329,11 @@ Features:
|
||||
* Add mac address detection `--localip-show-mac` (LocalIP, #451)
|
||||
|
||||
Bugfixes:
|
||||
* Fix Gnome version detection on Fedora (DE)
|
||||
* Fix GNOME version detection on Fedora (DE)
|
||||
* Fix Windows drives detection in WSL (Disk)
|
||||
|
||||
Changes:
|
||||
* In order to make Icons module consistent between different platforms, `--icons-format` no longer supports individual GTK / QT icon params.
|
||||
* In order to make Icons module consistent between different platforms, `--icons-format` no longer supports individual GTK / Qt icon params.
|
||||
* `--theme-format` no longer supports individual GTK / plasma theme params.
|
||||
* `--local-ip-*` and `--public-ip-*` have been changed to `--localip-*` and `--publicip-*`
|
||||
* `--localip-compact-type` is no longer supported. Fastfetch now display IPs as `--localip-compat-type multiline` by default, with `--local-compact true` can be set as an alias of `--localip-compact-type oneline`
|
||||
@@ -1320,7 +1707,7 @@ Fixes build on android (#205)
|
||||
# 1.6.0
|
||||
|
||||
Features:
|
||||
* Detect QT on more DEs than just KDE Plasma. The [Plasma] category was therefore renamed to [QT]
|
||||
* Detect Qt on more DEs than just KDE Plasma. The [Plasma] category was therefore renamed to [Qt]
|
||||
* Alacritty font detection
|
||||
* Load `/etc/fastfetch/config.conf` before user config
|
||||
* Disk: print one decimal point if size < 100GB
|
||||
|
||||
+266
-65
@@ -1,7 +1,7 @@
|
||||
cmake_minimum_required(VERSION 3.12.0) # target_link_libraries with OBJECT libs & project homepage url
|
||||
|
||||
project(fastfetch
|
||||
VERSION 2.13.1
|
||||
VERSION 2.21.1
|
||||
LANGUAGES C
|
||||
DESCRIPTION "Fast neofetch-like system information tool"
|
||||
HOMEPAGE_URL "https://github.com/fastfetch-cli/fastfetch"
|
||||
@@ -14,10 +14,12 @@ set(PROJECT_LICENSE "MIT license")
|
||||
###################
|
||||
if(ANDROID)
|
||||
set(LINUX FALSE)
|
||||
elseif("${CMAKE_SYSTEM_NAME}" MATCHES ".*[Ll]inux.*")
|
||||
elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
|
||||
set(LINUX TRUE CACHE BOOL "..." FORCE) # LINUX means GNU/Linux, not just the kernel
|
||||
elseif("${CMAKE_SYSTEM_NAME}" MATCHES ".*[Bb][Ss][Dd].*")
|
||||
set(BSD TRUE CACHE BOOL "..." FORCE)
|
||||
elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "FreeBSD")
|
||||
set(FreeBSD TRUE CACHE BOOL "..." FORCE)
|
||||
elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "SunOS")
|
||||
set(SunOS TRUE CACHE BOOL "..." FORCE)
|
||||
elseif(NOT APPLE AND NOT WIN32)
|
||||
message(FATAL_ERROR "Unsupported platform: ${CMAKE_SYSTEM_NAME}")
|
||||
endif()
|
||||
@@ -42,40 +44,48 @@ include(CheckIncludeFile)
|
||||
|
||||
include(CMakeDependentOption)
|
||||
|
||||
cmake_dependent_option(ENABLE_VULKAN "Enable vulkan" ON "LINUX OR APPLE OR BSD OR WIN32 OR ANDROID" OFF)
|
||||
cmake_dependent_option(ENABLE_WAYLAND "Enable wayland-client" ON "LINUX OR BSD" OFF)
|
||||
cmake_dependent_option(ENABLE_XCB_RANDR "Enable xcb-randr" ON "LINUX OR BSD" OFF)
|
||||
cmake_dependent_option(ENABLE_XCB "Enable xcb" ON "LINUX OR BSD" OFF)
|
||||
cmake_dependent_option(ENABLE_XRANDR "Enable xrandr" ON "LINUX OR BSD" OFF)
|
||||
cmake_dependent_option(ENABLE_X11 "Enable x11" ON "LINUX OR BSD" OFF)
|
||||
cmake_dependent_option(ENABLE_DRM "Enable libdrm" ON "LINUX OR BSD" OFF)
|
||||
cmake_dependent_option(ENABLE_GIO "Enable gio-2.0" ON "LINUX OR BSD" OFF)
|
||||
cmake_dependent_option(ENABLE_DCONF "Enable dconf" ON "LINUX OR BSD" OFF)
|
||||
cmake_dependent_option(ENABLE_DBUS "Enable dbus-1" ON "LINUX OR BSD" OFF)
|
||||
cmake_dependent_option(ENABLE_XFCONF "Enable libxfconf-0" ON "LINUX OR BSD" OFF)
|
||||
cmake_dependent_option(ENABLE_SQLITE3 "Enable sqlite3" ON "LINUX OR BSD OR APPLE" OFF)
|
||||
cmake_dependent_option(ENABLE_VULKAN "Enable vulkan" ON "LINUX OR APPLE OR FreeBSD OR WIN32 OR ANDROID OR SunOS" OFF)
|
||||
cmake_dependent_option(ENABLE_WAYLAND "Enable wayland-client" ON "LINUX OR FreeBSD" OFF)
|
||||
cmake_dependent_option(ENABLE_XCB_RANDR "Enable xcb-randr" ON "LINUX OR FreeBSD OR SunOS" OFF)
|
||||
cmake_dependent_option(ENABLE_XCB "Enable xcb" ON "LINUX OR FreeBSD OR SunOS" OFF)
|
||||
cmake_dependent_option(ENABLE_XRANDR "Enable xrandr" ON "LINUX OR FreeBSD OR SunOS" OFF)
|
||||
cmake_dependent_option(ENABLE_X11 "Enable x11" ON "LINUX OR FreeBSD OR SunOS" OFF)
|
||||
cmake_dependent_option(ENABLE_DRM "Enable libdrm" ON "LINUX OR FreeBSD OR SunOS" OFF)
|
||||
cmake_dependent_option(ENABLE_GIO "Enable gio-2.0" ON "LINUX OR FreeBSD OR SunOS" OFF)
|
||||
cmake_dependent_option(ENABLE_DCONF "Enable dconf" ON "LINUX OR FreeBSD OR SunOS" OFF)
|
||||
cmake_dependent_option(ENABLE_DBUS "Enable dbus-1" ON "LINUX OR FreeBSD OR SunOS" OFF)
|
||||
cmake_dependent_option(ENABLE_XFCONF "Enable libxfconf-0" ON "LINUX OR FreeBSD OR SunOS" OFF)
|
||||
cmake_dependent_option(ENABLE_SQLITE3 "Enable sqlite3" ON "LINUX OR FreeBSD OR APPLE OR SunOS" OFF)
|
||||
cmake_dependent_option(ENABLE_RPM "Enable rpm" ON "LINUX" OFF)
|
||||
cmake_dependent_option(ENABLE_IMAGEMAGICK7 "Enable imagemagick 7" ON "LINUX OR BSD OR APPLE OR WIN32" OFF)
|
||||
cmake_dependent_option(ENABLE_IMAGEMAGICK6 "Enable imagemagick 6" ON "LINUX OR BSD OR APPLE" OFF)
|
||||
cmake_dependent_option(ENABLE_IMAGEMAGICK7 "Enable imagemagick 7" ON "LINUX OR FreeBSD OR APPLE OR WIN32 OR SunOS" OFF)
|
||||
cmake_dependent_option(ENABLE_IMAGEMAGICK6 "Enable imagemagick 6" ON "LINUX OR FreeBSD OR APPLE OR SunOS" OFF)
|
||||
cmake_dependent_option(ENABLE_CHAFA "Enable chafa" ON "ENABLE_IMAGEMAGICK6 OR ENABLE_IMAGEMAGICK7" OFF)
|
||||
cmake_dependent_option(ENABLE_ZLIB "Enable zlib" ON "ENABLE_IMAGEMAGICK6 OR ENABLE_IMAGEMAGICK7" OFF)
|
||||
cmake_dependent_option(ENABLE_EGL "Enable egl" ON "LINUX OR BSD" OFF)
|
||||
cmake_dependent_option(ENABLE_GLX "Enable glx" ON "LINUX OR BSD" OFF)
|
||||
cmake_dependent_option(ENABLE_OSMESA "Enable osmesa" ON "LINUX OR BSD" OFF)
|
||||
cmake_dependent_option(ENABLE_OPENCL "Enable opencl" ON "LINUX OR BSD OR WIN32" OFF)
|
||||
cmake_dependent_option(ENABLE_LIBNM "Enable libnm" ON "LINUX" OFF)
|
||||
cmake_dependent_option(ENABLE_EGL "Enable egl" ON "LINUX OR FreeBSD OR WIN32 OR SunOS" OFF)
|
||||
cmake_dependent_option(ENABLE_GLX "Enable glx" ON "LINUX OR FreeBSD OR SunOS" OFF)
|
||||
cmake_dependent_option(ENABLE_OSMESA "Enable osmesa" ON "LINUX OR FreeBSD OR SunOS" OFF)
|
||||
cmake_dependent_option(ENABLE_OPENCL "Enable opencl" ON "LINUX OR FreeBSD OR WIN32 OR ANDROID OR SunOS" OFF)
|
||||
cmake_dependent_option(ENABLE_FREETYPE "Enable freetype" ON "ANDROID" OFF)
|
||||
cmake_dependent_option(ENABLE_PULSE "Enable pulse" ON "LINUX" OFF)
|
||||
cmake_dependent_option(ENABLE_PULSE "Enable pulse" ON "LINUX OR SunOS" OFF)
|
||||
cmake_dependent_option(ENABLE_DDCUTIL "Enable ddcutil" ON "LINUX" OFF)
|
||||
cmake_dependent_option(ENABLE_DIRECTX_HEADERS "Enable DirectX headers for WSL" ON "LINUX" OFF)
|
||||
cmake_dependent_option(ENABLE_ELF "Enable libelf" ON "LINUX OR FreeBSD OR SunOS" OFF)
|
||||
cmake_dependent_option(ENABLE_THREADS "Enable multithreading" ON "Threads_FOUND" OFF)
|
||||
|
||||
option(ENABLE_SYSTEM_YYJSON "Use system provided (instead of fastfetch embedded) yyjson library" OFF)
|
||||
option(ENABLE_ASAN "Build fastfetch with ASAN (address sanitizer)" OFF)
|
||||
option(ENABLE_PROPRIETARY_GPU_DRIVER_API "Enable proprietary GPU driver API (NVML, IGCL and AGS)" ON)
|
||||
option(ENABLE_LTO "Enable link-time optimization in release mode if supported" ON)
|
||||
option(BUILD_TESTS "Build tests" OFF) # Also create test executables
|
||||
option(SET_TWEAK "Add tweak to project version" ON) # This is set to off by github actions for release builds
|
||||
option(IS_MUSL "Build with musl libc" OFF) # Used by Github Actions
|
||||
option(INSTALL_LICENSE "Install license into /usr/share/licenses" ON)
|
||||
|
||||
set(BINARY_LINK_TYPE_OPTIONS dlopen dynamic static)
|
||||
set(BINARY_LINK_TYPE dlopen CACHE STRING "How to link fastfetch")
|
||||
set_property(CACHE BINARY_LINK_TYPE PROPERTY STRINGS ${BINARY_LINK_TYPE_OPTIONS})
|
||||
if(NOT BINARY_LINK_TYPE IN_LIST BINARY_LINK_TYPE_OPTIONS)
|
||||
message(FATAL_ERROR "BINARY_LINK_TYPE must be one of ${BINARY_LINK_TYPE_OPTIONS}")
|
||||
endif()
|
||||
|
||||
if (LINUX)
|
||||
set(CUSTOM_PCI_IDS_PATH "" CACHE STRING "Custom path to file pci.ids, defaults to `/usr/share/hwdata/pci.ids`")
|
||||
@@ -110,7 +120,7 @@ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${WARNING_FLAGS} -Werror=incompatible-pointe
|
||||
if(WIN32 OR ENABLE_DIRECTX_HEADERS)
|
||||
enable_language(CXX)
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${WARNING_FLAGS} -fno-exceptions -fno-rtti")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${WARNING_FLAGS}")
|
||||
endif()
|
||||
|
||||
if(WIN32)
|
||||
@@ -130,7 +140,7 @@ if(NOT WIN32)
|
||||
set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} -rdynamic")
|
||||
endif()
|
||||
|
||||
if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
if(ENABLE_LTO AND NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
message(STATUS "Enabling LTO")
|
||||
include(CheckIPOSupported)
|
||||
check_ipo_supported(RESULT IPO_SUPPORTED)
|
||||
@@ -192,10 +202,10 @@ if (SET_TWEAK AND EXISTS "${CMAKE_SOURCE_DIR}/.git")
|
||||
execute_process(
|
||||
COMMAND git describe --tags
|
||||
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
|
||||
OUTPUT_VARIABLE PROJECT_VERSION_TWEAK
|
||||
OUTPUT_VARIABLE PROJECT_VERSION_GIT
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
string(REGEX MATCH "-[0-9]+" PROJECT_VERSION_TWEAK "${PROJECT_VERSION_TWEAK}")
|
||||
string(REGEX MATCH "-[0-9]+" PROJECT_VERSION_TWEAK "${PROJECT_VERSION_GIT}")
|
||||
endif()
|
||||
if(PROJECT_VERSION_TWEAK)
|
||||
string(REGEX MATCH "[0-9]+" PROJECT_VERSION_TWEAK_NUM "${PROJECT_VERSION_TWEAK}")
|
||||
@@ -246,7 +256,7 @@ if(APPLE)
|
||||
configure_file(src/util/apple/Info.plist.in Info.plist @ONLY)
|
||||
endif()
|
||||
|
||||
string(TIMESTAMP FASTFETCH_BUILD_DATE "%d %B %Y")
|
||||
string(TIMESTAMP FASTFETCH_BUILD_DATE "%d %B %Y" UTC)
|
||||
configure_file(doc/fastfetch.1.in fastfetch.1 @ONLY)
|
||||
|
||||
####################
|
||||
@@ -284,6 +294,7 @@ set(LIBFASTFETCH_SRC
|
||||
src/common/properties.c
|
||||
src/common/settings.c
|
||||
src/common/temps.c
|
||||
src/detection/bluetoothradio/bluetoothradio.c
|
||||
src/detection/bootmgr/bootmgr.c
|
||||
src/detection/chassis/chassis.c
|
||||
src/detection/cpu/cpu.c
|
||||
@@ -291,11 +302,13 @@ set(LIBFASTFETCH_SRC
|
||||
src/detection/disk/disk.c
|
||||
src/detection/diskio/diskio.c
|
||||
src/detection/displayserver/displayserver.c
|
||||
src/detection/editor/editor.c
|
||||
src/detection/font/font.c
|
||||
src/detection/gpu/gpu.c
|
||||
src/detection/media/media.c
|
||||
src/detection/netio/netio.c
|
||||
src/detection/opencl/opencl.c
|
||||
src/detection/opengl/opengl_shared.c
|
||||
src/detection/os/os.c
|
||||
src/detection/packages/packages.c
|
||||
src/detection/physicalmemory/physicalmemory.c
|
||||
@@ -314,6 +327,7 @@ set(LIBFASTFETCH_SRC
|
||||
src/modules/battery/battery.c
|
||||
src/modules/bios/bios.c
|
||||
src/modules/bluetooth/bluetooth.c
|
||||
src/modules/bluetoothradio/bluetoothradio.c
|
||||
src/modules/board/board.c
|
||||
src/modules/bootmgr/bootmgr.c
|
||||
src/modules/brightness/brightness.c
|
||||
@@ -322,6 +336,7 @@ set(LIBFASTFETCH_SRC
|
||||
src/modules/chassis/chassis.c
|
||||
src/modules/colors/colors.c
|
||||
src/modules/cpu/cpu.c
|
||||
src/modules/cpucache/cpucache.c
|
||||
src/modules/cpuusage/cpuusage.c
|
||||
src/modules/cursor/cursor.c
|
||||
src/modules/custom/custom.c
|
||||
@@ -330,10 +345,13 @@ set(LIBFASTFETCH_SRC
|
||||
src/modules/de/de.c
|
||||
src/modules/disk/disk.c
|
||||
src/modules/diskio/diskio.c
|
||||
src/modules/dns/dns.c
|
||||
src/modules/editor/editor.c
|
||||
src/modules/font/font.c
|
||||
src/modules/gpu/gpu.c
|
||||
src/modules/host/host.c
|
||||
src/modules/icons/icons.c
|
||||
src/modules/initsystem/initsystem.c
|
||||
src/modules/gamepad/gamepad.c
|
||||
src/modules/kernel/kernel.c
|
||||
src/modules/lm/lm.c
|
||||
@@ -380,6 +398,7 @@ set(LIBFASTFETCH_SRC
|
||||
src/options/general.c
|
||||
src/options/library.c
|
||||
src/util/edidHelper.c
|
||||
src/util/base64.c
|
||||
src/util/FFlist.c
|
||||
src/util/FFstrbuf.c
|
||||
src/util/platform/FFPlatform.c
|
||||
@@ -400,10 +419,13 @@ if(LINUX)
|
||||
src/detection/brightness/brightness_linux.c
|
||||
src/detection/chassis/chassis_linux.c
|
||||
src/detection/cpu/cpu_linux.c
|
||||
src/detection/cpucache/cpucache_linux.c
|
||||
src/detection/cpuusage/cpuusage_linux.c
|
||||
src/detection/cursor/cursor_linux.c
|
||||
src/detection/bluetooth/bluetooth_linux.c
|
||||
src/detection/bluetoothradio/bluetoothradio_linux.c
|
||||
src/detection/disk/disk_linux.c
|
||||
src/detection/dns/dns_linux.c
|
||||
src/detection/physicaldisk/physicaldisk_linux.c
|
||||
src/detection/physicalmemory/physicalmemory_linux.c
|
||||
src/detection/diskio/diskio_linux.c
|
||||
@@ -412,7 +434,11 @@ if(LINUX)
|
||||
src/detection/displayserver/linux/wayland/wayland.c
|
||||
src/detection/displayserver/linux/wayland/global-output.c
|
||||
src/detection/displayserver/linux/wayland/zwlr-output.c
|
||||
src/detection/displayserver/linux/wayland/kde-output.c
|
||||
src/detection/displayserver/linux/wayland/wlr-output-management-unstable-v1-protocol.c
|
||||
src/detection/displayserver/linux/wayland/kde-output-device-v2-protocol.c
|
||||
src/detection/displayserver/linux/wayland/kde-output-order-v1-protocol.c
|
||||
src/detection/displayserver/linux/wayland/xdg-output-unstable-v1-protocol.c
|
||||
src/detection/displayserver/linux/wmde.c
|
||||
src/detection/displayserver/linux/xcb.c
|
||||
src/detection/displayserver/linux/xlib.c
|
||||
@@ -422,6 +448,7 @@ if(LINUX)
|
||||
src/detection/gtk_qt/gtk.c
|
||||
src/detection/host/host_linux.c
|
||||
src/detection/icons/icons_linux.c
|
||||
src/detection/initsystem/initsystem_linux.c
|
||||
src/detection/libc/libc_linux.c
|
||||
src/detection/lm/lm_linux.c
|
||||
src/detection/loadavg/loadavg_linux.c
|
||||
@@ -454,6 +481,7 @@ if(LINUX)
|
||||
src/detection/wmtheme/wmtheme_linux.c
|
||||
src/detection/camera/camera_linux.c
|
||||
src/util/platform/FFPlatform_unix.c
|
||||
src/util/linux/elf.c
|
||||
)
|
||||
elseif(ANDROID)
|
||||
list(APPEND LIBFASTFETCH_SRC
|
||||
@@ -464,14 +492,17 @@ elseif(ANDROID)
|
||||
src/detection/battery/battery_android.c
|
||||
src/detection/bios/bios_android.c
|
||||
src/detection/bluetooth/bluetooth_nosupport.c
|
||||
src/detection/bluetoothradio/bluetoothradio_nosupport.c
|
||||
src/detection/board/board_android.c
|
||||
src/detection/bootmgr/bootmgr_nosupport.c
|
||||
src/detection/brightness/brightness_nosupport.c
|
||||
src/detection/chassis/chassis_nosupport.c
|
||||
src/detection/cpu/cpu_linux.c
|
||||
src/detection/cpucache/cpucache_linux.c
|
||||
src/detection/cursor/cursor_nosupport.c
|
||||
src/detection/cpuusage/cpuusage_linux.c
|
||||
src/detection/disk/disk_linux.c
|
||||
src/detection/dns/dns_linux.c
|
||||
src/detection/physicaldisk/physicaldisk_linux.c
|
||||
src/detection/physicalmemory/physicalmemory_nosupport.c
|
||||
src/detection/diskio/diskio_linux.c
|
||||
@@ -480,6 +511,7 @@ elseif(ANDROID)
|
||||
src/detection/gpu/gpu_nosupport.c
|
||||
src/detection/host/host_android.c
|
||||
src/detection/icons/icons_nosupport.c
|
||||
src/detection/initsystem/initsystem_linux.c
|
||||
src/detection/libc/libc_android.c
|
||||
src/detection/lm/lm_nosupport.c
|
||||
src/detection/loadavg/loadavg_linux.c
|
||||
@@ -512,7 +544,7 @@ elseif(ANDROID)
|
||||
src/detection/camera/camera_android.c
|
||||
src/util/platform/FFPlatform_unix.c
|
||||
)
|
||||
elseif(BSD)
|
||||
elseif(FreeBSD)
|
||||
list(APPEND LIBFASTFETCH_SRC
|
||||
src/common/dbus.c
|
||||
src/common/io/io_unix.c
|
||||
@@ -523,14 +555,17 @@ elseif(BSD)
|
||||
src/detection/battery/battery_bsd.c
|
||||
src/detection/bios/bios_bsd.c
|
||||
src/detection/bluetooth/bluetooth_linux.c
|
||||
src/detection/bluetoothradio/bluetoothradio_linux.c
|
||||
src/detection/board/board_bsd.c
|
||||
src/detection/bootmgr/bootmgr_bsd.c
|
||||
src/detection/brightness/brightness_bsd.c
|
||||
src/detection/chassis/chassis_bsd.c
|
||||
src/detection/cpu/cpu_bsd.c
|
||||
src/detection/cpucache/cpucache_shared.c
|
||||
src/detection/cpuusage/cpuusage_bsd.c
|
||||
src/detection/cursor/cursor_linux.c
|
||||
src/detection/disk/disk_bsd.c
|
||||
src/detection/dns/dns_linux.c
|
||||
src/detection/physicaldisk/physicaldisk_bsd.c
|
||||
src/detection/physicalmemory/physicalmemory_linux.c
|
||||
src/detection/diskio/diskio_bsd.c
|
||||
@@ -539,7 +574,11 @@ elseif(BSD)
|
||||
src/detection/displayserver/linux/wayland/wayland.c
|
||||
src/detection/displayserver/linux/wayland/global-output.c
|
||||
src/detection/displayserver/linux/wayland/zwlr-output.c
|
||||
src/detection/displayserver/linux/wayland/kde-output.c
|
||||
src/detection/displayserver/linux/wayland/wlr-output-management-unstable-v1-protocol.c
|
||||
src/detection/displayserver/linux/wayland/kde-output-device-v2-protocol.c
|
||||
src/detection/displayserver/linux/wayland/kde-output-order-v1-protocol.c
|
||||
src/detection/displayserver/linux/wayland/xdg-output-unstable-v1-protocol.c
|
||||
src/detection/displayserver/linux/wmde.c
|
||||
src/detection/displayserver/linux/xcb.c
|
||||
src/detection/displayserver/linux/xlib.c
|
||||
@@ -550,6 +589,7 @@ elseif(BSD)
|
||||
src/detection/host/host_bsd.c
|
||||
src/detection/lm/lm_linux.c
|
||||
src/detection/icons/icons_linux.c
|
||||
src/detection/initsystem/initsystem_linux.c
|
||||
src/detection/libc/libc_bsd.c
|
||||
src/detection/loadavg/loadavg_bsd.c
|
||||
src/detection/locale/locale_linux.c
|
||||
@@ -557,7 +597,7 @@ elseif(BSD)
|
||||
src/detection/gamepad/gamepad_bsd.c
|
||||
src/detection/media/media_linux.c
|
||||
src/detection/memory/memory_bsd.c
|
||||
src/detection/monitor/monitor_nosupport.c
|
||||
src/detection/monitor/monitor_linux.c
|
||||
src/detection/netio/netio_bsd.c
|
||||
src/detection/opengl/opengl_linux.c
|
||||
src/detection/os/os_linux.c
|
||||
@@ -581,6 +621,7 @@ elseif(BSD)
|
||||
src/detection/wmtheme/wmtheme_linux.c
|
||||
src/detection/camera/camera_linux.c
|
||||
src/util/platform/FFPlatform_unix.c
|
||||
src/util/linux/elf.c
|
||||
)
|
||||
elseif(APPLE)
|
||||
list(APPEND LIBFASTFETCH_SRC
|
||||
@@ -592,14 +633,17 @@ elseif(APPLE)
|
||||
src/detection/battery/battery_apple.c
|
||||
src/detection/bios/bios_apple.c
|
||||
src/detection/bluetooth/bluetooth_apple.m
|
||||
src/detection/bluetoothradio/bluetoothradio_apple.m
|
||||
src/detection/board/board_apple.c
|
||||
src/detection/bootmgr/bootmgr_apple.c
|
||||
src/detection/brightness/brightness_apple.c
|
||||
src/detection/chassis/chassis_nosupport.c
|
||||
src/detection/cpu/cpu_apple.c
|
||||
src/detection/cpucache/cpucache_apple.c
|
||||
src/detection/cpuusage/cpuusage_apple.c
|
||||
src/detection/cursor/cursor_apple.m
|
||||
src/detection/disk/disk_bsd.c
|
||||
src/detection/dns/dns_linux.c
|
||||
src/detection/physicaldisk/physicaldisk_apple.c
|
||||
src/detection/physicalmemory/physicalmemory_apple.m
|
||||
src/detection/diskio/diskio_apple.c
|
||||
@@ -609,6 +653,7 @@ elseif(APPLE)
|
||||
src/detection/gpu/gpu_apple.m
|
||||
src/detection/host/host_apple.c
|
||||
src/detection/icons/icons_nosupport.c
|
||||
src/detection/initsystem/initsystem_linux.c
|
||||
src/detection/lm/lm_nosupport.c
|
||||
src/detection/loadavg/loadavg_bsd.c
|
||||
src/detection/libc/libc_apple.c
|
||||
@@ -652,28 +697,32 @@ elseif(WIN32)
|
||||
src/detection/battery/battery_windows.c
|
||||
src/detection/bios/bios_windows.c
|
||||
src/detection/bluetooth/bluetooth_windows.c
|
||||
src/detection/bluetoothradio/bluetoothradio_windows.c
|
||||
src/detection/board/board_windows.c
|
||||
src/detection/bootmgr/bootmgr_windows.c
|
||||
src/detection/brightness/brightness_windows.cpp
|
||||
src/detection/chassis/chassis_windows.c
|
||||
src/detection/cpu/cpu_windows.c
|
||||
src/detection/cpucache/cpucache_windows.c
|
||||
src/detection/cpuusage/cpuusage_windows.c
|
||||
src/detection/cursor/cursor_windows.c
|
||||
src/detection/disk/disk_windows.c
|
||||
src/detection/physicaldisk/physicaldisk_windows.c
|
||||
src/detection/diskio/diskio_windows.c
|
||||
src/detection/displayserver/displayserver_windows.c
|
||||
src/detection/dns/dns_windows.c
|
||||
src/detection/font/font_windows.c
|
||||
src/detection/gpu/gpu_windows.c
|
||||
src/detection/host/host_windows.c
|
||||
src/detection/icons/icons_windows.c
|
||||
src/detection/initsystem/initsystem_nosupport.c
|
||||
src/detection/libc/libc_windows.cpp
|
||||
src/detection/lm/lm_nosupport.c
|
||||
src/detection/loadavg/loadavg_nosupport.c
|
||||
src/detection/locale/locale_windows.c
|
||||
src/detection/localip/localip_windows.c
|
||||
src/detection/gamepad/gamepad_windows.c
|
||||
src/detection/media/media_nosupport.c
|
||||
src/detection/media/media_windows.c
|
||||
src/detection/memory/memory_windows.c
|
||||
src/detection/physicalmemory/physicalmemory_linux.c
|
||||
src/detection/monitor/monitor_windows.c
|
||||
@@ -705,6 +754,83 @@ elseif(WIN32)
|
||||
src/util/windows/wmi.cpp
|
||||
src/util/platform/FFPlatform_windows.c
|
||||
)
|
||||
elseif(SunOS)
|
||||
list(APPEND LIBFASTFETCH_SRC
|
||||
src/common/dbus.c
|
||||
src/common/io/io_unix.c
|
||||
src/common/netif/netif_bsd.c
|
||||
src/common/networking_linux.c
|
||||
src/common/processing_linux.c
|
||||
src/detection/battery/battery_nosupport.c
|
||||
src/detection/bios/bios_windows.c
|
||||
src/detection/board/board_windows.c
|
||||
src/detection/bootmgr/bootmgr_nosupport.c
|
||||
src/detection/brightness/brightness_nosupport.c
|
||||
src/detection/chassis/chassis_windows.c
|
||||
src/detection/cpu/cpu_sunos.c
|
||||
src/detection/cpucache/cpucache_shared.c
|
||||
src/detection/cpuusage/cpuusage_sunos.c
|
||||
src/detection/cursor/cursor_linux.c
|
||||
src/detection/bluetooth/bluetooth_nosupport.c
|
||||
src/detection/bluetoothradio/bluetoothradio_nosupport.c
|
||||
src/detection/disk/disk_sunos.c
|
||||
src/detection/dns/dns_linux.c
|
||||
src/detection/physicaldisk/physicaldisk_nosupport.c
|
||||
src/detection/physicalmemory/physicalmemory_linux.c
|
||||
src/detection/diskio/diskio_sunos.c
|
||||
src/detection/displayserver/linux/displayserver_linux.c
|
||||
src/detection/displayserver/linux/drm.c
|
||||
src/detection/displayserver/linux/wayland/wayland.c
|
||||
src/detection/displayserver/linux/wayland/global-output.c
|
||||
src/detection/displayserver/linux/wayland/zwlr-output.c
|
||||
src/detection/displayserver/linux/wayland/kde-output.c
|
||||
src/detection/displayserver/linux/wayland/wlr-output-management-unstable-v1-protocol.c
|
||||
src/detection/displayserver/linux/wayland/kde-output-device-v2-protocol.c
|
||||
src/detection/displayserver/linux/wayland/kde-output-order-v1-protocol.c
|
||||
src/detection/displayserver/linux/wayland/xdg-output-unstable-v1-protocol.c
|
||||
src/detection/displayserver/linux/wmde.c
|
||||
src/detection/displayserver/linux/xcb.c
|
||||
src/detection/displayserver/linux/xlib.c
|
||||
src/detection/font/font_linux.c
|
||||
src/detection/gpu/gpu_sunos.c
|
||||
src/detection/gpu/gpu_pci.c
|
||||
src/detection/gtk_qt/gtk.c
|
||||
src/detection/host/host_windows.c
|
||||
src/detection/icons/icons_linux.c
|
||||
src/detection/initsystem/initsystem_linux.c
|
||||
src/detection/libc/libc_nosupport.c
|
||||
src/detection/lm/lm_nosupport.c
|
||||
src/detection/loadavg/loadavg_sunos.c
|
||||
src/detection/locale/locale_linux.c
|
||||
src/detection/localip/localip_linux.c
|
||||
src/detection/gamepad/gamepad_nosupport.c
|
||||
src/detection/media/media_linux.c
|
||||
src/detection/memory/memory_sunos.c
|
||||
src/detection/monitor/monitor_linux.c
|
||||
src/detection/netio/netio_sunos.c
|
||||
src/detection/opengl/opengl_linux.c
|
||||
src/detection/os/os_sunos.c
|
||||
src/detection/packages/packages_sunos.c
|
||||
src/detection/poweradapter/poweradapter_nosupport.c
|
||||
src/detection/processes/processes_linux.c
|
||||
src/detection/gtk_qt/qt.c
|
||||
src/detection/sound/sound_linux.c
|
||||
src/detection/swap/swap_sunos.c
|
||||
src/detection/terminalfont/terminalfont_linux.c
|
||||
src/detection/terminalshell/terminalshell_linux.c
|
||||
src/detection/terminalsize/terminalsize_linux.c
|
||||
src/detection/theme/theme_linux.c
|
||||
src/detection/uptime/uptime_sunos.c
|
||||
src/detection/users/users_linux.c
|
||||
src/detection/wallpaper/wallpaper_linux.c
|
||||
src/detection/wifi/wifi_nosupport.c
|
||||
src/detection/wm/wm_nosupport.c
|
||||
src/detection/de/de_linux.c
|
||||
src/detection/wmtheme/wmtheme_linux.c
|
||||
src/detection/camera/camera_nosupport.c
|
||||
src/util/platform/FFPlatform_unix.c
|
||||
src/util/linux/elf.c
|
||||
)
|
||||
endif()
|
||||
|
||||
if(ENABLE_DIRECTX_HEADERS)
|
||||
@@ -712,17 +838,15 @@ if(ENABLE_DIRECTX_HEADERS)
|
||||
list(APPEND LIBFASTFETCH_SRC src/detection/gpu/gpu_wsl.cpp)
|
||||
endif()
|
||||
|
||||
if(ENABLE_PROPRIETARY_GPU_DRIVER_API AND (LINUX OR BSD OR WIN32))
|
||||
message(STATUS "Enabling proprietary GPU driver API")
|
||||
if(LINUX OR BSD OR WIN32)
|
||||
list(APPEND LIBFASTFETCH_SRC src/detection/gpu/gpu_nvidia.c)
|
||||
endif()
|
||||
if(WIN32)
|
||||
list(APPEND LIBFASTFETCH_SRC src/detection/gpu/gpu_intel.c)
|
||||
list(APPEND LIBFASTFETCH_SRC src/detection/gpu/gpu_amd.c)
|
||||
endif()
|
||||
# Proprietary GPU driver APIs
|
||||
if(LINUX OR FreeBSD OR WIN32)
|
||||
list(APPEND LIBFASTFETCH_SRC src/detection/gpu/gpu_nvidia.c)
|
||||
list(APPEND LIBFASTFETCH_SRC src/detection/gpu/gpu_mthreads.c)
|
||||
endif()
|
||||
if(WIN32)
|
||||
list(APPEND LIBFASTFETCH_SRC src/detection/gpu/gpu_intel.c)
|
||||
list(APPEND LIBFASTFETCH_SRC src/detection/gpu/gpu_amd.c)
|
||||
endif()
|
||||
|
||||
include(CheckFunctionExists)
|
||||
check_function_exists(wcwidth HAVE_WCWIDTH)
|
||||
if(NOT HAVE_WCWIDTH)
|
||||
@@ -749,10 +873,6 @@ add_library(libfastfetch OBJECT
|
||||
${LIBFASTFETCH_SRC}
|
||||
)
|
||||
|
||||
if(ENABLE_PROPRIETARY_GPU_DRIVER_API AND (LINUX OR BSD OR WIN32))
|
||||
target_compile_definitions(libfastfetch PRIVATE FF_USE_PROPRIETARY_GPU_DRIVER_API)
|
||||
endif()
|
||||
|
||||
if(yyjson_FOUND)
|
||||
target_compile_definitions(libfastfetch PRIVATE FF_USE_SYSTEM_YYJSON)
|
||||
target_link_libraries(libfastfetch PRIVATE yyjson::yyjson)
|
||||
@@ -779,7 +899,7 @@ if(APPLE AND EXISTS "/usr/bin/otool")
|
||||
target_compile_definitions(libfastfetch PUBLIC FF_LIBSYSTEM_VERSION="${CMAKE_MATCH_1}")
|
||||
endif()
|
||||
endif()
|
||||
if(BSD AND EXISTS "/usr/local/bin/objdump")
|
||||
if(FreeBSD AND EXISTS "/usr/local/bin/objdump")
|
||||
execute_process(COMMAND /bin/sh -c "/usr/local/bin/objdump -T /lib/libc.so.* | grep 'FBSD_[^ )]*' -o | sort -Vru | head -1"
|
||||
OUTPUT_VARIABLE OBJDUMP_T_RESULT)
|
||||
if("${OBJDUMP_T_RESULT}" MATCHES "FBSD_([0-9]+\\.[0-9]+)")
|
||||
@@ -792,6 +912,8 @@ if(WIN32)
|
||||
target_compile_definitions(libfastfetch PUBLIC WIN32_LEAN_AND_MEAN=1)
|
||||
elseif(APPLE)
|
||||
target_compile_definitions(libfastfetch PUBLIC _DARWIN_C_SOURCE)
|
||||
elseif(SunOS)
|
||||
target_compile_definitions(libfastfetch PUBLIC __EXTENSIONS__ _POSIX_C_SOURCE=1)
|
||||
endif()
|
||||
|
||||
if(HAVE_STATX)
|
||||
@@ -815,6 +937,11 @@ if(NOT "${CUSTOM_OS_RELEASE_PATH}" STREQUAL "")
|
||||
target_compile_definitions(libfastfetch PRIVATE FF_CUSTOM_OS_RELEASE_PATH=${CUSTOM_OS_RELEASE_PATH})
|
||||
endif()
|
||||
|
||||
if(NOT BINARY_LINK_TYPE STREQUAL "dlopen")
|
||||
message(STATUS "Enabling custom link type: ${BINARY_LINK_TYPE}")
|
||||
target_compile_definitions(libfastfetch PRIVATE FF_DISABLE_DLOPEN=1)
|
||||
endif()
|
||||
|
||||
function(ff_lib_enable VARNAME PKGCONFIG_NAMES CMAKE_NAME)
|
||||
if(NOT ENABLE_${VARNAME})
|
||||
return()
|
||||
@@ -843,6 +970,11 @@ function(ff_lib_enable VARNAME PKGCONFIG_NAMES CMAKE_NAME)
|
||||
target_compile_definitions(libfastfetch PRIVATE FF_HAVE_${VARNAME}=1)
|
||||
target_include_directories(libfastfetch PRIVATE ${${VARNAME}_INCLUDE_DIRS})
|
||||
|
||||
if(NOT BINARY_LINK_TYPE STREQUAL "dlopen")
|
||||
target_link_directories(libfastfetch PUBLIC ${${VARNAME}_LIBRARY_DIRS})
|
||||
target_link_libraries(libfastfetch PRIVATE ${${VARNAME}_LIBRARIES})
|
||||
endif()
|
||||
|
||||
foreach(FLAG ${${VARNAME}_CFLAGS_OTHER})
|
||||
if(FLAG MATCHES "-D.*")
|
||||
string(SUBSTRING ${FLAG} 2 -1 FLAG)
|
||||
@@ -935,10 +1067,6 @@ ff_lib_enable(OPENCL
|
||||
"OpenCL"
|
||||
"OpenCL"
|
||||
)
|
||||
ff_lib_enable(LIBNM
|
||||
"libnm"
|
||||
"libnm"
|
||||
)
|
||||
ff_lib_enable(FREETYPE
|
||||
"freetype2"
|
||||
"FreeType2"
|
||||
@@ -951,6 +1079,10 @@ ff_lib_enable(DDCUTIL
|
||||
"ddcutil"
|
||||
"Ddcutil"
|
||||
)
|
||||
ff_lib_enable(ELF
|
||||
"libelf"
|
||||
"libelf"
|
||||
)
|
||||
ff_lib_enable(DIRECTX_HEADERS
|
||||
"DirectX-Headers"
|
||||
"DirectX-Headers"
|
||||
@@ -1004,12 +1136,19 @@ elseif(WIN32)
|
||||
PRIVATE "hid"
|
||||
PRIVATE "wtsapi32"
|
||||
)
|
||||
elseif(BSD)
|
||||
elseif(FreeBSD)
|
||||
target_link_libraries(libfastfetch
|
||||
PRIVATE "m"
|
||||
PRIVATE "usbhid"
|
||||
PRIVATE "geom"
|
||||
)
|
||||
elseif(SunOS)
|
||||
target_link_libraries(libfastfetch
|
||||
PRIVATE "m"
|
||||
PRIVATE "socket"
|
||||
PRIVATE "kstat"
|
||||
PRIVATE "proc"
|
||||
)
|
||||
elseif(ANDROID)
|
||||
CHECK_LIBRARY_EXISTS(-l:libandroid-wordexp.a wordexp "" HAVE_LIBANDROID_WORDEXP_STATIC)
|
||||
if(HAVE_LIBANDROID_WORDEXP_STATIC)
|
||||
@@ -1035,6 +1174,52 @@ target_link_libraries(libfastfetch
|
||||
PRIVATE ${CMAKE_DL_LIBS}
|
||||
)
|
||||
|
||||
target_compile_options(libfastfetch PRIVATE
|
||||
$<$<COMPILE_LANGUAGE:CXX>:-fno-exceptions -fno-rtti>)
|
||||
|
||||
if(WIN32)
|
||||
set(CMAKE_CXX_STANDARD 20)
|
||||
include(CheckIncludeFileCXX)
|
||||
CHECK_INCLUDE_FILE_CXX("winrt/Windows.Foundation.h" HAVE_WINRT)
|
||||
if(HAVE_WINRT)
|
||||
add_library(ffwinrt MODULE src/detection/media/media_windows.dll.cpp)
|
||||
target_link_libraries(ffwinrt PRIVATE "RuntimeObject")
|
||||
target_compile_definitions(ffwinrt PRIVATE WIN32_LEAN_AND_MEAN=1 WINRT_LEAN_AND_MEAN=1)
|
||||
target_link_options(ffwinrt
|
||||
PRIVATE "-static" # stdc++, winpthread, gcc_s, etc.
|
||||
)
|
||||
endif()
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
endif()
|
||||
if(LINUX)
|
||||
CHECK_INCLUDE_FILE("linux/videodev2.h" HAVE_LINUX_VIDEODEV2)
|
||||
if(HAVE_LINUX_VIDEODEV2)
|
||||
target_compile_definitions(libfastfetch PRIVATE FF_HAVE_LINUX_VIDEODEV2=1)
|
||||
endif()
|
||||
CHECK_INCLUDE_FILE("linux/wireless.h" HAVE_LINUX_WIRELESS)
|
||||
if(HAVE_LINUX_WIRELESS)
|
||||
target_compile_definitions(libfastfetch PRIVATE FF_HAVE_LINUX_WIRELESS=1)
|
||||
endif()
|
||||
endif()
|
||||
if(NOT WIN32)
|
||||
CHECK_INCLUDE_FILE("utmpx.h" HAVE_UTMPX)
|
||||
if(HAVE_UTMPX)
|
||||
target_compile_definitions(libfastfetch PRIVATE FF_HAVE_UTMPX=1)
|
||||
endif()
|
||||
CHECK_INCLUDE_FILE("wordexp.h" HAVE_WORDEXP)
|
||||
if(HAVE_WORDEXP)
|
||||
target_compile_definitions(libfastfetch PRIVATE FF_HAVE_WORDEXP=1)
|
||||
endif()
|
||||
CHECK_INCLUDE_FILE("pthread_np.h" HAVE_PTHREAD_NP)
|
||||
if(HAVE_PTHREAD_NP)
|
||||
target_compile_definitions(libfastfetch PRIVATE FF_HAVE_PTHREAD_NP=1)
|
||||
endif()
|
||||
check_function_exists("pthread_timedjoin_np" HAVE_TIMEDJOIN_NP)
|
||||
if(HAVE_TIMEDJOIN_NP)
|
||||
target_compile_definitions(libfastfetch PRIVATE FF_HAVE_TIMEDJOIN_NP=1)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
######################
|
||||
# Executable targets #
|
||||
######################
|
||||
@@ -1073,12 +1258,9 @@ if(yyjson_FOUND)
|
||||
endif()
|
||||
|
||||
if(WIN32)
|
||||
set(TARGET_NAME fastfetch)
|
||||
target_sources(fastfetch
|
||||
PRIVATE src/util/windows/version.rc
|
||||
)
|
||||
|
||||
set(TARGET_NAME flashfetch)
|
||||
target_sources(flashfetch
|
||||
PRIVATE src/util/windows/version.rc
|
||||
)
|
||||
@@ -1091,6 +1273,11 @@ elseif(APPLE)
|
||||
)
|
||||
endif()
|
||||
|
||||
if(BINARY_LINK_TYPE STREQUAL "static")
|
||||
target_link_options(fastfetch PRIVATE "-static")
|
||||
target_link_options(flashfetch PRIVATE "-static")
|
||||
endif()
|
||||
|
||||
###################
|
||||
# Testing targets #
|
||||
###################
|
||||
@@ -1126,14 +1313,21 @@ install(
|
||||
DESTINATION "${CMAKE_INSTALL_BINDIR}"
|
||||
)
|
||||
|
||||
if (TARGET ffwinrt)
|
||||
install(
|
||||
TARGETS ffwinrt
|
||||
DESTINATION "${CMAKE_INSTALL_BINDIR}"
|
||||
)
|
||||
endif()
|
||||
|
||||
install(
|
||||
FILES "${CMAKE_SOURCE_DIR}/completions/bash"
|
||||
FILES "${CMAKE_SOURCE_DIR}/completions/${CMAKE_PROJECT_NAME}.bash"
|
||||
DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/bash-completion/completions"
|
||||
RENAME "${CMAKE_PROJECT_NAME}"
|
||||
)
|
||||
|
||||
install(
|
||||
FILES "${CMAKE_SOURCE_DIR}/completions/fish"
|
||||
FILES "${CMAKE_SOURCE_DIR}/completions/${CMAKE_PROJECT_NAME}.fish"
|
||||
DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/fish/vendor_completions.d"
|
||||
RENAME "${CMAKE_PROJECT_NAME}.fish"
|
||||
)
|
||||
@@ -1143,10 +1337,12 @@ install(
|
||||
DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/${CMAKE_PROJECT_NAME}"
|
||||
)
|
||||
|
||||
install(
|
||||
FILES "${CMAKE_SOURCE_DIR}/LICENSE"
|
||||
DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/licenses/${CMAKE_PROJECT_NAME}"
|
||||
)
|
||||
if(INSTALL_LICENSE)
|
||||
install(
|
||||
FILES "${CMAKE_SOURCE_DIR}/LICENSE"
|
||||
DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/licenses/${CMAKE_PROJECT_NAME}"
|
||||
)
|
||||
endif()
|
||||
|
||||
install(
|
||||
FILES "${PROJECT_BINARY_DIR}/fastfetch.1"
|
||||
@@ -1180,12 +1376,17 @@ if(LINUX)
|
||||
set(CPACK_DEBIAN_PACKAGE_PRIORITY "optional")
|
||||
|
||||
if(NOT IS_MUSL)
|
||||
EXECUTE_PROCESS (
|
||||
EXECUTE_PROCESS(
|
||||
COMMAND getconf GNU_LIBC_VERSION
|
||||
OUTPUT_VARIABLE GLIBC_VERSION
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
STRING (REPLACE "glibc " "" GLIBC_VERSION ${GLIBC_VERSION})
|
||||
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libc6 (>= ${GLIBC_VERSION})")
|
||||
if(GLIBC_VERSION)
|
||||
STRING(REPLACE "glibc " "" GLIBC_VERSION ${GLIBC_VERSION})
|
||||
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libc6 (>= ${GLIBC_VERSION})")
|
||||
message(STATUS "found glibc ${GLIBC_VERSION}")
|
||||
else()
|
||||
message(WARNING "Could not determine glibc version. If `musl` is used, `-DIS_MUSL=ON` should be set")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2021 Linus Dierheimer
|
||||
Copyright (c) 2021-2023 Linus Dierheimer
|
||||
Copyright (c) 2022-2024 Carter Li
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
[](https://repology.org/project/fastfetch/versions)
|
||||
[](https://repology.org/project/fastfetch/versions)
|
||||
|
||||
Fastfetch is a [neofetch](https://github.com/dylanaraps/neofetch)-like tool for fetching system information and displaying them in a pretty way. It is written mainly in C, with performance and customizability in mind. Currently, Linux, Android, FreeBSD, MacOS and Windows 7+ are supported.
|
||||
Fastfetch is a [neofetch](https://github.com/dylanaraps/neofetch)-like tool for fetching system information and displaying it prettily. It is written mainly in C, with performance and customizability in mind. Currently, Linux, Android, FreeBSD, macOS, SunOS and Windows 7+ are supported.
|
||||
|
||||
<img src="screenshots/example1.png" width="49%" align="left" />
|
||||
<img src="https://upload.wikimedia.org/wikipedia/commons/2/24/Transparent_Square_Tiles_Texture.png" width="49%" height="16px" align="left" />
|
||||
@@ -21,15 +21,16 @@ Fastfetch is a [neofetch](https://github.com/dylanaraps/neofetch)-like tool for
|
||||
<img src="screenshots/example3.png" width="48%" align="top" />
|
||||
<img src="screenshots/example5.png" height="15%" align="top" />
|
||||
|
||||
There are [screenshots on different platforms](https://github.com/fastfetch-cli/fastfetch/wiki)
|
||||
There are [screenshots on different platforms](https://github.com/fastfetch-cli/fastfetch/wiki).
|
||||
|
||||
## Installation
|
||||
|
||||
### Linux
|
||||
|
||||
Some distros packaged an outdated fastfetch version. Older version is not supported, please always ensure that the latest version is used.
|
||||
Some distros packaged an outdated fastfetch version. Older version receive no support, so please try always to use the latest version.
|
||||
|
||||
* Ubuntu: [`ppa:zhangsongcui3371/fastfetch`](https://launchpad.net/~zhangsongcui3371/+archive/ubuntu/fastfetch) (for Ubuntu 22.04 or newer)
|
||||
* Debian: `sudo apt install fastfetch` (for Debian 13 or newer)
|
||||
* Debian / Ubuntu: Download `fastfetch-linux-<proper architecture>.deb` from [Github release page](https://github.com/fastfetch-cli/fastfetch/releases/latest) and double-click it (for Ubuntu 20.04 or newer and Debian 11 or newer).
|
||||
* Arch Linux: `sudo pacman -S fastfetch`
|
||||
* Fedora: `sudo dnf install fastfetch`
|
||||
@@ -43,31 +44,28 @@ Replace sudo with doas depending on what you use.
|
||||
|
||||
[See also if fastfetch has been packaged for your favorite Linux distro](#Packaging).
|
||||
|
||||
If fastfetch is not packaged for your distro or an outdated version is packaged, [linuxbrew](https://brew.sh/) is a good alternate: `brew install fastfetch`
|
||||
If fastfetch is not packaged for your distro or an outdated version is packaged, [linuxbrew](https://brew.sh/) is a good alternative: `brew install fastfetch`
|
||||
|
||||
### macOS
|
||||
|
||||
...via [HomeBrew](https://brew.sh):
|
||||
|
||||
`brew install fastfetch`
|
||||
|
||||
...via [MacPorts](https://www.macports.org):
|
||||
|
||||
`sudo port install fastfetch`
|
||||
* [HomeBrew](https://formulae.brew.sh/formula/fastfetch#default): `brew install fastfetch`
|
||||
* [MacPorts](https://ports.macports.org/port/fastfetch/): `sudo port install fastfetch`
|
||||
|
||||
### Windows
|
||||
|
||||
`scoop install fastfetch`
|
||||
* [scoop](https://scoop.sh/#/apps?q=fastfetch): `scoop install fastfetch`
|
||||
* [winget](https://github.com/microsoft/winget-pkgs/tree/master/manifests/f/Fastfetch-cli/Fastfetch): `winget install fastfetch`
|
||||
* [MSYS2 MinGW](https://github.com/msys2/MINGW-packages/tree/master/mingw-w64-fastfetch): `pacman -S mingw-w64-<subsystem>-<arch>-fastfetch`
|
||||
|
||||
You may also download it directly from [GitHub releases page](https://github.com/fastfetch-cli/fastfetch/releases/latest) and extract the archive.
|
||||
You may also download the program directly from [the GitHub releases page](https://github.com/fastfetch-cli/fastfetch/releases/latest) in the form of an archive file.
|
||||
|
||||
### FreeBSD
|
||||
|
||||
`pkg install fastfetch`
|
||||
* `pkg install fastfetch`
|
||||
|
||||
### Android (Termux)
|
||||
|
||||
`pkg install fastfetch`
|
||||
* `pkg install fastfetch`
|
||||
|
||||
## Build from source
|
||||
|
||||
@@ -83,7 +81,7 @@ See Wiki: https://github.com/fastfetch-cli/fastfetch/wiki/Building
|
||||
|
||||
## Customization
|
||||
|
||||
Fastfetch uses the JSONC (or JSON with comments) for configuration. [See Wiki for detail](https://github.com/fastfetch-cli/fastfetch/wiki/Configuration). There are some premade config files in [`presets`](presets), including the ones used for the screenshots above. You can load them using `-c <filename>`. They may also serve as a good example for format arguments.
|
||||
Fastfetch uses the JSONC (or JSON with comments) for configuration. [See Wiki for detail](https://github.com/fastfetch-cli/fastfetch/wiki/Configuration). There are some premade config files in [`presets`](presets), including the ones used for the screenshots above. You can load them using `-c <filename>`. Those files can serve as examples of the configuration syntax.
|
||||
|
||||
Logos can be heavily customized too; see the [logo documentation](https://github.com/fastfetch-cli/fastfetch/wiki/Logo-options) for more information.
|
||||
|
||||
@@ -105,10 +103,10 @@ Logos can be heavily customized too; see the [logo documentation](https://github
|
||||
|
||||
1. Fastfetch is actively maintained.
|
||||
2. Fastfetch is faster. As the name suggests.
|
||||
3. Fastfetch is more feature-rich. By default fastfetch only has a few modules enabled. Use `fastfetch -c all` to find what you want.
|
||||
4. Fastfetch is more configurable. You can find more information in the Wiki: <https://github.com/fastfetch-cli/fastfetch/wiki/Configuration>
|
||||
5. Fastfetch is more polished. For example, neofetch prints `555MiB` in `Memory` module and `23G` in `Disk` module (notibily the difference of `MiB` and `G`), while fastfetch prints `555.00 MiB` and `22.97 GiB` respectively.
|
||||
6. Fastfetch is more accurate. For example, [neofetch never actually supports Wayland protocol](https://github.com/dylanaraps/neofetch/pull/2395).
|
||||
3. Fastfetch has a greater number of features, though by default fastfetch only has a few modules enabled; use `fastfetch -c all` to find what you want.
|
||||
4. Fastfetch is more configurable. You can find more information in the Wiki: <https://github.com/fastfetch-cli/fastfetch/wiki/Configuration>.
|
||||
5. Fastfetch is more polished. For example, neofetch prints `555MiB` in `Memory` module and `23G` in `Disk` module, whereas fastfetch prints `555.00 MiB` and `22.97 GiB` respectively.
|
||||
6. Fastfetch is more accurate. For example, [neofetch never actually supports the Wayland protocol](https://github.com/dylanaraps/neofetch/pull/2395).
|
||||
|
||||
### Q: Fastfetch shows my local IP address. It leaks my privacy!
|
||||
|
||||
@@ -120,7 +118,7 @@ If you really don't like it, you can disable the `Local IP` module in `config.js
|
||||
|
||||
### Q: Where is the config file? I can't find it.
|
||||
|
||||
`Fastfetch` don't generate config file automatically. You can use `fastfetch --gen-config` to generate one. The config file will be saved in `~/.config/fastfetch/config.jsonc` by default. See [Wiki for detail](https://github.com/fastfetch-cli/fastfetch/wiki/Configuration).
|
||||
`Fastfetch` does not generate config file automatically. You can use `fastfetch --gen-config` to generate one. The config file will be saved in `~/.config/fastfetch/config.jsonc` by default. See [Wiki for detail](https://github.com/fastfetch-cli/fastfetch/wiki/Configuration).
|
||||
|
||||
### Q: The configuration is so complex. Where is the documentation?
|
||||
|
||||
@@ -128,13 +126,19 @@ Fastfetch uses JSON (with comments) for configuration. I suggest you use an IDE
|
||||
|
||||
Alternatively, you can refer to the presets in [`presets` directory](https://github.com/fastfetch-cli/fastfetch/tree/dev/presets).
|
||||
|
||||
The **correct** way to edit the configuration:
|
||||
|
||||
This is an example that [changes size prefix from MiB / GiB to MB / GB](https://github.com/fastfetch-cli/fastfetch/discussions/1014). Editor used: [helix](https://github.com/helix-editor/helix)
|
||||
|
||||
[](https://asciinema.org/a/1uF6sTPGKrHKI1MVaFcikINSQ)
|
||||
|
||||
### Q: I WANT THE DOCUMENTATION!
|
||||
|
||||
[Here is the documentation](https://github.com/fastfetch-cli/fastfetch/wiki/Json-Schema). It is generated from [JSON schema](https://github.com/fastfetch-cli/fastfetch/blob/dev/doc/json_schema.json) but you won't like it.
|
||||
|
||||
### Q: How can I customize the module output?
|
||||
|
||||
Fastfetch uses `format` to generate output. For example to make `GPU` module show GPU name only and ignore other information, you can use
|
||||
Fastfetch uses `format` to generate output. For example, to make the `GPU` module show only the GPU name (leaving other information undisplayed), you can use
|
||||
|
||||
```jsonc
|
||||
{
|
||||
@@ -147,14 +151,23 @@ Fastfetch uses `format` to generate output. For example to make `GPU` module sho
|
||||
}
|
||||
```
|
||||
|
||||
which is equivalent to `fastfetch -s gpu --gpu-format '{2}'`
|
||||
. . which is equivalent to `fastfetch -s gpu --gpu-format '{2}'`
|
||||
|
||||
See `fastfetch -h format` for basic usage. For module specific formattion, see `fastfetch -h <module>-format`
|
||||
See `fastfetch -h format` for information on basic usage. For module specific formattion, see `fastfetch -h <module>-format`
|
||||
|
||||
### Q: I have my own ascii-art / image file. How can I show it with fastfetch?
|
||||
|
||||
Try `fastfetch -l /path/to/logo`. See [logo documentation](https://github.com/fastfetch-cli/fastfetch/wiki/Logo-options) for detail.
|
||||
|
||||
If you just want to display distro name in [FIGlet text](https://github.com/pwaller/pyfiglet):
|
||||
|
||||
```bash
|
||||
# install pyfiglet and jq first
|
||||
pyfiglet -s -f small_slant $(fastfetch -s os --format json | jq -r '.[0].result.name') && fastfetch -l none
|
||||
```
|
||||
|
||||

|
||||
|
||||
### Q: Fastfetch runs in white and black on shell startup. Why?
|
||||
|
||||
This issue usually happens when using fastfetch with `p10k`. There are known incompatibility between fastfetch and p10k instant prompt.
|
||||
@@ -162,6 +175,10 @@ The p10k doc clearly states that you should NOT print anything to stdout after `
|
||||
|
||||
You can always use `fastfetch --pipe false` to force fastfetch running in colorful mode.
|
||||
|
||||
### Q: Why do fastfetch and neofetch show different memory usage result?
|
||||
|
||||
See [#1096](https://github.com/fastfetch-cli/fastfetch/issues/1096).
|
||||
|
||||
### Q: I want feature A / B / C. Will fastfetch support it?
|
||||
|
||||
Fastfetch is a system information tool. We only accept hardware or system level software feature requests. For most personal uses, I recommend using `Command` module to detect it yourself, which can be used to grab output from a custom shell script:
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
__fastfetch_complete_help()
|
||||
{
|
||||
local __ff_helps=(
|
||||
@@ -85,12 +83,12 @@ __fastfetch_complete_logo_type()
|
||||
|
||||
__fastfetch_complete_binary_prefix()
|
||||
{
|
||||
local __ff_binary_prefixes=(
|
||||
local __ff_size_binary_prefixes=(
|
||||
"iec"
|
||||
"si"
|
||||
"jedec"
|
||||
)
|
||||
COMPREPLY=($(compgen -W "${__ff_binary_prefixes[*]}" -- "$CURRENT_WORD"))
|
||||
COMPREPLY=($(compgen -W "${__ff_size_binary_prefixes[*]}" -- "$CURRENT_WORD"))
|
||||
}
|
||||
|
||||
__fastfetch_complete_gl()
|
||||
@@ -349,6 +347,7 @@ __fastfetch_completion()
|
||||
"--users-key"
|
||||
"--users-format"
|
||||
"--users-key-color"
|
||||
"--users-myself-only"
|
||||
"--bluetooth-key"
|
||||
"--bluetooth-format"
|
||||
"--bluetooth-key-color"
|
||||
@@ -357,7 +356,6 @@ __fastfetch_completion()
|
||||
local FF_OPTIONS_PATH=(
|
||||
"-c"
|
||||
"--config"
|
||||
"--lib-pci"
|
||||
"--lib-vulkan"
|
||||
"--lib-wayland"
|
||||
"--lib-xcb-randr"
|
||||
Executable
+101
@@ -0,0 +1,101 @@
|
||||
if not type -q fastfetch
|
||||
exit
|
||||
end
|
||||
|
||||
complete -c fastfetch -f
|
||||
|
||||
function __fastfetch_complete_bool
|
||||
echo -e "true\tBool"
|
||||
echo -e "false\tBool"
|
||||
end
|
||||
|
||||
function __fastfetch_complete_color
|
||||
echo -e "black\tColor"
|
||||
echo -e "red\tColor"
|
||||
echo -e "green\tColor"
|
||||
echo -e "yellow\tColor"
|
||||
echo -e "blue\tColor"
|
||||
echo -e "magenta\tColor"
|
||||
echo -e "cyan\tColor"
|
||||
echo -e "white\tColor"
|
||||
echo -e "default\tColor"
|
||||
end
|
||||
|
||||
function __fastfetch_complete_command
|
||||
for line in (fastfetch --list-modules autocompletion)
|
||||
set -l pair (string split -m 2 : $line)
|
||||
set -l module (string lower $pair[1])
|
||||
|
||||
echo -e "$module-format\tModule format"
|
||||
end
|
||||
echo -e "format\tCustom format"
|
||||
echo -e "color\tColor format"
|
||||
end
|
||||
|
||||
function __fastfetch_complete_config
|
||||
for line in (fastfetch --list-presets autocompletion)
|
||||
echo -e "$line\tPreset"
|
||||
end
|
||||
echo -e "none\tDisable loading config file"
|
||||
end
|
||||
|
||||
function __fastfetch_complete_logo
|
||||
for line in (fastfetch --list-logos autocompletion)
|
||||
echo -e "$line\tBuiltin logo"
|
||||
end
|
||||
echo -e "none\tDon't print logo"
|
||||
echo -e "small\tPrint small ascii logo if available"
|
||||
end
|
||||
|
||||
function __fastfetch_complete_structure
|
||||
for line in (fastfetch --list-modules autocompletion)
|
||||
set -l pair (string split -m 2 : $line)
|
||||
echo -e "$pair[1]\t$pair[2]"
|
||||
end
|
||||
end
|
||||
|
||||
echo '
|
||||
import json, subprocess, sys
|
||||
|
||||
def main():
|
||||
data: dict[str, list[dict]] = json.loads(subprocess.check_output(["fastfetch", "--help-raw"]))
|
||||
|
||||
for key in data:
|
||||
for flag in data[key]:
|
||||
if flag.get("pseudo", False):
|
||||
continue
|
||||
|
||||
command_prefix = f"""complete -c fastfetch -d "{flag["desc"]}" -l "{flag["long"]}\""""
|
||||
if "short" in flag:
|
||||
command_prefix += f""" -o {flag["short"]}"""
|
||||
|
||||
if "arg" in flag:
|
||||
type: str = flag["arg"]["type"];
|
||||
if type == "bool":
|
||||
print(f"{command_prefix} -x -a \"(__fastfetch_complete_bool)\"")
|
||||
elif type == "color":
|
||||
print(f"{command_prefix} -x -a \"(__fastfetch_complete_color)\"")
|
||||
elif type == "command":
|
||||
print(f"{command_prefix} -x -a \"(__fastfetch_complete_command)\"")
|
||||
elif type == "config":
|
||||
print(f"{command_prefix} -x -a \"(__fastfetch_complete_config)\"")
|
||||
elif type == "enum":
|
||||
temp: str = " ".join(flag["arg"]["enum"])
|
||||
print(f"{command_prefix} -x -a \"{temp}\"")
|
||||
elif type == "logo":
|
||||
print(f"{command_prefix} -x -a \"(__fastfetch_complete_logo)\"")
|
||||
elif type == "structure":
|
||||
print(f"{command_prefix} -x -a \"(__fish_complete_list : __fastfetch_complete_structure)\"")
|
||||
elif type == "path":
|
||||
print(f"{command_prefix} -r -F")
|
||||
else:
|
||||
print(f"{command_prefix} -x")
|
||||
else:
|
||||
print(f"{command_prefix} -f")
|
||||
|
||||
if __name__ == "__main__":
|
||||
try:
|
||||
main()
|
||||
except:
|
||||
sys.exit(1)
|
||||
' | python3 | source
|
||||
@@ -1,105 +0,0 @@
|
||||
#!/usr/bin/env fish
|
||||
|
||||
if not type -q fastfetch
|
||||
exit
|
||||
end
|
||||
|
||||
complete -c fastfetch -f
|
||||
|
||||
function __fastfetch_complete_bool
|
||||
echo -e "true\tBool"
|
||||
echo -e "false\tBool"
|
||||
end
|
||||
|
||||
function __fastfetch_complete_color
|
||||
echo -e "black\tColor"
|
||||
echo -e "red\tColor"
|
||||
echo -e "green\tColor"
|
||||
echo -e "yellow\tColor"
|
||||
echo -e "blue\tColor"
|
||||
echo -e "magenta\tColor"
|
||||
echo -e "cyan\tColor"
|
||||
echo -e "white\tColor"
|
||||
echo -e "default\tColor"
|
||||
end
|
||||
|
||||
function __fastfetch_complete_command
|
||||
for line in (fastfetch --list-modules autocompletion)
|
||||
set -l pair (string split -m 2 : $line)
|
||||
set -l module (string lower $pair[1])
|
||||
|
||||
echo -e "$module-format\tModule format"
|
||||
end
|
||||
echo -e "format\tCustom format"
|
||||
echo -e "color\tColor format"
|
||||
end
|
||||
|
||||
function __fastfetch_complete_config
|
||||
for line in (fastfetch --list-presets autocompletion)
|
||||
echo -e "$line\tPreset"
|
||||
end
|
||||
echo -e "none\tDisable loading config file"
|
||||
end
|
||||
|
||||
function __fastfetch_complete_logo
|
||||
for line in (fastfetch --list-logos autocompletion)
|
||||
echo -e "$line\tBuiltin logo"
|
||||
end
|
||||
echo -e "none\tDon't print logo"
|
||||
echo -e "small\tPrint small ascii logo if available"
|
||||
end
|
||||
|
||||
function __fastfetch_complete_structure
|
||||
for line in (fastfetch --list-modules autocompletion)
|
||||
set -l pair (string split -m 2 : $line)
|
||||
echo -e "$pair[1]\t$pair[2]"
|
||||
end
|
||||
end
|
||||
|
||||
string match -r -a -g "^###> ?(.*)" < (status -f) | string collect | python3 | source
|
||||
|
||||
###> #!/usr/bin/env python3
|
||||
###>
|
||||
###> import json, subprocess, sys
|
||||
###>
|
||||
###> def main():
|
||||
###> data: dict[str, list[dict]] = json.loads(subprocess.check_output(['fastfetch', '--help-raw']))
|
||||
###>
|
||||
###> for key in data:
|
||||
###> for flag in data[key]:
|
||||
###> if flag.get('pseudo', False):
|
||||
###> continue
|
||||
###>
|
||||
###> command_prefix: str = f'complete -c fastfetch -d "{flag["desc"]}" -l "{flag["long"]}"';
|
||||
###> if 'short' in flag:
|
||||
###> command_prefix += f' -o "{flag["short"]}"'
|
||||
###>
|
||||
###> if 'arg' in flag:
|
||||
###> type: str = flag['arg']['type'];
|
||||
###> if type == 'bool':
|
||||
###> print(f'{command_prefix} -x -a "(__fastfetch_complete_bool)"')
|
||||
###> elif type == 'color':
|
||||
###> print(f'{command_prefix} -x -a "(__fastfetch_complete_color)"')
|
||||
###> elif type == 'command':
|
||||
###> print(f'{command_prefix} -x -a "(__fastfetch_complete_command)"')
|
||||
###> elif type == 'config':
|
||||
###> print(f'{command_prefix} -x -a "(__fastfetch_complete_config)"')
|
||||
###> elif type == 'enum':
|
||||
###> print(f'{command_prefix} -x -a "{' '.join(flag["arg"]["enum"])}"')
|
||||
###> elif type == 'logo':
|
||||
###> print(f'{command_prefix} -x -a "(__fastfetch_complete_logo)"')
|
||||
###> elif type == 'structure':
|
||||
###> print(f'{command_prefix} -x -a "(__fish_complete_list : __fastfetch_complete_structure)"')
|
||||
###> elif type == 'path':
|
||||
###> print(f'{command_prefix} -r -F')
|
||||
###> else:
|
||||
###> print(f'{command_prefix} -x')
|
||||
###> else:
|
||||
###> print(f'{command_prefix} -f')
|
||||
###>
|
||||
###> if __name__ == "__main__":
|
||||
###> try:
|
||||
###> main()
|
||||
###> except:
|
||||
###> sys.exit(1)
|
||||
###>
|
||||
Vendored
+114
@@ -1,3 +1,117 @@
|
||||
fastfetch (2.21.0) jammy; urgency=medium
|
||||
|
||||
* Update to 2.21.0
|
||||
|
||||
-- Carter Li <zhangsongcui@live.cn> Mon, 05 Aug 2024 14:35:43 +0800
|
||||
|
||||
fastfetch (2.20.0) jammy; urgency=medium
|
||||
|
||||
* Update to 2.20.0
|
||||
|
||||
-- Carter Li <zhangsongcui@live.cn> Fri, 26 Jul 2024 14:02:50 +0800
|
||||
|
||||
fastfetch (2.19.1) jammy; urgency=medium
|
||||
|
||||
* Update to 2.19.1
|
||||
|
||||
-- Carter Li <zhangsongcui@live.cn> Tue, 23 Jul 2024 10:25:14 +0800
|
||||
|
||||
fastfetch (2.19.0) jammy; urgency=medium
|
||||
|
||||
* Update to 2.19.0
|
||||
|
||||
-- Carter Li <zhangsongcui@live.cn> Mon, 22 Jul 2024 14:17:55 +0800
|
||||
|
||||
fastfetch (2.18.1) jammy; urgency=medium
|
||||
|
||||
* Update to 2.18.1
|
||||
|
||||
-- Carter Li <zhangsongcui@live.cn> Thu, 11 Jul 2024 14:32:15 +0800
|
||||
|
||||
fastfetch (2.18.0) jammy; urgency=medium
|
||||
|
||||
* Update to 2.18.0
|
||||
|
||||
-- Carter Li <zhangsongcui@live.cn> Wed, 10 Jul 2024 16:46:32 +0800
|
||||
|
||||
fastfetch (2.17.2) jammy; urgency=medium
|
||||
|
||||
* Update to 2.17.2
|
||||
|
||||
-- Carter Li <zhangsongcui@live.cn> Thu, 04 Jul 2024 10:22:44 +0800
|
||||
|
||||
fastfetch (2.17.1) jammy; urgency=medium
|
||||
|
||||
* Update to 2.17.1
|
||||
|
||||
-- Carter Li <zhangsongcui@live.cn> Mon, 01 Jul 2024 08:56:29 +0800
|
||||
|
||||
fastfetch (2.17.0) jammy; urgency=medium
|
||||
|
||||
* Update to 2.17.0
|
||||
|
||||
-- Carter Li <zhangsongcui@live.cn> Fri, 28 Jun 2024 13:43:18 +0800
|
||||
|
||||
fastfetch (2.16.0) jammy; urgency=medium
|
||||
|
||||
* Update to 2.16.0
|
||||
|
||||
-- Carter Li <zhangsongcui@live.cn> Wed, 19 Jun 2024 14:53:43 +0800
|
||||
|
||||
fastfetch (2.15.0) jammy; urgency=medium
|
||||
|
||||
* Update to 2.15.0
|
||||
|
||||
-- Carter Li <zhangsongcui@live.cn> Fri, 07 Jun 2024 13:52:43 +0800
|
||||
|
||||
fastfetch (2.14.0) jammy; urgency=medium
|
||||
|
||||
* Update to 2.14.0
|
||||
|
||||
-- Carter Li <zhangsongcui@live.cn> Thu, 30 May 2024 14:27:54 +0800
|
||||
|
||||
fastfetch (2.13.2) jammy; urgency=medium
|
||||
|
||||
* Update to 2.13.2
|
||||
|
||||
-- Carter Li <zhangsongcui@live.cn> Fri, 24 May 2024 13:48:59 +0800
|
||||
|
||||
fastfetch (2.13.1) jammy; urgency=medium
|
||||
|
||||
* Update to 2.13.1
|
||||
|
||||
-- Carter Li <zhangsongcui@live.cn> Tue, 21 May 2024 15:10:37 +0800
|
||||
|
||||
fastfetch (2.12.0) jammy; urgency=medium
|
||||
|
||||
* Update to 2.12.0
|
||||
|
||||
-- Carter Li <zhangsongcui@live.cn> Tue, 14 May 2024 16:33:33 +0800
|
||||
|
||||
fastfetch (2.11.5) jammy; urgency=medium
|
||||
|
||||
* Update to 2.11.5
|
||||
|
||||
-- Carter Li <zhangsongcui@live.cn> Tue, 07 May 2024 09:30:05 +0800
|
||||
|
||||
fastfetch (2.11.3) jammy; urgency=medium
|
||||
|
||||
* Update to 2.11.3
|
||||
|
||||
-- Carter Li <zhangsongcui@live.cn> Mon, 06 May 2024 08:46:45 +0800
|
||||
|
||||
fastfetch (2.10.2) jammy; urgency=medium
|
||||
|
||||
* Update to 2.10.2
|
||||
|
||||
-- Carter Li <zhangsongcui@live.cn> Tue, 23 Apr 2024 15:18:23 +0800
|
||||
|
||||
fastfetch (2.10.1) jammy; urgency=medium
|
||||
|
||||
* Update to 2.10.1
|
||||
|
||||
-- Carter Li <zhangsongcui@live.cn> Tue, 23 Apr 2024 09:55:02 +0800
|
||||
|
||||
fastfetch (2.9.2) jammy; urgency=medium
|
||||
|
||||
* Update to 2.9.2
|
||||
|
||||
Vendored
+1
-1
@@ -2,7 +2,7 @@ Source: fastfetch
|
||||
Section: universe/utils
|
||||
Priority: optional
|
||||
Maintainer: Carter Li <zhangsongcui@live.cn>
|
||||
Build-Depends: libvulkan-dev, libwayland-dev, libxrandr-dev, libxcb-randr0-dev, libdconf-dev, libdbus-1-dev, libmagickcore-dev, libxfconf-0-dev, libsqlite3-dev, librpm-dev, libegl-dev, libglx-dev, libosmesa6-dev, ocl-icd-opencl-dev, libnm-dev, libpulse-dev, libdrm-dev, libddcutil-dev, libchafa-dev, directx-headers-dev, pkgconf, cmake (>= 3.12), debhelper (>= 11.2), dh-cmake, dh-cmake-compat (= 1), dh-sequence-cmake, dh-sequence-ctest, ninja-build
|
||||
Build-Depends: libvulkan-dev, libwayland-dev, libxrandr-dev, libxcb-randr0-dev, libdconf-dev, libdbus-1-dev, libmagickcore-dev, libxfconf-0-dev, libsqlite3-dev, librpm-dev, libegl-dev, libglx-dev, libosmesa6-dev, ocl-icd-opencl-dev, libpulse-dev, libdrm-dev, libddcutil-dev, libchafa-dev, directx-headers-dev, pkgconf, cmake (>= 3.12), debhelper (>= 11.2), dh-cmake, dh-cmake-compat (= 1), dh-sequence-cmake, dh-sequence-ctest, ninja-build
|
||||
Standards-Version: 4.0.0
|
||||
Homepage: https://github.com/fastfetch-cli/fastfetch
|
||||
|
||||
|
||||
Vendored
+1
-1
@@ -1 +1 @@
|
||||
fastfetch_2.9.2_source.buildinfo universe/utils optional
|
||||
fastfetch_2.20.0_source.buildinfo universe/utils optional
|
||||
|
||||
+28
-18
@@ -26,7 +26,7 @@ the exit code will be non\-zero.
|
||||
.SS "Informative Options"
|
||||
.TP
|
||||
|
||||
.B \-h, \-\-help \fI [command]
|
||||
.B \-h, \-\-help \fI[command]
|
||||
Show help output, displaying all available options or help for given command
|
||||
.TP
|
||||
|
||||
@@ -43,7 +43,7 @@ List search paths of presets and logos
|
||||
.TP
|
||||
|
||||
.B \-\-list\-logos
|
||||
List available logos, they can be loaded with \fI \-\-logo
|
||||
List available logos, they can be loaded with \fI\-\-logo
|
||||
.TP
|
||||
|
||||
.B \-\-list\-modules
|
||||
@@ -51,7 +51,7 @@ List available modules
|
||||
.TP
|
||||
|
||||
.B \-\-list\-presets
|
||||
List available presets, they can be loaded with \fI \-\-config
|
||||
List available presets, they can be loaded with \fI\-\-config
|
||||
.TP
|
||||
|
||||
.B \-\-list\-features
|
||||
@@ -64,16 +64,24 @@ Print available logos
|
||||
|
||||
.B \-\-print\-structure
|
||||
Print the default structure
|
||||
.TP
|
||||
|
||||
.B \-\-format \fI<type>
|
||||
Set the output format. Besides the
|
||||
.I default
|
||||
format, only
|
||||
.I json
|
||||
is supported currently.
|
||||
|
||||
|
||||
.SS "Display Options"
|
||||
.TP
|
||||
|
||||
.B \-l, \-\-logo \fI <logo>
|
||||
.B \-l, \-\-logo \fI<logo>
|
||||
Set the logo to display
|
||||
.TP
|
||||
|
||||
.B \-s, \-\-structure \fI <structure>
|
||||
.B \-s, \-\-structure \fI<structure>
|
||||
Set the structure of the fetch. For details about the structure,
|
||||
see the CONFIGURATION section.
|
||||
|
||||
@@ -81,38 +89,40 @@ see the CONFIGURATION section.
|
||||
.SS "Config Options"
|
||||
.TP
|
||||
|
||||
.B \-c, \-\-config \fI <config>
|
||||
Use the specified config file or preset. If "none", disable further config
|
||||
loading. For details about config files, see the CONFIGURATION section
|
||||
.B \-c, \-\-config \fI<config>
|
||||
Use the specified config file or preset. If
|
||||
.I none
|
||||
is specified, disable further config loading. For details about
|
||||
config files, see the CONFIGURATION section
|
||||
.TP
|
||||
|
||||
.B \-\-gen\-config \fI [file]
|
||||
.B \-\-gen\-config \fI[file]
|
||||
Generate a config file with options specified on the command line.
|
||||
If \fI file \fR is specified, the configuration will written to the
|
||||
If \fIfile\fR is specified, the configuration will be written to the
|
||||
file, otherwise it will be written to stdout.
|
||||
.TP
|
||||
|
||||
.B \-\-gen\-config\-force \fI [file]
|
||||
Same as \fB \-\-gen\-config\fR, but overwrites existing config
|
||||
.B \-\-gen\-config\-force \fI[file]
|
||||
Same as \fB\-\-gen\-config\fR, but overwrites existing config
|
||||
.TP
|
||||
|
||||
|
||||
To list all options, use \fB \-\-help\fR this will also print all available module options.
|
||||
To list all options, use \fB\-\-help\fR. It will also print all available module options.
|
||||
|
||||
.SH CONFIGURATION
|
||||
.SS "Fetch Structure"
|
||||
The structure of a fetch describes the modules that should be included in
|
||||
the output. It consists of a string of modules, separated by a colon (:).
|
||||
To list all available modules, use \fB \-\-list\-modules \fR
|
||||
To list all available modules, use \fB\-\-list\-modules\fR
|
||||
|
||||
.SS "Config Files"
|
||||
|
||||
Fastfetch uses JSONC based format for configuration. Fastfetch doesn't generate
|
||||
config file automatically; it should be generated manually by \fB \-\-gen\-config\fR.
|
||||
config file automatically; it should be generated manually by \fB\-\-gen\-config\fR.
|
||||
The config file will be saved in \fB~/.config/fastfetch/config.jsonc\fR by default.
|
||||
|
||||
A JSONC config file is a JSON file that also supports comments with (//). Those
|
||||
files must have the extension '.jsonc'.
|
||||
A JSONC config file is a JSON file that also supports comments with (// and /* */).
|
||||
Those files must have the extension '.jsonc'.
|
||||
|
||||
The specified configuration/preset files are searched in the following order:
|
||||
|
||||
@@ -128,4 +138,4 @@ Fastfetch provides some default presets. List them with \fB\-\-list\-presets\fR.
|
||||
.BR neofetch (1)
|
||||
|
||||
.SH BUGS
|
||||
Please report bugs to:\fI https://github.com/fastfetch\-cli/fastfetch/issues \fR
|
||||
Please report bugs to: \fIhttps://github.com/fastfetch\-cli/fastfetch/issues\fR
|
||||
|
||||
+431
-126
File diff suppressed because it is too large
Load Diff
+38
-6
@@ -1,19 +1,27 @@
|
||||
{
|
||||
"$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json",
|
||||
"logo": {
|
||||
"padding": {
|
||||
"top": 2
|
||||
}
|
||||
},
|
||||
"modules": [
|
||||
"title",
|
||||
"separator",
|
||||
"os",
|
||||
"host",
|
||||
"bios",
|
||||
"bootmgr",
|
||||
"board",
|
||||
"chassis",
|
||||
"kernel",
|
||||
"initsystem",
|
||||
"uptime",
|
||||
"loadavg",
|
||||
"processes",
|
||||
"packages",
|
||||
"shell",
|
||||
"editor",
|
||||
"display",
|
||||
"brightness",
|
||||
"monitor",
|
||||
@@ -30,9 +38,18 @@
|
||||
"terminalfont",
|
||||
"terminalsize",
|
||||
"terminaltheme",
|
||||
"cpu",
|
||||
{
|
||||
"type": "cpu",
|
||||
"showPeCoreCount": true,
|
||||
"temp": true
|
||||
},
|
||||
"cpucache",
|
||||
"cpuusage",
|
||||
"gpu",
|
||||
{
|
||||
"type": "gpu",
|
||||
"driverSpecific": true,
|
||||
"temp": true
|
||||
},
|
||||
"memory",
|
||||
"physicalmemory",
|
||||
"swap",
|
||||
@@ -41,8 +58,16 @@
|
||||
"poweradapter",
|
||||
"player",
|
||||
"media",
|
||||
"publicip",
|
||||
"localip",
|
||||
{
|
||||
"type": "publicip",
|
||||
"timeout": 1000
|
||||
},
|
||||
{
|
||||
"type": "localip",
|
||||
"showIpv6": true,
|
||||
"showMac": true
|
||||
},
|
||||
"dns",
|
||||
"wifi",
|
||||
"datetime",
|
||||
"locale",
|
||||
@@ -51,13 +76,20 @@
|
||||
"opencl",
|
||||
"users",
|
||||
"bluetooth",
|
||||
"bluetoothradio",
|
||||
"sound",
|
||||
"camera",
|
||||
"gamepad",
|
||||
"weather",
|
||||
{
|
||||
"type": "weather",
|
||||
"timeout": 1000
|
||||
},
|
||||
"netio",
|
||||
"diskio",
|
||||
"physicaldisk",
|
||||
{
|
||||
"type": "physicaldisk",
|
||||
"temp": true
|
||||
},
|
||||
"version",
|
||||
"break",
|
||||
"colors"
|
||||
|
||||
+11
-13
@@ -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} \u001b[37m█\u001b[97m█ \u001b[36m█\u001b[96m█ \u001b[35m█\u001b[95m█ \u001b[34m█\u001b[94m█ \u001b[33m█\u001b[93m█ \u001b[32m█\u001b[92m█ \u001b[31m█\u001b[91m█ \u001b[30m█\u001b[90m█"
|
||||
"format": "{pretty-name} {version} {#37}█{#97}█ {#36}█{#96}█ {#35}█{#95}█ {#34}█{#94}█ {#33}█{#93}█ {#32}█{#92}█ {#31}█{#91}█ {#30}█{#90}█"
|
||||
},
|
||||
{
|
||||
"type": "packages",
|
||||
"format": "{1}"
|
||||
"format": "{all}"
|
||||
},
|
||||
{
|
||||
"type": "cpu",
|
||||
"key": "Temperature",
|
||||
"temp": true,
|
||||
"format": "{8}"
|
||||
"format": "{temperature}"
|
||||
},
|
||||
{
|
||||
"type": "cpu",
|
||||
"key": "CPU",
|
||||
"format": "{4} x {1}"
|
||||
"format": "{cores-logical} x {name}"
|
||||
},
|
||||
{
|
||||
"type": "gpu",
|
||||
"format": "{2}"
|
||||
"format": "{name}"
|
||||
},
|
||||
{
|
||||
"type": "memory",
|
||||
@@ -78,7 +75,8 @@
|
||||
},
|
||||
{
|
||||
"type": "publicip",
|
||||
"key": "WAN IP"
|
||||
"key": "WAN IP",
|
||||
"timeout": 1000
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -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"
|
||||
]
|
||||
}
|
||||
+29
-5
@@ -13,14 +13,17 @@
|
||||
"os",
|
||||
"host",
|
||||
"bios",
|
||||
"bootmgr",
|
||||
"board",
|
||||
"chassis",
|
||||
"kernel",
|
||||
"initsystem",
|
||||
"uptime",
|
||||
"loadavg",
|
||||
"processes",
|
||||
"packages",
|
||||
"shell",
|
||||
"editor",
|
||||
"display",
|
||||
"brightness",
|
||||
"monitor",
|
||||
@@ -37,9 +40,18 @@
|
||||
"terminalfont",
|
||||
"terminalsize",
|
||||
"terminaltheme",
|
||||
"cpu",
|
||||
{
|
||||
"type": "cpu",
|
||||
"showPeCoreCount": true,
|
||||
"temp": true
|
||||
},
|
||||
"cpucache",
|
||||
"cpuusage",
|
||||
"gpu",
|
||||
{
|
||||
"type": "gpu",
|
||||
"driverSpecific": true,
|
||||
"temp": true
|
||||
},
|
||||
"memory",
|
||||
"physicalmemory",
|
||||
"swap",
|
||||
@@ -48,8 +60,16 @@
|
||||
"poweradapter",
|
||||
"player",
|
||||
"media",
|
||||
"publicip",
|
||||
"localip",
|
||||
{
|
||||
"type": "publicip",
|
||||
"timeout": 1000
|
||||
},
|
||||
{
|
||||
"type": "localip",
|
||||
"showIpv6": true,
|
||||
"showMac": true
|
||||
},
|
||||
"dns",
|
||||
"wifi",
|
||||
"datetime",
|
||||
"locale",
|
||||
@@ -58,6 +78,7 @@
|
||||
"opencl",
|
||||
"users",
|
||||
"bluetooth",
|
||||
"bluetoothradio",
|
||||
"sound",
|
||||
"camera",
|
||||
"gamepad",
|
||||
@@ -67,7 +88,10 @@
|
||||
},
|
||||
"netio",
|
||||
"diskio",
|
||||
"physicaldisk",
|
||||
{
|
||||
"type": "physicaldisk",
|
||||
"temp": true
|
||||
},
|
||||
"version",
|
||||
"break",
|
||||
"colors"
|
||||
|
||||
@@ -9,12 +9,16 @@
|
||||
}
|
||||
},
|
||||
"display": {
|
||||
"separator": " -> "
|
||||
"separator": " -> ",
|
||||
"constants": [
|
||||
"──────────────────────────────"
|
||||
]
|
||||
},
|
||||
"modules": [
|
||||
{
|
||||
"type": "custom",
|
||||
"format": "\u001b[90m┌────────────────────────────────────────────────────────────┐"
|
||||
"format": "┌{$1}{$1}┐",
|
||||
"outputColor": "90"
|
||||
},
|
||||
{
|
||||
"type": "title",
|
||||
@@ -22,19 +26,21 @@
|
||||
},
|
||||
{
|
||||
"type": "custom",
|
||||
"format": "\u001b[90m└────────────────────────────────────────────────────────────┘"
|
||||
"format": "└{$1}{$1}┘",
|
||||
"outputColor": "90"
|
||||
},
|
||||
{
|
||||
"type": "custom",
|
||||
"format": " \u001b[90m \u001b[31m \u001b[32m \u001b[33m \u001b[34m \u001b[35m \u001b[36m \u001b[37m \u001b[38m \u001b[39m \u001b[38m \u001b[37m \u001b[36m \u001b[35m \u001b[34m \u001b[33m \u001b[32m \u001b[31m \u001b[90m"
|
||||
"format": " {#90} {#31} {#32} {#33} {#34} {#35} {#36} {#37} {#38} {#39} {#38} {#37} {#36} {#35} {#34} {#33} {#32} {#31} {#90}"
|
||||
},
|
||||
{
|
||||
"type": "custom",
|
||||
"format": "\u001b[90m┌────────────────────────────────────────────────────────────┐"
|
||||
"format": "┌{$1}{$1}┐",
|
||||
"outputColor": "90"
|
||||
},
|
||||
{
|
||||
"type": "os",
|
||||
"key": " OS",
|
||||
"key": "{icon} OS",
|
||||
"keyColor": "yellow"
|
||||
},
|
||||
{
|
||||
@@ -139,12 +145,13 @@
|
||||
},
|
||||
{
|
||||
"type": "custom",
|
||||
"format": "\u001b[90m└────────────────────────────────────────────────────────────┘"
|
||||
"format": "└{$1}{$1}┘",
|
||||
"outputColor": "90"
|
||||
},
|
||||
"break",
|
||||
{
|
||||
"type": "custom",
|
||||
"format": " \u001b[90m \u001b[31m \u001b[32m \u001b[33m \u001b[34m \u001b[35m \u001b[36m \u001b[37m \u001b[38m \u001b[39m \u001b[38m \u001b[37m \u001b[36m \u001b[35m \u001b[34m \u001b[33m \u001b[32m \u001b[31m \u001b[90m"
|
||||
"format": " {#90} {#31} {#32} {#33} {#34} {#35} {#36} {#37} {#38} {#39} {#38} {#37} {#36} {#35} {#34} {#33} {#32} {#31} {#90}"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -4,7 +4,10 @@
|
||||
"type": "small"
|
||||
},
|
||||
"display": {
|
||||
"separator": "\u001b[31m-> "
|
||||
"separator": "-> ",
|
||||
"color": {
|
||||
"separator": "red"
|
||||
}
|
||||
},
|
||||
"modules": [
|
||||
{
|
||||
|
||||
+30
-19
@@ -4,95 +4,106 @@
|
||||
"type": "none"
|
||||
},
|
||||
"display": {
|
||||
"separator": "-> "
|
||||
"separator": "-> ",
|
||||
"color": {
|
||||
"separator": "1" // Bold
|
||||
},
|
||||
"constants": [
|
||||
"───────────────────────────"
|
||||
],
|
||||
"key": {
|
||||
"type": "both",
|
||||
"paddingLeft": 4
|
||||
}
|
||||
},
|
||||
"modules": [
|
||||
{
|
||||
"type": "title",
|
||||
"format": " {6}{7}{8}"
|
||||
"format": " {user-name-colored}{at-symbol-colored}{host-name-colored}"
|
||||
},
|
||||
"break",
|
||||
{
|
||||
"type": "custom",
|
||||
"format": "┌───────────────────────────── \u001b[1mSystem Information\u001b[0m ─────────────────────────────┐" // `\u001b` is `\033`, or `\e`
|
||||
"format": "┌{$1} {#1}System Information{#} {$1}┐"
|
||||
},
|
||||
"break",
|
||||
{
|
||||
"key": " OS ",
|
||||
"key": "OS ",
|
||||
"keyColor": "red",
|
||||
"type": "os"
|
||||
},
|
||||
{
|
||||
"key": " Machine ",
|
||||
"key": "Machine ",
|
||||
"keyColor": "green",
|
||||
"type": "host"
|
||||
},
|
||||
{
|
||||
"key": " Kernel ",
|
||||
"key": "Kernel ",
|
||||
"keyColor": "magenta",
|
||||
"type": "kernel"
|
||||
},
|
||||
{
|
||||
"key": " Uptime ",
|
||||
"key": "Uptime ",
|
||||
"keyColor": "red",
|
||||
"type": "uptime"
|
||||
},
|
||||
{
|
||||
"key": " Resolution ",
|
||||
"key": "Resolution ",
|
||||
"keyColor": "yellow",
|
||||
"type": "display",
|
||||
"compactType": "original-with-refresh-rate"
|
||||
},
|
||||
{
|
||||
"key": " WM ",
|
||||
"key": "WM ",
|
||||
"keyColor": "blue",
|
||||
"type": "wm"
|
||||
},
|
||||
{
|
||||
"key": " DE ",
|
||||
"key": "DE ",
|
||||
"keyColor": "green",
|
||||
"type": "de"
|
||||
},
|
||||
{
|
||||
"key": " Shell ",
|
||||
"key": "Shell ",
|
||||
"keyColor": "cyan",
|
||||
"type": "shell"
|
||||
},
|
||||
{
|
||||
"key": " Terminal ",
|
||||
"key": "Terminal ",
|
||||
"keyColor": "red",
|
||||
"type": "terminal"
|
||||
},
|
||||
{
|
||||
"key": " CPU ",
|
||||
"key": "CPU ",
|
||||
"keyColor": "yellow",
|
||||
"type": "cpu"
|
||||
},
|
||||
{
|
||||
"key": " GPU ",
|
||||
"key": "GPU ",
|
||||
"keyColor": "blue",
|
||||
"type": "gpu"
|
||||
},
|
||||
{
|
||||
"key": " Memory ",
|
||||
"key": "Memory ",
|
||||
"keyColor": "magenta",
|
||||
"type": "memory"
|
||||
},
|
||||
{
|
||||
"key": " Local IP ",
|
||||
"key": "Local IP ",
|
||||
"keyColor": "red",
|
||||
"type": "localip",
|
||||
"compact": true
|
||||
},
|
||||
{
|
||||
"key": " Public IP ",
|
||||
"key": "Public IP ",
|
||||
"keyColor": "cyan",
|
||||
"type": "publicip"
|
||||
"type": "publicip",
|
||||
"timeout": 1000
|
||||
},
|
||||
"break",
|
||||
{
|
||||
"type": "custom",
|
||||
"format": "└──────────────────────────────────────────────────────────────────────────────┘" // `\u001b` is `\033`, or `\e`
|
||||
"format": "└{$1}────────────────────{$1}┘"
|
||||
},
|
||||
"break",
|
||||
{
|
||||
|
||||
+20
-20
@@ -1,3 +1,4 @@
|
||||
// Inspired by Catnap
|
||||
{
|
||||
"$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json",
|
||||
"logo": {
|
||||
@@ -7,8 +8,7 @@
|
||||
}
|
||||
},
|
||||
"display": {
|
||||
"separator": "",
|
||||
"keyWidth": 15
|
||||
"separator": " "
|
||||
},
|
||||
"modules": [
|
||||
{
|
||||
@@ -16,64 +16,64 @@
|
||||
"type": "custom"
|
||||
},
|
||||
{
|
||||
// draw borders first to make colors of left and right border consistant
|
||||
"key": "│ │\u001b[11D\u001b[31m user",
|
||||
"key": "│ {#31} user {#keys}│",
|
||||
"type": "title",
|
||||
"format": "{1}"
|
||||
"format": "{user-name}"
|
||||
},
|
||||
{
|
||||
"key": "│ │\u001b[11D\u001b[32m hname",
|
||||
"key": "│ {#32} hname {#keys}│",
|
||||
"type": "title",
|
||||
"format": "{2}"
|
||||
"format": "{host-name}"
|
||||
},
|
||||
{
|
||||
"key": "│ │\u001b[11D\u001b[33m uptime",
|
||||
"key": "│ {#33} uptime {#keys}│",
|
||||
"type": "uptime"
|
||||
},
|
||||
{
|
||||
"key": "│ │\u001b[11D\u001b[34m distro",
|
||||
"key": "│ {#34}{icon} distro {#keys}│",
|
||||
"type": "os"
|
||||
},
|
||||
{
|
||||
"key": "│ │\u001b[11D\u001b[35m kernel",
|
||||
"key": "│ {#35} kernel {#keys}│",
|
||||
"type": "kernel"
|
||||
},
|
||||
{
|
||||
"key": "│ │\u001b[11D\u001b[36m desktop",
|
||||
"key": "│ {#36} desktop {#keys}│",
|
||||
"type": "de"
|
||||
},
|
||||
{
|
||||
"key": "│ │\u001b[11D\u001b[31m term",
|
||||
"key": "│ {#31} term {#keys}│",
|
||||
"type": "terminal"
|
||||
},
|
||||
{
|
||||
"key": "│ │\u001b[11D\u001b[32m shell",
|
||||
"key": "│ {#32} shell {#keys}│",
|
||||
"type": "shell"
|
||||
},
|
||||
{
|
||||
"key": "│ │\u001b[11D\u001b[33m cpu",
|
||||
"type": "cpu"
|
||||
"key": "│ {#33} cpu {#keys}│",
|
||||
"type": "cpu",
|
||||
"showPeCoreCount": true
|
||||
},
|
||||
{
|
||||
"key": "│ │\u001b[11D\u001b[34m disk",
|
||||
"key": "│ {#34} disk {#keys}│",
|
||||
"type": "disk",
|
||||
"folders": "/"
|
||||
},
|
||||
{
|
||||
"key": "│ │\u001b[11D\u001b[35m memory",
|
||||
"key": "│ {#35} memory {#keys}│",
|
||||
"type": "memory"
|
||||
},
|
||||
{
|
||||
"key": "│ │\u001b[11D\u001b[36m network",
|
||||
"key": "│ {#36} network {#keys}│",
|
||||
"type": "localip",
|
||||
"format": "{1} ({4})"
|
||||
"format": "{ipv4} ({ifname})"
|
||||
},
|
||||
{
|
||||
"key": "├───────────┤",
|
||||
"type": "custom"
|
||||
},
|
||||
{
|
||||
"key": "│ │\u001b[11D\u001b[m colors",
|
||||
"key": "│ {#39} colors {#keys}│",
|
||||
"type": "colors",
|
||||
"symbol": "circle"
|
||||
},
|
||||
|
||||
@@ -0,0 +1,88 @@
|
||||
// Inspired by Catnap
|
||||
{
|
||||
"$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json",
|
||||
"logo": {
|
||||
"type": "small"
|
||||
},
|
||||
"display": {
|
||||
"separator": "",
|
||||
"key": {
|
||||
"width": 15
|
||||
}
|
||||
},
|
||||
"modules": [
|
||||
{
|
||||
// draw borders first to make colors of left and right border consistant
|
||||
"key": " user",
|
||||
"type": "title",
|
||||
"format": "{user-name}",
|
||||
"keyColor": "31"
|
||||
},
|
||||
{
|
||||
"key": " hname",
|
||||
"type": "title",
|
||||
"format": "{host-name}",
|
||||
"keyColor": "32"
|
||||
|
||||
},
|
||||
{
|
||||
"key": " uptime",
|
||||
"type": "uptime",
|
||||
"keyColor": "33"
|
||||
},
|
||||
{
|
||||
"key": "{icon} distro",
|
||||
"type": "os",
|
||||
"keyColor": "34"
|
||||
},
|
||||
{
|
||||
"key": " kernel",
|
||||
"type": "kernel",
|
||||
"keyColor": "35"
|
||||
},
|
||||
{
|
||||
"key": " desktop",
|
||||
"type": "de",
|
||||
"keyColor": "36"
|
||||
},
|
||||
{
|
||||
"key": " term",
|
||||
"type": "terminal",
|
||||
"keyColor": "31"
|
||||
},
|
||||
{
|
||||
"key": " shell",
|
||||
"type": "shell",
|
||||
"keyColor": "32"
|
||||
},
|
||||
{
|
||||
"key": " cpu",
|
||||
"type": "cpu",
|
||||
"showPeCoreCount": true,
|
||||
"keyColor": "33"
|
||||
},
|
||||
{
|
||||
"key": " disk",
|
||||
"type": "disk",
|
||||
"folders": "/",
|
||||
"keyColor": "34"
|
||||
},
|
||||
{
|
||||
"key": " memory",
|
||||
"type": "memory",
|
||||
"keyColor": "35"
|
||||
},
|
||||
{
|
||||
"key": " network",
|
||||
"type": "localip",
|
||||
"format": "{ipv4} ({ifname})",
|
||||
"keyColor": "36"
|
||||
},
|
||||
{
|
||||
"key": " colors",
|
||||
"type": "colors",
|
||||
"symbol": "circle",
|
||||
"keyColor": "39"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
// Inspired by Catnap
|
||||
{
|
||||
"$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json",
|
||||
"logo": {
|
||||
"type": "small",
|
||||
"padding": {
|
||||
"top": 1
|
||||
}
|
||||
},
|
||||
"display": {
|
||||
"separator": " "
|
||||
},
|
||||
"modules": [
|
||||
{
|
||||
"key": "•••••••••••••",
|
||||
"type": "custom"
|
||||
},
|
||||
{
|
||||
"key": "• {#31} user {#keys}•",
|
||||
"type": "title",
|
||||
"format": "{user-name}"
|
||||
},
|
||||
{
|
||||
"key": "• {#32} hname {#keys}•",
|
||||
"type": "title",
|
||||
"format": "{host-name}"
|
||||
},
|
||||
{
|
||||
"key": "• {#33} uptime {#keys}•",
|
||||
"type": "uptime"
|
||||
},
|
||||
{
|
||||
"key": "• {#34}{icon} distro {#keys}•",
|
||||
"type": "os"
|
||||
},
|
||||
{
|
||||
"key": "• {#35} kernel {#keys}•",
|
||||
"type": "kernel"
|
||||
},
|
||||
{
|
||||
"key": "• {#36} desktop {#keys}•",
|
||||
"type": "de"
|
||||
},
|
||||
{
|
||||
"key": "• {#31} term {#keys}•",
|
||||
"type": "terminal"
|
||||
},
|
||||
{
|
||||
"key": "• {#32} shell {#keys}•",
|
||||
"type": "shell"
|
||||
},
|
||||
{
|
||||
"key": "• {#33} cpu {#keys}•",
|
||||
"type": "cpu",
|
||||
"showPeCoreCount": true
|
||||
},
|
||||
{
|
||||
"key": "• {#34} disk {#keys}•",
|
||||
"type": "disk",
|
||||
"folders": "/"
|
||||
},
|
||||
{
|
||||
"key": "• {#35} memory {#keys}•",
|
||||
"type": "memory"
|
||||
},
|
||||
{
|
||||
"key": "• {#36} network {#keys}•",
|
||||
"type": "localip",
|
||||
"format": "{ipv4} ({ifname})"
|
||||
},
|
||||
{
|
||||
"key": "•••••••••••••",
|
||||
"type": "custom"
|
||||
},
|
||||
{
|
||||
"key": "• {#39} colors {#keys}•",
|
||||
"type": "colors",
|
||||
"symbol": "circle"
|
||||
},
|
||||
{
|
||||
"key": "•••••••••••••",
|
||||
"type": "custom"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
// Inspired by Catnap
|
||||
{
|
||||
"$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json",
|
||||
"logo": {
|
||||
"type": "small",
|
||||
"padding": {
|
||||
"top": 1
|
||||
}
|
||||
},
|
||||
"display": {
|
||||
"separator": " "
|
||||
},
|
||||
"modules": [
|
||||
{
|
||||
"key": "╔═══════════╗",
|
||||
"type": "custom"
|
||||
},
|
||||
{
|
||||
"key": "║ {#31} user {#keys}║",
|
||||
"type": "title",
|
||||
"format": "{user-name}"
|
||||
},
|
||||
{
|
||||
"key": "║ {#32} hname {#keys}║",
|
||||
"type": "title",
|
||||
"format": "{host-name}"
|
||||
},
|
||||
{
|
||||
"key": "║ {#33} uptime {#keys}║",
|
||||
"type": "uptime"
|
||||
},
|
||||
{
|
||||
"key": "║ {#34}{icon} distro {#keys}║",
|
||||
"type": "os"
|
||||
},
|
||||
{
|
||||
"key": "║ {#35} kernel {#keys}║",
|
||||
"type": "kernel"
|
||||
},
|
||||
{
|
||||
"key": "║ {#36} desktop {#keys}║",
|
||||
"type": "de"
|
||||
},
|
||||
{
|
||||
"key": "║ {#31} term {#keys}║",
|
||||
"type": "terminal"
|
||||
},
|
||||
{
|
||||
"key": "║ {#32} shell {#keys}║",
|
||||
"type": "shell"
|
||||
},
|
||||
{
|
||||
"key": "║ {#33} cpu {#keys}║",
|
||||
"type": "cpu",
|
||||
"showPeCoreCount": true
|
||||
},
|
||||
{
|
||||
"key": "║ {#34} disk {#keys}║",
|
||||
"type": "disk",
|
||||
"folders": "/"
|
||||
},
|
||||
{
|
||||
"key": "║ {#35} memory {#keys}║",
|
||||
"type": "memory"
|
||||
},
|
||||
{
|
||||
"key": "║ {#36} network {#keys}║",
|
||||
"type": "localip",
|
||||
"format": "{ipv4} ({ifname})"
|
||||
},
|
||||
{
|
||||
"key": "╠═══════════╣",
|
||||
"type": "custom"
|
||||
},
|
||||
{
|
||||
"key": "║ {#39} colors {#keys}║",
|
||||
"type": "colors",
|
||||
"symbol": "circle"
|
||||
},
|
||||
{
|
||||
"key": "╚═══════════╝",
|
||||
"type": "custom"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
{
|
||||
"$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json",
|
||||
"logo": {
|
||||
"type": "small",
|
||||
"padding": {
|
||||
"top": 1,
|
||||
"right": 2
|
||||
}
|
||||
},
|
||||
"display": {
|
||||
"separator": "> ",
|
||||
"color": {
|
||||
"separator": "red"
|
||||
},
|
||||
"constants": [
|
||||
"───────────────────────────────────────────────────────────────────────────",
|
||||
"│\u001b[75C│\u001b[75D"
|
||||
]
|
||||
},
|
||||
"modules": [
|
||||
{
|
||||
"format": "{#1}{#keys}╭{$1}╮\u001b[76D {user-name-colored}{at-symbol-colored}{host-name-colored} 🖥 ",
|
||||
"type": "title"
|
||||
},
|
||||
{
|
||||
"key": "{$2}{#31} kernel ",
|
||||
"type": "kernel"
|
||||
},
|
||||
{
|
||||
"key": "{$2}{#32} uptime ",
|
||||
"type": "uptime"
|
||||
},
|
||||
{
|
||||
"key": "{$2}{#33}{icon} distro ",
|
||||
"type": "os"
|
||||
},
|
||||
{
|
||||
"key": "{$2}{#34} desktop ",
|
||||
"type": "de"
|
||||
},
|
||||
{
|
||||
"key": "{$2}{#35} term ",
|
||||
"type": "terminal"
|
||||
},
|
||||
{
|
||||
"key": "{$2}{#36} shell ",
|
||||
"type": "shell"
|
||||
},
|
||||
{
|
||||
"key": "{$2}{#35} cpu ",
|
||||
"type": "cpu",
|
||||
"showPeCoreCount": true,
|
||||
"temp": true
|
||||
},
|
||||
{
|
||||
"key": "{$2}{#34} gpu ",
|
||||
"type": "gpu"
|
||||
},
|
||||
{
|
||||
"key": "{$2}{#33} disk ",
|
||||
"type": "disk",
|
||||
"folders": "/"
|
||||
},
|
||||
{
|
||||
"key": "{$2}{#32} memory ",
|
||||
"type": "memory"
|
||||
},
|
||||
{
|
||||
"key": "{$2}{#31} network ",
|
||||
"type": "localip",
|
||||
"format": "{ipv4} ({ifname})"
|
||||
},
|
||||
{
|
||||
"format": "{#1}{#keys}├{$1}┤",
|
||||
"type": "custom"
|
||||
},
|
||||
{
|
||||
"key": "{$2}{#39} colors ",
|
||||
"type": "colors",
|
||||
"symbol": "circle"
|
||||
},
|
||||
{
|
||||
"format": "{#1}{#keys}╰{$1}╯",
|
||||
"type": "custom"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
{
|
||||
"$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json",
|
||||
"logo": {
|
||||
"type": "small",
|
||||
"padding": {
|
||||
"top": 1,
|
||||
"right": 2
|
||||
}
|
||||
},
|
||||
"display": {
|
||||
"separator": "> ",
|
||||
"color": {
|
||||
"separator": "red"
|
||||
},
|
||||
"constants": [
|
||||
"═══════════════════════════════════════════════════════════════════════════",
|
||||
"║\u001b[75C║\u001b[75D"
|
||||
]
|
||||
},
|
||||
"modules": [
|
||||
{
|
||||
"format": "{#1}{#keys}╔{$1}╗\u001b[76D {user-name-colored}{at-symbol-colored}{host-name-colored} 💻 ",
|
||||
"type": "title"
|
||||
},
|
||||
{
|
||||
"key": "{$2}{#31} kernel ",
|
||||
"type": "kernel"
|
||||
},
|
||||
{
|
||||
"key": "{$2}{#32} uptime ",
|
||||
"type": "uptime"
|
||||
},
|
||||
{
|
||||
"key": "{$2}{#33}{icon} distro ",
|
||||
"type": "os"
|
||||
},
|
||||
{
|
||||
"key": "{$2}{#34} desktop ",
|
||||
"type": "de"
|
||||
},
|
||||
{
|
||||
"key": "{$2}{#35} term ",
|
||||
"type": "terminal"
|
||||
},
|
||||
{
|
||||
"key": "{$2}{#36} shell ",
|
||||
"type": "shell"
|
||||
},
|
||||
{
|
||||
"key": "{$2}{#35} cpu ",
|
||||
"type": "cpu",
|
||||
"showPeCoreCount": true,
|
||||
"temp": true
|
||||
},
|
||||
{
|
||||
"key": "{$2}{#34} gpu ",
|
||||
"type": "gpu"
|
||||
},
|
||||
{
|
||||
"key": "{$2}{#33} disk ",
|
||||
"type": "disk",
|
||||
"folders": "/"
|
||||
},
|
||||
{
|
||||
"key": "{$2}{#32} memory ",
|
||||
"type": "memory"
|
||||
},
|
||||
{
|
||||
"key": "{$2}{#31} network ",
|
||||
"type": "localip",
|
||||
"format": "{ipv4} ({ifname})"
|
||||
},
|
||||
{
|
||||
"format": "{#1}{#keys}╠{$1}╣",
|
||||
"type": "custom"
|
||||
},
|
||||
{
|
||||
"key": "{$2}{#39} colors ",
|
||||
"type": "colors",
|
||||
"symbol": "circle"
|
||||
},
|
||||
{
|
||||
"format": "{#1}{#keys}╚{$1}╝",
|
||||
"type": "custom"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,188 @@
|
||||
// _____ _____ _____ _____ _____ _____ _____ _____ _____
|
||||
// | __| _ | __|_ _| __| __|_ _| | | |
|
||||
// | __| |__ | | | | __| __| | | | --| |
|
||||
// |__| |__|__|_____| |_| |__| |_____| |_| |_____|__|__|
|
||||
//
|
||||
// By CarterLi - https://github.com/CarterLi
|
||||
// Homepage - https://github.com/fastfetch-cli/fastfetch
|
||||
// config.jsonc - ニリ @niri-san
|
||||
// pokemon-colorscripts - https://gitlab.com/phoneybadger/pokemon-colorscripts
|
||||
{
|
||||
"$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json",
|
||||
"logo": {
|
||||
"source": " _____ _____ _____ _____ _____ _____ _____ _____ _____\n| __| _ | __|_ _| __| __|_ _| | | |\n| __| |__ | | | | __| __| | | | --| |\n|__| |__|__|_____| |_| |__| |_____| |_| |_____|__|__|",
|
||||
"type": "data",
|
||||
"position": "top",
|
||||
"padding": {
|
||||
"right": 2
|
||||
}
|
||||
},
|
||||
"display": {
|
||||
"separator": " - "
|
||||
},
|
||||
"modules": [
|
||||
{
|
||||
"type": "custom", // HardwareInfo
|
||||
"format": "• {#green}SYSTEM INFORMATION"
|
||||
},
|
||||
{
|
||||
"type": "host",
|
||||
"key": "HOST",
|
||||
"format": "{name}{?vendor} ({vendor}){?}",
|
||||
"keyColor": "green"
|
||||
},
|
||||
{
|
||||
"type": "chassis",
|
||||
"key": "COMPUTER TYPE",
|
||||
"keyColor": "green"
|
||||
},
|
||||
{
|
||||
"type": "cpu",
|
||||
"key": "CPU",
|
||||
"keyColor": "green"
|
||||
},
|
||||
{
|
||||
"type": "gpu",
|
||||
"key": "GPU",
|
||||
"keyColor": "green"
|
||||
},
|
||||
{
|
||||
"type": "memory",
|
||||
"key": "MEMORY USED",
|
||||
"keyColor": "green"
|
||||
},
|
||||
{
|
||||
"type": "swap",
|
||||
"key": "SWAP USED",
|
||||
"keyColor": "green"
|
||||
},
|
||||
{
|
||||
"type": "disk",
|
||||
"key": "DISK",
|
||||
"folders": "/",
|
||||
"keyColor": "green"
|
||||
},
|
||||
{
|
||||
"type": "custom", // SoftwareInfo
|
||||
"format": "• {#red}SOFTWARE INFORMATION"
|
||||
},
|
||||
{
|
||||
"type": "os",
|
||||
"key": "DISTRO",
|
||||
"keyColor": "red"
|
||||
},
|
||||
{
|
||||
"type": "disk",
|
||||
"folders": "/", // Use "/System/Volumes/VM" or something else on macOS
|
||||
"format": "{create-time}",
|
||||
"key": "INSTALLED DATE",
|
||||
"keyColor": "red"
|
||||
},
|
||||
{
|
||||
"type": "kernel",
|
||||
"key": "KERNEL",
|
||||
"keyColor": "red"
|
||||
},
|
||||
{
|
||||
"type": "packages",
|
||||
"key": "PACKAGES",
|
||||
"keyColor": "red"
|
||||
},
|
||||
{
|
||||
"type": "uptime",
|
||||
"key": "UPTIME",
|
||||
"keyColor": "red"
|
||||
},
|
||||
{
|
||||
"type": "custom", // DisplayInfo
|
||||
"format": "• {#blue}DISPLAY INFORMATION"
|
||||
},
|
||||
{
|
||||
"type": "de",
|
||||
"key": "DESKTOP ENVIRONMENT",
|
||||
"keyColor": "blue"
|
||||
},
|
||||
{
|
||||
"type": "lm",
|
||||
"key": "LOGIN MANAGER",
|
||||
"format": "{type}",
|
||||
"keyColor": "blue"
|
||||
},
|
||||
{
|
||||
"type": "wm",
|
||||
"key": "WM",
|
||||
"keyColor": "blue"
|
||||
},
|
||||
{
|
||||
"type": "wmtheme",
|
||||
"key": "WM THEME",
|
||||
"keyColor": "blue"
|
||||
},
|
||||
{
|
||||
"type": "monitor",
|
||||
"key": "MONITOR ({name})",
|
||||
"keyColor": "blue"
|
||||
},
|
||||
{
|
||||
"type": "custom", // DesignInfo
|
||||
"format": "• {#yellow}DESIGN INFORMATION"
|
||||
},
|
||||
{
|
||||
"type": "wallpaper",
|
||||
"key": "WALLPAPER",
|
||||
"keyColor": "yellow"
|
||||
},
|
||||
{
|
||||
"type": "theme",
|
||||
"key": "KDE THEME",
|
||||
"format": "{1}",
|
||||
"keyColor": "yellow"
|
||||
},
|
||||
{
|
||||
"type": "icons",
|
||||
"key": "ICON THEME",
|
||||
"format": "{1}",
|
||||
"keyColor": "yellow"
|
||||
},
|
||||
{
|
||||
"type": "font",
|
||||
"key": "FONT",
|
||||
"format": "{?1}{1} [Qt]{?}{/1}Unknown", // Remove "[Qt]" if not using Qt
|
||||
"keyColor": "yellow"
|
||||
},
|
||||
{
|
||||
"type": "terminalfont",
|
||||
"key": "TERMINAL FONT",
|
||||
"keyColor": "yellow"
|
||||
},
|
||||
{
|
||||
"type": "cursor",
|
||||
"key": "CURSOR",
|
||||
"keyColor": "yellow"
|
||||
},
|
||||
{
|
||||
"type": "custom", // OtherInfo
|
||||
"format": "• {#cyan}VARIOUS INFORMATION"
|
||||
},
|
||||
{
|
||||
"type": "media",
|
||||
"key": "NOW PLAYING",
|
||||
"format": "{?artist}{artist} - {?}{title}",
|
||||
"keyColor": "cyan"
|
||||
},
|
||||
{
|
||||
"type": "weather",
|
||||
"key": "WEATHER",
|
||||
"timeout": 1000,
|
||||
"keyColor": "cyan"
|
||||
},
|
||||
{
|
||||
"type": "version",
|
||||
"key": "INFO",
|
||||
"keyColor": "cyan"
|
||||
},
|
||||
"break",
|
||||
"colors",
|
||||
"break"
|
||||
]
|
||||
}
|
||||
+46
-124
@@ -5,157 +5,79 @@
|
||||
"$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json",
|
||||
// "logo": {
|
||||
// "type": "iterm",
|
||||
// "source": "/Users/carter/Desktop/apple1.png",
|
||||
// "source": "~/Desktop/apple1.png",
|
||||
// "width": 28,
|
||||
// "height": 12
|
||||
// },
|
||||
"display": {
|
||||
"separator": " "
|
||||
"separator": " ",
|
||||
"constants": [
|
||||
"─────────────────" // {$1}, used in Custom module
|
||||
],
|
||||
"key": {
|
||||
"type": "icon",
|
||||
"paddingLeft": 2
|
||||
}
|
||||
},
|
||||
"modules": [
|
||||
{
|
||||
"type": "custom", // HardwareStart
|
||||
"format": "┌─────────── \u001b[1mHardware Information\u001b[0m ───────────┐" // `\u001b` is `\033`, or `\e`
|
||||
},
|
||||
{
|
||||
"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": " "
|
||||
// {#1} is equivalent to `\u001b[1m`. {#} is equivalent to `\u001b[m`
|
||||
"format": "┌{$1} {#1}Hardware Information{#} {$1}┐"
|
||||
},
|
||||
"host",
|
||||
"cpu",
|
||||
"gpu",
|
||||
"disk",
|
||||
"memory",
|
||||
"swap",
|
||||
"display",
|
||||
"brightness",
|
||||
"battery",
|
||||
"poweradapter",
|
||||
"bluetooth",
|
||||
"sound",
|
||||
"gamepad",
|
||||
{
|
||||
"type": "custom", // SoftwareStart
|
||||
"format": "├─────────── \u001b[1mSoftware Information\u001b[0m ───────────┤"
|
||||
"format": "├{$1} {#1}Software Information{#} {$1}┤"
|
||||
},
|
||||
{
|
||||
"type": "title",
|
||||
"key": " ",
|
||||
"format": "{1}@{2}"
|
||||
},
|
||||
{
|
||||
"type": "os",
|
||||
"key": " " // Just get your distro's logo off nerdfonts.com
|
||||
},
|
||||
{
|
||||
"type": "kernel",
|
||||
"key": " ",
|
||||
"format": "{1} {2}"
|
||||
},
|
||||
{
|
||||
"type": "lm",
|
||||
"key": " "
|
||||
},
|
||||
{
|
||||
"type": "de",
|
||||
"key": " "
|
||||
},
|
||||
{
|
||||
"type": "wm",
|
||||
"key": " "
|
||||
},
|
||||
{
|
||||
"type": "shell",
|
||||
"key": " "
|
||||
},
|
||||
{
|
||||
"type": "terminal",
|
||||
"key": " "
|
||||
},
|
||||
{
|
||||
"type": "terminalfont",
|
||||
"key": " "
|
||||
},
|
||||
{
|
||||
"type": "theme",
|
||||
"key": " "
|
||||
},
|
||||
{
|
||||
"type": "icons",
|
||||
"key": " "
|
||||
},
|
||||
{
|
||||
"type": "wallpaper",
|
||||
"key": " "
|
||||
},
|
||||
{
|
||||
"type": "packages",
|
||||
"key": " "
|
||||
},
|
||||
{
|
||||
"type": "uptime",
|
||||
"key": " "
|
||||
},
|
||||
{
|
||||
"type": "media",
|
||||
"key": " "
|
||||
"keyIcon": "",
|
||||
"key": "Title", // Title module has no key by default, so that icon is not displayed
|
||||
"format": "{user-name}@{host-name}"
|
||||
},
|
||||
"os",
|
||||
"kernel",
|
||||
"lm",
|
||||
"de",
|
||||
"wm",
|
||||
"shell",
|
||||
"terminal",
|
||||
"terminalfont",
|
||||
"theme",
|
||||
"icons",
|
||||
"wallpaper",
|
||||
"packages",
|
||||
"uptime",
|
||||
"media",
|
||||
{
|
||||
"type": "localip",
|
||||
"key": " ",
|
||||
"compact": true
|
||||
},
|
||||
{
|
||||
"type": "publicip",
|
||||
"key": " "
|
||||
"timeout": 1000
|
||||
},
|
||||
{
|
||||
"type": "wifi",
|
||||
"key": " ",
|
||||
"format": "{4}" // ssid
|
||||
},
|
||||
{
|
||||
"type": "locale",
|
||||
"key": " "
|
||||
"format": "{ssid}"
|
||||
},
|
||||
"locale",
|
||||
{
|
||||
"type": "custom", // InformationEnd
|
||||
"format": "└────────────────────────────────────────────┘"
|
||||
"format": "└{$1}──────────────────────{$1}┘"
|
||||
},
|
||||
{
|
||||
"type": "colors",
|
||||
|
||||
@@ -0,0 +1,165 @@
|
||||
// Inspired by https://github.com/usgraphics/TR-100
|
||||
{
|
||||
"$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json",
|
||||
"logo": null,
|
||||
"display": {
|
||||
"pipe": true,
|
||||
"key": {
|
||||
"width": 16
|
||||
},
|
||||
"separator": "│ ",
|
||||
"percent": {
|
||||
"type": 6
|
||||
},
|
||||
"bar": {
|
||||
"borderLeft": "",
|
||||
"borderRight": "",
|
||||
"charElapsed": "█",
|
||||
"charTotal": "░",
|
||||
"width": 40
|
||||
},
|
||||
"constants": [
|
||||
"\u001b[42C"
|
||||
]
|
||||
},
|
||||
"modules": [
|
||||
{
|
||||
"type": "custom",
|
||||
"format": "┌┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┐"
|
||||
},
|
||||
{
|
||||
"type": "custom",
|
||||
"format": "├┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┤"
|
||||
},
|
||||
{
|
||||
"type": "version",
|
||||
"key": " ",
|
||||
"format": "│ FASTFETCH v{version} │"
|
||||
},
|
||||
{
|
||||
"type": "custom",
|
||||
"format": "│ TR-100 MACHINE REPORT │"
|
||||
},
|
||||
{
|
||||
"type": "custom",
|
||||
"format": "├────────────┬──────────────────────────────────────────┤"
|
||||
},
|
||||
{
|
||||
"type": "os",
|
||||
"key": "│ OS │{$1}"
|
||||
},
|
||||
{
|
||||
"type": "kernel",
|
||||
"key": "│ KERNEL │{$1}"
|
||||
},
|
||||
{
|
||||
"type": "custom",
|
||||
"format": "├────────────┼──────────────────────────────────────────┤"
|
||||
},
|
||||
{
|
||||
"type": "title",
|
||||
"key": "│ HOSTNAME │{$1}",
|
||||
"format": "{host-name}"
|
||||
},
|
||||
{
|
||||
"type": "localip",
|
||||
"key": "│ CLIENT IP │{$1}",
|
||||
"format": "{ipv4}"
|
||||
},
|
||||
{
|
||||
"type": "localip",
|
||||
"key": "│ MAC ADDR │{$1}",
|
||||
"format": "{mac} ({ifname})",
|
||||
"showIPv4": false,
|
||||
"showMac": true
|
||||
},
|
||||
{
|
||||
"type": "dns",
|
||||
"key": "│ DNS │{$1}",
|
||||
"showType": "ipv4"
|
||||
},
|
||||
{
|
||||
"type": "title",
|
||||
"key": "│ USER │{$1}",
|
||||
"format": "{user-name}"
|
||||
},
|
||||
{
|
||||
"type": "host",
|
||||
"key": "│ MACHINE │{$1}",
|
||||
"format": "{name}"
|
||||
},
|
||||
{
|
||||
"type": "custom",
|
||||
"format": "├────────────┼──────────────────────────────────────────┤"
|
||||
},
|
||||
{
|
||||
"type": "cpu",
|
||||
"key": "│ PROCESSOR │{$1}",
|
||||
"format": "{name}"
|
||||
},
|
||||
{
|
||||
"type": "cpu",
|
||||
"key": "│ CORES │{$1}",
|
||||
"format": "{cores-physical} PHYSICAL CORES / {cores-logical} THREADS",
|
||||
"showPeCoreCount": false
|
||||
},
|
||||
{
|
||||
"type": "cpu",
|
||||
"key": "│ CPU FREQ │{$1}",
|
||||
"format": "{freq-max}{/freq-max}{freq-base}{/}"
|
||||
},
|
||||
{
|
||||
"type": "loadavg",
|
||||
"compact": false,
|
||||
// {duration} is not fixed length, hack it
|
||||
"key": "│ LOAD \u001b[s{duration}m\u001b[u\u001b[6C│{$1}"
|
||||
},
|
||||
{
|
||||
"type": "custom",
|
||||
"format": "├────────────┼──────────────────────────────────────────┤"
|
||||
},
|
||||
{
|
||||
"type": "memory",
|
||||
"key": "│ MEMORY │{$1}",
|
||||
"format": "{used} / {total} [{percentage}]"
|
||||
},
|
||||
{
|
||||
"type": "memory",
|
||||
"key": "│ USAGE │{$1}",
|
||||
"format": ""
|
||||
},
|
||||
{
|
||||
"type": "custom",
|
||||
"format": "├────────────┼──────────────────────────────────────────┤"
|
||||
},
|
||||
{
|
||||
"type": "disk",
|
||||
"key": "│ VOLUME │{$1}",
|
||||
"format": "{size-used} / {size-total} [{size-percentage}]",
|
||||
"folders": "/"
|
||||
},
|
||||
{
|
||||
"type": "disk",
|
||||
"key": "│ DISK USAGE │{$1}",
|
||||
"format": ""
|
||||
},
|
||||
{
|
||||
"type": "custom",
|
||||
"format": "├────────────┼──────────────────────────────────────────┤"
|
||||
},
|
||||
{
|
||||
"type": "users",
|
||||
"key": "│ LAST LOGIN │{$1}",
|
||||
"format": "{login-time}{?client-ip} ({client-ip})",
|
||||
"myselfOnly": true
|
||||
},
|
||||
{
|
||||
"type": "uptime",
|
||||
"key": "│ UPTIME │{$1}"
|
||||
},
|
||||
{
|
||||
"type": "custom",
|
||||
"format": "└────────────┴──────────────────────────────────────────┘"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
{
|
||||
"$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json",
|
||||
"logo": {
|
||||
"type": "small"
|
||||
},
|
||||
"display": {
|
||||
"constants": [
|
||||
"██ "
|
||||
]
|
||||
},
|
||||
"modules": [
|
||||
{
|
||||
"key": "{$1}Distro",
|
||||
"keyColor": "38;5;210",
|
||||
"type": "os"
|
||||
},
|
||||
{
|
||||
"key": "{$1}Kernel",
|
||||
"keyColor": "38;5;84",
|
||||
"type": "kernel"
|
||||
},
|
||||
{
|
||||
"key": "{$1}Shell",
|
||||
"keyColor": "38;5;147",
|
||||
"type": "shell"
|
||||
},
|
||||
{
|
||||
"key": "{$1}Packages",
|
||||
"keyColor": "38;5;200",
|
||||
"type": "packages"
|
||||
},
|
||||
{
|
||||
"key": "{$1}WM",
|
||||
"keyColor": "38;5;44",
|
||||
"type": "wm"
|
||||
},
|
||||
{
|
||||
"key": "{$1}CPU",
|
||||
"keyColor": "38;5;75",
|
||||
"type": "cpu"
|
||||
},
|
||||
{
|
||||
"key": "{$1}Memory",
|
||||
"keyColor": "38;5;123",
|
||||
"type": "memory"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,113 @@
|
||||
// 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",
|
||||
"logo": {
|
||||
"source": "arch3",
|
||||
"color": {
|
||||
"1": "red",
|
||||
"2": "yellow"
|
||||
}
|
||||
},
|
||||
"display": {
|
||||
"color": {
|
||||
"separator": "blue"
|
||||
},
|
||||
"separator": " | ",
|
||||
"constants": [
|
||||
">-----------<+>---------------------------------------------<"
|
||||
]
|
||||
},
|
||||
"modules": [
|
||||
{
|
||||
"type": "kernel",
|
||||
"key": " /\\rch Linux",
|
||||
"keyColor": "magenta"
|
||||
},
|
||||
{
|
||||
"type": "custom",
|
||||
"format": "{$1}",
|
||||
"outputColor": "separator"
|
||||
},
|
||||
{
|
||||
"type": "uptime",
|
||||
"key": " Uptime ",
|
||||
"keyColor": "green"
|
||||
},
|
||||
{
|
||||
"type": "shell",
|
||||
"key": " Shell ",
|
||||
"keyColor": "green"
|
||||
},
|
||||
{
|
||||
"type": "terminal",
|
||||
"key": " Terminal ",
|
||||
"keyColor": "green"
|
||||
},
|
||||
{
|
||||
"type": "terminalfont",
|
||||
"key": " Font ",
|
||||
"keyColor": "green"
|
||||
},
|
||||
{
|
||||
"type": "packages",
|
||||
"key": " Packages ",
|
||||
"keyColor": "green"
|
||||
},
|
||||
{
|
||||
"type": "localip",
|
||||
"key": " Local IP ",
|
||||
"keyColor": "green"
|
||||
},
|
||||
{
|
||||
"type": "custom",
|
||||
"format": "{$1}",
|
||||
"outputColor": "separator"
|
||||
},
|
||||
{
|
||||
"type": "display",
|
||||
"key": " Display ",
|
||||
"keyColor": "cyan"
|
||||
},
|
||||
{
|
||||
"type": "cpu",
|
||||
"key": " CPU ",
|
||||
"keyColor": "cyan"
|
||||
},
|
||||
{
|
||||
"type": "gpu",
|
||||
"key": " GPU ",
|
||||
"keyColor": "cyan"
|
||||
},
|
||||
{
|
||||
"type": "memory",
|
||||
"key": " RAM ",
|
||||
"keyColor": "cyan"
|
||||
},
|
||||
{
|
||||
"type": "swap",
|
||||
"key": " SWAP ",
|
||||
"keyColor": "cyan"
|
||||
},
|
||||
{
|
||||
"type": "disk",
|
||||
"key": " Disk ",
|
||||
"keyColor": "cyan"
|
||||
},
|
||||
{
|
||||
"type": "battery",
|
||||
"key": " Battery ",
|
||||
"keyColor": "cyan"
|
||||
},
|
||||
{
|
||||
"type": "custom",
|
||||
"format": "{$1}",
|
||||
"outputColor": "separator"
|
||||
},
|
||||
"break",
|
||||
{
|
||||
"type": "colors",
|
||||
"paddingLeft": 15
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
// designed for presenting Vanilla Linux
|
||||
// inspired from imstilllearnin's Vanilla Logo Ultra
|
||||
{
|
||||
"$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json",
|
||||
"logo": {
|
||||
"type": "small"
|
||||
},
|
||||
"display": {
|
||||
"color": {
|
||||
"output": "cyan"
|
||||
},
|
||||
"separator": ""
|
||||
},
|
||||
"modules": [
|
||||
{
|
||||
"type": "kernel",
|
||||
"key": "Vanilla ",
|
||||
"keyColor": "blue"
|
||||
},
|
||||
{
|
||||
"type": "packages",
|
||||
"key": " [_Packages_> ",
|
||||
"keyColor": "green"
|
||||
},
|
||||
{
|
||||
"type": "localip",
|
||||
"key": " [_Local_IP_> ",
|
||||
"keyColor": "green"
|
||||
},
|
||||
{
|
||||
"type": "cpu",
|
||||
"key": " [_CPU______> ",
|
||||
"keyColor": "magenta"
|
||||
},
|
||||
{
|
||||
"type": "memory",
|
||||
"key": " [_RAM______> ",
|
||||
"keyColor": "magenta"
|
||||
},
|
||||
{
|
||||
"type": "swap",
|
||||
"key": " [_SWAP_____> ",
|
||||
"keyColor": "magenta"
|
||||
},
|
||||
{
|
||||
"type": "disk",
|
||||
"key": " [_Disk_____> ",
|
||||
"keyColor": "magenta"
|
||||
},
|
||||
"break",
|
||||
{
|
||||
"type":"colors",
|
||||
"paddingLeft": 9,
|
||||
"symbol": "circle"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -2,9 +2,13 @@
|
||||
|
||||
{
|
||||
"$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json",
|
||||
"logo": "debian_small",
|
||||
"logo": {
|
||||
"type": "small"
|
||||
},
|
||||
"display": {
|
||||
"binaryPrefix": "si"
|
||||
"size": {
|
||||
"binaryPrefix": "si"
|
||||
}
|
||||
},
|
||||
"modules": [
|
||||
"vulkan",
|
||||
|
||||
@@ -3,13 +3,15 @@
|
||||
{
|
||||
"$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json",
|
||||
"logo": {
|
||||
"source": "arch_small",
|
||||
"type": "small",
|
||||
"padding": {
|
||||
"right": 1
|
||||
}
|
||||
},
|
||||
"display": {
|
||||
"binaryPrefix": "si",
|
||||
"size": {
|
||||
"binaryPrefix": "si"
|
||||
},
|
||||
"color": "blue",
|
||||
"separator": " "
|
||||
},
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
"$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json",
|
||||
"logo": null,
|
||||
"display": {
|
||||
"color": "reset_magenta"
|
||||
"color": "magenta"
|
||||
},
|
||||
"modules": [
|
||||
{
|
||||
|
||||
@@ -3,12 +3,6 @@
|
||||
|
||||
{
|
||||
"$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json",
|
||||
// "logo": {
|
||||
// "type": "iterm",
|
||||
// "source": "/Users/carter/Desktop/apple1.png",
|
||||
// "width": 28,
|
||||
// "height": 12
|
||||
// },
|
||||
"display": {
|
||||
"separator": " "
|
||||
},
|
||||
@@ -125,23 +119,22 @@
|
||||
"key": "╰─",
|
||||
"keyColor": "yellow"
|
||||
},
|
||||
|
||||
"break",
|
||||
|
||||
{
|
||||
"type": "title",
|
||||
"key": "╭─",
|
||||
"format": "{1}@{2}",
|
||||
"format": "{user-name}@{host-name}",
|
||||
"keyColor": "blue"
|
||||
},
|
||||
{
|
||||
"type": "os",
|
||||
"key": "├─", // Just get your distro's logo off nerdfonts.com
|
||||
"key": "├─{icon}", // Just get your distro's logo off nerdfonts.com
|
||||
"keyColor": "blue"
|
||||
},
|
||||
{
|
||||
"type": "kernel",
|
||||
"key": "├─",
|
||||
"format": "{1} {2}",
|
||||
"keyColor": "blue"
|
||||
},
|
||||
{
|
||||
@@ -168,12 +161,13 @@
|
||||
{
|
||||
"type": "publicip",
|
||||
"key": "├─",
|
||||
"keyColor": "blue"
|
||||
"keyColor": "blue",
|
||||
"timeout": 1000
|
||||
},
|
||||
{
|
||||
"type": "wifi",
|
||||
"key": "├─",
|
||||
"format": "{4}", // ssid
|
||||
"format": "{ssid}",
|
||||
"keyColor": "blue"
|
||||
},
|
||||
{
|
||||
|
||||
@@ -22,9 +22,8 @@
|
||||
},
|
||||
{
|
||||
"type": "os",
|
||||
"key": "├", // Just get your distro's logo off nerdfonts.com
|
||||
"keyColor": "yellow",
|
||||
"format": "{6}{?6} {?}{10} {8}"
|
||||
"key": "├{icon}", // Just get your distro's logo off nerdfonts.com
|
||||
"keyColor": "yellow"
|
||||
},
|
||||
{
|
||||
"type": "kernel",
|
||||
@@ -106,13 +105,13 @@
|
||||
"keyColor": "green"
|
||||
},
|
||||
{
|
||||
"type": "uptime",
|
||||
"key": "├",
|
||||
"type": "display",
|
||||
"key": "├",
|
||||
"keyColor": "green"
|
||||
},
|
||||
{
|
||||
"type": "display",
|
||||
"key": "└",
|
||||
"type": "uptime",
|
||||
"key": "└",
|
||||
"keyColor": "green"
|
||||
},
|
||||
|
||||
|
||||
+13
-24
@@ -11,6 +11,9 @@
|
||||
"size": {
|
||||
"ndigits": 0,
|
||||
"maxPrefix": "MB"
|
||||
},
|
||||
"key": {
|
||||
"type": "icon"
|
||||
}
|
||||
},
|
||||
"modules": [
|
||||
@@ -22,31 +25,17 @@
|
||||
"host": "blue"
|
||||
}
|
||||
},
|
||||
"os",
|
||||
"kernel",
|
||||
"memory",
|
||||
"packages",
|
||||
"uptime",
|
||||
{
|
||||
"type": "os",
|
||||
"key": "",
|
||||
"format": "{2} {8}"
|
||||
},
|
||||
{
|
||||
"type": "kernel",
|
||||
"key": ""
|
||||
},
|
||||
{
|
||||
"type": "memory",
|
||||
"key": ""
|
||||
},
|
||||
{
|
||||
"type": "packages",
|
||||
"key": ""
|
||||
},
|
||||
{
|
||||
"type": "uptime",
|
||||
"key": ""
|
||||
},
|
||||
{
|
||||
"type": "custom",
|
||||
"key": "",
|
||||
"format": "\u001b[31m███\u001b[32m███\u001b[33m███\u001b[34m███\u001b[35m███\u001b[36m███"
|
||||
"type": "colors",
|
||||
"key": "Colors", // For printing icon
|
||||
"block": {
|
||||
"range": [1, 6]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -4,11 +4,16 @@
|
||||
"type": "small"
|
||||
},
|
||||
"display": {
|
||||
"keyWidth": 11,
|
||||
"key": {
|
||||
"width": 11
|
||||
},
|
||||
"bar": {
|
||||
"charElapsed": "=",
|
||||
"charTotal": "-",
|
||||
"width": 13
|
||||
},
|
||||
"percent": {
|
||||
"type": 2
|
||||
}
|
||||
},
|
||||
"modules": [
|
||||
@@ -16,11 +21,14 @@
|
||||
"separator",
|
||||
"memory",
|
||||
"swap",
|
||||
"disk",
|
||||
{
|
||||
"type": "disk",
|
||||
"folders": "/"
|
||||
},
|
||||
"battery",
|
||||
{
|
||||
"type": "colors",
|
||||
"paddingLeft": 11,
|
||||
"paddingLeft": 10,
|
||||
"symbol": "circle"
|
||||
}
|
||||
]
|
||||
|
||||
@@ -1,37 +0,0 @@
|
||||
{
|
||||
"$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json",
|
||||
"modules": [
|
||||
{
|
||||
"type": "host",
|
||||
"format": "{?2}{2}{?}{?5} ({5}){?}"
|
||||
},
|
||||
"chassis",
|
||||
{
|
||||
"type": "board",
|
||||
"format": "{?1}{1}{?}{?2} ({2}){?}"
|
||||
},
|
||||
"cpu",
|
||||
{
|
||||
"type": "memory",
|
||||
"format": "{?2}{2}{?}"
|
||||
},
|
||||
"physicaldisk",
|
||||
"gpu",
|
||||
"display",
|
||||
"monitor",
|
||||
{
|
||||
"type": "wifi",
|
||||
"format": "{?1}{1}{?}{?6} - {6}{?}"
|
||||
},
|
||||
{
|
||||
"type": "sound",
|
||||
"format": "{?2}{2}{?}"
|
||||
},
|
||||
"camera",
|
||||
{
|
||||
"type": "battery",
|
||||
"format": "{?1}{1}{?}{?2} {2}{?}{?3} ({3}){?}"
|
||||
},
|
||||
"poweradapter"
|
||||
]
|
||||
}
|
||||
@@ -11,7 +11,10 @@
|
||||
"separator",
|
||||
"os",
|
||||
"host",
|
||||
"kernel",
|
||||
{
|
||||
"type": "kernel",
|
||||
"format": "{release}"
|
||||
},
|
||||
"uptime",
|
||||
"packages",
|
||||
"shell",
|
||||
@@ -28,7 +31,7 @@
|
||||
"terminal",
|
||||
{
|
||||
"type": "terminalfont",
|
||||
"format": "{/2}{-}{/}{2}{?3} {3}{?}"
|
||||
"format": "{/name}{-}{/}{name}{?size} {size}{?}"
|
||||
},
|
||||
"cpu",
|
||||
{
|
||||
@@ -37,7 +40,7 @@
|
||||
},
|
||||
{
|
||||
"type": "memory",
|
||||
"format": "{/1}{-}{/}{/2}{-}{/}{} / {}"
|
||||
"format": "{} / {}"
|
||||
},
|
||||
"break",
|
||||
"colors"
|
||||
|
||||
@@ -17,10 +17,7 @@
|
||||
"break",
|
||||
"packages",
|
||||
"shell",
|
||||
{
|
||||
"type": "display",
|
||||
"key": "Display"
|
||||
},
|
||||
"display",
|
||||
"terminal",
|
||||
"break",
|
||||
"cpu",
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
{
|
||||
"$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json",
|
||||
"modules": [
|
||||
"title",
|
||||
"os",
|
||||
"kernel",
|
||||
"uptime",
|
||||
{
|
||||
"type": "packages",
|
||||
"format": "{all}"
|
||||
},
|
||||
"shell",
|
||||
{
|
||||
"type": "display",
|
||||
"key": "Resolution",
|
||||
"compactType": "original"
|
||||
},
|
||||
"de",
|
||||
"wm",
|
||||
"wmtheme",
|
||||
{
|
||||
"type": "terminalfont",
|
||||
"key": "font"
|
||||
},
|
||||
{
|
||||
"type": "disk",
|
||||
"folders": "/",
|
||||
"key": "Disk"
|
||||
},
|
||||
"cpu",
|
||||
"gpu",
|
||||
{
|
||||
"type": "memory",
|
||||
"key": "RAM"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -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"
|
||||
]
|
||||
}
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 341 KiB After Width: | Height: | Size: 285 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 133 KiB |
Vendored
-27
@@ -1,27 +0,0 @@
|
||||
Intel Software License Agreement
|
||||
10.07.21
|
||||
|
||||
Use and Redistribution. You may use and redistribute Intel’s Control API software and the header files for the Intel® Graphics Control Library (collectively, the “Software”), solely for use on Intel platforms, provided the following conditions are met:
|
||||
* Redistributions must reproduce the above copyright notice and the following terms of use in the Software and in the documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Intel nor the names of its suppliers may be used to endorse or promote products derived from this Software without specific prior written permission.
|
||||
* No reverse engineering, decompilation, or disassembly of Software provided to you in binary form is permitted.
|
||||
|
||||
Third Party Software. The Software may contain Third Party Software. “Third Party Software” is third party software, open source software or other Intel software listed in the “third-party-software.txt” or other similarly named text file that is included with the Software. Third Party Software, even if included with the distribution of the Software, may be governed by separate license terms, including without limitation, third party license terms, open source software notices and terms, and/or other Intel software license terms. These separate license terms solely govern your use of the Third Party Software.
|
||||
|
||||
Ownership. Title to the Software and all copies remain with Intel or its suppliers.
|
||||
|
||||
DISCLAIMER. THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT ARE DISCLAIMED. THIS SOFTWARE IS NOT INTENDED FOR USE IN SYSTEMS OR APPLICATIONS WHERE FAILURE OF THE SOFTWARE MAY CAUSE PERSONAL INJURY OR DEATH AND YOU AGREE THAT YOU ARE FULLY RESPONSIBLE FOR ANY CLAIMS, COSTS, DAMAGES, EXPENSES, AND ATTORNEYS’ FEES ARISING OUT OF ANY SUCH USE, EVEN IF ANY CLAIM ALLEGES THAT INTEL WAS NEGLIGENT REGARDING THE DESIGN OR MANUFACTURE OF THE SOFTWARE.
|
||||
|
||||
LIMITATION OF LIABILITY; INDEMNITY. IN NO EVENT WILL INTEL BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. YOU AGREE TO INDEMNIFY, DEFEND, AND HOLD INTEL HARMLESS AGAINST ANY CLAIMS, DAMAGES, AND EXPENSES RESULTING FROM YOUR USE OR UNAUTHORIZED USE OF THE SOFTWARE.
|
||||
|
||||
No support. Intel may make changes to the Software, at any time without notice, and is not obligated to support, update or provide training for the Software.
|
||||
|
||||
Termination. Your right to use the Software is terminated immediately in the event of your breach of this agreement.
|
||||
|
||||
Feedback. Should you provide Intel with comments, modifications, corrections, enhancements or other input (“Feedback”) related to the Software Intel will be free to use, disclose, reproduce, license or otherwise distribute or exploit the Feedback in its sole discretion without any obligations or restrictions of any kind, including without limitation, intellectual property rights or licensing obligations.
|
||||
|
||||
Compliance with laws. You agree to comply with all applicable laws and regulations governing your use, transfer, import or export (or prohibition thereof) of the Software.
|
||||
|
||||
Governing law. All disputes will be governed by the laws of the United States of America and the State of Delaware without reference to conflict of law principles and subject to the exclusive jurisdiction of the state or federal courts sitting in the State of Delaware, and each party agrees that it submits to the personal jurisdiction and venue of those courts and waives any objections. The United Nations Convention on Contracts for the International Sale of Goods (1980) is specifically excluded and will not apply to the Software.
|
||||
|
||||
Severability. The parties intend that if a court holds that any provision of this agreement is invalid or unenforceable under applicable law, the court will modify the provision to the minimum extent necessary to make it valid and enforceable or sever and delete the provision from this agreement. Any change to or deletion of a provision of this agreement under this Section will not affect the validity or enforceability of the remainder of this agreement, which will continue in full force and effect.
|
||||
Vendored
-7906
File diff suppressed because it is too large
Load Diff
Vendored
-6
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"home": "https://github.com/intel/drivers.gpu.control-library",
|
||||
"license": "./LICENSE",
|
||||
"version": "v184",
|
||||
"author": "Intel Corporation"
|
||||
}
|
||||
Vendored
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"home": "https://www.cl.cam.ac.uk/~mgk25/ucs/wcwidth.c",
|
||||
"license": "Embed in source",
|
||||
"license": "MIT compatible (embed in source)",
|
||||
"version": "2007-05-26 (Unicode 5.0)",
|
||||
"author": "Markus Kuhn",
|
||||
"modified": "CarterLi"
|
||||
|
||||
Vendored
-11074
File diff suppressed because it is too large
Load Diff
Vendored
-6
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"home": "https://github.com/NVIDIA/nvidia-settings/blob/main/src/nvml.h",
|
||||
"license": "Embed in source",
|
||||
"version": "550.54.14",
|
||||
"author": "NVIDIA Corporation"
|
||||
}
|
||||
Vendored
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"home": "https://github.com/ibireme/yyjson",
|
||||
"license": "MIT ( embed in source )",
|
||||
"version": "0.9.0",
|
||||
"version": "0.10.0",
|
||||
"author": "ibireme"
|
||||
}
|
||||
|
||||
Vendored
+152
-57
@@ -1831,6 +1831,42 @@ bool unsafe_yyjson_mut_equals(yyjson_mut_val *lhs, yyjson_mut_val *rhs) {
|
||||
}
|
||||
}
|
||||
|
||||
bool yyjson_locate_pos(const char *str, size_t len, size_t pos,
|
||||
size_t *line, size_t *col, size_t *chr) {
|
||||
usize line_sum = 0, line_pos = 0, chr_sum = 0;
|
||||
const u8 *cur = (const u8 *)str;
|
||||
const u8 *end = cur + pos;
|
||||
|
||||
if (!str || pos > len) {
|
||||
if (line) *line = 0;
|
||||
if (col) *col = 0;
|
||||
if (chr) *chr = 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
while (cur < end) {
|
||||
u8 c = *cur;
|
||||
chr_sum += 1;
|
||||
if (likely(c < 0x80)) { /* 0xxxxxxx (0x00-0x7F) ASCII */
|
||||
if (c == '\n') {
|
||||
line_sum += 1;
|
||||
line_pos = chr_sum;
|
||||
}
|
||||
cur += 1;
|
||||
}
|
||||
else if (c < 0xC0) cur += 1; /* 10xxxxxx (0x80-0xBF) Invalid */
|
||||
else if (c < 0xE0) cur += 2; /* 110xxxxx (0xC0-0xDF) 2-byte UTF-8 */
|
||||
else if (c < 0xF0) cur += 3; /* 1110xxxx (0xE0-0xEF) 3-byte UTF-8 */
|
||||
else if (c < 0xF8) cur += 4; /* 11110xxx (0xF0-0xF7) 4-byte UTF-8 */
|
||||
else cur += 1; /* 11111xxx (0xF8-0xFF) Invalid */
|
||||
}
|
||||
|
||||
if (line) *line = line_sum + 1;
|
||||
if (col) *col = chr_sum - line_pos + 1;
|
||||
if (chr) *chr = chr_sum;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
#if !YYJSON_DISABLE_UTILS
|
||||
@@ -4434,7 +4470,7 @@ static_inline bool read_number(u8 **ptr,
|
||||
bool sign;
|
||||
|
||||
/* read number as raw string if has `YYJSON_READ_NUMBER_AS_RAW` flag */
|
||||
if (unlikely(pre && !has_read_flag(BIGNUM_AS_RAW))) {
|
||||
if (has_read_flag(NUMBER_AS_RAW)) {
|
||||
return read_number_raw(ptr, pre, flg, val, msg);
|
||||
}
|
||||
|
||||
@@ -5036,7 +5072,7 @@ static_inline bool read_number(u8 **ptr,
|
||||
bool sign;
|
||||
|
||||
/* read number as raw string if has `YYJSON_READ_NUMBER_AS_RAW` flag */
|
||||
if (unlikely(pre && !has_read_flag(BIGNUM_AS_RAW))) {
|
||||
if (has_read_flag(NUMBER_AS_RAW)) {
|
||||
return read_number_raw(ptr, pre, flg, val, msg);
|
||||
}
|
||||
|
||||
@@ -5744,18 +5780,18 @@ static_noinline yyjson_doc *read_root_single(u8 *hdr,
|
||||
}
|
||||
if (*cur == 't') {
|
||||
if (likely(read_true(&cur, val))) goto doc_end;
|
||||
goto fail_literal;
|
||||
goto fail_literal_true;
|
||||
}
|
||||
if (*cur == 'f') {
|
||||
if (likely(read_false(&cur, val))) goto doc_end;
|
||||
goto fail_literal;
|
||||
goto fail_literal_false;
|
||||
}
|
||||
if (*cur == 'n') {
|
||||
if (likely(read_null(&cur, val))) goto doc_end;
|
||||
if (has_read_flag(ALLOW_INF_AND_NAN)) {
|
||||
if (read_nan(false, &cur, pre, val)) goto doc_end;
|
||||
}
|
||||
goto fail_literal;
|
||||
goto fail_literal_null;
|
||||
}
|
||||
if (has_read_flag(ALLOW_INF_AND_NAN)) {
|
||||
if (read_inf_or_nan(false, &cur, pre, val)) goto doc_end;
|
||||
@@ -5789,15 +5825,26 @@ fail_string:
|
||||
fail_number:
|
||||
return_err(cur, INVALID_NUMBER, msg);
|
||||
fail_alloc:
|
||||
return_err(cur, MEMORY_ALLOCATION, "memory allocation failed");
|
||||
fail_literal:
|
||||
return_err(cur, LITERAL, "invalid literal");
|
||||
fail_comment:
|
||||
return_err(cur, INVALID_COMMENT, "unclosed multiline comment");
|
||||
return_err(cur, MEMORY_ALLOCATION,
|
||||
"memory allocation failed");
|
||||
fail_literal_true:
|
||||
return_err(cur, LITERAL,
|
||||
"invalid literal, expected a valid literal such as 'true'");
|
||||
fail_literal_false:
|
||||
return_err(cur, LITERAL,
|
||||
"invalid literal, expected a valid literal such as 'false'");
|
||||
fail_literal_null:
|
||||
return_err(cur, LITERAL,
|
||||
"invalid literal, expected a valid literal such as 'null'");
|
||||
fail_character:
|
||||
return_err(cur, UNEXPECTED_CHARACTER, "unexpected character");
|
||||
return_err(cur, UNEXPECTED_CHARACTER,
|
||||
"unexpected character, expected a valid root value");
|
||||
fail_comment:
|
||||
return_err(cur, INVALID_COMMENT,
|
||||
"unclosed multiline comment");
|
||||
fail_garbage:
|
||||
return_err(cur, UNEXPECTED_CONTENT, "unexpected content after document");
|
||||
return_err(cur, UNEXPECTED_CONTENT,
|
||||
"unexpected content after document");
|
||||
|
||||
#undef return_err
|
||||
}
|
||||
@@ -5927,13 +5974,13 @@ arr_val_begin:
|
||||
val_incr();
|
||||
ctn_len++;
|
||||
if (likely(read_true(&cur, val))) goto arr_val_end;
|
||||
goto fail_literal;
|
||||
goto fail_literal_true;
|
||||
}
|
||||
if (*cur == 'f') {
|
||||
val_incr();
|
||||
ctn_len++;
|
||||
if (likely(read_false(&cur, val))) goto arr_val_end;
|
||||
goto fail_literal;
|
||||
goto fail_literal_false;
|
||||
}
|
||||
if (*cur == 'n') {
|
||||
val_incr();
|
||||
@@ -5942,7 +5989,7 @@ arr_val_begin:
|
||||
if (has_read_flag(ALLOW_INF_AND_NAN)) {
|
||||
if (read_nan(false, &cur, pre, val)) goto arr_val_end;
|
||||
}
|
||||
goto fail_literal;
|
||||
goto fail_literal_null;
|
||||
}
|
||||
if (*cur == ']') {
|
||||
cur++;
|
||||
@@ -5960,13 +6007,13 @@ arr_val_begin:
|
||||
val_incr();
|
||||
ctn_len++;
|
||||
if (read_inf_or_nan(false, &cur, pre, val)) goto arr_val_end;
|
||||
goto fail_character;
|
||||
goto fail_character_val;
|
||||
}
|
||||
if (has_read_flag(ALLOW_COMMENTS)) {
|
||||
if (skip_spaces_and_comments(&cur)) goto arr_val_begin;
|
||||
if (byte_match_2(cur, "/*")) goto fail_comment;
|
||||
}
|
||||
goto fail_character;
|
||||
goto fail_character_val;
|
||||
|
||||
arr_val_end:
|
||||
if (*cur == ',') {
|
||||
@@ -5985,7 +6032,7 @@ arr_val_end:
|
||||
if (skip_spaces_and_comments(&cur)) goto arr_val_end;
|
||||
if (byte_match_2(cur, "/*")) goto fail_comment;
|
||||
}
|
||||
goto fail_character;
|
||||
goto fail_character_arr_end;
|
||||
|
||||
arr_end:
|
||||
/* get parent container */
|
||||
@@ -6038,7 +6085,7 @@ obj_key_begin:
|
||||
if (skip_spaces_and_comments(&cur)) goto obj_key_begin;
|
||||
if (byte_match_2(cur, "/*")) goto fail_comment;
|
||||
}
|
||||
goto fail_character;
|
||||
goto fail_character_obj_key;
|
||||
|
||||
obj_key_end:
|
||||
if (*cur == ':') {
|
||||
@@ -6053,7 +6100,7 @@ obj_key_end:
|
||||
if (skip_spaces_and_comments(&cur)) goto obj_key_end;
|
||||
if (byte_match_2(cur, "/*")) goto fail_comment;
|
||||
}
|
||||
goto fail_character;
|
||||
goto fail_character_obj_sep;
|
||||
|
||||
obj_val_begin:
|
||||
if (*cur == '"') {
|
||||
@@ -6080,13 +6127,13 @@ obj_val_begin:
|
||||
val++;
|
||||
ctn_len++;
|
||||
if (likely(read_true(&cur, val))) goto obj_val_end;
|
||||
goto fail_literal;
|
||||
goto fail_literal_true;
|
||||
}
|
||||
if (*cur == 'f') {
|
||||
val++;
|
||||
ctn_len++;
|
||||
if (likely(read_false(&cur, val))) goto obj_val_end;
|
||||
goto fail_literal;
|
||||
goto fail_literal_false;
|
||||
}
|
||||
if (*cur == 'n') {
|
||||
val++;
|
||||
@@ -6095,7 +6142,7 @@ obj_val_begin:
|
||||
if (has_read_flag(ALLOW_INF_AND_NAN)) {
|
||||
if (read_nan(false, &cur, pre, val)) goto obj_val_end;
|
||||
}
|
||||
goto fail_literal;
|
||||
goto fail_literal_null;
|
||||
}
|
||||
if (char_is_space(*cur)) {
|
||||
while (char_is_space(*++cur));
|
||||
@@ -6106,13 +6153,13 @@ obj_val_begin:
|
||||
val++;
|
||||
ctn_len++;
|
||||
if (read_inf_or_nan(false, &cur, pre, val)) goto obj_val_end;
|
||||
goto fail_character;
|
||||
goto fail_character_val;
|
||||
}
|
||||
if (has_read_flag(ALLOW_COMMENTS)) {
|
||||
if (skip_spaces_and_comments(&cur)) goto obj_val_begin;
|
||||
if (byte_match_2(cur, "/*")) goto fail_comment;
|
||||
}
|
||||
goto fail_character;
|
||||
goto fail_character_val;
|
||||
|
||||
obj_val_end:
|
||||
if (likely(*cur == ',')) {
|
||||
@@ -6131,7 +6178,7 @@ obj_val_end:
|
||||
if (skip_spaces_and_comments(&cur)) goto obj_val_end;
|
||||
if (byte_match_2(cur, "/*")) goto fail_comment;
|
||||
}
|
||||
goto fail_character;
|
||||
goto fail_character_obj_end;
|
||||
|
||||
obj_end:
|
||||
/* pop container */
|
||||
@@ -6174,17 +6221,41 @@ fail_string:
|
||||
fail_number:
|
||||
return_err(cur, INVALID_NUMBER, msg);
|
||||
fail_alloc:
|
||||
return_err(cur, MEMORY_ALLOCATION, "memory allocation failed");
|
||||
return_err(cur, MEMORY_ALLOCATION,
|
||||
"memory allocation failed");
|
||||
fail_trailing_comma:
|
||||
return_err(cur, JSON_STRUCTURE, "trailing comma is not allowed");
|
||||
fail_literal:
|
||||
return_err(cur, LITERAL, "invalid literal");
|
||||
return_err(cur, JSON_STRUCTURE,
|
||||
"trailing comma is not allowed");
|
||||
fail_literal_true:
|
||||
return_err(cur, LITERAL,
|
||||
"invalid literal, expected a valid literal such as 'true'");
|
||||
fail_literal_false:
|
||||
return_err(cur, LITERAL,
|
||||
"invalid literal, expected a valid literal such as 'false'");
|
||||
fail_literal_null:
|
||||
return_err(cur, LITERAL,
|
||||
"invalid literal, expected a valid literal such as 'null'");
|
||||
fail_character_val:
|
||||
return_err(cur, UNEXPECTED_CHARACTER,
|
||||
"unexpected character, expected a valid JSON value");
|
||||
fail_character_arr_end:
|
||||
return_err(cur, UNEXPECTED_CHARACTER,
|
||||
"unexpected character, expected a comma or a closing bracket");
|
||||
fail_character_obj_key:
|
||||
return_err(cur, UNEXPECTED_CHARACTER,
|
||||
"unexpected character, expected a string for object key");
|
||||
fail_character_obj_sep:
|
||||
return_err(cur, UNEXPECTED_CHARACTER,
|
||||
"unexpected character, expected a colon after object key");
|
||||
fail_character_obj_end:
|
||||
return_err(cur, UNEXPECTED_CHARACTER,
|
||||
"unexpected character, expected a comma or a closing brace");
|
||||
fail_comment:
|
||||
return_err(cur, INVALID_COMMENT, "unclosed multiline comment");
|
||||
fail_character:
|
||||
return_err(cur, UNEXPECTED_CHARACTER, "unexpected character");
|
||||
return_err(cur, INVALID_COMMENT,
|
||||
"unclosed multiline comment");
|
||||
fail_garbage:
|
||||
return_err(cur, UNEXPECTED_CONTENT, "unexpected content after document");
|
||||
return_err(cur, UNEXPECTED_CONTENT,
|
||||
"unexpected content after document");
|
||||
|
||||
#undef val_incr
|
||||
#undef return_err
|
||||
@@ -6330,13 +6401,13 @@ arr_val_begin:
|
||||
val_incr();
|
||||
ctn_len++;
|
||||
if (likely(read_true(&cur, val))) goto arr_val_end;
|
||||
goto fail_literal;
|
||||
goto fail_literal_true;
|
||||
}
|
||||
if (*cur == 'f') {
|
||||
val_incr();
|
||||
ctn_len++;
|
||||
if (likely(read_false(&cur, val))) goto arr_val_end;
|
||||
goto fail_literal;
|
||||
goto fail_literal_false;
|
||||
}
|
||||
if (*cur == 'n') {
|
||||
val_incr();
|
||||
@@ -6345,7 +6416,7 @@ arr_val_begin:
|
||||
if (has_read_flag(ALLOW_INF_AND_NAN)) {
|
||||
if (read_nan(false, &cur, pre, val)) goto arr_val_end;
|
||||
}
|
||||
goto fail_literal;
|
||||
goto fail_literal_null;
|
||||
}
|
||||
if (*cur == ']') {
|
||||
cur++;
|
||||
@@ -6363,13 +6434,13 @@ arr_val_begin:
|
||||
val_incr();
|
||||
ctn_len++;
|
||||
if (read_inf_or_nan(false, &cur, pre, val)) goto arr_val_end;
|
||||
goto fail_character;
|
||||
goto fail_character_val;
|
||||
}
|
||||
if (has_read_flag(ALLOW_COMMENTS)) {
|
||||
if (skip_spaces_and_comments(&cur)) goto arr_val_begin;
|
||||
if (byte_match_2(cur, "/*")) goto fail_comment;
|
||||
}
|
||||
goto fail_character;
|
||||
goto fail_character_val;
|
||||
|
||||
arr_val_end:
|
||||
if (byte_match_2(cur, ",\n")) {
|
||||
@@ -6392,7 +6463,7 @@ arr_val_end:
|
||||
if (skip_spaces_and_comments(&cur)) goto arr_val_end;
|
||||
if (byte_match_2(cur, "/*")) goto fail_comment;
|
||||
}
|
||||
goto fail_character;
|
||||
goto fail_character_arr_end;
|
||||
|
||||
arr_end:
|
||||
/* get parent container */
|
||||
@@ -6458,7 +6529,7 @@ obj_key_begin:
|
||||
if (skip_spaces_and_comments(&cur)) goto obj_key_begin;
|
||||
if (byte_match_2(cur, "/*")) goto fail_comment;
|
||||
}
|
||||
goto fail_character;
|
||||
goto fail_character_obj_key;
|
||||
|
||||
obj_key_end:
|
||||
if (byte_match_2(cur, ": ")) {
|
||||
@@ -6477,7 +6548,7 @@ obj_key_end:
|
||||
if (skip_spaces_and_comments(&cur)) goto obj_key_end;
|
||||
if (byte_match_2(cur, "/*")) goto fail_comment;
|
||||
}
|
||||
goto fail_character;
|
||||
goto fail_character_obj_sep;
|
||||
|
||||
obj_val_begin:
|
||||
if (*cur == '"') {
|
||||
@@ -6504,13 +6575,13 @@ obj_val_begin:
|
||||
val++;
|
||||
ctn_len++;
|
||||
if (likely(read_true(&cur, val))) goto obj_val_end;
|
||||
goto fail_literal;
|
||||
goto fail_literal_true;
|
||||
}
|
||||
if (*cur == 'f') {
|
||||
val++;
|
||||
ctn_len++;
|
||||
if (likely(read_false(&cur, val))) goto obj_val_end;
|
||||
goto fail_literal;
|
||||
goto fail_literal_false;
|
||||
}
|
||||
if (*cur == 'n') {
|
||||
val++;
|
||||
@@ -6519,7 +6590,7 @@ obj_val_begin:
|
||||
if (has_read_flag(ALLOW_INF_AND_NAN)) {
|
||||
if (read_nan(false, &cur, pre, val)) goto obj_val_end;
|
||||
}
|
||||
goto fail_literal;
|
||||
goto fail_literal_null;
|
||||
}
|
||||
if (char_is_space(*cur)) {
|
||||
while (char_is_space(*++cur));
|
||||
@@ -6530,13 +6601,13 @@ obj_val_begin:
|
||||
val++;
|
||||
ctn_len++;
|
||||
if (read_inf_or_nan(false, &cur, pre, val)) goto obj_val_end;
|
||||
goto fail_character;
|
||||
goto fail_character_val;
|
||||
}
|
||||
if (has_read_flag(ALLOW_COMMENTS)) {
|
||||
if (skip_spaces_and_comments(&cur)) goto obj_val_begin;
|
||||
if (byte_match_2(cur, "/*")) goto fail_comment;
|
||||
}
|
||||
goto fail_character;
|
||||
goto fail_character_val;
|
||||
|
||||
obj_val_end:
|
||||
if (byte_match_2(cur, ",\n")) {
|
||||
@@ -6559,7 +6630,7 @@ obj_val_end:
|
||||
if (skip_spaces_and_comments(&cur)) goto obj_val_end;
|
||||
if (byte_match_2(cur, "/*")) goto fail_comment;
|
||||
}
|
||||
goto fail_character;
|
||||
goto fail_character_obj_end;
|
||||
|
||||
obj_end:
|
||||
/* pop container */
|
||||
@@ -6603,17 +6674,41 @@ fail_string:
|
||||
fail_number:
|
||||
return_err(cur, INVALID_NUMBER, msg);
|
||||
fail_alloc:
|
||||
return_err(cur, MEMORY_ALLOCATION, "memory allocation failed");
|
||||
return_err(cur, MEMORY_ALLOCATION,
|
||||
"memory allocation failed");
|
||||
fail_trailing_comma:
|
||||
return_err(cur, JSON_STRUCTURE, "trailing comma is not allowed");
|
||||
fail_literal:
|
||||
return_err(cur, LITERAL, "invalid literal");
|
||||
return_err(cur, JSON_STRUCTURE,
|
||||
"trailing comma is not allowed");
|
||||
fail_literal_true:
|
||||
return_err(cur, LITERAL,
|
||||
"invalid literal, expected a valid literal such as 'true'");
|
||||
fail_literal_false:
|
||||
return_err(cur, LITERAL,
|
||||
"invalid literal, expected a valid literal such as 'false'");
|
||||
fail_literal_null:
|
||||
return_err(cur, LITERAL,
|
||||
"invalid literal, expected a valid literal such as 'null'");
|
||||
fail_character_val:
|
||||
return_err(cur, UNEXPECTED_CHARACTER,
|
||||
"unexpected character, expected a valid JSON value");
|
||||
fail_character_arr_end:
|
||||
return_err(cur, UNEXPECTED_CHARACTER,
|
||||
"unexpected character, expected a comma or a closing bracket");
|
||||
fail_character_obj_key:
|
||||
return_err(cur, UNEXPECTED_CHARACTER,
|
||||
"unexpected character, expected a string for object key");
|
||||
fail_character_obj_sep:
|
||||
return_err(cur, UNEXPECTED_CHARACTER,
|
||||
"unexpected character, expected a colon after object key");
|
||||
fail_character_obj_end:
|
||||
return_err(cur, UNEXPECTED_CHARACTER,
|
||||
"unexpected character, expected a comma or a closing brace");
|
||||
fail_comment:
|
||||
return_err(cur, INVALID_COMMENT, "unclosed multiline comment");
|
||||
fail_character:
|
||||
return_err(cur, UNEXPECTED_CHARACTER, "unexpected character");
|
||||
return_err(cur, INVALID_COMMENT,
|
||||
"unclosed multiline comment");
|
||||
fail_garbage:
|
||||
return_err(cur, UNEXPECTED_CONTENT, "unexpected content after document");
|
||||
return_err(cur, UNEXPECTED_CONTENT,
|
||||
"unexpected content after document");
|
||||
|
||||
#undef val_incr
|
||||
#undef return_err
|
||||
@@ -7835,7 +7930,7 @@ static const u8 esc_single_char_table[512] = {
|
||||
|
||||
/** Returns the encode table with options. */
|
||||
static_inline const char_enc_type *get_enc_table_with_flag(
|
||||
yyjson_read_flag flg) {
|
||||
yyjson_write_flag flg) {
|
||||
if (has_write_flag(ESCAPE_UNICODE)) {
|
||||
if (has_write_flag(ESCAPE_SLASHES)) {
|
||||
return enc_table_esc_slash;
|
||||
|
||||
Vendored
+21
-3
@@ -527,16 +527,16 @@ extern "C" {
|
||||
#define YYJSON_VERSION_MAJOR 0
|
||||
|
||||
/** The minor version of yyjson. */
|
||||
#define YYJSON_VERSION_MINOR 9
|
||||
#define YYJSON_VERSION_MINOR 10
|
||||
|
||||
/** The patch version of yyjson. */
|
||||
#define YYJSON_VERSION_PATCH 0
|
||||
|
||||
/** The version of yyjson in hex: `(major << 16) | (minor << 8) | (patch)`. */
|
||||
#define YYJSON_VERSION_HEX 0x000900
|
||||
#define YYJSON_VERSION_HEX 0x000A00
|
||||
|
||||
/** The version string of yyjson. */
|
||||
#define YYJSON_VERSION_STRING "0.9.0"
|
||||
#define YYJSON_VERSION_STRING "0.10.0"
|
||||
|
||||
/** The version of yyjson in hex, same as `YYJSON_VERSION_HEX`. */
|
||||
yyjson_api uint32_t yyjson_version(void);
|
||||
@@ -841,6 +841,24 @@ typedef struct yyjson_read_err {
|
||||
size_t pos;
|
||||
} yyjson_read_err;
|
||||
|
||||
/**
|
||||
Locate the line and column number for a byte position in a string.
|
||||
This can be used to get better description for error position.
|
||||
|
||||
@param str The input string.
|
||||
@param len The byte length of the input string.
|
||||
@param pos The byte position within the input string.
|
||||
@param line A pointer to receive the line number, starting from 1.
|
||||
@param col A pointer to receive the column number, starting from 1.
|
||||
@param chr A pointer to receive the character index, starting from 0.
|
||||
@return true on success, false if `str` is NULL or `pos` is out of bounds.
|
||||
@note Line/column/character are calculated based on Unicode characters for
|
||||
compatibility with text editors. For multi-byte UTF-8 characters,
|
||||
the returned value may not directly correspond to the byte position.
|
||||
*/
|
||||
yyjson_api bool yyjson_locate_pos(const char *str, size_t len, size_t pos,
|
||||
size_t *line, size_t *col, size_t *chr);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -130,10 +130,7 @@ void ffPrintCommandOption(FFdata* data, yyjson_mut_doc* jsonDoc)
|
||||
{
|
||||
char str[32];
|
||||
int len = snprintf(str, sizeof str, "%" PRIu64 "ms", ms);
|
||||
if(instance.config.display.pipe)
|
||||
puts(str);
|
||||
else
|
||||
printf("\033[s\033[1A\033[9999999C\033[%dD%s\033[u", len, str); // Save; Up 1; Right 9999999; Left <len>; Print <str>; Load
|
||||
printf("\033[s\033[1A\033[9999999C\033[%dD%s\033[u", len, str); // Save; Up 1; Right 9999999; Left <len>; Print <str>; Load
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+64
-29
@@ -10,9 +10,8 @@ static bool loadLibSymbols(FFDBusLibrary* lib)
|
||||
FF_LIBRARY_LOAD(dbus, &instance.config.library.libDBus, false, "libdbus-1" FF_LIBRARY_EXTENSION, 4);
|
||||
FF_LIBRARY_LOAD_SYMBOL_PTR(dbus, lib, dbus_bus_get, false)
|
||||
FF_LIBRARY_LOAD_SYMBOL_PTR(dbus, lib, dbus_message_new_method_call, false)
|
||||
FF_LIBRARY_LOAD_SYMBOL_PTR(dbus, lib, dbus_message_append_args, false)
|
||||
FF_LIBRARY_LOAD_SYMBOL_PTR(dbus, lib, dbus_message_iter_init, false)
|
||||
FF_LIBRARY_LOAD_SYMBOL_PTR(dbus, lib, dbus_message_iter_init_append, false)
|
||||
FF_LIBRARY_LOAD_SYMBOL_PTR(dbus, lib, dbus_message_iter_append_basic, false)
|
||||
FF_LIBRARY_LOAD_SYMBOL_PTR(dbus, lib, dbus_message_iter_get_arg_type, false)
|
||||
FF_LIBRARY_LOAD_SYMBOL_PTR(dbus, lib, dbus_message_iter_get_basic, false)
|
||||
FF_LIBRARY_LOAD_SYMBOL_PTR(dbus, lib, dbus_message_iter_recurse, false)
|
||||
@@ -20,10 +19,6 @@ static bool loadLibSymbols(FFDBusLibrary* lib)
|
||||
FF_LIBRARY_LOAD_SYMBOL_PTR(dbus, lib, dbus_message_iter_next, false)
|
||||
FF_LIBRARY_LOAD_SYMBOL_PTR(dbus, lib, dbus_message_unref, false)
|
||||
FF_LIBRARY_LOAD_SYMBOL_PTR(dbus, lib, dbus_connection_send_with_reply_and_block, false)
|
||||
FF_LIBRARY_LOAD_SYMBOL_PTR(dbus, lib, dbus_connection_flush, false)
|
||||
FF_LIBRARY_LOAD_SYMBOL_PTR(dbus, lib, dbus_pending_call_block, false)
|
||||
FF_LIBRARY_LOAD_SYMBOL_PTR(dbus, lib, dbus_pending_call_steal_reply, false)
|
||||
FF_LIBRARY_LOAD_SYMBOL_PTR(dbus, lib, dbus_pending_call_unref, false)
|
||||
dbus = NULL; // don't auto dlclose
|
||||
return true;
|
||||
}
|
||||
@@ -56,11 +51,11 @@ const char* ffDBusLoadData(DBusBusType busType, FFDBusData* data)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
bool ffDBusGetValue(FFDBusData* dbus, DBusMessageIter* iter, FFstrbuf* result)
|
||||
bool ffDBusGetString(FFDBusData* dbus, DBusMessageIter* iter, FFstrbuf* result)
|
||||
{
|
||||
int argType = dbus->lib->ffdbus_message_iter_get_arg_type(iter);
|
||||
|
||||
if(argType == DBUS_TYPE_STRING)
|
||||
if(argType == DBUS_TYPE_STRING || argType == DBUS_TYPE_OBJECT_PATH)
|
||||
{
|
||||
const char* value = NULL;
|
||||
dbus->lib->ffdbus_message_iter_get_basic(iter, &value);
|
||||
@@ -72,6 +67,14 @@ bool ffDBusGetValue(FFDBusData* dbus, DBusMessageIter* iter, FFstrbuf* result)
|
||||
return true;
|
||||
}
|
||||
|
||||
if (argType == DBUS_TYPE_BYTE)
|
||||
{
|
||||
uint8_t value;
|
||||
dbus->lib->ffdbus_message_iter_get_basic(iter, &value);
|
||||
ffStrbufAppendC(result, (char) value);
|
||||
return false; // Don't append a comma
|
||||
}
|
||||
|
||||
if(argType != DBUS_TYPE_VARIANT && argType != DBUS_TYPE_ARRAY)
|
||||
return false;
|
||||
|
||||
@@ -79,7 +82,7 @@ bool ffDBusGetValue(FFDBusData* dbus, DBusMessageIter* iter, FFstrbuf* result)
|
||||
dbus->lib->ffdbus_message_iter_recurse(iter, &subIter);
|
||||
|
||||
if(argType == DBUS_TYPE_VARIANT)
|
||||
return ffDBusGetValue(dbus, &subIter, result);
|
||||
return ffDBusGetString(dbus, &subIter, result);
|
||||
|
||||
//At this point we have an array
|
||||
|
||||
@@ -87,13 +90,16 @@ bool ffDBusGetValue(FFDBusData* dbus, DBusMessageIter* iter, FFstrbuf* result)
|
||||
|
||||
while(true)
|
||||
{
|
||||
if(ffDBusGetValue(dbus, &subIter, result))
|
||||
if(ffDBusGetString(dbus, &subIter, result))
|
||||
{
|
||||
foundAValue = true;
|
||||
ffStrbufAppendS(result, ", ");
|
||||
}
|
||||
|
||||
FF_DBUS_ITER_CONTINUE(dbus, &subIter);
|
||||
if(!dbus->lib->ffdbus_message_iter_next(&subIter))
|
||||
break;
|
||||
else
|
||||
continue;
|
||||
}
|
||||
|
||||
if(foundAValue)
|
||||
@@ -122,11 +128,27 @@ bool ffDBusGetBool(FFDBusData* dbus, DBusMessageIter* iter, bool* result)
|
||||
return ffDBusGetBool(dbus, &subIter, result);
|
||||
}
|
||||
|
||||
bool ffDBusGetByte(FFDBusData* dbus, DBusMessageIter* iter, uint8_t* result)
|
||||
bool ffDBusGetUint(FFDBusData* dbus, DBusMessageIter* iter, uint32_t* result)
|
||||
{
|
||||
int argType = dbus->lib->ffdbus_message_iter_get_arg_type(iter);
|
||||
|
||||
if(argType == DBUS_TYPE_BYTE)
|
||||
{
|
||||
uint8_t value = 0;
|
||||
dbus->lib->ffdbus_message_iter_get_basic(iter, &value);
|
||||
*result = value;
|
||||
return true;
|
||||
}
|
||||
|
||||
if(argType == DBUS_TYPE_UINT16)
|
||||
{
|
||||
uint16_t value = 0;
|
||||
dbus->lib->ffdbus_message_iter_get_basic(iter, &value);
|
||||
*result = value;
|
||||
return true;
|
||||
}
|
||||
|
||||
if(argType == DBUS_TYPE_UINT32)
|
||||
{
|
||||
dbus->lib->ffdbus_message_iter_get_basic(iter, result);
|
||||
return true;
|
||||
@@ -137,15 +159,18 @@ bool ffDBusGetByte(FFDBusData* dbus, DBusMessageIter* iter, uint8_t* result)
|
||||
|
||||
DBusMessageIter subIter;
|
||||
dbus->lib->ffdbus_message_iter_recurse(iter, &subIter);
|
||||
return ffDBusGetByte(dbus, &subIter, result);
|
||||
return ffDBusGetUint(dbus, &subIter, result);
|
||||
}
|
||||
|
||||
DBusMessage* ffDBusGetMethodReply(FFDBusData* dbus, const char* busName, const char* objectPath, const char* interface, const char* method)
|
||||
DBusMessage* ffDBusGetMethodReply(FFDBusData* dbus, const char* busName, const char* objectPath, const char* interface, const char* method, const char* arg)
|
||||
{
|
||||
DBusMessage* message = dbus->lib->ffdbus_message_new_method_call(busName, objectPath, interface, method);
|
||||
if(message == NULL)
|
||||
return NULL;
|
||||
|
||||
if (arg)
|
||||
dbus->lib->ffdbus_message_append_args(message, DBUS_TYPE_STRING, &arg, DBUS_TYPE_INVALID);
|
||||
|
||||
DBusMessage* reply = dbus->lib->ffdbus_connection_send_with_reply_and_block(dbus->connection, message, FF_DBUS_TIMEOUT_MILLISECONDS, NULL);
|
||||
|
||||
dbus->lib->ffdbus_message_unref(message);
|
||||
@@ -159,20 +184,10 @@ DBusMessage* ffDBusGetProperty(FFDBusData* dbus, const char* busName, const char
|
||||
if(message == NULL)
|
||||
return NULL;
|
||||
|
||||
DBusMessageIter requestIterator;
|
||||
dbus->lib->ffdbus_message_iter_init_append(message, &requestIterator);
|
||||
|
||||
if(!dbus->lib->ffdbus_message_iter_append_basic(&requestIterator, DBUS_TYPE_STRING, &interface))
|
||||
{
|
||||
dbus->lib->ffdbus_message_unref(message);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if(!dbus->lib->ffdbus_message_iter_append_basic(&requestIterator, DBUS_TYPE_STRING, &property))
|
||||
{
|
||||
dbus->lib->ffdbus_message_unref(message);
|
||||
return NULL;
|
||||
}
|
||||
dbus->lib->ffdbus_message_append_args(message,
|
||||
DBUS_TYPE_STRING, &interface,
|
||||
DBUS_TYPE_STRING, &property,
|
||||
DBUS_TYPE_INVALID);
|
||||
|
||||
DBusMessage* reply = dbus->lib->ffdbus_connection_send_with_reply_and_block(dbus->connection, message, FF_DBUS_TIMEOUT_MILLISECONDS, NULL);
|
||||
|
||||
@@ -194,7 +209,27 @@ bool ffDBusGetPropertyString(FFDBusData* dbus, const char* busName, const char*
|
||||
return false;
|
||||
}
|
||||
|
||||
bool ret = ffDBusGetValue(dbus, &rootIterator, result);
|
||||
bool ret = ffDBusGetString(dbus, &rootIterator, result);
|
||||
|
||||
dbus->lib->ffdbus_message_unref(reply);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
bool ffDBusGetPropertyUint(FFDBusData* dbus, const char* busName, const char* objectPath, const char* interface, const char* property, uint32_t* result)
|
||||
{
|
||||
DBusMessage* reply = ffDBusGetProperty(dbus, busName, objectPath, interface, property);
|
||||
if(reply == NULL)
|
||||
return false;
|
||||
|
||||
DBusMessageIter rootIterator;
|
||||
if(!dbus->lib->ffdbus_message_iter_init(reply, &rootIterator))
|
||||
{
|
||||
dbus->lib->ffdbus_message_unref(reply);
|
||||
return false;
|
||||
}
|
||||
|
||||
bool ret = ffDBusGetUint(dbus, &rootIterator, result);
|
||||
|
||||
dbus->lib->ffdbus_message_unref(reply);
|
||||
|
||||
|
||||
+6
-18
@@ -6,23 +6,14 @@
|
||||
#include "util/FFstrbuf.h"
|
||||
#include "common/library.h"
|
||||
|
||||
#define FF_DBUS_TIMEOUT_MILLISECONDS 35
|
||||
|
||||
#define FF_DBUS_ITER_CONTINUE(dbus, iterator) \
|
||||
{ \
|
||||
if(!(dbus)->lib->ffdbus_message_iter_has_next(iterator)) \
|
||||
break; \
|
||||
(dbus)->lib->ffdbus_message_iter_next(iterator); \
|
||||
continue; \
|
||||
}
|
||||
#define FF_DBUS_TIMEOUT_MILLISECONDS 100
|
||||
|
||||
typedef struct FFDBusLibrary
|
||||
{
|
||||
FF_LIBRARY_SYMBOL(dbus_bus_get)
|
||||
FF_LIBRARY_SYMBOL(dbus_message_new_method_call)
|
||||
FF_LIBRARY_SYMBOL(dbus_message_append_args)
|
||||
FF_LIBRARY_SYMBOL(dbus_message_iter_init)
|
||||
FF_LIBRARY_SYMBOL(dbus_message_iter_init_append)
|
||||
FF_LIBRARY_SYMBOL(dbus_message_iter_append_basic)
|
||||
FF_LIBRARY_SYMBOL(dbus_message_iter_get_arg_type)
|
||||
FF_LIBRARY_SYMBOL(dbus_message_iter_get_basic)
|
||||
FF_LIBRARY_SYMBOL(dbus_message_iter_recurse)
|
||||
@@ -30,10 +21,6 @@ typedef struct FFDBusLibrary
|
||||
FF_LIBRARY_SYMBOL(dbus_message_iter_next)
|
||||
FF_LIBRARY_SYMBOL(dbus_message_unref)
|
||||
FF_LIBRARY_SYMBOL(dbus_connection_send_with_reply_and_block)
|
||||
FF_LIBRARY_SYMBOL(dbus_connection_flush)
|
||||
FF_LIBRARY_SYMBOL(dbus_pending_call_block)
|
||||
FF_LIBRARY_SYMBOL(dbus_pending_call_steal_reply)
|
||||
FF_LIBRARY_SYMBOL(dbus_pending_call_unref)
|
||||
} FFDBusLibrary;
|
||||
|
||||
typedef struct FFDBusData
|
||||
@@ -43,11 +30,12 @@ typedef struct FFDBusData
|
||||
} FFDBusData;
|
||||
|
||||
const char* ffDBusLoadData(DBusBusType busType, FFDBusData* data); //Returns an error message or NULL on success
|
||||
bool ffDBusGetValue(FFDBusData* dbus, DBusMessageIter* iter, FFstrbuf* result);
|
||||
bool ffDBusGetString(FFDBusData* dbus, DBusMessageIter* iter, FFstrbuf* result);
|
||||
bool ffDBusGetBool(FFDBusData* dbus, DBusMessageIter* iter, bool* result);
|
||||
bool ffDBusGetByte(FFDBusData* dbus, DBusMessageIter* iter, uint8_t* result);
|
||||
DBusMessage* ffDBusGetMethodReply(FFDBusData* dbus, const char* busName, const char* objectPath, const char* interface, const char* method);
|
||||
bool ffDBusGetUint(FFDBusData* dbus, DBusMessageIter* iter, uint32_t* result);
|
||||
DBusMessage* ffDBusGetMethodReply(FFDBusData* dbus, const char* busName, const char* objectPath, const char* interface, const char* method, const char* arg);
|
||||
DBusMessage* ffDBusGetProperty(FFDBusData* dbus, const char* busName, const char* objectPath, const char* interface, const char* property);
|
||||
bool ffDBusGetPropertyString(FFDBusData* dbus, const char* busName, const char* objectPath, const char* interface, const char* property, FFstrbuf* result);
|
||||
bool ffDBusGetPropertyUint(FFDBusData* dbus, const char* busName, const char* objectPath, const char* interface, const char* property, uint32_t* result);
|
||||
|
||||
#endif // FF_HAVE_DBUS
|
||||
|
||||
+136
-81
@@ -52,14 +52,33 @@ void ffFormatAppendFormatArg(FFstrbuf* buffer, const FFformatarg* formatarg)
|
||||
* @param placeholderValue the string to parse
|
||||
* @return uint32_t the parsed value
|
||||
*/
|
||||
static inline uint32_t getArgumentIndex(const FFstrbuf* placeholderValue)
|
||||
static uint32_t getArgumentIndex(const char* placeholderValue, uint32_t numArgs, const FFformatarg* arguments)
|
||||
{
|
||||
uint32_t result = UINT32_MAX;
|
||||
char firstChar = placeholderValue[0];
|
||||
if (firstChar == '\0')
|
||||
return 0; // use arg counter
|
||||
|
||||
if(placeholderValue->chars[0] != '-')
|
||||
sscanf(placeholderValue->chars, "%" PRIu32, &result);
|
||||
if (firstChar >= '0' && firstChar <= '9')
|
||||
{
|
||||
char* pEnd = NULL;
|
||||
uint32_t result = (uint32_t) strtoul(placeholderValue, &pEnd, 10);
|
||||
if (result > numArgs)
|
||||
return UINT32_MAX;
|
||||
if (*pEnd != '\0')
|
||||
return UINT32_MAX;
|
||||
return result;
|
||||
}
|
||||
else if (ffCharIsEnglishAlphabet(firstChar))
|
||||
{
|
||||
for (uint32_t i = 0; i < numArgs; ++i)
|
||||
{
|
||||
const FFformatarg* arg = &arguments[i];
|
||||
if (arg->name && strcasecmp(placeholderValue, arg->name) == 0)
|
||||
return i + 1;
|
||||
}
|
||||
}
|
||||
|
||||
return result == 0 ? UINT32_MAX : result;
|
||||
return UINT32_MAX;
|
||||
}
|
||||
|
||||
static inline void appendInvalidPlaceholder(FFstrbuf* buffer, const char* start, const FFstrbuf* placeholderValue, uint32_t index, uint32_t formatStringLength)
|
||||
@@ -71,16 +90,6 @@ static inline void appendInvalidPlaceholder(FFstrbuf* buffer, const char* start,
|
||||
ffStrbufAppendC(buffer, '}');
|
||||
}
|
||||
|
||||
static inline void appendEmptyPlaceholder(FFstrbuf* buffer, const char* placeholder, uint32_t* argCounter, uint32_t numArgs, const FFformatarg* arguments)
|
||||
{
|
||||
if(*argCounter >= numArgs)
|
||||
ffStrbufAppendS(buffer, placeholder);
|
||||
else
|
||||
ffFormatAppendFormatArg(buffer, arguments + *argCounter);
|
||||
|
||||
(*argCounter)++;
|
||||
}
|
||||
|
||||
static inline bool formatArgSet(const FFformatarg* arg)
|
||||
{
|
||||
return arg->value != NULL && (
|
||||
@@ -101,7 +110,8 @@ void ffParseFormatString(FFstrbuf* buffer, const FFstrbuf* formatstr, uint32_t n
|
||||
|
||||
uint32_t numOpenIfs = 0;
|
||||
uint32_t numOpenNotIfs = 0;
|
||||
uint32_t numOpenColors = 0;
|
||||
|
||||
FF_STRBUF_AUTO_DESTROY placeholderValue = ffStrbufCreate();
|
||||
|
||||
for(uint32_t i = 0; i < formatstr->length; ++i)
|
||||
{
|
||||
@@ -112,13 +122,6 @@ void ffParseFormatString(FFstrbuf* buffer, const FFstrbuf* formatstr, uint32_t n
|
||||
continue;
|
||||
}
|
||||
|
||||
// if we have an { at the end handle it as {}
|
||||
if(i == formatstr->length - 1)
|
||||
{
|
||||
appendEmptyPlaceholder(buffer, "{", &argCounter, numArgs, arguments);
|
||||
continue;
|
||||
}
|
||||
|
||||
// jump to next char, the start of the placeholder value
|
||||
++i;
|
||||
|
||||
@@ -129,74 +132,70 @@ void ffParseFormatString(FFstrbuf* buffer, const FFstrbuf* formatstr, uint32_t n
|
||||
continue;
|
||||
}
|
||||
|
||||
// placeholder is {}
|
||||
if(formatstr->chars[i] == '}')
|
||||
ffStrbufClear(&placeholderValue);
|
||||
|
||||
{
|
||||
appendEmptyPlaceholder(buffer, "{}", &argCounter, numArgs, arguments);
|
||||
continue;
|
||||
uint32_t iEnd = ffStrbufNextIndexC(formatstr, i, '}');
|
||||
ffStrbufAppendNS(&placeholderValue, iEnd - i, &formatstr->chars[i]);
|
||||
i = iEnd;
|
||||
}
|
||||
|
||||
FF_STRBUF_AUTO_DESTROY placeholderValue = ffStrbufCreate();
|
||||
char firstChar = placeholderValue.chars[0];
|
||||
|
||||
while(i < formatstr->length && formatstr->chars[i] != '}')
|
||||
ffStrbufAppendC(&placeholderValue, formatstr->chars[i++]);
|
||||
|
||||
// test if for stop, if so break the loop
|
||||
if(placeholderValue.length == 1 && placeholderValue.chars[0] == '-')
|
||||
break;
|
||||
|
||||
// test for end of an if, if so do nothing
|
||||
if(placeholderValue.length == 1 && placeholderValue.chars[0] == '?')
|
||||
if (placeholderValue.length == 1)
|
||||
{
|
||||
if(numOpenIfs == 0)
|
||||
appendInvalidPlaceholder(buffer, "{", &placeholderValue, i, formatstr->length);
|
||||
else
|
||||
--numOpenIfs;
|
||||
// test if for stop, if so break the loop
|
||||
if (firstChar == '-')
|
||||
break;
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
// test for end of a not if, if so do nothing
|
||||
if(placeholderValue.length == 1 && placeholderValue.chars[0] == '/')
|
||||
{
|
||||
if(numOpenNotIfs == 0)
|
||||
appendInvalidPlaceholder(buffer, "{", &placeholderValue, i, formatstr->length);
|
||||
else
|
||||
--numOpenNotIfs;
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
// test for end of a color, if so do nothing
|
||||
if(placeholderValue.length == 1 && placeholderValue.chars[0] == '#')
|
||||
{
|
||||
if(numOpenColors == 0)
|
||||
appendInvalidPlaceholder(buffer, "{", &placeholderValue, i, formatstr->length);
|
||||
else
|
||||
// test for end of an if, if so do nothing
|
||||
if (firstChar == '?')
|
||||
{
|
||||
ffStrbufAppendS(buffer, FASTFETCH_TEXT_MODIFIER_RESET);
|
||||
--numOpenColors;
|
||||
if(numOpenIfs == 0)
|
||||
appendInvalidPlaceholder(buffer, "{", &placeholderValue, i, formatstr->length);
|
||||
else
|
||||
--numOpenIfs;
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
continue;
|
||||
// test for end of a not if, if so do nothing
|
||||
if (firstChar == '/')
|
||||
{
|
||||
if(numOpenNotIfs == 0)
|
||||
appendInvalidPlaceholder(buffer, "{", &placeholderValue, i, formatstr->length);
|
||||
else
|
||||
--numOpenNotIfs;
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
// test for end of a color, if so do nothing
|
||||
if (firstChar == '#')
|
||||
{
|
||||
if (!instance.config.display.pipe)
|
||||
ffStrbufAppendS(buffer, FASTFETCH_TEXT_MODIFIER_RESET);
|
||||
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
// test for if, if so evaluate it
|
||||
if(placeholderValue.chars[0] == '?')
|
||||
if (firstChar == '?')
|
||||
{
|
||||
ffStrbufSubstrAfter(&placeholderValue, 0);
|
||||
|
||||
uint32_t index = getArgumentIndex(&placeholderValue);
|
||||
uint32_t index = getArgumentIndex(placeholderValue.chars, numArgs, arguments);
|
||||
|
||||
// testing for an invalid index
|
||||
if(index > numArgs)
|
||||
if (index > numArgs)
|
||||
{
|
||||
appendInvalidPlaceholder(buffer, "{?", &placeholderValue, i, formatstr->length);
|
||||
continue;
|
||||
}
|
||||
|
||||
// continue normally if an format arg is set and the value is > 0
|
||||
if(formatArgSet(&arguments[index - 1]))
|
||||
if (formatArgSet(&arguments[index - 1]))
|
||||
{
|
||||
++numOpenIfs;
|
||||
continue;
|
||||
@@ -208,21 +207,21 @@ void ffParseFormatString(FFstrbuf* buffer, const FFstrbuf* formatstr, uint32_t n
|
||||
}
|
||||
|
||||
// test for not if, if so evaluate it
|
||||
if(placeholderValue.chars[0] == '/')
|
||||
if (firstChar == '/')
|
||||
{
|
||||
ffStrbufSubstrAfter(&placeholderValue, 0);
|
||||
|
||||
uint32_t index = getArgumentIndex(&placeholderValue);
|
||||
uint32_t index = getArgumentIndex(placeholderValue.chars, numArgs, arguments);
|
||||
|
||||
// testing for an invalid index
|
||||
if(index > numArgs)
|
||||
if (index > numArgs)
|
||||
{
|
||||
appendInvalidPlaceholder(buffer, "{/", &placeholderValue, i, formatstr->length);
|
||||
continue;
|
||||
}
|
||||
|
||||
//continue normally if an format arg is not set or the value is 0
|
||||
if(!formatArgSet(&arguments[index - 1]))
|
||||
if (!formatArgSet(&arguments[index - 1]))
|
||||
{
|
||||
++numOpenNotIfs;
|
||||
continue;
|
||||
@@ -234,27 +233,83 @@ void ffParseFormatString(FFstrbuf* buffer, const FFstrbuf* formatstr, uint32_t n
|
||||
}
|
||||
|
||||
//test for color, if so evaluate it
|
||||
if(placeholderValue.chars[0] == '#')
|
||||
if (firstChar == '#')
|
||||
{
|
||||
++numOpenColors;
|
||||
ffStrbufSubstrAfter(&placeholderValue, 0);
|
||||
ffStrbufAppendS(buffer, "\033[");
|
||||
ffStrbufAppend(buffer, &placeholderValue);
|
||||
ffStrbufAppendC(buffer, 'm');
|
||||
if (!instance.config.display.pipe)
|
||||
{
|
||||
ffStrbufAppendS(buffer, "\e[");
|
||||
ffOptionParseColorNoClear(placeholderValue.chars + 1, buffer);
|
||||
ffStrbufAppendC(buffer, 'm');
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
uint32_t index = getArgumentIndex(&placeholderValue);
|
||||
//test for constant, if so evaluate it
|
||||
if (firstChar == '$')
|
||||
{
|
||||
char* pend = NULL;
|
||||
int32_t indexSigned = (int32_t) strtol(placeholderValue.chars + 1, &pend, 10);
|
||||
uint32_t index = (uint32_t) indexSigned;
|
||||
bool backward = indexSigned < 0;
|
||||
|
||||
if (indexSigned == 0 || *pend != '\0' || instance.config.display.constants.length < index)
|
||||
{
|
||||
appendInvalidPlaceholder(buffer, "{", &placeholderValue, i, formatstr->length);
|
||||
continue;
|
||||
}
|
||||
|
||||
FFstrbuf* item = FF_LIST_GET(FFstrbuf, instance.config.display.constants, backward
|
||||
? instance.config.display.constants.length - index
|
||||
: index - 1);
|
||||
ffStrbufAppend(buffer, item);
|
||||
continue;
|
||||
}
|
||||
|
||||
int32_t truncLength = INT32_MAX;
|
||||
char* pColon = memchr(placeholderValue.chars, ':', placeholderValue.length);
|
||||
if (pColon != NULL)
|
||||
{
|
||||
char* pEnd = NULL;
|
||||
truncLength = (int32_t) strtol(pColon + 1, &pEnd, 10);
|
||||
if (*pEnd != '\0')
|
||||
{
|
||||
appendInvalidPlaceholder(buffer, "{", &placeholderValue, i, formatstr->length);
|
||||
continue;
|
||||
}
|
||||
*pColon = '\0';
|
||||
}
|
||||
|
||||
uint32_t index = getArgumentIndex(placeholderValue.chars, numArgs, arguments);
|
||||
|
||||
// test for invalid index
|
||||
if(index > numArgs)
|
||||
if (index == 0)
|
||||
index = ++argCounter;
|
||||
|
||||
if (index > numArgs)
|
||||
{
|
||||
if (pColon) *pColon = ':';
|
||||
appendInvalidPlaceholder(buffer, "{", &placeholderValue, i, formatstr->length);
|
||||
continue;
|
||||
}
|
||||
|
||||
bool ellipsis = false;
|
||||
if (truncLength < 0)
|
||||
{
|
||||
ellipsis = true;
|
||||
truncLength = -truncLength;
|
||||
}
|
||||
|
||||
uint32_t oldLength = buffer->length;
|
||||
ffFormatAppendFormatArg(buffer, &arguments[index - 1]);
|
||||
if (buffer->length - oldLength > (uint32_t) truncLength)
|
||||
{
|
||||
ffStrbufSubstrBefore(buffer, oldLength + (uint32_t) truncLength);
|
||||
ffStrbufTrimRightSpace(buffer);
|
||||
if (ellipsis)
|
||||
ffStrbufAppendS(buffer, "…");
|
||||
}
|
||||
}
|
||||
|
||||
ffStrbufAppendS(buffer, FASTFETCH_TEXT_MODIFIER_RESET);
|
||||
if (!instance.config.display.pipe)
|
||||
ffStrbufAppendS(buffer, FASTFETCH_TEXT_MODIFIER_RESET);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "util/FFstrbuf.h"
|
||||
|
||||
typedef enum FFformatargtype
|
||||
{
|
||||
FF_FORMAT_ARG_TYPE_NULL = 0,
|
||||
@@ -20,6 +22,7 @@ typedef struct FFformatarg
|
||||
{
|
||||
FFformatargtype type;
|
||||
const void* value;
|
||||
const char* name; // argument name, must start with an alphabet
|
||||
} FFformatarg;
|
||||
|
||||
void ffFormatAppendFormatArg(FFstrbuf* buffer, const FFformatarg* formatarg);
|
||||
|
||||
+47
-37
@@ -2,6 +2,7 @@
|
||||
#include "common/parsing.h"
|
||||
#include "common/thread.h"
|
||||
#include "detection/displayserver/displayserver.h"
|
||||
#include "detection/terminaltheme/terminaltheme.h"
|
||||
#include "util/textModifier.h"
|
||||
#include "logo/logo.h"
|
||||
|
||||
@@ -22,10 +23,18 @@ static void initState(FFstate* state)
|
||||
state->logoWidth = 0;
|
||||
state->logoHeight = 0;
|
||||
state->keysHeight = 0;
|
||||
state->terminalLightTheme = false;
|
||||
|
||||
ffPlatformInit(&state->platform);
|
||||
state->configDoc = NULL;
|
||||
state->resultDoc = NULL;
|
||||
|
||||
{
|
||||
// don't enable bright color if the terminal is in light mode
|
||||
FFTerminalThemeResult result;
|
||||
if (ffDetectTerminalTheme(&result, true /* forceEnv for performance */) && !result.bg.dark)
|
||||
state->terminalLightTheme = true;
|
||||
}
|
||||
}
|
||||
|
||||
static void defaultConfig(void)
|
||||
@@ -43,8 +52,12 @@ void ffInitInstance(void)
|
||||
//https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/setlocale-wsetlocale?source=recommendations&view=msvc-170#utf-8-support
|
||||
setlocale(LC_ALL, ".UTF8");
|
||||
#else
|
||||
// used for mbsrtowcs in Module `separator`
|
||||
setlocale(LC_ALL, "");
|
||||
// Never use `setlocale(LC_ALL, "")`
|
||||
setlocale(LC_TIME, "");
|
||||
setlocale(LC_NUMERIC, "");
|
||||
#ifdef LC_MESSAGES
|
||||
setlocale(LC_MESSAGES, "");
|
||||
#endif
|
||||
#endif
|
||||
|
||||
initState(&instance.state);
|
||||
@@ -160,97 +173,94 @@ void ffDestroyInstance(void)
|
||||
void ffListFeatures(void)
|
||||
{
|
||||
fputs(
|
||||
#ifdef FF_HAVE_THREADS
|
||||
#if FF_HAVE_THREADS
|
||||
"threads\n"
|
||||
#endif
|
||||
#ifdef FF_HAVE_VULKAN
|
||||
#if FF_HAVE_VULKAN
|
||||
"vulkan\n"
|
||||
#endif
|
||||
#ifdef FF_HAVE_WAYLAND
|
||||
#if FF_HAVE_WAYLAND
|
||||
"wayland\n"
|
||||
#endif
|
||||
#ifdef FF_HAVE_XCB_RANDR
|
||||
#if FF_HAVE_XCB_RANDR
|
||||
"xcb-randr\n"
|
||||
#endif
|
||||
#ifdef FF_HAVE_XCB
|
||||
#if FF_HAVE_XCB
|
||||
"xcb\n"
|
||||
#endif
|
||||
#ifdef FF_HAVE_XRANDR
|
||||
#if FF_HAVE_XRANDR
|
||||
"xrandr\n"
|
||||
#endif
|
||||
#ifdef FF_HAVE_X11
|
||||
#if FF_HAVE_X11
|
||||
"x11\n"
|
||||
#endif
|
||||
#ifdef FF_HAVE_DRM
|
||||
#if FF_HAVE_DRM
|
||||
"drm\n"
|
||||
#endif
|
||||
#ifdef FF_HAVE_GIO
|
||||
#if FF_HAVE_GIO
|
||||
"gio\n"
|
||||
#endif
|
||||
#ifdef FF_HAVE_DCONF
|
||||
#if FF_HAVE_DCONF
|
||||
"dconf\n"
|
||||
#endif
|
||||
#ifdef FF_HAVE_DBUS
|
||||
#if FF_HAVE_DBUS
|
||||
"dbus\n"
|
||||
#endif
|
||||
#ifdef FF_HAVE_IMAGEMAGICK7
|
||||
#if FF_HAVE_IMAGEMAGICK7
|
||||
"imagemagick7\n"
|
||||
#endif
|
||||
#ifdef FF_HAVE_IMAGEMAGICK6
|
||||
#if FF_HAVE_IMAGEMAGICK6
|
||||
"imagemagick6\n"
|
||||
#endif
|
||||
#ifdef FF_HAVE_CHAFA
|
||||
#if FF_HAVE_CHAFA
|
||||
"chafa\n"
|
||||
#endif
|
||||
#ifdef FF_HAVE_ZLIB
|
||||
#if FF_HAVE_ZLIB
|
||||
"zlib\n"
|
||||
#endif
|
||||
#ifdef FF_HAVE_XFCONF
|
||||
#if FF_HAVE_XFCONF
|
||||
"xfconf\n"
|
||||
#endif
|
||||
#ifdef FF_HAVE_SQLITE3
|
||||
#if FF_HAVE_SQLITE3
|
||||
"sqlite3\n"
|
||||
#endif
|
||||
#ifdef FF_HAVE_RPM
|
||||
#if FF_HAVE_RPM
|
||||
"rpm\n"
|
||||
#endif
|
||||
#ifdef FF_HAVE_EGL
|
||||
#if FF_HAVE_EGL
|
||||
"egl\n"
|
||||
#endif
|
||||
#ifdef FF_HAVE_GLX
|
||||
#if FF_HAVE_GLX
|
||||
"glx\n"
|
||||
#endif
|
||||
#ifdef FF_HAVE_OSMESA
|
||||
#if FF_HAVE_OSMESA
|
||||
"osmesa\n"
|
||||
#endif
|
||||
#ifdef FF_HAVE_OPENCL
|
||||
#if FF_HAVE_OPENCL
|
||||
"opencl\n"
|
||||
#endif
|
||||
#ifdef FF_HAVE_FREETYPE
|
||||
#if FF_HAVE_FREETYPE
|
||||
"freetype\n"
|
||||
#endif
|
||||
#ifdef FF_HAVE_PULSE
|
||||
#if FF_HAVE_PULSE
|
||||
"libpulse\n"
|
||||
#endif
|
||||
#ifdef FF_HAVE_LIBNM
|
||||
"libnm\n"
|
||||
#endif
|
||||
#ifdef FF_HAVE_DDCUTIL
|
||||
#if FF_HAVE_DDCUTIL
|
||||
"libddcutil\n"
|
||||
#endif
|
||||
#ifdef FF_HAVE_DIRECTX_HEADERS
|
||||
#if FF_HAVE_ELF
|
||||
"libelf\n"
|
||||
#endif
|
||||
#if FF_HAVE_DIRECTX_HEADERS
|
||||
"Directx Headers\n"
|
||||
#endif
|
||||
#ifdef FF_USE_PROPRIETARY_GPU_DRIVER_API
|
||||
"Proprietary GPU driver API\n"
|
||||
#endif
|
||||
#ifdef FF_USE_SYSTEM_YYJSON
|
||||
#if FF_USE_SYSTEM_YYJSON
|
||||
"System yyjson\n"
|
||||
#endif
|
||||
#if __has_include(<linux/videodev2.h>)
|
||||
#if FF_HAVE_LINUX_VIDEODEV2
|
||||
"linux/videodev2\n"
|
||||
#endif
|
||||
#if __has_include(<linux/wireless.h>)
|
||||
#if FF_HAVE_LINUX_WIRELESS
|
||||
"linux/wireless\n"
|
||||
#endif
|
||||
""
|
||||
|
||||
+18
-8
@@ -8,11 +8,13 @@
|
||||
#include <handleapi.h>
|
||||
#include <io.h>
|
||||
typedef HANDLE FFNativeFD;
|
||||
#define FF_INVALID_FD INVALID_HANDLE_VALUE
|
||||
#else
|
||||
#include <unistd.h>
|
||||
#include <dirent.h>
|
||||
#include <sys/stat.h>
|
||||
typedef int FFNativeFD;
|
||||
#define FF_INVALID_FD (-1)
|
||||
// procfs's file can be changed between read calls such as /proc/meminfo and /proc/uptime.
|
||||
// one safe way to read correct data is reading the whole file in a single read syscall
|
||||
// 8192 comes from procps-ng: https://gitlab.com/procps-ng/procps/-/blob/master/library/meminfo.c?ref_type=heads#L39
|
||||
@@ -99,17 +101,25 @@ static inline bool ffPathExists(const char* path, FFPathType pathType)
|
||||
|
||||
#else
|
||||
|
||||
struct stat fileStat;
|
||||
if(stat(path, &fileStat) != 0)
|
||||
return false;
|
||||
if (pathType == FF_PATHTYPE_ANY)
|
||||
{
|
||||
// Zero overhead
|
||||
return access(path, F_OK) == 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
struct stat fileStat;
|
||||
if(stat(path, &fileStat) != 0)
|
||||
return false;
|
||||
|
||||
unsigned int mode = fileStat.st_mode & S_IFMT;
|
||||
unsigned int mode = fileStat.st_mode & S_IFMT;
|
||||
|
||||
if(pathType & FF_PATHTYPE_FILE && mode != S_IFDIR)
|
||||
return true;
|
||||
if(pathType & FF_PATHTYPE_FILE && mode != S_IFDIR)
|
||||
return true;
|
||||
|
||||
if(pathType & FF_PATHTYPE_DIRECTORY && mode == S_IFDIR)
|
||||
return true;
|
||||
if(pathType & FF_PATHTYPE_DIRECTORY && mode == S_IFDIR)
|
||||
return true;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
+52
-27
@@ -8,8 +8,10 @@
|
||||
#include <dirent.h>
|
||||
#include <errno.h>
|
||||
|
||||
#if __has_include(<wordexp.h>)
|
||||
#include <wordexp.h>
|
||||
#if FF_HAVE_WORDEXP
|
||||
#include <wordexp.h>
|
||||
#else
|
||||
#warning "<wordexp.h> not available"
|
||||
#endif
|
||||
|
||||
static void createSubfolders(const char* fileName)
|
||||
@@ -112,7 +114,7 @@ bool ffPathExpandEnv(FF_MAYBE_UNUSED const char* in, FF_MAYBE_UNUSED FFstrbuf* o
|
||||
{
|
||||
bool result = false;
|
||||
|
||||
#if __has_include(<wordexp.h>) // https://github.com/termux/termux-packages/pull/7056
|
||||
#if FF_HAVE_WORDEXP // https://github.com/termux/termux-packages/pull/7056
|
||||
|
||||
wordexp_t exp;
|
||||
if(wordexp(in, &exp, 0) != 0)
|
||||
@@ -131,34 +133,39 @@ bool ffPathExpandEnv(FF_MAYBE_UNUSED const char* in, FF_MAYBE_UNUSED FFstrbuf* o
|
||||
return result;
|
||||
}
|
||||
|
||||
static int ftty = -1;
|
||||
static struct termios oldTerm;
|
||||
void restoreTerm(void)
|
||||
{
|
||||
tcsetattr(ftty, TCSAFLUSH, &oldTerm);
|
||||
}
|
||||
|
||||
const char* ffGetTerminalResponse(const char* request, const char* format, ...)
|
||||
{
|
||||
if (instance.config.display.pipe)
|
||||
return "Not supported in --pipe mode";
|
||||
|
||||
struct termios oldTerm, newTerm;
|
||||
if(tcgetattr(STDIN_FILENO, &oldTerm) == -1)
|
||||
return "tcgetattr(STDIN_FILENO, &oldTerm) failed";
|
||||
|
||||
newTerm = oldTerm;
|
||||
newTerm.c_lflag &= (tcflag_t) ~(ICANON | ECHO);
|
||||
if(tcsetattr(STDIN_FILENO, TCSANOW, &newTerm) == -1)
|
||||
return "tcsetattr(STDIN_FILENO, TCSANOW, &newTerm)";
|
||||
|
||||
fputs(request, stdout);
|
||||
fflush(stdout);
|
||||
|
||||
//Give the terminal 35ms to respond
|
||||
if(poll(&(struct pollfd) { .fd = STDIN_FILENO, .events = POLLIN }, 1, FF_IO_TERM_RESP_WAIT_MS) <= 0)
|
||||
if (ftty < 0)
|
||||
{
|
||||
tcsetattr(STDIN_FILENO, TCSANOW, &oldTerm);
|
||||
return "poll() timeout or failed";
|
||||
ftty = open("/dev/tty", O_RDWR | O_NOCTTY | O_CLOEXEC);
|
||||
if (ftty < 0)
|
||||
return "open(\"/dev/tty\", O_RDWR | O_NOCTTY | O_CLOEXEC) failed";
|
||||
|
||||
if(tcgetattr(ftty, &oldTerm) == -1)
|
||||
return "tcgetattr(STDIN_FILENO, &oldTerm) failed";
|
||||
|
||||
struct termios newTerm = oldTerm;
|
||||
newTerm.c_lflag &= (tcflag_t) ~(ICANON | ECHO);
|
||||
if(tcsetattr(ftty, TCSAFLUSH, &newTerm) == -1)
|
||||
return "tcsetattr(STDIN_FILENO, TCSAFLUSH, &newTerm)";
|
||||
atexit(restoreTerm);
|
||||
}
|
||||
|
||||
char buffer[512];
|
||||
ssize_t bytesRead = read(STDIN_FILENO, buffer, sizeof(buffer) - 1);
|
||||
ffWriteFDData(ftty, strlen(request), request);
|
||||
|
||||
tcsetattr(STDIN_FILENO, TCSANOW, &oldTerm);
|
||||
//Give the terminal some time to respond
|
||||
if(poll(&(struct pollfd) { .fd = ftty, .events = POLLIN }, 1, FF_IO_TERM_RESP_WAIT_MS) <= 0)
|
||||
return "poll() timeout or failed";
|
||||
|
||||
char buffer[512];
|
||||
ssize_t bytesRead = read(ftty, buffer, sizeof(buffer) - 1);
|
||||
|
||||
if(bytesRead <= 0)
|
||||
return "read(STDIN_FILENO, buffer, sizeof(buffer) - 1) failed";
|
||||
@@ -204,7 +211,11 @@ bool ffSuppressIO(bool suppress)
|
||||
|
||||
void listFilesRecursively(uint32_t baseLength, FFstrbuf* folder, uint8_t indentation, const char* folderName, bool pretty)
|
||||
{
|
||||
DIR* dir = opendir(folder->chars);
|
||||
FF_AUTO_CLOSE_FD int dfd = open(folder->chars, O_RDONLY);
|
||||
if (dfd < 0)
|
||||
return;
|
||||
|
||||
DIR* dir = fdopendir(dfd);
|
||||
if(dir == NULL)
|
||||
return;
|
||||
|
||||
@@ -221,7 +232,21 @@ void listFilesRecursively(uint32_t baseLength, FFstrbuf* folder, uint8_t indenta
|
||||
|
||||
while((entry = readdir(dir)) != NULL)
|
||||
{
|
||||
if(entry->d_type == DT_DIR)
|
||||
bool isDir = false;
|
||||
#ifdef _DIRENT_HAVE_D_TYPE
|
||||
if(entry->d_type != DT_UNKNOWN && entry->d_type != DT_LNK)
|
||||
isDir = entry->d_type == DT_DIR;
|
||||
else
|
||||
#else
|
||||
{
|
||||
struct stat stbuf;
|
||||
if (fstatat(dfd, entry->d_name, &stbuf, 0) < 0)
|
||||
isDir = false;
|
||||
else
|
||||
isDir = S_ISDIR(stbuf.st_mode);
|
||||
}
|
||||
#endif
|
||||
if (isDir)
|
||||
{
|
||||
if(ffStrEquals(entry->d_name, ".") || ffStrEquals(entry->d_name, ".."))
|
||||
continue;
|
||||
|
||||
+56
-12
@@ -114,8 +114,40 @@ bool ffPathExpandEnv(const char* in, FFstrbuf* out)
|
||||
|
||||
bool ffSuppressIO(bool suppress)
|
||||
{
|
||||
(void) suppress; //Not implemented.
|
||||
return false;
|
||||
static bool init = false;
|
||||
static HANDLE hOrigOut = INVALID_HANDLE_VALUE;
|
||||
static HANDLE hOrigErr = INVALID_HANDLE_VALUE;
|
||||
static HANDLE hNullFile = INVALID_HANDLE_VALUE;
|
||||
static int fOrigOut = -1;
|
||||
static int fOrigErr = -1;
|
||||
static int fNullFile = -1;
|
||||
|
||||
if (!init)
|
||||
{
|
||||
if(!suppress)
|
||||
return true;
|
||||
|
||||
hOrigOut = GetStdHandle(STD_OUTPUT_HANDLE);
|
||||
hOrigErr = GetStdHandle(STD_ERROR_HANDLE);
|
||||
hNullFile = CreateFileW(L"NUL", GENERIC_READ | GENERIC_WRITE, FILE_SHARE_WRITE, 0, OPEN_EXISTING, 0, NULL);
|
||||
fOrigOut = _dup(STDOUT_FILENO);
|
||||
fOrigErr = _dup(STDERR_FILENO);
|
||||
fNullFile = _open_osfhandle((intptr_t) hNullFile, 0);
|
||||
|
||||
init = true;
|
||||
}
|
||||
if (hNullFile == INVALID_HANDLE_VALUE || fNullFile == -1)
|
||||
return false;
|
||||
|
||||
fflush(stdout);
|
||||
fflush(stderr);
|
||||
|
||||
SetStdHandle(STD_OUTPUT_HANDLE, suppress ? hNullFile : hOrigOut);
|
||||
SetStdHandle(STD_ERROR_HANDLE, suppress ? hNullFile : hOrigErr);
|
||||
_dup2(suppress ? fNullFile : fOrigOut, STDOUT_FILENO);
|
||||
_dup2(suppress ? fNullFile : fOrigErr, STDERR_FILENO);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void listFilesRecursively(uint32_t baseLength, FFstrbuf* folder, uint8_t indentation, const char* folderName, bool pretty)
|
||||
@@ -175,24 +207,36 @@ void ffListFilesRecursively(const char* path, bool pretty)
|
||||
|
||||
const char* ffGetTerminalResponse(const char* request, const char* format, ...)
|
||||
{
|
||||
if (instance.config.display.pipe)
|
||||
return "Not supported in --pipe mode";
|
||||
|
||||
HANDLE hInput = GetStdHandle(STD_INPUT_HANDLE);
|
||||
DWORD prev_mode;
|
||||
GetConsoleMode(hInput, &prev_mode);
|
||||
FF_AUTO_CLOSE_FD HANDLE hConin = INVALID_HANDLE_VALUE;
|
||||
DWORD inputMode;
|
||||
if (!GetConsoleMode(hInput, &inputMode))
|
||||
{
|
||||
hConin = CreateFileW(L"CONIN$", GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ, 0, OPEN_EXISTING, 0, NULL);
|
||||
hInput = hConin;
|
||||
}
|
||||
SetConsoleMode(hInput, 0);
|
||||
|
||||
FlushConsoleInputBuffer(hInput);
|
||||
|
||||
DWORD bytes = 0;
|
||||
WriteFile(GetStdHandle(STD_OUTPUT_HANDLE), request, (DWORD) strlen(request), &bytes, NULL);
|
||||
{
|
||||
DWORD bytes = 0;
|
||||
HANDLE hOutput = GetStdHandle(STD_OUTPUT_HANDLE);
|
||||
FF_AUTO_CLOSE_FD HANDLE hConout = INVALID_HANDLE_VALUE;
|
||||
DWORD outputMode;
|
||||
if (!GetConsoleMode(hOutput, &outputMode))
|
||||
{
|
||||
hConout = CreateFileW(L"CONOUT$", GENERIC_READ | GENERIC_WRITE, FILE_SHARE_WRITE, 0, OPEN_EXISTING, 0, NULL);
|
||||
hOutput = hConout;
|
||||
}
|
||||
WriteFile(hOutput, request, (DWORD) strlen(request), &bytes, NULL);
|
||||
}
|
||||
|
||||
while (true)
|
||||
{
|
||||
if (WaitForSingleObjectEx(hInput, FF_IO_TERM_RESP_WAIT_MS, TRUE) != WAIT_OBJECT_0)
|
||||
{
|
||||
SetConsoleMode(hInput, prev_mode);
|
||||
SetConsoleMode(hInput, inputMode);
|
||||
return "WaitForSingleObject() failed or timeout";
|
||||
}
|
||||
|
||||
@@ -213,10 +257,10 @@ const char* ffGetTerminalResponse(const char* request, const char* format, ...)
|
||||
}
|
||||
|
||||
char buffer[512];
|
||||
bytes = 0;
|
||||
DWORD bytes = 0;
|
||||
ReadFile(hInput, buffer, sizeof(buffer) - 1, &bytes, NULL);
|
||||
|
||||
SetConsoleMode(hInput, prev_mode);
|
||||
SetConsoleMode(hInput, inputMode);
|
||||
|
||||
if(bytes <= 0)
|
||||
return "ReadFile() failed";
|
||||
|
||||
@@ -37,6 +37,11 @@ bool ffJsonConfigParseModuleArgs(const char* key, yyjson_val* val, FFModuleArgs*
|
||||
moduleArgs->keyWidth = (uint32_t) yyjson_get_uint(val);
|
||||
return true;
|
||||
}
|
||||
else if(ffStrEqualsIgnCase(key, "keyIcon"))
|
||||
{
|
||||
ffStrbufSetS(&moduleArgs->keyIcon, yyjson_get_str(val));
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -50,6 +55,8 @@ void ffJsonConfigGenerateModuleArgsConfig(yyjson_mut_doc* doc, yyjson_mut_val* m
|
||||
yyjson_mut_obj_add_strbuf(doc, module, "keyColor", &moduleArgs->keyColor);
|
||||
if (moduleArgs->keyWidth != defaultModuleArgs->keyWidth)
|
||||
yyjson_mut_obj_add_uint(doc, module, "keyWidth", moduleArgs->keyWidth);
|
||||
if (!ffStrbufEqual(&defaultModuleArgs->keyIcon, &moduleArgs->keyIcon))
|
||||
yyjson_mut_obj_add_strbuf(doc, module, "keyIcon", &moduleArgs->keyIcon);
|
||||
}
|
||||
|
||||
const char* ffJsonConfigParseEnum(yyjson_val* val, int* result, FFKeyValuePair pairs[])
|
||||
@@ -213,10 +220,7 @@ static const char* printJsonConfig(bool prepare, yyjson_mut_doc* jsonDoc)
|
||||
{
|
||||
char str[32];
|
||||
int len = snprintf(str, sizeof str, "%" PRIu64 "ms", ms);
|
||||
if(instance.config.display.pipe)
|
||||
puts(str);
|
||||
else
|
||||
printf("\033[s\033[1A\033[9999999C\033[%dD%s\033[u", len, str); // Save; Up 1; Right 9999999; Left <len>; Print <str>; Load
|
||||
printf("\033[s\033[1A\033[9999999C\033[%dD%s\033[u", len, str); // Save; Up 1; Right 9999999; Left <len>; Print <str>; Load
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
#include "fastfetch.h"
|
||||
#include "common/library.h"
|
||||
|
||||
#ifndef FF_DISABLE_DLOPEN
|
||||
|
||||
#include <stdarg.h>
|
||||
|
||||
//Clang doesn't define __SANITIZE_ADDRESS__ but defines __has_feature(address_sanitizer)
|
||||
@@ -77,3 +79,5 @@ void* ffLibraryLoad(const FFstrbuf* userProvidedName, ...)
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
#include "fastfetch.h"
|
||||
#include "util/FFcheckmacros.h"
|
||||
|
||||
#ifndef FF_DISABLE_DLOPEN
|
||||
|
||||
#if defined(_WIN32)
|
||||
#include <libloaderapi.h>
|
||||
#define FF_DLOPEN_FLAGS 0
|
||||
@@ -71,3 +73,45 @@ static inline void ffLibraryUnload(void** handle)
|
||||
FF_LIBRARY_LOAD_SYMBOL_ADDRESS(library, (varName)->ff ## symbolName, symbolName, returnValue);
|
||||
|
||||
void* ffLibraryLoad(const FFstrbuf* userProvidedName, ...);
|
||||
|
||||
#else
|
||||
|
||||
#define FF_LIBRARY_EXTENSION ""
|
||||
|
||||
#define FF_LIBRARY_SYMBOL(symbolName) \
|
||||
__typeof__(&symbolName) ff ## symbolName;
|
||||
|
||||
#define FF_LIBRARY_LOAD(libraryObjectName, userLibraryName, returnValue, ...) \
|
||||
FF_MAYBE_UNUSED void* libraryObjectName = NULL; // Placeholder
|
||||
|
||||
#define FF_LIBRARY_LOAD_SYMBOL_ADDRESS(library, symbolMapping, symbolName, returnValue) \
|
||||
symbolMapping = (__typeof__(&symbolName)) &symbolName
|
||||
|
||||
#define FF_LIBRARY_LOAD_SYMBOL_ADDRESS2(library, symbolMapping, symbolName, alternateName, returnValue) \
|
||||
symbolMapping = (__typeof__(&symbolName)) &symbolName
|
||||
|
||||
#define FF_LIBRARY_LOAD_SYMBOL(library, symbolName, returnValue) \
|
||||
FF_MAYBE_UNUSED __typeof__(&symbolName) FF_LIBRARY_LOAD_SYMBOL_ADDRESS(library, ff ## symbolName, symbolName, returnValue);
|
||||
|
||||
#define FF_LIBRARY_LOAD_SYMBOL_LAZY(library, symbolName) \
|
||||
FF_MAYBE_UNUSED __typeof__(&symbolName) ff ## symbolName = (__typeof__(&symbolName)) &symbolName;
|
||||
|
||||
#define FF_LIBRARY_LOAD_SYMBOL_MESSAGE(library, symbolName) \
|
||||
FF_MAYBE_UNUSED __typeof__(&symbolName) FF_LIBRARY_LOAD_SYMBOL_ADDRESS(library, ff ## symbolName, symbolName, "dlsym " #symbolName " failed");
|
||||
|
||||
#define FF_LIBRARY_LOAD_SYMBOL_MESSAGE2(library, symbolName, alternateName) \
|
||||
FF_MAYBE_UNUSED __typeof__(&symbolName) FF_LIBRARY_LOAD_SYMBOL_ADDRESS2(library, ff ## symbolName, symbolName, alternateName, "dlsym " #symbolName " failed");
|
||||
|
||||
#define FF_LIBRARY_LOAD_SYMBOL_VAR(library, varName, symbolName, returnValue) \
|
||||
FF_LIBRARY_LOAD_SYMBOL_ADDRESS(library, (varName).ff ## symbolName, symbolName, returnValue);
|
||||
|
||||
#define FF_LIBRARY_LOAD_SYMBOL_VAR_MESSAGE(library, varName, symbolName) \
|
||||
FF_LIBRARY_LOAD_SYMBOL_ADDRESS(library, (varName).ff ## symbolName, symbolName, "dlsym " #symbolName " failed");
|
||||
|
||||
#define FF_LIBRARY_LOAD_SYMBOL_VAR_MESSAGE2(library, varName, symbolName, alternateName) \
|
||||
FF_LIBRARY_LOAD_SYMBOL_ADDRESS2(library, (varName).ff ## symbolName, symbolName, alternateName, "dlsym " #symbolName " failed");
|
||||
|
||||
#define FF_LIBRARY_LOAD_SYMBOL_PTR(library, varName, symbolName, returnValue) \
|
||||
FF_LIBRARY_LOAD_SYMBOL_ADDRESS(library, (varName)->ff ## symbolName, symbolName, returnValue);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -8,6 +8,7 @@ static FFModuleBaseInfo* B[] = {
|
||||
(void*) &instance.config.modules.battery,
|
||||
(void*) &instance.config.modules.bios,
|
||||
(void*) &instance.config.modules.bluetooth,
|
||||
(void*) &instance.config.modules.bluetoothRadio,
|
||||
(void*) &instance.config.modules.board,
|
||||
(void*) &instance.config.modules.bootmgr,
|
||||
(void*) &instance.config.modules.break_,
|
||||
@@ -21,6 +22,7 @@ static FFModuleBaseInfo* C[] = {
|
||||
(void*) &instance.config.modules.command,
|
||||
(void*) &instance.config.modules.colors,
|
||||
(void*) &instance.config.modules.cpu,
|
||||
(void*) &instance.config.modules.cpuCache,
|
||||
(void*) &instance.config.modules.cpuUsage,
|
||||
(void*) &instance.config.modules.cursor,
|
||||
(void*) &instance.config.modules.custom,
|
||||
@@ -33,10 +35,12 @@ static FFModuleBaseInfo* D[] = {
|
||||
(void*) &instance.config.modules.display,
|
||||
(void*) &instance.config.modules.disk,
|
||||
(void*) &instance.config.modules.diskIo,
|
||||
(void*) &instance.config.modules.dns,
|
||||
NULL,
|
||||
};
|
||||
|
||||
static FFModuleBaseInfo* E[] = {
|
||||
(void*) &instance.config.modules.editor,
|
||||
NULL,
|
||||
};
|
||||
|
||||
@@ -58,6 +62,7 @@ static FFModuleBaseInfo* H[] = {
|
||||
|
||||
static FFModuleBaseInfo* I[] = {
|
||||
(void*) &instance.config.modules.icons,
|
||||
(void*) &instance.config.modules.initSystem,
|
||||
NULL,
|
||||
};
|
||||
|
||||
|
||||
@@ -18,6 +18,8 @@
|
||||
# define ROUNDUP(a) ROUNDUP2((a), sizeof(int))
|
||||
#elif defined(__OpenBSD__)
|
||||
# define ROUNDUP(a) ROUNDUP2((a), sizeof(int))
|
||||
#elif defined(__sun)
|
||||
# define ROUNDUP(a) ROUNDUP2((a), _SS_ALIGNSIZE)
|
||||
#else
|
||||
# error unknown platform
|
||||
#endif
|
||||
@@ -31,9 +33,13 @@ get_rt_address(struct rt_msghdr *rtm, int desired)
|
||||
{
|
||||
if (rtm->rtm_addrs & (1 << i))
|
||||
{
|
||||
if ((1 <<i ) == desired)
|
||||
if ((1 << i) == desired)
|
||||
return sa;
|
||||
#ifdef __sun
|
||||
sa = (struct sockaddr *)(ROUNDUP(sizeof(struct sockaddr)) + (char *)sa);
|
||||
#else
|
||||
sa = (struct sockaddr *)(ROUNDUP(sa->sa_len) + (char *)sa);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
@@ -71,7 +77,9 @@ bool ffNetifGetDefaultRouteImpl(char iface[IF_NAMESIZE + 1], uint32_t* ifIndex)
|
||||
},
|
||||
.dst = {
|
||||
.sin_family = AF_INET,
|
||||
#ifndef __sun
|
||||
.sin_len = sizeof(rtmsg.dst),
|
||||
#endif
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
+72
-60
@@ -1,3 +1,4 @@
|
||||
#include "fastfetch.h"
|
||||
#include "common/option.h"
|
||||
#include "common/color.h"
|
||||
#include "util/stringUtils.h"
|
||||
@@ -49,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;
|
||||
}
|
||||
@@ -145,65 +155,67 @@ bool ffOptionParseBoolean(const char* str)
|
||||
);
|
||||
}
|
||||
|
||||
void ffOptionParseColor(const char* value, FFstrbuf* buffer)
|
||||
void ffOptionParseColorNoClear(const char* value, FFstrbuf* buffer)
|
||||
{
|
||||
ffStrbufClear(buffer);
|
||||
// If value is already an ANSI escape code, use it
|
||||
if (value[0] == '\e' && value[1] == '[')
|
||||
{
|
||||
ffStrbufAppendS(buffer, value + 2);
|
||||
ffStrbufTrimRight(buffer, 'm');
|
||||
return;
|
||||
}
|
||||
|
||||
ffStrbufEnsureFree(buffer, 63);
|
||||
|
||||
while(*value != '\0')
|
||||
{
|
||||
#define FF_APPEND_COLOR_CODE_COND(prefix, code) \
|
||||
if(ffStrStartsWithIgnCase(value, #prefix)) { ffStrbufAppendS(buffer, code); value += strlen(#prefix); }
|
||||
if(ffStrStartsWithIgnCase(value, #prefix)) { ffStrbufAppendS(buffer, code); value += strlen(#prefix); continue; }
|
||||
#define FF_APPEND_COLOR_PROP_COND(prefix, prop) \
|
||||
if(ffStrStartsWithIgnCase(value, #prefix)) { if (instance.config.display.prop.length) ffStrbufAppend(buffer, &instance.config.display.prop); else ffStrbufAppendS(buffer, FF_COLOR_FG_DEFAULT); value += strlen(#prefix); continue; }
|
||||
|
||||
FF_APPEND_COLOR_CODE_COND(reset_, FF_COLOR_MODE_RESET)
|
||||
else FF_APPEND_COLOR_CODE_COND(bright_, FF_COLOR_MODE_BOLD)
|
||||
else FF_APPEND_COLOR_CODE_COND(dim_, FF_COLOR_MODE_DIM)
|
||||
else FF_APPEND_COLOR_CODE_COND(italic_, FF_COLOR_MODE_ITALIC)
|
||||
else FF_APPEND_COLOR_CODE_COND(underline_, FF_COLOR_MODE_UNDERLINE)
|
||||
else FF_APPEND_COLOR_CODE_COND(blink_, FF_COLOR_MODE_BLINK)
|
||||
else FF_APPEND_COLOR_CODE_COND(inverse_, FF_COLOR_MODE_INVERSE)
|
||||
else FF_APPEND_COLOR_CODE_COND(hidden_, FF_COLOR_MODE_HIDDEN)
|
||||
else FF_APPEND_COLOR_CODE_COND(strike_, FF_COLOR_MODE_STRIKETHROUGH)
|
||||
else FF_APPEND_COLOR_CODE_COND(black, FF_COLOR_FG_BLACK)
|
||||
else FF_APPEND_COLOR_CODE_COND(red, FF_COLOR_FG_RED)
|
||||
else FF_APPEND_COLOR_CODE_COND(green, FF_COLOR_FG_GREEN)
|
||||
else FF_APPEND_COLOR_CODE_COND(yellow, FF_COLOR_FG_YELLOW)
|
||||
else FF_APPEND_COLOR_CODE_COND(blue, FF_COLOR_FG_BLUE)
|
||||
else FF_APPEND_COLOR_CODE_COND(magenta, FF_COLOR_FG_MAGENTA)
|
||||
else FF_APPEND_COLOR_CODE_COND(cyan, FF_COLOR_FG_CYAN)
|
||||
else FF_APPEND_COLOR_CODE_COND(white, FF_COLOR_FG_WHITE)
|
||||
else FF_APPEND_COLOR_CODE_COND(default, FF_COLOR_FG_DEFAULT)
|
||||
else FF_APPEND_COLOR_CODE_COND(light_black, FF_COLOR_FG_LIGHT_BLACK)
|
||||
else FF_APPEND_COLOR_CODE_COND(light_red, FF_COLOR_FG_LIGHT_RED)
|
||||
else FF_APPEND_COLOR_CODE_COND(light_green, FF_COLOR_FG_LIGHT_GREEN)
|
||||
else FF_APPEND_COLOR_CODE_COND(light_yellow, FF_COLOR_FG_LIGHT_YELLOW)
|
||||
else FF_APPEND_COLOR_CODE_COND(light_blue, FF_COLOR_FG_LIGHT_BLUE)
|
||||
else FF_APPEND_COLOR_CODE_COND(light_magenta, FF_COLOR_FG_LIGHT_MAGENTA)
|
||||
else FF_APPEND_COLOR_CODE_COND(light_cyan, FF_COLOR_FG_LIGHT_CYAN)
|
||||
else FF_APPEND_COLOR_CODE_COND(light_white, FF_COLOR_FG_LIGHT_WHITE)
|
||||
else
|
||||
if (ffCharIsEnglishAlphabet(value[0]))
|
||||
{
|
||||
ffStrbufAppendC(buffer, *value);
|
||||
++value;
|
||||
FF_APPEND_COLOR_CODE_COND(reset_, FF_COLOR_MODE_RESET)
|
||||
else FF_APPEND_COLOR_CODE_COND(bright_, FF_COLOR_MODE_BOLD)
|
||||
else FF_APPEND_COLOR_CODE_COND(dim_, FF_COLOR_MODE_DIM)
|
||||
else FF_APPEND_COLOR_CODE_COND(italic_, FF_COLOR_MODE_ITALIC)
|
||||
else FF_APPEND_COLOR_CODE_COND(underline_, FF_COLOR_MODE_UNDERLINE)
|
||||
else FF_APPEND_COLOR_CODE_COND(blink_, FF_COLOR_MODE_BLINK)
|
||||
else FF_APPEND_COLOR_CODE_COND(inverse_, FF_COLOR_MODE_INVERSE)
|
||||
else FF_APPEND_COLOR_CODE_COND(hidden_, FF_COLOR_MODE_HIDDEN)
|
||||
else FF_APPEND_COLOR_CODE_COND(strike_, FF_COLOR_MODE_STRIKETHROUGH)
|
||||
else FF_APPEND_COLOR_CODE_COND(black, FF_COLOR_FG_BLACK)
|
||||
else FF_APPEND_COLOR_CODE_COND(red, FF_COLOR_FG_RED)
|
||||
else FF_APPEND_COLOR_CODE_COND(green, FF_COLOR_FG_GREEN)
|
||||
else FF_APPEND_COLOR_CODE_COND(yellow, FF_COLOR_FG_YELLOW)
|
||||
else FF_APPEND_COLOR_CODE_COND(blue, FF_COLOR_FG_BLUE)
|
||||
else FF_APPEND_COLOR_CODE_COND(magenta, FF_COLOR_FG_MAGENTA)
|
||||
else FF_APPEND_COLOR_CODE_COND(cyan, FF_COLOR_FG_CYAN)
|
||||
else FF_APPEND_COLOR_CODE_COND(white, FF_COLOR_FG_WHITE)
|
||||
else FF_APPEND_COLOR_CODE_COND(default, FF_COLOR_FG_DEFAULT)
|
||||
else FF_APPEND_COLOR_CODE_COND(light_black, FF_COLOR_FG_LIGHT_BLACK)
|
||||
else FF_APPEND_COLOR_CODE_COND(light_red, FF_COLOR_FG_LIGHT_RED)
|
||||
else FF_APPEND_COLOR_CODE_COND(light_green, FF_COLOR_FG_LIGHT_GREEN)
|
||||
else FF_APPEND_COLOR_CODE_COND(light_yellow, FF_COLOR_FG_LIGHT_YELLOW)
|
||||
else FF_APPEND_COLOR_CODE_COND(light_blue, FF_COLOR_FG_LIGHT_BLUE)
|
||||
else FF_APPEND_COLOR_CODE_COND(light_magenta, FF_COLOR_FG_LIGHT_MAGENTA)
|
||||
else FF_APPEND_COLOR_CODE_COND(light_cyan, FF_COLOR_FG_LIGHT_CYAN)
|
||||
else FF_APPEND_COLOR_CODE_COND(light_white, FF_COLOR_FG_LIGHT_WHITE)
|
||||
else FF_APPEND_COLOR_PROP_COND(keys, colorKeys)
|
||||
else FF_APPEND_COLOR_PROP_COND(title, colorTitle)
|
||||
else FF_APPEND_COLOR_PROP_COND(output, colorOutput)
|
||||
else FF_APPEND_COLOR_PROP_COND(separator, colorSeparator)
|
||||
else
|
||||
{
|
||||
fprintf(stderr, "Error: invalid color code found: %s\n", value);
|
||||
exit(479);
|
||||
}
|
||||
}
|
||||
ffStrbufAppendC(buffer, *value);
|
||||
++value;
|
||||
|
||||
#undef FF_APPEND_COLOR_CODE_COND
|
||||
#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);
|
||||
}
|
||||
|
||||
+34
-3
@@ -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;
|
||||
@@ -67,6 +76,28 @@ FF_C_NODISCARD uint32_t ffOptionParseUInt32(const char* argumentKey, const char*
|
||||
FF_C_NODISCARD int32_t ffOptionParseInt32(const char* argumentKey, const char* value);
|
||||
FF_C_NODISCARD int ffOptionParseEnum(const char* argumentKey, const char* requestedKey, FFKeyValuePair pairs[]);
|
||||
FF_C_NODISCARD bool ffOptionParseBoolean(const char* str);
|
||||
void ffOptionParseColor(const char* value, FFstrbuf* buffer);
|
||||
void ffOptionInitModuleArg(FFModuleArgs* args);
|
||||
void ffOptionDestroyModuleArg(FFModuleArgs* args);
|
||||
void ffOptionParseColorNoClear(const char* value, FFstrbuf* buffer);
|
||||
static inline void ffOptionParseColor(const char* value, FFstrbuf* buffer)
|
||||
{
|
||||
ffStrbufClear(buffer);
|
||||
ffOptionParseColorNoClear(value, buffer);
|
||||
}
|
||||
|
||||
static inline void ffOptionInitModuleArg(FFModuleArgs* args, const char* icon)
|
||||
{
|
||||
ffStrbufInit(&args->key);
|
||||
ffStrbufInit(&args->keyColor);
|
||||
ffStrbufInitStatic(&args->keyIcon, icon);
|
||||
ffStrbufInit(&args->outputFormat);
|
||||
ffStrbufInit(&args->outputColor);
|
||||
args->keyWidth = 0;
|
||||
}
|
||||
|
||||
static inline void ffOptionDestroyModuleArg(FFModuleArgs* args)
|
||||
{
|
||||
ffStrbufDestroy(&args->key);
|
||||
ffStrbufDestroy(&args->keyColor);
|
||||
ffStrbufDestroy(&args->keyIcon);
|
||||
ffStrbufDestroy(&args->outputFormat);
|
||||
ffStrbufDestroy(&args->outputColor);
|
||||
}
|
||||
|
||||
+18
-4
@@ -79,15 +79,15 @@ static void parseSize(FFstrbuf* result, uint64_t bytes, uint32_t base, const cha
|
||||
|
||||
void ffParseSize(uint64_t bytes, FFstrbuf* result)
|
||||
{
|
||||
switch (instance.config.display.binaryPrefixType)
|
||||
switch (instance.config.display.sizeBinaryPrefix)
|
||||
{
|
||||
case FF_BINARY_PREFIX_TYPE_IEC:
|
||||
case FF_SIZE_BINARY_PREFIX_TYPE_IEC:
|
||||
parseSize(result, bytes, 1024, (const char*[]) {"B", "KiB", "MiB", "GiB", "TiB", "PiB", "EiB", "ZiB", "YiB", NULL});
|
||||
break;
|
||||
case FF_BINARY_PREFIX_TYPE_SI:
|
||||
case FF_SIZE_BINARY_PREFIX_TYPE_SI:
|
||||
parseSize(result, bytes, 1000, (const char*[]) {"B", "kB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB", NULL});
|
||||
break;
|
||||
case FF_BINARY_PREFIX_TYPE_JEDEC:
|
||||
case FF_SIZE_BINARY_PREFIX_TYPE_JEDEC:
|
||||
parseSize(result, bytes, 1024, (const char*[]) {"B", "KB", "MB", "GB", "TB", NULL});
|
||||
break;
|
||||
default:
|
||||
@@ -96,6 +96,20 @@ void ffParseSize(uint64_t bytes, FFstrbuf* result)
|
||||
}
|
||||
}
|
||||
|
||||
bool ffParseFrequency(uint32_t mhz, FFstrbuf* result)
|
||||
{
|
||||
if (mhz == 0)
|
||||
return false;
|
||||
|
||||
int8_t ndigits = instance.config.display.freqNdigits;
|
||||
|
||||
if (ndigits >= 0)
|
||||
ffStrbufAppendF(result, "%.*f GHz", ndigits, mhz / 1000.);
|
||||
else
|
||||
ffStrbufAppendF(result, "%u MHz", (unsigned) mhz);
|
||||
return true;
|
||||
}
|
||||
|
||||
void ffParseGTK(FFstrbuf* buffer, const FFstrbuf* gtk2, const FFstrbuf* gtk3, const FFstrbuf* gtk4)
|
||||
{
|
||||
if(gtk2->length > 0 && gtk3->length > 0 && gtk4->length > 0)
|
||||
|
||||
@@ -26,3 +26,4 @@ void ffVersionToPretty(const FFVersion* version, FFstrbuf* pretty);
|
||||
int8_t ffVersionCompare(const FFVersion* version1, const FFVersion* version2);
|
||||
|
||||
void ffParseSize(uint64_t bytes, FFstrbuf* result);
|
||||
bool ffParseFrequency(uint32_t mhz, FFstrbuf* result);
|
||||
|
||||
+34
-16
@@ -24,12 +24,11 @@ void ffPercentAppendBar(FFstrbuf* buffer, double percent, FFColorRangeConfig con
|
||||
uint32_t blocksPercent = (uint32_t) (percent / 100.0 * options->barWidth + 0.5);
|
||||
assert(blocksPercent <= options->barWidth);
|
||||
|
||||
if(options->barBorder)
|
||||
if(options->barBorderLeft.length)
|
||||
{
|
||||
if(!options->pipe)
|
||||
ffStrbufAppendS(buffer, "\e[" FF_COLOR_FG_LIGHT_WHITE "m[ ");
|
||||
else
|
||||
ffStrbufAppendS(buffer, "[ ");
|
||||
ffStrbufAppendS(buffer, "\e[" FF_COLOR_FG_LIGHT_WHITE "m");
|
||||
ffStrbufAppend(buffer, &options->barBorderLeft);
|
||||
}
|
||||
|
||||
if (percent != percent)
|
||||
@@ -50,14 +49,34 @@ void ffPercentAppendBar(FFstrbuf* buffer, double percent, FFColorRangeConfig con
|
||||
{
|
||||
if(!options->pipe)
|
||||
{
|
||||
uint32_t section1Begin = (uint32_t) ((green <= yellow ? green : yellow) / 100.0 * options->barWidth + 0.5);
|
||||
uint32_t section2Begin = (uint32_t) ((green > yellow ? green : yellow) / 100.0 * options->barWidth + 0.5);
|
||||
if (i == section2Begin)
|
||||
ffStrbufAppendF(buffer, "\e[%sm", (green > yellow ? colorGreen : colorRed));
|
||||
else if (i == section1Begin)
|
||||
ffStrbufAppendF(buffer, "\e[%sm", colorYellow);
|
||||
else if (i == 0)
|
||||
ffStrbufAppendF(buffer, "\e[%sm", (green <= yellow ? colorGreen : colorRed));
|
||||
if (options->percentType & FF_PERCENTAGE_TYPE_BAR_MONOCHROME_BIT)
|
||||
{
|
||||
const char* color = NULL;
|
||||
if (green <= yellow)
|
||||
{
|
||||
if (percent < green) color = colorGreen;
|
||||
else if (percent < yellow) color = colorYellow;
|
||||
else color = colorRed;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (percent < yellow) color = colorRed;
|
||||
else if (percent < green) color = colorYellow;
|
||||
else color = colorGreen;
|
||||
}
|
||||
ffStrbufAppendF(buffer, "\e[%sm", color);
|
||||
}
|
||||
else
|
||||
{
|
||||
uint32_t section1Begin = (uint32_t) ((green <= yellow ? green : yellow) / 100.0 * options->barWidth + 0.5);
|
||||
uint32_t section2Begin = (uint32_t) ((green > yellow ? green : yellow) / 100.0 * options->barWidth + 0.5);
|
||||
if (i == section2Begin)
|
||||
ffStrbufAppendF(buffer, "\e[%sm", (green > yellow ? colorGreen : colorRed));
|
||||
else if (i == section1Begin)
|
||||
ffStrbufAppendF(buffer, "\e[%sm", colorYellow);
|
||||
else if (i == 0)
|
||||
ffStrbufAppendF(buffer, "\e[%sm", (green <= yellow ? colorGreen : colorRed));
|
||||
}
|
||||
}
|
||||
ffStrbufAppend(buffer, &options->barCharElapsed);
|
||||
}
|
||||
@@ -71,12 +90,11 @@ void ffPercentAppendBar(FFstrbuf* buffer, double percent, FFColorRangeConfig con
|
||||
}
|
||||
}
|
||||
|
||||
if(options->barBorder)
|
||||
if(options->barBorderRight.length)
|
||||
{
|
||||
if(!options->pipe)
|
||||
ffStrbufAppendS(buffer, "\e[" FF_COLOR_FG_LIGHT_WHITE "m ]");\
|
||||
else
|
||||
ffStrbufAppendS(buffer, " ]");
|
||||
ffStrbufAppendS(buffer, "\e[" FF_COLOR_FG_LIGHT_WHITE "m");
|
||||
ffStrbufAppend(buffer, &options->barBorderRight);
|
||||
}
|
||||
|
||||
if(!options->pipe)
|
||||
|
||||
@@ -4,12 +4,13 @@
|
||||
#include "common/parsing.h"
|
||||
#include "common/option.h"
|
||||
|
||||
enum
|
||||
enum FFPercentageTypeFlags
|
||||
{
|
||||
FF_PERCENTAGE_TYPE_NUM_BIT = 1 << 0,
|
||||
FF_PERCENTAGE_TYPE_BAR_BIT = 1 << 1,
|
||||
FF_PERCENTAGE_TYPE_HIDE_OTHERS_BIT = 1 << 2,
|
||||
FF_PERCENTAGE_TYPE_NUM_COLOR_BIT = 1 << 3,
|
||||
FF_PERCENTAGE_TYPE_BAR_MONOCHROME_BIT = FF_PERCENTAGE_TYPE_NUM_COLOR_BIT,
|
||||
};
|
||||
|
||||
// if (green <= yellow)
|
||||
|
||||
+68
-49
@@ -11,58 +11,80 @@ void ffPrintLogoAndKey(const char* moduleName, uint8_t moduleIndex, const FFModu
|
||||
return;
|
||||
|
||||
//This is used as a magic value for hiding keys
|
||||
if(moduleArgs && ffStrbufEqualS(&moduleArgs->key, " "))
|
||||
return;
|
||||
if (!(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);
|
||||
if (instance.config.display.brightColor)
|
||||
fputs(FASTFETCH_TEXT_MODIFIER_BOLT, stdout);
|
||||
|
||||
if(moduleArgs && !(printType & FF_PRINT_TYPE_NO_CUSTOM_KEY_COLOR) && moduleArgs->keyColor.length > 0)
|
||||
ffPrintColor(&moduleArgs->keyColor);
|
||||
else
|
||||
ffPrintColor(&instance.config.display.colorKeys);
|
||||
}
|
||||
|
||||
bool hasIcon = false;
|
||||
if (instance.config.display.keyType & FF_MODULE_KEY_TYPE_ICON && moduleArgs && moduleArgs->keyIcon.length > 0)
|
||||
{
|
||||
ffStrbufWriteTo(&moduleArgs->keyIcon, stdout);
|
||||
hasIcon = true;
|
||||
}
|
||||
|
||||
if (instance.config.display.keyType & FF_MODULE_KEY_TYPE_STRING)
|
||||
{
|
||||
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)
|
||||
{
|
||||
fputs(FASTFETCH_TEXT_MODIFIER_RESET, stdout);
|
||||
ffPrintColor(&instance.config.display.colorSeparator);
|
||||
}
|
||||
|
||||
ffStrbufWriteTo(&instance.config.display.keyValueSeparator, stdout);
|
||||
|
||||
if(!instance.config.display.pipe && instance.config.display.colorSeparator.length)
|
||||
fputs(FASTFETCH_TEXT_MODIFIER_RESET, stdout);
|
||||
|
||||
if (!(printType & FF_PRINT_TYPE_NO_CUSTOM_KEY_WIDTH))
|
||||
{
|
||||
uint32_t keyWidth = moduleArgs && moduleArgs->keyWidth > 0 ? moduleArgs->keyWidth : instance.config.display.keyWidth;
|
||||
if (keyWidth > 0)
|
||||
printf("\e[%uG", (unsigned) (keyWidth + instance.state.logoWidth));
|
||||
}
|
||||
}
|
||||
|
||||
if(!instance.config.display.pipe)
|
||||
{
|
||||
fputs(FASTFETCH_TEXT_MODIFIER_RESET, stdout);
|
||||
if (instance.config.display.brightColor)
|
||||
fputs(FASTFETCH_TEXT_MODIFIER_BOLT, stdout);
|
||||
|
||||
if(moduleArgs && !(printType & FF_PRINT_TYPE_NO_CUSTOM_KEY_COLOR) && moduleArgs->keyColor.length > 0)
|
||||
ffPrintColor(&moduleArgs->keyColor);
|
||||
else
|
||||
ffPrintColor(&instance.config.display.colorKeys);
|
||||
}
|
||||
|
||||
//NULL check is required for modules with custom keys, e.g. disk with the folder path
|
||||
if((printType & FF_PRINT_TYPE_NO_CUSTOM_KEY) || !moduleArgs || moduleArgs->key.length == 0)
|
||||
{
|
||||
fputs(moduleName, stdout);
|
||||
|
||||
if(moduleIndex > 0)
|
||||
printf(" %hhu", moduleIndex);
|
||||
}
|
||||
else
|
||||
{
|
||||
FF_STRBUF_AUTO_DESTROY key = ffStrbufCreate();
|
||||
FF_PARSE_FORMAT_STRING_CHECKED(&key, &moduleArgs->key, 1, ((FFformatarg[]){
|
||||
{FF_FORMAT_ARG_TYPE_UINT8, &moduleIndex}
|
||||
}));
|
||||
ffStrbufWriteTo(&key, stdout);
|
||||
}
|
||||
|
||||
if(!instance.config.display.pipe)
|
||||
fputs(FASTFETCH_TEXT_MODIFIER_RESET, stdout);
|
||||
|
||||
ffStrbufWriteTo(&instance.config.display.keyValueSeparator, stdout);
|
||||
|
||||
if(!instance.config.display.pipe)
|
||||
{
|
||||
fputs(FASTFETCH_TEXT_MODIFIER_RESET, stdout);
|
||||
if (moduleArgs->outputColor.length)
|
||||
if (moduleArgs && moduleArgs->outputColor.length)
|
||||
ffPrintColor(&moduleArgs->outputColor);
|
||||
else if (instance.config.display.colorOutput.length)
|
||||
ffPrintColor(&instance.config.display.colorOutput);
|
||||
}
|
||||
|
||||
if (!instance.config.display.pipe && !(printType & FF_PRINT_TYPE_NO_CUSTOM_KEY_WIDTH))
|
||||
{
|
||||
uint32_t keyWidth = moduleArgs && moduleArgs->keyWidth > 0 ? moduleArgs->keyWidth : instance.config.display.keyWidth;
|
||||
if (keyWidth > 0)
|
||||
printf("\e[%uG", (unsigned) (keyWidth + instance.state.logoWidth));
|
||||
}
|
||||
}
|
||||
|
||||
void ffPrintFormat(const char* moduleName, uint8_t moduleIndex, const FFModuleArgs* moduleArgs, FFPrintType printType, uint32_t numArgs, const FFformatarg* arguments)
|
||||
@@ -73,11 +95,8 @@ void ffPrintFormat(const char* moduleName, uint8_t moduleIndex, const FFModuleAr
|
||||
else
|
||||
ffStrbufAppendS(&buffer, "unknown");
|
||||
|
||||
if(buffer.length > 0)
|
||||
{
|
||||
ffPrintLogoAndKey(moduleName, moduleIndex, moduleArgs, printType);
|
||||
ffStrbufPutTo(&buffer, stdout);
|
||||
}
|
||||
ffPrintLogoAndKey(moduleName, moduleIndex, moduleArgs, printType);
|
||||
ffStrbufPutTo(&buffer, stdout);
|
||||
}
|
||||
|
||||
static void printError(const char* moduleName, uint8_t moduleIndex, const FFModuleArgs* moduleArgs, FFPrintType printType, const char* message, va_list arguments)
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
typedef enum FFPrintType {
|
||||
FF_PRINT_TYPE_DEFAULT = 0,
|
||||
FF_PRINT_TYPE_NO_CUSTOM_KEY = 1 << 0,
|
||||
FF_PRINT_TYPE_NO_CUSTOM_KEY = 1 << 0, // key has been formatted outside
|
||||
FF_PRINT_TYPE_NO_CUSTOM_KEY_COLOR = 1 << 1,
|
||||
FF_PRINT_TYPE_NO_CUSTOM_KEY_WIDTH = 1 << 2,
|
||||
FF_PRINT_TYPE_NO_CUSTOM_OUTPUT_FORMAT = 1 << 3, // reserved
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
|
||||
#include "util/FFstrbuf.h"
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
const char* ffProcessAppendOutput(FFstrbuf* buffer, char* const argv[], bool useStdErr);
|
||||
|
||||
static inline const char* ffProcessAppendStdOut(FFstrbuf* buffer, char* const argv[])
|
||||
@@ -19,3 +21,10 @@ static inline const char* ffProcessAppendStdErr(FFstrbuf* buffer, char* const ar
|
||||
ffStrbufTrimRightSpace(buffer);
|
||||
return error;
|
||||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
bool ffProcessGetInfoWindows(uint32_t pid, uint32_t* ppid, FFstrbuf* pname, FFstrbuf* exe, const char** exeName, FFstrbuf* exePath, bool* gui);
|
||||
#else
|
||||
void ffProcessGetInfoLinux(pid_t pid, FFstrbuf* processName, FFstrbuf* exe, const char** exeName, FFstrbuf* exePath);
|
||||
const char* ffProcessGetBasicInfoLinux(pid_t pid, FFstrbuf* name, pid_t* ppid, int32_t* tty);
|
||||
#endif
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
#include "common/processing.h"
|
||||
#include "common/io/io.h"
|
||||
#include "common/time.h"
|
||||
#include "util/stringUtils.h"
|
||||
#include "util/mallocHelper.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
@@ -11,6 +13,17 @@
|
||||
#include <errno.h>
|
||||
#include <sys/wait.h>
|
||||
|
||||
#if defined(__FreeBSD__) || defined(__APPLE__)
|
||||
#include <sys/types.h>
|
||||
#include <sys/user.h>
|
||||
#include <sys/sysctl.h>
|
||||
#endif
|
||||
#if defined(__APPLE__)
|
||||
#include <libproc.h>
|
||||
#elif defined(__sun)
|
||||
#include <procfs.h>
|
||||
#endif
|
||||
|
||||
enum { FF_PIPE_BUFSIZ = 8192 };
|
||||
|
||||
static inline int ffPipe2(int *fds, int flags)
|
||||
@@ -101,3 +114,270 @@ const char* ffProcessAppendOutput(FFstrbuf* buffer, char* const argv[], bool use
|
||||
|
||||
return "read(childPipeFd, str, FF_PIPE_BUFSIZ) failed";
|
||||
}
|
||||
|
||||
void ffProcessGetInfoLinux(pid_t pid, FFstrbuf* processName, FFstrbuf* exe, const char** exeName, FFstrbuf* exePath)
|
||||
{
|
||||
assert(processName->length > 0);
|
||||
ffStrbufClear(exe);
|
||||
|
||||
#ifdef __linux__
|
||||
|
||||
char filePath[64];
|
||||
snprintf(filePath, sizeof(filePath), "/proc/%d/cmdline", (int)pid);
|
||||
|
||||
if(ffReadFileBuffer(filePath, exe))
|
||||
{
|
||||
ffStrbufRecalculateLength(exe); //Trim the arguments
|
||||
ffStrbufTrimRightSpace(exe);
|
||||
ffStrbufTrimLeft(exe, '-'); //Login shells start with a dash
|
||||
}
|
||||
|
||||
if (exePath)
|
||||
{
|
||||
snprintf(filePath, sizeof(filePath), "/proc/%d/exe", (int)pid);
|
||||
ffStrbufEnsureFixedLengthFree(exePath, PATH_MAX);
|
||||
ssize_t length = readlink(filePath, exePath->chars, exePath->allocated - 1);
|
||||
if (length > 0) // doesn't contain trailing NUL
|
||||
{
|
||||
exePath->chars[length] = '\0';
|
||||
exePath->length = (uint32_t) length;
|
||||
}
|
||||
}
|
||||
|
||||
#elif defined(__APPLE__)
|
||||
|
||||
size_t len = 0;
|
||||
int mibs[] = { CTL_KERN, KERN_PROCARGS2, pid };
|
||||
if (sysctl(mibs, sizeof(mibs) / sizeof(*mibs), NULL, &len, NULL, 0) == 0)
|
||||
{// try get arg0
|
||||
#ifndef MAC_OS_X_VERSION_10_15
|
||||
//don't know why if don't let len longer, proArgs2 and len will change during the following sysctl() in old MacOS version.
|
||||
len++;
|
||||
#endif
|
||||
FF_AUTO_FREE char* const procArgs2 = malloc(len);
|
||||
if (sysctl(mibs, sizeof(mibs) / sizeof(*mibs), procArgs2, &len, NULL, 0) == 0)
|
||||
{
|
||||
// https://gist.github.com/nonowarn/770696#file-getargv-c-L46
|
||||
uint32_t argc = *(uint32_t*) procArgs2;
|
||||
const char* realExePath = procArgs2 + sizeof(argc);
|
||||
|
||||
const char* arg0 = memchr(realExePath, '\0', len - (size_t) (realExePath - procArgs2));
|
||||
if (exePath)
|
||||
ffStrbufSetNS(exePath, (uint32_t) (arg0 - realExePath), realExePath);
|
||||
|
||||
do arg0++; while (*arg0 == '\0');
|
||||
assert(arg0 < procArgs2 + len);
|
||||
|
||||
if (argc > 1)
|
||||
{
|
||||
// #977
|
||||
const char* p = strrchr(arg0, '/');
|
||||
if (p)
|
||||
p++;
|
||||
else
|
||||
p = arg0;
|
||||
if (ffStrStartsWithIgnCase(p, "python")) // /opt/homebrew/Cellar/python@3.12/3.12.3/Frameworks/Python.framework/Versions/3.12/Resources/Python.app/Contents/MacOS/Python /Users/carter/.local/bin/xonsh
|
||||
arg0 = p + strlen(p) + 1;
|
||||
}
|
||||
|
||||
if (*arg0 == '-') arg0++; // Login shells
|
||||
|
||||
ffStrbufSetS(exe, arg0);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ffStrbufEnsureFixedLengthFree(exe, PATH_MAX);
|
||||
int length = proc_pidpath(pid, exe->chars, exe->allocated);
|
||||
if (length > 0)
|
||||
{
|
||||
exe->length = (uint32_t) length;
|
||||
if (exePath)
|
||||
ffStrbufSet(exePath, exe);
|
||||
}
|
||||
}
|
||||
|
||||
#elif defined(__FreeBSD__)
|
||||
|
||||
size_t size = ARG_MAX;
|
||||
FF_AUTO_FREE char* args = malloc(size);
|
||||
|
||||
static_assert(ARG_MAX > PATH_MAX, "");
|
||||
|
||||
if(exePath && sysctl(
|
||||
(int[]){CTL_KERN, KERN_PROC, KERN_PROC_PATHNAME, pid}, 4,
|
||||
args, &size,
|
||||
NULL, 0
|
||||
) == 0)
|
||||
ffStrbufSetNS(exePath, (uint32_t) (size - 1), args);
|
||||
|
||||
size = ARG_MAX;
|
||||
if(sysctl(
|
||||
(int[]){CTL_KERN, KERN_PROC, KERN_PROC_ARGS, pid}, 4,
|
||||
args, &size,
|
||||
NULL, 0
|
||||
) == 0)
|
||||
{
|
||||
char* arg0 = args;
|
||||
size_t arg0Len = strlen(args);
|
||||
if (size > arg0Len + 1)
|
||||
{
|
||||
char* p = (char*) memrchr(args, '/', arg0Len);
|
||||
if (p)
|
||||
p++;
|
||||
else
|
||||
p = arg0;
|
||||
if (ffStrStartsWith(p, "python")) // /usr/local/bin/python3.9 /home/carter/.local/bin/xonsh
|
||||
{
|
||||
arg0 += arg0Len + 1;
|
||||
}
|
||||
}
|
||||
if (arg0[0] == '-') arg0++;
|
||||
ffStrbufSetS(exe, arg0);
|
||||
}
|
||||
|
||||
#elif defined(__sun)
|
||||
|
||||
char filePath[PATH_MAX];
|
||||
snprintf(filePath, sizeof(filePath), "/proc/%d/psinfo", (int) pid);
|
||||
psinfo_t proc;
|
||||
if (ffReadFileData(filePath, sizeof(proc), &proc) == sizeof(proc))
|
||||
{
|
||||
ffStrbufSetS(exe, proc.pr_psargs);
|
||||
ffStrbufSubstrBeforeFirstC(exe, ' ');
|
||||
}
|
||||
|
||||
if (exePath)
|
||||
{
|
||||
snprintf(filePath, sizeof(filePath), "/proc/%d/path/a.out", (int) pid);
|
||||
ffStrbufEnsureFixedLengthFree(exePath, PATH_MAX);
|
||||
ssize_t length = readlink(filePath, exePath->chars, exePath->allocated - 1);
|
||||
if (length > 0) // doesn't contain trailing NUL
|
||||
{
|
||||
exePath->chars[length] = '\0';
|
||||
exePath->length = (uint32_t) length;
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
if(exe->length == 0)
|
||||
ffStrbufSet(exe, processName);
|
||||
|
||||
assert(exe->length > 0);
|
||||
uint32_t lastSlashIndex = ffStrbufLastIndexC(exe, '/');
|
||||
if(lastSlashIndex < exe->length)
|
||||
*exeName = exe->chars + lastSlashIndex + 1;
|
||||
}
|
||||
|
||||
const char* ffProcessGetBasicInfoLinux(pid_t pid, FFstrbuf* name, pid_t* ppid, int32_t* tty)
|
||||
{
|
||||
if (pid <= 0)
|
||||
return "Invalid pid";
|
||||
|
||||
#ifdef __linux__
|
||||
|
||||
char procFilePath[64];
|
||||
if (ppid)
|
||||
{
|
||||
snprintf(procFilePath, sizeof(procFilePath), "/proc/%d/stat", (int)pid);
|
||||
char buf[PROC_FILE_BUFFSIZ];
|
||||
ssize_t nRead = ffReadFileData(procFilePath, sizeof(buf) - 1, buf);
|
||||
if(nRead <= 8)
|
||||
return "ffReadFileData(/proc/pid/stat, PROC_FILE_BUFFSIZ-1, buf) failed";
|
||||
buf[nRead] = '\0';
|
||||
|
||||
*ppid = 0;
|
||||
static_assert(sizeof(*ppid) == sizeof(int), "");
|
||||
|
||||
ffStrbufEnsureFixedLengthFree(name, 255);
|
||||
int tty_;
|
||||
if(
|
||||
sscanf(buf, "%*s (%255[^)]) %*c %d %*d %*d %d", name->chars, ppid, &tty_) < 2 || //stat (comm) state ppid pgrp session tty
|
||||
name->chars[0] == '\0'
|
||||
)
|
||||
return "sscanf(stat) failed";
|
||||
|
||||
ffStrbufRecalculateLength(name);
|
||||
if (tty)
|
||||
*tty = tty_ & 0xFF;
|
||||
}
|
||||
else
|
||||
{
|
||||
snprintf(procFilePath, sizeof(procFilePath), "/proc/%d/comm", (int)pid);
|
||||
ssize_t nRead = ffReadFileBuffer(procFilePath, name);
|
||||
if(nRead <= 0)
|
||||
return "ffReadFileBuffer(/proc/pid/comm, name) failed";
|
||||
ffStrbufTrimRightSpace(name);
|
||||
}
|
||||
|
||||
#elif defined(__APPLE__)
|
||||
|
||||
struct kinfo_proc proc;
|
||||
size_t size = sizeof(proc);
|
||||
if(sysctl(
|
||||
(int[]){CTL_KERN, KERN_PROC, KERN_PROC_PID, pid}, 4,
|
||||
&proc, &size,
|
||||
NULL, 0
|
||||
))
|
||||
return "sysctl(KERN_PROC_PID) failed";
|
||||
|
||||
ffStrbufSetS(name, proc.kp_proc.p_comm); //trancated to 16 chars
|
||||
if (ppid)
|
||||
*ppid = (pid_t)proc.kp_eproc.e_ppid;
|
||||
if (tty)
|
||||
{
|
||||
*tty = ((proc.kp_eproc.e_tdev >> 24) & 0xFF) == 0x10
|
||||
? proc.kp_eproc.e_tdev & 0xFFFFFF
|
||||
: -1;
|
||||
}
|
||||
|
||||
#elif defined(__FreeBSD__)
|
||||
|
||||
struct kinfo_proc proc;
|
||||
size_t size = sizeof(proc);
|
||||
if(sysctl(
|
||||
(int[]){CTL_KERN, KERN_PROC, KERN_PROC_PID, pid}, 4,
|
||||
&proc, &size,
|
||||
NULL, 0
|
||||
))
|
||||
return "sysctl(KERN_PROC_PID) failed";
|
||||
|
||||
ffStrbufSetS(name, proc.ki_comm);
|
||||
if (ppid)
|
||||
*ppid = (pid_t)proc.ki_ppid;
|
||||
if (tty)
|
||||
{
|
||||
if (proc.ki_tdev != NODEV && proc.ki_flag & P_CONTROLT)
|
||||
{
|
||||
const char* ttyName = devname(proc.ki_tdev, S_IFCHR);
|
||||
if (ffStrStartsWith(ttyName, "pts/"))
|
||||
*tty = (int32_t) strtol(ttyName + strlen("pts/"), NULL, 10);
|
||||
else
|
||||
*tty = -1;
|
||||
}
|
||||
else
|
||||
*tty = -1;
|
||||
}
|
||||
|
||||
#elif defined(__sun)
|
||||
char path[128];
|
||||
snprintf(path, sizeof(path), "/proc/%d/psinfo", (int) pid);
|
||||
psinfo_t proc;
|
||||
if (ffReadFileData(path, sizeof(proc), &proc) != sizeof(proc))
|
||||
return "ffReadFileData(psinfo) failed";
|
||||
|
||||
ffStrbufSetS(name, proc.pr_fname);
|
||||
if (ppid)
|
||||
*ppid = proc.pr_ppid;
|
||||
if (tty)
|
||||
*tty = (int) proc.pr_ttydev;
|
||||
|
||||
#else
|
||||
|
||||
return "Unsupported platform";
|
||||
|
||||
#endif
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
#include "common/io/io.h"
|
||||
|
||||
#include <Windows.h>
|
||||
#include <ntstatus.h>
|
||||
#include <winternl.h>
|
||||
|
||||
enum { FF_PIPE_BUFSIZ = 8192 };
|
||||
|
||||
@@ -124,3 +126,46 @@ const char* ffProcessAppendOutput(FFstrbuf* buffer, char* const argv[], bool use
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
bool ffProcessGetInfoWindows(uint32_t pid, uint32_t* ppid, FFstrbuf* pname, FFstrbuf* exe, const char** exeName, FFstrbuf* exePath, bool* gui)
|
||||
{
|
||||
FF_AUTO_CLOSE_FD HANDLE hProcess = pid == 0
|
||||
? GetCurrentProcess()
|
||||
: OpenProcess(PROCESS_QUERY_LIMITED_INFORMATION, FALSE, pid);
|
||||
|
||||
if (gui)
|
||||
*gui = GetGuiResources(hProcess, GR_GDIOBJECTS) > 0;
|
||||
|
||||
if(ppid)
|
||||
{
|
||||
PROCESS_BASIC_INFORMATION info = {};
|
||||
ULONG size;
|
||||
if(NT_SUCCESS(NtQueryInformationProcess(hProcess, ProcessBasicInformation, &info, sizeof(info), &size)))
|
||||
{
|
||||
assert(size == sizeof(info));
|
||||
*ppid = (uint32_t)info.InheritedFromUniqueProcessId;
|
||||
}
|
||||
else
|
||||
return false;
|
||||
}
|
||||
if(exe)
|
||||
{
|
||||
DWORD bufSize = exe->allocated;
|
||||
if(QueryFullProcessImageNameA(hProcess, 0, exe->chars, &bufSize))
|
||||
{
|
||||
// We use full path here
|
||||
// Querying command line of remote processes in Windows requires either WMI or ReadProcessMemory
|
||||
exe->length = bufSize;
|
||||
if (exePath) ffStrbufSet(exePath, exe);
|
||||
}
|
||||
else
|
||||
return false;
|
||||
}
|
||||
if(pname && exeName)
|
||||
{
|
||||
*exeName = exe->chars + ffStrbufLastIndexC(exe, '\\') + 1;
|
||||
ffStrbufSetS(pname, *exeName);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -4,11 +4,12 @@
|
||||
#include "util/mallocHelper.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <ctype.h>
|
||||
#ifdef _WIN32
|
||||
#include "util/windows/getline.h"
|
||||
#endif
|
||||
|
||||
static bool parsePropLinePointer(const char** line, const char* start, FFstrbuf* buffer)
|
||||
bool ffParsePropLinePointer(const char** line, const char* start, FFstrbuf* buffer)
|
||||
{
|
||||
if(**line == '\0')
|
||||
return false;
|
||||
@@ -32,7 +33,7 @@ static bool parsePropLinePointer(const char** line, const char* start, FFstrbuf*
|
||||
}
|
||||
|
||||
//Line doesn't match start, skip it
|
||||
if(**line != *start || **line == '\0')
|
||||
if(tolower(**line) != tolower(*start) || **line == '\0')
|
||||
return false;
|
||||
|
||||
//Line and start match, continue testing
|
||||
@@ -69,14 +70,9 @@ static bool parsePropLinePointer(const char** line, const char* start, FFstrbuf*
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ffParsePropLine(const char* line, const char* start, FFstrbuf* buffer)
|
||||
{
|
||||
return parsePropLinePointer(&line, start, buffer);
|
||||
}
|
||||
|
||||
bool ffParsePropLines(const char* lines, const char* start, FFstrbuf* buffer)
|
||||
{
|
||||
while(!parsePropLinePointer(&lines, start, buffer))
|
||||
while(!ffParsePropLinePointer(&lines, start, buffer))
|
||||
{
|
||||
while(*lines != '\0' && *lines != '\n')
|
||||
++lines;
|
||||
|
||||
@@ -8,12 +8,18 @@ typedef struct FFpropquery
|
||||
FFstrbuf* buffer;
|
||||
} FFpropquery;
|
||||
|
||||
bool ffParsePropLine(const char* line, const char* start, FFstrbuf* buffer);
|
||||
bool ffParsePropLines(const char* lines, const char* start, FFstrbuf* buffer);
|
||||
bool ffParsePropFileValues(const char* filename, uint32_t numQueries, FFpropquery* queries);
|
||||
bool ffParsePropFileHomeValues(const char* relativeFile, uint32_t numQueries, FFpropquery* queries);
|
||||
bool ffParsePropFileListValues(const FFlist* list, const char* relativeFile, uint32_t numQueries, FFpropquery* queries);
|
||||
|
||||
bool ffParsePropLinePointer(const char** line, const char* start, FFstrbuf* buffer);
|
||||
|
||||
static inline bool ffParsePropLine(const char* line, const char* start, FFstrbuf* buffer)
|
||||
{
|
||||
return ffParsePropLinePointer(&line, start, buffer);
|
||||
}
|
||||
|
||||
static inline bool ffParsePropFile(const char* filename, const char* start, FFstrbuf* buffer)
|
||||
{
|
||||
return ffParsePropFileValues(filename, 1, (FFpropquery[]){{start, buffer}});
|
||||
|
||||
+88
-90
@@ -6,45 +6,6 @@
|
||||
|
||||
#include <string.h>
|
||||
|
||||
typedef enum FFInitState
|
||||
{
|
||||
FF_INITSTATE_UNINITIALIZED = 0,
|
||||
FF_INITSTATE_SUCCESSFUL = 1,
|
||||
FF_INITSTATE_FAILED = 2
|
||||
} FFInitState;
|
||||
|
||||
#define FF_LIBRARY_DATA_LOAD_INIT(dataObject, userLibraryName, ...) \
|
||||
static dataObject data; \
|
||||
static FFInitState initState = FF_INITSTATE_UNINITIALIZED; \
|
||||
if(initState != FF_INITSTATE_UNINITIALIZED) {\
|
||||
return initState == FF_INITSTATE_SUCCESSFUL ? &data : NULL; \
|
||||
} \
|
||||
initState = FF_INITSTATE_SUCCESSFUL; \
|
||||
void* libraryHandle = ffLibraryLoad(&userLibraryName, __VA_ARGS__, NULL); \
|
||||
if(libraryHandle == NULL) { \
|
||||
initState = FF_INITSTATE_FAILED; \
|
||||
return NULL; \
|
||||
} \
|
||||
|
||||
#define FF_LIBRARY_DATA_LOAD_SYMBOL(symbolName) \
|
||||
data.ff ## symbolName = dlsym(libraryHandle, #symbolName); \
|
||||
if(data.ff ## symbolName == NULL) { \
|
||||
dlclose(libraryHandle); \
|
||||
initState = FF_INITSTATE_FAILED; \
|
||||
return NULL; \
|
||||
}
|
||||
|
||||
#define FF_LIBRARY_DATA_LOAD_RETURN \
|
||||
initState = FF_INITSTATE_SUCCESSFUL; \
|
||||
return &data;
|
||||
|
||||
#define FF_LIBRARY_DATA_LOAD_ERROR \
|
||||
{ \
|
||||
dlclose(libraryHandle); \
|
||||
initState = FF_INITSTATE_FAILED; \
|
||||
return NULL; \
|
||||
}
|
||||
|
||||
#ifdef FF_HAVE_GIO
|
||||
#include <gio/gio.h>
|
||||
|
||||
@@ -88,32 +49,39 @@ typedef struct GSettingsData
|
||||
FF_LIBRARY_SYMBOL(g_settings_schema_source_get_default)
|
||||
GSettingsSchemaSource* schemaSource;
|
||||
GVariantGetters variantGetters;
|
||||
|
||||
bool inited;
|
||||
} GSettingsData;
|
||||
|
||||
static const GSettingsData* getGSettingsData(void)
|
||||
{
|
||||
FF_LIBRARY_DATA_LOAD_INIT(GSettingsData, instance.config.library.libGIO, "libgio-2.0" FF_LIBRARY_EXTENSION, 1);
|
||||
static GSettingsData data;
|
||||
|
||||
FF_LIBRARY_DATA_LOAD_SYMBOL(g_settings_schema_source_lookup)
|
||||
FF_LIBRARY_DATA_LOAD_SYMBOL(g_settings_schema_has_key)
|
||||
FF_LIBRARY_DATA_LOAD_SYMBOL(g_settings_new_full)
|
||||
FF_LIBRARY_DATA_LOAD_SYMBOL(g_settings_get_value)
|
||||
FF_LIBRARY_DATA_LOAD_SYMBOL(g_settings_get_user_value)
|
||||
FF_LIBRARY_DATA_LOAD_SYMBOL(g_settings_get_default_value)
|
||||
FF_LIBRARY_DATA_LOAD_SYMBOL(g_settings_schema_source_get_default)
|
||||
if (!data.inited)
|
||||
{
|
||||
data.inited = true;
|
||||
FF_LIBRARY_LOAD(libgsettings, &instance.config.library.libGIO, NULL, "libgio-2.0" FF_LIBRARY_EXTENSION, 1);
|
||||
FF_LIBRARY_LOAD_SYMBOL_VAR(libgsettings, data, g_settings_schema_source_lookup, NULL)
|
||||
FF_LIBRARY_LOAD_SYMBOL_VAR(libgsettings, data, g_settings_schema_has_key, NULL)
|
||||
FF_LIBRARY_LOAD_SYMBOL_VAR(libgsettings, data, g_settings_new_full, NULL)
|
||||
FF_LIBRARY_LOAD_SYMBOL_VAR(libgsettings, data, g_settings_get_value, NULL)
|
||||
FF_LIBRARY_LOAD_SYMBOL_VAR(libgsettings, data, g_settings_get_user_value, NULL)
|
||||
FF_LIBRARY_LOAD_SYMBOL_VAR(libgsettings, data, g_settings_get_default_value, NULL)
|
||||
FF_LIBRARY_LOAD_SYMBOL_VAR(libgsettings, data, g_settings_schema_source_get_default, NULL)
|
||||
|
||||
#define data data.variantGetters
|
||||
FF_LIBRARY_DATA_LOAD_SYMBOL(g_variant_dup_string)
|
||||
FF_LIBRARY_DATA_LOAD_SYMBOL(g_variant_get_boolean)
|
||||
FF_LIBRARY_DATA_LOAD_SYMBOL(g_variant_get_int32)
|
||||
FF_LIBRARY_DATA_LOAD_SYMBOL(g_variant_unref);
|
||||
#undef data
|
||||
FF_LIBRARY_LOAD_SYMBOL_VAR(libgsettings, data.variantGetters, g_variant_dup_string, NULL)
|
||||
FF_LIBRARY_LOAD_SYMBOL_VAR(libgsettings, data.variantGetters, g_variant_get_boolean, NULL)
|
||||
FF_LIBRARY_LOAD_SYMBOL_VAR(libgsettings, data.variantGetters, g_variant_get_int32, NULL)
|
||||
FF_LIBRARY_LOAD_SYMBOL_VAR(libgsettings, data.variantGetters, g_variant_unref, NULL);
|
||||
|
||||
data.schemaSource = data.ffg_settings_schema_source_get_default();
|
||||
if(data.schemaSource == NULL)
|
||||
FF_LIBRARY_DATA_LOAD_ERROR
|
||||
data.schemaSource = data.ffg_settings_schema_source_get_default();
|
||||
if (data.schemaSource)
|
||||
libgsettings = NULL;
|
||||
}
|
||||
if(!data.schemaSource)
|
||||
return NULL;
|
||||
|
||||
FF_LIBRARY_DATA_LOAD_RETURN
|
||||
return &data;
|
||||
}
|
||||
|
||||
FFvariant ffSettingsGetGSettings(const char* schemaName, const char* path, const char* key, FFvarianttype type)
|
||||
@@ -161,27 +129,34 @@ typedef struct DConfData
|
||||
FF_LIBRARY_SYMBOL(dconf_client_new)
|
||||
GVariantGetters variantGetters;
|
||||
DConfClient* client;
|
||||
|
||||
bool inited;
|
||||
} DConfData;
|
||||
|
||||
static const DConfData* getDConfData(void)
|
||||
{
|
||||
FF_LIBRARY_DATA_LOAD_INIT(DConfData, instance.config.library.libDConf, "libdconf" FF_LIBRARY_EXTENSION, 2);
|
||||
static DConfData data;
|
||||
|
||||
FF_LIBRARY_DATA_LOAD_SYMBOL(dconf_client_read_full)
|
||||
FF_LIBRARY_DATA_LOAD_SYMBOL(dconf_client_new)
|
||||
if (!data.inited)
|
||||
{
|
||||
data.inited = true;
|
||||
|
||||
#define data data.variantGetters
|
||||
FF_LIBRARY_DATA_LOAD_SYMBOL(g_variant_dup_string)
|
||||
FF_LIBRARY_DATA_LOAD_SYMBOL(g_variant_get_boolean)
|
||||
FF_LIBRARY_DATA_LOAD_SYMBOL(g_variant_get_int32)
|
||||
FF_LIBRARY_DATA_LOAD_SYMBOL(g_variant_unref)
|
||||
#undef data
|
||||
FF_LIBRARY_LOAD(libdconf, &instance.config.library.libDConf, NULL, "libdconf" FF_LIBRARY_EXTENSION, 2);
|
||||
FF_LIBRARY_LOAD_SYMBOL_VAR(libdconf, data, dconf_client_read_full, NULL)
|
||||
FF_LIBRARY_LOAD_SYMBOL_VAR(libdconf, data, dconf_client_new, NULL)
|
||||
FF_LIBRARY_LOAD_SYMBOL_VAR(libdconf, data.variantGetters, g_variant_dup_string, NULL)
|
||||
FF_LIBRARY_LOAD_SYMBOL_VAR(libdconf, data.variantGetters, g_variant_get_boolean, NULL)
|
||||
FF_LIBRARY_LOAD_SYMBOL_VAR(libdconf, data.variantGetters, g_variant_get_int32, NULL)
|
||||
FF_LIBRARY_LOAD_SYMBOL_VAR(libdconf, data.variantGetters, g_variant_unref, NULL)
|
||||
|
||||
data.client = data.ffdconf_client_new();
|
||||
if(data.client == NULL)
|
||||
FF_LIBRARY_DATA_LOAD_ERROR
|
||||
data.client = data.ffdconf_client_new();
|
||||
if (data.client)
|
||||
libdconf = NULL;
|
||||
}
|
||||
if(!data.client)
|
||||
return NULL;
|
||||
|
||||
FF_LIBRARY_DATA_LOAD_RETURN
|
||||
return &data;
|
||||
}
|
||||
|
||||
FFvariant ffSettingsGetDConf(const char* key, FFvarianttype type)
|
||||
@@ -232,23 +207,35 @@ typedef struct XFConfData
|
||||
FF_LIBRARY_SYMBOL(xfconf_channel_get_bool)
|
||||
FF_LIBRARY_SYMBOL(xfconf_channel_get_int)
|
||||
FF_LIBRARY_SYMBOL(xfconf_init)
|
||||
|
||||
bool inited;
|
||||
} XFConfData;
|
||||
|
||||
static const XFConfData* getXFConfData(void)
|
||||
{
|
||||
FF_LIBRARY_DATA_LOAD_INIT(XFConfData, instance.config.library.libXFConf, "libxfconf-0" FF_LIBRARY_EXTENSION, 4);
|
||||
static XFConfData data;
|
||||
|
||||
FF_LIBRARY_DATA_LOAD_SYMBOL(xfconf_channel_get)
|
||||
FF_LIBRARY_DATA_LOAD_SYMBOL(xfconf_channel_has_property)
|
||||
FF_LIBRARY_DATA_LOAD_SYMBOL(xfconf_channel_get_string)
|
||||
FF_LIBRARY_DATA_LOAD_SYMBOL(xfconf_channel_get_bool)
|
||||
FF_LIBRARY_DATA_LOAD_SYMBOL(xfconf_channel_get_int)
|
||||
FF_LIBRARY_DATA_LOAD_SYMBOL(xfconf_init)
|
||||
if (!data.inited)
|
||||
{
|
||||
data.inited = true;
|
||||
FF_LIBRARY_LOAD(libxfconf, &instance.config.library.libXFConf, NULL, "libxfconf-0" FF_LIBRARY_EXTENSION, 4);
|
||||
|
||||
if(data.ffxfconf_init(NULL) == false)
|
||||
FF_LIBRARY_DATA_LOAD_ERROR
|
||||
FF_LIBRARY_LOAD_SYMBOL_VAR(libxfconf, data, xfconf_channel_get, NULL)
|
||||
FF_LIBRARY_LOAD_SYMBOL_VAR(libxfconf, data, xfconf_channel_has_property, NULL)
|
||||
FF_LIBRARY_LOAD_SYMBOL_VAR(libxfconf, data, xfconf_channel_get_string, NULL)
|
||||
FF_LIBRARY_LOAD_SYMBOL_VAR(libxfconf, data, xfconf_channel_get_bool, NULL)
|
||||
FF_LIBRARY_LOAD_SYMBOL_VAR(libxfconf, data, xfconf_channel_get_int, NULL)
|
||||
FF_LIBRARY_LOAD_SYMBOL_VAR(libxfconf, data, xfconf_init, NULL)
|
||||
if(!data.ffxfconf_init(NULL))
|
||||
data.ffxfconf_init = NULL;
|
||||
else
|
||||
libxfconf = NULL;
|
||||
}
|
||||
|
||||
FF_LIBRARY_DATA_LOAD_RETURN
|
||||
if(!data.ffxfconf_init)
|
||||
return NULL;
|
||||
|
||||
return &data;
|
||||
}
|
||||
|
||||
FFvariant ffSettingsGetXFConf(const char* channelName, const char* propertyName, FFvarianttype type)
|
||||
@@ -294,22 +281,33 @@ typedef struct SQLiteData
|
||||
FF_LIBRARY_SYMBOL(sqlite3_column_text)
|
||||
FF_LIBRARY_SYMBOL(sqlite3_finalize)
|
||||
FF_LIBRARY_SYMBOL(sqlite3_close)
|
||||
|
||||
bool inited;
|
||||
} SQLiteData;
|
||||
|
||||
static const SQLiteData* getSQLiteData(void)
|
||||
{
|
||||
FF_LIBRARY_DATA_LOAD_INIT(SQLiteData, instance.config.library.libSQLite3, "libsqlite3" FF_LIBRARY_EXTENSION, 1);
|
||||
static SQLiteData data;
|
||||
|
||||
FF_LIBRARY_DATA_LOAD_SYMBOL(sqlite3_open_v2)
|
||||
FF_LIBRARY_DATA_LOAD_SYMBOL(sqlite3_prepare_v2)
|
||||
FF_LIBRARY_DATA_LOAD_SYMBOL(sqlite3_step)
|
||||
FF_LIBRARY_DATA_LOAD_SYMBOL(sqlite3_data_count)
|
||||
FF_LIBRARY_DATA_LOAD_SYMBOL(sqlite3_column_int)
|
||||
FF_LIBRARY_DATA_LOAD_SYMBOL(sqlite3_column_text)
|
||||
FF_LIBRARY_DATA_LOAD_SYMBOL(sqlite3_finalize)
|
||||
FF_LIBRARY_DATA_LOAD_SYMBOL(sqlite3_close)
|
||||
if (!data.inited)
|
||||
{
|
||||
data.inited = true;
|
||||
FF_LIBRARY_LOAD(libsqlite, &instance.config.library.libSQLite3, NULL, "libsqlite3" FF_LIBRARY_EXTENSION, 1);
|
||||
FF_LIBRARY_LOAD_SYMBOL_VAR(libsqlite, data, sqlite3_open_v2, NULL)
|
||||
FF_LIBRARY_LOAD_SYMBOL_VAR(libsqlite, data, sqlite3_prepare_v2, NULL)
|
||||
FF_LIBRARY_LOAD_SYMBOL_VAR(libsqlite, data, sqlite3_step, NULL)
|
||||
FF_LIBRARY_LOAD_SYMBOL_VAR(libsqlite, data, sqlite3_data_count, NULL)
|
||||
FF_LIBRARY_LOAD_SYMBOL_VAR(libsqlite, data, sqlite3_column_int, NULL)
|
||||
FF_LIBRARY_LOAD_SYMBOL_VAR(libsqlite, data, sqlite3_column_text, NULL)
|
||||
FF_LIBRARY_LOAD_SYMBOL_VAR(libsqlite, data, sqlite3_finalize, NULL)
|
||||
FF_LIBRARY_LOAD_SYMBOL_VAR(libsqlite, data, sqlite3_close, NULL)
|
||||
libsqlite = NULL;
|
||||
}
|
||||
|
||||
FF_LIBRARY_DATA_LOAD_RETURN
|
||||
if (!data.ffsqlite3_close)
|
||||
return NULL;
|
||||
|
||||
return &data;
|
||||
}
|
||||
|
||||
int ffSettingsGetSQLite3Int(const char* dbPath, const char* query)
|
||||
|
||||
+2
-2
@@ -33,7 +33,7 @@
|
||||
#else
|
||||
#include <pthread.h>
|
||||
#include <signal.h>
|
||||
#if __has_include(<pthread_np.h>)
|
||||
#if FF_HAVE_PTHREAD_NP
|
||||
#include <pthread_np.h>
|
||||
#endif
|
||||
#define FF_THREAD_MUTEX_INITIALIZER PTHREAD_MUTEX_INITIALIZER
|
||||
@@ -51,7 +51,7 @@
|
||||
static inline void ffThreadDetach(FFThreadType thread) { pthread_detach(thread); }
|
||||
static inline bool ffThreadJoin(FFThreadType thread, FF_MAYBE_UNUSED uint32_t timeout)
|
||||
{
|
||||
#if (defined(__linux__) && !defined(__ANDROID__)) || __has_include(<pthread_np.h>)
|
||||
#if HAVE_TIMEDJOIN_NP
|
||||
if (timeout > 0)
|
||||
{
|
||||
struct timespec ts;
|
||||
|
||||
+2
-2
@@ -20,7 +20,7 @@ static inline uint64_t ffTimeGetTick() //In msec
|
||||
#else
|
||||
struct timespec timeNow;
|
||||
clock_gettime(CLOCK_MONOTONIC, &timeNow);
|
||||
return (uint64_t)((timeNow.tv_sec * 1000) + (timeNow.tv_nsec / 1000000));
|
||||
return (uint64_t)(((uint64_t) timeNow.tv_sec * 1000u) + ((uint64_t) timeNow.tv_nsec / 1000000u));
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ static inline uint64_t ffTimeGetNow()
|
||||
#else
|
||||
struct timespec timeNow;
|
||||
clock_gettime(CLOCK_REALTIME, &timeNow);
|
||||
return (uint64_t)((timeNow.tv_sec * 1000) + (timeNow.tv_nsec / 1000000));
|
||||
return (uint64_t)(((uint64_t) timeNow.tv_sec * 1000u) + ((uint64_t) timeNow.tv_nsec / 1000000u));
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
+181
-61
@@ -51,6 +51,18 @@
|
||||
{
|
||||
"long": "print-structure",
|
||||
"desc": "Print the default structure"
|
||||
},
|
||||
{
|
||||
"long": "format",
|
||||
"desc": "Set output format",
|
||||
"arg": {
|
||||
"type": "enum",
|
||||
"enum": {
|
||||
"default": "Default format",
|
||||
"json": "JSON format"
|
||||
},
|
||||
"default": "default"
|
||||
}
|
||||
}
|
||||
],
|
||||
"Config": [
|
||||
@@ -136,13 +148,23 @@
|
||||
"false": "Try `wayland`, then `x11`, then `drm`"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"long": "detect-version",
|
||||
"desc": "Whether to detect and display the version of terminal, shell and editor",
|
||||
"remark": "Mainly for benchmarking",
|
||||
"arg": {
|
||||
"type": "bool",
|
||||
"optional": true,
|
||||
"default": true
|
||||
}
|
||||
}
|
||||
],
|
||||
"Logo": [
|
||||
{
|
||||
"short": "l",
|
||||
"long": "logo",
|
||||
"desc": "Set the logo source",
|
||||
"desc": "Set the logo source. Use \"none\" to disable the logo",
|
||||
"remark": "Should be the name of a builtin logo, or a path to an image file. See also https://github.com/fastfetch-cli/fastfetch/wiki/Logo-options",
|
||||
"arg": {
|
||||
"type": "logo"
|
||||
@@ -245,12 +267,15 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"long": "logo-separate",
|
||||
"desc": "If true, print modules at bottom of the logo",
|
||||
"long": "logo-position",
|
||||
"desc": "Set the position of the logo should be displayed",
|
||||
"arg": {
|
||||
"type": "bool",
|
||||
"optional": true,
|
||||
"default": false
|
||||
"type": "enum",
|
||||
"enum": {
|
||||
"left": "Left",
|
||||
"top": "Top",
|
||||
"right": "Right"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -426,7 +451,7 @@
|
||||
},
|
||||
{
|
||||
"long": "pipe",
|
||||
"desc": "Disable logo and all escape sequences",
|
||||
"desc": "Disable colors",
|
||||
"remark": "Auto detection based on isatty(1)",
|
||||
"arg": {
|
||||
"type": "bool",
|
||||
@@ -457,6 +482,14 @@
|
||||
"type": "color"
|
||||
}
|
||||
},
|
||||
{
|
||||
"long": "color-separator",
|
||||
"desc": "Set the color of the key-value separator",
|
||||
"remark": "See `-h color` for the list of available colors",
|
||||
"arg": {
|
||||
"type": "color"
|
||||
}
|
||||
},
|
||||
{
|
||||
"long": "color",
|
||||
"desc": "Set the color of both the keys and title",
|
||||
@@ -472,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",
|
||||
@@ -516,28 +570,16 @@
|
||||
"default": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"long": "binary-prefix",
|
||||
"desc": "Set the binary prefix to used",
|
||||
"arg": {
|
||||
"type": "enum",
|
||||
"enum": {
|
||||
"IEC": "1024 Bytes = 1 KiB, 1024 KiB = 1 MiB, ...",
|
||||
"SI": "1000 Bytes = 1 KB, 1000 KB = 1 MB, ...",
|
||||
"JEDEC": "1024 Bytes = 1 kB, 1024 kB = 1 MB, ..."
|
||||
},
|
||||
"default": "IEC"
|
||||
}
|
||||
},
|
||||
{
|
||||
"long": "percent-type",
|
||||
"desc": "Set the percentage output type",
|
||||
"remark": [
|
||||
"1 for percentage number",
|
||||
"2 for bar",
|
||||
"2 for multi-color bar",
|
||||
"3 for both",
|
||||
"6 for bar only",
|
||||
"9 for colored number"
|
||||
"9 for colored number",
|
||||
"10 for monochrome bar"
|
||||
],
|
||||
"arg": {
|
||||
"type": "num",
|
||||
@@ -595,6 +637,22 @@
|
||||
"default": "-"
|
||||
}
|
||||
},
|
||||
{
|
||||
"long": "bar-border-left",
|
||||
"desc": "Set the string to use at left border of percentage bars",
|
||||
"arg": {
|
||||
"type": "string",
|
||||
"default": "[ "
|
||||
}
|
||||
},
|
||||
{
|
||||
"long": "bar-border-right",
|
||||
"desc": "Set the string to use at right border of percentage bars",
|
||||
"arg": {
|
||||
"type": "string",
|
||||
"default": " ]"
|
||||
}
|
||||
},
|
||||
{
|
||||
"long": "bar-width",
|
||||
"desc": "Set the width of percentage bars, in number of characters",
|
||||
@@ -603,15 +661,6 @@
|
||||
"default": 10
|
||||
}
|
||||
},
|
||||
{
|
||||
"long": "bar-border",
|
||||
"desc": "Whether to show a border around percentage bars",
|
||||
"arg": {
|
||||
"type": "bool",
|
||||
"optional": true,
|
||||
"default": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"long": "no-buffer",
|
||||
"desc": "Set if the stdout application buffer should be disabled",
|
||||
@@ -628,6 +677,19 @@
|
||||
"type": "num"
|
||||
}
|
||||
},
|
||||
{
|
||||
"long": "size-binary-prefix",
|
||||
"desc": "Set the binary prefix to used when formatting sizes",
|
||||
"arg": {
|
||||
"type": "enum",
|
||||
"enum": {
|
||||
"IEC": "1024 Bytes = 1 KiB, 1024 KiB = 1 MiB, ...",
|
||||
"SI": "1000 Bytes = 1 KB, 1000 KB = 1 MB, ...",
|
||||
"JEDEC": "1024 Bytes = 1 kB, 1024 kB = 1 MB, ..."
|
||||
},
|
||||
"default": "IEC"
|
||||
}
|
||||
},
|
||||
{
|
||||
"long": "size-max-prefix",
|
||||
"desc": "Set the largest binary prefix to use when formatting sizes",
|
||||
@@ -647,6 +709,14 @@
|
||||
"default": "YB"
|
||||
}
|
||||
},
|
||||
{
|
||||
"long": "freq-ndigits",
|
||||
"desc": "Set the number of digits to keep after the decimal point when printing CPU / GPU frequency in GHz",
|
||||
"arg": {
|
||||
"type": "num",
|
||||
"default": 2
|
||||
}
|
||||
},
|
||||
{
|
||||
"long": "temp-unit",
|
||||
"desc": "Set the unit of the temperature",
|
||||
@@ -694,26 +764,9 @@
|
||||
"type": "color",
|
||||
"default": "light_red"
|
||||
}
|
||||
},
|
||||
{
|
||||
"long": "ts-version",
|
||||
"desc": "Whether to detect and display the version of terminal and shell",
|
||||
"remark": "Mainly for benchmarking",
|
||||
"arg": {
|
||||
"type": "bool",
|
||||
"optional": true,
|
||||
"default": true
|
||||
}
|
||||
}
|
||||
],
|
||||
"Library path": [
|
||||
{
|
||||
"long": "lib-pci",
|
||||
"desc": "Pciutils. Used for GPU output",
|
||||
"arg": {
|
||||
"type": "path"
|
||||
}
|
||||
},
|
||||
{
|
||||
"long": "lib-vulkan",
|
||||
"desc": "Vulkan module & fallback for GPU output",
|
||||
@@ -882,6 +935,13 @@
|
||||
"arg": {
|
||||
"type": "path"
|
||||
}
|
||||
},
|
||||
{
|
||||
"long": "lib-elf",
|
||||
"desc": "Used for st terminal font detection and systemd version detection",
|
||||
"arg": {
|
||||
"type": "path"
|
||||
}
|
||||
}
|
||||
],
|
||||
"Module specific": [
|
||||
@@ -923,7 +983,7 @@
|
||||
},
|
||||
{
|
||||
"long": "separator-string",
|
||||
"desc": "Set the string printed by the separator module",
|
||||
"desc": "Set the string to be printed by the separator line",
|
||||
"arg": {
|
||||
"type": "str",
|
||||
"default": "-"
|
||||
@@ -931,12 +991,21 @@
|
||||
},
|
||||
{
|
||||
"long": "separator-output-color",
|
||||
"desc": "Set the color of the separator module",
|
||||
"desc": "Set the color of the separator line",
|
||||
"arg": {
|
||||
"type": "color",
|
||||
"default": "default"
|
||||
}
|
||||
},
|
||||
{
|
||||
"long": "separator-length",
|
||||
"desc": "Set the length of the separator line",
|
||||
"remark": "Set to 0 to automatically calculate it with the title length",
|
||||
"arg": {
|
||||
"type": "num",
|
||||
"default": "0"
|
||||
}
|
||||
},
|
||||
{
|
||||
"long": "disk-folders",
|
||||
"desc": "A colon (semicolon on Windows) separated list of folder paths to be detected",
|
||||
@@ -1145,16 +1214,17 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"long": "cpu-freq-ndigits",
|
||||
"desc": "Set the number of digits to keep after the decimal point when printing CPU frequency",
|
||||
"long": "cpu-show-pe-core-count",
|
||||
"desc": "Detect and display CPU frequency of different core types (eg. Pcore and Ecore) if supported",
|
||||
"arg": {
|
||||
"type": "num",
|
||||
"default": 2
|
||||
"type": "bool",
|
||||
"optional": true,
|
||||
"default": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"long": "cpu-show-pe-core-count",
|
||||
"desc": "Detect and display CPU frequency of different core types (eg. Pcore and Ecore) if supported",
|
||||
"long": "cpucache-compact",
|
||||
"desc": "Show all CPU caches in one line",
|
||||
"arg": {
|
||||
"type": "bool",
|
||||
"optional": true,
|
||||
@@ -1208,13 +1278,14 @@
|
||||
{
|
||||
"long": "gpu-detection-method",
|
||||
"desc": "Force using a specified method to detect GPUs",
|
||||
"remark": "Methods are used in this order: DRM (Linux only) -> PCI (Linux, FreeBSD and other platform specific methods) -> Vulkan -> OpenGL",
|
||||
"remark": "Will fall back to next methods if the specified method fails",
|
||||
"arg": {
|
||||
"type": "enum",
|
||||
"enum": {
|
||||
"auto": "Use DRM if available, which is most feature-rich. Requires proper DRM driver installed",
|
||||
"pci": "Search PCI devices, which do not requires any driver installed",
|
||||
"vulkan": "Use Vulkan API. Slow and requires vulkan driver installed",
|
||||
"auto": "Query platform specific graphic APIs. Requires proper GPU drivers installed. Not supported on FreeBSD",
|
||||
"pci": "Search PCI devices, which do not requires GPU driver installed. Not supported on Windows and macOS",
|
||||
"vulkan": "Use Vulkan API. Slow and requires proper vulkan driver installed. Used for Android",
|
||||
"opencl": "Use OpenCL API. Slow and requires proper OpenCL driver installed",
|
||||
"opengl": "Use OpenGL API. Slow and only detects one GPU"
|
||||
},
|
||||
"default": "auto"
|
||||
@@ -1250,6 +1321,15 @@
|
||||
"default": 2
|
||||
}
|
||||
},
|
||||
{
|
||||
"long": "loadavg-compact",
|
||||
"desc": "Show load average values in one line",
|
||||
"arg": {
|
||||
"type": "bool",
|
||||
"optional": true,
|
||||
"default": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"long": "localip-show-ipv4",
|
||||
"desc": "Show IPv4 addresses in local ip module",
|
||||
@@ -1330,6 +1410,19 @@
|
||||
"default": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"long": "dns-show-type",
|
||||
"desc": "Specify the type of DNS servers should be detected",
|
||||
"arg": {
|
||||
"type": "enum",
|
||||
"enum": {
|
||||
"ipv4": "Show IPv4 addresses only",
|
||||
"ipv6": "Show IPv6 addresses only",
|
||||
"both": "Show both IPv4 and IPv6 addresses"
|
||||
},
|
||||
"default": "both"
|
||||
}
|
||||
},
|
||||
{
|
||||
"long": "netio-name-prefix",
|
||||
"desc": "Show interfaces with given name prefix only",
|
||||
@@ -1413,6 +1506,24 @@
|
||||
"default": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"long": "users-compact",
|
||||
"desc": "Show all active users in one line",
|
||||
"arg": {
|
||||
"type": "bool",
|
||||
"optional": true,
|
||||
"default": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"long": "users-myself-only",
|
||||
"desc": "Show only current user",
|
||||
"arg": {
|
||||
"type": "bool",
|
||||
"optional": true,
|
||||
"default": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"long": "player-name",
|
||||
"desc": "The name of the player to use for module Media and Player",
|
||||
@@ -1464,13 +1575,14 @@
|
||||
"type": "enum",
|
||||
"enum": {
|
||||
"block": "\u2588\u2588\u2588",
|
||||
"background": "(whitespaces with background)",
|
||||
"circle": "\u25cf",
|
||||
"diamond": "\u25c6",
|
||||
"triangle": "\u25b2",
|
||||
"square": "\u25a0",
|
||||
"star": "\u2605"
|
||||
},
|
||||
"default": "block"
|
||||
"default": "background"
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -1553,6 +1665,14 @@
|
||||
},
|
||||
"pseudo": true
|
||||
},
|
||||
{
|
||||
"long": "<module>-key-icon",
|
||||
"desc": "Set the icon to be displayed by \"--key-type icon\"",
|
||||
"arg": {
|
||||
"type": "string"
|
||||
},
|
||||
"pseudo": true
|
||||
},
|
||||
{
|
||||
"long": "<module>-output-color",
|
||||
"desc": "Override the global \"--color-output\" option for each specific module",
|
||||
|
||||
+19
-5
@@ -1,10 +1,24 @@
|
||||
Usage: fastfetch --color <color>
|
||||
|
||||
Shortcut of `fastfetch --color-keys <color> --color-title <color>`.
|
||||
If no color is set, the main color of the logo will be used.
|
||||
|
||||
Following information applies to all settings
|
||||
|
||||
<color> must be a color encoding as ANSI escape sequences. It is inserted between "ESC[" and "m".
|
||||
Infos about them can be found here: https://en.wikipedia.org/wiki/ANSI_escape_code#SGR_(Select_Graphic_Rendition)_parameters.
|
||||
Examples:
|
||||
--color 35: sets the color to magenta. `--color magenta` is also supported
|
||||
--color 38;5;38: sets the color to 38th color of ANSI 256 colors
|
||||
--color 4;92: sets the color to bright Green with underline. `--color underline_green` is also supported
|
||||
--color 5;104: blinking text on a blue background
|
||||
If no color is set, the main color of the logo will be used.
|
||||
35: sets the color to magenta
|
||||
38;5;38: sets the color to 38th color of ANSI 256 colors
|
||||
4;92: sets the color to bright green with underline
|
||||
5;104: blinking text on a blue background
|
||||
|
||||
ANSI named colors are also supported:
|
||||
magenta: equivalent to `35`
|
||||
underline_bright_green: equivalent to `4;92`
|
||||
|
||||
After v2.15.0, some special keys can be used:
|
||||
keys: use the color set by `--color-keys`
|
||||
title: use the color set by `--color-title`
|
||||
output: use the color set by `--color-output`
|
||||
separator: use the color set by `--color-separator`
|
||||
|
||||
@@ -4,6 +4,15 @@ For example the format string "Values: {1} ({2})", with the values "First" and "
|
||||
The format string can contain placeholders in any order and have multiple occurrences.
|
||||
To include spaces when setting from the command line, surround the whole string with double quotes (").
|
||||
|
||||
In 2.14.0 or newer, the value indices can be meaningful named tags.
|
||||
For example: "--title-format '{user-name-colored}{at-symbol-colored}{host-name-colored}'" is equivalent to "--title-format '{6}{7}{8}'"
|
||||
See "fastfetch -h title-format" for all supported tags.
|
||||
|
||||
In 2.17.0 or newer, a truncation length can be specified using syntax '<arg>:<trunc-length>`
|
||||
For example: "--title-format '{user-name:5}'" will truncate user name into 5-length string.
|
||||
If '<trunc-length>' is negative, an ellipsis … will be appended at the end when the original string is truncated.
|
||||
Note: The string length is counted in raw bytes. Multi-byte unicode characters and ANSI escape codes are not taken into account.
|
||||
|
||||
If the value index is missing, meaning the placeholder is "{}", an internal counter sets the value index.
|
||||
This means that the format string "Values: {1} ({2})" is equivalent to "Values: {} ({})".
|
||||
Note that this counter only counts empty placeholders, so the format string "{2} {} {}" will contain the second value, then the first, and then the second again.
|
||||
@@ -16,7 +25,7 @@ To only print something if a variable is set, use "{?<index>} ... {?}".
|
||||
For example, to only print a second value if it is set, use "{?2} Second value: {2}{?}".
|
||||
If a "{?}" is found without an opener, it is printed as is.
|
||||
|
||||
To only print something if a variable is not set, do the same as with if, just replace every '?' with a '!'.
|
||||
To only print something if a variable is not set, do the same as with if, just replace every '?' with a '/'.
|
||||
For example to print a fallback for a second value if it is not set, use "{?2}{2}{?}{/2}Second value fallback{/}".
|
||||
|
||||
To stop formatting at any point in the format string, use "{-}".
|
||||
@@ -24,7 +33,7 @@ To stop formatting at any point in the format string, use "{-}".
|
||||
To print something with color, start a placeholder with a '#' and then the linux terminal color encoding.
|
||||
"\033[" at the start, and an 'm' at the end is automatically added, so don't do that.
|
||||
A "{#}" is equivalent to a "{#0}" and resets everything to normal.
|
||||
For example to print something pink and underline, use "{#4;35}...{#}".
|
||||
For example to print something pink and underline, use "{#4;35}...{#}". "{#underline_magenta}" is also supported. See `fastfetch -h color` for detail.
|
||||
Information about what the numbers mean can be found here: https://en.wikipedia.org/wiki/ANSI_escape_code#SGR_(Select_Graphic_Rendition)_parameters.
|
||||
Which escape codes are supported and how they look is defined by your terminal.
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ static void parseBattery(FFstrbuf* dir, const char* id, FFBatteryOptions* option
|
||||
|
||||
//capacity must exist and be not empty
|
||||
ffStrbufAppendS(dir, "/capacity");
|
||||
bool available = ffReadFileBuffer(dir->chars, &tmpBuffer);
|
||||
bool available = ffReadFileBuffer(dir->chars, &tmpBuffer); // This is expensive in my laptop
|
||||
ffStrbufSubstrBefore(dir, dirLength);
|
||||
|
||||
if (!available)
|
||||
|
||||
@@ -172,7 +172,7 @@ typedef struct FFSmbiosPortableBattery
|
||||
static_assert(offsetof(FFSmbiosPortableBattery, OEMSpecific) == 0x16,
|
||||
"FFSmbiosPortableBattery: Wrong struct alignment");
|
||||
|
||||
const char* detectBySmbios(FFBatteryResult* battery)
|
||||
static const char* detectBySmbios(FFBatteryResult* battery)
|
||||
{
|
||||
const FFSmbiosHeaderTable* smbiosTable = ffGetSmbiosHeaderTable();
|
||||
if (!smbiosTable)
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
#include "bios.h"
|
||||
|
||||
const char* ffDetectBios(FFBiosResult* bios)
|
||||
{
|
||||
return "Not supported on this platform";
|
||||
}
|
||||
@@ -1,5 +1,7 @@
|
||||
#include "bios.h"
|
||||
#include "util/smbiosHelper.h"
|
||||
|
||||
#ifdef _WIN32
|
||||
#include "util/windows/registry.h"
|
||||
|
||||
#include <ntstatus.h>
|
||||
@@ -25,7 +27,7 @@ typedef struct _SYSTEM_BOOT_ENVIRONMENT_INFORMATION
|
||||
};
|
||||
};
|
||||
} SYSTEM_BOOT_ENVIRONMENT_INFORMATION;
|
||||
|
||||
#endif
|
||||
|
||||
typedef struct FFSmbiosBios
|
||||
{
|
||||
@@ -74,6 +76,7 @@ const char* ffDetectBios(FFBiosResult* bios)
|
||||
if (data->Header.Length > offsetof(FFSmbiosBios, SystemBiosMajorRelease))
|
||||
ffStrbufSetF(&bios->release, "%u.%u", data->SystemBiosMajorRelease, data->SystemBiosMinorRelease);
|
||||
|
||||
#ifdef _WIN32
|
||||
// Same as GetFirmwareType, but support (?) Windows 7
|
||||
// https://ntdoc.m417z.com/system_information_class
|
||||
SYSTEM_BOOT_ENVIRONMENT_INFORMATION sbei;
|
||||
@@ -86,6 +89,7 @@ const char* ffDetectBios(FFBiosResult* bios)
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user