Compare commits
519 Commits
1.4.11
...
neofetch-8.1.0
| Author | SHA1 | Date | |
|---|---|---|---|
| 9cf9985973 | |||
| 18bb479415 | |||
| b667cc8ad6 | |||
| e838166b16 | |||
| 43e1dc1067 | |||
| cc5d7570fb | |||
| b05d9c44b4 | |||
| 2995c78e66 | |||
| 1d89f237db | |||
| 75cde60494 | |||
| fa71dfb84e | |||
| c147a2ffc6 | |||
| 9cc0f9a111 | |||
| 0aa7731c17 | |||
| 255dd3e630 | |||
| 7100f7a682 | |||
| 68cb804ccf | |||
| e9b65287a3 | |||
| 5ff0a8d49a | |||
| 635fbfff01 | |||
| 13e56f621b | |||
| 9500e8c0aa | |||
| e5ba2b3be9 | |||
| e78e60da3d | |||
| 809b9c34f4 | |||
| 352a1ba086 | |||
| b81d5fed1b | |||
| f32e2df4fa | |||
| abcc1d265b | |||
| 25824da0e0 | |||
| 5e0f1ee909 | |||
| 62b0fd959f | |||
| 9a66c10afd | |||
| 62fdc22c00 | |||
| 1fdcfa66b8 | |||
| d08a0745a5 | |||
| 4ee5344209 | |||
| 26030b0628 | |||
| 9b376f97c0 | |||
| 2dc18050ca | |||
| e816235637 | |||
| 8046e9bab3 | |||
| e03cda1475 | |||
| 20e5fb3f89 | |||
| e253a75924 | |||
| 2252fc36e7 | |||
| 4e23243384 | |||
| f6dc68d7dc | |||
| f947373a23 | |||
| 5b745cde01 | |||
| 1afbd66355 | |||
| 2fe21deea8 | |||
| 37a19901bb | |||
| 063679b72d | |||
| 264cf11690 | |||
| 6280d370bc | |||
| 6cfc337d83 | |||
| 533de96e80 | |||
| dee984f931 | |||
| 959d42ee9c | |||
| eb349aa1aa | |||
| d5751e06af | |||
| 981602b690 | |||
| a8d752aa9f | |||
| c57e8a4a49 | |||
| 67ae918ae8 | |||
| e788f93c2b | |||
| 75a2e9d8d3 | |||
| 23888c0e3e | |||
| e5ad9e564d | |||
| 328381b336 | |||
| 28a181d97b | |||
| bb514f8fd9 | |||
| b585ee1e26 | |||
| de2141347e | |||
| ba88581ed4 | |||
| 932042b62c | |||
| f5c5e31691 | |||
| 15ca855a04 | |||
| 666d2dc90a | |||
| 34583294c6 | |||
| 03615ab4ee | |||
| c722c73e79 | |||
| 8f5199974b | |||
| 8168877fb1 | |||
| 4e20b18d45 | |||
| 5dc1709f58 | |||
| fb1e35172e | |||
| fc9292be3f | |||
| 3f41cb40e2 | |||
| 729024a45f | |||
| ef1407d00e | |||
| 075fc467d2 | |||
| a463f4234c | |||
| beb04101db | |||
| bf60e4265b | |||
| 42421bc57d | |||
| f64ee7b7e9 | |||
| 1fa29cf831 | |||
| 4861dd5d4a | |||
| 5614b723fd | |||
| 5e1e13b091 | |||
| 79ddb3ca92 | |||
| 684929edea | |||
| f02ec8c4ba | |||
| 5fd4ed9b0c | |||
| 003c295084 | |||
| d4560e3edb | |||
| 62b4c27404 | |||
| 169368a784 | |||
| 3e47640c1a | |||
| 6ddd762b35 | |||
| 713bcce0ec | |||
| fdfd9816f5 | |||
| d6f9d1f569 | |||
| b28aa0ddf2 | |||
| a5e784c528 | |||
| 93b4dd3471 | |||
| d15afe579f | |||
| f79aca3c65 | |||
| fa3fc59a5f | |||
| afa3c1dfb9 | |||
| cf6b77a1b7 | |||
| b58425badd | |||
| 8c1713c37d | |||
| 3c7c449da4 | |||
| 2fe4b3f287 | |||
| 6a80928f10 | |||
| 4ac698817d | |||
| 13acc0b6b6 | |||
| 455f0382e7 | |||
| 0c9e4db742 | |||
| aee058e591 | |||
| b74787768f | |||
| 218c535d06 | |||
| 76ae5e507a | |||
| d2dfd950a3 | |||
| 45ee7e199e | |||
| 2cfea54a88 | |||
| 0cc6ddbca8 | |||
| 8a536c30f0 | |||
| 5c24bd443a | |||
| e691b2d9da | |||
| 5ec7b4f01a | |||
| f38b754783 | |||
| 211beb7b6a | |||
| 02c64ef281 | |||
| 4e9c510240 | |||
| d6b559fb40 | |||
| 9806ced8b2 | |||
| 982ac52c69 | |||
| f9c9a92048 | |||
| b8e5dadd78 | |||
| 287921439d | |||
| e8e0a58e4b | |||
| 3a80670491 | |||
| 8cc06c02b5 | |||
| 48f52be2d3 | |||
| b009342d78 | |||
| 8e4b57e33a | |||
| 9a9101a9a3 | |||
| 90d12d9385 | |||
| ca74acbafb | |||
| afd9ad33d4 | |||
| cafa3ff752 | |||
| a0db219ba3 | |||
| 89cced9950 | |||
| 1ff4b12f19 | |||
| 4f8ddd1c22 | |||
| 7a42824883 | |||
| 916f7274df | |||
| 79fc190013 | |||
| e78d95e573 | |||
| 943503004d | |||
| deb2bddbe1 | |||
| 15fabbdb1a | |||
| df71b0132a | |||
| 191995c0fe | |||
| 6558cf39f1 | |||
| 99d652383a | |||
| e78ae3233c | |||
| a60dd35169 | |||
| ccc8121550 | |||
| bb260890c5 | |||
| 057b3b53e2 | |||
| 3a96fe8561 | |||
| 1b3b5ca883 | |||
| 53f7e3fcdb | |||
| e630b7837f | |||
| aa065fe910 | |||
| 28b365d418 | |||
| 4ea0a4a9dc | |||
| b5b49ecbc0 | |||
| cf56c60006 | |||
| a6225d698f | |||
| d5621877d5 | |||
| d5b93829fc | |||
| f3fc92dc7d | |||
| 36fc38c7a9 | |||
| 6af128fb05 | |||
| 8b3e4bba76 | |||
| 1211dc6978 | |||
| d0f911922a | |||
| c68dd7fe5b | |||
| 49b26dc7ea | |||
| f815d2bdd6 | |||
| b0b8c51d35 | |||
| 87e6092446 | |||
| fb52256729 | |||
| 5e11110c66 | |||
| a8b94f9187 | |||
| 3754aada04 | |||
| f94e788547 | |||
| a5f648a3fa | |||
| e184ed613a | |||
| f4d6b75f56 | |||
| 865850da59 | |||
| 54e0f55a08 | |||
| c969ce3a21 | |||
| afc646c679 | |||
| 6ac7f70c51 | |||
| c1fbd137a0 | |||
| 6f913b6d4a | |||
| 1077ee5142 | |||
| cec24f6bd0 | |||
| 9636c980e7 | |||
| 3866ad0249 | |||
| 0ca67a5608 | |||
| b2f7a3cee9 | |||
| b33b26625a | |||
| 1e67d65cec | |||
| e04ef3b0fd | |||
| a51a19658a | |||
| a65a229b0e | |||
| 5c0662142e | |||
| 88d835f511 | |||
| ce358fc155 | |||
| d5b283e64d | |||
| a609edc505 | |||
| 753d35b56e | |||
| d309f2d8a8 | |||
| e59a0556ed | |||
| afa18885ee | |||
| 69f07aec8f | |||
| 95a6cc7f4b | |||
| 896ba8fc7d | |||
| 319afd2aa9 | |||
| 3df77e0042 | |||
| 729e81a3e2 | |||
| 3dafba3554 | |||
| 36d87c2c35 | |||
| 0f744ff815 | |||
| 0dea6eb11b | |||
| 05685de193 | |||
| 03a6802b8f | |||
| d6341d241a | |||
| 32dd56dc63 | |||
| 6732945af8 | |||
| bb6b9b1d37 | |||
| 474f744bc6 | |||
| 7c139595a6 | |||
| ebd253523b | |||
| 13e29325b9 | |||
| 00369355e6 | |||
| 2865ee7131 | |||
| faa7ab240f | |||
| bcdc720d8a | |||
| 52844b55ad | |||
| 6ccf0d9c31 | |||
| e46e78ecd5 | |||
| 2f18cc2826 | |||
| 4c72ed6d79 | |||
| 55b0eed88d | |||
| 28f98a40fb | |||
| bbe40930c2 | |||
| a5913cc3d7 | |||
| f976781997 | |||
| cbe176ff4e | |||
| fe7ed923ea | |||
| c2795125d2 | |||
| 370b56c1db | |||
| f47561c947 | |||
| 89e5342614 | |||
| 4e3ec2604a | |||
| 279311fea0 | |||
| a7c277cb76 | |||
| c2586212d6 | |||
| 632296dbb4 | |||
| fe7d902dac | |||
| c7295ebed8 | |||
| bdd03a34af | |||
| 683d1fc2ec | |||
| c80a6185fc | |||
| 6564ca72c2 | |||
| 2a8cd48674 | |||
| 13ead437ec | |||
| 8edb50c4d8 | |||
| 14ff66b836 | |||
| 0c7c43d71c | |||
| 2613471978 | |||
| a558cf7ac9 | |||
| cd1858134c | |||
| 0a31cd0817 | |||
| e25684cfd8 | |||
| de43bf74a9 | |||
| d8f3302b89 | |||
| 5517283fb2 | |||
| 66b08f7a2e | |||
| 19e3b382b4 | |||
| e10bdac351 | |||
| 6e28482706 | |||
| 198742e15b | |||
| a5de091883 | |||
| da5f6ef655 | |||
| dbecd3d705 | |||
| e2d538df1f | |||
| 8514629960 | |||
| d11f6f0a9f | |||
| 45347e0714 | |||
| d79196a7fc | |||
| 114de9be12 | |||
| 4861744b50 | |||
| 66b57cfea6 | |||
| ca583bddcb | |||
| 965b009bc7 | |||
| 5b759e0986 | |||
| 3cc26d7dd9 | |||
| 85a85ad4d3 | |||
| f3b1840e92 | |||
| d773c69918 | |||
| 290da7c363 | |||
| fa66bb486b | |||
| 1239e86d1a | |||
| 66491a4e73 | |||
| c100ca52a6 | |||
| 46b618252f | |||
| be70233b03 | |||
| b5588d8259 | |||
| ff46c8f4ca | |||
| 59213687fb | |||
| 475b10ba07 | |||
| b0737a33ba | |||
| 3e4e679b11 | |||
| 3c355f54f2 | |||
| 86e442b8a4 | |||
| a0856aa4f5 | |||
| d1d99daa87 | |||
| 4f1efbc699 | |||
| c1b30918e9 | |||
| 517dde43cc | |||
| 955046c959 | |||
| 274440e9db | |||
| fd413caba4 | |||
| 474c339599 | |||
| 927803549e | |||
| 11601933f9 | |||
| b7f2992ecd | |||
| 1f1362a0b5 | |||
| 7c874a8e9a | |||
| 6e0e3fd18a | |||
| 974c4514b2 | |||
| e3b220a248 | |||
| ae1f6a2b3f | |||
| 290445110d | |||
| 4f9e6deb90 | |||
| 3b94b94528 | |||
| 39b44ad041 | |||
| bf2c3c51d4 | |||
| 2a01c50aa6 | |||
| 7f18d0e042 | |||
| 2307f9de20 | |||
| c185f018a4 | |||
| 9b159c7472 | |||
| ca77102be1 | |||
| 5ee89eb148 | |||
| ced109f0ea | |||
| 5051b692f0 | |||
| 07e23e2a5b | |||
| 270334a385 | |||
| df7884c2ac | |||
| a8f02e94b6 | |||
| 881833d3c9 | |||
| 207c608cd6 | |||
| ccab992c7b | |||
| e385eef74a | |||
| 820b78fb3b | |||
| 09c823d8c8 | |||
| aef326ae07 | |||
| 1139abd9c6 | |||
| 4517efc07e | |||
| 3b5b3a556b | |||
| 7534371b05 | |||
| fc98d61109 | |||
| 359226c26b | |||
| 109d7d2f01 | |||
| 33fd55e6ad | |||
| e08e864be0 | |||
| 07da5d5f4b | |||
| c2a26cf0ae | |||
| 1c1483822c | |||
| 46d38d4851 | |||
| a8c2cfb921 | |||
| d8affa54cd | |||
| 4707704330 | |||
| 882dafd11b | |||
| 9a867c6819 | |||
| bfeca1535b | |||
| b2afcb8a64 | |||
| 6e7ac1839d | |||
| 515afa90c3 | |||
| 1a3e6a8e29 | |||
| cff0fdf6d8 | |||
| 896658d5e1 | |||
| cdc0071e28 | |||
| 4ed4f19196 | |||
| 38b8173be4 | |||
| d70baebbf0 | |||
| a2abe13b86 | |||
| cd6f74931c | |||
| 1b1c90ec44 | |||
| d942de0b88 | |||
| d41a302e44 | |||
| 566011efff | |||
| 96ba35b0bf | |||
| 4c06a53c68 | |||
| 30d1e67b53 | |||
| 22c8d76193 | |||
| 36cdc6da2a | |||
| 293889b9ad | |||
| e21f9bef26 | |||
| bbe141557e | |||
| f06c3fda31 | |||
| dbe67789d8 | |||
| 6a1ba72df9 | |||
| 413a7d3681 | |||
| 18107d9601 | |||
| 5ded23e8dd | |||
| 09506aaa3c | |||
| 770ffb01a5 | |||
| 41d767fa4e | |||
| e5169705b3 | |||
| 73bb634326 | |||
| 8eadfec466 | |||
| 6816679ad9 | |||
| 2a87f1d3b4 | |||
| 6dec8c4a58 | |||
| e466389ae9 | |||
| bb5f45a71c | |||
| 3a415600d5 | |||
| 5bafa5128b | |||
| 51f0ebf3ea | |||
| c7d6c753d9 | |||
| d8bb0097c1 | |||
| 9292a602df | |||
| dbe657a05f | |||
| bb156173b5 | |||
| 9cebc9df35 | |||
| 25a64b6ce3 | |||
| 5c34876c53 | |||
| 1e30a7701f | |||
| 1c9480b764 | |||
| a385480d89 | |||
| 81f4dc90e8 | |||
| 2b6d17c559 | |||
| 6f9155fe83 | |||
| f32df6e6d0 | |||
| ece02c5d44 | |||
| d47a63d237 | |||
| be8f75df01 | |||
| bd9c0b30cf | |||
| b835eea039 | |||
| 01a01fb21b | |||
| 1bcf46aa42 | |||
| 811ec5d2d2 | |||
| dc359abe45 | |||
| be05f6984d | |||
| e6d94bf20d | |||
| f9a43fba5f | |||
| bc8499e2fb | |||
| 3ba7830824 | |||
| d914d3ea2b | |||
| 7eb4102417 | |||
| 7da1531d34 | |||
| b283b0d11d | |||
| b8115e97ae | |||
| 7c41025c55 | |||
| 98d3d9f629 | |||
| d374354cb6 | |||
| eeffb35944 | |||
| 048e2d93fd | |||
| b9db6d2cc5 | |||
| d5e3b07c1c | |||
| fd5ff6a821 | |||
| a33f85d45a | |||
| 1b89fc9531 | |||
| 2aa368ee9e | |||
| 3d6be24e9f | |||
| f2ed3e7155 | |||
| 98efa7a44d | |||
| 25ec6bbac5 | |||
| eef4153c5b | |||
| 17e02a384f | |||
| e50ec9e366 | |||
| 057f075a0e | |||
| a410eb0646 | |||
| 56796a331f | |||
| 2c33e7e37d | |||
| 8edddeaf8b | |||
| caa1547e8c | |||
| 807eed022d | |||
| b69c400fa4 | |||
| 5f266a3f16 | |||
| b740ddc3e5 | |||
| dfc3f59323 | |||
| 0c1ac93a4d | |||
| f449cfadc3 | |||
| bdb222f9f8 | |||
| 985f32e5a6 | |||
| da48f1d32c |
@@ -0,0 +1,2 @@
|
||||
[env]
|
||||
CARGO_WORKSPACE_DIR = { value = "", relative = true }
|
||||
@@ -0,0 +1,71 @@
|
||||
# EditorConfig helps developers define and maintain consistent
|
||||
# coding styles between different editors and IDEs
|
||||
# editorconfig.org
|
||||
|
||||
root = true
|
||||
|
||||
[*]
|
||||
# Change these settings to your own preference
|
||||
indent_style = space
|
||||
indent_size = 4
|
||||
|
||||
# We recommend you to keep these unchanged
|
||||
end_of_line = lf
|
||||
charset = utf-8
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
|
||||
[*.csv]
|
||||
trim_trailing_whitespace = false
|
||||
|
||||
[*.js]
|
||||
indent_style = space
|
||||
indent_size = 4
|
||||
|
||||
[*.json]
|
||||
indent_style = space
|
||||
indent_size = 4
|
||||
|
||||
[*.md]
|
||||
trim_trailing_whitespace = false
|
||||
|
||||
[*.py]
|
||||
indent_style = space
|
||||
indent_size = 4
|
||||
|
||||
[*.rs]
|
||||
indent_style = space
|
||||
indent_size = 4
|
||||
|
||||
[*.sh]
|
||||
indent_style = space
|
||||
indent_size = 4
|
||||
|
||||
[*.toml]
|
||||
indent_style = space
|
||||
indent_size = 4
|
||||
|
||||
[*.{yaml,yml}]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
trim_trailing_whitespace = false
|
||||
|
||||
[.github/{actions,workflows}/**/*.yml]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
|
||||
[Cargo.toml]
|
||||
indent_style = space
|
||||
indent_size = 4
|
||||
|
||||
[Makefile]
|
||||
indent_style = tab
|
||||
indent_size = 4
|
||||
|
||||
[neofetch]
|
||||
indent_style = space
|
||||
indent_size = 4
|
||||
|
||||
[package.json]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
+17
-2
@@ -1,2 +1,17 @@
|
||||
# Auto detect text files and perform LF normalization
|
||||
* text=auto
|
||||
* text=auto eol=lf
|
||||
|
||||
*.csv text eol=lf
|
||||
*.js text eol=lf
|
||||
*.json text eol=lf
|
||||
*.md text eol=lf
|
||||
*.py text eol=lf
|
||||
*.rs text eol=lf
|
||||
*.sh text eol=lf
|
||||
*.toml text eol=lf
|
||||
*.txt text eol=lf
|
||||
*.yaml text eol=lf
|
||||
*.yml text eol=lf
|
||||
Cargo.lock text eol=lf merge=binary
|
||||
Makefile text eol=lf
|
||||
MANIFEST.in text eol=lf
|
||||
neofetch text eol=lf
|
||||
|
||||
+12
@@ -120,3 +120,15 @@ webhook-log
|
||||
start_moderation.sh
|
||||
gh_moderator.toml
|
||||
moderator-data
|
||||
hyfetch/git
|
||||
build
|
||||
dist
|
||||
target
|
||||
.vscode
|
||||
.idea
|
||||
*.iml
|
||||
*.egg-info
|
||||
__pycache__
|
||||
*.pyc
|
||||
*.pyo
|
||||
*.pyd
|
||||
|
||||
Generated
+1175
File diff suppressed because it is too large
Load Diff
+51
@@ -0,0 +1,51 @@
|
||||
[workspace]
|
||||
resolver = "2"
|
||||
members = ["crates/*"]
|
||||
|
||||
[workspace.package]
|
||||
version = "2.1.0-rc1"
|
||||
authors = ["Azalea Gui <azalea@hydev.org>"]
|
||||
edition = "2021"
|
||||
rust-version = "1.75.0"
|
||||
description = "Neofetch with LGBTQ+ pride flags!"
|
||||
repository = "https://github.com/hykilpikonna/hyfetch"
|
||||
license = "MIT"
|
||||
|
||||
[workspace.dependencies]
|
||||
aho-corasick = { version = "1.1.3", default-features = false }
|
||||
ansi_colours = { version = "1.2.2", default-features = false }
|
||||
anstream = { version = "0.6.14", default-features = false }
|
||||
anyhow = { version = "1.0.86", default-features = false }
|
||||
bpaf = { version = "0.9.12", default-features = false }
|
||||
crossterm = { version = "0.29.0", default-features = false }
|
||||
deranged = { version = "0.3.11", default-features = false }
|
||||
directories = { version = "6.0.0", default-features = false }
|
||||
enable-ansi-support = { version = "0.2.1", default-features = false }
|
||||
enterpolation = { version = "0.2.1", default-features = false }
|
||||
fastrand = { version = "2.1.0", default-features = false }
|
||||
indexmap = { version = "2.2.6", default-features = false }
|
||||
itertools = { version = "0.14.0", default-features = false }
|
||||
normpath = { version = "1.2.0", default-features = false }
|
||||
palette = { version = "0.7.6", default-features = false }
|
||||
regex = { version = "1.10.5", default-features = false }
|
||||
same-file = { version = "1.0.6", default-features = false }
|
||||
serde = { version = "1.0.203", default-features = false }
|
||||
serde_json = { version = "1.0.118", default-features = false }
|
||||
serde_path_to_error = { version = "0.1.16", default-features = false }
|
||||
shell-words = { version = "1.1.0", default-features = false }
|
||||
strum = { version = "0.27.2", default-features = false }
|
||||
supports-color = { version = "3.0.0", default-features = false }
|
||||
tempfile = { version = "3.10.1", default-features = false }
|
||||
terminal-colorsaurus = { version = "1.0.0", default-features = false }
|
||||
terminal_size = { version = "0.4.3", default-features = false }
|
||||
thiserror = { version = "1.0.61", default-features = false }
|
||||
time = { version = "0.3.36", default-features = false }
|
||||
toml_edit = { version = "0.23.6", default-features = false }
|
||||
tracing = { version = "0.1.40", default-features = false }
|
||||
tracing-subscriber = { version = "0.3.18", default-features = false }
|
||||
unicode-normalization = { version = "0.1.23", default-features = false }
|
||||
unicode-segmentation = { version = "1.11.0", default-features = false }
|
||||
which = { version = "7.0.1", default-features = false }
|
||||
|
||||
[workspace.lints.clippy]
|
||||
arithmetic_side_effects = "warn"
|
||||
@@ -1,9 +0,0 @@
|
||||
include hyfetch/scripts/*
|
||||
|
||||
recursive-exclude tools *
|
||||
recursive-exclude .github *
|
||||
recursive-exclude .vscode *
|
||||
exclude .gitignore
|
||||
exclude .gitattributes
|
||||
exclude package.json
|
||||
exclude CONTRIBUTING.md
|
||||
@@ -1,35 +0,0 @@
|
||||
PREFIX = /usr
|
||||
MANDIR = $(PREFIX)/share/man
|
||||
|
||||
all: build
|
||||
|
||||
build:
|
||||
python setup.py build
|
||||
|
||||
install:
|
||||
python setup.py install --prefix=${PREFIX}
|
||||
|
||||
install-doc:
|
||||
@mkdir -p $(DESTDIR)$(MANDIR)/man1
|
||||
@cp -p docs/hyfetch.1 $(DESTDIR)$(MANDIR)/man1
|
||||
@cp -p docs/neofetch.1 $(DESTDIR)$(MANDIR)/man1/neowofetch.1
|
||||
|
||||
uninstall:
|
||||
@rm -rf $(DESTDIR)$(PREFIX)/bin/hyfetch
|
||||
@rm -rf $(DESTDIR)$(PREFIX)/bin/neowofetch
|
||||
@rm -rf $(DESTDIR)$(MANDIR)/man1/hyfetch.1*
|
||||
@rm -rf $(DESTDIR)$(MANDIR)/man1/neowofetch.1*
|
||||
|
||||
clean:
|
||||
rm -rf build/ HyFetch.egg-info
|
||||
|
||||
install-neofetch:
|
||||
@mkdir -p $(DESTDIR)$(PREFIX)/bin
|
||||
@mkdir -p $(DESTDIR)$(MANDIR)/man1
|
||||
@cp -p neofetch $(DESTDIR)$(PREFIX)/bin/neofetch
|
||||
@cp -p docs/neofetch.1 $(DESTDIR)$(MANDIR)/man1
|
||||
@chmod 755 $(DESTDIR)$(PREFIX)/bin/neofetch
|
||||
|
||||
uninstall-neofetch:
|
||||
@rm -rf $(DESTDIR)$(PREFIX)/bin/neofetch
|
||||
@rm -rf $(DESTDIR)$(MANDIR)/man1/neofetch.1*
|
||||
@@ -6,52 +6,57 @@ neofetch with pride flags <3
|
||||
|
||||
### Running Updated Original Neofetch
|
||||
|
||||
This repo also serves as an updated version of the original `neofetch` since the upstream [dylanaraps/neofetch](https://github.com/dylanaraps/neofetch) doesn't seem to be maintained anymore (as of Oct 27, 2023, the original repo hasn't merged a pull request for almost 2 years). If you only want to use the updated neofetch without pride flags, you can use the `neofetch` script from this repo. To prevent command name conflict, I call it `neowofetch` :)
|
||||
This repo also serves as an updated version of the original `neofetch` since the upstream [dylanaraps/neofetch](https://github.com/dylanaraps/neofetch) isn't maintained anymore and has been archived. If you only want to use the updated neofetch without pride flags, you can use the `neofetch` script from this repo. To prevent command name conflict, I call it `neowofetch` :)
|
||||
|
||||
* Method 1: `pip install -U hyfetch` then run `neowofetch`
|
||||
* Method 2: `npx neowofetch`
|
||||
* Method 3: `P="$HOME/.local/bin/neowofetch" curl -L nf.hydev.org -o $P && chmod +x $P`
|
||||
* Method 3: `P="$HOME/.local/bin/neowofetch" && curl -L nf.hydev.org -o "$P" && chmod +x "$P"`
|
||||
* Method 4: Run without install `bash <(curl -sL nf.hydev.org)`
|
||||
|
||||
|
||||
## Installation
|
||||
|
||||
### Method 1: Install using Python pip (Recommended)
|
||||
### Method 1: Install using pip (Recommended)
|
||||
|
||||
Install Python >= 3.7 first. Then, just do:
|
||||
Even though hyfetch has been rewritten in Rust since 2.0.0, we also published PyPI packages with prebuilt rust binaries to allow seamless transition from the Python version. You can install the rust binaries using pip:
|
||||
|
||||
```sh
|
||||
pip install wheel
|
||||
pip install -U hyfetch
|
||||
# or
|
||||
pipx install hyfetch
|
||||
```
|
||||
|
||||
If a rust binary is not available for your platform (e.g. riscv64), it will automatically fall back to the v1.99.0 Python version.
|
||||
|
||||
### Method 2: Install using system package manager
|
||||
|
||||
Currently, these distributions have existing packages for HyFetch:
|
||||
|
||||
* Universal [Lure.sh](https://lure.sh/): `lure in hyfetch` (Thanks to [@Elara6331](https://github.com/Elara6331))
|
||||
* Arch Linux: `sudo pacman -S hyfetch` (Thanks to [@Aleksana](https://github.com/Aleksanaa) and [@Antiz96](https://github.com/Antiz96))
|
||||
* Fedora Linux: `sudo dnf install hyfetch` (packaged by [@topazus](http://github.com/topazus))
|
||||
* Nix: `nix-env -i hyfetch` (Thanks to [@YisuiDenghua](https://github.com/YisuiDenghua))
|
||||
* Nix Profile: `nix profile install nixpkgs#hyfetch`
|
||||
* Guix: `guix install hyfetch` (Thanks to [@WammKD](https://github.com/WammKD))
|
||||
* Slackware: `sbopkg -b hyfetch` [Slackbuild](https://slackbuilds.org/repository/15.0/desktop/hyfetch/?search=hyfetch) (Thanks to [@bittin](https://github.com/bittin) and Urchlay)
|
||||
* Homebrew: `brew install hyfetch` (Thanks to [@BKasin](https://github.com/BKasin) and [@osalbahr](https://github.com/osalbahr))
|
||||
* openSUSE Tumbleweed: `zypper in python311-hyfetch` (Thanks to [@BKasin](https://github.com/BKasin))
|
||||
* Gentoo: `emerge --ask app-misc/hyfetch` (Thanks to [@BKasin](https://github.com/BKasin))
|
||||
* Slackware: `sbopkg -b hyfetch` [Slackbuild](https://slackbuilds.org/repository/15.0/desktop/hyfetch/?search=hyfetch) (Thanks to [@bittin](https://github.com/bittin) , willysr (https://github.com/willysr), jebrhansen and Urchlay)
|
||||
* Homebrew: `brew install hyfetch` (Thanks to [@catumin](https://github.com/catumin) and [@osalbahr](https://github.com/osalbahr))
|
||||
* openSUSE Tumbleweed: `zypper in python311-hyfetch` (Thanks to [@catumin](https://github.com/catumin))
|
||||
* Gentoo: `emerge --ask app-misc/hyfetch` (Thanks to [@catumin](https://github.com/catumin))
|
||||
* Debian and Ubuntu `apt install hyfetch` (for Debian flavor >= [Trixie](https://packages.debian.org/trixie/hyfetch), Ubuntu flavor >= [Noble](https://packages.ubuntu.com/noble/hyfetch)) (Thanks to [@catumin](https://github.com/catumin))
|
||||
|
||||
[](https://repology.org/project/hyfetch/versions)
|
||||
[](https://repology.org/project/hyfetch/versions)
|
||||
|
||||
### Method 3: Install the latest developmental version using git
|
||||
### Method 3: Install using Cargo
|
||||
|
||||
Install Python >= 3.7 first. Then run the following commands:
|
||||
Since hyfetch has been rewritten in Rust since 2.0.0, you can now install it using Cargo:
|
||||
|
||||
```sh
|
||||
git clone https://github.com/hykilpikonna/hyfetch.git
|
||||
cd hyfetch
|
||||
pip install .
|
||||
cargo install hyfetch
|
||||
```
|
||||
|
||||
> [!WARNING]
|
||||
> If you install using Cargo, you would need to manually install dependencies like fastfetch if you want to use it as the backend, and Git Bash if you're on Windows.
|
||||
>
|
||||
> The PyPI package has all the dependencies bundled, so it's recommended to use that instead.
|
||||
|
||||
## Usage
|
||||
|
||||
@@ -82,7 +87,13 @@ For many in the LGBTQ+ community, these flags symbolize their identity, struggle
|
||||
|
||||
Also, by including flag coloring along with the updated neofetch, we're also broadcasting a wider message about the importance of inclusivity and representation. It's not just a design choice, it's a statement that promotes awareness and understanding toward the LGBTQ+ community.
|
||||
|
||||
#### Q: When I use `hyfetch` or `neowofetch` in my MotD, no art displays. How do I get the art back?
|
||||
|
||||
A: Most likely, the `stdout` detection is set to auto and is removing the ascii art and colors. To change this, you can: set `args` in your hyfetch.json to `"--stdout=off"`, add `--stdout=off` to the `neowofetch` command in your motd script, or set the option in $HOME/.config/(neofetch|neowofetch)/config.conf to off.
|
||||
|
||||
#### Q: How can I run HyFetch on Windows?
|
||||
|
||||
A: Install Python > 3.7 and Git > 2.42.0 first. Then, either open Git Bash terminal or install a terminal emulator that can display RGB colors (the default Windows cmd.exe cannot, but the new [Windows Terminal](https://apps.microsoft.com/detail/9N0DX20HK701?hl=en-US&gl=US) can). Then, run `pip install hyfetch` and run `hyfetch`.
|
||||
|
||||
|
||||
## Contributing
|
||||
@@ -113,19 +124,233 @@ Updates to `neowofetch` begins with the emoji 🖼️
|
||||
Note: You can install the latest nightly version by using:
|
||||
|
||||
```sh
|
||||
pip install git+https://github.com/hykilpikonna/hyfetch.git@master
|
||||
cargo install --git https://github.com/hykilpikonna/hyfetch
|
||||
```
|
||||
|
||||
<!-- CHANGELOG STARTS HERE --->
|
||||
|
||||
### 2.1.0-rc1
|
||||
|
||||
### 2.1.0
|
||||
|
||||
(changelog is generated by Gemini from commit history)
|
||||
|
||||
**✨ Features & Enhancements**
|
||||
|
||||
* Random Preset: Now can select multiple presets and let it randomly choose one on each run ([#487](https://github.com/hykilpikonna/hyfetch/issues/487)).
|
||||
* Distro as Data: Migrated distribution ASCII art and metadata to a unified JSON-header format, enabling shared usage across Python and Rust implementations.
|
||||
* Distro Parity: Added missing ASCII art and distros from [fastfetch](https://github.com/fastfetch-cli/fastfetch).
|
||||
* New OS Support: Added support for QNX/Blackberry 10 ([#480](https://github.com/hykilpikonna/hyfetch/issues/480)).
|
||||
* Custom Presets: Added `custom_presets` configuration option to allow user-defined color presets ([#481](https://github.com/hykilpikonna/hyfetch/issues/481)).
|
||||
* Interactive Filtering: Added live filter for preset selection in the configuration menu ([#482](https://github.com/hykilpikonna/hyfetch/issues/482)).
|
||||
* New Distros: Added support for Codex Linux ([#477](https://github.com/hykilpikonna/hyfetch/issues/477)) and Zirconium ([#468](https://github.com/hykilpikonna/hyfetch/issues/468)).
|
||||
* New Flags: Added Peter Griffin pride flag ([#489](https://github.com/hykilpikonna/hyfetch/issues/489)), Rubber flag ([#479](https://github.com/hykilpikonna/hyfetch/issues/479)), and Haruhi Suzumiya flag ([#486](https://github.com/hykilpikonna/hyfetch/issues/486)).
|
||||
|
||||
**🐛 Bug Fixes**
|
||||
|
||||
* Windows/MSYS2: Fixed bash path detection and execution in MINGW64 environment ([#488](https://github.com/hykilpikonna/hyfetch/issues/488)).
|
||||
* Backend Fixes: Fixed issues with the `macchina` backend crashing or reporting incorrect distribution ([#491](https://github.com/hykilpikonna/hyfetch/issues/491)).
|
||||
* Terminal Fixes: Fixed terminal font output issues in Kitty terminal ([#484](https://github.com/hykilpikonna/hyfetch/issues/484)).
|
||||
* Reliability:
|
||||
* Improved path detection to continue even when current path is not found ([#426](https://github.com/hykilpikonna/hyfetch/issues/426)).
|
||||
* Added fallback for operating systems unsupported by the Rust implementation ([#474](https://github.com/hykilpikonna/hyfetch/issues/474)).
|
||||
* Fixed prioritization of CLI-specified ASCII art to ensure it correctly overrides configuration ([#475](https://github.com/hykilpikonna/hyfetch/issues/475)).
|
||||
* Shell Detection: Switched to `os.execv` for more reliable shell detection and transition ([#469](https://github.com/hykilpikonna/hyfetch/issues/469)).
|
||||
* Background Detection Timeout: Prevent crash due to timeout in background color detection ([#453](https://github.com/hykilpikonna/hyfetch/issues/453)).
|
||||
|
||||
|
||||
### 2.0.5
|
||||
|
||||
**✨ Features & Enhancements**
|
||||
|
||||
* Added support for Secureblue ([#434](https://github.com/hykilpikonna/hyfetch/pull/434)).
|
||||
* Added `void_old` logo variant ([#457](https://github.com/hykilpikonna/hyfetch/pull/457)).
|
||||
* Added Femme flag ([#456](https://github.com/hykilpikonna/hyfetch/pull/456)).
|
||||
|
||||
**🐛 Bug Fixes**
|
||||
|
||||
* Fixed a panic when entering an invalid alignment option after rolling ([#460](https://github.com/hykilpikonna/hyfetch/issues/460)).
|
||||
* Fixed Traceback printing on KeyboardInterrupt ([#462](https://github.com/hykilpikonna/hyfetch/issues/462)).
|
||||
* Restored flags lost during Python/Rust presets merge ([#466](https://github.com/hykilpikonna/hyfetch/pull/466)).
|
||||
* Fixed a panic with file metadata access ([#465](https://github.com/hykilpikonna/hyfetch/issues/465)).
|
||||
|
||||
### 2.0.4
|
||||
|
||||
**🔧 Building Pipeline Refactoring**
|
||||
|
||||
* Modernize Python building toolchain from `setup.py` to `pyproject.toml`
|
||||
* Fixed a bug where Windows binaries are mistakenly built into Unix packages.
|
||||
* Fixed a bug where `presets.json` was not being included in the built package.
|
||||
|
||||
### 2.0.3
|
||||
|
||||
(changelog is generated by Gemini from commit history)
|
||||
|
||||
This update brings a significant internal refactor to how color presets are managed, along with a new batch of pride flags and several important bug fixes.
|
||||
|
||||
**✨ Features & Enhancements**
|
||||
|
||||
* **Custom ASCII Art**: You can now specify a file path for custom ASCII art ([#429](https://github.com/hykilpikonna/hyfetch/pull/429)).
|
||||
* **Hex Color Presets**: Added the ability to pass a custom comma-separated hex color string list (e.g., `#RRGGBB,#RRGGBB`) directly as a preset ([#435](https://github.com/hykilpikonna/hyfetch/pull/435)).
|
||||
|
||||
**🏳️🌈 New Flags**
|
||||
|
||||
* Added Transbian flag ([#449](https://github.com/hykilpikonna/hyfetch/pull/449))
|
||||
* Added Autism Pride flag ([#450](https://github.com/hykilpikonna/hyfetch/pull/450))
|
||||
* Added Transneutral & Cenelian flags ([#452](https://github.com/hykilpikonna/hyfetch/pull/452))
|
||||
* Added Fluidflux flags ([#437](https://github.com/hykilpikonna/hyfetch/pull/437))
|
||||
* Added Libragender flags ([#433](https://github.com/hykilpikonna/hyfetch/pull/433))
|
||||
|
||||
**🐛 Bug Fixes**
|
||||
|
||||
* **Crash Fix**: Fixed a panic that could occur if hyfetch was run on a distro with no defined ASCII art ([#455](https://github.com/hykilpikonna/hyfetch/pull/455)).
|
||||
* **OS Support**: Added support for iOS 1.x ([#444](https://github.com/hykilpikonna/hyfetch/pull/444)) and old Apple TV models ([#438](https://github.com/hykilpikonna/hyfetch/pull/438)).
|
||||
* **Python**:
|
||||
* Fixed a bug where 3-length hex codes (e.g., `#FFF`) does not work properly ([#443](https://github.com/hykilpikonna/hyfetch/pull/443)).
|
||||
* Fixed a string formatting issue for python 3.11 and earlier versions ([#442](https://github.com/hykilpikonna/hyfetch/pull/442)).
|
||||
* Fixed a bug where extra top padding would appear above output ascii art ([#428](https://github.com/hykilpikonna/hyfetch/pull/428)).
|
||||
* **Rust**:
|
||||
* Fixed the logic for the pride month easter egg so it only marks itself as "displayed" during June ([#430](https://github.com/hykilpikonna/hyfetch/pull/430)).
|
||||
* Fixed a build issue on Windows ([#439](https://github.com/hykilpikonna/hyfetch/pull/439)).
|
||||
|
||||
**🔧 Maintenance & Refactoring**
|
||||
|
||||
* **Preset Refactor**: Color presets are now stored in a central `presets.json` file. ([#451](https://github.com/hykilpikonna/hyfetch/issues/451)).
|
||||
* **Dependency Updates**: Upgraded various Rust crates and other dependencies to their latest versions.
|
||||
* **Code Cleanup**: General code shortening and readability improvements.
|
||||
|
||||
### 2.0.2
|
||||
|
||||
This is a small patch release that adds more flags and fixes some bugs from the recent Rust rewrite.
|
||||
|
||||
* 🏳️🌈 **New Flags**: Added new pride flags for Nullflux ([#397](https://github.com/hykilpikonna/hyfetch/pull/397)), Hypergender ([#422](https://github.com/hykilpikonna/hyfetch/pull/422)), Fictosexual ([#394](https://github.com/hykilpikonna/hyfetch/pull/394)), and Adipophilia ([#424](https://github.com/hykilpikonna/hyfetch/pull/424)).
|
||||
* 🐛 **Bug Fixes**:
|
||||
* Fixed a critical bug where custom `fastfetch` configurations could break hyfetch ([#420](https://github.com/hykilpikonna/hyfetch/pull/420)).
|
||||
* Corrected the `nixos_small` ASCII logo to display properly ([#421](https://github.com/hykilpikonna/hyfetch/pull/421)).
|
||||
* 🔧 **Improvements**:
|
||||
* Improved a warning message for better clarity ([#419](https://github.com/hykilpikonna/hyfetch/issues/419)).
|
||||
|
||||
### 2.0.1
|
||||
|
||||
(changelog is generated by Gemini from commit history)
|
||||
|
||||
**🦀 The Rust Rewrite!**
|
||||
|
||||
This is a massive update, rewriting the entire hyfetch core from Python to Rust for significantly improved performance, reliability, and maintainability. A huge thank you to **@teohhanhui** and all the contributors who made this possible!
|
||||
|
||||
* 🚀 **Complete Rewrite in Rust**: The entire codebase has been ported to Rust, resulting in major performance improvements and a smaller binary size.
|
||||
* ⚙️ **New Backends**: In addition to neofetch and fastfetch, hyfetch now supports **macchina** as a backend option.
|
||||
* 🌈 **Improved June Animation**: The `--june` pride month animation is now smoother, flicker-free ([#408](https://github.com/hykilpikonna/hyfetch/pull/408)).
|
||||
* 🪟 **Native Windows Support**: The Rust version provides much-improved support for Windows.
|
||||
|
||||
**✨ Features & Enhancements**
|
||||
|
||||
* 🎨 **Automatic Theme Detection**: Hyfetch can now automatically detect your terminal's light/dark mode (when auto_detect_light_dark is true) ([#380](https://github.com/hykilpikonna/hyfetch/pull/380)).
|
||||
* ✍️ **Font Logos**: Added a new feature to display a logo created from your system's font.
|
||||
* 🌐 **Cloudflare for Public IP**: Now uses Cloudflare to fetch the public IP address, with a fallback option ([#416](https://github.com/hykilpikonna/hyfetch/pull/416)).
|
||||
* 🖼️ **Interactive Logo Selection**: An interactive setup step now allows you to choose between default and small logo variants for your distro ([#392](https://github.com/hykilpikonna/hyfetch/pull/392)).
|
||||
* 🏳️🌈 **New Pride Flags**: Added flags for Cisgender ([#386](https://github.com/hykilpikonna/hyfetch/pull/386)), Kessoku Band ([#384](https://github.com/hykilpikonna/hyfetch/pull/384)), and Watermelon Cream Lozenges ([#369](https://github.com/hykilpikonna/hyfetch/pull/369)) for memes.
|
||||
* 📄 **Page Navigation**: Added `n` and `p` as shorthands for next/previous page selection and implemented page number roll-over ([#372](https://github.com/hykilpikonna/hyfetch/pull/372)).
|
||||
|
||||
**🖼️ New & Updated Distro Support**
|
||||
|
||||
* **Added Bazzite** ([#406](https://github.com/hykilpikonna/hyfetch/pull/406))
|
||||
* **Added Rhino Linux Logo** ([#407](https://github.com/hykilpikonna/hyfetch/pull/407))
|
||||
* **Updated openSUSE Logos & Added Slowroll**
|
||||
* **Updated KSLinux Detection** ([#395](https://github.com/hykilpikonna/hyfetch/pull/395))
|
||||
|
||||
**🐛 Bug Fixes**
|
||||
|
||||
* **macOS**: Fixed CPU and memory fetching on older macOS versions like Leopard and Tiger ([#387](https://github.com/hykilpikonna/hyfetch/pull/387), [#389](https://github.com/hykilpikonna/hyfetch/pull/389)).
|
||||
* **Packaging**: Resolved several issues with `cargo publish` to ensure reliable package deployment ([#405](https://github.com/hykilpikonna/hyfetch/pull/405)).
|
||||
* **Performance**: Sped up RPM package counting by skipping digest and signature verification ([#371](https://github.com/hykilpikonna/hyfetch/pull/371)).
|
||||
* **Animation**: Updated logic to ensure the pride month animation is always shown when `--june` is explicitly used ([#411](https://github.com/hykilpikonna/hyfetch/pull/411)).
|
||||
* **General**: Fixed numerous bugs related to builds, path detection, cache handling, and distro name detection.
|
||||
* **Formatting**: Fixed an unwanted space in the Python version output ([#401](https://github.com/hykilpikonna/hyfetch/pull/401)).
|
||||
|
||||
**🔧 Maintenance**
|
||||
|
||||
* **Documentation**: Updated the README with additional credits for Slackware contributors ([#365](https://github.com/hykilpikonna/hyfetch/pull/365)).
|
||||
* **Build System**: Overhauled the build scripts for Rust, including support for `musl` static builds and cross-compilation for macOS and Windows.
|
||||
|
||||
### 1.99.0
|
||||
|
||||
This version would be the last version of HyFetch on Python as we migrate to Rust (Huge thanks to everyone on [#317](https://github.com/hykilpikonna/hyfetch/pull/317)!). It will also be an effort to start a transition that phases out the neowofetch/neofetch backend in favor of FastFetch, since the time needed to maintain the NF backend currently exceed our capacity. If you are willing to help maintaining it, please let us know!
|
||||
|
||||
* 🌈 **Improve Windows support**
|
||||
* 🌈 **Include FastFetch into HyFetch PyPI package**
|
||||
* 🌈 Detached our fork from neofetch
|
||||
* 🌈 Build architecture-specific wheels for PyPI
|
||||
* 🌈 Add plural flag (bc8499e2)
|
||||
* 🌈 Add genderflux and girlflux flags ([#263](https://github.com/hykilpikonna/hyfetch/pull/263))
|
||||
* 🌈 Add Fraysexual flag ([#277](https://github.com/hykilpikonna/hyfetch/pull/277))
|
||||
* 🌈 Add Xenogender flag ([#309](https://github.com/hykilpikonna/hyfetch/pull/309))
|
||||
* 🌈 Add Caninekin flag ([#318](https://github.com/hykilpikonna/hyfetch/pull/318))
|
||||
* 🌈 Add Kenochoric, veldian, solian, lunian flags ([#331](https://github.com/hykilpikonna/hyfetch/pull/331))
|
||||
* 🌈 Add Polyamorous, sapphic, androgyne, interprogress, progress, intersex, equal-rights, drag, neofluid, genderqueer, and pronoun flags ([#342](https://github.com/hykilpikonna/hyfetch/pull/342))
|
||||
* 🌈 Add Gilbert Baker's original rainbow flag ([#284](https://github.com/hykilpikonna/hyfetch/pull/284))
|
||||
* 🌈 Add Queer subculture flags ([#302](https://github.com/hykilpikonna/hyfetch/pull/302))
|
||||
* 🌈 Add random flag option ([#334](https://github.com/hykilpikonna/hyfetch/pull/334))
|
||||
* 🌈 Fix distro logo triple-quotation mark escaping ([#222](https://github.com/hykilpikonna/hyfetch/pull/222))
|
||||
* 🌈 Fix Windows encoding issue on non-English systems ([#294](https://github.com/hykilpikonna/hyfetch/pull/294))
|
||||
* 🌈 Fix termux compatibility ([#286](https://github.com/hykilpikonna/hyfetch/pull/286))
|
||||
* 🌈 Fix term background detection not resetting properly ([#298](https://github.com/hykilpikonna/hyfetch/pull/298))
|
||||
* 🌈 Make typing-extensions optional ([#299](https://github.com/hykilpikonna/hyfetch/pull/299))
|
||||
* 🌈 Remove setuptools dependency ([#325](https://github.com/hykilpikonna/hyfetch/pull/325))
|
||||
* 🌈 Allow lightness value without a '%' sign in config prompt ([#307](https://github.com/hykilpikonna/hyfetch/pull/307))
|
||||
* 🌈 Fix Windows 7 and Python 3.7.0 support.
|
||||
* 🖼 OS - Update Apple hardware ID list ([#256](https://github.com/hykilpikonna/hyfetch/pull/256))
|
||||
* 🖼 OS - Remove Lilu detection for hackintosh ([#310](https://github.com/hykilpikonna/hyfetch/pull/310))
|
||||
* 🖼 OS - Support host info on PowerPC Macs ([#341](https://github.com/hykilpikonna/hyfetch/pull/341))
|
||||
* 🖼 DE - Show Kinfo for Plasma 6 ([#269](https://github.com/hykilpikonna/hyfetch/pull/269))
|
||||
* 🖼 GPU - Fix GPU not displaying in Haiku (dylanaraps#2448)
|
||||
* 🖼 GPU - List all intel GPU as detected ([#348](https://github.com/hykilpikonna/hyfetch/pull/348))
|
||||
* 🖼 Distro - Add eweOS ([#252](https://github.com/hykilpikonna/hyfetch/pull/252))
|
||||
* 🖼 Distro - Add Fedora Immutable distros (dylanaraps#2434)
|
||||
* 🖼 Distro - Add Macaroni OS (dylanaraps#2424)
|
||||
* 🖼 Distro - Add Ironclad OS ([#219](https://github.com/hykilpikonna/hyfetch/pull/219))
|
||||
* 🖼 Distro - Add Chimera Linux ([#285](https://github.com/hykilpikonna/hyfetch/pull/285))
|
||||
* 🖼 Distro - Add Tatra (dylanaraps#2439)
|
||||
* 🖼 Distro - Add Furreto Linux ([#290](https://github.com/hykilpikonna/hyfetch/pull/290))
|
||||
* 🖼 Distro - Add BlackMesa ([#316](https://github.com/hykilpikonna/hyfetch/pull/316))
|
||||
* 🖼 Distro - Add Magix ([#338](https://github.com/hykilpikonna/hyfetch/pull/338))
|
||||
* 🖼 Distro - Add Mauna ([#343](https://github.com/hykilpikonna/hyfetch/pull/343))
|
||||
* 🖼 Distro - Add Arkane Linux ([#321](https://github.com/hykilpikonna/hyfetch/pull/321))
|
||||
* 🖼 Distro - Add Linux From Scratch ([#336](https://github.com/hykilpikonna/hyfetch/pull/336))
|
||||
* 🖼 Distro - Fix debian version on Ubuntu ([#195](https://github.com/hykilpikonna/hyfetch/pull/195))
|
||||
* 🖼 Ascii - Update PikaOS logo ([#231](https://github.com/hykilpikonna/hyfetch/pull/231))
|
||||
* 🖼 Ascii - Add Fedora unicode logo ([#238](https://github.com/hykilpikonna/hyfetch/pull/238))
|
||||
* 🖼 Ascii - Fix colors not reverting properly ([#314](https://github.com/hykilpikonna/hyfetch/pull/314))
|
||||
* 🖼 Ascii - Fix AmogOS backslash escape ([#339](https://github.com/hykilpikonna/hyfetch/pull/339))
|
||||
* 🖼 Ascii - Add colorful NixOS logo ([#311](https://github.com/hykilpikonna/hyfetch/pull/311))
|
||||
* 🖼 Terminal - Fix terminal emulator selection ([#220](https://github.com/hykilpikonna/hyfetch/pull/220))
|
||||
* 🖼 Terminal - Fix terminal font info for yakuake ([#235](https://github.com/hykilpikonna/hyfetch/pull/235))
|
||||
* 🖼 Terminal - Add Apple Terminal ([#272](https://github.com/hykilpikonna/hyfetch/pull/272))
|
||||
* 🖼 Editor - Display neovim version ([#267](https://github.com/hykilpikonna/hyfetch/pull/267))
|
||||
* 🖼 Package - Add an option to hide some package managers ([#257](https://github.com/hykilpikonna/hyfetch/pull/257))
|
||||
* 🖼 Package - Add "AM" application manager ([#234](https://github.com/hykilpikonna/hyfetch/pull/234))
|
||||
* 🖼 Package - Fix npm list count mismatch ([#240](https://github.com/hykilpikonna/hyfetch/pull/240))
|
||||
* 🖼 Package - Add pnpm ([#288](https://github.com/hykilpikonna/hyfetch/pull/288))
|
||||
* 🖼 Package - Add pkgx.sh ([#265](https://github.com/hykilpikonna/hyfetch/pull/265))
|
||||
* 🖼 Package - Add pip, bonsai, rad, radula, birb ([#337](https://github.com/hykilpikonna/hyfetch/pull/337))
|
||||
* 🖼 Package - Add MacPorts for Linux support ([#340](https://github.com/hykilpikonna/hyfetch/pull/340))
|
||||
* 🖼 Package - Use XDG path for Nix package counting ([#255](https://github.com/hykilpikonna/hyfetch/pull/255))
|
||||
* 🖼 Package - Fix short package count ([#305](https://github.com/hykilpikonna/hyfetch/pull/305))
|
||||
* 🖼 Song - Add Cider player ([#245](https://github.com/hykilpikonna/hyfetch/pull/245))
|
||||
* 🖼 Network - Fix network speed detection on macOS ([#360](https://github.com/hykilpikonna/hyfetch/pull/360))
|
||||
|
||||
### 1.4.11
|
||||
|
||||
* 🌈 Add ability to set backend args in hyfetch config file ([#181](https://github.com/hykilpikonna/hyfetch/pull/181))
|
||||
* 🌈 Update makefile to be able to install hyfetch ([#174](https://github.com/hykilpikonna/hyfetch/pull/174))
|
||||
* 🌈 Fix config file argument ([#177](https://github.com/hykilpikonna/hyfetch/pull/177))
|
||||
* 🌈 Support pipx installation ([#188](https://github.com/hykilpikonna/hyfetch/pull/188), [#192](https://github.com/hykilpikonna/hyfetch/pull/192))
|
||||
* 🌈 Create package for Debian, OpenSUSE, Homebrew, Gentoo, and lure.sh
|
||||
([#184](https://github.com/hykilpikonna/hyfetch/pull/184), [#194](https://github.com/hykilpikonna/hyfetch/pull/194), [#207](https://github.com/hykilpikonna/hyfetch/pull/207), [#206](https://github.com/hykilpikonna/hyfetch/pull/206)) Huge thanks to @BKasin!
|
||||
([#184](https://github.com/hykilpikonna/hyfetch/pull/184), [#194](https://github.com/hykilpikonna/hyfetch/pull/194), [#207](https://github.com/hykilpikonna/hyfetch/pull/207), [#206](https://github.com/hykilpikonna/hyfetch/pull/206)) Huge thanks to @catumin!
|
||||
* 🖼 DE - Fix DE empty bracket in macOS ([#172](https://github.com/hykilpikonna/hyfetch/pull/172))
|
||||
* 🖼 OS - Disable Hackintosh check on arm64 processors ([dylanaraps#2396](https://github.com/dylanaraps/neofetch/pull/2396))
|
||||
* 🖼 OS - Add Windows NT ([#217](https://github.com/hykilpikonna/hyfetch/pull/217))
|
||||
* 🖼 Distro - Fixed Kubuntu recognized as Ubuntu ([dylanaraps#2411](https://github.com/dylanaraps/neofetch/pull/2411))
|
||||
* 🖼 Distro - Use /etc/debian_version to get .x on Debian ([#191](https://github.com/hykilpikonna/hyfetch/pull/191))
|
||||
* 🖼 Distro - Add LainOS ([#190](https://github.com/hykilpikonna/hyfetch/pull/190))
|
||||
* 🖼 Distro - Add aerOS ([dylanaraps#2360](https://github.com/dylanaraps/neofetch/pull/2360))
|
||||
@@ -143,10 +368,7 @@ pip install git+https://github.com/hykilpikonna/hyfetch.git@master
|
||||
* 🖼 Ascii - Add linux_small ([dylanaraps#2417](https://github.com/dylanaraps/neofetch/pull/2417))
|
||||
* 🖼 Bug Fix - Fix color blocks for bash !=3 & <5 ([#170](https://github.com/hykilpikonna/hyfetch/pull/170))
|
||||
* 🖼 Bug Fix - Use sed -r instead of -E when using GNU sed ([#171](https://github.com/hykilpikonna/hyfetch/pull/171))
|
||||
* 🖼 Bug Fix - Fixed Kubuntu recognized as Ubuntu ([dylanaraps#2411](https://github.com/dylanaraps/neofetch/pull/2411))
|
||||
* 🖼 OS - Improved MacOS resolution detection ([dylanaraps#2356](https://github.com/dylanaraps/neofetch/pull/2356))
|
||||
* 🖼 OS - Disable Hackintosh check on arm64 processors ([dylanaraps#2396](https://github.com/dylanaraps/neofetch/pull/2396))
|
||||
* 🖼 OS - Add Windows NT ([#217](https://github.com/hykilpikonna/hyfetch/pull/217))
|
||||
* 🖼 Resolution - Improved MacOS resolution detection ([dylanaraps#2356](https://github.com/dylanaraps/neofetch/pull/2356))
|
||||
* 🖼 Terminal - Add support for alacritty's new config format ([#202](https://github.com/hykilpikonna/hyfetch/pull/202))
|
||||
* 🖼 Terminal - Check for newer xfce4-term config ([#214](https://github.com/hykilpikonna/hyfetch/pull/214))
|
||||
* 🖼 Package - Add support for npm global packages ([#215](https://github.com/hykilpikonna/hyfetch/pull/215))
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
[package]
|
||||
name = "hyfetch"
|
||||
version = { workspace = true }
|
||||
authors = { workspace = true }
|
||||
edition = { workspace = true }
|
||||
rust-version = { workspace = true }
|
||||
description = { workspace = true }
|
||||
repository = { workspace = true }
|
||||
license = { workspace = true }
|
||||
default-run = "hyfetch"
|
||||
|
||||
[dependencies]
|
||||
aho-corasick = { workspace = true, features = ["perf-literal", "std"] }
|
||||
ansi_colours = { workspace = true, features = [] }
|
||||
anstream = { workspace = true, features = [], optional = true }
|
||||
anyhow = { workspace = true, features = ["std"] }
|
||||
bpaf = { workspace = true, features = [] }
|
||||
crossterm = { workspace = true, features = ["events"] }
|
||||
deranged = { workspace = true, features = ["serde", "std"] }
|
||||
directories = { workspace = true, features = [] }
|
||||
enterpolation = { workspace = true, features = ["bspline", "std"] }
|
||||
fastrand = { workspace = true, features = ["std"] }
|
||||
indexmap = { workspace = true, features = ["serde", "std"] }
|
||||
itertools = { workspace = true, features = ["use_std"] }
|
||||
palette = { workspace = true, features = ["std"] }
|
||||
serde = { workspace = true, features = ["derive", "std"] }
|
||||
serde_json = { workspace = true, features = ["std"] }
|
||||
serde_path_to_error = { workspace = true, features = [] }
|
||||
shell-words = { workspace = true, features = ["std"] }
|
||||
strum = { workspace = true, features = ["derive", "std"] }
|
||||
supports-color = { workspace = true, features = [] }
|
||||
tempfile = { workspace = true, features = [] }
|
||||
terminal-colorsaurus = { workspace = true, features = [] }
|
||||
terminal_size = { workspace = true, features = [] }
|
||||
thiserror = { workspace = true, features = [] }
|
||||
time = { workspace = true, features = ["local-offset", "std"] }
|
||||
toml_edit = { workspace = true, features = [], optional = true }
|
||||
tracing = { workspace = true, features = ["attributes", "std"] }
|
||||
tracing-subscriber = { workspace = true, features = ["ansi", "fmt", "smallvec", "std", "tracing-log"] }
|
||||
unicode-segmentation = { workspace = true, features = [] }
|
||||
which = { workspace = true, features = [] }
|
||||
|
||||
[build-dependencies]
|
||||
indexmap = { workspace = true, features = ["std", "serde"] }
|
||||
regex = { workspace = true, features = ["perf", "std", "unicode"] }
|
||||
unicode-normalization = { workspace = true, features = ["std"] }
|
||||
fs_extra = "1.3.0"
|
||||
serde = { workspace = true, features = ["derive", "std"] }
|
||||
serde_json = { workspace = true, features = ["std"] }
|
||||
anyhow = { workspace = true, features = ["std"] }
|
||||
heck = "0.5.0"
|
||||
|
||||
[target.'cfg(windows)'.dependencies]
|
||||
enable-ansi-support = { workspace = true, features = [] }
|
||||
normpath = { workspace = true, features = [] }
|
||||
same-file = { workspace = true, features = [] }
|
||||
crossterm = { workspace = true, features = ["windows"] }
|
||||
|
||||
[features]
|
||||
default = ["autocomplete", "color", "macchina"]
|
||||
autocomplete = ["bpaf/autocomplete"]
|
||||
color = ["bpaf/dull-color"]
|
||||
macchina = ["dep:anstream", "dep:toml_edit", "toml_edit/display"]
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
@@ -0,0 +1,365 @@
|
||||
use std::env;
|
||||
use std::fmt::Write as _;
|
||||
use std::fs;
|
||||
use std::io::{BufWriter, Write};
|
||||
use std::path::{Path, PathBuf};
|
||||
use anyhow::{Context, Result};
|
||||
use fs_extra::dir::CopyOptions;
|
||||
use heck::ToUpperCamelCase;
|
||||
use indexmap::IndexMap;
|
||||
use serde::Deserialize;
|
||||
use unicode_normalization::UnicodeNormalization as _;
|
||||
|
||||
#[derive(Debug)]
|
||||
struct AsciiDistro {
|
||||
pattern: String,
|
||||
color: String,
|
||||
foreground: Vec<u8>,
|
||||
background: Option<u8>,
|
||||
art: String,
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Debug)]
|
||||
struct DistroHeader {
|
||||
#[serde(rename = "match")]
|
||||
pattern: String,
|
||||
color: serde_json::Value,
|
||||
foreground: Option<Vec<u8>>,
|
||||
background: Option<u8>,
|
||||
}
|
||||
|
||||
impl AsciiDistro {
|
||||
fn friendly_name(&self) -> String {
|
||||
self.pattern
|
||||
.split('|')
|
||||
.next()
|
||||
.expect("invalid distro pattern")
|
||||
.trim_matches(|c: char| c.is_ascii_punctuation() || c == ' ')
|
||||
.replace(['"', '*'], "")
|
||||
}
|
||||
}
|
||||
|
||||
fn anything_that_exist(paths: &[&Path]) -> Option<PathBuf> {
|
||||
paths.iter().copied().find(|p| p.exists()).map(Path::to_path_buf)
|
||||
}
|
||||
|
||||
fn main() -> Result<()> {
|
||||
// Path hack to make file paths work in both workspace and manifest directory
|
||||
let dir = PathBuf::from(env::var_os("CARGO_WORKSPACE_DIR").unwrap_or_else(|| env::var_os("CARGO_MANIFEST_DIR").unwrap()));
|
||||
let o = PathBuf::from(env::var_os("OUT_DIR").unwrap());
|
||||
|
||||
let data_dir = anything_that_exist(&[
|
||||
&dir.join("hyfetch/data"),
|
||||
&dir.join("../../hyfetch/data"),
|
||||
]).context("couldn't find hyfetch/data")?;
|
||||
|
||||
let dst_root = o.join("hyfetch");
|
||||
fs::create_dir_all(&dst_root)?;
|
||||
|
||||
// Copy hyfetch/data
|
||||
let opt = CopyOptions { overwrite: true, copy_inside: true, ..CopyOptions::default() };
|
||||
fs_extra::dir::copy(&data_dir, &dst_root, &opt)?;
|
||||
|
||||
// Copy neofetch
|
||||
let neofetch_src = anything_that_exist(&[
|
||||
&dir.join("neofetch"),
|
||||
&dir.join("../../neofetch"),
|
||||
]).context("couldn't find neofetch")?;
|
||||
fs::copy(&neofetch_src, o.join("neofetch"))?;
|
||||
|
||||
preset_codegen(&o.join("hyfetch/data/presets.json"), &o.join("presets.rs"))?;
|
||||
|
||||
let distros_dir = data_dir.join("distros");
|
||||
export_distros(&distros_dir, &o)?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn export_distros(distro_dir: &Path, out_path: &Path) -> Result<()>
|
||||
{
|
||||
let distros = parse_ascii_distros(distro_dir)?;
|
||||
let mut variants = IndexMap::with_capacity(distros.len());
|
||||
|
||||
for distro in &distros {
|
||||
let variant = distro
|
||||
.friendly_name()
|
||||
.replace(|c: char| c.is_ascii_punctuation() || c == ' ', "_")
|
||||
.nfc()
|
||||
.collect::<String>();
|
||||
if variants.contains_key(&variant) {
|
||||
let variant_fallback = format!("{variant}_fallback");
|
||||
if variants.contains_key(&variant_fallback) {
|
||||
todo!("too many name clashes in ascii distro patterns: {variant}");
|
||||
}
|
||||
variants.insert(variant_fallback, distro);
|
||||
continue;
|
||||
}
|
||||
variants.insert(variant, distro);
|
||||
}
|
||||
|
||||
let mut buf = r###"
|
||||
#[derive(Clone, Eq, PartialEq, Hash, Debug)]
|
||||
pub enum Distro {
|
||||
"###.to_string();
|
||||
|
||||
for (variant, AsciiDistro { pattern, .. }) in &variants {
|
||||
write!(buf, r###"
|
||||
// {pattern})
|
||||
{variant},
|
||||
"###)?;
|
||||
}
|
||||
|
||||
buf.push_str(
|
||||
r###"
|
||||
}
|
||||
|
||||
impl Distro {
|
||||
pub fn detect<S>(name: S) -> Option<Self>
|
||||
where
|
||||
S: AsRef<str>,
|
||||
{
|
||||
let name = name.as_ref().to_lowercase();
|
||||
"###,
|
||||
);
|
||||
|
||||
for (variant, AsciiDistro { pattern, .. }) in &variants {
|
||||
let patterns = pattern.split('|').map(|s| s.trim());
|
||||
let mut conds = Vec::new();
|
||||
|
||||
for m in patterns {
|
||||
let stripped = m.trim_matches(['*', '\'', '"']).to_lowercase();
|
||||
|
||||
if stripped.contains(['*', '"']) {
|
||||
if let Some((prefix, suffix)) = stripped.split_once(r#""*""#) {
|
||||
conds.push(format!(
|
||||
r#"name.starts_with("{prefix}") && name.ends_with("{suffix}")"#
|
||||
));
|
||||
continue;
|
||||
}
|
||||
todo!("cannot properly parse: {m}");
|
||||
}
|
||||
|
||||
// Exact matches
|
||||
if m.trim_matches('*') == m {
|
||||
conds.push(format!(r#"name == "{stripped}""#));
|
||||
continue;
|
||||
}
|
||||
|
||||
// Both sides are *
|
||||
if m.starts_with('*') && m.ends_with('*') {
|
||||
conds.push(format!(
|
||||
r#"name.starts_with("{stripped}") || name.ends_with("{stripped}")"#
|
||||
));
|
||||
continue;
|
||||
}
|
||||
|
||||
// Ends with *
|
||||
if m.ends_with('*') {
|
||||
conds.push(format!(r#"name.starts_with("{stripped}")"#));
|
||||
continue;
|
||||
}
|
||||
|
||||
// Starts with *
|
||||
if m.starts_with('*') {
|
||||
conds.push(format!(r#"name.ends_with("{stripped}")"#));
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
let condition = conds.join(" || ");
|
||||
|
||||
write!(buf, r###"
|
||||
if {condition} {{
|
||||
return Some(Self::{variant});
|
||||
}}
|
||||
"###)?;
|
||||
}
|
||||
|
||||
buf.push_str(
|
||||
r###"
|
||||
None
|
||||
}
|
||||
|
||||
pub fn color(&self) -> &str {
|
||||
match self {
|
||||
"###,
|
||||
);
|
||||
|
||||
for (variant, AsciiDistro { color, .. }) in &variants {
|
||||
write!(buf, r###"
|
||||
Self::{variant} => {color:?},
|
||||
"###, color = color)?;
|
||||
}
|
||||
|
||||
buf.push_str(
|
||||
r###"
|
||||
}
|
||||
}
|
||||
|
||||
pub fn foreground(&self) -> &[u8] {
|
||||
match self {
|
||||
"###,
|
||||
);
|
||||
|
||||
for (variant, AsciiDistro { foreground, .. }) in &variants {
|
||||
if foreground.is_empty() {
|
||||
write!(buf, r###"
|
||||
Self::{variant} => &[],
|
||||
"###)?;
|
||||
} else {
|
||||
write!(buf, r###"
|
||||
Self::{variant} => &{:?},
|
||||
"###, foreground)?;
|
||||
}
|
||||
}
|
||||
|
||||
buf.push_str(
|
||||
r###"
|
||||
}
|
||||
}
|
||||
|
||||
pub fn background(&self) -> Option<u8> {
|
||||
match self {
|
||||
"###,
|
||||
);
|
||||
|
||||
for (variant, AsciiDistro { background, .. }) in &variants {
|
||||
if let Some(b) = background {
|
||||
write!(buf, r###"
|
||||
Self::{variant} => Some({b}),
|
||||
"###)?;
|
||||
} else {
|
||||
write!(buf, r###"
|
||||
Self::{variant} => None,
|
||||
"###)?;
|
||||
}
|
||||
}
|
||||
|
||||
buf.push_str(
|
||||
r###"
|
||||
}
|
||||
}
|
||||
|
||||
pub fn ascii_art(&self) -> &str {
|
||||
let art = match self {
|
||||
"###,
|
||||
);
|
||||
|
||||
let quotes = "#".repeat(80);
|
||||
for (variant, AsciiDistro { art, .. }) in &variants {
|
||||
write!(buf, r###"
|
||||
Self::{variant} => r{quotes}"
|
||||
{art}
|
||||
"{quotes},
|
||||
"###)?;
|
||||
}
|
||||
|
||||
buf.push_str(
|
||||
r###"
|
||||
};
|
||||
&art[1..art.len().checked_sub(1).unwrap()]
|
||||
}
|
||||
}
|
||||
"###,
|
||||
);
|
||||
|
||||
fs::write(out_path.join("distros.rs"), buf)?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn parse_ascii_distros(distro_dir: &Path) -> Result<Vec<AsciiDistro>>
|
||||
{
|
||||
let mut distros = Vec::new();
|
||||
let mut paths: Vec<_> = fs::read_dir(distro_dir)?
|
||||
.filter_map(|e| e.ok())
|
||||
.map(|e| e.path())
|
||||
.collect();
|
||||
paths.sort();
|
||||
|
||||
for path in paths {
|
||||
if path.extension().and_then(|s| s.to_str()) == Some("ascii") {
|
||||
let content = fs::read_to_string(&path)?;
|
||||
let (header_line, art) = content.split_once('\n').context("invalid distro file")?;
|
||||
let header: DistroHeader = serde_json::from_str(header_line)?;
|
||||
let color = match header.color {
|
||||
serde_json::Value::String(s) => s,
|
||||
serde_json::Value::Number(n) => n.to_string(),
|
||||
_ => "7".to_owned(),
|
||||
};
|
||||
distros.push(AsciiDistro {
|
||||
pattern: header.pattern,
|
||||
color,
|
||||
foreground: header.foreground.unwrap_or_default(),
|
||||
background: header.background,
|
||||
art: art.to_owned(),
|
||||
});
|
||||
}
|
||||
}
|
||||
Ok(distros)
|
||||
}
|
||||
|
||||
// Preset parsing
|
||||
#[derive(Deserialize, Debug)]
|
||||
#[serde(untagged)]
|
||||
enum PresetEntry {
|
||||
Simple(Vec<String>),
|
||||
Complex { colors: Vec<String>, weights: Option<Vec<u32>> },
|
||||
}
|
||||
|
||||
type PresetMap = IndexMap<String, PresetEntry>;
|
||||
|
||||
fn preset_codegen(json_path: &Path, out_path: &Path) -> Result<()> {
|
||||
// 1. Read and parse the JSON file
|
||||
let json_str = fs::read_to_string(json_path)?;
|
||||
let map: PresetMap = serde_json::from_str(&json_str)?;
|
||||
let mut f = BufWriter::new(fs::File::create(&out_path)?);
|
||||
|
||||
// 2. Build the code string
|
||||
let mut code_decl = String::new();
|
||||
let mut code_match = String::new();
|
||||
for (key, data) in map.iter() {
|
||||
let colors = match data {
|
||||
PresetEntry::Simple(c) => c,
|
||||
PresetEntry::Complex { colors, .. } => colors,
|
||||
};
|
||||
let colors = colors.iter().map(|s| format!("\"{}\"", s)).collect::<Vec<_>>().join(", ");
|
||||
let uck = key.to_upper_camel_case();
|
||||
|
||||
code_decl += &format!(r#"
|
||||
#[serde(rename = "{key}")]
|
||||
#[strum(serialize = "{key}")]
|
||||
{uck},
|
||||
"#);
|
||||
|
||||
let w = if let PresetEntry::Complex { weights: Some(w), .. } = data {
|
||||
format!(".and_then(|c| c.with_weights(vec![{}]))", w.iter().map(|n| n.to_string()).collect::<Vec<_>>().join(", "))
|
||||
} else { "".to_string() };
|
||||
|
||||
code_match += &format!(r#"
|
||||
Preset::{uck} => ColorProfile::from_hex_colors(vec![{colors}]){w},
|
||||
"#);
|
||||
}
|
||||
|
||||
// 3. Write the static map to the generated file
|
||||
writeln!(f, r#"
|
||||
pub use crate::color_profile::ColorProfile;
|
||||
use serde::{{Deserialize, Serialize}};
|
||||
use strum::{{AsRefStr, EnumCount, EnumString, VariantArray, VariantNames}};
|
||||
|
||||
#[derive(Copy, Clone, Hash, Debug, AsRefStr, Deserialize, EnumCount, EnumString, Serialize, VariantArray, VariantNames)]
|
||||
pub enum Preset {{
|
||||
{code_decl}
|
||||
}}
|
||||
|
||||
impl Preset {{
|
||||
pub fn color_profile(&self) -> ColorProfile {{
|
||||
(match self {{
|
||||
{code_match}
|
||||
}})
|
||||
.expect("preset color profiles should be valid")
|
||||
}}
|
||||
}}"#)?;
|
||||
|
||||
f.flush()?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
@@ -0,0 +1,396 @@
|
||||
use std::borrow::Cow;
|
||||
use std::fmt::Write as _;
|
||||
use std::ops::Range;
|
||||
|
||||
use aho_corasick::AhoCorasick;
|
||||
use anyhow::{Context as _, Result};
|
||||
use indexmap::IndexMap;
|
||||
use tracing::debug;
|
||||
use unicode_segmentation::UnicodeSegmentation;
|
||||
|
||||
use crate::color_util::{
|
||||
color, ForegroundBackground, NeofetchAsciiIndexedColor, ToAnsiString as _,
|
||||
};
|
||||
use crate::neofetch_util::{
|
||||
ascii_size, ColorAlignment, NEOFETCH_COLORS_AC, NEOFETCH_COLOR_PATTERNS,
|
||||
};
|
||||
use crate::presets::ColorProfile;
|
||||
use crate::types::{AnsiMode, TerminalTheme};
|
||||
|
||||
/// Raw ascii art before any processing.
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct RawAsciiArt {
|
||||
pub asc: String,
|
||||
pub fg: Vec<NeofetchAsciiIndexedColor>,
|
||||
}
|
||||
|
||||
/// Normalized ascii art where every line has the same width.
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct NormalizedAsciiArt {
|
||||
pub lines: Vec<String>,
|
||||
pub w: u8,
|
||||
pub h: u8,
|
||||
pub fg: Vec<NeofetchAsciiIndexedColor>,
|
||||
}
|
||||
|
||||
/// Recolored ascii art with all color codes replaced.
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct RecoloredAsciiArt {
|
||||
pub lines: Vec<String>,
|
||||
pub w: u8,
|
||||
pub h: u8,
|
||||
}
|
||||
|
||||
impl RawAsciiArt {
|
||||
/// Makes sure every line is the same width.
|
||||
#[tracing::instrument(level = "debug", skip(self))]
|
||||
pub fn to_normalized(&self) -> Result<NormalizedAsciiArt> {
|
||||
debug!("normalize ascii");
|
||||
|
||||
let (w, h) = ascii_size(&self.asc).context("failed to get ascii size")?;
|
||||
|
||||
let lines = self
|
||||
.asc
|
||||
.lines()
|
||||
.map(|line| {
|
||||
let (line_w, _) = ascii_size(line).unwrap();
|
||||
let pad = " ".repeat(usize::from(w.checked_sub(line_w).unwrap()));
|
||||
format!("{line}{pad}")
|
||||
})
|
||||
.collect();
|
||||
|
||||
Ok(NormalizedAsciiArt {
|
||||
lines,
|
||||
w: w.try_into().context("width does not fit in u8")?,
|
||||
h: h.try_into().context("height does not fit in u8")?,
|
||||
fg: self.fg.clone(),
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
impl NormalizedAsciiArt {
|
||||
/// Uses a color alignment to recolor the ascii art.
|
||||
#[tracing::instrument(level = "debug", skip(self), fields(self.w = self.w, self.h = self.h))]
|
||||
pub fn to_recolored(
|
||||
&self,
|
||||
color_align: &ColorAlignment,
|
||||
color_profile: &ColorProfile,
|
||||
color_mode: AnsiMode,
|
||||
theme: TerminalTheme,
|
||||
) -> Result<RecoloredAsciiArt> {
|
||||
debug!("recolor ascii");
|
||||
|
||||
if self.lines.is_empty() {
|
||||
return Ok(RecoloredAsciiArt {
|
||||
lines: self.lines.clone(),
|
||||
w: 0,
|
||||
h: 0,
|
||||
});
|
||||
}
|
||||
|
||||
let reset = color("&~&*", color_mode).expect("color reset should not be invalid");
|
||||
|
||||
let lines = match (color_align, self) {
|
||||
(ColorAlignment::Horizontal, Self { fg, .. }) => {
|
||||
let Self { lines, .. } = self
|
||||
.fill_starting()
|
||||
.context("failed to fill in starting neofetch color codes")?;
|
||||
|
||||
let ac = NEOFETCH_COLORS_AC
|
||||
.get_or_init(|| AhoCorasick::new(NEOFETCH_COLOR_PATTERNS).unwrap());
|
||||
|
||||
// Replace foreground colors
|
||||
let asc = {
|
||||
let asc = lines.join("\n");
|
||||
let mut replacements = NEOFETCH_COLOR_PATTERNS;
|
||||
let fg_color = color(
|
||||
match theme {
|
||||
TerminalTheme::Light => "&0",
|
||||
TerminalTheme::Dark => "&f",
|
||||
},
|
||||
color_mode,
|
||||
)
|
||||
.expect("foreground color should not be invalid");
|
||||
for &fore in fg {
|
||||
replacements[usize::from(u8::from(fore)).checked_sub(1).unwrap()] =
|
||||
&fg_color;
|
||||
}
|
||||
ac.replace_all(&asc, &replacements)
|
||||
};
|
||||
let lines = asc.lines();
|
||||
|
||||
// Add new colors
|
||||
let lines = {
|
||||
let ColorProfile { colors } = color_profile
|
||||
.with_length(self.h.try_into().expect("`h` should not be 0"))
|
||||
.with_context(|| {
|
||||
format!("failed to spread color profile to length {h}", h = self.h)
|
||||
})?;
|
||||
lines.enumerate().map(move |(i, line)| {
|
||||
let bg_color =
|
||||
colors[i].to_ansi_string(color_mode, ForegroundBackground::Foreground);
|
||||
const N: usize = NEOFETCH_COLOR_PATTERNS.len();
|
||||
let replacements = [&bg_color; N];
|
||||
ac.replace_all(line, &replacements)
|
||||
})
|
||||
};
|
||||
|
||||
// Reset colors at end of each line to prevent color bleeding
|
||||
lines.map(|line| format!("{line}{reset}")).collect()
|
||||
},
|
||||
(ColorAlignment::Vertical, Self { fg, .. }) if !fg.is_empty() => {
|
||||
if self.w == 0 {
|
||||
return Ok(RecoloredAsciiArt {
|
||||
lines: self.lines.clone(),
|
||||
w: 0,
|
||||
h: self.h,
|
||||
});
|
||||
}
|
||||
|
||||
let Self { lines, .. } = self
|
||||
.fill_starting()
|
||||
.context("failed to fill in starting neofetch color codes")?;
|
||||
|
||||
let color_profile = color_profile
|
||||
.with_length(self.w.try_into().expect("`w` should not be 0"))
|
||||
.with_context(|| {
|
||||
format!("failed to spread color profile to length {w}", w = self.w)
|
||||
})?;
|
||||
|
||||
// Apply colors
|
||||
let ac = NEOFETCH_COLORS_AC
|
||||
.get_or_init(|| AhoCorasick::new(NEOFETCH_COLOR_PATTERNS).unwrap());
|
||||
lines
|
||||
.into_iter()
|
||||
.map(|line| {
|
||||
let line: &str = line.as_ref();
|
||||
|
||||
// `AhoCorasick` operates on bytes; we need to map that back to grapheme
|
||||
// clusters (i.e. a character as seen on the terminal)
|
||||
// See https://github.com/BurntSushi/aho-corasick/issues/72#issuecomment-821128859
|
||||
let byte_idx_to_grapheme_idx: IndexMap<usize, usize> = {
|
||||
let mut m: IndexMap<_, _> = line
|
||||
.grapheme_indices(true)
|
||||
.enumerate()
|
||||
.map(|(gr_idx, (byte_idx, _))| (byte_idx, gr_idx))
|
||||
.collect();
|
||||
// Add an extra entry at the end, to support lookup using exclusive
|
||||
// range end
|
||||
m.insert(line.len(), m.len());
|
||||
m
|
||||
};
|
||||
|
||||
let mut matches = ac.find_iter(line).peekable();
|
||||
let mut dst = String::new();
|
||||
let mut offset: u8 = 0;
|
||||
loop {
|
||||
let current = matches.next();
|
||||
let next = matches.peek();
|
||||
let (neofetch_color_idx, span, done) = match (current, next) {
|
||||
(Some(m), Some(m_next)) => {
|
||||
let ai_start = m.start().checked_add(3).unwrap();
|
||||
let ai_end = m.end().checked_sub(1).unwrap();
|
||||
let neofetch_color_idx: NeofetchAsciiIndexedColor = line
|
||||
[ai_start..ai_end]
|
||||
.parse()
|
||||
.expect("neofetch color index should be valid");
|
||||
if offset == 0 && m.start() > 0 {
|
||||
dst.push_str(&line[..m.start()]);
|
||||
}
|
||||
offset =
|
||||
offset.checked_add(u8::try_from(m.len()).unwrap()).unwrap();
|
||||
let mut span = m.span();
|
||||
span.start = m.end();
|
||||
span.end = m_next.start();
|
||||
(neofetch_color_idx, span, false)
|
||||
},
|
||||
(Some(m), None) => {
|
||||
// Last color code
|
||||
let ai_start = m.start().checked_add(3).unwrap();
|
||||
let ai_end = m.end().checked_sub(1).unwrap();
|
||||
let neofetch_color_idx: NeofetchAsciiIndexedColor = line
|
||||
[ai_start..ai_end]
|
||||
.parse()
|
||||
.expect("neofetch color index should be valid");
|
||||
if offset == 0 && m.start() > 0 {
|
||||
dst.push_str(&line[..m.start()]);
|
||||
}
|
||||
offset =
|
||||
offset.checked_add(u8::try_from(m.len()).unwrap()).unwrap();
|
||||
let mut span = m.span();
|
||||
span.start = m.end();
|
||||
span.end = line.len();
|
||||
(neofetch_color_idx, span, true)
|
||||
},
|
||||
(None, _) => {
|
||||
// No color code in the entire line
|
||||
unreachable!(
|
||||
"`fill_starting` ensured each line of ascii art starts \
|
||||
with neofetch color code"
|
||||
);
|
||||
},
|
||||
};
|
||||
|
||||
if span.is_empty() {
|
||||
continue;
|
||||
}
|
||||
|
||||
let txt = &line[span];
|
||||
|
||||
if fg.contains(&neofetch_color_idx) {
|
||||
let fore = color(
|
||||
match theme {
|
||||
TerminalTheme::Light => "&0",
|
||||
TerminalTheme::Dark => "&f",
|
||||
},
|
||||
color_mode,
|
||||
)
|
||||
.expect("foreground color should not be invalid");
|
||||
write!(dst, "{fore}{txt}{reset}").unwrap();
|
||||
} else {
|
||||
let mut c_range: Range<usize> = span.into();
|
||||
c_range.start = byte_idx_to_grapheme_idx
|
||||
.get(&c_range.start)
|
||||
.unwrap()
|
||||
.checked_sub(usize::from(offset))
|
||||
.unwrap();
|
||||
c_range.end = byte_idx_to_grapheme_idx
|
||||
.get(&c_range.end)
|
||||
.unwrap()
|
||||
.checked_sub(usize::from(offset))
|
||||
.unwrap();
|
||||
dst.push_str(
|
||||
&ColorProfile::new(Vec::from(&color_profile.colors[c_range]))
|
||||
.color_text(
|
||||
txt,
|
||||
color_mode,
|
||||
ForegroundBackground::Foreground,
|
||||
false,
|
||||
)
|
||||
.context("failed to color text using color profile")?,
|
||||
);
|
||||
}
|
||||
|
||||
if done {
|
||||
break;
|
||||
}
|
||||
}
|
||||
Ok(dst)
|
||||
})
|
||||
.collect::<Result<_>>()?
|
||||
},
|
||||
(ColorAlignment::Vertical, Self { fg, .. }) if fg.is_empty() => {
|
||||
// Remove existing colors
|
||||
let asc = {
|
||||
let asc = self.lines.join("\n");
|
||||
let ac = NEOFETCH_COLORS_AC
|
||||
.get_or_init(|| AhoCorasick::new(NEOFETCH_COLOR_PATTERNS).unwrap());
|
||||
const N: usize = NEOFETCH_COLOR_PATTERNS.len();
|
||||
const REPLACEMENTS: [&str; N] = [""; N];
|
||||
ac.replace_all(&asc, &REPLACEMENTS)
|
||||
};
|
||||
let lines = asc.lines();
|
||||
|
||||
// Add new colors
|
||||
lines
|
||||
.map(|line| {
|
||||
let line = color_profile
|
||||
.color_text(line, color_mode, ForegroundBackground::Foreground, false)
|
||||
.context("failed to color text using color profile")?;
|
||||
Ok(line)
|
||||
})
|
||||
.collect::<Result<_>>()?
|
||||
},
|
||||
(
|
||||
ColorAlignment::Custom {
|
||||
colors: custom_colors,
|
||||
},
|
||||
_,
|
||||
) => {
|
||||
let Self { lines, .. } = self
|
||||
.fill_starting()
|
||||
.context("failed to fill in starting neofetch color codes")?;
|
||||
|
||||
let ColorProfile { colors } = color_profile.unique_colors();
|
||||
|
||||
// Apply colors
|
||||
let asc = {
|
||||
let asc = lines.join("\n");
|
||||
let ac = NEOFETCH_COLORS_AC
|
||||
.get_or_init(|| AhoCorasick::new(NEOFETCH_COLOR_PATTERNS).unwrap());
|
||||
const N: usize = NEOFETCH_COLOR_PATTERNS.len();
|
||||
let mut replacements = vec![Cow::from(""); N];
|
||||
for (&ai, &pi) in custom_colors {
|
||||
let ai: u8 = ai.into();
|
||||
let pi: u8 = pi.into();
|
||||
replacements[usize::from(ai.checked_sub(1).unwrap())] = colors
|
||||
[usize::from(pi)]
|
||||
.to_ansi_string(color_mode, ForegroundBackground::Foreground)
|
||||
.into();
|
||||
}
|
||||
ac.replace_all(&asc, &replacements)
|
||||
};
|
||||
let lines = asc.lines();
|
||||
|
||||
// Reset colors at end of each line to prevent color bleeding
|
||||
lines.map(|line| format!("{line}{reset}")).collect()
|
||||
},
|
||||
_ => {
|
||||
unreachable!()
|
||||
},
|
||||
};
|
||||
|
||||
Ok(RecoloredAsciiArt {
|
||||
lines,
|
||||
w: self.w,
|
||||
h: self.h,
|
||||
})
|
||||
}
|
||||
|
||||
/// Fills the missing starting placeholders.
|
||||
///
|
||||
/// e.g. `"${c1}...\n..."` -> `"${c1}...\n${c1}..."`
|
||||
fn fill_starting(&self) -> Result<Self> {
|
||||
let ac =
|
||||
NEOFETCH_COLORS_AC.get_or_init(|| AhoCorasick::new(NEOFETCH_COLOR_PATTERNS).unwrap());
|
||||
|
||||
let mut last = None;
|
||||
let lines =
|
||||
self.lines
|
||||
.iter()
|
||||
.map(|line| {
|
||||
let line: &str = line.as_ref();
|
||||
|
||||
let mut new = String::new();
|
||||
let mut matches = ac.find_iter(line).peekable();
|
||||
|
||||
match matches.peek() {
|
||||
Some(m)
|
||||
if m.start() == 0
|
||||
|| line[0..m.start()].trim_end_matches(' ').is_empty() =>
|
||||
{
|
||||
// Line starts with neofetch color code
|
||||
last = Some(&line[m.span()]);
|
||||
},
|
||||
_ => {
|
||||
new.push_str(last.unwrap_or(NEOFETCH_COLOR_PATTERNS[0]));
|
||||
},
|
||||
}
|
||||
new.push_str(line);
|
||||
|
||||
// Get the last placeholder for the next line
|
||||
if let Some(m) = matches.last() {
|
||||
last = Some(&line[m.span()]);
|
||||
}
|
||||
|
||||
Ok(new)
|
||||
})
|
||||
.collect::<Result<_>>()?;
|
||||
|
||||
Ok(Self {
|
||||
lines,
|
||||
fg: self.fg.clone(),
|
||||
..*self
|
||||
})
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,237 @@
|
||||
use std::iter;
|
||||
use std::path::PathBuf;
|
||||
use std::str::FromStr as _;
|
||||
|
||||
use anyhow::Context as _;
|
||||
#[cfg(feature = "autocomplete")]
|
||||
use bpaf::ShellComp;
|
||||
use bpaf::{construct, long, OptionParser, Parser as _};
|
||||
use directories::BaseDirs;
|
||||
use itertools::Itertools as _;
|
||||
use strum::VariantNames;
|
||||
|
||||
use crate::color_util::{color, Lightness};
|
||||
use crate::presets::Preset;
|
||||
use crate::types::{AnsiMode, Backend};
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct Options {
|
||||
pub config: bool,
|
||||
pub config_file: PathBuf,
|
||||
pub preset: Option<String>,
|
||||
pub mode: Option<AnsiMode>,
|
||||
pub backend: Option<Backend>,
|
||||
pub args: Option<Vec<String>>,
|
||||
pub scale: Option<f32>,
|
||||
pub lightness: Option<Lightness>,
|
||||
pub june: bool,
|
||||
pub debug: bool,
|
||||
pub distro: Option<String>,
|
||||
pub ascii_file: Option<PathBuf>,
|
||||
pub print_font_logo: bool,
|
||||
pub test_print: bool,
|
||||
pub ask_exit: bool,
|
||||
pub auto_detect_light_dark: Option<bool>,
|
||||
}
|
||||
|
||||
pub fn options() -> OptionParser<Options> {
|
||||
let config = long("config").short('c').help("Configure hyfetch").switch();
|
||||
let config_file = long("config-file")
|
||||
.short('C')
|
||||
.help("Use another config file")
|
||||
.argument("CONFIG_FILE");
|
||||
#[cfg(feature = "autocomplete")]
|
||||
let config_file = config_file.complete_shell(ShellComp::Nothing);
|
||||
let config_file = config_file
|
||||
.fallback_with(|| {
|
||||
Ok::<_, anyhow::Error>(
|
||||
BaseDirs::new()
|
||||
.context("failed to get base dirs")?
|
||||
.config_dir()
|
||||
.join("hyfetch.json"),
|
||||
)
|
||||
})
|
||||
.debug_fallback();
|
||||
let preset = long("preset")
|
||||
.short('p')
|
||||
.help(&*format!(
|
||||
"Use preset or comma-separated color list or comma-separated hex colors (e.g., \"#ff0000,#00ff00,#0000ff\"). Comma-separated preset names will pick one randomly.
|
||||
PRESET={{{presets}}}",
|
||||
presets = <Preset as VariantNames>::VARIANTS
|
||||
.iter()
|
||||
.chain(iter::once(&"random"))
|
||||
.join(",")
|
||||
))
|
||||
.argument::<String>("PRESET");
|
||||
#[cfg(feature = "autocomplete")]
|
||||
let preset = preset.complete(complete_preset);
|
||||
let preset = preset.optional();
|
||||
let mode = long("mode")
|
||||
.short('m')
|
||||
.help(&*format!(
|
||||
"Color mode
|
||||
MODE={{{modes}}}",
|
||||
modes = AnsiMode::VARIANTS.join(",")
|
||||
))
|
||||
.argument::<String>("MODE");
|
||||
#[cfg(feature = "autocomplete")]
|
||||
let mode = mode.complete(complete_mode);
|
||||
let mode = mode
|
||||
.parse(|s| {
|
||||
AnsiMode::from_str(&s).with_context(|| {
|
||||
format!(
|
||||
"MODE should be one of {{{modes}}}",
|
||||
modes = AnsiMode::VARIANTS.join(",")
|
||||
)
|
||||
})
|
||||
})
|
||||
.optional();
|
||||
let backend = long("backend")
|
||||
.short('b')
|
||||
.help(&*format!(
|
||||
"Choose a *fetch backend
|
||||
BACKEND={{{backends}}}",
|
||||
backends = Backend::VARIANTS.join(",")
|
||||
))
|
||||
.argument::<String>("BACKEND");
|
||||
#[cfg(feature = "autocomplete")]
|
||||
let backend = backend.complete(complete_backend);
|
||||
let backend = backend
|
||||
.parse(|s| {
|
||||
Backend::from_str(&s).with_context(|| {
|
||||
format!(
|
||||
"BACKEND should be one of {{{backends}}}",
|
||||
backends = Backend::VARIANTS.join(",")
|
||||
)
|
||||
})
|
||||
})
|
||||
.optional();
|
||||
let args = long("args")
|
||||
.help("Additional arguments pass-through to backend")
|
||||
.argument::<String>("ARGS")
|
||||
.parse(|s| shell_words::split(&s).context("ARGS should be valid command-line arguments"))
|
||||
.optional();
|
||||
let scale = long("c-scale")
|
||||
.help("Lighten colors by a multiplier")
|
||||
.argument("SCALE")
|
||||
.optional();
|
||||
let lightness = long("c-set-l")
|
||||
.help("Set lightness value of the colors")
|
||||
.argument("LIGHTNESS")
|
||||
.optional();
|
||||
let june = long("june").help("Show pride month easter egg").switch();
|
||||
let debug = long("debug").help("Debug mode").switch();
|
||||
let distro = long("distro")
|
||||
.help("Test for a specific distro")
|
||||
.argument("DISTRO")
|
||||
.optional();
|
||||
let test_distro = long("test-distro")
|
||||
.help("Test for a specific distro")
|
||||
.argument("DISTRO")
|
||||
.optional();
|
||||
let distro = construct!([distro, test_distro]);
|
||||
let ascii_file = long("ascii-file")
|
||||
.help("Use a specific file for the ascii art")
|
||||
.argument("ASCII_FILE");
|
||||
#[cfg(feature = "autocomplete")]
|
||||
let ascii_file = ascii_file.complete_shell(ShellComp::Nothing);
|
||||
let ascii_file = ascii_file.optional();
|
||||
let print_font_logo = long("print-font-logo")
|
||||
.help("Print the Font Logo / Nerd Font icon of your distro and exit")
|
||||
.switch();
|
||||
// hidden
|
||||
let test_print = long("test-print")
|
||||
.help("Print the ascii distro and exit")
|
||||
.switch()
|
||||
.hide();
|
||||
let ask_exit = long("ask-exit")
|
||||
.help("Ask for input before exiting")
|
||||
.switch()
|
||||
.hide();
|
||||
let auto_detect_light_dark = long("auto-detect-light-dark")
|
||||
.help("Enables hyfetch to detect light/dark terminal background in runtime")
|
||||
.argument("BOOL")
|
||||
.optional();
|
||||
|
||||
construct!(Options {
|
||||
config,
|
||||
config_file,
|
||||
preset,
|
||||
mode,
|
||||
backend,
|
||||
args,
|
||||
scale,
|
||||
lightness,
|
||||
june,
|
||||
debug,
|
||||
distro,
|
||||
ascii_file,
|
||||
print_font_logo,
|
||||
// hidden
|
||||
test_print,
|
||||
ask_exit,
|
||||
auto_detect_light_dark,
|
||||
})
|
||||
.to_options()
|
||||
.header(
|
||||
&*color(
|
||||
"&l&bhyfetch&~&L - neofetch with flags <3",
|
||||
AnsiMode::Ansi256,
|
||||
)
|
||||
.expect("header should not contain invalid color codes"),
|
||||
)
|
||||
.version(env!("CARGO_PKG_VERSION"))
|
||||
}
|
||||
|
||||
#[cfg(feature = "autocomplete")]
|
||||
fn complete_preset(input: &String) -> Vec<(String, Option<String>)> {
|
||||
<Preset as VariantNames>::VARIANTS
|
||||
.iter()
|
||||
.chain(iter::once(&"random"))
|
||||
.filter_map(|&name| {
|
||||
if name.starts_with(input) {
|
||||
Some((name.to_owned(), None))
|
||||
} else {
|
||||
None
|
||||
}
|
||||
})
|
||||
.collect::<Vec<_>>()
|
||||
}
|
||||
|
||||
#[cfg(feature = "autocomplete")]
|
||||
fn complete_mode(input: &String) -> Vec<(String, Option<String>)> {
|
||||
AnsiMode::VARIANTS
|
||||
.iter()
|
||||
.filter_map(|&name| {
|
||||
if name.starts_with(input) {
|
||||
Some((name.to_owned(), None))
|
||||
} else {
|
||||
None
|
||||
}
|
||||
})
|
||||
.collect::<Vec<_>>()
|
||||
}
|
||||
|
||||
#[cfg(feature = "autocomplete")]
|
||||
fn complete_backend(input: &String) -> Vec<(String, Option<String>)> {
|
||||
Backend::VARIANTS
|
||||
.iter()
|
||||
.filter_map(|&name| {
|
||||
if name.starts_with(input) {
|
||||
Some((name.to_owned(), None))
|
||||
} else {
|
||||
None
|
||||
}
|
||||
})
|
||||
.collect::<Vec<_>>()
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn check_options() {
|
||||
options().check_invariants(false)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,232 @@
|
||||
use std::iter;
|
||||
use std::num::{NonZeroU8, NonZeroUsize};
|
||||
|
||||
use anyhow::{anyhow, Result, Context as _};
|
||||
use indexmap::IndexSet;
|
||||
use palette::num::ClampAssign as _;
|
||||
use palette::{IntoColorMut as _, LinSrgb, Okhsl, Srgb};
|
||||
use tracing::debug;
|
||||
use unicode_segmentation::UnicodeSegmentation as _;
|
||||
|
||||
use crate::color_util::{ForegroundBackground, Lightness, ToAnsiString as _};
|
||||
use crate::types::{AnsiMode, TerminalTheme};
|
||||
|
||||
#[derive(Clone, Eq, PartialEq, Debug)]
|
||||
pub struct ColorProfile {
|
||||
pub colors: Vec<Srgb<u8>>,
|
||||
}
|
||||
|
||||
#[derive(Clone, PartialEq, Debug)]
|
||||
pub enum AssignLightness {
|
||||
Replace(Lightness),
|
||||
ClampMax(Lightness),
|
||||
ClampMin(Lightness),
|
||||
}
|
||||
|
||||
impl ColorProfile {
|
||||
pub fn new(colors: Vec<Srgb<u8>>) -> Self {
|
||||
Self { colors }
|
||||
}
|
||||
|
||||
pub fn from_hex_colors<S>(hex_colors: Vec<S>) -> Result<Self>
|
||||
where
|
||||
S: AsRef<str>,
|
||||
{
|
||||
let colors = hex_colors
|
||||
.into_iter()
|
||||
.map(|s| s.as_ref().parse())
|
||||
.collect::<Result<_, _>>()
|
||||
.context("failed to parse hex colors")?;
|
||||
Ok(Self::new(colors))
|
||||
}
|
||||
|
||||
/// Maps colors based on weights.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `weights` - Weights of each color (`weights[i]` = how many times
|
||||
/// `colors[i]` appears)
|
||||
pub fn with_weights(&self, weights: Vec<u8>) -> Result<Self> {
|
||||
if weights.len() != self.colors.len() {
|
||||
debug!(?weights, ?self.colors, "length mismatch between `weights` and `colors`");
|
||||
return Err(anyhow!(
|
||||
"`weights` should have the same number of elements as `colors`"
|
||||
));
|
||||
}
|
||||
|
||||
let mut weighted_colors = Vec::new();
|
||||
|
||||
for (i, w) in weights.into_iter().enumerate() {
|
||||
weighted_colors.extend(iter::repeat(self.colors[i]).take(usize::from(w)));
|
||||
}
|
||||
|
||||
Ok(Self::new(weighted_colors))
|
||||
}
|
||||
|
||||
/// Creates a new color profile, with the colors spread to the specified
|
||||
/// length.
|
||||
pub fn with_length(&self, length: NonZeroU8) -> Result<Self> {
|
||||
let orig_len = self.colors.len();
|
||||
let orig_len: NonZeroUsize = orig_len.try_into().expect("`colors` should not be empty");
|
||||
let orig_len: NonZeroU8 = orig_len
|
||||
.try_into()
|
||||
.expect("`colors` should not have more than 255 elements");
|
||||
// TODO: I believe weird things can happen because of this...
|
||||
// if length < orig_len {
|
||||
// unimplemented!("compressing length of color profile not implemented");
|
||||
// }
|
||||
let center_i = usize::from(orig_len.get() / 2);
|
||||
|
||||
// How many copies of each color should be displayed at least?
|
||||
let repeats = length.get().div_euclid(orig_len.get());
|
||||
let mut weights = vec![repeats; NonZeroUsize::from(orig_len).get()];
|
||||
|
||||
// How many extra spaces left?
|
||||
let mut extras = length.get().rem_euclid(orig_len.get());
|
||||
|
||||
// If there is an odd space left, extend the center by one space
|
||||
if extras % 2 == 1 {
|
||||
weights[center_i] = weights[center_i].checked_add(1).unwrap();
|
||||
extras = extras.checked_sub(1).unwrap();
|
||||
}
|
||||
|
||||
// Add weight to border until there's no space left (extras must be even at this
|
||||
// point)
|
||||
let weights_len = weights.len();
|
||||
for border_i in 0..usize::from(extras / 2) {
|
||||
weights[border_i] = weights[border_i].checked_add(1).unwrap();
|
||||
let border_opp = weights_len
|
||||
.checked_sub(border_i)
|
||||
.unwrap()
|
||||
.checked_sub(1)
|
||||
.unwrap();
|
||||
weights[border_opp] = weights[border_opp].checked_add(1).unwrap();
|
||||
}
|
||||
|
||||
self.with_weights(weights)
|
||||
}
|
||||
|
||||
/// Colors a text.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `foreground_background` - Whether the color is shown on the foreground
|
||||
/// text or the background block
|
||||
/// * `space_only` - Whether to only color spaces
|
||||
pub fn color_text<S>(
|
||||
&self,
|
||||
txt: S,
|
||||
color_mode: AnsiMode,
|
||||
foreground_background: ForegroundBackground,
|
||||
space_only: bool,
|
||||
) -> Result<String>
|
||||
where
|
||||
S: AsRef<str>,
|
||||
{
|
||||
let txt = txt.as_ref();
|
||||
|
||||
let txt: Vec<&str> = txt.graphemes(true).collect();
|
||||
|
||||
let ColorProfile { colors } = {
|
||||
let length = txt.len();
|
||||
let length: NonZeroUsize = length.try_into().context("`txt` should not be empty")?;
|
||||
let length: NonZeroU8 = length.try_into().with_context(|| {
|
||||
format!(
|
||||
"`txt` should not have more than {limit} characters",
|
||||
limit = u8::MAX
|
||||
)
|
||||
})?;
|
||||
self.with_length(length)
|
||||
.with_context(|| format!("failed to spread color profile to length {length}"))?
|
||||
};
|
||||
|
||||
let mut buf = String::new();
|
||||
for (i, &gr) in txt.iter().enumerate() {
|
||||
if space_only && gr != " " {
|
||||
if i > 0 && txt[i.checked_sub(1).unwrap()] == " " {
|
||||
buf.push_str("\x1b[39;49m");
|
||||
}
|
||||
buf.push_str(gr);
|
||||
} else {
|
||||
buf.push_str(&colors[i].to_ansi_string(color_mode, foreground_background));
|
||||
buf.push_str(gr);
|
||||
}
|
||||
}
|
||||
|
||||
buf.push_str("\x1b[39;49m");
|
||||
Ok(buf)
|
||||
}
|
||||
|
||||
/// Creates a new color profile, with the colors lightened by a multiplier.
|
||||
pub fn lighten(&self, multiplier: f32) -> Self {
|
||||
let mut rgb_f32_colors: Vec<LinSrgb> =
|
||||
self.colors.iter().map(|c| c.into_linear()).collect();
|
||||
|
||||
{
|
||||
let okhsl_f32_colors: &mut [Okhsl] = &mut rgb_f32_colors.into_color_mut();
|
||||
|
||||
for okhsl_f32_color in okhsl_f32_colors {
|
||||
okhsl_f32_color.lightness *= multiplier;
|
||||
}
|
||||
}
|
||||
|
||||
let rgb_u8_colors: Vec<_> = rgb_f32_colors
|
||||
.into_iter()
|
||||
.map(Srgb::<u8>::from_linear)
|
||||
.collect();
|
||||
|
||||
Self {
|
||||
colors: rgb_u8_colors,
|
||||
}
|
||||
}
|
||||
|
||||
/// Creates a new color profile, with the colors set to the specified
|
||||
/// [`Okhsl`] lightness value.
|
||||
pub fn with_lightness(&self, assign_lightness: AssignLightness) -> Self {
|
||||
let mut rgb_f32_colors: Vec<LinSrgb> =
|
||||
self.colors.iter().map(|c| c.into_linear()).collect();
|
||||
|
||||
{
|
||||
let okhsl_f32_colors: &mut [Okhsl] = &mut rgb_f32_colors.into_color_mut();
|
||||
|
||||
for okhsl_f32_color in okhsl_f32_colors {
|
||||
match assign_lightness {
|
||||
AssignLightness::Replace(lightness) => {
|
||||
okhsl_f32_color.lightness = lightness.into();
|
||||
},
|
||||
AssignLightness::ClampMax(lightness) => {
|
||||
okhsl_f32_color.lightness.clamp_max_assign(lightness.into());
|
||||
},
|
||||
AssignLightness::ClampMin(lightness) => {
|
||||
okhsl_f32_color.lightness.clamp_min_assign(lightness.into());
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
let rgb_u8_colors: Vec<Srgb<u8>> = rgb_f32_colors
|
||||
.into_iter()
|
||||
.map(Srgb::<u8>::from_linear)
|
||||
.collect();
|
||||
|
||||
Self {
|
||||
colors: rgb_u8_colors,
|
||||
}
|
||||
}
|
||||
|
||||
/// Creates a new color profile, with the colors set to the specified
|
||||
/// [`Okhsl`] lightness value, adapted to the terminal theme.
|
||||
pub fn with_lightness_adaptive(&self, lightness: Lightness, theme: TerminalTheme) -> Self {
|
||||
match theme {
|
||||
TerminalTheme::Dark => self.with_lightness(AssignLightness::ClampMin(lightness)),
|
||||
TerminalTheme::Light => self.with_lightness(AssignLightness::ClampMax(lightness)),
|
||||
}
|
||||
}
|
||||
|
||||
/// Creates another color profile with only the unique colors.
|
||||
pub fn unique_colors(&self) -> Self {
|
||||
let unique_colors: IndexSet<[u8; 3]> = self.colors.iter().map(|&c| c.into()).collect();
|
||||
let unique_colors: Vec<Srgb<u8>> = unique_colors.into_iter().map(|c| c.into()).collect();
|
||||
Self::new(unique_colors)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,435 @@
|
||||
use std::io::{self, Write as _};
|
||||
use std::num::{ParseFloatError, ParseIntError};
|
||||
use std::str::FromStr;
|
||||
use std::sync::OnceLock;
|
||||
|
||||
use aho_corasick::AhoCorasick;
|
||||
use ansi_colours::{ansi256_from_grey, rgb_from_ansi256, AsRGB as _};
|
||||
use anyhow::{anyhow, Context as _, Result};
|
||||
use deranged::RangedU8;
|
||||
use palette::color_difference::ImprovedCiede2000 as _;
|
||||
use palette::{
|
||||
FromColor as _, IntoColor as _, IntoColorMut as _, Lab, LinSrgb, Okhsl, Srgb, SrgbLuma,
|
||||
};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use thiserror::Error;
|
||||
|
||||
use crate::types::{AnsiMode, TerminalTheme};
|
||||
|
||||
const MINECRAFT_COLORS: [(&str, &str); 30] = [
|
||||
// Minecraft formatting codes
|
||||
// ==========================
|
||||
("&0", "\x1b[38;5;0m"),
|
||||
("&1", "\x1b[38;5;4m"),
|
||||
("&2", "\x1b[38;5;2m"),
|
||||
("&3", "\x1b[38;5;6m"),
|
||||
("&4", "\x1b[38;5;1m"),
|
||||
("&5", "\x1b[38;5;5m"),
|
||||
("&6", "\x1b[38;5;3m"),
|
||||
("&7", "\x1b[38;5;7m"),
|
||||
("&8", "\x1b[38;5;8m"),
|
||||
("&9", "\x1b[38;5;12m"),
|
||||
("&a", "\x1b[38;5;10m"),
|
||||
("&b", "\x1b[38;5;14m"),
|
||||
("&c", "\x1b[38;5;9m"),
|
||||
("&d", "\x1b[38;5;13m"),
|
||||
("&e", "\x1b[38;5;11m"),
|
||||
("&f", "\x1b[38;5;15m"),
|
||||
("&l", "\x1b[1m"), // Enable bold text
|
||||
("&o", "\x1b[3m"), // Enable italic text
|
||||
("&n", "\x1b[4m"), // Enable underlined text
|
||||
("&k", "\x1b[8m"), // Enable hidden text
|
||||
("&m", "\x1b[9m"), // Enable strikethrough text
|
||||
("&r", "\x1b[0m"), // Reset everything
|
||||
// Extended codes (not officially in Minecraft)
|
||||
// ============================================
|
||||
("&-", "\n"), // Line break
|
||||
("&~", "\x1b[39m"), // Reset text color
|
||||
("&*", "\x1b[49m"), // Reset background color
|
||||
("&L", "\x1b[22m"), // Disable bold text
|
||||
("&O", "\x1b[23m"), // Disable italic text
|
||||
("&N", "\x1b[24m"), // Disable underlined text
|
||||
("&K", "\x1b[28m"), // Disable hidden text
|
||||
("&M", "\x1b[29m"), // Disable strikethrough text
|
||||
];
|
||||
const RGB_COLOR_PATTERNS: [&str; 2] = ["&gf(", "&gb("];
|
||||
|
||||
/// See https://github.com/mina86/ansi_colours/blob/b9feefce10def2ac632b215ecd20830a4fca7836/src/ansi256.rs#L109
|
||||
const ANSI256_GRAYSCALE_COLORS: [u8; 30] = [
|
||||
16, 59, 102, 145, 188, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244,
|
||||
245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255,
|
||||
];
|
||||
|
||||
static MINECRAFT_COLORS_AC: OnceLock<(AhoCorasick, Box<[&str; 30]>)> = OnceLock::new();
|
||||
static RGB_COLORS_AC: OnceLock<AhoCorasick> = OnceLock::new();
|
||||
|
||||
/// Represents the lightness component in [`Okhsl`].
|
||||
///
|
||||
/// The range of valid values is
|
||||
/// [`Lightness::MIN`]`..=`[`Lightness::MAX`]
|
||||
///
|
||||
/// [`Okhsl`]: palette::Okhsl
|
||||
#[derive(Copy, Clone, PartialEq, PartialOrd, Debug, Deserialize, Serialize)]
|
||||
pub struct Lightness(f32);
|
||||
|
||||
#[derive(Debug, Error)]
|
||||
pub enum LightnessError {
|
||||
#[error(
|
||||
"invalid lightness {0}, expected value between {min} and {max}",
|
||||
min = Lightness::MIN,
|
||||
max = Lightness::MAX
|
||||
)]
|
||||
OutOfRange(f32),
|
||||
}
|
||||
|
||||
#[derive(Debug, Error)]
|
||||
pub enum ParseLightnessError {
|
||||
#[error("invalid float")]
|
||||
InvalidFloat(#[from] ParseFloatError),
|
||||
#[error("invalid lightness")]
|
||||
InvalidLightness(#[from] LightnessError),
|
||||
}
|
||||
|
||||
/// An indexed color where the color palette is the set of colors used in
|
||||
/// neofetch ascii art.
|
||||
///
|
||||
/// The range of valid values as supported in neofetch is
|
||||
/// [`NeofetchAsciiIndexedColor::MIN`]`..=`[`NeofetchAsciiIndexedColor::MAX`]
|
||||
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Debug, Deserialize, Serialize)]
|
||||
pub struct NeofetchAsciiIndexedColor(
|
||||
RangedU8<{ NeofetchAsciiIndexedColor::MIN }, { NeofetchAsciiIndexedColor::MAX }>,
|
||||
);
|
||||
|
||||
/// An indexed color where the color palette is the set of unique colors in a
|
||||
/// preset.
|
||||
///
|
||||
/// The range of valid values depends on the number of unique colors in a
|
||||
/// certain preset.
|
||||
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Debug, Deserialize, Serialize)]
|
||||
pub struct PresetIndexedColor(u8);
|
||||
|
||||
/// Whether the color is for foreground text or background color.
|
||||
#[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
|
||||
pub enum ForegroundBackground {
|
||||
Foreground,
|
||||
Background,
|
||||
}
|
||||
|
||||
pub trait ToAnsiString {
|
||||
/// Converts RGB to ANSI escape code.
|
||||
fn to_ansi_string(&self, mode: AnsiMode, foreground_background: ForegroundBackground)
|
||||
-> String;
|
||||
}
|
||||
|
||||
pub trait Theme {
|
||||
fn theme(&self) -> TerminalTheme;
|
||||
}
|
||||
|
||||
pub trait ContrastGrayscale {
|
||||
/// Calculates the grayscale foreground color which provides the highest
|
||||
/// contrast against this background color.
|
||||
///
|
||||
/// The returned color is one of the ANSI 256 (8-bit) grayscale colors.
|
||||
///
|
||||
/// See <https://upload.wikimedia.org/wikipedia/commons/1/15/Xterm_256color_chart.svg>
|
||||
fn contrast_grayscale(&self) -> SrgbLuma<u8>;
|
||||
}
|
||||
|
||||
impl Lightness {
|
||||
pub const MAX: f32 = 1.0f32;
|
||||
pub const MIN: f32 = 0.0f32;
|
||||
|
||||
pub fn new(value: f32) -> Result<Self, LightnessError> {
|
||||
if !(Self::MIN..=Self::MAX).contains(&value) {
|
||||
return Err(LightnessError::OutOfRange(value));
|
||||
}
|
||||
|
||||
Ok(Self(value))
|
||||
}
|
||||
}
|
||||
|
||||
impl TryFrom<f32> for Lightness {
|
||||
type Error = LightnessError;
|
||||
|
||||
fn try_from(value: f32) -> Result<Self, Self::Error> {
|
||||
Lightness::new(value)
|
||||
}
|
||||
}
|
||||
|
||||
impl FromStr for Lightness {
|
||||
type Err = ParseLightnessError;
|
||||
|
||||
fn from_str(s: &str) -> Result<Self, Self::Err> {
|
||||
Ok(Lightness::new(s.parse()?)?)
|
||||
}
|
||||
}
|
||||
|
||||
impl From<Lightness> for f32 {
|
||||
fn from(value: Lightness) -> Self {
|
||||
value.0
|
||||
}
|
||||
}
|
||||
|
||||
impl NeofetchAsciiIndexedColor {
|
||||
pub const MAX: u8 = 6;
|
||||
pub const MIN: u8 = 1;
|
||||
}
|
||||
|
||||
impl TryFrom<u8> for NeofetchAsciiIndexedColor {
|
||||
type Error = deranged::TryFromIntError;
|
||||
|
||||
fn try_from(value: u8) -> Result<Self, Self::Error> {
|
||||
Ok(Self(value.try_into()?))
|
||||
}
|
||||
}
|
||||
|
||||
impl FromStr for NeofetchAsciiIndexedColor {
|
||||
type Err = deranged::ParseIntError;
|
||||
|
||||
fn from_str(s: &str) -> Result<Self, Self::Err> {
|
||||
Ok(Self(s.parse()?))
|
||||
}
|
||||
}
|
||||
|
||||
impl From<NeofetchAsciiIndexedColor> for u8 {
|
||||
fn from(value: NeofetchAsciiIndexedColor) -> Self {
|
||||
value.0.get()
|
||||
}
|
||||
}
|
||||
|
||||
impl From<u8> for PresetIndexedColor {
|
||||
fn from(value: u8) -> Self {
|
||||
Self(value)
|
||||
}
|
||||
}
|
||||
|
||||
impl FromStr for PresetIndexedColor {
|
||||
type Err = ParseIntError;
|
||||
|
||||
fn from_str(s: &str) -> Result<Self, Self::Err> {
|
||||
Ok(Self(s.parse()?))
|
||||
}
|
||||
}
|
||||
|
||||
impl From<PresetIndexedColor> for u8 {
|
||||
fn from(value: PresetIndexedColor) -> Self {
|
||||
value.0
|
||||
}
|
||||
}
|
||||
|
||||
impl ToAnsiString for Srgb<u8> {
|
||||
fn to_ansi_string(
|
||||
&self,
|
||||
mode: AnsiMode,
|
||||
foreground_background: ForegroundBackground,
|
||||
) -> String {
|
||||
let c: u8 = match foreground_background {
|
||||
ForegroundBackground::Foreground => 38,
|
||||
ForegroundBackground::Background => 48,
|
||||
};
|
||||
match mode {
|
||||
AnsiMode::Rgb => {
|
||||
let [r, g, b]: [u8; 3] = (*self).into();
|
||||
format!("\x1b[{c};2;{r};{g};{b}m")
|
||||
},
|
||||
AnsiMode::Ansi256 => {
|
||||
let rgb: [u8; 3] = (*self).into();
|
||||
let indexed = rgb.to_ansi256();
|
||||
format!("\x1b[{c};5;{indexed}m")
|
||||
},
|
||||
AnsiMode::Ansi16 => {
|
||||
unimplemented!();
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl ToAnsiString for SrgbLuma<u8> {
|
||||
fn to_ansi_string(
|
||||
&self,
|
||||
mode: AnsiMode,
|
||||
foreground_background: ForegroundBackground,
|
||||
) -> String {
|
||||
let c: u8 = match foreground_background {
|
||||
ForegroundBackground::Foreground => 38,
|
||||
ForegroundBackground::Background => 48,
|
||||
};
|
||||
match mode {
|
||||
AnsiMode::Rgb => {
|
||||
let rgb_f32_color: LinSrgb = self.into_linear().into_color();
|
||||
let [r, g, b]: [u8; 3] = Srgb::<u8>::from_linear(rgb_f32_color).into();
|
||||
format!("\x1b[{c};2;{r};{g};{b}m")
|
||||
},
|
||||
AnsiMode::Ansi256 => {
|
||||
let indexed = ansi256_from_grey(self.luma);
|
||||
format!("\x1b[{c};5;{indexed}m")
|
||||
},
|
||||
AnsiMode::Ansi16 => {
|
||||
unimplemented!();
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Theme for Srgb<u8> {
|
||||
fn theme(&self) -> TerminalTheme {
|
||||
let mut rgb_f32_color: LinSrgb = self.into_linear();
|
||||
|
||||
{
|
||||
let okhsl_f32_color: &mut Okhsl = &mut rgb_f32_color.into_color_mut();
|
||||
|
||||
if okhsl_f32_color.lightness > 0.5 {
|
||||
TerminalTheme::Light
|
||||
} else {
|
||||
TerminalTheme::Dark
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl ContrastGrayscale for Srgb<u8> {
|
||||
fn contrast_grayscale(&self) -> SrgbLuma<u8> {
|
||||
let self_lab_f32: Lab = self.into_linear().into_color();
|
||||
|
||||
let mut best_contrast = None;
|
||||
for indexed in ANSI256_GRAYSCALE_COLORS {
|
||||
let rgb_u8_color: Srgb<u8> = rgb_from_ansi256(indexed).into();
|
||||
let lab_f32_color: Lab = rgb_u8_color.into_linear().into_color();
|
||||
let diff = lab_f32_color.improved_difference(self_lab_f32);
|
||||
best_contrast = match best_contrast {
|
||||
Some((_, best_diff)) if diff > best_diff => Some((lab_f32_color, diff)),
|
||||
None => Some((lab_f32_color, diff)),
|
||||
best => best,
|
||||
};
|
||||
}
|
||||
let (best_lab_f32, _) = best_contrast.expect("`best_contrast` should not be `None`");
|
||||
SrgbLuma::from_color(best_lab_f32).into_format()
|
||||
}
|
||||
}
|
||||
|
||||
/// Replaces extended minecraft color codes in message.
|
||||
///
|
||||
/// Returns message with escape codes.
|
||||
pub fn color<S>(msg: S, mode: AnsiMode) -> Result<String>
|
||||
where
|
||||
S: AsRef<str>,
|
||||
{
|
||||
let msg = msg.as_ref();
|
||||
|
||||
let msg = {
|
||||
let (ac, escape_codes) = MINECRAFT_COLORS_AC.get_or_init(|| {
|
||||
let (color_codes, escape_codes): (Vec<_>, Vec<_>) =
|
||||
MINECRAFT_COLORS.into_iter().unzip();
|
||||
let ac = AhoCorasick::new(color_codes).unwrap();
|
||||
(
|
||||
ac,
|
||||
escape_codes.try_into().expect(
|
||||
"`MINECRAFT_COLORS` should have the same number of elements as \
|
||||
`MINECRAFT_COLORS_AC.get_or_init(...).1`",
|
||||
),
|
||||
)
|
||||
});
|
||||
ac.replace_all(msg, &escape_codes[..])
|
||||
};
|
||||
|
||||
let ac = RGB_COLORS_AC.get_or_init(|| AhoCorasick::new(RGB_COLOR_PATTERNS).unwrap());
|
||||
let mut dst = String::new();
|
||||
let mut ret_err = None;
|
||||
ac.replace_all_with(&msg, &mut dst, |m, _, dst| {
|
||||
let start = m.end();
|
||||
let end = msg[start..]
|
||||
.find(')')
|
||||
.context("missing closing brace for color code");
|
||||
let end = match end {
|
||||
Ok(end) => end,
|
||||
Err(err) => {
|
||||
ret_err = Some(err);
|
||||
return false;
|
||||
},
|
||||
};
|
||||
let code = &msg[start..end];
|
||||
let foreground_background = if m.pattern().as_usize() == 0 {
|
||||
ForegroundBackground::Foreground
|
||||
} else {
|
||||
ForegroundBackground::Background
|
||||
};
|
||||
|
||||
let rgb: Srgb<u8> = if code.starts_with('#') {
|
||||
let rgb = code.parse().context("failed to parse hex color");
|
||||
match rgb {
|
||||
Ok(rgb) => rgb,
|
||||
Err(err) => {
|
||||
ret_err = Some(err);
|
||||
return false;
|
||||
},
|
||||
}
|
||||
} else {
|
||||
let rgb: Result<[&str; 3], _> = code
|
||||
.split(&[',', ';', ' '])
|
||||
.filter(|x| x.is_empty())
|
||||
.collect::<Vec<_>>()
|
||||
.try_into()
|
||||
.map_err(|_| anyhow!("wrong number of rgb components"));
|
||||
let rgb = match rgb {
|
||||
Ok(rgb) => rgb,
|
||||
Err(err) => {
|
||||
ret_err = Some(err);
|
||||
return false;
|
||||
},
|
||||
};
|
||||
let rgb = rgb
|
||||
.into_iter()
|
||||
.map(u8::from_str)
|
||||
.collect::<Result<Vec<_>, _>>()
|
||||
.context("failed to parse rgb components");
|
||||
let rgb: [u8; 3] = match rgb {
|
||||
Ok(rgb) => rgb.try_into().unwrap(),
|
||||
Err(err) => {
|
||||
ret_err = Some(err);
|
||||
return false;
|
||||
},
|
||||
};
|
||||
rgb.into()
|
||||
};
|
||||
|
||||
dst.push_str(&rgb.to_ansi_string(mode, foreground_background));
|
||||
|
||||
true
|
||||
});
|
||||
if let Some(err) = ret_err {
|
||||
return Err(err);
|
||||
}
|
||||
|
||||
Ok(dst)
|
||||
}
|
||||
|
||||
#[macro_export]
|
||||
macro_rules! printc {
|
||||
($($arg:tt)*) => {
|
||||
println!("{}", color(format!("{}&r", format!($($arg)*)), AnsiMode::Rgb).expect("failed to color message"));
|
||||
};
|
||||
}
|
||||
|
||||
/// Prints with color.
|
||||
pub fn printc<S>(msg: S, mode: AnsiMode) -> Result<()>
|
||||
where
|
||||
S: AsRef<str>,
|
||||
{
|
||||
println!("{msg}", msg = color(format!("{msg}&r", msg = msg.as_ref()), mode).context("failed to color message")?);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Clears screen using ANSI escape codes.
|
||||
pub fn clear_screen(title: Option<&str>, mode: AnsiMode, debug_mode: bool) -> Result<()> {
|
||||
if !debug_mode {
|
||||
write!(io::stdout(), "\x1b[2J\x1b[H")
|
||||
.and_then(|_| io::stdout().flush())
|
||||
.context("failed to write clear screen sequence to stdout")?;
|
||||
}
|
||||
|
||||
if let Some(title) = title {
|
||||
printc(format!("\n{title}\n"), mode).context("failed to print title")?;
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
#![allow(non_camel_case_types)]
|
||||
|
||||
include!(concat!(env!("OUT_DIR"), "/distros.rs"));
|
||||
@@ -0,0 +1,42 @@
|
||||
use crate::neofetch_util::get_distro_name;
|
||||
use crate::types::Backend;
|
||||
use crate::utils::get_cache_path;
|
||||
use anyhow::{Context, Result};
|
||||
use std::collections::HashMap;
|
||||
use std::fs::{File};
|
||||
use std::io::{Read, Write};
|
||||
|
||||
const FONT_LOGOS: &str = include_str!(concat!(env!("OUT_DIR"), "/hyfetch/data/font_logos.json"));
|
||||
|
||||
pub fn get_font_logo(backend: Backend) -> Result<String> {
|
||||
// Check if the cache file exists and return its contents if it does
|
||||
let cache_path = get_cache_path().context("Failed to get cache path")?.join("font_logo");
|
||||
if cache_path.exists() {
|
||||
let mut cached_logo = String::new();
|
||||
File::open(cache_path).context("Failed to open cache file")?
|
||||
.read_to_string(&mut cached_logo).context("Failed to read from cache file")?;
|
||||
return Ok(cached_logo);
|
||||
}
|
||||
|
||||
// Deserialize the JSON into a HashMap
|
||||
let font_logos: HashMap<String, String> = serde_json::from_str::<HashMap<String, String>>(FONT_LOGOS)
|
||||
.context("Failed to deserialize font logos JSON file")?
|
||||
.into_iter().map(|(k, v)| (k.to_lowercase(), v)).collect();
|
||||
|
||||
// Get the distro name
|
||||
let distro = get_distro_name(backend).context("Failed to get distro name")?.to_lowercase();
|
||||
|
||||
// Find the most likely matching distro from font_logos
|
||||
let matched_distro = font_logos.keys().find(|&k| distro.contains(k))
|
||||
.or_else(|| font_logos.keys().find(|k| k.contains(&distro)))
|
||||
.or_else(|| font_logos.keys().find(|k| k.split_whitespace().any(|part| distro.contains(part))))
|
||||
.ok_or_else(|| anyhow::anyhow!("No font logo found for distro: {distro}. The supported logos are in https://github.com/Lukas-W/font-logos"))?;
|
||||
|
||||
let logo = font_logos.get(matched_distro).unwrap();
|
||||
|
||||
// Write the logo to the cache file
|
||||
let mut cache_file = File::create(cache_path).context("Failed to create cache file")?;
|
||||
cache_file.write_all(logo.as_bytes()).context("Failed to write logo to cache file")?;
|
||||
|
||||
Ok(logo.clone())
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
pub mod ascii;
|
||||
pub mod cli_options;
|
||||
pub mod color_util;
|
||||
pub mod distros;
|
||||
pub mod font_logo;
|
||||
pub mod models;
|
||||
pub mod neofetch_util;
|
||||
pub mod presets;
|
||||
pub mod pride_month;
|
||||
pub mod types;
|
||||
pub mod utils;
|
||||
pub mod color_profile;
|
||||
@@ -0,0 +1,188 @@
|
||||
use std::collections::HashMap;
|
||||
|
||||
use anyhow::{Context as _, Result};
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
use crate::color_profile::ColorProfile;
|
||||
use crate::color_util::Lightness;
|
||||
use crate::neofetch_util::ColorAlignment;
|
||||
use crate::types::{AnsiMode, Backend, TerminalTheme};
|
||||
|
||||
#[derive(Clone, Debug, Deserialize, Serialize)]
|
||||
pub struct Config {
|
||||
pub preset: PresetValue,
|
||||
pub mode: AnsiMode,
|
||||
pub auto_detect_light_dark: Option<bool>,
|
||||
pub light_dark: Option<TerminalTheme>,
|
||||
pub lightness: Option<Lightness>,
|
||||
pub color_align: ColorAlignment,
|
||||
pub backend: Backend,
|
||||
#[serde(default)]
|
||||
#[serde(with = "self::args_serde")]
|
||||
pub args: Option<Vec<String>>,
|
||||
pub distro: Option<String>,
|
||||
pub pride_month_disable: bool,
|
||||
pub custom_ascii_path: Option<String>,
|
||||
pub custom_presets: Option<HashMap<String, Vec<String>>>,
|
||||
}
|
||||
|
||||
impl Config {
|
||||
pub fn default_lightness(theme: TerminalTheme) -> Lightness {
|
||||
match theme {
|
||||
TerminalTheme::Dark => {
|
||||
Lightness::new(0.65).expect("default lightness should not be invalid")
|
||||
},
|
||||
TerminalTheme::Light => {
|
||||
Lightness::new(0.4).expect("default lightness should not be invalid")
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
pub fn custom_preset_profiles(&self) -> Result<HashMap<String, ColorProfile>> {
|
||||
let mut profiles = HashMap::new();
|
||||
if let Some(custom_presets) = &self.custom_presets {
|
||||
for (preset_name, colors) in custom_presets {
|
||||
if preset_name == "random" {
|
||||
return Err(anyhow::anyhow!("custom preset key `random` is reserved"));
|
||||
}
|
||||
let color_profile = build_hex_color_profile(colors).with_context(|| {
|
||||
format!("failed to validate custom preset key `{preset_name}`")
|
||||
})?;
|
||||
profiles.insert(preset_name.clone(), color_profile);
|
||||
}
|
||||
}
|
||||
Ok(profiles)
|
||||
}
|
||||
}
|
||||
|
||||
pub fn build_hex_color_profile(hex_colors: &[String]) -> Result<ColorProfile> {
|
||||
if hex_colors.is_empty() {
|
||||
return Err(anyhow::anyhow!("hex color list cannot be empty"));
|
||||
}
|
||||
|
||||
for color in hex_colors {
|
||||
if !color.starts_with('#')
|
||||
|| (color.len() != 4 && color.len() != 7)
|
||||
|| !color[1..].chars().all(|c| c.is_ascii_hexdigit())
|
||||
{
|
||||
return Err(anyhow::anyhow!("invalid hex color: {color}"));
|
||||
}
|
||||
}
|
||||
|
||||
ColorProfile::from_hex_colors(hex_colors.to_vec())
|
||||
.context("failed to create color profile from hex")
|
||||
}
|
||||
|
||||
mod args_serde {
|
||||
use std::fmt;
|
||||
|
||||
use serde::de::{self, value, Deserialize, Deserializer, SeqAccess, Visitor};
|
||||
use serde::ser::Serializer;
|
||||
|
||||
type Value = Option<Vec<String>>;
|
||||
|
||||
pub(super) fn serialize<S>(value: &Value, serializer: S) -> Result<S::Ok, S::Error>
|
||||
where
|
||||
S: Serializer,
|
||||
{
|
||||
match value {
|
||||
Some(value) => serializer.serialize_some(&shell_words::join(value)),
|
||||
None => serializer.serialize_none(),
|
||||
}
|
||||
}
|
||||
|
||||
pub(super) fn deserialize<'de, D>(deserializer: D) -> Result<Value, D::Error>
|
||||
where
|
||||
D: Deserializer<'de>,
|
||||
{
|
||||
struct StringOrVec;
|
||||
|
||||
struct OptionVisitor;
|
||||
|
||||
impl<'de> Visitor<'de> for StringOrVec {
|
||||
type Value = Vec<String>;
|
||||
|
||||
fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
|
||||
formatter.write_str("string or list of strings")
|
||||
}
|
||||
|
||||
fn visit_str<E>(self, s: &str) -> Result<Self::Value, E>
|
||||
where
|
||||
E: de::Error,
|
||||
{
|
||||
shell_words::split(s).map_err(de::Error::custom)
|
||||
}
|
||||
|
||||
fn visit_seq<S>(self, seq: S) -> Result<Self::Value, S::Error>
|
||||
where
|
||||
S: SeqAccess<'de>,
|
||||
{
|
||||
Deserialize::deserialize(value::SeqAccessDeserializer::new(seq))
|
||||
}
|
||||
}
|
||||
|
||||
impl<'de> Visitor<'de> for OptionVisitor {
|
||||
type Value = Value;
|
||||
|
||||
fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
|
||||
formatter.write_str("option")
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn visit_unit<E>(self) -> Result<Self::Value, E>
|
||||
where
|
||||
E: de::Error,
|
||||
{
|
||||
Ok(None)
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn visit_none<E>(self) -> Result<Self::Value, E>
|
||||
where
|
||||
E: de::Error,
|
||||
{
|
||||
Ok(None)
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn visit_some<D>(self, deserializer: D) -> Result<Self::Value, D::Error>
|
||||
where
|
||||
D: Deserializer<'de>,
|
||||
{
|
||||
deserializer.deserialize_any(StringOrVec).map(Some)
|
||||
}
|
||||
}
|
||||
|
||||
deserializer.deserialize_option(OptionVisitor)
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize)]
|
||||
#[serde(untagged)]
|
||||
pub enum PresetValue {
|
||||
Single(String),
|
||||
Multiple(Vec<String>),
|
||||
}
|
||||
|
||||
impl From<String> for PresetValue {
|
||||
fn from(s: String) -> Self {
|
||||
PresetValue::Single(s)
|
||||
}
|
||||
}
|
||||
|
||||
impl PresetValue {
|
||||
pub fn get_random_if_multiple(&self) -> String {
|
||||
match self {
|
||||
PresetValue::Single(s) => s.clone(),
|
||||
PresetValue::Multiple(v) => {
|
||||
if v.is_empty() {
|
||||
"random".to_owned()
|
||||
} else {
|
||||
let mut rng = fastrand::Rng::new();
|
||||
let selected_index = rng.usize(0..v.len());
|
||||
v[selected_index].clone()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,735 @@
|
||||
use std::borrow::Cow;
|
||||
use std::ffi::OsStr;
|
||||
#[cfg(feature = "macchina")]
|
||||
use std::fs;
|
||||
use std::io::{Write as _};
|
||||
#[cfg(windows)]
|
||||
use std::io::{self};
|
||||
use std::path::PathBuf;
|
||||
use std::process::Command;
|
||||
use std::sync::OnceLock;
|
||||
use std::{env, fmt};
|
||||
|
||||
use aho_corasick::AhoCorasick;
|
||||
use anyhow::{Context as _, Result};
|
||||
use indexmap::IndexMap;
|
||||
use itertools::Itertools as _;
|
||||
#[cfg(windows)]
|
||||
use anyhow::anyhow;
|
||||
#[cfg(windows)]
|
||||
use crate::utils::find_file;
|
||||
#[cfg(windows)]
|
||||
use std::path::Path;
|
||||
#[cfg(windows)]
|
||||
use normpath::PathExt as _;
|
||||
#[cfg(windows)]
|
||||
use same_file::is_same_file;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use strum::AsRefStr;
|
||||
#[cfg(feature = "macchina")]
|
||||
use toml_edit::{value, DocumentMut, Item, Table};
|
||||
use tracing::debug;
|
||||
use unicode_segmentation::UnicodeSegmentation as _;
|
||||
use which::which;
|
||||
use crate::ascii::{RawAsciiArt, RecoloredAsciiArt};
|
||||
use crate::color_util::{printc, NeofetchAsciiIndexedColor, PresetIndexedColor};
|
||||
use crate::distros::Distro;
|
||||
use crate::types::{AnsiMode, Backend};
|
||||
use crate::utils::{find_in_path, get_cache_path, input, process_command_status};
|
||||
|
||||
pub const TEST_ASCII: &str = r####################"
|
||||
### |\___/| ###
|
||||
### ) ( ###
|
||||
## =\ /= ##
|
||||
#### )===( ####
|
||||
### / \ ###
|
||||
### | | ###
|
||||
## / {txt} \ ##
|
||||
## \ / ##
|
||||
_/\_\_ _/_/\_
|
||||
|##| ( ( |##|
|
||||
|##| ) ) |##|
|
||||
|##| (_( |##|
|
||||
"####################;
|
||||
|
||||
pub const NEOFETCH_COLOR_PATTERNS: [&str; 6] =
|
||||
["${c1}", "${c2}", "${c3}", "${c4}", "${c5}", "${c6}"];
|
||||
pub static NEOFETCH_COLORS_AC: OnceLock<AhoCorasick> = OnceLock::new();
|
||||
pub const NEOFETCH_SCRIPT: &str = include_str!(concat!(env!("OUT_DIR"), "/neofetch"));
|
||||
|
||||
#[derive(Clone, Eq, PartialEq, Debug, AsRefStr, Deserialize, Serialize)]
|
||||
#[serde(tag = "mode")]
|
||||
#[serde(rename_all = "lowercase")]
|
||||
#[strum(serialize_all = "lowercase")]
|
||||
pub enum ColorAlignment {
|
||||
Horizontal,
|
||||
Vertical,
|
||||
Custom {
|
||||
#[serde(rename = "custom_colors")]
|
||||
#[serde(deserialize_with = "crate::utils::index_map_serde::deserialize")]
|
||||
colors: IndexMap<NeofetchAsciiIndexedColor, PresetIndexedColor>,
|
||||
},
|
||||
}
|
||||
|
||||
/// Asks the user to provide an input among a list of options.
|
||||
pub fn literal_input<'a, S1, S2>(
|
||||
prompt: S1,
|
||||
options: &'a [S2],
|
||||
default: &str,
|
||||
show_options: bool,
|
||||
color_mode: AnsiMode,
|
||||
) -> Result<&'a str>
|
||||
where
|
||||
S1: AsRef<str>,
|
||||
S2: AsRef<str>,
|
||||
{
|
||||
let prompt = prompt.as_ref();
|
||||
|
||||
if show_options {
|
||||
let options_text = options
|
||||
.iter()
|
||||
.map(|o| {
|
||||
let o = o.as_ref();
|
||||
|
||||
if o == default {
|
||||
format!("&l&n{o}&L&N")
|
||||
} else {
|
||||
o.to_owned()
|
||||
}
|
||||
})
|
||||
.collect::<Vec<_>>()
|
||||
.join("|");
|
||||
printc(format!("{prompt} ({options_text})"), color_mode)
|
||||
.context("failed to print input prompt")?;
|
||||
} else {
|
||||
printc(format!("{prompt} (default: {default})"), color_mode)
|
||||
.context("failed to print input prompt")?;
|
||||
}
|
||||
|
||||
loop {
|
||||
let selection = input(Some("> ")).context("failed to read input")?;
|
||||
let selection = if selection.is_empty() {
|
||||
default.to_owned()
|
||||
} else {
|
||||
selection.to_lowercase()
|
||||
};
|
||||
|
||||
if let Some(selected) = find_selection(&selection, options) {
|
||||
println!();
|
||||
|
||||
return Ok(selected);
|
||||
} else {
|
||||
let options_text = options.iter().map(AsRef::as_ref).join("|");
|
||||
println!("Invalid selection! {selection} is not one of {options_text}");
|
||||
}
|
||||
}
|
||||
|
||||
fn find_selection<'a, S>(sel: &str, options: &'a [S]) -> Option<&'a str>
|
||||
where
|
||||
S: AsRef<str>,
|
||||
{
|
||||
if sel.is_empty() {
|
||||
return None;
|
||||
}
|
||||
|
||||
// Find exact match
|
||||
if let Some(selected) = options.iter().find(|&o| o.as_ref().to_lowercase() == sel) {
|
||||
return Some(selected.as_ref());
|
||||
}
|
||||
|
||||
// Find starting abbreviation
|
||||
if let Some(selected) = options
|
||||
.iter()
|
||||
.find(|&o| o.as_ref().to_lowercase().starts_with(sel))
|
||||
{
|
||||
return Some(selected.as_ref());
|
||||
}
|
||||
|
||||
None
|
||||
}
|
||||
}
|
||||
|
||||
/// Add the PyPI pacakge path to the PATH environment variable (for this local process only).
|
||||
/// This is done so that `which` can find the commands inside the PyPI package.
|
||||
pub fn add_pkg_path() -> Result<()> {
|
||||
// Get PATH
|
||||
let pv = &env::var_os("PATH").context("`PATH` env var is not set or invalid")?;
|
||||
let mut path = env::split_paths(pv).collect::<Vec<_>>();
|
||||
let exe = match env::current_exe() {
|
||||
Ok(exe) => exe,
|
||||
Err(e) => {
|
||||
debug!("Failed to get path of current running executable: {}", e);
|
||||
return Ok(());
|
||||
}
|
||||
};
|
||||
let base = exe.parent().unwrap();
|
||||
|
||||
// Add from bin: ../git, ../fastfetch, ../scripts
|
||||
let to_add = ["git", "fastfetch", "scripts", "fastfetch/usr/bin"];
|
||||
if let Some(parent) = base.parent() {
|
||||
path.extend(to_add.iter().map(|d| parent.join(d)));
|
||||
}
|
||||
|
||||
// Add from cwd: ./hyfetch/git, ./hyfetch/fastfetch, ./hyfetch/scripts
|
||||
path.extend(to_add.iter().map(|d| PathBuf::from("hyfetch").join(d)));
|
||||
|
||||
// Set PATH
|
||||
env::set_var("PATH", env::join_paths(path).context("failed to join paths")?);
|
||||
debug!("Added PyPI package path to PATH, PATH={}", env::var("PATH")?);
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Gets the absolute path of the [neofetch] command.
|
||||
///
|
||||
/// [neofetch]: https://github.com/hykilpikonna/hyfetch#running-updated-original-neofetch
|
||||
pub fn neofetch_path() -> Result<PathBuf> {
|
||||
if let Ok(p) = which("neowofetch") {
|
||||
return Ok(p);
|
||||
}
|
||||
|
||||
// Instead of doing that, let's write the neofetch script to a temp file
|
||||
let f: PathBuf = get_cache_path().context("Failed to get cache path")?.join("nf_script.sh");
|
||||
let mut file = fs::File::create(&f).context("Failed to create neofetch script file")?;
|
||||
file.write_all(NEOFETCH_SCRIPT.as_bytes())
|
||||
.context("Failed to write neofetch script to file")?;
|
||||
|
||||
Ok(f)
|
||||
}
|
||||
|
||||
/// Gets the absolute path of the [macchina] command.
|
||||
///
|
||||
/// [macchina]: https://github.com/Macchina-CLI/macchina
|
||||
#[cfg(feature = "macchina")]
|
||||
pub fn macchina_path() -> Result<Option<PathBuf>> {
|
||||
let macchina_path = {
|
||||
#[cfg(not(windows))]
|
||||
{
|
||||
find_in_path("macchina").context("failed to check existence of `macchina` in `PATH`")?
|
||||
}
|
||||
#[cfg(windows)]
|
||||
{
|
||||
find_in_path("macchina.exe")
|
||||
.context("failed to check existence of `macchina.exe` in `PATH`")?
|
||||
}
|
||||
};
|
||||
|
||||
// Fall back to `macchina.exe` in directory of current executable
|
||||
#[cfg(windows)]
|
||||
let macchina_path = macchina_path.map_or_else(
|
||||
|| {
|
||||
let current_exe_path: PathBuf = env::current_exe()
|
||||
.and_then(|p| p.normalize().map(|p| p.into()))
|
||||
.context("failed to get path of current running executable")?;
|
||||
let current_exe_dir_path = current_exe_path
|
||||
.parent()
|
||||
.expect("parent should not be `None`");
|
||||
let macchina_path = current_exe_dir_path.join("macchina.exe");
|
||||
find_file(&macchina_path)
|
||||
.with_context(|| format!("failed to check existence of file {macchina_path:?}"))
|
||||
},
|
||||
|path| Ok(Some(path)),
|
||||
)?;
|
||||
|
||||
Ok(macchina_path)
|
||||
}
|
||||
|
||||
/// Gets the distro ascii of the current distro. Or if distro is specified, get
|
||||
/// the specific distro's ascii art instead.
|
||||
#[tracing::instrument(level = "debug")]
|
||||
pub fn get_distro_ascii<S>(distro: Option<S>, backend: Backend) -> Result<RawAsciiArt>
|
||||
where
|
||||
S: AsRef<str> + fmt::Debug,
|
||||
{
|
||||
let distro_name: Cow<_> = if let Some(distro) = distro.as_ref() {
|
||||
distro.as_ref().into()
|
||||
} else {
|
||||
get_distro_name(backend)
|
||||
.context("failed to get distro name")?
|
||||
.into()
|
||||
};
|
||||
debug!(%distro_name, "distro name");
|
||||
|
||||
// Try new codegen-based detection method
|
||||
if let Some(distro) = Distro::detect(&distro_name) {
|
||||
let asc = distro.ascii_art().to_owned();
|
||||
let fg = ascii_foreground(&distro);
|
||||
|
||||
return Ok(RawAsciiArt { asc, fg });
|
||||
}
|
||||
|
||||
debug!(%distro_name, "could not find a match for distro; falling back to neofetch");
|
||||
|
||||
// Old detection method that calls neofetch
|
||||
let asc = run_neofetch_command_piped(&["print_ascii", "--ascii_distro", distro_name.as_ref()])
|
||||
.context("failed to get ascii art from neofetch")?;
|
||||
|
||||
// Unescape backslashes here because backslashes are escaped in neofetch for
|
||||
// printf
|
||||
let asc = asc.replace(r"\\", r"\");
|
||||
|
||||
Ok(RawAsciiArt {
|
||||
asc,
|
||||
fg: Vec::new(),
|
||||
})
|
||||
}
|
||||
|
||||
#[tracing::instrument(level = "debug", skip(asc), fields(asc.w = asc.w, asc.h = asc.h))]
|
||||
pub fn run(asc: RecoloredAsciiArt, backend: Backend, args: Option<&Vec<String>>) -> Result<()> {
|
||||
let asc = asc.lines.join("\n");
|
||||
|
||||
match backend {
|
||||
Backend::Neofetch => run_neofetch(asc, args).context("failed to run neofetch")?,
|
||||
Backend::Fastfetch => run_fastfetch(asc, args).context("failed to run fastfetch")?,
|
||||
#[cfg(feature = "macchina")]
|
||||
Backend::Macchina => run_macchina(asc, args).context("failed to run macchina")?,
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Gets distro ascii width and height, ignoring color code.
|
||||
pub fn ascii_size<S>(asc: S) -> Result<(u16, u16)>
|
||||
where
|
||||
S: AsRef<str>,
|
||||
{
|
||||
let asc = asc.as_ref();
|
||||
|
||||
if asc.is_empty() {
|
||||
return Ok((0, 0));
|
||||
}
|
||||
|
||||
let asc = {
|
||||
let ac =
|
||||
NEOFETCH_COLORS_AC.get_or_init(|| AhoCorasick::new(NEOFETCH_COLOR_PATTERNS).unwrap());
|
||||
const N: usize = NEOFETCH_COLOR_PATTERNS.len();
|
||||
const REPLACEMENTS: [&str; N] = [""; N];
|
||||
ac.replace_all(asc, &REPLACEMENTS)
|
||||
};
|
||||
|
||||
if asc.is_empty() {
|
||||
return Ok((0, 0));
|
||||
}
|
||||
|
||||
let width = asc.lines()
|
||||
.map(|line| line.graphemes(true).count()).max()
|
||||
.expect("line iterator should not be empty");
|
||||
let width: u16 = width.try_into().context("ascii art width should fit in u16")?;
|
||||
let height: u16 = asc.lines().count().try_into().context("ascii art height should fit in u16")?;
|
||||
Ok((width, height))
|
||||
}
|
||||
|
||||
/// Gets the absolute path of the bash command.
|
||||
#[cfg(windows)]
|
||||
fn bash_path() -> Result<PathBuf> {
|
||||
// 1. Try to find a good bash.exe in PATH
|
||||
let bash_in_path = find_in_path("bash.exe").unwrap_or(None);
|
||||
if let Some(pth) = &bash_in_path {
|
||||
// Check if it's not WSL bash
|
||||
// See https://github.com/hykilpikonna/hyfetch/issues/233
|
||||
let is_wsl = (|| {
|
||||
let windir = env::var_os("windir")?;
|
||||
let wsl_bash = Path::new(&windir).join(r"System32\bash.exe");
|
||||
Some(is_same_file(pth, &wsl_bash).unwrap_or(false))
|
||||
})()
|
||||
.unwrap_or(false);
|
||||
|
||||
if !is_wsl {
|
||||
// Check if it's not MSYS bash https://stackoverflow.com/a/58418686/1529493
|
||||
// We prefer the Git wrapper bash if possible, but we'll accept this if it's all we have.
|
||||
if !pth.ends_with(r"Git\usr\bin\bash.exe") {
|
||||
return Ok(pth.clone());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 2. Try to find git.exe in PATH and look for bash.exe relative to it
|
||||
if let Ok(Some(git_path)) = find_in_path("git.exe") {
|
||||
let mut current = git_path.clone();
|
||||
for _ in 0..3 {
|
||||
if let Some(parent) = current.parent() {
|
||||
let bin_bash = parent.join(r"bin\bash.exe");
|
||||
if bin_bash.is_file() {
|
||||
return Ok(bin_bash);
|
||||
}
|
||||
let usr_bin_bash = parent.join(r"usr\bin\bash.exe");
|
||||
if usr_bin_bash.is_file() {
|
||||
return Ok(usr_bin_bash);
|
||||
}
|
||||
current = parent.to_path_buf();
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 3. Fallback to whatever bash we found in PATH (even if it was the MSYS one)
|
||||
if let Some(pth) = bash_in_path {
|
||||
return Ok(pth);
|
||||
}
|
||||
|
||||
Err(anyhow!("bash.exe not found. Please ensure Git for Windows is installed and in your PATH."))
|
||||
}
|
||||
|
||||
/// Runs neofetch command, returning the piped stdout output.
|
||||
fn run_neofetch_command_piped<S>(args: &[S]) -> Result<String>
|
||||
where
|
||||
S: AsRef<OsStr> + fmt::Debug,
|
||||
{
|
||||
let mut command = make_neofetch_command(args)?;
|
||||
|
||||
let output = command
|
||||
.output()
|
||||
.context("failed to execute neofetch as child process")?;
|
||||
debug!(?output, "neofetch output");
|
||||
process_command_status(&output.status).context("neofetch command exited with error")?;
|
||||
|
||||
let out = String::from_utf8(output.stdout)
|
||||
.context("failed to process neofetch output as it contains invalid UTF-8")?
|
||||
.trim()
|
||||
.to_owned();
|
||||
Ok(out)
|
||||
}
|
||||
|
||||
fn make_neofetch_command<S>(args: &[S]) -> Result<Command>
|
||||
where
|
||||
S: AsRef<OsStr>,
|
||||
{
|
||||
// Find neofetch script
|
||||
let neofetch_path = neofetch_path().context("neofetch command not found")?;
|
||||
|
||||
debug!(?neofetch_path, "neofetch path");
|
||||
|
||||
#[cfg(not(windows))]
|
||||
{
|
||||
let mut command = Command::new("bash");
|
||||
command.arg(neofetch_path);
|
||||
command.args(args);
|
||||
Ok(command)
|
||||
}
|
||||
#[cfg(windows)]
|
||||
{
|
||||
let bash_path = bash_path().context("failed to get bash path")?;
|
||||
let mut command = Command::new(bash_path);
|
||||
command.arg(neofetch_path);
|
||||
command.args(args);
|
||||
Ok(command)
|
||||
}
|
||||
}
|
||||
|
||||
/// Runs fastfetch command, returning the piped stdout output.
|
||||
fn run_fastfetch_command_piped<S>(args: &[S]) -> Result<String>
|
||||
where
|
||||
S: AsRef<OsStr> + fmt::Debug,
|
||||
{
|
||||
let mut command = make_fastfetch_command(args)?;
|
||||
|
||||
let output = command
|
||||
.output()
|
||||
.context("failed to execute fastfetch as child process")?;
|
||||
debug!(?output, "fastfetch output");
|
||||
process_command_status(&output.status).context("fastfetch command exited with error")?;
|
||||
|
||||
let out = String::from_utf8(output.stdout)
|
||||
.context("failed to process fastfetch output as it contains invalid UTF-8")?
|
||||
.trim()
|
||||
.to_owned();
|
||||
Ok(out)
|
||||
}
|
||||
|
||||
pub fn fastfetch_path() -> Result<PathBuf> {
|
||||
which("fastfetch").context("fastfetch command not found")
|
||||
}
|
||||
|
||||
fn make_fastfetch_command<S>(args: &[S]) -> Result<Command>
|
||||
where
|
||||
S: AsRef<OsStr>,
|
||||
{
|
||||
// Find fastfetch executable
|
||||
let ff_path = fastfetch_path()?;
|
||||
debug!(?ff_path, "fastfetch path");
|
||||
|
||||
let mut command = Command::new(ff_path);
|
||||
command.env("FFTS_IGNORE_PARENT", "1");
|
||||
command.args(args);
|
||||
Ok(command)
|
||||
}
|
||||
|
||||
/// Runs macchina command, returning the piped stdout output.
|
||||
#[cfg(feature = "macchina")]
|
||||
fn run_macchina_command_piped<S>(args: &[S]) -> Result<String>
|
||||
where
|
||||
S: AsRef<OsStr> + fmt::Debug,
|
||||
{
|
||||
let mut command = make_macchina_command(args)?;
|
||||
|
||||
let output = command
|
||||
.output()
|
||||
.context("failed to execute macchina as child process")?;
|
||||
debug!(?output, "macchina output");
|
||||
process_command_status(&output.status).context("macchina command exited with error")?;
|
||||
|
||||
let out = String::from_utf8(output.stdout)
|
||||
.context("failed to process macchina output as it contains invalid UTF-8")?
|
||||
.trim()
|
||||
.to_owned();
|
||||
Ok(out)
|
||||
}
|
||||
|
||||
#[cfg(feature = "macchina")]
|
||||
fn make_macchina_command<S>(args: &[S]) -> Result<Command>
|
||||
where
|
||||
S: AsRef<OsStr>,
|
||||
{
|
||||
// Find macchina executable
|
||||
let macchina_path = macchina_path()
|
||||
.context("failed to get macchina path")?
|
||||
.context("macchina command not found")?;
|
||||
|
||||
debug!(?macchina_path, "macchina path");
|
||||
|
||||
let mut command = Command::new(macchina_path);
|
||||
command.args(args);
|
||||
Ok(command)
|
||||
}
|
||||
|
||||
#[tracing::instrument(level = "debug")]
|
||||
pub fn get_distro_name(backend: Backend) -> Result<String> {
|
||||
match backend {
|
||||
Backend::Neofetch => run_neofetch_command_piped(&["ascii_distro_name"])
|
||||
.context("failed to get distro name from neofetch"),
|
||||
Backend::Fastfetch => Ok(run_fastfetch_command_piped(&["--logo", "none", "-c", "none", "-s", "OS",])
|
||||
.context("failed to get distro name from fastfetch")?.replace("OS: ", "")),
|
||||
#[cfg(feature = "macchina")]
|
||||
Backend::Macchina => {
|
||||
// Write ascii art to temp file
|
||||
let asc_file_path = {
|
||||
let mut temp_file = tempfile::Builder::new()
|
||||
.suffix("ascii.txt")
|
||||
.tempfile()
|
||||
.context("failed to create temp file for ascii art")?;
|
||||
temp_file
|
||||
.write_all(b"\t\n\t\n")
|
||||
.context("failed to write ascii art to temp file")?;
|
||||
temp_file.into_temp_path()
|
||||
};
|
||||
|
||||
// Write macchina theme to temp file
|
||||
let theme_file_path = {
|
||||
let project_dirs = directories::ProjectDirs::from("", "", "macchina")
|
||||
.context("failed to get base dirs")?;
|
||||
let themes_path = project_dirs.config_dir().join("themes");
|
||||
fs::create_dir_all(&themes_path).with_context(|| {
|
||||
format!("failed to create macchina themes dir {themes_path:?}")
|
||||
})?;
|
||||
let mut temp_file = tempfile::Builder::new()
|
||||
.suffix("theme.toml")
|
||||
.tempfile_in(themes_path)
|
||||
.context("failed to create temp file for macchina theme")?;
|
||||
let theme_doc = {
|
||||
let mut doc = DocumentMut::new();
|
||||
doc["spacing"] = value(0);
|
||||
doc["padding"] = value(0);
|
||||
// See https://github.com/Macchina-CLI/macchina/issues/319
|
||||
doc["hide_ascii"] = value(false);
|
||||
doc["separator"] = value("");
|
||||
doc["custom_ascii"] = Item::Table(Table::from_iter([(
|
||||
"path",
|
||||
&*asc_file_path.to_string_lossy(),
|
||||
)]));
|
||||
doc["keys"] = Item::Table(Table::from_iter([("os", ""), ("distro", "")]));
|
||||
doc
|
||||
};
|
||||
debug!(%theme_doc, "macchina theme");
|
||||
temp_file
|
||||
.write_all(theme_doc.to_string().as_bytes())
|
||||
.context("failed to write macchina theme to temp file")?;
|
||||
temp_file.into_temp_path()
|
||||
};
|
||||
|
||||
let args: [&OsStr; 4] = [
|
||||
"--show".as_ref(),
|
||||
if cfg!(target_os = "linux") {
|
||||
"distribution"
|
||||
} else {
|
||||
"operating-system"
|
||||
}
|
||||
.as_ref(),
|
||||
"--theme".as_ref(),
|
||||
theme_file_path
|
||||
.file_stem()
|
||||
.expect("file name should not be `None`"),
|
||||
];
|
||||
run_macchina_command_piped(&args[..])
|
||||
.map(|s| {
|
||||
let s = anstream::adapter::strip_str(&s).to_string();
|
||||
let s = s.trim();
|
||||
s.splitn(2, '-')
|
||||
.last()
|
||||
.expect("splitn with 2 should always have at least 1 element")
|
||||
.trim()
|
||||
.to_owned()
|
||||
})
|
||||
.context("failed to get distro name from macchina")
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
/// Runs neofetch with custom ascii art.
|
||||
#[tracing::instrument(level = "debug", skip(asc))]
|
||||
fn run_neofetch(asc: String, args: Option<&Vec<String>>) -> Result<()> {
|
||||
// Escape backslashes here because backslashes are escaped in neofetch for
|
||||
// printf
|
||||
let asc = asc.replace('\\', r"\\");
|
||||
|
||||
// Write ascii art to temp file
|
||||
let asc_file_path = {
|
||||
let mut temp_file = tempfile::Builder::new()
|
||||
.suffix("ascii.txt")
|
||||
.tempfile()
|
||||
.context("failed to create temp file for ascii art")?;
|
||||
temp_file
|
||||
.write_all(asc.as_bytes())
|
||||
.context("failed to write ascii art to temp file")?;
|
||||
temp_file.into_temp_path()
|
||||
};
|
||||
|
||||
// Call neofetch
|
||||
let args = {
|
||||
let mut v: Vec<Cow<OsStr>> = vec![
|
||||
OsStr::new("--ascii").into(),
|
||||
OsStr::new("--source").into(),
|
||||
OsStr::new(&asc_file_path).into(),
|
||||
OsStr::new("--ascii_colors").into(),
|
||||
];
|
||||
if let Some(args) = args {
|
||||
v.extend(args.iter().map(|arg| OsStr::new(arg).into()));
|
||||
}
|
||||
v
|
||||
};
|
||||
let mut command = make_neofetch_command(&args[..])?;
|
||||
|
||||
debug!(?command, "neofetch command");
|
||||
|
||||
let status = command
|
||||
.status()
|
||||
.context("failed to execute neofetch command as child process")?;
|
||||
process_command_status(&status).context("neofetch command exited with error")?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Runs fastfetch with custom ascii art.
|
||||
#[tracing::instrument(level = "debug", skip(asc))]
|
||||
fn run_fastfetch(asc: String, args: Option<&Vec<String>>) -> Result<()> {
|
||||
// Write ascii art to temp file
|
||||
let asc_file_path = {
|
||||
let mut temp_file = tempfile::Builder::new()
|
||||
.suffix("ascii.txt")
|
||||
.tempfile()
|
||||
.context("failed to create temp file for ascii art")?;
|
||||
temp_file
|
||||
.write_all(asc.as_bytes())
|
||||
.context("failed to write ascii art to temp file")?;
|
||||
temp_file.into_temp_path()
|
||||
};
|
||||
|
||||
// Call fastfetch
|
||||
let args = {
|
||||
let mut v: Vec<Cow<OsStr>> = vec![
|
||||
OsStr::new("--file-raw").into(),
|
||||
OsStr::new(&asc_file_path).into(),
|
||||
];
|
||||
if let Some(args) = args {
|
||||
v.extend(args.iter().map(|arg| OsStr::new(arg).into()));
|
||||
}
|
||||
v
|
||||
};
|
||||
let mut command = make_fastfetch_command(&args[..])?;
|
||||
|
||||
debug!(?command, "fastfetch command");
|
||||
|
||||
let status = command
|
||||
.status()
|
||||
.context("failed to execute fastfetch command as child process")?;
|
||||
process_command_status(&status).context("fastfetch command exited with error")?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Runs macchina with custom ascii art.
|
||||
#[cfg(feature = "macchina")]
|
||||
#[tracing::instrument(level = "debug", skip(asc))]
|
||||
fn run_macchina(asc: String, args: Option<&Vec<String>>) -> Result<()> {
|
||||
// Write ascii art to temp file
|
||||
let asc_file_path = {
|
||||
let mut temp_file = tempfile::Builder::new()
|
||||
.suffix("ascii.txt")
|
||||
.tempfile()
|
||||
.context("failed to create temp file for ascii art")?;
|
||||
temp_file
|
||||
.write_all(asc.as_bytes())
|
||||
.context("failed to write ascii art to temp file")?;
|
||||
temp_file.into_temp_path()
|
||||
};
|
||||
|
||||
// Write macchina theme to temp file
|
||||
let theme_file_path = {
|
||||
let project_dirs = directories::ProjectDirs::from("", "", "macchina")
|
||||
.context("failed to get base dirs")?;
|
||||
let themes_path = project_dirs.config_dir().join("themes");
|
||||
fs::create_dir_all(&themes_path)
|
||||
.with_context(|| format!("failed to create macchina themes dir {themes_path:?}"))?;
|
||||
let mut temp_file = tempfile::Builder::new()
|
||||
.suffix("theme.toml")
|
||||
.tempfile_in(themes_path)
|
||||
.context("failed to create temp file for macchina theme")?;
|
||||
let theme_doc = {
|
||||
let mut doc = DocumentMut::new();
|
||||
doc["hide_ascii"] = value(false);
|
||||
doc["custom_ascii"] = Item::Table(Table::from_iter([(
|
||||
"path",
|
||||
&*asc_file_path.to_string_lossy(),
|
||||
)]));
|
||||
doc
|
||||
};
|
||||
debug!(%theme_doc, "macchina theme");
|
||||
temp_file
|
||||
.write_all(theme_doc.to_string().as_bytes())
|
||||
.context("failed to write macchina theme to temp file")?;
|
||||
temp_file.into_temp_path()
|
||||
};
|
||||
|
||||
let args = {
|
||||
let mut v: Vec<Cow<OsStr>> = vec![
|
||||
OsStr::new("--theme").into(),
|
||||
theme_file_path
|
||||
.file_stem()
|
||||
.expect("file name should not be `None`")
|
||||
.into(),
|
||||
];
|
||||
if let Some(args) = args {
|
||||
v.extend(args.iter().map(|arg| OsStr::new(arg).into()));
|
||||
}
|
||||
v
|
||||
};
|
||||
let mut command = make_macchina_command(&args[..])?;
|
||||
|
||||
debug!(?command, "macchina command");
|
||||
|
||||
let status = command
|
||||
.status()
|
||||
.context("failed to execute macchina command as child process")?;
|
||||
process_command_status(&status).context("macchina command exited with error")?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Gets the color indices that should be considered as foreground, for a
|
||||
/// particular distro's ascii art.
|
||||
fn ascii_foreground(distro: &Distro) -> Vec<NeofetchAsciiIndexedColor> {
|
||||
distro.foreground()
|
||||
.iter()
|
||||
.map(|&f| f.try_into().expect("neofetch color index should be valid"))
|
||||
.collect()
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
#![allow(non_camel_case_types)]
|
||||
|
||||
include!(concat!(env!("OUT_DIR"), "/presets.rs"));
|
||||
@@ -0,0 +1,269 @@
|
||||
use std::fmt::Write as _;
|
||||
use std::io::{self, Write as _};
|
||||
use std::num::{NonZeroU16, NonZeroUsize, Wrapping};
|
||||
use std::sync::atomic::{AtomicBool, Ordering};
|
||||
use std::sync::Arc;
|
||||
use std::time::Duration;
|
||||
use std::{cmp, thread};
|
||||
|
||||
use anyhow::{anyhow, Context as _, Result};
|
||||
use crossterm::execute;
|
||||
use crossterm::terminal::{
|
||||
BeginSynchronizedUpdate, EndSynchronizedUpdate, EnterAlternateScreen, LeaveAlternateScreen,
|
||||
};
|
||||
use palette::blend::Blend as _;
|
||||
use palette::{LinSrgba, Srgb, WithAlpha as _};
|
||||
use strum::VariantArray as _;
|
||||
use terminal_size::{terminal_size, Height, Width};
|
||||
|
||||
use crate::color_util::{color, ForegroundBackground, ToAnsiString as _};
|
||||
use crate::neofetch_util::ascii_size;
|
||||
use crate::presets::Preset;
|
||||
use crate::types::AnsiMode;
|
||||
|
||||
const TEXT_ASCII: &str = r"
|
||||
.======================================================.
|
||||
| . . .__ . . . , . | |
|
||||
| |__| _.._ ._ . [__)._.* _| _ |\/| _ ._ -+-|_ | |
|
||||
| | |(_][_)[_)\_| | [ |(_](/, | |(_)[ ) | [ ) * |
|
||||
| | | ._| |
|
||||
'======================================================'
|
||||
";
|
||||
|
||||
const TEXT_ASCII_SMALL: &str = r"
|
||||
.====================.
|
||||
| Happy Pride Month! |
|
||||
'===================='
|
||||
";
|
||||
|
||||
const NOTICE: &str = "Press enter to continue";
|
||||
|
||||
pub fn start_animation(color_mode: AnsiMode) -> Result<()> {
|
||||
let (w, h) = {
|
||||
let (Width(w), Height(h)) = terminal_size().context("failed to get terminal size")?;
|
||||
let w: NonZeroU16 = w.try_into().context("terminal width should not be 0")?;
|
||||
let h: NonZeroU16 = h.try_into().context("terminal height should not be 0")?;
|
||||
(w, h)
|
||||
};
|
||||
|
||||
let text = &TEXT_ASCII[1..TEXT_ASCII.len().checked_sub(1).unwrap()];
|
||||
let (text_w, text_h) = ascii_size(text)?;
|
||||
let (text, text_width, text_height) = {
|
||||
const TEXT_BORDER_WIDTH: u16 = 2;
|
||||
const NOTICE_BORDER_WIDTH: u16 = 1;
|
||||
const VERTICAL_MARGIN: u16 = 1;
|
||||
let notice_w: u16 = NOTICE.len().try_into()?;
|
||||
let notice_h: u16 = NOTICE.lines().count().try_into()?;
|
||||
let term_w_min = cmp::max(
|
||||
text_w + TEXT_BORDER_WIDTH * 2,
|
||||
notice_w + NOTICE_BORDER_WIDTH * 2,
|
||||
);
|
||||
let term_h_min = u16::from(text_h) + notice_h + VERTICAL_MARGIN * 2;
|
||||
if w.get() >= term_w_min && h.get() >= term_h_min {
|
||||
(text, text_w, text_h)
|
||||
} else {
|
||||
let text = &TEXT_ASCII_SMALL[1..TEXT_ASCII_SMALL.len().checked_sub(1).unwrap()];
|
||||
let (text_w, text_h) = ascii_size(text)?;
|
||||
let term_w_min = cmp::max(
|
||||
text_w + TEXT_BORDER_WIDTH * 2,
|
||||
notice_w + NOTICE_BORDER_WIDTH * 2,
|
||||
);
|
||||
let term_h_min = text_h + notice_h + VERTICAL_MARGIN * 2;
|
||||
if w.get() < term_w_min || h.get() < term_h_min {
|
||||
return Err(anyhow!("terminal size should be at least ({term_w_min} * {term_h_min})"));
|
||||
}
|
||||
(text, text_w, text_h)
|
||||
}
|
||||
};
|
||||
let text_lines: Vec<&str> = text.lines().collect();
|
||||
|
||||
const BLOCKS: u8 = 9;
|
||||
let block_width: NonZeroU16 = w
|
||||
.get()
|
||||
.div_euclid(u16::from(BLOCKS))
|
||||
.try_into()
|
||||
.with_context(|| format!("terminal width should be at least {BLOCKS}"))?;
|
||||
|
||||
let text_start_y = h
|
||||
.get()
|
||||
.div_euclid(2)
|
||||
.checked_sub((text_height / 2).into())
|
||||
.unwrap();
|
||||
let text_end_y = text_start_y.checked_add(text_height.into()).unwrap();
|
||||
let text_start_x = w
|
||||
.get()
|
||||
.div_euclid(2)
|
||||
.checked_sub((text_width / 2).into())
|
||||
.unwrap();
|
||||
let text_end_x = text_start_x.checked_add(text_width.into()).unwrap();
|
||||
|
||||
let notice_start_x = w
|
||||
.get()
|
||||
.checked_sub(
|
||||
u8::try_from(NOTICE.len())
|
||||
.expect("`NOTICE` length should fit in `u8`")
|
||||
.into(),
|
||||
)
|
||||
.unwrap()
|
||||
.checked_sub(1)
|
||||
.unwrap();
|
||||
let notice_end_x = w.get().checked_sub(1).unwrap();
|
||||
let notice_y = h.get().checked_sub(1).unwrap();
|
||||
|
||||
// Add every preset to colors
|
||||
let colors: Vec<Srgb<u8>> = Preset::VARIANTS
|
||||
.iter()
|
||||
.flat_map(|p| p.color_profile().colors)
|
||||
.collect();
|
||||
|
||||
let fg: Srgb<u8> = "#FFE09B"
|
||||
.parse()
|
||||
.expect("foreground color hex should be valid");
|
||||
let black = LinSrgba::new(0.0, 0.0, 0.0, 0.5);
|
||||
|
||||
let draw_frame = |frame: usize| -> Result<()> {
|
||||
execute!(io::stdout(), BeginSynchronizedUpdate)
|
||||
.context("failed to begin synchronized update")?;
|
||||
|
||||
let mut buf = String::new();
|
||||
|
||||
// Loop over the height
|
||||
for y in 0..h.get() {
|
||||
// Print the starting color
|
||||
write!(
|
||||
buf,
|
||||
"{bg}{fg}",
|
||||
bg = colors[frame
|
||||
.wrapping_add(y.into())
|
||||
.div_euclid(block_width.get().into())
|
||||
.rem_euclid(colors.len())]
|
||||
.to_ansi_string(color_mode, ForegroundBackground::Background),
|
||||
fg = fg.to_ansi_string(color_mode, ForegroundBackground::Foreground)
|
||||
)?;
|
||||
|
||||
// Loop over the width
|
||||
for x in 0..w.get() {
|
||||
let idx = frame
|
||||
.wrapping_add(x.into())
|
||||
.wrapping_add(y.into())
|
||||
.wrapping_add_signed((2.0 * (y as f64 + 0.5 * frame as f64).sin()) as isize);
|
||||
let y_text = text_start_y <= y && y < text_end_y;
|
||||
|
||||
let border = 1u16 + if y == text_start_y || y == (text_end_y - 1) { 0 } else { 1 };
|
||||
let text_bounds_x1 = text_start_x - border;
|
||||
let text_bounds_x2 = text_end_x - border;
|
||||
let notice_bounds_x1 = notice_start_x - 1;
|
||||
let notice_bounds_x2 = notice_end_x - 1;
|
||||
|
||||
// If it's a switching point
|
||||
if idx.rem_euclid(NonZeroUsize::from(block_width).get()) == 0
|
||||
|| x == text_bounds_x1
|
||||
|| x == text_bounds_x2
|
||||
|| x == notice_bounds_x1
|
||||
|| x == notice_bounds_x2
|
||||
{
|
||||
// Print the color at the current frame
|
||||
let ci = idx
|
||||
.div_euclid(NonZeroUsize::from(block_width).get())
|
||||
.rem_euclid(colors.len());
|
||||
let c = colors[ci];
|
||||
if (y_text && (text_bounds_x1 <= x) && (x < text_bounds_x2))
|
||||
|| (y == notice_y && notice_bounds_x1 <= x && x < notice_bounds_x2)
|
||||
{
|
||||
let c: LinSrgba = c.with_alpha(1.0).into_linear();
|
||||
let c = Srgb::<u8>::from_linear(c.overlay(black).without_alpha());
|
||||
write!(buf, "{bg}", bg = c.to_ansi_string(color_mode, ForegroundBackground::Background))?;
|
||||
} else {
|
||||
write!(buf, "{bg}", bg = c.to_ansi_string(color_mode, ForegroundBackground::Background))?;
|
||||
}
|
||||
}
|
||||
|
||||
// If text should be printed, print text
|
||||
if y_text && text_start_x <= x && x < text_end_x {
|
||||
write!(
|
||||
buf,
|
||||
"{text_char}",
|
||||
text_char = text_lines[usize::from(y.checked_sub(text_start_y).unwrap())]
|
||||
.chars()
|
||||
.nth(usize::from(x.checked_sub(text_start_x).unwrap()))
|
||||
.unwrap(),
|
||||
)?;
|
||||
} else if y == notice_y && notice_start_x <= x && x < notice_end_x {
|
||||
write!(
|
||||
buf,
|
||||
"{notice_char}",
|
||||
notice_char = NOTICE
|
||||
.chars()
|
||||
.nth(usize::from(x.checked_sub(notice_start_x).unwrap()))
|
||||
.unwrap(),
|
||||
)?;
|
||||
} else {
|
||||
write!(buf, " ")?;
|
||||
}
|
||||
}
|
||||
|
||||
// New line if it isn't the last line
|
||||
if y != h.get().checked_sub(1).unwrap() {
|
||||
writeln!(buf, "{reset}", reset = color("&r", color_mode)?)?;
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
let mut stdout = io::stdout().lock();
|
||||
write!(stdout, "{buf}")
|
||||
.and_then(|_| stdout.flush())
|
||||
.context("failed to write to stdout")?;
|
||||
}
|
||||
|
||||
execute!(io::stdout(), EndSynchronizedUpdate)
|
||||
.context("failed to end synchronized update")?;
|
||||
|
||||
Ok(())
|
||||
};
|
||||
|
||||
let key_pressed = Arc::new(AtomicBool::new(false));
|
||||
|
||||
// TODO: use non-blocking I/O; no need for another thread
|
||||
let _handle = thread::spawn({
|
||||
let key_pressed = Arc::clone(&key_pressed);
|
||||
move || {
|
||||
loop {
|
||||
match io::stdin().lines().next() {
|
||||
Some(Ok(_)) => {
|
||||
key_pressed.store(true, Ordering::Release);
|
||||
break;
|
||||
},
|
||||
Some(Err(err)) => {
|
||||
eprintln!("failed to read line from stdin: {err}");
|
||||
},
|
||||
None => {
|
||||
// EOF
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
let mut frame: Wrapping<usize> = Wrapping(0);
|
||||
|
||||
const SPEED: u8 = 2;
|
||||
let frame_delay = Duration::from_secs_f32(2.0 / 25.0);
|
||||
|
||||
execute!(io::stdout(), EnterAlternateScreen).context("failed to enter alternate screen")?;
|
||||
|
||||
loop {
|
||||
// Move cursor to the top left corner
|
||||
print!("\x1B[H");
|
||||
draw_frame(frame.0)?;
|
||||
frame += usize::from(SPEED);
|
||||
thread::sleep(frame_delay);
|
||||
|
||||
if key_pressed.load(Ordering::Acquire) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
execute!(io::stdout(), LeaveAlternateScreen).context("failed to leave alternate screen")?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
use serde::{Deserialize, Serialize};
|
||||
use strum::{AsRefStr, EnumString, VariantNames};
|
||||
|
||||
#[derive(Copy, Clone, Eq, PartialEq, Hash, Debug, AsRefStr, Deserialize, EnumString, Serialize)]
|
||||
#[serde(rename_all = "lowercase")]
|
||||
#[strum(serialize_all = "lowercase")]
|
||||
pub enum AnsiMode {
|
||||
#[serde(rename = "ansi")]
|
||||
#[serde(skip)]
|
||||
#[strum(serialize = "ansi")]
|
||||
#[strum(disabled)]
|
||||
Ansi16,
|
||||
#[serde(rename = "8bit")]
|
||||
#[strum(serialize = "8bit")]
|
||||
Ansi256,
|
||||
Rgb,
|
||||
}
|
||||
|
||||
#[derive(
|
||||
Copy,
|
||||
Clone,
|
||||
Eq,
|
||||
PartialEq,
|
||||
Hash,
|
||||
Debug,
|
||||
AsRefStr,
|
||||
Deserialize,
|
||||
EnumString,
|
||||
Serialize,
|
||||
VariantNames,
|
||||
)]
|
||||
#[serde(rename_all = "lowercase")]
|
||||
#[strum(serialize_all = "lowercase")]
|
||||
pub enum TerminalTheme {
|
||||
Light,
|
||||
Dark,
|
||||
}
|
||||
|
||||
impl Default for TerminalTheme {
|
||||
fn default() -> Self {
|
||||
Self::Dark
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(
|
||||
Copy,
|
||||
Clone,
|
||||
Eq,
|
||||
PartialEq,
|
||||
Hash,
|
||||
Debug,
|
||||
AsRefStr,
|
||||
Deserialize,
|
||||
EnumString,
|
||||
Serialize,
|
||||
VariantNames,
|
||||
)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[strum(serialize_all = "kebab-case")]
|
||||
pub enum Backend {
|
||||
Neofetch,
|
||||
Fastfetch,
|
||||
#[cfg(feature = "macchina")]
|
||||
Macchina,
|
||||
}
|
||||
|
||||
// See https://github.com/Peternator7/strum/issues/244
|
||||
impl VariantNames for AnsiMode {
|
||||
const VARIANTS: &'static [&'static str] = &["8bit", "rgb"];
|
||||
}
|
||||
@@ -0,0 +1,226 @@
|
||||
use std::io::Write as _;
|
||||
#[cfg(unix)]
|
||||
use std::os::unix::process::ExitStatusExt as _;
|
||||
use std::path::{Path, PathBuf};
|
||||
use std::process::ExitStatus;
|
||||
use std::{env, fs, io};
|
||||
|
||||
use anyhow::{anyhow, Context as _, Result};
|
||||
use directories::ProjectDirs;
|
||||
#[cfg(windows)]
|
||||
use normpath::PathExt as _;
|
||||
use tracing::debug;
|
||||
|
||||
pub fn get_cache_path() -> Result<PathBuf> {
|
||||
let path = ProjectDirs::from("", "", "hyfetch")
|
||||
.context("failed to get base dirs")?
|
||||
.cache_dir()
|
||||
.to_owned();
|
||||
|
||||
// Make sure the cache directory exists
|
||||
if !path.exists() {
|
||||
fs::create_dir_all(&path).with_context(|| format!("failed to create cache dir {path:?}"))?;
|
||||
}
|
||||
|
||||
Ok(path)
|
||||
}
|
||||
|
||||
/// Reads a string from standard input. The trailing newline is stripped.
|
||||
///
|
||||
/// The prompt string, if given, is printed to standard output without a
|
||||
/// trailing newline before reading input.
|
||||
pub fn input<S>(prompt: Option<S>) -> Result<String>
|
||||
where
|
||||
S: AsRef<str>,
|
||||
{
|
||||
if let Some(prompt) = prompt {
|
||||
write!(io::stdout(), "{prompt}", prompt = prompt.as_ref())
|
||||
.and_then(|_| io::stdout().flush())
|
||||
.context("failed to write prompt to stdout")?;
|
||||
}
|
||||
|
||||
io::stdin()
|
||||
.lines()
|
||||
.next()
|
||||
.unwrap_or_else(|| Ok(String::new()))
|
||||
.context("failed to read line from stdin")
|
||||
}
|
||||
|
||||
/// Finds a command in `PATH`.
|
||||
///
|
||||
/// Returns the canonicalized / normalized absolute path of the command.
|
||||
pub fn find_in_path<P>(program: P) -> Result<Option<PathBuf>>
|
||||
where
|
||||
P: AsRef<Path>,
|
||||
{
|
||||
let program = program.as_ref();
|
||||
|
||||
// Only accept program name, i.e. a relative path with one component
|
||||
if program.parent() != Some(Path::new("")) {
|
||||
return Err(anyhow!("invalid command name {program:?}"));
|
||||
};
|
||||
|
||||
let path_env = env::var_os("PATH").context("`PATH` env var is not set or invalid")?;
|
||||
|
||||
for search_path in env::split_paths(&path_env) {
|
||||
let path = search_path.join(program);
|
||||
let path = find_file(&path)
|
||||
.with_context(|| format!("failed to check existence of file {path:?}"))?;
|
||||
if path.is_some() {
|
||||
return Ok(path);
|
||||
}
|
||||
}
|
||||
|
||||
Ok(None)
|
||||
}
|
||||
|
||||
/// Finds a file.
|
||||
///
|
||||
/// Returns the canonicalized / normalized absolute path of the file.
|
||||
pub fn find_file<P>(path: P) -> Result<Option<PathBuf>>
|
||||
where
|
||||
P: AsRef<Path>,
|
||||
{
|
||||
let path = path.as_ref();
|
||||
|
||||
let metadata = match fs::metadata(path) {
|
||||
Ok(metadata) => metadata,
|
||||
Err(_) => return Ok(None)
|
||||
};
|
||||
|
||||
if !metadata.is_file() {
|
||||
debug!(?path, "path exists but is not a file");
|
||||
return Ok(None);
|
||||
}
|
||||
|
||||
#[cfg(not(windows))]
|
||||
{
|
||||
path.canonicalize()
|
||||
.with_context(|| format!("failed to canonicalize path {path:?}"))
|
||||
.map(Some)
|
||||
}
|
||||
#[cfg(windows)]
|
||||
{
|
||||
path.normalize()
|
||||
.with_context(|| format!("failed to normalize path {path:?}"))
|
||||
.map(|p| Some(p.into()))
|
||||
}
|
||||
}
|
||||
|
||||
pub fn process_command_status(status: &ExitStatus) -> Result<()> {
|
||||
if status.success() {
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
let err = if let Some(code) = status.code() {
|
||||
anyhow!("child process exited with status code: {code}")
|
||||
} else {
|
||||
#[cfg(unix)]
|
||||
{
|
||||
anyhow!(
|
||||
"child process terminated by signal: {signal}",
|
||||
signal = status
|
||||
.signal()
|
||||
.expect("either one of status code or signal should be set")
|
||||
)
|
||||
}
|
||||
#[cfg(not(unix))]
|
||||
{
|
||||
unimplemented!("status code not expected to be `None` on non-Unix platforms")
|
||||
}
|
||||
};
|
||||
Err(err)
|
||||
}
|
||||
|
||||
pub(crate) mod index_map_serde {
|
||||
use std::fmt;
|
||||
use std::hash::Hash;
|
||||
use std::marker::PhantomData;
|
||||
use std::str::FromStr;
|
||||
|
||||
use indexmap::IndexMap;
|
||||
use serde::de::{self, DeserializeSeed, MapAccess, Visitor};
|
||||
use serde::{Deserialize, Deserializer};
|
||||
|
||||
pub(crate) fn deserialize<'de, D, K, V>(deserializer: D) -> Result<IndexMap<K, V>, D::Error>
|
||||
where
|
||||
D: Deserializer<'de>,
|
||||
K: Eq + Hash + FromStr,
|
||||
K::Err: fmt::Display,
|
||||
V: Deserialize<'de>,
|
||||
{
|
||||
struct KeySeed<K> {
|
||||
k: PhantomData<K>,
|
||||
}
|
||||
|
||||
impl<'de, K> DeserializeSeed<'de> for KeySeed<K>
|
||||
where
|
||||
K: FromStr,
|
||||
K::Err: fmt::Display,
|
||||
{
|
||||
type Value = K;
|
||||
|
||||
fn deserialize<D>(self, deserializer: D) -> Result<Self::Value, D::Error>
|
||||
where
|
||||
D: Deserializer<'de>,
|
||||
{
|
||||
deserializer.deserialize_str(self)
|
||||
}
|
||||
}
|
||||
|
||||
impl<K> Visitor<'_> for KeySeed<K>
|
||||
where
|
||||
K: FromStr,
|
||||
K::Err: fmt::Display,
|
||||
{
|
||||
type Value = K;
|
||||
|
||||
fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
|
||||
formatter.write_str("a string")
|
||||
}
|
||||
|
||||
fn visit_str<E>(self, s: &str) -> Result<Self::Value, E>
|
||||
where
|
||||
E: de::Error,
|
||||
{
|
||||
K::from_str(s).map_err(de::Error::custom)
|
||||
}
|
||||
}
|
||||
|
||||
struct MapVisitor<K, V> {
|
||||
k: PhantomData<K>,
|
||||
v: PhantomData<V>,
|
||||
}
|
||||
|
||||
impl<'de, K, V> Visitor<'de> for MapVisitor<K, V>
|
||||
where
|
||||
K: Eq + Hash + FromStr,
|
||||
K::Err: fmt::Display,
|
||||
V: Deserialize<'de>,
|
||||
{
|
||||
type Value = IndexMap<K, V>;
|
||||
|
||||
fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
|
||||
formatter.write_str("a map")
|
||||
}
|
||||
|
||||
fn visit_map<A>(self, mut input: A) -> Result<Self::Value, A::Error>
|
||||
where
|
||||
A: MapAccess<'de>,
|
||||
{
|
||||
let mut map = IndexMap::new();
|
||||
while let Some((k, v)) =
|
||||
input.next_entry_seed(KeySeed { k: PhantomData }, PhantomData)?
|
||||
{
|
||||
map.insert(k, v);
|
||||
}
|
||||
Ok(map)
|
||||
}
|
||||
}
|
||||
|
||||
deserializer.deserialize_map(MapVisitor {
|
||||
k: PhantomData,
|
||||
v: PhantomData,
|
||||
})
|
||||
}
|
||||
}
|
||||
+43
-35
@@ -1,73 +1,81 @@
|
||||
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
|
||||
.TH VERSION "1" "December 2023" "Version is 1.4.11" "User Commands"
|
||||
.TH VERSION: "1" "April 2026" "Version: 2.1.0-rc1" "User Commands"
|
||||
.SH NAME
|
||||
Version \- manual page for Version is 1.4.11
|
||||
Version: \- manual page for Version: 2.1.0-rc1
|
||||
.SH SYNOPSIS
|
||||
.B hyfetch
|
||||
[\fI\,-c\/\fR] [\fI\,-C=CONFIG_FILE\/\fR] [\fI\,-p=PRESET\/\fR] [\fI\,-m=MODE\/\fR] [\fI\,-b=BACKEND\/\fR] [\fI\,--args=ARGS\/\fR] [\fI\,--c-scale=\/\fR
|
||||
.SH DESCRIPTION
|
||||
usage: hyfetch [\-h] [\-c] [\-C CONFIG_FILE]
|
||||
.IP
|
||||
[\-p {rainbow,transgender,nonbinary,agender,queer,genderfluid,bisexual,pansexual,polysexual,omnisexual,omniromantic,gay\-men,lesbian,abrosexual,asexual,aromantic,aroace1,aroace2,aroace3,autosexual,intergender,greygender,akiosexual,bigender,demigender,demiboy,demigirl,transmasculine,transfeminine,genderfaun,demifaun,genderfae,demifae,neutrois,biromantic1,biromantic2,autoromantic,boyflux2,finsexual,unlabeled1,unlabeled2,pangender,gendernonconforming1,gendernonconforming2,femboy,tomboy,gynesexual,androsexual,gendervoid,voidgirl,voidboy,nonhuman\-unity,beiyang,burger}]
|
||||
[\-m {8bit,rgb}]
|
||||
[\-b {qwqfetch,neofetch,fastfetch,fastfetch\-old}] [\-\-args ARGS]
|
||||
[\-\-c\-scale SCALE] [\-\-c\-set\-l LIGHT] [\-\-c\-overlay] [\-V] [\-\-june]
|
||||
[\-\-debug] [\-\-distro DISTRO] [\-\-ascii\-file ASCII_FILE]
|
||||
SCALE] [\-\-c\-set\-l=LIGHTNESS] [\-\-june] [\-\-debug] ([\-\-distro=DISTRO] | [\-\-test\-distro=DISTRO]) [
|
||||
\fB\-\-ascii\-file\fR=\fI\,ASCII_FILE]\/\fR [\-\-print\-font\-logo] [\-\-auto\-detect\-light\-dark=BOOL]
|
||||
.PP
|
||||
[1m[38;5;14mhyfetch[39m[22m \- neofetch with flags <3
|
||||
.SS "options:"
|
||||
.TP
|
||||
\fB\-h\fR, \fB\-\-help\fR
|
||||
show this help message and exit
|
||||
.SS "Available options:"
|
||||
.TP
|
||||
\fB\-c\fR, \fB\-\-config\fR
|
||||
Configure hyfetch
|
||||
.TP
|
||||
\fB\-C\fR CONFIG_FILE, \fB\-\-config\-file\fR CONFIG_FILE
|
||||
\fB\-C\fR, \fB\-\-config\-file\fR=\fI\,CONFIG_FILE\/\fR
|
||||
Use another config file
|
||||
[default: "/home/azalea/.config/hyfetch.json"]
|
||||
.TP
|
||||
\fB\-p\fR {rainbow,transgender,nonbinary,agender,queer,genderfluid,bisexual,pansexual,polysexual,omnisexual,omniromantic,gay\-men,lesbian,abrosexual,asexual,aromantic,aroace1,aroace2,aroace3,autosexual,intergender,greygender,akiosexual,bigender,demigender,demiboy,demigirl,transmasculine,transfeminine,genderfaun,demifaun,genderfae,demifae,neutrois,biromantic1,biromantic2,autoromantic,boyflux2,finsexual,unlabeled1,unlabeled2,pangender,gendernonconforming1,gendernonconforming2,femboy,tomboy,gynesexual,androsexual,gendervoid,voidgirl,voidboy,nonhuman\-unity,beiyang,burger}, \fB\-\-preset\fR {rainbow,transgender,nonbinary,agender,queer,genderfluid,bisexual,pansexual,polysexual,omnisexual,omniromantic,gay\-men,lesbian,abrosexual,asexual,aromantic,aroace1,aroace2,aroace3,autosexual,intergender,greygender,akiosexual,bigender,demigender,demiboy,demigirl,transmasculine,transfeminine,genderfaun,demifaun,genderfae,demifae,neutrois,biromantic1,biromantic2,autoromantic,boyflux2,finsexual,unlabeled1,unlabeled2,pangender,gendernonconforming1,gendernonconforming2,femboy,tomboy,gynesexual,androsexual,gendervoid,voidgirl,voidboy,nonhuman\-unity,beiyang,burger}
|
||||
Use preset
|
||||
\fB\-p\fR, \fB\-\-preset\fR=\fI\,PRESET\/\fR
|
||||
Use preset or comma\-separated color list or comma\-separated hex colors
|
||||
(e.g., "#ff0000,#00ff00,#0000ff"). Comma\-separated preset names will
|
||||
pick one randomly.
|
||||
PRESET={rainbow,transgender,nonbinary,xenogender,agender,queer,genderfluid,bisexual,pansexual,polysexual,omnisexual,omniromantic,gay\-men,lesbian,abrosexual,asexual,aromantic,fictosexual,aroace1,aroace2,aroace3,autosexual,intergender,greygender,akiosexual,bigender,demigender,demiboy,demigirl,transmasculine,transfeminine,genderfaun,demifaun,genderfae,demifae,neutrois,biromantic1,biromantic2,autoromantic,boyflux2,girlflux,genderflux,nullflux,hypergender,hyperboy,hypergirl,hyperandrogyne,hyperneutrois,finsexual,unlabeled1,unlabeled2,pangender,pangender.contrast,gendernonconforming1,gendernonconforming2,femboy,tomboy,gynesexual,androsexual,gendervoid,voidgirl,voidboy,nonhuman\-unity,plural,fraysexual,bear,butch,femme,leather,otter,twink,adipophilia,kenochoric,veldian,solian,lunian,polyam,sapphic,androgyne,interprogress,progress,intersex,old\-polyam,equal\-rights,drag,pronounfluid,pronounflux,exipronoun,neopronoun,neofluid,genderqueer,cisgender,baker,caninekin,libragender,librafeminine,libramasculine,libraandrogyne,libranonbinary,fluidflux1,fluidflux2,transbian,autism,cenelian,transneutral,beiyang,burger,throatlozenges,band,petergriffin,rubber,haruhi,random}
|
||||
.TP
|
||||
\fB\-m\fR {8bit,rgb}, \fB\-\-mode\fR {8bit,rgb}
|
||||
Color mode
|
||||
\fB\-m\fR, \fB\-\-mode\fR=\fI\,MODE\/\fR
|
||||
Color mode MODE={8bit,rgb}
|
||||
.TP
|
||||
\fB\-b\fR {qwqfetch,neofetch,fastfetch,fastfetch\-old}, \fB\-\-backend\fR {qwqfetch,neofetch,fastfetch,fastfetch\-old}
|
||||
Choose a *fetch backend
|
||||
\fB\-b\fR, \fB\-\-backend\fR=\fI\,BACKEND\/\fR
|
||||
Choose a *fetch backend BACKEND={neofetch,fastfetch,macchina}
|
||||
.TP
|
||||
\fB\-\-args\fR ARGS
|
||||
\fB\-\-args\fR=\fI\,ARGS\/\fR
|
||||
Additional arguments pass\-through to backend
|
||||
.TP
|
||||
\fB\-\-c\-scale\fR SCALE
|
||||
\fB\-\-c\-scale\fR=\fI\,SCALE\/\fR
|
||||
Lighten colors by a multiplier
|
||||
.TP
|
||||
\fB\-\-c\-set\-l\fR LIGHT
|
||||
\fB\-\-c\-set\-l\fR=\fI\,LIGHTNESS\/\fR
|
||||
Set lightness value of the colors
|
||||
.TP
|
||||
\fB\-\-c\-overlay\fR
|
||||
Use experimental overlay color adjusting instead of
|
||||
HSL lightness
|
||||
.TP
|
||||
\fB\-V\fR, \fB\-\-version\fR
|
||||
Check version
|
||||
.TP
|
||||
\fB\-\-june\fR
|
||||
Show pride month easter egg
|
||||
.TP
|
||||
\fB\-\-debug\fR
|
||||
Debug mode
|
||||
.TP
|
||||
\fB\-\-distro\fR DISTRO, \fB\-\-test\-distro\fR DISTRO
|
||||
\fB\-\-distro\fR=\fI\,DISTRO\/\fR
|
||||
Test for a specific distro
|
||||
.TP
|
||||
\fB\-\-ascii\-file\fR ASCII_FILE
|
||||
\fB\-\-test\-distro\fR=\fI\,DISTRO\/\fR
|
||||
Test for a specific distro
|
||||
.TP
|
||||
\fB\-\-ascii\-file\fR=\fI\,ASCII_FILE\/\fR
|
||||
Use a specific file for the ascii art
|
||||
.TP
|
||||
\fB\-\-print\-font\-logo\fR
|
||||
Print the Font Logo / Nerd Font icon of your distro and exit
|
||||
.TP
|
||||
\fB\-\-auto\-detect\-light\-dark\fR=\fI\,BOOL\/\fR
|
||||
Enables hyfetch to detect light/dark terminal background in
|
||||
runtime
|
||||
.TP
|
||||
\fB\-h\fR, \fB\-\-help\fR
|
||||
Prints help information
|
||||
.TP
|
||||
\fB\-V\fR, \fB\-\-version\fR
|
||||
Prints version information
|
||||
.SH "SEE ALSO"
|
||||
The full documentation for
|
||||
.B Version
|
||||
.B Version:
|
||||
is maintained as a Texinfo manual. If the
|
||||
.B info
|
||||
and
|
||||
.B Version
|
||||
.B Version:
|
||||
programs are properly installed at your site, the command
|
||||
.IP
|
||||
.B info Version
|
||||
.B info Version:
|
||||
.PP
|
||||
should give you access to the complete manual.
|
||||
|
||||
+45
-33
@@ -1,7 +1,7 @@
|
||||
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
|
||||
.TH NEOFETCH "1" "December 2023" "Neofetch 7.3.11" "User Commands"
|
||||
.TH NEOFETCH "1" "April 2026" "Neofetch 8.1.0" "User Commands"
|
||||
.SH NAME
|
||||
Neofetch \- manual page for Neofetch 7.3.11
|
||||
Neofetch \- manual page for Neofetch 8.1.0
|
||||
.SH SYNOPSIS
|
||||
.B neofetch
|
||||
\fI\,func_name --option "value" --option "value"\/\fR
|
||||
@@ -49,6 +49,9 @@ Hide/Show Package Manager names. (on, tiny, off)
|
||||
\fB\-\-package_separate\fR on/off
|
||||
Whether to separate system/user modes for supported package managers
|
||||
.TP
|
||||
\fB\-\-package_minimal\fR
|
||||
Reduce output of packages list by not showing programming language package managers or Steam games
|
||||
.TP
|
||||
\fB\-\-os_arch\fR on/off
|
||||
Hide/Show OS architecture.
|
||||
.TP
|
||||
@@ -317,52 +320,56 @@ NOTE: Ad??lie, aerOS, Afterglow, AIX, AlmaLinux, Alpine, Alter,
|
||||
Amazon, AmogOS, Anarchy, Android, Antergos, antiX, AOSC OS, Aperio
|
||||
GNU/Linux, Aperture, Apricity, Arch, ArchBox, Archcraft,
|
||||
archcraft_ascii, archcraft_minimal, ARCHlabs, ArchMerge, ArchStrike,
|
||||
ArcoLinux, ArseLinux, Artix, Arya, Asahi, AsteroidOS, astOS, Astra
|
||||
Linux, Athena, azos, Bedrock, BigLinux, Bitrig, BlackArch,
|
||||
blackPanther, BLAG, BlankOn, BlueLight, Bodhi, bonsai, BSD,
|
||||
BunsenLabs, CachyOS, Calculate, CalinixOS, Carbs, CBL\-Mariner,
|
||||
CelOS, Center, CentOS, Chakra, ChaletOS, Chapeau, ChonkySealOS,
|
||||
Chrom, Cleanjaro, Clear Linux OS, ClearOS, Clover, Cobalt, Condres,
|
||||
ArcoLinux, Arkane, ArseLinux, Artix, Arya, Asahi, AsteroidOS, astOS,
|
||||
Astra Linux, Athena, azos, Bazzite, Bedrock, BigLinux,
|
||||
BigLinux_large, Bitrig, BlackArch, BlackMesa, blackPanther, BLAG,
|
||||
BlankOn, BlueLight, Bodhi, bonsai, BSD, BunsenLabs, CachyOS,
|
||||
Calculate, CalinixOS, Carbs, CBL\-Mariner, CelOS, Center, CentOS,
|
||||
Chakra, ChaletOS, Chapeau, Chimera, ChonkySealOS, Chrom, Cleanjaro,
|
||||
Clear Linux OS, ClearOS, Clover, Cobalt, Codex Linux, Condres,
|
||||
Container Linux by CoreOS, CRUX, Crystal Linux, Cucumber,
|
||||
CutefishOS, CuteOS, CyberOS, dahlia, DarkOs, Darwin, Debian, Deepin,
|
||||
DesaOS, Devuan, DietPi, digital UNIX, DracOS, DragonFly, Drauger,
|
||||
Droidian, Elementary, Elive, EncryptOS, EndeavourOS, Endless, Enso,
|
||||
EuroLinux, EvolutionOS, Exherbo, Exodia Predator OS, Fedora,
|
||||
EuroLinux, EvolutionOS, eweOS, Exherbo, Exodia Predator OS, Fedora,
|
||||
Fedora Kinoite, Fedora Sericea, Fedora Silverblue, Fedora_unicode,
|
||||
FemboyOS, Feren, Finnix, Floflis, FreeBSD, FreeMiNT, Frugalware,
|
||||
Funtoo, GalliumOS, Garuda, Gentoo, GhostBSD, glaucus, gNewSense,
|
||||
GNOME, GNU, GoboLinux, GrapheneOS, Grombyang, Guix, Haiku, HamoniKR,
|
||||
HarDClanZ, Hash, Huayra, Hybrid, HydroOS, Hyperbola, iglunix,
|
||||
instantOS, Interix, IRIX, Itc, januslinux, Kaisen, Kali, KaOS, KDE,
|
||||
Kibojoe, Kogaion, Korora, KrassOS, KSLinux, Kubuntu, LainOS,
|
||||
LangitKetujuh, LaxerOS, LEDE, LibreELEC, Linspire, Linux, Linux
|
||||
Lite, Linux Mint, Linux Mint Old, Live Raizo, LMDE, Lubuntu, Lunar,
|
||||
mac, Mageia, MagpieOS, MainsailOS, Mandriva, Manjaro, MassOS,
|
||||
MatuusOS, Maui, Meowix, Mer, Minix, MIRACLE LINUX, MX, Namib, NekOS,
|
||||
Neptune, NetBSD, Netrunner, Nitrux, NixOS, Nobara, NomadBSD,
|
||||
Funtoo, Furreto, GalliumOS, Garuda, Gentoo, GhostBSD, glaucus,
|
||||
Gloire, gNewSense, GNOME, GNU, GoboLinux, GrapheneOS, Grombyang,
|
||||
Guix, Haiku, HamoniKR, HarDClanZ, Hash, Huayra, Hybrid, HydroOS,
|
||||
Hyperbola, iglunix, instantOS, Interix, IRIX, Itc, januslinux,
|
||||
Kaisen, Kali, KaOS, KDE, Kibojoe, Kogaion, Korora, KrassOS, KSLinux,
|
||||
Kubuntu, LainOS, LangitKetujuh, LaxerOS, LEDE, LibreELEC, Linspire,
|
||||
Linux, Linux Lite, Linux Mint, Linux Mint Old, LinuxFromScratch,
|
||||
Live Raizo, LMDE, Lubuntu, Lunar, mac, MacaroniOS, Mageia, Magix,
|
||||
MagpieOS, MainsailOS, Mandriva, Manjaro, MassOS, MatuusOS, Maui,
|
||||
Mauna, Meowix, Mer, Minix, MIRACLE LINUX, MX, Namib, NekOS, Neptune,
|
||||
NetBSD, Netrunner, Nitrux, NixOS, nixos_colorful, Nobara, NomadBSD,
|
||||
Nurunner, NuTyX, Obarun, OBRevenge, OmniOS, Open Source Media
|
||||
Center, OpenBSD, openEuler, OpenIndiana, openKylin, openmamba,
|
||||
OpenMandriva, OpenStage, openSUSE, openSUSE Leap, openSUSE
|
||||
Tumbleweed, OPNsense, Oracle, orchid, OS Elbrus, PacBSD, Panwah,
|
||||
Parabola, parch, Pardus, Parrot, Parsix, PCBSD, PCLinuxOS, pearOS,
|
||||
Pengwin, Pentoo, Peppermint, Peropesis, phyOS, PikaOS, Pisi, PNM
|
||||
Linux, Pop!_OS, Porteus, PostMarketOS, Profelis SambaBOX, Proxmox,
|
||||
PuffOS, Puppy, PureOS, Q4OS, Qubes, Qubyt, Quibian, Radix, Raspbian,
|
||||
ravynOS, Reborn OS, Red Star, Redcore, Redhat, Refracted Devuan,
|
||||
Regata, Regolith, RhaymOS, rocky, Rosa, Sabayon, sabotage, Sailfish,
|
||||
SalentOS, Salient OS, Salix, Sasanqua, Scientific, semc, Septor,
|
||||
Serene, SharkLinux, ShastraOS, Siduction, SkiffOS, Slackel,
|
||||
Slackware, SliTaz, SmartOS, Soda, Solus, Source Mage, Sparky, Star,
|
||||
SteamOS, Stock Linux, Sulin, SunOS, SwagArch, t2, Tails, TeArch,
|
||||
Tumbleweed, openSUSE Tumbleweed\-Slowroll, OPNsense, Oracle, orchid,
|
||||
OS Elbrus, PacBSD, Panwah, Parabola, parch, Pardus, Parrot, Parsix,
|
||||
PCBSD, PCLinuxOS, pearOS, Pengwin, Pentoo, Peppermint, Peropesis,
|
||||
phyOS, PikaOS, Pisi, PNM Linux, Pop!_OS, Porteus, PostMarketOS,
|
||||
Profelis SambaBOX, Proxmox, PuffOS, Puppy, PureOS, Q4OS, QNX, Qubes,
|
||||
Qubyt, Quibian, Radix, Raspbian, ravynOS, Reborn OS, Red Star,
|
||||
Redcore, Redhat, Refracted Devuan, Regata, Regolith, RhaymOS, Rhino
|
||||
Linux, rocky, Rosa, Sabayon, sabotage, Sailfish, SalentOS, Salient
|
||||
OS, Salix, Sasanqua, Scientific, secureblue, semc, Septor, Serene,
|
||||
SharkLinux, ShastraOS, Siduction, SkiffOS, Slackel, Slackware,
|
||||
SliTaz, SmartOS, Soda, Solus, Source Mage, Sparky, Star, SteamOS,
|
||||
Stock Linux, Sulin, SunOS, SwagArch, t2, Tails, Tatra, TeArch,
|
||||
TorizonCore, Trisquel, Twister, Ubuntu, Ubuntu Budgie, Ubuntu
|
||||
Cinnamon, Ubuntu Kylin, Ubuntu MATE, Ubuntu Studio, Ubuntu Sway,
|
||||
Ubuntu Touch, Ubuntu\-GNOME, ubuntu_old02, Ultramarine Linux,
|
||||
unicodearch, Univalent, Univention, Uos, UrukOS, uwuntu, Vanilla,
|
||||
Venom, VNux, Void, VzLinux, wii\-linux\-ngx, Windows, Windows 10,
|
||||
Windows 11, Windows95, Wrt, Xenia, Xenia2, XFerience, Xray_OS,
|
||||
Xubuntu, yiffOS, Zorin have ascii logos.
|
||||
Xubuntu, yiffOS, Zirconium, Zorin have ascii logos.
|
||||
.TP
|
||||
NOTE: arch, dragonfly, Fedora, LangitKetujuh, nixos, redhat, Ubuntu
|
||||
have 'old' logo variants, use {distro}_old to use them.
|
||||
NOTE: arch, dragonfly, Fedora, LangitKetujuh, nixos, redhat, Ubuntu,
|
||||
void have 'old' logo variants, use {distro}_old to use them.
|
||||
.TP
|
||||
NOTE: alpine, android, arch, arcolinux, artix, CalinixOS, centos,
|
||||
cleanjaro, crux, debian, dragonfly, elementary, endeavouros, fedora,
|
||||
@@ -371,6 +378,11 @@ linuxlite, linuxmint, mac, mageia, MainsailOS, manjaro, mx, netbsd,
|
||||
nixos, openbsd, opensuse, orchid, parabola, popos, postmarketos,
|
||||
pureos, Raspbian, rocky, slackware, sunos, ubuntu, venom, void have
|
||||
\&'small' logo variants, use {distro}_small to use them.
|
||||
.IP
|
||||
NOTE: Fedora has immutable spins with unique logos (except Onyx).
|
||||
.TP
|
||||
NOTE: Change this to Silverblue, Kinoite, Sericea, or CoreOS to use
|
||||
the spins.
|
||||
.TP
|
||||
\fB\-\-ascii_bold\fR on/off
|
||||
Whether or not to bold the ascii logo.
|
||||
|
||||
Executable
+3
@@ -0,0 +1,3 @@
|
||||
#!/usr/bin/env bash
|
||||
cd /ws/Others/hyfetch
|
||||
python3 -m hyfetch --print-font-logo
|
||||
+10
-7
@@ -1,9 +1,12 @@
|
||||
from . import main
|
||||
from .color_util import printc
|
||||
from __future__ import annotations
|
||||
|
||||
import os
|
||||
|
||||
from .py import run_py
|
||||
from .rs import run_rust
|
||||
|
||||
if __name__ == '__main__':
|
||||
try:
|
||||
main.run()
|
||||
except KeyboardInterrupt:
|
||||
printc('&cThe program is interrupted by ^C, exiting...')
|
||||
exit(0)
|
||||
if os.environ.get('HYFETCH_PY', False):
|
||||
run_py()
|
||||
else:
|
||||
run_rust()
|
||||
|
||||
@@ -1 +1,3 @@
|
||||
VERSION = '1.4.11'
|
||||
from __future__ import annotations
|
||||
|
||||
VERSION = '2.1.0-rc1'
|
||||
|
||||
+11
-3
@@ -135,9 +135,17 @@ class RGB:
|
||||
:return: RGB object
|
||||
"""
|
||||
hex = hex.lstrip("#")
|
||||
r = int(hex[0:2], 16)
|
||||
g = int(hex[2:4], 16)
|
||||
b = int(hex[4:6], 16)
|
||||
|
||||
if len(hex) == 6:
|
||||
r = int(hex[0:2], 16)
|
||||
g = int(hex[2:4], 16)
|
||||
b = int(hex[4:6], 16)
|
||||
elif len(hex) == 3:
|
||||
r = int(hex[0] * 2, 16)
|
||||
g = int(hex[1] * 2, 16)
|
||||
b = int(hex[2] * 2, 16)
|
||||
else:
|
||||
raise ValueError(f"Error: invalid hex length")
|
||||
return cls(r, g, b)
|
||||
|
||||
def to_ansi_rgb(self, foreground: bool = True) -> str:
|
||||
|
||||
@@ -9,6 +9,7 @@ from .types import LightDark
|
||||
from .__version__ import VERSION
|
||||
|
||||
CONFIG_PATH = Path.home() / '.config/hyfetch.json'
|
||||
SRC = Path(__file__).parent
|
||||
|
||||
|
||||
TEST_ASCII = r"""
|
||||
@@ -31,6 +32,7 @@ IS_WINDOWS = platform.system() == 'Windows'
|
||||
|
||||
CACHE_PATH = Path(os.getenv("LOCALAPPDATA") or os.getenv("XDG_CACHE_HOME") or Path.home() / '.cache') / 'hyfetch'
|
||||
|
||||
|
||||
@dataclass
|
||||
class GlobalConfig:
|
||||
# Global color mode default to 8-bit for compatibility
|
||||
@@ -49,6 +51,4 @@ class GlobalConfig:
|
||||
return 0.65 if term.lower() == 'dark' else 0.4
|
||||
|
||||
|
||||
GLOBAL_CFG = GlobalConfig(color_mode='8bit', override_distro=None, debug=False, is_light=False, use_overlay=False)
|
||||
|
||||
MINGIT_URL = 'https://github.com/git-for-windows/git/releases/download/v2.37.2.windows.2/MinGit-2.37.2.2-busybox-32-bit.zip'
|
||||
GLOBAL_CFG = GlobalConfig(color_mode='8bit', override_distro=None, debug=False, is_light=False, use_overlay=True)
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
{"match": "\"Ad\u00e9lie\"* | \"Adelie\"*", "color": "4 7 6"}
|
||||
${c1} ${c3} ,-^-___
|
||||
${c3} /\\\\\\///
|
||||
${c2}refined.${c1} /\\\\\\\\//
|
||||
${c2}reliable.${c1} /\\\\\\///
|
||||
${c2}ready.${c1} /\\\\/////\\
|
||||
__///\\\\\\\\/////\\
|
||||
${c3} _//////\\\\\\\\\\\\\\////
|
||||
${c1} ///////${c3}\\\\\\\\\\\\\\\\\\\\//
|
||||
//////${c1}\\\\\\\\\\/
|
||||
/////\\\\\\\\\\/
|
||||
/////${c3}\\\\\\\\/
|
||||
/\\\\///\\\\\\/
|
||||
/\\\\\\/${c1}\\\/
|
||||
/\\\\\\\\//
|
||||
//////
|
||||
/// ${c3}\\\\\\\\\\
|
||||
@@ -0,0 +1,15 @@
|
||||
{"match": "\"Aeon\"*", "color": "38;5;36 38;5;36"}
|
||||
⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷
|
||||
⣿⡇ ⢸⣿
|
||||
⣿⡇ ⢀⣀ ⣀⡀ ⢸⣿
|
||||
⣿⣇ ⠸⣿⣄ ⣠⣿⠇ ⣸⣿
|
||||
⢹⣿⡄ ⠙⠻⠿⠿⠟⠋ ⢠⣿⡏
|
||||
⠹⣿⣦⡀ ⢀⣴⣿⠏
|
||||
⠈⠛⢿⣶⣤⣄ ⣠⣤⣶⡿⠛⠁
|
||||
${c2} ⣠⣴⡿⠿⠛ ⠛⠿⢿⣦⣄
|
||||
⣠⣾⠟⠉ ⠉⠻⣷⣄
|
||||
⢰⣿⠏ ⢀⣤⣶⣶⣤⡀ ⠹⣿⡆
|
||||
⣿⡟ ⢰⣿⠏⠁⠈⠹⣿⡆ ⢿⣿
|
||||
⣿⡇ ⠈⠋ ⠙⠁ ⢸⣿
|
||||
⣿⡇ ⢸⣿
|
||||
⣿⣷⣶⣶⣶⣶⣶⣶⣶⣶⣶⣶⣶⣶⣶⣶⣾⣿
|
||||
@@ -1,8 +1,4 @@
|
||||
# This file is automatically generated. Please do not modify.
|
||||
|
||||
from . import AsciiArt
|
||||
|
||||
aeros = AsciiArt(match=r'''"aerOS"*''', color='fg 0 0 0', ascii=r"""
|
||||
{"match": "\"aerOS\"*", "color": "fg 0 0 0"}
|
||||
${c1}
|
||||
ooo OOO OOO ooo
|
||||
oOO OOo
|
||||
@@ -24,6 +20,4 @@ ${c1}
|
||||
oO OOo
|
||||
oOO OOo
|
||||
oOO OOo
|
||||
ooo OOO OOO ooo
|
||||
""")
|
||||
|
||||
ooo OOO OOO ooo
|
||||
@@ -0,0 +1,17 @@
|
||||
{"match": "\"AerynOS\"*", "color": "7 5"}
|
||||
;llll.
|
||||
0MMMMMM:
|
||||
NMMMMMMMMd
|
||||
.@ .cccccccccoWMMMMMMMMMM0
|
||||
@@ .MMMMMMMMMMMMMMMMMMMMMMMN
|
||||
OMMMMMMMMMMMMMMMW.
|
||||
.@ .MMMMMMMMMMMMMMMMMMM.
|
||||
.@ dMMMMMMMMMMMMMMMMMMl OMMMMMMMMk
|
||||
.OWMMMMM; dMMMMMMMMMk
|
||||
.MMMMMMMMMk
|
||||
@@ ooooooooooooooooooo .MMMMMMMMMN
|
||||
.@ oooooMMMMMMMMMMMMP NMMMMMMMMW.
|
||||
KMMMMMMMMMM. 0MMMMMMMMM:
|
||||
NMMMMMMMMM. dMMMMMMMMMd
|
||||
.WMMMMMMMW. XMMMMMMMMO
|
||||
.MMMMMMMk. xMMMMMMMMX
|
||||
@@ -1,8 +1,4 @@
|
||||
# This file is automatically generated. Please do not modify.
|
||||
|
||||
from . import AsciiArt
|
||||
|
||||
afterglow = AsciiArt(match=r'''"Afterglow"*''', color='5 1 3 4', ascii=r"""
|
||||
{"match": "\"Afterglow\"*", "color": "5 1 3 4"}
|
||||
${c2} .
|
||||
${c1}. ${c2}.{!
|
||||
${c1}.L! ${c2}J@||*
|
||||
@@ -17,6 +13,4 @@ ${c2} .
|
||||
${c3}.@FJJJF`${c4},@LFFFF`
|
||||
${c3}_@FFFFF ${c4}VLLLP`
|
||||
${c3}J@@LL@" ${c4}`"
|
||||
${c3}V@@"
|
||||
""")
|
||||
|
||||
${c3}V@@"
|
||||
@@ -1,8 +1,4 @@
|
||||
# This file is automatically generated. Please do not modify.
|
||||
|
||||
from . import AsciiArt
|
||||
|
||||
aix = AsciiArt(match=r'''"AIX"*''', color='2 7', ascii=r"""
|
||||
{"match": "\"AIX\"*", "color": "2 7"}
|
||||
${c1} `:+ssssossossss+-`
|
||||
.oys///oyhddddhyo///sy+.
|
||||
/yo:+hNNNNNNNNNNNNNNNNh+:oy/
|
||||
@@ -22,6 +18,4 @@ h//NNNNh ossss` +h md- .hm/ `sNNNNN:+y
|
||||
:h+-yNNNNNNNNNNNNNNNNNNNNNNs-oh-
|
||||
:ys:/yNNNNNNNNNNNNNNNmy/:sy:
|
||||
.+ys///osyhhhhys+///sy+.
|
||||
-/osssossossso/-
|
||||
""")
|
||||
|
||||
-/osssossossso/-
|
||||
@@ -1,8 +1,4 @@
|
||||
# This file is automatically generated. Please do not modify.
|
||||
|
||||
from . import AsciiArt
|
||||
|
||||
almalinux = AsciiArt(match=r'''"AlmaLinux"*''', color='1 3 4 2 6', ascii=r"""
|
||||
{"match": "\"AlmaLinux\"*", "color": "1 3 4 2 6"}
|
||||
${c1} 'c:.
|
||||
${c1} lkkkx, .. ${c2}.. ,cc,
|
||||
${c1} okkkk:ckkx' ${c2}.lxkkx.okkkkd
|
||||
@@ -22,6 +18,4 @@ ${c3} ..... ${c5}.;dk:. ${c5}lkk. ${c4}:;,
|
||||
,c,,;;;:xkkd.
|
||||
;kkkkl...
|
||||
;kkkkl
|
||||
,od;
|
||||
""")
|
||||
|
||||
,od;
|
||||
@@ -1,8 +1,4 @@
|
||||
# This file is automatically generated. Please do not modify.
|
||||
|
||||
from . import AsciiArt
|
||||
|
||||
alpine = AsciiArt(match=r'''"Alpine"*''', color='4 5 7 6', ascii=r"""
|
||||
{"match": "\"Alpine\"*", "color": "4 5 7 6"}
|
||||
${c1} .hddddddddddddddddddddddh.
|
||||
:dddddddddddddddddddddddddd:
|
||||
/dddddddddddddddddddddddddddd/
|
||||
@@ -22,6 +18,4 @@ hdddyo+ohddyosdddddddddho+oydddy++ohdddh
|
||||
+dddddddddddddddddddddddddddddd+
|
||||
/dddddddddddddddddddddddddddd/
|
||||
:dddddddddddddddddddddddddd:
|
||||
.hddddddddddddddddddddddh.
|
||||
""")
|
||||
|
||||
.hddddddddddddddddddddddh.
|
||||
@@ -0,0 +1,18 @@
|
||||
{"match": "\"Alpine2\"*", "color": "4 7"}
|
||||
.:::::::::::::::::::::.
|
||||
.:::::::::::::::::::::::.
|
||||
.:::::::::::::::::::::::::.
|
||||
.:::::::::::::::::::::::::::.
|
||||
.:::::::::${c2},db,${c1}::::::::::::::::.
|
||||
.::::::::${c2},d%%%%b,${c1}::${c2},db,${c1}:::::::::.
|
||||
.:::::::${c2},%%%%P'%%%b,d%%%b,${c1}::::::::.
|
||||
.::::::${c2},%%%%P,${c1}:::${c2}`%%%b'^q%%b,${c1}:::::::.
|
||||
'::::${c2},%%%%P,d|${c1}:::::${c2}`%%%b:'^%%b,${c1}:::::'
|
||||
'::${c2}`%%%'${c1}:${c2}'q$|${c1}:::::::${c2}'q%%b'`q%%b'${c1}::'
|
||||
':::::::::::::::::::::::::::::::'
|
||||
':::::::::::::::::::::::::::::'
|
||||
':::::::::::::::::::::::::::'
|
||||
':::::::::::::::::::::::::'
|
||||
':::::::::::::::::::::::'
|
||||
':::::::::::::::::::::'
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
{"match": "\"alpine2_small\"*", "color": "4 7"}
|
||||
${c1} /\ /\
|
||||
/${c2}/ ${c1}\ \
|
||||
/${c2}// ${c1}\ \
|
||||
/${c2}// ${c1}\ \
|
||||
${c2}// ${c1}\ \
|
||||
\
|
||||
@@ -0,0 +1,8 @@
|
||||
{"match": "\"alpine3_small\"*", "color": "7"}
|
||||
,db,
|
||||
,d%%%%b, ,db,
|
||||
,%%%%P'%%%b,d%%%b,
|
||||
,%%%%P, `%%%b'^q%%b,
|
||||
,%%%%P,d| `%%%b '^%%b,
|
||||
`%%%' 'q$| 'q%%b'`q%%b
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
{"match": "\"alpine_small\"", "color": "4 7"}
|
||||
${c1} /\\ /\\
|
||||
/${c2}/ ${c1}\\ \\
|
||||
/${c2}/ ${c1}\\ \\
|
||||
/${c2}// ${c1}\\ \\
|
||||
${c2}// ${c1}\\ \\
|
||||
\\
|
||||
@@ -1,8 +1,4 @@
|
||||
# This file is automatically generated. Please do not modify.
|
||||
|
||||
from . import AsciiArt
|
||||
|
||||
alter = AsciiArt(match=r'''"Alter"*''', color='6 6', ascii=r"""
|
||||
{"match": "\"Alter\"*", "color": "6 6"}
|
||||
${c1} %,
|
||||
^WWWw
|
||||
'wwwwww
|
||||
@@ -22,6 +18,4 @@ ${c1} %,
|
||||
@~:~~: ~:~~:~:(zltlltlO a,wwwwww
|
||||
8~~:~~:~~~~:~~~~_1ltltu ,www
|
||||
5~~:~~:~~:~~:~~:~~~_1ltq N,,
|
||||
g~:~~:~~~:~~:~~:~:~~~~1q N,
|
||||
""")
|
||||
|
||||
g~:~~:~~~:~~:~~:~:~~~~1q N,
|
||||
@@ -0,0 +1,23 @@
|
||||
{"match": "\"ALTLinux\"*", "color": "3 8 7"}
|
||||
##############
|
||||
######################
|
||||
##########################
|
||||
##+${c2}####${c1}#######################
|
||||
#####${c2}#${c1}*${c2}###%+${c1}######################
|
||||
########${c2}%${c1}*#${c2}%#####${c1}###################
|
||||
##########${c2}##${c1}*#*${c2}#######%+${c1}##############
|
||||
#############${c2}%#############%${c1}############
|
||||
#############${c2}+################${c1}##########
|
||||
##############${c2}################*${c1}#########
|
||||
##############${c2}+################+${c1}########
|
||||
###############${c2}##########${c1}###${c2}+##%${c1}########
|
||||
###############${c2}+########${c1}######${c2}###${c1}#######
|
||||
#############${c2}*####${c1}############${c2}%#+${c1}#######
|
||||
############${c2}+###${c3}####${c1}##########${c2}%#*${c1}#######
|
||||
##########${c2}###*${c3}######${c2}+#+${c1}#####${c2}+##*${c1}######
|
||||
#########${c2}##%${c3}#####${c2}:%#####${c1}###${c2}###*${c1}#####
|
||||
########${c2}%#+${c3}######${c2}#############${c1}####
|
||||
#####${c2}##%:${c3}######${c2}:############${c1}##
|
||||
##${c2}+##*${c3}########${c2}############${c1}
|
||||
${c2}###${c3}#########${c2}##########${c1}
|
||||
${c3}########${c2}######
|
||||
@@ -1,8 +1,4 @@
|
||||
# This file is automatically generated. Please do not modify.
|
||||
|
||||
from . import AsciiArt
|
||||
|
||||
amazon = AsciiArt(match=r'''"Amazon"*''', color='3 7', ascii=r"""
|
||||
{"match": "\"Amazon\"*", "color": "3 7"}
|
||||
${c1} `-/oydNNdyo:.`
|
||||
`.:+shmMMMMMMMMMMMMMMmhs+:.`
|
||||
-+hNNMMMMMMMMMMMMMMMMMMMMMMNNho-
|
||||
@@ -21,6 +17,4 @@ dMMMMMMMMMMMMMMMMh yMMMMMMMMMMMMMMMMd
|
||||
dMMMMMMMMMMMMMMMMh yMMMMMMMMMMMMMMMMd
|
||||
.:+ydNMMMMMMMMMMMh yMMMMMMMMMMMNdy+:.
|
||||
`.:+shNMMMMMh yMMMMMNhs+:``
|
||||
`-+shy shs+:`
|
||||
""")
|
||||
|
||||
`-+shy shs+:`
|
||||
@@ -0,0 +1,11 @@
|
||||
{"match": "\"Amazon Linux\"*|\"amzn\"*", "color": "7 38;5;178"}
|
||||
, ${c2}#_${c1}
|
||||
~\_ ${c2}####_${c1}
|
||||
~~ \_${c2}#####\${c1}
|
||||
~~ \${c2}###|${c1}
|
||||
~~ \${c2}#/${c1} ___
|
||||
~~ V~' '->
|
||||
~~~ /
|
||||
~~._. _/
|
||||
_/ _/
|
||||
_/m/'
|
||||
@@ -0,0 +1,15 @@
|
||||
{"match": "\"Amiga\"*", "color": "1 1 3 4 6 3 2"}
|
||||
----.---
|
||||
:-==.-==-
|
||||
${c2} -=== ===:
|
||||
===-:===.
|
||||
${c3} -+++:=++=
|
||||
=+++ +++.
|
||||
${c6} .+++-=++=
|
||||
${c4}.::. ::: ${c6} :**+ +**-
|
||||
${c4} :--:.---. ${c6} .+**=-***.
|
||||
${c5} :--- ---::${c6}***:***+
|
||||
${c5} .---::-${c6}=##*.*##-
|
||||
${c7} ----+${c6}##=:##*.
|
||||
${c7} :-${c6}###-*##+
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
{"match": "\"AmogOS\"*", "color": "15 6"}
|
||||
${c1} ___________
|
||||
/ \\
|
||||
/ ${c2}______${c1} \\
|
||||
/ ${c2}/ \\${c1} \\
|
||||
| ${c2}( )${c1} \\
|
||||
/ ${c2}\\______/${c1} |
|
||||
| |
|
||||
/ \\
|
||||
| |
|
||||
| |
|
||||
/ |
|
||||
| |
|
||||
| _______ |
|
||||
____/ / \\ |
|
||||
/ | | |
|
||||
| / ____/ |
|
||||
\\_________/ / |
|
||||
\\ __/
|
||||
\\_______/
|
||||
@@ -1,8 +1,4 @@
|
||||
# This file is automatically generated. Please do not modify.
|
||||
|
||||
from . import AsciiArt
|
||||
|
||||
anarchy = AsciiArt(match=r'''"Anarchy"*''', color='7 4', ascii=r"""
|
||||
{"match": "\"Anarchy\"*", "color": "7 4", "foreground": [2]}
|
||||
${c2}..${c1}
|
||||
${c2}..${c1}
|
||||
${c2}:..${c1}
|
||||
@@ -30,6 +26,4 @@ anarchy = AsciiArt(match=r'''"Anarchy"*''', color='7 4', ascii=r"""
|
||||
${c2}.${c1} ${c2}.:+++${c1}.
|
||||
${c2}.:${c1}:
|
||||
${c2}..${c1}
|
||||
${c2}..${c1}
|
||||
""")
|
||||
|
||||
${c2}..${c1}
|
||||
@@ -1,8 +1,4 @@
|
||||
# This file is automatically generated. Please do not modify.
|
||||
|
||||
from . import AsciiArt
|
||||
|
||||
android = AsciiArt(match=r'''"Android"*''', color='2 7', ascii=r"""
|
||||
{"match": "\"Android\"*", "color": "2 7", "foreground": [2]}
|
||||
${c1} -o o-
|
||||
+hydNNNNdyh+
|
||||
+mMMMMMMMMMMMMm+
|
||||
@@ -20,6 +16,4 @@ ${c1} -o o-
|
||||
`/++MMMMh++hMMMM++/`
|
||||
MMMMo oMMMM
|
||||
MMMMo oMMMM
|
||||
oNMm- -mMNs
|
||||
""")
|
||||
|
||||
oNMm- -mMNs
|
||||
@@ -0,0 +1,7 @@
|
||||
{"match": "\"android_small\"*", "color": "2 7"}
|
||||
${c1} ;, ,;
|
||||
';,.-----.,;'
|
||||
,' ',
|
||||
/ O O \\
|
||||
| |
|
||||
'-----------------'
|
||||
@@ -0,0 +1,21 @@
|
||||
{"match": "\"anduinos\"*", "color": "6 4"}
|
||||
${c1}+++++++++++
|
||||
+++++++++++++++++++++
|
||||
+++++++++++++++++++++++++++++++
|
||||
=+++++++++++++++++++++++++++++++++++++++=
|
||||
+++++++++++++++++++++++++++++++++++++++++++++
|
||||
=++++++++++++++++++++++++++++++++++++++++++++
|
||||
==+++++++++++++++++++++++++++++++++==
|
||||
+++++++++++++++++++++++++++
|
||||
${c2}**** ${c1}++=+++++++++++=++ ${c2}****
|
||||
********** ${c1}+++++++ ${c2}**********
|
||||
************** **************
|
||||
**************** ****************
|
||||
***********************
|
||||
****** ************* ******
|
||||
*********** *** ***********
|
||||
*************** ***************
|
||||
*************** ***************
|
||||
*********************
|
||||
***********
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
# This file is automatically generated. Please do not modify.
|
||||
|
||||
from . import AsciiArt
|
||||
|
||||
antergos = AsciiArt(match=r'''"Antergos"*''', color='4 6', ascii=r"""
|
||||
{"match": "\"Antergos\"*", "color": "4 6", "foreground": [1]}
|
||||
${c2} `.-/::/-``
|
||||
.-/osssssssso/.
|
||||
:osyysssssssyyys+-
|
||||
@@ -21,6 +17,4 @@ dmmmdddddddhhhyso${c1}++++++${c2}shhhhhddddddmmmmh
|
||||
-dmmmdddddddhhys${c1}o++++o${c2}shhhhdddddddmmmmd-
|
||||
.smmmmddddddddhhhhhhhhhdddddddddmmmms.
|
||||
`+ydmmmdddddddddddddddddddmmmmdy/.
|
||||
`.:+ooyyddddddddddddyyso+:.`
|
||||
""")
|
||||
|
||||
`.:+ooyyddddddddddddyyso+:.`
|
||||
@@ -1,8 +1,4 @@
|
||||
# This file is automatically generated. Please do not modify.
|
||||
|
||||
from . import AsciiArt
|
||||
|
||||
antix = AsciiArt(match=r'''"antiX"*''', color='1 7 3', ascii=r"""
|
||||
{"match": "\"antiX\"*", "color": "1 7 3"}
|
||||
${c1}
|
||||
\
|
||||
, - ~ ^ ~ - \ /
|
||||
@@ -15,6 +11,4 @@ ${c1}
|
||||
\,_/\_/ | |_/|_/|_/_/ \,
|
||||
, / ,\
|
||||
, / , ' \
|
||||
' - , _ _ _ , '
|
||||
""")
|
||||
|
||||
' - , _ _ _ , '
|
||||
@@ -0,0 +1,22 @@
|
||||
{"match": "\"AnushOS\"*", "color": "7 8 3 6 1"}
|
||||
${c4}#######################
|
||||
${c4}# ${c2}##### ${c4}#
|
||||
${c4}# ${c2}####### ${c4}#
|
||||
${c4}# ${c2}##${c5}O${c2}#${c5}O${c2}## ${c4}#
|
||||
${c4}# ${c2}#${c3}#####${c2}# ${c4}#
|
||||
${c4}# ${c2}##${c1}##${c3}###${c1}##${c2}## ${c4}#
|
||||
${c4}# ${c2}#${c1}##########${c2}## ${c4}#
|
||||
${c4}# ${c2}#${c1}############${c2}## ${c4}#
|
||||
${c4}# ${c2}#${c1}######${c5}A_O${c1}####${c2}### ${c4}#
|
||||
${c4}# ${c3}##${c2}#${c1}############${c2}##${c3}## ${c4}#
|
||||
${c4}#${c3}######${c2}#${c1}#######${c2}#${c3}######${c4}#
|
||||
${c4}#${c3}#######${c2}#${c1}#####${c2}#${c3}#######${c4}#
|
||||
${c4}# ${c3}#####${c2}#######${c3}##### ${c4}#
|
||||
${c4}#######################
|
||||
${c4}#${c5}╔═╗╔╗╔╦ ╦╔═╗╦ ╦╔═╗╔═╗${c4}#
|
||||
${c4}#${c5}╠═╣║║║║ ║╚═╗╠═╣║ ║╚═╗${c4}#
|
||||
${c4}#${c5}╩ ╩╝╚╝╚═╝╚═╝╩ ╩╚═╝╚═╝${c4}#
|
||||
${c4}#######################
|
||||
${c4}# ${c3}WWW.ANUSHOS.ORG ${c4}#
|
||||
${c4}#######################
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
# This file is automatically generated. Please do not modify.
|
||||
|
||||
from . import AsciiArt
|
||||
|
||||
aosc_os = AsciiArt(match=r'''"AOSC OS"*''', color='4 0 1 3', ascii=r"""
|
||||
{"match": "\"AOSC OS\"*", "color": "4 0 1 3"}
|
||||
${c2} __
|
||||
${c2}gpBBBBBBBBBP
|
||||
${c2}_gBBBBBBBBBRP
|
||||
@@ -13,12 +9,10 @@ ${c2} __
|
||||
${c4}_w@@@@@@@@@@@@@@@@P" ${c1}_g@@@@@@@P"
|
||||
${c4}_g@@@@@@@@@@@@@@@N"` ${c1}VMNN@NNNM^`
|
||||
${c4}^MMM@@@@@@@@@@@MP" ${c3},ggppww__
|
||||
${c4}`"\"\"\"" ${c3}_wNNNNNNNNNNNNNNNNNNN
|
||||
${c4}`""""" ${c3}_wNNNNNNNNNNNNNNNNNNN
|
||||
${c3}_gBNNNNNNNNNNNNNNNNNP"
|
||||
${c3}_wNNNNNNNNNNNNNNNNNNMP`
|
||||
${c3}_gBNNNNNNNNNNNNNNNNNP"
|
||||
${c3}_wNNNNNNNNNNNNNNNNNNNM^
|
||||
${c3}""Y^^MNNNNNNNNNNNNP`
|
||||
${c3}`"\"\""\"\""
|
||||
""")
|
||||
|
||||
${c3}`"""""""
|
||||
@@ -0,0 +1,21 @@
|
||||
{"match": "\"Aosc OS_old\"*|\"aoscos_old\"*", "color": "7"}
|
||||
.:+syhhhhys+:.
|
||||
.ohNMMMMMMMMMMMMMMNho.
|
||||
`+mMMMMMMMMMMmdmNMMMMMMMMm+`
|
||||
+NMMMMMMMMMMMM/ `./smMMMMMN+
|
||||
.mMMMMMMMMMMMMMMo -yMMMMMm.
|
||||
:NMMMMMMMMMMMMMMMs .hMMMMN:
|
||||
.NMMMMhmMMMMMMMMMMm+/- oMMMMN.
|
||||
dMMMMs ./ymMMMMMMMMMMNy. sMMMMd
|
||||
-MMMMN` oMMMMMMMMMMMN: `NMMMM-
|
||||
/MMMMh NMMMMMMMMMMMMm hMMMM/
|
||||
/MMMMh NMMMMMMMMMMMMm hMMMM/
|
||||
-MMMMN` :MMMMMMMMMMMMy. `NMMMM-
|
||||
dMMMMs .yNMMMMMMMMMMMNy/. sMMMMd
|
||||
.NMMMMo -/+sMMMMMMMMMMMmMMMMN.
|
||||
:NMMMMh. .MMMMMMMMMMMMMMMN:
|
||||
.mMMMMMy- NMMMMMMMMMMMMMm.
|
||||
+NMMMMMms/.` mMMMMMMMMMMMN+
|
||||
`+mMMMMMMMMNmddMMMMMMMMMMm+`
|
||||
.ohNMMMMMMMMMMMMMMNho.
|
||||
.:+syhhhhys+:.
|
||||
@@ -1,8 +1,4 @@
|
||||
# This file is automatically generated. Please do not modify.
|
||||
|
||||
from . import AsciiArt
|
||||
|
||||
aosc_os_retro = AsciiArt(match=r'''"AOSC OS/Retro"*''', color='4 7 1 3', ascii=r"""
|
||||
{"match": "\"Aosc OS/Retro\"*|\"aoscosretro\"*", "color": "4 7"}
|
||||
${c2} .........
|
||||
...................
|
||||
.....................${c1}################${c2}
|
||||
@@ -21,5 +17,3 @@ ${c2} .........
|
||||
${c3}................ ${c4}###########
|
||||
${c3}****************
|
||||
${c3}################
|
||||
""")
|
||||
|
||||
+1
-7
@@ -1,8 +1,4 @@
|
||||
# This file is automatically generated. Please do not modify.
|
||||
|
||||
from . import AsciiArt
|
||||
|
||||
aoscosretro_small = AsciiArt(match=r'''"aoscosretro_small"''', color='4 7 1 3', ascii=r"""
|
||||
{"match": "\"Aosc OS/Retro_small\"*|\"aoscosretro_small\"*", "color": "4 7"}
|
||||
${c2} _____ ${c1}_____${c2}
|
||||
-' '-${c1}| |${c2}
|
||||
/ ___ ${c1}| |${c2}
|
||||
@@ -12,5 +8,3 @@ ${c2} _____ ${c1}_____${c2}
|
||||
${c3}|${c2}/_/ ${c3}| ${c4}| |
|
||||
${c3}| | ${c4}|___|
|
||||
${c3}|_____|
|
||||
""")
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
{"match": "\"Aperio GNU/Linux\"*", "color": "255"}
|
||||
${c2}
|
||||
_.._ _ ._.. _
|
||||
(_][_)(/,[ |(_)
|
||||
| GNU/Linux
|
||||
@@ -1,8 +1,4 @@
|
||||
# This file is automatically generated. Please do not modify.
|
||||
|
||||
from . import AsciiArt
|
||||
|
||||
aperture = AsciiArt(match=r'''"Aperture"*''', color='6 6 7 1', ascii=r"""
|
||||
{"match": "\"Aperture\"*", "color": "6 6 7 1"}
|
||||
${c1} .,-:;//;:=,
|
||||
. :H@@@MM@M#H/.,+%;,
|
||||
,/X+ +M@@M@MM%=,-%HMMM@X/,
|
||||
@@ -22,6 +18,4 @@ ${c1} .,-:;//;:=,
|
||||
=XMMM@MM@MM#H;,-+HMM@M+ /MMMX=
|
||||
=%@M@M#@$-.=$@MM@@@M; %M%=
|
||||
,:+$+-,/H#MMMMMMM@= =,
|
||||
=++%%%%+/:-.
|
||||
""")
|
||||
|
||||
=++%%%%+/:-.
|
||||
@@ -0,0 +1,18 @@
|
||||
{"match": "\"Apple\"*", "color": "2 3 1 1 5 4"}
|
||||
..'
|
||||
,xNMM.
|
||||
.OMMMMo
|
||||
lMM"
|
||||
.;loddo:. .olloddol;.
|
||||
cKMMMMMMMMMMNWMMMMMMMMMM0:
|
||||
${c2}.KMMMMMMMMMMMMMMMMMMMMMMMWd.
|
||||
XMMMMMMMMMMMMMMMMMMMMMMMX.
|
||||
${c3};MMMMMMMMMMMMMMMMMMMMMMMM:
|
||||
:MMMMMMMMMMMMMMMMMMMMMMMM:
|
||||
${c4}.MMMMMMMMMMMMMMMMMMMMMMMMX.
|
||||
kMMMMMMMMMMMMMMMMMMMMMMMMWd.
|
||||
${c5}'XMMMMMMMMMMMMMMMMMMMMMMMMMMk
|
||||
'XMMMMMMMMMMMMMMMMMMMMMMMMK.
|
||||
${c6}kMMMMMMMMMMMMMMMMMMMMMMd
|
||||
;KMMMMMMMWXXWMMMMMMMk.
|
||||
"cooc*" "*coo'"
|
||||
@@ -0,0 +1,8 @@
|
||||
{"match": "\"Apple_small\"*", "color": "2 3 1 5 4"}
|
||||
${c1} .:'
|
||||
__ :'__
|
||||
${c2} .'`__`-'__``.
|
||||
${c3}:__________.-'
|
||||
${c4}:_________:
|
||||
:_________`-;
|
||||
${c5} `.__.-.__.'
|
||||
@@ -1,8 +1,4 @@
|
||||
# This file is automatically generated. Please do not modify.
|
||||
|
||||
from . import AsciiArt
|
||||
|
||||
apricity = AsciiArt(match=r'''"Apricity"*''', color='4 7 1', ascii=r"""
|
||||
{"match": "\"Apricity\"*", "color": "4 7 1"}
|
||||
${c2} ./o-
|
||||
``...`` `:. -/:
|
||||
`-+ymNMMMMMNmho-` :sdNNm/
|
||||
@@ -20,6 +16,4 @@ MMMMMM/`.-/ohmNMMMMMMy-
|
||||
MMMMMMNmNNMMMMMMMMmo.
|
||||
MMMMMMMMMMMMMMMms:`
|
||||
MMMMMMMMMMNds/.
|
||||
dhhyys+/-`
|
||||
""")
|
||||
|
||||
dhhyys+/-`
|
||||
@@ -1,8 +1,4 @@
|
||||
# This file is automatically generated. Please do not modify.
|
||||
|
||||
from . import AsciiArt
|
||||
|
||||
arch = AsciiArt(match=r'''"Arch"*''', color='6 6 7 1', ascii=r"""
|
||||
{"match": "\"Arch\"*", "color": "6 6 7 1"}
|
||||
${c1} -`
|
||||
.o+`
|
||||
`ooo/
|
||||
@@ -21,6 +17,4 @@ ${c2} .oossssso-````/ossssss+`
|
||||
`/ossssso+/:- -:/+osssso+-
|
||||
`+sso+:-` `.-/+oso:
|
||||
`++:. `-/+/
|
||||
.` `/
|
||||
""")
|
||||
|
||||
.` `/
|
||||
@@ -0,0 +1,20 @@
|
||||
{"match": "\"arch2\"*", "color": "6 6"}
|
||||
▄
|
||||
▟█▙
|
||||
▟███▙
|
||||
▟█████▙
|
||||
▟███████▙
|
||||
▂▔▀▜██████▙
|
||||
▟██▅▂▝▜█████▙
|
||||
▟█████████████▙
|
||||
▟███████████████▙
|
||||
▟█████████████████▙
|
||||
▟███████████████████▙
|
||||
${c2} ▟█████████▛▀▀▜████████▙
|
||||
▟████████▛ ▜███████▙
|
||||
▟█████████ ████████▙
|
||||
▟██████████ █████▆▅▄▃▂
|
||||
▟██████████▛ ▜█████████▙
|
||||
▟██████▀▀▀ ▀▀██████▙
|
||||
▟███▀▘ ▝▀███▙
|
||||
▟▛▀ ▀▜▙
|
||||
@@ -0,0 +1,20 @@
|
||||
{"match": "\"arch3\"*", "color": "6 6"}
|
||||
.
|
||||
/ \
|
||||
/ \
|
||||
/ \
|
||||
/ \
|
||||
/>, \
|
||||
/ `*. \
|
||||
/ ` \
|
||||
/ \
|
||||
/ \
|
||||
${c2} / ,.-+-.. \
|
||||
/ ,/' `\. \
|
||||
/ .|' `|. _ \
|
||||
/ :|. ,|; `+.\
|
||||
/ .\: ;/, "<\
|
||||
/ __,--+" "+--.__ \
|
||||
/ _,+'" "'+._ \
|
||||
/,-' `-.\
|
||||
' '
|
||||
@@ -1,8 +1,4 @@
|
||||
# This file is automatically generated. Please do not modify.
|
||||
|
||||
from . import AsciiArt
|
||||
|
||||
arch_old = AsciiArt(match=r'''"arch_old"''', color='6 7 1', ascii=r"""
|
||||
{"match": "\"arch_old\"", "color": "6 7 1"}
|
||||
${c1} __
|
||||
_=(SDGJT=_
|
||||
_GTDJHGGFCVS)
|
||||
@@ -18,6 +14,4 @@ ${c1}JSNRVW'${c2} __+MNAEC${c1}\IOI,${c2}\BN'
|
||||
${c1}HELK['${c2} __,=OFFXCBGHC${c1}\FD)
|
||||
${c1}?KGHE ${c2}\_-#DASDFLSV='${c1} 'EF
|
||||
'EHTI !H
|
||||
`0F' '!
|
||||
""")
|
||||
|
||||
`0F' '!
|
||||
@@ -0,0 +1,8 @@
|
||||
{"match": "\"arch_small\"", "color": "6 7 1"}
|
||||
${c1} /\\
|
||||
/ \\
|
||||
/\\ \\
|
||||
${c2} / \\
|
||||
/ ,, \\
|
||||
/ | | -\\
|
||||
/_-'' ''-_\\
|
||||
@@ -1,8 +1,4 @@
|
||||
# This file is automatically generated. Please do not modify.
|
||||
|
||||
from . import AsciiArt
|
||||
|
||||
archbox = AsciiArt(match=r'''"ArchBox"*''', color='2 7 1', ascii=r"""
|
||||
{"match": "\"ArchBox\"*", "color": "2 7 1"}
|
||||
${c1} ...:+oh/:::..
|
||||
..-/oshhhhhh` `::::-.
|
||||
.:/ohhhhhhhhhhhh` `-::::.
|
||||
@@ -21,6 +17,4 @@ ${c1} ...:+oh/:::..
|
||||
/:::+`hhhhoos` `hhhhhhhhhhhhhhhhhs+`
|
||||
`--/:` /: `hhhhhhhhhhhho/-
|
||||
-/:. `hhhhhhs+:-`
|
||||
::::/ho/-`
|
||||
""")
|
||||
|
||||
::::/ho/-`
|
||||
@@ -1,8 +1,4 @@
|
||||
# This file is automatically generated. Please do not modify.
|
||||
|
||||
from . import AsciiArt
|
||||
|
||||
archcraft = AsciiArt(match=r'''"Archcraft"*''', color='6 1 2 3 4 5', ascii=r"""
|
||||
{"match": "\"Archcraft\"*", "color": "6 1 2 3 4 5"}
|
||||
${c1}⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄${c1}⢰⡆${c1}⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄
|
||||
${c2}⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄${c1}⢠⣿⣿⡄${c2}⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄
|
||||
${c3}⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄${c1}⢀⣾⣿⣿⣿⡀${c3}⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄
|
||||
@@ -22,6 +18,4 @@ ${c4}⠄⠄⠄⠄${c1}⢀⣾⣿⣿⣿⣿⣿⣿⣷⣤⡀${c4}⠄⠄⠄${c1}⠻⣿
|
||||
${c5}⠄⠄⠄${c1}⢠⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⠏${c5}⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄${c1}⢿⣿⣿⣿⣿⣿⣿⣿⣿⣦⡀${c5}⠄⠄⠄
|
||||
${c6}⠄⠄${c1}⢠⣿⣿⣿⣿⣿⣿⣿⡿⠟⠋⠁${c6}⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄${c1}⠙⠻⣿⣿⣿⣿⣿⣿⣿⣿⡄${c6}⠄⠄
|
||||
${c1}⠄${c1}⣠⣿⣿⣿⣿⠿⠛⠋⠁${c1}⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄${c1}⠉⠙⠻⢿⣿⣿⣿⣿⣆${c1}⠄
|
||||
${c1}⡰⠟⠛⠉⠁${c2}⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄${c1}⠉⠙⠛⠿⢆
|
||||
""")
|
||||
|
||||
${c1}⡰⠟⠛⠉⠁${c2}⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄${c1}⠉⠙⠛⠿⢆
|
||||
@@ -1,9 +1,5 @@
|
||||
# This file is automatically generated. Please do not modify.
|
||||
|
||||
from . import AsciiArt
|
||||
|
||||
archcraft_ascii = AsciiArt(match=r'''"archcraft_ascii"*''', color='6 1 2 3 4 5', ascii=r"""
|
||||
${c1} -o\
|
||||
{"match": "\"Archcraft2\"*", "color": "6"}
|
||||
-o\
|
||||
:ooo:
|
||||
.ooooo.
|
||||
ooooooo.
|
||||
@@ -23,5 +19,3 @@ ${c1} -o\
|
||||
.+osossos+-` `-+osososs+.
|
||||
:sss+=-:` `:-=+ssss:
|
||||
:=-:` `-=+:
|
||||
""")
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
{"match": "\"archcraft_ascii\"*", "color": "6 1 2 3 4 5"}
|
||||
${c1} -o\
|
||||
:ooo:
|
||||
.ooooo.
|
||||
ooooooo.
|
||||
+oooooooo.
|
||||
-oooooooooo.
|
||||
--:-+oooooooo.
|
||||
yooo+=+sooooooo.
|
||||
yoooooosooooooooo.
|
||||
y+ooooooooooooooooo.
|
||||
yoooooooooooooooooooo`
|
||||
yoooooo+oo= :oo++ooooo`
|
||||
:oooooo. +ooooo-
|
||||
-ooooooo. .::. +ooosoo=
|
||||
-oooooo` .oooo` +os-=o=
|
||||
=ooooooo=: `oo+ :=ooo=--`.
|
||||
+ooooooooos. .=sooooooo+-
|
||||
.+osossos+-` `-+osososs+.
|
||||
:sss+=-:` `:-=+ssss:
|
||||
:=-:` `-=+:
|
||||
@@ -1,8 +1,4 @@
|
||||
# This file is automatically generated. Please do not modify.
|
||||
|
||||
from . import AsciiArt
|
||||
|
||||
archcraft_minimal = AsciiArt(match=r'''"archcraft_minimal"*''', color='6 1 2 3 4 5', ascii=r"""
|
||||
{"match": "\"archcraft_minimal\"*", "color": "6 1 2 3 4 5"}
|
||||
${c1} ⢰⡆
|
||||
⢠⣿⣿⡄
|
||||
⢀⣾⣿⣿⣿⡀
|
||||
@@ -22,6 +18,4 @@ ${c1} ⢰⡆
|
||||
⢠⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⠏ ⢿⣿⣿⣿⣿⣿⣿⣿⣿⣦⡀
|
||||
⢠⣿⣿⣿⣿⣿⣿⣿⡿⠟⠋⠁ ⠙⠻⣿⣿⣿⣿⣿⣿⣿⣿⡄
|
||||
⣠⣿⣿⣿⣿⠿⠛⠋⠁ ⠉⠙⠻⢿⣿⣿⣿⣿⣆
|
||||
⡰⠟⠛⠉⠁ ⠉⠙⠛⠿⢆
|
||||
""")
|
||||
|
||||
⡰⠟⠛⠉⠁ ⠉⠙⠛⠿⢆
|
||||
@@ -1,8 +1,4 @@
|
||||
# This file is automatically generated. Please do not modify.
|
||||
|
||||
from . import AsciiArt
|
||||
|
||||
archlabs = AsciiArt(match=r'''"ARCHlabs"*''', color='6 6 7 1', ascii=r"""
|
||||
{"match": "\"ARCHlabs\"*", "color": "6 6 7 1"}
|
||||
${c1} 'c'
|
||||
'kKk,
|
||||
.dKKKx.
|
||||
@@ -23,6 +19,4 @@ ${c1} 'c'
|
||||
'xKXXXXK0kdl:. ${c4}.ok; ${c1}.cdk0KKXXXKx'
|
||||
'xKK0koc,.. ${c4}'c, ${c1} ..,cok0KKk,
|
||||
,xko:'. ${c4}.. ${c1} .':okx;
|
||||
.,'. .',.
|
||||
""")
|
||||
|
||||
.,'. .',.
|
||||
@@ -1,8 +1,4 @@
|
||||
# This file is automatically generated. Please do not modify.
|
||||
|
||||
from . import AsciiArt
|
||||
|
||||
archmerge = AsciiArt(match=r'''"ArchMerge"*''', color='6 6 7 1', ascii=r"""
|
||||
{"match": "\"ArchMerge\"*", "color": "6 6 7 1"}
|
||||
${c1} y:
|
||||
sMN-
|
||||
+MMMm`
|
||||
@@ -22,6 +18,4 @@ ${c1} y:
|
||||
-NMMMMMMMMMh `mNMMMMMMMMd`
|
||||
/NMMMNds+:.` `-/oymMMMm.
|
||||
+Mmy/. `:smN:
|
||||
/+. -o.
|
||||
""")
|
||||
|
||||
/+. -o.
|
||||
@@ -1,8 +1,4 @@
|
||||
# This file is automatically generated. Please do not modify.
|
||||
|
||||
from . import AsciiArt
|
||||
|
||||
archstrike = AsciiArt(match=r'''"ArchStrike"*''', color='8 6', ascii=r"""
|
||||
{"match": "\"ArchStrike\"*", "color": "8 6", "foreground": [2]}
|
||||
${c1} *
|
||||
**.
|
||||
****
|
||||
@@ -19,6 +15,4 @@ ${c1} *
|
||||
****${c2}/${c1}**** ${c2}/////${c1}***${c2}/${c1}****
|
||||
******${c2}/${c1}*** ${c2}//// ${c1}**${c2}/${c1}******
|
||||
********${c2}/${c1}* ${c2}/// ${c1}*${c2}/${c1}********
|
||||
,****** ${c2}// ______ / ${c1}******,
|
||||
""")
|
||||
|
||||
,****** ${c2}// ______ / ${c1}******,
|
||||
@@ -0,0 +1,21 @@
|
||||
{"match": "\"arco\"*|\"arcolinux\"*", "color": "4 7"}
|
||||
/-
|
||||
ooo:
|
||||
yoooo/
|
||||
yooooooo
|
||||
yooooooooo
|
||||
yooooooooooo
|
||||
.yooooooooooooo
|
||||
.oooooooooooooooo
|
||||
.oooooooarcoooooooo
|
||||
.ooooooooo-oooooooooo
|
||||
.ooooooooo- oooooooooo
|
||||
:ooooooooo. :ooooooooo
|
||||
:ooooooooo. :ooooooooo
|
||||
:oooarcooo .oooarcooo
|
||||
:ooooooooy .ooooooooo
|
||||
${c1}:ooooooooo ${c2}/ooooooooooooooooooo
|
||||
${c1}:ooooooooo ${c2}.-ooooooooooooooooo.
|
||||
${c1}ooooooooo- ${c2}-ooooooooooooo.
|
||||
${c1}ooooooooo- ${c2}.-oooooooooo.
|
||||
${c1}ooooooooo. ${c2}-ooooooooo
|
||||
@@ -0,0 +1,12 @@
|
||||
{"match": "\"arco_small\"*|\"arcolinux_small\"*", "color": "4 7"}
|
||||
A
|
||||
ooo
|
||||
ooooo
|
||||
ooooooo
|
||||
ooooooooo
|
||||
ooooo ooooo
|
||||
ooooo ooooo
|
||||
ooooo ooooo
|
||||
ooooo ${c2}<oooooooo>${c1}
|
||||
ooooo ${c2}<oooooo>${c1}
|
||||
ooooo ${c2}<oooo>
|
||||
@@ -1,8 +1,4 @@
|
||||
# This file is automatically generated. Please do not modify.
|
||||
|
||||
from . import AsciiArt
|
||||
|
||||
arcolinux = AsciiArt(match=r'''"ArcoLinux"*''', color='7 4', ascii=r"""
|
||||
{"match": "\"ArcoLinux\"*", "color": "7 4"}
|
||||
${c2} /-
|
||||
ooo:
|
||||
yoooo/
|
||||
@@ -22,6 +18,4 @@ ${c2} /-
|
||||
:ooooooooo ${c1}.-ooooooooooooooooo.${c2}
|
||||
ooooooooo- ${c1}-ooooooooooooo.${c2}
|
||||
ooooooooo- ${c1}.-oooooooooo.${c2}
|
||||
ooooooooo. ${c1}-ooooooooo${c2}
|
||||
""")
|
||||
|
||||
ooooooooo. ${c1}-ooooooooo${c2}
|
||||
@@ -0,0 +1,12 @@
|
||||
{"match": "\"arcolinux_small\"*", "color": "7 4"}
|
||||
${c2} A
|
||||
ooo
|
||||
ooooo
|
||||
ooooooo
|
||||
ooooooooo
|
||||
ooooo ooooo
|
||||
ooooo ooooo
|
||||
ooooo ooooo
|
||||
ooooo ${c1}<oooooooo>${c2}
|
||||
ooooo ${c1}<oooooo>${c2}
|
||||
ooooo ${c1}<oooo>${c2}
|
||||
@@ -0,0 +1,24 @@
|
||||
{"match": "\"Arkane\"*", "color": "7 130 237", "foreground": [1]}
|
||||
${c3} .:..
|
||||
..:::......
|
||||
${c2}.${c3} .${c2}.${c3}.....
|
||||
${c2}+=${c3}...${c2}==${c3}....
|
||||
......:.${c1}:-${c2}:${c3}..${c1}+*${c2}=${c3}....
|
||||
${c2}:----::${c3}......
|
||||
${c2}.=***##*+=: ${c3}..
|
||||
${c2}=${c1}***######*${c2}=
|
||||
${c2}.${c1}-*######+
|
||||
${c2}:+${c1}###%%%###${c3}:
|
||||
${c2}-+*${c1}########+${c3}.
|
||||
${c2}=++*${c1}#######${c3}-
|
||||
${c2}-+=+**${c1}*####${c3}=
|
||||
${c3}.${c2}-=++==***${c1}##*${c1}-
|
||||
${c2}-++++++==++++=
|
||||
.-+++**+++=+===${c3}.
|
||||
${c2}:---===++++=-=--${c3}.
|
||||
${c2}-===============${c3}-==--:
|
||||
${c2}.-==+++***++*${c1}*#########${c3}=:::.
|
||||
${c2}.-=++++*++++**${c1}#######%%###${c3}=
|
||||
${c2}.:==++++++**${c1}#############${c3}:
|
||||
${c2}.${c3}-+*++*+++==${c1}###${c3}+
|
||||
-${c1}*+${c3}:
|
||||
@@ -0,0 +1,12 @@
|
||||
{"match": "\"Armbian\"*", "color": "7 1"}
|
||||
..
|
||||
`:]x**j-,'
|
||||
.,+t***********z\<"
|
||||
?******************;
|
||||
'*n` .'`^,;;,^`'. ,cc.
|
||||
-<. .[l
|
||||
// ^^ ^^ \\
|
||||
!^ ${c2}^^${c1} ":
|
||||
'tt}` ${c2}!~]rj_${c1} ")t/.
|
||||
Itttt?' ${c2}~~]rr]${c1} `{tttt,
|
||||
\tttttt!""I${c2}_]r(${c1}
|
||||
@@ -0,0 +1,15 @@
|
||||
{"match": "\"Armbian2\"*", "color": "1"}
|
||||
█ █ █ █ █ █ █ █ █ █ █
|
||||
███████████████████████
|
||||
▄▄██ ██▄▄
|
||||
▄▄██ ███████████ ██▄▄
|
||||
▄▄██ ██ ██ ██▄▄
|
||||
▄▄██ ██ ██ ██▄▄
|
||||
▄▄██ ██ ██ ██▄▄
|
||||
▄▄██ █████████████ ██▄▄
|
||||
▄▄██ ██ ██ ██▄▄
|
||||
▄▄██ ██ ██ ██▄▄
|
||||
▄▄██ ██ ██ ██▄▄
|
||||
▄▄██ ██▄▄
|
||||
███████████████████████
|
||||
█ █ █ █ █ █ █ █ █ █ █
|
||||
@@ -0,0 +1,16 @@
|
||||
{"match": "\"arse\"*|\"arselinux\"*|\"arse-linux\"*", "color": "4 7"}
|
||||
⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
|
||||
⠀⣶⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⠀⠀⠀⠀⠀⠀⣴⣶⠀⠀⠀⠀⠀
|
||||
⢸⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⣄⠀⠀⠀⠀⣼⠟⠁⠀⠀⢀⣀⠀
|
||||
⢸⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⡀⠀⢀⣤⡀⠀⠀⠀⠉⢻⣷⡄⠀⠀⠁⠀⢀⣤⣾⡿⠟⠀
|
||||
⢸⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠙⢿⣷⣿⠏⠀⠀⠀⠀⠀⠀⠹⣿⡄⠀⠀⠀⠙⠉⠁⠀⠀⠀
|
||||
⢸⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠹⣿⡄⠀⠀⠀⠀⠀⠀⠀⢹⣿⠀⠀⠀⠀⠠⣶⣶⣶⡶
|
||||
⢸⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢹⣿⠀⠀⠀⠀⠀⠀⠀⠀⣿⡇⠀⠀⠀⠀⠀⠀⠀⠀
|
||||
⢸⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⠀⠀⠀⠀⠀⠀⠀⢠⣿⠁⠀⠀⠀⠀⠀⠀⠀⠀
|
||||
⢸⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⠂⠀⠀⠀⠀⠀⢀⣾⡏⠀⠀⠀⠀⠀⠀⠀⠀⠀
|
||||
⢸⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢠⣿⠇⠀⠀⠀⠀⠀⣠⣾⠟⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
|
||||
⢸⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⣴⣿⣇⣀⣀⣀⣠⣴⣾⣿⡏⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
|
||||
⢸⣿⠀⠀⠀⠀⠀⣤⣤⣴⣶⣾⠿⠟⣿⡏⠙⠛⠛⠛⠋⠉⢀⣿⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
|
||||
⠀⣿⡄⠀⠀⠀⠀⠈⠉⠉⠀⠀⠀⠀⣿⡇⠀⠀⠀⠀⠀⠀⢸⣿⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
|
||||
⠀⣿⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢿⠇⠀⠀⠀⠀⠀⠀⠘⠿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
|
||||
⠀⠈⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
|
||||
@@ -1,8 +1,4 @@
|
||||
# This file is automatically generated. Please do not modify.
|
||||
|
||||
from . import AsciiArt
|
||||
|
||||
arselinux = AsciiArt(match=r'''"ArseLinux"*''', color='4 7', ascii=r"""
|
||||
{"match": "\"ArseLinux\"*", "color": "4 7"}
|
||||
${c1}
|
||||
⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
|
||||
⠀⣶⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⠀⠀⠀⠀⠀⠀⣴⣶⠀⠀⠀⠀⠀
|
||||
@@ -18,6 +14,4 @@ ${c1}
|
||||
⢸⣿⠀⠀⠀⠀⠀⣤⣤⣴⣶⣾⠿⠟⣿⡏⠙⠛⠛⠛⠋⠉⢀⣿⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
|
||||
⠀⣿⡄⠀⠀⠀⠀⠈⠉⠉⠀⠀⠀⠀⣿⡇⠀⠀⠀⠀⠀⠀⢸⣿⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
|
||||
⠀⣿⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢿⠇⠀⠀⠀⠀⠀⠀⠘⠿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
|
||||
⠀⠈⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
|
||||
""")
|
||||
|
||||
⠀⠈⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
|
||||
@@ -1,8 +1,4 @@
|
||||
# This file is automatically generated. Please do not modify.
|
||||
|
||||
from . import AsciiArt
|
||||
|
||||
artix = AsciiArt(match=r'''"Artix"*''', color='6 6 7 1', ascii=r"""
|
||||
{"match": "\"Artix\"*", "color": "6 6 7 1"}
|
||||
${c1} '
|
||||
'o'
|
||||
'ooo'
|
||||
@@ -22,6 +18,4 @@ ${c1} '
|
||||
'ooooxooi::'` .:iiixkxxo'
|
||||
'ooooi:'` `'';ioxxo'
|
||||
'i:'` '':io'
|
||||
'` `'
|
||||
""")
|
||||
|
||||
'` `'
|
||||
@@ -0,0 +1,9 @@
|
||||
{"match": "\"artix2_small\"*", "color": "6"}
|
||||
/\
|
||||
/ \
|
||||
/`'.,\
|
||||
/ ',
|
||||
/ ,`\
|
||||
/ ,.'`. \
|
||||
/.,'` `'.\
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
# This file is automatically generated. Please do not modify.
|
||||
|
||||
from . import AsciiArt
|
||||
|
||||
artix_small = AsciiArt(match=r'''"artix_small"*''', color='6 6 7 1', ascii=r"""
|
||||
{"match": "\"artix_small\"*", "color": "6 6 7 1"}
|
||||
${c1} '
|
||||
'A'
|
||||
'ooo'
|
||||
@@ -15,6 +11,4 @@ ${c1} '
|
||||
'ookxxkoo'` .'oo'
|
||||
'ooxoo'` .:ooxxo'
|
||||
'io'` `'oo'
|
||||
'` `'
|
||||
""")
|
||||
|
||||
'` `'
|
||||
@@ -1,8 +1,4 @@
|
||||
# This file is automatically generated. Please do not modify.
|
||||
|
||||
from . import AsciiArt
|
||||
|
||||
arya = AsciiArt(match=r'''"Arya"*''', color='2 1', ascii=r"""
|
||||
{"match": "\"Arya\"*", "color": "2 1"}
|
||||
${c1} `oyyy/${c2}-yyyyyy+
|
||||
${c1} -syyyy/${c2}-yyyyyy+
|
||||
${c1} .syyyyy/${c2}-yyyyyy+
|
||||
@@ -17,6 +13,4 @@ ${c1} +yyyyyys :yyyyyy/${c2}-yyyyyy+
|
||||
${c1} .oyyyyyyo. :yyyyyy/${c2}-yyyyyy+ ---------
|
||||
${c1} .syyyyyy+` :yyyyyy/${c2}-yyyyy+-+syyyyyyyy
|
||||
${c1} -syyyyyy/ :yyyyyy/${c2}-yyys:.syyyyyyyyyy
|
||||
${c1}:syyyyyy/ :yyyyyy/${c2}-yyo.:syyyyyyyyyyy
|
||||
""")
|
||||
|
||||
${c1}:syyyyyy/ :yyyyyy/${c2}-yyo.:syyyyyyyyyyy
|
||||
@@ -1,8 +1,4 @@
|
||||
# This file is automatically generated. Please do not modify.
|
||||
|
||||
from . import AsciiArt
|
||||
|
||||
asahi = AsciiArt(match=r'''"Asahi"*''', color='3 2 1 8 7 6 4', ascii=r"""
|
||||
{"match": "\"Asahi\"*", "color": "3 2 1 8 7 6 4", "foreground": [5]}
|
||||
${c1} ## ${c2}**
|
||||
${c1}*####${c2}****.
|
||||
${c1}###${c2},
|
||||
@@ -20,6 +16,4 @@ ${c3}(((((((((((((((((((((${c5}@@@${c6}&%&${c5}@@@%${c4},..........
|
||||
${c3}/((((((((((((${c5}@@@@@@/${c4}.../&&
|
||||
${c3}.(((((((((${c5}@@@@(${c4}....
|
||||
${c3}/(((((${c5}@@#${c4}...
|
||||
${c3}.((${c4}&,
|
||||
""")
|
||||
|
||||
${c3}.((${c4}&,
|
||||
@@ -0,0 +1,19 @@
|
||||
{"match": "\"asahi2\"*|\"asahi-linux2\"*", "color": "3 6 1 1 7 8 6"}
|
||||
${c1}_wwM ${c2}_ww
|
||||
${c1}MMM${c2}MMMM
|
||||
${c1}MM
|
||||
${c3}_ww##############yy_
|
||||
${c4}wMMMMM${c3}###########${c4}MMMMm
|
||||
${c4},MMMMMMMMM${c3}######${c4}MMMMMMMM0_
|
||||
${c4}wMMMMMMMMMMMMM${c5}MM${c6}0MMMMMMMMMMm
|
||||
${c4},MMMMMMMMMMMMMMM${c5}MMMM${c6}0MMMMMMMMM0,
|
||||
${c4}wMMMMMMMMMMMMMMMM${c5}MMMMM0${c6}MMMMMMMMMMb
|
||||
${c4}_MMMMMMMMMMMMMMMMMM${c5}MMMMMMM0${c6}MMMMMMMMM0,
|
||||
${c4}_MMMMMMMMMMMMMMMMMMM${c5}MMMM${c7}M${c5}MMMW${c6}MMMMMMMMMM_
|
||||
${c4}_MMMMMMMMMMMMMMMMMMMM${c5}MMMM${c7}M0${c5}MMMW${c6}MMMMMMMMMM_
|
||||
${c4}~MMMMMMMMMMMMMMMMM${c5}MMMM${c7}M${c5}MMMW${c6}MMMMM00~
|
||||
${c4}~MMMMMMMMMMMMM${c5}MMMWMMM${c6}0MM${c5}MMM${c6}~
|
||||
${c4}~MMMMMMMMMM${c5}MMMMM${c6}0MMM~~
|
||||
${c4}~MMMMMM${c5}MMM${c6}0MM~
|
||||
${c4}~MM${c5}M${c6}@~
|
||||
${c4}M
|
||||
@@ -0,0 +1,19 @@
|
||||
{"match": "\"aster\"*", "color": "6"}
|
||||
...''...
|
||||
.;oOXWMWNXXXNMMN0d:.
|
||||
.oXMWOo;.. ..:oO;
|
||||
;KMWx, co,
|
||||
'KMNl dMMW.
|
||||
oMMx xMMMMk
|
||||
xMM: dMMMMMM;
|
||||
cMMl dMMMMMMMW
|
||||
NMK xMMMx::dXMx
|
||||
,MMl xMMN' .o.
|
||||
cMM; dMMW'
|
||||
;MMc oMMW,
|
||||
WMK dMMW, ccccccc.
|
||||
lMMl oMMM; ooooooo.
|
||||
OMMc ...
|
||||
xMMx
|
||||
;XMN:
|
||||
,.
|
||||
@@ -1,8 +1,4 @@
|
||||
# This file is automatically generated. Please do not modify.
|
||||
|
||||
from . import AsciiArt
|
||||
|
||||
asteroidos = AsciiArt(match=r'''"AsteroidOS"*''', color='160 208 202 214', ascii=r"""
|
||||
{"match": "\"AsteroidOS\"*", "color": "160 208 202 214"}
|
||||
${c1} ***
|
||||
${c1} *****
|
||||
${c1} **********
|
||||
@@ -19,6 +15,4 @@ ${c3} /######## ########
|
||||
${c4} #######%#######
|
||||
${c4} (#%%%%%%%#
|
||||
${c4} %%%%%
|
||||
${c4} %%%
|
||||
""")
|
||||
|
||||
${c4} %%%
|
||||
@@ -1,30 +1,24 @@
|
||||
# This file is automatically generated. Please do not modify.
|
||||
|
||||
from . import AsciiArt
|
||||
|
||||
astos = AsciiArt(match=r'''"astOS"*''', color='8', ascii=r"""
|
||||
{"match": "\"astOS\"*", "color": "8"}
|
||||
${c1} oQA#$%UMn
|
||||
H 9
|
||||
G #
|
||||
6 %
|
||||
?#M#%KW3"
|
||||
// \\
|
||||
// \\
|
||||
// \\
|
||||
// \\
|
||||
// \\\
|
||||
// \\\
|
||||
// \\\
|
||||
// \\\
|
||||
n%@$DK&ML .0O3#@&M_
|
||||
P # 8 W
|
||||
H U G #
|
||||
B N O @
|
||||
C&&#%HNAR 'WS3QMHB"
|
||||
// \\ \\
|
||||
// \\ \\
|
||||
// \\ \\
|
||||
// \\ \\
|
||||
// \\\ \\\
|
||||
// \\\ \\\
|
||||
// \\\ \\\
|
||||
// \\\ \\\
|
||||
uURF$##Bv nKWB$%ABc aM@3R@D@b
|
||||
8 M @ O # %
|
||||
% & G U @ @
|
||||
& @ # % % #
|
||||
!HGN@MNCf t&$9#%HQr ?@G#6S@QP
|
||||
""")
|
||||
|
||||
!HGN@MNCf t&$9#%HQr ?@G#6S@QP
|
||||
@@ -0,0 +1,23 @@
|
||||
{"match": "\"Astra\"*|\"Astra Linux\"*|\"astralinux\"*", "color": "1 7"}
|
||||
AA
|
||||
AaaA
|
||||
Aa${c2}/\${c1}aA
|
||||
${c1} Aa${c2}/${c1}aa${c2}\${c1}aA
|
||||
${c1} Aa${c2}/${c1}aAAa${c2}\${c1}aA
|
||||
${c1} aA${c2}/${c1}aaAAaa${c2}\${c1}Aa
|
||||
${c1} aA${c2}/${c1}aaAAAAaa${c2}\${c1}Aa
|
||||
${c1} aaaaaaAAAAa${c2}/${c1}aaAAAAAAaa${c2}\${c1}aAAAAaaaaa
|
||||
${c1}aAAa${c2}-----${c1}aaaaaAAAAAAAAAAaaaaa${c2}-----${c1}aAAa
|
||||
${c1} aAA${c2}\ ${c1}aAAAAAAAAAAAAAAAAAAAAAAa${c2} /${c1}AAa
|
||||
${c1} aAa${c2}\${c1}aAAA${c2}\${c1}AAAA${c2}\${c1}AAAA${c2}\${c1}AAA${c2}\${c1}AAa${c2}/${c1}aAa
|
||||
${c1} aAa${c2}\${c1}aA${c2}\\${c1}AAA${c2}\\${c1}AAA${c2}\\${c1}AA${c2}\\/${c1}aAa
|
||||
${c1} aAA${c2}\${c1}aA${c2}\\${c1}AAA${c2}\\${c1}AAA${c2}\\${c1}Aa${c2}/${c1}AAa
|
||||
${c1} aA${c2}\${c1}aA${c2}\\${c1}AAA${c2}\\${c1}AAA${c2}\\/${c1}Aa
|
||||
${c1} aA${c2}/${c1}AA${c2}\\\${c1}AA${c2}\\\${c1}AA${c2}\\\${c1}Aa
|
||||
${c1} aA${c2}/\${c1}AAa${c2}\\\${c1}Aa${c2}\\\${c1}Aa${c2}\\\${c1}Aa
|
||||
${c1} aA${c2}/\\${c1}AAa${c2}\\/\${c1}a${c2}\\\${c1}Aa${c2}\\${c1}Aa
|
||||
${c1} aA${c2}/${c1}a${c2}\\\${c1}Aa${c2}\/${c1}AA${c2}\\\\\${c1}Aa${c2}\\${c1}Aa
|
||||
${c1} aA${c2}/${c1}aA${c2}\\/${c1}aAa aAa${c2}\\\${c1}Aa${c2}\${c1}Aa
|
||||
${c1} aA${c2}/\${c1}A${c2}\/${c1}Aa aA${c2}\\${c1}A${c2}\\${c1}Aa
|
||||
${c1} A${c2}|/${c1}aaAa aAaa${c2}\|${c1}A
|
||||
${c1} aAaa aaAa
|
||||
@@ -0,0 +1,23 @@
|
||||
{"match": "\"Astra Linux\"*", "color": "160 231", "foreground": [2]}
|
||||
${c1} AA
|
||||
${c1} AaaA
|
||||
${c1} Aa${c2}/\\${c1}aA
|
||||
${c1} Aa${c2}/${c1}aa${c2}\\${c1}aA
|
||||
${c1} Aa${c2}/${c1}aAAa${c2}\\${c1}aA
|
||||
${c1} aA${c2}/${c1}aaAAaa${c2}\\${c1}Aa
|
||||
${c1} aA${c2}/${c1}aaAAAAaa${c2}\\${c1}Aa
|
||||
${c1} aaaaaaAAAAa${c2}/${c1}aaAAAAAAaa${c2}\\${c1}aAAAAaaaaa
|
||||
${c1} aAAa${c2}-----${c1}aaaaaAAAAAAAAAAaaaaa${c2}-----${c1}aAAa
|
||||
${c1} aAA${c2}\ ${c1}aAAAAAAAAAAAAAAAAAAAAAAa${c2} /${c1}AAa
|
||||
${c1} aAa${c2}\\${c1}aAAA${c2}\\${c1}AAAA${c2}\\${c1}AAAA${c2}\\${c1}AAA${c2}\\${c1}AAa${c2}/${c1}aAa
|
||||
${c1} aAa${c2}\\${c1}aA${c2}\\\\${c1}AAA${c2}\\\\${c1}AAA${c2}\\\\${c1}AA${c2}\\\\/${c1}aAa
|
||||
${c1} aAA${c2}\\${c1}aA${c2}\\\\${c1}AAA${c2}\\\\${c1}AAA${c2}\\\\${c1}Aa${c2}/${c1}AAa
|
||||
${c1} aA${c2}\\${c1}aA${c2}\\\\${c1}AAA${c2}\\\\${c1}AAA${c2}\\\\/${c1}Aa
|
||||
${c1} aA${c2}/${c1}AA${c2}\\\\\\${c1}AA${c2}\\\\\\${c1}AA${c2}\\\\\\${c1}Aa
|
||||
${c1} aA${c2}/\\${c1}AAa${c2}\\\\\\${c1}Aa${c2}\\\\\\${c1}Aa${c2}\\\\\\${c1}Aa
|
||||
${c1} aA${c2}/\\\\${c1}AAa${c2}\\\\/\\${c1}a${c2}\\\\\\${c1}Aa${c2}\\\\${c1}Aa
|
||||
${c1} aA${c2}/${c1}a${c2}\\\\\\${c1}Aa${c2}\\/${c1}AA${c2}\\\\\\\\\\${c1}Aa${c2}\\\\${c1}Aa
|
||||
${c1} aA${c2}/${c1}aA${c2}\\\\/${c1}aAa aAa${c2}\\\\\\${c1}Aa${c2}\\${c1}Aa
|
||||
${c1} aA${c2}/\\${c1}A${c2}\\/${c1}Aa aA${c2}\\\\${c1}A${c2}\\\\${c1}Aa
|
||||
${c1} A${c2}|/${c1}aaAa aAaa${c2}\\|${c1}A
|
||||
${c1} aAaa aaAa
|
||||
@@ -1,9 +1,5 @@
|
||||
# This file is automatically generated. Please do not modify.
|
||||
|
||||
from . import AsciiArt
|
||||
|
||||
januslinux = AsciiArt(match=r'''"januslinux"*|"janus"*|"Ataraxia Linux"*|"Ataraxia"*''', color='4 5 6 2', ascii=r"""
|
||||
${c1} 'l:
|
||||
{"match": "\"Ataraxia Linux\"*|\"Ataraxia\"*", "color": "4 5"}
|
||||
'l:
|
||||
loooooo
|
||||
loooo coooool
|
||||
looooooooooooooooooool
|
||||
@@ -27,5 +23,3 @@ ${c1} cooo: ${c2}coooooooooooooooooool
|
||||
:oooool, coool:, looool:,
|
||||
looool: ooooooooooooooo:
|
||||
cooolc .ooooooooooool
|
||||
""")
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user