mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-09-12 10:22:12 +02:00
Compare commits
811 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 43bdb68cbf | |||
| 8b43e331e3 | |||
| 302716fa61 | |||
| 188b6aba10 | |||
| 7af9cab688 | |||
| 714b88c638 | |||
| d9f1db10aa | |||
| bb10e1c9a3 | |||
| 264b6794f3 | |||
| a8b734c877 | |||
| 10ca77610e | |||
| c2eaea3665 | |||
| 1619f0ab6c | |||
| aba211221b | |||
| 81485baadb | |||
| 1b4fc38330 | |||
| 3571d9277d | |||
| e9b535d277 | |||
| 09ffd32144 | |||
| 27aa5c0343 | |||
| 1d95f9b224 | |||
| 4f1cb779ab | |||
| 758ddae344 | |||
| 14969b31d0 | |||
| d88e2eeb36 | |||
| 7946e69a66 | |||
| 15766f5266 | |||
| ed02845c40 | |||
| 4ffa0ffcb7 | |||
| c04c040713 | |||
| c763896b49 | |||
| e9a44f71b2 | |||
| 5078c8d910 | |||
| f9e0efb7ee | |||
| 926390508e | |||
| 45446c1c1d | |||
| b79c47cac9 | |||
| fd16e69464 | |||
| 92abf3e063 | |||
| 90a242a4aa | |||
| 1118c57d8f | |||
| eda9496479 | |||
| 0b94ff5adb | |||
| 62bf3ec021 | |||
| ab2268a927 | |||
| 1421627a47 | |||
| 02e5232bda | |||
| 289d03cfb2 | |||
| 965ab1abc4 | |||
| 06b2ff9a08 | |||
| b4a6606faf | |||
| def758580f | |||
| 5ea2b2ecc9 | |||
| b3886c6c47 | |||
| bc76220a5b | |||
| 60fa7946f5 | |||
| b6a703bd56 | |||
| 462c3b0e06 | |||
| 72138dbde5 | |||
| b2ea5d8f3e | |||
| 49080c5361 | |||
| 445dd94b53 | |||
| 7c03fc1550 | |||
| 06a8f12d6a | |||
| 8c7edf4d2d | |||
| 85b4679373 | |||
| 215029ea27 | |||
| 533f54fb73 | |||
| a6212c5b01 | |||
| ba76b18367 | |||
| 4290efb49d | |||
| 30b85fc169 | |||
| dc94ac8d0c | |||
| 1d9e612262 | |||
| be1791e386 | |||
| 3b8c2d6ee6 | |||
| c661e55053 | |||
| 56403bab5c | |||
| caef317ade | |||
| 131e01f35b | |||
| c8e3c6882a | |||
| c985bdbbfd | |||
| b80eb47ecd | |||
| 68942c1d3f | |||
| b36b74448f | |||
| 217bb6657e | |||
| df2862996b | |||
| df6ab6427e | |||
| 82d848727c | |||
| d0d6323b1f | |||
| 6439921f85 | |||
| d28907ee9d | |||
| 41f0971570 | |||
| ab0bd79bb8 | |||
| 07747aa819 | |||
| 68efcdd0dd | |||
| fef3100fd7 | |||
| 08a940bfd4 | |||
| d6a99c631e | |||
| 3d4077c2d0 | |||
| ce6b595421 | |||
| 7d8c085254 | |||
| ec0af17fb5 | |||
| 2accfbc894 | |||
| 01d2fa1228 | |||
| f16843d60f | |||
| acc77ebddd | |||
| 7eb145fb7f | |||
| 34a6eb13c6 | |||
| 0f5e746fe2 | |||
| b62ad16aa6 | |||
| f79498e4b5 | |||
| 31c433b353 | |||
| 852c6abf2e | |||
| df3fa6f8a8 | |||
| 738daa1c77 | |||
| 4204cfc500 | |||
| 9cb08d115a | |||
| 459f159b1b | |||
| 2880536513 | |||
| 64cb1bfdfd | |||
| b80c30ace3 | |||
| 19b8849bfc | |||
| 8f457f047c | |||
| 299bc7468f | |||
| c213b0769b | |||
| 260c883d07 | |||
| da0db042fa | |||
| ae5732e2a8 | |||
| 1f05a33807 | |||
| f090951abc | |||
| 855fd6edee | |||
| d4bd4401a8 | |||
| 689feb39a4 | |||
| 0f64e2830a | |||
| 3e24cdc752 | |||
| dc9c285a0b | |||
| 1d03c9c85e | |||
| 4eae11df64 | |||
| eba13d5485 | |||
| 16b875ef5a | |||
| 366138e1bd | |||
| 7fe18a5b7c | |||
| 39cd8cfb4c | |||
| 8b441c85e5 | |||
| f66e901c44 | |||
| 3815823a20 | |||
| 33ff4870dc | |||
| 479731f076 | |||
| d2f3f47457 | |||
| 5ea89ecba5 | |||
| 865f57bd76 | |||
| e98e2a3d52 | |||
| 6bb748869e | |||
| 654721b8c5 | |||
| 0542eac1b9 | |||
| b9faf8d77f | |||
| 61f848146a | |||
| 4175dfdc3a | |||
| 861d9006d7 | |||
| 7ba07bd2e0 | |||
| 9fee36a286 | |||
| 2fc9230b29 | |||
| 5fb1286e15 | |||
| a4cace4765 | |||
| c6d2467a83 | |||
| db0d38202e | |||
| 9fbb23b135 | |||
| 3a990e495b | |||
| 648530ee8f | |||
| b12a59cdaf | |||
| 83c1fe26e6 | |||
| 217f98a36c | |||
| 1011e21ba8 | |||
| 08c6a6e4cb | |||
| 5e9fcaf7ca | |||
| 8b838cef61 | |||
| 22d9d8e196 | |||
| a789b8330a | |||
| 903ecf37f7 | |||
| c4a876f6aa | |||
| 82285ebeb4 | |||
| 36dadcdc7f | |||
| 030c05429a | |||
| a462a12370 | |||
| b386365d95 | |||
| 158db9d7c7 | |||
| 407bfa8c95 | |||
| 1449290e9e | |||
| 4c0ea7354d | |||
| 71cba2451a | |||
| ef3b5df048 | |||
| 3e98034e55 | |||
| 1c89101522 | |||
| 757e6271ff | |||
| c5c846aa22 | |||
| 23a59a15ec | |||
| 4798c619d0 | |||
| 023e767237 | |||
| 688d9b00ab | |||
| c2fe2f70dc | |||
| 3430c10ec2 | |||
| 9afcc00201 | |||
| cd783d1267 | |||
| 81480532e2 | |||
| 982e8a0117 | |||
| 8af88a3376 | |||
| 9ed2f13c78 | |||
| d7ea774d71 | |||
| a4b9784c48 | |||
| 3fe2d8091a | |||
| 78c903c403 | |||
| c42711ee26 | |||
| 367264e549 | |||
| 36a0c273f9 | |||
| 418106c485 | |||
| 1058e876a7 | |||
| 8721cc1ab5 | |||
| e12642e0b9 | |||
| 315bbb3020 | |||
| 0576d4ca26 | |||
| c309dbb844 | |||
| c71b04ba93 | |||
| f3417b1b05 | |||
| c597b7ec3a | |||
| 8b4586b914 | |||
| b65a0e2543 | |||
| 6e15a44168 | |||
| 6bd3d2c434 | |||
| 29644ef904 | |||
| 39dfcb6f10 | |||
| 882b17834c | |||
| bdd2908e6a | |||
| d4a402f4dd | |||
| 115b293ff5 | |||
| 6831c095ec | |||
| 81fb146869 | |||
| 35b54fd064 | |||
| 866e65749e | |||
| e157b9a51f | |||
| 74c89cc03f | |||
| 229c6674a4 | |||
| ab8ad7ffc0 | |||
| 6805cb16fb | |||
| e596d76430 | |||
| de4afb6507 | |||
| beb5f479d9 | |||
| e660e61027 | |||
| e3cdecdb14 | |||
| 40320e5efa | |||
| c2fd057126 | |||
| ea1ef0f347 | |||
| 04456d9807 | |||
| 18240524dc | |||
| 42b7d567a1 | |||
| 2790493cba | |||
| 8eabc49e12 | |||
| 3252812699 | |||
| 3fa308386f | |||
| 84ee7cef7c | |||
| 57f6aff2de | |||
| d745d7afef | |||
| 510a1f57f8 | |||
| a1c9b24755 | |||
| 75e6f48dfd | |||
| ed7b12e733 | |||
| 9c56839c97 | |||
| 6647980ce3 | |||
| 80f8b086ca | |||
| 8c2dd1aeac | |||
| ae3c6f1e63 | |||
| 7cc381339c | |||
| aa58a0999d | |||
| 4580f3fd54 | |||
| 6c0c4fa2cf | |||
| 526324be38 | |||
| efb0f335e1 | |||
| 9b23ce94ab | |||
| 47000f2aaf | |||
| cb3ca73f60 | |||
| fd0b35f21a | |||
| 0e7dda4043 | |||
| 5f7b9d2473 | |||
| f8cbe4c008 | |||
| 41df915f29 | |||
| ef440a015d | |||
| 180cbce3a2 | |||
| 64ec76f5a6 | |||
| 9860fb67d4 | |||
| 08cbba1d9d | |||
| 095149a4e9 | |||
| a561a96a5f | |||
| 073d6a9337 | |||
| 6851c9cc1a | |||
| 2862f466f3 | |||
| 5e3fdc6c33 | |||
| 03fe5803de | |||
| 6d36ec55c5 | |||
| f098cdbf69 | |||
| 07d3fe3044 | |||
| 636b6fc43d | |||
| ccfba6786c | |||
| 7c2c631807 | |||
| 6769410753 | |||
| 40b9af6c36 | |||
| e63dfdd8b1 | |||
| a6639d7211 | |||
| 3e251f602a | |||
| ec25ca9fc7 | |||
| 396d20f2da | |||
| 49181fd0bf | |||
| 5eb1dbe7bf | |||
| 690e988cab | |||
| fd41770d6e | |||
| fb26cb1394 | |||
| 4e4efa67e6 | |||
| 0dfb1b6bb1 | |||
| bcbca38b1e | |||
| 3f0ccf802c | |||
| 691cb4ac24 | |||
| 282939f548 | |||
| 6f35b2f382 | |||
| 6700f63091 | |||
| 5c37ebec70 | |||
| 28a419d252 | |||
| 95128ee95f | |||
| c94180b3d2 | |||
| 12ca1a0cf7 | |||
| 67564dfa2c | |||
| a1e79a9522 | |||
| e16f8ef349 | |||
| fd1a2072b3 | |||
| aa45e70910 | |||
| 5374feb24b | |||
| 12ac0ac7a9 | |||
| 3d78666ed3 | |||
| dd2cc116bd | |||
| ba2636dc1a | |||
| 69589f1ad5 | |||
| 39da11de8e | |||
| 8b7a4daeda | |||
| 82af7a5b52 | |||
| a2d99695fd | |||
| 3a2786a89f | |||
| a6cb30d6c8 | |||
| de6b1f9542 | |||
| 77431671bb | |||
| 4430b7145e | |||
| 898859cc7a | |||
| 43b96df112 | |||
| bb97893bd0 | |||
| 9b21ec6e1f | |||
| ffac354368 | |||
| a9aab51764 | |||
| 4d1fc9ceb1 | |||
| e897a98153 | |||
| 0a8056d835 | |||
| 9681e176b3 | |||
| 1f8be43881 | |||
| 30813551be | |||
| beb564f374 | |||
| 5c97c012a9 | |||
| 50da7cabd6 | |||
| a6528cdfd6 | |||
| 588201fe46 | |||
| 6184b5ee96 | |||
| 5e7baa9d0a | |||
| 79ae650c58 | |||
| 44107f289e | |||
| 75927a87b2 | |||
| 85da30ccf5 | |||
| f73c3b85c2 | |||
| 66bef2fc19 | |||
| 7c5eb021ee | |||
| f902e3b3d8 | |||
| 553124ab5b | |||
| 6c6d93370d | |||
| 55ae3a7dbd | |||
| 586874080f | |||
| d5b91a8983 | |||
| 72fee13112 | |||
| 20ae897f39 | |||
| 6f756d103f | |||
| c9dd858ce3 | |||
| 2e201eaaf7 | |||
| 7c54dcba69 | |||
| a107395707 | |||
| 8a9fe22855 | |||
| 7e04e23528 | |||
| 8d779f68f3 | |||
| 98ba08c1a0 | |||
| a1499b82f8 | |||
| c6c866d78a | |||
| 7a6999bd20 | |||
| 1084cf3523 | |||
| ed5f2a3968 | |||
| 17e1d4b72d | |||
| 912f6c4f3c | |||
| 77d71b5fef | |||
| 6938a73a8a | |||
| cee9df189d | |||
| 2a125e226b | |||
| 4a7e60ef57 | |||
| 0a6140346e | |||
| 01862ebc04 | |||
| 3185299214 | |||
| 5b6ebe4f11 | |||
| 6274ef591b | |||
| 7acdaebee4 | |||
| 6dcfb6b88f | |||
| 064972aecd | |||
| b9dbb66bd7 | |||
| a01792c06c | |||
| d707a67f89 | |||
| 5d8aa11d81 | |||
| a87463fc09 | |||
| d0a4a012c4 | |||
| 6a82d73fe9 | |||
| 7504484f21 | |||
| d497853af5 | |||
| c2f815f5ba | |||
| 4bd4ec2897 | |||
| fc685e9aa0 | |||
| 14d3bd89a7 | |||
| c3970154d6 | |||
| 66aee54401 | |||
| 979f7d19b1 | |||
| f238138711 | |||
| 6c88981b05 | |||
| c935527e6f | |||
| 04915945f5 | |||
| 153df44282 | |||
| 22012556f8 | |||
| d0b03c380b | |||
| de2cd79632 | |||
| cc40ef42f0 | |||
| ba45073e04 | |||
| a3c3f3829d | |||
| 79b7b15b46 | |||
| 111f7111b2 | |||
| 5147651bcb | |||
| ba60d9059f | |||
| 8f205b8c30 | |||
| e046787aec | |||
| 743eebaa6b | |||
| 609caad02f | |||
| a0c47204bb | |||
| 1c87693867 | |||
| 42b756e703 | |||
| d317997396 | |||
| 91dac1563b | |||
| 73cfae97d2 | |||
| 78a606c1e1 | |||
| f258e484d9 | |||
| ea162fd452 | |||
| b80391b183 | |||
| 4c7a9e4394 | |||
| 4b747f70a4 | |||
| 5fb4b6dc04 | |||
| 5e7cfe2976 | |||
| 77db2d84a3 | |||
| 15bb5bfb24 | |||
| 4e9ee9aa03 | |||
| 6a0c7ca788 | |||
| 90e99bcf69 | |||
| 5b20a86d53 | |||
| 6ad1262f4a | |||
| e0297e1dd1 | |||
| 937611aa29 | |||
| eda38e16db | |||
| 2731756c39 | |||
| 853ca0f608 | |||
| 17f4a6e055 | |||
| 925dc6f681 | |||
| 706527eab4 | |||
| 3a96ade423 | |||
| da9c928286 | |||
| 30d3d00900 | |||
| 99fce80d0d | |||
| a5a28e30a0 | |||
| 7fe39353df | |||
| a3576b3154 | |||
| c5d0d84001 | |||
| 467ed54a3b | |||
| 7ea8882843 | |||
| f4cb3bb33f | |||
| 330eb9fa21 | |||
| 1006f513f5 | |||
| 652c4b2e82 | |||
| 3c618a8cd0 | |||
| b5821de793 | |||
| dec604691c | |||
| 72baa6cca9 | |||
| 34b023a74f | |||
| 8249a8ed6a | |||
| 7e1ac5e24a | |||
| 55c72a8bb3 | |||
| b602bb20c2 | |||
| 46ed24275f | |||
| 71db83f806 | |||
| 0746afa0c2 | |||
| 805c384819 | |||
| 9e4c0e318c | |||
| 51eaac2fd7 | |||
| 92c3df82e6 | |||
| 7f238a701e | |||
| 72236f62ad | |||
| 51b0c43d76 | |||
| 79e2007d30 | |||
| 02eb604ceb | |||
| ce6b2b85f7 | |||
| 48d1980061 | |||
| 40fae5c5f1 | |||
| e296ee1040 | |||
| 199e71553d | |||
| 13fa218e5a | |||
| eed5efabea | |||
| d2315e967e | |||
| cbe3c70480 | |||
| c918226909 | |||
| 18472660ae | |||
| 458c2ccd01 | |||
| 7bb9efcebb | |||
| 8a42dfd68d | |||
| 3edd8a6740 | |||
| cba22b7155 | |||
| 246ad6d288 | |||
| 295e119810 | |||
| cfe22f9524 | |||
| de2c1d7786 | |||
| 7d74339aa0 | |||
| 7589e962c2 | |||
| 9a189694f9 | |||
| 4069fbfe7b | |||
| 7ccd886909 | |||
| 42957356b2 | |||
| 9038cd32b2 | |||
| 128c3bfea6 | |||
| 60ed822f6a | |||
| 527ec1bc61 | |||
| cbf203901b | |||
| cf6f3dbe0c | |||
| ab625497ce | |||
| 83532b68dd | |||
| cd2a1495b8 | |||
| b01d2bdd8c | |||
| 736d5316cc | |||
| efe42a2c7d | |||
| ee07755139 | |||
| 3d924eeadd | |||
| aaa091f23b | |||
| 53cd1e5378 | |||
| 3747683f0d | |||
| 59c1e3d8c5 | |||
| 1206f6d2ba | |||
| 9aad3e339a | |||
| ef9221f305 | |||
| 391a3a0430 | |||
| 6b0314f14b | |||
| 8e316eb080 | |||
| 999f2170fe | |||
| 0282b884cc | |||
| ef7e6d0a6a | |||
| 77253a8d81 | |||
| 2041272f5f | |||
| d2a41bdfe1 | |||
| 025a708ecb | |||
| 4e2c124442 | |||
| 79ba9d7a68 | |||
| ee60ec3530 | |||
| 9d7cbb0fe3 | |||
| 0b98a14977 | |||
| 8f51763374 | |||
| 28ea765f19 | |||
| 5378d05bfb | |||
| bbf04f0d40 | |||
| ec6195133b | |||
| fa8c99601c | |||
| a5d5de90f8 | |||
| 994fd359a5 | |||
| a9a5790cba | |||
| 31b3fe403a | |||
| 14b74fe51d | |||
| 35a5a03cd7 | |||
| f927b8ea87 | |||
| ebefcec3e2 | |||
| c151bf0b37 | |||
| a767104b96 | |||
| 18fced9b2e | |||
| 713ef0ce34 | |||
| 5b2db02bc1 | |||
| 0f69dc5980 | |||
| 6af57ff5b6 | |||
| 7d7789565b | |||
| 0eb76e9636 | |||
| 8b1ee64a3e | |||
| b0acf168bf | |||
| 7ddc207574 | |||
| d1a791b333 | |||
| 62ca495155 | |||
| e7974a7cea | |||
| 24cb83dd18 | |||
| da5c44b3d0 | |||
| bd71aa931f | |||
| 4d1f242e1d | |||
| d810245d55 | |||
| 06181ec433 | |||
| 8404ae034f | |||
| 8e7d465333 | |||
| 87813b3306 | |||
| 9610a1ab23 | |||
| 5f14781970 | |||
| 356488be0c | |||
| e013c87890 | |||
| 7d78d92a92 | |||
| 06af39835a | |||
| eee8fb78d2 | |||
| 413f91260d | |||
| a44daa04d6 | |||
| d6cb405afe | |||
| b2a853cb6e | |||
| 0168f2e9a8 | |||
| 3992d85eb6 | |||
| 5096180e92 | |||
| 947d2ff0a9 | |||
| 1e4f174415 | |||
| 2808b1a653 | |||
| c749f214e0 | |||
| d0d9831d41 | |||
| b3945e277c | |||
| 9f77851176 | |||
| 963eaa5395 | |||
| 07dfe57386 | |||
| a3c0085e2b | |||
| c8f28e4c79 | |||
| 861eea5899 | |||
| 1227799a38 | |||
| 35d1497053 | |||
| ea3734f004 | |||
| 5d35dade60 | |||
| 0c844fc342 | |||
| c1ed0a4e91 | |||
| e1af6fc0fe | |||
| c1d41a36bb | |||
| 958bde228b | |||
| 6655c446ba | |||
| 43657e8fd6 | |||
| 38f216291e | |||
| 01de158bba | |||
| 5a34b8d01f | |||
| afa0a7dac8 | |||
| 974ee2ab0d | |||
| ab1e3db665 | |||
| 95b64622c4 | |||
| d3c7529c45 | |||
| 89db425a03 | |||
| 269ad36df5 | |||
| 22cdb1247f | |||
| 905ed76ddd | |||
| 6da57d64c3 | |||
| 37e0a7b03f | |||
| 0c65cdc1f5 | |||
| 653e689f18 | |||
| a8aaf605b1 | |||
| 5f638a67ed | |||
| 0645f559af | |||
| f5a57ab747 | |||
| 92e05f7e38 | |||
| 8ba031b761 | |||
| fdb68669f4 | |||
| 12155e029b | |||
| 7926b74917 | |||
| 61af59fc00 | |||
| bc52613410 | |||
| f84bb1ebe2 | |||
| a160bc8de5 | |||
| cb599c6f2a | |||
| 5693700c16 | |||
| e8c067ff3d | |||
| 80cc4e3f4a | |||
| 8e78fadbeb | |||
| 1215eb06ca | |||
| 2aa899d83c | |||
| cf096eb101 | |||
| 5b4a26393d | |||
| 2ba878cbab | |||
| 0af40ab6a3 | |||
| b9777bec77 | |||
| 8801921d02 | |||
| c0c32456e8 | |||
| 640fa146c1 | |||
| de91429e1a | |||
| 1621484c96 | |||
| d8297d296e | |||
| 48bb82c8fb | |||
| c1c7f7b93f | |||
| 1d35811253 | |||
| fe0b43d92d | |||
| 446fe907d2 | |||
| d578f1006c | |||
| 33f3199383 | |||
| 21f3875c4f | |||
| 6bcd75835e | |||
| 24cec76251 | |||
| f8ac56691f | |||
| 810112cb26 | |||
| 2340c2afd7 | |||
| b6c8649cbf | |||
| 92a6b01133 | |||
| 396112e8ea | |||
| 5eacd0bb8e | |||
| ea3ea196aa | |||
| 0e6be69eb8 | |||
| d69e19377e | |||
| f4f466d4ba | |||
| 10b2fe13bd | |||
| b5dc4f59f1 | |||
| 7c0b743c61 | |||
| 6bd909c89d | |||
| 1fef41241a | |||
| 5c75e271ef | |||
| b6b1993f62 | |||
| cd0109c382 | |||
| 6698283430 | |||
| 83ce3e4554 | |||
| ff0f91dc3c | |||
| ab028964bf | |||
| 21353b8256 | |||
| 0a1de91a29 | |||
| b80da99fac | |||
| a95a80aa93 | |||
| 553338b2bc | |||
| a56c092a78 | |||
| 3f553b3266 | |||
| cae4b1c657 | |||
| bb489f9af3 | |||
| 275b53c6c0 | |||
| adae31304d | |||
| db6d5d7fd6 | |||
| bce96cf3f0 | |||
| 0707902532 | |||
| ef1d102e05 | |||
| c1f511c8f2 | |||
| 0284f6bfd1 | |||
| 6d50f1efdd | |||
| 4066c0d9e8 | |||
| 150e9fc650 | |||
| 36bce8fb0e | |||
| e5e70c1d92 | |||
| 12065bcfb0 | |||
| 73a30da7bc | |||
| 01fb491289 | |||
| 6c4a4bfe13 | |||
| 62647c3cb9 | |||
| 42694042f5 | |||
| d5997b9f29 | |||
| 969a67ed0f | |||
| 54bd4346ec | |||
| 17d6f84850 | |||
| 0972eb6986 | |||
| 0ee892f2de | |||
| b1f54ab7a2 | |||
| 5a372882fa | |||
| 16d34b6933 | |||
| f319a80dc5 | |||
| 60f5cc9079 | |||
| dd3b3f22ba | |||
| e672e40f8b | |||
| 91089a7fe9 | |||
| 677f39420b | |||
| f2da8305c7 | |||
| 060082885b | |||
| 3134a04b5c | |||
| d3bcef61da | |||
| b2cabd2af7 | |||
| 5e85864ab0 | |||
| cb68dccd0e | |||
| 3b6d5468da | |||
| 350388295d | |||
| e7aa6c3757 | |||
| c100e0dff7 | |||
| 02999ae4bf | |||
| b5a01400e9 | |||
| ef8bd63075 | |||
| 58e8403e16 | |||
| 34b0bbac26 | |||
| 97c6966939 | |||
| be38182ab2 | |||
| d2d4ee89d8 | |||
| 113b1b8fc2 | |||
| cf98e6f5a1 | |||
| e85a4b9ff5 | |||
| b7935aa238 | |||
| a13520c5ff | |||
| dfb0eecf86 | |||
| c5695542b2 | |||
| a1d81b4964 | |||
| 72ed11ec9e | |||
| 1c5179d3b0 | |||
| adc506d2b3 | |||
| b2236cc046 | |||
| 3040bc38cb | |||
| b9368ac20d | |||
| a4f5a9af03 | |||
| f8be6322df | |||
| 4a1bbb6a03 | |||
| 961e9a6a5f | |||
| 2f4b210f33 | |||
| 456a58c8f5 | |||
| b8b15c5170 | |||
| 61485cb133 |
@@ -7,19 +7,25 @@ assignees: ''
|
||||
|
||||
---
|
||||
|
||||
Be sure to read [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 -->
|
||||
|
||||
# General description of bug:
|
||||
|
||||
* What happened:
|
||||
* 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/)?
|
||||
|
||||
# Often helpful information:
|
||||
|
||||
The content of the configuration file you use (if any)
|
||||
Screenshot:
|
||||
<!-- Paste the screenshot here -->
|
||||
|
||||
The content of the configuration file you use (if any):
|
||||
```
|
||||
//paste here
|
||||
```
|
||||
@@ -38,24 +44,27 @@ Output of `fastfetch --list-features`:
|
||||
//paste here
|
||||
```
|
||||
|
||||
## If fastfatch crashed
|
||||
## If fastfatch crashed or freezed
|
||||
|
||||
Paste the stacktrace here. You may get it with:
|
||||
|
||||
```
|
||||
$ gdb /path/to/fastfetch
|
||||
$ run
|
||||
$ bt
|
||||
```shell
|
||||
# You may need Ctrl+C to stop the process if it freezes
|
||||
gdb -q -ex 'set confirm off' -ex run -ex 'bt full' -ex quit --args /path/to/fastfetch
|
||||
```
|
||||
|
||||
If you are able to identify which module crashed, the strace can be helpful too
|
||||
|
||||
```
|
||||
$ strace /path/to/fastfetch --multithreading false --structure {MODULE} --pipe
|
||||
```shell
|
||||
strace /path/to/fastfetch --multithreading false -s {MODULE} --pipe
|
||||
```
|
||||
|
||||
If you cannot do the instructions above, please upload the core dump file:
|
||||
|
||||
## If fastfetch is slow
|
||||
|
||||
Use `time fastfetch --stat` to show time usage for each module.
|
||||
|
||||
## If my image logo didn't show / work
|
||||
|
||||
<!-- Please make sure the terminal does support the image protocol you used. Note Gnome terminal doesn't support any image protocols -->
|
||||
@@ -67,10 +76,5 @@ If you cannot do the instructions above, please upload the core dump file:
|
||||
|
||||
## If fastfetch behaves incorrectly on shell starting
|
||||
|
||||
<!-- NOTE for zsh / p10k users:
|
||||
There are known incompatibility between fastfetch and p10k instant prompt.
|
||||
The p10k doc clearly states that you should NOT print anything to stdout after p10k-instant-prompt is initialized.
|
||||
You should either put `fastfetch` before initialization of p10k-instant-prompt (recommended), remove it or use `fastfetch --pipe false` -->
|
||||
|
||||
* The bug is reproduceable with fresh / clean shell configuration (i.e. `fastfetch` is the single line of `.zshrc` or `~/.config/fish/config.fish`):
|
||||
* Does `sleep 1` before running `fastfetch` work?
|
||||
|
||||
@@ -7,10 +7,28 @@ assignees: ''
|
||||
|
||||
---
|
||||
|
||||
<!-- Before requesting a new feature, please try `fastfetch -c all.jsonc` to see if it has been supported -->
|
||||
## Before requesting a new feature
|
||||
|
||||
# Current state:
|
||||
* 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
|
||||
|
||||
# Wanted state:
|
||||
```jsonc
|
||||
// ~/.config/fastfetch/fastfetch.jsonc
|
||||
{
|
||||
"modules": [
|
||||
{
|
||||
"type": "command",
|
||||
"text": "/path/to/your/script",
|
||||
"key": "Feature Title"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
# Why the change is sensible:
|
||||
## Wanted features:
|
||||
|
||||
<!-- Your features here -->
|
||||
|
||||
## Motivation:
|
||||
|
||||
<!-- Your motivation here -->
|
||||
|
||||
@@ -7,9 +7,11 @@ assignees: ''
|
||||
|
||||
---
|
||||
|
||||
Tip: A logo can be displayed by fastfetch without getting into fastfetch's official repo. For highly customized logo for personal use, it's recommended to keep it locally. Please refer to https://github.com/fastfetch-cli/fastfetch/wiki/Migrate-Neofetch-Logo-To-Fastfetch
|
||||
|
||||
# OS
|
||||
```
|
||||
Paste content of /etc/os-release here. If this file doesn't exist, describe a way to identify the distro.
|
||||
Paste content of /etc/os-release and /etc/lsb-release here. If none of these files exist, describe a way to identify the distro
|
||||
```
|
||||
|
||||
# Ascii
|
||||
|
||||
+300
-90
@@ -10,34 +10,23 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: checkout repository
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install codespell
|
||||
shell: bash
|
||||
run: sudo apt update && sudo apt install -y codespell
|
||||
run: |
|
||||
sudo apt-get update || true
|
||||
sudo apt-get install -y codespell
|
||||
|
||||
- name: Run Spellchecker
|
||||
run: codespell
|
||||
|
||||
linux-buildtest:
|
||||
name: Linux build test
|
||||
no-features-test:
|
||||
name: No-features-test
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
security-events: write
|
||||
contents: read
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [ubuntu-22.04, ubuntu-20.04]
|
||||
compiler: [
|
||||
{ cc: gcc, cxx: "g++" },
|
||||
{ cc: clang, cxx: "clang++" },
|
||||
{ cc: "musl-gcc", cxx: "musl-g++" }
|
||||
]
|
||||
enableFeatures: [ON, OFF]
|
||||
exclude:
|
||||
# The feature libraries are all build against glibc, so they can't be used with musl
|
||||
- compiler: { cc: "musl-gcc", cxx: "musl-g++" }
|
||||
enableFeatures: ON
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: checkout repository
|
||||
uses: actions/checkout@v4
|
||||
@@ -45,22 +34,13 @@ jobs:
|
||||
- name: uname -a
|
||||
run: uname -a
|
||||
|
||||
- name: install required packages
|
||||
run: sudo apt-get update && sudo apt-get install -y musl-dev musl-tools linux-headers-generic libpci-dev 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 directx-headers-dev libdrm-dev
|
||||
|
||||
- name: configure project
|
||||
env:
|
||||
CC: ${{ matrix.compiler.cc }}
|
||||
CXX: ${{ matrix.compiler.cxx }}
|
||||
run: cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DENABLE_LIBPCI=${{ matrix.enableFeatures }} -DENABLE_VULKAN=${{ matrix.enableFeatures }} -DENABLE_WAYLAND=${{ matrix.enableFeatures }} -DENABLE_XCB_RANDR=${{ matrix.enableFeatures }} -DENABLE_XCB=${{ matrix.enableFeatures }} -DENABLE_XRANDR=${{ matrix.enableFeatures }} -DENABLE_X11=${{ matrix.enableFeatures }} -DENABLE_GIO=${{ matrix.enableFeatures }} -DENABLE_DCONF=${{ matrix.enableFeatures }} -DENABLE_DBUS=${{ matrix.enableFeatures }} -DENABLE_XFCONF=${{ matrix.enableFeatures }} -DENABLE_SQLITE3=${{ matrix.enableFeatures }} -DENABLE_RPM=${{ matrix.enableFeatures }} -DENABLE_IMAGEMAGICK7=${{ matrix.enableFeatures }} -DENABLE_IMAGEMAGICK6=${{ matrix.enableFeatures }} -DENABLE_CHAFA=${{ matrix.enableFeatures }} -DENABLE_ZLIB=${{ matrix.enableFeatures }} -DENABLE_EGL=${{ matrix.enableFeatures }} -DENABLE_GLX=${{ matrix.enableFeatures }} -DENABLE_OSMESA=${{ matrix.enableFeatures }} -DENABLE_OPENCL=${{ matrix.enableFeatures }} -DENABLE_LIBNM=${{ matrix.enableFeatures }} -DENABLE_PULSE=${{ matrix.enableFeatures }} -DENABLE_DIRECTX_HEADERS=${{ matrix.enableFeatures }} -DENABLE_DRM=${{ matrix.enableFeatures }} .
|
||||
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
|
||||
|
||||
- name: build project
|
||||
run: cmake --build .
|
||||
run: cmake --build . --target package --verbose -j4
|
||||
|
||||
- name: run tests
|
||||
run: ctest
|
||||
|
||||
- name: run fastfetch --list-features
|
||||
- name: list features
|
||||
run: ./fastfetch --list-features
|
||||
|
||||
- name: run fastfetch
|
||||
@@ -72,9 +52,15 @@ jobs:
|
||||
- name: run flashfetch
|
||||
run: time ./flashfetch
|
||||
|
||||
linux:
|
||||
name: Linux
|
||||
runs-on: ubuntu-20.04 # 22.04 ships a newer version of glibc than debian stable, allow those people to use the debian package
|
||||
- name: print dependencies
|
||||
run: ldd fastfetch
|
||||
|
||||
- name: run tests
|
||||
run: ctest
|
||||
|
||||
linux-amd64:
|
||||
name: Linux-amd64
|
||||
runs-on: ubuntu-20.04
|
||||
permissions:
|
||||
security-events: write
|
||||
contents: read
|
||||
@@ -88,15 +74,15 @@ jobs:
|
||||
run: uname -a
|
||||
|
||||
- name: install required packages
|
||||
run: sudo apt-get update && sudo apt-get install -y libpci-dev 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 libnm-dev libpulse-dev libdrm-dev directx-headers-dev
|
||||
|
||||
- name: install linuxbrew packages
|
||||
run: |
|
||||
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
|
||||
/home/linuxbrew/.linuxbrew/bin/brew install imagemagick ddcutil --ignore-dependencies
|
||||
/home/linuxbrew/.linuxbrew/bin/brew install imagemagick chafa ddcutil --ignore-dependencies
|
||||
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@v2
|
||||
uses: github/codeql-action/init@v3
|
||||
with:
|
||||
languages: c
|
||||
|
||||
@@ -104,10 +90,10 @@ jobs:
|
||||
run: PKG_CONFIG_PATH=/home/linuxbrew/.linuxbrew/lib/pkgconfig:$PKG_CONFIG_PATH cmake -DSET_TWEAK=Off -DBUILD_TESTS=On -DCMAKE_INSTALL_PREFIX=/usr .
|
||||
|
||||
- name: build project
|
||||
run: cmake --build . --target package --verbose
|
||||
run: cmake --build . --target package --verbose -j4
|
||||
|
||||
- name: perform CodeQL analysis
|
||||
uses: github/codeql-action/analyze@v2
|
||||
uses: github/codeql-action/analyze@v3
|
||||
|
||||
- name: list features
|
||||
run: ./fastfetch --list-features
|
||||
@@ -132,14 +118,166 @@ jobs:
|
||||
run: echo "ffversion=$(./fastfetch --version-raw)" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: upload artifacts
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: fastfetch-linux
|
||||
name: fastfetch-linux-amd64
|
||||
path: ./fastfetch-*.*
|
||||
|
||||
macos:
|
||||
name: MacOS
|
||||
runs-on: macos-latest
|
||||
linux-aarch64:
|
||||
name: Linux-aarch64
|
||||
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: aarch64
|
||||
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 libnm-dev libpulse-dev libdrm-dev libddcutil-dev libchafa-dev directx-headers-dev rpm
|
||||
cmake -DSET_TWEAK=Off -DBUILD_TESTS=On -DCMAKE_INSTALL_PREFIX=/usr .
|
||||
cmake --build . --target package --verbose -j4
|
||||
./fastfetch --list-features
|
||||
time ./fastfetch -c presets/ci.jsonc
|
||||
time ./fastfetch -c presets/ci.jsonc --format json
|
||||
time ./flashfetch
|
||||
ldd fastfetch
|
||||
ctest
|
||||
|
||||
- name: upload artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: fastfetch-linux-aarch64
|
||||
path: ./fastfetch-*.*
|
||||
|
||||
linux-armv7:
|
||||
name: Linux-armv7
|
||||
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: armv7
|
||||
distro: ubuntu20.04
|
||||
githubToken: ${{ github.token }}
|
||||
run: |
|
||||
uname -a
|
||||
apt-get update && apt-get install -y wget
|
||||
# CMake installed by apt has bug `list sub-command REMOVE_ITEM requires two or more arguments`
|
||||
wget --no-check-certificate https://apt.kitware.com/ubuntu/pool/main/c/cmake/{cmake_3.29.2-0kitware1ubuntu20.04.1_armhf.deb,cmake-data_3.29.2-0kitware1ubuntu20.04.1_all.deb}
|
||||
dpkg -i *.deb
|
||||
apt-get install -y make g++ libvulkan-dev libwayland-dev libxrandr-dev libxcb-randr0-dev libdconf-dev libdbus-1-dev libmagickcore-dev libxfconf-0-dev libsqlite3-dev librpm-dev libegl-dev libglx-dev libosmesa6-dev ocl-icd-opencl-dev libnm-dev libpulse-dev libdrm-dev directx-headers-dev rpm
|
||||
cmake -DSET_TWEAK=Off -DBUILD_TESTS=On -DCMAKE_INSTALL_PREFIX=/usr .
|
||||
cmake --build . --target package --verbose -j4
|
||||
./fastfetch --list-features
|
||||
time ./fastfetch -c presets/ci.jsonc
|
||||
time ./fastfetch -c presets/ci.jsonc --format json
|
||||
time ./flashfetch
|
||||
ldd fastfetch
|
||||
ctest
|
||||
|
||||
- name: upload artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: fastfetch-linux-armv7
|
||||
path: ./fastfetch-*.*
|
||||
|
||||
musl-amd64:
|
||||
name: Musl-amd64
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: setup alpine linux
|
||||
uses: jirutka/setup-alpine@master
|
||||
|
||||
- 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++
|
||||
shell: alpine.sh --root {0}
|
||||
|
||||
- name: build
|
||||
run: |
|
||||
cmake -DSET_TWEAK=Off -DBUILD_TESTS=On -DCMAKE_INSTALL_PREFIX=/usr -DIS_MUSL=ON -GNinja .
|
||||
cmake --build . --target package --verbose -j4
|
||||
shell: alpine.sh {0}
|
||||
|
||||
- name: run
|
||||
run: |
|
||||
./fastfetch --list-features
|
||||
time ./fastfetch -c presets/ci.jsonc
|
||||
time ./fastfetch -c presets/ci.jsonc --format json
|
||||
time ./flashfetch
|
||||
ldd fastfetch
|
||||
ctest
|
||||
shell: alpine.sh {0}
|
||||
|
||||
- name: upload artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: fastfetch-musl-amd64
|
||||
path: ./fastfetch-*.*
|
||||
|
||||
musl-aarch64:
|
||||
name: Musl-aarch64
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: setup alpine linux
|
||||
uses: jirutka/setup-alpine@master
|
||||
with:
|
||||
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++
|
||||
shell: alpine.sh --root {0}
|
||||
|
||||
- name: build
|
||||
run: |
|
||||
cmake -DSET_TWEAK=Off -DBUILD_TESTS=On -DCMAKE_INSTALL_PREFIX=/usr -DIS_MUSL=ON -GNinja .
|
||||
cmake --build . --target package --verbose -j4
|
||||
shell: alpine.sh {0}
|
||||
|
||||
- name: run
|
||||
run: |
|
||||
./fastfetch --list-features
|
||||
time ./fastfetch -c presets/ci.jsonc
|
||||
time ./fastfetch -c presets/ci.jsonc --format json
|
||||
time ./flashfetch
|
||||
ldd fastfetch
|
||||
ctest
|
||||
shell: alpine.sh {0}
|
||||
|
||||
- name: upload artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: fastfetch-musl-aarch64
|
||||
path: ./fastfetch-*.*
|
||||
|
||||
macos-universal:
|
||||
name: macOS-universal
|
||||
runs-on: macos-12
|
||||
permissions:
|
||||
security-events: write
|
||||
contents: read
|
||||
@@ -152,11 +290,10 @@ jobs:
|
||||
|
||||
- name: install required packages
|
||||
run: |
|
||||
brew update
|
||||
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1 brew install vulkan-loader vulkan-headers molten-vk imagemagick chafa
|
||||
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1 brew install --overwrite vulkan-loader vulkan-headers molten-vk imagemagick chafa
|
||||
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@v2
|
||||
uses: github/codeql-action/init@v3
|
||||
with:
|
||||
languages: c
|
||||
|
||||
@@ -164,10 +301,10 @@ jobs:
|
||||
run: cmake -DSET_TWEAK=Off -DBUILD_TESTS=On -DCMAKE_OSX_ARCHITECTURES='arm64;x86_64' .
|
||||
|
||||
- name: build project
|
||||
run: cmake --build . --target package --verbose
|
||||
run: cmake --build . --target package --verbose -j4
|
||||
|
||||
- name: perform CodeQL analysis
|
||||
uses: github/codeql-action/analyze@v2
|
||||
uses: github/codeql-action/analyze@v3
|
||||
|
||||
- name: list features
|
||||
run: ./fastfetch --list-features
|
||||
@@ -188,14 +325,14 @@ jobs:
|
||||
run: ctest
|
||||
|
||||
- name: upload artifacts
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: fastfetch-macos
|
||||
name: fastfetch-macos-universal
|
||||
path: ./fastfetch-*.*
|
||||
|
||||
freebsd:
|
||||
name: FreeBSD
|
||||
runs-on: macos-12
|
||||
freebsd-amd64:
|
||||
name: FreeBSD-amd64
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
security-events: write
|
||||
contents: read
|
||||
@@ -204,16 +341,19 @@ jobs:
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: run VM
|
||||
uses: cross-platform-actions/action@v0.21.1
|
||||
uses: cross-platform-actions/action@master
|
||||
with:
|
||||
operating_system: freebsd
|
||||
architecture: x86-64
|
||||
cpu_count: 3
|
||||
shell: bash
|
||||
version: '13.2'
|
||||
run: |
|
||||
uname -a
|
||||
sudo pkg update
|
||||
sudo pkg install -y cmake git pkgconf binutils pciutils wayland vulkan-headers vulkan-loader libxcb libXrandr libX11 libdrm glib dconf dbus sqlite3-tcl xfce4-conf ImageMagick6 ImageMagick7 chafa egl libosmesa opencl ocl-icd pulseaudio
|
||||
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
|
||||
cmake --build . --target package --verbose -j4
|
||||
./fastfetch --list-features
|
||||
time ./fastfetch
|
||||
time ./fastfetch --format json
|
||||
@@ -222,13 +362,50 @@ jobs:
|
||||
ctest
|
||||
|
||||
- name: upload artifacts
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: fastfetch-freebsd
|
||||
name: fastfetch-freebsd-amd64
|
||||
path: ./fastfetch-*.*
|
||||
|
||||
win64:
|
||||
name: Win64
|
||||
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
|
||||
permissions:
|
||||
security-events: write
|
||||
@@ -245,7 +422,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-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
|
||||
|
||||
- name: print msys version
|
||||
run: uname -a
|
||||
@@ -254,7 +431,7 @@ jobs:
|
||||
run: env PKG_CONFIG_PATH=/clang64/lib/pkgconfig/:$PKG_CONFIG_PATH cmake -DSET_TWEAK=Off -DBUILD_TESTS=On .
|
||||
|
||||
- name: build project
|
||||
run: cmake --build . --verbose
|
||||
run: cmake --build . --verbose -j4
|
||||
|
||||
- name: copy necessary dlls
|
||||
run: cp /clang64/bin/{OpenCL,vulkan-1}.dll .
|
||||
@@ -278,19 +455,19 @@ jobs:
|
||||
run: ctest
|
||||
|
||||
- name: create zip archive
|
||||
run: 7z a -tzip -mx9 -bd -y fastfetch-$(./fastfetch --version-raw)-Win64.zip *.dll fastfetch.exe flashfetch.exe presets
|
||||
run: 7z a -tzip -mx9 -bd -y fastfetch-windows-amd64.zip *.dll fastfetch.exe flashfetch.exe presets
|
||||
|
||||
- name: create 7z archive
|
||||
run: 7z a -t7z -mx9 -bd -y fastfetch-$(./fastfetch --version-raw)-Win64.7z *.dll fastfetch.exe flashfetch.exe presets
|
||||
run: 7z a -t7z -mx9 -bd -y fastfetch-windows-amd64.7z *.dll fastfetch.exe flashfetch.exe presets
|
||||
|
||||
- name: upload artifacts
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: fastfetch-win64
|
||||
path: ./fastfetch-*-Win64.*
|
||||
name: fastfetch-windows-amd64
|
||||
path: ./fastfetch-windows-amd64.*
|
||||
|
||||
win32:
|
||||
name: Win32
|
||||
windows-i686:
|
||||
name: Windows-i686
|
||||
runs-on: windows-latest
|
||||
permissions:
|
||||
security-events: write
|
||||
@@ -307,13 +484,13 @@ jobs:
|
||||
with:
|
||||
msystem: CLANG32
|
||||
update: true
|
||||
install: git mingw-w64-clang-i686-7zip mingw-w64-clang-i686-cmake mingw-w64-clang-i686-clang mingw-w64-clang-i686-vulkan-loader mingw-w64-clang-i686-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
|
||||
|
||||
- name: print msys version
|
||||
run: uname -a
|
||||
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@v2
|
||||
uses: github/codeql-action/init@v3
|
||||
with:
|
||||
languages: c, cpp
|
||||
|
||||
@@ -321,10 +498,10 @@ jobs:
|
||||
run: env PKG_CONFIG_PATH=/clang32/lib/pkgconfig/:$PKG_CONFIG_PATH cmake -DSET_TWEAK=Off -DBUILD_TESTS=On .
|
||||
|
||||
- name: build project
|
||||
run: cmake --build . --verbose
|
||||
run: cmake --build . --verbose -j4
|
||||
|
||||
- name: perform CodeQL analysis
|
||||
uses: github/codeql-action/analyze@v2
|
||||
uses: github/codeql-action/analyze@v3
|
||||
|
||||
- name: copy necessary dlls
|
||||
run: cp /clang32/bin/{OpenCL,vulkan-1}.dll .
|
||||
@@ -345,44 +522,77 @@ jobs:
|
||||
run: ctest
|
||||
|
||||
- name: create zip archive
|
||||
run: 7z a -tzip -mx9 -bd -y fastfetch-$(./fastfetch --version-raw)-Win32.zip *.dll fastfetch.exe flashfetch.exe presets
|
||||
run: 7z a -tzip -mx9 -bd -y fastfetch-windows-i686.zip *.dll fastfetch.exe flashfetch.exe presets
|
||||
|
||||
- name: create 7z archive
|
||||
run: 7z a -t7z -mx9 -bd -y fastfetch-$(./fastfetch --version-raw)-Win32.7z *.dll fastfetch.exe flashfetch.exe presets
|
||||
run: 7z a -t7z -mx9 -bd -y fastfetch-windows-i686.7z *.dll fastfetch.exe flashfetch.exe presets
|
||||
|
||||
- name: upload artifacts
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: fastfetch-win32
|
||||
path: ./fastfetch-*-Win32.*
|
||||
name: fastfetch-windows-i686
|
||||
path: ./fastfetch-windows-i686.*
|
||||
|
||||
release:
|
||||
if: github.event_name == 'push' && github.ref == 'refs/heads/master' && github.repository == 'fastfetch-cli/fastfetch'
|
||||
name: Release
|
||||
runs-on: ubuntu-latest
|
||||
needs:
|
||||
- linux
|
||||
- macos
|
||||
- freebsd
|
||||
- win64
|
||||
- win32
|
||||
- linux-amd64
|
||||
- linux-aarch64
|
||||
- linux-armv7
|
||||
- musl-amd64
|
||||
- musl-aarch64
|
||||
- macos-universal
|
||||
- freebsd-amd64
|
||||
- freebsd-aarch64
|
||||
- windows-amd64
|
||||
- windows-i686
|
||||
permissions:
|
||||
contents: write
|
||||
steps:
|
||||
- name: download artifacts
|
||||
uses: actions/download-artifact@v3
|
||||
|
||||
- name: get latest release version
|
||||
id: get_version_release
|
||||
uses: pozetroninc/github-action-get-latest-release@master
|
||||
with:
|
||||
repository: ${{ github.repository }}
|
||||
|
||||
- name: download artifacts
|
||||
if: needs.linux-amd64.outputs.ffversion != steps.get_version_release.outputs.release
|
||||
uses: actions/download-artifact@v4
|
||||
|
||||
- name: create release
|
||||
if: needs.linux.outputs.ffversion != steps.get_version_release.outputs.release
|
||||
if: needs.linux-amd64.outputs.ffversion != steps.get_version_release.outputs.release
|
||||
uses: ncipollo/release-action@v1
|
||||
with:
|
||||
tag: ${{ needs.linux.outputs.ffversion }}
|
||||
tag: ${{ needs.linux-amd64.outputs.ffversion }}
|
||||
commit: ${{ github.sha }}
|
||||
artifactErrorsFailBuild: true
|
||||
artifacts: fastfetch-linux/*,fastfetch-macos/*,fastfetch-freebsd/*,fastfetch-win64/*,fastfetch-win32/*
|
||||
artifacts: fastfetch-*/fastfetch-*
|
||||
body: "Please refer to [CHANGELOG.md](https://github.com/${{ github.repository }}/blob/${{ needs.linux-amd64.outputs.ffversion }}/CHANGELOG.md) for details."
|
||||
|
||||
- name: download source tarballs
|
||||
if: needs.linux-amd64.outputs.ffversion != steps.get_version_release.outputs.release
|
||||
run: |
|
||||
for i in 1 2 3 4 5; do curl -L --remote-name-all --output-dir fastfetch-source --create-dirs https://github.com/${{ github.repository }}/archive/refs/tags/${{ needs.linux-amd64.outputs.ffversion }}.{tar.gz,zip} && break || sleep 5; done
|
||||
ls fastfetch-*/*
|
||||
|
||||
- name: generate release notes
|
||||
if: needs.linux-amd64.outputs.ffversion != steps.get_version_release.outputs.release
|
||||
run: |
|
||||
echo "Please refer to [CHANGELOG.md](https://github.com/${{ github.repository }}/blob/${{ needs.linux-amd64.outputs.ffversion }}/CHANGELOG.md) for details." > fastfetch-release-notes.md
|
||||
echo -e "\n---\n\n<details><summary>SHA256SUMs</summary><br>\n\n\`\`\`" >> fastfetch-release-notes.md
|
||||
sha256sum fastfetch-*/* >> fastfetch-release-notes.md
|
||||
echo -e "\`\`\`\n</details>" >> fastfetch-release-notes.md
|
||||
echo -e "\n<details><summary>SHA512SUMs</summary><br>\n\n\`\`\`" >> fastfetch-release-notes.md
|
||||
sha512sum fastfetch-*/* >> fastfetch-release-notes.md
|
||||
echo -e "\`\`\`\n</details>" >> fastfetch-release-notes.md
|
||||
|
||||
- name: update release body
|
||||
if: needs.linux-amd64.outputs.ffversion != steps.get_version_release.outputs.release
|
||||
uses: ncipollo/release-action@v1
|
||||
with:
|
||||
tag: ${{ needs.linux-amd64.outputs.ffversion }}
|
||||
commit: ${{ github.sha }}
|
||||
bodyFile: fastfetch-release-notes.md
|
||||
allowUpdates: true
|
||||
|
||||
+6
-6
@@ -1,9 +1,9 @@
|
||||
**/build/
|
||||
**/.vscode/
|
||||
**/.cache/
|
||||
**/.kdev4/
|
||||
**/.DS_Store
|
||||
/.vs
|
||||
build/
|
||||
.vs/
|
||||
.vscode/
|
||||
.cache/
|
||||
.kdev4/
|
||||
.DS_Store
|
||||
cscope.*
|
||||
tags
|
||||
fastfetch.kdev4
|
||||
|
||||
+480
@@ -1,3 +1,483 @@
|
||||
# 2.13.0
|
||||
|
||||
Changes:
|
||||
* Option `--gpu-force-vulkan <?bool>` has been changed to `--gpu-detection-method <enum>`
|
||||
* Use `--gpu-detection-method vulkan` to get the old behavior
|
||||
* See `fastfetch -h gpu-detection-method` for detail
|
||||
* In Linux, BIOS limited CPU frequency is printed by default to match the behavior of neofetch (CPU, Linux, #947)
|
||||
|
||||
Features:
|
||||
* Add new module `Bootmgr` which prints information of stage 2 bootloader (grub, system-boot, etc)
|
||||
* Requires root permission to work on Windows and FreeBSD
|
||||
* Requires booting in UEFI mode
|
||||
* Add package manager lpkg and lpkg-build support (Packages, Linux)
|
||||
* Improve macOS 10.13 compatibility (macOS)
|
||||
* Detect core count for performance / efficiency cores (CPU)
|
||||
* Test it with `fastfetch -s cpu --cpu-format '{9}'`
|
||||
* Support min / max frequency and physical core count detection in FreeBSD, if kernel supports it (CPU, FreeBSD)
|
||||
* Detect DRM driver version if DRM detection method is used (GPU, Linux)
|
||||
|
||||
Bugfixes:
|
||||
* Don't detect `clifm` and `valgrind` as a terminal (Terminal, Linux)
|
||||
* Improve stability (PhysicalMemory, FreeBSD)
|
||||
* Fix bssid & status detection (Wifi, FreeBSD)
|
||||
* Ensure createTime is correctly initialized (Disk, FreeBSD / macOS)
|
||||
* Fix `--cpu-freq-ndigits` not working if `--cpu-format` is used
|
||||
* Fix `nix-user` package count detection (Packages, Linux)
|
||||
* Fix some memory leaks
|
||||
|
||||
Logos:
|
||||
* Fix Manjaro logo not displayed
|
||||
* Add SpoinkOS
|
||||
* Add Loc-OS
|
||||
* Add Furreto Linux
|
||||
* Fix TorizonCore logo colors
|
||||
* Fix KDE neon logo not displayed
|
||||
|
||||
# 2.12.0
|
||||
|
||||
Changes:
|
||||
* The long deprecated flag based config files are removed.
|
||||
* They can still be used with `xargs fastfetch < /path/to/config.conf`
|
||||
* `--gen-config` can be used to migrate them to json based config files
|
||||
* The long deprecated options `--set` and `--set-keyless` are removed.
|
||||
* `Kernel` module now prints kernel name by default
|
||||
|
||||
Features:
|
||||
* Support `st` terminal font detection for font configuration compiled in `st` binary (TerminalFont, Linux)
|
||||
* Add option `--color-output` to change output color of all modules except `Title`, `Separator`
|
||||
* `display.color.output` in JSONC config file
|
||||
* Add option `--<module>-output-color` to change output color of one specified module, which overrides the global option `--color-output`
|
||||
* Add option `--publicip-ipv6` to print IPv6 address (PublicIP)
|
||||
* Add new module `Loadavg` to print load averages (Loadavg)
|
||||
* Add new module `PhysicalMemory` to print information of physical memory devices (PhysicalMemory)
|
||||
* Requires root permission to work on Linux and FreeBSD
|
||||
* Support specifying `--logo-width` only for `--kitty-direct` and `--iterm` (Logo)
|
||||
* Add option `--localip-show-all-ips` to show all IPs assigned to the same interface (LocalIP)
|
||||
* Default to `false`
|
||||
* Improve compatibility with `(*term)` (#909, Terminal, macOS)
|
||||
* Support GPU core count and frequency detection for Asahi Linux (GPU, Linux)
|
||||
|
||||
Bugfixes:
|
||||
* Rename option `--temperature-unit` to `--temp-unit` as documented in help messages
|
||||
* Fix alternate logo doesn't work with `{ "type": "builtin" }` (#914, Logo)
|
||||
|
||||
Logos:
|
||||
* Fix DahliaOS detection
|
||||
* Add openSUSE Slowroll
|
||||
* Add macOS3
|
||||
* Add Quirinux
|
||||
|
||||
# 2.11.5
|
||||
|
||||
Bugfix:
|
||||
* Fix logo printing for OpenMandriva (#896)
|
||||
* Remove `--os-file` in help messages
|
||||
|
||||
# 2.11.4
|
||||
|
||||
Changes:
|
||||
* Fastfetch will print a colorless ascii logo in `--pipe` mode for better `lolcat` compatibility. `fastfetch | lolcat` should work and no `--pipe false` needed.
|
||||
* Previously the logo would be disabled in `--pipe` mode.
|
||||
* Use `--pipe -l none` to get the old beheavior
|
||||
* `--os-file` was removed and CMake option `-DCUSTOM_OS_RELEASE_PATH=/path/to/os-release` was introduced for configuring at compile time by package managers if needed. This option should not used in most cases.
|
||||
|
||||
Bugfixes:
|
||||
* Fix possible out-of-bound memory access (#868)
|
||||
* Fix Apple Terminal detection (#878, macOS, Terminal)
|
||||
* Fix deprecation warning for macOS 14.0 hopefully (#860, macOS, Camera)
|
||||
* Fix memory leaks when passing informative options (#888)
|
||||
* Fix JSON config `size.ndigits` doesn't work
|
||||
|
||||
Features:
|
||||
* Enable `--pipe` mode if environment variable `$NO_COLOR` is set
|
||||
* Support Armbian and Proxmox distro detection (OS, Linux)
|
||||
|
||||
Logo:
|
||||
* Add Armbian
|
||||
|
||||
# 2.11.3
|
||||
|
||||
Hotfix for nix (https://github.com/NixOS/nixpkgs/issues/308849#issuecomment-2093962376)
|
||||
|
||||
Features:
|
||||
* Add cmake option `CUSTOM_AMDGPU_IDS_PATH` for specifying custom path of `amdgpu.ids`
|
||||
|
||||
Bugfixes:
|
||||
* Fix hanging when detecting disconnected network drive (Disk, Windows)
|
||||
* Ensure line ending is printed when printing image logo errors (Logo)
|
||||
* Revert image logo limitation change in 2.11.2; allow image logo in SSH session and tmux again (#861, Logo)
|
||||
* Fix doubled output in custom formation (PhysicalDisk, Windows)
|
||||
|
||||
# 2.11.2
|
||||
|
||||
Hotfix for Debian 11
|
||||
|
||||
Changes:
|
||||
* Error messages when trying to print image logo will only be printed with `--show-errors`
|
||||
* When generating JSON output, fastfetch will generate an empty array when no result is detected, instead of an error.
|
||||
|
||||
Bugfixes:
|
||||
* Fix segfault in Debian 11 and some old kernels. Regression introduced in 2.11.0 (#845, GPU, Linux)
|
||||
* Don't try detecting version of raw `sh` shell (#849, Shell, Linux)
|
||||
* Trim `\r` on Windows
|
||||
|
||||
Features:
|
||||
* Check xdg state home for nix user packages (#837, Packages, Linux)
|
||||
* Disable image logos in ssh and tmux sessions (#839)
|
||||
* Support MX Linux distro detection (#847, OS, Linux)
|
||||
|
||||
Logo:
|
||||
* Add KernelOS
|
||||
* Fix name of DraugerOS
|
||||
* Add missing `FF_LOGO_LINE_TYPE_SMALL_BIT` flags
|
||||
* Add MX2
|
||||
|
||||
# 2.11.1
|
||||
|
||||
Hotfix for Android
|
||||
|
||||
Bugfixes:
|
||||
* Fix uninitialized variables which can cause crashes (#760 #838, Battery, Android)
|
||||
* Don't detect hyfetch as shell when used as backend of [hyfetch](https://github.com/hykilpikonna/hyfetch)
|
||||
* Fix incorrect information in man page (#828)
|
||||
|
||||
Features:
|
||||
* Support sorcery package manager detection (Packages, Linux)
|
||||
* Make `--custom-format` optional (Custom)
|
||||
* Make `/` an alias of `C:\` for `--disk-folders` (Disk, Windows)
|
||||
* Build for Linux armv7
|
||||
|
||||
Logo:
|
||||
* Fix colors of Source Mage logo
|
||||
|
||||
# 2.11.0
|
||||
|
||||
Changes:
|
||||
* Default `hideCursor` to false. It doesn't make much difference but makes user's terminal unusable if fastfetch is not exited correctly.
|
||||
* Linux amd64 binaries are built with Ubuntu 20.04 again (#808)
|
||||
|
||||
Bugfixes:
|
||||
* Fix swap usage detection in x86-32 build (Windows, Swap)
|
||||
* Fix minimum cmake version support (#810)
|
||||
* Fix wifi detection on platforms that don't use NetworkManager (#811, Wifi, Linux)
|
||||
* Fix NixOS wrapped process name (#814, Terminal, Linux)
|
||||
* Fix GPU type detection for AMD cards (#816, GPU, Linux)
|
||||
* Silence system deprecation warnings (#822, Camera, macOS)
|
||||
|
||||
Features:
|
||||
* Add basic support DE detection support for UKUI (DE, Linux)
|
||||
* Support printing total number of nix / flatpak / brew packages (Packages)
|
||||
* See `fastfetch -h packages-format` for detail
|
||||
* Better max CPU frequency detection support with `CPUID / 16H` instruction (CPU, Windows)
|
||||
* This requires Intel Core I Gen 6 or newer, and with `Virtual Machine Platform` Windows feature disabled. X86 only.
|
||||
* Improve performance of nix packages detection (Packages, Linux)
|
||||
* Make config specified in JSONC overridable by command line flags
|
||||
* Note this change only make global config overridable; module configs are still not
|
||||
* Suggest increasing `--processing-timeout` when child process timeouts
|
||||
* Only detect folders that specified by `--disk-folders`
|
||||
* Previously `--disk-folders` only omits unmatched disks from output
|
||||
* This option can be used to improve detection performance by ignoring slow network drives
|
||||
|
||||
# 2.10.2
|
||||
|
||||
Bugfixes:
|
||||
* Fix a regression that detect x11 as wayland (#805, WM, Linux)
|
||||
|
||||
# 2.10.1
|
||||
|
||||
Bugfixes:
|
||||
* Fix build with `-DENABLE_DBUS=OFF` (Linux)
|
||||
|
||||
# 2.10.0
|
||||
|
||||
Changes:
|
||||
* We now always detect max frequency of GPUs for consistent, instead of current frequency
|
||||
|
||||
Features:
|
||||
* Improve display detection for wlroots based WMs. Fastfetch now correctly reports fractional scale factors in hyprland (Display, Linux)
|
||||
* 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 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
|
||||
* Improve performance of detecting WSL version (Host, Linux)
|
||||
|
||||
Bugfixes:
|
||||
* Correctly detect `/bin/sh` as current shell if it's used as default shell (#798, Shell, Linux)
|
||||
* Work around an issue which CPU module reports incorrect CPU frequency that is too high (#800, CPU, Linux)
|
||||
* Don't print ANSI escape codes in `--pipe` mode
|
||||
|
||||
# 2.9.2
|
||||
|
||||
Changes:
|
||||
* To make use of the newly introduced `yyjson` flag `YYJSON_WRITE_NEWLINE_AT_END`, fastfetch now requires `yyjson` 0.9.0 or later
|
||||
|
||||
Features:
|
||||
* Always add a final new-line when generating JSON output
|
||||
* Detect partition create time, which can be used as OS installation time (Disk)
|
||||
* Print time string when generating JSON result instead of UNIX epoch time number, which is more human-readable
|
||||
|
||||
Bugfixes:
|
||||
* Fix a memory leak
|
||||
* Better portable mode detection of Windows Terminal (TerminalFont, Windows)
|
||||
* Fix parsing of option `--packages-disabled` (Packages)
|
||||
* Don't use command `time` as a shell (Shell)
|
||||
|
||||
Logos:
|
||||
* Add openSUSE MicroOS
|
||||
* Fix color of AOSC OS
|
||||
|
||||
# 2.9.1
|
||||
|
||||
Features:
|
||||
* Support weston-terminal (missed commit in v2.9.0) (TerminalFont, Linux)
|
||||
* Support hyprcursor detection (#776, Cursor, Linux)
|
||||
|
||||
Bugfixes:
|
||||
* Fix `fastfetch --gen-config` raises SIGSEGV when `~/.config/fastfetch` doesn't exist. Regression of `2.9.0` (#778)
|
||||
|
||||
# 2.9.0
|
||||
|
||||
Features:
|
||||
* Support Lxterminal version detection (Terminal, Linux)
|
||||
* Support weston-terminal version detection (Terminal, Linux)
|
||||
* Support `am` package manager detection (#771, Packages, Linux)
|
||||
* Support network prefix length detection for IPv6 (LocalIP)
|
||||
* Display all IPs when multiple IPs are assigned to the same interface (LocalIP)
|
||||
* Add option `--localip-show-prefix-len` to show network prefix length for both IPv4 and IPv6. Defaults to `true` (LocalIP)
|
||||
|
||||
Bugfixes:
|
||||
* Fix network prefix length detection when the value is greater than 24 (#773, LocalIP, Linux)
|
||||
* For xfce4-terminal, use system mono font if no config file is found (TerminalFont, Linux)
|
||||
|
||||
# 2.8.10
|
||||
|
||||
Bugfixes:
|
||||
* Don't display 0.00 GHz (CPU, FreeBSD)
|
||||
* Don't detect manufactor of Qualcomm as ARM (CPU, Android)
|
||||
* Ignore `chezmoi` (Terminal, Linux)
|
||||
* Trim trailing possible whitespaces (PublicIP)
|
||||
* Fix detection compatibility for KDE 6 (Font, Linux)
|
||||
* Always use Metal API to detect vmem size (GPU, macOS)
|
||||
|
||||
Features:
|
||||
* Improve stability; print more useful error message; avoid misuse (PublicIP / Weather)
|
||||
* Use MS-DOS device name as mountFrom result, instead of useless GUID volume name (Windows, Disk)
|
||||
* Some adjustments to Terminal detection (Terminal, Windows)
|
||||
* Don't pretty print CMD
|
||||
* Print conhost as Windows Console
|
||||
* Don't detect `wininit` as Terminal
|
||||
|
||||
Logo:
|
||||
* Fix color of Arco Linux
|
||||
|
||||
# 2.8.9
|
||||
|
||||
Bugfixes:
|
||||
* Don't detect `SessionLeader` as terminal, actually (Terminal, Linux)
|
||||
* Fix blurry chafa result when specifying both width and height (#757, Logo)
|
||||
|
||||
Features:
|
||||
* Support new MacBook Air (Host, macOS)
|
||||
* Distinguish min frequency and base frequency (CPU)
|
||||
|
||||
Logo:
|
||||
* Fix proxmox
|
||||
|
||||
# 2.8.8
|
||||
|
||||
Bugfixes:
|
||||
* Fix old fish version compatibility (#744)
|
||||
* Fix truncated texts in `--help format` (#745)
|
||||
* Fix old vulkan-header and libdrm library compatibility (#748, Linux)
|
||||
* Fix possible segfaults in `--help *-format` (#749)
|
||||
* Fix invalid resolution detection when using libdrm (Linux, Display)
|
||||
* Fix segfault when `/sys/devices/system/cpu/cpufreq/` doesn't exist (#750, CPU, Linux)
|
||||
* Don't detect `SessionLeader` as terminal (Terminal, Linux)
|
||||
* Fix detection of client IP (Users, Linux)
|
||||
|
||||
# 2.8.7
|
||||
|
||||
Bugfixes:
|
||||
* Fix max CPU frequency detection for some cases (CPU, Linux)
|
||||
* Fix some memory leaks
|
||||
* Fix ddcutil 2.1 compatibility (Brightness, Linux)
|
||||
* Workaround `permission denied` error when reading `/proc/uptime` (Uptime, Android)
|
||||
|
||||
Features:
|
||||
* Support zellij version detection (Linux, Terminal)
|
||||
|
||||
Logo:
|
||||
* Fix PostMarketOS
|
||||
|
||||
# 2.8.6
|
||||
|
||||
Changes:
|
||||
* Due to newly introduced configs, JSONC option `{ "temperatureUnit": "C" }` has been changed to `{ "temp": { "unit": "C" } }`
|
||||
|
||||
Bugfixes:
|
||||
* Fix incorrect GPU name detection for Intel iGPU on Linux (#736, GPU, Linux)
|
||||
|
||||
Features:
|
||||
* Support additional temperature formatting options (#737)
|
||||
* `{ "temp": { "ndigits": 1 } }`
|
||||
* `{ "temp": { "color": { "green": "green", "yellow": "yellow", "red": "red" } } }`
|
||||
* Support specifying custom `pci.ids` path for Linux (GPU, Linux)
|
||||
* Support warp-linux terminal version & terminal font detection (Terminal, Linux)
|
||||
|
||||
# 2.8.5
|
||||
|
||||
Bugfixes:
|
||||
* Fix uninitialized variables
|
||||
|
||||
# 2.8.4
|
||||
|
||||
Bugfixes:
|
||||
* Fix segfault if we fail to find `Vendor ID` in `lscpu` (#718, CPU, Linux)
|
||||
* Fix multi-device bcachefs filesystem compatibility (#731, Disk, Linux)
|
||||
|
||||
Features:
|
||||
* Support portable Windows Terminal settings (#720, Terminal, Windows)
|
||||
* Support `--color-block-width` and `--color-block-range` (#721, Colors)
|
||||
* Support `--diskio-detect-total` to show total bytes read/written (DiskIO)
|
||||
* Support `--netio-detect-total` to show total bytes received/sent (NetIO)
|
||||
* Support `--packages-disabled` to disable specified package manager (#729, Packages)
|
||||
* Support `--display-order` to sort multiple displays in a specific order (Display)
|
||||
* Support `--display-compact-type original-with-refresh-rate` to show refresh rates in compact (oneline) mode (Display)
|
||||
|
||||
# 2.8.3
|
||||
|
||||
Bugfixes:
|
||||
* Fix GPU name detection for AMD graphic cards (GPU, Linux / FreeBSD)
|
||||
|
||||
# 2.8.2
|
||||
|
||||
Changes:
|
||||
* The linux binaries are now built with glibc 2.35, which means they no longer support Debian 11 and Ubuntu 20.04. Users using these distros may download the artifacts `fastfetch-linux-old` from GitHub Actions.
|
||||
|
||||
Features:
|
||||
* Rewrite GPU module, drop libpci dependency (GPU, Linux)
|
||||
* Detect marketing name of Apple Silicon CPUs for asahi linux (CPU, Linux)
|
||||
* Add new module `Camera`, which prints the name and resolution of connected cameras
|
||||
|
||||
Bugfixes:
|
||||
* Fix compatibility with packages installed by flatpak (Terminal, Linux)
|
||||
* Don't show an empty battery if no battery is detected (macOS, Battery)
|
||||
* Don't show `not connected` if no power adapter is found (macOS / Linux, PowerAdapter)
|
||||
* Make format of battery status be consistent with other platforms (Linux, Battery)
|
||||
|
||||
Logo:
|
||||
* Print Asahi logo in asahi linux (Logo, Linux)
|
||||
* Add Asahi2, z/OS, Tatra, PikaOS
|
||||
|
||||
# 2.7.1
|
||||
|
||||
Features:
|
||||
* Config presets in app folder now work with symlinks
|
||||
|
||||
Bugfixes:
|
||||
* Fix a possible segfault when detecting terminal (Terminal, Linux)
|
||||
|
||||
# 2.7.0
|
||||
|
||||
Features:
|
||||
* Add new module `TerminalTheme`, which prints the foreground and background color of the current terminal window. Currently doesn't work on Windows.
|
||||
* Allow command substitution when expanding paths. For example, now it's possible to use `"source": "$(ls ~/path/to/images/*.png | shuf -n 1)"` in JSONC config file to randomly choose an image to display. (#698)
|
||||
* Use native methods instead of pciutils to detect GPUs in FreeBSD. (GPU, FreeBSD)
|
||||
|
||||
Bugfixes:
|
||||
* Fix text formatting (Wifi, Linux)
|
||||
* Fix terminal detection in some cases (Terminal)
|
||||
* Remove trailing `\0` in JSON results (FreeBSD)
|
||||
* Fix uninitialized variables (GPU, Linux)
|
||||
* Fix a possible segfault (OpenCL)
|
||||
|
||||
Logo:
|
||||
* Add ASCII logos for fedora immutable variants (#700)
|
||||
|
||||
# 2.6.3
|
||||
|
||||
Bugfixes:
|
||||
* Fix module not working (Bluetooth)
|
||||
|
||||
# 2.6.2
|
||||
|
||||
Bugfixes:
|
||||
* Fix building for GCC in Windows (Windows)
|
||||
|
||||
# 2.6.1
|
||||
|
||||
Features:
|
||||
* Improve xonsh shell detection (Shell)
|
||||
* Support colored percentage values (Bluetooth / Gamepad / Sound)
|
||||
* Add `--<module>-percent-[green|yellow]` options to specify threshold of percentage colors
|
||||
* eg. `--disk-percent-green 20 --disk-percent-yellow 50` will show green if disk usage is less than 20%, yellow if disk usage is less then 50%, and red otherwise.
|
||||
* Add `--percent-color-[green|yellow|red]` options to specify color of different percent value states.
|
||||
* eg. `--percent-color-green blue` will show blue color if percent value falls in green state.
|
||||
* Improve Intel macbook support (macOS)
|
||||
|
||||
Bugfixes:
|
||||
* Fix segfault in CPU module when running in aarch64 machine without `lscpu` installed (CPU, Linux)
|
||||
* Don't use `login` as terminal process (Terminal, Linux)
|
||||
* Silence warnings when building in 32bit machines.
|
||||
* Create sub folders when writing config file (#690)
|
||||
* Improve user specific locale detection; fix locale detection in Windows 7 (Locale)
|
||||
* Fix GPU type detection (GPU, macOS)
|
||||
|
||||
# 2.6.0
|
||||
|
||||
Changes:
|
||||
* Remove support of option `--battery-dir`. We detect a lot of things in `/sys/class/*` and only module `Battery` supports specifying a custom directory for some reason, which is weird.
|
||||
* Remove `--chassis-use-wmi` which is no longer used.
|
||||
|
||||
Features:
|
||||
* Add `ENABLE_PROPRIETARY_GPU_DRIVER_API` cmake option to disable using of proprietary GPU driver APIs (GPU)
|
||||
* Support wallpaper detection for macOS Sonoma (Wallpaper, macOS)
|
||||
* Support power adapter detection for Asahi Linux (PowerAdapter, Linux)
|
||||
* Support battery serial number and manufacturer date detection (Battery)
|
||||
* Support host serial number and UUID detection (Host)
|
||||
* Support battery level detection for gamepads where possible (Gamepad)
|
||||
* Support maximum CPU clock detection. Previously base clock was printed (CPU, Windows)
|
||||
* Support manufacture date and serial number detection for physical monitors (Monitor)
|
||||
* Support ash (default shell of BusyBox) version detection (Shell, Linux)
|
||||
* Sound module in FreeBSD now uses native `ioctl`s. Pulseaudio dependency is no longer used.
|
||||
* Locale module in Windows now prints the same format as in Linux and other posix systems.
|
||||
|
||||
Bugfixes:
|
||||
* Fix overall memory leaks (macOS)
|
||||
* Remove trailing `\0` in JSON results (FreeBSD)
|
||||
* Fix physical monitor detection with Nvidia drivers (Monitor, Linux)
|
||||
* Don't print llvmpipe in vulkan module (Vulkan)
|
||||
* Fix system yyjson usage in `fastfetch.c`. Previously embedded `3rdparty/yyjson/yyjson.h` was used in `fastfetch.c` even if `ENABLE_SYSTEM_YYJSON` was set (CMake)
|
||||
* Fix locale module printing unexpected results in specific environments (Locale)
|
||||
* Fix battery temperature detection in Windows. Note only smart batteries report temperatures but few laptops uses smart battery (Battery, Windows)
|
||||
* Print device name if no backlight name is available, so we don't print empty parentheses (Brightness, FreeBSD)
|
||||
|
||||
# 2.5.0
|
||||
|
||||
Changes:
|
||||
* `--gpu-use-nvml` has been renamed to `--gpu-driver-specific` due to using of `IGCL` and `AGS`
|
||||
* We now detect external partitions more conservatively in Linux. USB partitions will not be detected as external always ( eg. The Linux kernel itself is installed in a USB drive )
|
||||
|
||||
Features:
|
||||
* Support more authentication type detection for macOS Sonoma (Wifi, macOS)
|
||||
* Default preset names to `.jsonc`. For example, `fastfetch -c all` will load `presets/all.jsonc` (#666)
|
||||
* Use Intel Graphics Control Library (IGCL) to detect more GPU information. Windows only (GPU, Windows)
|
||||
* Improve support of Asahi Linux (Brightness / CPU / GPU / Disk, Linux)
|
||||
* Support more properties of physical disks (PhysicalDisk)
|
||||
* Support SSD temperature detection with `--physicaldisk-temp` (PhysicalDisk)
|
||||
* Support partition label detection (Disk, FreeBSD)
|
||||
* Support platform specific graphic API version detection (GPU, macOS / Windows)
|
||||
|
||||
Bugfixes:
|
||||
* Fix Windows partition detection for WSL2 (Linux, Disk)
|
||||
* Fix Btrfs subvolumes being detected as external partitions some times (Linux, Disk)
|
||||
* Fix battery cycle counts in some places (Battery)
|
||||
* Fix CodeWhisperer compatibility (#676, Terminal, macOS)
|
||||
|
||||
# 2.4.0
|
||||
|
||||
**We are deprecating flags based config files (will be removed in v3.0.0). We suggest you migrate to json based config files.** One may use `-c /path/to/config.conf --gen-config` to migrate existing flag based config files.
|
||||
|
||||
+155
-44
@@ -1,7 +1,7 @@
|
||||
cmake_minimum_required(VERSION 3.12.0) # target_link_libraries with OBJECT libs & project homepage url
|
||||
|
||||
project(fastfetch
|
||||
VERSION 2.4.0
|
||||
VERSION 2.13.0
|
||||
LANGUAGES C
|
||||
DESCRIPTION "Fast neofetch-like system information tool"
|
||||
HOMEPAGE_URL "https://github.com/fastfetch-cli/fastfetch"
|
||||
@@ -42,7 +42,6 @@ include(CheckIncludeFile)
|
||||
|
||||
include(CMakeDependentOption)
|
||||
|
||||
cmake_dependent_option(ENABLE_LIBPCI "Enable libpci" ON "LINUX OR BSD" OFF)
|
||||
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)
|
||||
@@ -66,16 +65,23 @@ 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_FREETYPE "Enable freetype" ON "ANDROID" OFF)
|
||||
cmake_dependent_option(ENABLE_PULSE "Enable pulse" ON "LINUX OR BSD" OFF)
|
||||
cmake_dependent_option(ENABLE_PULSE "Enable pulse" ON "LINUX" OFF)
|
||||
cmake_dependent_option(ENABLE_DDCUTIL "Enable ddcutil" ON "LINUX" OFF)
|
||||
cmake_dependent_option(ENABLE_DIRECTX_HEADERS "Enable DirectX headers for WSL" ON "LINUX" OFF)
|
||||
cmake_dependent_option(ENABLE_THREADS "Enable multithreading" ON "Threads_FOUND" OFF)
|
||||
cmake_dependent_option(ENABLE_PCI_MEMORY "Enable detecting GPU memory size with libpci" OFF "LINUX OR BSD" 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(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
|
||||
|
||||
if (LINUX)
|
||||
set(CUSTOM_PCI_IDS_PATH "" CACHE STRING "Custom path to file pci.ids, defaults to `/usr/share/hwdata/pci.ids`")
|
||||
set(CUSTOM_AMDGPU_IDS_PATH "" CACHE STRING "Custom path to file amdgpu.ids, defaults to `/usr/share/libdrm/amdgpu.ids`")
|
||||
set(CUSTOM_OS_RELEASE_PATH "" CACHE STRING "Custom path to file os-release, defaults to `/etc/os-release`")
|
||||
endif()
|
||||
|
||||
####################
|
||||
# Compiler options #
|
||||
@@ -109,12 +115,8 @@ endif()
|
||||
|
||||
if(WIN32)
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--tsaware -Wl,--build-id -Wl,--subsystem,console:6.1,--major-os-version,6,--minor-os-version,1")
|
||||
endif()
|
||||
|
||||
# Used for dlopen finding dylibs installed by homebrew
|
||||
# `/opt/homebrew/lib` is not on in dlopen search path by default
|
||||
if(APPLE AND DEFINED ENV{HOMEBREW_PREFIX})
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-rpath,$ENV{HOMEBREW_PREFIX}/lib")
|
||||
elseif(APPLE AND CMAKE_C_COMPILER_ID MATCHES "Clang")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fobjc-arc")
|
||||
endif()
|
||||
|
||||
set(FASTFETCH_FLAGS_DEBUG "-fno-omit-frame-pointer")
|
||||
@@ -123,7 +125,7 @@ if(ENABLE_ASAN)
|
||||
set(FASTFETCH_FLAGS_DEBUG "${FASTFETCH_FLAGS_DEBUG} -fsanitize=address")
|
||||
endif()
|
||||
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} ${FASTFETCH_FLAGS_DEBUG}")
|
||||
set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} ${FASTFETCH_FLAGS_DEBUG}")
|
||||
set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} ${FASTFETCH_FLAGS_DEBUG} -fstack-protector-all -fno-delete-null-pointer-checks")
|
||||
if(NOT WIN32)
|
||||
set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} -rdynamic")
|
||||
endif()
|
||||
@@ -234,10 +236,9 @@ endif()
|
||||
|
||||
fastfetch_encode_c_string("${DATATEXT_JSON_HELP}" DATATEXT_JSON_HELP)
|
||||
fastfetch_load_text(src/data/structure.txt DATATEXT_STRUCTURE)
|
||||
fastfetch_load_text(src/data/help.txt DATATEXT_HELP)
|
||||
fastfetch_load_text(src/data/help_footer.txt DATATEXT_HELP_FOOTER)
|
||||
fastfetch_load_text(src/data/help_color.txt DATATEXT_HELP_COLOR)
|
||||
fastfetch_load_text(src/data/help_format.txt DATATEXT_HELP_FORMAT)
|
||||
fastfetch_load_text(src/data/help_config.txt DATATEXT_HELP_CONFIG)
|
||||
|
||||
configure_file(src/fastfetch_config.h.in fastfetch_config.h @ONLY)
|
||||
configure_file(src/fastfetch_datatext.h.in fastfetch_datatext.h @ONLY)
|
||||
@@ -256,7 +257,7 @@ file(GLOB LOGO_FILES "src/logo/ascii/*.txt")
|
||||
set(LOGO_BUILTIN_H "#pragma once\n#pragma GCC diagnostic ignored \"-Wtrigraphs\"\n\n")
|
||||
foreach(file ${LOGO_FILES})
|
||||
fastfetch_load_text("${file}" content)
|
||||
get_filename_component(file "${file}" NAME_WLE)
|
||||
get_filename_component(file "${file}" NAME_WE)
|
||||
string(TOUPPER "${file}" file)
|
||||
string(REGEX REPLACE "\\$\\{c([0-9]+)\\}" "$\\1" content "${content}")
|
||||
set(LOGO_BUILTIN_H "${LOGO_BUILTIN_H}#define FASTFETCH_DATATEXT_LOGO_${file} ${content}\n")
|
||||
@@ -268,7 +269,7 @@ file(GENERATE OUTPUT logo_builtin.h CONTENT "${LOGO_BUILTIN_H}")
|
||||
#######################
|
||||
|
||||
set(LIBFASTFETCH_SRC
|
||||
src/common/bar.c
|
||||
src/common/percent.c
|
||||
src/common/commandoption.c
|
||||
src/common/font.c
|
||||
src/common/format.c
|
||||
@@ -282,6 +283,8 @@ set(LIBFASTFETCH_SRC
|
||||
src/common/printing.c
|
||||
src/common/properties.c
|
||||
src/common/settings.c
|
||||
src/common/temps.c
|
||||
src/detection/bootmgr/bootmgr.c
|
||||
src/detection/chassis/chassis.c
|
||||
src/detection/cpu/cpu.c
|
||||
src/detection/cpuusage/cpuusage.c
|
||||
@@ -290,13 +293,14 @@ set(LIBFASTFETCH_SRC
|
||||
src/detection/displayserver/displayserver.c
|
||||
src/detection/font/font.c
|
||||
src/detection/gpu/gpu.c
|
||||
src/detection/locale/locale.c
|
||||
src/detection/media/media.c
|
||||
src/detection/netio/netio.c
|
||||
src/detection/opencl/opencl.c
|
||||
src/detection/os/os.c
|
||||
src/detection/packages/packages.c
|
||||
src/detection/physicalmemory/physicalmemory.c
|
||||
src/detection/publicip/publicip.c
|
||||
src/detection/terminaltheme/terminaltheme.c
|
||||
src/detection/terminalfont/terminalfont.c
|
||||
src/detection/terminalshell/terminalshell.c
|
||||
src/detection/version/version.c
|
||||
@@ -311,8 +315,10 @@ set(LIBFASTFETCH_SRC
|
||||
src/modules/bios/bios.c
|
||||
src/modules/bluetooth/bluetooth.c
|
||||
src/modules/board/board.c
|
||||
src/modules/bootmgr/bootmgr.c
|
||||
src/modules/brightness/brightness.c
|
||||
src/modules/break/break.c
|
||||
src/modules/camera/camera.c
|
||||
src/modules/chassis/chassis.c
|
||||
src/modules/colors/colors.c
|
||||
src/modules/cpu/cpu.c
|
||||
@@ -331,6 +337,7 @@ set(LIBFASTFETCH_SRC
|
||||
src/modules/gamepad/gamepad.c
|
||||
src/modules/kernel/kernel.c
|
||||
src/modules/lm/lm.c
|
||||
src/modules/loadavg/loadavg.c
|
||||
src/modules/locale/locale.c
|
||||
src/modules/localip/localip.c
|
||||
src/modules/memory/memory.c
|
||||
@@ -341,6 +348,7 @@ set(LIBFASTFETCH_SRC
|
||||
src/modules/os/os.c
|
||||
src/modules/packages/packages.c
|
||||
src/modules/physicaldisk/physicaldisk.c
|
||||
src/modules/physicalmemory/physicalmemory.c
|
||||
src/modules/processes/processes.c
|
||||
src/modules/player/player.c
|
||||
src/modules/poweradapter/poweradapter.c
|
||||
@@ -352,6 +360,7 @@ set(LIBFASTFETCH_SRC
|
||||
src/modules/swap/swap.c
|
||||
src/modules/media/media.c
|
||||
src/modules/terminal/terminal.c
|
||||
src/modules/terminaltheme/terminaltheme.c
|
||||
src/modules/terminalfont/terminalfont.c
|
||||
src/modules/terminalsize/terminalsize.c
|
||||
src/modules/theme/theme.c
|
||||
@@ -374,7 +383,6 @@ set(LIBFASTFETCH_SRC
|
||||
src/util/FFlist.c
|
||||
src/util/FFstrbuf.c
|
||||
src/util/platform/FFPlatform.c
|
||||
src/util/stringUtils.c
|
||||
src/util/smbiosHelper.c
|
||||
)
|
||||
|
||||
@@ -388,6 +396,7 @@ if(LINUX)
|
||||
src/detection/battery/battery_linux.c
|
||||
src/detection/bios/bios_linux.c
|
||||
src/detection/board/board_linux.c
|
||||
src/detection/bootmgr/bootmgr_linux.c
|
||||
src/detection/brightness/brightness_linux.c
|
||||
src/detection/chassis/chassis_linux.c
|
||||
src/detection/cpu/cpu_linux.c
|
||||
@@ -396,21 +405,27 @@ if(LINUX)
|
||||
src/detection/bluetooth/bluetooth_linux.c
|
||||
src/detection/disk/disk_linux.c
|
||||
src/detection/physicaldisk/physicaldisk_linux.c
|
||||
src/detection/physicalmemory/physicalmemory_linux.c
|
||||
src/detection/diskio/diskio_linux.c
|
||||
src/detection/displayserver/linux/displayserver_linux.c
|
||||
src/detection/displayserver/linux/drm.c
|
||||
src/detection/displayserver/linux/wayland.c
|
||||
src/detection/displayserver/linux/wayland/wayland.c
|
||||
src/detection/displayserver/linux/wayland/global-output.c
|
||||
src/detection/displayserver/linux/wayland/zwlr-output.c
|
||||
src/detection/displayserver/linux/wayland/wlr-output-management-unstable-v1-protocol.c
|
||||
src/detection/displayserver/linux/wmde.c
|
||||
src/detection/displayserver/linux/xcb.c
|
||||
src/detection/displayserver/linux/xlib.c
|
||||
src/detection/font/font_linux.c
|
||||
src/detection/gpu/gpu_linux.c
|
||||
src/detection/gpu/gpu_nvidia.c
|
||||
src/detection/gpu/gpu_pci.c
|
||||
src/detection/gtk_qt/gtk.c
|
||||
src/detection/host/host_linux.c
|
||||
src/detection/icons/icons_linux.c
|
||||
src/detection/libc/libc_linux.c
|
||||
src/detection/lm/lm_linux.c
|
||||
src/detection/loadavg/loadavg_linux.c
|
||||
src/detection/locale/locale_linux.c
|
||||
src/detection/localip/localip_linux.c
|
||||
src/detection/gamepad/gamepad_linux.c
|
||||
src/detection/media/media_linux.c
|
||||
@@ -420,7 +435,7 @@ if(LINUX)
|
||||
src/detection/opengl/opengl_linux.c
|
||||
src/detection/os/os_linux.c
|
||||
src/detection/packages/packages_linux.c
|
||||
src/detection/poweradapter/poweradapter_nosupport.c
|
||||
src/detection/poweradapter/poweradapter_linux.c
|
||||
src/detection/processes/processes_linux.c
|
||||
src/detection/gtk_qt/qt.c
|
||||
src/detection/sound/sound_linux.c
|
||||
@@ -437,6 +452,7 @@ if(LINUX)
|
||||
src/detection/wm/wm_nosupport.c
|
||||
src/detection/de/de_linux.c
|
||||
src/detection/wmtheme/wmtheme_linux.c
|
||||
src/detection/camera/camera_linux.c
|
||||
src/util/platform/FFPlatform_unix.c
|
||||
)
|
||||
elseif(ANDROID)
|
||||
@@ -449,6 +465,7 @@ elseif(ANDROID)
|
||||
src/detection/bios/bios_android.c
|
||||
src/detection/bluetooth/bluetooth_nosupport.c
|
||||
src/detection/board/board_android.c
|
||||
src/detection/bootmgr/bootmgr_nosupport.c
|
||||
src/detection/brightness/brightness_nosupport.c
|
||||
src/detection/chassis/chassis_nosupport.c
|
||||
src/detection/cpu/cpu_linux.c
|
||||
@@ -456,6 +473,7 @@ elseif(ANDROID)
|
||||
src/detection/cpuusage/cpuusage_linux.c
|
||||
src/detection/disk/disk_linux.c
|
||||
src/detection/physicaldisk/physicaldisk_linux.c
|
||||
src/detection/physicalmemory/physicalmemory_nosupport.c
|
||||
src/detection/diskio/diskio_linux.c
|
||||
src/detection/displayserver/displayserver_android.c
|
||||
src/detection/font/font_nosupport.c
|
||||
@@ -464,6 +482,8 @@ elseif(ANDROID)
|
||||
src/detection/icons/icons_nosupport.c
|
||||
src/detection/libc/libc_android.c
|
||||
src/detection/lm/lm_nosupport.c
|
||||
src/detection/loadavg/loadavg_linux.c
|
||||
src/detection/locale/locale_linux.c
|
||||
src/detection/localip/localip_linux.c
|
||||
src/detection/gamepad/gamepad_nosupport.c
|
||||
src/detection/media/media_nosupport.c
|
||||
@@ -489,6 +509,7 @@ elseif(ANDROID)
|
||||
src/detection/wm/wm_nosupport.c
|
||||
src/detection/de/de_nosupport.c
|
||||
src/detection/wmtheme/wmtheme_nosupport.c
|
||||
src/detection/camera/camera_android.c
|
||||
src/util/platform/FFPlatform_unix.c
|
||||
)
|
||||
elseif(BSD)
|
||||
@@ -503,6 +524,7 @@ elseif(BSD)
|
||||
src/detection/bios/bios_bsd.c
|
||||
src/detection/bluetooth/bluetooth_linux.c
|
||||
src/detection/board/board_bsd.c
|
||||
src/detection/bootmgr/bootmgr_bsd.c
|
||||
src/detection/brightness/brightness_bsd.c
|
||||
src/detection/chassis/chassis_bsd.c
|
||||
src/detection/cpu/cpu_bsd.c
|
||||
@@ -510,21 +532,27 @@ elseif(BSD)
|
||||
src/detection/cursor/cursor_linux.c
|
||||
src/detection/disk/disk_bsd.c
|
||||
src/detection/physicaldisk/physicaldisk_bsd.c
|
||||
src/detection/physicalmemory/physicalmemory_linux.c
|
||||
src/detection/diskio/diskio_bsd.c
|
||||
src/detection/displayserver/linux/displayserver_linux.c
|
||||
src/detection/displayserver/linux/drm.c
|
||||
src/detection/displayserver/linux/wayland.c
|
||||
src/detection/displayserver/linux/wayland/wayland.c
|
||||
src/detection/displayserver/linux/wayland/global-output.c
|
||||
src/detection/displayserver/linux/wayland/zwlr-output.c
|
||||
src/detection/displayserver/linux/wayland/wlr-output-management-unstable-v1-protocol.c
|
||||
src/detection/displayserver/linux/wmde.c
|
||||
src/detection/displayserver/linux/xcb.c
|
||||
src/detection/displayserver/linux/xlib.c
|
||||
src/detection/font/font_linux.c
|
||||
src/detection/gpu/gpu_linux.c
|
||||
src/detection/gpu/gpu_nvidia.c
|
||||
src/detection/gpu/gpu_bsd.c
|
||||
src/detection/gpu/gpu_pci.c
|
||||
src/detection/gtk_qt/gtk.c
|
||||
src/detection/host/host_bsd.c
|
||||
src/detection/lm/lm_linux.c
|
||||
src/detection/icons/icons_linux.c
|
||||
src/detection/libc/libc_bsd.c
|
||||
src/detection/loadavg/loadavg_bsd.c
|
||||
src/detection/locale/locale_linux.c
|
||||
src/detection/localip/localip_linux.c
|
||||
src/detection/gamepad/gamepad_bsd.c
|
||||
src/detection/media/media_linux.c
|
||||
@@ -537,7 +565,7 @@ elseif(BSD)
|
||||
src/detection/poweradapter/poweradapter_nosupport.c
|
||||
src/detection/processes/processes_bsd.c
|
||||
src/detection/gtk_qt/qt.c
|
||||
src/detection/sound/sound_linux.c
|
||||
src/detection/sound/sound_bsd.c
|
||||
src/detection/swap/swap_bsd.c
|
||||
src/detection/temps/temps_bsd.c
|
||||
src/detection/terminalfont/terminalfont_linux.c
|
||||
@@ -551,6 +579,7 @@ elseif(BSD)
|
||||
src/detection/wm/wm_nosupport.c
|
||||
src/detection/de/de_linux.c
|
||||
src/detection/wmtheme/wmtheme_linux.c
|
||||
src/detection/camera/camera_linux.c
|
||||
src/util/platform/FFPlatform_unix.c
|
||||
)
|
||||
elseif(APPLE)
|
||||
@@ -564,6 +593,7 @@ elseif(APPLE)
|
||||
src/detection/bios/bios_apple.c
|
||||
src/detection/bluetooth/bluetooth_apple.m
|
||||
src/detection/board/board_apple.c
|
||||
src/detection/bootmgr/bootmgr_apple.c
|
||||
src/detection/brightness/brightness_apple.c
|
||||
src/detection/chassis/chassis_nosupport.c
|
||||
src/detection/cpu/cpu_apple.c
|
||||
@@ -571,14 +601,18 @@ elseif(APPLE)
|
||||
src/detection/cursor/cursor_apple.m
|
||||
src/detection/disk/disk_bsd.c
|
||||
src/detection/physicaldisk/physicaldisk_apple.c
|
||||
src/detection/physicalmemory/physicalmemory_apple.m
|
||||
src/detection/diskio/diskio_apple.c
|
||||
src/detection/displayserver/displayserver_apple.c
|
||||
src/detection/font/font_apple.m
|
||||
src/detection/gpu/gpu_apple.c
|
||||
src/detection/gpu/gpu_apple.m
|
||||
src/detection/host/host_apple.c
|
||||
src/detection/lm/lm_nosupport.c
|
||||
src/detection/icons/icons_nosupport.c
|
||||
src/detection/lm/lm_nosupport.c
|
||||
src/detection/loadavg/loadavg_bsd.c
|
||||
src/detection/libc/libc_apple.c
|
||||
src/detection/locale/locale_linux.c
|
||||
src/detection/localip/localip_linux.c
|
||||
src/detection/gamepad/gamepad_apple.c
|
||||
src/detection/media/media_apple.m
|
||||
@@ -599,11 +633,12 @@ elseif(APPLE)
|
||||
src/detection/theme/theme_nosupport.c
|
||||
src/detection/uptime/uptime_bsd.c
|
||||
src/detection/users/users_linux.c
|
||||
src/detection/wallpaper/wallpaper_apple.c
|
||||
src/detection/wallpaper/wallpaper_apple.m
|
||||
src/detection/wifi/wifi_apple.m
|
||||
src/detection/wm/wm_apple.c
|
||||
src/detection/de/de_nosupport.c
|
||||
src/detection/wmtheme/wmtheme_apple.m
|
||||
src/detection/camera/camera_apple.m
|
||||
src/util/apple/cf_helpers.c
|
||||
src/util/apple/osascript.m
|
||||
src/util/platform/FFPlatform_unix.c
|
||||
@@ -618,8 +653,9 @@ elseif(WIN32)
|
||||
src/detection/bios/bios_windows.c
|
||||
src/detection/bluetooth/bluetooth_windows.c
|
||||
src/detection/board/board_windows.c
|
||||
src/detection/bootmgr/bootmgr_windows.c
|
||||
src/detection/brightness/brightness_windows.cpp
|
||||
src/detection/chassis/chassis_windows.cpp
|
||||
src/detection/chassis/chassis_windows.c
|
||||
src/detection/cpu/cpu_windows.c
|
||||
src/detection/cpuusage/cpuusage_windows.c
|
||||
src/detection/cursor/cursor_windows.c
|
||||
@@ -629,15 +665,17 @@ elseif(WIN32)
|
||||
src/detection/displayserver/displayserver_windows.c
|
||||
src/detection/font/font_windows.c
|
||||
src/detection/gpu/gpu_windows.c
|
||||
src/detection/gpu/gpu_nvidia.c
|
||||
src/detection/host/host_windows.c
|
||||
src/detection/icons/icons_windows.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/memory/memory_windows.c
|
||||
src/detection/physicalmemory/physicalmemory_linux.c
|
||||
src/detection/monitor/monitor_windows.c
|
||||
src/detection/netio/netio_windows.c
|
||||
src/detection/opengl/opengl_windows.c
|
||||
@@ -659,6 +697,7 @@ elseif(WIN32)
|
||||
src/detection/wm/wm_windows.cpp
|
||||
src/detection/de/de_nosupport.c
|
||||
src/detection/wmtheme/wmtheme_windows.c
|
||||
src/detection/camera/camera_windows.cpp
|
||||
src/util/windows/getline.c
|
||||
src/util/windows/com.cpp
|
||||
src/util/windows/registry.c
|
||||
@@ -673,11 +712,25 @@ 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()
|
||||
endif()
|
||||
|
||||
include(CheckFunctionExists)
|
||||
check_function_exists(wcwidth HAVE_WCWIDTH)
|
||||
if(NOT HAVE_WCWIDTH)
|
||||
list(APPEND LIBFASTFETCH_SRC src/3rdparty/mk_wcwidch/wcwidth.c)
|
||||
endif()
|
||||
if(LINUX)
|
||||
check_function_exists(statx HAVE_STATX)
|
||||
endif()
|
||||
|
||||
if(ENABLE_SYSTEM_YYJSON)
|
||||
find_package(yyjson)
|
||||
@@ -696,9 +749,20 @@ 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)
|
||||
target_link_libraries(libfastfetch PRIVATE yyjson::yyjson)
|
||||
# `target_link_libraries(yyjson::yyjson)` sets rpath implicitly
|
||||
else()
|
||||
# Used for dlopen finding dylibs installed by homebrew
|
||||
# `/opt/homebrew/lib` is not on in dlopen search path by default
|
||||
if(APPLE)
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-rpath,/opt/homebrew/lib -Wl,-rpath,/usr/local/lib")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(LINUX AND EXISTS "/lib/ld-musl-${CMAKE_HOST_SYSTEM_PROCESSOR}.so.1")
|
||||
@@ -723,17 +787,34 @@ if(BSD AND EXISTS "/usr/local/bin/objdump")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
target_compile_definitions(libfastfetch PUBLIC _GNU_SOURCE _XOPEN_SOURCE __STDC_WANT_LIB_EXT1__=1)
|
||||
target_compile_definitions(libfastfetch PUBLIC _GNU_SOURCE _XOPEN_SOURCE __STDC_WANT_LIB_EXT1__=1 _FILE_OFFSET_BITS=64)
|
||||
if(WIN32)
|
||||
target_compile_definitions(libfastfetch PUBLIC WIN32_LEAN_AND_MEAN=1)
|
||||
elseif(APPLE)
|
||||
target_compile_definitions(libfastfetch PUBLIC _DARWIN_C_SOURCE)
|
||||
endif()
|
||||
|
||||
if(HAVE_STATX)
|
||||
target_compile_definitions(libfastfetch PRIVATE FF_HAVE_STATX)
|
||||
endif()
|
||||
|
||||
if(HAVE_WCWIDTH)
|
||||
target_compile_definitions(libfastfetch PRIVATE FF_HAVE_WCWIDTH)
|
||||
endif()
|
||||
|
||||
if(NOT "${CUSTOM_PCI_IDS_PATH}" STREQUAL "")
|
||||
message(STATUS "Custom file path of pci.ids: ${CUSTOM_PCI_IDS_PATH}")
|
||||
target_compile_definitions(libfastfetch PRIVATE FF_CUSTOM_PCI_IDS_PATH=${CUSTOM_PCI_IDS_PATH})
|
||||
endif()
|
||||
if(NOT "${CUSTOM_AMDGPU_IDS_PATH}" STREQUAL "")
|
||||
message(STATUS "Custom file path of amdgpu.ids: ${CUSTOM_AMDGPU_IDS_PATH}")
|
||||
target_compile_definitions(libfastfetch PRIVATE FF_CUSTOM_AMDGPU_IDS_PATH=${CUSTOM_AMDGPU_IDS_PATH})
|
||||
endif()
|
||||
if(NOT "${CUSTOM_OS_RELEASE_PATH}" STREQUAL "")
|
||||
message(STATUS "Custom file path of os_release: ${CUSTOM_OS_RELEASE_PATH}")
|
||||
target_compile_definitions(libfastfetch PRIVATE FF_CUSTOM_OS_RELEASE_PATH=${CUSTOM_OS_RELEASE_PATH})
|
||||
endif()
|
||||
|
||||
function(ff_lib_enable VARNAME PKGCONFIG_NAMES CMAKE_NAME)
|
||||
if(NOT ENABLE_${VARNAME})
|
||||
return()
|
||||
@@ -770,10 +851,6 @@ function(ff_lib_enable VARNAME PKGCONFIG_NAMES CMAKE_NAME)
|
||||
endforeach()
|
||||
endfunction()
|
||||
|
||||
ff_lib_enable(LIBPCI
|
||||
"libpci"
|
||||
"Pci"
|
||||
)
|
||||
ff_lib_enable(VULKAN
|
||||
"vulkan"
|
||||
"Vulkan"
|
||||
@@ -886,23 +963,22 @@ if(ENABLE_THREADS)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(ENABLE_PCI_MEMORY)
|
||||
target_compile_definitions(libfastfetch PRIVATE FF_USE_PCI_MEMORY)
|
||||
endif()
|
||||
|
||||
if(LINUX)
|
||||
target_link_libraries(libfastfetch
|
||||
PRIVATE "m"
|
||||
)
|
||||
elseif(APPLE)
|
||||
target_link_libraries(libfastfetch
|
||||
PRIVATE "-framework AVFoundation"
|
||||
PRIVATE "-framework Cocoa"
|
||||
PRIVATE "-framework CoreFoundation"
|
||||
PRIVATE "-framework CoreAudio"
|
||||
PRIVATE "-framework CoreMedia"
|
||||
PRIVATE "-framework CoreVideo"
|
||||
PRIVATE "-framework CoreWLAN"
|
||||
PRIVATE "-framework IOBluetooth"
|
||||
PRIVATE "-framework IOKit"
|
||||
PRIVATE "-framework Metal"
|
||||
PRIVATE "-framework OpenGL"
|
||||
PRIVATE "-framework OpenCL"
|
||||
PRIVATE "-framework SystemConfiguration"
|
||||
@@ -989,6 +1065,13 @@ set(CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES "")
|
||||
set_target_properties(fastfetch PROPERTIES LINKER_LANGUAGE C)
|
||||
set_target_properties(flashfetch PROPERTIES LINKER_LANGUAGE C)
|
||||
|
||||
if(yyjson_FOUND)
|
||||
target_compile_definitions(fastfetch PRIVATE FF_USE_SYSTEM_YYJSON)
|
||||
target_link_libraries(fastfetch PRIVATE yyjson::yyjson)
|
||||
target_compile_definitions(flashfetch PRIVATE FF_USE_SYSTEM_YYJSON)
|
||||
target_link_libraries(flashfetch PRIVATE yyjson::yyjson)
|
||||
endif()
|
||||
|
||||
if(WIN32)
|
||||
set(TARGET_NAME fastfetch)
|
||||
target_sources(fastfetch
|
||||
@@ -1075,15 +1158,43 @@ install(
|
||||
##################
|
||||
|
||||
set(CPACK_GENERATOR "TGZ;ZIP")
|
||||
if(APPLE)
|
||||
string(TOLOWER "${CMAKE_PROJECT_NAME}-macos-universal" CPACK_PACKAGE_FILE_NAME)
|
||||
else() # We don't use this in Windows
|
||||
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
|
||||
set(CMAKE_SYSTEM_PROCESSOR "amd64")
|
||||
endif()
|
||||
if(IS_MUSL)
|
||||
string(TOLOWER "${CMAKE_PROJECT_NAME}-musl-${CMAKE_SYSTEM_PROCESSOR}" CPACK_PACKAGE_FILE_NAME)
|
||||
else()
|
||||
string(TOLOWER "${CMAKE_PROJECT_NAME}-${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR}" CPACK_PACKAGE_FILE_NAME)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(LINUX)
|
||||
set(CPACK_GENERATOR "${CPACK_GENERATOR};DEB;RPM")
|
||||
find_program(HAVE_DPKG "dpkg")
|
||||
if(HAVE_DPKG)
|
||||
set(CPACK_GENERATOR "${CPACK_GENERATOR};DEB")
|
||||
|
||||
set(CPACK_DEBIAN_PACKAGE_SECTION, "utils")
|
||||
set(CPACK_DEBIAN_PACKAGE_PRIORITY "optional")
|
||||
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libc6")
|
||||
set(CPACK_DEBIAN_PACKAGE_SECTION, "utils")
|
||||
set(CPACK_DEBIAN_PACKAGE_PRIORITY "optional")
|
||||
|
||||
set(CPACK_RPM_PACKAGE_LICENSE "MIT")
|
||||
if(NOT IS_MUSL)
|
||||
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})")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
find_program(HAVE_RPMBUILD "rpmbuild")
|
||||
if(HAVE_RPMBUILD)
|
||||
set(CPACK_GENERATOR "${CPACK_GENERATOR};RPM")
|
||||
|
||||
set(CPACK_RPM_PACKAGE_LICENSE "MIT")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set(CPACK_SET_DESTDIR ON)
|
||||
@@ -1091,7 +1202,7 @@ set(CPACK_SET_DESTDIR ON)
|
||||
set(CPACK_PACKAGE_CONTACT "Linus Dierheimer <Linus@Dierheimer.de>")
|
||||
set(CPACK_PACKAGE_DESCRIPTION "\
|
||||
fastfetch is a neofetch-like tool for fetching system information and displaying them in a pretty way. \
|
||||
It is written in c to achieve much better performance.\
|
||||
It is written mostly in C to achieve much better performance.\
|
||||
")
|
||||
|
||||
include(CPack)
|
||||
|
||||
@@ -0,0 +1,133 @@
|
||||
|
||||
# Contributor Covenant Code of Conduct
|
||||
|
||||
## Our Pledge
|
||||
|
||||
We as members, contributors, and leaders pledge to make participation in our
|
||||
community a harassment-free experience for everyone, regardless of age, body
|
||||
size, visible or invisible disability, ethnicity, sex characteristics, gender
|
||||
identity and expression, level of experience, education, socio-economic status,
|
||||
nationality, personal appearance, race, caste, color, religion, or sexual
|
||||
identity and orientation.
|
||||
|
||||
We pledge to act and interact in ways that contribute to an open, welcoming,
|
||||
diverse, inclusive, and healthy community.
|
||||
|
||||
## Our Standards
|
||||
|
||||
Examples of behavior that contributes to a positive environment for our
|
||||
community include:
|
||||
|
||||
* Demonstrating empathy and kindness toward other people
|
||||
* Being respectful of differing opinions, viewpoints, and experiences
|
||||
* Giving and gracefully accepting constructive feedback
|
||||
* Accepting responsibility and apologizing to those affected by our mistakes,
|
||||
and learning from the experience
|
||||
* Focusing on what is best not just for us as individuals, but for the overall
|
||||
community
|
||||
|
||||
Examples of unacceptable behavior include:
|
||||
|
||||
* The use of sexualized language or imagery, and sexual attention or advances of
|
||||
any kind
|
||||
* Trolling, insulting or derogatory comments, and personal or political attacks
|
||||
* Public or private harassment
|
||||
* Publishing others' private information, such as a physical or email address,
|
||||
without their explicit permission
|
||||
* Other conduct which could reasonably be considered inappropriate in a
|
||||
professional setting
|
||||
|
||||
## Enforcement Responsibilities
|
||||
|
||||
Community leaders are responsible for clarifying and enforcing our standards of
|
||||
acceptable behavior and will take appropriate and fair corrective action in
|
||||
response to any behavior that they deem inappropriate, threatening, offensive,
|
||||
or harmful.
|
||||
|
||||
Community leaders have the right and responsibility to remove, edit, or reject
|
||||
comments, commits, code, wiki edits, issues, and other contributions that are
|
||||
not aligned to this Code of Conduct, and will communicate reasons for moderation
|
||||
decisions when appropriate.
|
||||
|
||||
## Scope
|
||||
|
||||
This Code of Conduct applies within all community spaces, and also applies when
|
||||
an individual is officially representing the community in public spaces.
|
||||
Examples of representing our community include using an official email address,
|
||||
posting via an official social media account, or acting as an appointed
|
||||
representative at an online or offline event.
|
||||
|
||||
## Enforcement
|
||||
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
||||
reported to the community leaders responsible for enforcement at
|
||||
[INSERT CONTACT METHOD].
|
||||
All complaints will be reviewed and investigated promptly and fairly.
|
||||
|
||||
All community leaders are obligated to respect the privacy and security of the
|
||||
reporter of any incident.
|
||||
|
||||
## Enforcement Guidelines
|
||||
|
||||
Community leaders will follow these Community Impact Guidelines in determining
|
||||
the consequences for any action they deem in violation of this Code of Conduct:
|
||||
|
||||
### 1. Correction
|
||||
|
||||
**Community Impact**: Use of inappropriate language or other behavior deemed
|
||||
unprofessional or unwelcome in the community.
|
||||
|
||||
**Consequence**: A private, written warning from community leaders, providing
|
||||
clarity around the nature of the violation and an explanation of why the
|
||||
behavior was inappropriate. A public apology may be requested.
|
||||
|
||||
### 2. Warning
|
||||
|
||||
**Community Impact**: A violation through a single incident or series of
|
||||
actions.
|
||||
|
||||
**Consequence**: A warning with consequences for continued behavior. No
|
||||
interaction with the people involved, including unsolicited interaction with
|
||||
those enforcing the Code of Conduct, for a specified period of time. This
|
||||
includes avoiding interactions in community spaces as well as external channels
|
||||
like social media. Violating these terms may lead to a temporary or permanent
|
||||
ban.
|
||||
|
||||
### 3. Temporary Ban
|
||||
|
||||
**Community Impact**: A serious violation of community standards, including
|
||||
sustained inappropriate behavior.
|
||||
|
||||
**Consequence**: A temporary ban from any sort of interaction or public
|
||||
communication with the community for a specified period of time. No public or
|
||||
private interaction with the people involved, including unsolicited interaction
|
||||
with those enforcing the Code of Conduct, is allowed during this period.
|
||||
Violating these terms may lead to a permanent ban.
|
||||
|
||||
### 4. Permanent Ban
|
||||
|
||||
**Community Impact**: Demonstrating a pattern of violation of community
|
||||
standards, including sustained inappropriate behavior, harassment of an
|
||||
individual, or aggression toward or disparagement of classes of individuals.
|
||||
|
||||
**Consequence**: A permanent ban from any sort of public interaction within the
|
||||
community.
|
||||
|
||||
## Attribution
|
||||
|
||||
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
||||
version 2.1, available at
|
||||
[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
|
||||
|
||||
Community Impact Guidelines were inspired by
|
||||
[Mozilla's code of conduct enforcement ladder][Mozilla CoC].
|
||||
|
||||
For answers to common questions about this code of conduct, see the FAQ at
|
||||
[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
|
||||
[https://www.contributor-covenant.org/translations][translations].
|
||||
|
||||
[homepage]: https://www.contributor-covenant.org
|
||||
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
|
||||
[Mozilla CoC]: https://github.com/mozilla/diversity
|
||||
[FAQ]: https://www.contributor-covenant.org/faq
|
||||
[translations]: https://www.contributor-covenant.org/translations
|
||||
@@ -1,34 +0,0 @@
|
||||
# Development help
|
||||
|
||||
This file is not an official documentation!
|
||||
Here i just add things that are easy to forget.
|
||||
|
||||
## Features i am planning to implement
|
||||
|
||||
### Specific
|
||||
|
||||
- [ ] Split the project in different libs / executables, all linking static by default:
|
||||
- `libffdetect`: contains all the detection stuff. To be used by anything that needs system information
|
||||
- `libffprint`: contains the printing functions, logos, format etc
|
||||
- `fastfetch` and `flashfetch`: Executables, that initialize the config of libffprint. Fist one at runtime, second one at compile time
|
||||
- [ ] Make LocalIP module more configurable
|
||||
- [ ] Automatic migrate old config files to newer versions
|
||||
- [ ] ZSH completions
|
||||
- [ ] Fish completions
|
||||
- [ ] Make CPU usage detection much faster and more accurate
|
||||
- [ ] Detect CPU usage in a common detection method and expose it both to the cpuUsage module and the cpu format string
|
||||
- [ ] Per session caching
|
||||
|
||||
### General
|
||||
- More presets
|
||||
- More logos
|
||||
- More package managers
|
||||
- More DE detections
|
||||
- More WM theme detections
|
||||
- More terminal font detections
|
||||
- Performance optimizations
|
||||
- More module specific options
|
||||
- Better error handling, especially the messages shown when using --show-errors
|
||||
- Using package managers libraries for package count detection instead own. E.g. using libalpm instead of counting files in /var/lib/pacman/local
|
||||
- Better documentation (especially default config file and the various --help options. Colored output?)
|
||||
- General feature parity with neofetch, to demonstrate supremity of c
|
||||
@@ -27,17 +27,34 @@ There are [screenshots on different platforms](https://github.com/fastfetch-cli/
|
||||
|
||||
### Linux
|
||||
|
||||
* Debian / Ubuntu: Download `fastfetch-<version>-Linux.deb` from [Github release page](https://github.com/fastfetch-cli/fastfetch/releases/latest) and `sudo apt install fastfetch-<version>-Linux.deb`
|
||||
Some distros packaged an outdated fastfetch version. Older version is not supported, please always ensure that the latest version is used.
|
||||
|
||||
* Ubuntu: [`ppa:zhangsongcui3371/fastfetch`](https://launchpad.net/~zhangsongcui3371/+archive/ubuntu/fastfetch) (for Ubuntu 22.04 or newer)
|
||||
* Debian / Ubuntu: Download `fastfetch-linux-<proper architecture>.deb` from [Github release page](https://github.com/fastfetch-cli/fastfetch/releases/latest) and double-click it (for Ubuntu 20.04 or newer and Debian 11 or newer).
|
||||
* Arch Linux: `sudo pacman -S fastfetch`
|
||||
* Fedora: `sudo dnf install fastfetch`
|
||||
* Gentoo: `sudo emerge --ask app-misc/fastfetch`
|
||||
* Alpine: `apk add --upgrade fastfetch`
|
||||
* NixOS: `nix-shell -p fastfetch`
|
||||
* openSUSE: `sudo zypper install fastfetch`
|
||||
* ALT Linux: `sudo apt-get install fastfetch`
|
||||
|
||||
[See also if fastfetch has been packaged for your favorite Linux distro](#Packaging)
|
||||
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`
|
||||
|
||||
### macOS
|
||||
|
||||
...via [HomeBrew](https://brew.sh):
|
||||
|
||||
`brew install fastfetch`
|
||||
|
||||
...via [MacPorts](https://www.macports.org):
|
||||
|
||||
`sudo port install fastfetch`
|
||||
|
||||
### Windows
|
||||
|
||||
`scoop install fastfetch`
|
||||
@@ -84,11 +101,90 @@ Logos can be heavily customized too; see the [logo documentation](https://github
|
||||
|
||||
## FAQ
|
||||
|
||||
Q: Why do you need a very performant version of neofetch?
|
||||
> I like putting neofetch in my ~/.bashrc to have a system overview whenever I use the terminal, but the slow speed annoyed me, so I created this. Also neofetch didn't output everything correctly (e.g Font is displayed as "[Plasma], Noto Sans, 10 [GTK2/3]") and writing my own tool gave me the possibility to fine tune it to run perfectly on at least my configuration.
|
||||
### Q: Neofetch is good enough. Why do I need fastfetch?
|
||||
|
||||
Q: It does not display [*] correctly for me, what can I do?
|
||||
> This is most likely because your system is not implemented (yet). At the moment I am focusing more on making the core app better, than adding more configurations. Feel free to open a pull request if you want to add support for your configuration
|
||||
1. Fastfetch is actively maintained.
|
||||
2. Fastfetch is faster. As the name suggests.
|
||||
3. Fastfetch 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).
|
||||
|
||||
### Q: Fastfetch shows my local IP address. It leaks my privacy!
|
||||
|
||||
A local IP (10.x.x.x, 172.x.x.x, 192.168.x.x) has nothing to do with privacy. It only makes sense if you are on the same network, for example, if you connect to the same Wi-Fi network.
|
||||
|
||||
Actually the `Local IP` module is the most useful module for me personally. I (@CarterLi) have several VMs installed to test fastfetch and often need to SSH into them. I have fastfetch running on shell startup and I never need to type `ip addr` manually.
|
||||
|
||||
If you really don't like it, you can disable the `Local IP` module in `config.jsonc`.
|
||||
|
||||
### Q: Where is the config file? I can't find it.
|
||||
|
||||
`Fastfetch` 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).
|
||||
|
||||
### Q: The configuration is so complex. Where is the documentation?
|
||||
|
||||
Fastfetch uses JSON (with comments) for configuration. I suggest you use an IDE with JSON schema support (like VSCode) to edit it.
|
||||
|
||||
Alternatively, you can refer to the presets in [`presets` directory](https://github.com/fastfetch-cli/fastfetch/tree/dev/presets).
|
||||
|
||||
### Q: I WANT THE DOCUMENTATION!
|
||||
|
||||
[Here is the documentation](https://github.com/fastfetch-cli/fastfetch/wiki/Json-Schema). It is generated from [JSON schema](https://github.com/fastfetch-cli/fastfetch/blob/dev/doc/json_schema.json) but you won't like it.
|
||||
|
||||
### Q: How can I customize the module output?
|
||||
|
||||
Fastfetch uses `format` to generate output. For example to make `GPU` module show GPU name only and ignore other information, you can use
|
||||
|
||||
```jsonc
|
||||
{
|
||||
"modules": [
|
||||
{
|
||||
"type": "gpu",
|
||||
"format": "{2}" // See `fastfetch -h gpu-format` for detail
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
which is equivalent to `fastfetch -s gpu --gpu-format '{2}'`
|
||||
|
||||
See `fastfetch -h format` for 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.
|
||||
|
||||
### Q: Fastfetch runs in white and black on shell startup. Why?
|
||||
|
||||
This issue usually happens when using fastfetch with `p10k`. There are known incompatibility between fastfetch and p10k instant prompt.
|
||||
The p10k doc clearly states that you should NOT print anything to stdout after `p10k-instant-prompt` is initialized. You should either put `fastfetch` before initialization of `p10k-instant-prompt` (recommended)
|
||||
|
||||
You can always use `fastfetch --pipe false` to force fastfetch running in colorful mode.
|
||||
|
||||
### Q: I want feature A / B / C. Will fastfetch support it?
|
||||
|
||||
Fastfetch is a system information tool. We only accept hardware or system level software feature requests. For most personal uses, I recommend using `Command` module to detect it yourself, which can be used to grab output from a custom shell script:
|
||||
|
||||
```jsonc
|
||||
// This module shows the default editor
|
||||
{
|
||||
"modules": [
|
||||
{
|
||||
"type": "command",
|
||||
"text": "$EDITOR --version | head -1",
|
||||
"key": "Editor"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
Otherwise, open a feature request in [GitHub Issues](https://github.com/fastfetch-cli/fastfetch/issues).
|
||||
|
||||
### Q: I have questions. Where can I get help?
|
||||
|
||||
* For usage questions, please start a discussion in [GitHub Discussions](https://github.com/fastfetch-cli/fastfetch/discussions).
|
||||
* For possible bugs, please open an issue in [GitHub Issues](https://github.com/fastfetch-cli/fastfetch/issues). Be sure to fill the bug-report template carefully for developers to investigate.
|
||||
|
||||
## Star History
|
||||
|
||||
|
||||
+1
-6
@@ -191,14 +191,13 @@ __fastfetch_completion()
|
||||
"--escape-bedrock"
|
||||
"--pipe"
|
||||
"--title-fqdn"
|
||||
"--escape-bedrock"
|
||||
"--disk-folders"
|
||||
"--disk-show-external"
|
||||
"--disk-show-hidden"
|
||||
"--disk-show-subvolumes"
|
||||
"--gpu-hide-integrated"
|
||||
"--gpu-hide-discrete"
|
||||
"--gpu-force-vulkan"
|
||||
"--gpu-force-method"
|
||||
"--disk-show-unknown"
|
||||
"--bluetooth-show-disconnected"
|
||||
)
|
||||
@@ -227,8 +226,6 @@ __fastfetch_completion()
|
||||
"--separator"
|
||||
"-s"
|
||||
"--structure"
|
||||
"--set"
|
||||
"--set-keyless"
|
||||
"--player-name"
|
||||
"--percent-type"
|
||||
"--publicip-url"
|
||||
@@ -360,7 +357,6 @@ __fastfetch_completion()
|
||||
local FF_OPTIONS_PATH=(
|
||||
"-c"
|
||||
"--config"
|
||||
"--os-file"
|
||||
"--lib-pci"
|
||||
"--lib-vulkan"
|
||||
"--lib-wayland"
|
||||
@@ -384,7 +380,6 @@ __fastfetch_completion()
|
||||
"--lib-pulse"
|
||||
"--lib-ddcutil"
|
||||
"--lib-nm"
|
||||
"--battery-dir"
|
||||
)
|
||||
|
||||
local FF_OPTIONS_LOGO=(
|
||||
|
||||
+2
-3
@@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env fish
|
||||
|
||||
if not type -q fastfetch
|
||||
return
|
||||
exit
|
||||
end
|
||||
|
||||
complete -c fastfetch -f
|
||||
@@ -85,8 +85,7 @@ string match -r -a -g "^###> ?(.*)" < (status -f) | string collect | python3 | s
|
||||
###> elif type == 'config':
|
||||
###> print(f'{command_prefix} -x -a "(__fastfetch_complete_config)"')
|
||||
###> elif type == 'enum':
|
||||
###> temp: str = ' '.join(map(lambda x: f"{x[0]}\\t{x[1]}", flag["arg"]["enum"].items()))
|
||||
###> print(f'{command_prefix} -x -a "{temp}"')
|
||||
###> 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':
|
||||
|
||||
Vendored
+60
@@ -0,0 +1,60 @@
|
||||
fastfetch (2.9.2) jammy; urgency=medium
|
||||
|
||||
* Update to 2.9.2
|
||||
|
||||
-- Carter Li <zhangsongcui@live.cn> Tue, 16 Apr 2024 16:32:40 +0800
|
||||
|
||||
fastfetch (2.9.1) jammy; urgency=medium
|
||||
|
||||
* Update to 2.9.1
|
||||
|
||||
-- Carter Li <zhangsongcui@live.cn> Mon, 08 Apr 2024 09:34:30 +0800
|
||||
|
||||
fastfetch (2.8.10) jammy; urgency=medium
|
||||
|
||||
* Update to 2.8.10
|
||||
|
||||
-- Carter Li <zhangsongcui@live.cn> Mon, 25 Mar 2024 15:01:53 +0800
|
||||
|
||||
fastfetch (2.8.9) jammy; urgency=medium
|
||||
|
||||
* Update to 2.8.9
|
||||
|
||||
-- Carter Li <zhangsongcui@live.cn> Fri, 15 Mar 2024 10:49:42 +0800
|
||||
|
||||
fastfetch (2.8.8) jammy; urgency=medium
|
||||
|
||||
* Update to 2.8.8
|
||||
|
||||
-- Carter Li <zhangsongcui@live.cn> Fri, 08 Mar 2024 09:59:41 +0800
|
||||
|
||||
fastfetch (2.8.6) jammy; urgency=medium
|
||||
|
||||
* Update to 2.8.6
|
||||
|
||||
-- Carter Li <zhangsongcui@live.cn> Wed, 28 Feb 2024 10:01:40 +0800
|
||||
|
||||
fastfetch (2.8.4) jammy; urgency=medium
|
||||
|
||||
* Update to 2.8.4
|
||||
|
||||
-- Carter Li <zhangsongcui@live.cn> Fri, 23 Feb 2024 16:14:57 +0800
|
||||
|
||||
fastfetch (2.7.1ubuntu2) jammy; urgency=medium
|
||||
|
||||
* Ignore .git
|
||||
|
||||
-- Carter Li <zhangsongcui@live.cn> Wed, 07 Feb 2024 14:23:23 +0800
|
||||
|
||||
fastfetch (2.7.1ubuntu1) jammy; urgency=medium
|
||||
|
||||
* Update build scripts
|
||||
|
||||
-- Carter Li <zhangsongcui@live.cn> Wed, 07 Feb 2024 13:53:37 +0800
|
||||
|
||||
fastfetch (2.7.1) jammy; urgency=medium
|
||||
|
||||
* Initial release.
|
||||
|
||||
-- Carter Li <zhangsongcui@live.cn> Tue, 06 Feb 2024 15:01:11 +0800
|
||||
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
12
|
||||
Vendored
+13
@@ -0,0 +1,13 @@
|
||||
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
|
||||
Standards-Version: 4.0.0
|
||||
Homepage: https://github.com/fastfetch-cli/fastfetch
|
||||
|
||||
Package: fastfetch
|
||||
Architecture: any
|
||||
Depends: ${shlibs:Depends}, ${misc:Depends}
|
||||
Description: Fastfetch is a 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.
|
||||
Vendored
+11
@@ -0,0 +1,11 @@
|
||||
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
|
||||
Upstream-Name: fastfetch
|
||||
Source: https://github.com/fastfetch-cli/fastfetch
|
||||
|
||||
Files: *
|
||||
Copyright: 2024 fastfetch-cli
|
||||
License: Expat
|
||||
|
||||
Files: src/3rdparty/yyjson/*
|
||||
Copyright: 2020 YaoYuan
|
||||
License: Expat
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
fastfetch_2.9.2_source.buildinfo universe/utils optional
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
debuild -S -i -I
|
||||
dput ppa:zhangsongcui3371/fastfetch ~/fastfetch_*.changes
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
#!/usr/bin/make -f
|
||||
|
||||
%:
|
||||
dh $@ --buildsystem=cmake+ninja
|
||||
|
||||
override_dh_ctest_configure:
|
||||
dh_ctest_configure -- -DSET_TWEAK=OFF -DBUILD_TESTS=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo
|
||||
Vendored
+4
@@ -0,0 +1,4 @@
|
||||
version=4
|
||||
opts="filenamemangle=s%.*/@ANY_VERSION@%@PACKAGE@-$1.tar.gz%,searchmode=plain" \
|
||||
https://api.github.com/repos/fastfetch-cli/fastfetch/releases?per_page=100 \
|
||||
https://api.github.com/repos/fastfetch-cli/fastfetch/tarball/@ANY_VERSION@
|
||||
+5
-8
@@ -107,12 +107,12 @@ To list all available modules, use \fB \-\-list\-modules \fR
|
||||
|
||||
.SS "Config Files"
|
||||
|
||||
fastfetch supports two types of config files. The legacy
|
||||
configuration files and a JSONC based format.
|
||||
Fastfetch uses JSONC based format for configuration. Fastfetch doesn't generate
|
||||
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'. You can migrate a legacy config
|
||||
file to the JSONC format by using \fB\-\-gen\-config\fR.
|
||||
files must have the extension '.jsonc'.
|
||||
|
||||
The specified configuration/preset files are searched in the following order:
|
||||
|
||||
@@ -122,10 +122,7 @@ The specified configuration/preset files are searched in the following order:
|
||||
|
||||
3. relative to /usr/share/fastfetch/presets/
|
||||
|
||||
When both a '.jsonc' and a '.conf' file with the same name is found,
|
||||
the '.jsonc' file is preferred.
|
||||
|
||||
Fastfetch provides some default presets. List them with \fB \-\-print\-available\-presets\fR.
|
||||
Fastfetch provides some default presets. List them with \fB\-\-list\-presets\fR.
|
||||
|
||||
.SH "SEE ALSO"
|
||||
.BR neofetch (1)
|
||||
|
||||
+588
-132
File diff suppressed because it is too large
Load Diff
@@ -10,6 +10,7 @@
|
||||
"chassis",
|
||||
"kernel",
|
||||
"uptime",
|
||||
"loadavg",
|
||||
"processes",
|
||||
"packages",
|
||||
"shell",
|
||||
@@ -28,10 +29,12 @@
|
||||
"terminal",
|
||||
"terminalfont",
|
||||
"terminalsize",
|
||||
"terminaltheme",
|
||||
"cpu",
|
||||
"cpuusage",
|
||||
"gpu",
|
||||
"memory",
|
||||
"physicalmemory",
|
||||
"swap",
|
||||
"disk",
|
||||
"battery",
|
||||
@@ -49,6 +52,7 @@
|
||||
"users",
|
||||
"bluetooth",
|
||||
"sound",
|
||||
"camera",
|
||||
"gamepad",
|
||||
"weather",
|
||||
"netio",
|
||||
|
||||
@@ -0,0 +1,84 @@
|
||||
{
|
||||
"$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json",
|
||||
"modules": [
|
||||
{
|
||||
"type": "title",
|
||||
"key": "User",
|
||||
"format": "{1}"
|
||||
},
|
||||
{
|
||||
"type": "title",
|
||||
"key": "Hostname",
|
||||
"format": "{2}"
|
||||
},
|
||||
{
|
||||
"type": "host",
|
||||
"key": "Model"
|
||||
},
|
||||
{
|
||||
"type": "os",
|
||||
"format": "{3} {9} {12}"
|
||||
},
|
||||
"kernel",
|
||||
"uptime",
|
||||
{
|
||||
"type": "loadavg",
|
||||
"key": "Load Average"
|
||||
},
|
||||
"processes",
|
||||
{
|
||||
"type": "wm",
|
||||
"key": "Window Manager"
|
||||
},
|
||||
{
|
||||
"type": "de",
|
||||
"key": "Desktop Environment"
|
||||
},
|
||||
{
|
||||
"type": "shell",
|
||||
"format": "{7}"
|
||||
},
|
||||
{
|
||||
"type": "terminal",
|
||||
"format": "{5} {6} \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█"
|
||||
},
|
||||
{
|
||||
"type": "packages",
|
||||
"format": "{1}"
|
||||
},
|
||||
{
|
||||
"type": "cpu",
|
||||
"key": "Temperature",
|
||||
"temp": true,
|
||||
"format": "{8}"
|
||||
},
|
||||
{
|
||||
"type": "cpu",
|
||||
"key": "CPU",
|
||||
"format": "{4} x {1}"
|
||||
},
|
||||
{
|
||||
"type": "gpu",
|
||||
"format": "{2}"
|
||||
},
|
||||
{
|
||||
"type": "memory",
|
||||
"key": "RAM"
|
||||
},
|
||||
{
|
||||
"type": "disk",
|
||||
"key": "Disk",
|
||||
"folders": "/"
|
||||
},
|
||||
{
|
||||
"type": "localip",
|
||||
"key": "LAN IP",
|
||||
"showIpv6": true,
|
||||
"showPrefixLen": false
|
||||
},
|
||||
{
|
||||
"type": "publicip",
|
||||
"key": "WAN IP"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -6,6 +6,7 @@
|
||||
"showErrors": true,
|
||||
"noBuffer": true
|
||||
},
|
||||
"logo": null,
|
||||
"modules": [
|
||||
"title",
|
||||
"separator",
|
||||
@@ -16,6 +17,7 @@
|
||||
"chassis",
|
||||
"kernel",
|
||||
"uptime",
|
||||
"loadavg",
|
||||
"processes",
|
||||
"packages",
|
||||
"shell",
|
||||
@@ -34,10 +36,12 @@
|
||||
"terminal",
|
||||
"terminalfont",
|
||||
"terminalsize",
|
||||
"terminaltheme",
|
||||
"cpu",
|
||||
"cpuusage",
|
||||
"gpu",
|
||||
"memory",
|
||||
"physicalmemory",
|
||||
"swap",
|
||||
"disk",
|
||||
"battery",
|
||||
@@ -55,6 +59,7 @@
|
||||
"users",
|
||||
"bluetooth",
|
||||
"sound",
|
||||
"camera",
|
||||
"gamepad",
|
||||
{
|
||||
"type": "weather",
|
||||
|
||||
@@ -84,17 +84,17 @@
|
||||
},
|
||||
{
|
||||
"type": "host",
|
||||
"key": " PC",
|
||||
"key": " PC",
|
||||
"keyColor": "green"
|
||||
},
|
||||
{
|
||||
"type": "cpu",
|
||||
"key": "│ ├",
|
||||
"key": "│ ├",
|
||||
"keyColor": "green"
|
||||
},
|
||||
{
|
||||
"type": "gpu",
|
||||
"key": "│ ├",
|
||||
"key": "│ ├",
|
||||
"keyColor": "green"
|
||||
},
|
||||
{
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"$schema": "file:///C:/msys64/home/zhang/fastfetch/doc/json_schema.json",
|
||||
"$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json",
|
||||
"logo": {
|
||||
"type": "small"
|
||||
},
|
||||
|
||||
@@ -0,0 +1,104 @@
|
||||
{
|
||||
"$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json",
|
||||
"logo": {
|
||||
"type": "none"
|
||||
},
|
||||
"display": {
|
||||
"separator": "-> "
|
||||
},
|
||||
"modules": [
|
||||
{
|
||||
"type": "title",
|
||||
"format": " {6}{7}{8}"
|
||||
},
|
||||
"break",
|
||||
{
|
||||
"type": "custom",
|
||||
"format": "┌───────────────────────────── \u001b[1mSystem Information\u001b[0m ─────────────────────────────┐" // `\u001b` is `\033`, or `\e`
|
||||
},
|
||||
"break",
|
||||
{
|
||||
"key": " OS ",
|
||||
"keyColor": "red",
|
||||
"type": "os"
|
||||
},
|
||||
{
|
||||
"key": " Machine ",
|
||||
"keyColor": "green",
|
||||
"type": "host"
|
||||
},
|
||||
{
|
||||
"key": " Kernel ",
|
||||
"keyColor": "magenta",
|
||||
"type": "kernel"
|
||||
},
|
||||
{
|
||||
"key": " Uptime ",
|
||||
"keyColor": "red",
|
||||
"type": "uptime"
|
||||
},
|
||||
{
|
||||
"key": " Resolution ",
|
||||
"keyColor": "yellow",
|
||||
"type": "display",
|
||||
"compactType": "original-with-refresh-rate"
|
||||
},
|
||||
{
|
||||
"key": " WM ",
|
||||
"keyColor": "blue",
|
||||
"type": "wm"
|
||||
},
|
||||
{
|
||||
"key": " DE ",
|
||||
"keyColor": "green",
|
||||
"type": "de"
|
||||
},
|
||||
{
|
||||
"key": " Shell ",
|
||||
"keyColor": "cyan",
|
||||
"type": "shell"
|
||||
},
|
||||
{
|
||||
"key": " Terminal ",
|
||||
"keyColor": "red",
|
||||
"type": "terminal"
|
||||
},
|
||||
{
|
||||
"key": " CPU ",
|
||||
"keyColor": "yellow",
|
||||
"type": "cpu"
|
||||
},
|
||||
{
|
||||
"key": " GPU ",
|
||||
"keyColor": "blue",
|
||||
"type": "gpu"
|
||||
},
|
||||
{
|
||||
"key": " Memory ",
|
||||
"keyColor": "magenta",
|
||||
"type": "memory"
|
||||
},
|
||||
{
|
||||
"key": " Local IP ",
|
||||
"keyColor": "red",
|
||||
"type": "localip",
|
||||
"compact": true
|
||||
},
|
||||
{
|
||||
"key": " Public IP ",
|
||||
"keyColor": "cyan",
|
||||
"type": "publicip"
|
||||
},
|
||||
"break",
|
||||
{
|
||||
"type": "custom",
|
||||
"format": "└──────────────────────────────────────────────────────────────────────────────┘" // `\u001b` is `\033`, or `\e`
|
||||
},
|
||||
"break",
|
||||
{
|
||||
"type": "colors",
|
||||
"paddingLeft": 34,
|
||||
"symbol": "circle"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
{
|
||||
"$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json",
|
||||
"logo": {
|
||||
"type": "small",
|
||||
"padding": {
|
||||
"top": 1
|
||||
}
|
||||
},
|
||||
"display": {
|
||||
"separator": "",
|
||||
"keyWidth": 15
|
||||
},
|
||||
"modules": [
|
||||
{
|
||||
"key": "╭───────────╮",
|
||||
"type": "custom"
|
||||
},
|
||||
{
|
||||
// draw borders first to make colors of left and right border consistant
|
||||
"key": "│ │\u001b[11D\u001b[31m user",
|
||||
"type": "title",
|
||||
"format": "{1}"
|
||||
},
|
||||
{
|
||||
"key": "│ │\u001b[11D\u001b[32m hname",
|
||||
"type": "title",
|
||||
"format": "{2}"
|
||||
},
|
||||
{
|
||||
"key": "│ │\u001b[11D\u001b[33m uptime",
|
||||
"type": "uptime"
|
||||
},
|
||||
{
|
||||
"key": "│ │\u001b[11D\u001b[34m distro",
|
||||
"type": "os"
|
||||
},
|
||||
{
|
||||
"key": "│ │\u001b[11D\u001b[35m kernel",
|
||||
"type": "kernel"
|
||||
},
|
||||
{
|
||||
"key": "│ │\u001b[11D\u001b[36m desktop",
|
||||
"type": "de"
|
||||
},
|
||||
{
|
||||
"key": "│ │\u001b[11D\u001b[31m term",
|
||||
"type": "terminal"
|
||||
},
|
||||
{
|
||||
"key": "│ │\u001b[11D\u001b[32m shell",
|
||||
"type": "shell"
|
||||
},
|
||||
{
|
||||
"key": "│ │\u001b[11D\u001b[33m cpu",
|
||||
"type": "cpu"
|
||||
},
|
||||
{
|
||||
"key": "│ │\u001b[11D\u001b[34m disk",
|
||||
"type": "disk",
|
||||
"folders": "/"
|
||||
},
|
||||
{
|
||||
"key": "│ │\u001b[11D\u001b[35m memory",
|
||||
"type": "memory"
|
||||
},
|
||||
{
|
||||
"key": "│ │\u001b[11D\u001b[36m network",
|
||||
"type": "localip",
|
||||
"format": "{1} ({4})"
|
||||
},
|
||||
{
|
||||
"key": "├───────────┤",
|
||||
"type": "custom"
|
||||
},
|
||||
{
|
||||
"key": "│ │\u001b[11D\u001b[m colors",
|
||||
"type": "colors",
|
||||
"symbol": "circle"
|
||||
},
|
||||
{
|
||||
"key": "╰───────────╯",
|
||||
"type": "custom"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -19,15 +19,15 @@
|
||||
},
|
||||
{
|
||||
"type": "host",
|
||||
"key": " "
|
||||
"key": " "
|
||||
},
|
||||
{
|
||||
"type": "cpu",
|
||||
"key": " "
|
||||
"key": " "
|
||||
},
|
||||
{
|
||||
"type": "gpu",
|
||||
"key": " "
|
||||
"key": " "
|
||||
},
|
||||
{
|
||||
"type": "disk",
|
||||
|
||||
@@ -9,13 +9,11 @@
|
||||
"modules": [
|
||||
{
|
||||
"type": "theme",
|
||||
"key": "T",
|
||||
"format": "{7}"
|
||||
"key": "T"
|
||||
},
|
||||
{
|
||||
"type": "icons",
|
||||
"key": "I",
|
||||
"format": "{5}"
|
||||
"key": "I"
|
||||
},
|
||||
{
|
||||
"type": "font",
|
||||
|
||||
@@ -15,17 +15,17 @@
|
||||
"modules": [
|
||||
{
|
||||
"type": "host",
|
||||
"key": "╭─",
|
||||
"key": "╭─",
|
||||
"keyColor": "green"
|
||||
},
|
||||
{
|
||||
"type": "cpu",
|
||||
"key": "├─",
|
||||
"key": "├─",
|
||||
"keyColor": "green"
|
||||
},
|
||||
{
|
||||
"type": "gpu",
|
||||
"key": "├─",
|
||||
"key": "├─",
|
||||
"keyColor": "green"
|
||||
},
|
||||
{
|
||||
|
||||
@@ -77,17 +77,17 @@
|
||||
"break",
|
||||
{
|
||||
"type": "host",
|
||||
"key": " PC",
|
||||
"key": " PC",
|
||||
"keyColor": "green"
|
||||
},
|
||||
{
|
||||
"type": "cpu",
|
||||
"key": "├",
|
||||
"key": "├",
|
||||
"keyColor": "green"
|
||||
},
|
||||
{
|
||||
"type": "gpu",
|
||||
"key": "├",
|
||||
"key": "├",
|
||||
"keyColor": "green"
|
||||
},
|
||||
{
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
},
|
||||
{
|
||||
"type": "memory",
|
||||
"key": ""
|
||||
"key": ""
|
||||
},
|
||||
{
|
||||
"type": "packages",
|
||||
|
||||
+25
-13
@@ -1,25 +1,37 @@
|
||||
{
|
||||
"$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json",
|
||||
"logo": {
|
||||
"type": "builtin",
|
||||
"source": "arch"
|
||||
},
|
||||
"modules": [
|
||||
"host",
|
||||
"display",
|
||||
{
|
||||
"type": "host",
|
||||
"format": "{?2}{2}{?}{?5} ({5}){?}"
|
||||
},
|
||||
"chassis",
|
||||
{
|
||||
"type": "board",
|
||||
"format": "{?1}{1}{?}{?2} ({2}){?}"
|
||||
},
|
||||
"cpu",
|
||||
"gpu",
|
||||
{
|
||||
"type": "memory",
|
||||
"format": "{?2}{2}{?}"
|
||||
},
|
||||
{
|
||||
"type": "disk",
|
||||
"format": "{?2}{2}{?}"
|
||||
},
|
||||
"physicaldisk",
|
||||
"gpu",
|
||||
"display",
|
||||
"monitor",
|
||||
{
|
||||
"type": "wifi",
|
||||
"format": "{?1}{1}{?}{?6} - {6}{?}"
|
||||
},
|
||||
{
|
||||
"type": "sound",
|
||||
"format": "{?2}{2}{?}"
|
||||
},
|
||||
"camera",
|
||||
{
|
||||
"type": "battery",
|
||||
"format": "{?1}{1} {?}{?2}{2} {?}{?3}({3}){?}"
|
||||
}
|
||||
"format": "{?1}{1}{?}{?2} {2}{?}{?3} ({3}){?}"
|
||||
},
|
||||
"poweradapter"
|
||||
]
|
||||
}
|
||||
|
||||
+9
-12
@@ -1,16 +1,16 @@
|
||||
{
|
||||
"$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json",
|
||||
"display": {
|
||||
"size": {
|
||||
"maxPrefix": "MB",
|
||||
"ndigits": 0
|
||||
}
|
||||
},
|
||||
"modules": [
|
||||
"title",
|
||||
"separator",
|
||||
{
|
||||
"type": "os",
|
||||
"format": "{3} {12}"
|
||||
},
|
||||
{
|
||||
"type": "host",
|
||||
"format": "{/2}{-}{/}{2}{?3} {3}{?}"
|
||||
},
|
||||
"os",
|
||||
"host",
|
||||
"kernel",
|
||||
"uptime",
|
||||
"packages",
|
||||
@@ -23,10 +23,7 @@
|
||||
"de",
|
||||
"wm",
|
||||
"wmtheme",
|
||||
{
|
||||
"type": "theme",
|
||||
"format": "{?1}{1}{?3} {3}{?} [Plasma], {?}{7}"
|
||||
},
|
||||
"theme",
|
||||
"icons",
|
||||
"terminal",
|
||||
{
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
"uptime",
|
||||
{
|
||||
"type": "battery",
|
||||
"format": "{/4}{-}{/}{4}%{?5} [{5}]{?}"
|
||||
"format": "{/4}{-}{/}{4}{?5} [{5}]{?}"
|
||||
},
|
||||
"break",
|
||||
"packages",
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 68 KiB After Width: | Height: | Size: 341 KiB |
Vendored
+383
@@ -0,0 +1,383 @@
|
||||
//
|
||||
// Copyright (c) 2023 Advanced Micro Devices, Inc. All rights reserved.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
//
|
||||
|
||||
/// \file
|
||||
/// \mainpage
|
||||
/// AGS Library Overview
|
||||
/// --------------------
|
||||
/// This document provides an overview of the AGS (AMD GPU Services) library. The AGS library provides software developers with the ability to query
|
||||
/// AMD GPU software and hardware state information that is not normally available through standard operating systems or graphic APIs.
|
||||
///
|
||||
/// The latest version of the API is publicly hosted here: https://github.com/GPUOpen-LibrariesAndSDKs/AGS_SDK/.
|
||||
/// It is also worth checking http://gpuopen.com/gaming-product/amd-gpu-services-ags-library/ for any updates and articles on AGS.
|
||||
/// \internal
|
||||
/// Online documentation is publicly hosted here: http://gpuopen-librariesandsdks.github.io/ags/
|
||||
/// \endinternal
|
||||
///
|
||||
/// ---------------------------------------
|
||||
/// What's new in AGS 6.2 since version 6.1
|
||||
/// ---------------------------------------
|
||||
/// AGS 6.2 includes the following updates:
|
||||
/// * Shader clock intrinsics
|
||||
/// * Minor improvements and fixes
|
||||
///
|
||||
/// ---------------------------------------
|
||||
/// What's new in AGS 6.1 since version 6.0
|
||||
/// ---------------------------------------
|
||||
/// AGS 6.1 includes the following updates:
|
||||
/// * RDNA3 detection
|
||||
///
|
||||
/// ---------------------------------------
|
||||
/// What's new in AGS 6.0 since version 5.4.2
|
||||
/// ---------------------------------------
|
||||
/// AGS 6.0 includes the following updates:
|
||||
/// * DX12 ray tracing hit token for RDNA2 hardware.
|
||||
/// * Shader intrinsic that exposes ReadLaneAt in DX12.
|
||||
/// * Shader intrinsics that expose explicit float conversions in DX12.
|
||||
/// * Refactored and revised API to minimize user error.
|
||||
/// * Added agsGetVersionNumber.
|
||||
/// * Detection for external GPUs.
|
||||
/// * Detection of RDNA2 architecture.
|
||||
/// * Grouped the more established intrinsics together into per year support.
|
||||
/// * Function pointer typedefs for the API
|
||||
///
|
||||
/// ---------------------------------------
|
||||
/// What's new in AGS 5.4.2 since version 5.4.1
|
||||
/// ---------------------------------------
|
||||
/// AGS 5.4.2 includes the following updates:
|
||||
/// * sharedMemoryInBytes has been reinstated.
|
||||
/// * Clock speed returned for APUs.
|
||||
///
|
||||
/// ---------------------------------------
|
||||
/// What's new in AGS 5.4.1 since version 5.4.0
|
||||
/// ---------------------------------------
|
||||
/// AGS 5.4.1 includes the following updates:
|
||||
/// * AsicFamily_Count to help with code maintenance.
|
||||
/// * Visual Studio 2019 support.
|
||||
/// * x86 support
|
||||
/// * BaseInstance and BaseVertex intrinsics along with corresponding caps bits.
|
||||
/// * GetWaveSize intrinsic along with corresponding caps bits.
|
||||
///
|
||||
/// ---------------------------------------
|
||||
/// What's new in AGS 5.4 since version 5.3
|
||||
/// ---------------------------------------
|
||||
/// AGS 5.4 includes the following updates:
|
||||
/// * A more detailed description of the GPU architecture, now including RDNA GPUs.
|
||||
/// * Radeon 7 core and memory speeds returned.
|
||||
/// * Draw index and Atomic U64 intrinsics for both DX11 and DX12.
|
||||
///
|
||||
/// ---------------------------------------
|
||||
/// What's new in AGS 5.3 since version 5.2
|
||||
/// ---------------------------------------
|
||||
/// AGS 5.3 includes the following updates:
|
||||
/// * DX11 deferred context support for Multi Draw Indirect and UAV Overlap extensions.
|
||||
/// * A Radeon Software Version helper to determine whether the installed driver meets your game's minimum driver version requirements.
|
||||
/// * Freesync HDR Gamma 2.2 mode which uses a 1010102 swapchain and can be considered as an alternative to using the 64 bit swapchain required for Freesync HDR scRGB.
|
||||
///
|
||||
/// Using the AGS library
|
||||
/// ---------------------
|
||||
/// It is recommended to take a look at the source code for the samples that come with the AGS SDK:
|
||||
/// * AGSSample
|
||||
/// * CrossfireSample
|
||||
/// * EyefinitySample
|
||||
/// The AGSSample application is the simplest of the three examples and demonstrates the code required to initialize AGS and use it to query the GPU and Eyefinity state.
|
||||
/// The CrossfireSample application demonstrates the use of the new API to transfer resources on GPUs in Crossfire mode. Lastly, the EyefinitySample application provides a more
|
||||
/// extensive example of Eyefinity setup than the basic example provided in AGSSample.
|
||||
/// There are other samples on Github that demonstrate the DirectX shader extensions, such as the Barycentrics11 and Barycentrics12 samples.
|
||||
///
|
||||
/// To add AGS support to an existing project, follow these steps:
|
||||
/// * Link your project against the correct import library. Choose from either the 32 bit or 64 bit version.
|
||||
/// * Copy the AGS dll into the same directory as your game executable.
|
||||
/// * Include the amd_ags.h header file from your source code.
|
||||
/// * Include the AGS hlsl files if you are using the shader intrinsics.
|
||||
/// * Declare a pointer to an AGSContext and make this available for all subsequent calls to AGS.
|
||||
/// * On game initialization, call \ref agsInitialize passing in the address of the context. On success, this function will return a valid context pointer.
|
||||
///
|
||||
/// Don't forget to cleanup AGS by calling \ref agsDeInitialize when the app exits, after the device has been destroyed.
|
||||
|
||||
#ifndef AMD_AGS_H
|
||||
#define AMD_AGS_H
|
||||
|
||||
#define AMD_AGS_VERSION_MAJOR 6 ///< AGS major version
|
||||
#define AMD_AGS_VERSION_MINOR 2 ///< AGS minor version
|
||||
#define AMD_AGS_VERSION_PATCH 0 ///< AGS patch version
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/// \defgroup Defines AGS defines
|
||||
/// @{
|
||||
#if defined (AGS_GCC)
|
||||
#define AMD_AGS_API
|
||||
#else
|
||||
#define AMD_AGS_API __declspec(dllexport) ///< AGS exported functions
|
||||
#endif
|
||||
|
||||
#define AGS_MAKE_VERSION( major, minor, patch ) ( ( major << 22 ) | ( minor << 12 ) | patch ) ///< Macro to create the app and engine versions for the fields in \ref AGSDX12ExtensionParams and \ref AGSDX11ExtensionParams and the Radeon Software Version
|
||||
#define AGS_UNSPECIFIED_VERSION 0xFFFFAD00 ///< Use this to specify no version
|
||||
#define AGS_CURRENT_VERSION AGS_MAKE_VERSION( AMD_AGS_VERSION_MAJOR, AMD_AGS_VERSION_MINOR, AMD_AGS_VERSION_PATCH ) ///< Macro to return the current AGS version as defined by the AGS header file
|
||||
/// @}
|
||||
|
||||
/// \defgroup enums General enumerations
|
||||
/// @{
|
||||
|
||||
/// The return codes
|
||||
typedef enum AGSReturnCode
|
||||
{
|
||||
AGS_SUCCESS, ///< Successful function call
|
||||
AGS_FAILURE, ///< Failed to complete call for some unspecified reason
|
||||
AGS_INVALID_ARGS, ///< Invalid arguments into the function
|
||||
AGS_OUT_OF_MEMORY, ///< Out of memory when allocating space internally
|
||||
AGS_MISSING_D3D_DLL, ///< Returned when a D3D dll fails to load
|
||||
AGS_LEGACY_DRIVER, ///< Returned if a feature is not present in the installed driver
|
||||
AGS_NO_AMD_DRIVER_INSTALLED, ///< Returned if the AMD GPU driver does not appear to be installed
|
||||
AGS_EXTENSION_NOT_SUPPORTED, ///< Returned if the driver does not support the requested driver extension
|
||||
AGS_ADL_FAILURE, ///< Failure in ADL (the AMD Display Library)
|
||||
AGS_DX_FAILURE, ///< Failure from DirectX runtime
|
||||
AGS_D3DDEVICE_NOT_CREATED ///< Failure due to not creating the D3D device successfully via AGS.
|
||||
} AGSReturnCode;
|
||||
|
||||
/// @}
|
||||
|
||||
typedef struct AGSContext AGSContext; ///< All function calls in AGS require a pointer to a context. This is generated via \ref agsInitialize
|
||||
|
||||
/// The rectangle struct used by AGS.
|
||||
typedef struct AGSRect
|
||||
{
|
||||
int offsetX; ///< Offset on X axis
|
||||
int offsetY; ///< Offset on Y axis
|
||||
int width; ///< Width of rectangle
|
||||
int height; ///< Height of rectangle
|
||||
} AGSRect;
|
||||
|
||||
/// The display info struct used to describe a display enumerated by AGS
|
||||
typedef struct AGSDisplayInfo
|
||||
{
|
||||
char name[ 256 ]; ///< The name of the display
|
||||
char displayDeviceName[ 32 ]; ///< The display device name, i.e. DISPLAY_DEVICE::DeviceName
|
||||
|
||||
unsigned int isPrimaryDisplay : 1; ///< Whether this display is marked as the primary display
|
||||
unsigned int HDR10 : 1; ///< HDR10 is supported on this display
|
||||
unsigned int dolbyVision : 1; ///< Dolby Vision is supported on this display
|
||||
unsigned int freesync : 1; ///< Freesync is supported on this display
|
||||
unsigned int freesyncHDR : 1; ///< Freesync HDR is supported on this display
|
||||
unsigned int eyefinityInGroup : 1; ///< The display is part of the Eyefinity group
|
||||
unsigned int eyefinityPreferredDisplay : 1; ///< The display is the preferred display in the Eyefinity group for displaying the UI
|
||||
unsigned int eyefinityInPortraitMode : 1; ///< The display is in the Eyefinity group but in portrait mode
|
||||
unsigned int reservedPadding : 24; ///< Reserved for future use
|
||||
|
||||
int maxResolutionX; ///< The maximum supported resolution of the unrotated display
|
||||
int maxResolutionY; ///< The maximum supported resolution of the unrotated display
|
||||
float maxRefreshRate; ///< The maximum supported refresh rate of the display
|
||||
|
||||
AGSRect currentResolution; ///< The current resolution and position in the desktop, ignoring Eyefinity bezel compensation
|
||||
AGSRect visibleResolution; ///< The visible resolution and position. When Eyefinity bezel compensation is enabled this will
|
||||
///< be the sub region in the Eyefinity single large surface (SLS)
|
||||
float currentRefreshRate; ///< The current refresh rate
|
||||
|
||||
int eyefinityGridCoordX; ///< The X coordinate in the Eyefinity grid. -1 if not in an Eyefinity group
|
||||
int eyefinityGridCoordY; ///< The Y coordinate in the Eyefinity grid. -1 if not in an Eyefinity group
|
||||
|
||||
double chromaticityRedX; ///< Red display primary X coord
|
||||
double chromaticityRedY; ///< Red display primary Y coord
|
||||
|
||||
double chromaticityGreenX; ///< Green display primary X coord
|
||||
double chromaticityGreenY; ///< Green display primary Y coord
|
||||
|
||||
double chromaticityBlueX; ///< Blue display primary X coord
|
||||
double chromaticityBlueY; ///< Blue display primary Y coord
|
||||
|
||||
double chromaticityWhitePointX; ///< White point X coord
|
||||
double chromaticityWhitePointY; ///< White point Y coord
|
||||
|
||||
double screenDiffuseReflectance; ///< Percentage expressed between 0 - 1
|
||||
double screenSpecularReflectance; ///< Percentage expressed between 0 - 1
|
||||
|
||||
double minLuminance; ///< The minimum luminance of the display in nits
|
||||
double maxLuminance; ///< The maximum luminance of the display in nits
|
||||
double avgLuminance; ///< The average luminance of the display in nits
|
||||
|
||||
int logicalDisplayIndex; ///< The internally used index of this display
|
||||
int adlAdapterIndex; ///< The internally used ADL adapter index
|
||||
int reserved; ///< reserved field
|
||||
} AGSDisplayInfo;
|
||||
|
||||
/// The ASIC family
|
||||
typedef enum AsicFamily
|
||||
{
|
||||
AsicFamily_Unknown, ///< Unknown architecture, potentially from another IHV. Check \ref AGSDeviceInfo::vendorId
|
||||
AsicFamily_PreGCN, ///< Pre GCN architecture.
|
||||
AsicFamily_GCN1, ///< AMD GCN 1 architecture: Oland, Cape Verde, Pitcairn & Tahiti.
|
||||
AsicFamily_GCN2, ///< AMD GCN 2 architecture: Hawaii & Bonaire. This also includes APUs Kaveri and Carrizo.
|
||||
AsicFamily_GCN3, ///< AMD GCN 3 architecture: Tonga & Fiji.
|
||||
AsicFamily_GCN4, ///< AMD GCN 4 architecture: Polaris.
|
||||
AsicFamily_Vega, ///< AMD Vega architecture, including Raven Ridge (ie AMD Ryzen CPU + AMD Vega GPU).
|
||||
AsicFamily_RDNA, ///< AMD RDNA architecture
|
||||
AsicFamily_RDNA2, ///< AMD RDNA2 architecture
|
||||
AsicFamily_RDNA3, ///< AMD RDNA3 architecture
|
||||
|
||||
AsicFamily_Count ///< Number of enumerated ASIC families
|
||||
} AsicFamily;
|
||||
|
||||
/// The device info struct used to describe a physical GPU enumerated by AGS
|
||||
typedef struct AGSDeviceInfo
|
||||
{
|
||||
const char* adapterString; ///< The adapter name string
|
||||
AsicFamily asicFamily; ///< Set to Unknown if not AMD hardware
|
||||
unsigned int isAPU : 1; ///< Whether this device is an APU
|
||||
unsigned int isPrimaryDevice : 1; ///< Whether this device is marked as the primary device
|
||||
unsigned int isExternal :1; ///< Whether this device is a detachable, external device
|
||||
unsigned int reservedPadding : 29; ///< Reserved for future use
|
||||
|
||||
int vendorId; ///< The vendor id
|
||||
int deviceId; ///< The device id
|
||||
int revisionId; ///< The revision id
|
||||
|
||||
int numCUs; ///< Number of compute units
|
||||
int numWGPs; ///< Number of RDNA Work Group Processors. Only valid if ASIC is RDNA onwards.
|
||||
|
||||
int numROPs; ///< Number of ROPs
|
||||
int coreClock; ///< Core clock speed at 100% power in MHz
|
||||
int memoryClock; ///< Memory clock speed at 100% power in MHz
|
||||
int memoryBandwidth; ///< Memory bandwidth in MB/s
|
||||
float teraFlops; ///< Teraflops of GPU. Zero if not GCN onwards. Calculated from iCoreClock * iNumCUs * 64 Pixels/clk * 2 instructions/MAD
|
||||
|
||||
unsigned long long localMemoryInBytes; ///< The size of local memory in bytes. 0 for non AMD hardware.
|
||||
unsigned long long sharedMemoryInBytes; ///< The size of system memory available to the GPU in bytes. It is important to factor this into your VRAM budget for APUs
|
||||
///< as the reported local memory will only be a small fraction of the total memory available to the GPU.
|
||||
|
||||
int numDisplays; ///< The number of active displays found to be attached to this adapter.
|
||||
AGSDisplayInfo* displays; ///< List of displays allocated by AGS to be numDisplays in length.
|
||||
|
||||
int eyefinityEnabled; ///< Indicates if Eyefinity is active
|
||||
int eyefinityGridWidth; ///< Contains width of the multi-monitor grid that makes up the Eyefinity Single Large Surface.
|
||||
int eyefinityGridHeight; ///< Contains height of the multi-monitor grid that makes up the Eyefinity Single Large Surface.
|
||||
int eyefinityResolutionX; ///< Contains width in pixels of the multi-monitor Single Large Surface.
|
||||
int eyefinityResolutionY; ///< Contains height in pixels of the multi-monitor Single Large Surface.
|
||||
int eyefinityBezelCompensated; ///< Indicates if bezel compensation is used for the current SLS display area. 1 if enabled, and 0 if disabled.
|
||||
|
||||
int adlAdapterIndex; ///< Internally used index into the ADL list of adapters
|
||||
int reserved; ///< reserved field
|
||||
} AGSDeviceInfo;
|
||||
|
||||
/// \defgroup general General API functions
|
||||
/// API for initialization, cleanup, HDR display modes and Crossfire GPU count
|
||||
/// @{
|
||||
|
||||
typedef void* (__stdcall *AGS_ALLOC_CALLBACK)( size_t allocationSize ); ///< AGS user defined allocation prototype
|
||||
typedef void (__stdcall *AGS_FREE_CALLBACK)( void* allocationPtr ); ///< AGS user defined free prototype
|
||||
|
||||
/// The configuration options that can be passed in to \ref agsInitialize
|
||||
typedef struct AGSConfiguration
|
||||
{
|
||||
AGS_ALLOC_CALLBACK allocCallback; ///< Optional memory allocation callback. If not supplied, malloc() is used
|
||||
AGS_FREE_CALLBACK freeCallback; ///< Optional memory freeing callback. If not supplied, free() is used
|
||||
} AGSConfiguration;
|
||||
|
||||
/// The top level GPU information returned from \ref agsInitialize
|
||||
typedef struct AGSGPUInfo
|
||||
{
|
||||
const char* driverVersion; ///< The AMD driver package version
|
||||
const char* radeonSoftwareVersion; ///< The Radeon Software Version
|
||||
|
||||
int numDevices; ///< Number of GPUs in the system
|
||||
AGSDeviceInfo* devices; ///< List of GPUs in the system
|
||||
} AGSGPUInfo;
|
||||
|
||||
/// The struct to specify the display settings to the driver.
|
||||
typedef struct AGSDisplaySettings AGSDisplaySettings;
|
||||
|
||||
|
||||
/// The result returned from \ref agsCheckDriverVersion
|
||||
typedef enum AGSDriverVersionResult
|
||||
{
|
||||
AGS_SOFTWAREVERSIONCHECK_OK, ///< The reported Radeon Software Version is newer or the same as the required version
|
||||
AGS_SOFTWAREVERSIONCHECK_OLDER, ///< The reported Radeon Software Version is older than the required version
|
||||
AGS_SOFTWAREVERSIONCHECK_UNDEFINED ///< The check could not determine as result. This could be because it is a private or custom driver or just invalid arguments.
|
||||
} AGSDriverVersionResult;
|
||||
|
||||
///
|
||||
/// Helper function to check the installed software version against the required software version.
|
||||
///
|
||||
/// \param [in] radeonSoftwareVersionReported The Radeon Software Version returned from \ref AGSGPUInfo::radeonSoftwareVersion.
|
||||
/// \param [in] radeonSoftwareVersionRequired The Radeon Software Version to check against. This is specificed using \ref AGS_MAKE_VERSION.
|
||||
/// \return The result of the check.
|
||||
///
|
||||
AMD_AGS_API AGSDriverVersionResult agsCheckDriverVersion( const char* radeonSoftwareVersionReported, unsigned int radeonSoftwareVersionRequired );
|
||||
|
||||
///
|
||||
/// Function to return the AGS version number.
|
||||
///
|
||||
/// \return The version number made using AGS_MAKE_VERSION( AMD_AGS_VERSION_MAJOR, AMD_AGS_VERSION_MINOR, AMD_AGS_VERSION_PATCH ).
|
||||
///
|
||||
AMD_AGS_API int agsGetVersionNumber();
|
||||
|
||||
///
|
||||
/// Function used to initialize the AGS library.
|
||||
/// agsVersion must be specified as AGS_CURRENT_VERSION or the call will return \ref AGS_INVALID_ARGS.
|
||||
/// Must be called prior to any of the subsequent AGS API calls.
|
||||
/// Must be called prior to ID3D11Device or ID3D12Device creation.
|
||||
/// \note The caller of this function should handle the possibility of the call failing in the cases below. One option is to do a vendor id check and only call \ref agsInitialize if there is an AMD GPU present.
|
||||
/// \note This function will fail with \ref AGS_NO_AMD_DRIVER_INSTALLED if there is no AMD driver found on the system.
|
||||
/// \note This function will fail with \ref AGS_LEGACY_DRIVER in Catalyst versions before 12.20.
|
||||
///
|
||||
/// \param [in] agsVersion The API version specified using the \ref AGS_CURRENT_VERSION macro. If this does not match the version in the binary this initialization call will fail.
|
||||
/// \param [in] config Optional pointer to a AGSConfiguration struct to override the default library configuration.
|
||||
/// \param [out] context Address of a pointer to a context. This function allocates a context on the heap which is then required for all subsequent API calls.
|
||||
/// \param [out] gpuInfo Optional pointer to a AGSGPUInfo struct which will get filled in for all the GPUs in the system.
|
||||
///
|
||||
AMD_AGS_API AGSReturnCode agsInitialize( int agsVersion, const AGSConfiguration* config, AGSContext** context, AGSGPUInfo* gpuInfo );
|
||||
|
||||
///
|
||||
/// Function used to clean up the AGS library.
|
||||
///
|
||||
/// \param [in] context Pointer to a context. This function will deallocate the context from the heap.
|
||||
///
|
||||
AMD_AGS_API AGSReturnCode agsDeInitialize( AGSContext* context );
|
||||
|
||||
///
|
||||
/// Function used to set a specific display into HDR mode
|
||||
/// \note Setting all of the values apart from color space and transfer function to zero will cause the display to use defaults.
|
||||
/// \note Call this function after each mode change (switch to fullscreen, any change in swapchain etc).
|
||||
/// \note HDR10 PQ mode requires a 1010102 swapchain.
|
||||
/// \note HDR10 scRGB mode requires an FP16 swapchain.
|
||||
/// \note Freesync HDR scRGB mode requires an FP16 swapchain.
|
||||
/// \note Freesync HDR Gamma 2.2 mode requires a 1010102 swapchain.
|
||||
/// \note Dolby Vision requires a 8888 UNORM swapchain.
|
||||
///
|
||||
/// \param [in] context Pointer to a context. This is generated by \ref agsInitialize
|
||||
/// \param [in] deviceIndex The index of the device listed in \ref AGSGPUInfo::devices.
|
||||
/// \param [in] displayIndex The index of the display listed in \ref AGSDeviceInfo::displays.
|
||||
/// \param [in] settings Pointer to the display settings to use.
|
||||
///
|
||||
AMD_AGS_API AGSReturnCode agsSetDisplayMode( AGSContext* context, int deviceIndex, int displayIndex, const AGSDisplaySettings* settings );
|
||||
|
||||
/// @}
|
||||
|
||||
/// @}
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
||||
#endif // AMD_AGS_H
|
||||
Vendored
+7
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"home": "https://github.com/GPUOpen-LibrariesAndSDKs/AGS_SDK",
|
||||
"license": "MIT (embeded in source)",
|
||||
"version": "AGS v6.2.0",
|
||||
"author": "Advanced Micro Devices, Inc",
|
||||
"modified": "CarterLi"
|
||||
}
|
||||
Vendored
+27
@@ -0,0 +1,27 @@
|
||||
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
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"home": "https://github.com/intel/drivers.gpu.control-library",
|
||||
"license": "./LICENSE",
|
||||
"version": "v184",
|
||||
"author": "Intel Corporation"
|
||||
}
|
||||
Vendored
+740
-25
@@ -153,6 +153,27 @@ typedef struct nvmlDevice_st* nvmlDevice_t;
|
||||
*/
|
||||
#define NVML_DEVICE_PCI_BUS_ID_BUFFER_V2_SIZE 16
|
||||
|
||||
/**
|
||||
* PCI information about a GPU device.
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
unsigned int version; //!< The version number of this struct
|
||||
unsigned int domain; //!< The PCI domain on which the device's bus resides, 0 to 0xffffffff
|
||||
unsigned int bus; //!< The bus on which the device resides, 0 to 0xff
|
||||
unsigned int device; //!< The device's id on the bus, 0 to 31
|
||||
|
||||
unsigned int pciDeviceId; //!< The combined 16-bit device id and 16-bit vendor id
|
||||
unsigned int pciSubSystemId; //!< The 32-bit Sub System Device ID
|
||||
|
||||
unsigned int baseClass; //!< The 8-bit PCI base class code
|
||||
unsigned int subClass; //!< The 8-bit PCI sub class code
|
||||
|
||||
char busId[NVML_DEVICE_PCI_BUS_ID_BUFFER_SIZE]; //!< The tuple domain:bus:device.function PCI identifier (& NULL terminator)
|
||||
} nvmlPciInfoExt_v1_t;
|
||||
typedef nvmlPciInfoExt_v1_t nvmlPciInfoExt_t;
|
||||
#define nvmlPciInfoExt_v1 NVML_STRUCT_VERSION(PciInfoExt, 1)
|
||||
|
||||
/**
|
||||
* PCI information about a GPU device.
|
||||
*/
|
||||
@@ -482,11 +503,16 @@ typedef enum nvmlGpuP2PStatus_enum
|
||||
typedef enum nvmlGpuP2PCapsIndex_enum
|
||||
{
|
||||
NVML_P2P_CAPS_INDEX_READ = 0,
|
||||
NVML_P2P_CAPS_INDEX_WRITE,
|
||||
NVML_P2P_CAPS_INDEX_NVLINK,
|
||||
NVML_P2P_CAPS_INDEX_ATOMICS,
|
||||
NVML_P2P_CAPS_INDEX_PROP,
|
||||
NVML_P2P_CAPS_INDEX_UNKNOWN
|
||||
NVML_P2P_CAPS_INDEX_WRITE = 1,
|
||||
NVML_P2P_CAPS_INDEX_NVLINK = 2,
|
||||
NVML_P2P_CAPS_INDEX_ATOMICS = 3,
|
||||
NVML_P2P_CAPS_INDEX_PCI = 4,
|
||||
/*
|
||||
* DO NOT USE! NVML_P2P_CAPS_INDEX_PROP is deprecated.
|
||||
* Use NVML_P2P_CAPS_INDEX_PCI instead.
|
||||
*/
|
||||
NVML_P2P_CAPS_INDEX_PROP = NVML_P2P_CAPS_INDEX_PCI,
|
||||
NVML_P2P_CAPS_INDEX_UNKNOWN = 5,
|
||||
}nvmlGpuP2PCapsIndex_t;
|
||||
|
||||
/**
|
||||
@@ -526,6 +552,8 @@ typedef enum nvmlSamplingType_enum
|
||||
NVML_PROCESSOR_CLK_SAMPLES = 5, //!< To represent processor clock samples
|
||||
NVML_MEMORY_CLK_SAMPLES = 6, //!< To represent memory clock samples
|
||||
NVML_MODULE_POWER_SAMPLES = 7, //!< To represent module power samples for total module starting Grace Hopper
|
||||
NVML_JPG_UTILIZATION_SAMPLES = 8, //!< To represent percent of time during which NVJPG remains busy
|
||||
NVML_OFA_UTILIZATION_SAMPLES = 9, //!< To represent percent of time during which NVOFA remains busy
|
||||
|
||||
// Keep this last
|
||||
NVML_SAMPLINGTYPE_COUNT
|
||||
@@ -1005,6 +1033,7 @@ typedef enum nvmlReturn_enum
|
||||
NVML_ERROR_DEPRECATED = 26, //!< The requested functionality has been deprecated
|
||||
NVML_ERROR_NOT_READY = 27, //!< The system is not ready for the request
|
||||
NVML_ERROR_GPU_NOT_FOUND = 28, //!< No GPUs were found
|
||||
NVML_ERROR_INVALID_STATE = 29, //!< Resource not in correct state to perform requested operation
|
||||
NVML_ERROR_UNKNOWN = 999 //!< An internal driver error occurred
|
||||
} nvmlReturn_t;
|
||||
|
||||
@@ -1150,11 +1179,14 @@ typedef enum nvmlVgpuDriverCapability_enum
|
||||
*/
|
||||
typedef enum nvmlDeviceVgpuCapability_enum
|
||||
{
|
||||
NVML_DEVICE_VGPU_CAP_FRACTIONAL_MULTI_VGPU = 0, //!< Fractional vGPU profiles on this GPU can be used in multi-vGPU configurations
|
||||
NVML_DEVICE_VGPU_CAP_HETEROGENEOUS_TIMESLICE_PROFILES = 1, //!< Supports concurrent execution of timesliced vGPU profiles of differing types
|
||||
NVML_DEVICE_VGPU_CAP_HETEROGENEOUS_TIMESLICE_SIZES = 2, //!< Supports concurrent execution of timesliced vGPU profiles of differing framebuffer sizes
|
||||
NVML_DEVICE_VGPU_CAP_READ_DEVICE_BUFFER_BW = 3, //!< GPU device's read_device_buffer expected bandwidth capacity in megabytes per second
|
||||
NVML_DEVICE_VGPU_CAP_WRITE_DEVICE_BUFFER_BW = 4, //!< GPU device's write_device_buffer expected bandwidth capacity in megabytes per second
|
||||
NVML_DEVICE_VGPU_CAP_FRACTIONAL_MULTI_VGPU = 0, //!< Query if the fractional vGPU profiles on this GPU can be used in multi-vGPU configurations
|
||||
NVML_DEVICE_VGPU_CAP_HETEROGENEOUS_TIMESLICE_PROFILES = 1, //!< Query if the GPU support concurrent execution of timesliced vGPU profiles of differing types
|
||||
NVML_DEVICE_VGPU_CAP_HETEROGENEOUS_TIMESLICE_SIZES = 2, //!< Query if the GPU support concurrent execution of timesliced vGPU profiles of differing framebuffer sizes
|
||||
NVML_DEVICE_VGPU_CAP_READ_DEVICE_BUFFER_BW = 3, //!< Query the GPU's read_device_buffer expected bandwidth capacity in megabytes per second
|
||||
NVML_DEVICE_VGPU_CAP_WRITE_DEVICE_BUFFER_BW = 4, //!< Query the GPU's write_device_buffer expected bandwidth capacity in megabytes per second
|
||||
NVML_DEVICE_VGPU_CAP_DEVICE_STREAMING = 5, //!< Query if vGPU profiles on the GPU supports migration data streaming
|
||||
NVML_DEVICE_VGPU_CAP_MINI_QUARTER_GPU = 6, //!< Set/Get support for mini-quarter vGPU profiles
|
||||
NVML_DEVICE_VGPU_CAP_COMPUTE_MEDIA_ENGINE_GPU = 7, //!< Set/Get support for compute media engine vGPU profiles
|
||||
// Keep this last
|
||||
NVML_DEVICE_VGPU_CAP_COUNT
|
||||
} nvmlDeviceVgpuCapability_t;
|
||||
@@ -1181,6 +1213,8 @@ typedef enum nvmlDeviceVgpuCapability_enum
|
||||
|
||||
#define INVALID_GPU_INSTANCE_ID 0xFFFFFFFF
|
||||
|
||||
#define NVML_INVALID_VGPU_PLACEMENT_ID 0xFFFF
|
||||
|
||||
/*!
|
||||
* Macros for vGPU instance's virtualization capabilities bitfield.
|
||||
*/
|
||||
@@ -1207,6 +1241,41 @@ typedef unsigned int nvmlVgpuTypeId_t;
|
||||
|
||||
typedef unsigned int nvmlVgpuInstance_t;
|
||||
|
||||
/**
|
||||
* Structure to store the vGPU heterogeneous mode of device -- version 1
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
unsigned int version; //!< The version number of this struct
|
||||
unsigned int mode; //!< The vGPU heterogeneous mode
|
||||
} nvmlVgpuHeterogeneousMode_v1_t;
|
||||
typedef nvmlVgpuHeterogeneousMode_v1_t nvmlVgpuHeterogeneousMode_t;
|
||||
#define nvmlVgpuHeterogeneousMode_v1 NVML_STRUCT_VERSION(VgpuHeterogeneousMode, 1)
|
||||
|
||||
/**
|
||||
* Structure to store the placement ID of vGPU instance -- version 1
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
unsigned int version; //!< The version number of this struct
|
||||
unsigned int placementId; //!< Placement ID of the active vGPU instance
|
||||
} nvmlVgpuPlacementId_v1_t;
|
||||
typedef nvmlVgpuPlacementId_v1_t nvmlVgpuPlacementId_t;
|
||||
#define nvmlVgpuPlacementId_v1 NVML_STRUCT_VERSION(VgpuPlacementId, 1)
|
||||
|
||||
/**
|
||||
* Structure to store the list of vGPU placements -- version 1
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
unsigned int version; //!< The version number of this struct
|
||||
unsigned int placementSize; //!< The number of slots occupied by the vGPU type
|
||||
unsigned int count; //!< Count of placement IDs fetched
|
||||
unsigned int *placementIds; //!< Placement IDs for the vGPU type
|
||||
} nvmlVgpuPlacementList_v1_t;
|
||||
typedef nvmlVgpuPlacementList_v1_t nvmlVgpuPlacementList_t;
|
||||
#define nvmlVgpuPlacementList_v1 NVML_STRUCT_VERSION(VgpuPlacementList, 1)
|
||||
|
||||
/**
|
||||
* Structure to store Utilization Value and vgpuInstance
|
||||
*/
|
||||
@@ -1220,6 +1289,35 @@ typedef struct nvmlVgpuInstanceUtilizationSample_st
|
||||
nvmlValue_t decUtil; //!< Decoder Util Value
|
||||
} nvmlVgpuInstanceUtilizationSample_t;
|
||||
|
||||
/**
|
||||
* Structure to store Utilization Value and vgpuInstance Info -- Version 1
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
unsigned long long timeStamp; //!< CPU Timestamp in microseconds
|
||||
nvmlVgpuInstance_t vgpuInstance; //!< vGPU Instance
|
||||
nvmlValue_t smUtil; //!< SM (3D/Compute) Util Value
|
||||
nvmlValue_t memUtil; //!< Frame Buffer Memory Util Value
|
||||
nvmlValue_t encUtil; //!< Encoder Util Value
|
||||
nvmlValue_t decUtil; //!< Decoder Util Value
|
||||
nvmlValue_t jpgUtil; //!< Jpeg Util Value
|
||||
nvmlValue_t ofaUtil; //!< Ofa Util Value
|
||||
} nvmlVgpuInstanceUtilizationInfo_v1_t;
|
||||
|
||||
/**
|
||||
* Structure to store recent utilization for vGPU instances running on a device -- version 1
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
unsigned int version; //!< The version number of this struct
|
||||
nvmlValueType_t sampleValType; //!< Hold the type of returned sample values
|
||||
unsigned int vgpuInstanceCount; //!< Hold the number of vGPU instances
|
||||
unsigned long long lastSeenTimeStamp; //!< Return only samples with timestamp greater than lastSeenTimeStamp
|
||||
nvmlVgpuInstanceUtilizationInfo_v1_t *vgpuUtilArray; //!< The array (allocated by caller) in which vGPU utilization are returned
|
||||
} nvmlVgpuInstancesUtilizationInfo_v1_t;
|
||||
typedef nvmlVgpuInstancesUtilizationInfo_v1_t nvmlVgpuInstancesUtilizationInfo_t;
|
||||
#define nvmlVgpuInstancesUtilizationInfo_v1 NVML_STRUCT_VERSION(VgpuInstancesUtilizationInfo, 1)
|
||||
|
||||
/**
|
||||
* Structure to store Utilization Value, vgpuInstance and subprocess information
|
||||
*/
|
||||
@@ -1235,6 +1333,36 @@ typedef struct nvmlVgpuProcessUtilizationSample_st
|
||||
unsigned int decUtil; //!< Decoder Util Value
|
||||
} nvmlVgpuProcessUtilizationSample_t;
|
||||
|
||||
/**
|
||||
* Structure to store Utilization Value, vgpuInstance and subprocess information for process running on vGPU instance -- version 1
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
char processName[NVML_VGPU_NAME_BUFFER_SIZE]; //!< Name of process running within the vGPU VM
|
||||
unsigned long long timeStamp; //!< CPU Timestamp in microseconds
|
||||
nvmlVgpuInstance_t vgpuInstance; //!< vGPU Instance
|
||||
unsigned int pid; //!< PID of process running within the vGPU VM
|
||||
unsigned int smUtil; //!< SM (3D/Compute) Util Value
|
||||
unsigned int memUtil; //!< Frame Buffer Memory Util Value
|
||||
unsigned int encUtil; //!< Encoder Util Value
|
||||
unsigned int decUtil; //!< Decoder Util Value
|
||||
unsigned int jpgUtil; //!< Jpeg Util Value
|
||||
unsigned int ofaUtil; //!< Ofa Util Value
|
||||
} nvmlVgpuProcessUtilizationInfo_v1_t;
|
||||
|
||||
/**
|
||||
* Structure to store recent utilization, vgpuInstance and subprocess information for processes running on vGPU instances active on a device -- version 1
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
unsigned int version; //!< The version number of this struct
|
||||
unsigned int vgpuProcessCount; //!< Hold the number of processes running on vGPU instances
|
||||
unsigned long long lastSeenTimeStamp; //!< Return only samples with timestamp greater than lastSeenTimeStamp
|
||||
nvmlVgpuProcessUtilizationInfo_v1_t *vgpuProcUtilArray; //!< The array (allocated by caller) in which utilization of processes running on vGPU instances are returned
|
||||
} nvmlVgpuProcessesUtilizationInfo_v1_t;
|
||||
typedef nvmlVgpuProcessesUtilizationInfo_v1_t nvmlVgpuProcessesUtilizationInfo_t;
|
||||
#define nvmlVgpuProcessesUtilizationInfo_v1 NVML_STRUCT_VERSION(VgpuProcessesUtilizationInfo, 1)
|
||||
|
||||
/**
|
||||
* vGPU scheduler policies
|
||||
*/
|
||||
@@ -1392,6 +1520,34 @@ typedef struct nvmlProcessUtilizationSample_st
|
||||
unsigned int decUtil; //!< Decoder Util Value
|
||||
} nvmlProcessUtilizationSample_t;
|
||||
|
||||
/**
|
||||
* Structure to store utilization value and process Id -- version 1
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
unsigned long long timeStamp; //!< CPU Timestamp in microseconds
|
||||
unsigned int pid; //!< PID of process
|
||||
unsigned int smUtil; //!< SM (3D/Compute) Util Value
|
||||
unsigned int memUtil; //!< Frame Buffer Memory Util Value
|
||||
unsigned int encUtil; //!< Encoder Util Value
|
||||
unsigned int decUtil; //!< Decoder Util Value
|
||||
unsigned int jpgUtil; //!< Jpeg Util Value
|
||||
unsigned int ofaUtil; //!< Ofa Util Value
|
||||
} nvmlProcessUtilizationInfo_v1_t;
|
||||
|
||||
/**
|
||||
* Structure to store utilization and process ID for each running process -- version 1
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
unsigned int version; //!< The version number of this struct
|
||||
unsigned int processSamplesCount; //!< Caller-supplied array size, and returns number of processes running
|
||||
unsigned long long lastSeenTimeStamp; //!< Return only samples with timestamp greater than lastSeenTimeStamp
|
||||
nvmlProcessUtilizationInfo_v1_t *procUtilArray; //!< The array (allocated by caller) of the utilization of GPU SM, framebuffer, video encoder, video decoder, JPEG, and OFA
|
||||
} nvmlProcessesUtilizationInfo_v1_t;
|
||||
typedef nvmlProcessesUtilizationInfo_v1_t nvmlProcessesUtilizationInfo_t;
|
||||
#define nvmlProcessesUtilizationInfo_v1 NVML_STRUCT_VERSION(ProcessesUtilizationInfo, 1)
|
||||
|
||||
/**
|
||||
* Structure to store license expiry date and time values
|
||||
*/
|
||||
@@ -1429,6 +1585,29 @@ typedef struct nvmlGridLicensableFeatures_st
|
||||
nvmlGridLicensableFeature_t gridLicensableFeatures[NVML_GRID_LICENSE_FEATURE_MAX_COUNT]; //!< Array of vGPU software licensable features.
|
||||
} nvmlGridLicensableFeatures_t;
|
||||
|
||||
/**
|
||||
* Structure to store SRAM uncorrectable error counters
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
unsigned int version; //!< the API version number
|
||||
unsigned long long aggregateUncParity; //!< aggregate uncorrectable parity error count
|
||||
unsigned long long aggregateUncSecDed; //!< aggregate uncorrectable SEC-DED error count
|
||||
unsigned long long aggregateCor; //!< aggregate correctable error count
|
||||
unsigned long long volatileUncParity; //!< volatile uncorrectable parity error count
|
||||
unsigned long long volatileUncSecDed; //!< volatile uncorrectable SEC-DED error count
|
||||
unsigned long long volatileCor; //!< volatile correctable error count
|
||||
unsigned long long aggregateUncBucketL2; //!< aggregate uncorrectable error count for L2 cache bucket
|
||||
unsigned long long aggregateUncBucketSm; //!< aggregate uncorrectable error count for SM bucket
|
||||
unsigned long long aggregateUncBucketPcie; //!< aggregate uncorrectable error count for PCIE bucket
|
||||
unsigned long long aggregateUncBucketMcu; //!< aggregate uncorrectable error count for Microcontroller bucket
|
||||
unsigned long long aggregateUncBucketOther; //!< aggregate uncorrectable error count for Other bucket
|
||||
unsigned int bThresholdExceeded; //!< if the error threshold of field diag is exceeded
|
||||
} nvmlEccSramErrorStatus_v1_t;
|
||||
|
||||
typedef nvmlEccSramErrorStatus_v1_t nvmlEccSramErrorStatus_t;
|
||||
#define nvmlEccSramErrorStatus_v1 NVML_STRUCT_VERSION(EccSramErrorStatus, 1)
|
||||
|
||||
/**
|
||||
* GSP firmware
|
||||
*/
|
||||
@@ -1837,7 +2016,9 @@ typedef struct nvmlGpuDynamicPstatesInfo_st
|
||||
#define NVML_FI_DEV_TEMPERATURE_MEM_MAX_TLIMIT 195 //!< T.Limit temperature after which GPU may begin SW slowdown due to memory temperature
|
||||
#define NVML_FI_DEV_TEMPERATURE_GPU_MAX_TLIMIT 196 //!< T.Limit temperature after which GPU may be throttled below base clock
|
||||
|
||||
#define NVML_FI_MAX 197 //!< One greater than the largest field ID defined above
|
||||
#define NVML_FI_DEV_IS_MIG_MODE_INDEPENDENT_MIG_QUERY_CAPABLE 199 //!< MIG mode independent, MIG query capable device. 1=yes. 0=no.
|
||||
|
||||
#define NVML_FI_MAX 200 //!< One greater than the largest field ID defined above
|
||||
|
||||
/**
|
||||
* Information for a Field Value Sample
|
||||
@@ -2248,9 +2429,10 @@ typedef struct nvmlAccountingStats_st {
|
||||
*/
|
||||
typedef enum nvmlEncoderQueryType_enum
|
||||
{
|
||||
NVML_ENCODER_QUERY_H264 = 0, //!< H264 encoder
|
||||
NVML_ENCODER_QUERY_HEVC = 1, //!< HEVC encoder
|
||||
NVML_ENCODER_QUERY_AV1 = 2 //!< AV1 encoder
|
||||
NVML_ENCODER_QUERY_H264 = 0x00, //!< H264 encoder
|
||||
NVML_ENCODER_QUERY_HEVC = 0x01, //!< HEVC encoder
|
||||
NVML_ENCODER_QUERY_AV1 = 0x02, //!< AV1 encoder
|
||||
NVML_ENCODER_QUERY_UNKNOWN = 0xFF //!< Unknown encoder
|
||||
}nvmlEncoderType_t;
|
||||
|
||||
/**
|
||||
@@ -2399,6 +2581,26 @@ typedef struct nvmlConfComputeSystemState_st {
|
||||
unsigned int devToolsMode;
|
||||
} nvmlConfComputeSystemState_t;
|
||||
|
||||
/**
|
||||
* Confidential Compute Multigpu mode values
|
||||
*/
|
||||
#define NVML_CC_SYSTEM_MULTIGPU_NONE 0
|
||||
#define NVML_CC_SYSTEM_MULTIGPU_PROTECTED_PCIE 1
|
||||
|
||||
/**
|
||||
* Confidential Compute System settings
|
||||
*/
|
||||
typedef struct {
|
||||
unsigned int version;
|
||||
unsigned int environment;
|
||||
unsigned int ccFeature;
|
||||
unsigned int devToolsMode;
|
||||
unsigned int multiGpuMode;
|
||||
} nvmlSystemConfComputeSettings_v1_t;
|
||||
|
||||
typedef nvmlSystemConfComputeSettings_v1_t nvmlSystemConfComputeSettings_t;
|
||||
#define nvmlSystemConfComputeSettings_v1 NVML_STRUCT_VERSION(SystemConfComputeSettings, 1)
|
||||
|
||||
/**
|
||||
* Protected memory size
|
||||
*/
|
||||
@@ -2436,6 +2638,8 @@ typedef struct nvmlConfComputeGpuCertificate_st {
|
||||
#define NVML_CC_GPU_CEC_ATTESTATION_REPORT_SIZE 0x1000
|
||||
#define NVML_CC_CEC_ATTESTATION_REPORT_NOT_PRESENT 0
|
||||
#define NVML_CC_CEC_ATTESTATION_REPORT_PRESENT 1
|
||||
#define NVML_CC_KEY_ROTATION_THRESHOLD_ATTACKER_ADVANTAGE_MIN 50
|
||||
#define NVML_CC_KEY_ROTATION_THRESHOLD_ATTACKER_ADVANTAGE_MAX 75
|
||||
|
||||
typedef struct nvmlConfComputeGpuAttestationReport_st {
|
||||
unsigned int isCecAttestationReportPresent;
|
||||
@@ -2446,6 +2650,24 @@ typedef struct nvmlConfComputeGpuAttestationReport_st {
|
||||
unsigned char cecAttestationReport[NVML_CC_GPU_CEC_ATTESTATION_REPORT_SIZE];
|
||||
} nvmlConfComputeGpuAttestationReport_t;
|
||||
|
||||
typedef struct nvmlConfComputeSetKeyRotationThresholdInfo_st {
|
||||
unsigned int version;
|
||||
unsigned long long maxAttackerAdvantage;
|
||||
} nvmlConfComputeSetKeyRotationThresholdInfo_v1_t;
|
||||
|
||||
typedef nvmlConfComputeSetKeyRotationThresholdInfo_v1_t nvmlConfComputeSetKeyRotationThresholdInfo_t;
|
||||
#define nvmlConfComputeSetKeyRotationThresholdInfo_v1 \
|
||||
NVML_STRUCT_VERSION(ConfComputeSetKeyRotationThresholdInfo, 1)
|
||||
|
||||
typedef struct nvmlConfComputeGetKeyRotationThresholdInfo_st {
|
||||
unsigned int version;
|
||||
unsigned long long attackerAdvantage;
|
||||
} nvmlConfComputeGetKeyRotationThresholdInfo_v1_t;
|
||||
|
||||
typedef nvmlConfComputeGetKeyRotationThresholdInfo_v1_t nvmlConfComputeGetKeyRotationThresholdInfo_t;
|
||||
#define nvmlConfComputeGetKeyRotationThresholdInfo_v1 \
|
||||
NVML_STRUCT_VERSION(ConfComputeGetKeyRotationThresholdInfo, 1)
|
||||
|
||||
/** @} */
|
||||
|
||||
#define NVML_GPU_FABRIC_UUID_LEN 16
|
||||
@@ -2464,6 +2686,55 @@ typedef struct {
|
||||
nvmlGpuFabricState_t state; //!< Current state of GPU registration process
|
||||
} nvmlGpuFabricInfo_t;
|
||||
|
||||
#define NVML_GPU_FABRIC_HEALTH_MASK_DEGRADED_BW_NOT_SUPPORTED 0
|
||||
#define NVML_GPU_FABRIC_HEALTH_MASK_DEGRADED_BW_TRUE 1
|
||||
#define NVML_GPU_FABRIC_HEALTH_MASK_DEGRADED_BW_FALSE 2
|
||||
|
||||
#define NVML_GPU_FABRIC_HEALTH_MASK_SHIFT_DEGRADED_BW 0
|
||||
#define NVML_GPU_FABRIC_HEALTH_MASK_WIDTH_DEGRADED_BW 0x11
|
||||
|
||||
/**
|
||||
* GPU Fabric Health Status Mask for various fields can be obtained
|
||||
* using the below macro.
|
||||
* Ex - NVML_GPU_FABRIC_HEALTH_GET(var, _DEGRADED_BW)
|
||||
*/
|
||||
#define NVML_GPU_FABRIC_HEALTH_GET(var, type) \
|
||||
(((var) >> NVML_GPU_FABRIC_HEALTH_MASK_SHIFT##type) & \
|
||||
(NVML_GPU_FABRIC_HEALTH_MASK_WIDTH##type))
|
||||
|
||||
/**
|
||||
* GPU Fabric Health Status Mask for various fields can be tested
|
||||
* using the below macro.
|
||||
* Ex - NVML_GPU_FABRIC_HEALTH_TEST(var, _DEGRADED_BW, _TRUE)
|
||||
*/
|
||||
#define NVML_GPU_FABRIC_HEALTH_TEST(var, type, val) \
|
||||
(NVML_GPU_FABRIC_HEALTH_GET(var, type) == \
|
||||
NVML_GPU_FABRIC_HEALTH_MASK##type##val)
|
||||
|
||||
/**
|
||||
* GPU Fabric information (v2).
|
||||
*
|
||||
* Version 2 adds the \ref nvmlGpuFabricInfo_v2_t.version field
|
||||
* to the start of the structure, and the \ref nvmlGpuFabricInfo_v2_t.healthMask
|
||||
* field to the end. This structure is not backwards-compatible with
|
||||
* \ref nvmlGpuFabricInfo_t.
|
||||
*/
|
||||
typedef struct {
|
||||
unsigned int version; //!< Structure version identifier (set to \ref nvmlGpuFabricInfo_v2)
|
||||
unsigned char clusterUuid[NVML_GPU_FABRIC_UUID_LEN]; //!< Uuid of the cluster to which this GPU belongs
|
||||
nvmlReturn_t status; //!< Error status, if any. Must be checked only if state returns "complete".
|
||||
unsigned int cliqueId; //!< ID of the fabric clique to which this GPU belongs
|
||||
nvmlGpuFabricState_t state; //!< Current state of GPU registration process
|
||||
unsigned int healthMask; //!< GPU Fabric health Status Mask
|
||||
} nvmlGpuFabricInfo_v2_t;
|
||||
|
||||
typedef nvmlGpuFabricInfo_v2_t nvmlGpuFabricInfoV_t;
|
||||
|
||||
/**
|
||||
* Version identifier value for \ref nvmlGpuFabricInfo_v2_t.version.
|
||||
*/
|
||||
#define nvmlGpuFabricInfo_v2 NVML_STRUCT_VERSION(GpuFabricInfo, 2)
|
||||
|
||||
/**
|
||||
* Device Scope - This is useful to retrieve the telemetry at GPU and module (e.g. GPU + CPU) level
|
||||
*/
|
||||
@@ -3414,6 +3685,19 @@ nvmlReturn_t DECLDIR nvmlDeviceSetCpuAffinity(nvmlDevice_t device);
|
||||
*/
|
||||
nvmlReturn_t DECLDIR nvmlDeviceClearCpuAffinity(nvmlDevice_t device);
|
||||
|
||||
/**
|
||||
* Get the NUMA node of the given GPU device.
|
||||
* This only applies to platforms where the GPUs are NUMA nodes.
|
||||
*
|
||||
* @param[in] device The device handle
|
||||
* @param[out] node NUMA node ID of the device
|
||||
*
|
||||
* @returns
|
||||
* - \ref NVML_SUCCESS if the NUMA node is retrieved successfully
|
||||
* - \ref NVML_ERROR_NOT_SUPPORTED if request is not supported on the current platform
|
||||
* - \ref NVML_ERROR_INVALID_ARGUMENT if \a device \a node is invalid
|
||||
*/
|
||||
nvmlReturn_t DECLDIR nvmlDeviceGetNumaNodeId(nvmlDevice_t device, unsigned int *node);
|
||||
/**
|
||||
* Retrieve the common ancestor for two devices
|
||||
* For all products.
|
||||
@@ -3726,6 +4010,25 @@ nvmlReturn_t DECLDIR nvmlDeviceGetDisplayActive(nvmlDevice_t device, nvmlEnableS
|
||||
*/
|
||||
nvmlReturn_t DECLDIR nvmlDeviceGetPersistenceMode(nvmlDevice_t device, nvmlEnableState_t *mode);
|
||||
|
||||
/**
|
||||
* Retrieves PCI attributes of this device.
|
||||
*
|
||||
* For all products.
|
||||
*
|
||||
* See \ref nvmlPciInfoExt_t for details on the available PCI info.
|
||||
*
|
||||
* @param device The identifier of the target device
|
||||
* @param pci Reference in which to return the PCI info
|
||||
*
|
||||
* @return
|
||||
* - \ref NVML_SUCCESS if \a pci has been populated
|
||||
* - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
|
||||
* - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a pci is NULL
|
||||
* - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
|
||||
* - \ref NVML_ERROR_UNKNOWN on any unexpected error
|
||||
*/
|
||||
nvmlReturn_t DECLDIR nvmlDeviceGetPciInfoExt(nvmlDevice_t device, nvmlPciInfoExt_t *pci);
|
||||
|
||||
/**
|
||||
* Retrieves the PCI attributes of this device.
|
||||
*
|
||||
@@ -5423,7 +5726,7 @@ nvmlReturn_t DECLDIR nvmlDeviceGetMPSComputeRunningProcesses_v3(nvmlDevice_t dev
|
||||
*
|
||||
* To determine the size of the @ref plist->procArray array to allocate, call the function with
|
||||
* @ref plist->numProcArrayEntries set to zero and @ref plist->procArray set to NULL. The return
|
||||
* code will be either NVML_ERROR_INSUFFICIENT_SIZE (if there are valid processes of type
|
||||
* code will be either NVML_ERROR_INSUFFICIENT_SIZE (if there are valid processes of type
|
||||
* @ref plist->mode to report on, in which case the @ref plist->numProcArrayEntries field will
|
||||
* indicate the required number of entries in the array) or NVML_SUCCESS (if no processes of type
|
||||
* @ref plist->mode exist).
|
||||
@@ -5708,7 +6011,7 @@ nvmlReturn_t DECLDIR nvmlDeviceGetPcieSpeed(nvmlDevice_t device, unsigned int *p
|
||||
*
|
||||
* @param device The identifier of the target device
|
||||
* @param adaptiveClockStatus The current adaptive clocking status, either
|
||||
* @ref NVML_ADAPTIVE_CLOCKING_INFO_STATUS_DISABLED
|
||||
* @ref NVML_ADAPTIVE_CLOCKING_INFO_STATUS_DISABLED
|
||||
* or @ref NVML_ADAPTIVE_CLOCKING_INFO_STATUS_ENABLED
|
||||
*
|
||||
* @return
|
||||
@@ -5735,7 +6038,10 @@ nvmlReturn_t DECLDIR nvmlDeviceGetAdaptiveClockInfoStatus(nvmlDevice_t device, u
|
||||
*/
|
||||
nvmlReturn_t DECLDIR nvmlDeviceGetBusType(nvmlDevice_t device, nvmlBusType_t *type);
|
||||
|
||||
/**
|
||||
|
||||
/**
|
||||
* Deprecated: Will be deprecated in a future release. Use \ref nvmlDeviceGetGpuFabricInfoV instead
|
||||
*
|
||||
* Get fabric information associated with the device.
|
||||
*
|
||||
* %HOPPER_OR_NEWER%
|
||||
@@ -5746,6 +6052,7 @@ nvmlReturn_t DECLDIR nvmlDeviceGetBusType(nvmlDevice_t device, nvmlBusType_t *ty
|
||||
* This API reports the current state of the GPU in the NVLink fabric
|
||||
* along with other useful information.
|
||||
*
|
||||
*
|
||||
* @param device The identifier of the target device
|
||||
* @param gpuFabricInfo Information about GPU fabric state
|
||||
*
|
||||
@@ -5755,6 +6062,30 @@ nvmlReturn_t DECLDIR nvmlDeviceGetBusType(nvmlDevice_t device, nvmlBusType_t *ty
|
||||
*/
|
||||
nvmlReturn_t DECLDIR nvmlDeviceGetGpuFabricInfo(nvmlDevice_t device, nvmlGpuFabricInfo_t *gpuFabricInfo);
|
||||
|
||||
/**
|
||||
* Versioned wrapper around \ref nvmlDeviceGetGpuFabricInfo that accepts a versioned
|
||||
* \ref nvmlGpuFabricInfo_v2_t or later output structure.
|
||||
*
|
||||
* @note The caller must set the \ref nvmlGpuFabricInfoV_t.version field to the
|
||||
* appropriate version prior to calling this function. For example:
|
||||
* \code
|
||||
* nvmlGpuFabricInfoV_t fabricInfo =
|
||||
* { .version = nvmlGpuFabricInfo_v2 };
|
||||
* nvmlReturn_t result = nvmlDeviceGetGpuFabricInfoV(device,&fabricInfo);
|
||||
* \endcode
|
||||
*
|
||||
* %HOPPER_OR_NEWER%
|
||||
*
|
||||
* @param device The identifier of the target device
|
||||
* @param gpuFabricInfo Information about GPU fabric state
|
||||
*
|
||||
* @return
|
||||
* - \ref NVML_SUCCESS Upon success
|
||||
* - \ref NVML_ERROR_NOT_SUPPORTED If \a device doesn't support gpu fabric
|
||||
*/
|
||||
nvmlReturn_t DECLDIR nvmlDeviceGetGpuFabricInfoV(nvmlDevice_t device,
|
||||
nvmlGpuFabricInfoV_t *gpuFabricInfo);
|
||||
|
||||
/**
|
||||
* Get Conf Computing System capabilities.
|
||||
*
|
||||
@@ -5877,6 +6208,42 @@ nvmlReturn_t DECLDIR nvmlDeviceGetConfComputeGpuCertificate(nvmlDevice_t device,
|
||||
*/
|
||||
nvmlReturn_t DECLDIR nvmlDeviceGetConfComputeGpuAttestationReport(nvmlDevice_t device,
|
||||
nvmlConfComputeGpuAttestationReport_t *gpuAtstReport);
|
||||
/**
|
||||
* Get Conf Computing key rotation threshold detail.
|
||||
*
|
||||
* %HOPPER_OR_NEWER%
|
||||
* Supported on Linux, Windows TCC.
|
||||
*
|
||||
* @param pKeyRotationThrInfo Reference in which to return the key rotation threshold data
|
||||
*
|
||||
* @return
|
||||
* - \ref NVML_SUCCESS if \a gpu key rotation threshold info has been populated
|
||||
* - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
|
||||
* - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a memory is NULL
|
||||
* - \ref NVML_ERROR_NOT_SUPPORTED if this query is not supported by the device
|
||||
* - \ref NVML_ERROR_UNKNOWN on any unexpected error
|
||||
*/
|
||||
nvmlReturn_t DECLDIR nvmlSystemGetConfComputeKeyRotationThresholdInfo(
|
||||
nvmlConfComputeGetKeyRotationThresholdInfo_t *pKeyRotationThrInfo);
|
||||
|
||||
/**
|
||||
* Get Conf Computing System Settings.
|
||||
*
|
||||
* %HOPPER_OR_NEWER%
|
||||
* Supported on Linux, Windows TCC.
|
||||
*
|
||||
* @param settings System CC settings
|
||||
*
|
||||
* @return
|
||||
* - \ref NVML_SUCCESS if the query is success
|
||||
* - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
|
||||
* - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a counters is NULL
|
||||
* - \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature
|
||||
* - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
|
||||
* - \ref NVML_ERROR_ARGUMENT_VERSION_MISMATCH if the provided version is invalid/unsupported
|
||||
* - \ref NVML_ERROR_UNKNOWN on any unexpected error
|
||||
*/
|
||||
nvmlReturn_t DECLDIR nvmlSystemGetConfComputeSettings(nvmlSystemConfComputeSettings_t *settings);
|
||||
|
||||
/**
|
||||
* Retrieve GSP firmware version.
|
||||
@@ -6241,6 +6608,52 @@ nvmlReturn_t DECLDIR nvmlDeviceGetClkMonStatus(nvmlDevice_t device, nvmlClkMonSt
|
||||
nvmlReturn_t DECLDIR nvmlDeviceGetProcessUtilization(nvmlDevice_t device, nvmlProcessUtilizationSample_t *utilization,
|
||||
unsigned int *processSamplesCount, unsigned long long lastSeenTimeStamp);
|
||||
|
||||
/**
|
||||
* Retrieves the recent utilization and process ID for all running processes
|
||||
*
|
||||
* For Maxwell &tm; or newer fully supported devices.
|
||||
*
|
||||
* Reads recent utilization of GPU SM (3D/Compute), framebuffer, video encoder, and video decoder, jpeg decoder, OFA (Optical Flow Accelerator)
|
||||
* for all running processes. Utilization values are returned as an array of utilization sample structures in the caller-supplied buffer pointed at
|
||||
* by \a procesesUtilInfo->procUtilArray. One utilization sample structure is returned per process running, that had some non-zero utilization
|
||||
* during the last sample period. It includes the CPU timestamp at which the samples were recorded. Individual utilization values
|
||||
* are returned as "unsigned int" values.
|
||||
*
|
||||
* The caller should allocate a buffer of size processSamplesCount * sizeof(nvmlProcessUtilizationInfo_t). If the buffer is too small, the API will
|
||||
* return \a NVML_ERROR_INSUFFICIENT_SIZE, with the recommended minimal buffer size at \a procesesUtilInfo->processSamplesCount. The caller should
|
||||
* invoke the function again with the allocated buffer passed in \a procesesUtilInfo->procUtilArray, and \a procesesUtilInfo->processSamplesCount
|
||||
* set to the number no less than the recommended value by the previous API return.
|
||||
*
|
||||
* On successful return, the function updates \a procesesUtilInfo->processSamplesCount with the number of process utilization info structures
|
||||
* that were actually written. This may differ from a previously read value as instances are created or destroyed.
|
||||
*
|
||||
* \a procesesUtilInfo->lastSeenTimeStamp represents the CPU timestamp in microseconds at which utilization samples were last read. Set it to 0
|
||||
* to read utilization based on all the samples maintained by the driver's internal sample buffer. Set \a procesesUtilInfo->lastSeenTimeStamp
|
||||
* to a timeStamp retrieved from a previous query to read utilization since the previous query.
|
||||
*
|
||||
* \a procesesUtilInfo->version is the version number of the structure nvmlProcessesUtilizationInfo_t, the caller should set the correct version
|
||||
* number to retrieve the specific version of processes utilization information.
|
||||
*
|
||||
* @note On MIG-enabled GPUs, querying process utilization is not currently supported.
|
||||
*
|
||||
* @param device The identifier of the target device
|
||||
* @param procesesUtilInfo Pointer to the caller-provided structure of nvmlProcessesUtilizationInfo_t.
|
||||
|
||||
* @return
|
||||
* - \ref NVML_SUCCESS if \a procesesUtilInfo->procUtilArray has been populated
|
||||
* - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
|
||||
* - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid, or \a procesesUtilInfo is NULL
|
||||
* - \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature
|
||||
* - \ref NVML_ERROR_NOT_FOUND if sample entries are not found
|
||||
* - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
|
||||
* - \ref NVML_ERROR_VERSION_MISMATCH if the version of \a procesesUtilInfo is invalid
|
||||
* - \ref NVML_ERROR_INSUFFICIENT_SIZE if \a procesesUtilInfo->procUtilArray is NULL, or the buffer size of procesesUtilInfo->procUtilArray is too small.
|
||||
* The caller should check the minimul array size from the returned procesesUtilInfo->processSamplesCount, and call
|
||||
* the function again with a buffer no smaller than procesesUtilInfo->processSamplesCount * sizeof(nvmlProcessUtilizationInfo_t)
|
||||
* - \ref NVML_ERROR_UNKNOWN on any unexpected error
|
||||
*/
|
||||
nvmlReturn_t DECLDIR nvmlDeviceGetProcessesUtilizationInfo(nvmlDevice_t device, nvmlProcessesUtilizationInfo_t *procesesUtilInfo);
|
||||
|
||||
/** @} */
|
||||
|
||||
/***************************************************************************************************/
|
||||
@@ -6960,6 +7373,30 @@ nvmlReturn_t DECLDIR nvmlDeviceSetConfComputeUnprotectedMemSize(nvmlDevice_t dev
|
||||
*/
|
||||
nvmlReturn_t DECLDIR nvmlSystemSetConfComputeGpusReadyState(unsigned int isAcceptingWork);
|
||||
|
||||
/**
|
||||
* Set Conf Computing key rotation threshold.
|
||||
*
|
||||
* %HOPPER_OR_NEWER%
|
||||
* Supported on Linux, Windows TCC.
|
||||
*
|
||||
* This function is to set the confidential compute key rotation threshold parameters.
|
||||
* @ref pKeyRotationThrInfo->maxAttackerAdvantage should be in the range from
|
||||
* NVML_CC_KEY_ROTATION_THRESHOLD_ATTACKER_ADVANTAGE_MIN to NVML_CC_KEY_ROTATION_THRESHOLD_ATTACKER_ADVANTAGE_MAX.
|
||||
* Default value is 60.
|
||||
*
|
||||
* @param pKeyRotationThrInfo Reference to the key rotation threshold data
|
||||
*
|
||||
* @return
|
||||
* - \ref NVML_SUCCESS if \a key rotation threashold max attacker advantage has been set
|
||||
* - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
|
||||
* - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a memory is NULL
|
||||
* - \ref NVML_ERROR_INVALID_STATE if confidential compute GPU ready state is enabled
|
||||
* - \ref NVML_ERROR_NOT_SUPPORTED if this query is not supported by the device
|
||||
* - \ref NVML_ERROR_UNKNOWN on any unexpected error
|
||||
*/
|
||||
nvmlReturn_t DECLDIR nvmlSystemSetConfComputeKeyRotationThresholdInfo(
|
||||
nvmlConfComputeSetKeyRotationThresholdInfo_t *pKeyRotationThrInfo);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
@@ -7648,15 +8085,180 @@ nvmlReturn_t DECLDIR nvmlDeviceGetHostVgpuMode(nvmlDevice_t device, nvmlHostVgpu
|
||||
* @param virtualMode virtualization mode. One of NVML_GPU_VIRTUALIZATION_?
|
||||
*
|
||||
* @return
|
||||
* - \ref NVML_SUCCESS if \a pVirtualMode is set
|
||||
* - \ref NVML_SUCCESS if \a virtualMode is set
|
||||
* - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
|
||||
* - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a pVirtualMode is NULL
|
||||
* - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a virtualMode is NULL
|
||||
* - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
|
||||
* - \ref NVML_ERROR_NOT_SUPPORTED if setting of virtualization mode is not supported.
|
||||
* - \ref NVML_ERROR_NO_PERMISSION if setting of virtualization mode is not allowed for this client.
|
||||
*/
|
||||
nvmlReturn_t DECLDIR nvmlDeviceSetVirtualizationMode(nvmlDevice_t device, nvmlGpuVirtualizationMode_t virtualMode);
|
||||
|
||||
/**
|
||||
* Get the vGPU heterogeneous mode for the device.
|
||||
*
|
||||
* When in heterogeneous mode, a vGPU can concurrently host timesliced vGPUs with differing framebuffer sizes.
|
||||
*
|
||||
* On successful return, the function returns \a pHeterogeneousMode->mode with the current vGPU heterogeneous mode.
|
||||
* \a pHeterogeneousMode->version is the version number of the structure nvmlVgpuHeterogeneousMode_t, the caller should
|
||||
* set the correct version number to retrieve the vGPU heterogeneous mode.
|
||||
* \a pHeterogeneousMode->mode can either be \ref NVML_FEATURE_ENABLED or \ref NVML_FEATURE_DISABLED.
|
||||
*
|
||||
* @param device The identifier of the target device
|
||||
* @param pHeterogeneousMode Pointer to the caller-provided structure of nvmlVgpuHeterogeneousMode_t
|
||||
*
|
||||
* @return
|
||||
* - \ref NVML_SUCCESS Upon success
|
||||
* - \ref NVML_ERROR_UNINITIALIZED If library has not been successfully initialized
|
||||
* - \ref NVML_ERROR_INVALID_ARGUMENT If \a device is invalid or \a pHeterogeneousMode is NULL
|
||||
* - \ref NVML_ERROR_NOT_SUPPORTED If \a device doesn't support this feature
|
||||
* - \ref NVML_ERROR_VERSION_MISMATCH If the version of \a pHeterogeneousMode is invalid
|
||||
* - \ref NVML_ERROR_UNKNOWN On any unexpected error
|
||||
*/
|
||||
nvmlReturn_t DECLDIR nvmlDeviceGetVgpuHeterogeneousMode(nvmlDevice_t device, nvmlVgpuHeterogeneousMode_t *pHeterogeneousMode);
|
||||
|
||||
/**
|
||||
* Enable or disable vGPU heterogeneous mode for the device.
|
||||
*
|
||||
* When in heterogeneous mode, a vGPU can concurrently host timesliced vGPUs with differing framebuffer sizes.
|
||||
*
|
||||
* API would return an appropriate error code upon unsuccessful activation. For example, the heterogeneous mode
|
||||
* set will fail with error \ref NVML_ERROR_IN_USE if any vGPU instance is active on the device. The caller of this API
|
||||
* is expected to shutdown the vGPU VMs and retry setting the \a mode.
|
||||
* On successful return, the function updates the vGPU heterogeneous mode with the user provided \a pHeterogeneousMode->mode.
|
||||
* \a pHeterogeneousMode->version is the version number of the structure nvmlVgpuHeterogeneousMode_t, the caller should
|
||||
* set the correct version number to set the vGPU heterogeneous mode.
|
||||
*
|
||||
* @param device Identifier of the target device
|
||||
* @param pHeterogeneousMode Pointer to the caller-provided structure of nvmlVgpuHeterogeneousMode_t
|
||||
*
|
||||
* @return
|
||||
* - \ref NVML_SUCCESS Upon success
|
||||
* - \ref NVML_ERROR_UNINITIALIZED If library has not been successfully initialized
|
||||
* - \ref NVML_ERROR_INVALID_ARGUMENT If \a device or \a pHeterogeneousMode is NULL or \a pHeterogeneousMode->mode is invalid
|
||||
* - \ref NVML_ERROR_IN_USE If the \a device is in use
|
||||
* - \ref NVML_ERROR_NO_PERMISSION If user doesn't have permission to perform the operation
|
||||
* - \ref NVML_ERROR_NOT_SUPPORTED If MIG is enabled or \a device doesn't support this feature
|
||||
* - \ref NVML_ERROR_VERSION_MISMATCH If the version of \a pHeterogeneousMode is invalid
|
||||
* - \ref NVML_ERROR_UNKNOWN On any unexpected error
|
||||
*/
|
||||
nvmlReturn_t DECLDIR nvmlDeviceSetVgpuHeterogeneousMode(nvmlDevice_t device, const nvmlVgpuHeterogeneousMode_t *pHeterogeneousMode);
|
||||
|
||||
/**
|
||||
* Query the placement ID of active vGPU instance.
|
||||
*
|
||||
* When in vGPU heterogeneous mode, this function returns a valid placement ID as \a pPlacement->placementId
|
||||
* else NVML_INVALID_VGPU_PLACEMENT_ID is returned.
|
||||
* \a pPlacement->version is the version number of the structure nvmlVgpuPlacementId_t, the caller should
|
||||
* set the correct version number to get placement id of the vGPU instance \a vgpuInstance.
|
||||
*
|
||||
* @param vgpuInstance Identifier of the target vGPU instance
|
||||
* @param pPlacement Pointer to vGPU placement ID structure \a nvmlVgpuPlacementId_t
|
||||
*
|
||||
* @return
|
||||
* - \ref NVML_SUCCESS If information is successfully retrieved
|
||||
* - \ref NVML_ERROR_NOT_FOUND If \a vgpuInstance does not match a valid active vGPU instance
|
||||
* - \ref NVML_ERROR_INVALID_ARGUMENT If \a vgpuInstance is invalid or \a pPlacement is NULL
|
||||
* - \ref NVML_ERROR_VERSION_MISMATCH If the version of \a pPlacement is invalid
|
||||
* - \ref NVML_ERROR_UNKNOWN On any unexpected error
|
||||
*/
|
||||
nvmlReturn_t DECLDIR nvmlVgpuInstanceGetPlacementId(nvmlVgpuInstance_t vgpuInstance, nvmlVgpuPlacementId_t *pPlacement);
|
||||
|
||||
/**
|
||||
* Query the supported vGPU placement ID of the vGPU type.
|
||||
*
|
||||
* An array of supported vGPU placement IDs for the vGPU type ID indicated by \a vgpuTypeId is returned in the
|
||||
* caller-supplied buffer of \a pPlacementList->placementIds. Memory needed for the placementIds array should be
|
||||
* allocated based on maximum instances of a vGPU type which can be queried via \ref nvmlVgpuTypeGetMaxInstances().
|
||||
*
|
||||
* This function will return supported placement IDs even if GPU is not in vGPU heterogeneous mode.
|
||||
*
|
||||
* @param device Identifier of the target device
|
||||
* @param vgpuTypeId Handle to vGPU type. The vGPU type ID
|
||||
* @param pPlacementList Pointer to the vGPU placement structure \a nvmlVgpuPlacementList_t
|
||||
*
|
||||
* @return
|
||||
* - \ref NVML_SUCCESS Upon success
|
||||
* - \ref NVML_ERROR_UNINITIALIZED If library has not been successfully initialized
|
||||
* - \ref NVML_ERROR_INVALID_ARGUMENT If \a device or \a vgpuTypeId is invalid or \a pPlacementList is NULL
|
||||
* - \ref NVML_ERROR_NOT_SUPPORTED If \a device or \a vgpuTypeId isn't supported
|
||||
* - \ref NVML_ERROR_NO_PERMISSION If user doesn't have permission to perform the operation
|
||||
* - \ref NVML_ERROR_VERSION_MISMATCH If the version of \a pPlacementList is invalid
|
||||
* - \ref NVML_ERROR_UNKNOWN On any unexpected error
|
||||
*/
|
||||
nvmlReturn_t DECLDIR nvmlDeviceGetVgpuTypeSupportedPlacements(nvmlDevice_t device, nvmlVgpuTypeId_t vgpuTypeId, nvmlVgpuPlacementList_t *pPlacementList);
|
||||
|
||||
/**
|
||||
* Query the creatable vGPU placement ID of the vGPU type.
|
||||
*
|
||||
* An array of creatable vGPU placement IDs for the vGPU type ID indicated by \a vgpuTypeId is returned in the
|
||||
* caller-supplied buffer of \a pPlacementList->placementIds. Memory needed for the placementIds array should be
|
||||
* allocated based on maximum instances of a vGPU type which can be queried via \ref nvmlVgpuTypeGetMaxInstances().
|
||||
* The creatable vGPU placement IDs may differ over time, as there may be restrictions on what type of vGPU the
|
||||
* vGPU instance is running.
|
||||
*
|
||||
* The function will return \ref NVML_ERROR_NOT_SUPPORTED if the \a device is not in vGPU heterogeneous mode.
|
||||
*
|
||||
* @param device The identifier of the target device
|
||||
* @param vgpuTypeId Handle to vGPU type. The vGPU type ID
|
||||
* @param pPlacementList Pointer to the list of vGPU placement structure \a nvmlVgpuPlacementList_t
|
||||
*
|
||||
* @return
|
||||
* - \ref NVML_SUCCESS Upon success
|
||||
* - \ref NVML_ERROR_UNINITIALIZED If library has not been successfully initialized
|
||||
* - \ref NVML_ERROR_INVALID_ARGUMENT If \a device or \a vgpuTypeId is invalid or \a pPlacementList is NULL
|
||||
* - \ref NVML_ERROR_NOT_SUPPORTED If \a device or \a vgpuTypeId isn't supported
|
||||
* - \ref NVML_ERROR_NO_PERMISSION If user doesn't have permission to perform the operation
|
||||
* - \ref NVML_ERROR_VERSION_MISMATCH If the version of \a pPlacementList is invalid
|
||||
* - \ref NVML_ERROR_UNKNOWN On any unexpected error
|
||||
*/
|
||||
nvmlReturn_t DECLDIR nvmlDeviceGetVgpuTypeCreatablePlacements(nvmlDevice_t device, nvmlVgpuTypeId_t vgpuTypeId, nvmlVgpuPlacementList_t *pPlacementList);
|
||||
|
||||
/**
|
||||
* Retrieve the static GSP heap size of the vGPU type in bytes
|
||||
*
|
||||
* @param vgpuTypeId Handle to vGPU type
|
||||
* @param gspHeapSize Reference to return the GSP heap size value
|
||||
* @return
|
||||
* - \ref NVML_SUCCESS Successful completion
|
||||
* - \ref NVML_ERROR_UNINITIALIZED If the library has not been successfully initialized
|
||||
* - \ref NVML_ERROR_INVALID_ARGUMENT If \a vgpuTypeId is invalid, or \a gspHeapSize is NULL
|
||||
* - \ref NVML_ERROR_UNKNOWN On any unexpected error
|
||||
*/
|
||||
nvmlReturn_t DECLDIR nvmlVgpuTypeGetGspHeapSize(nvmlVgpuTypeId_t vgpuTypeId, unsigned long long *gspHeapSize);
|
||||
|
||||
/**
|
||||
* Retrieve the static framebuffer reservation of the vGPU type in bytes
|
||||
*
|
||||
* @param vgpuTypeId Handle to vGPU type
|
||||
* @param fbReservation Reference to return the framebuffer reservation
|
||||
* @return
|
||||
* - \ref NVML_SUCCESS Successful completion
|
||||
* - \ref NVML_ERROR_UNINITIALIZED If the library has not been successfully initialized
|
||||
* - \ref NVML_ERROR_INVALID_ARGUMENT If \a vgpuTypeId is invalid, or \a fbReservation is NULL
|
||||
* - \ref NVML_ERROR_UNKNOWN On any unexpected error
|
||||
*/
|
||||
nvmlReturn_t DECLDIR nvmlVgpuTypeGetFbReservation(nvmlVgpuTypeId_t vgpuTypeId, unsigned long long *fbReservation);
|
||||
|
||||
/**
|
||||
* Set the desirable vGPU capability of a device
|
||||
*
|
||||
* Refer to the \a nvmlDeviceVgpuCapability_t structure for the specific capabilities that can be set.
|
||||
* See \ref nvmlEnableState_t for available state.
|
||||
*
|
||||
* @param device The identifier of the target device
|
||||
* @param capability Specifies the \a nvmlDeviceVgpuCapability_t to be set
|
||||
* @param state The target capability mode
|
||||
*
|
||||
* @return
|
||||
* - \ref NVML_SUCCESS Successful completion
|
||||
* - \ref NVML_ERROR_UNINITIALIZED If the library has not been successfully initialized
|
||||
* - \ref NVML_ERROR_INVALID_ARGUMENT If \a device is invalid, or \a capability is invalid, or \a state is invalid
|
||||
* - \ref NVML_ERROR_NOT_SUPPORTED The API is not supported in current state, or \a device not in vGPU mode
|
||||
* - \ref NVML_ERROR_UNKNOWN On any unexpected error
|
||||
*/
|
||||
nvmlReturn_t DECLDIR nvmlDeviceSetVgpuCapabilities(nvmlDevice_t device, nvmlDeviceVgpuCapability_t capability, nvmlEnableState_t state);
|
||||
|
||||
/**
|
||||
* Retrieve the vGPU Software licensable features.
|
||||
*
|
||||
@@ -8774,6 +9376,52 @@ nvmlReturn_t DECLDIR nvmlDeviceGetVgpuUtilization(nvmlDevice_t device, unsigned
|
||||
nvmlValueType_t *sampleValType, unsigned int *vgpuInstanceSamplesCount,
|
||||
nvmlVgpuInstanceUtilizationSample_t *utilizationSamples);
|
||||
|
||||
/**
|
||||
* Retrieves recent utilization for vGPU instances running on a physical GPU (device).
|
||||
*
|
||||
* For Kepler &tm; or newer fully supported devices.
|
||||
*
|
||||
* Reads recent utilization of GPU SM (3D/Compute), framebuffer, video encoder, video decoder, jpeg decoder, and OFA for vGPU
|
||||
* instances running on a device. Utilization values are returned as an array of utilization sample structures in the caller-supplied
|
||||
* buffer pointed at by \a vgpuUtilInfo->vgpuUtilArray. One utilization sample structure is returned per vGPU instance, and includes the
|
||||
* CPU timestamp at which the samples were recorded. Individual utilization values are returned as "unsigned int" values
|
||||
* in nvmlValue_t unions. The function sets the caller-supplied \a vgpuUtilInfo->sampleValType to NVML_VALUE_TYPE_UNSIGNED_INT to
|
||||
* indicate the returned value type.
|
||||
*
|
||||
* To read utilization values, first determine the size of buffer required to hold the samples by invoking the function with
|
||||
* \a vgpuUtilInfo->vgpuUtilArray set to NULL. The function will return NVML_ERROR_INSUFFICIENT_SIZE, with the current vGPU instance
|
||||
* count in \a vgpuUtilInfo->vgpuInstanceCount, or NVML_SUCCESS if the current vGPU instance count is zero. The caller should allocate
|
||||
* a buffer of size vgpuUtilInfo->vgpuInstanceCount * sizeof(nvmlVgpuInstanceUtilizationInfo_t). Invoke the function again with
|
||||
* the allocated buffer passed in \a vgpuUtilInfo->vgpuUtilArray, and \a vgpuUtilInfo->vgpuInstanceCount set to the number of entries the
|
||||
* buffer is sized for.
|
||||
*
|
||||
* On successful return, the function updates \a vgpuUtilInfo->vgpuInstanceCount with the number of vGPU utilization sample
|
||||
* structures that were actually written. This may differ from a previously read value as vGPU instances are created or
|
||||
* destroyed.
|
||||
*
|
||||
* \a vgpuUtilInfo->lastSeenTimeStamp represents the CPU timestamp in microseconds at which utilization samples were last read. Set it to 0
|
||||
* to read utilization based on all the samples maintained by the driver's internal sample buffer. Set \a vgpuUtilInfo->lastSeenTimeStamp
|
||||
* to a timeStamp retrieved from a previous query to read utilization since the previous query.
|
||||
*
|
||||
* @param device The identifier for the target device
|
||||
* @param vgpuUtilInfo Pointer to the caller-provided structure of nvmlVgpuInstancesUtilizationInfo_t
|
||||
|
||||
* @return
|
||||
* - \ref NVML_SUCCESS if utilization samples are successfully retrieved
|
||||
* - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
|
||||
* - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid, \a vgpuUtilInfo is NULL, or \a vgpuUtilInfo->vgpuInstanceCount is 0
|
||||
* - \ref NVML_ERROR_NOT_SUPPORTED if vGPU is not supported by the device
|
||||
* - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
|
||||
* - \ref NVML_ERROR_VERSION_MISMATCH if the version of \a vgpuUtilInfo is invalid
|
||||
* - \ref NVML_ERROR_INSUFFICIENT_SIZE if \a vgpuUtilInfo->vgpuUtilArray is NULL, or the buffer size of vgpuUtilInfo->vgpuInstanceCount is too small.
|
||||
* The caller should check the current vGPU instance count from the returned vgpuUtilInfo->vgpuInstanceCount, and call
|
||||
* the function again with a buffer of size vgpuUtilInfo->vgpuInstanceCount * sizeof(nvmlVgpuInstanceUtilizationInfo_t)
|
||||
* - \ref NVML_ERROR_NOT_FOUND if sample entries are not found
|
||||
* - \ref NVML_ERROR_UNKNOWN on any unexpected error
|
||||
*/
|
||||
nvmlReturn_t DECLDIR nvmlDeviceGetVgpuInstancesUtilizationInfo(nvmlDevice_t device,
|
||||
nvmlVgpuInstancesUtilizationInfo_t *vgpuUtilInfo);
|
||||
|
||||
/**
|
||||
* Retrieves current utilization for processes running on vGPUs on a physical GPU (device).
|
||||
*
|
||||
@@ -8820,6 +9468,52 @@ nvmlReturn_t DECLDIR nvmlDeviceGetVgpuUtilization(nvmlDevice_t device, unsigned
|
||||
nvmlReturn_t DECLDIR nvmlDeviceGetVgpuProcessUtilization(nvmlDevice_t device, unsigned long long lastSeenTimeStamp,
|
||||
unsigned int *vgpuProcessSamplesCount,
|
||||
nvmlVgpuProcessUtilizationSample_t *utilizationSamples);
|
||||
|
||||
/**
|
||||
* Retrieves recent utilization for processes running on vGPU instances on a physical GPU (device).
|
||||
*
|
||||
* For Maxwell &tm; or newer fully supported devices.
|
||||
*
|
||||
* Reads recent utilization of GPU SM (3D/Compute), framebuffer, video encoder, video decoder, jpeg decoder, and OFA for processes running
|
||||
* on vGPU instances active on a device. Utilization values are returned as an array of utilization sample structures in the caller-supplied
|
||||
* buffer pointed at by \a vgpuProcUtilInfo->vgpuProcUtilArray. One utilization sample structure is returned per process running
|
||||
* on vGPU instances, that had some non-zero utilization during the last sample period. It includes the CPU timestamp at which
|
||||
* the samples were recorded. Individual utilization values are returned as "unsigned int" values.
|
||||
*
|
||||
* To read utilization values, first determine the size of buffer required to hold the samples by invoking the function with
|
||||
* \a vgpuProcUtilInfo->vgpuProcUtilArray set to NULL. The function will return NVML_ERROR_INSUFFICIENT_SIZE, with the current processes' count
|
||||
* running on vGPU instances in \a vgpuProcUtilInfo->vgpuProcessCount. The caller should allocate a buffer of size
|
||||
* vgpuProcUtilInfo->vgpuProcessCount * sizeof(nvmlVgpuProcessUtilizationSample_t). Invoke the function again with the allocated buffer passed
|
||||
* in \a vgpuProcUtilInfo->vgpuProcUtilArray, and \a vgpuProcUtilInfo->vgpuProcessCount set to the number of entries the buffer is sized for.
|
||||
*
|
||||
* On successful return, the function updates \a vgpuProcUtilInfo->vgpuProcessCount with the number of vGPU sub process utilization sample
|
||||
* structures that were actually written. This may differ from a previously read value depending on the number of processes that are active
|
||||
* in any given sample period.
|
||||
*
|
||||
* vgpuProcUtilInfo->lastSeenTimeStamp represents the CPU timestamp in microseconds at which utilization samples were last read. Set it to 0
|
||||
* to read utilization based on all the samples maintained by the driver's internal sample buffer. Set vgpuProcUtilInfo->lastSeenTimeStamp
|
||||
* to a timeStamp retrieved from a previous query to read utilization since the previous query.
|
||||
*
|
||||
* @param device The identifier for the target device
|
||||
* @param vgpuProcUtilInfo Pointer to the caller-provided structure of nvmlVgpuProcessesUtilizationInfo_t
|
||||
|
||||
* @return
|
||||
* - \ref NVML_SUCCESS if utilization samples are successfully retrieved
|
||||
* - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
|
||||
* - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid, or \a vgpuProcUtilInfo is null
|
||||
* - \ref NVML_ERROR_VERSION_MISMATCH if the version of \a vgpuProcUtilInfo is invalid
|
||||
* - \ref NVML_ERROR_INSUFFICIENT_SIZE if \a vgpuProcUtilInfo->vgpuProcUtilArray is null, or supplied \a vgpuProcUtilInfo->vgpuProcessCount
|
||||
* is too small to return samples for all processes on vGPU instances currently executing on the device.
|
||||
* The caller should check the current processes count from the returned \a vgpuProcUtilInfo->vgpuProcessCount,
|
||||
* and call the function again with a buffer of size
|
||||
* vgpuProcUtilInfo->vgpuProcessCount * sizeof(nvmlVgpuProcessUtilizationSample_t)
|
||||
* - \ref NVML_ERROR_NOT_SUPPORTED if vGPU is not supported by the device
|
||||
* - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
|
||||
* - \ref NVML_ERROR_NOT_FOUND if sample entries are not found
|
||||
* - \ref NVML_ERROR_UNKNOWN on any unexpected error
|
||||
*/
|
||||
nvmlReturn_t DECLDIR nvmlDeviceGetVgpuProcessesUtilizationInfo(nvmlDevice_t device, nvmlVgpuProcessesUtilizationInfo_t *vgpuProcUtilInfo);
|
||||
|
||||
/**
|
||||
* Queries the state of per process accounting mode on vGPU.
|
||||
*
|
||||
@@ -9304,7 +9998,7 @@ nvmlReturn_t DECLDIR nvmlDeviceSetMigMode(nvmlDevice_t device, unsigned int mode
|
||||
nvmlReturn_t DECLDIR nvmlDeviceGetMigMode(nvmlDevice_t device, unsigned int *currentMode, unsigned int *pendingMode);
|
||||
|
||||
/**
|
||||
* Get GPU instance profile information.
|
||||
* Get GPU instance profile information
|
||||
*
|
||||
* Information provided by this API is immutable throughout the lifetime of a MIG mode.
|
||||
*
|
||||
@@ -9319,7 +10013,7 @@ nvmlReturn_t DECLDIR nvmlDeviceGetMigMode(nvmlDevice_t device, unsigned int *cur
|
||||
* - \ref NVML_SUCCESS Upon success
|
||||
* - \ref NVML_ERROR_UNINITIALIZED If library has not been successfully initialized
|
||||
* - \ref NVML_ERROR_INVALID_ARGUMENT If \a device, \a profile or \a info are invalid
|
||||
* - \ref NVML_ERROR_NOT_SUPPORTED If \a device doesn't have MIG mode enabled or \a profile isn't supported
|
||||
* - \ref NVML_ERROR_NOT_SUPPORTED If \a device doesn't support MIG or \a profile isn't supported
|
||||
* - \ref NVML_ERROR_NO_PERMISSION If user doesn't have permission to perform the operation
|
||||
*/
|
||||
nvmlReturn_t DECLDIR nvmlDeviceGetGpuInstanceProfileInfo(nvmlDevice_t device, unsigned int profile,
|
||||
@@ -9360,7 +10054,7 @@ nvmlReturn_t DECLDIR nvmlDeviceGetGpuInstanceProfileInfoV(nvmlDevice_t device, u
|
||||
* Get GPU instance placements.
|
||||
*
|
||||
* A placement represents the location of a GPU instance within a device. This API only returns all the possible
|
||||
* placements for the given profile.
|
||||
* placements for the given profile regardless of whether MIG is enabled or not.
|
||||
* A created GPU instance occupies memory slices described by its placement. Creation of new GPU instance will
|
||||
* fail if there is overlap with the already occupied memory slices.
|
||||
*
|
||||
@@ -9379,7 +10073,7 @@ nvmlReturn_t DECLDIR nvmlDeviceGetGpuInstanceProfileInfoV(nvmlDevice_t device, u
|
||||
* - \ref NVML_SUCCESS Upon success
|
||||
* - \ref NVML_ERROR_UNINITIALIZED If library has not been successfully initialized
|
||||
* - \ref NVML_ERROR_INVALID_ARGUMENT If \a device, \a profileId or \a count are invalid
|
||||
* - \ref NVML_ERROR_NOT_SUPPORTED If \a device doesn't have MIG mode enabled or \a profileId isn't supported
|
||||
* - \ref NVML_ERROR_NOT_SUPPORTED If \a device doesn't support MIG or \a profileId isn't supported
|
||||
* - \ref NVML_ERROR_NO_PERMISSION If user doesn't have permission to perform the operation
|
||||
*/
|
||||
nvmlReturn_t DECLDIR nvmlDeviceGetGpuInstancePossiblePlacements_v2(nvmlDevice_t device, unsigned int profileId,
|
||||
@@ -10287,7 +10981,7 @@ nvmlReturn_t DECLDIR nvmlSystemGetNvlinkBwMode(unsigned int *nvlinkBwMode);
|
||||
* - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
|
||||
* - \ref NVML_ERROR_UNKNOWN on any unexpected error
|
||||
*
|
||||
* @see NVML_FI_DEV_POWER_AVERAGE
|
||||
* @see NVML_FI_DEV_POWER_AVERAGE
|
||||
* @see NVML_FI_DEV_POWER_INSTANT
|
||||
* @see NVML_FI_DEV_POWER_MIN_LIMIT
|
||||
* @see NVML_FI_DEV_POWER_MAX_LIMIT
|
||||
@@ -10295,7 +10989,28 @@ nvmlReturn_t DECLDIR nvmlSystemGetNvlinkBwMode(unsigned int *nvlinkBwMode);
|
||||
*/
|
||||
nvmlReturn_t DECLDIR nvmlDeviceSetPowerManagementLimit_v2(nvmlDevice_t device, nvmlPowerValue_v2_t *powerValue);
|
||||
|
||||
|
||||
/**
|
||||
* Get SRAM ECC error status of this device.
|
||||
*
|
||||
* For Ampere &tm; or newer fully supported devices.
|
||||
* Requires root/admin permissions.
|
||||
*
|
||||
* See \ref nvmlEccSramErrorStatus_v1_t for more information on the struct.
|
||||
*
|
||||
* @param device The identifier of the target device
|
||||
* @param status Returns SRAM ECC error status
|
||||
*
|
||||
* @return
|
||||
* - \ref NVML_SUCCESS if \a limit has been set
|
||||
* - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
|
||||
* - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a counters is NULL
|
||||
* - \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature
|
||||
* - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
|
||||
* - \ref NVML_ERROR_VERSION_MISMATCH if the version of \a nvmlEccSramErrorStatus_t is invalid
|
||||
* - \ref NVML_ERROR_UNKNOWN on any unexpected error
|
||||
*/
|
||||
nvmlReturn_t DECLDIR nvmlDeviceGetSramEccErrorStatus(nvmlDevice_t device,
|
||||
nvmlEccSramErrorStatus_t *status);
|
||||
/**
|
||||
* NVML API versioning support
|
||||
*/
|
||||
|
||||
Vendored
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"home": "https://github.com/NVIDIA/nvidia-settings/blob/main/src/nvml.h",
|
||||
"license": "Embed in source",
|
||||
"version": "545.23.06",
|
||||
"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.8.0",
|
||||
"version": "0.9.0",
|
||||
"author": "ibireme"
|
||||
}
|
||||
|
||||
Vendored
+31
-5
@@ -1407,6 +1407,7 @@ bool yyjson_mut_doc_set_val_pool_size(yyjson_mut_doc *doc, size_t count) {
|
||||
void yyjson_mut_doc_free(yyjson_mut_doc *doc) {
|
||||
if (doc) {
|
||||
yyjson_alc alc = doc->alc;
|
||||
memset(&doc->alc, 0, sizeof(alc));
|
||||
unsafe_yyjson_str_pool_release(&doc->str_pool, &alc);
|
||||
unsafe_yyjson_val_pool_release(&doc->val_pool, &alc);
|
||||
alc.free(alc.ctx, doc);
|
||||
@@ -8309,13 +8310,15 @@ static_inline u8 *yyjson_write_single(yyjson_val *val,
|
||||
bool cpy = (enc_table == enc_table_cpy);
|
||||
bool esc = has_write_flag(ESCAPE_UNICODE) != 0;
|
||||
bool inv = has_write_flag(ALLOW_INVALID_UNICODE) != 0;
|
||||
bool newline = has_write_flag(NEWLINE_AT_END) != 0;
|
||||
const usize end_len = 2; /* '\n' and '\0' */
|
||||
|
||||
switch (unsafe_yyjson_get_type(val)) {
|
||||
case YYJSON_TYPE_RAW:
|
||||
str_len = unsafe_yyjson_get_len(val);
|
||||
str_ptr = (const u8 *)unsafe_yyjson_get_str(val);
|
||||
check_str_len(str_len);
|
||||
incr_len(str_len + 1);
|
||||
incr_len(str_len + end_len);
|
||||
cur = write_raw(cur, str_ptr, str_len);
|
||||
break;
|
||||
|
||||
@@ -8323,7 +8326,7 @@ static_inline u8 *yyjson_write_single(yyjson_val *val,
|
||||
str_len = unsafe_yyjson_get_len(val);
|
||||
str_ptr = (const u8 *)unsafe_yyjson_get_str(val);
|
||||
check_str_len(str_len);
|
||||
incr_len(str_len * 6 + 4);
|
||||
incr_len(str_len * 6 + 2 + end_len);
|
||||
if (likely(cpy) && unsafe_yyjson_get_subtype(val)) {
|
||||
cur = write_string_noesc(cur, str_ptr, str_len);
|
||||
} else {
|
||||
@@ -8333,7 +8336,7 @@ static_inline u8 *yyjson_write_single(yyjson_val *val,
|
||||
break;
|
||||
|
||||
case YYJSON_TYPE_NUM:
|
||||
incr_len(32);
|
||||
incr_len(32 + end_len);
|
||||
cur = write_number(cur, val, flg);
|
||||
if (unlikely(!cur)) goto fail_num;
|
||||
break;
|
||||
@@ -8349,13 +8352,13 @@ static_inline u8 *yyjson_write_single(yyjson_val *val,
|
||||
break;
|
||||
|
||||
case YYJSON_TYPE_ARR:
|
||||
incr_len(4);
|
||||
incr_len(2 + end_len);
|
||||
byte_copy_2(cur, "[]");
|
||||
cur += 2;
|
||||
break;
|
||||
|
||||
case YYJSON_TYPE_OBJ:
|
||||
incr_len(4);
|
||||
incr_len(2 + end_len);
|
||||
byte_copy_2(cur, "{}");
|
||||
cur += 2;
|
||||
break;
|
||||
@@ -8364,6 +8367,7 @@ static_inline u8 *yyjson_write_single(yyjson_val *val,
|
||||
goto fail_type;
|
||||
}
|
||||
|
||||
if (newline) *cur++ = '\n';
|
||||
*cur = '\0';
|
||||
*dat_len = (usize)(cur - hdr);
|
||||
memset(err, 0, sizeof(yyjson_write_err));
|
||||
@@ -8436,6 +8440,7 @@ static_inline u8 *yyjson_write_minify(const yyjson_val *root,
|
||||
bool cpy = (enc_table == enc_table_cpy);
|
||||
bool esc = has_write_flag(ESCAPE_UNICODE) != 0;
|
||||
bool inv = has_write_flag(ALLOW_INVALID_UNICODE) != 0;
|
||||
bool newline = has_write_flag(NEWLINE_AT_END) != 0;
|
||||
|
||||
alc_len = root->uni.ofs / sizeof(yyjson_val);
|
||||
alc_len = alc_len * YYJSON_WRITER_ESTIMATED_MINIFY_RATIO + 64;
|
||||
@@ -8542,6 +8547,11 @@ ctn_end:
|
||||
}
|
||||
|
||||
doc_end:
|
||||
if (newline) {
|
||||
incr_len(2);
|
||||
*(cur - 1) = '\n';
|
||||
cur++;
|
||||
}
|
||||
*--cur = '\0';
|
||||
*dat_len = (usize)(cur - hdr);
|
||||
memset(err, 0, sizeof(yyjson_write_err));
|
||||
@@ -8615,6 +8625,7 @@ static_inline u8 *yyjson_write_pretty(const yyjson_val *root,
|
||||
bool esc = has_write_flag(ESCAPE_UNICODE) != 0;
|
||||
bool inv = has_write_flag(ALLOW_INVALID_UNICODE) != 0;
|
||||
usize spaces = has_write_flag(PRETTY_TWO_SPACES) ? 2 : 4;
|
||||
bool newline = has_write_flag(NEWLINE_AT_END) != 0;
|
||||
|
||||
alc_len = root->uni.ofs / sizeof(yyjson_val);
|
||||
alc_len = alc_len * YYJSON_WRITER_ESTIMATED_PRETTY_RATIO + 64;
|
||||
@@ -8745,6 +8756,10 @@ ctn_end:
|
||||
}
|
||||
|
||||
doc_end:
|
||||
if (newline) {
|
||||
incr_len(2);
|
||||
*cur++ = '\n';
|
||||
}
|
||||
*cur = '\0';
|
||||
*dat_len = (usize)(cur - hdr);
|
||||
memset(err, 0, sizeof(yyjson_write_err));
|
||||
@@ -8977,6 +8992,7 @@ static_inline u8 *yyjson_mut_write_minify(const yyjson_mut_val *root,
|
||||
bool cpy = (enc_table == enc_table_cpy);
|
||||
bool esc = has_write_flag(ESCAPE_UNICODE) != 0;
|
||||
bool inv = has_write_flag(ALLOW_INVALID_UNICODE) != 0;
|
||||
bool newline = has_write_flag(NEWLINE_AT_END) != 0;
|
||||
|
||||
alc_len = estimated_val_num * YYJSON_WRITER_ESTIMATED_MINIFY_RATIO + 64;
|
||||
alc_len = size_align_up(alc_len, sizeof(yyjson_mut_write_ctx));
|
||||
@@ -9087,6 +9103,11 @@ ctn_end:
|
||||
}
|
||||
|
||||
doc_end:
|
||||
if (newline) {
|
||||
incr_len(2);
|
||||
*(cur - 1) = '\n';
|
||||
cur++;
|
||||
}
|
||||
*--cur = '\0';
|
||||
*dat_len = (usize)(cur - hdr);
|
||||
err->code = YYJSON_WRITE_SUCCESS;
|
||||
@@ -9162,6 +9183,7 @@ static_inline u8 *yyjson_mut_write_pretty(const yyjson_mut_val *root,
|
||||
bool esc = has_write_flag(ESCAPE_UNICODE) != 0;
|
||||
bool inv = has_write_flag(ALLOW_INVALID_UNICODE) != 0;
|
||||
usize spaces = has_write_flag(PRETTY_TWO_SPACES) ? 2 : 4;
|
||||
bool newline = has_write_flag(NEWLINE_AT_END) != 0;
|
||||
|
||||
alc_len = estimated_val_num * YYJSON_WRITER_ESTIMATED_PRETTY_RATIO + 64;
|
||||
alc_len = size_align_up(alc_len, sizeof(yyjson_mut_write_ctx));
|
||||
@@ -9296,6 +9318,10 @@ ctn_end:
|
||||
}
|
||||
|
||||
doc_end:
|
||||
if (newline) {
|
||||
incr_len(2);
|
||||
*cur++ = '\n';
|
||||
}
|
||||
*cur = '\0';
|
||||
*dat_len = (usize)(cur - hdr);
|
||||
err->code = YYJSON_WRITE_SUCCESS;
|
||||
|
||||
Vendored
+35
-21
@@ -527,16 +527,16 @@ extern "C" {
|
||||
#define YYJSON_VERSION_MAJOR 0
|
||||
|
||||
/** The minor version of yyjson. */
|
||||
#define YYJSON_VERSION_MINOR 8
|
||||
#define YYJSON_VERSION_MINOR 9
|
||||
|
||||
/** 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 0x000800
|
||||
#define YYJSON_VERSION_HEX 0x000900
|
||||
|
||||
/** The version string of yyjson. */
|
||||
#define YYJSON_VERSION_STRING "0.8.0"
|
||||
#define YYJSON_VERSION_STRING "0.9.0"
|
||||
|
||||
/** The version of yyjson in hex, same as `YYJSON_VERSION_HEX`. */
|
||||
yyjson_api uint32_t yyjson_version(void);
|
||||
@@ -738,7 +738,7 @@ typedef uint32_t yyjson_read_flag;
|
||||
- Report error if double number is infinity.
|
||||
- Report error if string contains invalid UTF-8 character or BOM.
|
||||
- Report error on trailing commas, comments, inf and nan literals. */
|
||||
static const yyjson_read_flag YYJSON_READ_NOFLAG = 0 << 0;
|
||||
static const yyjson_read_flag YYJSON_READ_NOFLAG = 0;
|
||||
|
||||
/** Read the input data in-situ.
|
||||
This option allows the reader to modify and use input data to store string
|
||||
@@ -1067,7 +1067,7 @@ typedef uint32_t yyjson_write_flag;
|
||||
- Report error on inf or nan number.
|
||||
- Report error on invalid UTF-8 string.
|
||||
- Do not escape unicode or slash. */
|
||||
static const yyjson_write_flag YYJSON_WRITE_NOFLAG = 0 << 0;
|
||||
static const yyjson_write_flag YYJSON_WRITE_NOFLAG = 0;
|
||||
|
||||
/** Write JSON pretty with 4 space indent. */
|
||||
static const yyjson_write_flag YYJSON_WRITE_PRETTY = 1 << 0;
|
||||
@@ -1096,6 +1096,10 @@ static const yyjson_write_flag YYJSON_WRITE_ALLOW_INVALID_UNICODE = 1 << 5;
|
||||
This flag will override `YYJSON_WRITE_PRETTY` flag. */
|
||||
static const yyjson_write_flag YYJSON_WRITE_PRETTY_TWO_SPACES = 1 << 6;
|
||||
|
||||
/** Adds a newline character `\n` at the end of the JSON.
|
||||
This can be helpful for text editors or NDJSON. */
|
||||
static const yyjson_write_flag YYJSON_WRITE_NEWLINE_AT_END = 1 << 7;
|
||||
|
||||
|
||||
|
||||
/** Result code for JSON writer */
|
||||
@@ -3695,7 +3699,7 @@ yyjson_api_inline bool yyjson_mut_obj_add_strcpy(yyjson_mut_doc *doc,
|
||||
The `len` should be the length of the `val`, in bytes.
|
||||
This function allows duplicated key in one object.
|
||||
|
||||
@warning The key/value strings are not copied, you should keep these strings
|
||||
@warning The key strings are not copied, you should keep these strings
|
||||
unmodified for the lifetime of this JSON document. */
|
||||
yyjson_api_inline bool yyjson_mut_obj_add_strncpy(yyjson_mut_doc *doc,
|
||||
yyjson_mut_val *obj,
|
||||
@@ -4829,6 +4833,7 @@ yyjson_api_inline size_t yyjson_doc_get_val_count(yyjson_doc *doc) {
|
||||
yyjson_api_inline void yyjson_doc_free(yyjson_doc *doc) {
|
||||
if (doc) {
|
||||
yyjson_alc alc = doc->alc;
|
||||
memset(&doc->alc, 0, sizeof(alc));
|
||||
if (doc->str_pool) alc.free(alc.ctx, doc->str_pool);
|
||||
alc.free(alc.ctx, doc);
|
||||
}
|
||||
@@ -5668,6 +5673,7 @@ yyjson_api_inline yyjson_mut_val *yyjson_mut_bool(yyjson_mut_doc *doc,
|
||||
if (yyjson_likely(doc)) {
|
||||
yyjson_mut_val *val = unsafe_yyjson_mut_val(doc, 1);
|
||||
if (yyjson_likely(val)) {
|
||||
_val = !!_val;
|
||||
val->tag = YYJSON_TYPE_BOOL | (uint8_t)((uint8_t)_val << 3);
|
||||
return val;
|
||||
}
|
||||
@@ -5920,7 +5926,8 @@ yyjson_api_inline yyjson_mut_val *yyjson_mut_arr(yyjson_mut_doc *doc) {
|
||||
yyjson_api_inline yyjson_mut_val *yyjson_mut_arr_with_bool(
|
||||
yyjson_mut_doc *doc, const bool *vals, size_t count) {
|
||||
yyjson_mut_arr_with_func({
|
||||
val->tag = YYJSON_TYPE_BOOL | (uint8_t)((uint8_t)vals[i] << 3);
|
||||
bool _val = !!vals[i];
|
||||
val->tag = YYJSON_TYPE_BOOL | (uint8_t)((uint8_t)_val << 3);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -6872,6 +6879,7 @@ yyjson_api_inline bool yyjson_mut_obj_add_bool(yyjson_mut_doc *doc,
|
||||
const char *_key,
|
||||
bool _val) {
|
||||
yyjson_mut_obj_add_func({
|
||||
_val = !!_val;
|
||||
val->tag = YYJSON_TYPE_BOOL | (uint8_t)((uint8_t)(_val) << 3);
|
||||
});
|
||||
}
|
||||
@@ -7730,33 +7738,39 @@ yyjson_api_inline bool yyjson_ptr_get_bool(
|
||||
}
|
||||
|
||||
/**
|
||||
Set provided `value` if the JSON Pointer (RFC 6901) exists and is type uint.
|
||||
Returns true if value at `ptr` exists and is the correct type, otherwise false.
|
||||
Set provided `value` if the JSON Pointer (RFC 6901) exists and is an integer
|
||||
that fits in `uint64_t`. Returns true if successful, otherwise false.
|
||||
*/
|
||||
yyjson_api_inline bool yyjson_ptr_get_uint(
|
||||
yyjson_val *root, const char *ptr, uint64_t *value) {
|
||||
yyjson_val *val = yyjson_ptr_get(root, ptr);
|
||||
if (value && yyjson_is_uint(val)) {
|
||||
*value = unsafe_yyjson_get_uint(val);
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
if (value && val) {
|
||||
uint64_t ret = val->uni.u64;
|
||||
if (unsafe_yyjson_is_uint(val) ||
|
||||
(unsafe_yyjson_is_sint(val) && !(ret >> 63))) {
|
||||
*value = ret;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
Set provided `value` if the JSON Pointer (RFC 6901) exists and is type sint.
|
||||
Returns true if value at `ptr` exists and is the correct type, otherwise false.
|
||||
Set provided `value` if the JSON Pointer (RFC 6901) exists and is an integer
|
||||
that fits in `int64_t`. Returns true if successful, otherwise false.
|
||||
*/
|
||||
yyjson_api_inline bool yyjson_ptr_get_sint(
|
||||
yyjson_val *root, const char *ptr, int64_t *value) {
|
||||
yyjson_val *val = yyjson_ptr_get(root, ptr);
|
||||
if (value && yyjson_is_sint(val)) {
|
||||
*value = unsafe_yyjson_get_sint(val);
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
if (value && val) {
|
||||
int64_t ret = val->uni.i64;
|
||||
if (unsafe_yyjson_is_sint(val) ||
|
||||
(unsafe_yyjson_is_uint(val) && ret >= 0)) {
|
||||
*value = ret;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,111 +0,0 @@
|
||||
#include "common/bar.h"
|
||||
#include "common/color.h"
|
||||
#include "util/textModifier.h"
|
||||
|
||||
void ffAppendPercentBar(FFstrbuf* buffer, double percent, uint8_t green, uint8_t yellow, uint8_t red)
|
||||
{
|
||||
assert(green <= 100 && yellow <= 100 && red <= 100);
|
||||
|
||||
const FFOptionsDisplay* options = &instance.config.display;
|
||||
|
||||
uint32_t blocksPercent = (uint32_t) (percent / 100.0 * options->barWidth + 0.5);
|
||||
uint32_t blocksGreen = (uint32_t) (green / 100.0 * options->barWidth + 0.5);
|
||||
uint32_t blocksYellow = (uint32_t) (yellow / 100.0 * options->barWidth + 0.5);
|
||||
uint32_t blocksRed = (uint32_t) (red / 100.0 * options->barWidth + 0.5);
|
||||
assert(blocksPercent <= options->barWidth);
|
||||
|
||||
if(options->barBorder)
|
||||
{
|
||||
if(!options->pipe)
|
||||
ffStrbufAppendS(buffer, "\e[" FF_COLOR_FG_LIGHT_WHITE "m[ ");
|
||||
else
|
||||
ffStrbufAppendS(buffer, "[ ");
|
||||
}
|
||||
|
||||
for (uint32_t i = 0; i < blocksPercent; ++i)
|
||||
{
|
||||
if(!options->pipe)
|
||||
{
|
||||
if (i == blocksGreen)
|
||||
ffStrbufAppendS(buffer, "\e[" FF_COLOR_FG_GREEN "m");
|
||||
else if (i == blocksYellow)
|
||||
ffStrbufAppendS(buffer, "\e[" FF_COLOR_FG_LIGHT_YELLOW "m");
|
||||
else if (i == blocksRed)
|
||||
ffStrbufAppendS(buffer, "\e[" FF_COLOR_FG_LIGHT_RED "m");
|
||||
}
|
||||
ffStrbufAppend(buffer, &options->barCharElapsed);
|
||||
}
|
||||
|
||||
if (blocksPercent < options->barWidth)
|
||||
{
|
||||
if(!options->pipe)
|
||||
ffStrbufAppendS(buffer, "\e[" FF_COLOR_FG_LIGHT_WHITE "m");
|
||||
for (uint32_t i = blocksPercent; i < options->barWidth; ++i)
|
||||
ffStrbufAppend(buffer, &options->barCharTotal);
|
||||
}
|
||||
|
||||
if(options->barBorder)
|
||||
{
|
||||
if(!options->pipe)
|
||||
ffStrbufAppendS(buffer, "\e[" FF_COLOR_FG_LIGHT_WHITE "m ]");
|
||||
else
|
||||
ffStrbufAppendS(buffer, " ]");
|
||||
}
|
||||
|
||||
if(!options->pipe)
|
||||
ffStrbufAppendS(buffer, FASTFETCH_TEXT_MODIFIER_RESET);
|
||||
}
|
||||
|
||||
// if (green < yellow)
|
||||
// [0, green]: print green
|
||||
// (green, yellow]: print yellow
|
||||
// (yellow, 100]: print red
|
||||
//
|
||||
// if (green > yellow)
|
||||
// [green, 100]: print green
|
||||
// [yellow, green): print yellow
|
||||
// [0, yellow): PRINT RED
|
||||
void ffAppendPercentNum(FFstrbuf* buffer, double percent, uint8_t green, uint8_t yellow, bool parentheses)
|
||||
{
|
||||
assert(green <= 100 && yellow <= 100);
|
||||
|
||||
const FFOptionsDisplay* options = &instance.config.display;
|
||||
|
||||
bool colored = !!(options->percentType & FF_PERCENTAGE_TYPE_NUM_COLOR_BIT);
|
||||
|
||||
if (parentheses)
|
||||
ffStrbufAppendC(buffer, '(');
|
||||
|
||||
if (colored && !options->pipe)
|
||||
{
|
||||
if(percent != percent)
|
||||
ffStrbufAppendS(buffer, "\e[" FF_COLOR_FG_LIGHT_BLACK "m");
|
||||
else if(green < yellow)
|
||||
{
|
||||
if (percent <= green)
|
||||
ffStrbufAppendS(buffer, "\e[" FF_COLOR_FG_GREEN "m");
|
||||
else if (percent <= yellow)
|
||||
ffStrbufAppendS(buffer, "\e[" FF_COLOR_FG_LIGHT_YELLOW "m");
|
||||
else
|
||||
ffStrbufAppendS(buffer, "\e[" FF_COLOR_FG_LIGHT_RED "m");
|
||||
}
|
||||
else
|
||||
{
|
||||
if (percent >= green)
|
||||
ffStrbufAppendS(buffer, "\e[" FF_COLOR_FG_GREEN "m");
|
||||
else if (percent >= yellow)
|
||||
ffStrbufAppendS(buffer, "\e[" FF_COLOR_FG_LIGHT_YELLOW "m");
|
||||
else
|
||||
ffStrbufAppendS(buffer, "\e[" FF_COLOR_FG_LIGHT_RED "m");
|
||||
}
|
||||
}
|
||||
ffStrbufAppendF(buffer, "%.*f%%", options->percentNdigits, percent);
|
||||
|
||||
if (colored && !options->pipe)
|
||||
{
|
||||
ffStrbufAppendS(buffer, FASTFETCH_TEXT_MODIFIER_RESET);
|
||||
}
|
||||
|
||||
if (parentheses)
|
||||
ffStrbufAppendC(buffer, ')');
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include "fastfetch.h"
|
||||
|
||||
enum
|
||||
{
|
||||
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,
|
||||
};
|
||||
|
||||
void ffAppendPercentBar(FFstrbuf* buffer, double percent, uint8_t green, uint8_t yellow, uint8_t red);
|
||||
void ffAppendPercentNum(FFstrbuf* buffer, double percent, uint8_t green, uint8_t yellow, bool parentheses);
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
bool ffParseModuleOptions(const char* key, const char* value)
|
||||
{
|
||||
if (!ffStrStartsWith(key, "--") || !isalpha(key[2])) return false;
|
||||
if (!ffStrStartsWith(key, "--") || !ffCharIsEnglishAlphabet(key[2])) return false;
|
||||
|
||||
for (FFModuleBaseInfo** modules = ffModuleInfos[toupper(key[2]) - 'A']; *modules; ++modules)
|
||||
{
|
||||
@@ -26,7 +26,7 @@ void ffPrepareCommandOption(FFdata* data)
|
||||
FFOptionsModules* const options = &instance.config.modules;
|
||||
//If we don't have a custom structure, use the default one
|
||||
if(data->structure.length == 0)
|
||||
ffStrbufAppendS(&data->structure, FASTFETCH_DATATEXT_STRUCTURE);
|
||||
ffStrbufAppendS(&data->structure, FASTFETCH_DATATEXT_STRUCTURE); // Cannot use `ffStrbufSetStatic` here because we will modify the string
|
||||
|
||||
if(ffStrbufContainIgnCaseS(&data->structure, FF_CPUUSAGE_MODULE_NAME))
|
||||
ffPrepareCPUUsage();
|
||||
@@ -79,30 +79,11 @@ static void genJsonResult(FFModuleBaseInfo* baseInfo, yyjson_mut_doc* doc)
|
||||
|
||||
static void parseStructureCommand(
|
||||
const char* line,
|
||||
FFlist* customValues,
|
||||
void (*fn)(FFModuleBaseInfo *baseInfo, yyjson_mut_doc* jsonDoc),
|
||||
yyjson_mut_doc* jsonDoc
|
||||
)
|
||||
{
|
||||
// handle `--set` and `--set-keyless`
|
||||
FF_LIST_FOR_EACH(FFCustomValue, customValue, *customValues)
|
||||
{
|
||||
if (ffStrbufEqualS(&customValue->key, line))
|
||||
{
|
||||
__attribute__((__cleanup__(ffDestroyCustomOptions))) FFCustomOptions options;
|
||||
ffInitCustomOptions(&options);
|
||||
if (customValue->printKey)
|
||||
ffStrbufAppend(&options.moduleArgs.key, &customValue->key);
|
||||
ffStrbufAppend(&options.moduleArgs.outputFormat, &customValue->value);
|
||||
if (__builtin_expect(jsonDoc != NULL, false))
|
||||
fn((FFModuleBaseInfo*) &options, jsonDoc);
|
||||
else
|
||||
ffPrintCustom(&options);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if(isalpha(line[0]))
|
||||
if(ffCharIsEnglishAlphabet(line[0]))
|
||||
{
|
||||
for (FFModuleBaseInfo** modules = ffModuleInfos[toupper(line[0]) - 'A']; *modules; ++modules)
|
||||
{
|
||||
@@ -118,7 +99,7 @@ static void parseStructureCommand(
|
||||
}
|
||||
}
|
||||
|
||||
ffPrintErrorString(line, 0, NULL, FF_PRINT_TYPE_NO_CUSTOM_KEY, "<no implementation provided>");
|
||||
ffPrintError(line, 0, NULL, FF_PRINT_TYPE_NO_CUSTOM_KEY, "<no implementation provided>");
|
||||
}
|
||||
|
||||
void ffPrintCommandOption(FFdata* data, yyjson_mut_doc* jsonDoc)
|
||||
@@ -134,7 +115,7 @@ void ffPrintCommandOption(FFdata* data, yyjson_mut_doc* jsonDoc)
|
||||
if(instance.config.display.stat)
|
||||
ms = ffTimeGetTick();
|
||||
|
||||
parseStructureCommand(data->structure.chars + startIndex, &data->customValues, genJsonResult, jsonDoc);
|
||||
parseStructureCommand(data->structure.chars + startIndex, genJsonResult, jsonDoc);
|
||||
|
||||
if(instance.config.display.stat)
|
||||
{
|
||||
@@ -168,7 +149,7 @@ void ffMigrateCommandOptionToJsonc(FFdata* data, yyjson_mut_doc* jsonDoc)
|
||||
{
|
||||
//If we don't have a custom structure, use the default one
|
||||
if(data->structure.length == 0)
|
||||
ffStrbufAppendS(&data->structure, FASTFETCH_DATATEXT_STRUCTURE);
|
||||
ffStrbufAppendS(&data->structure, FASTFETCH_DATATEXT_STRUCTURE); // Cannot use `ffStrbufSetStatic` here because we will modify the string
|
||||
|
||||
//Parse the structure and call the modules
|
||||
uint32_t startIndex = 0;
|
||||
@@ -177,7 +158,7 @@ void ffMigrateCommandOptionToJsonc(FFdata* data, yyjson_mut_doc* jsonDoc)
|
||||
uint32_t colonIndex = ffStrbufNextIndexC(&data->structure, startIndex, ':');
|
||||
data->structure.chars[colonIndex] = '\0';
|
||||
|
||||
parseStructureCommand(data->structure.chars + startIndex, &data->customValues, genJsonConfig, jsonDoc);
|
||||
parseStructureCommand(data->structure.chars + startIndex, genJsonConfig, jsonDoc);
|
||||
|
||||
startIndex = colonIndex + 1;
|
||||
}
|
||||
|
||||
@@ -2,18 +2,10 @@
|
||||
|
||||
#include "fastfetch.h"
|
||||
|
||||
typedef struct FFCustomValue
|
||||
{
|
||||
bool printKey;
|
||||
FFstrbuf key;
|
||||
FFstrbuf value;
|
||||
} FFCustomValue;
|
||||
|
||||
// Things only needed by fastfetch
|
||||
typedef struct FFdata
|
||||
{
|
||||
FFstrbuf structure;
|
||||
FFlist customValues; // List of FFCustomValue
|
||||
bool configLoaded;
|
||||
} FFdata;
|
||||
|
||||
|
||||
+6
-4
@@ -181,22 +181,24 @@ DBusMessage* ffDBusGetProperty(FFDBusData* dbus, const char* busName, const char
|
||||
return reply;
|
||||
}
|
||||
|
||||
void ffDBusGetPropertyString(FFDBusData* dbus, const char* busName, const char* objectPath, const char* interface, const char* property, FFstrbuf* result)
|
||||
bool ffDBusGetPropertyString(FFDBusData* dbus, const char* busName, const char* objectPath, const char* interface, const char* property, FFstrbuf* result)
|
||||
{
|
||||
DBusMessage* reply = ffDBusGetProperty(dbus, busName, objectPath, interface, property);
|
||||
if(reply == NULL)
|
||||
return;
|
||||
return false;
|
||||
|
||||
DBusMessageIter rootIterator;
|
||||
if(!dbus->lib->ffdbus_message_iter_init(reply, &rootIterator))
|
||||
{
|
||||
dbus->lib->ffdbus_message_unref(reply);
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
ffDBusGetValue(dbus, &rootIterator, result);
|
||||
bool ret = ffDBusGetValue(dbus, &rootIterator, result);
|
||||
|
||||
dbus->lib->ffdbus_message_unref(reply);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
#endif //FF_HAVE_DBUS
|
||||
|
||||
+1
-1
@@ -48,6 +48,6 @@ 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);
|
||||
DBusMessage* ffDBusGetProperty(FFDBusData* dbus, const char* busName, const char* objectPath, const char* interface, const char* property);
|
||||
void ffDBusGetPropertyString(FFDBusData* dbus, const char* busName, const char* objectPath, const char* interface, const char* property, FFstrbuf* result);
|
||||
bool ffDBusGetPropertyString(FFDBusData* dbus, const char* busName, const char* objectPath, const char* interface, const char* property, FFstrbuf* result);
|
||||
|
||||
#endif // FF_HAVE_DBUS
|
||||
|
||||
+38
-51
@@ -2,6 +2,7 @@
|
||||
#include "common/font.h"
|
||||
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
|
||||
void ffFontInit(FFfont* font)
|
||||
{
|
||||
@@ -12,6 +13,22 @@ void ffFontInit(FFfont* font)
|
||||
ffListInit(&font->styles, sizeof(FFstrbuf));
|
||||
}
|
||||
|
||||
static void strbufAppendNSExcludingC(FFstrbuf* strbuf, uint32_t length, const char* value, char exclude)
|
||||
{
|
||||
if(value == NULL || length == 0)
|
||||
return;
|
||||
|
||||
ffStrbufEnsureFree(strbuf, length);
|
||||
|
||||
for(uint32_t i = 0; i < length; i++)
|
||||
{
|
||||
if(value[i] != exclude)
|
||||
strbuf->chars[strbuf->length++] = value[i];
|
||||
}
|
||||
|
||||
strbuf->chars[strbuf->length] = '\0';
|
||||
}
|
||||
|
||||
static void fontInitPretty(FFfont* font)
|
||||
{
|
||||
ffStrbufAppend(&font->pretty, &font->name);
|
||||
@@ -50,59 +67,33 @@ void ffFontInitQt(FFfont* font, const char* data)
|
||||
//See https://doc.qt.io/qt-5/qfont.html#toString
|
||||
|
||||
//Family
|
||||
while(*data != ',' && *data != '\0')
|
||||
{
|
||||
ffStrbufAppendC(&font->name, *data);
|
||||
++data;
|
||||
}
|
||||
if(*data != '\0')
|
||||
++data;
|
||||
data = ffStrbufAppendSUntilC(&font->name, data, ',');
|
||||
ffStrbufTrim(&font->name, ' ');
|
||||
if (!data) goto exit;
|
||||
data++;
|
||||
|
||||
//Size
|
||||
while(*data != ',' && *data != '\0')
|
||||
{
|
||||
ffStrbufAppendC(&font->size, *data);
|
||||
++data;
|
||||
}
|
||||
if(*data != '\0')
|
||||
++data;
|
||||
data = ffStrbufAppendSUntilC(&font->size, data, ',');
|
||||
ffStrbufTrim(&font->size, ' ');
|
||||
if (!data) goto exit;
|
||||
data++;
|
||||
|
||||
#define FF_FONT_QT_SKIP_VALUE \
|
||||
while(*data != ',' && *data != '\0') \
|
||||
++data; \
|
||||
if(*data != '\0') \
|
||||
++data;
|
||||
|
||||
FF_FONT_QT_SKIP_VALUE //Pixel size
|
||||
FF_FONT_QT_SKIP_VALUE //Style hint
|
||||
FF_FONT_QT_SKIP_VALUE //Font weight
|
||||
FF_FONT_QT_SKIP_VALUE //Font style
|
||||
FF_FONT_QT_SKIP_VALUE //Underline
|
||||
FF_FONT_QT_SKIP_VALUE //Strike out
|
||||
FF_FONT_QT_SKIP_VALUE //Fixed pitch
|
||||
FF_FONT_QT_SKIP_VALUE //Always 0
|
||||
|
||||
#undef FF_FONT_QT_SKIP_VALUE
|
||||
|
||||
while(*data != '\0')
|
||||
//Style
|
||||
data = strrchr(data, ',');
|
||||
if (!data) goto exit;
|
||||
data++;
|
||||
if (isalpha(*data))
|
||||
{
|
||||
while(*data == ' ')
|
||||
++data;
|
||||
|
||||
if(*data == '\0')
|
||||
break;
|
||||
|
||||
FFstrbuf* style = ffListAdd(&font->styles);
|
||||
ffStrbufInit(style);
|
||||
while(*data != ' ' && *data != '\0')
|
||||
do
|
||||
{
|
||||
ffStrbufAppendC(style, *data);
|
||||
++data;
|
||||
}
|
||||
FFstrbuf* style = ffListAdd(&font->styles);
|
||||
ffStrbufInit(style);
|
||||
data = ffStrbufAppendSUntilC(style, data, ' ');
|
||||
if (data) data++;
|
||||
} while (data);
|
||||
}
|
||||
|
||||
exit:
|
||||
fontInitPretty(font);
|
||||
}
|
||||
|
||||
@@ -155,7 +146,7 @@ static void fontPangoParseWord(const char** data, FFfont* font, FFstrbuf* altern
|
||||
ffStrbufInit(alternativeBuffer);
|
||||
}
|
||||
|
||||
ffStrbufAppendNSExludingC(alternativeBuffer, wordLength, wordStart, '-');
|
||||
strbufAppendNSExcludingC(alternativeBuffer, wordLength, wordStart, '-');
|
||||
|
||||
if(
|
||||
strncasecmp(wordStart, "Ultra ", 6) == 0 ||
|
||||
@@ -171,7 +162,7 @@ static void fontPangoParseWord(const char** data, FFfont* font, FFstrbuf* altern
|
||||
|
||||
if(alternativeBuffer != NULL)
|
||||
{
|
||||
ffStrbufAppendNSExludingC(alternativeBuffer, wordLength, wordStart, '-');
|
||||
strbufAppendNSExcludingC(alternativeBuffer, wordLength, wordStart, '-');
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -195,16 +186,12 @@ void ffFontInitValues(FFfont* font, const char* name, const char* size)
|
||||
ffFontInit(font);
|
||||
|
||||
ffStrbufAppendS(&font->name, name);
|
||||
ffStrbufTrim(&font->name, '"');
|
||||
ffStrbufAppendS(&font->size, size);
|
||||
|
||||
fontInitPretty(font);
|
||||
}
|
||||
|
||||
void ffFontInitCopy(FFfont* font, const char* name)
|
||||
{
|
||||
ffFontInitValues(font, name, NULL);
|
||||
}
|
||||
|
||||
void ffFontInitWithSpace(FFfont* font, const char* rawName)
|
||||
{
|
||||
const char* pspace = strrchr(rawName, ' ');
|
||||
|
||||
+5
-1
@@ -14,7 +14,11 @@ typedef struct FFfont
|
||||
void ffFontInit(FFfont* font);
|
||||
void ffFontInitQt(FFfont* font, const char* data);
|
||||
void ffFontInitPango(FFfont* font, const char* data);
|
||||
void ffFontInitCopy(FFfont* font, const char* name);
|
||||
void ffFontInitValues(FFfont* font, const char* name, const char* size);
|
||||
void ffFontInitWithSpace(FFfont* font, const char* rawName);
|
||||
void ffFontDestroy(FFfont* font);
|
||||
|
||||
static inline void ffFontInitCopy(FFfont* font, const char* name)
|
||||
{
|
||||
ffFontInitValues(font, name, NULL);
|
||||
}
|
||||
|
||||
+1
-1
@@ -57,7 +57,7 @@ static inline uint32_t getArgumentIndex(const FFstrbuf* placeholderValue)
|
||||
uint32_t result = UINT32_MAX;
|
||||
|
||||
if(placeholderValue->chars[0] != '-')
|
||||
sscanf(placeholderValue->chars, "%u", &result);
|
||||
sscanf(placeholderValue->chars, "%" PRIu32, &result);
|
||||
|
||||
return result == 0 ? UINT32_MAX : result;
|
||||
}
|
||||
|
||||
@@ -24,3 +24,7 @@ typedef struct FFformatarg
|
||||
|
||||
void ffFormatAppendFormatArg(FFstrbuf* buffer, const FFformatarg* formatarg);
|
||||
void ffParseFormatString(FFstrbuf* buffer, const FFstrbuf* formatstr, uint32_t numArgs, const FFformatarg* arguments);
|
||||
#define FF_PARSE_FORMAT_STRING_CHECKED(buffer, formatstr, numArgs, arguments) do {\
|
||||
static_assert(sizeof(arguments) / sizeof(*(arguments)) == (numArgs), "Invalid number of format arguments");\
|
||||
ffParseFormatString((buffer), (formatstr), (numArgs), (arguments));\
|
||||
} while (0)
|
||||
|
||||
+12
-3
@@ -163,9 +163,6 @@ void ffListFeatures(void)
|
||||
#ifdef FF_HAVE_THREADS
|
||||
"threads\n"
|
||||
#endif
|
||||
#ifdef FF_HAVE_LIBPCI
|
||||
"libpci\n"
|
||||
#endif
|
||||
#ifdef FF_HAVE_VULKAN
|
||||
"vulkan\n"
|
||||
#endif
|
||||
@@ -244,6 +241,18 @@ void ffListFeatures(void)
|
||||
#ifdef FF_HAVE_DIRECTX_HEADERS
|
||||
"Directx Headers\n"
|
||||
#endif
|
||||
#ifdef FF_USE_PROPRIETARY_GPU_DRIVER_API
|
||||
"Proprietary GPU driver API\n"
|
||||
#endif
|
||||
#ifdef FF_USE_SYSTEM_YYJSON
|
||||
"System yyjson\n"
|
||||
#endif
|
||||
#if __has_include(<linux/videodev2.h>)
|
||||
"linux/videodev2\n"
|
||||
#endif
|
||||
#if __has_include(<linux/wireless.h>)
|
||||
"linux/wireless\n"
|
||||
#endif
|
||||
""
|
||||
, stdout);
|
||||
}
|
||||
|
||||
+17
-1
@@ -1,6 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "util/FFstrbuf.h"
|
||||
#include "util/FFlist.h"
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <fileapi.h>
|
||||
@@ -104,7 +105,7 @@ static inline bool ffPathExists(const char* path, FFPathType pathType)
|
||||
|
||||
unsigned int mode = fileStat.st_mode & S_IFMT;
|
||||
|
||||
if(pathType & FF_PATHTYPE_FILE && mode == S_IFREG)
|
||||
if(pathType & FF_PATHTYPE_FILE && mode != S_IFDIR)
|
||||
return true;
|
||||
|
||||
if(pathType & FF_PATHTYPE_DIRECTORY && mode == S_IFDIR)
|
||||
@@ -185,3 +186,18 @@ static inline bool wrapClosedir(HANDLE* pdir)
|
||||
}
|
||||
#endif
|
||||
#define FF_AUTO_CLOSE_DIR __attribute__((__cleanup__(wrapClosedir)))
|
||||
|
||||
static inline bool ffSearchUserConfigFile(const FFlist* configDirs, const char* fileSubpath, FFstrbuf* result)
|
||||
{
|
||||
// configDirs is a list of FFstrbufs include the trailing slash
|
||||
FF_LIST_FOR_EACH(FFstrbuf, dir, *configDirs)
|
||||
{
|
||||
ffStrbufClear(result);
|
||||
ffStrbufAppend(result, dir);
|
||||
ffStrbufAppendS(result, fileSubpath);
|
||||
if (ffPathExists(result->chars, FF_PATHTYPE_FILE))
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
+34
-31
@@ -1,6 +1,6 @@
|
||||
#include "io.h"
|
||||
#include "fastfetch.h"
|
||||
#include "util/stringUtils.h"
|
||||
#include "util/unused.h"
|
||||
|
||||
#include <fcntl.h>
|
||||
#include <termios.h>
|
||||
@@ -47,46 +47,46 @@ bool ffWriteFileData(const char* fileName, size_t dataSize, const void* data)
|
||||
return write(fd, data, dataSize) > 0;
|
||||
}
|
||||
|
||||
static inline void readWithLength(int fd, FFstrbuf* buffer, uint32_t length)
|
||||
{
|
||||
ffStrbufEnsureFixedLengthFree(buffer, length);
|
||||
ssize_t bytesRead = 0;
|
||||
while(
|
||||
length > 0 && (bytesRead = read(fd, buffer->chars + buffer->length, length)) > 0
|
||||
) {
|
||||
buffer->length += (uint32_t) bytesRead;
|
||||
length -= (uint32_t) bytesRead;
|
||||
}
|
||||
}
|
||||
|
||||
static inline void readUntilEOF(int fd, FFstrbuf* buffer)
|
||||
{
|
||||
ffStrbufEnsureFree(buffer, 31);
|
||||
uint32_t available = ffStrbufGetFree(buffer);
|
||||
ssize_t bytesRead = 0;
|
||||
while(
|
||||
(bytesRead = read(fd, buffer->chars + buffer->length, available)) > 0
|
||||
) {
|
||||
buffer->length += (uint32_t) bytesRead;
|
||||
if((uint32_t) bytesRead == available)
|
||||
ffStrbufEnsureFree(buffer, buffer->allocated - 1); // Doubles capacity every round. -1 for the null byte.
|
||||
available = ffStrbufGetFree(buffer);
|
||||
}
|
||||
}
|
||||
|
||||
bool ffAppendFDBuffer(int fd, FFstrbuf* buffer)
|
||||
{
|
||||
ssize_t bytesRead = 0;
|
||||
|
||||
struct stat fileInfo;
|
||||
if(fstat(fd, &fileInfo) != 0)
|
||||
return false;
|
||||
|
||||
if (fileInfo.st_size > 0)
|
||||
{
|
||||
// optimize for files has a fixed length,
|
||||
// file can be very large, only keep necessary memory to save time and resources.
|
||||
ffStrbufEnsureFixedLengthFree(buffer, (uint32_t)fileInfo.st_size);
|
||||
}
|
||||
readWithLength(fd, buffer, (uint32_t)fileInfo.st_size);
|
||||
else
|
||||
ffStrbufEnsureFree(buffer, 31);
|
||||
uint32_t free = ffStrbufGetFree(buffer);
|
||||
// procfs file's st_size is always zero
|
||||
// choose a signed int type so that can store a native number
|
||||
ssize_t remain = fileInfo.st_size;
|
||||
|
||||
while(
|
||||
(bytesRead = read(fd, buffer->chars + buffer->length, free)) > 0
|
||||
) {
|
||||
buffer->length += (uint32_t) bytesRead;
|
||||
// if remain > 0, it means there is some data left in the file.
|
||||
// if remain == 0, it means reading has completed, no need to grow up the buffer.
|
||||
// if remain < 0, we are reading a file from procfs/sysfs and its st_size is zero,
|
||||
// we cannot detect how many data remains in the file, we only can call ffStrbufEnsureFree and read again.
|
||||
remain -= bytesRead;
|
||||
if((uint32_t) bytesRead == free && remain != 0)
|
||||
ffStrbufEnsureFree(buffer, buffer->allocated - 1); // Doubles capacity every round. -1 for the null byte.
|
||||
free = ffStrbufGetFree(buffer);
|
||||
}
|
||||
readUntilEOF(fd, buffer);
|
||||
|
||||
buffer->chars[buffer->length] = '\0';
|
||||
|
||||
ffStrbufTrimRight(buffer, '\n');
|
||||
ffStrbufTrimRight(buffer, ' ');
|
||||
|
||||
return buffer->length > 0;
|
||||
}
|
||||
|
||||
@@ -115,7 +115,7 @@ bool ffPathExpandEnv(FF_MAYBE_UNUSED const char* in, FF_MAYBE_UNUSED FFstrbuf* o
|
||||
#if __has_include(<wordexp.h>) // https://github.com/termux/termux-packages/pull/7056
|
||||
|
||||
wordexp_t exp;
|
||||
if(wordexp(in, &exp, WRDE_NOCMD) != 0)
|
||||
if(wordexp(in, &exp, 0) != 0)
|
||||
return false;
|
||||
|
||||
if (exp.we_wordc == 1)
|
||||
@@ -133,6 +133,9 @@ bool ffPathExpandEnv(FF_MAYBE_UNUSED const char* in, FF_MAYBE_UNUSED FFstrbuf* o
|
||||
|
||||
const char* ffGetTerminalResponse(const char* request, const char* format, ...)
|
||||
{
|
||||
if (instance.config.display.pipe)
|
||||
return "Not supported in --pipe mode";
|
||||
|
||||
struct termios oldTerm, newTerm;
|
||||
if(tcgetattr(STDIN_FILENO, &oldTerm) == -1)
|
||||
return "tcgetattr(STDIN_FILENO, &oldTerm) failed";
|
||||
|
||||
+37
-26
@@ -1,4 +1,5 @@
|
||||
#include "io.h"
|
||||
#include "fastfetch.h"
|
||||
#include "util/stringUtils.h"
|
||||
|
||||
#include <windows.h>
|
||||
@@ -35,43 +36,50 @@ bool ffWriteFileData(const char* fileName, size_t dataSize, const void* data)
|
||||
return !!WriteFile(handle, data, (DWORD)dataSize, &written, NULL);
|
||||
}
|
||||
|
||||
static inline void readWithLength(HANDLE handle, FFstrbuf* buffer, uint32_t length)
|
||||
{
|
||||
ffStrbufEnsureFixedLengthFree(buffer, length);
|
||||
DWORD bytesRead = 0;
|
||||
while(
|
||||
length > 0 &&
|
||||
ReadFile(handle, buffer->chars + buffer->length, length, &bytesRead, NULL) != FALSE &&
|
||||
bytesRead > 0
|
||||
) {
|
||||
buffer->length += (uint32_t) bytesRead;
|
||||
length -= (uint32_t) bytesRead;
|
||||
}
|
||||
}
|
||||
|
||||
static inline void readUntilEOF(HANDLE handle, FFstrbuf* buffer)
|
||||
{
|
||||
ffStrbufEnsureFree(buffer, 31);
|
||||
uint32_t available = ffStrbufGetFree(buffer);
|
||||
DWORD bytesRead = 0;
|
||||
while(
|
||||
ReadFile(handle, buffer->chars + buffer->length, available, &bytesRead, NULL) != FALSE &&
|
||||
bytesRead > 0
|
||||
) {
|
||||
buffer->length += (uint32_t) bytesRead;
|
||||
if((uint32_t) bytesRead == available)
|
||||
ffStrbufEnsureFree(buffer, buffer->allocated - 1); // Doubles capacity every round. -1 for the null byte.
|
||||
available = ffStrbufGetFree(buffer);
|
||||
}
|
||||
}
|
||||
|
||||
bool ffAppendFDBuffer(HANDLE handle, FFstrbuf* buffer)
|
||||
{
|
||||
DWORD bytesRead = 0;
|
||||
|
||||
LARGE_INTEGER fileSize;
|
||||
if(!GetFileSizeEx(handle, &fileSize))
|
||||
fileSize.QuadPart = 0;
|
||||
|
||||
if (fileSize.QuadPart > 0)
|
||||
{
|
||||
// optimize for files has a fixed length,
|
||||
// file can be very large, only keep necessary memory to save time and resources.
|
||||
ffStrbufEnsureFixedLengthFree(buffer, (uint32_t)fileSize.QuadPart);
|
||||
}
|
||||
readWithLength(handle, buffer, (uint32_t)fileSize.QuadPart);
|
||||
else
|
||||
ffStrbufEnsureFree(buffer, 31);
|
||||
uint32_t free = ffStrbufGetFree(buffer);
|
||||
ssize_t remain = fileSize.QuadPart;
|
||||
|
||||
bool success;
|
||||
while(
|
||||
(success = !!ReadFile(handle, buffer->chars + buffer->length, free, &bytesRead, NULL)) &&
|
||||
bytesRead > 0
|
||||
) {
|
||||
buffer->length += (uint32_t) bytesRead;
|
||||
remain -= (ssize_t)bytesRead;
|
||||
if((uint32_t) bytesRead == free && remain != 0)
|
||||
ffStrbufEnsureFree(buffer, buffer->allocated - 1); // Doubles capacity every round. -1 for the null byte.
|
||||
free = ffStrbufGetFree(buffer);
|
||||
}
|
||||
readUntilEOF(handle, buffer);
|
||||
|
||||
buffer->chars[buffer->length] = '\0';
|
||||
|
||||
ffStrbufTrimRight(buffer, '\n');
|
||||
ffStrbufTrimRight(buffer, ' ');
|
||||
|
||||
return success;
|
||||
return buffer->length > 0;
|
||||
}
|
||||
|
||||
ssize_t ffReadFileData(const char* fileName, size_t dataSize, void* data)
|
||||
@@ -167,6 +175,9 @@ 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);
|
||||
|
||||
@@ -22,6 +22,11 @@ bool ffJsonConfigParseModuleArgs(const char* key, yyjson_val* val, FFModuleArgs*
|
||||
ffStrbufSetNS(&moduleArgs->outputFormat, (uint32_t) yyjson_get_len(val), yyjson_get_str(val));
|
||||
return true;
|
||||
}
|
||||
else if(ffStrEqualsIgnCase(key, "outputColor"))
|
||||
{
|
||||
ffOptionParseColor(yyjson_get_str(val), &moduleArgs->outputColor);
|
||||
return true;
|
||||
}
|
||||
else if(ffStrEqualsIgnCase(key, "keyColor"))
|
||||
{
|
||||
ffOptionParseColor(yyjson_get_str(val), &moduleArgs->keyColor);
|
||||
@@ -94,7 +99,7 @@ static inline void genJsonResult(FFModuleBaseInfo* baseInfo, yyjson_mut_doc* doc
|
||||
|
||||
static bool parseModuleJsonObject(const char* type, yyjson_val* jsonVal, yyjson_mut_doc* jsonDoc)
|
||||
{
|
||||
if(!isalpha(type[0])) return false;
|
||||
if(!ffCharIsEnglishAlphabet(type[0])) return false;
|
||||
|
||||
for (FFModuleBaseInfo** modules = ffModuleInfos[toupper(type[0]) - 'A']; *modules; ++modules)
|
||||
{
|
||||
@@ -235,6 +240,6 @@ void ffPrintJsonConfig(bool prepare, yyjson_mut_doc* jsonDoc)
|
||||
yyjson_mut_doc_set_root(jsonDoc, obj);
|
||||
}
|
||||
else
|
||||
ffPrintErrorString("JsonConfig", 0, NULL, FF_PRINT_TYPE_NO_CUSTOM_KEY, "%s", error);
|
||||
ffPrintError("JsonConfig", 0, NULL, FF_PRINT_TYPE_NO_CUSTOM_KEY, "%s", error);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#include <stdarg.h>
|
||||
|
||||
//Clang doesn't define __SANITIZE_ADDRESS__ but defines __has_feature(address_sanitizer)
|
||||
#if defined(__has_feature)
|
||||
#if !defined(__SANITIZE_ADDRESS__) && defined(__has_feature)
|
||||
#if __has_feature(address_sanitizer)
|
||||
#define __SANITIZE_ADDRESS__
|
||||
#endif
|
||||
|
||||
@@ -9,12 +9,14 @@ static FFModuleBaseInfo* B[] = {
|
||||
(void*) &instance.config.modules.bios,
|
||||
(void*) &instance.config.modules.bluetooth,
|
||||
(void*) &instance.config.modules.board,
|
||||
(void*) &instance.config.modules.bootmgr,
|
||||
(void*) &instance.config.modules.break_,
|
||||
(void*) &instance.config.modules.brightness,
|
||||
NULL,
|
||||
};
|
||||
|
||||
static FFModuleBaseInfo* C[] = {
|
||||
(void*) &instance.config.modules.camera,
|
||||
(void*) &instance.config.modules.chassis,
|
||||
(void*) &instance.config.modules.command,
|
||||
(void*) &instance.config.modules.colors,
|
||||
@@ -70,6 +72,7 @@ static FFModuleBaseInfo* K[] = {
|
||||
|
||||
static FFModuleBaseInfo* L[] = {
|
||||
(void*) &instance.config.modules.lm,
|
||||
(void*) &instance.config.modules.loadavg,
|
||||
(void*) &instance.config.modules.locale,
|
||||
(void*) &instance.config.modules.localIP,
|
||||
NULL,
|
||||
@@ -97,6 +100,7 @@ static FFModuleBaseInfo* O[] = {
|
||||
static FFModuleBaseInfo* P[] = {
|
||||
(void*) &instance.config.modules.packages,
|
||||
(void*) &instance.config.modules.physicalDisk,
|
||||
(void*) &instance.config.modules.physicalMemory,
|
||||
(void*) &instance.config.modules.player,
|
||||
(void*) &instance.config.modules.powerAdapter,
|
||||
(void*) &instance.config.modules.processes,
|
||||
@@ -124,6 +128,7 @@ static FFModuleBaseInfo* T[] = {
|
||||
(void*) &instance.config.modules.terminal,
|
||||
(void*) &instance.config.modules.terminalFont,
|
||||
(void*) &instance.config.modules.terminalSize,
|
||||
(void*) &instance.config.modules.terminalTheme,
|
||||
(void*) &instance.config.modules.title,
|
||||
(void*) &instance.config.modules.theme,
|
||||
NULL,
|
||||
|
||||
+5
-10
@@ -20,15 +20,10 @@ typedef struct FFNetworkingState {
|
||||
FFThreadType thread;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
uint32_t timeout;
|
||||
bool ipv6;
|
||||
} FFNetworkingState;
|
||||
|
||||
bool ffNetworkingSendHttpRequest(FFNetworkingState* state, const char* host, const char* path, const char* headers);
|
||||
bool ffNetworkingRecvHttpResponse(FFNetworkingState* state, FFstrbuf* buffer, uint32_t timeout);
|
||||
|
||||
static inline bool ffNetworkingGetHttp(const char* host, const char* path, uint32_t timeout, const char* headers, FFstrbuf* buffer)
|
||||
{
|
||||
FFNetworkingState state;
|
||||
if(ffNetworkingSendHttpRequest(&state, host, path, headers))
|
||||
return ffNetworkingRecvHttpResponse(&state, buffer, timeout);
|
||||
return false;
|
||||
}
|
||||
const char* ffNetworkingSendHttpRequest(FFNetworkingState* state, const char* host, const char* path, const char* headers);
|
||||
const char* ffNetworkingRecvHttpResponse(FFNetworkingState* state, FFstrbuf* buffer);
|
||||
|
||||
@@ -5,30 +5,50 @@
|
||||
#include <sys/time.h>
|
||||
#include <sys/socket.h>
|
||||
#include <netdb.h>
|
||||
#include <netinet/in.h> // For FreeBSD
|
||||
#include <netinet/tcp.h>
|
||||
|
||||
static void connectAndSend(FFNetworkingState* state)
|
||||
static const char* connectAndSend(FFNetworkingState* state)
|
||||
{
|
||||
struct addrinfo hints = {
|
||||
.ai_family = AF_INET,
|
||||
.ai_socktype = SOCK_STREAM,
|
||||
};
|
||||
|
||||
const char* ret = NULL;
|
||||
struct addrinfo* addr;
|
||||
|
||||
if(getaddrinfo(state->host.chars, "80", &hints, &addr) != 0)
|
||||
if(getaddrinfo(state->host.chars, "80", &(struct addrinfo) {
|
||||
.ai_family = state->ipv6 ? AF_INET6 : AF_INET,
|
||||
.ai_socktype = SOCK_STREAM,
|
||||
}, &addr) != 0)
|
||||
{
|
||||
ret = "getaddrinfo() failed";
|
||||
goto error;
|
||||
}
|
||||
|
||||
state->sockfd = socket(addr->ai_family, addr->ai_socktype, addr->ai_protocol);
|
||||
if(state->sockfd == -1)
|
||||
{
|
||||
freeaddrinfo(addr);
|
||||
ret = "socket() failed";
|
||||
goto error;
|
||||
}
|
||||
|
||||
if (state->timeout > 0)
|
||||
{
|
||||
FF_MAYBE_UNUSED uint32_t sec = state->timeout / 1000;
|
||||
if (sec == 0) sec = 1;
|
||||
|
||||
#ifdef TCP_CONNECTIONTIMEOUT
|
||||
setsockopt(state->sockfd, IPPROTO_TCP, TCP_CONNECTIONTIMEOUT, &sec, sizeof(sec));
|
||||
#elif defined(TCP_KEEPINIT)
|
||||
setsockopt(state->sockfd, IPPROTO_TCP, TCP_KEEPINIT, &sec, sizeof(sec));
|
||||
#elif defined(TCP_USER_TIMEOUT)
|
||||
setsockopt(state->sockfd, IPPROTO_TCP, TCP_USER_TIMEOUT, &state->timeout, sizeof(state->timeout));
|
||||
#endif
|
||||
}
|
||||
|
||||
if(connect(state->sockfd, addr->ai_addr, addr->ai_addrlen) == -1)
|
||||
{
|
||||
close(state->sockfd);
|
||||
freeaddrinfo(addr);
|
||||
ret = "connect() failed";
|
||||
goto error;
|
||||
}
|
||||
|
||||
@@ -37,6 +57,7 @@ static void connectAndSend(FFNetworkingState* state)
|
||||
if(send(state->sockfd, state->command.chars, state->command.length, 0) < 0)
|
||||
{
|
||||
close(state->sockfd);
|
||||
ret = "send() failed";
|
||||
goto error;
|
||||
}
|
||||
|
||||
@@ -48,11 +69,13 @@ error:
|
||||
exit:
|
||||
ffStrbufDestroy(&state->host);
|
||||
ffStrbufDestroy(&state->command);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
FF_THREAD_ENTRY_DECL_WRAPPER(connectAndSend, FFNetworkingState*);
|
||||
|
||||
bool ffNetworkingSendHttpRequest(FFNetworkingState* state, const char* host, const char* path, const char* headers)
|
||||
const char* ffNetworkingSendHttpRequest(FFNetworkingState* state, const char* host, const char* path, const char* headers)
|
||||
{
|
||||
ffStrbufInitS(&state->host, host);
|
||||
|
||||
@@ -66,22 +89,30 @@ bool ffNetworkingSendHttpRequest(FFNetworkingState* state, const char* host, con
|
||||
ffStrbufAppendS(&state->command, "\r\n");
|
||||
|
||||
#ifdef FF_HAVE_THREADS
|
||||
if (instance.config.general.multithreading)
|
||||
{
|
||||
state->thread = ffThreadCreate(connectAndSendThreadMain, state);
|
||||
return !!state->thread;
|
||||
#else
|
||||
connectAndSend(state);
|
||||
return state->sockfd != -1;
|
||||
return state->thread ? NULL : "ffThreadCreate(connectAndSend) failed";
|
||||
}
|
||||
#endif
|
||||
|
||||
return connectAndSend(state);
|
||||
}
|
||||
|
||||
bool ffNetworkingRecvHttpResponse(FFNetworkingState* state, FFstrbuf* buffer, uint32_t timeout)
|
||||
const char* ffNetworkingRecvHttpResponse(FFNetworkingState* state, FFstrbuf* buffer)
|
||||
{
|
||||
uint32_t timeout = state->timeout;
|
||||
|
||||
#ifdef FF_HAVE_THREADS
|
||||
if (instance.config.general.multithreading)
|
||||
{
|
||||
if (!ffThreadJoin(state->thread, timeout))
|
||||
return false;
|
||||
return "ffThreadJoin() failed or timeout";
|
||||
}
|
||||
#endif
|
||||
|
||||
if(state->sockfd == -1)
|
||||
return false;
|
||||
return "ffNetworkingSendHttpRequest() failed";
|
||||
|
||||
if(timeout > 0)
|
||||
{
|
||||
@@ -91,14 +122,15 @@ bool ffNetworkingRecvHttpResponse(FFNetworkingState* state, FFstrbuf* buffer, ui
|
||||
setsockopt(state->sockfd, SOL_SOCKET, SO_RCVTIMEO, &timev, sizeof(timev));
|
||||
}
|
||||
|
||||
ssize_t received = recv(state->sockfd, buffer->chars + buffer->length, ffStrbufGetFree(buffer), 0);
|
||||
|
||||
if(received > 0)
|
||||
{
|
||||
uint32_t recvStart;
|
||||
do {
|
||||
recvStart = buffer->length;
|
||||
ssize_t received = recv(state->sockfd, buffer->chars + buffer->length, ffStrbufGetFree(buffer), 0);
|
||||
if (received <= 0) break;
|
||||
buffer->length += (uint32_t) received;
|
||||
buffer->chars[buffer->length] = '\0';
|
||||
}
|
||||
} while (ffStrbufGetFree(buffer) > 0 && strstr(buffer->chars + recvStart, "\r\n\r\n") == NULL);
|
||||
|
||||
close(state->sockfd);
|
||||
return ffStrbufStartsWithS(buffer, "HTTP/1.1 200 OK\r\n");
|
||||
return ffStrbufStartsWithS(buffer, "HTTP/1.1 200 OK\r\n") ? NULL : "Invalid response";
|
||||
}
|
||||
|
||||
@@ -7,22 +7,18 @@
|
||||
|
||||
static LPFN_CONNECTEX ConnectEx;
|
||||
|
||||
static BOOL WINAPI initWsaData(PINIT_ONCE once, PVOID param, PVOID* context)
|
||||
static const char* initWsaData(WSADATA* wsaData)
|
||||
{
|
||||
(void)once;
|
||||
(void)param;
|
||||
static WSADATA wsaData;
|
||||
*context = &wsaData;
|
||||
if(WSAStartup(MAKEWORD(2, 2), &wsaData) != 0)
|
||||
return FALSE;
|
||||
if(WSAStartup(MAKEWORD(2, 2), wsaData) != 0)
|
||||
return "WSAStartup() failed";
|
||||
|
||||
if(LOBYTE(wsaData.wVersion) != 2 || HIBYTE(wsaData.wVersion) != 2)
|
||||
return FALSE;
|
||||
if(LOBYTE(wsaData->wVersion) != 2 || HIBYTE(wsaData->wVersion) != 2)
|
||||
return "Invalid wsaData version found";
|
||||
|
||||
//Dummy socket needed for WSAIoctl
|
||||
SOCKET sockfd = socket(AF_INET, SOCK_STREAM, 0);
|
||||
if(sockfd == INVALID_SOCKET)
|
||||
return FALSE;
|
||||
return "socket(AF_INET, SOCK_STREAM) failed";
|
||||
|
||||
DWORD dwBytes;
|
||||
GUID guid = WSAID_CONNECTEX;
|
||||
@@ -30,48 +26,55 @@ static BOOL WINAPI initWsaData(PINIT_ONCE once, PVOID param, PVOID* context)
|
||||
&guid, sizeof(guid),
|
||||
&ConnectEx, sizeof(ConnectEx),
|
||||
&dwBytes, NULL, NULL) != 0)
|
||||
return FALSE;
|
||||
return "WSAIoctl(sockfd, SIO_GET_EXTENSION_FUNCTION_POINTER) failed";
|
||||
|
||||
return closesocket(sockfd) == 0;
|
||||
closesocket(sockfd);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
bool ffNetworkingSendHttpRequest(FFNetworkingState* state, const char* host, const char* path, const char* headers)
|
||||
const char* ffNetworkingSendHttpRequest(FFNetworkingState* state, const char* host, const char* path, const char* headers)
|
||||
{
|
||||
static INIT_ONCE once = INIT_ONCE_STATIC_INIT;
|
||||
WSADATA* pData;
|
||||
if(!InitOnceExecuteOnce(&once, initWsaData, NULL, (LPVOID*) &pData))
|
||||
return false;
|
||||
|
||||
memset(state, 0, sizeof(*state));
|
||||
|
||||
struct addrinfo hints = {
|
||||
.ai_family = AF_INET,
|
||||
.ai_socktype = SOCK_STREAM,
|
||||
};
|
||||
static WSADATA wsaData;
|
||||
if (wsaData.wVersion == 0)
|
||||
{
|
||||
const char* error = initWsaData(&wsaData);
|
||||
if (error != NULL)
|
||||
{
|
||||
wsaData.wVersion = (WORD) -1;
|
||||
return error;
|
||||
}
|
||||
}
|
||||
else if (wsaData.wVersion == (WORD) -1)
|
||||
return "initWsaData() failed before";
|
||||
|
||||
struct addrinfo* addr;
|
||||
|
||||
if(getaddrinfo(host, "80", &hints, &addr) != 0)
|
||||
return false;
|
||||
if(getaddrinfo(host, "80", &(struct addrinfo) {
|
||||
.ai_family = state->ipv6 ? AF_INET6 : AF_INET,
|
||||
.ai_socktype = SOCK_STREAM,
|
||||
}, &addr) != 0)
|
||||
return "getaddrinfo() failed";
|
||||
|
||||
state->sockfd = socket(addr->ai_family, addr->ai_socktype, addr->ai_protocol);
|
||||
if(state->sockfd == INVALID_SOCKET)
|
||||
{
|
||||
freeaddrinfo(addr);
|
||||
return false;
|
||||
return "socket() failed";
|
||||
}
|
||||
|
||||
{
|
||||
//ConnectEx requires the socket to be initially bound
|
||||
struct sockaddr_in addr = {
|
||||
if(bind(state->sockfd, (SOCKADDR *) &(struct sockaddr_in) {
|
||||
.sin_family = AF_INET,
|
||||
.sin_addr.s_addr = INADDR_ANY,
|
||||
.sin_port = 0,
|
||||
};
|
||||
if(bind(state->sockfd, (SOCKADDR *)&addr, sizeof(addr)) != 0)
|
||||
}, sizeof(struct sockaddr_in)) != 0)
|
||||
{
|
||||
printf("bind %d\n", WSAGetLastError());
|
||||
return false;
|
||||
closesocket(state->sockfd);
|
||||
freeaddrinfo(addr);
|
||||
state->sockfd = INVALID_SOCKET;
|
||||
return "bind() failed";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -90,35 +93,52 @@ bool ffNetworkingSendHttpRequest(FFNetworkingState* state, const char* host, con
|
||||
if(!result && WSAGetLastError() != WSA_IO_PENDING)
|
||||
{
|
||||
closesocket(state->sockfd);
|
||||
return false;
|
||||
freeaddrinfo(addr);
|
||||
state->sockfd = INVALID_SOCKET;
|
||||
return "ConnectEx() failed";
|
||||
}
|
||||
|
||||
return true;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
bool ffNetworkingRecvHttpResponse(FFNetworkingState* state, FFstrbuf* buffer, uint32_t timeout)
|
||||
const char* ffNetworkingRecvHttpResponse(FFNetworkingState* state, FFstrbuf* buffer)
|
||||
{
|
||||
if (state->sockfd == INVALID_SOCKET)
|
||||
return "ffNetworkingSendHttpRequest() failed";
|
||||
|
||||
uint32_t timeout = state->timeout;
|
||||
if (timeout > 0)
|
||||
{
|
||||
if (WaitForSingleObject((HANDLE) state->sockfd, timeout) != WAIT_OBJECT_0)
|
||||
{
|
||||
CancelIo((HANDLE) state->sockfd);
|
||||
closesocket(state->sockfd);
|
||||
return "WaitForSingleObject(state->sockfd) failed or timeout";
|
||||
}
|
||||
}
|
||||
|
||||
DWORD transfer, flags;
|
||||
if (!WSAGetOverlappedResult(state->sockfd, &state->overlapped, &transfer, TRUE, &flags))
|
||||
{
|
||||
closesocket(state->sockfd);
|
||||
return false;
|
||||
return "WSAGetOverlappedResult() failed";
|
||||
}
|
||||
|
||||
if(timeout > 0)
|
||||
{
|
||||
//https://learn.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-setsockopt
|
||||
setsockopt(state->sockfd, SOL_SOCKET, SO_RCVTIMEO, (const char*)&timeout, sizeof(timeout));
|
||||
setsockopt(state->sockfd, SOL_SOCKET, SO_RCVTIMEO, (const char*) &timeout, sizeof(timeout));
|
||||
}
|
||||
|
||||
ssize_t received = recv(state->sockfd, buffer->chars + buffer->length, (int)ffStrbufGetFree(buffer), 0);
|
||||
|
||||
if(received > 0)
|
||||
{
|
||||
buffer->length += (uint32_t) received;
|
||||
uint32_t recvStart;
|
||||
do {
|
||||
recvStart = buffer->length;
|
||||
ssize_t received = recv(state->sockfd, buffer->chars + buffer->length, (int) ffStrbufGetFree(buffer), 0);
|
||||
if (received <= 0) break;
|
||||
buffer->length = recvStart + (uint32_t) received;
|
||||
buffer->chars[buffer->length] = '\0';
|
||||
}
|
||||
} while (ffStrbufGetFree(buffer) > 0 && strstr(buffer->chars + recvStart, "\r\n\r\n") == NULL);
|
||||
|
||||
closesocket(state->sockfd);
|
||||
return ffStrbufStartsWithS(buffer, "HTTP/1.1 200 OK\r\n");
|
||||
return ffStrbufStartsWithS(buffer, "HTTP/1.1 200 OK\r\n") ? NULL : "Invalid response";
|
||||
}
|
||||
|
||||
+19
-1
@@ -39,6 +39,16 @@ bool ffOptionParseModuleArgs(const char* argumentKey, const char* subKey, const
|
||||
ffOptionParseString(argumentKey, value, &result->outputFormat);
|
||||
return true;
|
||||
}
|
||||
else if(ffStrEqualsIgnCase(subKey, "output-color"))
|
||||
{
|
||||
if(value == NULL)
|
||||
{
|
||||
fprintf(stderr, "Error: usage: %s <str>\n", argumentKey);
|
||||
exit(477);
|
||||
}
|
||||
ffOptionParseColor(value, &result->outputColor);
|
||||
return true;
|
||||
}
|
||||
else if(ffStrEqualsIgnCase(subKey, "key-color"))
|
||||
{
|
||||
if(value == NULL)
|
||||
@@ -143,11 +153,17 @@ void ffOptionParseColor(const char* value, FFstrbuf* buffer)
|
||||
while(*value != '\0')
|
||||
{
|
||||
#define FF_APPEND_COLOR_CODE_COND(prefix, code) \
|
||||
if(strncasecmp(value, #prefix, strlen(#prefix)) == 0) { ffStrbufAppendS(buffer, code); value += strlen(#prefix); }
|
||||
if(ffStrStartsWithIgnCase(value, #prefix)) { ffStrbufAppendS(buffer, code); value += strlen(#prefix); }
|
||||
|
||||
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)
|
||||
@@ -180,6 +196,7 @@ void ffOptionInitModuleArg(FFModuleArgs* args)
|
||||
ffStrbufInit(&args->key);
|
||||
ffStrbufInit(&args->keyColor);
|
||||
ffStrbufInit(&args->outputFormat);
|
||||
ffStrbufInit(&args->outputColor);
|
||||
args->keyWidth = 0;
|
||||
}
|
||||
|
||||
@@ -188,4 +205,5 @@ void ffOptionDestroyModuleArg(FFModuleArgs* args)
|
||||
ffStrbufDestroy(&args->key);
|
||||
ffStrbufDestroy(&args->keyColor);
|
||||
ffStrbufDestroy(&args->outputFormat);
|
||||
ffStrbufDestroy(&args->outputColor);
|
||||
}
|
||||
|
||||
@@ -50,6 +50,7 @@ typedef struct FFModuleArgs
|
||||
FFstrbuf key;
|
||||
FFstrbuf keyColor;
|
||||
FFstrbuf outputFormat;
|
||||
FFstrbuf outputColor;
|
||||
uint32_t keyWidth;
|
||||
} FFModuleArgs;
|
||||
|
||||
|
||||
+5
-21
@@ -96,39 +96,23 @@ void ffParseSize(uint64_t bytes, FFstrbuf* result)
|
||||
}
|
||||
}
|
||||
|
||||
void ffParseTemperature(double celsius, FFstrbuf* buffer)
|
||||
{
|
||||
switch (instance.config.display.temperatureUnit)
|
||||
{
|
||||
case FF_TEMPERATURE_UNIT_CELSIUS:
|
||||
ffStrbufAppendF(buffer, "%.1f°C", celsius);
|
||||
break;
|
||||
case FF_TEMPERATURE_UNIT_FAHRENHEIT:
|
||||
ffStrbufAppendF(buffer, "%.1f°F", celsius * 1.8 + 32);
|
||||
break;
|
||||
case FF_TEMPERATURE_UNIT_KELVIN:
|
||||
ffStrbufAppendF(buffer, "%.1f K", celsius + 273.15);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void ffParseGTK(FFstrbuf* buffer, const FFstrbuf* gtk2, const FFstrbuf* gtk3, const FFstrbuf* gtk4)
|
||||
{
|
||||
if(gtk2->length > 0 && gtk3->length > 0 && gtk4->length > 0)
|
||||
{
|
||||
if((ffStrbufIgnCaseComp(gtk2, gtk3) == 0) && (ffStrbufIgnCaseComp(gtk2, gtk4) == 0))
|
||||
if((ffStrbufIgnCaseEqual(gtk2, gtk3)) && (ffStrbufIgnCaseEqual(gtk2, gtk4)))
|
||||
{
|
||||
ffStrbufAppend(buffer, gtk4);
|
||||
ffStrbufAppendS(buffer, " [GTK2/3/4]");
|
||||
}
|
||||
else if(ffStrbufIgnCaseComp(gtk2, gtk3) == 0)
|
||||
else if(ffStrbufIgnCaseEqual(gtk2, gtk3))
|
||||
{
|
||||
ffStrbufAppend(buffer, gtk3);
|
||||
ffStrbufAppendS(buffer, " [GTK2/3], ");
|
||||
ffStrbufAppend(buffer, gtk4);
|
||||
ffStrbufAppendS(buffer, " [GTK4]");
|
||||
}
|
||||
else if(ffStrbufIgnCaseComp(gtk3, gtk4) == 0)
|
||||
else if(ffStrbufIgnCaseEqual(gtk3, gtk4))
|
||||
{
|
||||
ffStrbufAppend(buffer, gtk2);
|
||||
ffStrbufAppendS(buffer, " [GTK2], ");
|
||||
@@ -147,7 +131,7 @@ void ffParseGTK(FFstrbuf* buffer, const FFstrbuf* gtk2, const FFstrbuf* gtk3, co
|
||||
}
|
||||
else if(gtk2->length > 0 && gtk3->length > 0)
|
||||
{
|
||||
if(ffStrbufIgnCaseComp(gtk2, gtk3) == 0)
|
||||
if(ffStrbufIgnCaseEqual(gtk2, gtk3))
|
||||
{
|
||||
ffStrbufAppend(buffer, gtk3);
|
||||
ffStrbufAppendS(buffer, " [GTK2/3]");
|
||||
@@ -162,7 +146,7 @@ void ffParseGTK(FFstrbuf* buffer, const FFstrbuf* gtk2, const FFstrbuf* gtk3, co
|
||||
}
|
||||
else if(gtk3->length > 0 && gtk4->length > 0)
|
||||
{
|
||||
if(ffStrbufIgnCaseComp(gtk3, gtk4) == 0)
|
||||
if(ffStrbufIgnCaseEqual(gtk3, gtk4))
|
||||
{
|
||||
ffStrbufAppend(buffer, gtk4);
|
||||
ffStrbufAppendS(buffer, " [GTK3/4]");
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include "fastfetch.h"
|
||||
#include "util/FFstrbuf.h"
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
@@ -11,6 +11,12 @@ typedef struct FFVersion
|
||||
uint32_t patch;
|
||||
} FFVersion;
|
||||
|
||||
typedef struct FFColorRangeConfig
|
||||
{
|
||||
uint8_t green;
|
||||
uint8_t yellow;
|
||||
} FFColorRangeConfig;
|
||||
|
||||
#define FF_VERSION_INIT ((FFVersion) {0})
|
||||
|
||||
void ffParseSemver(FFstrbuf* buffer, const FFstrbuf* major, const FFstrbuf* minor, const FFstrbuf* patch);
|
||||
@@ -20,4 +26,3 @@ void ffVersionToPretty(const FFVersion* version, FFstrbuf* pretty);
|
||||
int8_t ffVersionCompare(const FFVersion* version1, const FFVersion* version2);
|
||||
|
||||
void ffParseSize(uint64_t bytes, FFstrbuf* result);
|
||||
void ffParseTemperature(double celsius, FFstrbuf* buffer);
|
||||
|
||||
@@ -0,0 +1,223 @@
|
||||
#include "fastfetch.h"
|
||||
#include "common/percent.h"
|
||||
#include "common/color.h"
|
||||
#include "common/option.h"
|
||||
#include "common/jsonconfig.h"
|
||||
#include "util/textModifier.h"
|
||||
#include "util/stringUtils.h"
|
||||
|
||||
static void appendOutputColor(FFstrbuf* buffer, const FFModuleArgs* module)
|
||||
{
|
||||
if (module->outputColor.length)
|
||||
ffStrbufAppendF(buffer, "\e[%sm", module->outputColor.chars);
|
||||
else if (instance.config.display.colorOutput.length)
|
||||
ffStrbufAppendF(buffer, "\e[%sm", instance.config.display.colorOutput.chars);
|
||||
}
|
||||
|
||||
void ffPercentAppendBar(FFstrbuf* buffer, double percent, FFColorRangeConfig config, const FFModuleArgs* module)
|
||||
{
|
||||
uint8_t green = config.green, yellow = config.yellow;
|
||||
assert(green <= 100 && yellow <= 100);
|
||||
|
||||
const FFOptionsDisplay* options = &instance.config.display;
|
||||
|
||||
uint32_t blocksPercent = (uint32_t) (percent / 100.0 * options->barWidth + 0.5);
|
||||
assert(blocksPercent <= options->barWidth);
|
||||
|
||||
if(options->barBorder)
|
||||
{
|
||||
if(!options->pipe)
|
||||
ffStrbufAppendS(buffer, "\e[" FF_COLOR_FG_LIGHT_WHITE "m[ ");
|
||||
else
|
||||
ffStrbufAppendS(buffer, "[ ");
|
||||
}
|
||||
|
||||
if (percent != percent)
|
||||
{
|
||||
if(!options->pipe)
|
||||
ffStrbufAppendS(buffer, "\e[" FF_COLOR_FG_LIGHT_BLACK "m");
|
||||
|
||||
for (uint32_t i = 0; i < options->barWidth; ++i)
|
||||
ffStrbufAppend(buffer, &options->barCharElapsed);
|
||||
}
|
||||
else
|
||||
{
|
||||
const char* colorGreen = instance.config.display.percentColorGreen.chars;
|
||||
const char* colorYellow = instance.config.display.percentColorYellow.chars;
|
||||
const char* colorRed = instance.config.display.percentColorRed.chars;
|
||||
|
||||
for (uint32_t i = 0; i < blocksPercent; ++i)
|
||||
{
|
||||
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));
|
||||
}
|
||||
ffStrbufAppend(buffer, &options->barCharElapsed);
|
||||
}
|
||||
|
||||
if (blocksPercent < options->barWidth)
|
||||
{
|
||||
if(!options->pipe)
|
||||
ffStrbufAppendS(buffer, "\e[" FF_COLOR_FG_LIGHT_WHITE "m");
|
||||
for (uint32_t i = blocksPercent; i < options->barWidth; ++i)
|
||||
ffStrbufAppend(buffer, &options->barCharTotal);
|
||||
}
|
||||
}
|
||||
|
||||
if(options->barBorder)
|
||||
{
|
||||
if(!options->pipe)
|
||||
ffStrbufAppendS(buffer, "\e[" FF_COLOR_FG_LIGHT_WHITE "m ]");\
|
||||
else
|
||||
ffStrbufAppendS(buffer, " ]");
|
||||
}
|
||||
|
||||
if(!options->pipe)
|
||||
{
|
||||
ffStrbufAppendS(buffer, FASTFETCH_TEXT_MODIFIER_RESET);
|
||||
appendOutputColor(buffer, module);
|
||||
}
|
||||
}
|
||||
|
||||
void ffPercentAppendNum(FFstrbuf* buffer, double percent, FFColorRangeConfig config, bool parentheses, const FFModuleArgs* module)
|
||||
{
|
||||
uint8_t green = config.green, yellow = config.yellow;
|
||||
assert(green <= 100 && yellow <= 100);
|
||||
|
||||
const FFOptionsDisplay* options = &instance.config.display;
|
||||
|
||||
bool colored = !!(options->percentType & FF_PERCENTAGE_TYPE_NUM_COLOR_BIT);
|
||||
|
||||
if (parentheses)
|
||||
ffStrbufAppendC(buffer, '(');
|
||||
|
||||
if (colored && !options->pipe)
|
||||
{
|
||||
const char* colorGreen = options->percentColorGreen.chars;
|
||||
const char* colorYellow = options->percentColorYellow.chars;
|
||||
const char* colorRed = options->percentColorRed.chars;
|
||||
|
||||
if(percent != percent)
|
||||
ffStrbufAppendS(buffer, "\e[" FF_COLOR_FG_LIGHT_BLACK "m");
|
||||
else if(green <= yellow)
|
||||
{
|
||||
if (percent > yellow)
|
||||
ffStrbufAppendF(buffer, "\e[%sm", colorRed);
|
||||
else if (percent > green)
|
||||
ffStrbufAppendF(buffer, "\e[%sm", colorYellow);
|
||||
else
|
||||
ffStrbufAppendF(buffer, "\e[%sm", colorGreen);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
if (percent < yellow)
|
||||
ffStrbufAppendF(buffer, "\e[%sm", colorRed);
|
||||
else if (percent < green)
|
||||
ffStrbufAppendF(buffer, "\e[%sm", colorYellow);
|
||||
else
|
||||
ffStrbufAppendF(buffer, "\e[%sm", colorGreen);
|
||||
}
|
||||
}
|
||||
ffStrbufAppendF(buffer, "%.*f%%", options->percentNdigits, percent);
|
||||
|
||||
if (colored && !options->pipe)
|
||||
{
|
||||
ffStrbufAppendS(buffer, FASTFETCH_TEXT_MODIFIER_RESET);
|
||||
appendOutputColor(buffer, module);
|
||||
}
|
||||
|
||||
if (parentheses)
|
||||
ffStrbufAppendC(buffer, ')');
|
||||
}
|
||||
|
||||
bool ffPercentParseCommandOptions(const char* key, const char* subkey, const char* value, FFColorRangeConfig* config)
|
||||
{
|
||||
if (!ffStrStartsWithIgnCase(subkey, "percent-"))
|
||||
return false;
|
||||
|
||||
subkey += strlen("percent-");
|
||||
|
||||
if (ffStrEqualsIgnCase(subkey, "green"))
|
||||
{
|
||||
uint32_t num = ffOptionParseUInt32(key, value);
|
||||
if (num > 100)
|
||||
{
|
||||
fprintf(stderr, "Error: usage: %s must be between 0 and 100\n", key);
|
||||
exit(480);
|
||||
}
|
||||
config->green = (uint8_t) num;
|
||||
return true;
|
||||
}
|
||||
|
||||
if (ffStrEqualsIgnCase(subkey, "yellow"))
|
||||
{
|
||||
uint32_t num = ffOptionParseUInt32(key, value);
|
||||
if (num > 100)
|
||||
{
|
||||
fprintf(stderr, "Error: usage: %s must be between 0 and 100\n", key);
|
||||
exit(480);
|
||||
}
|
||||
config->yellow = (uint8_t) num;
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool ffPercentParseJsonObject(const char* key, yyjson_val* value, FFColorRangeConfig* config)
|
||||
{
|
||||
if (!ffStrEqualsIgnCase(key, "percent"))
|
||||
return false;
|
||||
|
||||
if (!yyjson_is_obj(value))
|
||||
{
|
||||
fprintf(stderr, "Error: usage: %s must be an object\n", key);
|
||||
exit(480);
|
||||
}
|
||||
|
||||
yyjson_val* greenVal = yyjson_obj_get(value, "green");
|
||||
if (greenVal)
|
||||
{
|
||||
int num = yyjson_get_int(greenVal);
|
||||
if (num < 0 || num > 100)
|
||||
{
|
||||
fputs("Error: usage: percent.green must be between 0 and 100\n", stderr);
|
||||
exit(480);
|
||||
}
|
||||
config->green = (uint8_t) num;
|
||||
}
|
||||
|
||||
yyjson_val* yellowVal = yyjson_obj_get(value, "yellow");
|
||||
if (yellowVal)
|
||||
{
|
||||
int num = yyjson_get_int(yellowVal);
|
||||
if (num < 0 || num > 100)
|
||||
{
|
||||
fputs("Error: usage: percent.yellow must be between 0 and 100\n", stderr);
|
||||
exit(480);
|
||||
}
|
||||
config->yellow = (uint8_t) num;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void ffPercentGenerateJsonConfig(yyjson_mut_doc* doc, yyjson_mut_val* module, FFColorRangeConfig defaultConfig, FFColorRangeConfig config)
|
||||
{
|
||||
if (config.green == defaultConfig.green && config.yellow == defaultConfig.yellow)
|
||||
return;
|
||||
|
||||
yyjson_mut_val* percent = yyjson_mut_obj_add_obj(doc, module, "percent");
|
||||
if (config.green != defaultConfig.green)
|
||||
yyjson_mut_obj_add_uint(doc, percent, "green", config.green);
|
||||
if (config.yellow != defaultConfig.yellow)
|
||||
yyjson_mut_obj_add_uint(doc, percent, "yellow", config.yellow);
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
#pragma once
|
||||
|
||||
#include "util/FFstrbuf.h"
|
||||
#include "common/parsing.h"
|
||||
#include "common/option.h"
|
||||
|
||||
enum
|
||||
{
|
||||
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,
|
||||
};
|
||||
|
||||
// if (green <= yellow)
|
||||
// [0, green]: print green
|
||||
// (green, yellow]: print yellow
|
||||
// (yellow, 100]: print red
|
||||
//
|
||||
// if (green > yellow)
|
||||
// [green, 100]: print green
|
||||
// [yellow, green): print yellow
|
||||
// [0, yellow): print red
|
||||
|
||||
void ffPercentAppendBar(FFstrbuf* buffer, double percent, FFColorRangeConfig config, const FFModuleArgs* module);
|
||||
void ffPercentAppendNum(FFstrbuf* buffer, double percent, FFColorRangeConfig config, bool parentheses, const FFModuleArgs* module);
|
||||
|
||||
typedef struct yyjson_val yyjson_val;
|
||||
typedef struct yyjson_mut_doc yyjson_mut_doc;
|
||||
typedef struct yyjson_mut_val yyjson_mut_val;
|
||||
bool ffPercentParseCommandOptions(const char* key, const char* subkey, const char* value, FFColorRangeConfig* config);
|
||||
bool ffPercentParseJsonObject(const char* key, yyjson_val* value, FFColorRangeConfig* config);
|
||||
void ffPercentGenerateJsonConfig(yyjson_mut_doc* doc, yyjson_mut_val* module, FFColorRangeConfig defaultConfig, FFColorRangeConfig config);
|
||||
+10
-13
@@ -37,9 +37,9 @@ void ffPrintLogoAndKey(const char* moduleName, uint8_t moduleIndex, const FFModu
|
||||
else
|
||||
{
|
||||
FF_STRBUF_AUTO_DESTROY key = ffStrbufCreate();
|
||||
ffParseFormatString(&key, &moduleArgs->key, 1, (FFformatarg[]){
|
||||
FF_PARSE_FORMAT_STRING_CHECKED(&key, &moduleArgs->key, 1, ((FFformatarg[]){
|
||||
{FF_FORMAT_ARG_TYPE_UINT8, &moduleIndex}
|
||||
});
|
||||
}));
|
||||
ffStrbufWriteTo(&key, stdout);
|
||||
}
|
||||
|
||||
@@ -49,8 +49,13 @@ void ffPrintLogoAndKey(const char* moduleName, uint8_t moduleIndex, const FFModu
|
||||
ffStrbufWriteTo(&instance.config.display.keyValueSeparator, stdout);
|
||||
|
||||
if(!instance.config.display.pipe)
|
||||
{
|
||||
fputs(FASTFETCH_TEXT_MODIFIER_RESET, stdout);
|
||||
|
||||
if (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))
|
||||
{
|
||||
@@ -60,7 +65,7 @@ void ffPrintLogoAndKey(const char* moduleName, uint8_t moduleIndex, const FFModu
|
||||
}
|
||||
}
|
||||
|
||||
void ffPrintFormatString(const char* moduleName, uint8_t moduleIndex, const FFModuleArgs* moduleArgs, FFPrintType printType, uint32_t numArgs, const FFformatarg* arguments)
|
||||
void ffPrintFormat(const char* moduleName, uint8_t moduleIndex, const FFModuleArgs* moduleArgs, FFPrintType printType, uint32_t numArgs, const FFformatarg* arguments)
|
||||
{
|
||||
FF_STRBUF_AUTO_DESTROY buffer = ffStrbufCreate();
|
||||
if (moduleArgs)
|
||||
@@ -93,7 +98,7 @@ static void printError(const char* moduleName, uint8_t moduleIndex, const FFModu
|
||||
putchar('\n');
|
||||
}
|
||||
|
||||
void ffPrintErrorString(const char* moduleName, uint8_t moduleIndex, const FFModuleArgs* moduleArgs, FFPrintType printType, const char* message, ...)
|
||||
void ffPrintError(const char* moduleName, uint8_t moduleIndex, const FFModuleArgs* moduleArgs, FFPrintType printType, const char* message, ...)
|
||||
{
|
||||
va_list arguments;
|
||||
va_start(arguments, message);
|
||||
@@ -101,14 +106,6 @@ void ffPrintErrorString(const char* moduleName, uint8_t moduleIndex, const FFMod
|
||||
va_end(arguments);
|
||||
}
|
||||
|
||||
void ffPrintError(const char* moduleName, uint8_t moduleIndex, const FFModuleArgs* moduleArgs, const char* message, ...)
|
||||
{
|
||||
va_list arguments;
|
||||
va_start(arguments, message);
|
||||
printError(moduleName, moduleIndex, moduleArgs, FF_PRINT_TYPE_DEFAULT, message, arguments);
|
||||
va_end(arguments);
|
||||
}
|
||||
|
||||
void ffPrintColor(const FFstrbuf* colorValue)
|
||||
{
|
||||
//If the color is not set, this would reset in \033[m, which resets everything.
|
||||
|
||||
+10
-7
@@ -12,14 +12,17 @@ typedef enum FFPrintType {
|
||||
} FFPrintType;
|
||||
|
||||
void ffPrintLogoAndKey(const char* moduleName, uint8_t moduleIndex, const FFModuleArgs* moduleArgs, FFPrintType printType);
|
||||
void ffPrintFormatString(const char* moduleName, uint8_t moduleIndex, const FFModuleArgs* moduleArgs, FFPrintType printType, uint32_t numArgs, const FFformatarg* arguments);
|
||||
static inline void ffPrintFormat(const char* moduleName, uint8_t moduleIndex, const FFModuleArgs* moduleArgs, uint32_t numArgs, const FFformatarg* arguments)
|
||||
{
|
||||
ffPrintFormatString(moduleName, moduleIndex, moduleArgs, FF_PRINT_TYPE_DEFAULT, numArgs, arguments);
|
||||
}
|
||||
FF_C_PRINTF(5, 6) void ffPrintErrorString(const char* moduleName, uint8_t moduleIndex, const FFModuleArgs* moduleArgs, FFPrintType printType, const char* message, ...);
|
||||
FF_C_PRINTF(4, 5) void ffPrintError(const char* moduleName, uint8_t moduleIndex, const FFModuleArgs* moduleArgs, const char* message, ...);
|
||||
void ffPrintFormat(const char* moduleName, uint8_t moduleIndex, const FFModuleArgs* moduleArgs, FFPrintType printType, uint32_t numArgs, const FFformatarg* arguments);
|
||||
#define FF_PRINT_FORMAT_CHECKED(moduleName, moduleIndex, moduleArgs, printType, numArgs, arguments) do {\
|
||||
static_assert(sizeof(arguments) / sizeof(*(arguments)) == (numArgs), "Invalid number of format arguments");\
|
||||
ffPrintFormat((moduleName), (moduleIndex), (moduleArgs), (printType), (numArgs), (arguments));\
|
||||
} while (0)
|
||||
FF_C_PRINTF(5, 6) void ffPrintError(const char* moduleName, uint8_t moduleIndex, const FFModuleArgs* moduleArgs, FFPrintType printType, const char* message, ...);
|
||||
void ffPrintColor(const FFstrbuf* colorValue);
|
||||
void ffPrintCharTimes(char c, uint32_t times);
|
||||
|
||||
void ffPrintModuleFormatHelp(const char* name, const char* def, uint32_t numArgs, const char* args[]);
|
||||
#define FF_PRINT_MODULE_FORMAT_HELP_CHECKED(moduleName, def, numArgs, args) do {\
|
||||
static_assert(sizeof(args) / sizeof(*(args)) == (numArgs), "Invalid number of format arguments");\
|
||||
ffPrintModuleFormatHelp((moduleName), (def), (numArgs), (args));\
|
||||
} while (0)
|
||||
|
||||
@@ -8,10 +8,7 @@ static inline const char* ffProcessAppendStdOut(FFstrbuf* buffer, char* const ar
|
||||
{
|
||||
const char* error = ffProcessAppendOutput(buffer, argv, false);
|
||||
if (!error)
|
||||
{
|
||||
ffStrbufTrimRight(buffer, '\n');
|
||||
ffStrbufTrimRight(buffer, ' ');
|
||||
}
|
||||
ffStrbufTrimRightSpace(buffer);
|
||||
return error;
|
||||
}
|
||||
|
||||
@@ -19,9 +16,6 @@ static inline const char* ffProcessAppendStdErr(FFstrbuf* buffer, char* const ar
|
||||
{
|
||||
const char* error = ffProcessAppendOutput(buffer, argv, true);
|
||||
if (!error)
|
||||
{
|
||||
ffStrbufTrimRight(buffer, '\n');
|
||||
ffStrbufTrimRight(buffer, ' ');
|
||||
}
|
||||
ffStrbufTrimRightSpace(buffer);
|
||||
return error;
|
||||
}
|
||||
|
||||
@@ -13,13 +13,6 @@
|
||||
|
||||
enum { FF_PIPE_BUFSIZ = 8192 };
|
||||
|
||||
static inline void waitpid_wrapper(const pid_t* pid)
|
||||
{
|
||||
// remove zombie processes
|
||||
if (*pid > 0)
|
||||
waitpid(*pid, NULL, 0);
|
||||
}
|
||||
|
||||
static inline int ffPipe2(int *fds, int flags)
|
||||
{
|
||||
#ifdef __APPLE__
|
||||
@@ -41,7 +34,7 @@ const char* ffProcessAppendOutput(FFstrbuf* buffer, char* const argv[], bool use
|
||||
if(ffPipe2(pipes, O_CLOEXEC) == -1)
|
||||
return "pipe() failed";
|
||||
|
||||
__attribute__((__cleanup__(waitpid_wrapper))) pid_t childPid = fork();
|
||||
pid_t childPid = fork();
|
||||
if(childPid == -1)
|
||||
{
|
||||
close(pipes[0]);
|
||||
@@ -74,11 +67,13 @@ const char* ffProcessAppendOutput(FFstrbuf* buffer, char* const argv[], bool use
|
||||
if (poll(&pollfd, 1, timeout) == 0)
|
||||
{
|
||||
kill(childPid, SIGTERM);
|
||||
return "poll(&pollfd, 1, timeout) timeout";
|
||||
waitpid(childPid, NULL, 0);
|
||||
return "poll(&pollfd, 1, timeout) timeout (try increasing --processing-timeout)";
|
||||
}
|
||||
else if (pollfd.revents & POLLERR)
|
||||
{
|
||||
kill(childPid, SIGTERM);
|
||||
waitpid(childPid, NULL, 0);
|
||||
return "poll(&pollfd, 1, timeout) error";
|
||||
}
|
||||
}
|
||||
@@ -87,7 +82,19 @@ const char* ffProcessAppendOutput(FFstrbuf* buffer, char* const argv[], bool use
|
||||
if (nRead > 0)
|
||||
ffStrbufAppendNS(buffer, (uint32_t) nRead, str);
|
||||
else if (nRead == 0)
|
||||
return NULL;
|
||||
{
|
||||
int stat_loc = 0;
|
||||
if (waitpid(childPid, &stat_loc, 0) == childPid)
|
||||
{
|
||||
if (!WIFEXITED(stat_loc))
|
||||
return "child process exited abnormally";
|
||||
if (WEXITSTATUS(stat_loc) == 127)
|
||||
return "command was not found";
|
||||
// We only handle 127 as an error. See `getTerminalVersionUrxvt` in `terminalshell.c`
|
||||
return NULL;
|
||||
}
|
||||
return "waitpid() failed";
|
||||
}
|
||||
else if (nRead < 0)
|
||||
break;
|
||||
};
|
||||
|
||||
@@ -83,8 +83,7 @@ const char* ffProcessAppendOutput(FFstrbuf* buffer, char* const argv[], bool use
|
||||
|
||||
char str[FF_PIPE_BUFSIZ];
|
||||
DWORD nRead = 0;
|
||||
FF_AUTO_CLOSE_FD HANDLE hEvent = CreateEventW(NULL, FALSE, FALSE, NULL);
|
||||
OVERLAPPED overlapped = { .hEvent = hEvent };
|
||||
OVERLAPPED overlapped = { };
|
||||
// ReadFile always completes synchronously if the pipe is not created with FILE_FLAG_OVERLAPPED
|
||||
do
|
||||
{
|
||||
@@ -93,11 +92,11 @@ const char* ffProcessAppendOutput(FFstrbuf* buffer, char* const argv[], bool use
|
||||
switch (GetLastError())
|
||||
{
|
||||
case ERROR_IO_PENDING:
|
||||
if (!timeout || WaitForSingleObject(hEvent, (DWORD) timeout) != WAIT_OBJECT_0)
|
||||
if (!timeout || WaitForSingleObject(hChildPipeRead, (DWORD) timeout) != WAIT_OBJECT_0)
|
||||
{
|
||||
CancelIo(hChildPipeRead);
|
||||
TerminateProcess(hProcess, 1);
|
||||
return "WaitForSingleObject(hEvent) failed or timeout";
|
||||
return "WaitForSingleObject(hChildPipeRead) failed or timeout (try increasing --processing-timeout)";
|
||||
}
|
||||
|
||||
if (!GetOverlappedResult(hChildPipeRead, &overlapped, &nRead, FALSE))
|
||||
|
||||
+29
-36
@@ -1,5 +1,7 @@
|
||||
#include "fastfetch.h"
|
||||
#include "common/properties.h"
|
||||
#include "common/io/io.h"
|
||||
#include "util/mallocHelper.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#ifdef _WIN32
|
||||
@@ -95,50 +97,44 @@ bool ffParsePropLines(const char* lines, const char* start, FFstrbuf* buffer)
|
||||
|
||||
bool ffParsePropFileValues(const char* filename, uint32_t numQueries, FFpropquery* queries)
|
||||
{
|
||||
FILE* file = fopen(filename, "r");
|
||||
if(file == NULL)
|
||||
FF_AUTO_CLOSE_FILE FILE* file = fopen(filename, "r");
|
||||
if (file == NULL)
|
||||
return false;
|
||||
|
||||
bool valueStorage[4];
|
||||
bool* unsetValues;
|
||||
bool valueStorage[32];
|
||||
bool* unsetValues = valueStorage;
|
||||
|
||||
if(numQueries > sizeof(valueStorage) / sizeof(valueStorage[0]))
|
||||
if (numQueries > sizeof(valueStorage) / sizeof(valueStorage[0]))
|
||||
unsetValues = malloc(sizeof(bool) * numQueries);
|
||||
else
|
||||
unsetValues = valueStorage;
|
||||
|
||||
bool allSet = true;
|
||||
for(uint32_t i = 0; i < numQueries; i++)
|
||||
for (uint32_t i = 0; i < numQueries; i++)
|
||||
{
|
||||
if((unsetValues[i] = queries[i].buffer->length == 0))
|
||||
unsetValues[i] = queries[i].buffer->length == 0;
|
||||
if (unsetValues[i])
|
||||
allSet = false;
|
||||
}
|
||||
|
||||
if(allSet)
|
||||
goto done;
|
||||
|
||||
char* line = NULL;
|
||||
size_t len = 0;
|
||||
|
||||
while (getline(&line, &len, file) != -1)
|
||||
if (!allSet)
|
||||
{
|
||||
for(uint32_t i = 0; i < numQueries; i++)
|
||||
{
|
||||
if(!unsetValues[i])
|
||||
continue;
|
||||
FF_AUTO_FREE char* line = NULL;
|
||||
size_t len = 0;
|
||||
|
||||
uint32_t currentLength = queries[i].buffer->length;
|
||||
queries[i].buffer->length = 0;
|
||||
if(!ffParsePropLine(line, queries[i].start, queries[i].buffer))
|
||||
queries[i].buffer->length = currentLength;
|
||||
while (getline(&line, &len, file) != -1)
|
||||
{
|
||||
for(uint32_t i = 0; i < numQueries; i++)
|
||||
{
|
||||
if(!unsetValues[i])
|
||||
continue;
|
||||
|
||||
uint32_t currentLength = queries[i].buffer->length;
|
||||
queries[i].buffer->length = 0;
|
||||
if(!ffParsePropLine(line, queries[i].start, queries[i].buffer))
|
||||
queries[i].buffer->length = currentLength;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(line != NULL)
|
||||
free(line);
|
||||
|
||||
done:
|
||||
fclose(file);
|
||||
if(unsetValues != valueStorage)
|
||||
free(unsetValues);
|
||||
return true;
|
||||
@@ -154,16 +150,13 @@ bool ffParsePropFileListValues(const FFlist* list, const char* relativeFile, uin
|
||||
{
|
||||
bool foundAFile = false;
|
||||
|
||||
FF_STRBUF_AUTO_DESTROY baseDir = ffStrbufCreateA(64);
|
||||
|
||||
FF_LIST_FOR_EACH(FFstrbuf, dirPrefix, *list)
|
||||
{
|
||||
//We need to copy the dir each time, because it used by multiple threads, so we can't directly write to it.
|
||||
ffStrbufSet(&baseDir, dirPrefix);
|
||||
ffStrbufAppendS(&baseDir, relativeFile);
|
||||
|
||||
if(ffParsePropFileValues(baseDir.chars, numQueries, queries))
|
||||
const uint32_t dirPrefixLength = dirPrefix->length;
|
||||
ffStrbufAppendS(dirPrefix, relativeFile);
|
||||
if(ffParsePropFileValues(dirPrefix->chars, numQueries, queries))
|
||||
foundAFile = true;
|
||||
ffStrbufSubstrBefore(dirPrefix, dirPrefixLength);
|
||||
|
||||
bool allSet = true;
|
||||
for(uint32_t k = 0; k < numQueries; k++)
|
||||
|
||||
@@ -411,9 +411,8 @@ bool ffSettingsGetFreeBSDKenv(const char* propName, FFstrbuf* result)
|
||||
//https://wiki.ghostbsd.org/index.php/Kenv
|
||||
ffStrbufEnsureFree(result, KENV_MVALLEN);
|
||||
int len = kenv(KENV_GET, propName, result->chars + result->length, KENV_MVALLEN);
|
||||
if (len <= 0) return false;
|
||||
result->length += (uint32_t) len;
|
||||
result->chars[result->length] = '\0';
|
||||
if (len <= 1) return false; // number of bytes copied, including NUL terminator
|
||||
result->length += (uint32_t) len - 1;
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,177 @@
|
||||
#include "fastfetch.h"
|
||||
#include "common/temps.h"
|
||||
#include "util/textModifier.h"
|
||||
#include "util/stringUtils.h"
|
||||
|
||||
void ffTempsAppendNum(double celsius, FFstrbuf* buffer, FFColorRangeConfig config, const FFModuleArgs* module)
|
||||
{
|
||||
if (celsius != celsius) // ignores NaN
|
||||
return;
|
||||
|
||||
const FFOptionsDisplay* options = &instance.config.display;
|
||||
const char* colorGreen = options->tempColorGreen.chars;
|
||||
const char* colorYellow = options->tempColorYellow.chars;
|
||||
const char* colorRed = options->tempColorRed.chars;
|
||||
|
||||
uint8_t green = config.green, yellow = config.yellow;
|
||||
|
||||
if (!options->pipe)
|
||||
{
|
||||
if(green <= yellow)
|
||||
{
|
||||
if (celsius > yellow)
|
||||
ffStrbufAppendF(buffer, "\e[%sm", colorRed);
|
||||
else if (celsius > green)
|
||||
ffStrbufAppendF(buffer, "\e[%sm", colorYellow);
|
||||
else
|
||||
ffStrbufAppendF(buffer, "\e[%sm", colorGreen);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (celsius < yellow)
|
||||
ffStrbufAppendF(buffer, "\e[%sm", colorRed);
|
||||
else if (celsius < green)
|
||||
ffStrbufAppendF(buffer, "\e[%sm", colorYellow);
|
||||
else
|
||||
ffStrbufAppendF(buffer, "\e[%sm", colorGreen);
|
||||
}
|
||||
}
|
||||
|
||||
switch (options->tempUnit)
|
||||
{
|
||||
case FF_TEMPERATURE_UNIT_CELSIUS:
|
||||
ffStrbufAppendF(buffer, "%.*f°C", options->tempNdigits, celsius);
|
||||
break;
|
||||
case FF_TEMPERATURE_UNIT_FAHRENHEIT:
|
||||
ffStrbufAppendF(buffer, "%.*f°F", options->tempNdigits, celsius * 1.8 + 32);
|
||||
break;
|
||||
case FF_TEMPERATURE_UNIT_KELVIN:
|
||||
ffStrbufAppendF(buffer, "%.*f K", options->tempNdigits, celsius + 273.15);
|
||||
break;
|
||||
}
|
||||
|
||||
if (!options->pipe)
|
||||
{
|
||||
ffStrbufAppendS(buffer, FASTFETCH_TEXT_MODIFIER_RESET);
|
||||
if (module->outputColor.length)
|
||||
ffStrbufAppendF(buffer, "\e[%sm", module->outputColor.chars);
|
||||
else if (instance.config.display.colorOutput.length)
|
||||
ffStrbufAppendF(buffer, "\e[%sm", instance.config.display.colorOutput.chars);
|
||||
}
|
||||
}
|
||||
|
||||
bool ffTempsParseCommandOptions(const char* key, const char* subkey, const char* value, bool* useTemp, FFColorRangeConfig* config)
|
||||
{
|
||||
if (!ffStrStartsWithIgnCase(subkey, "temp"))
|
||||
return false;
|
||||
|
||||
if (subkey[strlen("temp")] == '\0')
|
||||
{
|
||||
*useTemp = ffOptionParseBoolean(value);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (subkey[strlen("temp")] != '-')
|
||||
return false;
|
||||
|
||||
subkey += strlen("temp-");
|
||||
|
||||
if (ffStrEqualsIgnCase(subkey, "green"))
|
||||
{
|
||||
uint32_t num = ffOptionParseUInt32(key, value);
|
||||
if (num > 100)
|
||||
{
|
||||
fprintf(stderr, "Error: usage: %s must be between 0 and 100\n", key);
|
||||
exit(480);
|
||||
}
|
||||
config->green = (uint8_t) num;
|
||||
return true;
|
||||
}
|
||||
|
||||
if (ffStrEqualsIgnCase(subkey, "yellow"))
|
||||
{
|
||||
uint32_t num = ffOptionParseUInt32(key, value);
|
||||
if (num > 100)
|
||||
{
|
||||
fprintf(stderr, "Error: usage: %s must be between 0 and 100\n", key);
|
||||
exit(480);
|
||||
}
|
||||
config->yellow = (uint8_t) num;
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool ffTempsParseJsonObject(const char* key, yyjson_val* value, bool* useTemp, FFColorRangeConfig* config)
|
||||
{
|
||||
if (!ffStrEqualsIgnCase(key, "temp"))
|
||||
return false;
|
||||
|
||||
if (yyjson_is_bool(value))
|
||||
{
|
||||
*useTemp = yyjson_get_bool(value);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (yyjson_is_null(value))
|
||||
{
|
||||
*useTemp = false;
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!yyjson_is_obj(value))
|
||||
{
|
||||
fprintf(stderr, "Error: usage: %s must be an object or a boolean\n", key);
|
||||
exit(480);
|
||||
}
|
||||
|
||||
*useTemp = true;
|
||||
|
||||
yyjson_val* greenVal = yyjson_obj_get(value, "green");
|
||||
if (greenVal)
|
||||
{
|
||||
int num = yyjson_get_int(greenVal);
|
||||
if (num < 0 || num > 100)
|
||||
{
|
||||
fputs("Error: usage: temp.green must be between 0 and 100\n", stderr);
|
||||
exit(480);
|
||||
}
|
||||
config->green = (uint8_t) num;
|
||||
}
|
||||
|
||||
yyjson_val* yellowVal = yyjson_obj_get(value, "yellow");
|
||||
if (yellowVal)
|
||||
{
|
||||
int num = yyjson_get_int(yellowVal);
|
||||
if (num < 0 || num > 100)
|
||||
{
|
||||
fputs("Error: usage: temp.yellow must be between 0 and 100\n", stderr);
|
||||
exit(480);
|
||||
}
|
||||
config->yellow = (uint8_t) num;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void ffTempsGenerateJsonConfig(yyjson_mut_doc* doc, yyjson_mut_val* module, FF_MAYBE_UNUSED bool defaultTemp, FFColorRangeConfig defaultConfig, bool temp, FFColorRangeConfig config)
|
||||
{
|
||||
assert(defaultTemp == false); // assume defaultTemp is always false
|
||||
|
||||
if (!temp)
|
||||
return;
|
||||
|
||||
if (config.green != defaultConfig.green || config.yellow != defaultConfig.yellow)
|
||||
{
|
||||
yyjson_mut_val* temp = yyjson_mut_obj_add_obj(doc, module, "temp");
|
||||
if (config.green != defaultConfig.green)
|
||||
yyjson_mut_obj_add_uint(doc, temp, "green", config.green);
|
||||
if (config.yellow != defaultConfig.yellow)
|
||||
yyjson_mut_obj_add_uint(doc, temp, "yellow", config.yellow);
|
||||
}
|
||||
else
|
||||
{
|
||||
yyjson_mut_obj_add_bool(doc, module, "temp", true);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
#pragma once
|
||||
|
||||
#include "common/parsing.h"
|
||||
#include "common/option.h"
|
||||
|
||||
void ffTempsAppendNum(double celsius, FFstrbuf* buffer, FFColorRangeConfig config, const FFModuleArgs* module);
|
||||
bool ffTempsParseCommandOptions(const char* key, const char* subkey, const char* value, bool* useTemp, FFColorRangeConfig* config);
|
||||
bool ffTempsParseJsonObject(const char* key, yyjson_val* value, bool* useTemp, FFColorRangeConfig* config);
|
||||
void ffTempsGenerateJsonConfig(yyjson_mut_doc* doc, yyjson_mut_val* module, FF_MAYBE_UNUSED bool defaultTemp, FFColorRangeConfig defaultConfig, bool temp, FFColorRangeConfig config);
|
||||
+37
-3
@@ -1,12 +1,12 @@
|
||||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
#include <time.h>
|
||||
#include <stdio.h>
|
||||
#ifdef _WIN32
|
||||
#include <synchapi.h>
|
||||
#include <profileapi.h>
|
||||
#include <sysinfoapi.h>
|
||||
#else
|
||||
#include <time.h>
|
||||
#endif
|
||||
|
||||
static inline uint64_t ffTimeGetTick() //In msec
|
||||
@@ -42,6 +42,40 @@ static inline void ffTimeSleep(uint32_t msec)
|
||||
#ifdef _WIN32
|
||||
SleepEx(msec, TRUE);
|
||||
#else
|
||||
nanosleep(&(struct timespec){ msec / 1000, (msec % 1000) * 1000000 }, NULL);
|
||||
nanosleep(&(struct timespec){ msec / 1000, (long) (msec % 1000) * 1000000 }, NULL);
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wformat"
|
||||
#endif
|
||||
|
||||
// Not thread-safe
|
||||
static inline const char* ffTimeToFullStr(uint64_t msec)
|
||||
{
|
||||
if (msec == 0) return "";
|
||||
time_t tsec = (time_t) (msec / 1000);
|
||||
const struct tm* tm = localtime(&tsec);
|
||||
|
||||
static char buf[32];
|
||||
strftime(buf, __builtin_strlen("0000-00-00T00:00:00") + 1, "%FT%T", tm);
|
||||
snprintf(buf + __builtin_strlen("0000-00-00T00:00:00"), __builtin_strlen(".000") + 1, ".%03u", (unsigned) (msec % 1000));
|
||||
strftime(buf + __builtin_strlen("0000-00-00T00:00:00.000"), __builtin_strlen("+0000") + 1, "%z", tm);
|
||||
return buf;
|
||||
}
|
||||
|
||||
// Not thread-safe
|
||||
static inline const char* ffTimeToShortStr(uint64_t msec)
|
||||
{
|
||||
if (msec == 0) return "";
|
||||
time_t tsec = (time_t) (msec / 1000);
|
||||
|
||||
static char buf[32];
|
||||
strftime(buf, sizeof(buf), "%F %T", localtime(&tsec));
|
||||
return buf;
|
||||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
|
||||
+307
-63
@@ -82,7 +82,7 @@
|
||||
}
|
||||
}
|
||||
],
|
||||
"pseudo": [
|
||||
"General": [
|
||||
{
|
||||
"long": "thread",
|
||||
"desc": "Use separate threads to send HTTP requests",
|
||||
@@ -122,7 +122,10 @@
|
||||
{
|
||||
"long": "ds-force-drm",
|
||||
"desc": "Set if only DRM should be used to detect displays",
|
||||
"remark": "Use this option if you encountered problems with other detection method. Linux only",
|
||||
"remark": [
|
||||
"Use this option if you encountered problems with other detection method.",
|
||||
"Linux only"
|
||||
],
|
||||
"arg": {
|
||||
"type": "enum",
|
||||
"optional": true,
|
||||
@@ -198,6 +201,7 @@
|
||||
{
|
||||
"long": "logo-color-[1-9]",
|
||||
"desc": "Overwrite a color in the logo",
|
||||
"remark": "See `-h color` for the list of available colors",
|
||||
"arg": {
|
||||
"type": "color"
|
||||
},
|
||||
@@ -432,6 +436,7 @@
|
||||
{
|
||||
"long": "color-keys",
|
||||
"desc": "Set the color of the keys",
|
||||
"remark": "Doesn't affect module Title, Separator and Colors. See `-h color` for the list of available colors",
|
||||
"arg": {
|
||||
"type": "color"
|
||||
}
|
||||
@@ -439,6 +444,15 @@
|
||||
{
|
||||
"long": "color-title",
|
||||
"desc": "Set the color of the title",
|
||||
"remark": "See `-h color` for the list of available colors",
|
||||
"arg": {
|
||||
"type": "color"
|
||||
}
|
||||
},
|
||||
{
|
||||
"long": "color-output",
|
||||
"desc": "Set the color of module output",
|
||||
"remark": "See `-h color` for the list of available colors",
|
||||
"arg": {
|
||||
"type": "color"
|
||||
}
|
||||
@@ -475,22 +489,6 @@
|
||||
"default": ": "
|
||||
}
|
||||
},
|
||||
{
|
||||
"long": "set",
|
||||
"desc": "Hard set the value of a key",
|
||||
"remark": "Deprecated. Use \"Custom\" module instead",
|
||||
"arg": {
|
||||
"type": "key=value"
|
||||
}
|
||||
},
|
||||
{
|
||||
"long": "set-keyless",
|
||||
"desc": "Hard set the value of a key, but don't print the key or the separator",
|
||||
"remark": "Deprecated. Use \"Custom\" module instead",
|
||||
"arg": {
|
||||
"type": "key=value"
|
||||
}
|
||||
},
|
||||
{
|
||||
"long": "show-errors",
|
||||
"desc": "Print occurring errors",
|
||||
@@ -515,7 +513,7 @@
|
||||
"arg": {
|
||||
"type": "bool",
|
||||
"optional": true,
|
||||
"default": true
|
||||
"default": false
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -534,7 +532,13 @@
|
||||
{
|
||||
"long": "percent-type",
|
||||
"desc": "Set the percentage output type",
|
||||
"remark": "1 for percentage number, 2 for bar, 3 for both, 6 for bar only, 9 for colored number",
|
||||
"remark": [
|
||||
"1 for percentage number",
|
||||
"2 for bar",
|
||||
"3 for both",
|
||||
"6 for bar only",
|
||||
"9 for colored number"
|
||||
],
|
||||
"arg": {
|
||||
"type": "num",
|
||||
"default": 9
|
||||
@@ -548,6 +552,33 @@
|
||||
"default": 0
|
||||
}
|
||||
},
|
||||
{
|
||||
"long": "percent-color-green",
|
||||
"desc": "Set color used in green state of percentage bars and numbers",
|
||||
"remark": "See `-h color` for the list of available colors",
|
||||
"arg": {
|
||||
"type": "color",
|
||||
"default": "green"
|
||||
}
|
||||
},
|
||||
{
|
||||
"long": "percent-color-yellow",
|
||||
"desc": "Set color used in yellow state of percentage bars and numbers",
|
||||
"remark": "See `-h color` for the list of available colors",
|
||||
"arg": {
|
||||
"type": "color",
|
||||
"default": "light_yellow"
|
||||
}
|
||||
},
|
||||
{
|
||||
"long": "percent-color-red",
|
||||
"desc": "Set color used in red state of percentage bars and numbers",
|
||||
"remark": "See `-h color` for the list of available colors",
|
||||
"arg": {
|
||||
"type": "color",
|
||||
"default": "light_red"
|
||||
}
|
||||
},
|
||||
{
|
||||
"long": "bar-char-elapsed",
|
||||
"desc": "Set the character to use in elapsed part of percentage bars",
|
||||
@@ -617,7 +648,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"long": "temperature-unit",
|
||||
"long": "temp-unit",
|
||||
"desc": "Set the unit of the temperature",
|
||||
"arg": {
|
||||
"type": "enum",
|
||||
@@ -628,6 +659,51 @@
|
||||
},
|
||||
"default": "C"
|
||||
}
|
||||
},
|
||||
{
|
||||
"long": "temp-ndigits",
|
||||
"desc": "Set the number of digits to keep after the decimal point when printing temperature",
|
||||
"arg": {
|
||||
"type": "num",
|
||||
"default": 2
|
||||
}
|
||||
},
|
||||
{
|
||||
"long": "temp-color-green",
|
||||
"desc": "Set color used in green state of temperature values",
|
||||
"remark": "See `-h color` for the list of available colors",
|
||||
"arg": {
|
||||
"type": "color",
|
||||
"default": "green"
|
||||
}
|
||||
},
|
||||
{
|
||||
"long": "temp-color-yellow",
|
||||
"desc": "Set color used in yellow state of temperature values",
|
||||
"remark": "See `-h color` for the list of available colors",
|
||||
"arg": {
|
||||
"type": "color",
|
||||
"default": "light_yellow"
|
||||
}
|
||||
},
|
||||
{
|
||||
"long": "temp-color-red",
|
||||
"desc": "Set color used in red state of temperature values",
|
||||
"remark": "See `-h color` for the list of available colors",
|
||||
"arg": {
|
||||
"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": [
|
||||
@@ -821,6 +897,7 @@
|
||||
{
|
||||
"long": "title-color-user",
|
||||
"desc": "Set color of the user name (left part)",
|
||||
"remark": "See `-h color` for the list of available colors",
|
||||
"arg": {
|
||||
"type": "color",
|
||||
"default": "Use color of \"--color-title\""
|
||||
@@ -829,6 +906,7 @@
|
||||
{
|
||||
"long": "title-color-at",
|
||||
"desc": "Set color of the @ symbol (middle part)",
|
||||
"remark": "See `-h color` for the list of available colors",
|
||||
"arg": {
|
||||
"type": "color",
|
||||
"default": "Use color of \"--color-title\""
|
||||
@@ -837,21 +915,12 @@
|
||||
{
|
||||
"long": "title-color-host",
|
||||
"desc": "Set color of the host name (right part)",
|
||||
"remark": "See `-h color` for the list of available colors",
|
||||
"arg": {
|
||||
"type": "color",
|
||||
"default": "default"
|
||||
}
|
||||
},
|
||||
{
|
||||
"long": "chassis-use-wmi",
|
||||
"desc": "Set if WMI query should be used on Windows",
|
||||
"remark": "WMI query detects more information but is slower. Windows only",
|
||||
"arg": {
|
||||
"type": "bool",
|
||||
"optional": true,
|
||||
"default": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"long": "separator-string",
|
||||
"desc": "Set the string printed by the separator module",
|
||||
@@ -861,16 +930,17 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"long": "os-file",
|
||||
"desc": "Set the additional file path which containing OS information",
|
||||
"remark": "Linux only",
|
||||
"long": "separator-output-color",
|
||||
"desc": "Set the color of the separator module",
|
||||
"arg": {
|
||||
"type": "path"
|
||||
"type": "color",
|
||||
"default": "default"
|
||||
}
|
||||
},
|
||||
{
|
||||
"long": "disk-folders",
|
||||
"desc": "A colon (semicolon on Windows) separated list of folder paths for the disk output",
|
||||
"desc": "A colon (semicolon on Windows) separated list of folder paths to be detected",
|
||||
"remark": "On Windows, a drive latter must be upper cased and end with \"\\\". \"/\" is used as an alias of the system drive. This option overrides other disk-show-* options",
|
||||
"arg": {
|
||||
"type": "path",
|
||||
"default": "Auto detection using mount-points"
|
||||
@@ -940,6 +1010,14 @@
|
||||
"default": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"long": "diskio-detect-total",
|
||||
"desc": "Detect total bytes instead of current rate",
|
||||
"arg": {
|
||||
"type": "bool",
|
||||
"default": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"long": "diskio-name-prefix",
|
||||
"desc": "Show disks with given name prefix only",
|
||||
@@ -954,6 +1032,15 @@
|
||||
"type": "str"
|
||||
}
|
||||
},
|
||||
{
|
||||
"long": "physicaldisk-temp",
|
||||
"desc": "Detect and display SSD temperature if supported",
|
||||
"arg": {
|
||||
"type": "bool",
|
||||
"optional": true,
|
||||
"default": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"long": "bluetooth-show-disconnected",
|
||||
"desc": "Set if disconnected bluetooth devices should be printed",
|
||||
@@ -964,13 +1051,16 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"long": "packages-winget",
|
||||
"desc": "Set if winget package count should be detected",
|
||||
"remark": "This option is extremely slow. You may need to increase value of '--processing-timeout' to make it actually work",
|
||||
"long": "packages-disabled",
|
||||
"desc": "A colon separated list of package managers to be disabled when detecting",
|
||||
"remark": [
|
||||
"Some detection methods can be very slow.",
|
||||
"You may need to increase value of '--processing-timeout' to make it actually work.",
|
||||
"Use `--packages-disabled none` to enable all."
|
||||
],
|
||||
"arg": {
|
||||
"type": "bool",
|
||||
"optional": true,
|
||||
"default": false
|
||||
"type": "string",
|
||||
"default": "winget"
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -981,7 +1071,9 @@
|
||||
"enum": {
|
||||
"none": "Disable this compact mode",
|
||||
"original": "Print original resolutions",
|
||||
"scaled": "Print scaled resolutions"
|
||||
"scaled": "Print scaled resolutions",
|
||||
"original-with-refresh-rate": "Print original resolutions with refresh rate",
|
||||
"scaled-with-refresh-rate": "Print scaled resolutions with refresh rate"
|
||||
},
|
||||
"default": "none"
|
||||
}
|
||||
@@ -995,6 +1087,19 @@
|
||||
"default": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"long": "display-order",
|
||||
"desc": "Set the order should be used when printing displays",
|
||||
"arg": {
|
||||
"type": "enum",
|
||||
"enum": {
|
||||
"none": "Use the detected order",
|
||||
"asc": "Sort by display name ascendingly",
|
||||
"desc": "Sort by display name descendingly"
|
||||
},
|
||||
"default": "none"
|
||||
}
|
||||
},
|
||||
{
|
||||
"long": "brightness-ddcci-sleep",
|
||||
"desc": "Set the sleep times (in ms) when sending DDC/CI requests",
|
||||
@@ -1017,19 +1122,13 @@
|
||||
"default": "main"
|
||||
}
|
||||
},
|
||||
{
|
||||
"long": "battery-dir",
|
||||
"desc": "The directory where the battery folders are",
|
||||
"remark": "Linux only",
|
||||
"arg": {
|
||||
"type": "path",
|
||||
"default": "/sys/class/power_supply/"
|
||||
}
|
||||
},
|
||||
{
|
||||
"long": "battery-use-setup-api",
|
||||
"desc": "Set if \"SetupAPI\" should be used on Windows to detect battery info",
|
||||
"remark": "SetupAPI supports multi batteries, but slower. Windows only",
|
||||
"remark": [
|
||||
"SetupAPI supports multi batteries, but slower.",
|
||||
"Windows only"
|
||||
],
|
||||
"arg": {
|
||||
"type": "bool",
|
||||
"optional": true,
|
||||
@@ -1065,7 +1164,10 @@
|
||||
{
|
||||
"long": "de-slow-version-detection",
|
||||
"desc": "Set if DE version should be detected with slow operations",
|
||||
"remark": "Usually is not necessary. Linux only",
|
||||
"remark": [
|
||||
"It's only used as a fallback method. Please file a bug report if you encounter any issues.",
|
||||
"Linux only"
|
||||
],
|
||||
"arg": {
|
||||
"type": "bool",
|
||||
"optional": true,
|
||||
@@ -1082,9 +1184,12 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"long": "gpu-use-nvml",
|
||||
"desc": "Use nvml (NVIDIA Management Library) to detect more detailed GPU information",
|
||||
"remark": "Detects memory usage, CUDA core count, etc. Requires NVIDIA proprietary driver installed",
|
||||
"long": "gpu-driver-specific",
|
||||
"desc": "Use driver specific method to detect more detailed GPU information (memory usage, core count, etc)",
|
||||
"remark": [
|
||||
"Correctly NVML (NVIDIA) and IGCL (Intel, Windows only) are supported.",
|
||||
"Both require the latest proprietary driver to be installed."
|
||||
],
|
||||
"arg": {
|
||||
"type": "bool",
|
||||
"optional": true,
|
||||
@@ -1092,13 +1197,18 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"long": "gpu-force-vulkan",
|
||||
"desc": "Force using vulkan to detect GPUs",
|
||||
"remark": "Vulkan supports video memory usage detection",
|
||||
"long": "gpu-detection-method",
|
||||
"desc": "Force using a specified method to detect GPUs",
|
||||
"remark": "Methods are used in this order: DRM (Linux only) -> PCI (Linux, FreeBSD and other platform specific methods) -> Vulkan -> OpenGL",
|
||||
"arg": {
|
||||
"type": "bool",
|
||||
"optional": true,
|
||||
"default": false
|
||||
"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",
|
||||
"opengl": "Use OpenGL API. Slow and only detects one GPU"
|
||||
},
|
||||
"default": "auto"
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -1123,6 +1233,14 @@
|
||||
"default": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"long": "loadavg-ndigits",
|
||||
"desc": "Set the number of digits to keep after the decimal point when printing load average",
|
||||
"arg": {
|
||||
"type": "num",
|
||||
"default": 2
|
||||
}
|
||||
},
|
||||
{
|
||||
"long": "localip-show-ipv4",
|
||||
"desc": "Show IPv4 addresses in local ip module",
|
||||
@@ -1159,6 +1277,15 @@
|
||||
"default": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"long": "localip-show-prefix-len",
|
||||
"desc": "Show network prefix length (/N) in local ip module",
|
||||
"arg": {
|
||||
"type": "bool",
|
||||
"optional": true,
|
||||
"default": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"long": "localip-name-prefix",
|
||||
"desc": "Show interfaces with given interface name prefix only",
|
||||
@@ -1176,6 +1303,15 @@
|
||||
"default": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"long": "localip-show-all-ips",
|
||||
"desc": "Show all IPs bound to the same interface. By default only the first IP is shown",
|
||||
"arg": {
|
||||
"type": "bool",
|
||||
"optional": true,
|
||||
"default": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"long": "localip-compact",
|
||||
"desc": "Show all IPs in one line",
|
||||
@@ -1202,6 +1338,14 @@
|
||||
"default": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"long": "netio-detect-total",
|
||||
"desc": "Detect total bytes instead of current rate",
|
||||
"arg": {
|
||||
"type": "bool",
|
||||
"default": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"long": "publicip-timeout",
|
||||
"desc": "Time in milliseconds to wait for the public ip server to respond",
|
||||
@@ -1218,6 +1362,14 @@
|
||||
"type": "str"
|
||||
}
|
||||
},
|
||||
{
|
||||
"long": "publicip-ipv6",
|
||||
"desc": "Whether to use IPv6 for public IP detection server",
|
||||
"arg": {
|
||||
"type": "bool",
|
||||
"default": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"long": "weather-location",
|
||||
"desc": "Set the location to be used",
|
||||
@@ -1319,6 +1471,44 @@
|
||||
"type": "num",
|
||||
"default": 0
|
||||
}
|
||||
},
|
||||
{
|
||||
"long": "colors-block-width",
|
||||
"desc": "Set the block width in spaces",
|
||||
"arg": {
|
||||
"type": "num",
|
||||
"default": 3
|
||||
}
|
||||
},
|
||||
{
|
||||
"long": "colors-block-range-start",
|
||||
"desc": "Set the start range of colors in the blocks to print",
|
||||
"remark": [
|
||||
"Display colors 0-15 in the blocks. (16 colors)",
|
||||
"Display colors 0-7 in the blocks. (8 colors)",
|
||||
"Only works for `--colors-symbol block`.",
|
||||
"Must be in range 0-15",
|
||||
"See also `--colors-range-end`"
|
||||
],
|
||||
"arg": {
|
||||
"type": "num",
|
||||
"default": 0
|
||||
}
|
||||
},
|
||||
{
|
||||
"long": "colors-block-range-end",
|
||||
"desc": "Set the end range of colors in the blocks to print",
|
||||
"remark": [
|
||||
"Display colors 0-15 in the blocks. (16 colors)",
|
||||
"Display colors 0-7 in the blocks. (8 colors)",
|
||||
"Only works for `--colors-symbol block`.",
|
||||
"Must be in range 0-15",
|
||||
"See also `--colors-range-start`"
|
||||
],
|
||||
"arg": {
|
||||
"type": "num",
|
||||
"default": 15
|
||||
}
|
||||
}
|
||||
],
|
||||
"General module": [
|
||||
@@ -1354,6 +1544,14 @@
|
||||
},
|
||||
"pseudo": true
|
||||
},
|
||||
{
|
||||
"long": "<module>-output-color",
|
||||
"desc": "Override the global \"--color-output\" option for each specific module",
|
||||
"arg": {
|
||||
"type": "color"
|
||||
},
|
||||
"pseudo": true
|
||||
},
|
||||
{
|
||||
"long": "<module>-key-width",
|
||||
"desc": "Override the global \"--key-width\" option for each specific module",
|
||||
@@ -1361,6 +1559,52 @@
|
||||
"type": "num"
|
||||
},
|
||||
"pseudo": true
|
||||
},
|
||||
{
|
||||
"long": "<module>-percent-green",
|
||||
"desc": [
|
||||
"Threshold of percentage colors",
|
||||
"Value less then percent-green will be shown in green"
|
||||
],
|
||||
"arg": {
|
||||
"type": "num"
|
||||
},
|
||||
"pseudo": true
|
||||
},
|
||||
{
|
||||
"long": "<module>-percent-yellow",
|
||||
"desc": [
|
||||
"Threshold of percentage colors",
|
||||
"Value greater than percent-green and less then yellow will be shown in yellow",
|
||||
"Value greater than percent-yellow will be shown in red"
|
||||
],
|
||||
"arg": {
|
||||
"type": "num"
|
||||
},
|
||||
"pseudo": true
|
||||
},
|
||||
{
|
||||
"long": "<module>-temp-green",
|
||||
"desc": [
|
||||
"Threshold of temperature colors",
|
||||
"Value less then temp-green will be shown in green"
|
||||
],
|
||||
"arg": {
|
||||
"type": "num"
|
||||
},
|
||||
"pseudo": true
|
||||
},
|
||||
{
|
||||
"long": "<module>-temp-yellow",
|
||||
"desc": [
|
||||
"Threshold of temperature colors",
|
||||
"Value greater than temp-green and less then yellow will be shown in yellow",
|
||||
"Value greater than temp-yellow will be shown in red"
|
||||
],
|
||||
"arg": {
|
||||
"type": "num"
|
||||
},
|
||||
"pseudo": true
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -3,7 +3,8 @@ Usage: fastfetch --color <color>
|
||||
<color> must be a color encoding as ANSI escape sequences. It is inserted between "ESC[" and "m".
|
||||
Infos about them can be found here: https://en.wikipedia.org/wiki/ANSI_escape_code#SGR_(Select_Graphic_Rendition)_parameters.
|
||||
Examples:
|
||||
--color 35: sets the color to magenta. `--color magenta` is also supported
|
||||
--color 4;92: sets the color to bright Green with underline
|
||||
--color 5;104: blinking text on a blue background
|
||||
--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.
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
Usage: fastfetch -c <file>
|
||||
|
||||
Loads a config file. A config file contains one flag per line. Empty lines or lines starting with # are ignored.
|
||||
If the file is relative it looks in the following order:
|
||||
- relative to the current working directory
|
||||
- relative to ~/.local/share/fastfetch/presets/
|
||||
- relative to /usr/share/fastfetch/presets/
|
||||
Fastfetch provides some default presets. List them with "fastfetch --list-presets".
|
||||
@@ -1,15 +1,15 @@
|
||||
A format string is a string that contains placeholders for values.
|
||||
These placeholders begin with a '{', containing the index of the value, and end with a '}'.
|
||||
For example the format string "Values: {1} ({2})", with the values "First" and "My second val", will produce
|
||||
For example the format string "Values: {1} ({2})", with the values "First" and "My second val", will produce "Values: First (My second val)".
|
||||
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 (").
|
||||
|
||||
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 v
|
||||
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.
|
||||
|
||||
To make formatting easier, a double open curly brace ("{{") will be printed as a single open curly brace and not
|
||||
If a value index is misformatted or wants a non-existing value, it will be printed as is, with the curly braces aro
|
||||
To make formatting easier, a double open curly brace ("{{") will be printed as a single open curly brace and not counted as the beginning of a placeholder.
|
||||
If a value index is misformatted or wants a non-existing value, it will be printed as is, with the curly braces around it.
|
||||
If the last placeholder isn't closed, it will be treated like it was at the end of the format string.
|
||||
|
||||
To only print something if a variable is set, use "{?<index>} ... {?}".
|
||||
@@ -17,7 +17,7 @@ For example, to only print a second value if it is set, use "{?2} Second value:
|
||||
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 '!'.
|
||||
For example to print a fallback for a second value if it is not set, use "{?2}{2}{?}{/2}Second value fallback{/}"
|
||||
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 "{-}".
|
||||
|
||||
@@ -25,7 +25,7 @@ To print something with color, start a placeholder with a '#' and then the linux
|
||||
"\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}...{#}".
|
||||
Information about what the numbers mean can be found here: https://en.wikipedia.org/wiki/ANSI_escape_code#SGR_(Sele
|
||||
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.
|
||||
|
||||
If a format string evaluates to an empty value, the whole line in the output will be discarded.
|
||||
|
||||
@@ -7,10 +7,12 @@
|
||||
typedef struct FFBatteryResult
|
||||
{
|
||||
FFstrbuf manufacturer;
|
||||
FFstrbuf manufactureDate;
|
||||
FFstrbuf modelName;
|
||||
FFstrbuf technology;
|
||||
double capacity;
|
||||
FFstrbuf status;
|
||||
FFstrbuf serial;
|
||||
double capacity;
|
||||
double temperature;
|
||||
uint32_t cycleCount;
|
||||
} FFBatteryResult;
|
||||
|
||||
@@ -40,6 +40,8 @@ static const char* parseTermuxApi(FFBatteryOptions* options, FFlist* results)
|
||||
ffStrbufInit(&battery->modelName);
|
||||
ffStrbufInit(&battery->status);
|
||||
ffStrbufInit(&battery->technology);
|
||||
ffStrbufInit(&battery->serial);
|
||||
ffStrbufInit(&battery->manufactureDate);
|
||||
|
||||
battery->capacity = yyjson_get_num(yyjson_obj_get(root, "percentage"));
|
||||
ffStrbufAppendS(&battery->status, yyjson_get_str(yyjson_obj_get(root, "status")));
|
||||
@@ -71,10 +73,13 @@ static const char* parseDumpsys(FFBatteryOptions* options, FFlist* results)
|
||||
|
||||
FFBatteryResult* battery = ffListAdd(results);
|
||||
battery->temperature = FF_BATTERY_TEMP_UNSET;
|
||||
battery->cycleCount = 0;
|
||||
ffStrbufInit(&battery->manufacturer);
|
||||
ffStrbufInit(&battery->modelName);
|
||||
ffStrbufInit(&battery->status);
|
||||
ffStrbufInit(&battery->technology);
|
||||
ffStrbufInit(&battery->serial);
|
||||
ffStrbufInit(&battery->manufactureDate);
|
||||
|
||||
if (ffParsePropLines(start, "AC powered: ", &temp) && ffStrbufEqualS(&temp, "true"))
|
||||
ffStrbufAppendS(&battery->status, "AC powered");
|
||||
|
||||
@@ -4,84 +4,104 @@
|
||||
#include "detection/temps/temps_apple.h"
|
||||
|
||||
#include <IOKit/IOKitLib.h>
|
||||
#include <IOKit/pwr_mgt/IOPM.h>
|
||||
|
||||
const char* ffDetectBattery(FFBatteryOptions* options, FFlist* results)
|
||||
{
|
||||
io_iterator_t iterator;
|
||||
if(IOServiceGetMatchingServices(MACH_PORT_NULL, IOServiceMatching("AppleSmartBattery"), &iterator) != kIOReturnSuccess)
|
||||
FF_IOOBJECT_AUTO_RELEASE io_iterator_t iterator = IO_OBJECT_NULL;
|
||||
if (IOServiceGetMatchingServices(MACH_PORT_NULL, IOServiceMatching("AppleSmartBattery"), &iterator) != kIOReturnSuccess)
|
||||
return "IOServiceGetMatchingServices() failed";
|
||||
|
||||
io_registry_entry_t registryEntry;
|
||||
while((registryEntry = IOIteratorNext(iterator)) != 0)
|
||||
while ((registryEntry = IOIteratorNext(iterator)) != IO_OBJECT_NULL)
|
||||
{
|
||||
FF_IOOBJECT_AUTO_RELEASE io_registry_entry_t entryBattery = registryEntry;
|
||||
FF_CFTYPE_AUTO_RELEASE CFMutableDictionaryRef properties = NULL;
|
||||
if(IORegistryEntryCreateCFProperties(registryEntry, &properties, kCFAllocatorDefault, kNilOptions) != kIOReturnSuccess)
|
||||
{
|
||||
IOObjectRelease(registryEntry);
|
||||
if (IORegistryEntryCreateCFProperties(entryBattery, &properties, kCFAllocatorDefault, kNilOptions) != kIOReturnSuccess)
|
||||
continue;
|
||||
|
||||
int currentCapacity, maxCapacity;
|
||||
|
||||
if (ffCfDictGetInt(properties, CFSTR(kIOPMPSMaxCapacityKey), &maxCapacity) != NULL || maxCapacity <= 0)
|
||||
continue;
|
||||
|
||||
if (ffCfDictGetInt(properties, CFSTR(kIOPMPSCurrentCapacityKey), ¤tCapacity) != NULL || currentCapacity <= 0)
|
||||
continue;
|
||||
}
|
||||
|
||||
bool boolValue;
|
||||
const char* error;
|
||||
|
||||
FFBatteryResult* battery = ffListAdd(results);
|
||||
battery->temperature = FF_BATTERY_TEMP_UNSET;
|
||||
ffStrbufInit(&battery->manufacturer);
|
||||
ffStrbufInit(&battery->modelName);
|
||||
ffStrbufInit(&battery->serial);
|
||||
ffStrbufInit(&battery->technology);
|
||||
ffStrbufInit(&battery->status);
|
||||
battery->capacity = 0.0/0.0;
|
||||
|
||||
int currentCapacity, maxCapacity;
|
||||
|
||||
if ((error = ffCfDictGetInt(properties, CFSTR("MaxCapacity"), &maxCapacity)))
|
||||
return error;
|
||||
if (maxCapacity <= 0)
|
||||
return "Querying MaxCapacity failed";
|
||||
|
||||
if ((error = ffCfDictGetInt(properties, CFSTR("CurrentCapacity"), ¤tCapacity)))
|
||||
return error;
|
||||
if(currentCapacity <= 0)
|
||||
return "Querying CurrentCapacity failed";
|
||||
|
||||
ffStrbufInit(&battery->manufactureDate);
|
||||
battery->capacity = currentCapacity * 100.0 / maxCapacity;
|
||||
|
||||
ffCfDictGetString(properties, CFSTR("DeviceName"), &battery->modelName);
|
||||
ffCfDictGetString(properties, CFSTR(kIOPMDeviceNameKey), &battery->modelName);
|
||||
ffCfDictGetString(properties, CFSTR(kIOPMPSSerialKey), &battery->serial);
|
||||
ffCfDictGetString(properties, CFSTR(kIOPMPSManufacturerKey), &battery->manufacturer);
|
||||
|
||||
if (!ffCfDictGetBool(properties, CFSTR("built-in"), &boolValue) && boolValue)
|
||||
{
|
||||
ffStrbufAppendS(&battery->manufacturer, "Apple Inc.");
|
||||
if (!battery->manufacturer.length)
|
||||
ffStrbufAppendS(&battery->manufacturer, "Apple Inc.");
|
||||
ffStrbufAppendS(&battery->technology, "Lithium");
|
||||
if (!battery->modelName.length)
|
||||
ffStrbufAppendS(&battery->modelName, "Built-in");
|
||||
}
|
||||
|
||||
ffCfDictGetInt(properties, CFSTR("CycleCount"), (int32_t*) &battery->cycleCount);
|
||||
int32_t cycleCount = 0;
|
||||
ffCfDictGetInt(properties, CFSTR(kIOPMPSCycleCountKey), &cycleCount);
|
||||
battery->cycleCount = cycleCount < 0 ? 0 : (uint32_t) cycleCount;
|
||||
|
||||
if (!ffCfDictGetBool(properties, CFSTR("ExternalConnected"), &boolValue) && boolValue)
|
||||
if (!ffCfDictGetBool(properties, CFSTR(kIOPMPSExternalConnectedKey), &boolValue) && boolValue)
|
||||
ffStrbufAppendS(&battery->status, "AC connected, ");
|
||||
else
|
||||
ffStrbufAppendS(&battery->status, "Discharging, ");
|
||||
if (!ffCfDictGetBool(properties, CFSTR("IsCharging"), &boolValue) && boolValue)
|
||||
if (!ffCfDictGetBool(properties, CFSTR(kIOPMPSIsChargingKey), &boolValue) && boolValue)
|
||||
ffStrbufAppendS(&battery->status, "Charging, ");
|
||||
if (!ffCfDictGetBool(properties, CFSTR("AtCriticalLevel"), &boolValue) && boolValue)
|
||||
if (!ffCfDictGetBool(properties, CFSTR(kIOPMPSAtCriticalLevelKey), &boolValue) && boolValue)
|
||||
ffStrbufAppendS(&battery->status, "Critical, ");
|
||||
ffStrbufTrimRight(&battery->status, ' ');
|
||||
ffStrbufTrimRight(&battery->status, ',');
|
||||
|
||||
int sbdsManufactureDate = 0;
|
||||
if (ffCfDictGetInt(properties, CFSTR(kIOPMPSManufactureDateKey), &sbdsManufactureDate) == NULL)
|
||||
{
|
||||
int day = sbdsManufactureDate & 0b11111;
|
||||
int month = (sbdsManufactureDate >> 5) & 0b1111;
|
||||
int year = (sbdsManufactureDate >> 9) + 1800;
|
||||
ffStrbufSetF(&battery->manufactureDate, "%.4d-%.2d-%.2d", year, month, day);
|
||||
}
|
||||
else
|
||||
{
|
||||
CFDictionaryRef batteryData;
|
||||
if (ffCfDictGetDict(properties, CFSTR("BatteryData"), &batteryData) == NULL)
|
||||
{
|
||||
char manufactureDate[sizeof(uint64_t)];
|
||||
if (ffCfDictGetInt64(batteryData, CFSTR(kIOPMPSManufactureDateKey), (int64_t*) manufactureDate) == NULL)
|
||||
{
|
||||
// https://github.com/AsahiLinux/linux/blob/b5c05cbffb0488c7618106926d522cc3b43d93d5/drivers/power/supply/macsmc_power.c#L410-L419
|
||||
int year = (manufactureDate[0] - '0') * 10 + (manufactureDate[1] - '0') + 2000 - 8;
|
||||
int month = (manufactureDate[2] - '0') * 10 + (manufactureDate[3] - '0');
|
||||
int day = (manufactureDate[4] - '0') * 10 + (manufactureDate[3] - '5');
|
||||
ffStrbufSetF(&battery->manufactureDate, "%.4d-%.2d-%.2d", year, month, day);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (options->temp)
|
||||
{
|
||||
int64_t temp;
|
||||
if (!ffCfDictGetInt64(properties, CFSTR("Temperature"), &temp))
|
||||
if (!ffCfDictGetInt64(properties, CFSTR(kIOPMPSBatteryTemperatureKey), &temp))
|
||||
battery->temperature = (double) temp / 10 - 273.15;
|
||||
else
|
||||
ffDetectCoreTemps(FF_TEMP_BATTERY, &battery->temperature);
|
||||
ffDetectSmcTemps(FF_TEMP_BATTERY, &battery->temperature);
|
||||
}
|
||||
|
||||
IOObjectRelease(registryEntry);
|
||||
}
|
||||
|
||||
IOObjectRelease(iterator);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -39,6 +39,8 @@ const char* ffDetectBattery(FF_MAYBE_UNUSED FFBatteryOptions* options, FFlist* r
|
||||
ffStrbufInit(&battery->modelName);
|
||||
ffStrbufInit(&battery->status);
|
||||
ffStrbufInit(&battery->technology);
|
||||
ffStrbufInit(&battery->serial);
|
||||
ffStrbufInit(&battery->manufactureDate);
|
||||
|
||||
battery->capacity = battio.battinfo.cap;
|
||||
if(battio.battinfo.state == ACPI_BATT_STAT_INVALID)
|
||||
@@ -52,13 +54,13 @@ const char* ffDetectBattery(FF_MAYBE_UNUSED FFBatteryOptions* options, FFlist* r
|
||||
else if(battio.battinfo.state & ACPI_BATT_STAT_CHARGING)
|
||||
ffStrbufAppendS(&battery->status, "Charging, ");
|
||||
if(battio.battinfo.state & ACPI_BATT_STAT_CRITICAL)
|
||||
ffStrbufAppendS(&battery->status, "Ctritical, ");
|
||||
ffStrbufAppendS(&battery->status, "Critical, ");
|
||||
}
|
||||
|
||||
int acadStatus;
|
||||
if (ioctl(acpifd, ACPIIO_ACAD_GET_STATUS, &acadStatus) >= 0 && acadStatus)
|
||||
{
|
||||
ffStrbufAppendS(&battery->status, "AC connected");
|
||||
ffStrbufAppendS(&battery->status, "AC Connected");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -5,107 +5,159 @@
|
||||
|
||||
#include <dirent.h>
|
||||
|
||||
// https://www.kernel.org/doc/Documentation/ABI/testing/sysfs-class-power
|
||||
|
||||
static void parseBattery(FFstrbuf* dir, const char* id, FFBatteryOptions* options, FFlist* results)
|
||||
{
|
||||
uint32_t dirLength = dir->length;
|
||||
|
||||
FF_STRBUF_AUTO_DESTROY testBatteryBuffer = ffStrbufCreate();
|
||||
FF_STRBUF_AUTO_DESTROY tmpBuffer = ffStrbufCreate();
|
||||
|
||||
//type must exist and be "Battery"
|
||||
ffStrbufAppendS(dir, "/type");
|
||||
ffReadFileBuffer(dir->chars, &testBatteryBuffer);
|
||||
if (ffReadFileBuffer(dir->chars, &tmpBuffer))
|
||||
ffStrbufTrimRightSpace(&tmpBuffer);
|
||||
ffStrbufSubstrBefore(dir, dirLength);
|
||||
|
||||
if(ffStrbufIgnCaseCompS(&testBatteryBuffer, "Battery") != 0)
|
||||
if(!ffStrbufIgnCaseEqualS(&tmpBuffer, "Battery"))
|
||||
return;
|
||||
|
||||
//scope may not exist or must not be "Device"
|
||||
ffStrbufAppendS(dir, "/scope");
|
||||
ffReadFileBuffer(dir->chars, &testBatteryBuffer);
|
||||
if (ffReadFileBuffer(dir->chars, &tmpBuffer))
|
||||
ffStrbufTrimRightSpace(&tmpBuffer);
|
||||
ffStrbufSubstrBefore(dir, dirLength);
|
||||
|
||||
if(ffStrbufIgnCaseCompS(&testBatteryBuffer, "Device") == 0)
|
||||
if(ffStrbufIgnCaseEqualS(&tmpBuffer, "Device"))
|
||||
return;
|
||||
|
||||
FFBatteryResult* result = ffListAdd(results);
|
||||
|
||||
//capacity must exist and be not empty
|
||||
ffStrbufAppendS(dir, "/capacity");
|
||||
bool available = ffReadFileBuffer(dir->chars, &testBatteryBuffer);
|
||||
bool available = ffReadFileBuffer(dir->chars, &tmpBuffer);
|
||||
ffStrbufSubstrBefore(dir, dirLength);
|
||||
if(available)
|
||||
result->capacity = ffStrbufToDouble(&testBatteryBuffer);
|
||||
|
||||
if(!available)
|
||||
{
|
||||
result->capacity = 0.0/0.0;
|
||||
--results->length;
|
||||
if (!available)
|
||||
return;
|
||||
}
|
||||
|
||||
FFBatteryResult* result = ffListAdd(results);
|
||||
result->capacity = ffStrbufToDouble(&tmpBuffer);
|
||||
|
||||
//At this point, we have a battery. Try to get as much values as possible.
|
||||
|
||||
ffStrbufInit(&result->manufacturer);
|
||||
ffStrbufAppendS(dir, "/manufacturer");
|
||||
ffReadFileBuffer(dir->chars, &result->manufacturer);
|
||||
if (ffReadFileBuffer(dir->chars, &result->manufacturer))
|
||||
ffStrbufTrimRightSpace(&result->manufacturer);
|
||||
else if (ffStrEquals(id, "macsmc-battery")) // asahi
|
||||
ffStrbufSetStatic(&result->manufacturer, "Apple Inc.");
|
||||
ffStrbufSubstrBefore(dir, dirLength);
|
||||
|
||||
ffStrbufInit(&result->modelName);
|
||||
ffStrbufAppendS(dir, "/model_name");
|
||||
ffReadFileBuffer(dir->chars, &result->modelName);
|
||||
if (ffReadFileBuffer(dir->chars, &result->modelName))
|
||||
ffStrbufTrimRightSpace(&result->modelName);
|
||||
ffStrbufSubstrBefore(dir, dirLength);
|
||||
|
||||
ffStrbufInit(&result->technology);
|
||||
ffStrbufAppendS(dir, "/technology");
|
||||
ffReadFileBuffer(dir->chars, &result->technology);
|
||||
if (ffReadFileBuffer(dir->chars, &result->technology))
|
||||
ffStrbufTrimRightSpace(&result->technology);
|
||||
ffStrbufSubstrBefore(dir, dirLength);
|
||||
|
||||
ffStrbufInit(&result->status);
|
||||
ffStrbufAppendS(dir, "/status");
|
||||
ffReadFileBuffer(dir->chars, &result->status);
|
||||
if (ffReadFileBuffer(dir->chars, &result->status))
|
||||
ffStrbufTrimRightSpace(&result->status);
|
||||
ffStrbufSubstrBefore(dir, dirLength);
|
||||
|
||||
// Unknown, Charging, Discharging, Not charging, Full
|
||||
if (ffStrbufEqualS(&result->status, "Not charging") || ffStrbufEqualS(&result->status, "Full"))
|
||||
ffStrbufSetStatic(&result->status, "AC Connected");
|
||||
else if (ffStrbufEqualS(&result->status, "Unknown"))
|
||||
ffStrbufClear(&result->status);
|
||||
|
||||
ffStrbufAppendS(dir, "/capacity_level");
|
||||
if (ffReadFileBuffer(dir->chars, &tmpBuffer))
|
||||
{
|
||||
ffStrbufTrimRightSpace(&result->manufacturer);
|
||||
if (ffStrbufEqualS(&tmpBuffer, "Critical"))
|
||||
{
|
||||
if (result->status.length)
|
||||
ffStrbufAppendS(&result->status, ", Critical");
|
||||
else
|
||||
ffStrbufSetStatic(&result->status, "Critical");
|
||||
}
|
||||
}
|
||||
ffStrbufSubstrBefore(dir, dirLength);
|
||||
|
||||
ffStrbufInit(&result->serial);
|
||||
ffStrbufAppendS(dir, "/serial_number");
|
||||
if (ffReadFileBuffer(dir->chars, &result->serial))
|
||||
ffStrbufTrimRightSpace(&result->serial);
|
||||
ffStrbufSubstrBefore(dir, dirLength);
|
||||
|
||||
ffStrbufAppendS(dir, "/cycle_count");
|
||||
ffReadFileBuffer(dir->chars, &testBatteryBuffer);
|
||||
available = ffReadFileBuffer(dir->chars, &tmpBuffer);
|
||||
ffStrbufSubstrBefore(dir, dirLength);
|
||||
if(dir->length)
|
||||
result->cycleCount = (uint32_t) ffStrbufToUInt(&testBatteryBuffer, 0);
|
||||
if (available)
|
||||
{
|
||||
int64_t cycleCount = ffStrbufToSInt(&tmpBuffer, 0);
|
||||
result->cycleCount = cycleCount < 0 || cycleCount > UINT32_MAX ? 0 : (uint32_t) cycleCount;
|
||||
}
|
||||
|
||||
ffStrbufInit(&result->manufactureDate);
|
||||
ffStrbufAppendS(dir, "/manufacture_year");
|
||||
available = ffReadFileBuffer(dir->chars, &tmpBuffer);
|
||||
ffStrbufSubstrBefore(dir, dirLength);
|
||||
if (available)
|
||||
{
|
||||
int year = (int) ffStrbufToSInt(&tmpBuffer, 0);
|
||||
if (year > 0)
|
||||
{
|
||||
ffStrbufAppendS(dir, "/manufacture_month");
|
||||
available = ffReadFileBuffer(dir->chars, &tmpBuffer);
|
||||
ffStrbufSubstrBefore(dir, dirLength);
|
||||
if (available)
|
||||
{
|
||||
int month = (int) ffStrbufToSInt(&tmpBuffer, 0);
|
||||
if (month > 0)
|
||||
{
|
||||
ffStrbufAppendS(dir, "/manufacture_day");
|
||||
available = ffReadFileBuffer(dir->chars, &tmpBuffer);
|
||||
ffStrbufSubstrBefore(dir, dirLength);
|
||||
if (available)
|
||||
{
|
||||
int day = (int) ffStrbufToSInt(&tmpBuffer, 0);
|
||||
if (day > 0)
|
||||
{
|
||||
ffStrbufSetF(&result->manufactureDate, "%.4d-%.2d-%.2d", year, month, day);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
result->temperature = FF_BATTERY_TEMP_UNSET;
|
||||
if (options->temp)
|
||||
{
|
||||
const FFlist* tempsResult = ffDetectTemps();
|
||||
|
||||
FF_LIST_FOR_EACH(FFTempValue, value, *tempsResult)
|
||||
{
|
||||
if (ffStrbufEqualS(&value->name, id))
|
||||
{
|
||||
result->temperature = value->value;
|
||||
break;
|
||||
}
|
||||
}
|
||||
ffStrbufAppendS(dir, "/temp");
|
||||
if (ffReadFileBuffer(dir->chars, &tmpBuffer))
|
||||
result->temperature = ffStrbufToDouble(&tmpBuffer) / 10;
|
||||
ffStrbufSubstrBefore(dir, dirLength);
|
||||
}
|
||||
}
|
||||
|
||||
const char* ffDetectBattery(FFBatteryOptions* options, FFlist* results)
|
||||
{
|
||||
FF_STRBUF_AUTO_DESTROY baseDir = ffStrbufCreateA(64);
|
||||
|
||||
if(options->dir.length > 0)
|
||||
{
|
||||
ffStrbufAppend(&baseDir, &options->dir);
|
||||
ffStrbufEnsureEndsWithC(&baseDir, '/');
|
||||
}
|
||||
else
|
||||
{
|
||||
ffStrbufAppendS(&baseDir, "/sys/class/power_supply/");
|
||||
}
|
||||
ffStrbufAppendS(&baseDir, "/sys/class/power_supply/");
|
||||
|
||||
uint32_t baseDirLength = baseDir.length;
|
||||
|
||||
FF_AUTO_CLOSE_DIR DIR* dirp = opendir(baseDir.chars);
|
||||
if(dirp == NULL)
|
||||
return "opendir(batteryDir) == NULL";
|
||||
return "opendir(\"/sys/class/power_supply/\") == NULL";
|
||||
|
||||
struct dirent* entry;
|
||||
while((entry = readdir(dirp)) != NULL)
|
||||
@@ -118,8 +170,5 @@ const char* ffDetectBattery(FFBatteryOptions* options, FFlist* results)
|
||||
ffStrbufSubstrBefore(&baseDir, baseDirLength);
|
||||
}
|
||||
|
||||
if(results->length == 0)
|
||||
return "batteryDir doesn't contain any battery folder";
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
#include "battery.h"
|
||||
|
||||
#include "common/io/io.h"
|
||||
#include "util/windows/nt.h"
|
||||
#include "util/windows/unicode.h"
|
||||
#include "util/mallocHelper.h"
|
||||
#include "util/smbiosHelper.h"
|
||||
|
||||
#undef WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
@@ -9,21 +13,6 @@
|
||||
#include <devguid.h>
|
||||
#include <winternl.h>
|
||||
|
||||
NTSYSCALLAPI
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
NtPowerInformation(
|
||||
IN POWER_INFORMATION_LEVEL InformationLevel,
|
||||
IN PVOID InputBuffer OPTIONAL,
|
||||
IN ULONG InputBufferLength,
|
||||
OUT PVOID OutputBuffer OPTIONAL,
|
||||
IN ULONG OutputBufferLength);
|
||||
|
||||
static inline void wrapCloseHandle(HANDLE* handle)
|
||||
{
|
||||
if(*handle)
|
||||
CloseHandle(*handle);
|
||||
}
|
||||
static inline void wrapSetupDiDestroyDeviceInfoList(HDEVINFO* hdev)
|
||||
{
|
||||
if(*hdev)
|
||||
@@ -51,7 +40,7 @@ static const char* detectWithSetupApi(FFBatteryOptions* options, FFlist* results
|
||||
if(!SetupDiGetDeviceInterfaceDetailW(hdev, &did, pdidd, cbRequired, &cbRequired, NULL))
|
||||
continue;
|
||||
|
||||
HANDLE __attribute__((__cleanup__(wrapCloseHandle))) hBattery =
|
||||
HANDLE FF_AUTO_CLOSE_FD hBattery =
|
||||
CreateFileW(pdidd->DevicePath, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
|
||||
|
||||
if(hBattery == INVALID_HANDLE_VALUE)
|
||||
@@ -75,19 +64,19 @@ static const char* detectWithSetupApi(FFBatteryOptions* options, FFlist* results
|
||||
FFBatteryResult* battery = (FFBatteryResult*)ffListAdd(results);
|
||||
|
||||
if(memcmp(bi.Chemistry, "PbAc", 4) == 0)
|
||||
ffStrbufInitS(&battery->technology, "Lead Acid");
|
||||
ffStrbufInitStatic(&battery->technology, "Lead Acid");
|
||||
else if(memcmp(bi.Chemistry, "LION", 4) == 0 || memcmp(bi.Chemistry, "Li-I", 4) == 0)
|
||||
ffStrbufInitS(&battery->technology, "Lithium Ion");
|
||||
ffStrbufInitStatic(&battery->technology, "Lithium Ion");
|
||||
else if(memcmp(bi.Chemistry, "NiCd", 4) == 0)
|
||||
ffStrbufInitS(&battery->technology, "Nickel Cadmium");
|
||||
ffStrbufInitStatic(&battery->technology, "Nickel Cadmium");
|
||||
else if(memcmp(bi.Chemistry, "NiMH", 4) == 0)
|
||||
ffStrbufInitS(&battery->technology, "Nickel Metal Hydride");
|
||||
ffStrbufInitStatic(&battery->technology, "Nickel Metal Hydride");
|
||||
else if(memcmp(bi.Chemistry, "NiZn", 4) == 0)
|
||||
ffStrbufInitS(&battery->technology, "Nickel Zinc");
|
||||
ffStrbufInitStatic(&battery->technology, "Nickel Zinc");
|
||||
else if(memcmp(bi.Chemistry, "RAM\0", 4) == 0)
|
||||
ffStrbufInitS(&battery->technology, "Rechargeable Alkaline-Manganese");
|
||||
ffStrbufInitStatic(&battery->technology, "Rechargeable Alkaline-Manganese");
|
||||
else
|
||||
ffStrbufInitS(&battery->technology, "Unknown");
|
||||
ffStrbufInitStatic(&battery->technology, "Unknown");
|
||||
|
||||
{
|
||||
ffStrbufInit(&battery->modelName);
|
||||
@@ -105,6 +94,22 @@ static const char* detectWithSetupApi(FFBatteryOptions* options, FFlist* results
|
||||
ffStrbufSetWS(&battery->manufacturer, name);
|
||||
}
|
||||
|
||||
{
|
||||
ffStrbufInit(&battery->manufactureDate);
|
||||
bqi.InformationLevel = BatteryManufactureDate;
|
||||
BATTERY_MANUFACTURE_DATE date;
|
||||
if(DeviceIoControl(hBattery, IOCTL_BATTERY_QUERY_INFORMATION, &bqi, sizeof(bqi), &date, sizeof(date), &dwOut, NULL))
|
||||
ffStrbufSetF(&battery->manufactureDate, "%.4d-%.2d-%.2d", date.Year + 1900, date.Month, date.Day);
|
||||
}
|
||||
|
||||
{
|
||||
ffStrbufInit(&battery->serial);
|
||||
bqi.InformationLevel = BatterySerialNumber;
|
||||
wchar_t name[64];
|
||||
if(DeviceIoControl(hBattery, IOCTL_BATTERY_QUERY_INFORMATION, &bqi, sizeof(bqi), name, sizeof(name), &dwOut, NULL))
|
||||
ffStrbufSetWS(&battery->serial, name);
|
||||
}
|
||||
|
||||
battery->cycleCount = bi.CycleCount;
|
||||
|
||||
battery->temperature = 0.0/0.0;
|
||||
@@ -113,7 +118,7 @@ static const char* detectWithSetupApi(FFBatteryOptions* options, FFlist* results
|
||||
bqi.InformationLevel = BatteryTemperature;
|
||||
ULONG temp;
|
||||
if(DeviceIoControl(hBattery, IOCTL_BATTERY_QUERY_INFORMATION, &bqi, sizeof(bqi), &temp, sizeof(temp), &dwOut, NULL))
|
||||
battery->temperature = temp;
|
||||
battery->temperature = temp / 10.0 - 273.15;
|
||||
}
|
||||
|
||||
{
|
||||
@@ -140,6 +145,88 @@ static const char* detectWithSetupApi(FFBatteryOptions* options, FFlist* results
|
||||
return NULL;
|
||||
}
|
||||
|
||||
typedef struct FFSmbiosPortableBattery
|
||||
{
|
||||
FFSmbiosHeader Header;
|
||||
|
||||
// 2.1+
|
||||
uint8_t Location; // string
|
||||
uint8_t Manufacturer; // string
|
||||
uint8_t ManufactureDate; // string
|
||||
uint8_t SerialNumber; // string
|
||||
uint8_t DeviceName; // string
|
||||
uint8_t DeviceChemistry; // enum
|
||||
uint16_t DesignCapacity; // varies
|
||||
uint16_t DesignVoltage; // varies
|
||||
uint8_t SbdsVersionNumber; // string
|
||||
uint8_t MaximumErrorInBatteryData; // varies
|
||||
|
||||
// 2.2+
|
||||
uint16_t SbdsSerialNumber; // varies
|
||||
uint16_t SbdsManufactureDate; // varies
|
||||
uint8_t SbdsDeviceChemistry; // string
|
||||
uint8_t DesignCapacityMultiplier; // varies
|
||||
uint16_t OEMSpecific; // varies
|
||||
} __attribute__((__packed__)) FFSmbiosPortableBattery;
|
||||
|
||||
static_assert(offsetof(FFSmbiosPortableBattery, OEMSpecific) == 0x16,
|
||||
"FFSmbiosPortableBattery: Wrong struct alignment");
|
||||
|
||||
const char* detectBySmbios(FFBatteryResult* battery)
|
||||
{
|
||||
const FFSmbiosHeaderTable* smbiosTable = ffGetSmbiosHeaderTable();
|
||||
if (!smbiosTable)
|
||||
return "Failed to get SMBIOS data";
|
||||
|
||||
const FFSmbiosPortableBattery* data = (const FFSmbiosPortableBattery*) (*smbiosTable)[FF_SMBIOS_TYPE_PORTABLE_BATTERY];
|
||||
if (!data)
|
||||
return "Portable battery section is not found in SMBIOS data";
|
||||
|
||||
const char* strings = (const char*) data + data->Header.Length;
|
||||
|
||||
ffStrbufSetStatic(&battery->modelName, ffSmbiosLocateString(strings, data->DeviceName));
|
||||
ffCleanUpSmbiosValue(&battery->modelName);
|
||||
ffStrbufSetStatic(&battery->manufacturer, ffSmbiosLocateString(strings, data->Manufacturer));
|
||||
ffCleanUpSmbiosValue(&battery->manufacturer);
|
||||
|
||||
if (data->ManufactureDate)
|
||||
{
|
||||
ffStrbufSetStatic(&battery->manufactureDate, ffSmbiosLocateString(strings, data->ManufactureDate));
|
||||
ffCleanUpSmbiosValue(&battery->manufactureDate);
|
||||
}
|
||||
else if (data->Header.Length > offsetof(FFSmbiosPortableBattery, SbdsManufactureDate))
|
||||
{
|
||||
int day = data->SbdsManufactureDate & 0b11111;
|
||||
int month = (data->SbdsManufactureDate >> 5) & 0b1111;
|
||||
int year = (data->SbdsManufactureDate >> 9) + 1800;
|
||||
ffStrbufSetF(&battery->manufactureDate, "%.4d-%.2d-%.2d", year, month, day);
|
||||
}
|
||||
|
||||
switch (data->DeviceChemistry)
|
||||
{
|
||||
case 0x01: ffStrbufSetStatic(&battery->technology, "Other"); break;
|
||||
case 0x02: ffStrbufSetStatic(&battery->technology, "Unknown"); break;
|
||||
case 0x03: ffStrbufSetStatic(&battery->technology, "Lead Acid"); break;
|
||||
case 0x04: ffStrbufSetStatic(&battery->technology, "Nickel Cadmium"); break;
|
||||
case 0x05: ffStrbufSetStatic(&battery->technology, "Nickel metal hydride"); break;
|
||||
case 0x06: ffStrbufSetStatic(&battery->technology, "Lithium-ion"); break;
|
||||
case 0x07: ffStrbufSetStatic(&battery->technology, "Zinc air"); break;
|
||||
case 0x08: ffStrbufSetStatic(&battery->technology, "Lithium Polymer"); break;
|
||||
}
|
||||
|
||||
if (data->SerialNumber)
|
||||
{
|
||||
ffStrbufSetStatic(&battery->serial, ffSmbiosLocateString(strings, data->SerialNumber));
|
||||
ffCleanUpSmbiosValue(&battery->serial);
|
||||
}
|
||||
else if (data->Header.Length > offsetof(FFSmbiosPortableBattery, SbdsSerialNumber))
|
||||
{
|
||||
ffStrbufSetF(&battery->serial, "%4X", data->SbdsSerialNumber);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static const char* detectWithNtApi(FF_MAYBE_UNUSED FFBatteryOptions* options, FFlist* results)
|
||||
{
|
||||
SYSTEM_BATTERY_STATE info;
|
||||
@@ -148,9 +235,11 @@ static const char* detectWithNtApi(FF_MAYBE_UNUSED FFBatteryOptions* options, FF
|
||||
FFBatteryResult* battery = (FFBatteryResult*)ffListAdd(results);
|
||||
ffStrbufInit(&battery->modelName);
|
||||
ffStrbufInit(&battery->manufacturer);
|
||||
ffStrbufInit(&battery->manufactureDate);
|
||||
ffStrbufInit(&battery->technology);
|
||||
ffStrbufInit(&battery->status);
|
||||
battery->temperature = 0.0/0.0;
|
||||
ffStrbufInit(&battery->serial);
|
||||
battery->temperature = FF_BATTERY_TEMP_UNSET;
|
||||
battery->cycleCount = 0;
|
||||
|
||||
battery->capacity = info.RemainingCapacity * 100.0 / info.MaxCapacity;
|
||||
@@ -162,6 +251,9 @@ static const char* detectWithNtApi(FF_MAYBE_UNUSED FFBatteryOptions* options, FF
|
||||
}
|
||||
else if(info.Discharging)
|
||||
ffStrbufAppendS(&battery->status, "Discharging");
|
||||
|
||||
detectBySmbios(battery);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
return "NtPowerInformation(SystemBatteryState) failed";
|
||||
@@ -169,7 +261,7 @@ static const char* detectWithNtApi(FF_MAYBE_UNUSED FFBatteryOptions* options, FF
|
||||
|
||||
const char* ffDetectBattery(FFBatteryOptions* options, FFlist* results)
|
||||
{
|
||||
return true
|
||||
return options->useSetupApi
|
||||
? detectWithSetupApi(options, results)
|
||||
: detectWithNtApi(options, results);
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
#include "common/settings.h"
|
||||
#include "common/sysctl.h"
|
||||
#include "common/io/io.h"
|
||||
#include "util/smbiosHelper.h"
|
||||
|
||||
const char* ffDetectBios(FFBiosResult* result)
|
||||
@@ -15,5 +16,18 @@ const char* ffDetectBios(FFBiosResult* result)
|
||||
ffSettingsGetFreeBSDKenv("smbios.bios.version", &result->version);
|
||||
ffCleanUpSmbiosValue(&result->version);
|
||||
ffSysctlGetString("machdep.bootmethod", &result->type);
|
||||
|
||||
if (result->type.length == 0)
|
||||
{
|
||||
if (ffSettingsGetFreeBSDKenv("loader.efi", &result->type))
|
||||
ffStrbufSetStatic(&result->type, ffStrbufEqualS(&result->type, "1") ? "UEFI" : "BIOS");
|
||||
else
|
||||
{
|
||||
ffStrbufSetStatic(&result->type,
|
||||
ffPathExists("/dev/efi" /*efidev*/, FF_PATHTYPE_FILE) ||
|
||||
ffPathExists("/boot/efi/efi" /*efi partition*/, FF_PATHTYPE_DIRECTORY)
|
||||
? "UEFI" : "BIOS");
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -4,25 +4,12 @@
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
static void getSmbiosValue(const char* devicesPath, const char* classPath, FFstrbuf* buffer)
|
||||
const char *ffDetectBios(FFBiosResult *bios)
|
||||
{
|
||||
ffReadFileBuffer(devicesPath, buffer);
|
||||
if(ffIsSmbiosValueSet(buffer))
|
||||
return;
|
||||
|
||||
ffReadFileBuffer(classPath, buffer);
|
||||
if(ffIsSmbiosValueSet(buffer))
|
||||
return;
|
||||
|
||||
ffStrbufClear(buffer);
|
||||
}
|
||||
|
||||
const char* ffDetectBios(FFBiosResult* bios)
|
||||
{
|
||||
getSmbiosValue("/sys/devices/virtual/dmi/id/bios_date", "/sys/class/dmi/id/bios_date", &bios->date);
|
||||
getSmbiosValue("/sys/devices/virtual/dmi/id/bios_release", "/sys/class/dmi/id/bios_release", &bios->release);
|
||||
getSmbiosValue("/sys/devices/virtual/dmi/id/bios_vendor", "/sys/class/dmi/id/bios_vendor", &bios->vendor);
|
||||
getSmbiosValue("/sys/devices/virtual/dmi/id/bios_version", "/sys/class/dmi/id/bios_version", &bios->version);
|
||||
ffGetSmbiosValue("/sys/devices/virtual/dmi/id/bios_date", "/sys/class/dmi/id/bios_date", &bios->date);
|
||||
ffGetSmbiosValue("/sys/devices/virtual/dmi/id/bios_release", "/sys/class/dmi/id/bios_release", &bios->release);
|
||||
ffGetSmbiosValue("/sys/devices/virtual/dmi/id/bios_vendor", "/sys/class/dmi/id/bios_vendor", &bios->vendor);
|
||||
ffGetSmbiosValue("/sys/devices/virtual/dmi/id/bios_version", "/sys/class/dmi/id/bios_version", &bios->version);
|
||||
if (ffPathExists("/sys/firmware/efi", FF_PATHTYPE_DIRECTORY) || ffPathExists("/sys/firmware/acpi/tables/UEFI", FF_PATHTYPE_FILE))
|
||||
ffStrbufSetStatic(&bios->type, "UEFI");
|
||||
else
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include "bios.h"
|
||||
#include "util/windows/registry.h"
|
||||
#include "util/smbiosHelper.h"
|
||||
#include "util/windows/registry.h"
|
||||
|
||||
#include <ntstatus.h>
|
||||
#include <winternl.h>
|
||||
@@ -26,27 +26,53 @@ typedef struct _SYSTEM_BOOT_ENVIRONMENT_INFORMATION
|
||||
};
|
||||
} SYSTEM_BOOT_ENVIRONMENT_INFORMATION;
|
||||
|
||||
|
||||
typedef struct FFSmbiosBios
|
||||
{
|
||||
FFSmbiosHeader Header;
|
||||
|
||||
uint8_t Vendor; // string
|
||||
uint8_t BiosVersion; // string
|
||||
uint16_t BiosStartingAddressSegment; // varies
|
||||
uint8_t BiosReleaseDate; // string
|
||||
uint8_t BiosRomSize; // string
|
||||
uint64_t BiosCharacteristics; // bit field
|
||||
|
||||
// 2.4+
|
||||
uint8_t BiosCharacteristicsExtensionBytes[2]; // bit field
|
||||
uint8_t SystemBiosMajorRelease; // varies
|
||||
uint8_t SystemBiosMinorRelease; // varies
|
||||
uint8_t EmbeddedControllerFirmwareMajorRelease; // varies
|
||||
uint8_t EmbeddedControllerFirmwareMinorRelease; // varies
|
||||
|
||||
// 3.1+
|
||||
uint16_t ExtendedBiosRomSize; // bit field
|
||||
} __attribute__((__packed__)) FFSmbiosBios;
|
||||
|
||||
static_assert(offsetof(FFSmbiosBios, ExtendedBiosRomSize) == 0x18,
|
||||
"FFSmbiosBios: Wrong struct alignment");
|
||||
|
||||
const char* ffDetectBios(FFBiosResult* bios)
|
||||
{
|
||||
FF_HKEY_AUTO_DESTROY hKey = NULL;
|
||||
if(!ffRegOpenKeyForRead(HKEY_LOCAL_MACHINE, L"HARDWARE\\DESCRIPTION\\System\\BIOS", &hKey, NULL))
|
||||
return "ffRegOpenKeyForRead(HKEY_LOCAL_MACHINE, L\"HARDWARE\\DESCRIPTION\\System\\BIOS\", &hKey, NULL) failed";
|
||||
const FFSmbiosHeaderTable* smbiosTable = ffGetSmbiosHeaderTable();
|
||||
if (!smbiosTable)
|
||||
return "Failed to get SMBIOS data";
|
||||
|
||||
if(!ffRegReadStrbuf(hKey, L"BIOSVersion", &bios->version, NULL))
|
||||
return "\"HKEY_LOCAL_MACHINE\\HARDWARE\\DESCRIPTION\\System\\BIOS\\BIOSVersion\" doesn't exist";
|
||||
const FFSmbiosBios* data = (const FFSmbiosBios*) (*smbiosTable)[FF_SMBIOS_TYPE_BIOS];
|
||||
if (!data)
|
||||
return "BIOS section is not found in SMBIOS data";
|
||||
|
||||
const char* strings = (const char*) data + data->Header.Length;
|
||||
|
||||
ffStrbufSetStatic(&bios->version, ffSmbiosLocateString(strings, data->BiosVersion));
|
||||
ffCleanUpSmbiosValue(&bios->version);
|
||||
ffRegReadStrbuf(hKey, L"BIOSVendor", &bios->vendor, NULL);
|
||||
ffStrbufSetStatic(&bios->vendor, ffSmbiosLocateString(strings, data->Vendor));
|
||||
ffCleanUpSmbiosValue(&bios->vendor);
|
||||
ffRegReadStrbuf(hKey, L"BIOSReleaseDate", &bios->date, NULL);
|
||||
ffStrbufSetStatic(&bios->date, ffSmbiosLocateString(strings, data->BiosReleaseDate));
|
||||
ffCleanUpSmbiosValue(&bios->date);
|
||||
|
||||
uint32_t major, minor;
|
||||
if(
|
||||
ffRegReadUint(hKey, L"BiosMajorRelease", &major, NULL) &&
|
||||
ffRegReadUint(hKey, L"BiosMinorRelease", &minor, NULL)
|
||||
)
|
||||
ffStrbufAppendF(&bios->release, "%u.%u", (unsigned)major, (unsigned)minor);
|
||||
if (data->Header.Length > offsetof(FFSmbiosBios, SystemBiosMajorRelease))
|
||||
ffStrbufSetF(&bios->release, "%u.%u", data->SystemBiosMajorRelease, data->SystemBiosMinorRelease);
|
||||
|
||||
// Same as GetFirmwareType, but support (?) Windows 7
|
||||
// https://ntdoc.m417z.com/system_information_class
|
||||
|
||||
@@ -7,6 +7,7 @@ typedef struct FFBoardResult
|
||||
FFstrbuf name;
|
||||
FFstrbuf vendor;
|
||||
FFstrbuf version;
|
||||
FFstrbuf serial;
|
||||
} FFBoardResult;
|
||||
|
||||
const char* ffDetectBoard(FFBoardResult* board);
|
||||
|
||||
@@ -1,13 +1,21 @@
|
||||
#include "board.h"
|
||||
|
||||
#include "common/sysctl.h"
|
||||
#include "util/apple/cf_helpers.h"
|
||||
|
||||
const char* ffDetectBoard(FFBoardResult* result)
|
||||
{
|
||||
const char* error = ffSysctlGetString("hw.model", &result->name);
|
||||
if (error)
|
||||
return error;
|
||||
FF_IOOBJECT_AUTO_RELEASE io_registry_entry_t service = IOServiceGetMatchingService(MACH_PORT_NULL, IOServiceMatching("IOPlatformExpertDevice"));
|
||||
if (!service)
|
||||
return "No IOPlatformExpertDevice found";
|
||||
|
||||
io_name_t name;
|
||||
if (IORegistryEntryGetName(service, name) == kIOReturnSuccess)
|
||||
ffStrbufSetS(&result->name, name);
|
||||
|
||||
FF_CFTYPE_AUTO_RELEASE CFTypeRef manufacturer = IORegistryEntryCreateCFProperty(service, CFSTR("manufacturer"), kCFAllocatorDefault, kNilOptions);
|
||||
if (manufacturer)
|
||||
ffCfStrGetString(manufacturer, &result->vendor);
|
||||
|
||||
ffStrbufSetStatic(&result->vendor, "Apple");
|
||||
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