mirror of
https://github.com/romkatv/powerlevel10k.git
synced 2025-12-04 21:56:46 +01:00
Compare commits
793 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
36f3045d69 | ||
|
|
8fa10f43a0 |
||
|
|
05b11d8b92 | ||
|
|
eb487f836a | ||
|
|
f3b05b4448 | ||
|
|
3e2053a934 |
||
|
|
c85cd0f028 | ||
|
|
33fff66cc6 | ||
|
|
c187964ad3 |
||
|
|
ef83e13c22 | ||
|
|
f2f0149974 |
||
|
|
8a331b8210 | ||
|
|
ed07f45e39 | ||
|
|
5bddd1e731 | ||
|
|
5e26473457 | ||
|
|
67a365b9db |
||
|
|
3483f230a7 |
||
|
|
0996a94118 |
||
|
|
c64a133616 | ||
|
|
140a6ade4e | ||
|
|
087405df78 | ||
|
|
f31d01dbb1 | ||
|
|
edf38f964e |
||
|
|
d71edb83f9 | ||
|
|
00f74aaf75 | ||
|
|
c30068c1f1 | ||
|
|
a42e374e25 | ||
|
|
119e4039ef | ||
|
|
2b7da93df0 | ||
|
|
821b25dc32 | ||
|
|
4a2ef610ef |
||
|
|
df8ed16343 | ||
|
|
bde5ca4c2a |
||
|
|
16e5848426 |
||
|
|
3395c828b2 | ||
|
|
b28d68f44b | ||
|
|
01e3f0b4ba | ||
|
|
808ba80ab0 | ||
|
|
178fcda348 |
||
|
|
bcef7cafdf |
||
|
|
aeff1153d4 | ||
|
|
7c2ce29c3f | ||
|
|
d6a0fed1d9 |
||
|
|
da9b03777c |
||
|
|
45627c528b | ||
|
|
3fe8706d24 | ||
|
|
a7f13e420e | ||
|
|
55c8f74c38 | ||
|
|
50794faba4 | ||
|
|
a3f7dabcae | ||
|
|
93d074a82b | ||
|
|
07a971d310 | ||
|
|
6836bfe2da |
||
|
|
0fdca5b1e6 | ||
|
|
d39e426835 | ||
|
|
0cc19ac2ed | ||
|
|
b973805f01 | ||
|
|
b379cf6225 | ||
|
|
bb16e366c3 | ||
|
|
31d99b694c | ||
|
|
bfbc65e63d | ||
|
|
12e0592ac8 | ||
|
|
9e3418d319 | ||
|
|
17cd9e354a | ||
|
|
8e2a22d80b | ||
|
|
5ef7487648 | ||
|
|
f880e18769 |
||
|
|
665257d059 |
||
|
|
67cedd3edc |
||
|
|
eb8f96f808 |
||
|
|
1aa91f0069 |
||
|
|
5bba4b849b | ||
|
|
ce7c242337 | ||
|
|
34ee1c6bbb |
||
|
|
62341054d8 | ||
|
|
be39c4ea5a | ||
|
|
adc238fa1d | ||
|
|
6f4520cc13 | ||
|
|
307bce24d1 | ||
|
|
35833ea15f | ||
|
|
bd0fa8a08f | ||
|
|
a6fa4e4304 | ||
|
|
ab6a863e23 | ||
|
|
8fefef2285 | ||
|
|
ecf91710c0 | ||
|
|
d774adcb85 | ||
|
|
30ba16ecd8 | ||
|
|
4d7925c983 |
||
|
|
c180a5e040 | ||
|
|
75724ec65e | ||
|
|
9be438f862 |
||
|
|
cda24b72b7 | ||
|
|
f5d5abfe1f | ||
|
|
651033c3df | ||
|
|
d804048efc | ||
|
|
cc6ed4be41 | ||
|
|
dec881651c | ||
|
|
d70eedb345 | ||
|
|
36cce9a088 | ||
|
|
3cc18b5e08 | ||
|
|
44f754d711 |
||
|
|
47b0187a67 | ||
|
|
b9a2d846ef | ||
|
|
7fd76370f5 | ||
|
|
9547f22822 | ||
|
|
c39e5304a1 | ||
|
|
096a731db3 | ||
|
|
783588c17f | ||
|
|
211c90343f | ||
|
|
47d5397baa |
||
|
|
92bee79642 |
||
|
|
174ce9bf01 | ||
|
|
18f0bec1bb | ||
|
|
430616734a | ||
|
|
c7fa7d6748 | ||
|
|
862440ae11 | ||
|
|
873c4ff09c | ||
|
|
215b20e087 | ||
|
|
be4c68fd0a |
||
|
|
f8595a35bf | ||
|
|
011b8469ab |
||
|
|
d8041e4700 | ||
|
|
f04ce05d92 | ||
|
|
9401ed17c0 | ||
|
|
69d726d9fb | ||
|
|
22cb2f79dd | ||
|
|
2d9c1f271b | ||
|
|
717f9a1881 |
||
|
|
f851f41fc1 | ||
|
|
9bb15e9ffb | ||
|
|
ef401ad02a | ||
|
|
a8fa0e2a1b | ||
|
|
68104494a7 | ||
|
|
baf03bf48e | ||
|
|
367c667de6 | ||
|
|
12aa3fa3c4 | ||
|
|
7e9a79f3f1 | ||
|
|
1d96f5e066 | ||
|
|
e8aa8cce7f | ||
|
|
646bae0dd6 | ||
|
|
4cc0ea0081 | ||
|
|
2453fd27e2 |
||
|
|
932954a8b1 | ||
|
|
93d97b7eba | ||
|
|
078497570f | ||
|
|
343d4f44e5 | ||
|
|
0c28fec137 | ||
|
|
4dca4bdfbb | ||
|
|
20323d6f8c | ||
|
|
017395a266 | ||
|
|
ab8bac01e2 |
||
|
|
360dcd3907 | ||
|
|
944f52fc43 | ||
|
|
cc4878aef2 | ||
|
|
c775a3ffd5 | ||
|
|
416bdf1ca3 | ||
|
|
3ecef8c6a5 | ||
|
|
7b19746580 | ||
|
|
e4b8925478 | ||
|
|
79753faacb | ||
|
|
3ce7bac4ff | ||
|
|
9ed51ec315 | ||
|
|
6db5920bb9 | ||
|
|
29c0b25850 | ||
|
|
951d695789 | ||
|
|
6740f08f61 | ||
|
|
8cce84643f | ||
|
|
a69aa22fa8 | ||
|
|
f4a7e6d0e0 | ||
|
|
7bb3f05318 | ||
|
|
9b47a22f13 | ||
|
|
1dcd882593 | ||
|
|
064f4d2209 | ||
|
|
0a9eb73e16 | ||
|
|
016512f493 | ||
|
|
7039779c19 | ||
|
|
4ed8aae324 | ||
|
|
5d16c106ed | ||
|
|
0af598cbed | ||
|
|
ce0bee979b | ||
|
|
dff735c261 | ||
|
|
630c1868df | ||
|
|
bbea8d2d06 | ||
|
|
6f8dec7a76 | ||
|
|
94c4428ddc | ||
|
|
045f006c50 | ||
|
|
c1b5b2c8aa | ||
|
|
954f38d589 |
||
|
|
f27d192eb2 | ||
|
|
bab655fb1f | ||
|
|
fb1287fedb | ||
|
|
1cff22491b | ||
|
|
b474978b2e | ||
|
|
8167383665 | ||
|
|
d031df752b | ||
|
|
6314edf35c | ||
|
|
6c82236d6f | ||
|
|
6b50e0918b | ||
|
|
ec1702caf1 | ||
|
|
f02b8d365b | ||
|
|
614a6ed1ca | ||
|
|
cb9788b12a | ||
|
|
7f30a32ee6 | ||
|
|
e2c4e6673f | ||
|
|
2aa16c5431 | ||
|
|
373337123c | ||
|
|
a30145b0f8 | ||
|
|
e7b2bb2372 | ||
|
|
e9e94a503a | ||
|
|
0adbc1415b | ||
|
|
f03d917fb0 | ||
|
|
21e89cb61d | ||
|
|
b165fec0ed | ||
|
|
d1b89dd381 | ||
|
|
a066b55f85 | ||
|
|
1a4b01c232 | ||
|
|
35165798a8 | ||
|
|
33916e91a7 | ||
|
|
c08975d0f6 | ||
|
|
07b5a607d4 |
||
|
|
7f2950f9cc | ||
|
|
a7bf4c83de | ||
|
|
edafcb5a7d | ||
|
|
9f0751c2e3 | ||
|
|
45758d95fb | ||
|
|
6609767abd | ||
|
|
8d47270e8c | ||
|
|
176f781121 | ||
|
|
cf83ab21e4 | ||
|
|
54798e0c18 | ||
|
|
d5123401be |
||
|
|
bc5983543a | ||
|
|
5691a418e0 | ||
|
|
8c55eb4fa3 | ||
|
|
5a3109e40d | ||
|
|
f68197a3aa | ||
|
|
b8c6c6f42f |
||
|
|
8091c8a3a8 | ||
|
|
e4a94a8ae0 | ||
|
|
ed1b02efd5 | ||
|
|
cd47894197 | ||
|
|
bd0c9f4ec7 | ||
|
|
f89b54faf2 | ||
|
|
02290d1eb9 | ||
|
|
3e952468aa |
||
|
|
efffc87cf5 |
||
|
|
5ee784787f | ||
|
|
cf1b586515 | ||
|
|
843dcf0167 | ||
|
|
957249a95c | ||
|
|
4bbb198a60 | ||
|
|
b4a5379be8 | ||
|
|
5ca97df8fe | ||
|
|
18f939d344 | ||
|
|
3bfbb8294f | ||
|
|
cbca1bd8c1 | ||
|
|
534ace8773 | ||
|
|
5d223b8351 |
||
|
|
0493886837 | ||
|
|
f9fd384d8d | ||
|
|
4a60348e07 | ||
|
|
abc318b608 |
||
|
|
e72264e01c | ||
|
|
fd5fa09504 | ||
|
|
7704f6b877 | ||
|
|
64c5f10379 | ||
|
|
2dd6a29e4d | ||
|
|
71e4e3288d | ||
|
|
be3724bc80 | ||
|
|
487a388dbd | ||
|
|
c1c827e21d | ||
|
|
9a3c2f48a4 | ||
|
|
cb82b1f5d9 | ||
|
|
cf67cad465 | ||
|
|
0c197ed4a5 | ||
|
|
0bef490cda | ||
|
|
3ed9c1bce1 | ||
|
|
19bcd37935 |
||
|
|
6b128d48d6 | ||
|
|
89ecd6539a | ||
|
|
5c7ad753a2 | ||
|
|
a3f6859a8d | ||
|
|
cf9a1fd02d | ||
|
|
74ff02a819 | ||
|
|
406e6aa9e4 | ||
|
|
d03058819d | ||
|
|
ff531e5f2c | ||
|
|
0b02654269 | ||
|
|
657e184e0d | ||
|
|
65599411ec | ||
|
|
e13283ec7d | ||
|
|
f07d7baea3 | ||
|
|
73698935b8 | ||
|
|
40a5cdfa6c |
||
|
|
b898d1de15 |
||
|
|
59e90bd8b0 | ||
|
|
01467fae4f | ||
|
|
c0a028351f | ||
|
|
123136c0e7 | ||
|
|
5fe28f0a01 | ||
|
|
4b21cd06ff | ||
|
|
a83e53005f | ||
|
|
c5203a3da2 | ||
|
|
8a676a9157 | ||
|
|
bee6e09262 | ||
|
|
4f143b7b97 | ||
|
|
d6f8c47761 | ||
|
|
5014de0541 | ||
|
|
cead0349c5 | ||
|
|
6c71862c5f | ||
|
|
9e0ef918db | ||
|
|
02710eb568 | ||
|
|
e511c36ec6 |
||
|
|
3d994b033b | ||
|
|
0f8a77d47d | ||
|
|
161f4c1f04 | ||
|
|
b8ddcd4c17 | ||
|
|
c4d3ab0ae0 | ||
|
|
69909a7a1f |
||
|
|
fdbde52c20 | ||
|
|
6fae3a169b | ||
|
|
683a485232 | ||
|
|
e1c52e08d4 | ||
|
|
fba50d9671 | ||
|
|
66c0181f76 | ||
|
|
67ac98d515 | ||
|
|
c8160f2954 | ||
|
|
2079d8ecbe | ||
|
|
3d3b24c419 | ||
|
|
7354688123 | ||
|
|
dd3dcfaf51 | ||
|
|
ced7788012 | ||
|
|
ab321a2a03 | ||
|
|
d99df7d12d | ||
|
|
0d6202c077 | ||
|
|
ed70c90c2d | ||
|
|
c9bc2f5a32 | ||
|
|
2e58e3888e | ||
|
|
cde05cfa7b | ||
|
|
00dd4ae009 | ||
|
|
370535af45 | ||
|
|
da5a4cdbec | ||
|
|
83f773caae | ||
|
|
356ce68f69 | ||
|
|
6692245f3e | ||
|
|
09ece9601f | ||
|
|
608bd2c88b | ||
|
|
469baa6221 | ||
|
|
57d0274b88 | ||
|
|
2e8a8f1d63 | ||
|
|
a23c4314a1 | ||
|
|
4543076483 | ||
|
|
3091ffbd86 | ||
|
|
fde8bf62d4 | ||
|
|
abc5df446d | ||
|
|
e181bc0653 | ||
|
|
3380f7503e | ||
|
|
a9f208c8fc | ||
|
|
6520323fdb | ||
|
|
e2447322e0 | ||
|
|
d281e595b3 | ||
|
|
a55955c5cf | ||
|
|
dce00cdb5d | ||
|
|
85e31542dd | ||
|
|
99edd12e00 | ||
|
|
faddef4a22 | ||
|
|
b4615f5e00 | ||
|
|
ed0bd29416 | ||
|
|
1af6385436 | ||
|
|
6441a01dd3 | ||
|
|
edd98053cc | ||
|
|
5acedce0b0 | ||
|
|
3e515a75d2 | ||
|
|
ed45177e19 | ||
|
|
0ce9df66d2 |
||
|
|
7a72acf563 | ||
|
|
fcfeebfb53 | ||
|
|
0122a63834 |
||
|
|
543e2d59cf | ||
|
|
0745592886 | ||
|
|
20eb8c64bf | ||
|
|
d2f78d4b29 | ||
|
|
4f3d2ffe72 | ||
|
|
c5c9178341 | ||
|
|
c2c3171927 | ||
|
|
b5f4d27c74 | ||
|
|
2c7241c43d | ||
|
|
b3b0efb69f | ||
|
|
10ad57cc6b | ||
|
|
e362b69735 | ||
|
|
0a1946b965 | ||
|
|
379b97e4e7 |
||
|
|
277ff8b414 |
||
|
|
80ec734a95 | ||
|
|
ec44300155 | ||
|
|
25e5f5985f | ||
|
|
5669c12c66 | ||
|
|
e7629449c6 | ||
|
|
ce7d4a4cd3 | ||
|
|
6aeb13b08a | ||
|
|
20b87731de | ||
|
|
32e76e7721 |
||
|
|
46a3e51896 |
||
|
|
799c22f63b | ||
|
|
8f798f986a | ||
|
|
e3c8529052 | ||
|
|
c23f3c3c10 |
||
|
|
5e1c1caeb1 | ||
|
|
70ae5810d8 | ||
|
|
a38a1f5be1 | ||
|
|
83d80fa308 | ||
|
|
2c135dd631 | ||
|
|
942c4cf640 | ||
|
|
dae5f7f1c9 | ||
|
|
9f98915167 | ||
|
|
f717a91f55 | ||
|
|
1e7be00e04 |
||
|
|
4bcc519547 | ||
|
|
077abf95e0 | ||
|
|
05d71fe82c | ||
|
|
63a009669a | ||
|
|
7f4a2741b5 | ||
|
|
7759063b74 | ||
|
|
f4668bc194 | ||
|
|
3213e2e17f | ||
|
|
fd7313a5e7 | ||
|
|
0c862a1307 | ||
|
|
f1ff680487 | ||
|
|
73eff3a033 | ||
|
|
c003c253e8 | ||
|
|
515422c727 | ||
|
|
67f494cf54 | ||
|
|
606d4a85a9 | ||
|
|
717573d845 | ||
|
|
a49f90d3ba | ||
|
|
4e4c14927f | ||
|
|
2e0989c018 | ||
|
|
038de6f78b | ||
|
|
f5d61840ae | ||
|
|
96f3ca1733 | ||
|
|
4ba3c010f6 | ||
|
|
b9c62ca028 | ||
|
|
ba83466e1d | ||
|
|
f217e4a39a | ||
|
|
77fa0e6dcc | ||
|
|
d87d557b0f |
||
|
|
c7ad00b5a5 | ||
|
|
10918387b3 | ||
|
|
aa4d366341 | ||
|
|
35acee119d |
||
|
|
c59720647a | ||
|
|
a3494a52d7 | ||
|
|
f774df6c76 | ||
|
|
69d3650958 | ||
|
|
1ad8e5759e | ||
|
|
4d2346da0a | ||
|
|
0ab7e1ccfd | ||
|
|
9c034101fe |
||
|
|
f924646194 | ||
|
|
8d1daa4e63 | ||
|
|
b69bb45ab1 | ||
|
|
48ff2e8065 | ||
|
|
836332f578 |
||
|
|
607befe822 | ||
|
|
cd865da150 | ||
|
|
b55ad16bdf | ||
|
|
30bd9461b3 | ||
|
|
8dc91004cb |
||
|
|
8b2aab74d4 |
||
|
|
4d15cf977e |
||
|
|
af86b53047 |
||
|
|
eafd78c3e0 | ||
|
|
d3de2e558c |
||
|
|
58f5470cd9 |
||
|
|
7d786b9c50 | ||
|
|
d28e84ca70 | ||
|
|
6d545d5dd0 |
||
|
|
3920940ea8 |
||
|
|
6a7115b35b |
||
|
|
b816abfed0 | ||
|
|
d26bdcd601 |
||
|
|
7b0698debf |
||
|
|
68abcc86d4 |
||
|
|
00232d1b6d | ||
|
|
a2695675e6 | ||
|
|
a20dcd0284 | ||
|
|
4fa8943960 | ||
|
|
f0af094382 | ||
|
|
eadc0d7653 | ||
|
|
33f20f5eae |
||
|
|
a43748d427 |
||
|
|
8bafd1a2ee |
||
|
|
ea97f031b4 |
||
|
|
29f16b61e6 |
||
|
|
d524164020 | ||
|
|
0513e0fee4 | ||
|
|
59db4252bb | ||
|
|
dd62469cc7 | ||
|
|
61c63eea6b |
||
|
|
5ea5d4bc19 | ||
|
|
9609a835ca | ||
|
|
9c3ecab81e | ||
|
|
033e01a272 | ||
|
|
38a5492b5f |
||
|
|
a5d0525c6a | ||
|
|
4807bd8da2 | ||
|
|
7a6eef4918 | ||
|
|
b9b3399b35 | ||
|
|
fc854fa719 | ||
|
|
e8afa806ce | ||
|
|
c14fe96b7c |
||
|
|
439ce3ed4e | ||
|
|
1d99a0bac3 | ||
|
|
b90b36251d | ||
|
|
2c3bcd8b5d | ||
|
|
c7914c051d | ||
|
|
96646e8b9c | ||
|
|
ecf1de25a4 |
||
|
|
ff79e502ad | ||
|
|
29759b7b0a | ||
|
|
bc3158cba5 | ||
|
|
a7f417245d | ||
|
|
9d6444a557 | ||
|
|
622069e60f | ||
|
|
381bd09e67 | ||
|
|
4050729e48 | ||
|
|
7cb7ee07be | ||
|
|
ade5b86226 | ||
|
|
e1e50dc84c | ||
|
|
8db9836617 |
||
|
|
98a8ec6f31 | ||
|
|
685682da90 | ||
|
|
507018f079 | ||
|
|
fb89173a42 | ||
|
|
7e363af9ed | ||
|
|
98b96e06cc | ||
|
|
6b254621e7 | ||
|
|
139413f535 | ||
|
|
39cf063480 | ||
|
|
21df7db2b2 | ||
|
|
31ede3c1d3 |
||
|
|
28301be914 | ||
|
|
04f75a10a5 | ||
|
|
790f4719ab | ||
|
|
ece7213a3d | ||
|
|
b7167a64c6 | ||
|
|
bf830b5bf1 | ||
|
|
7969eb3f18 | ||
|
|
09be56bb53 | ||
|
|
f8ae544e6e | ||
|
|
8488f7c75c | ||
|
|
feaf120ddc | ||
|
|
8840fe550e | ||
|
|
271836403d | ||
|
|
e2db860745 | ||
|
|
f6c24d2053 | ||
|
|
2fc7257486 | ||
|
|
d7861fcfa0 | ||
|
|
5e2422df50 | ||
|
|
76e5a69262 | ||
|
|
85f9e75918 | ||
|
|
aa6d40b733 | ||
|
|
b9be4f968b |
||
|
|
2ea3356d66 | ||
|
|
8f0db0c95a | ||
|
|
74c6e18363 | ||
|
|
49d5617989 | ||
|
|
78301e82c7 | ||
|
|
98494aaf7b |
||
|
|
d86bbe75de | ||
|
|
68c89ec2bc | ||
|
|
de0e022177 | ||
|
|
f0159ca642 | ||
|
|
fdc0ee3708 | ||
|
|
2bcf38f554 | ||
|
|
47713ea2df | ||
|
|
e43209409b |
||
|
|
b1aeeda6a8 | ||
|
|
a124a71032 | ||
|
|
fb2805e5ab | ||
|
|
967e845819 | ||
|
|
b770e6a3e5 | ||
|
|
0da94e8ef1 | ||
|
|
9b981b89c5 | ||
|
|
3aec0c6b36 | ||
|
|
060af91a80 | ||
|
|
2875595647 | ||
|
|
42aa719e48 | ||
|
|
3586cc8d7e | ||
|
|
71b39f0da9 | ||
|
|
80d9e57388 | ||
|
|
3b772824c0 | ||
|
|
f14b58e44f | ||
|
|
4d1fba340f | ||
|
|
760f7cb7a5 | ||
|
|
afb854d279 | ||
|
|
54d40b924c | ||
|
|
12cef82077 |
||
|
|
622130980c | ||
|
|
6c8c6eea1b | ||
|
|
3b2f474c9f | ||
|
|
47c842fe8e | ||
|
|
cababbeee2 | ||
|
|
dd5948e5e3 | ||
|
|
536d90a335 | ||
|
|
a3727dcaef | ||
|
|
c1db3926fe | ||
|
|
b673e6a7dd | ||
|
|
f2bf019758 | ||
|
|
2a4c962c21 | ||
|
|
7eb501c0f5 | ||
|
|
6853fcd8e5 | ||
|
|
c464fd25e6 | ||
|
|
16cb58d15f | ||
|
|
6279aa57d7 | ||
|
|
2f4c3c4cec | ||
|
|
d62961131c |
||
|
|
8f90ed6d49 | ||
|
|
dca8774f1b | ||
|
|
711490252e | ||
|
|
525e2545db | ||
|
|
c425a5e635 | ||
|
|
03ab8e9c7e | ||
|
|
f63d6a31c1 | ||
|
|
ebfaae2ab6 | ||
|
|
7a0bf995c7 | ||
|
|
b53b43533a | ||
|
|
d5d6ee11ff |
||
|
|
c48b81ecb7 | ||
|
|
03e61879b5 | ||
|
|
cb59280c40 | ||
|
|
422b7a94b9 | ||
|
|
05ff662568 | ||
|
|
598ff99f1b | ||
|
|
2ba87f4d1f | ||
|
|
15818346bf | ||
|
|
88d5fb6145 | ||
|
|
7a114ad6fb | ||
|
|
86b747f434 | ||
|
|
24278ccd39 | ||
|
|
bf2aa14bec | ||
|
|
6dfd92f8c1 | ||
|
|
620e69fef1 | ||
|
|
4635fcacee | ||
|
|
a28d45005e | ||
|
|
cfc35853df | ||
|
|
d0edcbc966 |
||
|
|
34952e4a85 |
||
|
|
6c9d0977a6 | ||
|
|
0c341b6702 | ||
|
|
06ed564092 | ||
|
|
2d74ac9d06 | ||
|
|
ff8654ccd5 | ||
|
|
9486385824 | ||
|
|
882cede0ae | ||
|
|
e0ed693e6d | ||
|
|
be66f21f53 | ||
|
|
a88e11f54b | ||
|
|
db6f909958 | ||
|
|
ae32fd58b3 | ||
|
|
6a1e993a05 | ||
|
|
eadfdba707 | ||
|
|
1be10ebcf7 | ||
|
|
d394a4e038 |
||
|
|
178c3bccf0 |
||
|
|
8854cb6000 | ||
|
|
eda706c8ff | ||
|
|
54bbe0a0a3 | ||
|
|
0717e57ff4 | ||
|
|
5e5d3f5aff | ||
|
|
4c15d633dd | ||
|
|
3e17260622 | ||
|
|
b015817892 | ||
|
|
4d14f9e0ba | ||
|
|
faa510d54c | ||
|
|
a43b1b34d8 | ||
|
|
e2196ce32e | ||
|
|
05eaf8162c | ||
|
|
fb5a0a6cca | ||
|
|
fa2e337cbd | ||
|
|
b7d90c8467 | ||
|
|
e3f582f246 | ||
|
|
c6e599ddd5 | ||
|
|
a700031279 | ||
|
|
a3c1b7164b | ||
|
|
00cf3b1167 | ||
|
|
d75147503e | ||
|
|
6e120b9eec | ||
|
|
b93f9663c5 | ||
|
|
bf88ce9120 | ||
|
|
54c9822834 | ||
|
|
ed9d5a7088 | ||
|
|
05dad31f3f | ||
|
|
b2be33d556 | ||
|
|
04656da7c1 | ||
|
|
50dec9f9f5 | ||
|
|
7760aa66d7 | ||
|
|
9fd719c834 | ||
|
|
2ba6182373 | ||
|
|
f82d0de0d3 | ||
|
|
2b1d0e599c | ||
|
|
62c0a12a10 | ||
|
|
537c2b04e1 | ||
|
|
55a9f366a8 | ||
|
|
801bfbb294 | ||
|
|
285bf7ba60 | ||
|
|
189ecf8e16 | ||
|
|
094d1b3a47 | ||
|
|
127737816a | ||
|
|
a4a71cff9e | ||
|
|
a3d887cd43 | ||
|
|
f3fb34dd99 | ||
|
|
d8d6efc4ec | ||
|
|
c9e3cfe5db | ||
|
|
937204640a | ||
|
|
86d980cdb5 | ||
|
|
b38a7bf4af | ||
|
|
102aefadab | ||
|
|
ee68d4db4b | ||
|
|
b3875f5193 | ||
|
|
ad18cd78db | ||
|
|
4cd2700a85 | ||
|
|
7d35c7ebb8 | ||
|
|
6696212dde | ||
|
|
90df734bf8 | ||
|
|
ba6c79e277 | ||
|
|
9a4bbcd930 | ||
|
|
619ddaf6f1 | ||
|
|
2ade5d786b | ||
|
|
ed3287b737 | ||
|
|
5e9a4eb072 | ||
|
|
644488afcc | ||
|
|
45eeb08fc3 | ||
|
|
a963533cbd | ||
|
|
be83ec430c | ||
|
|
6b69030bfb | ||
|
|
ee44f9e112 | ||
|
|
936b0d6dea | ||
|
|
c713ded9e7 | ||
|
|
499de79a2b | ||
|
|
8cfe934f15 | ||
|
|
fb0dc597fa | ||
|
|
519de2c569 | ||
|
|
8e86b0c8d4 | ||
|
|
00cfdb48a8 | ||
|
|
072fc38ebe | ||
|
|
646a826440 | ||
|
|
fb9bc2d3f5 | ||
|
|
f3ae4032c1 | ||
|
|
1e2a0cc34a | ||
|
|
debacbf530 |
||
|
|
e3beeea0ae | ||
|
|
c0ff47bea5 | ||
|
|
be5c067125 | ||
|
|
5d1bfe8ed7 | ||
|
|
5e932c225e | ||
|
|
c0091537a9 | ||
|
|
6998d06a91 | ||
|
|
f96c1eb5e5 | ||
|
|
00d2cc7237 | ||
|
|
fdac99c57c | ||
|
|
48c6ff4701 | ||
|
|
6c83ace41c | ||
|
|
b62a164998 | ||
|
|
af0b387182 | ||
|
|
ff18dbaf74 | ||
|
|
bf0255931b | ||
|
|
9f33d6567b | ||
|
|
d9b90027ba | ||
|
|
2841cecaa9 | ||
|
|
3ddb8025d5 | ||
|
|
accbe293cb | ||
|
|
574754eaf6 | ||
|
|
7e6abbb891 | ||
|
|
6f5e834b8e | ||
|
|
46c76dd707 | ||
|
|
1f8bd78e3a | ||
|
|
d0f6cd0b50 | ||
|
|
a6009c74a9 | ||
|
|
e7f0bac67d | ||
|
|
d23b2c3792 | ||
|
|
71f5f42997 | ||
|
|
16b44fd9da | ||
|
|
d075b5a5cb | ||
|
|
bda74564e3 | ||
|
|
f43d8b9e0e | ||
|
|
1db7094966 | ||
|
|
e27a8fbcbf | ||
|
|
d047ed87a1 | ||
|
|
1a976f989a | ||
|
|
bc85e46f8b | ||
|
|
75bbc4439f | ||
|
|
b305649e53 |
39 changed files with 6293 additions and 2425 deletions
14
Makefile
Normal file
14
Makefile
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
ZSH := $(shell command -v zsh 2> /dev/null)
|
||||||
|
|
||||||
|
all:
|
||||||
|
|
||||||
|
zwc:
|
||||||
|
$(MAKE) -C gitstatus zwc
|
||||||
|
$(or $(ZSH),:) -fc 'for f in *.zsh-theme internal/*.zsh; do zcompile -R -- $$f.zwc $$f || exit; done'
|
||||||
|
|
||||||
|
minify:
|
||||||
|
$(MAKE) -C gitstatus minify
|
||||||
|
rm -rf -- .git .gitattributes .gitignore LICENSE Makefile README.md font.md powerlevel10k.png
|
||||||
|
|
||||||
|
pkg: zwc
|
||||||
|
$(MAKE) -C gitstatus pkg
|
||||||
|
|
@ -17,10 +17,10 @@
|
||||||
|
|
||||||
# Unset all configuration options. This allows you to apply configuration changes without
|
# Unset all configuration options. This allows you to apply configuration changes without
|
||||||
# restarting zsh. Edit ~/.p10k.zsh and type `source ~/.p10k.zsh`.
|
# restarting zsh. Edit ~/.p10k.zsh and type `source ~/.p10k.zsh`.
|
||||||
unset -m 'POWERLEVEL9K_*|DEFAULT_USER'
|
unset -m '(POWERLEVEL9K_*|DEFAULT_USER)~POWERLEVEL9K_GITSTATUS_DIR'
|
||||||
|
|
||||||
# Zsh >= 5.1 is required.
|
# Zsh >= 5.1 is required.
|
||||||
autoload -Uz is-at-least && is-at-least 5.1 || return
|
[[ $ZSH_VERSION == (5.<1->*|<6->.*) ]] || return
|
||||||
|
|
||||||
# The list of segments shown on the left. Fill it with the most important segments.
|
# The list of segments shown on the left. Fill it with the most important segments.
|
||||||
typeset -g POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(
|
typeset -g POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(
|
||||||
|
|
@ -65,22 +65,30 @@
|
||||||
luaenv # lua version from luaenv (https://github.com/cehoffman/luaenv)
|
luaenv # lua version from luaenv (https://github.com/cehoffman/luaenv)
|
||||||
jenv # java version from jenv (https://github.com/jenv/jenv)
|
jenv # java version from jenv (https://github.com/jenv/jenv)
|
||||||
plenv # perl version from plenv (https://github.com/tokuhirom/plenv)
|
plenv # perl version from plenv (https://github.com/tokuhirom/plenv)
|
||||||
|
perlbrew # perl version from perlbrew (https://github.com/gugod/App-perlbrew)
|
||||||
phpenv # php version from phpenv (https://github.com/phpenv/phpenv)
|
phpenv # php version from phpenv (https://github.com/phpenv/phpenv)
|
||||||
|
scalaenv # scala version from scalaenv (https://github.com/scalaenv/scalaenv)
|
||||||
haskell_stack # haskell version from stack (https://haskellstack.org/)
|
haskell_stack # haskell version from stack (https://haskellstack.org/)
|
||||||
kubecontext # current kubernetes context (https://kubernetes.io/)
|
kubecontext # current kubernetes context (https://kubernetes.io/)
|
||||||
terraform # terraform workspace (https://www.terraform.io)
|
terraform # terraform workspace (https://www.terraform.io)
|
||||||
|
# terraform_version # terraform version (https://www.terraform.io)
|
||||||
aws # aws profile (https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html)
|
aws # aws profile (https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html)
|
||||||
aws_eb_env # aws elastic beanstalk environment (https://aws.amazon.com/elasticbeanstalk/)
|
aws_eb_env # aws elastic beanstalk environment (https://aws.amazon.com/elasticbeanstalk/)
|
||||||
azure # azure account name (https://docs.microsoft.com/en-us/cli/azure)
|
azure # azure account name (https://docs.microsoft.com/en-us/cli/azure)
|
||||||
gcloud # google cloud cli account and project (https://cloud.google.com/)
|
gcloud # google cloud cli account and project (https://cloud.google.com/)
|
||||||
google_app_cred # google application credentials (https://cloud.google.com/docs/authentication/production)
|
google_app_cred # google application credentials (https://cloud.google.com/docs/authentication/production)
|
||||||
|
toolbox # toolbox name (https://github.com/containers/toolbox)
|
||||||
context # user@hostname
|
context # user@hostname
|
||||||
nordvpn # nordvpn connection status, linux only (https://nordvpn.com/)
|
nordvpn # nordvpn connection status, linux only (https://nordvpn.com/)
|
||||||
ranger # ranger shell (https://github.com/ranger/ranger)
|
ranger # ranger shell (https://github.com/ranger/ranger)
|
||||||
|
yazi # yazi shell (https://github.com/sxyazi/yazi)
|
||||||
nnn # nnn shell (https://github.com/jarun/nnn)
|
nnn # nnn shell (https://github.com/jarun/nnn)
|
||||||
|
lf # lf shell (https://github.com/gokcehan/lf)
|
||||||
|
xplr # xplr shell (https://github.com/sayanarijit/xplr)
|
||||||
vim_shell # vim shell indicator (:sh)
|
vim_shell # vim shell indicator (:sh)
|
||||||
midnight_commander # midnight commander shell (https://midnight-commander.org/)
|
midnight_commander # midnight commander shell (https://midnight-commander.org/)
|
||||||
nix_shell # nix shell (https://nixos.org/nixos/nix-pills/developing-with-nix-shell.html)
|
nix_shell # nix shell (https://nixos.org/nixos/nix-pills/developing-with-nix-shell.html)
|
||||||
|
chezmoi_shell # chezmoi shell (https://www.chezmoi.io/)
|
||||||
# vi_mode # vi mode (you don't need this if you've enabled prompt_char)
|
# vi_mode # vi mode (you don't need this if you've enabled prompt_char)
|
||||||
# vpn_ip # virtual private network indicator
|
# vpn_ip # virtual private network indicator
|
||||||
# load # CPU load
|
# load # CPU load
|
||||||
|
|
@ -90,6 +98,8 @@
|
||||||
todo # todo items (https://github.com/todotxt/todo.txt-cli)
|
todo # todo items (https://github.com/todotxt/todo.txt-cli)
|
||||||
timewarrior # timewarrior tracking status (https://timewarrior.net/)
|
timewarrior # timewarrior tracking status (https://timewarrior.net/)
|
||||||
taskwarrior # taskwarrior task count (https://taskwarrior.org/)
|
taskwarrior # taskwarrior task count (https://taskwarrior.org/)
|
||||||
|
per_directory_history # Oh My Zsh per-directory-history local/global indicator
|
||||||
|
# cpu_arch # CPU architecture
|
||||||
# time # current time
|
# time # current time
|
||||||
# =========================[ Line #2 ]=========================
|
# =========================[ Line #2 ]=========================
|
||||||
newline # \n
|
newline # \n
|
||||||
|
|
@ -136,7 +146,7 @@
|
||||||
# Filler between left and right prompt on the first prompt line. You can set it to ' ', '·' or
|
# Filler between left and right prompt on the first prompt line. You can set it to ' ', '·' or
|
||||||
# '─'. The last two make it easier to see the alignment between left and right prompt and to
|
# '─'. The last two make it easier to see the alignment between left and right prompt and to
|
||||||
# separate prompt from command output. You might want to set POWERLEVEL9K_PROMPT_ADD_NEWLINE=false
|
# separate prompt from command output. You might want to set POWERLEVEL9K_PROMPT_ADD_NEWLINE=false
|
||||||
# for more compact prompt if using using this option.
|
# for more compact prompt if using this option.
|
||||||
typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_CHAR=' '
|
typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_CHAR=' '
|
||||||
typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_BACKGROUND=
|
typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_BACKGROUND=
|
||||||
typeset -g POWERLEVEL9K_MULTILINE_NEWLINE_PROMPT_GAP_BACKGROUND=
|
typeset -g POWERLEVEL9K_MULTILINE_NEWLINE_PROMPT_GAP_BACKGROUND=
|
||||||
|
|
@ -161,6 +171,9 @@
|
||||||
typeset -g POWERLEVEL9K_LEFT_SEGMENT_SEPARATOR='\uE0B0'
|
typeset -g POWERLEVEL9K_LEFT_SEGMENT_SEPARATOR='\uE0B0'
|
||||||
# Separator between different-color segments on the right.
|
# Separator between different-color segments on the right.
|
||||||
typeset -g POWERLEVEL9K_RIGHT_SEGMENT_SEPARATOR='\uE0B2'
|
typeset -g POWERLEVEL9K_RIGHT_SEGMENT_SEPARATOR='\uE0B2'
|
||||||
|
# To remove a separator between two segments, add "_joined" to the second segment name.
|
||||||
|
# For example: POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(os_icon context_joined)
|
||||||
|
|
||||||
# The right end of left prompt.
|
# The right end of left prompt.
|
||||||
typeset -g POWERLEVEL9K_LEFT_PROMPT_LAST_SEGMENT_END_SYMBOL='\uE0B0'
|
typeset -g POWERLEVEL9K_LEFT_PROMPT_LAST_SEGMENT_END_SYMBOL='\uE0B0'
|
||||||
# The left end of right prompt.
|
# The left end of right prompt.
|
||||||
|
|
@ -190,7 +203,7 @@
|
||||||
# Prompt symbol in command vi mode.
|
# Prompt symbol in command vi mode.
|
||||||
typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VICMD_CONTENT_EXPANSION='❮'
|
typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VICMD_CONTENT_EXPANSION='❮'
|
||||||
# Prompt symbol in visual vi mode.
|
# Prompt symbol in visual vi mode.
|
||||||
typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIVIS_CONTENT_EXPANSION='Ⅴ'
|
typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIVIS_CONTENT_EXPANSION='V'
|
||||||
# Prompt symbol in overwrite vi mode.
|
# Prompt symbol in overwrite vi mode.
|
||||||
typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIOWR_CONTENT_EXPANSION='▶'
|
typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIOWR_CONTENT_EXPANSION='▶'
|
||||||
typeset -g POWERLEVEL9K_PROMPT_CHAR_OVERWRITE_STATE=true
|
typeset -g POWERLEVEL9K_PROMPT_CHAR_OVERWRITE_STATE=true
|
||||||
|
|
@ -230,7 +243,8 @@
|
||||||
.java-version
|
.java-version
|
||||||
.perl-version
|
.perl-version
|
||||||
.php-version
|
.php-version
|
||||||
.tool-version
|
.tool-versions
|
||||||
|
.mise.toml
|
||||||
.shorten_folder_marker
|
.shorten_folder_marker
|
||||||
.svn
|
.svn
|
||||||
.terraform
|
.terraform
|
||||||
|
|
@ -247,6 +261,11 @@
|
||||||
# /foo/bar/git_repo/nested_git_repo/baz, prompt will display git_repo/nested_git_repo/baz (first)
|
# /foo/bar/git_repo/nested_git_repo/baz, prompt will display git_repo/nested_git_repo/baz (first)
|
||||||
# or nested_git_repo/baz (last). This assumes that git_repo and nested_git_repo contain markers
|
# or nested_git_repo/baz (last). This assumes that git_repo and nested_git_repo contain markers
|
||||||
# and other directories don't.
|
# and other directories don't.
|
||||||
|
#
|
||||||
|
# Optionally, "first" and "last" can be followed by ":<offset>" where <offset> is an integer.
|
||||||
|
# This moves the truncation point to the right (positive offset) or to the left (negative offset)
|
||||||
|
# relative to the marker. Plain "first" and "last" are equivalent to "first:0" and "last:0"
|
||||||
|
# respectively.
|
||||||
typeset -g POWERLEVEL9K_DIR_TRUNCATE_BEFORE_MARKER=false
|
typeset -g POWERLEVEL9K_DIR_TRUNCATE_BEFORE_MARKER=false
|
||||||
# Don't shorten this many last directory segments. They are anchors.
|
# Don't shorten this many last directory segments. They are anchors.
|
||||||
typeset -g POWERLEVEL9K_SHORTEN_DIR_LENGTH=1
|
typeset -g POWERLEVEL9K_SHORTEN_DIR_LENGTH=1
|
||||||
|
|
@ -268,12 +287,12 @@
|
||||||
# the full directory that was used in previous commands.
|
# the full directory that was used in previous commands.
|
||||||
typeset -g POWERLEVEL9K_DIR_HYPERLINK=false
|
typeset -g POWERLEVEL9K_DIR_HYPERLINK=false
|
||||||
|
|
||||||
# Enable special styling for non-writable directories. See POWERLEVEL9K_LOCK_ICON and
|
# Enable special styling for non-writable and non-existent directories. See POWERLEVEL9K_LOCK_ICON
|
||||||
# POWERLEVEL9K_DIR_CLASSES below.
|
# and POWERLEVEL9K_DIR_CLASSES below.
|
||||||
typeset -g POWERLEVEL9K_DIR_SHOW_WRITABLE=v2
|
typeset -g POWERLEVEL9K_DIR_SHOW_WRITABLE=v3
|
||||||
|
|
||||||
# The default icon shown next to non-writable directories when POWERLEVEL9K_DIR_SHOW_WRITABLE is
|
# The default icon shown next to non-writable and non-existent directories when
|
||||||
# set to v2.
|
# POWERLEVEL9K_DIR_SHOW_WRITABLE is set to v3.
|
||||||
# typeset -g POWERLEVEL9K_LOCK_ICON='⭐'
|
# typeset -g POWERLEVEL9K_LOCK_ICON='⭐'
|
||||||
|
|
||||||
# POWERLEVEL9K_DIR_CLASSES allows you to specify custom icons and colors for different
|
# POWERLEVEL9K_DIR_CLASSES allows you to specify custom icons and colors for different
|
||||||
|
|
@ -286,8 +305,8 @@
|
||||||
#
|
#
|
||||||
# Triplets are tried in order. The first triplet whose pattern matches $PWD wins.
|
# Triplets are tried in order. The first triplet whose pattern matches $PWD wins.
|
||||||
#
|
#
|
||||||
# If POWERLEVEL9K_DIR_SHOW_WRITABLE is set to v2 and the current directory is not writable,
|
# If POWERLEVEL9K_DIR_SHOW_WRITABLE is set to v3, non-writable and non-existent directories
|
||||||
# its class gets suffix _NOT_WRITABLE.
|
# acquire class suffix _NOT_WRITABLE and NON_EXISTENT respectively.
|
||||||
#
|
#
|
||||||
# For example, given these settings:
|
# For example, given these settings:
|
||||||
#
|
#
|
||||||
|
|
@ -296,10 +315,11 @@
|
||||||
# '~(|/*)' HOME ''
|
# '~(|/*)' HOME ''
|
||||||
# '*' DEFAULT '')
|
# '*' DEFAULT '')
|
||||||
#
|
#
|
||||||
# Whenever the current directory is ~/work or a subdirectory of ~/work, it gets styled with class
|
# Whenever the current directory is ~/work or a subdirectory of ~/work, it gets styled with one
|
||||||
# WORK or WORK_NOT_WRITABLE.
|
# of the following classes depending on its writability and existence: WORK, WORK_NOT_WRITABLE or
|
||||||
|
# WORK_NON_EXISTENT.
|
||||||
#
|
#
|
||||||
# Simply assigning classes to directories don't have any visible effects. It merely gives you an
|
# Simply assigning classes to directories doesn't have any visible effects. It merely gives you an
|
||||||
# option to define custom colors and icons for different directory classes.
|
# option to define custom colors and icons for different directory classes.
|
||||||
#
|
#
|
||||||
# # Styling for WORK.
|
# # Styling for WORK.
|
||||||
|
|
@ -314,6 +334,12 @@
|
||||||
# typeset -g POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_SHORTENED_FOREGROUND=103
|
# typeset -g POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_SHORTENED_FOREGROUND=103
|
||||||
# typeset -g POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_ANCHOR_FOREGROUND=39
|
# typeset -g POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_ANCHOR_FOREGROUND=39
|
||||||
#
|
#
|
||||||
|
# # Styling for WORK_NON_EXISTENT.
|
||||||
|
# typeset -g POWERLEVEL9K_DIR_WORK_NON_EXISTENT_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
||||||
|
# typeset -g POWERLEVEL9K_DIR_WORK_NON_EXISTENT_FOREGROUND=31
|
||||||
|
# typeset -g POWERLEVEL9K_DIR_WORK_NON_EXISTENT_SHORTENED_FOREGROUND=103
|
||||||
|
# typeset -g POWERLEVEL9K_DIR_WORK_NON_EXISTENT_ANCHOR_FOREGROUND=39
|
||||||
|
#
|
||||||
# If a styling parameter isn't explicitly defined for some class, it falls back to the classless
|
# If a styling parameter isn't explicitly defined for some class, it falls back to the classless
|
||||||
# parameter. For example, if POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_FOREGROUND is not set, it falls
|
# parameter. For example, if POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_FOREGROUND is not set, it falls
|
||||||
# back to POWERLEVEL9K_DIR_FOREGROUND.
|
# back to POWERLEVEL9K_DIR_FOREGROUND.
|
||||||
|
|
@ -324,7 +350,7 @@
|
||||||
# typeset -g POWERLEVEL9K_DIR_PREFIX='%248Fin '
|
# typeset -g POWERLEVEL9K_DIR_PREFIX='%248Fin '
|
||||||
|
|
||||||
#####################################[ vcs: git status ]######################################
|
#####################################[ vcs: git status ]######################################
|
||||||
# Branch icon. Set this parameter to '\uF126 ' for the popular Powerline branch icon.
|
# Branch icon. Set this parameter to '\UE0A0 ' for the popular Powerline branch icon.
|
||||||
typeset -g POWERLEVEL9K_VCS_BRANCH_ICON=
|
typeset -g POWERLEVEL9K_VCS_BRANCH_ICON=
|
||||||
|
|
||||||
# Untracked files icon. It's really a question mark, your font isn't broken.
|
# Untracked files icon. It's really a question mark, your font isn't broken.
|
||||||
|
|
@ -333,7 +359,7 @@
|
||||||
|
|
||||||
# Formatter for Git status.
|
# Formatter for Git status.
|
||||||
#
|
#
|
||||||
# Example output: master ⇣42⇡42 *42 merge ~42 +42 !42 ?42.
|
# Example output: master wip ⇣42⇡42 *42 merge ~42 +42 !42 ?42.
|
||||||
#
|
#
|
||||||
# You can edit the function to customize how Git status looks.
|
# You can edit the function to customize how Git status looks.
|
||||||
#
|
#
|
||||||
|
|
@ -366,35 +392,55 @@
|
||||||
fi
|
fi
|
||||||
|
|
||||||
local res
|
local res
|
||||||
local where # branch or tag
|
|
||||||
if [[ -n $VCS_STATUS_LOCAL_BRANCH ]]; then
|
if [[ -n $VCS_STATUS_LOCAL_BRANCH ]]; then
|
||||||
res+="${clean}${(g::)POWERLEVEL9K_VCS_BRANCH_ICON}"
|
local branch=${(V)VCS_STATUS_LOCAL_BRANCH}
|
||||||
where=${(V)VCS_STATUS_LOCAL_BRANCH}
|
# If local branch name is at most 32 characters long, show it in full.
|
||||||
elif [[ -n $VCS_STATUS_TAG ]]; then
|
# Otherwise show the first 12 … the last 12.
|
||||||
res+="${meta}#"
|
# Tip: To always show local branch name in full without truncation, delete the next line.
|
||||||
where=${(V)VCS_STATUS_TAG}
|
(( $#branch > 32 )) && branch[13,-13]="…" # <-- this line
|
||||||
|
res+="${clean}${(g::)POWERLEVEL9K_VCS_BRANCH_ICON}${branch//\%/%%}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# If local branch name or tag is at most 32 characters long, show it in full.
|
if [[ -n $VCS_STATUS_TAG
|
||||||
# Otherwise show the first 12 … the last 12.
|
# Show tag only if not on a branch.
|
||||||
# Tip: To always show local branch name in full without truncation, delete the next line.
|
# Tip: To always show tag, delete the next line.
|
||||||
(( $#where > 32 )) && where[13,-13]="…"
|
&& -z $VCS_STATUS_LOCAL_BRANCH # <-- this line
|
||||||
res+="${clean}${where//\%/%%}" # escape %
|
]]; then
|
||||||
|
local tag=${(V)VCS_STATUS_TAG}
|
||||||
|
# If tag name is at most 32 characters long, show it in full.
|
||||||
|
# Otherwise show the first 12 … the last 12.
|
||||||
|
# Tip: To always show tag name in full without truncation, delete the next line.
|
||||||
|
(( $#tag > 32 )) && tag[13,-13]="…" # <-- this line
|
||||||
|
res+="${meta}#${clean}${tag//\%/%%}"
|
||||||
|
fi
|
||||||
|
|
||||||
# Display the current Git commit if there is no branch or tag.
|
# Display the current Git commit if there is no branch and no tag.
|
||||||
# Tip: To always display the current Git commit, remove `[[ -z $where ]] &&` from the next line.
|
# Tip: To always display the current Git commit, delete the next line.
|
||||||
[[ -z $where ]] && res+="${meta}@${clean}${VCS_STATUS_COMMIT[1,8]}"
|
[[ -z $VCS_STATUS_LOCAL_BRANCH && -z $VCS_STATUS_TAG ]] && # <-- this line
|
||||||
|
res+="${meta}@${clean}${VCS_STATUS_COMMIT[1,8]}"
|
||||||
|
|
||||||
# Show tracking branch name if it differs from local branch.
|
# Show tracking branch name if it differs from local branch.
|
||||||
if [[ -n ${VCS_STATUS_REMOTE_BRANCH:#$VCS_STATUS_LOCAL_BRANCH} ]]; then
|
if [[ -n ${VCS_STATUS_REMOTE_BRANCH:#$VCS_STATUS_LOCAL_BRANCH} ]]; then
|
||||||
res+="${meta}:${clean}${(V)VCS_STATUS_REMOTE_BRANCH//\%/%%}" # escape %
|
res+="${meta}:${clean}${(V)VCS_STATUS_REMOTE_BRANCH//\%/%%}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Display "wip" if the latest commit's summary contains "wip" or "WIP".
|
||||||
|
if [[ $VCS_STATUS_COMMIT_SUMMARY == (|*[^[:alnum:]])(wip|WIP)(|[^[:alnum:]]*) ]]; then
|
||||||
|
res+=" ${modified}wip"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if (( VCS_STATUS_COMMITS_AHEAD || VCS_STATUS_COMMITS_BEHIND )); then
|
||||||
|
# ⇣42 if behind the remote.
|
||||||
|
(( VCS_STATUS_COMMITS_BEHIND )) && res+=" ${clean}⇣${VCS_STATUS_COMMITS_BEHIND}"
|
||||||
|
# ⇡42 if ahead of the remote; no leading space if also behind the remote: ⇣42⇡42.
|
||||||
|
(( VCS_STATUS_COMMITS_AHEAD && !VCS_STATUS_COMMITS_BEHIND )) && res+=" "
|
||||||
|
(( VCS_STATUS_COMMITS_AHEAD )) && res+="${clean}⇡${VCS_STATUS_COMMITS_AHEAD}"
|
||||||
|
elif [[ -n $VCS_STATUS_REMOTE_BRANCH ]]; then
|
||||||
|
# Tip: Uncomment the next line to display '=' if up to date with the remote.
|
||||||
|
# res+=" ${clean}="
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# ⇣42 if behind the remote.
|
|
||||||
(( VCS_STATUS_COMMITS_BEHIND )) && res+=" ${clean}⇣${VCS_STATUS_COMMITS_BEHIND}"
|
|
||||||
# ⇡42 if ahead of the remote; no leading space if also behind the remote: ⇣42⇡42.
|
|
||||||
(( VCS_STATUS_COMMITS_AHEAD && !VCS_STATUS_COMMITS_BEHIND )) && res+=" "
|
|
||||||
(( VCS_STATUS_COMMITS_AHEAD )) && res+="${clean}⇡${VCS_STATUS_COMMITS_AHEAD}"
|
|
||||||
# ⇠42 if behind the push remote.
|
# ⇠42 if behind the push remote.
|
||||||
(( VCS_STATUS_PUSH_COMMITS_BEHIND )) && res+=" ${clean}⇠${VCS_STATUS_PUSH_COMMITS_BEHIND}"
|
(( VCS_STATUS_PUSH_COMMITS_BEHIND )) && res+=" ${clean}⇠${VCS_STATUS_PUSH_COMMITS_BEHIND}"
|
||||||
(( VCS_STATUS_PUSH_COMMITS_AHEAD && !VCS_STATUS_PUSH_COMMITS_BEHIND )) && res+=" "
|
(( VCS_STATUS_PUSH_COMMITS_AHEAD && !VCS_STATUS_PUSH_COMMITS_BEHIND )) && res+=" "
|
||||||
|
|
@ -436,7 +482,7 @@
|
||||||
|
|
||||||
# Don't show Git status in prompt for repositories whose workdir matches this pattern.
|
# Don't show Git status in prompt for repositories whose workdir matches this pattern.
|
||||||
# For example, if set to '~', the Git repository at $HOME/.git will be ignored.
|
# For example, if set to '~', the Git repository at $HOME/.git will be ignored.
|
||||||
# Multiple patterns can be combined with '|': '~|~/some/dir'.
|
# Multiple patterns can be combined with '|': '~(|/foo)|/bar/baz/*'.
|
||||||
typeset -g POWERLEVEL9K_VCS_DISABLED_WORKDIR_PATTERN='~'
|
typeset -g POWERLEVEL9K_VCS_DISABLED_WORKDIR_PATTERN='~'
|
||||||
|
|
||||||
# Disable the default Git status formatting.
|
# Disable the default Git status formatting.
|
||||||
|
|
@ -460,7 +506,7 @@
|
||||||
# isn't in an svn or hg reposotiry.
|
# isn't in an svn or hg reposotiry.
|
||||||
typeset -g POWERLEVEL9K_VCS_BACKENDS=(git)
|
typeset -g POWERLEVEL9K_VCS_BACKENDS=(git)
|
||||||
|
|
||||||
# These settings are used for respositories other than Git or when gitstatusd fails and
|
# These settings are used for repositories other than Git or when gitstatusd fails and
|
||||||
# Powerlevel10k has to fall back to using vcs_info.
|
# Powerlevel10k has to fall back to using vcs_info.
|
||||||
typeset -g POWERLEVEL9K_VCS_CLEAN_FOREGROUND=76
|
typeset -g POWERLEVEL9K_VCS_CLEAN_FOREGROUND=76
|
||||||
typeset -g POWERLEVEL9K_VCS_UNTRACKED_FOREGROUND=76
|
typeset -g POWERLEVEL9K_VCS_UNTRACKED_FOREGROUND=76
|
||||||
|
|
@ -503,7 +549,7 @@
|
||||||
typeset -g POWERLEVEL9K_STATUS_ERROR_PIPE_VISUAL_IDENTIFIER_EXPANSION='✘'
|
typeset -g POWERLEVEL9K_STATUS_ERROR_PIPE_VISUAL_IDENTIFIER_EXPANSION='✘'
|
||||||
|
|
||||||
###################[ command_execution_time: duration of the last command ]###################
|
###################[ command_execution_time: duration of the last command ]###################
|
||||||
# Show duration of the last command if takes longer than this many seconds.
|
# Show duration of the last command if takes at least this many seconds.
|
||||||
typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_THRESHOLD=3
|
typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_THRESHOLD=3
|
||||||
# Show this many fractional digits. Zero means round to seconds.
|
# Show this many fractional digits. Zero means round to seconds.
|
||||||
typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_PRECISION=0
|
typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_PRECISION=0
|
||||||
|
|
@ -532,6 +578,7 @@
|
||||||
|
|
||||||
###############[ asdf: asdf version manager (https://github.com/asdf-vm/asdf) ]###############
|
###############[ asdf: asdf version manager (https://github.com/asdf-vm/asdf) ]###############
|
||||||
# Default asdf color. Only used to display tools for which there is no color override (see below).
|
# Default asdf color. Only used to display tools for which there is no color override (see below).
|
||||||
|
# Tip: Override this parameter for ${TOOL} with POWERLEVEL9K_ASDF_${TOOL}_FOREGROUND.
|
||||||
typeset -g POWERLEVEL9K_ASDF_FOREGROUND=66
|
typeset -g POWERLEVEL9K_ASDF_FOREGROUND=66
|
||||||
|
|
||||||
# There are four parameters that can be used to hide asdf tools. Each parameter describes
|
# There are four parameters that can be used to hide asdf tools. Each parameter describes
|
||||||
|
|
@ -577,7 +624,7 @@
|
||||||
typeset -g POWERLEVEL9K_ASDF_SHOW_SYSTEM=true
|
typeset -g POWERLEVEL9K_ASDF_SHOW_SYSTEM=true
|
||||||
|
|
||||||
# If set to non-empty value, hide tools unless there is a file matching the specified file pattern
|
# If set to non-empty value, hide tools unless there is a file matching the specified file pattern
|
||||||
# in the current directory, or its parent diretory, or its grandparent directory, and so on.
|
# in the current directory, or its parent directory, or its grandparent directory, and so on.
|
||||||
#
|
#
|
||||||
# Note: If this parameter is set to empty value, it won't hide tools.
|
# Note: If this parameter is set to empty value, it won't hide tools.
|
||||||
# Note: SHOW_ON_UPGLOB isn't specific to asdf. It works with all prompt segments.
|
# Note: SHOW_ON_UPGLOB isn't specific to asdf. It works with all prompt segments.
|
||||||
|
|
@ -664,6 +711,11 @@
|
||||||
# typeset -g POWERLEVEL9K_ASDF_HASKELL_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
# typeset -g POWERLEVEL9K_ASDF_HASKELL_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
||||||
# typeset -g POWERLEVEL9K_ASDF_HASKELL_SHOW_ON_UPGLOB='*.foo|*.bar'
|
# typeset -g POWERLEVEL9K_ASDF_HASKELL_SHOW_ON_UPGLOB='*.foo|*.bar'
|
||||||
|
|
||||||
|
# Julia version from asdf.
|
||||||
|
typeset -g POWERLEVEL9K_ASDF_JULIA_FOREGROUND=70
|
||||||
|
# typeset -g POWERLEVEL9K_ASDF_JULIA_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
||||||
|
# typeset -g POWERLEVEL9K_ASDF_JULIA_SHOW_ON_UPGLOB='*.foo|*.bar'
|
||||||
|
|
||||||
##########[ nordvpn: nordvpn connection status, linux only (https://nordvpn.com/) ]###########
|
##########[ nordvpn: nordvpn connection status, linux only (https://nordvpn.com/) ]###########
|
||||||
# NordVPN connection indicator color.
|
# NordVPN connection indicator color.
|
||||||
typeset -g POWERLEVEL9K_NORDVPN_FOREGROUND=39
|
typeset -g POWERLEVEL9K_NORDVPN_FOREGROUND=39
|
||||||
|
|
@ -678,6 +730,12 @@
|
||||||
typeset -g POWERLEVEL9K_RANGER_FOREGROUND=178
|
typeset -g POWERLEVEL9K_RANGER_FOREGROUND=178
|
||||||
# Custom icon.
|
# Custom icon.
|
||||||
# typeset -g POWERLEVEL9K_RANGER_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
# typeset -g POWERLEVEL9K_RANGER_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
||||||
|
|
||||||
|
####################[ yazi: yazi shell (https://github.com/sxyazi/yazi) ]#####################
|
||||||
|
# Yazi shell color.
|
||||||
|
typeset -g POWERLEVEL9K_YAZI_FOREGROUND=178
|
||||||
|
# Custom icon.
|
||||||
|
# typeset -g POWERLEVEL9K_YAZI_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
||||||
|
|
||||||
######################[ nnn: nnn shell (https://github.com/jarun/nnn) ]#######################
|
######################[ nnn: nnn shell (https://github.com/jarun/nnn) ]#######################
|
||||||
# Nnn shell color.
|
# Nnn shell color.
|
||||||
|
|
@ -685,6 +743,18 @@
|
||||||
# Custom icon.
|
# Custom icon.
|
||||||
# typeset -g POWERLEVEL9K_NNN_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
# typeset -g POWERLEVEL9K_NNN_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
||||||
|
|
||||||
|
######################[ lf: lf shell (https://github.com/gokcehan/lf) ]#######################
|
||||||
|
# lf shell color.
|
||||||
|
typeset -g POWERLEVEL9K_LF_FOREGROUND=72
|
||||||
|
# Custom icon.
|
||||||
|
# typeset -g POWERLEVEL9K_LF_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
||||||
|
|
||||||
|
##################[ xplr: xplr shell (https://github.com/sayanarijit/xplr) ]##################
|
||||||
|
# xplr shell color.
|
||||||
|
typeset -g POWERLEVEL9K_XPLR_FOREGROUND=72
|
||||||
|
# Custom icon.
|
||||||
|
# typeset -g POWERLEVEL9K_XPLR_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
||||||
|
|
||||||
###########################[ vim_shell: vim shell indicator (:sh) ]###########################
|
###########################[ vim_shell: vim shell indicator (:sh) ]###########################
|
||||||
# Vim shell indicator color.
|
# Vim shell indicator color.
|
||||||
typeset -g POWERLEVEL9K_VIM_SHELL_FOREGROUND=34
|
typeset -g POWERLEVEL9K_VIM_SHELL_FOREGROUND=34
|
||||||
|
|
@ -701,12 +771,21 @@
|
||||||
# Nix shell color.
|
# Nix shell color.
|
||||||
typeset -g POWERLEVEL9K_NIX_SHELL_FOREGROUND=74
|
typeset -g POWERLEVEL9K_NIX_SHELL_FOREGROUND=74
|
||||||
|
|
||||||
|
# Display the icon of nix_shell if PATH contains a subdirectory of /nix/store.
|
||||||
|
# typeset -g POWERLEVEL9K_NIX_SHELL_INFER_FROM_PATH=false
|
||||||
|
|
||||||
# Tip: If you want to see just the icon without "pure" and "impure", uncomment the next line.
|
# Tip: If you want to see just the icon without "pure" and "impure", uncomment the next line.
|
||||||
# typeset -g POWERLEVEL9K_NIX_SHELL_CONTENT_EXPANSION=
|
# typeset -g POWERLEVEL9K_NIX_SHELL_CONTENT_EXPANSION=
|
||||||
|
|
||||||
# Custom icon.
|
# Custom icon.
|
||||||
# typeset -g POWERLEVEL9K_NIX_SHELL_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
# typeset -g POWERLEVEL9K_NIX_SHELL_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
||||||
|
|
||||||
|
##################[ chezmoi_shell: chezmoi shell (https://www.chezmoi.io/) ]##################
|
||||||
|
# chezmoi shell color.
|
||||||
|
typeset -g POWERLEVEL9K_CHEZMOI_SHELL_FOREGROUND=33
|
||||||
|
# Custom icon.
|
||||||
|
# typeset -g POWERLEVEL9K_CHEZMOI_SHELL_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
||||||
|
|
||||||
##################################[ disk_usage: disk usage ]##################################
|
##################################[ disk_usage: disk usage ]##################################
|
||||||
# Colors for different levels of disk usage.
|
# Colors for different levels of disk usage.
|
||||||
typeset -g POWERLEVEL9K_DISK_USAGE_NORMAL_FOREGROUND=35
|
typeset -g POWERLEVEL9K_DISK_USAGE_NORMAL_FOREGROUND=35
|
||||||
|
|
@ -733,9 +812,8 @@
|
||||||
# Text and color for insert vi mode.
|
# Text and color for insert vi mode.
|
||||||
typeset -g POWERLEVEL9K_VI_INSERT_MODE_STRING=
|
typeset -g POWERLEVEL9K_VI_INSERT_MODE_STRING=
|
||||||
typeset -g POWERLEVEL9K_VI_MODE_INSERT_FOREGROUND=66
|
typeset -g POWERLEVEL9K_VI_MODE_INSERT_FOREGROUND=66
|
||||||
|
|
||||||
# Custom icon.
|
# Custom icon.
|
||||||
# typeset -g POWERLEVEL9K_RANGER_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
# typeset -g POWERLEVEL9K_VI_MODE_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
||||||
|
|
||||||
######################################[ ram: free RAM ]#######################################
|
######################################[ ram: free RAM ]#######################################
|
||||||
# RAM color.
|
# RAM color.
|
||||||
|
|
@ -800,7 +878,7 @@
|
||||||
##############[ taskwarrior: taskwarrior task count (https://taskwarrior.org/) ]##############
|
##############[ taskwarrior: taskwarrior task count (https://taskwarrior.org/) ]##############
|
||||||
# Taskwarrior color.
|
# Taskwarrior color.
|
||||||
typeset -g POWERLEVEL9K_TASKWARRIOR_FOREGROUND=74
|
typeset -g POWERLEVEL9K_TASKWARRIOR_FOREGROUND=74
|
||||||
|
|
||||||
# Taskwarrior segment format. The following parameters are available within the expansion.
|
# Taskwarrior segment format. The following parameters are available within the expansion.
|
||||||
#
|
#
|
||||||
# - P9K_TASKWARRIOR_PENDING_COUNT The number of pending tasks: `task +PENDING count`.
|
# - P9K_TASKWARRIOR_PENDING_COUNT The number of pending tasks: `task +PENDING count`.
|
||||||
|
|
@ -817,6 +895,30 @@
|
||||||
# Custom icon.
|
# Custom icon.
|
||||||
# typeset -g POWERLEVEL9K_TASKWARRIOR_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
# typeset -g POWERLEVEL9K_TASKWARRIOR_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
||||||
|
|
||||||
|
######[ per_directory_history: Oh My Zsh per-directory-history local/global indicator ]#######
|
||||||
|
# Color when using local/global history.
|
||||||
|
typeset -g POWERLEVEL9K_PER_DIRECTORY_HISTORY_LOCAL_FOREGROUND=135
|
||||||
|
typeset -g POWERLEVEL9K_PER_DIRECTORY_HISTORY_GLOBAL_FOREGROUND=130
|
||||||
|
|
||||||
|
# Tip: Uncomment the next two lines to hide "local"/"global" text and leave just the icon.
|
||||||
|
# typeset -g POWERLEVEL9K_PER_DIRECTORY_HISTORY_LOCAL_CONTENT_EXPANSION=''
|
||||||
|
# typeset -g POWERLEVEL9K_PER_DIRECTORY_HISTORY_GLOBAL_CONTENT_EXPANSION=''
|
||||||
|
|
||||||
|
# Custom icon.
|
||||||
|
# typeset -g POWERLEVEL9K_PER_DIRECTORY_HISTORY_LOCAL_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
||||||
|
# typeset -g POWERLEVEL9K_PER_DIRECTORY_HISTORY_GLOBAL_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
||||||
|
|
||||||
|
################################[ cpu_arch: CPU architecture ]################################
|
||||||
|
# CPU architecture color.
|
||||||
|
typeset -g POWERLEVEL9K_CPU_ARCH_FOREGROUND=172
|
||||||
|
|
||||||
|
# Hide the segment when on a specific CPU architecture.
|
||||||
|
# typeset -g POWERLEVEL9K_CPU_ARCH_X86_64_CONTENT_EXPANSION=
|
||||||
|
# typeset -g POWERLEVEL9K_CPU_ARCH_X86_64_VISUAL_IDENTIFIER_EXPANSION=
|
||||||
|
|
||||||
|
# Custom icon.
|
||||||
|
# typeset -g POWERLEVEL9K_CPU_ARCH_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
||||||
|
|
||||||
##################################[ context: user@hostname ]##################################
|
##################################[ context: user@hostname ]##################################
|
||||||
# Context color when running with privileges.
|
# Context color when running with privileges.
|
||||||
typeset -g POWERLEVEL9K_CONTEXT_ROOT_FOREGROUND=178
|
typeset -g POWERLEVEL9K_CONTEXT_ROOT_FOREGROUND=178
|
||||||
|
|
@ -846,6 +948,9 @@
|
||||||
typeset -g POWERLEVEL9K_VIRTUALENV_FOREGROUND=37
|
typeset -g POWERLEVEL9K_VIRTUALENV_FOREGROUND=37
|
||||||
# Don't show Python version next to the virtual environment name.
|
# Don't show Python version next to the virtual environment name.
|
||||||
typeset -g POWERLEVEL9K_VIRTUALENV_SHOW_PYTHON_VERSION=false
|
typeset -g POWERLEVEL9K_VIRTUALENV_SHOW_PYTHON_VERSION=false
|
||||||
|
# If set to "false", won't show virtualenv if pyenv is already shown.
|
||||||
|
# If set to "if-different", won't show virtualenv if it's the same as pyenv.
|
||||||
|
typeset -g POWERLEVEL9K_VIRTUALENV_SHOW_WITH_PYENV=false
|
||||||
# Separate environment name from Python version only with a space.
|
# Separate environment name from Python version only with a space.
|
||||||
typeset -g POWERLEVEL9K_VIRTUALENV_{LEFT,RIGHT}_DELIMITER=
|
typeset -g POWERLEVEL9K_VIRTUALENV_{LEFT,RIGHT}_DELIMITER=
|
||||||
# Custom icon.
|
# Custom icon.
|
||||||
|
|
@ -854,10 +959,33 @@
|
||||||
#####################[ anaconda: conda environment (https://conda.io/) ]######################
|
#####################[ anaconda: conda environment (https://conda.io/) ]######################
|
||||||
# Anaconda environment color.
|
# Anaconda environment color.
|
||||||
typeset -g POWERLEVEL9K_ANACONDA_FOREGROUND=37
|
typeset -g POWERLEVEL9K_ANACONDA_FOREGROUND=37
|
||||||
# Don't show Python version next to the anaconda environment name.
|
|
||||||
typeset -g POWERLEVEL9K_ANACONDA_SHOW_PYTHON_VERSION=false
|
# Anaconda segment format. The following parameters are available within the expansion.
|
||||||
# Separate environment name from Python version only with a space.
|
#
|
||||||
typeset -g POWERLEVEL9K_ANACONDA_{LEFT,RIGHT}_DELIMITER=
|
# - CONDA_PREFIX Absolute path to the active Anaconda/Miniconda environment.
|
||||||
|
# - CONDA_DEFAULT_ENV Name of the active Anaconda/Miniconda environment.
|
||||||
|
# - CONDA_PROMPT_MODIFIER Configurable prompt modifier (see below).
|
||||||
|
# - P9K_ANACONDA_PYTHON_VERSION Current python version (python --version).
|
||||||
|
#
|
||||||
|
# CONDA_PROMPT_MODIFIER can be configured with the following command:
|
||||||
|
#
|
||||||
|
# conda config --set env_prompt '({default_env}) '
|
||||||
|
#
|
||||||
|
# The last argument is a Python format string that can use the following variables:
|
||||||
|
#
|
||||||
|
# - prefix The same as CONDA_PREFIX.
|
||||||
|
# - default_env The same as CONDA_DEFAULT_ENV.
|
||||||
|
# - name The last segment of CONDA_PREFIX.
|
||||||
|
# - stacked_env Comma-separated list of names in the environment stack. The first element is
|
||||||
|
# always the same as default_env.
|
||||||
|
#
|
||||||
|
# Note: '({default_env}) ' is the default value of env_prompt.
|
||||||
|
#
|
||||||
|
# The default value of POWERLEVEL9K_ANACONDA_CONTENT_EXPANSION expands to $CONDA_PROMPT_MODIFIER
|
||||||
|
# without the surrounding parentheses, or to the last path component of CONDA_PREFIX if the former
|
||||||
|
# is empty.
|
||||||
|
typeset -g POWERLEVEL9K_ANACONDA_CONTENT_EXPANSION='${${${${CONDA_PROMPT_MODIFIER#\(}% }%\)}:-${CONDA_PREFIX:t}}'
|
||||||
|
|
||||||
# Custom icon.
|
# Custom icon.
|
||||||
# typeset -g POWERLEVEL9K_ANACONDA_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
# typeset -g POWERLEVEL9K_ANACONDA_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
||||||
|
|
||||||
|
|
@ -871,6 +999,19 @@
|
||||||
typeset -g POWERLEVEL9K_PYENV_PROMPT_ALWAYS_SHOW=false
|
typeset -g POWERLEVEL9K_PYENV_PROMPT_ALWAYS_SHOW=false
|
||||||
# If set to false, hide python version if it's equal to "system".
|
# If set to false, hide python version if it's equal to "system".
|
||||||
typeset -g POWERLEVEL9K_PYENV_SHOW_SYSTEM=true
|
typeset -g POWERLEVEL9K_PYENV_SHOW_SYSTEM=true
|
||||||
|
|
||||||
|
# Pyenv segment format. The following parameters are available within the expansion.
|
||||||
|
#
|
||||||
|
# - P9K_CONTENT Current pyenv environment (pyenv version-name).
|
||||||
|
# - P9K_PYENV_PYTHON_VERSION Current python version (python --version).
|
||||||
|
#
|
||||||
|
# The default format has the following logic:
|
||||||
|
#
|
||||||
|
# 1. Display just "$P9K_CONTENT" if it's equal to "$P9K_PYENV_PYTHON_VERSION" or
|
||||||
|
# starts with "$P9K_PYENV_PYTHON_VERSION/".
|
||||||
|
# 2. Otherwise display "$P9K_CONTENT $P9K_PYENV_PYTHON_VERSION".
|
||||||
|
typeset -g POWERLEVEL9K_PYENV_CONTENT_EXPANSION='${P9K_CONTENT}${${P9K_CONTENT:#$P9K_PYENV_PYTHON_VERSION(|/*)}:+ $P9K_PYENV_PYTHON_VERSION}'
|
||||||
|
|
||||||
# Custom icon.
|
# Custom icon.
|
||||||
# typeset -g POWERLEVEL9K_PYENV_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
# typeset -g POWERLEVEL9K_PYENV_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
||||||
|
|
||||||
|
|
@ -903,6 +1044,11 @@
|
||||||
##############[ nvm: node.js version from nvm (https://github.com/nvm-sh/nvm) ]###############
|
##############[ nvm: node.js version from nvm (https://github.com/nvm-sh/nvm) ]###############
|
||||||
# Nvm color.
|
# Nvm color.
|
||||||
typeset -g POWERLEVEL9K_NVM_FOREGROUND=70
|
typeset -g POWERLEVEL9K_NVM_FOREGROUND=70
|
||||||
|
# If set to false, hide node version if it's the same as default:
|
||||||
|
# $(nvm version current) == $(nvm version default).
|
||||||
|
typeset -g POWERLEVEL9K_NVM_PROMPT_ALWAYS_SHOW=false
|
||||||
|
# If set to false, hide node version if it's equal to "system".
|
||||||
|
typeset -g POWERLEVEL9K_NVM_SHOW_SYSTEM=true
|
||||||
# Custom icon.
|
# Custom icon.
|
||||||
# typeset -g POWERLEVEL9K_NVM_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
# typeset -g POWERLEVEL9K_NVM_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
||||||
|
|
||||||
|
|
@ -1052,6 +1198,16 @@
|
||||||
# Custom icon.
|
# Custom icon.
|
||||||
# typeset -g POWERLEVEL9K_PLENV_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
# typeset -g POWERLEVEL9K_PLENV_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
||||||
|
|
||||||
|
###########[ perlbrew: perl version from perlbrew (https://github.com/gugod/App-perlbrew) ]############
|
||||||
|
# Perlbrew color.
|
||||||
|
typeset -g POWERLEVEL9K_PERLBREW_FOREGROUND=67
|
||||||
|
# Show perlbrew version only when in a perl project subdirectory.
|
||||||
|
typeset -g POWERLEVEL9K_PERLBREW_PROJECT_ONLY=true
|
||||||
|
# Don't show "perl-" at the front.
|
||||||
|
typeset -g POWERLEVEL9K_PERLBREW_SHOW_PREFIX=false
|
||||||
|
# Custom icon.
|
||||||
|
# typeset -g POWERLEVEL9K_PERLBREW_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
||||||
|
|
||||||
############[ phpenv: php version from phpenv (https://github.com/phpenv/phpenv) ]############
|
############[ phpenv: php version from phpenv (https://github.com/phpenv/phpenv) ]############
|
||||||
# PHP color.
|
# PHP color.
|
||||||
typeset -g POWERLEVEL9K_PHPENV_FOREGROUND=99
|
typeset -g POWERLEVEL9K_PHPENV_FOREGROUND=99
|
||||||
|
|
@ -1065,6 +1221,19 @@
|
||||||
# Custom icon.
|
# Custom icon.
|
||||||
# typeset -g POWERLEVEL9K_PHPENV_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
# typeset -g POWERLEVEL9K_PHPENV_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
||||||
|
|
||||||
|
#######[ scalaenv: scala version from scalaenv (https://github.com/scalaenv/scalaenv) ]#######
|
||||||
|
# Scala color.
|
||||||
|
typeset -g POWERLEVEL9K_SCALAENV_FOREGROUND=160
|
||||||
|
# Hide scala version if it doesn't come from one of these sources.
|
||||||
|
typeset -g POWERLEVEL9K_SCALAENV_SOURCES=(shell local global)
|
||||||
|
# If set to false, hide scala version if it's the same as global:
|
||||||
|
# $(scalaenv version-name) == $(scalaenv global).
|
||||||
|
typeset -g POWERLEVEL9K_SCALAENV_PROMPT_ALWAYS_SHOW=false
|
||||||
|
# If set to false, hide scala version if it's equal to "system".
|
||||||
|
typeset -g POWERLEVEL9K_SCALAENV_SHOW_SYSTEM=true
|
||||||
|
# Custom icon.
|
||||||
|
# typeset -g POWERLEVEL9K_SCALAENV_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
||||||
|
|
||||||
##########[ haskell_stack: haskell version from stack (https://haskellstack.org/) ]###########
|
##########[ haskell_stack: haskell version from stack (https://haskellstack.org/) ]###########
|
||||||
# Haskell color.
|
# Haskell color.
|
||||||
typeset -g POWERLEVEL9K_HASKELL_STACK_FOREGROUND=172
|
typeset -g POWERLEVEL9K_HASKELL_STACK_FOREGROUND=172
|
||||||
|
|
@ -1080,6 +1249,8 @@
|
||||||
# typeset -g POWERLEVEL9K_HASKELL_STACK_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
# typeset -g POWERLEVEL9K_HASKELL_STACK_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
||||||
|
|
||||||
################[ terraform: terraform workspace (https://www.terraform.io) ]#################
|
################[ terraform: terraform workspace (https://www.terraform.io) ]#################
|
||||||
|
# Don't show terraform workspace if it's literally "default".
|
||||||
|
typeset -g POWERLEVEL9K_TERRAFORM_SHOW_DEFAULT=false
|
||||||
# POWERLEVEL9K_TERRAFORM_CLASSES is an array with even number of elements. The first element
|
# POWERLEVEL9K_TERRAFORM_CLASSES is an array with even number of elements. The first element
|
||||||
# in each pair defines a pattern against which the current terraform workspace gets matched.
|
# in each pair defines a pattern against which the current terraform workspace gets matched.
|
||||||
# More specifically, it's P9K_CONTENT prior to the application of context expansion (see below)
|
# More specifically, it's P9K_CONTENT prior to the application of context expansion (see below)
|
||||||
|
|
@ -1093,7 +1264,7 @@
|
||||||
# typeset -g POWERLEVEL9K_TERRAFORM_CLASSES=(
|
# typeset -g POWERLEVEL9K_TERRAFORM_CLASSES=(
|
||||||
# '*prod*' PROD
|
# '*prod*' PROD
|
||||||
# '*test*' TEST
|
# '*test*' TEST
|
||||||
# '*' DEFAULT)
|
# '*' OTHER)
|
||||||
#
|
#
|
||||||
# If your current terraform workspace is "project_test", its class is TEST because "project_test"
|
# If your current terraform workspace is "project_test", its class is TEST because "project_test"
|
||||||
# doesn't match the pattern '*prod*' but does match '*test*'.
|
# doesn't match the pattern '*prod*' but does match '*test*'.
|
||||||
|
|
@ -1106,14 +1277,20 @@
|
||||||
typeset -g POWERLEVEL9K_TERRAFORM_CLASSES=(
|
typeset -g POWERLEVEL9K_TERRAFORM_CLASSES=(
|
||||||
# '*prod*' PROD # These values are examples that are unlikely
|
# '*prod*' PROD # These values are examples that are unlikely
|
||||||
# '*test*' TEST # to match your needs. Customize them as needed.
|
# '*test*' TEST # to match your needs. Customize them as needed.
|
||||||
'*' DEFAULT)
|
'*' OTHER)
|
||||||
typeset -g POWERLEVEL9K_TERRAFORM_DEFAULT_FOREGROUND=38
|
typeset -g POWERLEVEL9K_TERRAFORM_OTHER_FOREGROUND=38
|
||||||
# typeset -g POWERLEVEL9K_TERRAFORM_DEFAULT_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
# typeset -g POWERLEVEL9K_TERRAFORM_OTHER_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
||||||
|
|
||||||
|
#############[ terraform_version: terraform version (https://www.terraform.io) ]##############
|
||||||
|
# Terraform version color.
|
||||||
|
typeset -g POWERLEVEL9K_TERRAFORM_VERSION_FOREGROUND=38
|
||||||
|
# Custom icon.
|
||||||
|
# typeset -g POWERLEVEL9K_TERRAFORM_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
||||||
|
|
||||||
#############[ kubecontext: current kubernetes context (https://kubernetes.io/) ]#############
|
#############[ kubecontext: current kubernetes context (https://kubernetes.io/) ]#############
|
||||||
# Show kubecontext only when the the command you are typing invokes one of these tools.
|
# Show kubecontext only when the command you are typing invokes one of these tools.
|
||||||
# Tip: Remove the next line to always show kubecontext.
|
# Tip: Remove the next line to always show kubecontext.
|
||||||
typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito'
|
typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito|k9s|helmfile|flux|fluxctl|stern|kubeseal|skaffold|kubent|kubecolor|cmctl|sparkctl'
|
||||||
|
|
||||||
# Kubernetes context classes for the purpose of using different colors, icons and expansions with
|
# Kubernetes context classes for the purpose of using different colors, icons and expansions with
|
||||||
# different contexts.
|
# different contexts.
|
||||||
|
|
@ -1198,9 +1375,9 @@
|
||||||
# typeset -g POWERLEVEL9K_KUBECONTEXT_PREFIX='%248Fat '
|
# typeset -g POWERLEVEL9K_KUBECONTEXT_PREFIX='%248Fat '
|
||||||
|
|
||||||
#[ aws: aws profile (https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html) ]#
|
#[ aws: aws profile (https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html) ]#
|
||||||
# Show aws only when the the command you are typing invokes one of these tools.
|
# Show aws only when the command you are typing invokes one of these tools.
|
||||||
# Tip: Remove the next line to always show aws.
|
# Tip: Remove the next line to always show aws.
|
||||||
typeset -g POWERLEVEL9K_AWS_SHOW_ON_COMMAND='aws|awless|terraform|pulumi'
|
typeset -g POWERLEVEL9K_AWS_SHOW_ON_COMMAND='aws|awless|cdk|terraform|pulumi|terragrunt'
|
||||||
|
|
||||||
# POWERLEVEL9K_AWS_CLASSES is an array with even number of elements. The first element
|
# POWERLEVEL9K_AWS_CLASSES is an array with even number of elements. The first element
|
||||||
# in each pair defines a pattern against which the current AWS profile gets matched.
|
# in each pair defines a pattern against which the current AWS profile gets matched.
|
||||||
|
|
@ -1232,6 +1409,12 @@
|
||||||
typeset -g POWERLEVEL9K_AWS_DEFAULT_FOREGROUND=208
|
typeset -g POWERLEVEL9K_AWS_DEFAULT_FOREGROUND=208
|
||||||
# typeset -g POWERLEVEL9K_AWS_DEFAULT_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
# typeset -g POWERLEVEL9K_AWS_DEFAULT_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
||||||
|
|
||||||
|
# AWS segment format. The following parameters are available within the expansion.
|
||||||
|
#
|
||||||
|
# - P9K_AWS_PROFILE The name of the current AWS profile.
|
||||||
|
# - P9K_AWS_REGION The region associated with the current AWS profile.
|
||||||
|
typeset -g POWERLEVEL9K_AWS_CONTENT_EXPANSION='${P9K_AWS_PROFILE//\%/%%}${P9K_AWS_REGION:+ ${P9K_AWS_REGION//\%/%%}}'
|
||||||
|
|
||||||
#[ aws_eb_env: aws elastic beanstalk environment (https://aws.amazon.com/elasticbeanstalk/) ]#
|
#[ aws_eb_env: aws elastic beanstalk environment (https://aws.amazon.com/elasticbeanstalk/) ]#
|
||||||
# AWS Elastic Beanstalk environment color.
|
# AWS Elastic Beanstalk environment color.
|
||||||
typeset -g POWERLEVEL9K_AWS_EB_ENV_FOREGROUND=70
|
typeset -g POWERLEVEL9K_AWS_EB_ENV_FOREGROUND=70
|
||||||
|
|
@ -1239,18 +1422,47 @@
|
||||||
# typeset -g POWERLEVEL9K_AWS_EB_ENV_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
# typeset -g POWERLEVEL9K_AWS_EB_ENV_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
||||||
|
|
||||||
##########[ azure: azure account name (https://docs.microsoft.com/en-us/cli/azure) ]##########
|
##########[ azure: azure account name (https://docs.microsoft.com/en-us/cli/azure) ]##########
|
||||||
# Show azure only when the the command you are typing invokes one of these tools.
|
# Show azure only when the command you are typing invokes one of these tools.
|
||||||
# Tip: Remove the next line to always show azure.
|
# Tip: Remove the next line to always show azure.
|
||||||
typeset -g POWERLEVEL9K_AZURE_SHOW_ON_COMMAND='az|terraform|pulumi'
|
typeset -g POWERLEVEL9K_AZURE_SHOW_ON_COMMAND='az|terraform|pulumi|terragrunt'
|
||||||
|
|
||||||
|
# POWERLEVEL9K_AZURE_CLASSES is an array with even number of elements. The first element
|
||||||
|
# in each pair defines a pattern against which the current azure account name gets matched.
|
||||||
|
# More specifically, it's P9K_CONTENT prior to the application of context expansion (see below)
|
||||||
|
# that gets matched. If you unset all POWERLEVEL9K_AZURE_*CONTENT_EXPANSION parameters,
|
||||||
|
# you'll see this value in your prompt. The second element of each pair in
|
||||||
|
# POWERLEVEL9K_AZURE_CLASSES defines the account class. Patterns are tried in order. The
|
||||||
|
# first match wins.
|
||||||
|
#
|
||||||
|
# For example, given these settings:
|
||||||
|
#
|
||||||
|
# typeset -g POWERLEVEL9K_AZURE_CLASSES=(
|
||||||
|
# '*prod*' PROD
|
||||||
|
# '*test*' TEST
|
||||||
|
# '*' OTHER)
|
||||||
|
#
|
||||||
|
# If your current azure account is "company_test", its class is TEST because "company_test"
|
||||||
|
# doesn't match the pattern '*prod*' but does match '*test*'.
|
||||||
|
#
|
||||||
|
# You can define different colors, icons and content expansions for different classes:
|
||||||
|
#
|
||||||
|
# typeset -g POWERLEVEL9K_AZURE_TEST_FOREGROUND=28
|
||||||
|
# typeset -g POWERLEVEL9K_AZURE_TEST_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
||||||
|
# typeset -g POWERLEVEL9K_AZURE_TEST_CONTENT_EXPANSION='> ${P9K_CONTENT} <'
|
||||||
|
typeset -g POWERLEVEL9K_AZURE_CLASSES=(
|
||||||
|
# '*prod*' PROD # These values are examples that are unlikely
|
||||||
|
# '*test*' TEST # to match your needs. Customize them as needed.
|
||||||
|
'*' OTHER)
|
||||||
|
|
||||||
# Azure account name color.
|
# Azure account name color.
|
||||||
typeset -g POWERLEVEL9K_AZURE_FOREGROUND=32
|
typeset -g POWERLEVEL9K_AZURE_OTHER_FOREGROUND=32
|
||||||
# Custom icon.
|
# Custom icon.
|
||||||
# typeset -g POWERLEVEL9K_AZURE_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
# typeset -g POWERLEVEL9K_AZURE_OTHER_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
||||||
|
|
||||||
##########[ gcloud: google cloud account and project (https://cloud.google.com/) ]###########
|
##########[ gcloud: google cloud account and project (https://cloud.google.com/) ]###########
|
||||||
# Show gcloud only when the the command you are typing invokes one of these tools.
|
# Show gcloud only when the command you are typing invokes one of these tools.
|
||||||
# Tip: Remove the next line to always show gcloud.
|
# Tip: Remove the next line to always show gcloud.
|
||||||
typeset -g POWERLEVEL9K_GCLOUD_SHOW_ON_COMMAND='gcloud|gcs'
|
typeset -g POWERLEVEL9K_GCLOUD_SHOW_ON_COMMAND='gcloud|gcs|gsutil'
|
||||||
# Google cloud color.
|
# Google cloud color.
|
||||||
typeset -g POWERLEVEL9K_GCLOUD_FOREGROUND=32
|
typeset -g POWERLEVEL9K_GCLOUD_FOREGROUND=32
|
||||||
|
|
||||||
|
|
@ -1266,7 +1478,7 @@
|
||||||
# P9K_GCLOUD_PROJECT_ID | gcloud config get-value project
|
# P9K_GCLOUD_PROJECT_ID | gcloud config get-value project
|
||||||
# P9K_GCLOUD_PROJECT_NAME | gcloud projects describe $P9K_GCLOUD_PROJECT_ID --format='value(name)'
|
# P9K_GCLOUD_PROJECT_NAME | gcloud projects describe $P9K_GCLOUD_PROJECT_ID --format='value(name)'
|
||||||
#
|
#
|
||||||
# Note: ${VARIABLE//\%/%%} expands to ${VARIABLE} with all occurences of '%' replaced with '%%'.
|
# Note: ${VARIABLE//\%/%%} expands to ${VARIABLE} with all occurrences of '%' replaced with '%%'.
|
||||||
#
|
#
|
||||||
# Obtaining project name requires sending a request to Google servers. This can take a long time
|
# Obtaining project name requires sending a request to Google servers. This can take a long time
|
||||||
# and even fail. When project name is unknown, P9K_GCLOUD_PROJECT_NAME is not set and gcloud
|
# and even fail. When project name is unknown, P9K_GCLOUD_PROJECT_NAME is not set and gcloud
|
||||||
|
|
@ -1289,9 +1501,9 @@
|
||||||
# typeset -g POWERLEVEL9K_GCLOUD_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
# typeset -g POWERLEVEL9K_GCLOUD_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
||||||
|
|
||||||
#[ google_app_cred: google application credentials (https://cloud.google.com/docs/authentication/production) ]#
|
#[ google_app_cred: google application credentials (https://cloud.google.com/docs/authentication/production) ]#
|
||||||
# Show google_app_cred only when the the command you are typing invokes one of these tools.
|
# Show google_app_cred only when the command you are typing invokes one of these tools.
|
||||||
# Tip: Remove the next line to always show google_app_cred.
|
# Tip: Remove the next line to always show google_app_cred.
|
||||||
typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_SHOW_ON_COMMAND='terraform|pulumi'
|
typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_SHOW_ON_COMMAND='terraform|pulumi|terragrunt'
|
||||||
|
|
||||||
# Google application credentials classes for the purpose of using different colors, icons and
|
# Google application credentials classes for the purpose of using different colors, icons and
|
||||||
# expansions with different credentials.
|
# expansions with different credentials.
|
||||||
|
|
@ -1339,9 +1551,19 @@
|
||||||
# P9K_GOOGLE_APP_CRED_PROJECT_ID | project_id
|
# P9K_GOOGLE_APP_CRED_PROJECT_ID | project_id
|
||||||
# P9K_GOOGLE_APP_CRED_CLIENT_EMAIL | client_email
|
# P9K_GOOGLE_APP_CRED_CLIENT_EMAIL | client_email
|
||||||
#
|
#
|
||||||
# Note: ${VARIABLE//\%/%%} expands to ${VARIABLE} with all occurences of '%' replaced by '%%'.
|
# Note: ${VARIABLE//\%/%%} expands to ${VARIABLE} with all occurrences of '%' replaced by '%%'.
|
||||||
typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_DEFAULT_CONTENT_EXPANSION='${P9K_GOOGLE_APP_CRED_PROJECT_ID//\%/%%}'
|
typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_DEFAULT_CONTENT_EXPANSION='${P9K_GOOGLE_APP_CRED_PROJECT_ID//\%/%%}'
|
||||||
|
|
||||||
|
##############[ toolbox: toolbox name (https://github.com/containers/toolbox) ]###############
|
||||||
|
# Toolbox color.
|
||||||
|
typeset -g POWERLEVEL9K_TOOLBOX_FOREGROUND=178
|
||||||
|
# Don't display the name of the toolbox if it matches fedora-toolbox-*.
|
||||||
|
typeset -g POWERLEVEL9K_TOOLBOX_CONTENT_EXPANSION='${P9K_TOOLBOX_NAME:#fedora-toolbox-*}'
|
||||||
|
# Custom icon.
|
||||||
|
# typeset -g POWERLEVEL9K_TOOLBOX_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
||||||
|
# Custom prefix.
|
||||||
|
# typeset -g POWERLEVEL9K_TOOLBOX_PREFIX='%248Fin '
|
||||||
|
|
||||||
###############################[ public_ip: public IP address ]###############################
|
###############################[ public_ip: public IP address ]###############################
|
||||||
# Public IP color.
|
# Public IP color.
|
||||||
typeset -g POWERLEVEL9K_PUBLIC_IP_FOREGROUND=94
|
typeset -g POWERLEVEL9K_PUBLIC_IP_FOREGROUND=94
|
||||||
|
|
@ -1356,7 +1578,7 @@
|
||||||
typeset -g POWERLEVEL9K_VPN_IP_CONTENT_EXPANSION=
|
typeset -g POWERLEVEL9K_VPN_IP_CONTENT_EXPANSION=
|
||||||
# Regular expression for the VPN network interface. Run `ifconfig` or `ip -4 a show` while on VPN
|
# Regular expression for the VPN network interface. Run `ifconfig` or `ip -4 a show` while on VPN
|
||||||
# to see the name of the interface.
|
# to see the name of the interface.
|
||||||
typeset -g POWERLEVEL9K_VPN_IP_INTERFACE='(wg|(.*tun))[0-9]*'
|
typeset -g POWERLEVEL9K_VPN_IP_INTERFACE='(gpd|wg|(.*tun)|tailscale)[0-9]*|(zt.*)'
|
||||||
# If set to true, show one segment per matching network interface. If set to false, show only
|
# If set to true, show one segment per matching network interface. If set to false, show only
|
||||||
# one segment corresponding to the first matching network interface.
|
# one segment corresponding to the first matching network interface.
|
||||||
# Tip: If you set it to true, you'll probably want to unset POWERLEVEL9K_VPN_IP_CONTENT_EXPANSION.
|
# Tip: If you set it to true, you'll probably want to unset POWERLEVEL9K_VPN_IP_CONTENT_EXPANSION.
|
||||||
|
|
@ -1370,17 +1592,19 @@
|
||||||
# The following parameters are accessible within the expansion:
|
# The following parameters are accessible within the expansion:
|
||||||
#
|
#
|
||||||
# Parameter | Meaning
|
# Parameter | Meaning
|
||||||
# ----------------------+---------------
|
# ----------------------+-------------------------------------------
|
||||||
# P9K_IP_IP | IP address
|
# P9K_IP_IP | IP address
|
||||||
# P9K_IP_INTERFACE | network interface
|
# P9K_IP_INTERFACE | network interface
|
||||||
# P9K_IP_RX_BYTES | total number of bytes received
|
# P9K_IP_RX_BYTES | total number of bytes received
|
||||||
# P9K_IP_TX_BYTES | total number of bytes sent
|
# P9K_IP_TX_BYTES | total number of bytes sent
|
||||||
# P9K_IP_RX_RATE | receive rate (since last prompt)
|
# P9K_IP_RX_BYTES_DELTA | number of bytes received since last prompt
|
||||||
# P9K_IP_TX_RATE | send rate (since last prompt)
|
# P9K_IP_TX_BYTES_DELTA | number of bytes sent since last prompt
|
||||||
|
# P9K_IP_RX_RATE | receive rate (since last prompt)
|
||||||
|
# P9K_IP_TX_RATE | send rate (since last prompt)
|
||||||
typeset -g POWERLEVEL9K_IP_CONTENT_EXPANSION='${P9K_IP_RX_RATE:+%70F⇣$P9K_IP_RX_RATE }${P9K_IP_TX_RATE:+%215F⇡$P9K_IP_TX_RATE }%38F$P9K_IP_IP'
|
typeset -g POWERLEVEL9K_IP_CONTENT_EXPANSION='${P9K_IP_RX_RATE:+%70F⇣$P9K_IP_RX_RATE }${P9K_IP_TX_RATE:+%215F⇡$P9K_IP_TX_RATE }%38F$P9K_IP_IP'
|
||||||
# Show information for the first network interface whose name matches this regular expression.
|
# Show information for the first network interface whose name matches this regular expression.
|
||||||
# Run `ifconfig` or `ip -4 a show` to see the names of all network interfaces.
|
# Run `ifconfig` or `ip -4 a show` to see the names of all network interfaces.
|
||||||
typeset -g POWERLEVEL9K_IP_INTERFACE='e.*'
|
typeset -g POWERLEVEL9K_IP_INTERFACE='[ew].*'
|
||||||
# Custom icon.
|
# Custom icon.
|
||||||
# typeset -g POWERLEVEL9K_IP_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
# typeset -g POWERLEVEL9K_IP_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
||||||
|
|
||||||
|
|
@ -1423,15 +1647,11 @@
|
||||||
# Parameter | Meaning
|
# Parameter | Meaning
|
||||||
# ----------------------+---------------
|
# ----------------------+---------------
|
||||||
# P9K_WIFI_SSID | service set identifier, a.k.a. network name
|
# P9K_WIFI_SSID | service set identifier, a.k.a. network name
|
||||||
# P9K_WIFI_LINK_AUTH | authentication protocol such as "wpa2-psk" or "none"
|
# P9K_WIFI_LINK_AUTH | authentication protocol such as "wpa2-psk" or "none"; empty if unknown
|
||||||
# P9K_WIFI_LAST_TX_RATE | wireless transmit rate in megabits per second
|
# P9K_WIFI_LAST_TX_RATE | wireless transmit rate in megabits per second
|
||||||
# P9K_WIFI_RSSI | signal strength in dBm, from -120 to 0
|
# P9K_WIFI_RSSI | signal strength in dBm, from -120 to 0
|
||||||
# P9K_WIFI_NOISE | noise in dBm, from -120 to 0
|
# P9K_WIFI_NOISE | noise in dBm, from -120 to 0
|
||||||
# P9K_WIFI_BARS | signal strength in bars, from 0 to 4 (derived from P9K_WIFI_RSSI and P9K_WIFI_NOISE)
|
# P9K_WIFI_BARS | signal strength in bars, from 0 to 4 (derived from P9K_WIFI_RSSI and P9K_WIFI_NOISE)
|
||||||
#
|
|
||||||
# All parameters except P9K_WIFI_BARS are extracted from the output of the following command:
|
|
||||||
#
|
|
||||||
# /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -I
|
|
||||||
|
|
||||||
####################################[ time: current time ]####################################
|
####################################[ time: current time ]####################################
|
||||||
# Current time color.
|
# Current time color.
|
||||||
|
|
@ -1458,7 +1678,7 @@
|
||||||
|
|
||||||
# User-defined prompt segments may optionally provide an instant_prompt_* function. Its job
|
# User-defined prompt segments may optionally provide an instant_prompt_* function. Its job
|
||||||
# is to generate the prompt segment for display in instant prompt. See
|
# is to generate the prompt segment for display in instant prompt. See
|
||||||
# https://github.com/romkatv/powerlevel10k/blob/master/README.md#instant-prompt.
|
# https://github.com/romkatv/powerlevel10k#instant-prompt.
|
||||||
#
|
#
|
||||||
# Powerlevel10k will call instant_prompt_* at the same time as the regular prompt_* function
|
# Powerlevel10k will call instant_prompt_* at the same time as the regular prompt_* function
|
||||||
# and will record all `p10k segment` calls it makes. When displaying instant prompt, Powerlevel10k
|
# and will record all `p10k segment` calls it makes. When displaying instant prompt, Powerlevel10k
|
||||||
|
|
@ -1494,7 +1714,7 @@
|
||||||
# it incompatible with your zsh configuration files.
|
# it incompatible with your zsh configuration files.
|
||||||
# - quiet: Enable instant prompt and don't print warnings when detecting console output
|
# - quiet: Enable instant prompt and don't print warnings when detecting console output
|
||||||
# during zsh initialization. Choose this if you've read and understood
|
# during zsh initialization. Choose this if you've read and understood
|
||||||
# https://github.com/romkatv/powerlevel10k/blob/master/README.md#instant-prompt.
|
# https://github.com/romkatv/powerlevel10k#instant-prompt.
|
||||||
# - verbose: Enable instant prompt and print a warning when detecting console output during
|
# - verbose: Enable instant prompt and print a warning when detecting console output during
|
||||||
# zsh initialization. Choose this if you've never tried instant prompt, haven't
|
# zsh initialization. Choose this if you've never tried instant prompt, haven't
|
||||||
# seen the warning, or if you are unsure what this all means.
|
# seen the warning, or if you are unsure what this all means.
|
||||||
|
|
|
||||||
|
|
@ -17,10 +17,10 @@
|
||||||
|
|
||||||
# Unset all configuration options. This allows you to apply configuration changes without
|
# Unset all configuration options. This allows you to apply configuration changes without
|
||||||
# restarting zsh. Edit ~/.p10k.zsh and type `source ~/.p10k.zsh`.
|
# restarting zsh. Edit ~/.p10k.zsh and type `source ~/.p10k.zsh`.
|
||||||
unset -m 'POWERLEVEL9K_*|DEFAULT_USER'
|
unset -m '(POWERLEVEL9K_*|DEFAULT_USER)~POWERLEVEL9K_GITSTATUS_DIR'
|
||||||
|
|
||||||
# Zsh >= 5.1 is required.
|
# Zsh >= 5.1 is required.
|
||||||
autoload -Uz is-at-least && is-at-least 5.1 || return
|
[[ $ZSH_VERSION == (5.<1->*|<6->.*) ]] || return
|
||||||
|
|
||||||
# The list of segments shown on the left. Fill it with the most important segments.
|
# The list of segments shown on the left. Fill it with the most important segments.
|
||||||
typeset -g POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(
|
typeset -g POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(
|
||||||
|
|
@ -65,22 +65,30 @@
|
||||||
luaenv # lua version from luaenv (https://github.com/cehoffman/luaenv)
|
luaenv # lua version from luaenv (https://github.com/cehoffman/luaenv)
|
||||||
jenv # java version from jenv (https://github.com/jenv/jenv)
|
jenv # java version from jenv (https://github.com/jenv/jenv)
|
||||||
plenv # perl version from plenv (https://github.com/tokuhirom/plenv)
|
plenv # perl version from plenv (https://github.com/tokuhirom/plenv)
|
||||||
|
perlbrew # perl version from perlbrew (https://github.com/gugod/App-perlbrew)
|
||||||
phpenv # php version from phpenv (https://github.com/phpenv/phpenv)
|
phpenv # php version from phpenv (https://github.com/phpenv/phpenv)
|
||||||
|
scalaenv # scala version from scalaenv (https://github.com/scalaenv/scalaenv)
|
||||||
haskell_stack # haskell version from stack (https://haskellstack.org/)
|
haskell_stack # haskell version from stack (https://haskellstack.org/)
|
||||||
kubecontext # current kubernetes context (https://kubernetes.io/)
|
kubecontext # current kubernetes context (https://kubernetes.io/)
|
||||||
terraform # terraform workspace (https://www.terraform.io)
|
terraform # terraform workspace (https://www.terraform.io)
|
||||||
|
# terraform_version # terraform version (https://www.terraform.io)
|
||||||
aws # aws profile (https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html)
|
aws # aws profile (https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html)
|
||||||
aws_eb_env # aws elastic beanstalk environment (https://aws.amazon.com/elasticbeanstalk/)
|
aws_eb_env # aws elastic beanstalk environment (https://aws.amazon.com/elasticbeanstalk/)
|
||||||
azure # azure account name (https://docs.microsoft.com/en-us/cli/azure)
|
azure # azure account name (https://docs.microsoft.com/en-us/cli/azure)
|
||||||
gcloud # google cloud cli account and project (https://cloud.google.com/)
|
gcloud # google cloud cli account and project (https://cloud.google.com/)
|
||||||
google_app_cred # google application credentials (https://cloud.google.com/docs/authentication/production)
|
google_app_cred # google application credentials (https://cloud.google.com/docs/authentication/production)
|
||||||
|
toolbox # toolbox name (https://github.com/containers/toolbox)
|
||||||
context # user@hostname
|
context # user@hostname
|
||||||
nordvpn # nordvpn connection status, linux only (https://nordvpn.com/)
|
nordvpn # nordvpn connection status, linux only (https://nordvpn.com/)
|
||||||
ranger # ranger shell (https://github.com/ranger/ranger)
|
ranger # ranger shell (https://github.com/ranger/ranger)
|
||||||
|
yazi # yazi shell (https://github.com/sxyazi/yazi)
|
||||||
nnn # nnn shell (https://github.com/jarun/nnn)
|
nnn # nnn shell (https://github.com/jarun/nnn)
|
||||||
|
lf # lf shell (https://github.com/gokcehan/lf)
|
||||||
|
xplr # xplr shell (https://github.com/sayanarijit/xplr)
|
||||||
vim_shell # vim shell indicator (:sh)
|
vim_shell # vim shell indicator (:sh)
|
||||||
midnight_commander # midnight commander shell (https://midnight-commander.org/)
|
midnight_commander # midnight commander shell (https://midnight-commander.org/)
|
||||||
nix_shell # nix shell (https://nixos.org/nixos/nix-pills/developing-with-nix-shell.html)
|
nix_shell # nix shell (https://nixos.org/nixos/nix-pills/developing-with-nix-shell.html)
|
||||||
|
chezmoi_shell # chezmoi shell (https://www.chezmoi.io/)
|
||||||
# vpn_ip # virtual private network indicator
|
# vpn_ip # virtual private network indicator
|
||||||
# load # CPU load
|
# load # CPU load
|
||||||
# disk_usage # disk usage
|
# disk_usage # disk usage
|
||||||
|
|
@ -89,6 +97,8 @@
|
||||||
todo # todo items (https://github.com/todotxt/todo.txt-cli)
|
todo # todo items (https://github.com/todotxt/todo.txt-cli)
|
||||||
timewarrior # timewarrior tracking status (https://timewarrior.net/)
|
timewarrior # timewarrior tracking status (https://timewarrior.net/)
|
||||||
taskwarrior # taskwarrior task count (https://taskwarrior.org/)
|
taskwarrior # taskwarrior task count (https://taskwarrior.org/)
|
||||||
|
per_directory_history # Oh My Zsh per-directory-history local/global indicator
|
||||||
|
# cpu_arch # CPU architecture
|
||||||
# time # current time
|
# time # current time
|
||||||
# =========================[ Line #2 ]=========================
|
# =========================[ Line #2 ]=========================
|
||||||
newline # \n
|
newline # \n
|
||||||
|
|
@ -186,7 +196,7 @@
|
||||||
# Prompt symbol in command vi mode.
|
# Prompt symbol in command vi mode.
|
||||||
typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VICMD_CONTENT_EXPANSION='❮'
|
typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VICMD_CONTENT_EXPANSION='❮'
|
||||||
# Prompt symbol in visual vi mode.
|
# Prompt symbol in visual vi mode.
|
||||||
typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIVIS_CONTENT_EXPANSION='Ⅴ'
|
typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIVIS_CONTENT_EXPANSION='V'
|
||||||
# Prompt symbol in overwrite vi mode.
|
# Prompt symbol in overwrite vi mode.
|
||||||
typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIOWR_CONTENT_EXPANSION='▶'
|
typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIOWR_CONTENT_EXPANSION='▶'
|
||||||
typeset -g POWERLEVEL9K_PROMPT_CHAR_OVERWRITE_STATE=true
|
typeset -g POWERLEVEL9K_PROMPT_CHAR_OVERWRITE_STATE=true
|
||||||
|
|
@ -224,7 +234,8 @@
|
||||||
.java-version
|
.java-version
|
||||||
.perl-version
|
.perl-version
|
||||||
.php-version
|
.php-version
|
||||||
.tool-version
|
.tool-versions
|
||||||
|
.mise.toml
|
||||||
.shorten_folder_marker
|
.shorten_folder_marker
|
||||||
.svn
|
.svn
|
||||||
.terraform
|
.terraform
|
||||||
|
|
@ -241,6 +252,11 @@
|
||||||
# /foo/bar/git_repo/nested_git_repo/baz, prompt will display git_repo/nested_git_repo/baz (first)
|
# /foo/bar/git_repo/nested_git_repo/baz, prompt will display git_repo/nested_git_repo/baz (first)
|
||||||
# or nested_git_repo/baz (last). This assumes that git_repo and nested_git_repo contain markers
|
# or nested_git_repo/baz (last). This assumes that git_repo and nested_git_repo contain markers
|
||||||
# and other directories don't.
|
# and other directories don't.
|
||||||
|
#
|
||||||
|
# Optionally, "first" and "last" can be followed by ":<offset>" where <offset> is an integer.
|
||||||
|
# This moves the truncation point to the right (positive offset) or to the left (negative offset)
|
||||||
|
# relative to the marker. Plain "first" and "last" are equivalent to "first:0" and "last:0"
|
||||||
|
# respectively.
|
||||||
typeset -g POWERLEVEL9K_DIR_TRUNCATE_BEFORE_MARKER=false
|
typeset -g POWERLEVEL9K_DIR_TRUNCATE_BEFORE_MARKER=false
|
||||||
# Don't shorten this many last directory segments. They are anchors.
|
# Don't shorten this many last directory segments. They are anchors.
|
||||||
typeset -g POWERLEVEL9K_SHORTEN_DIR_LENGTH=1
|
typeset -g POWERLEVEL9K_SHORTEN_DIR_LENGTH=1
|
||||||
|
|
@ -262,12 +278,12 @@
|
||||||
# the full directory that was used in previous commands.
|
# the full directory that was used in previous commands.
|
||||||
typeset -g POWERLEVEL9K_DIR_HYPERLINK=false
|
typeset -g POWERLEVEL9K_DIR_HYPERLINK=false
|
||||||
|
|
||||||
# Enable special styling for non-writable directories. See POWERLEVEL9K_LOCK_ICON and
|
# Enable special styling for non-writable and non-existent directories. See POWERLEVEL9K_LOCK_ICON
|
||||||
# POWERLEVEL9K_DIR_CLASSES below.
|
# and POWERLEVEL9K_DIR_CLASSES below.
|
||||||
typeset -g POWERLEVEL9K_DIR_SHOW_WRITABLE=v2
|
typeset -g POWERLEVEL9K_DIR_SHOW_WRITABLE=v3
|
||||||
|
|
||||||
# The default icon shown next to non-writable directories when POWERLEVEL9K_DIR_SHOW_WRITABLE is
|
# The default icon shown next to non-writable and non-existent directories when
|
||||||
# set to v2.
|
# POWERLEVEL9K_DIR_SHOW_WRITABLE is set to v3.
|
||||||
# typeset -g POWERLEVEL9K_LOCK_ICON='⭐'
|
# typeset -g POWERLEVEL9K_LOCK_ICON='⭐'
|
||||||
|
|
||||||
# POWERLEVEL9K_DIR_CLASSES allows you to specify custom icons and colors for different
|
# POWERLEVEL9K_DIR_CLASSES allows you to specify custom icons and colors for different
|
||||||
|
|
@ -280,8 +296,8 @@
|
||||||
#
|
#
|
||||||
# Triplets are tried in order. The first triplet whose pattern matches $PWD wins.
|
# Triplets are tried in order. The first triplet whose pattern matches $PWD wins.
|
||||||
#
|
#
|
||||||
# If POWERLEVEL9K_DIR_SHOW_WRITABLE is set to v2 and the current directory is not writable,
|
# If POWERLEVEL9K_DIR_SHOW_WRITABLE is set to v3, non-writable and non-existent directories
|
||||||
# its class gets suffix _NOT_WRITABLE.
|
# acquire class suffix _NOT_WRITABLE and NON_EXISTENT respectively.
|
||||||
#
|
#
|
||||||
# For example, given these settings:
|
# For example, given these settings:
|
||||||
#
|
#
|
||||||
|
|
@ -290,10 +306,11 @@
|
||||||
# '~(|/*)' HOME ''
|
# '~(|/*)' HOME ''
|
||||||
# '*' DEFAULT '')
|
# '*' DEFAULT '')
|
||||||
#
|
#
|
||||||
# Whenever the current directory is ~/work or a subdirectory of ~/work, it gets styled with class
|
# Whenever the current directory is ~/work or a subdirectory of ~/work, it gets styled with one
|
||||||
# WORK or WORK_NOT_WRITABLE.
|
# of the following classes depending on its writability and existence: WORK, WORK_NOT_WRITABLE or
|
||||||
|
# WORK_NON_EXISTENT.
|
||||||
#
|
#
|
||||||
# Simply assigning classes to directories don't have any visible effects. It merely gives you an
|
# Simply assigning classes to directories doesn't have any visible effects. It merely gives you an
|
||||||
# option to define custom colors and icons for different directory classes.
|
# option to define custom colors and icons for different directory classes.
|
||||||
#
|
#
|
||||||
# # Styling for WORK.
|
# # Styling for WORK.
|
||||||
|
|
@ -306,7 +323,13 @@
|
||||||
# typeset -g POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
# typeset -g POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
||||||
# typeset -g POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_FOREGROUND=4
|
# typeset -g POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_FOREGROUND=4
|
||||||
# typeset -g POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_SHORTENED_FOREGROUND=4
|
# typeset -g POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_SHORTENED_FOREGROUND=4
|
||||||
# typeset -g POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_ANCHOR_FOREGROUND=4
|
# typeset -g POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_ANCHOR_FOREGROUND=4#
|
||||||
|
#
|
||||||
|
# Styling for WORK_NON_EXISTENT.
|
||||||
|
# typeset -g POWERLEVEL9K_DIR_WORK_NON_EXISTENT_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
||||||
|
# typeset -g POWERLEVEL9K_DIR_WORK_NON_EXISTENT_FOREGROUND=4
|
||||||
|
# typeset -g POWERLEVEL9K_DIR_WORK_NON_EXISTENT_SHORTENED_FOREGROUND=4
|
||||||
|
# typeset -g POWERLEVEL9K_DIR_WORK_NON_EXISTENT_ANCHOR_FOREGROUND=4
|
||||||
#
|
#
|
||||||
# If a styling parameter isn't explicitly defined for some class, it falls back to the classless
|
# If a styling parameter isn't explicitly defined for some class, it falls back to the classless
|
||||||
# parameter. For example, if POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_FOREGROUND is not set, it falls
|
# parameter. For example, if POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_FOREGROUND is not set, it falls
|
||||||
|
|
@ -318,7 +341,7 @@
|
||||||
# typeset -g POWERLEVEL9K_DIR_PREFIX='%fin '
|
# typeset -g POWERLEVEL9K_DIR_PREFIX='%fin '
|
||||||
|
|
||||||
#####################################[ vcs: git status ]######################################
|
#####################################[ vcs: git status ]######################################
|
||||||
# Branch icon. Set this parameter to '\uF126 ' for the popular Powerline branch icon.
|
# Branch icon. Set this parameter to '\UE0A0 ' for the popular Powerline branch icon.
|
||||||
typeset -g POWERLEVEL9K_VCS_BRANCH_ICON=
|
typeset -g POWERLEVEL9K_VCS_BRANCH_ICON=
|
||||||
|
|
||||||
# Untracked files icon. It's really a question mark, your font isn't broken.
|
# Untracked files icon. It's really a question mark, your font isn't broken.
|
||||||
|
|
@ -327,7 +350,7 @@
|
||||||
|
|
||||||
# Formatter for Git status.
|
# Formatter for Git status.
|
||||||
#
|
#
|
||||||
# Example output: master ⇣42⇡42 *42 merge ~42 +42 !42 ?42.
|
# Example output: master wip ⇣42⇡42 *42 merge ~42 +42 !42 ?42.
|
||||||
#
|
#
|
||||||
# You can edit the function to customize how Git status looks.
|
# You can edit the function to customize how Git status looks.
|
||||||
#
|
#
|
||||||
|
|
@ -360,35 +383,55 @@
|
||||||
fi
|
fi
|
||||||
|
|
||||||
local res
|
local res
|
||||||
local where # branch or tag
|
|
||||||
if [[ -n $VCS_STATUS_LOCAL_BRANCH ]]; then
|
if [[ -n $VCS_STATUS_LOCAL_BRANCH ]]; then
|
||||||
res+="${clean}${(g::)POWERLEVEL9K_VCS_BRANCH_ICON}"
|
local branch=${(V)VCS_STATUS_LOCAL_BRANCH}
|
||||||
where=${(V)VCS_STATUS_LOCAL_BRANCH}
|
# If local branch name is at most 32 characters long, show it in full.
|
||||||
elif [[ -n $VCS_STATUS_TAG ]]; then
|
# Otherwise show the first 12 … the last 12.
|
||||||
res+="${meta}#"
|
# Tip: To always show local branch name in full without truncation, delete the next line.
|
||||||
where=${(V)VCS_STATUS_TAG}
|
(( $#branch > 32 )) && branch[13,-13]="…" # <-- this line
|
||||||
|
res+="${clean}${(g::)POWERLEVEL9K_VCS_BRANCH_ICON}${branch//\%/%%}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# If local branch name or tag is at most 32 characters long, show it in full.
|
if [[ -n $VCS_STATUS_TAG
|
||||||
# Otherwise show the first 12 … the last 12.
|
# Show tag only if not on a branch.
|
||||||
# Tip: To always show local branch name in full without truncation, delete the next line.
|
# Tip: To always show tag, delete the next line.
|
||||||
(( $#where > 32 )) && where[13,-13]="…"
|
&& -z $VCS_STATUS_LOCAL_BRANCH # <-- this line
|
||||||
res+="${clean}${where//\%/%%}" # escape %
|
]]; then
|
||||||
|
local tag=${(V)VCS_STATUS_TAG}
|
||||||
|
# If tag name is at most 32 characters long, show it in full.
|
||||||
|
# Otherwise show the first 12 … the last 12.
|
||||||
|
# Tip: To always show tag name in full without truncation, delete the next line.
|
||||||
|
(( $#tag > 32 )) && tag[13,-13]="…" # <-- this line
|
||||||
|
res+="${meta}#${clean}${tag//\%/%%}"
|
||||||
|
fi
|
||||||
|
|
||||||
# Display the current Git commit if there is no branch or tag.
|
# Display the current Git commit if there is no branch and no tag.
|
||||||
# Tip: To always display the current Git commit, remove `[[ -z $where ]] &&` from the next line.
|
# Tip: To always display the current Git commit, delete the next line.
|
||||||
[[ -z $where ]] && res+="${meta}@${clean}${VCS_STATUS_COMMIT[1,8]}"
|
[[ -z $VCS_STATUS_LOCAL_BRANCH && -z $VCS_STATUS_TAG ]] && # <-- this line
|
||||||
|
res+="${meta}@${clean}${VCS_STATUS_COMMIT[1,8]}"
|
||||||
|
|
||||||
# Show tracking branch name if it differs from local branch.
|
# Show tracking branch name if it differs from local branch.
|
||||||
if [[ -n ${VCS_STATUS_REMOTE_BRANCH:#$VCS_STATUS_LOCAL_BRANCH} ]]; then
|
if [[ -n ${VCS_STATUS_REMOTE_BRANCH:#$VCS_STATUS_LOCAL_BRANCH} ]]; then
|
||||||
res+="${meta}:${clean}${(V)VCS_STATUS_REMOTE_BRANCH//\%/%%}" # escape %
|
res+="${meta}:${clean}${(V)VCS_STATUS_REMOTE_BRANCH//\%/%%}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Display "wip" if the latest commit's summary contains "wip" or "WIP".
|
||||||
|
if [[ $VCS_STATUS_COMMIT_SUMMARY == (|*[^[:alnum:]])(wip|WIP)(|[^[:alnum:]]*) ]]; then
|
||||||
|
res+=" ${modified}wip"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if (( VCS_STATUS_COMMITS_AHEAD || VCS_STATUS_COMMITS_BEHIND )); then
|
||||||
|
# ⇣42 if behind the remote.
|
||||||
|
(( VCS_STATUS_COMMITS_BEHIND )) && res+=" ${clean}⇣${VCS_STATUS_COMMITS_BEHIND}"
|
||||||
|
# ⇡42 if ahead of the remote; no leading space if also behind the remote: ⇣42⇡42.
|
||||||
|
(( VCS_STATUS_COMMITS_AHEAD && !VCS_STATUS_COMMITS_BEHIND )) && res+=" "
|
||||||
|
(( VCS_STATUS_COMMITS_AHEAD )) && res+="${clean}⇡${VCS_STATUS_COMMITS_AHEAD}"
|
||||||
|
elif [[ -n $VCS_STATUS_REMOTE_BRANCH ]]; then
|
||||||
|
# Tip: Uncomment the next line to display '=' if up to date with the remote.
|
||||||
|
# res+=" ${clean}="
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# ⇣42 if behind the remote.
|
|
||||||
(( VCS_STATUS_COMMITS_BEHIND )) && res+=" ${clean}⇣${VCS_STATUS_COMMITS_BEHIND}"
|
|
||||||
# ⇡42 if ahead of the remote; no leading space if also behind the remote: ⇣42⇡42.
|
|
||||||
(( VCS_STATUS_COMMITS_AHEAD && !VCS_STATUS_COMMITS_BEHIND )) && res+=" "
|
|
||||||
(( VCS_STATUS_COMMITS_AHEAD )) && res+="${clean}⇡${VCS_STATUS_COMMITS_AHEAD}"
|
|
||||||
# ⇠42 if behind the push remote.
|
# ⇠42 if behind the push remote.
|
||||||
(( VCS_STATUS_PUSH_COMMITS_BEHIND )) && res+=" ${clean}⇠${VCS_STATUS_PUSH_COMMITS_BEHIND}"
|
(( VCS_STATUS_PUSH_COMMITS_BEHIND )) && res+=" ${clean}⇠${VCS_STATUS_PUSH_COMMITS_BEHIND}"
|
||||||
(( VCS_STATUS_PUSH_COMMITS_AHEAD && !VCS_STATUS_PUSH_COMMITS_BEHIND )) && res+=" "
|
(( VCS_STATUS_PUSH_COMMITS_AHEAD && !VCS_STATUS_PUSH_COMMITS_BEHIND )) && res+=" "
|
||||||
|
|
@ -430,7 +473,7 @@
|
||||||
|
|
||||||
# Don't show Git status in prompt for repositories whose workdir matches this pattern.
|
# Don't show Git status in prompt for repositories whose workdir matches this pattern.
|
||||||
# For example, if set to '~', the Git repository at $HOME/.git will be ignored.
|
# For example, if set to '~', the Git repository at $HOME/.git will be ignored.
|
||||||
# Multiple patterns can be combined with '|': '~|~/some/dir'.
|
# Multiple patterns can be combined with '|': '~(|/foo)|/bar/baz/*'.
|
||||||
typeset -g POWERLEVEL9K_VCS_DISABLED_WORKDIR_PATTERN='~'
|
typeset -g POWERLEVEL9K_VCS_DISABLED_WORKDIR_PATTERN='~'
|
||||||
|
|
||||||
# Disable the default Git status formatting.
|
# Disable the default Git status formatting.
|
||||||
|
|
@ -451,10 +494,10 @@
|
||||||
|
|
||||||
# Show status of repositories of these types. You can add svn and/or hg if you are
|
# Show status of repositories of these types. You can add svn and/or hg if you are
|
||||||
# using them. If you do, your prompt may become slow even when your current directory
|
# using them. If you do, your prompt may become slow even when your current directory
|
||||||
# isn't in an svn or hg reposotiry.
|
# isn't in an svn or hg repository.
|
||||||
typeset -g POWERLEVEL9K_VCS_BACKENDS=(git)
|
typeset -g POWERLEVEL9K_VCS_BACKENDS=(git)
|
||||||
|
|
||||||
# These settings are used for respositories other than Git or when gitstatusd fails and
|
# These settings are used for repositories other than Git or when gitstatusd fails and
|
||||||
# Powerlevel10k has to fall back to using vcs_info.
|
# Powerlevel10k has to fall back to using vcs_info.
|
||||||
typeset -g POWERLEVEL9K_VCS_CLEAN_FOREGROUND=2
|
typeset -g POWERLEVEL9K_VCS_CLEAN_FOREGROUND=2
|
||||||
typeset -g POWERLEVEL9K_VCS_UNTRACKED_FOREGROUND=2
|
typeset -g POWERLEVEL9K_VCS_UNTRACKED_FOREGROUND=2
|
||||||
|
|
@ -497,7 +540,7 @@
|
||||||
typeset -g POWERLEVEL9K_STATUS_ERROR_PIPE_VISUAL_IDENTIFIER_EXPANSION='✘'
|
typeset -g POWERLEVEL9K_STATUS_ERROR_PIPE_VISUAL_IDENTIFIER_EXPANSION='✘'
|
||||||
|
|
||||||
###################[ command_execution_time: duration of the last command ]###################
|
###################[ command_execution_time: duration of the last command ]###################
|
||||||
# Show duration of the last command if takes longer than this many seconds.
|
# Show duration of the last command if takes at least this many seconds.
|
||||||
typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_THRESHOLD=3
|
typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_THRESHOLD=3
|
||||||
# Show this many fractional digits. Zero means round to seconds.
|
# Show this many fractional digits. Zero means round to seconds.
|
||||||
typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_PRECISION=0
|
typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_PRECISION=0
|
||||||
|
|
@ -526,6 +569,7 @@
|
||||||
|
|
||||||
###############[ asdf: asdf version manager (https://github.com/asdf-vm/asdf) ]###############
|
###############[ asdf: asdf version manager (https://github.com/asdf-vm/asdf) ]###############
|
||||||
# Default asdf color. Only used to display tools for which there is no color override (see below).
|
# Default asdf color. Only used to display tools for which there is no color override (see below).
|
||||||
|
# Tip: Override this parameter for ${TOOL} with POWERLEVEL9K_ASDF_${TOOL}_FOREGROUND.
|
||||||
typeset -g POWERLEVEL9K_ASDF_FOREGROUND=6
|
typeset -g POWERLEVEL9K_ASDF_FOREGROUND=6
|
||||||
|
|
||||||
# There are four parameters that can be used to hide asdf tools. Each parameter describes
|
# There are four parameters that can be used to hide asdf tools. Each parameter describes
|
||||||
|
|
@ -571,7 +615,7 @@
|
||||||
typeset -g POWERLEVEL9K_ASDF_SHOW_SYSTEM=true
|
typeset -g POWERLEVEL9K_ASDF_SHOW_SYSTEM=true
|
||||||
|
|
||||||
# If set to non-empty value, hide tools unless there is a file matching the specified file pattern
|
# If set to non-empty value, hide tools unless there is a file matching the specified file pattern
|
||||||
# in the current directory, or its parent diretory, or its grandparent directory, and so on.
|
# in the current directory, or its parent directory, or its grandparent directory, and so on.
|
||||||
#
|
#
|
||||||
# Note: If this parameter is set to empty value, it won't hide tools.
|
# Note: If this parameter is set to empty value, it won't hide tools.
|
||||||
# Note: SHOW_ON_UPGLOB isn't specific to asdf. It works with all prompt segments.
|
# Note: SHOW_ON_UPGLOB isn't specific to asdf. It works with all prompt segments.
|
||||||
|
|
@ -658,6 +702,11 @@
|
||||||
# typeset -g POWERLEVEL9K_ASDF_HASKELL_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
# typeset -g POWERLEVEL9K_ASDF_HASKELL_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
||||||
# typeset -g POWERLEVEL9K_ASDF_HASKELL_SHOW_ON_UPGLOB='*.foo|*.bar'
|
# typeset -g POWERLEVEL9K_ASDF_HASKELL_SHOW_ON_UPGLOB='*.foo|*.bar'
|
||||||
|
|
||||||
|
# Julia version from asdf.
|
||||||
|
typeset -g POWERLEVEL9K_ASDF_JULIA_FOREGROUND=2
|
||||||
|
# typeset -g POWERLEVEL9K_ASDF_JULIA_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
||||||
|
# typeset -g POWERLEVEL9K_ASDF_JULIA_SHOW_ON_UPGLOB='*.foo|*.bar'
|
||||||
|
|
||||||
##########[ nordvpn: nordvpn connection status, linux only (https://nordvpn.com/) ]###########
|
##########[ nordvpn: nordvpn connection status, linux only (https://nordvpn.com/) ]###########
|
||||||
# NordVPN connection indicator color.
|
# NordVPN connection indicator color.
|
||||||
typeset -g POWERLEVEL9K_NORDVPN_FOREGROUND=6
|
typeset -g POWERLEVEL9K_NORDVPN_FOREGROUND=6
|
||||||
|
|
@ -672,6 +721,12 @@
|
||||||
typeset -g POWERLEVEL9K_RANGER_FOREGROUND=3
|
typeset -g POWERLEVEL9K_RANGER_FOREGROUND=3
|
||||||
# Custom icon.
|
# Custom icon.
|
||||||
# typeset -g POWERLEVEL9K_RANGER_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
# typeset -g POWERLEVEL9K_RANGER_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
||||||
|
|
||||||
|
####################[ yazi: yazi shell (https://github.com/sxyazi/yazi) ]#####################
|
||||||
|
# Yazi shell color.
|
||||||
|
typeset -g POWERLEVEL9K_YAZI_FOREGROUND=3
|
||||||
|
# Custom icon.
|
||||||
|
# typeset -g POWERLEVEL9K_YAZI_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
||||||
|
|
||||||
######################[ nnn: nnn shell (https://github.com/jarun/nnn) ]#######################
|
######################[ nnn: nnn shell (https://github.com/jarun/nnn) ]#######################
|
||||||
# Nnn shell color.
|
# Nnn shell color.
|
||||||
|
|
@ -679,6 +734,18 @@
|
||||||
# Custom icon.
|
# Custom icon.
|
||||||
# typeset -g POWERLEVEL9K_NNN_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
# typeset -g POWERLEVEL9K_NNN_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
||||||
|
|
||||||
|
######################[ lf: lf shell (https://github.com/gokcehan/lf) ]#######################
|
||||||
|
# lf shell color.
|
||||||
|
typeset -g POWERLEVEL9K_LF_FOREGROUND=3
|
||||||
|
# Custom icon.
|
||||||
|
# typeset -g POWERLEVEL9K_LF_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
||||||
|
|
||||||
|
##################[ xplr: xplr shell (https://github.com/sayanarijit/xplr) ]##################
|
||||||
|
# xplr shell color.
|
||||||
|
typeset -g POWERLEVEL9K_XPLR_FOREGROUND=3
|
||||||
|
# Custom icon.
|
||||||
|
# typeset -g POWERLEVEL9K_XPLR_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
||||||
|
|
||||||
###########################[ vim_shell: vim shell indicator (:sh) ]###########################
|
###########################[ vim_shell: vim shell indicator (:sh) ]###########################
|
||||||
# Vim shell indicator color.
|
# Vim shell indicator color.
|
||||||
typeset -g POWERLEVEL9K_VIM_SHELL_FOREGROUND=3
|
typeset -g POWERLEVEL9K_VIM_SHELL_FOREGROUND=3
|
||||||
|
|
@ -695,12 +762,21 @@
|
||||||
# Nix shell color.
|
# Nix shell color.
|
||||||
typeset -g POWERLEVEL9K_NIX_SHELL_FOREGROUND=4
|
typeset -g POWERLEVEL9K_NIX_SHELL_FOREGROUND=4
|
||||||
|
|
||||||
|
# Display the icon of nix_shell if PATH contains a subdirectory of /nix/store.
|
||||||
|
# typeset -g POWERLEVEL9K_NIX_SHELL_INFER_FROM_PATH=false
|
||||||
|
|
||||||
# Tip: If you want to see just the icon without "pure" and "impure", uncomment the next line.
|
# Tip: If you want to see just the icon without "pure" and "impure", uncomment the next line.
|
||||||
# typeset -g POWERLEVEL9K_NIX_SHELL_CONTENT_EXPANSION=
|
# typeset -g POWERLEVEL9K_NIX_SHELL_CONTENT_EXPANSION=
|
||||||
|
|
||||||
# Custom icon.
|
# Custom icon.
|
||||||
# typeset -g POWERLEVEL9K_NIX_SHELL_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
# typeset -g POWERLEVEL9K_NIX_SHELL_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
||||||
|
|
||||||
|
##################[ chezmoi_shell: chezmoi shell (https://www.chezmoi.io/) ]##################
|
||||||
|
# chezmoi shell color.
|
||||||
|
typeset -g POWERLEVEL9K_CHEZMOI_SHELL_FOREGROUND=4
|
||||||
|
# Custom icon.
|
||||||
|
# typeset -g POWERLEVEL9K_CHEZMOI_SHELL_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
||||||
|
|
||||||
##################################[ disk_usage: disk usage ]##################################
|
##################################[ disk_usage: disk usage ]##################################
|
||||||
# Colors for different levels of disk usage.
|
# Colors for different levels of disk usage.
|
||||||
typeset -g POWERLEVEL9K_DISK_USAGE_NORMAL_FOREGROUND=2
|
typeset -g POWERLEVEL9K_DISK_USAGE_NORMAL_FOREGROUND=2
|
||||||
|
|
@ -777,7 +853,7 @@
|
||||||
##############[ taskwarrior: taskwarrior task count (https://taskwarrior.org/) ]##############
|
##############[ taskwarrior: taskwarrior task count (https://taskwarrior.org/) ]##############
|
||||||
# Taskwarrior color.
|
# Taskwarrior color.
|
||||||
typeset -g POWERLEVEL9K_TASKWARRIOR_FOREGROUND=6
|
typeset -g POWERLEVEL9K_TASKWARRIOR_FOREGROUND=6
|
||||||
|
|
||||||
# Taskwarrior segment format. The following parameters are available within the expansion.
|
# Taskwarrior segment format. The following parameters are available within the expansion.
|
||||||
#
|
#
|
||||||
# - P9K_TASKWARRIOR_PENDING_COUNT The number of pending tasks: `task +PENDING count`.
|
# - P9K_TASKWARRIOR_PENDING_COUNT The number of pending tasks: `task +PENDING count`.
|
||||||
|
|
@ -794,6 +870,30 @@
|
||||||
# Custom icon.
|
# Custom icon.
|
||||||
# typeset -g POWERLEVEL9K_TASKWARRIOR_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
# typeset -g POWERLEVEL9K_TASKWARRIOR_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
||||||
|
|
||||||
|
######[ per_directory_history: Oh My Zsh per-directory-history local/global indicator ]#######
|
||||||
|
# Color when using local/global history.
|
||||||
|
typeset -g POWERLEVEL9K_PER_DIRECTORY_HISTORY_LOCAL_FOREGROUND=5
|
||||||
|
typeset -g POWERLEVEL9K_PER_DIRECTORY_HISTORY_GLOBAL_FOREGROUND=3
|
||||||
|
|
||||||
|
# Tip: Uncomment the next two lines to hide "local"/"global" text and leave just the icon.
|
||||||
|
# typeset -g POWERLEVEL9K_PER_DIRECTORY_HISTORY_LOCAL_CONTENT_EXPANSION=''
|
||||||
|
# typeset -g POWERLEVEL9K_PER_DIRECTORY_HISTORY_GLOBAL_CONTENT_EXPANSION=''
|
||||||
|
|
||||||
|
# Custom icon.
|
||||||
|
# typeset -g POWERLEVEL9K_PER_DIRECTORY_HISTORY_LOCAL_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
||||||
|
# typeset -g POWERLEVEL9K_PER_DIRECTORY_HISTORY_GLOBAL_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
||||||
|
|
||||||
|
################################[ cpu_arch: CPU architecture ]################################
|
||||||
|
# CPU architecture color.
|
||||||
|
typeset -g POWERLEVEL9K_CPU_ARCH_FOREGROUND=3
|
||||||
|
|
||||||
|
# Hide the segment when on a specific CPU architecture.
|
||||||
|
# typeset -g POWERLEVEL9K_CPU_ARCH_X86_64_CONTENT_EXPANSION=
|
||||||
|
# typeset -g POWERLEVEL9K_CPU_ARCH_X86_64_VISUAL_IDENTIFIER_EXPANSION=
|
||||||
|
|
||||||
|
# Custom icon.
|
||||||
|
# typeset -g POWERLEVEL9K_CPU_ARCH_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
||||||
|
|
||||||
##################################[ context: user@hostname ]##################################
|
##################################[ context: user@hostname ]##################################
|
||||||
# Context color when running with privileges.
|
# Context color when running with privileges.
|
||||||
typeset -g POWERLEVEL9K_CONTEXT_ROOT_FOREGROUND=1
|
typeset -g POWERLEVEL9K_CONTEXT_ROOT_FOREGROUND=1
|
||||||
|
|
@ -823,6 +923,9 @@
|
||||||
typeset -g POWERLEVEL9K_VIRTUALENV_FOREGROUND=6
|
typeset -g POWERLEVEL9K_VIRTUALENV_FOREGROUND=6
|
||||||
# Don't show Python version next to the virtual environment name.
|
# Don't show Python version next to the virtual environment name.
|
||||||
typeset -g POWERLEVEL9K_VIRTUALENV_SHOW_PYTHON_VERSION=false
|
typeset -g POWERLEVEL9K_VIRTUALENV_SHOW_PYTHON_VERSION=false
|
||||||
|
# If set to "false", won't show virtualenv if pyenv is already shown.
|
||||||
|
# If set to "if-different", won't show virtualenv if it's the same as pyenv.
|
||||||
|
typeset -g POWERLEVEL9K_VIRTUALENV_SHOW_WITH_PYENV=false
|
||||||
# Separate environment name from Python version only with a space.
|
# Separate environment name from Python version only with a space.
|
||||||
typeset -g POWERLEVEL9K_VIRTUALENV_{LEFT,RIGHT}_DELIMITER=
|
typeset -g POWERLEVEL9K_VIRTUALENV_{LEFT,RIGHT}_DELIMITER=
|
||||||
# Custom icon.
|
# Custom icon.
|
||||||
|
|
@ -831,10 +934,33 @@
|
||||||
#####################[ anaconda: conda environment (https://conda.io/) ]######################
|
#####################[ anaconda: conda environment (https://conda.io/) ]######################
|
||||||
# Anaconda environment color.
|
# Anaconda environment color.
|
||||||
typeset -g POWERLEVEL9K_ANACONDA_FOREGROUND=6
|
typeset -g POWERLEVEL9K_ANACONDA_FOREGROUND=6
|
||||||
# Don't show Python version next to the anaconda environment name.
|
|
||||||
typeset -g POWERLEVEL9K_ANACONDA_SHOW_PYTHON_VERSION=false
|
# Anaconda segment format. The following parameters are available within the expansion.
|
||||||
# Separate environment name from Python version only with a space.
|
#
|
||||||
typeset -g POWERLEVEL9K_ANACONDA_{LEFT,RIGHT}_DELIMITER=
|
# - CONDA_PREFIX Absolute path to the active Anaconda/Miniconda environment.
|
||||||
|
# - CONDA_DEFAULT_ENV Name of the active Anaconda/Miniconda environment.
|
||||||
|
# - CONDA_PROMPT_MODIFIER Configurable prompt modifier (see below).
|
||||||
|
# - P9K_ANACONDA_PYTHON_VERSION Current python version (python --version).
|
||||||
|
#
|
||||||
|
# CONDA_PROMPT_MODIFIER can be configured with the following command:
|
||||||
|
#
|
||||||
|
# conda config --set env_prompt '({default_env}) '
|
||||||
|
#
|
||||||
|
# The last argument is a Python format string that can use the following variables:
|
||||||
|
#
|
||||||
|
# - prefix The same as CONDA_PREFIX.
|
||||||
|
# - default_env The same as CONDA_DEFAULT_ENV.
|
||||||
|
# - name The last segment of CONDA_PREFIX.
|
||||||
|
# - stacked_env Comma-separated list of names in the environment stack. The first element is
|
||||||
|
# always the same as default_env.
|
||||||
|
#
|
||||||
|
# Note: '({default_env}) ' is the default value of env_prompt.
|
||||||
|
#
|
||||||
|
# The default value of POWERLEVEL9K_ANACONDA_CONTENT_EXPANSION expands to $CONDA_PROMPT_MODIFIER
|
||||||
|
# without the surrounding parentheses, or to the last path component of CONDA_PREFIX if the former
|
||||||
|
# is empty.
|
||||||
|
typeset -g POWERLEVEL9K_ANACONDA_CONTENT_EXPANSION='${${${${CONDA_PROMPT_MODIFIER#\(}% }%\)}:-${CONDA_PREFIX:t}}'
|
||||||
|
|
||||||
# Custom icon.
|
# Custom icon.
|
||||||
# typeset -g POWERLEVEL9K_ANACONDA_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
# typeset -g POWERLEVEL9K_ANACONDA_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
||||||
|
|
||||||
|
|
@ -848,6 +974,19 @@
|
||||||
typeset -g POWERLEVEL9K_PYENV_PROMPT_ALWAYS_SHOW=false
|
typeset -g POWERLEVEL9K_PYENV_PROMPT_ALWAYS_SHOW=false
|
||||||
# If set to false, hide python version if it's equal to "system".
|
# If set to false, hide python version if it's equal to "system".
|
||||||
typeset -g POWERLEVEL9K_PYENV_SHOW_SYSTEM=true
|
typeset -g POWERLEVEL9K_PYENV_SHOW_SYSTEM=true
|
||||||
|
|
||||||
|
# Pyenv segment format. The following parameters are available within the expansion.
|
||||||
|
#
|
||||||
|
# - P9K_CONTENT Current pyenv environment (pyenv version-name).
|
||||||
|
# - P9K_PYENV_PYTHON_VERSION Current python version (python --version).
|
||||||
|
#
|
||||||
|
# The default format has the following logic:
|
||||||
|
#
|
||||||
|
# 1. Display just "$P9K_CONTENT" if it's equal to "$P9K_PYENV_PYTHON_VERSION" or
|
||||||
|
# starts with "$P9K_PYENV_PYTHON_VERSION/".
|
||||||
|
# 2. Otherwise display "$P9K_CONTENT $P9K_PYENV_PYTHON_VERSION".
|
||||||
|
typeset -g POWERLEVEL9K_PYENV_CONTENT_EXPANSION='${P9K_CONTENT}${${P9K_CONTENT:#$P9K_PYENV_PYTHON_VERSION(|/*)}:+ $P9K_PYENV_PYTHON_VERSION}'
|
||||||
|
|
||||||
# Custom icon.
|
# Custom icon.
|
||||||
# typeset -g POWERLEVEL9K_PYENV_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
# typeset -g POWERLEVEL9K_PYENV_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
||||||
|
|
||||||
|
|
@ -880,6 +1019,11 @@
|
||||||
##############[ nvm: node.js version from nvm (https://github.com/nvm-sh/nvm) ]###############
|
##############[ nvm: node.js version from nvm (https://github.com/nvm-sh/nvm) ]###############
|
||||||
# Nvm color.
|
# Nvm color.
|
||||||
typeset -g POWERLEVEL9K_NVM_FOREGROUND=2
|
typeset -g POWERLEVEL9K_NVM_FOREGROUND=2
|
||||||
|
# If set to false, hide node version if it's the same as default:
|
||||||
|
# $(nvm version current) == $(nvm version default).
|
||||||
|
typeset -g POWERLEVEL9K_NVM_PROMPT_ALWAYS_SHOW=false
|
||||||
|
# If set to false, hide node version if it's equal to "system".
|
||||||
|
typeset -g POWERLEVEL9K_NVM_SHOW_SYSTEM=true
|
||||||
# Custom icon.
|
# Custom icon.
|
||||||
# typeset -g POWERLEVEL9K_NVM_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
# typeset -g POWERLEVEL9K_NVM_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
||||||
|
|
||||||
|
|
@ -1029,6 +1173,16 @@
|
||||||
# Custom icon.
|
# Custom icon.
|
||||||
# typeset -g POWERLEVEL9K_PLENV_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
# typeset -g POWERLEVEL9K_PLENV_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
||||||
|
|
||||||
|
###########[ perlbrew: perl version from perlbrew (https://github.com/gugod/App-perlbrew) ]############
|
||||||
|
# Perlbrew color.
|
||||||
|
typeset -g POWERLEVEL9K_PERLBREW_FOREGROUND=67
|
||||||
|
# Show perlbrew version only when in a perl project subdirectory.
|
||||||
|
typeset -g POWERLEVEL9K_PERLBREW_PROJECT_ONLY=true
|
||||||
|
# Don't show "perl-" at the front.
|
||||||
|
typeset -g POWERLEVEL9K_PERLBREW_SHOW_PREFIX=false
|
||||||
|
# Custom icon.
|
||||||
|
# typeset -g POWERLEVEL9K_PERLBREW_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
||||||
|
|
||||||
############[ phpenv: php version from phpenv (https://github.com/phpenv/phpenv) ]############
|
############[ phpenv: php version from phpenv (https://github.com/phpenv/phpenv) ]############
|
||||||
# PHP color.
|
# PHP color.
|
||||||
typeset -g POWERLEVEL9K_PHPENV_FOREGROUND=5
|
typeset -g POWERLEVEL9K_PHPENV_FOREGROUND=5
|
||||||
|
|
@ -1042,6 +1196,19 @@
|
||||||
# Custom icon.
|
# Custom icon.
|
||||||
# typeset -g POWERLEVEL9K_PHPENV_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
# typeset -g POWERLEVEL9K_PHPENV_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
||||||
|
|
||||||
|
#######[ scalaenv: scala version from scalaenv (https://github.com/scalaenv/scalaenv) ]#######
|
||||||
|
# Scala color.
|
||||||
|
typeset -g POWERLEVEL9K_SCALAENV_FOREGROUND=1
|
||||||
|
# Hide scala version if it doesn't come from one of these sources.
|
||||||
|
typeset -g POWERLEVEL9K_SCALAENV_SOURCES=(shell local global)
|
||||||
|
# If set to false, hide scala version if it's the same as global:
|
||||||
|
# $(scalaenv version-name) == $(scalaenv global).
|
||||||
|
typeset -g POWERLEVEL9K_SCALAENV_PROMPT_ALWAYS_SHOW=false
|
||||||
|
# If set to false, hide scala version if it's equal to "system".
|
||||||
|
typeset -g POWERLEVEL9K_SCALAENV_SHOW_SYSTEM=true
|
||||||
|
# Custom icon.
|
||||||
|
# typeset -g POWERLEVEL9K_SCALAENV_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
||||||
|
|
||||||
##########[ haskell_stack: haskell version from stack (https://haskellstack.org/) ]###########
|
##########[ haskell_stack: haskell version from stack (https://haskellstack.org/) ]###########
|
||||||
# Haskell color.
|
# Haskell color.
|
||||||
typeset -g POWERLEVEL9K_HASKELL_STACK_FOREGROUND=3
|
typeset -g POWERLEVEL9K_HASKELL_STACK_FOREGROUND=3
|
||||||
|
|
@ -1057,9 +1224,9 @@
|
||||||
# typeset -g POWERLEVEL9K_HASKELL_STACK_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
# typeset -g POWERLEVEL9K_HASKELL_STACK_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
||||||
|
|
||||||
#############[ kubecontext: current kubernetes context (https://kubernetes.io/) ]#############
|
#############[ kubecontext: current kubernetes context (https://kubernetes.io/) ]#############
|
||||||
# Show kubecontext only when the the command you are typing invokes one of these tools.
|
# Show kubecontext only when the command you are typing invokes one of these tools.
|
||||||
# Tip: Remove the next line to always show kubecontext.
|
# Tip: Remove the next line to always show kubecontext.
|
||||||
typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito'
|
typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito|k9s|helmfile|flux|fluxctl|stern|kubeseal|skaffold|kubent|kubecolor|cmctl|sparkctl'
|
||||||
|
|
||||||
# Kubernetes context classes for the purpose of using different colors, icons and expansions with
|
# Kubernetes context classes for the purpose of using different colors, icons and expansions with
|
||||||
# different contexts.
|
# different contexts.
|
||||||
|
|
@ -1144,6 +1311,8 @@
|
||||||
# typeset -g POWERLEVEL9K_KUBECONTEXT_PREFIX='%fat '
|
# typeset -g POWERLEVEL9K_KUBECONTEXT_PREFIX='%fat '
|
||||||
|
|
||||||
################[ terraform: terraform workspace (https://www.terraform.io) ]#################
|
################[ terraform: terraform workspace (https://www.terraform.io) ]#################
|
||||||
|
# Don't show terraform workspace if it's literally "default".
|
||||||
|
typeset -g POWERLEVEL9K_TERRAFORM_SHOW_DEFAULT=false
|
||||||
# POWERLEVEL9K_TERRAFORM_CLASSES is an array with even number of elements. The first element
|
# POWERLEVEL9K_TERRAFORM_CLASSES is an array with even number of elements. The first element
|
||||||
# in each pair defines a pattern against which the current terraform workspace gets matched.
|
# in each pair defines a pattern against which the current terraform workspace gets matched.
|
||||||
# More specifically, it's P9K_CONTENT prior to the application of context expansion (see below)
|
# More specifically, it's P9K_CONTENT prior to the application of context expansion (see below)
|
||||||
|
|
@ -1157,7 +1326,7 @@
|
||||||
# typeset -g POWERLEVEL9K_TERRAFORM_CLASSES=(
|
# typeset -g POWERLEVEL9K_TERRAFORM_CLASSES=(
|
||||||
# '*prod*' PROD
|
# '*prod*' PROD
|
||||||
# '*test*' TEST
|
# '*test*' TEST
|
||||||
# '*' DEFAULT)
|
# '*' OTHER)
|
||||||
#
|
#
|
||||||
# If your current terraform workspace is "project_test", its class is TEST because "project_test"
|
# If your current terraform workspace is "project_test", its class is TEST because "project_test"
|
||||||
# doesn't match the pattern '*prod*' but does match '*test*'.
|
# doesn't match the pattern '*prod*' but does match '*test*'.
|
||||||
|
|
@ -1170,14 +1339,20 @@
|
||||||
typeset -g POWERLEVEL9K_TERRAFORM_CLASSES=(
|
typeset -g POWERLEVEL9K_TERRAFORM_CLASSES=(
|
||||||
# '*prod*' PROD # These values are examples that are unlikely
|
# '*prod*' PROD # These values are examples that are unlikely
|
||||||
# '*test*' TEST # to match your needs. Customize them as needed.
|
# '*test*' TEST # to match your needs. Customize them as needed.
|
||||||
'*' DEFAULT)
|
'*' OTHER)
|
||||||
typeset -g POWERLEVEL9K_TERRAFORM_DEFAULT_FOREGROUND=4
|
typeset -g POWERLEVEL9K_TERRAFORM_OTHER_FOREGROUND=4
|
||||||
# typeset -g POWERLEVEL9K_TERRAFORM_DEFAULT_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
# typeset -g POWERLEVEL9K_TERRAFORM_OTHER_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
||||||
|
|
||||||
|
#############[ terraform_version: terraform version (https://www.terraform.io) ]##############
|
||||||
|
# Terraform version color.
|
||||||
|
typeset -g POWERLEVEL9K_TERRAFORM_VERSION_FOREGROUND=4
|
||||||
|
# Custom icon.
|
||||||
|
# typeset -g POWERLEVEL9K_TERRAFORM_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
||||||
|
|
||||||
#[ aws: aws profile (https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html) ]#
|
#[ aws: aws profile (https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html) ]#
|
||||||
# Show aws only when the the command you are typing invokes one of these tools.
|
# Show aws only when the command you are typing invokes one of these tools.
|
||||||
# Tip: Remove the next line to always show aws.
|
# Tip: Remove the next line to always show aws.
|
||||||
typeset -g POWERLEVEL9K_AWS_SHOW_ON_COMMAND='aws|awless|terraform|pulumi'
|
typeset -g POWERLEVEL9K_AWS_SHOW_ON_COMMAND='aws|awless|cdk|terraform|pulumi|terragrunt'
|
||||||
|
|
||||||
# POWERLEVEL9K_AWS_CLASSES is an array with even number of elements. The first element
|
# POWERLEVEL9K_AWS_CLASSES is an array with even number of elements. The first element
|
||||||
# in each pair defines a pattern against which the current AWS profile gets matched.
|
# in each pair defines a pattern against which the current AWS profile gets matched.
|
||||||
|
|
@ -1209,6 +1384,12 @@
|
||||||
typeset -g POWERLEVEL9K_AWS_DEFAULT_FOREGROUND=3
|
typeset -g POWERLEVEL9K_AWS_DEFAULT_FOREGROUND=3
|
||||||
# typeset -g POWERLEVEL9K_AWS_DEFAULT_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
# typeset -g POWERLEVEL9K_AWS_DEFAULT_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
||||||
|
|
||||||
|
# AWS segment format. The following parameters are available within the expansion.
|
||||||
|
#
|
||||||
|
# - P9K_AWS_PROFILE The name of the current AWS profile.
|
||||||
|
# - P9K_AWS_REGION The region associated with the current AWS profile.
|
||||||
|
typeset -g POWERLEVEL9K_AWS_CONTENT_EXPANSION='${P9K_AWS_PROFILE//\%/%%}${P9K_AWS_REGION:+ ${P9K_AWS_REGION//\%/%%}}'
|
||||||
|
|
||||||
#[ aws_eb_env: aws elastic beanstalk environment (https://aws.amazon.com/elasticbeanstalk/) ]#
|
#[ aws_eb_env: aws elastic beanstalk environment (https://aws.amazon.com/elasticbeanstalk/) ]#
|
||||||
# AWS Elastic Beanstalk environment color.
|
# AWS Elastic Beanstalk environment color.
|
||||||
typeset -g POWERLEVEL9K_AWS_EB_ENV_FOREGROUND=2
|
typeset -g POWERLEVEL9K_AWS_EB_ENV_FOREGROUND=2
|
||||||
|
|
@ -1216,18 +1397,47 @@
|
||||||
# typeset -g POWERLEVEL9K_AWS_EB_ENV_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
# typeset -g POWERLEVEL9K_AWS_EB_ENV_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
||||||
|
|
||||||
##########[ azure: azure account name (https://docs.microsoft.com/en-us/cli/azure) ]##########
|
##########[ azure: azure account name (https://docs.microsoft.com/en-us/cli/azure) ]##########
|
||||||
# Show azure only when the the command you are typing invokes one of these tools.
|
# Show azure only when the command you are typing invokes one of these tools.
|
||||||
# Tip: Remove the next line to always show azure.
|
# Tip: Remove the next line to always show azure.
|
||||||
typeset -g POWERLEVEL9K_AZURE_SHOW_ON_COMMAND='az|terraform|pulumi'
|
typeset -g POWERLEVEL9K_AZURE_SHOW_ON_COMMAND='az|terraform|pulumi|terragrunt'
|
||||||
|
|
||||||
|
# POWERLEVEL9K_AZURE_CLASSES is an array with even number of elements. The first element
|
||||||
|
# in each pair defines a pattern against which the current azure account name gets matched.
|
||||||
|
# More specifically, it's P9K_CONTENT prior to the application of context expansion (see below)
|
||||||
|
# that gets matched. If you unset all POWERLEVEL9K_AZURE_*CONTENT_EXPANSION parameters,
|
||||||
|
# you'll see this value in your prompt. The second element of each pair in
|
||||||
|
# POWERLEVEL9K_AZURE_CLASSES defines the account class. Patterns are tried in order. The
|
||||||
|
# first match wins.
|
||||||
|
#
|
||||||
|
# For example, given these settings:
|
||||||
|
#
|
||||||
|
# typeset -g POWERLEVEL9K_AZURE_CLASSES=(
|
||||||
|
# '*prod*' PROD
|
||||||
|
# '*test*' TEST
|
||||||
|
# '*' OTHER)
|
||||||
|
#
|
||||||
|
# If your current azure account is "company_test", its class is TEST because "company_test"
|
||||||
|
# doesn't match the pattern '*prod*' but does match '*test*'.
|
||||||
|
#
|
||||||
|
# You can define different colors, icons and content expansions for different classes:
|
||||||
|
#
|
||||||
|
# typeset -g POWERLEVEL9K_AZURE_TEST_FOREGROUND=2
|
||||||
|
# typeset -g POWERLEVEL9K_AZURE_TEST_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
||||||
|
# typeset -g POWERLEVEL9K_AZURE_TEST_CONTENT_EXPANSION='> ${P9K_CONTENT} <'
|
||||||
|
typeset -g POWERLEVEL9K_AZURE_CLASSES=(
|
||||||
|
# '*prod*' PROD # These values are examples that are unlikely
|
||||||
|
# '*test*' TEST # to match your needs. Customize them as needed.
|
||||||
|
'*' OTHER)
|
||||||
|
|
||||||
# Azure account name color.
|
# Azure account name color.
|
||||||
typeset -g POWERLEVEL9K_AZURE_FOREGROUND=4
|
typeset -g POWERLEVEL9K_AZURE_OTHER_FOREGROUND=4
|
||||||
# Custom icon.
|
# Custom icon.
|
||||||
# typeset -g POWERLEVEL9K_AZURE_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
# typeset -g POWERLEVEL9K_AZURE_OTHER_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
||||||
|
|
||||||
##########[ gcloud: google cloud account and project (https://cloud.google.com/) ]###########
|
##########[ gcloud: google cloud account and project (https://cloud.google.com/) ]###########
|
||||||
# Show gcloud only when the the command you are typing invokes one of these tools.
|
# Show gcloud only when the command you are typing invokes one of these tools.
|
||||||
# Tip: Remove the next line to always show gcloud.
|
# Tip: Remove the next line to always show gcloud.
|
||||||
typeset -g POWERLEVEL9K_GCLOUD_SHOW_ON_COMMAND='gcloud|gcs'
|
typeset -g POWERLEVEL9K_GCLOUD_SHOW_ON_COMMAND='gcloud|gcs|gsutil'
|
||||||
# Google cloud color.
|
# Google cloud color.
|
||||||
typeset -g POWERLEVEL9K_GCLOUD_FOREGROUND=4
|
typeset -g POWERLEVEL9K_GCLOUD_FOREGROUND=4
|
||||||
|
|
||||||
|
|
@ -1243,7 +1453,7 @@
|
||||||
# P9K_GCLOUD_PROJECT_ID | gcloud config get-value project
|
# P9K_GCLOUD_PROJECT_ID | gcloud config get-value project
|
||||||
# P9K_GCLOUD_PROJECT_NAME | gcloud projects describe $P9K_GCLOUD_PROJECT_ID --format='value(name)'
|
# P9K_GCLOUD_PROJECT_NAME | gcloud projects describe $P9K_GCLOUD_PROJECT_ID --format='value(name)'
|
||||||
#
|
#
|
||||||
# Note: ${VARIABLE//\%/%%} expands to ${VARIABLE} with all occurences of '%' replaced with '%%'.
|
# Note: ${VARIABLE//\%/%%} expands to ${VARIABLE} with all occurrences of '%' replaced with '%%'.
|
||||||
#
|
#
|
||||||
# Obtaining project name requires sending a request to Google servers. This can take a long time
|
# Obtaining project name requires sending a request to Google servers. This can take a long time
|
||||||
# and even fail. When project name is unknown, P9K_GCLOUD_PROJECT_NAME is not set and gcloud
|
# and even fail. When project name is unknown, P9K_GCLOUD_PROJECT_NAME is not set and gcloud
|
||||||
|
|
@ -1266,9 +1476,9 @@
|
||||||
# typeset -g POWERLEVEL9K_GCLOUD_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
# typeset -g POWERLEVEL9K_GCLOUD_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
||||||
|
|
||||||
#[ google_app_cred: google application credentials (https://cloud.google.com/docs/authentication/production) ]#
|
#[ google_app_cred: google application credentials (https://cloud.google.com/docs/authentication/production) ]#
|
||||||
# Show google_app_cred only when the the command you are typing invokes one of these tools.
|
# Show google_app_cred only when the command you are typing invokes one of these tools.
|
||||||
# Tip: Remove the next line to always show google_app_cred.
|
# Tip: Remove the next line to always show google_app_cred.
|
||||||
typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_SHOW_ON_COMMAND='terraform|pulumi'
|
typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_SHOW_ON_COMMAND='terraform|pulumi|terragrunt'
|
||||||
|
|
||||||
# Google application credentials classes for the purpose of using different colors, icons and
|
# Google application credentials classes for the purpose of using different colors, icons and
|
||||||
# expansions with different credentials.
|
# expansions with different credentials.
|
||||||
|
|
@ -1316,9 +1526,19 @@
|
||||||
# P9K_GOOGLE_APP_CRED_PROJECT_ID | project_id
|
# P9K_GOOGLE_APP_CRED_PROJECT_ID | project_id
|
||||||
# P9K_GOOGLE_APP_CRED_CLIENT_EMAIL | client_email
|
# P9K_GOOGLE_APP_CRED_CLIENT_EMAIL | client_email
|
||||||
#
|
#
|
||||||
# Note: ${VARIABLE//\%/%%} expands to ${VARIABLE} with all occurences of '%' replaced by '%%'.
|
# Note: ${VARIABLE//\%/%%} expands to ${VARIABLE} with all occurrences of '%' replaced by '%%'.
|
||||||
typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_DEFAULT_CONTENT_EXPANSION='${P9K_GOOGLE_APP_CRED_PROJECT_ID//\%/%%}'
|
typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_DEFAULT_CONTENT_EXPANSION='${P9K_GOOGLE_APP_CRED_PROJECT_ID//\%/%%}'
|
||||||
|
|
||||||
|
##############[ toolbox: toolbox name (https://github.com/containers/toolbox) ]###############
|
||||||
|
# Toolbox color.
|
||||||
|
typeset -g POWERLEVEL9K_TOOLBOX_FOREGROUND=3
|
||||||
|
# Don't display the name of the toolbox if it matches fedora-toolbox-*.
|
||||||
|
typeset -g POWERLEVEL9K_TOOLBOX_CONTENT_EXPANSION='${P9K_TOOLBOX_NAME:#fedora-toolbox-*}'
|
||||||
|
# Custom icon.
|
||||||
|
# typeset -g POWERLEVEL9K_TOOLBOX_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
||||||
|
# Custom prefix.
|
||||||
|
# typeset -g POWERLEVEL9K_TOOLBOX_PREFIX='%fin '
|
||||||
|
|
||||||
###############################[ public_ip: public IP address ]###############################
|
###############################[ public_ip: public IP address ]###############################
|
||||||
# Public IP color.
|
# Public IP color.
|
||||||
typeset -g POWERLEVEL9K_PUBLIC_IP_FOREGROUND=6
|
typeset -g POWERLEVEL9K_PUBLIC_IP_FOREGROUND=6
|
||||||
|
|
@ -1333,7 +1553,7 @@
|
||||||
typeset -g POWERLEVEL9K_VPN_IP_CONTENT_EXPANSION=
|
typeset -g POWERLEVEL9K_VPN_IP_CONTENT_EXPANSION=
|
||||||
# Regular expression for the VPN network interface. Run `ifconfig` or `ip -4 a show` while on VPN
|
# Regular expression for the VPN network interface. Run `ifconfig` or `ip -4 a show` while on VPN
|
||||||
# to see the name of the interface.
|
# to see the name of the interface.
|
||||||
typeset -g POWERLEVEL9K_VPN_IP_INTERFACE='(wg|(.*tun))[0-9]*'
|
typeset -g POWERLEVEL9K_VPN_IP_INTERFACE='(gpd|wg|(.*tun)|tailscale)[0-9]*|(zt.*)'
|
||||||
# If set to true, show one segment per matching network interface. If set to false, show only
|
# If set to true, show one segment per matching network interface. If set to false, show only
|
||||||
# one segment corresponding to the first matching network interface.
|
# one segment corresponding to the first matching network interface.
|
||||||
# Tip: If you set it to true, you'll probably want to unset POWERLEVEL9K_VPN_IP_CONTENT_EXPANSION.
|
# Tip: If you set it to true, you'll probably want to unset POWERLEVEL9K_VPN_IP_CONTENT_EXPANSION.
|
||||||
|
|
@ -1347,17 +1567,19 @@
|
||||||
# The following parameters are accessible within the expansion:
|
# The following parameters are accessible within the expansion:
|
||||||
#
|
#
|
||||||
# Parameter | Meaning
|
# Parameter | Meaning
|
||||||
# ----------------------+---------------
|
# ----------------------+-------------------------------------------
|
||||||
# P9K_IP_IP | IP address
|
# P9K_IP_IP | IP address
|
||||||
# P9K_IP_INTERFACE | network interface
|
# P9K_IP_INTERFACE | network interface
|
||||||
# P9K_IP_RX_BYTES | total number of bytes received
|
# P9K_IP_RX_BYTES | total number of bytes received
|
||||||
# P9K_IP_TX_BYTES | total number of bytes sent
|
# P9K_IP_TX_BYTES | total number of bytes sent
|
||||||
# P9K_IP_RX_RATE | receive rate (since last prompt)
|
# P9K_IP_RX_BYTES_DELTA | number of bytes received since last prompt
|
||||||
# P9K_IP_TX_RATE | send rate (since last prompt)
|
# P9K_IP_TX_BYTES_DELTA | number of bytes sent since last prompt
|
||||||
|
# P9K_IP_RX_RATE | receive rate (since last prompt)
|
||||||
|
# P9K_IP_TX_RATE | send rate (since last prompt)
|
||||||
typeset -g POWERLEVEL9K_IP_CONTENT_EXPANSION='$P9K_IP_IP${P9K_IP_RX_RATE:+ %2F⇣$P9K_IP_RX_RATE}${P9K_IP_TX_RATE:+ %3F⇡$P9K_IP_TX_RATE}'
|
typeset -g POWERLEVEL9K_IP_CONTENT_EXPANSION='$P9K_IP_IP${P9K_IP_RX_RATE:+ %2F⇣$P9K_IP_RX_RATE}${P9K_IP_TX_RATE:+ %3F⇡$P9K_IP_TX_RATE}'
|
||||||
# Show information for the first network interface whose name matches this regular expression.
|
# Show information for the first network interface whose name matches this regular expression.
|
||||||
# Run `ifconfig` or `ip -4 a show` to see the names of all network interfaces.
|
# Run `ifconfig` or `ip -4 a show` to see the names of all network interfaces.
|
||||||
typeset -g POWERLEVEL9K_IP_INTERFACE='e.*'
|
typeset -g POWERLEVEL9K_IP_INTERFACE='[ew].*'
|
||||||
# Custom icon.
|
# Custom icon.
|
||||||
# typeset -g POWERLEVEL9K_IP_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
# typeset -g POWERLEVEL9K_IP_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
||||||
|
|
||||||
|
|
@ -1400,15 +1622,11 @@
|
||||||
# Parameter | Meaning
|
# Parameter | Meaning
|
||||||
# ----------------------+---------------
|
# ----------------------+---------------
|
||||||
# P9K_WIFI_SSID | service set identifier, a.k.a. network name
|
# P9K_WIFI_SSID | service set identifier, a.k.a. network name
|
||||||
# P9K_WIFI_LINK_AUTH | authentication protocol such as "wpa2-psk" or "none"
|
# P9K_WIFI_LINK_AUTH | authentication protocol such as "wpa2-psk" or "none"; empty if unknown
|
||||||
# P9K_WIFI_LAST_TX_RATE | wireless transmit rate in megabits per second
|
# P9K_WIFI_LAST_TX_RATE | wireless transmit rate in megabits per second
|
||||||
# P9K_WIFI_RSSI | signal strength in dBm, from -120 to 0
|
# P9K_WIFI_RSSI | signal strength in dBm, from -120 to 0
|
||||||
# P9K_WIFI_NOISE | noise in dBm, from -120 to 0
|
# P9K_WIFI_NOISE | noise in dBm, from -120 to 0
|
||||||
# P9K_WIFI_BARS | signal strength in bars, from 0 to 4 (derived from P9K_WIFI_RSSI and P9K_WIFI_NOISE)
|
# P9K_WIFI_BARS | signal strength in bars, from 0 to 4 (derived from P9K_WIFI_RSSI and P9K_WIFI_NOISE)
|
||||||
#
|
|
||||||
# All parameters except P9K_WIFI_BARS are extracted from the output of the following command:
|
|
||||||
#
|
|
||||||
# /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -I
|
|
||||||
|
|
||||||
####################################[ time: current time ]####################################
|
####################################[ time: current time ]####################################
|
||||||
# Current time color.
|
# Current time color.
|
||||||
|
|
@ -1435,7 +1653,7 @@
|
||||||
|
|
||||||
# User-defined prompt segments may optionally provide an instant_prompt_* function. Its job
|
# User-defined prompt segments may optionally provide an instant_prompt_* function. Its job
|
||||||
# is to generate the prompt segment for display in instant prompt. See
|
# is to generate the prompt segment for display in instant prompt. See
|
||||||
# https://github.com/romkatv/powerlevel10k/blob/master/README.md#instant-prompt.
|
# https://github.com/romkatv/powerlevel10k#instant-prompt.
|
||||||
#
|
#
|
||||||
# Powerlevel10k will call instant_prompt_* at the same time as the regular prompt_* function
|
# Powerlevel10k will call instant_prompt_* at the same time as the regular prompt_* function
|
||||||
# and will record all `p10k segment` calls it makes. When displaying instant prompt, Powerlevel10k
|
# and will record all `p10k segment` calls it makes. When displaying instant prompt, Powerlevel10k
|
||||||
|
|
@ -1471,7 +1689,7 @@
|
||||||
# it incompatible with your zsh configuration files.
|
# it incompatible with your zsh configuration files.
|
||||||
# - quiet: Enable instant prompt and don't print warnings when detecting console output
|
# - quiet: Enable instant prompt and don't print warnings when detecting console output
|
||||||
# during zsh initialization. Choose this if you've read and understood
|
# during zsh initialization. Choose this if you've read and understood
|
||||||
# https://github.com/romkatv/powerlevel10k/blob/master/README.md#instant-prompt.
|
# https://github.com/romkatv/powerlevel10k#instant-prompt.
|
||||||
# - verbose: Enable instant prompt and print a warning when detecting console output during
|
# - verbose: Enable instant prompt and print a warning when detecting console output during
|
||||||
# zsh initialization. Choose this if you've never tried instant prompt, haven't
|
# zsh initialization. Choose this if you've never tried instant prompt, haven't
|
||||||
# seen the warning, or if you are unsure what this all means.
|
# seen the warning, or if you are unsure what this all means.
|
||||||
|
|
|
||||||
|
|
@ -17,10 +17,10 @@
|
||||||
|
|
||||||
# Unset all configuration options. This allows you to apply configuration changes without
|
# Unset all configuration options. This allows you to apply configuration changes without
|
||||||
# restarting zsh. Edit ~/.p10k.zsh and type `source ~/.p10k.zsh`.
|
# restarting zsh. Edit ~/.p10k.zsh and type `source ~/.p10k.zsh`.
|
||||||
unset -m 'POWERLEVEL9K_*|DEFAULT_USER'
|
unset -m '(POWERLEVEL9K_*|DEFAULT_USER)~POWERLEVEL9K_GITSTATUS_DIR'
|
||||||
|
|
||||||
# Zsh >= 5.1 is required.
|
# Zsh >= 5.1 is required.
|
||||||
autoload -Uz is-at-least && is-at-least 5.1 || return
|
[[ $ZSH_VERSION == (5.<1->*|<6->.*) ]] || return
|
||||||
|
|
||||||
# The list of segments shown on the left. Fill it with the most important segments.
|
# The list of segments shown on the left. Fill it with the most important segments.
|
||||||
typeset -g POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(
|
typeset -g POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(
|
||||||
|
|
@ -65,22 +65,30 @@
|
||||||
luaenv # lua version from luaenv (https://github.com/cehoffman/luaenv)
|
luaenv # lua version from luaenv (https://github.com/cehoffman/luaenv)
|
||||||
jenv # java version from jenv (https://github.com/jenv/jenv)
|
jenv # java version from jenv (https://github.com/jenv/jenv)
|
||||||
plenv # perl version from plenv (https://github.com/tokuhirom/plenv)
|
plenv # perl version from plenv (https://github.com/tokuhirom/plenv)
|
||||||
|
perlbrew # perl version from perlbrew (https://github.com/gugod/App-perlbrew)
|
||||||
phpenv # php version from phpenv (https://github.com/phpenv/phpenv)
|
phpenv # php version from phpenv (https://github.com/phpenv/phpenv)
|
||||||
|
scalaenv # scala version from scalaenv (https://github.com/scalaenv/scalaenv)
|
||||||
haskell_stack # haskell version from stack (https://haskellstack.org/)
|
haskell_stack # haskell version from stack (https://haskellstack.org/)
|
||||||
kubecontext # current kubernetes context (https://kubernetes.io/)
|
kubecontext # current kubernetes context (https://kubernetes.io/)
|
||||||
terraform # terraform workspace (https://www.terraform.io)
|
terraform # terraform workspace (https://www.terraform.io)
|
||||||
|
# terraform_version # terraform version (https://www.terraform.io)
|
||||||
aws # aws profile (https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html)
|
aws # aws profile (https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html)
|
||||||
aws_eb_env # aws elastic beanstalk environment (https://aws.amazon.com/elasticbeanstalk/)
|
aws_eb_env # aws elastic beanstalk environment (https://aws.amazon.com/elasticbeanstalk/)
|
||||||
azure # azure account name (https://docs.microsoft.com/en-us/cli/azure)
|
azure # azure account name (https://docs.microsoft.com/en-us/cli/azure)
|
||||||
gcloud # google cloud cli account and project (https://cloud.google.com/)
|
gcloud # google cloud cli account and project (https://cloud.google.com/)
|
||||||
google_app_cred # google application credentials (https://cloud.google.com/docs/authentication/production)
|
google_app_cred # google application credentials (https://cloud.google.com/docs/authentication/production)
|
||||||
|
toolbox # toolbox name (https://github.com/containers/toolbox)
|
||||||
context # user@hostname
|
context # user@hostname
|
||||||
nordvpn # nordvpn connection status, linux only (https://nordvpn.com/)
|
nordvpn # nordvpn connection status, linux only (https://nordvpn.com/)
|
||||||
ranger # ranger shell (https://github.com/ranger/ranger)
|
ranger # ranger shell (https://github.com/ranger/ranger)
|
||||||
|
yazi # yazi shell (https://github.com/sxyazi/yazi)
|
||||||
nnn # nnn shell (https://github.com/jarun/nnn)
|
nnn # nnn shell (https://github.com/jarun/nnn)
|
||||||
|
lf # lf shell (https://github.com/gokcehan/lf)
|
||||||
|
xplr # xplr shell (https://github.com/sayanarijit/xplr)
|
||||||
vim_shell # vim shell indicator (:sh)
|
vim_shell # vim shell indicator (:sh)
|
||||||
midnight_commander # midnight commander shell (https://midnight-commander.org/)
|
midnight_commander # midnight commander shell (https://midnight-commander.org/)
|
||||||
nix_shell # nix shell (https://nixos.org/nixos/nix-pills/developing-with-nix-shell.html)
|
nix_shell # nix shell (https://nixos.org/nixos/nix-pills/developing-with-nix-shell.html)
|
||||||
|
chezmoi_shell # chezmoi shell (https://www.chezmoi.io/)
|
||||||
# vpn_ip # virtual private network indicator
|
# vpn_ip # virtual private network indicator
|
||||||
# load # CPU load
|
# load # CPU load
|
||||||
# disk_usage # disk usage
|
# disk_usage # disk usage
|
||||||
|
|
@ -89,6 +97,8 @@
|
||||||
todo # todo items (https://github.com/todotxt/todo.txt-cli)
|
todo # todo items (https://github.com/todotxt/todo.txt-cli)
|
||||||
timewarrior # timewarrior tracking status (https://timewarrior.net/)
|
timewarrior # timewarrior tracking status (https://timewarrior.net/)
|
||||||
taskwarrior # taskwarrior task count (https://taskwarrior.org/)
|
taskwarrior # taskwarrior task count (https://taskwarrior.org/)
|
||||||
|
per_directory_history # Oh My Zsh per-directory-history local/global indicator
|
||||||
|
# cpu_arch # CPU architecture
|
||||||
# time # current time
|
# time # current time
|
||||||
# =========================[ Line #2 ]=========================
|
# =========================[ Line #2 ]=========================
|
||||||
newline
|
newline
|
||||||
|
|
@ -173,8 +183,8 @@
|
||||||
#################################[ os_icon: os identifier ]##################################
|
#################################[ os_icon: os identifier ]##################################
|
||||||
# OS identifier color.
|
# OS identifier color.
|
||||||
typeset -g POWERLEVEL9K_OS_ICON_FOREGROUND=
|
typeset -g POWERLEVEL9K_OS_ICON_FOREGROUND=
|
||||||
# Make the icon bold.
|
# Custom icon.
|
||||||
typeset -g POWERLEVEL9K_OS_ICON_CONTENT_EXPANSION='${P9K_CONTENT}'
|
# typeset -g POWERLEVEL9K_OS_ICON_CONTENT_EXPANSION='⭐'
|
||||||
|
|
||||||
################################[ prompt_char: prompt symbol ]################################
|
################################[ prompt_char: prompt symbol ]################################
|
||||||
# Green prompt symbol if the last command succeeded.
|
# Green prompt symbol if the last command succeeded.
|
||||||
|
|
@ -186,7 +196,7 @@
|
||||||
# Prompt symbol in command vi mode.
|
# Prompt symbol in command vi mode.
|
||||||
typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VICMD_CONTENT_EXPANSION='❮'
|
typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VICMD_CONTENT_EXPANSION='❮'
|
||||||
# Prompt symbol in visual vi mode.
|
# Prompt symbol in visual vi mode.
|
||||||
typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIVIS_CONTENT_EXPANSION='Ⅴ'
|
typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIVIS_CONTENT_EXPANSION='V'
|
||||||
# Prompt symbol in overwrite vi mode.
|
# Prompt symbol in overwrite vi mode.
|
||||||
typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIOWR_CONTENT_EXPANSION='▶'
|
typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIOWR_CONTENT_EXPANSION='▶'
|
||||||
typeset -g POWERLEVEL9K_PROMPT_CHAR_OVERWRITE_STATE=true
|
typeset -g POWERLEVEL9K_PROMPT_CHAR_OVERWRITE_STATE=true
|
||||||
|
|
@ -224,7 +234,8 @@
|
||||||
.java-version
|
.java-version
|
||||||
.perl-version
|
.perl-version
|
||||||
.php-version
|
.php-version
|
||||||
.tool-version
|
.tool-versions
|
||||||
|
.mise.toml
|
||||||
.shorten_folder_marker
|
.shorten_folder_marker
|
||||||
.svn
|
.svn
|
||||||
.terraform
|
.terraform
|
||||||
|
|
@ -241,6 +252,11 @@
|
||||||
# /foo/bar/git_repo/nested_git_repo/baz, prompt will display git_repo/nested_git_repo/baz (first)
|
# /foo/bar/git_repo/nested_git_repo/baz, prompt will display git_repo/nested_git_repo/baz (first)
|
||||||
# or nested_git_repo/baz (last). This assumes that git_repo and nested_git_repo contain markers
|
# or nested_git_repo/baz (last). This assumes that git_repo and nested_git_repo contain markers
|
||||||
# and other directories don't.
|
# and other directories don't.
|
||||||
|
#
|
||||||
|
# Optionally, "first" and "last" can be followed by ":<offset>" where <offset> is an integer.
|
||||||
|
# This moves the truncation point to the right (positive offset) or to the left (negative offset)
|
||||||
|
# relative to the marker. Plain "first" and "last" are equivalent to "first:0" and "last:0"
|
||||||
|
# respectively.
|
||||||
typeset -g POWERLEVEL9K_DIR_TRUNCATE_BEFORE_MARKER=false
|
typeset -g POWERLEVEL9K_DIR_TRUNCATE_BEFORE_MARKER=false
|
||||||
# Don't shorten this many last directory segments. They are anchors.
|
# Don't shorten this many last directory segments. They are anchors.
|
||||||
typeset -g POWERLEVEL9K_SHORTEN_DIR_LENGTH=1
|
typeset -g POWERLEVEL9K_SHORTEN_DIR_LENGTH=1
|
||||||
|
|
@ -262,12 +278,12 @@
|
||||||
# the full directory that was used in previous commands.
|
# the full directory that was used in previous commands.
|
||||||
typeset -g POWERLEVEL9K_DIR_HYPERLINK=false
|
typeset -g POWERLEVEL9K_DIR_HYPERLINK=false
|
||||||
|
|
||||||
# Enable special styling for non-writable directories. See POWERLEVEL9K_LOCK_ICON and
|
# Enable special styling for non-writable and non-existent directories. See POWERLEVEL9K_LOCK_ICON
|
||||||
# POWERLEVEL9K_DIR_CLASSES below.
|
# and POWERLEVEL9K_DIR_CLASSES below.
|
||||||
typeset -g POWERLEVEL9K_DIR_SHOW_WRITABLE=v2
|
typeset -g POWERLEVEL9K_DIR_SHOW_WRITABLE=v3
|
||||||
|
|
||||||
# The default icon shown next to non-writable directories when POWERLEVEL9K_DIR_SHOW_WRITABLE is
|
# The default icon shown next to non-writable and non-existent directories when
|
||||||
# set to v2.
|
# POWERLEVEL9K_DIR_SHOW_WRITABLE is set to v3.
|
||||||
# typeset -g POWERLEVEL9K_LOCK_ICON='⭐'
|
# typeset -g POWERLEVEL9K_LOCK_ICON='⭐'
|
||||||
|
|
||||||
# POWERLEVEL9K_DIR_CLASSES allows you to specify custom icons and colors for different
|
# POWERLEVEL9K_DIR_CLASSES allows you to specify custom icons and colors for different
|
||||||
|
|
@ -280,8 +296,8 @@
|
||||||
#
|
#
|
||||||
# Triplets are tried in order. The first triplet whose pattern matches $PWD wins.
|
# Triplets are tried in order. The first triplet whose pattern matches $PWD wins.
|
||||||
#
|
#
|
||||||
# If POWERLEVEL9K_DIR_SHOW_WRITABLE is set to v2 and the current directory is not writable,
|
# If POWERLEVEL9K_DIR_SHOW_WRITABLE is set to v3, non-writable and non-existent directories
|
||||||
# its class gets suffix _NOT_WRITABLE.
|
# acquire class suffix _NOT_WRITABLE and NON_EXISTENT respectively.
|
||||||
#
|
#
|
||||||
# For example, given these settings:
|
# For example, given these settings:
|
||||||
#
|
#
|
||||||
|
|
@ -290,10 +306,11 @@
|
||||||
# '~(|/*)' HOME ''
|
# '~(|/*)' HOME ''
|
||||||
# '*' DEFAULT '')
|
# '*' DEFAULT '')
|
||||||
#
|
#
|
||||||
# Whenever the current directory is ~/work or a subdirectory of ~/work, it gets styled with class
|
# Whenever the current directory is ~/work or a subdirectory of ~/work, it gets styled with one
|
||||||
# WORK or WORK_NOT_WRITABLE.
|
# of the following classes depending on its writability and existence: WORK, WORK_NOT_WRITABLE or
|
||||||
|
# WORK_NON_EXISTENT.
|
||||||
#
|
#
|
||||||
# Simply assigning classes to directories don't have any visible effects. It merely gives you an
|
# Simply assigning classes to directories doesn't have any visible effects. It merely gives you an
|
||||||
# option to define custom colors and icons for different directory classes.
|
# option to define custom colors and icons for different directory classes.
|
||||||
#
|
#
|
||||||
# # Styling for WORK.
|
# # Styling for WORK.
|
||||||
|
|
@ -308,6 +325,12 @@
|
||||||
# typeset -g POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_SHORTENED_FOREGROUND=103
|
# typeset -g POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_SHORTENED_FOREGROUND=103
|
||||||
# typeset -g POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_ANCHOR_FOREGROUND=39
|
# typeset -g POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_ANCHOR_FOREGROUND=39
|
||||||
#
|
#
|
||||||
|
# # Styling for WORK_NON_EXISTENT.
|
||||||
|
# typeset -g POWERLEVEL9K_DIR_WORK_NON_EXISTENT_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
||||||
|
# typeset -g POWERLEVEL9K_DIR_WORK_NON_EXISTENT_FOREGROUND=31
|
||||||
|
# typeset -g POWERLEVEL9K_DIR_WORK_NON_EXISTENT_SHORTENED_FOREGROUND=103
|
||||||
|
# typeset -g POWERLEVEL9K_DIR_WORK_NON_EXISTENT_ANCHOR_FOREGROUND=39
|
||||||
|
#
|
||||||
# If a styling parameter isn't explicitly defined for some class, it falls back to the classless
|
# If a styling parameter isn't explicitly defined for some class, it falls back to the classless
|
||||||
# parameter. For example, if POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_FOREGROUND is not set, it falls
|
# parameter. For example, if POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_FOREGROUND is not set, it falls
|
||||||
# back to POWERLEVEL9K_DIR_FOREGROUND.
|
# back to POWERLEVEL9K_DIR_FOREGROUND.
|
||||||
|
|
@ -318,7 +341,7 @@
|
||||||
# typeset -g POWERLEVEL9K_DIR_PREFIX='%fin '
|
# typeset -g POWERLEVEL9K_DIR_PREFIX='%fin '
|
||||||
|
|
||||||
#####################################[ vcs: git status ]######################################
|
#####################################[ vcs: git status ]######################################
|
||||||
# Branch icon. Set this parameter to '\uF126 ' for the popular Powerline branch icon.
|
# Branch icon. Set this parameter to '\UE0A0 ' for the popular Powerline branch icon.
|
||||||
typeset -g POWERLEVEL9K_VCS_BRANCH_ICON=
|
typeset -g POWERLEVEL9K_VCS_BRANCH_ICON=
|
||||||
|
|
||||||
# Untracked files icon. It's really a question mark, your font isn't broken.
|
# Untracked files icon. It's really a question mark, your font isn't broken.
|
||||||
|
|
@ -327,7 +350,7 @@
|
||||||
|
|
||||||
# Formatter for Git status.
|
# Formatter for Git status.
|
||||||
#
|
#
|
||||||
# Example output: master ⇣42⇡42 *42 merge ~42 +42 !42 ?42.
|
# Example output: master wip ⇣42⇡42 *42 merge ~42 +42 !42 ?42.
|
||||||
#
|
#
|
||||||
# You can edit the function to customize how Git status looks.
|
# You can edit the function to customize how Git status looks.
|
||||||
#
|
#
|
||||||
|
|
@ -360,35 +383,55 @@
|
||||||
fi
|
fi
|
||||||
|
|
||||||
local res
|
local res
|
||||||
local where # branch or tag
|
|
||||||
if [[ -n $VCS_STATUS_LOCAL_BRANCH ]]; then
|
if [[ -n $VCS_STATUS_LOCAL_BRANCH ]]; then
|
||||||
res+="${clean}${(g::)POWERLEVEL9K_VCS_BRANCH_ICON}"
|
local branch=${(V)VCS_STATUS_LOCAL_BRANCH}
|
||||||
where=${(V)VCS_STATUS_LOCAL_BRANCH}
|
# If local branch name is at most 32 characters long, show it in full.
|
||||||
elif [[ -n $VCS_STATUS_TAG ]]; then
|
# Otherwise show the first 12 … the last 12.
|
||||||
res+="${meta}#"
|
# Tip: To always show local branch name in full without truncation, delete the next line.
|
||||||
where=${(V)VCS_STATUS_TAG}
|
(( $#branch > 32 )) && branch[13,-13]="…" # <-- this line
|
||||||
|
res+="${clean}${(g::)POWERLEVEL9K_VCS_BRANCH_ICON}${branch//\%/%%}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# If local branch name or tag is at most 32 characters long, show it in full.
|
if [[ -n $VCS_STATUS_TAG
|
||||||
# Otherwise show the first 12 … the last 12.
|
# Show tag only if not on a branch.
|
||||||
# Tip: To always show local branch name in full without truncation, delete the next line.
|
# Tip: To always show tag, delete the next line.
|
||||||
(( $#where > 32 )) && where[13,-13]="…"
|
&& -z $VCS_STATUS_LOCAL_BRANCH # <-- this line
|
||||||
res+="${clean}${where//\%/%%}" # escape %
|
]]; then
|
||||||
|
local tag=${(V)VCS_STATUS_TAG}
|
||||||
|
# If tag name is at most 32 characters long, show it in full.
|
||||||
|
# Otherwise show the first 12 … the last 12.
|
||||||
|
# Tip: To always show tag name in full without truncation, delete the next line.
|
||||||
|
(( $#tag > 32 )) && tag[13,-13]="…" # <-- this line
|
||||||
|
res+="${meta}#${clean}${tag//\%/%%}"
|
||||||
|
fi
|
||||||
|
|
||||||
# Display the current Git commit if there is no branch or tag.
|
# Display the current Git commit if there is no branch and no tag.
|
||||||
# Tip: To always display the current Git commit, remove `[[ -z $where ]] &&` from the next line.
|
# Tip: To always display the current Git commit, delete the next line.
|
||||||
[[ -z $where ]] && res+="${meta}@${clean}${VCS_STATUS_COMMIT[1,8]}"
|
[[ -z $VCS_STATUS_LOCAL_BRANCH && -z $VCS_STATUS_TAG ]] && # <-- this line
|
||||||
|
res+="${meta}@${clean}${VCS_STATUS_COMMIT[1,8]}"
|
||||||
|
|
||||||
# Show tracking branch name if it differs from local branch.
|
# Show tracking branch name if it differs from local branch.
|
||||||
if [[ -n ${VCS_STATUS_REMOTE_BRANCH:#$VCS_STATUS_LOCAL_BRANCH} ]]; then
|
if [[ -n ${VCS_STATUS_REMOTE_BRANCH:#$VCS_STATUS_LOCAL_BRANCH} ]]; then
|
||||||
res+="${meta}:${clean}${(V)VCS_STATUS_REMOTE_BRANCH//\%/%%}" # escape %
|
res+="${meta}:${clean}${(V)VCS_STATUS_REMOTE_BRANCH//\%/%%}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Display "wip" if the latest commit's summary contains "wip" or "WIP".
|
||||||
|
if [[ $VCS_STATUS_COMMIT_SUMMARY == (|*[^[:alnum:]])(wip|WIP)(|[^[:alnum:]]*) ]]; then
|
||||||
|
res+=" ${modified}wip"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if (( VCS_STATUS_COMMITS_AHEAD || VCS_STATUS_COMMITS_BEHIND )); then
|
||||||
|
# ⇣42 if behind the remote.
|
||||||
|
(( VCS_STATUS_COMMITS_BEHIND )) && res+=" ${clean}⇣${VCS_STATUS_COMMITS_BEHIND}"
|
||||||
|
# ⇡42 if ahead of the remote; no leading space if also behind the remote: ⇣42⇡42.
|
||||||
|
(( VCS_STATUS_COMMITS_AHEAD && !VCS_STATUS_COMMITS_BEHIND )) && res+=" "
|
||||||
|
(( VCS_STATUS_COMMITS_AHEAD )) && res+="${clean}⇡${VCS_STATUS_COMMITS_AHEAD}"
|
||||||
|
elif [[ -n $VCS_STATUS_REMOTE_BRANCH ]]; then
|
||||||
|
# Tip: Uncomment the next line to display '=' if up to date with the remote.
|
||||||
|
# res+=" ${clean}="
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# ⇣42 if behind the remote.
|
|
||||||
(( VCS_STATUS_COMMITS_BEHIND )) && res+=" ${clean}⇣${VCS_STATUS_COMMITS_BEHIND}"
|
|
||||||
# ⇡42 if ahead of the remote; no leading space if also behind the remote: ⇣42⇡42.
|
|
||||||
(( VCS_STATUS_COMMITS_AHEAD && !VCS_STATUS_COMMITS_BEHIND )) && res+=" "
|
|
||||||
(( VCS_STATUS_COMMITS_AHEAD )) && res+="${clean}⇡${VCS_STATUS_COMMITS_AHEAD}"
|
|
||||||
# ⇠42 if behind the push remote.
|
# ⇠42 if behind the push remote.
|
||||||
(( VCS_STATUS_PUSH_COMMITS_BEHIND )) && res+=" ${clean}⇠${VCS_STATUS_PUSH_COMMITS_BEHIND}"
|
(( VCS_STATUS_PUSH_COMMITS_BEHIND )) && res+=" ${clean}⇠${VCS_STATUS_PUSH_COMMITS_BEHIND}"
|
||||||
(( VCS_STATUS_PUSH_COMMITS_AHEAD && !VCS_STATUS_PUSH_COMMITS_BEHIND )) && res+=" "
|
(( VCS_STATUS_PUSH_COMMITS_AHEAD && !VCS_STATUS_PUSH_COMMITS_BEHIND )) && res+=" "
|
||||||
|
|
@ -430,7 +473,7 @@
|
||||||
|
|
||||||
# Don't show Git status in prompt for repositories whose workdir matches this pattern.
|
# Don't show Git status in prompt for repositories whose workdir matches this pattern.
|
||||||
# For example, if set to '~', the Git repository at $HOME/.git will be ignored.
|
# For example, if set to '~', the Git repository at $HOME/.git will be ignored.
|
||||||
# Multiple patterns can be combined with '|': '~|~/some/dir'.
|
# Multiple patterns can be combined with '|': '~(|/foo)|/bar/baz/*'.
|
||||||
typeset -g POWERLEVEL9K_VCS_DISABLED_WORKDIR_PATTERN='~'
|
typeset -g POWERLEVEL9K_VCS_DISABLED_WORKDIR_PATTERN='~'
|
||||||
|
|
||||||
# Disable the default Git status formatting.
|
# Disable the default Git status formatting.
|
||||||
|
|
@ -451,10 +494,10 @@
|
||||||
|
|
||||||
# Show status of repositories of these types. You can add svn and/or hg if you are
|
# Show status of repositories of these types. You can add svn and/or hg if you are
|
||||||
# using them. If you do, your prompt may become slow even when your current directory
|
# using them. If you do, your prompt may become slow even when your current directory
|
||||||
# isn't in an svn or hg reposotiry.
|
# isn't in an svn or hg repository.
|
||||||
typeset -g POWERLEVEL9K_VCS_BACKENDS=(git)
|
typeset -g POWERLEVEL9K_VCS_BACKENDS=(git)
|
||||||
|
|
||||||
# These settings are used for respositories other than Git or when gitstatusd fails and
|
# These settings are used for repositories other than Git or when gitstatusd fails and
|
||||||
# Powerlevel10k has to fall back to using vcs_info.
|
# Powerlevel10k has to fall back to using vcs_info.
|
||||||
typeset -g POWERLEVEL9K_VCS_CLEAN_FOREGROUND=76
|
typeset -g POWERLEVEL9K_VCS_CLEAN_FOREGROUND=76
|
||||||
typeset -g POWERLEVEL9K_VCS_UNTRACKED_FOREGROUND=76
|
typeset -g POWERLEVEL9K_VCS_UNTRACKED_FOREGROUND=76
|
||||||
|
|
@ -497,7 +540,7 @@
|
||||||
typeset -g POWERLEVEL9K_STATUS_ERROR_PIPE_VISUAL_IDENTIFIER_EXPANSION='✘'
|
typeset -g POWERLEVEL9K_STATUS_ERROR_PIPE_VISUAL_IDENTIFIER_EXPANSION='✘'
|
||||||
|
|
||||||
###################[ command_execution_time: duration of the last command ]###################
|
###################[ command_execution_time: duration of the last command ]###################
|
||||||
# Show duration of the last command if takes longer than this many seconds.
|
# Show duration of the last command if takes at least this many seconds.
|
||||||
typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_THRESHOLD=3
|
typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_THRESHOLD=3
|
||||||
# Show this many fractional digits. Zero means round to seconds.
|
# Show this many fractional digits. Zero means round to seconds.
|
||||||
typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_PRECISION=0
|
typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_PRECISION=0
|
||||||
|
|
@ -526,6 +569,7 @@
|
||||||
|
|
||||||
###############[ asdf: asdf version manager (https://github.com/asdf-vm/asdf) ]###############
|
###############[ asdf: asdf version manager (https://github.com/asdf-vm/asdf) ]###############
|
||||||
# Default asdf color. Only used to display tools for which there is no color override (see below).
|
# Default asdf color. Only used to display tools for which there is no color override (see below).
|
||||||
|
# Tip: Override this parameter for ${TOOL} with POWERLEVEL9K_ASDF_${TOOL}_FOREGROUND.
|
||||||
typeset -g POWERLEVEL9K_ASDF_FOREGROUND=66
|
typeset -g POWERLEVEL9K_ASDF_FOREGROUND=66
|
||||||
|
|
||||||
# There are four parameters that can be used to hide asdf tools. Each parameter describes
|
# There are four parameters that can be used to hide asdf tools. Each parameter describes
|
||||||
|
|
@ -571,7 +615,7 @@
|
||||||
typeset -g POWERLEVEL9K_ASDF_SHOW_SYSTEM=true
|
typeset -g POWERLEVEL9K_ASDF_SHOW_SYSTEM=true
|
||||||
|
|
||||||
# If set to non-empty value, hide tools unless there is a file matching the specified file pattern
|
# If set to non-empty value, hide tools unless there is a file matching the specified file pattern
|
||||||
# in the current directory, or its parent diretory, or its grandparent directory, and so on.
|
# in the current directory, or its parent directory, or its grandparent directory, and so on.
|
||||||
#
|
#
|
||||||
# Note: If this parameter is set to empty value, it won't hide tools.
|
# Note: If this parameter is set to empty value, it won't hide tools.
|
||||||
# Note: SHOW_ON_UPGLOB isn't specific to asdf. It works with all prompt segments.
|
# Note: SHOW_ON_UPGLOB isn't specific to asdf. It works with all prompt segments.
|
||||||
|
|
@ -658,6 +702,11 @@
|
||||||
# typeset -g POWERLEVEL9K_ASDF_HASKELL_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
# typeset -g POWERLEVEL9K_ASDF_HASKELL_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
||||||
# typeset -g POWERLEVEL9K_ASDF_HASKELL_SHOW_ON_UPGLOB='*.foo|*.bar'
|
# typeset -g POWERLEVEL9K_ASDF_HASKELL_SHOW_ON_UPGLOB='*.foo|*.bar'
|
||||||
|
|
||||||
|
# Julia version from asdf.
|
||||||
|
typeset -g POWERLEVEL9K_ASDF_JULIA_FOREGROUND=70
|
||||||
|
# typeset -g POWERLEVEL9K_ASDF_JULIA_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
||||||
|
# typeset -g POWERLEVEL9K_ASDF_JULIA_SHOW_ON_UPGLOB='*.foo|*.bar'
|
||||||
|
|
||||||
##########[ nordvpn: nordvpn connection status, linux only (https://nordvpn.com/) ]###########
|
##########[ nordvpn: nordvpn connection status, linux only (https://nordvpn.com/) ]###########
|
||||||
# NordVPN connection indicator color.
|
# NordVPN connection indicator color.
|
||||||
typeset -g POWERLEVEL9K_NORDVPN_FOREGROUND=39
|
typeset -g POWERLEVEL9K_NORDVPN_FOREGROUND=39
|
||||||
|
|
@ -672,6 +721,12 @@
|
||||||
typeset -g POWERLEVEL9K_RANGER_FOREGROUND=178
|
typeset -g POWERLEVEL9K_RANGER_FOREGROUND=178
|
||||||
# Custom icon.
|
# Custom icon.
|
||||||
# typeset -g POWERLEVEL9K_RANGER_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
# typeset -g POWERLEVEL9K_RANGER_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
||||||
|
|
||||||
|
####################[ yazi: yazi shell (https://github.com/sxyazi/yazi) ]#####################
|
||||||
|
# Yazi shell color.
|
||||||
|
typeset -g POWERLEVEL9K_YAZI_FOREGROUND=178
|
||||||
|
# Custom icon.
|
||||||
|
# typeset -g POWERLEVEL9K_YAZI_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
||||||
|
|
||||||
######################[ nnn: nnn shell (https://github.com/jarun/nnn) ]#######################
|
######################[ nnn: nnn shell (https://github.com/jarun/nnn) ]#######################
|
||||||
# Nnn shell color.
|
# Nnn shell color.
|
||||||
|
|
@ -679,6 +734,18 @@
|
||||||
# Custom icon.
|
# Custom icon.
|
||||||
# typeset -g POWERLEVEL9K_NNN_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
# typeset -g POWERLEVEL9K_NNN_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
||||||
|
|
||||||
|
######################[ lf: lf shell (https://github.com/gokcehan/lf) ]#######################
|
||||||
|
# lf shell color.
|
||||||
|
typeset -g POWERLEVEL9K_LF_FOREGROUND=72
|
||||||
|
# Custom icon.
|
||||||
|
# typeset -g POWERLEVEL9K_LF_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
||||||
|
|
||||||
|
##################[ xplr: xplr shell (https://github.com/sayanarijit/xplr) ]##################
|
||||||
|
# xplr shell color.
|
||||||
|
typeset -g POWERLEVEL9K_XPLR_FOREGROUND=72
|
||||||
|
# Custom icon.
|
||||||
|
# typeset -g POWERLEVEL9K_XPLR_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
||||||
|
|
||||||
###########################[ vim_shell: vim shell indicator (:sh) ]###########################
|
###########################[ vim_shell: vim shell indicator (:sh) ]###########################
|
||||||
# Vim shell indicator color.
|
# Vim shell indicator color.
|
||||||
typeset -g POWERLEVEL9K_VIM_SHELL_FOREGROUND=34
|
typeset -g POWERLEVEL9K_VIM_SHELL_FOREGROUND=34
|
||||||
|
|
@ -695,12 +762,21 @@
|
||||||
# Nix shell color.
|
# Nix shell color.
|
||||||
typeset -g POWERLEVEL9K_NIX_SHELL_FOREGROUND=74
|
typeset -g POWERLEVEL9K_NIX_SHELL_FOREGROUND=74
|
||||||
|
|
||||||
|
# Display the icon of nix_shell if PATH contains a subdirectory of /nix/store.
|
||||||
|
# typeset -g POWERLEVEL9K_NIX_SHELL_INFER_FROM_PATH=false
|
||||||
|
|
||||||
# Tip: If you want to see just the icon without "pure" and "impure", uncomment the next line.
|
# Tip: If you want to see just the icon without "pure" and "impure", uncomment the next line.
|
||||||
# typeset -g POWERLEVEL9K_NIX_SHELL_CONTENT_EXPANSION=
|
# typeset -g POWERLEVEL9K_NIX_SHELL_CONTENT_EXPANSION=
|
||||||
|
|
||||||
# Custom icon.
|
# Custom icon.
|
||||||
# typeset -g POWERLEVEL9K_NIX_SHELL_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
# typeset -g POWERLEVEL9K_NIX_SHELL_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
||||||
|
|
||||||
|
##################[ chezmoi_shell: chezmoi shell (https://www.chezmoi.io/) ]##################
|
||||||
|
# chezmoi shell color.
|
||||||
|
typeset -g POWERLEVEL9K_CHEZMOI_SHELL_FOREGROUND=33
|
||||||
|
# Custom icon.
|
||||||
|
# typeset -g POWERLEVEL9K_CHEZMOI_SHELL_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
||||||
|
|
||||||
##################################[ disk_usage: disk usage ]##################################
|
##################################[ disk_usage: disk usage ]##################################
|
||||||
# Colors for different levels of disk usage.
|
# Colors for different levels of disk usage.
|
||||||
typeset -g POWERLEVEL9K_DISK_USAGE_NORMAL_FOREGROUND=35
|
typeset -g POWERLEVEL9K_DISK_USAGE_NORMAL_FOREGROUND=35
|
||||||
|
|
@ -777,7 +853,7 @@
|
||||||
##############[ taskwarrior: taskwarrior task count (https://taskwarrior.org/) ]##############
|
##############[ taskwarrior: taskwarrior task count (https://taskwarrior.org/) ]##############
|
||||||
# Taskwarrior color.
|
# Taskwarrior color.
|
||||||
typeset -g POWERLEVEL9K_TASKWARRIOR_FOREGROUND=74
|
typeset -g POWERLEVEL9K_TASKWARRIOR_FOREGROUND=74
|
||||||
|
|
||||||
# Taskwarrior segment format. The following parameters are available within the expansion.
|
# Taskwarrior segment format. The following parameters are available within the expansion.
|
||||||
#
|
#
|
||||||
# - P9K_TASKWARRIOR_PENDING_COUNT The number of pending tasks: `task +PENDING count`.
|
# - P9K_TASKWARRIOR_PENDING_COUNT The number of pending tasks: `task +PENDING count`.
|
||||||
|
|
@ -794,6 +870,30 @@
|
||||||
# Custom icon.
|
# Custom icon.
|
||||||
# typeset -g POWERLEVEL9K_TASKWARRIOR_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
# typeset -g POWERLEVEL9K_TASKWARRIOR_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
||||||
|
|
||||||
|
######[ per_directory_history: Oh My Zsh per-directory-history local/global indicator ]#######
|
||||||
|
# Color when using local/global history.
|
||||||
|
typeset -g POWERLEVEL9K_PER_DIRECTORY_HISTORY_LOCAL_FOREGROUND=135
|
||||||
|
typeset -g POWERLEVEL9K_PER_DIRECTORY_HISTORY_GLOBAL_FOREGROUND=130
|
||||||
|
|
||||||
|
# Tip: Uncomment the next two lines to hide "local"/"global" text and leave just the icon.
|
||||||
|
# typeset -g POWERLEVEL9K_PER_DIRECTORY_HISTORY_LOCAL_CONTENT_EXPANSION=''
|
||||||
|
# typeset -g POWERLEVEL9K_PER_DIRECTORY_HISTORY_GLOBAL_CONTENT_EXPANSION=''
|
||||||
|
|
||||||
|
# Custom icon.
|
||||||
|
# typeset -g POWERLEVEL9K_PER_DIRECTORY_HISTORY_LOCAL_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
||||||
|
# typeset -g POWERLEVEL9K_PER_DIRECTORY_HISTORY_GLOBAL_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
||||||
|
|
||||||
|
################################[ cpu_arch: CPU architecture ]################################
|
||||||
|
# CPU architecture color.
|
||||||
|
typeset -g POWERLEVEL9K_CPU_ARCH_FOREGROUND=172
|
||||||
|
|
||||||
|
# Hide the segment when on a specific CPU architecture.
|
||||||
|
# typeset -g POWERLEVEL9K_CPU_ARCH_X86_64_CONTENT_EXPANSION=
|
||||||
|
# typeset -g POWERLEVEL9K_CPU_ARCH_X86_64_VISUAL_IDENTIFIER_EXPANSION=
|
||||||
|
|
||||||
|
# Custom icon.
|
||||||
|
# typeset -g POWERLEVEL9K_CPU_ARCH_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
||||||
|
|
||||||
##################################[ context: user@hostname ]##################################
|
##################################[ context: user@hostname ]##################################
|
||||||
# Context color when running with privileges.
|
# Context color when running with privileges.
|
||||||
typeset -g POWERLEVEL9K_CONTEXT_ROOT_FOREGROUND=178
|
typeset -g POWERLEVEL9K_CONTEXT_ROOT_FOREGROUND=178
|
||||||
|
|
@ -823,6 +923,9 @@
|
||||||
typeset -g POWERLEVEL9K_VIRTUALENV_FOREGROUND=37
|
typeset -g POWERLEVEL9K_VIRTUALENV_FOREGROUND=37
|
||||||
# Don't show Python version next to the virtual environment name.
|
# Don't show Python version next to the virtual environment name.
|
||||||
typeset -g POWERLEVEL9K_VIRTUALENV_SHOW_PYTHON_VERSION=false
|
typeset -g POWERLEVEL9K_VIRTUALENV_SHOW_PYTHON_VERSION=false
|
||||||
|
# If set to "false", won't show virtualenv if pyenv is already shown.
|
||||||
|
# If set to "if-different", won't show virtualenv if it's the same as pyenv.
|
||||||
|
typeset -g POWERLEVEL9K_VIRTUALENV_SHOW_WITH_PYENV=false
|
||||||
# Separate environment name from Python version only with a space.
|
# Separate environment name from Python version only with a space.
|
||||||
typeset -g POWERLEVEL9K_VIRTUALENV_{LEFT,RIGHT}_DELIMITER=
|
typeset -g POWERLEVEL9K_VIRTUALENV_{LEFT,RIGHT}_DELIMITER=
|
||||||
# Custom icon.
|
# Custom icon.
|
||||||
|
|
@ -831,10 +934,33 @@
|
||||||
#####################[ anaconda: conda environment (https://conda.io/) ]######################
|
#####################[ anaconda: conda environment (https://conda.io/) ]######################
|
||||||
# Anaconda environment color.
|
# Anaconda environment color.
|
||||||
typeset -g POWERLEVEL9K_ANACONDA_FOREGROUND=37
|
typeset -g POWERLEVEL9K_ANACONDA_FOREGROUND=37
|
||||||
# Don't show Python version next to the anaconda environment name.
|
|
||||||
typeset -g POWERLEVEL9K_ANACONDA_SHOW_PYTHON_VERSION=false
|
# Anaconda segment format. The following parameters are available within the expansion.
|
||||||
# Separate environment name from Python version only with a space.
|
#
|
||||||
typeset -g POWERLEVEL9K_ANACONDA_{LEFT,RIGHT}_DELIMITER=
|
# - CONDA_PREFIX Absolute path to the active Anaconda/Miniconda environment.
|
||||||
|
# - CONDA_DEFAULT_ENV Name of the active Anaconda/Miniconda environment.
|
||||||
|
# - CONDA_PROMPT_MODIFIER Configurable prompt modifier (see below).
|
||||||
|
# - P9K_ANACONDA_PYTHON_VERSION Current python version (python --version).
|
||||||
|
#
|
||||||
|
# CONDA_PROMPT_MODIFIER can be configured with the following command:
|
||||||
|
#
|
||||||
|
# conda config --set env_prompt '({default_env}) '
|
||||||
|
#
|
||||||
|
# The last argument is a Python format string that can use the following variables:
|
||||||
|
#
|
||||||
|
# - prefix The same as CONDA_PREFIX.
|
||||||
|
# - default_env The same as CONDA_DEFAULT_ENV.
|
||||||
|
# - name The last segment of CONDA_PREFIX.
|
||||||
|
# - stacked_env Comma-separated list of names in the environment stack. The first element is
|
||||||
|
# always the same as default_env.
|
||||||
|
#
|
||||||
|
# Note: '({default_env}) ' is the default value of env_prompt.
|
||||||
|
#
|
||||||
|
# The default value of POWERLEVEL9K_ANACONDA_CONTENT_EXPANSION expands to $CONDA_PROMPT_MODIFIER
|
||||||
|
# without the surrounding parentheses, or to the last path component of CONDA_PREFIX if the former
|
||||||
|
# is empty.
|
||||||
|
typeset -g POWERLEVEL9K_ANACONDA_CONTENT_EXPANSION='${${${${CONDA_PROMPT_MODIFIER#\(}% }%\)}:-${CONDA_PREFIX:t}}'
|
||||||
|
|
||||||
# Custom icon.
|
# Custom icon.
|
||||||
# typeset -g POWERLEVEL9K_ANACONDA_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
# typeset -g POWERLEVEL9K_ANACONDA_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
||||||
|
|
||||||
|
|
@ -848,6 +974,19 @@
|
||||||
typeset -g POWERLEVEL9K_PYENV_PROMPT_ALWAYS_SHOW=false
|
typeset -g POWERLEVEL9K_PYENV_PROMPT_ALWAYS_SHOW=false
|
||||||
# If set to false, hide python version if it's equal to "system".
|
# If set to false, hide python version if it's equal to "system".
|
||||||
typeset -g POWERLEVEL9K_PYENV_SHOW_SYSTEM=true
|
typeset -g POWERLEVEL9K_PYENV_SHOW_SYSTEM=true
|
||||||
|
|
||||||
|
# Pyenv segment format. The following parameters are available within the expansion.
|
||||||
|
#
|
||||||
|
# - P9K_CONTENT Current pyenv environment (pyenv version-name).
|
||||||
|
# - P9K_PYENV_PYTHON_VERSION Current python version (python --version).
|
||||||
|
#
|
||||||
|
# The default format has the following logic:
|
||||||
|
#
|
||||||
|
# 1. Display just "$P9K_CONTENT" if it's equal to "$P9K_PYENV_PYTHON_VERSION" or
|
||||||
|
# starts with "$P9K_PYENV_PYTHON_VERSION/".
|
||||||
|
# 2. Otherwise display "$P9K_CONTENT $P9K_PYENV_PYTHON_VERSION".
|
||||||
|
typeset -g POWERLEVEL9K_PYENV_CONTENT_EXPANSION='${P9K_CONTENT}${${P9K_CONTENT:#$P9K_PYENV_PYTHON_VERSION(|/*)}:+ $P9K_PYENV_PYTHON_VERSION}'
|
||||||
|
|
||||||
# Custom icon.
|
# Custom icon.
|
||||||
# typeset -g POWERLEVEL9K_PYENV_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
# typeset -g POWERLEVEL9K_PYENV_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
||||||
|
|
||||||
|
|
@ -880,6 +1019,11 @@
|
||||||
##############[ nvm: node.js version from nvm (https://github.com/nvm-sh/nvm) ]###############
|
##############[ nvm: node.js version from nvm (https://github.com/nvm-sh/nvm) ]###############
|
||||||
# Nvm color.
|
# Nvm color.
|
||||||
typeset -g POWERLEVEL9K_NVM_FOREGROUND=70
|
typeset -g POWERLEVEL9K_NVM_FOREGROUND=70
|
||||||
|
# If set to false, hide node version if it's the same as default:
|
||||||
|
# $(nvm version current) == $(nvm version default).
|
||||||
|
typeset -g POWERLEVEL9K_NVM_PROMPT_ALWAYS_SHOW=false
|
||||||
|
# If set to false, hide node version if it's equal to "system".
|
||||||
|
typeset -g POWERLEVEL9K_NVM_SHOW_SYSTEM=true
|
||||||
# Custom icon.
|
# Custom icon.
|
||||||
# typeset -g POWERLEVEL9K_NVM_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
# typeset -g POWERLEVEL9K_NVM_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
||||||
|
|
||||||
|
|
@ -1029,6 +1173,16 @@
|
||||||
# Custom icon.
|
# Custom icon.
|
||||||
# typeset -g POWERLEVEL9K_PLENV_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
# typeset -g POWERLEVEL9K_PLENV_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
||||||
|
|
||||||
|
###########[ perlbrew: perl version from perlbrew (https://github.com/gugod/App-perlbrew) ]############
|
||||||
|
# Perlbrew color.
|
||||||
|
typeset -g POWERLEVEL9K_PERLBREW_FOREGROUND=67
|
||||||
|
# Show perlbrew version only when in a perl project subdirectory.
|
||||||
|
typeset -g POWERLEVEL9K_PERLBREW_PROJECT_ONLY=true
|
||||||
|
# Don't show "perl-" at the front.
|
||||||
|
typeset -g POWERLEVEL9K_PERLBREW_SHOW_PREFIX=false
|
||||||
|
# Custom icon.
|
||||||
|
# typeset -g POWERLEVEL9K_PERLBREW_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
||||||
|
|
||||||
############[ phpenv: php version from phpenv (https://github.com/phpenv/phpenv) ]############
|
############[ phpenv: php version from phpenv (https://github.com/phpenv/phpenv) ]############
|
||||||
# PHP color.
|
# PHP color.
|
||||||
typeset -g POWERLEVEL9K_PHPENV_FOREGROUND=99
|
typeset -g POWERLEVEL9K_PHPENV_FOREGROUND=99
|
||||||
|
|
@ -1042,6 +1196,19 @@
|
||||||
# Custom icon.
|
# Custom icon.
|
||||||
# typeset -g POWERLEVEL9K_PHPENV_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
# typeset -g POWERLEVEL9K_PHPENV_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
||||||
|
|
||||||
|
#######[ scalaenv: scala version from scalaenv (https://github.com/scalaenv/scalaenv) ]#######
|
||||||
|
# Scala color.
|
||||||
|
typeset -g POWERLEVEL9K_SCALAENV_FOREGROUND=160
|
||||||
|
# Hide scala version if it doesn't come from one of these sources.
|
||||||
|
typeset -g POWERLEVEL9K_SCALAENV_SOURCES=(shell local global)
|
||||||
|
# If set to false, hide scala version if it's the same as global:
|
||||||
|
# $(scalaenv version-name) == $(scalaenv global).
|
||||||
|
typeset -g POWERLEVEL9K_SCALAENV_PROMPT_ALWAYS_SHOW=false
|
||||||
|
# If set to false, hide scala version if it's equal to "system".
|
||||||
|
typeset -g POWERLEVEL9K_SCALAENV_SHOW_SYSTEM=true
|
||||||
|
# Custom icon.
|
||||||
|
# typeset -g POWERLEVEL9K_SCALAENV_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
||||||
|
|
||||||
##########[ haskell_stack: haskell version from stack (https://haskellstack.org/) ]###########
|
##########[ haskell_stack: haskell version from stack (https://haskellstack.org/) ]###########
|
||||||
# Haskell color.
|
# Haskell color.
|
||||||
typeset -g POWERLEVEL9K_HASKELL_STACK_FOREGROUND=172
|
typeset -g POWERLEVEL9K_HASKELL_STACK_FOREGROUND=172
|
||||||
|
|
@ -1057,9 +1224,9 @@
|
||||||
# typeset -g POWERLEVEL9K_HASKELL_STACK_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
# typeset -g POWERLEVEL9K_HASKELL_STACK_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
||||||
|
|
||||||
#############[ kubecontext: current kubernetes context (https://kubernetes.io/) ]#############
|
#############[ kubecontext: current kubernetes context (https://kubernetes.io/) ]#############
|
||||||
# Show kubecontext only when the the command you are typing invokes one of these tools.
|
# Show kubecontext only when the command you are typing invokes one of these tools.
|
||||||
# Tip: Remove the next line to always show kubecontext.
|
# Tip: Remove the next line to always show kubecontext.
|
||||||
typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito'
|
typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito|k9s|helmfile|flux|fluxctl|stern|kubeseal|skaffold|kubent|kubecolor|cmctl|sparkctl'
|
||||||
|
|
||||||
# Kubernetes context classes for the purpose of using different colors, icons and expansions with
|
# Kubernetes context classes for the purpose of using different colors, icons and expansions with
|
||||||
# different contexts.
|
# different contexts.
|
||||||
|
|
@ -1144,6 +1311,8 @@
|
||||||
# typeset -g POWERLEVEL9K_KUBECONTEXT_PREFIX='%fat '
|
# typeset -g POWERLEVEL9K_KUBECONTEXT_PREFIX='%fat '
|
||||||
|
|
||||||
################[ terraform: terraform workspace (https://www.terraform.io) ]#################
|
################[ terraform: terraform workspace (https://www.terraform.io) ]#################
|
||||||
|
# Don't show terraform workspace if it's literally "default".
|
||||||
|
typeset -g POWERLEVEL9K_TERRAFORM_SHOW_DEFAULT=false
|
||||||
# POWERLEVEL9K_TERRAFORM_CLASSES is an array with even number of elements. The first element
|
# POWERLEVEL9K_TERRAFORM_CLASSES is an array with even number of elements. The first element
|
||||||
# in each pair defines a pattern against which the current terraform workspace gets matched.
|
# in each pair defines a pattern against which the current terraform workspace gets matched.
|
||||||
# More specifically, it's P9K_CONTENT prior to the application of context expansion (see below)
|
# More specifically, it's P9K_CONTENT prior to the application of context expansion (see below)
|
||||||
|
|
@ -1157,7 +1326,7 @@
|
||||||
# typeset -g POWERLEVEL9K_TERRAFORM_CLASSES=(
|
# typeset -g POWERLEVEL9K_TERRAFORM_CLASSES=(
|
||||||
# '*prod*' PROD
|
# '*prod*' PROD
|
||||||
# '*test*' TEST
|
# '*test*' TEST
|
||||||
# '*' DEFAULT)
|
# '*' OTHER)
|
||||||
#
|
#
|
||||||
# If your current terraform workspace is "project_test", its class is TEST because "project_test"
|
# If your current terraform workspace is "project_test", its class is TEST because "project_test"
|
||||||
# doesn't match the pattern '*prod*' but does match '*test*'.
|
# doesn't match the pattern '*prod*' but does match '*test*'.
|
||||||
|
|
@ -1170,14 +1339,20 @@
|
||||||
typeset -g POWERLEVEL9K_TERRAFORM_CLASSES=(
|
typeset -g POWERLEVEL9K_TERRAFORM_CLASSES=(
|
||||||
# '*prod*' PROD # These values are examples that are unlikely
|
# '*prod*' PROD # These values are examples that are unlikely
|
||||||
# '*test*' TEST # to match your needs. Customize them as needed.
|
# '*test*' TEST # to match your needs. Customize them as needed.
|
||||||
'*' DEFAULT)
|
'*' OTHER)
|
||||||
typeset -g POWERLEVEL9K_TERRAFORM_DEFAULT_FOREGROUND=38
|
typeset -g POWERLEVEL9K_TERRAFORM_OTHER_FOREGROUND=38
|
||||||
# typeset -g POWERLEVEL9K_TERRAFORM_DEFAULT_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
# typeset -g POWERLEVEL9K_TERRAFORM_OTHER_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
||||||
|
|
||||||
|
#############[ terraform_version: terraform version (https://www.terraform.io) ]##############
|
||||||
|
# Terraform version color.
|
||||||
|
typeset -g POWERLEVEL9K_TERRAFORM_VERSION_FOREGROUND=38
|
||||||
|
# Custom icon.
|
||||||
|
# typeset -g POWERLEVEL9K_TERRAFORM_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
||||||
|
|
||||||
#[ aws: aws profile (https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html) ]#
|
#[ aws: aws profile (https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html) ]#
|
||||||
# Show aws only when the the command you are typing invokes one of these tools.
|
# Show aws only when the command you are typing invokes one of these tools.
|
||||||
# Tip: Remove the next line to always show aws.
|
# Tip: Remove the next line to always show aws.
|
||||||
typeset -g POWERLEVEL9K_AWS_SHOW_ON_COMMAND='aws|awless|terraform|pulumi'
|
typeset -g POWERLEVEL9K_AWS_SHOW_ON_COMMAND='aws|awless|cdk|terraform|pulumi|terragrunt'
|
||||||
|
|
||||||
# POWERLEVEL9K_AWS_CLASSES is an array with even number of elements. The first element
|
# POWERLEVEL9K_AWS_CLASSES is an array with even number of elements. The first element
|
||||||
# in each pair defines a pattern against which the current AWS profile gets matched.
|
# in each pair defines a pattern against which the current AWS profile gets matched.
|
||||||
|
|
@ -1209,6 +1384,12 @@
|
||||||
typeset -g POWERLEVEL9K_AWS_DEFAULT_FOREGROUND=208
|
typeset -g POWERLEVEL9K_AWS_DEFAULT_FOREGROUND=208
|
||||||
# typeset -g POWERLEVEL9K_AWS_DEFAULT_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
# typeset -g POWERLEVEL9K_AWS_DEFAULT_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
||||||
|
|
||||||
|
# AWS segment format. The following parameters are available within the expansion.
|
||||||
|
#
|
||||||
|
# - P9K_AWS_PROFILE The name of the current AWS profile.
|
||||||
|
# - P9K_AWS_REGION The region associated with the current AWS profile.
|
||||||
|
typeset -g POWERLEVEL9K_AWS_CONTENT_EXPANSION='${P9K_AWS_PROFILE//\%/%%}${P9K_AWS_REGION:+ ${P9K_AWS_REGION//\%/%%}}'
|
||||||
|
|
||||||
#[ aws_eb_env: aws elastic beanstalk environment (https://aws.amazon.com/elasticbeanstalk/) ]#
|
#[ aws_eb_env: aws elastic beanstalk environment (https://aws.amazon.com/elasticbeanstalk/) ]#
|
||||||
# AWS Elastic Beanstalk environment color.
|
# AWS Elastic Beanstalk environment color.
|
||||||
typeset -g POWERLEVEL9K_AWS_EB_ENV_FOREGROUND=70
|
typeset -g POWERLEVEL9K_AWS_EB_ENV_FOREGROUND=70
|
||||||
|
|
@ -1216,18 +1397,47 @@
|
||||||
# typeset -g POWERLEVEL9K_AWS_EB_ENV_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
# typeset -g POWERLEVEL9K_AWS_EB_ENV_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
||||||
|
|
||||||
##########[ azure: azure account name (https://docs.microsoft.com/en-us/cli/azure) ]##########
|
##########[ azure: azure account name (https://docs.microsoft.com/en-us/cli/azure) ]##########
|
||||||
# Show azure only when the the command you are typing invokes one of these tools.
|
# Show azure only when the command you are typing invokes one of these tools.
|
||||||
# Tip: Remove the next line to always show azure.
|
# Tip: Remove the next line to always show azure.
|
||||||
typeset -g POWERLEVEL9K_AZURE_SHOW_ON_COMMAND='az|terraform|pulumi'
|
typeset -g POWERLEVEL9K_AZURE_SHOW_ON_COMMAND='az|terraform|pulumi|terragrunt'
|
||||||
|
|
||||||
|
# POWERLEVEL9K_AZURE_CLASSES is an array with even number of elements. The first element
|
||||||
|
# in each pair defines a pattern against which the current azure account name gets matched.
|
||||||
|
# More specifically, it's P9K_CONTENT prior to the application of context expansion (see below)
|
||||||
|
# that gets matched. If you unset all POWERLEVEL9K_AZURE_*CONTENT_EXPANSION parameters,
|
||||||
|
# you'll see this value in your prompt. The second element of each pair in
|
||||||
|
# POWERLEVEL9K_AZURE_CLASSES defines the account class. Patterns are tried in order. The
|
||||||
|
# first match wins.
|
||||||
|
#
|
||||||
|
# For example, given these settings:
|
||||||
|
#
|
||||||
|
# typeset -g POWERLEVEL9K_AZURE_CLASSES=(
|
||||||
|
# '*prod*' PROD
|
||||||
|
# '*test*' TEST
|
||||||
|
# '*' OTHER)
|
||||||
|
#
|
||||||
|
# If your current azure account is "company_test", its class is TEST because "company_test"
|
||||||
|
# doesn't match the pattern '*prod*' but does match '*test*'.
|
||||||
|
#
|
||||||
|
# You can define different colors, icons and content expansions for different classes:
|
||||||
|
#
|
||||||
|
# typeset -g POWERLEVEL9K_AZURE_TEST_FOREGROUND=28
|
||||||
|
# typeset -g POWERLEVEL9K_AZURE_TEST_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
||||||
|
# typeset -g POWERLEVEL9K_AZURE_TEST_CONTENT_EXPANSION='> ${P9K_CONTENT} <'
|
||||||
|
typeset -g POWERLEVEL9K_AZURE_CLASSES=(
|
||||||
|
# '*prod*' PROD # These values are examples that are unlikely
|
||||||
|
# '*test*' TEST # to match your needs. Customize them as needed.
|
||||||
|
'*' OTHER)
|
||||||
|
|
||||||
# Azure account name color.
|
# Azure account name color.
|
||||||
typeset -g POWERLEVEL9K_AZURE_FOREGROUND=32
|
typeset -g POWERLEVEL9K_AZURE_OTHER_FOREGROUND=32
|
||||||
# Custom icon.
|
# Custom icon.
|
||||||
# typeset -g POWERLEVEL9K_AZURE_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
# typeset -g POWERLEVEL9K_AZURE_OTHER_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
||||||
|
|
||||||
##########[ gcloud: google cloud account and project (https://cloud.google.com/) ]###########
|
##########[ gcloud: google cloud account and project (https://cloud.google.com/) ]###########
|
||||||
# Show gcloud only when the the command you are typing invokes one of these tools.
|
# Show gcloud only when the command you are typing invokes one of these tools.
|
||||||
# Tip: Remove the next line to always show gcloud.
|
# Tip: Remove the next line to always show gcloud.
|
||||||
typeset -g POWERLEVEL9K_GCLOUD_SHOW_ON_COMMAND='gcloud|gcs'
|
typeset -g POWERLEVEL9K_GCLOUD_SHOW_ON_COMMAND='gcloud|gcs|gsutil'
|
||||||
# Google cloud color.
|
# Google cloud color.
|
||||||
typeset -g POWERLEVEL9K_GCLOUD_FOREGROUND=32
|
typeset -g POWERLEVEL9K_GCLOUD_FOREGROUND=32
|
||||||
|
|
||||||
|
|
@ -1243,7 +1453,7 @@
|
||||||
# P9K_GCLOUD_PROJECT_ID | gcloud config get-value project
|
# P9K_GCLOUD_PROJECT_ID | gcloud config get-value project
|
||||||
# P9K_GCLOUD_PROJECT_NAME | gcloud projects describe $P9K_GCLOUD_PROJECT_ID --format='value(name)'
|
# P9K_GCLOUD_PROJECT_NAME | gcloud projects describe $P9K_GCLOUD_PROJECT_ID --format='value(name)'
|
||||||
#
|
#
|
||||||
# Note: ${VARIABLE//\%/%%} expands to ${VARIABLE} with all occurences of '%' replaced with '%%'.
|
# Note: ${VARIABLE//\%/%%} expands to ${VARIABLE} with all occurrences of '%' replaced with '%%'.
|
||||||
#
|
#
|
||||||
# Obtaining project name requires sending a request to Google servers. This can take a long time
|
# Obtaining project name requires sending a request to Google servers. This can take a long time
|
||||||
# and even fail. When project name is unknown, P9K_GCLOUD_PROJECT_NAME is not set and gcloud
|
# and even fail. When project name is unknown, P9K_GCLOUD_PROJECT_NAME is not set and gcloud
|
||||||
|
|
@ -1266,9 +1476,9 @@
|
||||||
# typeset -g POWERLEVEL9K_GCLOUD_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
# typeset -g POWERLEVEL9K_GCLOUD_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
||||||
|
|
||||||
#[ google_app_cred: google application credentials (https://cloud.google.com/docs/authentication/production) ]#
|
#[ google_app_cred: google application credentials (https://cloud.google.com/docs/authentication/production) ]#
|
||||||
# Show google_app_cred only when the the command you are typing invokes one of these tools.
|
# Show google_app_cred only when the command you are typing invokes one of these tools.
|
||||||
# Tip: Remove the next line to always show google_app_cred.
|
# Tip: Remove the next line to always show google_app_cred.
|
||||||
typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_SHOW_ON_COMMAND='terraform|pulumi'
|
typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_SHOW_ON_COMMAND='terraform|pulumi|terragrunt'
|
||||||
|
|
||||||
# Google application credentials classes for the purpose of using different colors, icons and
|
# Google application credentials classes for the purpose of using different colors, icons and
|
||||||
# expansions with different credentials.
|
# expansions with different credentials.
|
||||||
|
|
@ -1316,9 +1526,19 @@
|
||||||
# P9K_GOOGLE_APP_CRED_PROJECT_ID | project_id
|
# P9K_GOOGLE_APP_CRED_PROJECT_ID | project_id
|
||||||
# P9K_GOOGLE_APP_CRED_CLIENT_EMAIL | client_email
|
# P9K_GOOGLE_APP_CRED_CLIENT_EMAIL | client_email
|
||||||
#
|
#
|
||||||
# Note: ${VARIABLE//\%/%%} expands to ${VARIABLE} with all occurences of '%' replaced by '%%'.
|
# Note: ${VARIABLE//\%/%%} expands to ${VARIABLE} with all occurrences of '%' replaced by '%%'.
|
||||||
typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_DEFAULT_CONTENT_EXPANSION='${P9K_GOOGLE_APP_CRED_PROJECT_ID//\%/%%}'
|
typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_DEFAULT_CONTENT_EXPANSION='${P9K_GOOGLE_APP_CRED_PROJECT_ID//\%/%%}'
|
||||||
|
|
||||||
|
##############[ toolbox: toolbox name (https://github.com/containers/toolbox) ]###############
|
||||||
|
# Toolbox color.
|
||||||
|
typeset -g POWERLEVEL9K_TOOLBOX_FOREGROUND=178
|
||||||
|
# Don't display the name of the toolbox if it matches fedora-toolbox-*.
|
||||||
|
typeset -g POWERLEVEL9K_TOOLBOX_CONTENT_EXPANSION='${P9K_TOOLBOX_NAME:#fedora-toolbox-*}'
|
||||||
|
# Custom icon.
|
||||||
|
# typeset -g POWERLEVEL9K_TOOLBOX_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
||||||
|
# Custom prefix.
|
||||||
|
# typeset -g POWERLEVEL9K_TOOLBOX_PREFIX='%fin '
|
||||||
|
|
||||||
###############################[ public_ip: public IP address ]###############################
|
###############################[ public_ip: public IP address ]###############################
|
||||||
# Public IP color.
|
# Public IP color.
|
||||||
typeset -g POWERLEVEL9K_PUBLIC_IP_FOREGROUND=94
|
typeset -g POWERLEVEL9K_PUBLIC_IP_FOREGROUND=94
|
||||||
|
|
@ -1333,7 +1553,7 @@
|
||||||
typeset -g POWERLEVEL9K_VPN_IP_CONTENT_EXPANSION=
|
typeset -g POWERLEVEL9K_VPN_IP_CONTENT_EXPANSION=
|
||||||
# Regular expression for the VPN network interface. Run `ifconfig` or `ip -4 a show` while on VPN
|
# Regular expression for the VPN network interface. Run `ifconfig` or `ip -4 a show` while on VPN
|
||||||
# to see the name of the interface.
|
# to see the name of the interface.
|
||||||
typeset -g POWERLEVEL9K_VPN_IP_INTERFACE='(wg|(.*tun))[0-9]*'
|
typeset -g POWERLEVEL9K_VPN_IP_INTERFACE='(gpd|wg|(.*tun)|tailscale)[0-9]*|(zt.*)'
|
||||||
# If set to true, show one segment per matching network interface. If set to false, show only
|
# If set to true, show one segment per matching network interface. If set to false, show only
|
||||||
# one segment corresponding to the first matching network interface.
|
# one segment corresponding to the first matching network interface.
|
||||||
# Tip: If you set it to true, you'll probably want to unset POWERLEVEL9K_VPN_IP_CONTENT_EXPANSION.
|
# Tip: If you set it to true, you'll probably want to unset POWERLEVEL9K_VPN_IP_CONTENT_EXPANSION.
|
||||||
|
|
@ -1347,17 +1567,19 @@
|
||||||
# The following parameters are accessible within the expansion:
|
# The following parameters are accessible within the expansion:
|
||||||
#
|
#
|
||||||
# Parameter | Meaning
|
# Parameter | Meaning
|
||||||
# ----------------------+---------------
|
# ----------------------+-------------------------------------------
|
||||||
# P9K_IP_IP | IP address
|
# P9K_IP_IP | IP address
|
||||||
# P9K_IP_INTERFACE | network interface
|
# P9K_IP_INTERFACE | network interface
|
||||||
# P9K_IP_RX_BYTES | total number of bytes received
|
# P9K_IP_RX_BYTES | total number of bytes received
|
||||||
# P9K_IP_TX_BYTES | total number of bytes sent
|
# P9K_IP_TX_BYTES | total number of bytes sent
|
||||||
# P9K_IP_RX_RATE | receive rate (since last prompt)
|
# P9K_IP_RX_BYTES_DELTA | number of bytes received since last prompt
|
||||||
# P9K_IP_TX_RATE | send rate (since last prompt)
|
# P9K_IP_TX_BYTES_DELTA | number of bytes sent since last prompt
|
||||||
|
# P9K_IP_RX_RATE | receive rate (since last prompt)
|
||||||
|
# P9K_IP_TX_RATE | send rate (since last prompt)
|
||||||
typeset -g POWERLEVEL9K_IP_CONTENT_EXPANSION='$P9K_IP_IP${P9K_IP_RX_RATE:+ %70F⇣$P9K_IP_RX_RATE}${P9K_IP_TX_RATE:+ %215F⇡$P9K_IP_TX_RATE}'
|
typeset -g POWERLEVEL9K_IP_CONTENT_EXPANSION='$P9K_IP_IP${P9K_IP_RX_RATE:+ %70F⇣$P9K_IP_RX_RATE}${P9K_IP_TX_RATE:+ %215F⇡$P9K_IP_TX_RATE}'
|
||||||
# Show information for the first network interface whose name matches this regular expression.
|
# Show information for the first network interface whose name matches this regular expression.
|
||||||
# Run `ifconfig` or `ip -4 a show` to see the names of all network interfaces.
|
# Run `ifconfig` or `ip -4 a show` to see the names of all network interfaces.
|
||||||
typeset -g POWERLEVEL9K_IP_INTERFACE='e.*'
|
typeset -g POWERLEVEL9K_IP_INTERFACE='[ew].*'
|
||||||
# Custom icon.
|
# Custom icon.
|
||||||
# typeset -g POWERLEVEL9K_IP_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
# typeset -g POWERLEVEL9K_IP_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
||||||
|
|
||||||
|
|
@ -1400,15 +1622,11 @@
|
||||||
# Parameter | Meaning
|
# Parameter | Meaning
|
||||||
# ----------------------+---------------
|
# ----------------------+---------------
|
||||||
# P9K_WIFI_SSID | service set identifier, a.k.a. network name
|
# P9K_WIFI_SSID | service set identifier, a.k.a. network name
|
||||||
# P9K_WIFI_LINK_AUTH | authentication protocol such as "wpa2-psk" or "none"
|
# P9K_WIFI_LINK_AUTH | authentication protocol such as "wpa2-psk" or "none"; empty if unknown
|
||||||
# P9K_WIFI_LAST_TX_RATE | wireless transmit rate in megabits per second
|
# P9K_WIFI_LAST_TX_RATE | wireless transmit rate in megabits per second
|
||||||
# P9K_WIFI_RSSI | signal strength in dBm, from -120 to 0
|
# P9K_WIFI_RSSI | signal strength in dBm, from -120 to 0
|
||||||
# P9K_WIFI_NOISE | noise in dBm, from -120 to 0
|
# P9K_WIFI_NOISE | noise in dBm, from -120 to 0
|
||||||
# P9K_WIFI_BARS | signal strength in bars, from 0 to 4 (derived from P9K_WIFI_RSSI and P9K_WIFI_NOISE)
|
# P9K_WIFI_BARS | signal strength in bars, from 0 to 4 (derived from P9K_WIFI_RSSI and P9K_WIFI_NOISE)
|
||||||
#
|
|
||||||
# All parameters except P9K_WIFI_BARS are extracted from the output of the following command:
|
|
||||||
#
|
|
||||||
# /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -I
|
|
||||||
|
|
||||||
####################################[ time: current time ]####################################
|
####################################[ time: current time ]####################################
|
||||||
# Current time color.
|
# Current time color.
|
||||||
|
|
@ -1435,7 +1653,7 @@
|
||||||
|
|
||||||
# User-defined prompt segments may optionally provide an instant_prompt_* function. Its job
|
# User-defined prompt segments may optionally provide an instant_prompt_* function. Its job
|
||||||
# is to generate the prompt segment for display in instant prompt. See
|
# is to generate the prompt segment for display in instant prompt. See
|
||||||
# https://github.com/romkatv/powerlevel10k/blob/master/README.md#instant-prompt.
|
# https://github.com/romkatv/powerlevel10k#instant-prompt.
|
||||||
#
|
#
|
||||||
# Powerlevel10k will call instant_prompt_* at the same time as the regular prompt_* function
|
# Powerlevel10k will call instant_prompt_* at the same time as the regular prompt_* function
|
||||||
# and will record all `p10k segment` calls it makes. When displaying instant prompt, Powerlevel10k
|
# and will record all `p10k segment` calls it makes. When displaying instant prompt, Powerlevel10k
|
||||||
|
|
@ -1471,7 +1689,7 @@
|
||||||
# it incompatible with your zsh configuration files.
|
# it incompatible with your zsh configuration files.
|
||||||
# - quiet: Enable instant prompt and don't print warnings when detecting console output
|
# - quiet: Enable instant prompt and don't print warnings when detecting console output
|
||||||
# during zsh initialization. Choose this if you've read and understood
|
# during zsh initialization. Choose this if you've read and understood
|
||||||
# https://github.com/romkatv/powerlevel10k/blob/master/README.md#instant-prompt.
|
# https://github.com/romkatv/powerlevel10k#instant-prompt.
|
||||||
# - verbose: Enable instant prompt and print a warning when detecting console output during
|
# - verbose: Enable instant prompt and print a warning when detecting console output during
|
||||||
# zsh initialization. Choose this if you've never tried instant prompt, haven't
|
# zsh initialization. Choose this if you've never tried instant prompt, haven't
|
||||||
# seen the warning, or if you are unsure what this all means.
|
# seen the warning, or if you are unsure what this all means.
|
||||||
|
|
|
||||||
|
|
@ -23,13 +23,13 @@
|
||||||
'builtin' 'setopt' 'no_aliases' 'no_sh_glob' 'brace_expand'
|
'builtin' 'setopt' 'no_aliases' 'no_sh_glob' 'brace_expand'
|
||||||
|
|
||||||
() {
|
() {
|
||||||
emulate -L zsh
|
emulate -L zsh -o extended_glob
|
||||||
|
|
||||||
# Unset all configuration options.
|
# Unset all configuration options.
|
||||||
unset -m 'POWERLEVEL9K_*|DEFAULT_USER'
|
unset -m '(POWERLEVEL9K_*|DEFAULT_USER)~POWERLEVEL9K_GITSTATUS_DIR'
|
||||||
|
|
||||||
# Zsh >= 5.1 is required.
|
# Zsh >= 5.1 is required.
|
||||||
autoload -Uz is-at-least && is-at-least 5.1 || return
|
[[ $ZSH_VERSION == (5.<1->*|<6->.*) ]] || return
|
||||||
|
|
||||||
# Prompt colors.
|
# Prompt colors.
|
||||||
local grey=242
|
local grey=242
|
||||||
|
|
@ -169,7 +169,7 @@
|
||||||
# it incompatible with your zsh configuration files.
|
# it incompatible with your zsh configuration files.
|
||||||
# - quiet: Enable instant prompt and don't print warnings when detecting console output
|
# - quiet: Enable instant prompt and don't print warnings when detecting console output
|
||||||
# during zsh initialization. Choose this if you've read and understood
|
# during zsh initialization. Choose this if you've read and understood
|
||||||
# https://github.com/romkatv/powerlevel10k/blob/master/README.md#instant-prompt.
|
# https://github.com/romkatv/powerlevel10k#instant-prompt.
|
||||||
# - verbose: Enable instant prompt and print a warning when detecting console output during
|
# - verbose: Enable instant prompt and print a warning when detecting console output during
|
||||||
# zsh initialization. Choose this if you've never tried instant prompt, haven't
|
# zsh initialization. Choose this if you've never tried instant prompt, haven't
|
||||||
# seen the warning, or if you are unsure what this all means.
|
# seen the warning, or if you are unsure what this all means.
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load diff
|
|
@ -18,13 +18,13 @@
|
||||||
'builtin' 'setopt' 'no_aliases' 'no_sh_glob' 'brace_expand'
|
'builtin' 'setopt' 'no_aliases' 'no_sh_glob' 'brace_expand'
|
||||||
|
|
||||||
() {
|
() {
|
||||||
emulate -L zsh
|
emulate -L zsh -o extended_glob
|
||||||
|
|
||||||
# Unset all configuration options.
|
# Unset all configuration options.
|
||||||
unset -m 'POWERLEVEL9K_*|DEFAULT_USER'
|
unset -m '(POWERLEVEL9K_*|DEFAULT_USER)~POWERLEVEL9K_GITSTATUS_DIR'
|
||||||
|
|
||||||
# Zsh >= 5.1 is required.
|
# Zsh >= 5.1 is required.
|
||||||
autoload -Uz is-at-least && is-at-least 5.1 || return
|
[[ $ZSH_VERSION == (5.<1->*|<6->.*) ]] || return
|
||||||
|
|
||||||
# Left prompt segments.
|
# Left prompt segments.
|
||||||
typeset -g POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(prompt_char dir vcs)
|
typeset -g POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(prompt_char dir vcs)
|
||||||
|
|
@ -87,7 +87,7 @@
|
||||||
# it incompatible with your zsh configuration files.
|
# it incompatible with your zsh configuration files.
|
||||||
# - quiet: Enable instant prompt and don't print warnings when detecting console output
|
# - quiet: Enable instant prompt and don't print warnings when detecting console output
|
||||||
# during zsh initialization. Choose this if you've read and understood
|
# during zsh initialization. Choose this if you've read and understood
|
||||||
# https://github.com/romkatv/powerlevel10k/blob/master/README.md#instant-prompt.
|
# https://github.com/romkatv/powerlevel10k#instant-prompt.
|
||||||
# - verbose: Enable instant prompt and print a warning when detecting console output during
|
# - verbose: Enable instant prompt and print a warning when detecting console output during
|
||||||
# zsh initialization. Choose this if you've never tried instant prompt, haven't
|
# zsh initialization. Choose this if you've never tried instant prompt, haven't
|
||||||
# seen the warning, or if you are unsure what this all means.
|
# seen the warning, or if you are unsure what this all means.
|
||||||
|
|
|
||||||
180
font.md
Normal file
180
font.md
Normal file
|
|
@ -0,0 +1,180 @@
|
||||||
|
# Recommended font: Meslo Nerd Font patched for Powerlevel10k
|
||||||
|
|
||||||
|
Gorgeous monospace font designed by Jim Lyles for Bitstream, customized by the same for Apple,
|
||||||
|
further customized by André Berg, and finally patched by yours truly with customized scripts
|
||||||
|
originally developed by Ryan L McIntyre of Nerd Fonts. Contains all glyphs and symbols that
|
||||||
|
Powerlevel10k may need. Battle-tested in dozens of different terminals on all major operating
|
||||||
|
systems.
|
||||||
|
|
||||||
|
*FAQ*: [How was the recommended font created?](README.md#how-was-the-recommended-font-created)
|
||||||
|
|
||||||
|
## Automatic font installation
|
||||||
|
|
||||||
|
If you are using iTerm2 or Termux, `p10k configure` can install the recommended font for you.
|
||||||
|
Simply answer `Yes` when asked whether to install *Meslo Nerd Font*.
|
||||||
|
|
||||||
|
If you are using a different terminal, proceed with manual font installation. 👇
|
||||||
|
|
||||||
|
## Manual font installation
|
||||||
|
|
||||||
|
1. Download these four ttf files:
|
||||||
|
- [MesloLGS NF Regular.ttf](
|
||||||
|
https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Regular.ttf)
|
||||||
|
- [MesloLGS NF Bold.ttf](
|
||||||
|
https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Bold.ttf)
|
||||||
|
- [MesloLGS NF Italic.ttf](
|
||||||
|
https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Italic.ttf)
|
||||||
|
- [MesloLGS NF Bold Italic.ttf](
|
||||||
|
https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Bold%20Italic.ttf)
|
||||||
|
1. Double-click on each file and click "Install". This will make `MesloLGS NF` font available to all
|
||||||
|
applications on your system.
|
||||||
|
1. Configure your terminal to use this font:
|
||||||
|
- **iTerm2**: Type `p10k configure` and answer `Yes` when asked whether to install
|
||||||
|
*Meslo Nerd Font*. Alternatively, open *iTerm2 → Preferences → Profiles → Text* and set *Font* to
|
||||||
|
`MesloLGS NF`.
|
||||||
|
- **Apple Terminal**: Open *Terminal → Preferences → Profiles → Text*, click *Change* under *Font*
|
||||||
|
and select `MesloLGS NF` family.
|
||||||
|
- **Hyper**: Open *Hyper → Edit → Preferences* and change the value of `fontFamily` under
|
||||||
|
`module.exports.config` to `MesloLGS NF`.
|
||||||
|
- **Visual Studio Code**: Open *File → Preferences → Settings* (PC) or
|
||||||
|
*Code → Preferences → Settings* (Mac), enter `terminal.integrated.fontFamily` in the search box at
|
||||||
|
the top of *Settings* tab and set the value below to `MesloLGS NF`.
|
||||||
|
Consult [this screenshot](
|
||||||
|
https://raw.githubusercontent.com/romkatv/powerlevel10k-media/389133fb8c9a2347929a23702ce3039aacc46c3d/visual-studio-code-font-settings.jpg)
|
||||||
|
to see how it should look like or see [this issue](
|
||||||
|
https://github.com/romkatv/powerlevel10k/issues/671) for extra information.
|
||||||
|
- **GNOME Terminal** (the default Ubuntu terminal): Open *Terminal → Preferences* and click on the
|
||||||
|
selected profile under *Profiles*. Check *Custom font* under *Text Appearance* and select
|
||||||
|
`MesloLGS NF Regular`.
|
||||||
|
- **Konsole**: Open *Settings → Edit Current Profile → Appearance*, click *Select Font* and select
|
||||||
|
`MesloLGS NF Regular`.
|
||||||
|
- **Tilix**: Open *Tilix → Preferences* and click on the selected profile under *Profiles*. Check
|
||||||
|
*Custom font* under *Text Appearance* and select `MesloLGS NF Regular`.
|
||||||
|
- **Windows Console Host** (the old thing): Click the icon in the top left corner, then
|
||||||
|
*Properties → Font* and set *Font* to `MesloLGS NF`.
|
||||||
|
- **Windows Terminal** by Microsoft (the new thing): Open *Settings* (<kbd>Ctrl+,</kbd>), click
|
||||||
|
either on the selected profile under *Profiles* or on *Defaults*, click *Appearance* and set
|
||||||
|
*Font face* to `MesloLGS NF`.
|
||||||
|
- **Conemu**: Open *Setup → General → Fonts* and set *Main console font* to `MesloLGS NF`.
|
||||||
|
- **IntelliJ** (and other IDEs by Jet Brains): Open *IDE → Edit → Preferences → Editor →
|
||||||
|
Color Scheme → Console Font*. Select *Use console font instead of the default* and set the font
|
||||||
|
name to `MesloLGS NF`.
|
||||||
|
- **Termux**: Type `p10k configure` and answer `Yes` when asked whether to install
|
||||||
|
*Meslo Nerd Font*.
|
||||||
|
- **Blink**: Type `config`, go to *Appearance*, tap *Add a new font*, tap *Open Gallery*, select
|
||||||
|
*MesloLGS NF.css*, tap *import* and type `exit` in the home view to reload the font.
|
||||||
|
- **Tabby** (formerly **Terminus**): Open *Settings → Appearance* and set *Font* to `MesloLGS NF`.
|
||||||
|
- **Terminator**: Open *Preferences* using the context menu. Under *Profiles* select the *General*
|
||||||
|
tab (should be selected already), uncheck *Use the system fixed width font* (if not already)
|
||||||
|
and select `MesloLGS NF Regular`. Exit the Preferences dialog by clicking *Close*.
|
||||||
|
- **Guake**: Right Click on an open terminal and open *Preferences*. Under *Appearance*
|
||||||
|
tab, uncheck *Use the system fixed width font* (if not already) and select `MesloLGS NF Regular`.
|
||||||
|
Exit the Preferences dialog by clicking *Close*.
|
||||||
|
- **MobaXterm**: Open *Settings* → *Configuration* → *Terminal* → (under *Terminal look and feel*)
|
||||||
|
and change *Font* to `MesloLGS NF`. If you have *sessions*, you need to change the font in each
|
||||||
|
of them through *Settings* → right click on an individual session → *Edit Session* → *Terminal
|
||||||
|
Settings* → *Font settings*.
|
||||||
|
- **Asbrú Connection Manager**: Open *Preferences → Local Shell Options → Look and Feel*, enable
|
||||||
|
*Use these personal options* and change *Font:* under *Terminal UI* to `MesloLGS NF Regular`.
|
||||||
|
To change the font for the remote host connections, go to *Preferences → Terminal Options →
|
||||||
|
Look and Feel* and change *Font:* under *Terminal UI* to `MesloLGS NF Regular`.
|
||||||
|
- **Warp**: Open Warp and Navigate to *Settings* then *Appearance*. Scroll down to *Text* Section
|
||||||
|
and under *"Terminal Font"*, select the `MesloLGS NF` font.
|
||||||
|
- **WSLtty**: Right click on an open terminal and then on *Options*. In the *Text* section, under
|
||||||
|
*Font*, click *"Select..."* and set Font to `MesloLGS NF Regular`.
|
||||||
|
- **Yakuake**: Click *≡* → *Manage Profiles* → *New* → *Appearance*. Click *Choose* next to the
|
||||||
|
*Font* dropdown, select `MesloLGS NF` and click *OK*. Click *OK* to save the profile. Select the
|
||||||
|
new profile and click *Set as Default*.
|
||||||
|
- **Alacritty**: Create or open `~/.config/alacritty/alacritty.toml` and add the following
|
||||||
|
section to it:
|
||||||
|
```toml
|
||||||
|
[font.normal]
|
||||||
|
family = "MesloLGS NF"
|
||||||
|
```
|
||||||
|
- **foot**: Create or open `~/.config/foot/foot.ini` and add the following section to it:
|
||||||
|
```ini
|
||||||
|
font=MesloLGS NF:size=12
|
||||||
|
```
|
||||||
|
- **kitty**: Create or open `~/.config/kitty/kitty.conf` and add the following line to it:
|
||||||
|
```text
|
||||||
|
font_family MesloLGS NF
|
||||||
|
```
|
||||||
|
Restart kitty by closing all sessions and opening a new session.
|
||||||
|
- **puTTY**: Set *Window* → *Appearance* → *Font* to `MesloLGS NF`. Requires puTTY
|
||||||
|
version >= 0.75.
|
||||||
|
- **WezTerm**: Create or open `$HOME/.config/wezterm/wezterm.lua` and add the following:
|
||||||
|
```lua
|
||||||
|
local wezterm = require 'wezterm';
|
||||||
|
return {
|
||||||
|
font = wezterm.font("MesloLGS NF"),
|
||||||
|
}
|
||||||
|
```
|
||||||
|
If the file already exists, only add the line with the font to the existing return.
|
||||||
|
Also add the first line if it is not already present.
|
||||||
|
- **urxvt**: Create or open `~/.Xresources` and add the following line to it:
|
||||||
|
```text
|
||||||
|
URxvt.font: xft:MesloLGS NF:size=11
|
||||||
|
```
|
||||||
|
You can adjust the font size to your preference. After changing the config run
|
||||||
|
`xrdb ~/.Xresources` to reload it. The new config is applied to all new terminals.
|
||||||
|
- **xterm**: Create or open `~/.Xresources` and add the following line to it:
|
||||||
|
```text
|
||||||
|
xterm*faceName: MesloLGS NF
|
||||||
|
```
|
||||||
|
After changing the config run `xrdb ~/.Xresources` to reload it. The new config is applied to
|
||||||
|
all new terminals.
|
||||||
|
- **Zed**: Open `~/.config/zed/settings.json` and set `terminal.font_family` to `"MesloLGS NF"`.
|
||||||
|
```jsonc
|
||||||
|
{
|
||||||
|
"terminal": {
|
||||||
|
"font_family": "MesloLGS NF"
|
||||||
|
},
|
||||||
|
// Other settings.
|
||||||
|
}
|
||||||
|
```
|
||||||
|
- Crostini (Linux on Chrome OS): Open
|
||||||
|
chrome-untrusted://terminal/html/nassh_preferences_editor.html, set *Text font family* to
|
||||||
|
`'MesloLGS NF'` (including the quotes) and *Custom CSS (inline text)* to the following:
|
||||||
|
```css
|
||||||
|
@font-face {
|
||||||
|
font-family: "MesloLGS NF";
|
||||||
|
src: url("https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/MesloLGS%20NF%20Regular.ttf");
|
||||||
|
font-weight: normal;
|
||||||
|
font-style: normal;
|
||||||
|
}
|
||||||
|
@font-face {
|
||||||
|
font-family: "MesloLGS NF";
|
||||||
|
src: url("https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/MesloLGS%20NF%20Bold.ttf");
|
||||||
|
font-weight: bold;
|
||||||
|
font-style: normal;
|
||||||
|
}
|
||||||
|
@font-face {
|
||||||
|
font-family: "MesloLGS NF";
|
||||||
|
src: url("https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/MesloLGS%20NF%20Italic.ttf");
|
||||||
|
font-weight: normal;
|
||||||
|
font-style: italic;
|
||||||
|
}
|
||||||
|
@font-face {
|
||||||
|
font-family: "MesloLGS NF";
|
||||||
|
src: url("https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/MesloLGS%20NF%20Bold%20Italic.ttf");
|
||||||
|
font-weight: bold;
|
||||||
|
font-style: italic;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
**_CAVEAT_**: If you open the normal terminal preferences these settings will be overwritten.
|
||||||
|
- **Deepin Terminal**: Create or open `~/.config/deepin/deepin-terminal/config.conf` and add the following section
|
||||||
|
to it:
|
||||||
|
```ini
|
||||||
|
[basic.interface.font]
|
||||||
|
value = "MesloLGS NF"
|
||||||
|
```
|
||||||
|
- **Ghostty**: Open *Menu → Open Configuration* (Linux) or *Ghostty → Settings...* (Mac) and add
|
||||||
|
the following line:
|
||||||
|
```text
|
||||||
|
font-family = "MesloLGS NF"
|
||||||
|
```
|
||||||
|
1. Run `p10k configure` to generate a new `~/.p10k.zsh`. The old config may work
|
||||||
|
incorrectly with the new font.
|
||||||
|
|
||||||
|
_Using a different terminal and know how to set the font for it? Share your knowledge by sending a
|
||||||
|
PR to expand the list!_
|
||||||
|
|
@ -2,6 +2,7 @@ APPNAME ?= gitstatusd
|
||||||
OBJDIR ?= obj
|
OBJDIR ?= obj
|
||||||
|
|
||||||
CXX ?= g++
|
CXX ?= g++
|
||||||
|
ZSH := $(shell command -v zsh 2> /dev/null)
|
||||||
|
|
||||||
VERSION ?= $(shell . ./build.info && printf "%s" "$$gitstatus_version")
|
VERSION ?= $(shell . ./build.info && printf "%s" "$$gitstatus_version")
|
||||||
|
|
||||||
|
|
@ -9,7 +10,7 @@ VERSION ?= $(shell . ./build.info && printf "%s" "$$gitstatus_version")
|
||||||
#
|
#
|
||||||
# Sized delete is implemented as __ZdlPvm in /usr/lib/libc++.1.dylib but this symbol is
|
# Sized delete is implemented as __ZdlPvm in /usr/lib/libc++.1.dylib but this symbol is
|
||||||
# missing in macOS prior to 10.13.
|
# missing in macOS prior to 10.13.
|
||||||
CXXFLAGS += -std=c++14 -funsigned-char -O3 -DNDEBUG -DGITSTATUS_VERSION=$(VERSION) -Wall -Werror # -g -fsanitize=thread
|
CXXFLAGS += -std=c++14 -funsigned-char -O3 -DNDEBUG -DGITSTATUS_VERSION=$(VERSION) # -Wall -g -fsanitize=thread
|
||||||
LDFLAGS += -pthread # -fsanitize=thread
|
LDFLAGS += -pthread # -fsanitize=thread
|
||||||
LDLIBS += -lgit2 # -lprofiler -lunwind
|
LDLIBS += -lgit2 # -lprofiler -lunwind
|
||||||
|
|
||||||
|
|
@ -33,4 +34,24 @@ $(OBJDIR)/%.o: src/%.cc Makefile build.info | $(OBJDIR)
|
||||||
clean:
|
clean:
|
||||||
rm -rf -- $(OBJDIR)
|
rm -rf -- $(OBJDIR)
|
||||||
|
|
||||||
|
zwc:
|
||||||
|
$(or $(ZSH),:) -fc 'for f in *.zsh install; do zcompile -R -- $$f.zwc $$f || exit; done'
|
||||||
|
|
||||||
|
minify:
|
||||||
|
rm -rf -- .clang-format .git .gitattributes .gitignore .vscode deps docs src usrbin/.gitkeep LICENSE Makefile README.md build mbuild
|
||||||
|
|
||||||
|
pkg: zwc
|
||||||
|
GITSTATUS_DAEMON= GITSTATUS_CACHE_DIR=$(shell pwd)/usrbin ./install -f
|
||||||
|
|
||||||
-include $(OBJS:.o=.dep)
|
-include $(OBJS:.o=.dep)
|
||||||
|
|
||||||
|
.PHONY: help
|
||||||
|
|
||||||
|
help:
|
||||||
|
@echo "Usage: make [TARGET]"
|
||||||
|
@echo "Available targets:"
|
||||||
|
@echo " all Build $(APPNAME) (default target)"
|
||||||
|
@echo " clean Remove generated files and directories"
|
||||||
|
@echo " zwc Compile Zsh files"
|
||||||
|
@echo " minify Remove unnecessary files and folders"
|
||||||
|
@echo " pkg Create a package"
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,9 @@
|
||||||
# gitstatus
|
# gitstatus
|
||||||
|
|
||||||
|
- **THE PROJECT HAS VERY LIMITED SUPPORT**
|
||||||
|
- **NO NEW FEATURES ARE IN THE WORKS**
|
||||||
|
- **MOST BUGS WILL GO UNFIXED**
|
||||||
|
|
||||||
**gitstatus** is a 10x faster alternative to `git status` and `git describe`. Its primary use
|
**gitstatus** is a 10x faster alternative to `git status` and `git describe`. Its primary use
|
||||||
case is to enable fast git prompt in interactive shells.
|
case is to enable fast git prompt in interactive shells.
|
||||||
|
|
||||||
|
|
@ -22,7 +26,8 @@ Bash bindings for integration with shell.
|
||||||
|
|
||||||
The easiest way to take advantage of gitstatus from Zsh is to use a theme that's already integrated
|
The easiest way to take advantage of gitstatus from Zsh is to use a theme that's already integrated
|
||||||
with it. For example, [Powerlevel10k](https://github.com/romkatv/powerlevel10k) is a flexible and
|
with it. For example, [Powerlevel10k](https://github.com/romkatv/powerlevel10k) is a flexible and
|
||||||
fast theme with first-class gitstatus integration.
|
fast theme with first-class gitstatus integration. If you install Powerlevel10k, you don't need to
|
||||||
|
install gitstatus.
|
||||||
|
|
||||||

|
https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/prompt-styles-high-contrast.png)
|
||||||
|
|
@ -35,6 +40,24 @@ git clone --depth=1 https://github.com/romkatv/gitstatus.git ~/gitstatus
|
||||||
echo 'source ~/gitstatus/gitstatus.prompt.zsh' >>! ~/.zshrc
|
echo 'source ~/gitstatus/gitstatus.prompt.zsh' >>! ~/.zshrc
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Users in China can use the official mirror on gitee.com for faster download.<br>
|
||||||
|
中国大陆用户可以使用 gitee.com 上的官方镜像加速下载.
|
||||||
|
|
||||||
|
```zsh
|
||||||
|
git clone --depth=1 https://gitee.com/romkatv/gitstatus.git ~/gitstatus
|
||||||
|
echo 'source ~/gitstatus/gitstatus.prompt.zsh' >>! ~/.zshrc
|
||||||
|
```
|
||||||
|
|
||||||
|
Alternatively, if you have Homebrew installed:
|
||||||
|
|
||||||
|
```zsh
|
||||||
|
brew install romkatv/gitstatus/gitstatus
|
||||||
|
echo "source $(brew --prefix)/opt/gitstatus/gitstatus.prompt.zsh" >>! ~/.zshrc
|
||||||
|
```
|
||||||
|
|
||||||
|
(If you choose this option, replace `~/gitstatus` with `$(brew --prefix)/opt/gitstatus/gitstatus`
|
||||||
|
in all code snippets below.)
|
||||||
|
|
||||||
_Make sure to disable your current theme if you have one._
|
_Make sure to disable your current theme if you have one._
|
||||||
|
|
||||||
This will give you a basic yet functional prompt with git status in it. It's
|
This will give you a basic yet functional prompt with git status in it. It's
|
||||||
|
|
@ -85,9 +108,9 @@ function my_set_prompt() {
|
||||||
|
|
||||||
if gitstatus_query MY && [[ $VCS_STATUS_RESULT == ok-sync ]]; then
|
if gitstatus_query MY && [[ $VCS_STATUS_RESULT == ok-sync ]]; then
|
||||||
RPROMPT=${${VCS_STATUS_LOCAL_BRANCH:-@${VCS_STATUS_COMMIT}}//\%/%%} # escape %
|
RPROMPT=${${VCS_STATUS_LOCAL_BRANCH:-@${VCS_STATUS_COMMIT}}//\%/%%} # escape %
|
||||||
(( $VCS_STATUS_NUM_STAGED )) && RPROMPT+='+'
|
(( VCS_STATUS_NUM_STAGED )) && RPROMPT+='+'
|
||||||
(( $VCS_STATUS_NUM_UNSTAGED )) && RPROMPT+='!'
|
(( VCS_STATUS_NUM_UNSTAGED )) && RPROMPT+='!'
|
||||||
(( $VCS_STATUS_NUM_UNTRACKED )) && RPROMPT+='?'
|
(( VCS_STATUS_NUM_UNTRACKED )) && RPROMPT+='?'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
setopt no_prompt_{bang,subst} prompt_percent # enable/disable correct prompt expansions
|
setopt no_prompt_{bang,subst} prompt_percent # enable/disable correct prompt expansions
|
||||||
|
|
@ -118,6 +141,24 @@ git clone --depth=1 https://github.com/romkatv/gitstatus.git ~/gitstatus
|
||||||
echo 'source ~/gitstatus/gitstatus.prompt.sh' >> ~/.bashrc
|
echo 'source ~/gitstatus/gitstatus.prompt.sh' >> ~/.bashrc
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Users in China can use the official mirror on gitee.com for faster download.<br>
|
||||||
|
中国大陆用户可以使用 gitee.com 上的官方镜像加速下载.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git clone --depth=1 https://gitee.com/romkatv/gitstatus.git ~/gitstatus
|
||||||
|
echo 'source ~/gitstatus/gitstatus.prompt.sh' >> ~/.bashrc
|
||||||
|
```
|
||||||
|
|
||||||
|
Alternatively, if you have Homebrew installed:
|
||||||
|
|
||||||
|
```zsh
|
||||||
|
brew install romkatv/gitstatus/gitstatus
|
||||||
|
echo "source $(brew --prefix)/opt/gitstatus/gitstatus.prompt.sh" >> ~/.bashrc
|
||||||
|
```
|
||||||
|
|
||||||
|
(If you choose this option, replace `~/gitstatus` with `$(brew --prefix)/opt/gitstatus/gitstatus`
|
||||||
|
in all code snippets below.)
|
||||||
|
|
||||||
This will give you a basic yet functional prompt with git status in it. It's
|
This will give you a basic yet functional prompt with git status in it. It's
|
||||||
[over 10x faster](#benchmarks) than any alternative that can give you comparable prompt.
|
[over 10x faster](#benchmarks) than any alternative that can give you comparable prompt.
|
||||||
|
|
||||||
|
|
@ -168,9 +209,9 @@ function my_set_prompt() {
|
||||||
else
|
else
|
||||||
PS1+=" @${VCS_STATUS_COMMIT//\\/\\\\}" # escape backslash
|
PS1+=" @${VCS_STATUS_COMMIT//\\/\\\\}" # escape backslash
|
||||||
fi
|
fi
|
||||||
[[ "$VCS_STATUS_HAS_STAGED" == 1 ]] && PS1+='+'
|
(( VCS_STATUS_HAS_STAGED" )) && PS1+='+'
|
||||||
[[ "$VCS_STATUS_HAS_UNSTAGED" == 1 ]] && PS1+='!'
|
(( VCS_STATUS_HAS_UNSTAGED" )) && PS1+='!'
|
||||||
[[ "$VCS_STATUS_HAS_UNTRACKED" == 1 ]] && PS1+='?'
|
(( VCS_STATUS_HAS_UNTRACKED" )) && PS1+='?'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
PS1+='\n\$ '
|
PS1+='\n\$ '
|
||||||
|
|
@ -218,7 +259,7 @@ repository was checked out to an ext4 filesystem on M.2 SSD.
|
||||||
Three functionally equivalent tools for computing git status were benchmarked:
|
Three functionally equivalent tools for computing git status were benchmarked:
|
||||||
|
|
||||||
* `gitstatusd`
|
* `gitstatusd`
|
||||||
* `git` with untracked cache enabled
|
* `git` with `core.untrackedcache` enabled and `core.fsmonitor` disabled
|
||||||
* `lg2` -- a demo/example executable from [libgit2](https://github.com/romkatv/libgit2) that
|
* `lg2` -- a demo/example executable from [libgit2](https://github.com/romkatv/libgit2) that
|
||||||
implements a subset of `git` functionality on top of libgit2 API; for the purposes of this
|
implements a subset of `git` functionality on top of libgit2 API; for the purposes of this
|
||||||
benchmark the subset is sufficient to generate the same data as the other tools
|
benchmark the subset is sufficient to generate the same data as the other tools
|
||||||
|
|
@ -344,7 +385,7 @@ generated with the same tools and the same flags as the profile of libgit2.
|
||||||
|
|
||||||
Since both profiles were generated from the same workload, absolute numbers can be compared. We can
|
Since both profiles were generated from the same workload, absolute numbers can be compared. We can
|
||||||
see that gitstatusd took 62 seconds in total compared to libgit2's 232 seconds. System calls at the
|
see that gitstatusd took 62 seconds in total compared to libgit2's 232 seconds. System calls at the
|
||||||
core of the algorithm are cleary visible. `__GI___fxstatat` is a flavor of `stat()`, and the other
|
core of the algorithm are clearly visible. `__GI___fxstatat` is a flavor of `stat()`, and the other
|
||||||
three calls -- `__libc_openat64`, `__libc_close` and `__GI___fxstat` are responsible for opening
|
three calls -- `__libc_openat64`, `__libc_close` and `__GI___fxstat` are responsible for opening
|
||||||
directories and finding untracked files. Notice that there is almost nothing else in the profile
|
directories and finding untracked files. Notice that there is almost nothing else in the profile
|
||||||
apart from these calls. The rest of the code accounts for 3.77 seconds of CPU time -- 32 times less
|
apart from these calls. The rest of the code accounts for 3.77 seconds of CPU time -- 32 times less
|
||||||
|
|
@ -455,6 +496,15 @@ cd gitstatus
|
||||||
./build -w -s -d docker
|
./build -w -s -d docker
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Users in China can use the official mirror on gitee.com for faster download.<br>
|
||||||
|
中国大陆用户可以使用 gitee.com 上的官方镜像加速下载.
|
||||||
|
|
||||||
|
```zsh
|
||||||
|
git clone --depth=1 https://gitee.com/romkatv/gitstatus.git
|
||||||
|
cd gitstatus
|
||||||
|
./build -w -s -d docker
|
||||||
|
```
|
||||||
|
|
||||||
- If it says that `-d docker` is not supported on your OS, remove this flag.
|
- If it says that `-d docker` is not supported on your OS, remove this flag.
|
||||||
- If it says that `-s` is not supported on your OS, remove this flag.
|
- If it says that `-s` is not supported on your OS, remove this flag.
|
||||||
- If it tell you to install docker but you cannot or don't want to, remove `-d docker`.
|
- If it tell you to install docker but you cannot or don't want to, remove `-d docker`.
|
||||||
|
|
@ -466,44 +516,17 @@ by shell bindings automatically.
|
||||||
When you update shell bindings, they may refuse to work with the binary you've built earlier. In
|
When you update shell bindings, they may refuse to work with the binary you've built earlier. In
|
||||||
this case you'll need to rebuild.
|
this case you'll need to rebuild.
|
||||||
|
|
||||||
|
If you are using gitstatus through [Powerlevel10k](https://github.com/romkatv/powerlevel10k), the
|
||||||
|
instructions are the same except that you don't need to clone gitstatus. Instead, change your
|
||||||
|
current directory to `/path/to/powerlevel10k/gitstatus` (`/path/to/powerlevel10k` is the directory
|
||||||
|
where you've installed Powerlevel10k) and run `./build -w -s -d docker` from there as described
|
||||||
|
above.
|
||||||
|
|
||||||
### Compiling for distribution
|
### Compiling for distribution
|
||||||
|
|
||||||
If you want to package gitstatus, it's best to do it based off releases. You also probably don't
|
It's currently neither easy nor recommended to package and distribute gitstatus. There are no
|
||||||
want to build in docker (`-d docker`) or to allow automatic downloading of libgit2 tarballs (`-w`).
|
instructions you can follow that would allow you to easily update your package when new versions of
|
||||||
|
gitstatus are released. This may change in the future but not soon.
|
||||||
The following code should work. If it doesn't, please open an issue.
|
|
||||||
|
|
||||||
```zsh
|
|
||||||
curl -fsSLO https://github.com/romkatv/gitstatus/archive/v1.0.0.tar.gz
|
|
||||||
tar -xzf v1.0.0.tar.gz
|
|
||||||
cd gitstatus-1.0.0
|
|
||||||
(
|
|
||||||
. ./build.info
|
|
||||||
curl -fsSLo \
|
|
||||||
deps/libgit2-"$libgit2_version".tar.gz \
|
|
||||||
https://github.com/romkatv/libgit2/archive/"$libgit2_version".tar.gz
|
|
||||||
)
|
|
||||||
./build
|
|
||||||
rm deps/libgit2-*.tar.gz
|
|
||||||
for file in gitstatus.plugin.zsh gitstatus.prompt.zsh install; do
|
|
||||||
zsh -fc "zcompile -R -- $file.zwc $file"
|
|
||||||
done
|
|
||||||
```
|
|
||||||
|
|
||||||
This needs binutils, cmake, gcc, g++, git, GNU make and zsh.
|
|
||||||
|
|
||||||
Depending on your workflow, it might be easier to store the URL to the libgit2 tarball in the
|
|
||||||
same place where you are going to put the main gitstatus tarball URL. You'll need to update both
|
|
||||||
URLs at the same time when bumping package version.
|
|
||||||
|
|
||||||
Once build completes, *do not delete or move any files*. Package the whole directory as is. Don't
|
|
||||||
add it (or any of its subdirectories) to `PATH`.
|
|
||||||
|
|
||||||
Note that Powerlevel10k has an embedded version of gitstatus. It must stay that way. The embedded
|
|
||||||
gitstatus won't conflict with the standalone version. They can have different versions and can
|
|
||||||
coexist within the same Zsh process. Do not attempt to surgically remove gitstatus from
|
|
||||||
Powerlevel10k, package the result and then somehow force Powerlevel10k to use a separately packaged
|
|
||||||
gitstatus.
|
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
|
|
|
||||||
401
gitstatus/build
401
gitstatus/build
|
|
@ -9,7 +9,28 @@ if [ -n "${ZSH_VERSION:-}" ]; then
|
||||||
emulate sh -o err_exit -o no_unset
|
emulate sh -o err_exit -o no_unset
|
||||||
fi
|
fi
|
||||||
|
|
||||||
usage="$(cat <<\END
|
export LC_ALL=C
|
||||||
|
|
||||||
|
if [ -z "${ZSH_VERSION-}" ] && command -v zsh >/dev/null 2>&1; then
|
||||||
|
# Avoid bash 3.*.
|
||||||
|
case "${BASH_VERSION-}" in
|
||||||
|
[0-3].*) exec zsh "$0" "$@";;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Avoid ksh: https://github.com/romkatv/gitstatus/issues/282.
|
||||||
|
if [ -n "${KSH_VERSION-}" ]; then
|
||||||
|
if [ -z "${ZSH_VERSION-}" ] && command -v zsh >/dev/null 2>&1; then
|
||||||
|
exec zsh "$0" "$@"
|
||||||
|
elif [ -z "${BASH_VERSION-}" ] && command -v bash >/dev/null 2>&1 &&
|
||||||
|
bash_version="$(bash --version 2>&1)"; then
|
||||||
|
case "$bash_version" in
|
||||||
|
*version\ [4-9]*|*version\ [1-9][0-9]*) exec bash "$0" "$@";;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
usage="$(command cat <<\END
|
||||||
Usage: build [-m ARCH] [-c CPU] [-d CMD] [-i IMAGE] [-s] [-w]
|
Usage: build [-m ARCH] [-c CPU] [-d CMD] [-i IMAGE] [-s] [-w]
|
||||||
|
|
||||||
Options:
|
Options:
|
||||||
|
|
@ -17,8 +38,8 @@ Options:
|
||||||
-m ARCH `uname -m` from the target machine; defaults to `uname -m`
|
-m ARCH `uname -m` from the target machine; defaults to `uname -m`
|
||||||
from the local machine
|
from the local machine
|
||||||
-c CPU generate machine instructions for CPU of this type; this
|
-c CPU generate machine instructions for CPU of this type; this
|
||||||
value gets passed as `-march` to gcc; inferred from ARCH
|
value gets passed as `-march` (or `-mcpu` for ppc64le) to gcc;
|
||||||
if not set explicitly
|
inferred from ARCH if not set explicitly
|
||||||
-d CMD build in a Docker container and use CMD as the `docker`
|
-d CMD build in a Docker container and use CMD as the `docker`
|
||||||
command; e.g., `-d docker` or `-d podman`
|
command; e.g., `-d docker` or `-d podman`
|
||||||
-i IMAGE build in this Docker image; inferred from ARCH if not set
|
-i IMAGE build in this Docker image; inferred from ARCH if not set
|
||||||
|
|
@ -27,73 +48,90 @@ Options:
|
||||||
succeed; on some operating systems this option is not
|
succeed; on some operating systems this option is not
|
||||||
supported; on others it can have partial effect
|
supported; on others it can have partial effect
|
||||||
-w automatically download tarballs for dependencies if they
|
-w automatically download tarballs for dependencies if they
|
||||||
don't already exist in ./deps; dependencies are described
|
do not already exist in ./deps; dependencies are described
|
||||||
in ./build.info
|
in ./build.info
|
||||||
END
|
END
|
||||||
)"
|
)"
|
||||||
|
|
||||||
build="$(cat <<\END
|
build="$(command cat <<\END
|
||||||
outdir="$(pwd)"
|
outdir="$(command pwd)"
|
||||||
|
|
||||||
if command -v mktemp >/dev/null 2>&1; then
|
if command -v mktemp >/dev/null 2>&1; then
|
||||||
workdir="$(mktemp -d "${TMPDIR:-/tmp}"/gitstatus-build.XXXXXXXXXX)"
|
workdir="$(command mktemp -d "${TMPDIR:-/tmp}"/gitstatus-build.XXXXXXXXXX)"
|
||||||
else
|
else
|
||||||
workdir="${TMPDIR:-/tmp}/gitstatus-build.tmp.$$"
|
workdir="${TMPDIR:-/tmp}/gitstatus-build.tmp.$$"
|
||||||
mkdir -- "$workdir"
|
command mkdir -- "$workdir"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cd -- "$workdir"
|
cd -- "$workdir"
|
||||||
workdir="$(pwd)"
|
workdir="$(command pwd)"
|
||||||
|
|
||||||
narg() { echo $#; }
|
narg() { echo $#; }
|
||||||
|
|
||||||
if [ "$(narg $workdir)" != 1 -o -z "${workdir##*:*}" ]; then
|
if [ "$(narg $workdir)" != 1 -o -z "${workdir##*:*}" -o -z "${workdir##*=*}" ]; then
|
||||||
>&2 echo "[error] cannot build in this directory: $workdir"
|
>&2 echo "[error] cannot build in this directory: $workdir"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
appname=gitstatusd-"$gitstatus_kernel"-"$gitstatus_arch"
|
appname=gitstatusd
|
||||||
libgit2_tmp="$outdir"/deps/"$appname".libgit2.tmp
|
libgit2_tmp="$outdir"/deps/"$appname".libgit2.tmp
|
||||||
|
|
||||||
cleanup() {
|
cleanup() {
|
||||||
|
trap - INT QUIT TERM ILL PIPE
|
||||||
cd /
|
cd /
|
||||||
rm -rf -- "$workdir" "$outdir"/usrbin/"$appname".tmp "$libgit2_tmp"
|
if ! command rm -rf -- "$workdir" "$outdir"/usrbin/"$appname".tmp "$libgit2_tmp"; then
|
||||||
trap - INT QUIT TERM EXIT ILL PIPE
|
command sleep 5
|
||||||
|
command rm -rf -- "$workdir" "$outdir"/usrbin/"$appname".tmp "$libgit2_tmp"
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
trap cleanup INT QUIT TERM EXIT ILL PIPE
|
trap cleanup INT QUIT TERM ILL PIPE
|
||||||
|
|
||||||
if [ -n "$gitstatus_install_tools" ]; then
|
if [ -n "$gitstatus_install_tools" ]; then
|
||||||
case "$gitstatus_kernel" in
|
case "$gitstatus_kernel" in
|
||||||
linux)
|
linux)
|
||||||
apk update
|
if command -v apk >/dev/null 2>&1; then
|
||||||
apk add binutils cmake gcc g++ git make musl-dev
|
command apk update
|
||||||
|
command apk add binutils cmake gcc g++ git make musl-dev perl-utils
|
||||||
|
elif command -v apt-get >/dev/null 2>&1; then
|
||||||
|
apt-get update
|
||||||
|
apt-get install -y binutils cmake gcc g++ make wget
|
||||||
|
else
|
||||||
|
>&2 echo "[error] -s is not supported on this system"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
;;
|
;;
|
||||||
freebsd)
|
freebsd|dragonfly)
|
||||||
pkg install -y cmake gmake binutils gcc git
|
command pkg install -y cmake gmake binutils git perl5 wget
|
||||||
|
;;
|
||||||
|
openbsd)
|
||||||
|
command pkg_add cmake gmake gcc g++ git wget
|
||||||
;;
|
;;
|
||||||
netbsd)
|
netbsd)
|
||||||
pkgin -y install cmake gmake binutils git
|
command pkgin -y install cmake gmake binutils git
|
||||||
;;
|
;;
|
||||||
darwin)
|
darwin)
|
||||||
if ! command -v make >/dev/null 2>&1 || ! command -v gcc >/dev/null 2>&1; then
|
if ! command -v make >/dev/null 2>&1 || ! command -v gcc >/dev/null 2>&1; then
|
||||||
>&2 echo "[error] please run 'xcode-select --install' and retry"
|
>&2 echo "[error] please run 'xcode-select --install' and retry"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
if ! command -v brew >/dev/null 2>&1; then
|
if command -v port >/dev/null 2>&1; then
|
||||||
>&2 echo "[error] please install homebrew from https://brew.sh/ and retry"
|
sudo port -N install libiconv cmake wget
|
||||||
|
elif command -v brew >/dev/null 2>&1; then
|
||||||
|
for formula in libiconv cmake git wget; do
|
||||||
|
if command brew ls --version "$formula" &>/dev/null; then
|
||||||
|
command brew upgrade "$formula"
|
||||||
|
else
|
||||||
|
command brew install "$formula"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
else
|
||||||
|
>&2 echo "[error] please install MacPorts or Homebrew and retry"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
for formula in libiconv cmake git wget; do
|
|
||||||
if brew list "$formula" &>/dev/null; then
|
|
||||||
brew upgrade "$formula"
|
|
||||||
else
|
|
||||||
brew install "$formula"
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
;;
|
;;
|
||||||
msys*|mingw*)
|
msys*|mingw*)
|
||||||
pacman -Syu --noconfirm
|
command pacman -Syu --noconfirm
|
||||||
pacman -S --needed --noconfirm binutils cmake gcc git make
|
command pacman -S --needed --noconfirm binutils cmake gcc git make perl
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
>&2 echo "[internal error] unhandled kernel: $gitstatus_kernel"
|
>&2 echo "[internal error] unhandled kernel: $gitstatus_kernel"
|
||||||
|
|
@ -102,43 +140,149 @@ if [ -n "$gitstatus_install_tools" ]; then
|
||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cpus="$(getconf _NPROCESSORS_ONLN)" || cpus="$(sysctl -n hw.ncpu)" || cpus=8
|
cpus="$(command getconf _NPROCESSORS_ONLN 2>/dev/null)" ||
|
||||||
|
cpus="$(command sysctl -n hw.ncpu 2>/dev/null)" ||
|
||||||
|
cpus=8
|
||||||
|
|
||||||
|
case "$gitstatus_cpu" in
|
||||||
|
powerpc64|powerpc64le)
|
||||||
|
archflag="-mcpu"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
archflag="-march"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
case "$gitstatus_arch" in
|
||||||
|
e2k)
|
||||||
|
nopltflag=""
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
nopltflag="-fno-plt"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
cflags="$archflag=$gitstatus_cpu $nopltflag -D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fpie"
|
||||||
|
ldflags=
|
||||||
|
static_pie=
|
||||||
|
|
||||||
|
if [ -z "${CC-}" ]; then
|
||||||
|
case "$gitstatus_kernel" in
|
||||||
|
freebsd) export CC=clang;;
|
||||||
|
*) export CC=cc;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
|
||||||
|
printf 'int main() {}\n' >"$workdir"/cc-test.c
|
||||||
|
if 2>/dev/null "$CC" \
|
||||||
|
-ffile-prefix-map=x=y \
|
||||||
|
-Werror \
|
||||||
|
-c "$workdir"/cc-test.c \
|
||||||
|
-o "$workdir"/cc-test.o; then
|
||||||
|
cflags="$cflags -ffile-prefix-map=$workdir/="
|
||||||
|
fi
|
||||||
|
|
||||||
|
command rm -f -- "$workdir"/cc-test "$workdir"/cc-test.o
|
||||||
|
if 2>/dev/null "$CC" \
|
||||||
|
-fstack-clash-protection \
|
||||||
|
-Werror \
|
||||||
|
-c "$workdir"/cc-test.c \
|
||||||
|
-o "$workdir"/cc-test.o; then
|
||||||
|
cflags="$cflags -fstack-clash-protection"
|
||||||
|
fi
|
||||||
|
|
||||||
|
command rm -f -- "$workdir"/cc-test "$workdir"/cc-test.o
|
||||||
|
if 2>/dev/null "$CC" \
|
||||||
|
-fcf-protection \
|
||||||
|
-Werror \
|
||||||
|
-c "$workdir"/cc-test.c \
|
||||||
|
-o "$workdir"/cc-test.o; then
|
||||||
|
cflags="$cflags -fcf-protection"
|
||||||
|
fi
|
||||||
|
|
||||||
|
command rm -f -- "$workdir"/cc-test "$workdir"/cc-test.o
|
||||||
|
if 2>/dev/null "$CC" \
|
||||||
|
-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now \
|
||||||
|
-Werror \
|
||||||
|
"$workdir"/cc-test.c \
|
||||||
|
-o "$workdir"/cc-test; then
|
||||||
|
ldflags="$ldflags -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now"
|
||||||
|
fi
|
||||||
|
|
||||||
|
command rm -f -- "$workdir"/cc-test "$workdir"/cc-test.o
|
||||||
|
if 2>/dev/null "$CC" \
|
||||||
|
-fpie -static-pie \
|
||||||
|
-Werror \
|
||||||
|
"$workdir"/cc-test.c \
|
||||||
|
-o "$workdir"/cc-test; then
|
||||||
|
static_pie='-static-pie'
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$gitstatus_cpu" = x86-64 ]; then
|
||||||
|
cflags="$cflags -mtune=generic"
|
||||||
|
fi
|
||||||
|
|
||||||
libgit2_cmake_flags=
|
libgit2_cmake_flags=
|
||||||
libgit2_cflags="-march=$gitstatus_cpu"
|
libgit2_cflags="${CFLAGS-} $cflags -O3 -DNDEBUG"
|
||||||
|
|
||||||
gitstatus_cxx=g++
|
gitstatus_cxx=g++
|
||||||
gitstatus_cxxflags="-I${workdir}/libgit2/include -DGITSTATUS_ZERO_NSEC -D_GNU_SOURCE -march=$gitstatus_cpu"
|
gitstatus_cxxflags="${CXXFLAGS-} $cflags -I${workdir}/libgit2/include -DGITSTATUS_ZERO_NSEC -D_GNU_SOURCE -D_GLIBCXX_ASSERTIONS"
|
||||||
gitstatus_ldflags="-L${workdir}/libgit2/build"
|
gitstatus_ldflags="${LDFLAGS-} $ldflags -L${workdir}/libgit2/build"
|
||||||
gitstatus_ldlibs=
|
gitstatus_ldlibs=
|
||||||
gitstatus_make=make
|
gitstatus_make=make
|
||||||
|
|
||||||
case "$gitstatus_kernel" in
|
case "$gitstatus_kernel" in
|
||||||
linux)
|
linux)
|
||||||
gitstatus_ldflags="$gitstatus_ldflags -static"
|
gitstatus_ldflags="$gitstatus_ldflags ${static_pie:--static}"
|
||||||
|
libgit2_cmake_flags="$libgit2_cmake_flags -DENABLE_REPRODUCIBLE_BUILDS=ON"
|
||||||
;;
|
;;
|
||||||
freebsd)
|
freebsd)
|
||||||
|
gitstatus_cxx=clang++
|
||||||
gitstatus_make=gmake
|
gitstatus_make=gmake
|
||||||
gitstatus_ldflags="$gitstatus_ldflags -static"
|
gitstatus_ldflags="$gitstatus_ldflags ${static_pie:--static}"
|
||||||
|
libgit2_cmake_flags="$libgit2_cmake_flags -DENABLE_REPRODUCIBLE_BUILDS=ON"
|
||||||
|
;;
|
||||||
|
dragonfly)
|
||||||
|
gitstatus_cxx=clang++12
|
||||||
|
gitstatus_make=gmake
|
||||||
|
gitstatus_ldflags="$gitstatus_ldflags ${static_pie:--static}"
|
||||||
|
libgit2_cmake_flags="$libgit2_cmake_flags -DENABLE_REPRODUCIBLE_BUILDS=ON"
|
||||||
|
;;
|
||||||
|
openbsd)
|
||||||
|
gitstatus_cxx=eg++
|
||||||
|
gitstatus_make=gmake
|
||||||
|
gitstatus_ldflags="$gitstatus_ldflags ${static_pie:--static}"
|
||||||
|
libgit2_cmake_flags="$libgit2_cmake_flags -DENABLE_REPRODUCIBLE_BUILDS=ON"
|
||||||
;;
|
;;
|
||||||
netbsd)
|
netbsd)
|
||||||
gitstatus_make=gmake
|
gitstatus_make=gmake
|
||||||
gitstatus_ldflags="$gitstatus_ldflags -static"
|
gitstatus_ldflags="$gitstatus_ldflags ${static_pie:--static}"
|
||||||
|
libgit2_cmake_flags="$libgit2_cmake_flags -DENABLE_REPRODUCIBLE_BUILDS=ON"
|
||||||
;;
|
;;
|
||||||
darwin)
|
darwin)
|
||||||
mkdir -- "$workdir"/lib
|
command mkdir -- "$workdir"/lib
|
||||||
ln -s -- /usr/local/opt/libiconv/lib/libiconv.a "$workdir"/lib
|
if [ -e /opt/local/lib/libiconv.a ]; then
|
||||||
|
command ln -s -- /opt/local/lib/libiconv.a "$workdir"/lib
|
||||||
|
libgit2_cflags="$libgit2_cflags -I/opt/local/include"
|
||||||
|
gitstatus_cxxflags="$gitstatus_cxxflags -I/opt/local/include"
|
||||||
|
else
|
||||||
|
brew_prefix="$(command brew --prefix)"
|
||||||
|
command ln -s -- "$brew_prefix"/opt/libiconv/lib/libiconv.a "$workdir"/lib
|
||||||
|
libgit2_cflags="$libgit2_cflags -I"$brew_prefix"/opt/libiconv/include"
|
||||||
|
gitstatus_cxxflags="$gitstatus_cxxflags -I"$brew_prefix"/opt/libiconv/include"
|
||||||
|
fi
|
||||||
libgit2_cmake_flags="$libgit2_cmake_flags -DUSE_ICONV=ON"
|
libgit2_cmake_flags="$libgit2_cmake_flags -DUSE_ICONV=ON"
|
||||||
libgit2_cflags="$libgit2_cflags -I/usr/local/opt/libiconv/include"
|
|
||||||
gitstatus_cxxflags="$gitstatus_cxxflags -I/usr/local/opt/libiconv/include"
|
|
||||||
gitstatus_ldlibs="$gitstatus_ldlibs -liconv"
|
gitstatus_ldlibs="$gitstatus_ldlibs -liconv"
|
||||||
gitstatus_ldflags="$gitstatus_ldflags -L${workdir}/lib"
|
gitstatus_ldflags="$gitstatus_ldflags -L${workdir}/lib"
|
||||||
|
libgit2_cmake_flags="$libgit2_cmake_flags -DENABLE_REPRODUCIBLE_BUILDS=OFF"
|
||||||
;;
|
;;
|
||||||
msys*|mingw*)
|
msys*|mingw*)
|
||||||
gitstatus_ldflags="$gitstatus_ldflags -static"
|
gitstatus_ldflags="$gitstatus_ldflags ${static_pie:--static}"
|
||||||
|
libgit2_cmake_flags="$libgit2_cmake_flags -DENABLE_REPRODUCIBLE_BUILDS=ON"
|
||||||
;;
|
;;
|
||||||
cygwin*)
|
cygwin*)
|
||||||
gitstatus_ldflags="$gitstatus_ldflags -static"
|
gitstatus_ldflags="$gitstatus_ldflags ${static_pie:--static}"
|
||||||
|
libgit2_cmake_flags="$libgit2_cmake_flags -DENABLE_REPRODUCIBLE_BUILDS=ON"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
>&2 echo "[internal error] unhandled kernel: $gitstatus_kernel"
|
>&2 echo "[internal error] unhandled kernel: $gitstatus_kernel"
|
||||||
|
|
@ -146,7 +290,7 @@ case "$gitstatus_kernel" in
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
for cmd in cmake gcc g++ git ld "$gitstatus_make" wget; do
|
for cmd in cat cmake git ld ln mkdir rm strip tar "$gitstatus_make"; do
|
||||||
if ! command -v "$cmd" >/dev/null 2>&1; then
|
if ! command -v "$cmd" >/dev/null 2>&1; then
|
||||||
if [ -n "$gitstatus_install_tools" ]; then
|
if [ -n "$gitstatus_install_tools" ]; then
|
||||||
>&2 echo "[internal error] $cmd not found"
|
>&2 echo "[internal error] $cmd not found"
|
||||||
|
|
@ -159,74 +303,147 @@ for cmd in cmake gcc g++ git ld "$gitstatus_make" wget; do
|
||||||
done
|
done
|
||||||
|
|
||||||
. "$outdir"/build.info
|
. "$outdir"/build.info
|
||||||
if [ -z "$libgit2_version" ]; then
|
if [ -z "${libgit2_version:-}" ]; then
|
||||||
>&2 echo "[internal error] libgit2_version not set"
|
>&2 echo "[internal error] libgit2_version not set"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
if [ -z "${libgit2_sha256:-}" ]; then
|
||||||
|
>&2 echo "[internal error] libgit2_sha256 not set"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
libgit2_tarball="$outdir"/deps/libgit2-"$libgit2_version".tar.gz
|
libgit2_tarball="$outdir"/deps/libgit2-"$libgit2_version".tar.gz
|
||||||
if [ ! -e "$libgit2_tarball" ]; then
|
if [ ! -e "$libgit2_tarball" ]; then
|
||||||
if [ -n "$gitstatus_download_deps" ]; then
|
if [ -n "$gitstatus_download_deps" ]; then
|
||||||
|
if ! command -v wget >/dev/null 2>&1; then
|
||||||
|
if [ -n "$gitstatus_install_tools" ]; then
|
||||||
|
>&2 echo "[internal error] wget not found"
|
||||||
|
exit 1
|
||||||
|
else
|
||||||
|
>&2 echo "[error] command not found: wget"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
libgit2_url=https://github.com/romkatv/libgit2/archive/"$libgit2_version".tar.gz
|
libgit2_url=https://github.com/romkatv/libgit2/archive/"$libgit2_version".tar.gz
|
||||||
wget -O "$libgit2_tmp" -- "$libgit2_url"
|
if ! >"$libgit2_tmp" command wget --no-config -qO- -- "$libgit2_url" &&
|
||||||
mv -f -- "$libgit2_tmp" "$libgit2_tarball"
|
! >"$libgit2_tmp" command wget -qO- -- "$libgit2_url"; then
|
||||||
|
set -x
|
||||||
|
>&2 command which wget
|
||||||
|
>&2 command ls -lAd -- "$(command which wget)"
|
||||||
|
>&2 command ls -lAd -- "$outdir"
|
||||||
|
>&2 command ls -lA -- "$outdir"
|
||||||
|
>&2 command ls -lAd -- "$outdir"/deps
|
||||||
|
>&2 command ls -lA -- "$outdir"/deps
|
||||||
|
set +x
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
command mv -f -- "$libgit2_tmp" "$libgit2_tarball"
|
||||||
else
|
else
|
||||||
>&2 echo "[error] file not found: deps/libgit2-"$libgit2_version".tar.gz"
|
>&2 echo "[error] file not found: deps/libgit2-"$libgit2_version".tar.gz"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
libgit2_actual_sha256=
|
||||||
|
if command -v shasum >/dev/null 2>/dev/null; then
|
||||||
|
libgit2_actual_sha256="$(command shasum -b -a 256 -- "$libgit2_tarball")"
|
||||||
|
libgit2_actual_sha256="${libgit2_actual_sha256%% *}"
|
||||||
|
elif command -v sha256sum >/dev/null 2>/dev/null; then
|
||||||
|
libgit2_actual_sha256="$(command sha256sum -b -- "$libgit2_tarball")"
|
||||||
|
libgit2_actual_sha256="${libgit2_actual_sha256%% *}"
|
||||||
|
elif command -v sha256 >/dev/null 2>/dev/null; then
|
||||||
|
libgit2_actual_sha256="$(command sha256 -- "$libgit2_tarball" </dev/null)"
|
||||||
|
# Ignore sha256 output if it's from hashalot. It's incompatible.
|
||||||
|
if [ ${#libgit2_actual_sha256} -lt 64 ]; then
|
||||||
|
libgit2_actual_sha256=
|
||||||
|
else
|
||||||
|
libgit2_actual_sha256="${libgit2_actual_sha256##* }"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -z "$libgit2_actual_sha256" ]; then
|
||||||
|
>&2 echo "[error] command not found: shasum or sha256sum"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$libgit2_actual_sha256" != "$libgit2_sha256" ]; then
|
||||||
|
>&2 echo "[error] sha256 mismatch"
|
||||||
|
>&2 echo ""
|
||||||
|
>&2 echo " file : deps/libgit2-$libgit2_version.tar.gz"
|
||||||
|
>&2 echo " expected: $libgit2_sha256"
|
||||||
|
>&2 echo " actual : $libgit2_actual_sha256"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
cd -- "$workdir"
|
cd -- "$workdir"
|
||||||
tar -xzf "$libgit2_tarball"
|
command tar -xzf "$libgit2_tarball"
|
||||||
mv -- libgit2-"$libgit2_version" libgit2
|
command mv -- libgit2-"$libgit2_version" libgit2
|
||||||
mkdir libgit2/build
|
command mkdir libgit2/build
|
||||||
cd libgit2/build
|
cd libgit2/build
|
||||||
|
|
||||||
CFLAGS="$libgit2_cflags" cmake \
|
CFLAGS="$libgit2_cflags" command cmake \
|
||||||
-DCMAKE_BUILD_TYPE=Release \
|
-DCMAKE_BUILD_TYPE=None \
|
||||||
-DZERO_NSEC=ON \
|
-DZERO_NSEC=ON \
|
||||||
-DTHREADSAFE=ON \
|
-DTHREADSAFE=ON \
|
||||||
-DUSE_BUNDLED_ZLIB=ON \
|
-DUSE_BUNDLED_ZLIB=ON \
|
||||||
-DREGEX_BACKEND=builtin \
|
-DREGEX_BACKEND=builtin \
|
||||||
-DUSE_HTTP_PARSER=builtin \
|
-DUSE_HTTP_PARSER=builtin \
|
||||||
-DUSE_SSH=OFF \
|
-DUSE_SSH=OFF \
|
||||||
-DUSE_HTTPS=OFF \
|
-DUSE_HTTPS=OFF \
|
||||||
-DBUILD_CLAR=OFF \
|
-DBUILD_CLAR=OFF \
|
||||||
-DUSE_GSSAPI=OFF \
|
-DUSE_GSSAPI=OFF \
|
||||||
-DUSE_NTLMCLIENT=OFF \
|
-DUSE_NTLMCLIENT=OFF \
|
||||||
-DBUILD_SHARED_LIBS=OFF \
|
-DBUILD_SHARED_LIBS=OFF \
|
||||||
-DENABLE_REPRODUCIBLE_BUILDS=OFF \
|
-G "Unix Makefiles" \
|
||||||
$libgit2_cmake_flags \
|
$libgit2_cmake_flags \
|
||||||
..
|
..
|
||||||
make -j "$cpus" VERBOSE=1
|
command make -j "$cpus" VERBOSE=1
|
||||||
|
|
||||||
APPNAME="$appname".tmp \
|
APPNAME="$appname".tmp \
|
||||||
OBJDIR="$workdir"/gitstatus \
|
OBJDIR="$workdir"/gitstatus \
|
||||||
CXX="$gitstatus_cxx" \
|
CXX="${CXX:-$gitstatus_cxx}" \
|
||||||
CXXFLAGS="$gitstatus_cxxflags" \
|
CXXFLAGS="$gitstatus_cxxflags" \
|
||||||
LDFLAGS="$gitstatus_ldflags" \
|
LDFLAGS="$gitstatus_ldflags" \
|
||||||
LDLIBS="$gitstatus_ldlibs" \
|
LDLIBS="$gitstatus_ldlibs" \
|
||||||
"$gitstatus_make" -C "$outdir" -j "$cpus"
|
command "$gitstatus_make" -C "$outdir" -j "$cpus"
|
||||||
|
|
||||||
app="$outdir"/usrbin/"$appname"
|
app="$outdir"/usrbin/"$appname"
|
||||||
|
|
||||||
strip "$app".tmp
|
command strip "$app".tmp
|
||||||
|
|
||||||
mkdir -- "$workdir"/repo
|
command mkdir -- "$workdir"/repo
|
||||||
git -C "$workdir"/repo init --
|
printf '[init]\n defaultBranch = master\n' >"$workdir"/.gitconfig
|
||||||
git -C "$workdir"/repo config user.email "you@example.com"
|
(
|
||||||
git -C "$workdir"/repo commit --allow-empty --allow-empty-message -m ''
|
cd -- "$workdir"/repo
|
||||||
|
GIT_CONFIG_NOSYSTEM=1 HOME="$workdir" command git init
|
||||||
|
GIT_CONFIG_NOSYSTEM=1 HOME="$workdir" command git config user.name "Your Name"
|
||||||
|
GIT_CONFIG_NOSYSTEM=1 HOME="$workdir" command git config user.email "you@example.com"
|
||||||
|
GIT_CONFIG_NOSYSTEM=1 HOME="$workdir" command git commit \
|
||||||
|
--allow-empty --allow-empty-message --no-gpg-sign -m ''
|
||||||
|
)
|
||||||
|
|
||||||
resp="$(printf "hello\037$workdir/repo\036" | "$app".tmp)"
|
resp="$(printf "hello\037$workdir/repo\036" | "$app".tmp)"
|
||||||
[ -n "$resp" -a -z "${resp##hello*1*$workdir/repo*master*}" ]
|
case "$resp" in
|
||||||
|
hello*1*/repo*master*);;
|
||||||
|
*)
|
||||||
|
>&2 echo 'error: invalid gitstatusd response for a git repo'
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
resp="$(printf 'hello\037\036' | "$app".tmp)"
|
resp="$(printf 'hello\037\036' | "$app".tmp)"
|
||||||
[ -n "$resp" -a -z "${resp##hello*0*}" ]
|
case "$resp" in
|
||||||
|
hello*0*);;
|
||||||
|
*)
|
||||||
|
>&2 echo 'error: invalid gitstatusd response for a non-repo'
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
mv -f -- "$app".tmp "$app"
|
command mv -f -- "$app".tmp "$app"
|
||||||
|
|
||||||
cleanup
|
cleanup
|
||||||
|
|
||||||
cat >&2 <<-END
|
command cat >&2 <<-END
|
||||||
-------------------------------------------------
|
-------------------------------------------------
|
||||||
SUCCESS: created usrbin/$appname
|
SUCCESS: created usrbin/$appname
|
||||||
END
|
END
|
||||||
|
|
@ -328,10 +545,17 @@ fi
|
||||||
|
|
||||||
if [ -z "$gitstatus_cpu" ]; then
|
if [ -z "$gitstatus_cpu" ]; then
|
||||||
case "$gitstatus_arch" in
|
case "$gitstatus_arch" in
|
||||||
armv6l) gitstatus_cpu=armv6;;
|
armel) gitstatus_cpu=armv5;;
|
||||||
|
armv6l|armhf) gitstatus_cpu=armv6;;
|
||||||
armv7l) gitstatus_cpu=armv7;;
|
armv7l) gitstatus_cpu=armv7;;
|
||||||
aarch64) gitstatus_cpu=armv8-a;;
|
arm64|aarch64) gitstatus_cpu=armv8-a;;
|
||||||
|
ppc64|ppc64le) gitstatus_cpu=powerpc64le;;
|
||||||
|
riscv64) gitstatus_cpu=rv64imafdc;;
|
||||||
|
loongarch64) gitstatus_cpu=loongarch64;;
|
||||||
x86_64|amd64) gitstatus_cpu=x86-64;;
|
x86_64|amd64) gitstatus_cpu=x86-64;;
|
||||||
|
x86) gitstatus_cpu=i586;;
|
||||||
|
s390x) gitstatus_cpu=z900;;
|
||||||
|
e2k) gitstatus_cpu=native;;
|
||||||
i386|i586|i686) gitstatus_cpu="$gitstatus_arch";;
|
i386|i586|i686) gitstatus_cpu="$gitstatus_arch";;
|
||||||
*)
|
*)
|
||||||
>&2 echo '[error] unable to infer target CPU architecture'
|
>&2 echo '[error] unable to infer target CPU architecture'
|
||||||
|
|
@ -360,11 +584,13 @@ case "$gitstatus_kernel" in
|
||||||
fi
|
fi
|
||||||
if [ -z "$docker_image" ]; then
|
if [ -z "$docker_image" ]; then
|
||||||
case "$gitstatus_arch" in
|
case "$gitstatus_arch" in
|
||||||
x86_64) docker_image=alpine:3.11.6;;
|
x86_64) docker_image=alpine:3.11.6;;
|
||||||
i386|i586|i686) docker_image=i386/alpine:3.11.6;;
|
x86|i386|i586|i686) docker_image=i386/alpine:3.11.6;;
|
||||||
armv6l) docker_image=arm32v6/alpine:3.11.6;;
|
armv6l|armhf) docker_image=arm32v6/alpine:3.11.6;;
|
||||||
armv7l) docker_image=arm32v7/alpine:3.11.6;;
|
armv7l) docker_image=arm32v7/alpine:3.11.6;;
|
||||||
aarch64) docker_image=arm64v8/alpine:3.11.6;;
|
aarch64) docker_image=arm64v8/alpine:3.11.6;;
|
||||||
|
ppc64|ppc64le) docker_image=ppc64le/alpine:3.11.6;;
|
||||||
|
s390x) docker_image=s390x/alpine:3.11.6;;
|
||||||
*)
|
*)
|
||||||
>&2 echo '[error] unable to infer docker image'
|
>&2 echo '[error] unable to infer docker image'
|
||||||
>&2 echo 'Please specify explicitly with `-i IMAGE`.'
|
>&2 echo 'Please specify explicitly with `-i IMAGE`.'
|
||||||
|
|
@ -372,12 +598,9 @@ case "$gitstatus_kernel" in
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
elif [ -n "$gitstatus_install_tools" ]; then
|
|
||||||
>&2 echo '[error] -s without -d is not supported on linux'
|
|
||||||
exit 1
|
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
freebsd|netbsd|darwin)
|
freebsd|openbsd|netbsd|darwin|dragonfly)
|
||||||
if [ -n "$docker_cmd" ]; then
|
if [ -n "$docker_cmd" ]; then
|
||||||
>&2 echo "[error] docker (-d) is not supported on $gitstatus_kernel"
|
>&2 echo "[error] docker (-d) is not supported on $gitstatus_kernel"
|
||||||
exit 1
|
exit 1
|
||||||
|
|
@ -428,6 +651,8 @@ fi
|
||||||
|
|
||||||
if [ -n "$docker_cmd" ]; then
|
if [ -n "$docker_cmd" ]; then
|
||||||
"$docker_cmd" run \
|
"$docker_cmd" run \
|
||||||
|
-e docker_cmd="$docker_cmd" \
|
||||||
|
-e docker_image="$docker_image" \
|
||||||
-e gitstatus_kernel="$gitstatus_kernel" \
|
-e gitstatus_kernel="$gitstatus_kernel" \
|
||||||
-e gitstatus_arch="$gitstatus_arch" \
|
-e gitstatus_arch="$gitstatus_arch" \
|
||||||
-e gitstatus_cpu="$gitstatus_cpu" \
|
-e gitstatus_cpu="$gitstatus_cpu" \
|
||||||
|
|
|
||||||
|
|
@ -2,11 +2,11 @@
|
||||||
# read by ./Makefile. `gitstatusd --version` reports it back.
|
# read by ./Makefile. `gitstatusd --version` reports it back.
|
||||||
#
|
#
|
||||||
# This value is also read by shell bindings (indirectly, through
|
# This value is also read by shell bindings (indirectly, through
|
||||||
# ./install) when gitstatusd is from ./usrbin.
|
# ./install) when using GITSTATUS_DAEMON or usrbin/gitstatusd.
|
||||||
gitstatus_version="v1.0.0"
|
gitstatus_version="v1.5.5"
|
||||||
|
|
||||||
# libgit2 is a build time dependency of gitstatusd. The value of
|
# libgit2 is a build time dependency of gitstatusd. The values of
|
||||||
# libgit2_version is read by ./build.
|
# libgit2_version and libgit2_sha256 are read by ./build.
|
||||||
#
|
#
|
||||||
# If ./deps/libgit2-${libgit2_version}.tar.gz doesn't exist, build
|
# If ./deps/libgit2-${libgit2_version}.tar.gz doesn't exist, build
|
||||||
# downloads it from the following location:
|
# downloads it from the following location:
|
||||||
|
|
@ -15,4 +15,8 @@ gitstatus_version="v1.0.0"
|
||||||
#
|
#
|
||||||
# Once downloaded, the tarball is stored at the path indicated
|
# Once downloaded, the tarball is stored at the path indicated
|
||||||
# above so that repeated builds don't consume network bandwidth.
|
# above so that repeated builds don't consume network bandwidth.
|
||||||
libgit2_version="tag-005f77dca6dbe8788e55139fa1199fc94cc04f9a"
|
#
|
||||||
|
# If sha256 of ./deps/libgit2-${libgit2_version}.tar.gz doesn't match,
|
||||||
|
# build gets aborted.
|
||||||
|
libgit2_version="tag-2ecf33948a4df9ef45a66c68b8ef24a5e60eaac6"
|
||||||
|
libgit2_sha256="4ce11d71ee576dbbc410b9fa33a9642809cc1fa687b315f7c23eeb825b251e93"
|
||||||
|
|
|
||||||
|
|
@ -35,12 +35,27 @@
|
||||||
#
|
#
|
||||||
# -D Unless this option is specified, report zero staged, unstaged and conflicted
|
# -D Unless this option is specified, report zero staged, unstaged and conflicted
|
||||||
# changes for repositories with bash.showDirtyState = false.
|
# changes for repositories with bash.showDirtyState = false.
|
||||||
|
#
|
||||||
|
# -r INT Close git repositories that haven't been used for this many seconds. This is
|
||||||
|
# meant to release resources such as memory and file descriptors. The next request
|
||||||
|
# for a repo that's been closed is much slower than for a repo that hasn't been.
|
||||||
|
# Negative value means infinity. The default is 3600 (one hour).
|
||||||
function gitstatus_start() {
|
function gitstatus_start() {
|
||||||
|
if [[ "$BASH_VERSION" < 4 ]]; then
|
||||||
|
>&2 printf 'gitstatus_start: need bash version >= 4.0, found %s\n' "$BASH_VERSION"
|
||||||
|
>&2 printf '\n'
|
||||||
|
>&2 printf 'To see the version of the current shell, type:\n'
|
||||||
|
>&2 printf '\n'
|
||||||
|
>&2 printf ' \033[32mecho\033[0m \033[33m"$BASH_VERSION"\033[0m\n'
|
||||||
|
>&2 printf '\n'
|
||||||
|
>&2 printf 'The output of `\033[32mbash\033[0m --version` may be different and is not relevant.\n'
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
unset OPTIND
|
unset OPTIND
|
||||||
local opt timeout=5 max_dirty=-1 extra_flags
|
local opt timeout=5 max_dirty=-1 ttl=3600 extra_flags=
|
||||||
local max_num_staged=1 max_num_unstaged=1 max_num_conflicted=1 max_num_untracked=1
|
local max_num_staged=1 max_num_unstaged=1 max_num_conflicted=1 max_num_untracked=1
|
||||||
local ignore_status_show_untracked_files
|
while getopts "t:s:u:c:d:m:r:eUWD" opt; do
|
||||||
while getopts "t:s:u:c:d:m:eUWD" opt; do
|
|
||||||
case "$opt" in
|
case "$opt" in
|
||||||
t) timeout=$OPTARG;;
|
t) timeout=$OPTARG;;
|
||||||
s) max_num_staged=$OPTARG;;
|
s) max_num_staged=$OPTARG;;
|
||||||
|
|
@ -48,6 +63,7 @@ function gitstatus_start() {
|
||||||
c) max_num_conflicted=$OPTARG;;
|
c) max_num_conflicted=$OPTARG;;
|
||||||
d) max_num_untracked=$OPTARG;;
|
d) max_num_untracked=$OPTARG;;
|
||||||
m) max_dirty=$OPTARG;;
|
m) max_dirty=$OPTARG;;
|
||||||
|
r) ttl=$OPTARG;;
|
||||||
e) extra_flags+='--recurse-untracked-dirs ';;
|
e) extra_flags+='--recurse-untracked-dirs ';;
|
||||||
U) extra_flags+='--ignore-status-show-untracked-files ';;
|
U) extra_flags+='--ignore-status-show-untracked-files ';;
|
||||||
W) extra_flags+='--ignore-bash-show-untracked-files ';;
|
W) extra_flags+='--ignore-bash-show-untracked-files ';;
|
||||||
|
|
@ -69,14 +85,14 @@ function gitstatus_start() {
|
||||||
local gitstatus_plugin_dir="$PWD"
|
local gitstatus_plugin_dir="$PWD"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
local req_fifo resp_fifo
|
local tmpdir req_fifo resp_fifo culprit
|
||||||
|
|
||||||
function gitstatus_start_impl() {
|
function gitstatus_start_impl() {
|
||||||
local log_level="${GITSTATUS_LOG_LEVEL:-}"
|
local log_level="${GITSTATUS_LOG_LEVEL:-}"
|
||||||
[[ -n "$log_level" || "${GITSTATUS_ENABLE_LOGGING:-0}" != 1 ]] || log_level=INFO
|
[[ -n "$log_level" || "${GITSTATUS_ENABLE_LOGGING:-0}" != 1 ]] || log_level=INFO
|
||||||
|
|
||||||
local uname_sm
|
local uname_sm
|
||||||
uname_sm="$(uname -sm)" || return
|
uname_sm="$(command uname -sm)" || return
|
||||||
uname_sm="${uname_sm,,}"
|
uname_sm="${uname_sm,,}"
|
||||||
local uname_s="${uname_sm% *}"
|
local uname_s="${uname_sm% *}"
|
||||||
local uname_m="${uname_sm#* }"
|
local uname_m="${uname_sm#* }"
|
||||||
|
|
@ -86,8 +102,8 @@ function gitstatus_start() {
|
||||||
else
|
else
|
||||||
local cpus
|
local cpus
|
||||||
if ! command -v sysctl &>/dev/null || [[ "$uname_s" == linux ]] ||
|
if ! command -v sysctl &>/dev/null || [[ "$uname_s" == linux ]] ||
|
||||||
! cpus="$(sysctl -n hw.ncpu)"; then
|
! cpus="$(command sysctl -n hw.ncpu)"; then
|
||||||
if ! command -v getconf &>/dev/null || ! cpus="$(getconf _NPROCESSORS_ONLN)"; then
|
if ! command -v getconf &>/dev/null || ! cpus="$(command getconf _NPROCESSORS_ONLN)"; then
|
||||||
cpus=8
|
cpus=8
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
@ -102,25 +118,36 @@ function gitstatus_start() {
|
||||||
--max-num-conflicted="$max_num_conflicted"
|
--max-num-conflicted="$max_num_conflicted"
|
||||||
--max-num-untracked="$max_num_untracked"
|
--max-num-untracked="$max_num_untracked"
|
||||||
--dirty-max-index-size="$max_dirty"
|
--dirty-max-index-size="$max_dirty"
|
||||||
|
--repo-ttl-seconds="$ttl"
|
||||||
$extra_flags)
|
$extra_flags)
|
||||||
|
|
||||||
|
if [[ -n "$TMPDIR" && ( ( -d "$TMPDIR" && -w "$TMPDIR" ) || ! ( -d /tmp && -w /tmp ) ) ]]; then
|
||||||
|
local tmpdir=$TMPDIR
|
||||||
|
else
|
||||||
|
local tmpdir=/tmp
|
||||||
|
fi
|
||||||
|
tmpdir="$(command mktemp -d "$tmpdir"/gitstatus.bash.$$.XXXXXXXXXX)" || return
|
||||||
|
|
||||||
if [[ -n "$log_level" ]]; then
|
if [[ -n "$log_level" ]]; then
|
||||||
GITSTATUS_DAEMON_LOG=$(mktemp "${TMPDIR:-/tmp}"/gitstatus.$$.log.XXXXXXXXXX) || return
|
GITSTATUS_DAEMON_LOG="$tmpdir"/daemon.log
|
||||||
[[ "$log_level" == INFO ]] || daemon_args+=(--log-level="$log_level")
|
[[ "$log_level" == INFO ]] || daemon_args+=(--log-level="$log_level")
|
||||||
else
|
else
|
||||||
GITSTATUS_DAEMON_LOG=/dev/null
|
GITSTATUS_DAEMON_LOG=/dev/null
|
||||||
fi
|
fi
|
||||||
|
|
||||||
req_fifo=$(mktemp -u "${TMPDIR:-/tmp}"/gitstatus.$$.pipe.req.XXXXXXXXXX) || return
|
req_fifo="$tmpdir"/req.fifo
|
||||||
resp_fifo=$(mktemp -u "${TMPDIR:-/tmp}"/gitstatus.$$.pipe.resp.XXXXXXXXXX) || return
|
resp_fifo="$tmpdir"/resp.fifo
|
||||||
mkfifo "$req_fifo" "$resp_fifo" || return
|
command mkfifo -- "$req_fifo" "$resp_fifo" || return
|
||||||
|
|
||||||
{
|
{
|
||||||
(
|
(
|
||||||
|
trap '' INT QUIT TSTP
|
||||||
|
[[ "$GITSTATUS_DAEMON_LOG" == /dev/null ]] || set -x
|
||||||
builtin cd /
|
builtin cd /
|
||||||
|
|
||||||
(
|
(
|
||||||
local fd_in fd_out
|
local fd_in fd_out
|
||||||
exec {fd_in}<"$req_fifo" {fd_out}>"$resp_fifo" || exit
|
exec {fd_in}<"$req_fifo" {fd_out}>>"$resp_fifo" || exit
|
||||||
echo "$BASHPID" >&"$fd_out"
|
echo "$BASHPID" >&"$fd_out"
|
||||||
|
|
||||||
local _gitstatus_bash_daemon _gitstatus_bash_version _gitstatus_bash_downloaded
|
local _gitstatus_bash_daemon _gitstatus_bash_version _gitstatus_bash_downloaded
|
||||||
|
|
@ -131,17 +158,28 @@ function gitstatus_start() {
|
||||||
_gitstatus_bash_downloaded="$3"
|
_gitstatus_bash_downloaded="$3"
|
||||||
}
|
}
|
||||||
|
|
||||||
set -- -d "$gitstatus_plugin_dir" -s "$uname_s" -m "$uname_m" -- _gitstatus_set_daemon
|
set -- -d "$gitstatus_plugin_dir" -s "$uname_s" -m "$uname_m" \
|
||||||
|
-p "printf '.\036' >&$fd_out" -e "$fd_out" -- _gitstatus_set_daemon
|
||||||
[[ "${GITSTATUS_AUTO_INSTALL:-1}" -ne 0 ]] || set -- -n "$@"
|
[[ "${GITSTATUS_AUTO_INSTALL:-1}" -ne 0 ]] || set -- -n "$@"
|
||||||
source "$gitstatus_plugin_dir"/install || return
|
source "$gitstatus_plugin_dir"/install || return
|
||||||
[[ -n "$_gitstatus_bash_daemon" ]] || return
|
[[ -n "$_gitstatus_bash_daemon" ]] || return
|
||||||
[[ -n "$_gitstatus_bash_version" ]] || return
|
[[ -n "$_gitstatus_bash_version" ]] || return
|
||||||
[[ "$_gitstatus_bash_downloaded" == [01] ]] || return
|
[[ "$_gitstatus_bash_downloaded" == [01] ]] || return
|
||||||
|
|
||||||
local sig=(INT QUIT TERM EXIT ILL PIPE)
|
local sig=(TERM ILL PIPE)
|
||||||
|
|
||||||
|
if (( UID == EUID )); then
|
||||||
|
local home=~
|
||||||
|
else
|
||||||
|
local user
|
||||||
|
user="$(command id -un)" || return
|
||||||
|
[[ "$user" =~ ^[a-zA-Z0-9_,.-]+$ ]] || return
|
||||||
|
eval "local home=~$user"
|
||||||
|
[[ -n "$home" ]] || return
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ -x "$_gitstatus_bash_daemon" ]]; then
|
if [[ -x "$_gitstatus_bash_daemon" ]]; then
|
||||||
"$_gitstatus_bash_daemon" \
|
HOME="$home" "$_gitstatus_bash_daemon" \
|
||||||
-G "$_gitstatus_bash_version" "${daemon_args[@]}" <&"$fd_in" >&"$fd_out" &
|
-G "$_gitstatus_bash_version" "${daemon_args[@]}" <&"$fd_in" >&"$fd_out" &
|
||||||
local pid=$!
|
local pid=$!
|
||||||
trap "trap - ${sig[*]}; kill $pid &>/dev/null" ${sig[@]}
|
trap "trap - ${sig[*]}; kill $pid &>/dev/null" ${sig[@]}
|
||||||
|
|
@ -149,8 +187,8 @@ function gitstatus_start() {
|
||||||
local ret=$?
|
local ret=$?
|
||||||
trap - ${sig[@]}
|
trap - ${sig[@]}
|
||||||
case "$ret" in
|
case "$ret" in
|
||||||
0|129|130|131|137|141|143)
|
0|129|130|131|137|141|143|159)
|
||||||
echo -nE $'bye\x1f0\x1e' >&"$fd_out"
|
echo -nE $'}bye\x1f0\x1e' >&"$fd_out"
|
||||||
exit "$ret"
|
exit "$ret"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
@ -158,43 +196,78 @@ function gitstatus_start() {
|
||||||
|
|
||||||
(( ! _gitstatus_bash_downloaded )) || return
|
(( ! _gitstatus_bash_downloaded )) || return
|
||||||
[[ "${GITSTATUS_AUTO_INSTALL:-1}" -ne 0 ]] || return
|
[[ "${GITSTATUS_AUTO_INSTALL:-1}" -ne 0 ]] || return
|
||||||
|
[[ "$_gitstatus_bash_daemon" == \
|
||||||
|
"${GITSTATUS_CACHE_DIR:-${XDG_CACHE_HOME:-$HOME/.cache}/gitstatus}"/* ]] || return
|
||||||
|
|
||||||
set -- -f "$@"
|
set -- -f "$@"
|
||||||
_gitstatus_bash_daemon=
|
_gitstatus_bash_daemon=
|
||||||
_gitstatus_bash_version=
|
_gitstatus_bash_version=
|
||||||
_gitstatus_bash_downloaded=
|
_gitstatus_bash_downloaded=
|
||||||
source "$gitstatus_plugin_dir"/install || return
|
source "$gitstatus_plugin_dir"/install || return
|
||||||
[[ -n "$_gitstatus_bash_daemon" ]] || return
|
[[ -n "$_gitstatus_bash_daemon" ]] || return
|
||||||
[[ -n "$_gitstatus_bash_version" ]] || return
|
[[ -n "$_gitstatus_bash_version" ]] || return
|
||||||
[[ "$_gitstatus_bash_downloaded" == 1 ]] || return
|
[[ "$_gitstatus_bash_downloaded" == 1 ]] || return
|
||||||
|
|
||||||
"$_gitstatus_bash_daemon" \
|
HOME="$home" "$_gitstatus_bash_daemon" \
|
||||||
-G "$_gitstatus_bash_version" "${daemon_args[@]}" <&"$fd_in" >&"$fd_out" &
|
-G "$_gitstatus_bash_version" "${daemon_args[@]}" <&"$fd_in" >&"$fd_out" &
|
||||||
local pid=$!
|
local pid=$!
|
||||||
trap "trap - ${sig[*]}; kill $pid &>/dev/null" ${sig[@]}
|
trap "trap - ${sig[*]}; kill $pid &>/dev/null" ${sig[@]}
|
||||||
wait "$pid"
|
wait "$pid"
|
||||||
trap - ${sig[@]}
|
trap - ${sig[@]}
|
||||||
echo -nE $'bye\x1f0\x1e' >&"$fd_out"
|
echo -nE $'}bye\x1f0\x1e' >&"$fd_out"
|
||||||
) &
|
) & disown
|
||||||
) & disown
|
) & disown
|
||||||
} 0</dev/null &>/dev/null
|
} 0</dev/null &>"$GITSTATUS_DAEMON_LOG"
|
||||||
|
|
||||||
exec {_GITSTATUS_REQ_FD}>"$req_fifo" {_GITSTATUS_RESP_FD}<"$resp_fifo" || return
|
exec {_GITSTATUS_REQ_FD}>>"$req_fifo" {_GITSTATUS_RESP_FD}<"$resp_fifo" || return
|
||||||
command rm "$req_fifo" "$resp_fifo" || return
|
command rm -f -- "$req_fifo" "$resp_fifo" || return
|
||||||
|
[[ "$GITSTATUS_DAEMON_LOG" != /dev/null ]] || command rmdir -- "$tmpdir" 2>/dev/null
|
||||||
|
|
||||||
IFS='' read -r -u $_GITSTATUS_RESP_FD GITSTATUS_DAEMON_PID || return
|
IFS='' read -r -u $_GITSTATUS_RESP_FD GITSTATUS_DAEMON_PID || return
|
||||||
[[ $GITSTATUS_DAEMON_PID == [1-9]* ]] || return
|
[[ "$GITSTATUS_DAEMON_PID" == [1-9]* ]] || return
|
||||||
|
|
||||||
local reply
|
local reply
|
||||||
echo -nE $'hello\x1f\x1e' >&$_GITSTATUS_REQ_FD || return
|
echo -nE $'}hello\x1f\x1e' >&$_GITSTATUS_REQ_FD || return
|
||||||
IFS='' read -rd $'\x1e' -u $_GITSTATUS_RESP_FD -t "$timeout" reply || return
|
local dl=
|
||||||
[[ "$reply" == $'hello\x1f0' ]] || return
|
while true; do
|
||||||
|
reply=
|
||||||
|
if ! IFS='' read -rd $'\x1e' -u $_GITSTATUS_RESP_FD -t "$timeout" reply; then
|
||||||
|
culprit="$reply"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
[[ "$reply" == $'}hello\x1f0' ]] && break
|
||||||
|
if [[ -z "$dl" ]]; then
|
||||||
|
dl=1
|
||||||
|
if [[ -t 2 ]]; then
|
||||||
|
local spinner=('\b\033[33m-\033[0m' '\b\033[33m\\\033[0m' '\b\033[33m|\033[0m' '\b\033[33m/\033[0m')
|
||||||
|
>&2 printf '[\033[33mgitstatus\033[0m] fetching \033[32mgitstatusd\033[0m .. '
|
||||||
|
else
|
||||||
|
local spinner=('.')
|
||||||
|
>&2 printf '[gitstatus] fetching gitstatusd ..'
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
>&2 printf "${spinner[0]}"
|
||||||
|
spinner=("${spinner[@]:1}" "${spinner[0]}")
|
||||||
|
done
|
||||||
|
|
||||||
|
if [[ -n "$dl" ]]; then
|
||||||
|
if [[ -t 2 ]]; then
|
||||||
|
>&2 printf '\b[\033[32mok\033[0m]\n'
|
||||||
|
else
|
||||||
|
>&2 echo ' [ok]'
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
_GITSTATUS_DIRTY_MAX_INDEX_SIZE=$max_dirty
|
_GITSTATUS_DIRTY_MAX_INDEX_SIZE=$max_dirty
|
||||||
_GITSTATUS_CLIENT_PID="$BASHPID"
|
_GITSTATUS_CLIENT_PID="$BASHPID"
|
||||||
}
|
}
|
||||||
|
|
||||||
if ! gitstatus_start_impl; then
|
if ! gitstatus_start_impl; then
|
||||||
echo "gitstatus_start: failed to start gitstatusd" >&2
|
>&2 printf '\n'
|
||||||
|
>&2 printf '[\033[31mERROR\033[0m]: gitstatus failed to initialize.\n'
|
||||||
|
if [[ -n "${culprit-}" ]]; then
|
||||||
|
>&2 printf '\n%s\n' "$culprit"
|
||||||
|
fi
|
||||||
[[ -z "${req_fifo:-}" ]] || command rm -f "$req_fifo"
|
[[ -z "${req_fifo:-}" ]] || command rm -f "$req_fifo"
|
||||||
[[ -z "${resp_fifo:-}" ]] || command rm -f "$resp_fifo"
|
[[ -z "${resp_fifo:-}" ]] || command rm -f "$resp_fifo"
|
||||||
unset -f gitstatus_start_impl
|
unset -f gitstatus_start_impl
|
||||||
|
|
@ -202,54 +275,22 @@ function gitstatus_start() {
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
export _GITSTATUS_CLIENT_PID _GITSTATUS_REQ_FD _GITSTATUS_RESP_FD GITSTATUS_DAEMON_PID
|
||||||
unset -f gitstatus_start_impl
|
unset -f gitstatus_start_impl
|
||||||
|
|
||||||
if [[ "${GITSTATUS_STOP_ON_EXEC:-1}" == 1 ]]; then
|
|
||||||
type -t _gitstatus_exec &>/dev/null || function _gitstatus_exec() { exec "$@"; }
|
|
||||||
type -t _gitstatus_builtin &>/dev/null || function _gitstatus_builtin() { builtin "$@"; }
|
|
||||||
|
|
||||||
function _gitstatus_exec_wrapper() {
|
|
||||||
(( ! $# )) || gitstatus_stop
|
|
||||||
local ret=0
|
|
||||||
_gitstatus_exec "$@" || ret=$?
|
|
||||||
[[ -n "${GITSTATUS_DAEMON_PID:-}" ]] || gitstatus_start || true
|
|
||||||
return $ret
|
|
||||||
}
|
|
||||||
|
|
||||||
function _gitstatus_builtin_wrapper() {
|
|
||||||
while [[ "${1:-}" == builtin ]]; do shift; done
|
|
||||||
if [[ "${1:-}" == exec ]]; then
|
|
||||||
_gitstatus_exec_wrapper "${@:2}"
|
|
||||||
else
|
|
||||||
_gitstatus_builtin "$@"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
alias exec=_gitstatus_exec_wrapper
|
|
||||||
alias builtin=_gitstatus_builtin_wrapper
|
|
||||||
|
|
||||||
_GITSTATUS_EXEC_HOOK=1
|
|
||||||
else
|
|
||||||
unset _GITSTATUS_EXEC_HOOK
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Stops gitstatusd if it's running.
|
# Stops gitstatusd if it's running.
|
||||||
function gitstatus_stop() {
|
function gitstatus_stop() {
|
||||||
[[ "${_GITSTATUS_CLIENT_PID:-$BASHPID}" == "$BASHPID" ]] || return 0
|
if [[ "${_GITSTATUS_CLIENT_PID:-$BASHPID}" == "$BASHPID" ]]; then
|
||||||
[[ -z "${_GITSTATUS_REQ_FD:-}" ]] || exec {_GITSTATUS_REQ_FD}>&- || true
|
[[ -z "${_GITSTATUS_REQ_FD:-}" ]] || exec {_GITSTATUS_REQ_FD}>&- || true
|
||||||
[[ -z "${_GITSTATUS_RESP_FD:-}" ]] || exec {_GITSTATUS_RESP_FD}>&- || true
|
[[ -z "${_GITSTATUS_RESP_FD:-}" ]] || exec {_GITSTATUS_RESP_FD}>&- || true
|
||||||
[[ -z "${GITSTATUS_DAEMON_PID:-}" ]] || kill "$GITSTATUS_DAEMON_PID" &>/dev/null || true
|
[[ -z "${GITSTATUS_DAEMON_PID:-}" ]] || kill "$GITSTATUS_DAEMON_PID" &>/dev/null || true
|
||||||
if [[ -n "${_GITSTATUS_EXEC_HOOK:-}" ]]; then
|
|
||||||
unalias exec builtin &>/dev/null || true
|
|
||||||
function _gitstatus_exec_wrapper() { _gitstatus_exec "$@"; }
|
|
||||||
function _gitstatus_builtin_wrapper() { _gitstatus_builtin "$@"; }
|
|
||||||
fi
|
fi
|
||||||
unset _GITSTATUS_REQ_FD _GITSTATUS_RESP_FD GITSTATUS_DAEMON_PID _GITSTATUS_EXEC_HOOK
|
unset _GITSTATUS_REQ_FD _GITSTATUS_RESP_FD GITSTATUS_DAEMON_PID
|
||||||
unset _GITSTATUS_DIRTY_MAX_INDEX_SIZE _GITSTATUS_CLIENT_PID
|
unset _GITSTATUS_DIRTY_MAX_INDEX_SIZE _GITSTATUS_CLIENT_PID
|
||||||
}
|
}
|
||||||
|
|
||||||
# Retrives status of a git repository from a directory under its working tree.
|
# Retrieves status of a git repository from a directory under its working tree.
|
||||||
#
|
#
|
||||||
# Usage: gitstatus_query [OPTION]...
|
# Usage: gitstatus_query [OPTION]...
|
||||||
#
|
#
|
||||||
|
|
@ -270,6 +311,8 @@ function gitstatus_stop() {
|
||||||
# VCS_STATUS_WORKDIR Git repo working directory. Not empty.
|
# VCS_STATUS_WORKDIR Git repo working directory. Not empty.
|
||||||
# VCS_STATUS_COMMIT Commit hash that HEAD is pointing to. Either 40 hex digits or
|
# VCS_STATUS_COMMIT Commit hash that HEAD is pointing to. Either 40 hex digits or
|
||||||
# empty if there is no HEAD (empty repo).
|
# empty if there is no HEAD (empty repo).
|
||||||
|
# VCS_STATUS_COMMIT_ENCODING Encoding of the HEAD's commit message. Empty value means UTF-8.
|
||||||
|
# VCS_STATUS_COMMIT_SUMMARY The first paragraph of the HEAD's commit message as one line.
|
||||||
# VCS_STATUS_LOCAL_BRANCH Local branch name or empty if not on a branch.
|
# VCS_STATUS_LOCAL_BRANCH Local branch name or empty if not on a branch.
|
||||||
# VCS_STATUS_REMOTE_NAME The remote name, e.g. "upstream" or "origin".
|
# VCS_STATUS_REMOTE_NAME The remote name, e.g. "upstream" or "origin".
|
||||||
# VCS_STATUS_REMOTE_BRANCH Upstream branch name. Can be empty.
|
# VCS_STATUS_REMOTE_BRANCH Upstream branch name. Can be empty.
|
||||||
|
|
@ -317,7 +360,7 @@ function gitstatus_stop() {
|
||||||
# shell or the call had failed.
|
# shell or the call had failed.
|
||||||
function gitstatus_query() {
|
function gitstatus_query() {
|
||||||
unset OPTIND
|
unset OPTIND
|
||||||
local opt dir timeout=() no_diff=0
|
local opt dir= timeout=() no_diff=0
|
||||||
while getopts "d:c:t:p" opt "$@"; do
|
while getopts "d:c:t:p" opt "$@"; do
|
||||||
case "$opt" in
|
case "$opt" in
|
||||||
d) dir=$OPTARG;;
|
d) dir=$OPTARG;;
|
||||||
|
|
@ -328,7 +371,7 @@ function gitstatus_query() {
|
||||||
done
|
done
|
||||||
(( OPTIND == $# + 1 )) || { echo "usage: gitstatus_query [OPTION]..." >&2; return 1; }
|
(( OPTIND == $# + 1 )) || { echo "usage: gitstatus_query [OPTION]..." >&2; return 1; }
|
||||||
|
|
||||||
[[ -n "$GITSTATUS_DAEMON_PID" ]] || return # not started
|
[[ -n "${GITSTATUS_DAEMON_PID-}" ]] || return # not started
|
||||||
|
|
||||||
local req_id="$RANDOM.$RANDOM.$RANDOM.$RANDOM"
|
local req_id="$RANDOM.$RANDOM.$RANDOM.$RANDOM"
|
||||||
if [[ -z "${GIT_DIR:-}" ]]; then
|
if [[ -z "${GIT_DIR:-}" ]]; then
|
||||||
|
|
@ -373,6 +416,8 @@ function gitstatus_query() {
|
||||||
VCS_STATUS_PUSH_COMMITS_BEHIND="${resp[24]:-0}"
|
VCS_STATUS_PUSH_COMMITS_BEHIND="${resp[24]:-0}"
|
||||||
VCS_STATUS_NUM_SKIP_WORKTREE="${resp[25]:-0}"
|
VCS_STATUS_NUM_SKIP_WORKTREE="${resp[25]:-0}"
|
||||||
VCS_STATUS_NUM_ASSUME_UNCHANGED="${resp[26]:-0}"
|
VCS_STATUS_NUM_ASSUME_UNCHANGED="${resp[26]:-0}"
|
||||||
|
VCS_STATUS_COMMIT_ENCODING="${resp[27]-}"
|
||||||
|
VCS_STATUS_COMMIT_SUMMARY="${resp[28]-}"
|
||||||
VCS_STATUS_HAS_STAGED=$((VCS_STATUS_NUM_STAGED > 0))
|
VCS_STATUS_HAS_STAGED=$((VCS_STATUS_NUM_STAGED > 0))
|
||||||
if (( _GITSTATUS_DIRTY_MAX_INDEX_SIZE >= 0 &&
|
if (( _GITSTATUS_DIRTY_MAX_INDEX_SIZE >= 0 &&
|
||||||
VCS_STATUS_INDEX_SIZE > _GITSTATUS_DIRTY_MAX_INDEX_SIZE_ )); then
|
VCS_STATUS_INDEX_SIZE > _GITSTATUS_DIRTY_MAX_INDEX_SIZE_ )); then
|
||||||
|
|
@ -415,6 +460,8 @@ function gitstatus_query() {
|
||||||
unset VCS_STATUS_PUSH_COMMITS_BEHIND
|
unset VCS_STATUS_PUSH_COMMITS_BEHIND
|
||||||
unset VCS_STATUS_NUM_SKIP_WORKTREE
|
unset VCS_STATUS_NUM_SKIP_WORKTREE
|
||||||
unset VCS_STATUS_NUM_ASSUME_UNCHANGED
|
unset VCS_STATUS_NUM_ASSUME_UNCHANGED
|
||||||
|
unset VCS_STATUS_COMMIT_ENCODING
|
||||||
|
unset VCS_STATUS_COMMIT_SUMMARY
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,8 @@
|
||||||
# VCS_STATUS_COMMIT=c000eddcff0fb38df2d0137efe24d9d2d900f209
|
# VCS_STATUS_COMMIT=c000eddcff0fb38df2d0137efe24d9d2d900f209
|
||||||
# VCS_STATUS_COMMITS_AHEAD=0
|
# VCS_STATUS_COMMITS_AHEAD=0
|
||||||
# VCS_STATUS_COMMITS_BEHIND=0
|
# VCS_STATUS_COMMITS_BEHIND=0
|
||||||
|
# VCS_STATUS_COMMIT_ENCODING=''
|
||||||
|
# VCS_STATUS_COMMIT_SUMMARY='pull upstream changes from gitstatus'
|
||||||
# VCS_STATUS_HAS_CONFLICTED=0
|
# VCS_STATUS_HAS_CONFLICTED=0
|
||||||
# VCS_STATUS_HAS_STAGED=0
|
# VCS_STATUS_HAS_STAGED=0
|
||||||
# VCS_STATUS_HAS_UNSTAGED=1
|
# VCS_STATUS_HAS_UNSTAGED=1
|
||||||
|
|
@ -57,7 +59,7 @@ zmodload -F zsh/files b:zf_rm || return
|
||||||
|
|
||||||
typeset -g _gitstatus_plugin_dir"${1:-}"="${${(%):-%x}:A:h}"
|
typeset -g _gitstatus_plugin_dir"${1:-}"="${${(%):-%x}:A:h}"
|
||||||
|
|
||||||
# Retrives status of a git repo from a directory under its working tree.
|
# Retrieves status of a git repo from a directory under its working tree.
|
||||||
#
|
#
|
||||||
## Usage: gitstatus_query [OPTION]... NAME
|
## Usage: gitstatus_query [OPTION]... NAME
|
||||||
#
|
#
|
||||||
|
|
@ -88,6 +90,8 @@ typeset -g _gitstatus_plugin_dir"${1:-}"="${${(%):-%x}:A:h}"
|
||||||
# VCS_STATUS_WORKDIR Git repo working directory. Not empty.
|
# VCS_STATUS_WORKDIR Git repo working directory. Not empty.
|
||||||
# VCS_STATUS_COMMIT Commit hash that HEAD is pointing to. Either 40 hex digits or
|
# VCS_STATUS_COMMIT Commit hash that HEAD is pointing to. Either 40 hex digits or
|
||||||
# empty if there is no HEAD (empty repo).
|
# empty if there is no HEAD (empty repo).
|
||||||
|
# VCS_STATUS_COMMIT_ENCODING Encoding of the HEAD's commit message. Empty value means UTF-8.
|
||||||
|
# VCS_STATUS_COMMIT_SUMMARY The first paragraph of the HEAD's commit message as one line.
|
||||||
# VCS_STATUS_LOCAL_BRANCH Local branch name or empty if not on a branch.
|
# VCS_STATUS_LOCAL_BRANCH Local branch name or empty if not on a branch.
|
||||||
# VCS_STATUS_REMOTE_NAME The remote name, e.g. "upstream" or "origin".
|
# VCS_STATUS_REMOTE_NAME The remote name, e.g. "upstream" or "origin".
|
||||||
# VCS_STATUS_REMOTE_BRANCH Upstream branch name. Can be empty.
|
# VCS_STATUS_REMOTE_BRANCH Upstream branch name. Can be empty.
|
||||||
|
|
@ -168,22 +172,40 @@ function gitstatus_query"${1:-}"() {
|
||||||
done
|
done
|
||||||
|
|
||||||
if (( OPTIND != ARGC )); then
|
if (( OPTIND != ARGC )); then
|
||||||
print -ru2 -- "gitstatus_start: exactly one positional argument is required"
|
print -ru2 -- "gitstatus_query: exactly one positional argument is required"
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
local name=$*[OPTIND]
|
local name=$*[OPTIND]
|
||||||
if [[ $name != [[:IDENT:]]## ]]; then
|
if [[ $name != [[:IDENT:]]## ]]; then
|
||||||
print -ru2 -- "gitstatus_start: invalid positional argument: $name"
|
print -ru2 -- "gitstatus_query: invalid positional argument: $name"
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
(( _GITSTATUS_STATE_$name == 2 )) || return
|
(( _GITSTATUS_STATE_$name == 2 )) || return
|
||||||
|
|
||||||
if [[ -z $GIT_DIR ]]; then
|
if [[ -z $GIT_DIR ]]; then
|
||||||
[[ $dir == /* ]] || dir=${(%):-%/}/$dir
|
if [[ $dir != /* ]]; then
|
||||||
|
if [[ $PWD == /* && $PWD -ef . ]]; then
|
||||||
|
dir=$PWD/$dir
|
||||||
|
else
|
||||||
|
dir=${dir:a}
|
||||||
|
fi
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
[[ $GIT_DIR == /* ]] && dir=:$GIT_DIR || dir=:${(%):-%/}/$GIT_DIR
|
if [[ $GIT_DIR == /* ]]; then
|
||||||
|
dir=:$GIT_DIR
|
||||||
|
elif [[ $PWD == /* && $PWD -ef . ]]; then
|
||||||
|
dir=:$PWD/$GIT_DIR
|
||||||
|
else
|
||||||
|
dir=:${GIT_DIR:a}
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ $dir != (|:)/* ]]; then
|
||||||
|
typeset -g VCS_STATUS_RESULT=norepo-sync
|
||||||
|
_gitstatus_clear$fsuf
|
||||||
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
local -i req_fd=${(P)${:-_GITSTATUS_REQ_FD_$name}}
|
local -i req_fd=${(P)${:-_GITSTATUS_REQ_FD_$name}}
|
||||||
|
|
@ -323,7 +345,9 @@ function _gitstatus_process_response"${1:-}"() {
|
||||||
VCS_STATUS_PUSH_COMMITS_AHEAD \
|
VCS_STATUS_PUSH_COMMITS_AHEAD \
|
||||||
VCS_STATUS_PUSH_COMMITS_BEHIND \
|
VCS_STATUS_PUSH_COMMITS_BEHIND \
|
||||||
VCS_STATUS_NUM_SKIP_WORKTREE \
|
VCS_STATUS_NUM_SKIP_WORKTREE \
|
||||||
VCS_STATUS_NUM_ASSUME_UNCHANGED in "${(@)resp[3,27]}"; do
|
VCS_STATUS_NUM_ASSUME_UNCHANGED \
|
||||||
|
VCS_STATUS_COMMIT_ENCODING \
|
||||||
|
VCS_STATUS_COMMIT_SUMMARY in "${(@)resp[3,29]}"; do
|
||||||
done
|
done
|
||||||
typeset -gi VCS_STATUS_{INDEX_SIZE,NUM_STAGED,NUM_UNSTAGED,NUM_CONFLICTED,NUM_UNTRACKED,COMMITS_AHEAD,COMMITS_BEHIND,STASHES,NUM_UNSTAGED_DELETED,NUM_STAGED_NEW,NUM_STAGED_DELETED,PUSH_COMMITS_AHEAD,PUSH_COMMITS_BEHIND,NUM_SKIP_WORKTREE,NUM_ASSUME_UNCHANGED}
|
typeset -gi VCS_STATUS_{INDEX_SIZE,NUM_STAGED,NUM_UNSTAGED,NUM_CONFLICTED,NUM_UNTRACKED,COMMITS_AHEAD,COMMITS_BEHIND,STASHES,NUM_UNSTAGED_DELETED,NUM_STAGED_NEW,NUM_STAGED_DELETED,PUSH_COMMITS_AHEAD,PUSH_COMMITS_BEHIND,NUM_SKIP_WORKTREE,NUM_ASSUME_UNCHANGED}
|
||||||
typeset -gi VCS_STATUS_HAS_STAGED=$((VCS_STATUS_NUM_STAGED > 0))
|
typeset -gi VCS_STATUS_HAS_STAGED=$((VCS_STATUS_NUM_STAGED > 0))
|
||||||
|
|
@ -365,8 +389,8 @@ function _gitstatus_daemon"${1:-}"() {
|
||||||
trap '' PIPE
|
trap '' PIPE
|
||||||
|
|
||||||
local uname_sm
|
local uname_sm
|
||||||
uname_sm="${(L)$(uname -sm)}" || return
|
uname_sm="${${(L)$(command uname -sm)}//ı/i}" || return
|
||||||
[[ $uname_sm == [^' ']##' '[^' ']## ]] || return
|
[[ $uname_sm == [^' ']##' '[^' ']## ]] || return
|
||||||
local uname_s=${uname_sm% *}
|
local uname_s=${uname_sm% *}
|
||||||
local uname_m=${uname_sm#* }
|
local uname_m=${uname_sm#* }
|
||||||
|
|
||||||
|
|
@ -375,14 +399,19 @@ function _gitstatus_daemon"${1:-}"() {
|
||||||
else
|
else
|
||||||
local cpus
|
local cpus
|
||||||
if (( ! $+commands[sysctl] )) || [[ $uname_s == linux ]] ||
|
if (( ! $+commands[sysctl] )) || [[ $uname_s == linux ]] ||
|
||||||
! cpus="$(sysctl -n hw.ncpu)"; then
|
! cpus="$(command sysctl -n hw.ncpu)"; then
|
||||||
if (( ! $+commands[getconf] )) || ! cpus="$(getconf _NPROCESSORS_ONLN)"; then
|
if (( ! $+commands[getconf] )) || ! cpus="$(command getconf _NPROCESSORS_ONLN)"; then
|
||||||
cpus=8
|
cpus=8
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
args+=(-t $((cpus > 16 ? 32 : cpus > 0 ? 2 * cpus : 16)))
|
args+=(-t $((cpus > 16 ? 32 : cpus > 0 ? 2 * cpus : 16)))
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
command mkfifo -- $file_prefix.fifo || return
|
||||||
|
print -rnu $pipe_fd -- ${(l:20:)pgid} || return
|
||||||
|
exec <$file_prefix.fifo || return
|
||||||
|
zf_rm -- $file_prefix.fifo || return
|
||||||
|
|
||||||
local _gitstatus_zsh_daemon _gitstatus_zsh_version _gitstatus_zsh_downloaded
|
local _gitstatus_zsh_daemon _gitstatus_zsh_version _gitstatus_zsh_downloaded
|
||||||
|
|
||||||
function _gitstatus_set_daemon$fsuf() {
|
function _gitstatus_set_daemon$fsuf() {
|
||||||
|
|
@ -393,36 +422,44 @@ function _gitstatus_daemon"${1:-}"() {
|
||||||
|
|
||||||
local gitstatus_plugin_dir_var=_gitstatus_plugin_dir$fsuf
|
local gitstatus_plugin_dir_var=_gitstatus_plugin_dir$fsuf
|
||||||
local gitstatus_plugin_dir=${(P)gitstatus_plugin_dir_var}
|
local gitstatus_plugin_dir=${(P)gitstatus_plugin_dir_var}
|
||||||
set -- -d $gitstatus_plugin_dir -s $uname_s -m $uname_m -- _gitstatus_set_daemon$fsuf
|
builtin set -- -d $gitstatus_plugin_dir -s $uname_s -m $uname_m \
|
||||||
[[ ${GITSTATUS_AUTO_INSTALL:-1} == (|-|+)<1-> ]] || set -- -n "$@"
|
-p "printf '\\001' >&$pipe_fd" -e $pipe_fd -- _gitstatus_set_daemon$fsuf
|
||||||
source $gitstatus_plugin_dir/install || return
|
[[ ${GITSTATUS_AUTO_INSTALL:-1} == (|-|+)<1-> ]] || builtin set -- -n "$@"
|
||||||
[[ -n $_gitstatus_zsh_daemon ]] || return
|
builtin source $gitstatus_plugin_dir/install || return
|
||||||
[[ -n $_gitstatus_zsh_version ]] || return
|
[[ -n $_gitstatus_zsh_daemon ]] || return
|
||||||
[[ $_gitstatus_zsh_downloaded == [01] ]] || return
|
[[ -n $_gitstatus_zsh_version ]] || return
|
||||||
|
[[ $_gitstatus_zsh_downloaded == [01] ]] || return
|
||||||
|
|
||||||
mkfifo -- $file_prefix.fifo || return
|
if (( UID == EUID )); then
|
||||||
print -rnu $pipe_fd -- ${(l:20:)pgid} || return
|
local home=~
|
||||||
exec <$file_prefix.fifo || return
|
else
|
||||||
zf_rm -- $file_prefix.fifo || return
|
local user
|
||||||
|
user="$(command id -un)" || return
|
||||||
|
local home=${userdirs[$user]}
|
||||||
|
[[ -n $home ]] || return
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ -x $_gitstatus_zsh_daemon ]]; then
|
if [[ -x $_gitstatus_zsh_daemon ]]; then
|
||||||
$_gitstatus_zsh_daemon -G $_gitstatus_zsh_version "${(@)args}" >&$pipe_fd
|
HOME=$home $_gitstatus_zsh_daemon -G $_gitstatus_zsh_version "${(@)args}" >&$pipe_fd
|
||||||
local -i ret=$?
|
local -i ret=$?
|
||||||
[[ $ret == (0|129|130|131|137|141|143) ]] && return ret
|
[[ $ret == (0|129|130|131|137|141|143|159) ]] && return ret
|
||||||
fi
|
fi
|
||||||
|
|
||||||
(( ! _gitstatus_zsh_downloaded )) || return
|
(( ! _gitstatus_zsh_downloaded )) || return
|
||||||
[[ ${GITSTATUS_AUTO_INSTALL:-1} == (|-|+)<1-> ]] || return
|
[[ ${GITSTATUS_AUTO_INSTALL:-1} == (|-|+)<1-> ]] || return
|
||||||
set -- -f "$@"
|
[[ $_gitstatus_zsh_daemon == \
|
||||||
|
${GITSTATUS_CACHE_DIR:-${XDG_CACHE_HOME:-$HOME/.cache}/gitstatus}/* ]] || return
|
||||||
|
|
||||||
|
builtin set -- -f "$@"
|
||||||
_gitstatus_zsh_daemon=
|
_gitstatus_zsh_daemon=
|
||||||
_gitstatus_zsh_version=
|
_gitstatus_zsh_version=
|
||||||
_gitstatus_zsh_downloaded=
|
_gitstatus_zsh_downloaded=
|
||||||
source $gitstatus_plugin_dir/install || return
|
builtin source $gitstatus_plugin_dir/install || return
|
||||||
[[ -n $_gitstatus_zsh_daemon ]] || return
|
[[ -n $_gitstatus_zsh_daemon ]] || return
|
||||||
[[ -n $_gitstatus_zsh_version ]] || return
|
[[ -n $_gitstatus_zsh_version ]] || return
|
||||||
[[ $_gitstatus_zsh_downloaded == 1 ]] || return
|
[[ $_gitstatus_zsh_downloaded == 1 ]] || return
|
||||||
|
|
||||||
$_gitstatus_zsh_daemon -G $_gitstatus_zsh_version "${(@)args}" >&$pipe_fd
|
HOME=$home $_gitstatus_zsh_daemon -G $_gitstatus_zsh_version "${(@)args}" >&$pipe_fd
|
||||||
} always {
|
} always {
|
||||||
local -i ret=$?
|
local -i ret=$?
|
||||||
zf_rm -f -- $file_prefix.lock $file_prefix.fifo
|
zf_rm -f -- $file_prefix.lock $file_prefix.fifo
|
||||||
|
|
@ -433,7 +470,7 @@ function _gitstatus_daemon"${1:-}"() {
|
||||||
(( lock_fd == -1 )) && return
|
(( lock_fd == -1 )) && return
|
||||||
|
|
||||||
{
|
{
|
||||||
if zsystem flock -- $file_prefix.lock && [[ -e $file_prefix.lock ]]; then
|
if zsystem flock -- $file_prefix.lock && command sleep 5 && [[ -e $file_prefix.lock ]]; then
|
||||||
zf_rm -f -- $file_prefix.lock $file_prefix.fifo
|
zf_rm -f -- $file_prefix.lock $file_prefix.fifo
|
||||||
kill -- -$pgid
|
kill -- -$pgid
|
||||||
fi
|
fi
|
||||||
|
|
@ -503,7 +540,7 @@ function gitstatus_start"${1:-}"() {
|
||||||
args+=(-$opt $OPTARG)
|
args+=(-$opt $OPTARG)
|
||||||
[[ $opt == m ]] && dirty_max_index_size=OPTARG
|
[[ $opt == m ]] && dirty_max_index_size=OPTARG
|
||||||
;;
|
;;
|
||||||
e|U|W|D) args+=$opt;;
|
e|U|W|D) args+=-$opt;;
|
||||||
+(e|U|W|D)) args=(${(@)args:#-$opt});;
|
+(e|U|W|D)) args=(${(@)args:#-$opt});;
|
||||||
\?) print -ru2 -- "gitstatus_start: invalid option: $OPTARG" ; return 1;;
|
\?) print -ru2 -- "gitstatus_start: invalid option: $OPTARG" ; return 1;;
|
||||||
:) print -ru2 -- "gitstatus_start: missing required argument: $OPTARG"; return 1;;
|
:) print -ru2 -- "gitstatus_start: missing required argument: $OPTARG"; return 1;;
|
||||||
|
|
@ -523,209 +560,264 @@ function gitstatus_start"${1:-}"() {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
local -i lock_fd resp_fd stderr_fd
|
local -i lock_fd resp_fd stderr_fd
|
||||||
local file_prefix xtrace=/dev/null daemon_log=/dev/null
|
local file_prefix xtrace=/dev/null daemon_log=/dev/null culprit
|
||||||
if (( _GITSTATUS_STATE_$name )); then
|
|
||||||
(( async )) && return
|
|
||||||
(( _GITSTATUS_STATE_$name == 2 )) && return
|
|
||||||
lock_fd=_GITSTATUS_LOCK_FD_$name
|
|
||||||
resp_fd=_GITSTATUS_RESP_FD_$name
|
|
||||||
xtrace=${(P)${:-GITSTATUS_XTRACE_$name}}
|
|
||||||
daemon_log=${(P)${:-GITSTATUS_DAEMON_LOG_$name}}
|
|
||||||
file_prefix=${(P)${:-_GITSTATUS_FILE_PREFIX_$name}}
|
|
||||||
else
|
|
||||||
typeset -gi _GITSTATUS_START_COUNTER
|
|
||||||
local log_level=$GITSTATUS_LOG_LEVEL
|
|
||||||
local file_prefix=${${TMPDIR:-/tmp}:A}/gitstatus.$name.$EUID
|
|
||||||
file_prefix+=.$sysparams[pid].$EPOCHSECONDS.$((++_GITSTATUS_START_COUNTER))
|
|
||||||
(( GITSTATUS_ENABLE_LOGGING )) && : ${log_level:=INFO}
|
|
||||||
if [[ -n $log_level ]]; then
|
|
||||||
xtrace=$file_prefix.xtrace.log
|
|
||||||
daemon_log=$file_prefix.daemon.log
|
|
||||||
fi
|
|
||||||
args+=(-v ${log_level:-FATAL})
|
|
||||||
typeset -g GITSTATUS_XTRACE_$name=$xtrace
|
|
||||||
typeset -g GITSTATUS_DAEMON_LOG_$name=$daemon_log
|
|
||||||
typeset -g _GITSTATUS_FILE_PREFIX_$name=$file_prefix
|
|
||||||
typeset -gi _GITSTATUS_CLIENT_PID_$name="sysparams[pid]"
|
|
||||||
typeset -gi _GITSTATUS_DIRTY_MAX_INDEX_SIZE_$name=dirty_max_index_size
|
|
||||||
fi
|
|
||||||
|
|
||||||
() {
|
{
|
||||||
if [[ $xtrace != /dev/null && -o no_xtrace ]]; then
|
if (( _GITSTATUS_STATE_$name )); then
|
||||||
exec {stderr_fd}>&2 || return
|
(( async )) && return
|
||||||
exec 2>>$xtrace || return
|
(( _GITSTATUS_STATE_$name == 2 )) && return
|
||||||
setopt xtrace
|
lock_fd=_GITSTATUS_LOCK_FD_$name
|
||||||
fi
|
resp_fd=_GITSTATUS_RESP_FD_$name
|
||||||
|
xtrace=${(P)${:-GITSTATUS_XTRACE_$name}}
|
||||||
setopt monitor || return
|
daemon_log=${(P)${:-GITSTATUS_DAEMON_LOG_$name}}
|
||||||
|
file_prefix=${(P)${:-_GITSTATUS_FILE_PREFIX_$name}}
|
||||||
if (( ! _GITSTATUS_STATE_$name )); then
|
else
|
||||||
if [[ -r /proc/version && "$(</proc/version)" == *Microsoft* ]]; then
|
typeset -gi _GITSTATUS_START_COUNTER
|
||||||
lock_fd=-1
|
local log_level=$GITSTATUS_LOG_LEVEL
|
||||||
|
if [[ -n "$TMPDIR" && ( ( -d "$TMPDIR" && -w "$TMPDIR" ) || ! ( -d /tmp && -w /tmp ) ) ]]; then
|
||||||
|
local tmpdir=$TMPDIR
|
||||||
else
|
else
|
||||||
print -rn >$file_prefix.lock || return
|
local tmpdir=/tmp
|
||||||
zsystem flock -f lock_fd $file_prefix.lock || return
|
fi
|
||||||
[[ $lock_fd == <1-> ]] || return
|
local file_prefix=${tmpdir:A}/gitstatus.$name.$EUID
|
||||||
|
file_prefix+=.$sysparams[pid].$EPOCHSECONDS.$((++_GITSTATUS_START_COUNTER))
|
||||||
|
(( GITSTATUS_ENABLE_LOGGING )) && : ${log_level:=INFO}
|
||||||
|
if [[ -n $log_level ]]; then
|
||||||
|
xtrace=$file_prefix.xtrace.log
|
||||||
|
daemon_log=$file_prefix.daemon.log
|
||||||
|
fi
|
||||||
|
args+=(-v ${log_level:-FATAL})
|
||||||
|
typeset -g GITSTATUS_XTRACE_$name=$xtrace
|
||||||
|
typeset -g GITSTATUS_DAEMON_LOG_$name=$daemon_log
|
||||||
|
typeset -g _GITSTATUS_FILE_PREFIX_$name=$file_prefix
|
||||||
|
typeset -gi _GITSTATUS_CLIENT_PID_$name="sysparams[pid]"
|
||||||
|
typeset -gi _GITSTATUS_DIRTY_MAX_INDEX_SIZE_$name=dirty_max_index_size
|
||||||
|
fi
|
||||||
|
|
||||||
|
() {
|
||||||
|
if [[ $xtrace != /dev/null && -o no_xtrace ]]; then
|
||||||
|
exec {stderr_fd}>&2 || return
|
||||||
|
exec 2>>$xtrace || return
|
||||||
|
setopt xtrace
|
||||||
fi
|
fi
|
||||||
|
|
||||||
typeset -gi _GITSTATUS_LOCK_FD_$name=lock_fd
|
setopt monitor || return
|
||||||
|
|
||||||
if [[ -n $USERPROFILE && -d /cygdrive && -d /proc/self/fd ]]; then
|
if (( ! _GITSTATUS_STATE_$name )); then
|
||||||
# Work around bugs in Cygwin 32-bit.
|
if [[ -r /proc/version && "$(</proc/version)" == *Microsoft* ]]; then
|
||||||
#
|
lock_fd=-1
|
||||||
# This hangs:
|
|
||||||
#
|
|
||||||
# emulate -L zsh
|
|
||||||
# () { exec {fd}< $1 } <(:)
|
|
||||||
# =true # hangs here
|
|
||||||
#
|
|
||||||
# This hangs:
|
|
||||||
#
|
|
||||||
# sysopen -r -u fd <(:)
|
|
||||||
local -i fd
|
|
||||||
exec {fd}< <(_gitstatus_daemon$fsuf) || return
|
|
||||||
{
|
|
||||||
[[ -r /proc/self/fd/$fd ]] || return
|
|
||||||
sysopen -r -o cloexec -u resp_fd /proc/self/fd/$fd || return
|
|
||||||
} always {
|
|
||||||
exec {fd} >&- || return
|
|
||||||
}
|
|
||||||
else
|
|
||||||
sysopen -r -o cloexec -u resp_fd <(_gitstatus_daemon$fsuf) || return
|
|
||||||
fi
|
|
||||||
|
|
||||||
typeset -gi GITSTATUS_DAEMON_PID_$name="${sysparams[procsubstpid]:--1}"
|
|
||||||
|
|
||||||
[[ $resp_fd == <1-> ]] || return
|
|
||||||
typeset -gi _GITSTATUS_RESP_FD_$name=resp_fd
|
|
||||||
typeset -gi _GITSTATUS_STATE_$name=1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if (( ! async )); then
|
|
||||||
(( _GITSTATUS_CLIENT_PID_$name == sysparams[pid] )) || return
|
|
||||||
|
|
||||||
local pgid
|
|
||||||
while (( $#pgid < 20 )); do
|
|
||||||
[[ -t $resp_fd ]]
|
|
||||||
sysread -s $((20 - $#pgid)) -t $timeout -i $resp_fd 'pgid[$#pgid+1]' || return
|
|
||||||
done
|
|
||||||
[[ $pgid == ' '#<1-> ]] || return
|
|
||||||
typeset -gi GITSTATUS_DAEMON_PID_$name=pgid
|
|
||||||
|
|
||||||
sysopen -w -o cloexec -u req_fd -- $file_prefix.fifo || return
|
|
||||||
[[ $req_fd == <1-> ]] || return
|
|
||||||
typeset -gi _GITSTATUS_REQ_FD_$name=req_fd
|
|
||||||
|
|
||||||
function _gitstatus_process_response_$name-$fsuf() {
|
|
||||||
emulate -L zsh -o no_aliases -o extended_glob -o typeset_silent
|
|
||||||
local pair=${${(%):-%N}#_gitstatus_process_response_}
|
|
||||||
local name=${pair%%-*}
|
|
||||||
local fsuf=${pair#*-}
|
|
||||||
if (( ARGC == 1 )); then
|
|
||||||
_gitstatus_process_response$fsuf $name 0 ''
|
|
||||||
else
|
else
|
||||||
gitstatus_stop$fsuf $name
|
print -rn >$file_prefix.lock || return
|
||||||
|
zsystem flock -f lock_fd $file_prefix.lock || return
|
||||||
|
[[ $lock_fd == <1-> ]] || return
|
||||||
fi
|
fi
|
||||||
}
|
|
||||||
if ! zle -F $resp_fd _gitstatus_process_response_$name-$fsuf; then
|
typeset -gi _GITSTATUS_LOCK_FD_$name=lock_fd
|
||||||
unfunction _gitstatus_process_response_$name-$fsuf
|
|
||||||
return 1
|
if [[ $OSTYPE == cygwin* && -d /proc/self/fd ]]; then
|
||||||
|
# Work around bugs in Cygwin 32-bit.
|
||||||
|
#
|
||||||
|
# This hangs:
|
||||||
|
#
|
||||||
|
# emulate -L zsh
|
||||||
|
# () { exec {fd}< $1 } <(:)
|
||||||
|
# =true # hangs here
|
||||||
|
#
|
||||||
|
# This hangs:
|
||||||
|
#
|
||||||
|
# sysopen -r -u fd <(:)
|
||||||
|
local -i fd
|
||||||
|
exec {fd}< <(_gitstatus_daemon$fsuf) || return
|
||||||
|
{
|
||||||
|
[[ -r /proc/self/fd/$fd ]] || return
|
||||||
|
sysopen -r -o cloexec -u resp_fd /proc/self/fd/$fd || return
|
||||||
|
} always {
|
||||||
|
exec {fd} >&- || return
|
||||||
|
}
|
||||||
|
else
|
||||||
|
sysopen -r -o cloexec -u resp_fd <(_gitstatus_daemon$fsuf) || return
|
||||||
|
fi
|
||||||
|
|
||||||
|
typeset -gi GITSTATUS_DAEMON_PID_$name="${sysparams[procsubstpid]:--1}"
|
||||||
|
|
||||||
|
[[ $resp_fd == <1-> ]] || return
|
||||||
|
typeset -gi _GITSTATUS_RESP_FD_$name=resp_fd
|
||||||
|
typeset -gi _GITSTATUS_STATE_$name=1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
function _gitstatus_cleanup_$name-$fsuf() {
|
if (( ! async )); then
|
||||||
emulate -L zsh -o no_aliases -o extended_glob -o typeset_silent
|
|
||||||
local pair=${${(%):-%N}#_gitstatus_cleanup_}
|
|
||||||
local name=${pair%%-*}
|
|
||||||
local fsuf=${pair#*-}
|
|
||||||
(( _GITSTATUS_CLIENT_PID_$name == sysparams[pid] )) || return
|
(( _GITSTATUS_CLIENT_PID_$name == sysparams[pid] )) || return
|
||||||
gitstatus_stop$fsuf $name
|
|
||||||
}
|
local pgid
|
||||||
if ! add-zsh-hook zshexit _gitstatus_cleanup_$name-$fsuf; then
|
while (( $#pgid < 20 )); do
|
||||||
unfunction _gitstatus_cleanup_$name-$fsuf
|
[[ -t $resp_fd ]]
|
||||||
return 1
|
sysread -s $((20 - $#pgid)) -t $timeout -i $resp_fd 'pgid[$#pgid+1]' || return
|
||||||
|
done
|
||||||
|
[[ $pgid == ' '#<1-> ]] || return
|
||||||
|
typeset -gi GITSTATUS_DAEMON_PID_$name=pgid
|
||||||
|
|
||||||
|
sysopen -w -o cloexec -u req_fd -- $file_prefix.fifo || return
|
||||||
|
[[ $req_fd == <1-> ]] || return
|
||||||
|
typeset -gi _GITSTATUS_REQ_FD_$name=req_fd
|
||||||
|
|
||||||
|
print -nru $req_fd -- $'}hello\x1f\x1e' || return
|
||||||
|
local expected=$'}hello\x1f0\x1e' actual
|
||||||
|
if (( $+functions[p10k] )) && [[ ! -t 1 && ! -t 0 ]]; then
|
||||||
|
local -F deadline='EPOCHREALTIME + 4'
|
||||||
|
else
|
||||||
|
local -F deadline='1'
|
||||||
|
fi
|
||||||
|
while true; do
|
||||||
|
[[ -t $resp_fd ]]
|
||||||
|
sysread -s 1 -t $timeout -i $resp_fd actual || return
|
||||||
|
[[ $expected == $actual* ]] && break
|
||||||
|
if [[ $actual != $'\1' ]]; then
|
||||||
|
[[ -t $resp_fd ]]
|
||||||
|
while sysread -t $timeout -i $resp_fd 'actual[$#actual+1]'; do
|
||||||
|
[[ -t $resp_fd ]]
|
||||||
|
done
|
||||||
|
culprit=$actual
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
(( EPOCHREALTIME < deadline )) && continue
|
||||||
|
if (( deadline > 0 )); then
|
||||||
|
deadline=0
|
||||||
|
if (( stderr_fd )); then
|
||||||
|
unsetopt xtrace
|
||||||
|
exec 2>&$stderr_fd {stderr_fd}>&-
|
||||||
|
stderr_fd=0
|
||||||
|
fi
|
||||||
|
if (( $+functions[p10k] )); then
|
||||||
|
p10k clear-instant-prompt || return
|
||||||
|
fi
|
||||||
|
if [[ $name == POWERLEVEL9K ]]; then
|
||||||
|
local label=powerlevel10k
|
||||||
|
else
|
||||||
|
local label=gitstatus
|
||||||
|
fi
|
||||||
|
if [[ -t 2 ]]; then
|
||||||
|
local spinner=($'\b%3F-%f' $'\b%3F\\%f' $'\b%3F|%f' $'\b%3F/%f')
|
||||||
|
print -Prnu2 -- "[%3F$label%f] fetching %2Fgitstatusd%f .. "
|
||||||
|
else
|
||||||
|
local spinner=('.')
|
||||||
|
print -rnu2 -- "[$label] fetching gitstatusd .."
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
print -Prnu2 -- $spinner[1]
|
||||||
|
spinner=($spinner[2,-1] $spinner[1])
|
||||||
|
done
|
||||||
|
|
||||||
|
if (( deadline == 0 )); then
|
||||||
|
if [[ -t 2 ]]; then
|
||||||
|
print -Pru2 -- $'\b[%2Fok%f]'
|
||||||
|
else
|
||||||
|
print -ru2 -- ' [ok]'
|
||||||
|
fi
|
||||||
|
if [[ $xtrace != /dev/null && -o no_xtrace ]]; then
|
||||||
|
exec {stderr_fd}>&2 || return
|
||||||
|
exec 2>>$xtrace || return
|
||||||
|
setopt xtrace
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
while (( $#actual < $#expected )); do
|
||||||
|
[[ -t $resp_fd ]]
|
||||||
|
sysread -s $(($#expected - $#actual)) -t $timeout -i $resp_fd 'actual[$#actual+1]' || return
|
||||||
|
done
|
||||||
|
[[ $actual == $expected ]] || return
|
||||||
|
|
||||||
|
function _gitstatus_process_response_$name-$fsuf() {
|
||||||
|
emulate -L zsh -o no_aliases -o extended_glob -o typeset_silent
|
||||||
|
local pair=${${(%):-%N}#_gitstatus_process_response_}
|
||||||
|
local name=${pair%%-*}
|
||||||
|
local fsuf=${pair#*-}
|
||||||
|
[[ $name == POWERLEVEL9K && $fsuf == _p9k_ ]] && eval $__p9k_intro_base
|
||||||
|
if (( ARGC == 1 )); then
|
||||||
|
_gitstatus_process_response$fsuf $name 0 ''
|
||||||
|
else
|
||||||
|
gitstatus_stop$fsuf $name
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
if ! zle -F $resp_fd _gitstatus_process_response_$name-$fsuf; then
|
||||||
|
unfunction _gitstatus_process_response_$name-$fsuf
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
function _gitstatus_cleanup_$name-$fsuf() {
|
||||||
|
emulate -L zsh -o no_aliases -o extended_glob -o typeset_silent
|
||||||
|
local pair=${${(%):-%N}#_gitstatus_cleanup_}
|
||||||
|
local name=${pair%%-*}
|
||||||
|
local fsuf=${pair#*-}
|
||||||
|
(( _GITSTATUS_CLIENT_PID_$name == sysparams[pid] )) || return
|
||||||
|
gitstatus_stop$fsuf $name
|
||||||
|
}
|
||||||
|
if ! add-zsh-hook zshexit _gitstatus_cleanup_$name-$fsuf; then
|
||||||
|
unfunction _gitstatus_cleanup_$name-$fsuf
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if (( lock_fd != -1 )); then
|
||||||
|
zf_rm -- $file_prefix.lock || return
|
||||||
|
zsystem flock -u $lock_fd || return
|
||||||
|
fi
|
||||||
|
unset _GITSTATUS_LOCK_FD_$name
|
||||||
|
|
||||||
|
typeset -gi _GITSTATUS_STATE_$name=2
|
||||||
fi
|
fi
|
||||||
|
}
|
||||||
|
} always {
|
||||||
|
local -i err=$?
|
||||||
|
(( stderr_fd )) && exec 2>&$stderr_fd {stderr_fd}>&-
|
||||||
|
(( err == 0 )) && return
|
||||||
|
|
||||||
print -nru $req_fd -- $'hello\x1f\x1e' || return
|
gitstatus_stop$fsuf $name
|
||||||
local expected=$'hello\x1f0\x1e' actual
|
|
||||||
while (( $#actual < $#expected )); do
|
|
||||||
[[ -t $resp_fd ]]
|
|
||||||
sysread -s $(($#expected - $#actual)) -t $timeout -i $resp_fd 'actual[$#actual+1]' || return
|
|
||||||
done
|
|
||||||
[[ $actual == $expected ]] || return
|
|
||||||
|
|
||||||
if (( lock_fd != -1 )); then
|
setopt prompt_percent no_prompt_subst no_prompt_bang
|
||||||
zf_rm -- $file_prefix.lock || return
|
(( $+functions[p10k] )) && p10k clear-instant-prompt
|
||||||
zsystem flock -u $lock_fd || return
|
print -ru2 -- ''
|
||||||
fi
|
print -Pru2 -- '[%F{red}ERROR%f]: gitstatus failed to initialize.'
|
||||||
unset _GITSTATUS_LOCK_FD_$name
|
print -ru2 -- ''
|
||||||
|
if [[ -n $culprit ]]; then
|
||||||
typeset -gi _GITSTATUS_STATE_$name=2
|
print -ru2 -- $culprit
|
||||||
|
return err
|
||||||
|
fi
|
||||||
|
if [[ -s $xtrace ]]; then
|
||||||
|
print -ru2 -- ''
|
||||||
|
print -Pru2 -- " Zsh log (%U${xtrace//\%/%%}%u):"
|
||||||
|
print -Pru2 -- '%F{yellow}'
|
||||||
|
print -lru2 -- "${(@)${(@f)$(<$xtrace)}/#/ }"
|
||||||
|
print -Pnru2 -- '%f'
|
||||||
|
fi
|
||||||
|
if [[ -s $daemon_log ]]; then
|
||||||
|
print -ru2 -- ''
|
||||||
|
print -Pru2 -- " Daemon log (%U${daemon_log//\%/%%}%u):"
|
||||||
|
print -Pru2 -- '%F{yellow}'
|
||||||
|
print -lru2 -- "${(@)${(@f)$(<$daemon_log)}/#/ }"
|
||||||
|
print -Pnru2 -- '%f'
|
||||||
|
fi
|
||||||
|
if [[ $GITSTATUS_LOG_LEVEL == DEBUG ]]; then
|
||||||
|
print -ru2 -- ''
|
||||||
|
print -ru2 -- ' System information:'
|
||||||
|
print -Pru2 -- '%F{yellow}'
|
||||||
|
print -ru2 -- " zsh: $ZSH_VERSION"
|
||||||
|
print -ru2 -- " uname -a: $(command uname -a)"
|
||||||
|
print -Pru2 -- '%f'
|
||||||
|
print -ru2 -- ' If you need help, open an issue and attach this whole error message to it:'
|
||||||
|
print -ru2 -- ''
|
||||||
|
print -Pru2 -- ' %Uhttps://github.com/romkatv/gitstatus/issues/new%u'
|
||||||
|
else
|
||||||
|
print -ru2 -- ''
|
||||||
|
local home=~
|
||||||
|
local zshrc=${${${(q)${ZDOTDIR:-~}}/#${(q)home}/'~'}//\%/%%}/.zshrc
|
||||||
|
print -Pru2 -- " Add the following parameter to %U$zshrc%u for extra diagnostics on error:"
|
||||||
|
print -ru2 -- ''
|
||||||
|
print -Pru2 -- ' %BGITSTATUS_LOG_LEVEL=DEBUG%b'
|
||||||
|
print -ru2 -- ''
|
||||||
|
print -ru2 -- ' Restart Zsh to retry gitstatus initialization:'
|
||||||
|
print -ru2 -- ''
|
||||||
|
print -Pru2 -- ' %F{green}%Uexec%u zsh%f'
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
local -i err=$?
|
|
||||||
(( stderr_fd )) && exec 2>&$stderr_fd {stderr_fd}>&-
|
|
||||||
(( err == 0 )) && return
|
|
||||||
|
|
||||||
gitstatus_stop$fsuf $name
|
|
||||||
|
|
||||||
setopt prompt_percent no_prompt_subst no_prompt_bang
|
|
||||||
print -Pru2 -- '[%F{red}ERROR%f]: gitstatus failed to initialize.'
|
|
||||||
print -ru2 -- ''
|
|
||||||
print -ru2 -- ' Your Git prompt may disappear or become slow.'
|
|
||||||
if [[ -s $xtrace ]]; then
|
|
||||||
print -ru2 -- ''
|
|
||||||
print -ru2 -- " The content of ${(q-)xtrace} (gitstatus_start xtrace):"
|
|
||||||
print -Pru2 -- '%F{yellow}'
|
|
||||||
>&2 awk '{print " " $0}' <$xtrace
|
|
||||||
print -Pru2 -- "%F{red} ^ this command failed ($err)%f"
|
|
||||||
fi
|
|
||||||
if [[ -s $daemon_log ]]; then
|
|
||||||
print -ru2 -- ''
|
|
||||||
print -ru2 -- " The content of ${(q-)daemon_log} (gitstatus daemon log):"
|
|
||||||
print -Pru2 -- '%F{yellow}'
|
|
||||||
>&2 awk '{print " " $0}' <$daemon_log
|
|
||||||
print -Pnru2 -- '%f'
|
|
||||||
fi
|
|
||||||
if [[ $GITSTATUS_LOG_LEVEL == DEBUG ]]; then
|
|
||||||
print -ru2 -- ''
|
|
||||||
print -ru2 -- ' Your system information:'
|
|
||||||
print -Pru2 -- '%F{yellow}'
|
|
||||||
print -ru2 -- " zsh: $ZSH_VERSION"
|
|
||||||
print -ru2 -- " uname -a: $(uname -a)"
|
|
||||||
print -Pru2 -- '%f'
|
|
||||||
print -ru2 -- ' If you need help, open an issue and attach this whole error message to it:'
|
|
||||||
print -ru2 -- ''
|
|
||||||
print -Pru2 -- ' %F{green}https://github.com/romkatv/gitstatus/issues/new%f'
|
|
||||||
else
|
|
||||||
print -ru2 -- ''
|
|
||||||
print -ru2 -- ' Run the following command to retry with extra diagnostics:'
|
|
||||||
print -Pru2 -- '%F{green}'
|
|
||||||
local env="GITSTATUS_LOG_LEVEL=DEBUG"
|
|
||||||
if [[ -n $GITSTATUS_NUM_THREADS ]]; then
|
|
||||||
env+=" GITSTATUS_NUM_THREADS=${(q)GITSTATUS_NUM_THREADS}"
|
|
||||||
fi
|
|
||||||
if [[ -n $GITSTATUS_DAEMON ]]; then
|
|
||||||
env+=" GITSTATUS_DAEMON=${(q)GITSTATUS_DAEMON}"
|
|
||||||
fi
|
|
||||||
if [[ -n $GITSTATUS_AUTO_INSTALL ]]; then
|
|
||||||
env+=" GITSTATUS_AUTO_INSTALL=${(q)GITSTATUS_AUTO_INSTALL}"
|
|
||||||
fi
|
|
||||||
if [[ -n $GITSTATUS_CACHE_DIR ]]; then
|
|
||||||
env+=" GITSTATUS_CACHE_DIR=${(q)GITSTATUS_CACHE_DIR}"
|
|
||||||
fi
|
|
||||||
print -nru2 -- " ${env} gitstatus_start ${(@q-)*}"
|
|
||||||
print -Pru2 -- '%f'
|
|
||||||
print -ru2 -- ''
|
|
||||||
local zshrc=${(D)ZDOTDIR:-~}/.zshrc
|
|
||||||
print -ru2 -- " If this command produces no output, add the following parameter to $zshrc:"
|
|
||||||
print -ru2 -- ''
|
|
||||||
print -Pru2 -- '%F{green} GITSTATUS_LOG_LEVEL=DEBUG%f'
|
|
||||||
print -ru2 -- ''
|
|
||||||
print -ru2 -- ' With this parameter gitstatus will print additional information on error.'
|
|
||||||
fi
|
|
||||||
|
|
||||||
return err
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Stops gitstatusd if it's running.
|
# Stops gitstatusd if it's running.
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
# Source gitstatus.plugin.sh from $GITSTATUS_DIR or from the same directory
|
# Source gitstatus.plugin.sh from $GITSTATUS_DIR or from the same directory
|
||||||
# in which the current script resides if the variable isn't set.
|
# in which the current script resides if the variable isn't set.
|
||||||
if [[ -n "${GITSTATUS_DIR:-}" ]]; then
|
if [[ -n "${GITSTATUS_DIR-}" ]]; then
|
||||||
source "$GITSTATUS_DIR" || return
|
source "$GITSTATUS_DIR" || return
|
||||||
elif [[ "${BASH_SOURCE[0]}" == */* ]]; then
|
elif [[ "${BASH_SOURCE[0]}" == */* ]]; then
|
||||||
source "${BASH_SOURCE[0]%/*}/gitstatus.plugin.sh" || return
|
source "${BASH_SOURCE[0]%/*}/gitstatus.plugin.sh" || return
|
||||||
|
|
@ -33,11 +33,11 @@ function gitstatus_prompt_update() {
|
||||||
gitstatus_query "$@" || return 1 # error
|
gitstatus_query "$@" || return 1 # error
|
||||||
[[ "$VCS_STATUS_RESULT" == ok-sync ]] || return 0 # not a git repo
|
[[ "$VCS_STATUS_RESULT" == ok-sync ]] || return 0 # not a git repo
|
||||||
|
|
||||||
local reset=$'\e[0m' # no color
|
local reset=$'\001\e[0m\002' # no color
|
||||||
local clean=$'\e[38;5;076m' # green foreground
|
local clean=$'\001\e[38;5;076m\002' # green foreground
|
||||||
local untracked=$'\e[38;5;014m' # teal foreground
|
local untracked=$'\001\e[38;5;014m\002' # teal foreground
|
||||||
local modified=$'\e[38;5;011m' # yellow foreground
|
local modified=$'\001\e[38;5;011m\002' # yellow foreground
|
||||||
local conflicted=$'\e[38;5;196m' # red foreground
|
local conflicted=$'\001\e[38;5;196m\002' # red foreground
|
||||||
|
|
||||||
local p
|
local p
|
||||||
|
|
||||||
|
|
@ -85,7 +85,15 @@ function gitstatus_prompt_update() {
|
||||||
gitstatus_stop && gitstatus_start -s -1 -u -1 -c -1 -d -1
|
gitstatus_stop && gitstatus_start -s -1 -u -1 -c -1 -d -1
|
||||||
|
|
||||||
# On every prompt, fetch git status and set GITSTATUS_PROMPT.
|
# On every prompt, fetch git status and set GITSTATUS_PROMPT.
|
||||||
PROMPT_COMMAND=gitstatus_prompt_update
|
if [[ -z "${PROMPT_COMMAND[*]}" ]]; then
|
||||||
|
PROMPT_COMMAND=gitstatus_prompt_update
|
||||||
|
elif [[ ! "${PROMPT_COMMAND[*]}" =~ [[:space:]\;]?gitstatus_prompt_update[[:space:]\;]? ]]; then
|
||||||
|
# Note: If PROMPT_COMMAND is an array, this will modify its first element.
|
||||||
|
PROMPT_COMMAND=$'gitstatus_prompt_update\n'"$PROMPT_COMMAND"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Retain 3 trailing components of the current directory.
|
||||||
|
PROMPT_DIRTRIM=3
|
||||||
|
|
||||||
# Enable promptvars so that ${GITSTATUS_PROMPT} in PS1 is expanded.
|
# Enable promptvars so that ${GITSTATUS_PROMPT} in PS1 is expanded.
|
||||||
shopt -s promptvars
|
shopt -s promptvars
|
||||||
|
|
@ -94,7 +102,7 @@ shopt -s promptvars
|
||||||
#
|
#
|
||||||
# Example:
|
# Example:
|
||||||
#
|
#
|
||||||
# user@host ~/projects/skynet master+!
|
# user@host ~/projects/skynet master ⇡42
|
||||||
# $ █
|
# $ █
|
||||||
PS1='\[\033[01;32m\]\u@\h\[\033[00m\] ' # green user@host
|
PS1='\[\033[01;32m\]\u@\h\[\033[00m\] ' # green user@host
|
||||||
PS1+='\[\033[01;34m\]\w\[\033[00m\]' # blue current working directory
|
PS1+='\[\033[01;34m\]\w\[\033[00m\]' # blue current working directory
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,12 @@
|
||||||
#
|
#
|
||||||
# This script does not have a stable API.
|
# This script does not have a stable API.
|
||||||
|
|
||||||
|
_gitstatus_install_daemon_found() {
|
||||||
|
local installed="$1"
|
||||||
|
shift
|
||||||
|
[ $# = 0 ] || "$@" "$daemon" "$version" "$installed"
|
||||||
|
}
|
||||||
|
|
||||||
_gitstatus_install_main() {
|
_gitstatus_install_main() {
|
||||||
if [ -n "${ZSH_VERSION:-}" ]; then
|
if [ -n "${ZSH_VERSION:-}" ]; then
|
||||||
emulate -L sh -o no_unset
|
emulate -L sh -o no_unset
|
||||||
|
|
@ -9,17 +15,17 @@ _gitstatus_install_main() {
|
||||||
set -u
|
set -u
|
||||||
fi
|
fi
|
||||||
|
|
||||||
local argv1=$1
|
local argv1="$1"
|
||||||
shift
|
shift
|
||||||
|
|
||||||
local no_check= no_install= uname_s= uname_m= gitstatus_dir=
|
local no_check= no_install= uname_s= uname_m= gitstatus_dir= dl_status= e=
|
||||||
local opt= OPTARG= OPTIND=1
|
local opt= OPTARG= OPTIND=1
|
||||||
|
|
||||||
while getopts ':s:m:d:fnh' opt "$@"; do
|
while getopts ':s:m:d:p:e:fnh' opt "$@"; do
|
||||||
case "$opt" in
|
case "$opt" in
|
||||||
h)
|
h)
|
||||||
command cat <<\END
|
command cat <<\END
|
||||||
Usage: install [-s KERNEL] [-m ARCH] [-d DIR] [-f|-n] [-- CMD [ARG]...]
|
Usage: install [-s KERNEL] [-m ARCH] [-d DIR] [-p CMD] [-e ERRFD] [-f|-n] [-- CMD [ARG]...]
|
||||||
|
|
||||||
If positional arguments are specified, call this on success:
|
If positional arguments are specified, call this on success:
|
||||||
|
|
||||||
|
|
@ -35,6 +41,8 @@ Options:
|
||||||
-s KERNEL use this instead of lowercase `uname -s`
|
-s KERNEL use this instead of lowercase `uname -s`
|
||||||
-m ARCH use this instead of lowercase `uname -m`
|
-m ARCH use this instead of lowercase `uname -m`
|
||||||
-d DIR use this instead of `dirname "$0"`
|
-d DIR use this instead of `dirname "$0"`
|
||||||
|
-p CMD eval this every second while downloading gitstatusd
|
||||||
|
-e ERRFD write error messages to this file descriptor
|
||||||
-f download gitstatusd even if there is one locally
|
-f download gitstatusd even if there is one locally
|
||||||
-n do not download gitstatusd (fail instead)
|
-n do not download gitstatusd (fail instead)
|
||||||
END
|
END
|
||||||
|
|
@ -65,6 +73,28 @@ END
|
||||||
fi
|
fi
|
||||||
gitstatus_dir="$OPTARG"
|
gitstatus_dir="$OPTARG"
|
||||||
;;
|
;;
|
||||||
|
p)
|
||||||
|
if [ -n "$dl_status" ]; then
|
||||||
|
>&2 echo "[gitstatus] error: duplicate option: -$opt"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
if [ -z "$OPTARG" ]; then
|
||||||
|
>&2 echo "[error] incorrect value of -$opt: $OPTARG"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
dl_status="$OPTARG"
|
||||||
|
;;
|
||||||
|
e)
|
||||||
|
if [ -n "$e" ]; then
|
||||||
|
>&2 echo "[gitstatus] error: duplicate option: -$opt"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
if [ -z "$OPTARG" ]; then
|
||||||
|
>&2 echo "[error] incorrect value of -$opt: $OPTARG"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
e="$OPTARG"
|
||||||
|
;;
|
||||||
m)
|
m)
|
||||||
if [ -n "$uname_m" ]; then
|
if [ -n "$uname_m" ]; then
|
||||||
>&2 echo "[gitstatus] error: duplicate option: -$opt"
|
>&2 echo "[gitstatus] error: duplicate option: -$opt"
|
||||||
|
|
@ -95,6 +125,7 @@ END
|
||||||
|
|
||||||
shift "$((OPTIND - 1))"
|
shift "$((OPTIND - 1))"
|
||||||
|
|
||||||
|
: "${e:=2}"
|
||||||
: "${gitstatus_dir:=$argv1}"
|
: "${gitstatus_dir:=$argv1}"
|
||||||
|
|
||||||
if [ -n "$no_check" -a -n "$no_install" ]; then
|
if [ -n "$no_check" -a -n "$no_install" ]; then
|
||||||
|
|
@ -119,14 +150,8 @@ END
|
||||||
>&2 echo "[gitstatus] error: GITSTATUS_DAEMON is not absolute path: $daemon"
|
>&2 echo "[gitstatus] error: GITSTATUS_DAEMON is not absolute path: $daemon"
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
if [ -z "$daemon" ]; then
|
if [ -z "$daemon" -a -e "$gitstatus_dir"/usrbin/gitstatusd ]; then
|
||||||
daemon="$gitstatus_dir"/usrbin/gitstatusd
|
daemon="$gitstatus_dir"/usrbin/gitstatusd
|
||||||
if [ ! -e "$daemon" ]; then
|
|
||||||
daemon="$daemon"-"$uname_s"-"$uname_m"
|
|
||||||
if [ ! -e "$daemon" ]; then
|
|
||||||
daemon=
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
if [ -n "$daemon" ]; then
|
if [ -n "$daemon" ]; then
|
||||||
local gitstatus_version= libgit2_version=
|
local gitstatus_version= libgit2_version=
|
||||||
|
|
@ -138,7 +163,8 @@ END
|
||||||
>&2 echo "[gitstatus] internal error: empty gitstatus_version in build.info"
|
>&2 echo "[gitstatus] internal error: empty gitstatus_version in build.info"
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
[ $# = 0 ] || "$@" "$daemon" "$gitstatus_version" 0
|
local version="$gitstatus_version"
|
||||||
|
_gitstatus_install_daemon_found 0 "$@"
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
@ -147,10 +173,14 @@ END
|
||||||
line="${line###*}"
|
line="${line###*}"
|
||||||
[ -n "$line" ] || continue
|
[ -n "$line" ] || continue
|
||||||
|
|
||||||
local uname_s_glob= uname_m_glob= file= version=
|
local uname_s_glob= uname_m_glob= file= version= sha256=
|
||||||
eval "$line" || return
|
eval "$line" || return
|
||||||
|
|
||||||
if [ -z "$uname_s_glob" -o -z "$uname_m_glob" -o -z "$file" -o -z "$version" ]; then
|
if [ -z "$uname_s_glob" -o \
|
||||||
|
-z "$uname_m_glob" -o \
|
||||||
|
-z "$file" -o \
|
||||||
|
-z "$version" -o \
|
||||||
|
-z "$sha256" ]; then
|
||||||
>&2 echo "[gitstatus] internal error: invalid install.info line: $line"
|
>&2 echo "[gitstatus] internal error: invalid install.info line: $line"
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
@ -168,23 +198,13 @@ END
|
||||||
|
|
||||||
if [ -z "$no_check" ]; then
|
if [ -z "$no_check" ]; then
|
||||||
# Check if a suitable gitstatusd already exists.
|
# Check if a suitable gitstatusd already exists.
|
||||||
local daemon="$cache_dir"/"$file"
|
local daemon="$gitstatus_dir"/usrbin/"$file"
|
||||||
if [ -e "$daemon" ]; then
|
if [ ! -e "$daemon" ]; then
|
||||||
[ $# = 0 ] || "$@" "$daemon" "$version" 0
|
daemon="$cache_dir"/"$file"
|
||||||
return
|
[ -e "$daemon" ] || daemon=
|
||||||
fi
|
fi
|
||||||
daemon="$daemon"-"$uname_s"-"$uname_m"
|
if [ -n "$daemon" ]; then
|
||||||
if [ -e "$daemon" ]; then
|
_gitstatus_install_daemon_found 0 "$@"
|
||||||
local gitstatus_version= libgit2_version=
|
|
||||||
if ! . "$gitstatus_dir"/build.info; then
|
|
||||||
>&2 echo "[gitstatus] internal error: failed to source build.info"
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
if [ -z "$gitstatus_version" ]; then
|
|
||||||
>&2 echo "[gitstatus] internal error: empty gitstatus_version in build.info"
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
[ $# = 0 ] || "$@" "$daemon" "$gitstatus_version" 0
|
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
@ -202,63 +222,250 @@ END
|
||||||
>&2 echo "[gitstatus] error: GITSTATUS_CACHE_DIR is not absolute: $cache_dir"
|
>&2 echo "[gitstatus] error: GITSTATUS_CACHE_DIR is not absolute: $cache_dir"
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
[ -d "$cache_dir" ] || mkdir -p -- "$cache_dir" || return
|
if [ ! -d "$cache_dir" ] && ! mkdir -p -- "$cache_dir" || [ ! -w "$cache_dir" ]; then
|
||||||
|
local dir="$cache_dir"
|
||||||
|
while true; do
|
||||||
|
if [ -e "$dir" ]; then
|
||||||
|
if [ ! -d "$dir" ]; then
|
||||||
|
>&"$e" printf 'Not a directory: \033[4;31m%s\033[0m\n' "$dir"
|
||||||
|
>&"$e" printf '\n'
|
||||||
|
>&"$e" printf 'Delete it, then restart your shell.\n'
|
||||||
|
elif [ ! -w "$dir" ]; then
|
||||||
|
>&"$e" printf 'Directory is not writable: \033[4;31m%s\033[0m\n' "$dir"
|
||||||
|
>&"$e" printf '\n'
|
||||||
|
>&"$e" printf 'Make it writable, then restart your shell.\n'
|
||||||
|
fi
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
if [ "$dir" = / ] || [ "$dir" = . ]; then
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
dir="$(dirname -- "$dir")"
|
||||||
|
done
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
local url="https://github.com/romkatv/gitstatus/releases/download/$version/$file.tar.gz"
|
if [ -n "${TMPDIR-}" -a '(' '(' -d "${TMPDIR-}" -a -w "${TMPDIR-}" ')' -o '!' '(' -d /tmp -a -w /tmp ')' ')' ]; then
|
||||||
local archive="$cache_dir"/"$file".tmp.$$.tar.gz
|
local tmp="$TMPDIR"
|
||||||
if command -v curl >/dev/null 2>&1; then
|
|
||||||
if ! err="$(command curl -fsSLo "$archive" -- "$url" 2>&1)"; then
|
|
||||||
>&2 echo "[gitstatus] error: failed to download gitstatusd: $url"
|
|
||||||
>&2 printf "%s" "$err"
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
elif command -v wget >/dev/null 2>&1; then
|
|
||||||
if ! err="$(command wget -O "$archive" -- "$url" 2>&1)"; then
|
|
||||||
>&2 echo "[gitstatus] error: failed to download gitstatusd: $url"
|
|
||||||
>&2 printf "%s" "$err"
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
else
|
else
|
||||||
>&2 echo "[gitstatus] error: please install curl or wget"
|
local tmp=/tmp
|
||||||
|
fi
|
||||||
|
if ! command -v mktemp >/dev/null 2>&1 ||
|
||||||
|
! tmpdir="$(command mktemp -d "$tmp"/gitstatus-install.XXXXXXXXXX)"; then
|
||||||
|
tmpdir="$tmp/gitstatus-install.tmp.$$"
|
||||||
|
if ! mkdir -p -- "$tmpdir"; then
|
||||||
|
if [ "$tmp" = /tmp ]; then
|
||||||
|
local label='directory'
|
||||||
|
else
|
||||||
|
local label='directory (\033[1mTMPDIR\033[m)'
|
||||||
|
fi
|
||||||
|
if [ ! -e "$tmp" ]; then
|
||||||
|
>&"$e" printf 'Temporary '"$label"' does not exist: \033[4;31m%s\033[0m\n' "$tmp"
|
||||||
|
>&"$e" printf '\n'
|
||||||
|
>&"$e" printf 'Create it, then restart your shell.\n'
|
||||||
|
elif [ ! -d "$tmp" ]; then
|
||||||
|
>&"$e" printf 'Not a '"$label"': \033[4;31m%s\033[0m\n' "$tmp"
|
||||||
|
>&"$e" printf '\n'
|
||||||
|
>&"$e" printf 'Make it a directory, then restart your shell.\n'
|
||||||
|
elif [ ! -w "$tmp" ]; then
|
||||||
|
>&"$e" printf 'Temporary '"$label"' is not writable: \033[4;31m%s\033[0m\n' "$tmp"
|
||||||
|
>&"$e" printf '\n'
|
||||||
|
>&"$e" printf 'Make it writable, then restart your shell.\n'
|
||||||
|
fi
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if ! command -v curl >/dev/null 2>&1 && ! command -v wget >/dev/null 2>&1; then
|
||||||
|
>&"$e" printf 'Please install \033[32mcurl\033[0m or \033[32mwget\033[0m, then restart your shell.\n'
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
(
|
(
|
||||||
if [ -n "${ZSH_VERSION:-}" ]; then
|
run_cmd() {
|
||||||
builtin cd -q -- "$cache_dir" || return
|
command -v "$1" >/dev/null 2>/dev/null || return 127
|
||||||
else
|
local trapped= pid die ret
|
||||||
cd -- "$cache_dir" || return
|
trap 'trapped=1' $sig
|
||||||
fi
|
# The only reason for suppressing stderr is that `curl -f` cannot be silenced:
|
||||||
|
# `-s` doesn't work despite what the docs say.
|
||||||
local old=
|
command "$@" 2>/dev/null &
|
||||||
if [ -e "$daemon" ]; then
|
ret="$?"
|
||||||
local i=1
|
|
||||||
while :; do
|
|
||||||
old="$daemon"."$i"
|
|
||||||
[ -e "$old" ] || break
|
|
||||||
i="$((i+1))"
|
|
||||||
done
|
|
||||||
command mv -f -- "$daemon" "$old" || return
|
|
||||||
fi
|
|
||||||
|
|
||||||
command tar -xzf "$archive"
|
|
||||||
local ret=$?
|
|
||||||
command rm -f -- "$archive"
|
|
||||||
if [ -n "$old" ]; then
|
|
||||||
if [ "$ret" = 0 ]; then
|
if [ "$ret" = 0 ]; then
|
||||||
command rm -f -- "$old" 2>/dev/null
|
pid="$!"
|
||||||
else
|
die="trap - $sig; kill -- $pid 2>/dev/null; wait -- $pid 2>/dev/null; exit 1"
|
||||||
command mv -f -- "$old" "$daemon"
|
trap "$die" $sig
|
||||||
|
[ -z "$trapped" ] || eval "$die"
|
||||||
|
wait -- "$pid" 2>/dev/null
|
||||||
|
ret="$?"
|
||||||
fi
|
fi
|
||||||
fi
|
trap - $sig
|
||||||
exit "$ret"
|
[ -z "$trapped" ] || exit
|
||||||
) || return
|
return "$ret"
|
||||||
|
}
|
||||||
|
|
||||||
[ $# = 0 ] || "$@" "$daemon" "$version" 1
|
check_sha256() {
|
||||||
|
local data_file="$tmpdir"/"$1".tar.gz
|
||||||
|
local hash_file="$tmpdir"/"$1".tar.gz.sha256
|
||||||
|
local hash=
|
||||||
|
{
|
||||||
|
command -v shasum >/dev/null 2>/dev/null &&
|
||||||
|
run_cmd shasum -b -a 256 -- "$data_file" >"$hash_file" </dev/null &&
|
||||||
|
IFS= read -r hash <"$hash_file" &&
|
||||||
|
hash="${hash%% *}" &&
|
||||||
|
[ ${#hash} -eq 64 ]
|
||||||
|
} || {
|
||||||
|
command -v sha256sum >/dev/null 2>/dev/null &&
|
||||||
|
run_cmd sha256sum -b -- "$data_file" >"$hash_file" </dev/null &&
|
||||||
|
IFS= read -r hash <"$hash_file" &&
|
||||||
|
hash="${hash%% *}" &&
|
||||||
|
[ ${#hash} -eq 64 ]
|
||||||
|
} || {
|
||||||
|
# Note: sha256 can be from hashalot. It's incompatible.
|
||||||
|
# Thankfully, it produces shorter output.
|
||||||
|
command -v sha256 >/dev/null 2>/dev/null &&
|
||||||
|
run_cmd sha256 -- "$data_file" >"$hash_file" </dev/null &&
|
||||||
|
IFS= read -r hash <"$hash_file" &&
|
||||||
|
hash="${hash##* }" &&
|
||||||
|
[ ${#hash} -eq 64 ]
|
||||||
|
} || {
|
||||||
|
hash=
|
||||||
|
}
|
||||||
|
[ "$1" = 1 -a -z "$hash" -o "$hash" = "$sha256" ]
|
||||||
|
}
|
||||||
|
|
||||||
|
local url1="https://github.com/romkatv/gitstatus/releases/download/$version/$file.tar.gz"
|
||||||
|
local url2="https://gitee.com/romkatv/gitstatus/raw/release-$version/release/$file.tar.gz"
|
||||||
|
local sig='INT QUIT TERM ILL PIPE'
|
||||||
|
|
||||||
|
fetch() {
|
||||||
|
if [ "$1" != 1 ] && command -v sleep >/dev/null 2>/dev/null; then
|
||||||
|
if ! run_cmd sleep "$1"; then
|
||||||
|
echo -n >"$tmpdir"/"$1".status
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
local cmd part url ret
|
||||||
|
for cmd in 'curl -kfsSL' 'wget -qO-' 'curl -q -kfsSL' 'wget --no-config -qO-'; do
|
||||||
|
part=0
|
||||||
|
while true; do
|
||||||
|
if [ "$part" = 2 ]; then
|
||||||
|
ret=1
|
||||||
|
break
|
||||||
|
elif [ "$part" = 0 ]; then
|
||||||
|
url="$2"
|
||||||
|
else
|
||||||
|
url="$2"."$part"
|
||||||
|
fi
|
||||||
|
run_cmd $cmd -- "$url" >>"$tmpdir"/"$1".tar.gz
|
||||||
|
ret="$?"
|
||||||
|
[ "$ret" = 0 ] || break
|
||||||
|
check_sha256 "$1" && break
|
||||||
|
part=$((part+1))
|
||||||
|
done
|
||||||
|
[ "$ret" = 0 ] && break
|
||||||
|
run_cmd rm -f -- "$tmpdir"/"$1".tar.gz && continue
|
||||||
|
ret="$?"
|
||||||
|
break
|
||||||
|
done
|
||||||
|
echo -n >"$tmpdir"/"$1".status
|
||||||
|
return "$ret"
|
||||||
|
}
|
||||||
|
|
||||||
|
local trapped=
|
||||||
|
trap 'trapped=1' $sig
|
||||||
|
fetch 1 "$url1" &
|
||||||
|
local pid1="$!"
|
||||||
|
fetch 2 "$url2" &
|
||||||
|
local pid2="$!"
|
||||||
|
|
||||||
|
local die="trap - $sig; kill -- $pid1 $pid2 2>/dev/null; wait -- $pid1 $pid2 2>/dev/null; exit 1"
|
||||||
|
trap "$die" $sig
|
||||||
|
[ -z "$trapped" ] || eval "$die"
|
||||||
|
|
||||||
|
local n=
|
||||||
|
while true; do
|
||||||
|
[ -z "$dl_status" ] || eval "$dl_status" || eval "$die"
|
||||||
|
if command -v sleep >/dev/null 2>/dev/null; then
|
||||||
|
command sleep 1
|
||||||
|
elif command -v true >/dev/null 2>/dev/null; then
|
||||||
|
command true
|
||||||
|
fi
|
||||||
|
if [ -n "$pid1" -a -e "$tmpdir"/1.status ]; then
|
||||||
|
wait -- "$pid1" 2>/dev/null
|
||||||
|
local ret="$?"
|
||||||
|
pid1=
|
||||||
|
if [ "$ret" = 0 ]; then
|
||||||
|
if [ -n "$pid2" ]; then
|
||||||
|
kill -- "$pid2" 2>/dev/null
|
||||||
|
wait -- "$pid2" 2>/dev/null
|
||||||
|
fi
|
||||||
|
n=1
|
||||||
|
break
|
||||||
|
elif [ -z "$pid2" ]; then
|
||||||
|
break
|
||||||
|
else
|
||||||
|
die="trap - $sig; kill -- $pid2 2>/dev/null; wait -- $pid2 2>/dev/null; exit 1"
|
||||||
|
trap "$die" $sig
|
||||||
|
fi
|
||||||
|
elif [ -n "$pid2" -a -e "$tmpdir"/2.status ]; then
|
||||||
|
wait -- "$pid2" 2>/dev/null
|
||||||
|
local ret="$?"
|
||||||
|
pid2=
|
||||||
|
if [ "$ret" = 0 ]; then
|
||||||
|
if [ -n "$pid1" ]; then
|
||||||
|
kill -- "$pid1" 2>/dev/null
|
||||||
|
wait -- "$pid1" 2>/dev/null
|
||||||
|
fi
|
||||||
|
n=2
|
||||||
|
break
|
||||||
|
elif [ -z "$pid1" ]; then
|
||||||
|
break
|
||||||
|
else
|
||||||
|
die="trap - $sig; kill -- $pid1 2>/dev/null; wait -- $pid1 2>/dev/null; exit 1"
|
||||||
|
trap "$die" $sig
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
trap - $sig
|
||||||
|
|
||||||
|
if [ -z "$n" ]; then
|
||||||
|
>&"$e" printf 'Failed to download \033[32m%s\033[0m from any mirror:\n' "$file"
|
||||||
|
>&"$e" printf '\n'
|
||||||
|
>&"$e" printf ' 1. \033[4m%s\033[0m\n' "$url1"
|
||||||
|
>&"$e" printf ' 2. \033[4m%s\033[0m\n' "$url2"
|
||||||
|
>&"$e" printf '\n'
|
||||||
|
>&"$e" printf 'Check your internet connection, then restart your shell.\n'
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
command tar -C "$tmpdir" -xzf "$tmpdir"/"$n".tar.gz || exit
|
||||||
|
|
||||||
|
local tmpfile
|
||||||
|
if ! command -v mktemp >/dev/null 2>&1 ||
|
||||||
|
! tmpfile="$(command mktemp "$cache_dir"/gitstatusd.XXXXXXXXXX)"; then
|
||||||
|
tmpfile="$cache_dir"/gitstatusd.tmp.$$
|
||||||
|
fi
|
||||||
|
|
||||||
|
command mv -f -- "$tmpdir"/"$file" "$tmpfile" || exit
|
||||||
|
command mv -f -- "$tmpfile" "$cache_dir"/"$file" && exit
|
||||||
|
command rm -f -- "$cache_dir"/"$file"
|
||||||
|
command mv -f -- "$tmpfile" "$cache_dir"/"$file" && exit
|
||||||
|
command rm -f -- "$tmpfile"
|
||||||
|
exit 1
|
||||||
|
)
|
||||||
|
|
||||||
|
local ret="$?"
|
||||||
|
command rm -rf -- "$tmpdir"
|
||||||
|
[ "$ret" = 0 ] || return
|
||||||
|
|
||||||
|
_gitstatus_install_daemon_found 1 "$@"
|
||||||
return
|
return
|
||||||
done <"$gitstatus_dir"/install.info
|
done <"$gitstatus_dir"/install.info
|
||||||
|
|
||||||
>&2 echo "[gitstatus] error: no gitstatusd found for $uname_s $uname_m"
|
>&"$e" printf 'There is no prebuilt \033[32mgitstatusd\033[0m for \033[1m%s\033[0m.\n' "$uname_s $uname_m"
|
||||||
|
>&"$e" printf '\n'
|
||||||
|
>&"$e" printf 'See: \033[4mhttps://github.com/romkatv/gitstatus#compiling\033[0m\n'
|
||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,24 +1,34 @@
|
||||||
|
# 3
|
||||||
|
#
|
||||||
# This file is used by ./install and indirectly by shell bindings.
|
# This file is used by ./install and indirectly by shell bindings.
|
||||||
|
#
|
||||||
|
# The first line is read by powerlevel10k instant prompt. It must
|
||||||
|
# be updated whenever the content of this file changes. The actual
|
||||||
|
# value doesn't matter as long as it's unique. Consecutive integers
|
||||||
|
# work fine.
|
||||||
|
|
||||||
# Official gitstatusd binaries.
|
# Official gitstatusd binaries.
|
||||||
uname_s_glob="cygwin_nt-10.0"; uname_m_glob="i686"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.0.0";
|
uname_s_glob="cygwin_nt-10.0"; uname_m_glob="i686"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.5.4"; sha256="5a8a809dcebdb6aa9b47d37e086c0485424a9d9c136770eec3c26cedf5bb75e3";
|
||||||
uname_s_glob="cygwin_nt-10.0"; uname_m_glob="x86_64"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.0.0";
|
uname_s_glob="cygwin_nt-10.0"; uname_m_glob="x86_64"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.5.1"; sha256="c84cade0d6b86e04c27a6055f45851f6b46d6b88ba58772f7ca8ef4d295c800f";
|
||||||
uname_s_glob="darwin"; uname_m_glob="x86_64"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.0.0";
|
uname_s_glob="darwin"; uname_m_glob="arm64"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.5.4"; sha256="eae979e990ca37c56ee39fadd0c3f392cbbd0c6bdfb9a603010be60d9e48910a";
|
||||||
uname_s_glob="freebsd"; uname_m_glob="amd64"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.0.0";
|
uname_s_glob="darwin"; uname_m_glob="x86_64"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.5.4"; sha256="9fd3913ec1b6b856ab6e08a99a2343f0e8e809eb6b62ca4b0963163656c668e6";
|
||||||
uname_s_glob="linux"; uname_m_glob="aarch64"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.0.0";
|
uname_s_glob="freebsd"; uname_m_glob="amd64"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.5.4"; sha256="8e57ad642251e5acfa430aed82cd4ffe103db0bfadae4a15ccaf462c455d0442";
|
||||||
uname_s_glob="linux"; uname_m_glob="armv6l"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.0.0";
|
uname_s_glob="linux"; uname_m_glob="aarch64"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.5.4"; sha256="32b57eb28bf6d80b280e4020a0045184f8ca897b20b570c12948aa6838673225";
|
||||||
uname_s_glob="linux"; uname_m_glob="armv7l"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.0.0";
|
uname_s_glob="linux"; uname_m_glob="armv6l"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.5.1"; sha256="4bf5a0d0a082f544a48536ad3675930d5d2cc6a8cf906710045e0788f51192b3";
|
||||||
uname_s_glob="linux"; uname_m_glob="i686"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.0.0";
|
uname_s_glob="linux"; uname_m_glob="armv7l"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.5.1"; sha256="2b9deb29f86c8209114b71b94fc2e1ed936a1658808a1bee46f4a82fd6a1f8cc";
|
||||||
uname_s_glob="linux"; uname_m_glob="x86_64"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.0.0";
|
uname_s_glob="linux"; uname_m_glob="armv8l"; file="gitstatusd-${uname_s}-aarch64"; version="v1.5.4"; sha256="32b57eb28bf6d80b280e4020a0045184f8ca897b20b570c12948aa6838673225";
|
||||||
uname_s_glob="msys_nt-10.0"; uname_m_glob="i686"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.0.0";
|
uname_s_glob="linux"; uname_m_glob="i686"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.5.4"; sha256="56d55e2e9a202d3072fa612d8fa1faa61243ffc86418a7fa64c2c9d9a82e0f64";
|
||||||
uname_s_glob="msys_nt-10.0"; uname_m_glob="x86_64"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.0.0";
|
uname_s_glob="linux"; uname_m_glob="ppc64le"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.5.4"; sha256="1afd072c8c26ef6ec2d9ac11cef96c84cd6f10e859665a6ffcfb6112c758547e";
|
||||||
|
uname_s_glob="linux"; uname_m_glob="x86_64"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.5.4"; sha256="9633816e7832109e530c9e2532b11a1edae08136d63aa7e40246c0339b7db304";
|
||||||
|
uname_s_glob="msys_nt-10.0"; uname_m_glob="i686"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.5.1"; sha256="7f9b849fc52e7a95b9b933e25121ad5ae990a1871aad6616922ad7bcf1eebf20";
|
||||||
|
uname_s_glob="msys_nt-10.0"; uname_m_glob="x86_64"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.5.1"; sha256="5d3c626b5ee564dbc13ddba89752dc58b0efe925b26dbd8b2304849d9ba01732";
|
||||||
|
|
||||||
# Fallbacks to official gitstatusd binaries.
|
# Fallbacks to official gitstatusd binaries.
|
||||||
uname_s_glob="cygwin_nt-*"; uname_m_glob="i686"; file="gitstatusd-cygwin_nt-10.0-${uname_m}"; version="v1.0.0";
|
uname_s_glob="cygwin_nt-*"; uname_m_glob="i686"; file="gitstatusd-cygwin_nt-10.0-${uname_m}"; version="v1.5.2"; sha256="5a8a809dcebdb6aa9b47d37e086c0485424a9d9c136770eec3c26cedf5bb75e3";
|
||||||
uname_s_glob="cygwin_nt-*"; uname_m_glob="x86_64"; file="gitstatusd-cygwin_nt-10.0-${uname_m}"; version="v1.0.0";
|
uname_s_glob="cygwin_nt-*"; uname_m_glob="x86_64"; file="gitstatusd-cygwin_nt-10.0-${uname_m}"; version="v1.5.1"; sha256="c84cade0d6b86e04c27a6055f45851f6b46d6b88ba58772f7ca8ef4d295c800f";
|
||||||
uname_s_glob="mingw32_nt-*"; uname_m_glob="i686"; file="gitstatusd-msys_nt-10.0-${uname_m}"; version="v1.0.0";
|
uname_s_glob="mingw32_nt-*"; uname_m_glob="i686"; file="gitstatusd-msys_nt-10.0-${uname_m}"; version="v1.5.1"; sha256="7f9b849fc52e7a95b9b933e25121ad5ae990a1871aad6616922ad7bcf1eebf20";
|
||||||
uname_s_glob="mingw32_nt-*"; uname_m_glob="x86_64"; file="gitstatusd-msys_nt-10.0-${uname_m}"; version="v1.0.0";
|
uname_s_glob="mingw32_nt-*"; uname_m_glob="x86_64"; file="gitstatusd-msys_nt-10.0-${uname_m}"; version="v1.5.1"; sha256="5d3c626b5ee564dbc13ddba89752dc58b0efe925b26dbd8b2304849d9ba01732";
|
||||||
uname_s_glob="mingw64_nt-*"; uname_m_glob="i686"; file="gitstatusd-msys_nt-10.0-${uname_m}"; version="v1.0.0";
|
uname_s_glob="mingw64_nt-*"; uname_m_glob="i686"; file="gitstatusd-msys_nt-10.0-${uname_m}"; version="v1.5.1"; sha256="7f9b849fc52e7a95b9b933e25121ad5ae990a1871aad6616922ad7bcf1eebf20";
|
||||||
uname_s_glob="mingw64_nt-*"; uname_m_glob="x86_64"; file="gitstatusd-msys_nt-10.0-${uname_m}"; version="v1.0.0";
|
uname_s_glob="mingw64_nt-*"; uname_m_glob="x86_64"; file="gitstatusd-msys_nt-10.0-${uname_m}"; version="v1.5.1"; sha256="5d3c626b5ee564dbc13ddba89752dc58b0efe925b26dbd8b2304849d9ba01732";
|
||||||
uname_s_glob="msys_nt-*"; uname_m_glob="i686"; file="gitstatusd-msys_nt-10.0-${uname_m}"; version="v1.0.0";
|
uname_s_glob="msys_nt-*"; uname_m_glob="i686"; file="gitstatusd-msys_nt-10.0-${uname_m}"; version="v1.5.1"; sha256="7f9b849fc52e7a95b9b933e25121ad5ae990a1871aad6616922ad7bcf1eebf20";
|
||||||
uname_s_glob="msys_nt-*"; uname_m_glob="x86_64"; file="gitstatusd-msys_nt-10.0-${uname_m}"; version="v1.0.0";
|
uname_s_glob="msys_nt-*"; uname_m_glob="x86_64"; file="gitstatusd-msys_nt-10.0-${uname_m}"; version="v1.5.1"; sha256="5d3c626b5ee564dbc13ddba89752dc58b0efe925b26dbd8b2304849d9ba01732";
|
||||||
|
|
|
||||||
112
gitstatus/mbuild
112
gitstatus/mbuild
|
|
@ -5,7 +5,7 @@
|
||||||
# Usage: mbuild [-b git-ref] [kernel-arch]...
|
# Usage: mbuild [-b git-ref] [kernel-arch]...
|
||||||
#
|
#
|
||||||
# Builds a bunch of gitstatusd-* binaries. Without arguments builds binaries
|
# Builds a bunch of gitstatusd-* binaries. Without arguments builds binaries
|
||||||
# for all platforms. git-ref defaults to src.
|
# for all platforms. git-ref defaults to master.
|
||||||
#
|
#
|
||||||
# Before using this script you need to set up build servers and list them
|
# Before using this script you need to set up build servers and list them
|
||||||
# in ~/.ssh/config. There should be a Host entry for every value of `assets`
|
# in ~/.ssh/config. There should be a Host entry for every value of `assets`
|
||||||
|
|
@ -46,7 +46,7 @@
|
||||||
# ps> C:\msys64\autorebase.bat
|
# ps> C:\msys64\autorebase.bat
|
||||||
# - Install 64-bit and 32-bit cygwin: https://cygwin.com/install.html.
|
# - Install 64-bit and 32-bit cygwin: https://cygwin.com/install.html.
|
||||||
# - Choose to install 32-bit to c:/cygwin32 instead of the default c:/cygwin.
|
# - Choose to install 32-bit to c:/cygwin32 instead of the default c:/cygwin.
|
||||||
# - Select these packages: binutils, cmake, gcc-core, gcc-g++, git, make, wget.
|
# - Select these packages: binutils, cmake, gcc-core, gcc-g++, git, make, perl, wget.
|
||||||
#
|
#
|
||||||
# IMPORTANT: Install msys2 and cygwin one at a time.
|
# IMPORTANT: Install msys2 and cygwin one at a time.
|
||||||
#
|
#
|
||||||
|
|
@ -94,9 +94,7 @@
|
||||||
setopt no_unset extended_glob pipe_fail prompt_percent typeset_silent \
|
setopt no_unset extended_glob pipe_fail prompt_percent typeset_silent \
|
||||||
no_prompt_subst no_prompt_bang pushd_silent warn_create_global
|
no_prompt_subst no_prompt_bang pushd_silent warn_create_global
|
||||||
|
|
||||||
autoload -Uz is-at-least
|
if [[ $ZSH_VERSION != (5.<1->*|<6->.*) || $ZSH_VERSION == 5.4(|.*) ]]; then
|
||||||
|
|
||||||
if ! is-at-least 5.1 || [[ $ZSH_VERSION == 5.4.* ]]; then
|
|
||||||
print -ru2 -- "[error] unsupported zsh version: $ZSH_VERSION"
|
print -ru2 -- "[error] unsupported zsh version: $ZSH_VERSION"
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
@ -111,12 +109,14 @@ local -rA assets=(
|
||||||
cygwin_nt-10.0-x86_64 build-windows-x86_64
|
cygwin_nt-10.0-x86_64 build-windows-x86_64
|
||||||
msys_nt-10.0-i686 build-windows-x86_64
|
msys_nt-10.0-i686 build-windows-x86_64
|
||||||
msys_nt-10.0-x86_64 build-windows-x86_64
|
msys_nt-10.0-x86_64 build-windows-x86_64
|
||||||
|
darwin-arm64 build-macos-arm64
|
||||||
darwin-x86_64 build-macos-x86_64
|
darwin-x86_64 build-macos-x86_64
|
||||||
freebsd-amd64 build-freebsd-amd64
|
freebsd-amd64 build-freebsd-amd64
|
||||||
linux-aarch64 build-linux-aarch64
|
linux-aarch64 build-linux-aarch64
|
||||||
linux-armv6l build-linux-armv7l
|
linux-armv6l build-linux-armv7l
|
||||||
linux-armv7l build-linux-armv7l
|
linux-armv7l build-linux-armv7l
|
||||||
linux-i686 build-linux-x86_64
|
linux-i686 build-linux-x86_64
|
||||||
|
linux-ppc64le build-linux-ppc64le
|
||||||
linux-x86_64 build-linux-x86_64
|
linux-x86_64 build-linux-x86_64
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -137,7 +137,7 @@ function usage() {
|
||||||
print -r -- 'usage: mbuild [-b REF] [KERNEL-ARCH]...'
|
print -r -- 'usage: mbuild [-b REF] [KERNEL-ARCH]...'
|
||||||
}
|
}
|
||||||
|
|
||||||
local OPTARG opt git_ref=src
|
local OPTARG opt git_ref=master
|
||||||
local -i OPTIND
|
local -i OPTIND
|
||||||
while getopts ":b:h" opt; do
|
while getopts ":b:h" opt; do
|
||||||
case $opt in
|
case $opt in
|
||||||
|
|
@ -151,7 +151,7 @@ done
|
||||||
|
|
||||||
shift $((OPTIND - 1))
|
shift $((OPTIND - 1))
|
||||||
|
|
||||||
(( $# )) || set -- ${(k)assets}
|
(( $# )) || set -- ${(ko)assets}
|
||||||
set -- ${(u)@}
|
set -- ${(u)@}
|
||||||
|
|
||||||
local platform
|
local platform
|
||||||
|
|
@ -180,14 +180,16 @@ local build='
|
||||||
function build-unix() {
|
function build-unix() {
|
||||||
local intro flags=(-sw)
|
local intro flags=(-sw)
|
||||||
case $2 in
|
case $2 in
|
||||||
darwin-*) intro='PATH="/usr/local/bin:$PATH"';;
|
linux-ppc64le) ;;
|
||||||
linux-*) flags+=(-d docker);;
|
linux-*) flags+=(-d docker);;
|
||||||
|
darwin-arm64) intro='PATH="/opt/homebrew/bin:$PATH"';;
|
||||||
|
darwin-*) intro='PATH="/usr/local/bin:$PATH"';;
|
||||||
esac
|
esac
|
||||||
ssh $1 -- /bin/sh -uex <<<"
|
ssh $1 -- /bin/sh -uex <<<"
|
||||||
$intro
|
$intro
|
||||||
cd /tmp
|
cd /tmp
|
||||||
$build ${2##*-} ${(j: :)${(@q)flags}}"
|
$build ${2##*-} ${(j: :)${(@q)flags}}"
|
||||||
scp $1:/tmp/gitstatus/usrbin/gitstatusd-$2 $binaries/
|
scp $1:/tmp/gitstatus/usrbin/gitstatusd $binaries/gitstatusd-$2
|
||||||
}
|
}
|
||||||
|
|
||||||
function build-windows() {
|
function build-windows() {
|
||||||
|
|
@ -200,15 +202,23 @@ function build-windows() {
|
||||||
|
|
||||||
local tmp env bin intro flags=(-w)
|
local tmp env bin intro flags=(-w)
|
||||||
case $2 in
|
case $2 in
|
||||||
msys_nt-10.0-i686) bin='msys32/usr/bin';|
|
|
||||||
msys_nt-10.0-x86_64) bin='msys64/usr/bin';|
|
|
||||||
cygwin_nt-10.0-i686) bin='cygwin32/bin' ;|
|
cygwin_nt-10.0-i686) bin='cygwin32/bin' ;|
|
||||||
cygwin_nt-10.0-x86_64) bin='cygwin64/bin' ;|
|
cygwin_nt-10.0-x86_64) bin='cygwin64/bin' ;|
|
||||||
|
msys_nt-10.0-i686) bin='msys32/usr/bin';|
|
||||||
|
msys_nt-10.0-x86_64) bin='msys64/usr/bin';|
|
||||||
|
cygwin_nt-10.0-*)
|
||||||
|
tmp='/cygdrive/c/tmp'
|
||||||
|
;|
|
||||||
msys_nt-10.0-*)
|
msys_nt-10.0-*)
|
||||||
flags+=(-s)
|
|
||||||
tmp='/c/tmp'
|
tmp='/c/tmp'
|
||||||
env='MSYSTEM=MSYS'
|
env='MSYSTEM=MSYS'
|
||||||
|
# TODO: fix this (some errors about PGP keys).
|
||||||
|
# flags+=(-s)
|
||||||
|
# intro='pacman -S --needed --noconfirm git; '
|
||||||
|
intro+='PATH="$PATH:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl"'
|
||||||
while true; do
|
while true; do
|
||||||
|
# TODO: run autorebase only when getting an error that can be fixed by autorebasing.
|
||||||
|
break
|
||||||
local out
|
local out
|
||||||
out="$(ssh $1 cmd.exe "$c/${bin%%/*}/autorebase.bat" 2>&1)"
|
out="$(ssh $1 cmd.exe "$c/${bin%%/*}/autorebase.bat" 2>&1)"
|
||||||
[[ $out == *"The following DLLs couldn't be rebased"* ]] || break
|
[[ $out == *"The following DLLs couldn't be rebased"* ]] || break
|
||||||
|
|
@ -219,6 +229,8 @@ function build-windows() {
|
||||||
done
|
done
|
||||||
() {
|
() {
|
||||||
while true; do
|
while true; do
|
||||||
|
# TODO: fix this (some errors about PGP keys).
|
||||||
|
break
|
||||||
local -i fd
|
local -i fd
|
||||||
exec {fd}< <(
|
exec {fd}< <(
|
||||||
ssh $1 $c/$bin/env.exe $env c:/$bin/bash.exe -l 2>&1 <<<"
|
ssh $1 $c/$bin/env.exe $env c:/$bin/bash.exe -l 2>&1 <<<"
|
||||||
|
|
@ -229,7 +241,7 @@ function build-windows() {
|
||||||
while true; do
|
while true; do
|
||||||
IFS= read -u $fd -r line || return 0
|
IFS= read -u $fd -r line || return 0
|
||||||
if [[ $line == *"warning: terminate MSYS2"* ]]; then
|
if [[ $line == *"warning: terminate MSYS2"* ]]; then
|
||||||
# At this point the machine is hosed. Rogue process with corrupted name
|
# At this point the machine is hosed. A rogue process with a corrupted name
|
||||||
# is eating all CPU. The top SSH connection won't terminate on its own.
|
# is eating all CPU. The top SSH connection won't terminate on its own.
|
||||||
ssh $1 powershell.exe <<<'Restart-Computer -Force' || true
|
ssh $1 powershell.exe <<<'Restart-Computer -Force' || true
|
||||||
sleep 30
|
sleep 30
|
||||||
|
|
@ -243,12 +255,7 @@ function build-windows() {
|
||||||
}
|
}
|
||||||
done
|
done
|
||||||
} "$@"
|
} "$@"
|
||||||
intro='pacman -Syu --noconfirm; pacman -S --needed --noconfirm git; '
|
;|
|
||||||
intro+='PATH="$PATH:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl"'
|
|
||||||
;;
|
|
||||||
cygwin_nt-10.0-*)
|
|
||||||
tmp='/cygdrive/c/tmp'
|
|
||||||
;;
|
|
||||||
esac
|
esac
|
||||||
|
|
||||||
ssh $1 $c/$bin/env.exe $env c:/$bin/bash.exe -l <<<"
|
ssh $1 $c/$bin/env.exe $env c:/$bin/bash.exe -l <<<"
|
||||||
|
|
@ -258,20 +265,56 @@ function build-windows() {
|
||||||
cd -- $tmp
|
cd -- $tmp
|
||||||
$build ${2##*-} ${(j: :)${(@q)flags}}
|
$build ${2##*-} ${(j: :)${(@q)flags}}
|
||||||
exit"
|
exit"
|
||||||
scp $1:$c/tmp/gitstatus/usrbin/gitstatusd-$2 $binaries/
|
scp $1:$c/tmp/gitstatus/usrbin/gitstatusd $binaries/gitstatusd-$2
|
||||||
chmod +x $binaries/gitstatusd-$2
|
chmod +x $binaries/gitstatusd-$2
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if [[ -r /proc/version && "$(</proc/version)" == *Microsoft* ]]; then
|
||||||
|
() {
|
||||||
|
(( $# )) || return 0
|
||||||
|
print -ru2 -- "WARNING: lock files exist: $@"
|
||||||
|
(( $# )) && rm -- $@
|
||||||
|
} $locks/*(N)
|
||||||
|
|
||||||
|
function flock() {
|
||||||
|
local fd
|
||||||
|
sysopen -ro cloexec -u fd <(
|
||||||
|
exec </dev/null 2>/dev/null
|
||||||
|
(
|
||||||
|
trap '' TERM PIPE
|
||||||
|
local fd
|
||||||
|
while true; do
|
||||||
|
sysopen -wo create,excl -u fd -- $1 && break
|
||||||
|
sleep 1
|
||||||
|
done
|
||||||
|
exec {fd}>&-
|
||||||
|
while true; do
|
||||||
|
print || break
|
||||||
|
done
|
||||||
|
rm -- $1
|
||||||
|
) &!
|
||||||
|
)
|
||||||
|
local REPLY
|
||||||
|
IFS= read -ru $fd
|
||||||
|
}
|
||||||
|
else
|
||||||
|
function flock() {
|
||||||
|
: >>$1
|
||||||
|
zsystem flock $1
|
||||||
|
}
|
||||||
|
fi
|
||||||
|
|
||||||
function build() (
|
function build() (
|
||||||
setopt xtrace
|
setopt xtrace
|
||||||
local platform=$1
|
local platform=$1
|
||||||
local machine=$assets[$platform]
|
local machine=$assets[$platform]
|
||||||
print -n >>$locks/$machine
|
flock $locks/$machine
|
||||||
zsystem flock $locks/$machine
|
|
||||||
build-${protocol[(k)$platform]} $machine $platform
|
build-${protocol[(k)$platform]} $machine $platform
|
||||||
local tmp=gitstatusd-$platform.tmp.$$.tar.gz
|
local tmp=gitstatusd-$platform.tmp.$$.tar.gz
|
||||||
( cd -q -- $binaries; GZIP=-9 tar -czf $tmp gitstatusd-$platform )
|
( cd -q -- $binaries; tar --owner=0 --group=0 -I 'gzip -9' -cf $tmp gitstatusd-$platform )
|
||||||
mv -f -- $binaries/$tmp $binaries/gitstatusd-$platform.tar.gz
|
mv -f -- $binaries/$tmp $binaries/gitstatusd-$platform.tar.gz
|
||||||
|
# Make sure the last command is a built-in (important for flock).
|
||||||
|
:
|
||||||
)
|
)
|
||||||
|
|
||||||
function mbuild() {
|
function mbuild() {
|
||||||
|
|
@ -281,17 +324,24 @@ function mbuild() {
|
||||||
print -r -- "starting build for $platform on $assets[$platform] (pid $!)"
|
print -r -- "starting build for $platform on $assets[$platform] (pid $!)"
|
||||||
pids+=($platform $!)
|
pids+=($platform $!)
|
||||||
done
|
done
|
||||||
|
local failed=()
|
||||||
for platform pid in $pids; do
|
for platform pid in $pids; do
|
||||||
print -rn -- "$platform => "
|
print -rn -- "$platform => "
|
||||||
if wait $pid; then
|
if wait $pid; then
|
||||||
print -r -- "ok"
|
print -r -- "ok"
|
||||||
else
|
else
|
||||||
print -r -- "error $?"
|
print -r -- "error"
|
||||||
print -r -- "---------------------"
|
failed+=$platform
|
||||||
>&2 cat $logs/$platform
|
|
||||||
return 1
|
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
(( $#failed )) || return 0
|
||||||
|
print
|
||||||
|
print -r -- "Error logs:"
|
||||||
|
print
|
||||||
|
for platform in $failed; do
|
||||||
|
print -r -- " $platform => $logs/$platform"
|
||||||
|
done
|
||||||
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
# Copied from https://github.com/romkatv/run-process-tree.
|
# Copied from https://github.com/romkatv/run-process-tree.
|
||||||
|
|
@ -349,4 +399,8 @@ function run-process-tree() {
|
||||||
}
|
}
|
||||||
|
|
||||||
mkdir -p -- $logs $locks $binaries
|
mkdir -p -- $logs $locks $binaries
|
||||||
run-process-tree mbuild $@
|
|
||||||
|
() {
|
||||||
|
run-process-tree mbuild $@
|
||||||
|
exit
|
||||||
|
} "$@"
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@ namespace gitstatus {
|
||||||
//
|
//
|
||||||
// // Donates a block to the arena. When the time comes, it'll be freed with
|
// // Donates a block to the arena. When the time comes, it'll be freed with
|
||||||
// // free(p, size, userdata).
|
// // free(p, size, userdata).
|
||||||
// void Donate(void* p, size_t size, void* userdata, void(*free)(void*, void*));
|
// void Donate(void* p, size_t size, void* userdata, void(*free)(void*, size_t, void*));
|
||||||
class Arena {
|
class Arena {
|
||||||
public:
|
public:
|
||||||
struct Options {
|
struct Options {
|
||||||
|
|
@ -62,7 +62,7 @@ class Arena {
|
||||||
//
|
//
|
||||||
// void* userdata;
|
// void* userdata;
|
||||||
// void (*alloc)(size_t size, size_t alignment, void* userdata);
|
// void (*alloc)(size_t size, size_t alignment, void* userdata);
|
||||||
// void (*free)(size_t size, void* userdata);
|
// void (*free)(void* p, size_t size, void* userdata);
|
||||||
};
|
};
|
||||||
|
|
||||||
// Requires: opt.min_block_size <= opt.max_block_size.
|
// Requires: opt.min_block_size <= opt.max_block_size.
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
|
|
||||||
// The argument must be an expression convertible to bool.
|
// The argument must be an expression convertible to bool.
|
||||||
// Does nothing if the expression evalutes to true. Otherwise
|
// Does nothing if the expression evaluates to true. Otherwise
|
||||||
// it's equivalent to LOG(FATAL).
|
// it's equivalent to LOG(FATAL).
|
||||||
#define CHECK(cond...) \
|
#define CHECK(cond...) \
|
||||||
static_cast<void>(0), (!!(cond)) ? static_cast<void>(0) : LOG(FATAL) << #cond << ": "
|
static_cast<void>(0), (!!(cond)) ? static_cast<void>(0) : LOG(FATAL) << #cond << ": "
|
||||||
|
|
|
||||||
|
|
@ -106,32 +106,34 @@ bool ListDir(int dir_fd, Arena& arena, std::vector<char*>& entries, bool precomp
|
||||||
};
|
};
|
||||||
|
|
||||||
constexpr size_t kBufSize = 8 << 10;
|
constexpr size_t kBufSize = 8 << 10;
|
||||||
entries.clear();
|
const size_t orig_size = entries.size();
|
||||||
|
|
||||||
while (true) {
|
while (true) {
|
||||||
char* buf = static_cast<char*>(arena.Allocate(kBufSize, alignof(linux_dirent64)));
|
char* buf = static_cast<char*>(arena.Allocate(kBufSize, alignof(linux_dirent64)));
|
||||||
// Save 256 bytes for the rainy day.
|
// Save 256 bytes for the rainy day.
|
||||||
int n = syscall(SYS_getdents64, dir_fd, buf, kBufSize - 256);
|
int n = syscall(SYS_getdents64, dir_fd, buf, kBufSize - 256);
|
||||||
if (n < 0) {
|
if (n < 0) {
|
||||||
entries.clear();
|
entries.resize(orig_size);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (n == 0) break;
|
|
||||||
for (int pos = 0; pos < n;) {
|
for (int pos = 0; pos < n;) {
|
||||||
auto* ent = reinterpret_cast<linux_dirent64*>(buf + pos);
|
auto* ent = reinterpret_cast<linux_dirent64*>(buf + pos);
|
||||||
if (!Dots(ent->d_name)) entries.push_back(ent->d_name);
|
if (!Dots(ent->d_name)) entries.push_back(ent->d_name);
|
||||||
pos += ent->d_reclen;
|
pos += ent->d_reclen;
|
||||||
// It's tempting to bail here if n + sizeof(linux_dirent64) + 512 <= n. After all, there
|
|
||||||
// was enough space for another entry but SYS_getdents64 didn't write it, so this must be
|
|
||||||
// the end of the directory listing, right? Unfortuatenly, no. SYS_getdents64 is finicky.
|
|
||||||
// It sometimes writes a partial list of entries even if the full list would fit.
|
|
||||||
}
|
}
|
||||||
|
if (n == 0) break;
|
||||||
|
// The following optimization relies on SYS_getdents64 always returning as many
|
||||||
|
// entries as would fit. This is not guaranteed by the specification and I don't
|
||||||
|
// know if this is true in practice. The optimization has no measurable effect on
|
||||||
|
// gitstatus performance, so it's turned off.
|
||||||
|
//
|
||||||
|
// if (n + sizeof(linux_dirent64) + 512 <= kBufSize) break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (case_sensitive) {
|
if (case_sensitive) {
|
||||||
SortEntries<true>(entries.data(), entries.data() + entries.size());
|
SortEntries<true>(entries.data() + orig_size, entries.data() + entries.size());
|
||||||
} else {
|
} else {
|
||||||
SortEntries<false>(entries.data(), entries.data() + entries.size());
|
SortEntries<false>(entries.data() + orig_size, entries.data() + entries.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
@ -209,23 +211,24 @@ char* DirenvConvert(Arena& arena, struct dirent& ent, bool do_convert) {
|
||||||
|
|
||||||
bool ListDir(int dir_fd, Arena& arena, std::vector<char*>& entries, bool precompose_unicode,
|
bool ListDir(int dir_fd, Arena& arena, std::vector<char*>& entries, bool precompose_unicode,
|
||||||
bool case_sensitive) {
|
bool case_sensitive) {
|
||||||
VERIFY((dir_fd = dup(dir_fd)) >= 0);
|
const size_t orig_size = entries.size();
|
||||||
|
dir_fd = dup(dir_fd);
|
||||||
|
if (dir_fd < 0) return false;
|
||||||
DIR* dir = fdopendir(dir_fd);
|
DIR* dir = fdopendir(dir_fd);
|
||||||
if (!dir) {
|
if (!dir) {
|
||||||
CHECK(!close(dir_fd)) << Errno();
|
CHECK(!close(dir_fd)) << Errno();
|
||||||
return -1;
|
return false;
|
||||||
}
|
}
|
||||||
ON_SCOPE_EXIT(&) { CHECK(!closedir(dir)) << Errno(); };
|
ON_SCOPE_EXIT(&) { CHECK(!closedir(dir)) << Errno(); };
|
||||||
entries.clear();
|
|
||||||
while (struct dirent* ent = (errno = 0, readdir(dir))) {
|
while (struct dirent* ent = (errno = 0, readdir(dir))) {
|
||||||
if (Dots(ent->d_name)) continue;
|
if (Dots(ent->d_name)) continue;
|
||||||
entries.push_back(DirenvConvert(arena, *ent, precompose_unicode));
|
entries.push_back(DirenvConvert(arena, *ent, precompose_unicode));
|
||||||
}
|
}
|
||||||
if (errno) {
|
if (errno) {
|
||||||
entries.clear();
|
entries.resize(orig_size);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
StrSort(entries.data(), entries.data() + entries.size(), case_sensitive);
|
StrSort(entries.data() + orig_size, entries.data() + entries.size(), case_sensitive);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -25,11 +25,11 @@
|
||||||
|
|
||||||
namespace gitstatus {
|
namespace gitstatus {
|
||||||
|
|
||||||
// On error, clears entries and returns false. Does not throw.
|
// On error, leaves entries unchanged and returns false. Does not throw.
|
||||||
//
|
//
|
||||||
// On success, fills entries with the names of files from the specified directory and returns true.
|
// On success, appends names of files from the specified directory to entries and returns true.
|
||||||
// Every entry is a null-terminated string. At -1 offset is its d_type. All elements point into the
|
// Every appended entry is a null-terminated string. At -1 offset is its d_type. All elements
|
||||||
// arena. They are sorted either by strcmp or strcasecmp depending on case_sensitive.
|
// point into the arena. They are sorted either by strcmp or strcasecmp depending on case_sensitive.
|
||||||
//
|
//
|
||||||
// Does not close dir_fd.
|
// Does not close dir_fd.
|
||||||
//
|
//
|
||||||
|
|
|
||||||
|
|
@ -239,4 +239,12 @@ PushRemotePtr GetPushRemote(git_repository* repo, const git_reference* local) {
|
||||||
return PushRemotePtr(res.release());
|
return PushRemotePtr(res.release());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CommitMessage GetCommitMessage(git_repository* repo, const git_oid& id) {
|
||||||
|
git_commit* commit;
|
||||||
|
VERIFY(!git_commit_lookup(&commit, repo, &id)) << GitError();
|
||||||
|
ON_SCOPE_EXIT(=) { git_commit_free(commit); };
|
||||||
|
return {.encoding = git_commit_message_encoding(commit) ?: "",
|
||||||
|
.summary = git_commit_summary(commit) ?: ""};
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace gitstatus
|
} // namespace gitstatus
|
||||||
|
|
|
||||||
|
|
@ -48,6 +48,15 @@ git_reference* Head(git_repository* repo);
|
||||||
// Returns the name of the local branch, or an empty string.
|
// Returns the name of the local branch, or an empty string.
|
||||||
const char* LocalBranchName(const git_reference* ref);
|
const char* LocalBranchName(const git_reference* ref);
|
||||||
|
|
||||||
|
struct CommitMessage {
|
||||||
|
// Can be empty, meaning "UTF-8".
|
||||||
|
std::string encoding;
|
||||||
|
// The first paragraph of the commit's message as a one-liner.
|
||||||
|
std::string summary;
|
||||||
|
};
|
||||||
|
|
||||||
|
CommitMessage GetCommitMessage(git_repository* repo, const git_oid& id);
|
||||||
|
|
||||||
struct Remote {
|
struct Remote {
|
||||||
// Tip of the remote branch.
|
// Tip of the remote branch.
|
||||||
git_reference* ref;
|
git_reference* ref;
|
||||||
|
|
|
||||||
|
|
@ -41,6 +41,10 @@ namespace {
|
||||||
|
|
||||||
using namespace std::string_literals;
|
using namespace std::string_literals;
|
||||||
|
|
||||||
|
void Truncate(std::string& s, size_t max_len) {
|
||||||
|
if (s.size() > max_len) s.resize(max_len);
|
||||||
|
}
|
||||||
|
|
||||||
void ProcessRequest(const Options& opts, RepoCache& cache, Request req) {
|
void ProcessRequest(const Options& opts, RepoCache& cache, Request req) {
|
||||||
Timer timer;
|
Timer timer;
|
||||||
ON_SCOPE_EXIT(&) { timer.Report("request"); };
|
ON_SCOPE_EXIT(&) { timer.Report("request"); };
|
||||||
|
|
@ -118,7 +122,7 @@ void ProcessRequest(const Options& opts, RepoCache& cache, Request req) {
|
||||||
resp.Print(stats.num_untracked);
|
resp.Print(stats.num_untracked);
|
||||||
|
|
||||||
if (remote && remote->ref) {
|
if (remote && remote->ref) {
|
||||||
const char* ref = git_reference_shorthand(remote->ref);
|
const char* ref = git_reference_name(remote->ref);
|
||||||
// Number of commits we are ahead of upstream. Non-negative integer.
|
// Number of commits we are ahead of upstream. Non-negative integer.
|
||||||
resp.Print(CountRange(repo->repo(), ref + "..HEAD"s));
|
resp.Print(CountRange(repo->repo(), ref + "..HEAD"s));
|
||||||
// Number of commits we are behind upstream. Non-negative integer.
|
// Number of commits we are behind upstream. Non-negative integer.
|
||||||
|
|
@ -152,7 +156,7 @@ void ProcessRequest(const Options& opts, RepoCache& cache, Request req) {
|
||||||
resp.Print(push_remote ? push_remote->url : "");
|
resp.Print(push_remote ? push_remote->url : "");
|
||||||
|
|
||||||
if (push_remote && push_remote->ref) {
|
if (push_remote && push_remote->ref) {
|
||||||
const char* ref = git_reference_shorthand(push_remote->ref);
|
const char* ref = git_reference_name(push_remote->ref);
|
||||||
// Number of commits we are ahead of push remote. Non-negative integer.
|
// Number of commits we are ahead of push remote. Non-negative integer.
|
||||||
resp.Print(CountRange(repo->repo(), ref + "..HEAD"s));
|
resp.Print(CountRange(repo->repo(), ref + "..HEAD"s));
|
||||||
// Number of commits we are behind upstream. Non-negative integer.
|
// Number of commits we are behind upstream. Non-negative integer.
|
||||||
|
|
@ -167,6 +171,11 @@ void ProcessRequest(const Options& opts, RepoCache& cache, Request req) {
|
||||||
// The number of files in the index with assume-unchanged bit set.
|
// The number of files in the index with assume-unchanged bit set.
|
||||||
resp.Print(stats.num_assume_unchanged);
|
resp.Print(stats.num_assume_unchanged);
|
||||||
|
|
||||||
|
CommitMessage msg = head_target ? GetCommitMessage(repo->repo(), *head_target) : CommitMessage();
|
||||||
|
Truncate(msg.summary, opts.max_commit_summary_length);
|
||||||
|
resp.Print(msg.encoding);
|
||||||
|
resp.Print(msg.summary);
|
||||||
|
|
||||||
resp.Dump("with git status");
|
resp.Dump("with git status");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -242,6 +242,7 @@ std::vector<const char*> ScanDirs(git_index* index, int root_fd, IndexDir* const
|
||||||
dir.st = st;
|
dir.st = st;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
entries.clear();
|
||||||
arena.Reuse();
|
arena.Reuse();
|
||||||
if (!ListDir(*dir_fd, arena, entries, caps.precompose_unicode, caps.case_sensitive)) {
|
if (!ListDir(*dir_fd, arena, entries, caps.precompose_unicode, caps.case_sensitive)) {
|
||||||
AddUnmached("");
|
AddUnmached("");
|
||||||
|
|
|
||||||
|
|
@ -53,9 +53,15 @@ long ParseInt(const char* s) {
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
size_t ParseSizeT(const char* s) {
|
||||||
|
static_assert(sizeof(long) <= sizeof(size_t), "");
|
||||||
|
long res = ParseLong(s);
|
||||||
|
return res >= 0 ? res : -1;
|
||||||
|
}
|
||||||
|
|
||||||
void PrintUsage() {
|
void PrintUsage() {
|
||||||
std::cout << "Usage: gitstatusd [OPTION]...\n"
|
std::cout << "Usage: gitstatusd [OPTION]...\n"
|
||||||
<< "Print machine-readable status of the git repos for directores in stdin.\n"
|
<< "Print machine-readable status of the git repos for directories in stdin.\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< "OPTIONS\n"
|
<< "OPTIONS\n"
|
||||||
<< " -l, --lock-fd=NUM [default=-1]\n"
|
<< " -l, --lock-fd=NUM [default=-1]\n"
|
||||||
|
|
@ -72,7 +78,7 @@ void PrintUsage() {
|
||||||
<< " maximum performance.\n"
|
<< " maximum performance.\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< " -v, --log-level=STR [default=INFO]\n"
|
<< " -v, --log-level=STR [default=INFO]\n"
|
||||||
<< " Don't write entires to log whose log level is below this. Log levels in\n"
|
<< " Don't write entries to log whose log level is below this. Log levels in\n"
|
||||||
<< " increasing order: DEBUG, INFO, WARN, ERROR, FATAL.\n"
|
<< " increasing order: DEBUG, INFO, WARN, ERROR, FATAL.\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< " -r, --repo-ttl-seconds=NUM [default=3600]\n"
|
<< " -r, --repo-ttl-seconds=NUM [default=3600]\n"
|
||||||
|
|
@ -81,12 +87,18 @@ void PrintUsage() {
|
||||||
<< " repo that's been closed is much slower than for a repo that hasn't been.\n"
|
<< " repo that's been closed is much slower than for a repo that hasn't been.\n"
|
||||||
<< " Negative value means infinity.\n"
|
<< " Negative value means infinity.\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
|
<< " -z, --max-commit-summary-length=NUM [default=256]\n"
|
||||||
|
<< " Truncate commit summary if it's longer than this many bytes.\n"
|
||||||
|
<< "\n"
|
||||||
<< " -s, --max-num-staged=NUM [default=1]\n"
|
<< " -s, --max-num-staged=NUM [default=1]\n"
|
||||||
<< " Report at most this many staged changes; negative value means infinity.\n"
|
<< " Report at most this many staged changes; negative value means infinity.\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< " -u, --max-num-unstaged=NUM [default=1]\n"
|
<< " -u, --max-num-unstaged=NUM [default=1]\n"
|
||||||
<< " Report at most this many unstaged changes; negative value means infinity.\n"
|
<< " Report at most this many unstaged changes; negative value means infinity.\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
|
<< " -c, --max-num-conflicted=NUM [default=1]\n"
|
||||||
|
<< " Report at most this many conflicted changes; negative value means infinity.\n"
|
||||||
|
<< "\n"
|
||||||
<< " -d, --max-num-untracked=NUM [default=1]\n"
|
<< " -d, --max-num-untracked=NUM [default=1]\n"
|
||||||
<< " Report at most this many untracked files; negative value means infinity.\n"
|
<< " Report at most this many untracked files; negative value means infinity.\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
|
|
@ -129,7 +141,7 @@ void PrintUsage() {
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< " 1. Request ID. Any string. Can be empty.\n"
|
<< " 1. Request ID. Any string. Can be empty.\n"
|
||||||
<< " 2. Path to the directory for which git stats are being requested.\n"
|
<< " 2. Path to the directory for which git stats are being requested.\n"
|
||||||
<< " If the first character is ':', it is removed and the remaning path\n"
|
<< " If the first character is ':', it is removed and the remaining path\n"
|
||||||
<< " is treated as GIT_DIR.\n"
|
<< " is treated as GIT_DIR.\n"
|
||||||
<< " 3. (Optional) '1' to disable computation of anything that requires reading\n"
|
<< " 3. (Optional) '1' to disable computation of anything that requires reading\n"
|
||||||
<< " git index; '0' for the default behavior of computing everything.\n"
|
<< " git index; '0' for the default behavior of computing everything.\n"
|
||||||
|
|
@ -170,6 +182,8 @@ void PrintUsage() {
|
||||||
<< " 25. Number of commits the current branch is behind push remote.\n"
|
<< " 25. Number of commits the current branch is behind push remote.\n"
|
||||||
<< " 26. Number of files in the index with skip-worktree bit set.\n"
|
<< " 26. Number of files in the index with skip-worktree bit set.\n"
|
||||||
<< " 27. Number of files in the index with assume-unchanged bit set.\n"
|
<< " 27. Number of files in the index with assume-unchanged bit set.\n"
|
||||||
|
<< " 28. Encoding of the HEAD's commit message. Empty value means UTF-8.\n"
|
||||||
|
<< " 29. The first paragraph of the HEAD's commit message as one line.\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< "Note: Renamed files are reported as deleted plus new.\n"
|
<< "Note: Renamed files are reported as deleted plus new.\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
|
|
@ -212,6 +226,8 @@ void PrintUsage() {
|
||||||
<< " '0'\n"
|
<< " '0'\n"
|
||||||
<< " '0'\n"
|
<< " '0'\n"
|
||||||
<< " '0'\n"
|
<< " '0'\n"
|
||||||
|
<< " ''\n"
|
||||||
|
<< " 'add a build server for darwin-arm64'\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< "EXIT STATUS\n"
|
<< "EXIT STATUS\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
|
|
@ -239,12 +255,13 @@ const char* Version() {
|
||||||
Options ParseOptions(int argc, char** argv) {
|
Options ParseOptions(int argc, char** argv) {
|
||||||
const struct option opts[] = {{"help", no_argument, nullptr, 'h'},
|
const struct option opts[] = {{"help", no_argument, nullptr, 'h'},
|
||||||
{"version", no_argument, nullptr, 'V'},
|
{"version", no_argument, nullptr, 'V'},
|
||||||
{"version-glob", no_argument, nullptr, 'G'},
|
{"version-glob", required_argument, nullptr, 'G'},
|
||||||
{"lock-fd", required_argument, nullptr, 'l'},
|
{"lock-fd", required_argument, nullptr, 'l'},
|
||||||
{"parent-pid", required_argument, nullptr, 'p'},
|
{"parent-pid", required_argument, nullptr, 'p'},
|
||||||
{"num-threads", required_argument, nullptr, 't'},
|
{"num-threads", required_argument, nullptr, 't'},
|
||||||
{"log-level", required_argument, nullptr, 'v'},
|
{"log-level", required_argument, nullptr, 'v'},
|
||||||
{"repo-ttl-seconds", required_argument, nullptr, 'r'},
|
{"repo-ttl-seconds", required_argument, nullptr, 'r'},
|
||||||
|
{"max-commit-summary-length", required_argument, nullptr, 'z'},
|
||||||
{"max-num-staged", required_argument, nullptr, 's'},
|
{"max-num-staged", required_argument, nullptr, 's'},
|
||||||
{"max-num-unstaged", required_argument, nullptr, 'u'},
|
{"max-num-unstaged", required_argument, nullptr, 'u'},
|
||||||
{"max-num-conflicted", required_argument, nullptr, 'c'},
|
{"max-num-conflicted", required_argument, nullptr, 'c'},
|
||||||
|
|
@ -257,7 +274,7 @@ Options ParseOptions(int argc, char** argv) {
|
||||||
{}};
|
{}};
|
||||||
Options res;
|
Options res;
|
||||||
while (true) {
|
while (true) {
|
||||||
switch (getopt_long(argc, argv, "hVG:l:p:t:v:r:s:u:c:d:m:eUWD", opts, nullptr)) {
|
switch (getopt_long(argc, argv, "hVG:l:p:t:v:r:z:s:u:c:d:m:eUWD", opts, nullptr)) {
|
||||||
case -1:
|
case -1:
|
||||||
if (optind != argc) {
|
if (optind != argc) {
|
||||||
std::cerr << "unexpected positional argument: " << argv[optind] << std::endl;
|
std::cerr << "unexpected positional argument: " << argv[optind] << std::endl;
|
||||||
|
|
@ -306,20 +323,23 @@ Options ParseOptions(int argc, char** argv) {
|
||||||
res.num_threads = n;
|
res.num_threads = n;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case 'z':
|
||||||
|
res.max_commit_summary_length = ParseSizeT(optarg);
|
||||||
|
break;
|
||||||
case 's':
|
case 's':
|
||||||
res.max_num_staged = ParseLong(optarg);
|
res.max_num_staged = ParseSizeT(optarg);
|
||||||
break;
|
break;
|
||||||
case 'u':
|
case 'u':
|
||||||
res.max_num_unstaged = ParseLong(optarg);
|
res.max_num_unstaged = ParseSizeT(optarg);
|
||||||
break;
|
break;
|
||||||
case 'c':
|
case 'c':
|
||||||
res.max_num_conflicted = ParseLong(optarg);
|
res.max_num_conflicted = ParseSizeT(optarg);
|
||||||
break;
|
break;
|
||||||
case 'd':
|
case 'd':
|
||||||
res.max_num_untracked = ParseLong(optarg);
|
res.max_num_untracked = ParseSizeT(optarg);
|
||||||
break;
|
break;
|
||||||
case 'm':
|
case 'm':
|
||||||
res.dirty_max_index_size = ParseLong(optarg);
|
res.dirty_max_index_size = ParseSizeT(optarg);
|
||||||
break;
|
break;
|
||||||
case 'e':
|
case 'e':
|
||||||
res.recurse_untracked_dirs = true;
|
res.recurse_untracked_dirs = true;
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,8 @@
|
||||||
namespace gitstatus {
|
namespace gitstatus {
|
||||||
|
|
||||||
struct Limits {
|
struct Limits {
|
||||||
|
// Truncate commit summary if it's longer than this many bytes.
|
||||||
|
size_t max_commit_summary_length = 256;
|
||||||
// Report at most this many staged changes.
|
// Report at most this many staged changes.
|
||||||
size_t max_num_staged = 1;
|
size_t max_num_staged = 1;
|
||||||
// Report at most this many unstaged changes.
|
// Report at most this many unstaged changes.
|
||||||
|
|
@ -60,7 +62,7 @@ struct Options : Limits {
|
||||||
// If non-negative, send signal 0 to the specified PID when not receiving any requests for one
|
// If non-negative, send signal 0 to the specified PID when not receiving any requests for one
|
||||||
// second; exit if signal sending fails.
|
// second; exit if signal sending fails.
|
||||||
int parent_pid = -1;
|
int parent_pid = -1;
|
||||||
// Don't write entires to log whose log level is below this. Log levels in increasing order:
|
// Don't write entries to log whose log level is below this. Log levels in increasing order:
|
||||||
// DEBUG, INFO, WARN, ERROR, FATAL.
|
// DEBUG, INFO, WARN, ERROR, FATAL.
|
||||||
LogLevel log_level = INFO;
|
LogLevel log_level = INFO;
|
||||||
// Close git repositories that haven't been used for this long. This is meant to release resources
|
// Close git repositories that haven't been used for this long. This is meant to release resources
|
||||||
|
|
|
||||||
|
|
@ -155,7 +155,7 @@ IndexStats Repo::GetIndexStats(const git_oid* head, git_config* cfg) {
|
||||||
VERIFY(!git_repository_index(&git_index_, repo_)) << GitError();
|
VERIFY(!git_repository_index(&git_index_, repo_)) << GitError();
|
||||||
// Query an attribute (doesn't matter which) to initialize repo's attribute
|
// Query an attribute (doesn't matter which) to initialize repo's attribute
|
||||||
// cache. It's a workaround for synchronization bugs (data races) in libgit2
|
// cache. It's a workaround for synchronization bugs (data races) in libgit2
|
||||||
// that result from lazy cache initialization without synchrnonization.
|
// that result from lazy cache initialization without synchronization.
|
||||||
// Thankfully, subsequent cache reads and writes are properly synchronized.
|
// Thankfully, subsequent cache reads and writes are properly synchronized.
|
||||||
const char* attr;
|
const char* attr;
|
||||||
VERIFY(!git_attr_get(&attr, repo_, 0, "x", "x")) << GitError();
|
VERIFY(!git_attr_get(&attr, repo_, 0, "x", "x")) << GitError();
|
||||||
|
|
|
||||||
|
|
@ -155,6 +155,8 @@ void TagDb::ReadLooseTags() {
|
||||||
int dir_fd = open(dirname.c_str(), O_RDONLY | O_DIRECTORY | O_CLOEXEC);
|
int dir_fd = open(dirname.c_str(), O_RDONLY | O_DIRECTORY | O_CLOEXEC);
|
||||||
if (dir_fd < 0) return;
|
if (dir_fd < 0) return;
|
||||||
ON_SCOPE_EXIT(&) { CHECK(!close(dir_fd)) << Errno(); };
|
ON_SCOPE_EXIT(&) { CHECK(!close(dir_fd)) << Errno(); };
|
||||||
|
// TODO: recursively traverse directories so that the file refs/tags/foo/bar gets interpreted
|
||||||
|
// as the tag foo/bar. See https://github.com/romkatv/gitstatus/issues/254.
|
||||||
(void)ListDir(dir_fd, loose_arena_, loose_tags_, /* precompose_unicode = */ false,
|
(void)ListDir(dir_fd, loose_arena_, loose_tags_, /* precompose_unicode = */ false,
|
||||||
/* case_sensitive = */ true);
|
/* case_sensitive = */ true);
|
||||||
}
|
}
|
||||||
|
|
@ -212,14 +214,30 @@ void TagDb::ParsePack() {
|
||||||
char* p = &pack_[0];
|
char* p = &pack_[0];
|
||||||
char* e = p + pack_.size();
|
char* e = p + pack_.size();
|
||||||
|
|
||||||
if (*p == '#') {
|
// Usually packed-refs starts with the following line:
|
||||||
char* eol = std::strchr(p, '\n');
|
//
|
||||||
if (!eol) return;
|
// # pack-refs with: peeled fully-peeled sorted
|
||||||
*eol = 0;
|
//
|
||||||
if (!std::strstr(p, " fully-peeled") || !std::strstr(p, " sorted")) return;
|
// However, some users can produce pack-refs without this line.
|
||||||
p = eol + 1;
|
// See https://github.com/romkatv/powerlevel10k/issues/1428.
|
||||||
|
// I don't know how they do it. Without the header line we cannot
|
||||||
|
// assume that refs are sorted, which isn't a big deal because we
|
||||||
|
// can just sort them. What's worse is that refs cannot be assumed
|
||||||
|
// to be fully-peeled. We don't want to peel them, so we just drop
|
||||||
|
// all tags.
|
||||||
|
if (*p != '#') {
|
||||||
|
LOG(WARN) << "packed-refs doesn't have a header. Won't resolve tags.";
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
char* eol = std::strchr(p, '\n');
|
||||||
|
if (!eol) return;
|
||||||
|
*eol = 0;
|
||||||
|
if (!std::strstr(p, " fully-peeled") || !std::strstr(p, " sorted")) {
|
||||||
|
LOG(WARN) << "packed-refs has unexpected header. Won't resolve tags.";
|
||||||
|
}
|
||||||
|
p = eol + 1;
|
||||||
|
|
||||||
name2id_.reserve(pack_.size() / 128);
|
name2id_.reserve(pack_.size() / 128);
|
||||||
id2name_.reserve(pack_.size() / 128);
|
id2name_.reserve(pack_.size() / 128);
|
||||||
|
|
||||||
|
|
@ -249,7 +267,10 @@ void TagDb::ParsePack() {
|
||||||
id2name_.push_back(tag);
|
id2name_.push_back(tag);
|
||||||
}
|
}
|
||||||
|
|
||||||
VERIFY(std::is_sorted(name2id_.begin(), name2id_.end(), ByName));
|
if (!std::is_sorted(name2id_.begin(), name2id_.end(), ByName)) {
|
||||||
|
// "sorted" in the header of packed-refs promises that this won't trigger.
|
||||||
|
std::sort(name2id_.begin(), name2id_.end(), ByName);
|
||||||
|
}
|
||||||
|
|
||||||
id2name_dirty_ = true;
|
id2name_dirty_ = true;
|
||||||
GlobalThreadPool()->Schedule([this] {
|
GlobalThreadPool()->Schedule([this] {
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,7 @@
|
||||||
typeset -gr __p9k_wizard_columns=51
|
# Fewer than 47 columns will probably work. Haven't tried it.
|
||||||
typeset -gr __p9k_wizard_lines=12
|
typeset -gr __p9k_wizard_columns=47
|
||||||
|
# The bottleneck is ask_tails with nerd fonts. Everything else works fine with 12 lines.
|
||||||
|
typeset -gr __p9k_wizard_lines=14
|
||||||
typeset -gr __p9k_zd=${ZDOTDIR:-$HOME}
|
typeset -gr __p9k_zd=${ZDOTDIR:-$HOME}
|
||||||
typeset -gr __p9k_zd_u=${${${(q)__p9k_zd}/#(#b)${(q)HOME}(|\/*)/'~'$match[1]}//\%/%%}
|
typeset -gr __p9k_zd_u=${${${(q)__p9k_zd}/#(#b)${(q)HOME}(|\/*)/'~'$match[1]}//\%/%%}
|
||||||
typeset -gr __p9k_zshrc=${${:-$__p9k_zd/.zshrc}:A}
|
typeset -gr __p9k_zshrc=${${:-$__p9k_zd/.zshrc}:A}
|
||||||
|
|
@ -16,13 +18,22 @@ function _p9k_can_configure() {
|
||||||
typeset -g __p9k_cfg_path=${__p9k_cfg_path_o:A}
|
typeset -g __p9k_cfg_path=${__p9k_cfg_path_o:A}
|
||||||
typeset -g __p9k_cfg_path_u=${${${(q)__p9k_cfg_path_o}/#(#b)${(q)HOME}(|\/*)/'~'$match[1]}//\%/%%}
|
typeset -g __p9k_cfg_path_u=${${${(q)__p9k_cfg_path_o}/#(#b)${(q)HOME}(|\/*)/'~'$match[1]}//\%/%%}
|
||||||
{
|
{
|
||||||
[[ -o multibyte ]] || { $0_error "multibyte option is not set"; return 1 }
|
|
||||||
[[ -e $__p9k_zd ]] || { $0_error "$__p9k_zd_u does not exist"; return 1 }
|
[[ -e $__p9k_zd ]] || { $0_error "$__p9k_zd_u does not exist"; return 1 }
|
||||||
[[ -d $__p9k_zd ]] || { $0_error "$__p9k_zd_u is not a directory"; return 1 }
|
[[ -d $__p9k_zd ]] || { $0_error "$__p9k_zd_u is not a directory"; return 1 }
|
||||||
[[ -w $__p9k_zd ]] || { $0_error "$__p9k_zd_u is not writable"; return 1 }
|
|
||||||
[[ ! -d $__p9k_cfg_path ]] || { $0_error "$__p9k_cfg_path_u is a directory"; return 1 }
|
[[ ! -d $__p9k_cfg_path ]] || { $0_error "$__p9k_cfg_path_u is a directory"; return 1 }
|
||||||
[[ ! -d $__p9k_zshrc ]] || { $0_error "$__p9k_zshrc_u is a directory"; return 1 }
|
[[ ! -d $__p9k_zshrc ]] || { $0_error "$__p9k_zshrc_u is a directory"; return 1 }
|
||||||
|
|
||||||
|
local dir=${__p9k_cfg_path:h}
|
||||||
|
while [[ ! -e $dir && $dir != ${dir:h} ]]; do dir=${dir:h}; done
|
||||||
|
if [[ ! -d $dir ]]; then
|
||||||
|
$0_error "cannot create $__p9k_cfg_path_u because ${dir//\%/%%} is not a directory"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
if [[ ! -w $dir ]]; then
|
||||||
|
$0_error "cannot create $__p9k_cfg_path_u because ${dir//\%/%%} is readonly"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
[[ ! -e $__p9k_cfg_path || -f $__p9k_cfg_path || -h $__p9k_cfg_path ]] || {
|
[[ ! -e $__p9k_cfg_path || -f $__p9k_cfg_path || -h $__p9k_cfg_path ]] || {
|
||||||
$0_error "$__p9k_cfg_path_u is a special file"
|
$0_error "$__p9k_cfg_path_u is a special file"
|
||||||
return 1
|
return 1
|
||||||
|
|
@ -44,10 +55,13 @@ function _p9k_can_configure() {
|
||||||
done
|
done
|
||||||
|
|
||||||
(( LINES >= __p9k_wizard_lines && COLUMNS >= __p9k_wizard_columns )) || {
|
(( LINES >= __p9k_wizard_lines && COLUMNS >= __p9k_wizard_columns )) || {
|
||||||
$0_error "terminal size too small; must be at least $__p9k_wizard_columns x $__p9k_wizard_lines"
|
$0_error "terminal size too small; must be at least $__p9k_wizard_columns columns by $__p9k_wizard_lines lines"
|
||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
[[ -t 0 && -t 1 ]] || { $0_error "no TTY"; return 2 }
|
[[ -t 0 && -t 1 ]] || {
|
||||||
|
$0_error "no TTY"
|
||||||
|
return 2
|
||||||
|
}
|
||||||
return 0
|
return 0
|
||||||
} always {
|
} always {
|
||||||
unfunction $0_error
|
unfunction $0_error
|
||||||
|
|
@ -59,11 +73,11 @@ function p9k_configure() {
|
||||||
_p9k_can_configure || return
|
_p9k_can_configure || return
|
||||||
(
|
(
|
||||||
set -- -f
|
set -- -f
|
||||||
source $__p9k_root_dir/internal/wizard.zsh
|
builtin source $__p9k_root_dir/internal/wizard.zsh
|
||||||
)
|
)
|
||||||
local ret=$?
|
local ret=$?
|
||||||
case $ret in
|
case $ret in
|
||||||
0) source $__p9k_cfg_path; _p9k__force_must_init=1;;
|
0) builtin source $__p9k_cfg_path; _p9k__force_must_init=1;;
|
||||||
69) return 0;;
|
69) return 0;;
|
||||||
*) return $ret;;
|
*) return $ret;;
|
||||||
esac
|
esac
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
typeset -gA icons
|
typeset -gA icons
|
||||||
|
|
||||||
function _p9k_init_icons() {
|
function _p9k_init_icons() {
|
||||||
|
[[ -n ${POWERLEVEL9K_MODE-} || ${langinfo[CODESET]} == (utf|UTF)(-|)8 ]] || local POWERLEVEL9K_MODE=ascii
|
||||||
[[ $_p9k__icon_mode == $POWERLEVEL9K_MODE/$POWERLEVEL9K_LEGACY_ICON_SPACING/$POWERLEVEL9K_ICON_PADDING ]] && return
|
[[ $_p9k__icon_mode == $POWERLEVEL9K_MODE/$POWERLEVEL9K_LEGACY_ICON_SPACING/$POWERLEVEL9K_ICON_PADDING ]] && return
|
||||||
typeset -g _p9k__icon_mode=$POWERLEVEL9K_MODE/$POWERLEVEL9K_LEGACY_ICON_SPACING/$POWERLEVEL9K_ICON_PADDING
|
typeset -g _p9k__icon_mode=$POWERLEVEL9K_MODE/$POWERLEVEL9K_LEGACY_ICON_SPACING/$POWERLEVEL9K_ICON_PADDING
|
||||||
|
|
||||||
|
|
@ -51,6 +52,7 @@ function _p9k_init_icons() {
|
||||||
LINUX_DEBIAN_ICON '\uE271'$s #
|
LINUX_DEBIAN_ICON '\uE271'$s #
|
||||||
LINUX_RASPBIAN_ICON '\uE271'$s #
|
LINUX_RASPBIAN_ICON '\uE271'$s #
|
||||||
LINUX_UBUNTU_ICON '\uE271'$s #
|
LINUX_UBUNTU_ICON '\uE271'$s #
|
||||||
|
LINUX_KALI_ICON '\uE271'$s #
|
||||||
LINUX_CENTOS_ICON '\uE271'$s #
|
LINUX_CENTOS_ICON '\uE271'$s #
|
||||||
LINUX_COREOS_ICON '\uE271'$s #
|
LINUX_COREOS_ICON '\uE271'$s #
|
||||||
LINUX_ELEMENTARY_ICON '\uE271'$s #
|
LINUX_ELEMENTARY_ICON '\uE271'$s #
|
||||||
|
|
@ -67,6 +69,14 @@ function _p9k_init_icons() {
|
||||||
LINUX_SABAYON_ICON '\uE271'$s #
|
LINUX_SABAYON_ICON '\uE271'$s #
|
||||||
LINUX_SLACKWARE_ICON '\uE271'$s #
|
LINUX_SLACKWARE_ICON '\uE271'$s #
|
||||||
LINUX_VOID_ICON '\uE271'$s #
|
LINUX_VOID_ICON '\uE271'$s #
|
||||||
|
LINUX_ARTIX_ICON '\uE271'$s #
|
||||||
|
LINUX_RHEL_ICON '\uE271'$s #
|
||||||
|
LINUX_AMZN_ICON '\uE271'$s #
|
||||||
|
LINUX_ENDEAVOUROS_ICON '\uE271'$s #
|
||||||
|
LINUX_ROCKY_ICON '\uE271'$s #
|
||||||
|
LINUX_ALMALINUX_ICON '\uE271'$s #
|
||||||
|
LINUX_GUIX_ICON '\uE271'$s #
|
||||||
|
LINUX_NEON_ICON '\uE271'$s #
|
||||||
SUNOS_ICON '\U1F31E'$q # 🌞
|
SUNOS_ICON '\U1F31E'$q # 🌞
|
||||||
HOME_ICON '\uE12C'$s #
|
HOME_ICON '\uE12C'$s #
|
||||||
HOME_SUB_ICON '\uE18D'$s #
|
HOME_SUB_ICON '\uE18D'$s #
|
||||||
|
|
@ -97,10 +107,23 @@ function _p9k_init_icons() {
|
||||||
VCS_GIT_GITHUB_ICON '\uE20E ' #
|
VCS_GIT_GITHUB_ICON '\uE20E ' #
|
||||||
VCS_GIT_BITBUCKET_ICON '\uE20E ' #
|
VCS_GIT_BITBUCKET_ICON '\uE20E ' #
|
||||||
VCS_GIT_GITLAB_ICON '\uE20E ' #
|
VCS_GIT_GITLAB_ICON '\uE20E ' #
|
||||||
|
VCS_GIT_AZURE_ICON '\uE20E ' #
|
||||||
|
VCS_GIT_ARCHLINUX_ICON '\uE20E ' #
|
||||||
|
VCS_GIT_CODEBERG_ICON '\uE20E ' #
|
||||||
|
VCS_GIT_DEBIAN_ICON '\uE20E ' #
|
||||||
|
VCS_GIT_FREEBSD_ICON '\uE20E ' #
|
||||||
|
VCS_GIT_FREEDESKTOP_ICON '\uE20E ' #
|
||||||
|
VCS_GIT_GNOME_ICON '\uE20E ' #
|
||||||
|
VCS_GIT_GNU_ICON '\uE20E ' #
|
||||||
|
VCS_GIT_KDE_ICON '\uE20E ' #
|
||||||
|
VCS_GIT_LINUX_ICON '\uE20E ' #
|
||||||
|
VCS_GIT_GITEA_ICON '\uE20E ' #
|
||||||
|
VCS_GIT_SOURCEHUT_ICON '\uE20E ' #
|
||||||
VCS_HG_ICON '\uE1C3 ' #
|
VCS_HG_ICON '\uE1C3 ' #
|
||||||
VCS_SVN_ICON 'svn'$q
|
VCS_SVN_ICON 'svn'$q
|
||||||
RUST_ICON 'R'
|
RUST_ICON 'R'
|
||||||
PYTHON_ICON '\uE63C'$s # (doesn't always work)
|
PYTHON_ICON '\uE63C'$s # (doesn't always work)
|
||||||
|
CHEZMOI_ICON '\uE12C'$s #
|
||||||
SWIFT_ICON 'Swift'
|
SWIFT_ICON 'Swift'
|
||||||
GO_ICON 'Go'
|
GO_ICON 'Go'
|
||||||
GOLANG_ICON 'Go'
|
GOLANG_ICON 'Go'
|
||||||
|
|
@ -117,6 +140,7 @@ function _p9k_init_icons() {
|
||||||
JAVA_ICON '\U2615' # ☕︎
|
JAVA_ICON '\U2615' # ☕︎
|
||||||
LARAVEL_ICON ''
|
LARAVEL_ICON ''
|
||||||
RANGER_ICON '\u2B50' # ⭐
|
RANGER_ICON '\u2B50' # ⭐
|
||||||
|
YAZI_ICON '\u2B50' # ⭐
|
||||||
MIDNIGHT_COMMANDER_ICON 'mc'
|
MIDNIGHT_COMMANDER_ICON 'mc'
|
||||||
VIM_ICON 'vim'
|
VIM_ICON 'vim'
|
||||||
TERRAFORM_ICON 'tf'
|
TERRAFORM_ICON 'tf'
|
||||||
|
|
@ -130,6 +154,8 @@ function _p9k_init_icons() {
|
||||||
LUA_ICON 'lua'
|
LUA_ICON 'lua'
|
||||||
PERL_ICON 'perl'
|
PERL_ICON 'perl'
|
||||||
NNN_ICON 'nnn'
|
NNN_ICON 'nnn'
|
||||||
|
LF_ICON 'lf'
|
||||||
|
XPLR_ICON 'xplr'
|
||||||
TIMEWARRIOR_ICON 'tw'
|
TIMEWARRIOR_ICON 'tw'
|
||||||
TASKWARRIOR_ICON 'task'
|
TASKWARRIOR_ICON 'task'
|
||||||
NIX_SHELL_ICON 'nix'
|
NIX_SHELL_ICON 'nix'
|
||||||
|
|
@ -140,6 +166,11 @@ function _p9k_init_icons() {
|
||||||
PHP_ICON 'php'
|
PHP_ICON 'php'
|
||||||
HASKELL_ICON 'hs'
|
HASKELL_ICON 'hs'
|
||||||
PACKAGE_ICON 'pkg'
|
PACKAGE_ICON 'pkg'
|
||||||
|
JULIA_ICON 'jl'
|
||||||
|
SCALA_ICON 'scala'
|
||||||
|
TOOLBOX_ICON '\u2B22' # ⬢
|
||||||
|
ARCH_ICON 'arch'
|
||||||
|
HISTORY_ICON 'hist'
|
||||||
)
|
)
|
||||||
;;
|
;;
|
||||||
'awesome-fontconfig')
|
'awesome-fontconfig')
|
||||||
|
|
@ -180,6 +211,7 @@ function _p9k_init_icons() {
|
||||||
LINUX_DEBIAN_ICON '\uF17C'$s #
|
LINUX_DEBIAN_ICON '\uF17C'$s #
|
||||||
LINUX_RASPBIAN_ICON '\uF17C'$s #
|
LINUX_RASPBIAN_ICON '\uF17C'$s #
|
||||||
LINUX_UBUNTU_ICON '\uF17C'$s #
|
LINUX_UBUNTU_ICON '\uF17C'$s #
|
||||||
|
LINUX_KALI_ICON '\uF17C'$s #
|
||||||
LINUX_CENTOS_ICON '\uF17C'$s #
|
LINUX_CENTOS_ICON '\uF17C'$s #
|
||||||
LINUX_COREOS_ICON '\uF17C'$s #
|
LINUX_COREOS_ICON '\uF17C'$s #
|
||||||
LINUX_ELEMENTARY_ICON '\uF17C'$s #
|
LINUX_ELEMENTARY_ICON '\uF17C'$s #
|
||||||
|
|
@ -196,6 +228,14 @@ function _p9k_init_icons() {
|
||||||
LINUX_SABAYON_ICON '\uF17C'$s #
|
LINUX_SABAYON_ICON '\uF17C'$s #
|
||||||
LINUX_SLACKWARE_ICON '\uF17C'$s #
|
LINUX_SLACKWARE_ICON '\uF17C'$s #
|
||||||
LINUX_VOID_ICON '\uF17C'$s #
|
LINUX_VOID_ICON '\uF17C'$s #
|
||||||
|
LINUX_ARTIX_ICON '\uF17C'$s #
|
||||||
|
LINUX_RHEL_ICON '\uF17C'$s #
|
||||||
|
LINUX_AMZN_ICON '\uF17C'$s #
|
||||||
|
LINUX_ENDEAVOUROS_ICON '\uF17C'$s #
|
||||||
|
LINUX_ROCKY_ICON '\uF17C'$s #
|
||||||
|
LINUX_ALMALINUX_ICON '\uF17C'$s #
|
||||||
|
LINUX_GUIX_ICON '\uF17C'$s #
|
||||||
|
LINUX_NEON_ICON '\uF17C'$s #
|
||||||
SUNOS_ICON '\uF185 ' #
|
SUNOS_ICON '\uF185 ' #
|
||||||
HOME_ICON '\uF015'$s #
|
HOME_ICON '\uF015'$s #
|
||||||
HOME_SUB_ICON '\uF07C'$s #
|
HOME_SUB_ICON '\uF07C'$s #
|
||||||
|
|
@ -222,10 +262,23 @@ function _p9k_init_icons() {
|
||||||
VCS_GIT_GITHUB_ICON '\uF113 ' #
|
VCS_GIT_GITHUB_ICON '\uF113 ' #
|
||||||
VCS_GIT_BITBUCKET_ICON '\uF171 ' #
|
VCS_GIT_BITBUCKET_ICON '\uF171 ' #
|
||||||
VCS_GIT_GITLAB_ICON '\uF296 ' #
|
VCS_GIT_GITLAB_ICON '\uF296 ' #
|
||||||
|
VCS_GIT_AZURE_ICON '\u2601 ' # ☁
|
||||||
|
VCS_GIT_ARCHLINUX_ICON '\uF1D3 ' #
|
||||||
|
VCS_GIT_CODEBERG_ICON '\uF1D3 ' #
|
||||||
|
VCS_GIT_DEBIAN_ICON '\uF1D3 ' #
|
||||||
|
VCS_GIT_FREEBSD_ICON '\uF1D3 ' #
|
||||||
|
VCS_GIT_FREEDESKTOP_ICON '\uF1D3 ' #
|
||||||
|
VCS_GIT_GNOME_ICON '\uF1D3 ' #
|
||||||
|
VCS_GIT_GNU_ICON '\uF1D3 ' #
|
||||||
|
VCS_GIT_KDE_ICON '\uF1D3 ' #
|
||||||
|
VCS_GIT_LINUX_ICON '\uF1D3 ' #
|
||||||
|
VCS_GIT_GITEA_ICON '\uF1D3 ' #
|
||||||
|
VCS_GIT_SOURCEHUT_ICON '\uF1D3 ' #
|
||||||
VCS_HG_ICON '\uF0C3 ' #
|
VCS_HG_ICON '\uF0C3 ' #
|
||||||
VCS_SVN_ICON 'svn'$q
|
VCS_SVN_ICON 'svn'$q
|
||||||
RUST_ICON '\uE6A8' #
|
RUST_ICON '\uE6A8' #
|
||||||
PYTHON_ICON '\uE63C'$s #
|
PYTHON_ICON '\uE63C'$s #
|
||||||
|
CHEZMOI_ICON '\uF015'$s #
|
||||||
SWIFT_ICON 'Swift'
|
SWIFT_ICON 'Swift'
|
||||||
GO_ICON 'Go'
|
GO_ICON 'Go'
|
||||||
GOLANG_ICON 'Go'
|
GOLANG_ICON 'Go'
|
||||||
|
|
@ -234,7 +287,7 @@ function _p9k_init_icons() {
|
||||||
NORDVPN_ICON '\UF023' #
|
NORDVPN_ICON '\UF023' #
|
||||||
EXECUTION_TIME_ICON '\uF253'$s #
|
EXECUTION_TIME_ICON '\uF253'$s #
|
||||||
SSH_ICON 'ssh'
|
SSH_ICON 'ssh'
|
||||||
VPN_ICON '\uF023'
|
VPN_ICON '\uF023'
|
||||||
KUBERNETES_ICON '\U2388' # ⎈
|
KUBERNETES_ICON '\U2388' # ⎈
|
||||||
DROPBOX_ICON '\UF16B'$s #
|
DROPBOX_ICON '\UF16B'$s #
|
||||||
DATE_ICON '\uF073 ' #
|
DATE_ICON '\uF073 ' #
|
||||||
|
|
@ -242,6 +295,7 @@ function _p9k_init_icons() {
|
||||||
JAVA_ICON '\U2615' # ☕︎
|
JAVA_ICON '\U2615' # ☕︎
|
||||||
LARAVEL_ICON ''
|
LARAVEL_ICON ''
|
||||||
RANGER_ICON '\u2B50' # ⭐
|
RANGER_ICON '\u2B50' # ⭐
|
||||||
|
YAZI_ICON '\u2B50' # ⭐
|
||||||
MIDNIGHT_COMMANDER_ICON 'mc'
|
MIDNIGHT_COMMANDER_ICON 'mc'
|
||||||
VIM_ICON 'vim'
|
VIM_ICON 'vim'
|
||||||
TERRAFORM_ICON 'tf'
|
TERRAFORM_ICON 'tf'
|
||||||
|
|
@ -255,6 +309,8 @@ function _p9k_init_icons() {
|
||||||
LUA_ICON 'lua'
|
LUA_ICON 'lua'
|
||||||
PERL_ICON 'perl'
|
PERL_ICON 'perl'
|
||||||
NNN_ICON 'nnn'
|
NNN_ICON 'nnn'
|
||||||
|
LF_ICON 'lf'
|
||||||
|
XPLR_ICON 'xplr'
|
||||||
TIMEWARRIOR_ICON 'tw'
|
TIMEWARRIOR_ICON 'tw'
|
||||||
TASKWARRIOR_ICON 'task'
|
TASKWARRIOR_ICON 'task'
|
||||||
NIX_SHELL_ICON 'nix'
|
NIX_SHELL_ICON 'nix'
|
||||||
|
|
@ -265,6 +321,11 @@ function _p9k_init_icons() {
|
||||||
PHP_ICON 'php'
|
PHP_ICON 'php'
|
||||||
HASKELL_ICON 'hs'
|
HASKELL_ICON 'hs'
|
||||||
PACKAGE_ICON 'pkg'
|
PACKAGE_ICON 'pkg'
|
||||||
|
JULIA_ICON 'jl'
|
||||||
|
SCALA_ICON 'scala'
|
||||||
|
TOOLBOX_ICON '\u2B22' # ⬢
|
||||||
|
ARCH_ICON 'arch'
|
||||||
|
HISTORY_ICON 'hist'
|
||||||
)
|
)
|
||||||
;;
|
;;
|
||||||
'awesome-mapped-fontconfig')
|
'awesome-mapped-fontconfig')
|
||||||
|
|
@ -310,6 +371,7 @@ function _p9k_init_icons() {
|
||||||
LINUX_DEBIAN_ICON "${CODEPOINT_OF_AWESOME_LINUX:+\\u$CODEPOINT_OF_AWESOME_LINUX$s}"
|
LINUX_DEBIAN_ICON "${CODEPOINT_OF_AWESOME_LINUX:+\\u$CODEPOINT_OF_AWESOME_LINUX$s}"
|
||||||
LINUX_RASPBIAN_ICON "${CODEPOINT_OF_AWESOME_LINUX:+\\u$CODEPOINT_OF_AWESOME_LINUX$s}"
|
LINUX_RASPBIAN_ICON "${CODEPOINT_OF_AWESOME_LINUX:+\\u$CODEPOINT_OF_AWESOME_LINUX$s}"
|
||||||
LINUX_UBUNTU_ICON "${CODEPOINT_OF_AWESOME_LINUX:+\\u$CODEPOINT_OF_AWESOME_LINUX$s}"
|
LINUX_UBUNTU_ICON "${CODEPOINT_OF_AWESOME_LINUX:+\\u$CODEPOINT_OF_AWESOME_LINUX$s}"
|
||||||
|
LINUX_KALI_ICON "${CODEPOINT_OF_AWESOME_LINUX:+\\u$CODEPOINT_OF_AWESOME_LINUX$s}"
|
||||||
LINUX_CENTOS_ICON "${CODEPOINT_OF_AWESOME_LINUX:+\\u$CODEPOINT_OF_AWESOME_LINUX$s}"
|
LINUX_CENTOS_ICON "${CODEPOINT_OF_AWESOME_LINUX:+\\u$CODEPOINT_OF_AWESOME_LINUX$s}"
|
||||||
LINUX_COREOS_ICON "${CODEPOINT_OF_AWESOME_LINUX:+\\u$CODEPOINT_OF_AWESOME_LINUX$s}"
|
LINUX_COREOS_ICON "${CODEPOINT_OF_AWESOME_LINUX:+\\u$CODEPOINT_OF_AWESOME_LINUX$s}"
|
||||||
LINUX_ELEMENTARY_ICON "${CODEPOINT_OF_AWESOME_LINUX:+\\u$CODEPOINT_OF_AWESOME_LINUX$s}"
|
LINUX_ELEMENTARY_ICON "${CODEPOINT_OF_AWESOME_LINUX:+\\u$CODEPOINT_OF_AWESOME_LINUX$s}"
|
||||||
|
|
@ -326,6 +388,14 @@ function _p9k_init_icons() {
|
||||||
LINUX_SABAYON_ICON "${CODEPOINT_OF_AWESOME_LINUX:+\\u$CODEPOINT_OF_AWESOME_LINUX$s}"
|
LINUX_SABAYON_ICON "${CODEPOINT_OF_AWESOME_LINUX:+\\u$CODEPOINT_OF_AWESOME_LINUX$s}"
|
||||||
LINUX_SLACKWARE_ICON "${CODEPOINT_OF_AWESOME_LINUX:+\\u$CODEPOINT_OF_AWESOME_LINUX$s}"
|
LINUX_SLACKWARE_ICON "${CODEPOINT_OF_AWESOME_LINUX:+\\u$CODEPOINT_OF_AWESOME_LINUX$s}"
|
||||||
LINUX_VOID_ICON "${CODEPOINT_OF_AWESOME_LINUX:+\\u$CODEPOINT_OF_AWESOME_LINUX$s}"
|
LINUX_VOID_ICON "${CODEPOINT_OF_AWESOME_LINUX:+\\u$CODEPOINT_OF_AWESOME_LINUX$s}"
|
||||||
|
LINUX_ARTIX_ICON "${CODEPOINT_OF_AWESOME_LINUX:+\\u$CODEPOINT_OF_AWESOME_LINUX$s}"
|
||||||
|
LINUX_RHEL_ICON "${CODEPOINT_OF_AWESOME_LINUX:+\\u$CODEPOINT_OF_AWESOME_LINUX$s}"
|
||||||
|
LINUX_AMZN_ICON "${CODEPOINT_OF_AWESOME_LINUX:+\\u$CODEPOINT_OF_AWESOME_LINUX$s}"
|
||||||
|
LINUX_ENDEAVOUROS_ICON "${CODEPOINT_OF_AWESOME_LINUX:+\\u$CODEPOINT_OF_AWESOME_LINUX$s}"
|
||||||
|
LINUX_ROCKY_ICON "${CODEPOINT_OF_AWESOME_LINUX:+\\u$CODEPOINT_OF_AWESOME_LINUX$s}"
|
||||||
|
LINUX_ALMALINUX_ICON "${CODEPOINT_OF_AWESOME_LINUX:+\\u$CODEPOINT_OF_AWESOME_LINUX$s}"
|
||||||
|
LINUX_GUIX_ICON "${CODEPOINT_OF_AWESOME_LINUX:+\\u$CODEPOINT_OF_AWESOME_LINUX$s}"
|
||||||
|
LINUX_NEON_ICON "${CODEPOINT_OF_AWESOME_LINUX:+\\u$CODEPOINT_OF_AWESOME_LINUX$s}"
|
||||||
SUNOS_ICON "${CODEPOINT_OF_AWESOME_SUN_O:+\\u$CODEPOINT_OF_AWESOME_SUN_O }"
|
SUNOS_ICON "${CODEPOINT_OF_AWESOME_SUN_O:+\\u$CODEPOINT_OF_AWESOME_SUN_O }"
|
||||||
HOME_ICON "${CODEPOINT_OF_AWESOME_HOME:+\\u$CODEPOINT_OF_AWESOME_HOME$s}"
|
HOME_ICON "${CODEPOINT_OF_AWESOME_HOME:+\\u$CODEPOINT_OF_AWESOME_HOME$s}"
|
||||||
HOME_SUB_ICON "${CODEPOINT_OF_AWESOME_FOLDER_OPEN:+\\u$CODEPOINT_OF_AWESOME_FOLDER_OPEN$s}"
|
HOME_SUB_ICON "${CODEPOINT_OF_AWESOME_FOLDER_OPEN:+\\u$CODEPOINT_OF_AWESOME_FOLDER_OPEN$s}"
|
||||||
|
|
@ -352,10 +422,23 @@ function _p9k_init_icons() {
|
||||||
VCS_GIT_GITHUB_ICON "${CODEPOINT_OF_AWESOME_GITHUB_ALT:+\\u$CODEPOINT_OF_AWESOME_GITHUB_ALT }"
|
VCS_GIT_GITHUB_ICON "${CODEPOINT_OF_AWESOME_GITHUB_ALT:+\\u$CODEPOINT_OF_AWESOME_GITHUB_ALT }"
|
||||||
VCS_GIT_BITBUCKET_ICON "${CODEPOINT_OF_AWESOME_BITBUCKET:+\\u$CODEPOINT_OF_AWESOME_BITBUCKET }"
|
VCS_GIT_BITBUCKET_ICON "${CODEPOINT_OF_AWESOME_BITBUCKET:+\\u$CODEPOINT_OF_AWESOME_BITBUCKET }"
|
||||||
VCS_GIT_GITLAB_ICON "${CODEPOINT_OF_AWESOME_GITLAB:+\\u$CODEPOINT_OF_AWESOME_GITLAB }"
|
VCS_GIT_GITLAB_ICON "${CODEPOINT_OF_AWESOME_GITLAB:+\\u$CODEPOINT_OF_AWESOME_GITLAB }"
|
||||||
|
VCS_GIT_AZURE_ICON '\u2601 ' # ☁
|
||||||
|
VCS_GIT_ARCHLINUX_ICON "${CODEPOINT_OF_AWESOME_GIT:+\\u$CODEPOINT_OF_AWESOME_GIT }"
|
||||||
|
VCS_GIT_CODEBERG_ICON "${CODEPOINT_OF_AWESOME_GIT:+\\u$CODEPOINT_OF_AWESOME_GIT }"
|
||||||
|
VCS_GIT_DEBIAN_ICON "${CODEPOINT_OF_AWESOME_GIT:+\\u$CODEPOINT_OF_AWESOME_GIT }"
|
||||||
|
VCS_GIT_FREEBSD_ICON "${CODEPOINT_OF_AWESOME_GIT:+\\u$CODEPOINT_OF_AWESOME_GIT }"
|
||||||
|
VCS_GIT_FREEDESKTOP_ICON "${CODEPOINT_OF_AWESOME_GIT:+\\u$CODEPOINT_OF_AWESOME_GIT }"
|
||||||
|
VCS_GIT_GNOME_ICON "${CODEPOINT_OF_AWESOME_GIT:+\\u$CODEPOINT_OF_AWESOME_GIT }"
|
||||||
|
VCS_GIT_GNU_ICON "${CODEPOINT_OF_AWESOME_GIT:+\\u$CODEPOINT_OF_AWESOME_GIT }"
|
||||||
|
VCS_GIT_KDE_ICON "${CODEPOINT_OF_AWESOME_GIT:+\\u$CODEPOINT_OF_AWESOME_GIT }"
|
||||||
|
VCS_GIT_LINUX_ICON "${CODEPOINT_OF_AWESOME_GIT:+\\u$CODEPOINT_OF_AWESOME_GIT }"
|
||||||
|
VCS_GIT_GITEA_ICON "${CODEPOINT_OF_AWESOME_GIT:+\\u$CODEPOINT_OF_AWESOME_GIT }"
|
||||||
|
VCS_GIT_SOURCEHUT_ICON "${CODEPOINT_OF_AWESOME_GIT:+\\u$CODEPOINT_OF_AWESOME_GIT }"
|
||||||
VCS_HG_ICON "${CODEPOINT_OF_AWESOME_FLASK:+\\u$CODEPOINT_OF_AWESOME_FLASK }"
|
VCS_HG_ICON "${CODEPOINT_OF_AWESOME_FLASK:+\\u$CODEPOINT_OF_AWESOME_FLASK }"
|
||||||
VCS_SVN_ICON 'svn'$q
|
VCS_SVN_ICON 'svn'$q
|
||||||
RUST_ICON '\uE6A8' #
|
RUST_ICON '\uE6A8' #
|
||||||
PYTHON_ICON '\U1F40D' # 🐍
|
PYTHON_ICON '\U1F40D' # 🐍
|
||||||
|
CHEZMOI_ICON "${CODEPOINT_OF_AWESOME_HOME:+\\u$CODEPOINT_OF_AWESOME_HOME$s}"
|
||||||
SWIFT_ICON '\uE655'$s #
|
SWIFT_ICON '\uE655'$s #
|
||||||
PUBLIC_IP_ICON "${CODEPOINT_OF_AWESOME_GLOBE:+\\u$CODEPOINT_OF_AWESOME_GLOBE$s}"
|
PUBLIC_IP_ICON "${CODEPOINT_OF_AWESOME_GLOBE:+\\u$CODEPOINT_OF_AWESOME_GLOBE$s}"
|
||||||
LOCK_ICON "${CODEPOINT_OF_AWESOME_LOCK:+\\u$CODEPOINT_OF_AWESOME_LOCK}"
|
LOCK_ICON "${CODEPOINT_OF_AWESOME_LOCK:+\\u$CODEPOINT_OF_AWESOME_LOCK}"
|
||||||
|
|
@ -370,6 +453,7 @@ function _p9k_init_icons() {
|
||||||
JAVA_ICON '\U2615' # ☕︎
|
JAVA_ICON '\U2615' # ☕︎
|
||||||
LARAVEL_ICON ''
|
LARAVEL_ICON ''
|
||||||
RANGER_ICON '\u2B50' # ⭐
|
RANGER_ICON '\u2B50' # ⭐
|
||||||
|
YAZI_ICON '\u2B50' # ⭐
|
||||||
MIDNIGHT_COMMANDER_ICON 'mc'
|
MIDNIGHT_COMMANDER_ICON 'mc'
|
||||||
VIM_ICON 'vim'
|
VIM_ICON 'vim'
|
||||||
TERRAFORM_ICON 'tf'
|
TERRAFORM_ICON 'tf'
|
||||||
|
|
@ -383,6 +467,8 @@ function _p9k_init_icons() {
|
||||||
LUA_ICON 'lua'
|
LUA_ICON 'lua'
|
||||||
PERL_ICON 'perl'
|
PERL_ICON 'perl'
|
||||||
NNN_ICON 'nnn'
|
NNN_ICON 'nnn'
|
||||||
|
LF_ICON 'lf'
|
||||||
|
XPLR_ICON 'xplr'
|
||||||
TIMEWARRIOR_ICON 'tw'
|
TIMEWARRIOR_ICON 'tw'
|
||||||
TASKWARRIOR_ICON 'task'
|
TASKWARRIOR_ICON 'task'
|
||||||
NIX_SHELL_ICON 'nix'
|
NIX_SHELL_ICON 'nix'
|
||||||
|
|
@ -393,6 +479,172 @@ function _p9k_init_icons() {
|
||||||
PHP_ICON 'php'
|
PHP_ICON 'php'
|
||||||
HASKELL_ICON 'hs'
|
HASKELL_ICON 'hs'
|
||||||
PACKAGE_ICON 'pkg'
|
PACKAGE_ICON 'pkg'
|
||||||
|
JULIA_ICON 'jl'
|
||||||
|
SCALA_ICON 'scala'
|
||||||
|
TOOLBOX_ICON '\u2B22' # ⬢
|
||||||
|
ARCH_ICON 'arch'
|
||||||
|
HISTORY_ICON 'hist'
|
||||||
|
)
|
||||||
|
;;
|
||||||
|
'nerdfont-v3')
|
||||||
|
# In this version of Nerd Fonts the Material icons are mapped to U+F0001-U+F19C3.
|
||||||
|
# The font may also have Material icons in the old range of U+F500-U+FD46 but
|
||||||
|
# powerlevel10k won't rely on them.
|
||||||
|
icons=(
|
||||||
|
RULER_CHAR '\u2500' # ─
|
||||||
|
LEFT_SEGMENT_SEPARATOR '\uE0B0' #
|
||||||
|
RIGHT_SEGMENT_SEPARATOR '\uE0B2' #
|
||||||
|
LEFT_SEGMENT_END_SEPARATOR ' ' #
|
||||||
|
LEFT_SUBSEGMENT_SEPARATOR '\uE0B1' #
|
||||||
|
RIGHT_SUBSEGMENT_SEPARATOR '\uE0B3' #
|
||||||
|
CARRIAGE_RETURN_ICON '\u21B5' # ↵
|
||||||
|
ROOT_ICON '\uE614'$q #
|
||||||
|
SUDO_ICON '\uF09C'$s #
|
||||||
|
RUBY_ICON '\uF219 ' #
|
||||||
|
AWS_ICON '\uF270'$s #
|
||||||
|
AWS_EB_ICON '\UF1BD'$q$q #
|
||||||
|
BACKGROUND_JOBS_ICON '\uF013 ' #
|
||||||
|
TEST_ICON '\uF188'$s #
|
||||||
|
TODO_ICON '\u2611' # ☑
|
||||||
|
BATTERY_ICON '\UF240 ' #
|
||||||
|
DISK_ICON '\uF0A0'$s #
|
||||||
|
OK_ICON '\uF00C'$s #
|
||||||
|
FAIL_ICON '\uF00D' #
|
||||||
|
SYMFONY_ICON '\uE757' #
|
||||||
|
NODE_ICON '\uE617 ' #
|
||||||
|
NODEJS_ICON '\uE617 ' #
|
||||||
|
MULTILINE_FIRST_PROMPT_PREFIX '\u256D\U2500' # ╭─
|
||||||
|
MULTILINE_NEWLINE_PROMPT_PREFIX '\u251C\U2500' # ├─
|
||||||
|
MULTILINE_LAST_PROMPT_PREFIX '\u2570\U2500 ' # ╰─
|
||||||
|
APPLE_ICON '\uF179' #
|
||||||
|
WINDOWS_ICON '\uF17A'$s #
|
||||||
|
FREEBSD_ICON '\UF30C ' #
|
||||||
|
ANDROID_ICON '\uF17B' #
|
||||||
|
LINUX_ARCH_ICON '\uF303' #
|
||||||
|
LINUX_CENTOS_ICON '\uF304'$s #
|
||||||
|
LINUX_COREOS_ICON '\uF305'$s #
|
||||||
|
LINUX_DEBIAN_ICON '\uF306' #
|
||||||
|
LINUX_RASPBIAN_ICON '\uF315' #
|
||||||
|
LINUX_ELEMENTARY_ICON '\uF309'$s #
|
||||||
|
LINUX_FEDORA_ICON '\uF30a'$s #
|
||||||
|
LINUX_GENTOO_ICON '\uF30d'$s #
|
||||||
|
LINUX_MAGEIA_ICON '\uF310' #
|
||||||
|
LINUX_MINT_ICON '\uF30e'$s #
|
||||||
|
LINUX_NIXOS_ICON '\uF313'$s #
|
||||||
|
LINUX_MANJARO_ICON '\uF312'$s #
|
||||||
|
LINUX_DEVUAN_ICON '\uF307'$s #
|
||||||
|
LINUX_ALPINE_ICON '\uF300'$s #
|
||||||
|
LINUX_AOSC_ICON '\uF301'$s #
|
||||||
|
LINUX_OPENSUSE_ICON '\uF314'$s #
|
||||||
|
LINUX_SABAYON_ICON '\uF317'$s #
|
||||||
|
LINUX_SLACKWARE_ICON '\uF319'$s #
|
||||||
|
LINUX_VOID_ICON '\UF32E'$s #
|
||||||
|
LINUX_ARTIX_ICON '\UF31F'$s #
|
||||||
|
LINUX_UBUNTU_ICON '\uF31b'$s #
|
||||||
|
LINUX_KALI_ICON '\uF327'$s #
|
||||||
|
LINUX_RHEL_ICON '\UF111B'$s #
|
||||||
|
LINUX_AMZN_ICON '\uF270'$s #
|
||||||
|
LINUX_ENDEAVOUROS_ICON '\UF322'$s #
|
||||||
|
LINUX_ROCKY_ICON '\UF32B'$s #
|
||||||
|
LINUX_ALMALINUX_ICON '\UF31D'$s #
|
||||||
|
LINUX_GUIX_ICON '\UF325'$s #
|
||||||
|
LINUX_NEON_ICON '\uF17C' #
|
||||||
|
LINUX_ICON '\uF17C' #
|
||||||
|
SUNOS_ICON '\uF185 ' #
|
||||||
|
HOME_ICON '\uF015'$s #
|
||||||
|
HOME_SUB_ICON '\uF07C'$s #
|
||||||
|
FOLDER_ICON '\uF115'$s #
|
||||||
|
ETC_ICON '\uF013'$s #
|
||||||
|
NETWORK_ICON '\UF0378'$s #
|
||||||
|
LOAD_ICON '\uF080 ' #
|
||||||
|
SWAP_ICON '\uF464'$s #
|
||||||
|
RAM_ICON '\uF0E4'$s #
|
||||||
|
SERVER_ICON '\uF0AE'$s #
|
||||||
|
VCS_UNTRACKED_ICON '\uF059'$s #
|
||||||
|
VCS_UNSTAGED_ICON '\uF06A'$s #
|
||||||
|
VCS_STAGED_ICON '\uF055'$s #
|
||||||
|
VCS_STASH_ICON '\uF01C ' #
|
||||||
|
VCS_INCOMING_CHANGES_ICON '\uF01A ' #
|
||||||
|
VCS_OUTGOING_CHANGES_ICON '\uF01B ' #
|
||||||
|
VCS_TAG_ICON '\uF02B ' #
|
||||||
|
VCS_BOOKMARK_ICON '\uF461 ' #
|
||||||
|
VCS_COMMIT_ICON '\uE729 ' #
|
||||||
|
VCS_BRANCH_ICON '\uF126 ' #
|
||||||
|
VCS_REMOTE_BRANCH_ICON '\uE728 ' #
|
||||||
|
VCS_LOADING_ICON '' #
|
||||||
|
VCS_GIT_ICON '\uF1D3 ' #
|
||||||
|
VCS_GIT_GITHUB_ICON '\uF113 ' #
|
||||||
|
VCS_GIT_BITBUCKET_ICON '\uE703 ' #
|
||||||
|
VCS_GIT_GITLAB_ICON '\uF296 ' #
|
||||||
|
VCS_GIT_AZURE_ICON '\uEBE8 ' #
|
||||||
|
VCS_GIT_ARCHLINUX_ICON '\uF303 ' #
|
||||||
|
# v3.1 has \uF330.
|
||||||
|
VCS_GIT_CODEBERG_ICON '\uF1D3 ' #
|
||||||
|
VCS_GIT_DEBIAN_ICON '\uF306 ' #
|
||||||
|
VCS_GIT_FREEBSD_ICON '\UF30C ' #
|
||||||
|
# v3.1 has \uF360.
|
||||||
|
VCS_GIT_FREEDESKTOP_ICON '\uF296 ' #
|
||||||
|
# v3.1 has \uF361.
|
||||||
|
VCS_GIT_GNOME_ICON '\uF296 ' #
|
||||||
|
VCS_GIT_GNU_ICON '\uE779 ' #
|
||||||
|
# v3.1 has \uF332.
|
||||||
|
VCS_GIT_KDE_ICON '\uF296 ' #
|
||||||
|
VCS_GIT_LINUX_ICON '\uF17C ' #
|
||||||
|
# v3.1 has \uF339.
|
||||||
|
VCS_GIT_GITEA_ICON '\uF1D3 ' #
|
||||||
|
VCS_GIT_SOURCEHUT_ICON '\uF1DB ' #
|
||||||
|
VCS_HG_ICON '\uF0C3 ' #
|
||||||
|
VCS_SVN_ICON '\uE72D'$q #
|
||||||
|
RUST_ICON '\uE7A8'$q #
|
||||||
|
PYTHON_ICON '\UE73C ' #
|
||||||
|
CHEZMOI_ICON '\uF015'$s #
|
||||||
|
SWIFT_ICON '\uE755' #
|
||||||
|
GO_ICON '\uE626' #
|
||||||
|
GOLANG_ICON '\uE626' #
|
||||||
|
PUBLIC_IP_ICON '\UF0AC'$s #
|
||||||
|
LOCK_ICON '\UF023' #
|
||||||
|
NORDVPN_ICON '\UF023' #
|
||||||
|
EXECUTION_TIME_ICON '\uF252'$s #
|
||||||
|
SSH_ICON '\uF489'$s #
|
||||||
|
VPN_ICON '\UF023' #
|
||||||
|
KUBERNETES_ICON '\UF10FE' #
|
||||||
|
DROPBOX_ICON '\UF16B'$s #
|
||||||
|
DATE_ICON '\uF073 ' #
|
||||||
|
TIME_ICON '\uF017 ' #
|
||||||
|
JAVA_ICON '\uE738' #
|
||||||
|
LARAVEL_ICON '\ue73f'$q #
|
||||||
|
RANGER_ICON '\uF00b ' #
|
||||||
|
YAZI_ICON '\uF00b ' #
|
||||||
|
MIDNIGHT_COMMANDER_ICON 'mc' # mc
|
||||||
|
VIM_ICON '\uE62B' #
|
||||||
|
TERRAFORM_ICON '\uF1BB ' #
|
||||||
|
PROXY_ICON '\u2194' # ↔
|
||||||
|
DOTNET_ICON '\uE77F' #
|
||||||
|
DOTNET_CORE_ICON '\uE77F' #
|
||||||
|
AZURE_ICON '\uEBD8 ' #
|
||||||
|
DIRENV_ICON '\u25BC' # ▼
|
||||||
|
FLUTTER_ICON 'F' # F
|
||||||
|
GCLOUD_ICON '\UF02AD' #
|
||||||
|
LUA_ICON '\uE620' #
|
||||||
|
PERL_ICON '\uE769' #
|
||||||
|
NNN_ICON 'nnn' # nnn
|
||||||
|
LF_ICON 'lf' # lf
|
||||||
|
XPLR_ICON 'xplr' # xplr
|
||||||
|
TIMEWARRIOR_ICON '\uF49B' #
|
||||||
|
TASKWARRIOR_ICON '\uF4A0 ' #
|
||||||
|
NIX_SHELL_ICON '\uF313 ' #
|
||||||
|
WIFI_ICON '\uF1EB ' #
|
||||||
|
ERLANG_ICON '\uE7B1 ' #
|
||||||
|
ELIXIR_ICON '\uE62D' #
|
||||||
|
POSTGRES_ICON '\uE76E' #
|
||||||
|
PHP_ICON '\uE608' #
|
||||||
|
HASKELL_ICON '\uE61F' #
|
||||||
|
PACKAGE_ICON '\UF03D7' #
|
||||||
|
JULIA_ICON '\uE624' #
|
||||||
|
SCALA_ICON '\uE737' #
|
||||||
|
TOOLBOX_ICON '\uE20F'$s #
|
||||||
|
ARCH_ICON '\uE266' #
|
||||||
|
HISTORY_ICON '\uF1DA'$s #
|
||||||
)
|
)
|
||||||
;;
|
;;
|
||||||
'nerdfont-complete'|'nerdfont-fontconfig')
|
'nerdfont-complete'|'nerdfont-fontconfig')
|
||||||
|
|
@ -448,14 +700,23 @@ function _p9k_init_icons() {
|
||||||
LINUX_SABAYON_ICON '\uF317'$s #
|
LINUX_SABAYON_ICON '\uF317'$s #
|
||||||
LINUX_SLACKWARE_ICON '\uF319'$s #
|
LINUX_SLACKWARE_ICON '\uF319'$s #
|
||||||
LINUX_VOID_ICON '\uF17C' #
|
LINUX_VOID_ICON '\uF17C' #
|
||||||
|
LINUX_ARTIX_ICON '\uF17C' #
|
||||||
LINUX_UBUNTU_ICON '\uF31b'$s #
|
LINUX_UBUNTU_ICON '\uF31b'$s #
|
||||||
|
LINUX_KALI_ICON '\uF17C' #
|
||||||
|
LINUX_RHEL_ICON '\uF316'$s #
|
||||||
|
LINUX_AMZN_ICON '\uF270'$s #
|
||||||
|
LINUX_ENDEAVOUROS_ICON '\uF17C' #
|
||||||
|
LINUX_ROCKY_ICON '\uF17C' #
|
||||||
|
LINUX_ALMALINUX_ICON '\uF17C' #
|
||||||
|
LINUX_GUIX_ICON '\uF325'$s #
|
||||||
|
LINUX_NEON_ICON '\uF17C' #
|
||||||
LINUX_ICON '\uF17C' #
|
LINUX_ICON '\uF17C' #
|
||||||
SUNOS_ICON '\uF185 ' #
|
SUNOS_ICON '\uF185 ' #
|
||||||
HOME_ICON '\uF015'$s #
|
HOME_ICON '\uF015'$s #
|
||||||
HOME_SUB_ICON '\uF07C'$s #
|
HOME_SUB_ICON '\uF07C'$s #
|
||||||
FOLDER_ICON '\uF115'$s #
|
FOLDER_ICON '\uF115'$s #
|
||||||
ETC_ICON '\uF013'$s #
|
ETC_ICON '\uF013'$s #
|
||||||
NETWORK_ICON '\uFBF1'$s # ﯱ
|
NETWORK_ICON '\uF50D'$s #
|
||||||
LOAD_ICON '\uF080 ' #
|
LOAD_ICON '\uF080 ' #
|
||||||
SWAP_ICON '\uF464'$s #
|
SWAP_ICON '\uF464'$s #
|
||||||
RAM_ICON '\uF0E4'$s #
|
RAM_ICON '\uF0E4'$s #
|
||||||
|
|
@ -476,10 +737,23 @@ function _p9k_init_icons() {
|
||||||
VCS_GIT_GITHUB_ICON '\uF113 ' #
|
VCS_GIT_GITHUB_ICON '\uF113 ' #
|
||||||
VCS_GIT_BITBUCKET_ICON '\uE703 ' #
|
VCS_GIT_BITBUCKET_ICON '\uE703 ' #
|
||||||
VCS_GIT_GITLAB_ICON '\uF296 ' #
|
VCS_GIT_GITLAB_ICON '\uF296 ' #
|
||||||
|
VCS_GIT_AZURE_ICON '\uFD03 ' # ﴃ
|
||||||
|
VCS_GIT_ARCHLINUX_ICON '\uF303 ' #
|
||||||
|
VCS_GIT_CODEBERG_ICON '\uF1D3 ' #
|
||||||
|
VCS_GIT_DEBIAN_ICON '\uF306 ' #
|
||||||
|
VCS_GIT_FREEBSD_ICON '\UF30C ' #
|
||||||
|
VCS_GIT_FREEDESKTOP_ICON '\uF296 ' #
|
||||||
|
VCS_GIT_GNOME_ICON '\uF296 ' #
|
||||||
|
VCS_GIT_GNU_ICON '\uE779 ' #
|
||||||
|
VCS_GIT_KDE_ICON '\uF296 ' #
|
||||||
|
VCS_GIT_LINUX_ICON '\uF17C ' #
|
||||||
|
VCS_GIT_GITEA_ICON '\uF1D3 ' #
|
||||||
|
VCS_GIT_SOURCEHUT_ICON '\uF1DB ' #
|
||||||
VCS_HG_ICON '\uF0C3 ' #
|
VCS_HG_ICON '\uF0C3 ' #
|
||||||
VCS_SVN_ICON '\uE72D'$q #
|
VCS_SVN_ICON '\uE72D'$q #
|
||||||
RUST_ICON '\uE7A8'$q #
|
RUST_ICON '\uE7A8'$q #
|
||||||
PYTHON_ICON '\UE73C ' #
|
PYTHON_ICON '\UE73C ' #
|
||||||
|
CHEZMOI_ICON '\uF015'$s #
|
||||||
SWIFT_ICON '\uE755' #
|
SWIFT_ICON '\uE755' #
|
||||||
GO_ICON '\uE626' #
|
GO_ICON '\uE626' #
|
||||||
GOLANG_ICON '\uE626' #
|
GOLANG_ICON '\uE626' #
|
||||||
|
|
@ -496,6 +770,7 @@ function _p9k_init_icons() {
|
||||||
JAVA_ICON '\uE738' #
|
JAVA_ICON '\uE738' #
|
||||||
LARAVEL_ICON '\ue73f'$q #
|
LARAVEL_ICON '\ue73f'$q #
|
||||||
RANGER_ICON '\uF00b ' #
|
RANGER_ICON '\uF00b ' #
|
||||||
|
YAZI_ICON '\uF00b ' #
|
||||||
MIDNIGHT_COMMANDER_ICON 'mc'
|
MIDNIGHT_COMMANDER_ICON 'mc'
|
||||||
VIM_ICON '\uE62B' #
|
VIM_ICON '\uE62B' #
|
||||||
TERRAFORM_ICON '\uF1BB ' #
|
TERRAFORM_ICON '\uF1BB ' #
|
||||||
|
|
@ -509,6 +784,8 @@ function _p9k_init_icons() {
|
||||||
LUA_ICON '\uE620' #
|
LUA_ICON '\uE620' #
|
||||||
PERL_ICON '\uE769' #
|
PERL_ICON '\uE769' #
|
||||||
NNN_ICON 'nnn'
|
NNN_ICON 'nnn'
|
||||||
|
LF_ICON 'lf'
|
||||||
|
XPLR_ICON 'xplr'
|
||||||
TIMEWARRIOR_ICON '\uF49B' #
|
TIMEWARRIOR_ICON '\uF49B' #
|
||||||
TASKWARRIOR_ICON '\uF4A0 ' #
|
TASKWARRIOR_ICON '\uF4A0 ' #
|
||||||
NIX_SHELL_ICON '\uF313 ' #
|
NIX_SHELL_ICON '\uF313 ' #
|
||||||
|
|
@ -519,6 +796,11 @@ function _p9k_init_icons() {
|
||||||
PHP_ICON '\uE608' #
|
PHP_ICON '\uE608' #
|
||||||
HASKELL_ICON '\uE61F' #
|
HASKELL_ICON '\uE61F' #
|
||||||
PACKAGE_ICON '\uF8D6' #
|
PACKAGE_ICON '\uF8D6' #
|
||||||
|
JULIA_ICON '\uE624' #
|
||||||
|
SCALA_ICON '\uE737' #
|
||||||
|
TOOLBOX_ICON '\uE20F'$s #
|
||||||
|
ARCH_ICON '\uE266' #
|
||||||
|
HISTORY_ICON '\uF1DA'$s #
|
||||||
)
|
)
|
||||||
;;
|
;;
|
||||||
ascii)
|
ascii)
|
||||||
|
|
@ -557,6 +839,7 @@ function _p9k_init_icons() {
|
||||||
LINUX_DEBIAN_ICON 'debian'
|
LINUX_DEBIAN_ICON 'debian'
|
||||||
LINUX_RASPBIAN_ICON 'pi'
|
LINUX_RASPBIAN_ICON 'pi'
|
||||||
LINUX_UBUNTU_ICON 'ubuntu'
|
LINUX_UBUNTU_ICON 'ubuntu'
|
||||||
|
LINUX_KALI_ICON 'kali'
|
||||||
LINUX_CENTOS_ICON 'centos'
|
LINUX_CENTOS_ICON 'centos'
|
||||||
LINUX_COREOS_ICON 'coreos'
|
LINUX_COREOS_ICON 'coreos'
|
||||||
LINUX_ELEMENTARY_ICON 'elementary'
|
LINUX_ELEMENTARY_ICON 'elementary'
|
||||||
|
|
@ -573,6 +856,14 @@ function _p9k_init_icons() {
|
||||||
LINUX_SABAYON_ICON 'sabayon'
|
LINUX_SABAYON_ICON 'sabayon'
|
||||||
LINUX_SLACKWARE_ICON 'slack'
|
LINUX_SLACKWARE_ICON 'slack'
|
||||||
LINUX_VOID_ICON 'void'
|
LINUX_VOID_ICON 'void'
|
||||||
|
LINUX_ARTIX_ICON 'artix'
|
||||||
|
LINUX_RHEL_ICON 'rhel'
|
||||||
|
LINUX_AMZN_ICON 'amzn'
|
||||||
|
LINUX_ENDEAVOUROS_ICON 'edvos'
|
||||||
|
LINUX_ROCKY_ICON 'rocky'
|
||||||
|
LINUX_ALMALINUX_ICON 'alma'
|
||||||
|
LINUX_GUIX_ICON 'guix'
|
||||||
|
LINUX_NEON_ICON 'neon'
|
||||||
SUNOS_ICON 'sunos'
|
SUNOS_ICON 'sunos'
|
||||||
HOME_ICON ''
|
HOME_ICON ''
|
||||||
HOME_SUB_ICON ''
|
HOME_SUB_ICON ''
|
||||||
|
|
@ -599,10 +890,23 @@ function _p9k_init_icons() {
|
||||||
VCS_GIT_GITHUB_ICON ''
|
VCS_GIT_GITHUB_ICON ''
|
||||||
VCS_GIT_BITBUCKET_ICON ''
|
VCS_GIT_BITBUCKET_ICON ''
|
||||||
VCS_GIT_GITLAB_ICON ''
|
VCS_GIT_GITLAB_ICON ''
|
||||||
|
VCS_GIT_AZURE_ICON ''
|
||||||
|
VCS_GIT_ARCHLINUX_ICON ''
|
||||||
|
VCS_GIT_CODEBERG_ICON ''
|
||||||
|
VCS_GIT_DEBIAN_ICON ''
|
||||||
|
VCS_GIT_FREEBSD_ICON ''
|
||||||
|
VCS_GIT_FREEDESKTOP_ICON ''
|
||||||
|
VCS_GIT_GNOME_ICON ''
|
||||||
|
VCS_GIT_GNU_ICON ''
|
||||||
|
VCS_GIT_KDE_ICON ''
|
||||||
|
VCS_GIT_LINUX_ICON ''
|
||||||
|
VCS_GIT_GITEA_ICON ''
|
||||||
|
VCS_GIT_SOURCEHUT_ICON ''
|
||||||
VCS_HG_ICON ''
|
VCS_HG_ICON ''
|
||||||
VCS_SVN_ICON ''
|
VCS_SVN_ICON ''
|
||||||
RUST_ICON 'rust'
|
RUST_ICON 'rust'
|
||||||
PYTHON_ICON 'py'
|
PYTHON_ICON 'py'
|
||||||
|
CHEZMOI_ICON 'chezmoi'
|
||||||
SWIFT_ICON 'swift'
|
SWIFT_ICON 'swift'
|
||||||
GO_ICON 'go'
|
GO_ICON 'go'
|
||||||
GOLANG_ICON 'go'
|
GOLANG_ICON 'go'
|
||||||
|
|
@ -619,6 +923,7 @@ function _p9k_init_icons() {
|
||||||
JAVA_ICON 'java'
|
JAVA_ICON 'java'
|
||||||
LARAVEL_ICON ''
|
LARAVEL_ICON ''
|
||||||
RANGER_ICON 'ranger'
|
RANGER_ICON 'ranger'
|
||||||
|
YAZI_ICON 'yazi'
|
||||||
MIDNIGHT_COMMANDER_ICON 'mc'
|
MIDNIGHT_COMMANDER_ICON 'mc'
|
||||||
VIM_ICON 'vim'
|
VIM_ICON 'vim'
|
||||||
TERRAFORM_ICON 'tf'
|
TERRAFORM_ICON 'tf'
|
||||||
|
|
@ -632,6 +937,8 @@ function _p9k_init_icons() {
|
||||||
LUA_ICON 'lua'
|
LUA_ICON 'lua'
|
||||||
PERL_ICON 'perl'
|
PERL_ICON 'perl'
|
||||||
NNN_ICON 'nnn'
|
NNN_ICON 'nnn'
|
||||||
|
LF_ICON 'lf'
|
||||||
|
XPLR_ICON 'xplr'
|
||||||
TIMEWARRIOR_ICON 'tw'
|
TIMEWARRIOR_ICON 'tw'
|
||||||
TASKWARRIOR_ICON 'task'
|
TASKWARRIOR_ICON 'task'
|
||||||
NIX_SHELL_ICON 'nix'
|
NIX_SHELL_ICON 'nix'
|
||||||
|
|
@ -642,6 +949,11 @@ function _p9k_init_icons() {
|
||||||
PHP_ICON 'php'
|
PHP_ICON 'php'
|
||||||
HASKELL_ICON 'hs'
|
HASKELL_ICON 'hs'
|
||||||
PACKAGE_ICON 'pkg'
|
PACKAGE_ICON 'pkg'
|
||||||
|
JULIA_ICON 'jl'
|
||||||
|
SCALA_ICON 'scala'
|
||||||
|
TOOLBOX_ICON 'toolbox'
|
||||||
|
ARCH_ICON 'arch'
|
||||||
|
HISTORY_ICON 'hist'
|
||||||
)
|
)
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
|
|
@ -664,7 +976,7 @@ function _p9k_init_icons() {
|
||||||
TEST_ICON ''
|
TEST_ICON ''
|
||||||
TODO_ICON '\u2206' # ∆
|
TODO_ICON '\u2206' # ∆
|
||||||
BATTERY_ICON '\U1F50B' # 🔋
|
BATTERY_ICON '\U1F50B' # 🔋
|
||||||
DISK_ICON 'hdd'
|
DISK_ICON 'hdd'
|
||||||
OK_ICON '\u2714' # ✔
|
OK_ICON '\u2714' # ✔
|
||||||
FAIL_ICON '\u2718' # ✘
|
FAIL_ICON '\u2718' # ✘
|
||||||
SYMFONY_ICON 'SF'
|
SYMFONY_ICON 'SF'
|
||||||
|
|
@ -682,6 +994,7 @@ function _p9k_init_icons() {
|
||||||
LINUX_DEBIAN_ICON 'Deb'
|
LINUX_DEBIAN_ICON 'Deb'
|
||||||
LINUX_RASPBIAN_ICON 'RPi'
|
LINUX_RASPBIAN_ICON 'RPi'
|
||||||
LINUX_UBUNTU_ICON 'Ubu'
|
LINUX_UBUNTU_ICON 'Ubu'
|
||||||
|
LINUX_KALI_ICON 'Kal'
|
||||||
LINUX_CENTOS_ICON 'Cen'
|
LINUX_CENTOS_ICON 'Cen'
|
||||||
LINUX_COREOS_ICON 'Cor'
|
LINUX_COREOS_ICON 'Cor'
|
||||||
LINUX_ELEMENTARY_ICON 'Elm'
|
LINUX_ELEMENTARY_ICON 'Elm'
|
||||||
|
|
@ -698,6 +1011,14 @@ function _p9k_init_icons() {
|
||||||
LINUX_SABAYON_ICON 'Sab'
|
LINUX_SABAYON_ICON 'Sab'
|
||||||
LINUX_SLACKWARE_ICON 'Sla'
|
LINUX_SLACKWARE_ICON 'Sla'
|
||||||
LINUX_VOID_ICON 'Vo'
|
LINUX_VOID_ICON 'Vo'
|
||||||
|
LINUX_ARTIX_ICON 'Art'
|
||||||
|
LINUX_RHEL_ICON 'RH'
|
||||||
|
LINUX_AMZN_ICON 'Amzn'
|
||||||
|
LINUX_ENDEAVOUROS_ICON 'Edv'
|
||||||
|
LINUX_ROCKY_ICON 'Roc'
|
||||||
|
LINUX_ALMALINUX_ICON 'Alma'
|
||||||
|
LINUX_GUIX_ICON 'Guix'
|
||||||
|
LINUX_NEON_ICON 'Neon'
|
||||||
SUNOS_ICON 'Sun'
|
SUNOS_ICON 'Sun'
|
||||||
HOME_ICON ''
|
HOME_ICON ''
|
||||||
HOME_SUB_ICON ''
|
HOME_SUB_ICON ''
|
||||||
|
|
@ -724,10 +1045,23 @@ function _p9k_init_icons() {
|
||||||
VCS_GIT_GITHUB_ICON ''
|
VCS_GIT_GITHUB_ICON ''
|
||||||
VCS_GIT_BITBUCKET_ICON ''
|
VCS_GIT_BITBUCKET_ICON ''
|
||||||
VCS_GIT_GITLAB_ICON ''
|
VCS_GIT_GITLAB_ICON ''
|
||||||
|
VCS_GIT_AZURE_ICON ''
|
||||||
|
VCS_GIT_ARCHLINUX_ICON ''
|
||||||
|
VCS_GIT_CODEBERG_ICON ''
|
||||||
|
VCS_GIT_DEBIAN_ICON ''
|
||||||
|
VCS_GIT_FREEBSD_ICON ''
|
||||||
|
VCS_GIT_FREEDESKTOP_ICON ''
|
||||||
|
VCS_GIT_GNOME_ICON ''
|
||||||
|
VCS_GIT_GNU_ICON ''
|
||||||
|
VCS_GIT_KDE_ICON ''
|
||||||
|
VCS_GIT_LINUX_ICON ''
|
||||||
|
VCS_GIT_GITEA_ICON ''
|
||||||
|
VCS_GIT_SOURCEHUT_ICON ''
|
||||||
VCS_HG_ICON ''
|
VCS_HG_ICON ''
|
||||||
VCS_SVN_ICON ''
|
VCS_SVN_ICON ''
|
||||||
RUST_ICON 'R'
|
RUST_ICON 'R'
|
||||||
PYTHON_ICON 'Py'
|
PYTHON_ICON 'Py'
|
||||||
|
CHEZMOI_ICON 'Chez'
|
||||||
SWIFT_ICON 'Swift'
|
SWIFT_ICON 'Swift'
|
||||||
GO_ICON 'Go'
|
GO_ICON 'Go'
|
||||||
GOLANG_ICON 'Go'
|
GOLANG_ICON 'Go'
|
||||||
|
|
@ -744,6 +1078,7 @@ function _p9k_init_icons() {
|
||||||
JAVA_ICON '\U2615' # ☕︎
|
JAVA_ICON '\U2615' # ☕︎
|
||||||
LARAVEL_ICON ''
|
LARAVEL_ICON ''
|
||||||
RANGER_ICON '\u2B50' # ⭐
|
RANGER_ICON '\u2B50' # ⭐
|
||||||
|
YAZI_ICON '\u2B50' # ⭐
|
||||||
MIDNIGHT_COMMANDER_ICON 'mc'
|
MIDNIGHT_COMMANDER_ICON 'mc'
|
||||||
VIM_ICON 'vim'
|
VIM_ICON 'vim'
|
||||||
TERRAFORM_ICON 'tf'
|
TERRAFORM_ICON 'tf'
|
||||||
|
|
@ -757,6 +1092,8 @@ function _p9k_init_icons() {
|
||||||
LUA_ICON 'lua'
|
LUA_ICON 'lua'
|
||||||
PERL_ICON 'perl'
|
PERL_ICON 'perl'
|
||||||
NNN_ICON 'nnn'
|
NNN_ICON 'nnn'
|
||||||
|
LF_ICON 'lf'
|
||||||
|
XPLR_ICON 'xplr'
|
||||||
TIMEWARRIOR_ICON 'tw'
|
TIMEWARRIOR_ICON 'tw'
|
||||||
TASKWARRIOR_ICON 'task'
|
TASKWARRIOR_ICON 'task'
|
||||||
NIX_SHELL_ICON 'nix'
|
NIX_SHELL_ICON 'nix'
|
||||||
|
|
@ -767,6 +1104,11 @@ function _p9k_init_icons() {
|
||||||
PHP_ICON 'php'
|
PHP_ICON 'php'
|
||||||
HASKELL_ICON 'hs'
|
HASKELL_ICON 'hs'
|
||||||
PACKAGE_ICON 'pkg'
|
PACKAGE_ICON 'pkg'
|
||||||
|
JULIA_ICON 'jl'
|
||||||
|
SCALA_ICON 'scala'
|
||||||
|
TOOLBOX_ICON '\u2B22' # ⬢
|
||||||
|
ARCH_ICON 'arch'
|
||||||
|
HISTORY_ICON 'hist'
|
||||||
)
|
)
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
@ -791,6 +1133,7 @@ function _p9k_init_icons() {
|
||||||
icons[LEFT_SEGMENT_END_SEPARATOR]+=' '
|
icons[LEFT_SEGMENT_END_SEPARATOR]+=' '
|
||||||
icons[MULTILINE_LAST_PROMPT_PREFIX]+=' '
|
icons[MULTILINE_LAST_PROMPT_PREFIX]+=' '
|
||||||
icons[VCS_TAG_ICON]+=' '
|
icons[VCS_TAG_ICON]+=' '
|
||||||
|
icons[VCS_BOOKMARK_ICON]+=' '
|
||||||
icons[VCS_COMMIT_ICON]+=' '
|
icons[VCS_COMMIT_ICON]+=' '
|
||||||
icons[VCS_BRANCH_ICON]+=' '
|
icons[VCS_BRANCH_ICON]+=' '
|
||||||
icons[VCS_REMOTE_BRANCH_ICON]+=' '
|
icons[VCS_REMOTE_BRANCH_ICON]+=' '
|
||||||
|
|
|
||||||
|
|
@ -76,16 +76,6 @@ emulate zsh -o prompt_percent -c 'print -P "%F{#ff0000}red%F{green}%B bold green
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
bug: open a new tab and hit ctrl-p. an empty line will appear before prompt.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
take a look at https://github.com/skywind3000/z.lua. it claims to have fzf support. would be nice
|
|
||||||
if alt-down showed two groups -- one for subdirs and another for directory history (sorted by
|
|
||||||
frequency of use? by last use? three sections? more key bindings?).
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
add `p10k explain` that prints something like this:
|
add `p10k explain` that prints something like this:
|
||||||
|
|
||||||
```text
|
```text
|
||||||
|
|
@ -163,7 +153,8 @@ Prompt connection should have matching options.
|
||||||
Add `POWERLEVEL9K_{LEFT,RIGHT}_SEGMENT_MIRROR_SEPARATOR`. If set, left segments get separated with
|
Add `POWERLEVEL9K_{LEFT,RIGHT}_SEGMENT_MIRROR_SEPARATOR`. If set, left segments get separated with
|
||||||
`POWERLEVEL9K_LEFT_SEGMENT_SEPARATOR` followed by `POWERLEVEL9K_LEFT_SEGMENT_MIRROR_SEPARATOR`.
|
`POWERLEVEL9K_LEFT_SEGMENT_SEPARATOR` followed by `POWERLEVEL9K_LEFT_SEGMENT_MIRROR_SEPARATOR`.
|
||||||
Each is drawn without background. The first with the foreground of left segment, the second with
|
Each is drawn without background. The first with the foreground of left segment, the second with
|
||||||
the background of right segment. To insert space in between, embed it in one of these parameters.
|
the background of right segment. To insert space in between, embed it in
|
||||||
|
`POWERLEVEL9K_{LEFT,RIGHT}_SEGMENT_MIRROR_SEPARATOR`.
|
||||||
`POWERLEVEL9K_{LEFT,RIGHT}_SUBSEGMENT_SEPARATOR` is unused.
|
`POWERLEVEL9K_{LEFT,RIGHT}_SUBSEGMENT_SEPARATOR` is unused.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
@ -177,41 +168,6 @@ two filled separators similar to heads and tail. Figure out how to present this
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
Get rid of `saved_columns` in the wizard and always present all options as if horizontal space was
|
|
||||||
unlimited. `print_prompt` should print something like this if prompt is too wide:
|
|
||||||
|
|
||||||
Terminal window too narrow to display prompt.
|
|
||||||
Make it wider and press ENTER to refresh.
|
|
||||||
|
|
||||||
Terminal dimensions will need to be checked more often.
|
|
||||||
|
|
||||||
Try getting rid of the "press ENTER" requirement by trapping `SIGWINCH`. Might need to run `read -k`
|
|
||||||
with timeout in a loop.
|
|
||||||
|
|
||||||
Print all text with a helper function that keeps track of the number of lines remaining on screen.
|
|
||||||
`print_prompt` will then be able to show a similar message for Terminal window being too short. This
|
|
||||||
makes sense only for two-line prompts. This is probably OK.
|
|
||||||
|
|
||||||
If `print_prompt` can be told in advance how many prompts we are going to display, it might be able
|
|
||||||
to insert or avoid inserting `\n` in between, depending on terminal height. There is one screen
|
|
||||||
where one prompt is a one-liner while another is a two-liner. This is fine because there are only
|
|
||||||
two options. `print_prompt` can assume that all options will use the current prompt height.
|
|
||||||
|
|
||||||
Don't use `print_prompt` directly. Create `ask_prompt` and use it like this:
|
|
||||||
|
|
||||||
```zsh
|
|
||||||
ask_prompt \
|
|
||||||
1 "No frame" "left_frame=0 right_frame=0" \
|
|
||||||
2 "Left frame" "left_frame=1 right_frame=0" \
|
|
||||||
...
|
|
||||||
```
|
|
||||||
|
|
||||||
There are two prompt questions that don't fit this pattern: `ask_empty_line` and
|
|
||||||
`ask_transient_prompt`. The first is easy to adapt (`print_prompt` can print prompt twice if
|
|
||||||
`empty_line=1`) but the second will probably have to be hand-coded.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
Optimize auto-wizard check.
|
Optimize auto-wizard check.
|
||||||
|
|
||||||
```text
|
```text
|
||||||
|
|
@ -225,3 +181,17 @@ user=0.17s system=0.00s cpu=99% total=0.175
|
||||||
---
|
---
|
||||||
|
|
||||||
Add the equivalent of `P9K_PYTHON_VERSION` to all `*env` segments where it makes sense.
|
Add the equivalent of `P9K_PYTHON_VERSION` to all `*env` segments where it makes sense.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
Define `P9K_ICON` on initialization. Fill it with `$icon`. Duplicate every key that ends in `_ICON`.
|
||||||
|
Respect `POWERLEVEL9K_VCS_STASH_ICON` overrides but not anything with segment name or state.
|
||||||
|
|
||||||
|
Define `POWERLEVEL9K_VCS_*` parameters in config templates for all symbols used in
|
||||||
|
`my_git_formatter`. Add missing entries to `icons`. Use `$P9K_ICON[...]` within `my_git_formatter`.
|
||||||
|
Add a screen to the wizard to choose between clear and circled icons.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
Add a screen to the wizard asking whether to set `POWERLEVEL9K_VCS_DISABLED_WORKDIR_PATTERN='~'`.
|
||||||
|
Show it only if there is `$HOME/.git`. By default this parameter should be commented out.
|
||||||
|
|
|
||||||
2460
internal/p10k.zsh
2460
internal/p10k.zsh
File diff suppressed because it is too large
Load diff
|
|
@ -102,7 +102,7 @@ typeset -grA __p9k_pb_term_skip=(
|
||||||
|
|
||||||
# Usage: _p9k_parse_buffer <buffer> [token-limit]
|
# Usage: _p9k_parse_buffer <buffer> [token-limit]
|
||||||
#
|
#
|
||||||
# Parses the specified command line buffer and pupulates array P9K_COMMANDS
|
# Parses the specified command line buffer and populates array P9K_COMMANDS
|
||||||
# with commands from it. Terminates early and returns 1 if there are more
|
# with commands from it. Terminates early and returns 1 if there are more
|
||||||
# tokens than the specified limit.
|
# tokens than the specified limit.
|
||||||
#
|
#
|
||||||
|
|
@ -152,7 +152,7 @@ function _p9k_parse_buffer() {
|
||||||
local -r var="\$$id|\${$id}|\"\$$id\"|\"\${$id}\""
|
local -r var="\$$id|\${$id}|\"\$$id\"|\"\${$id}\""
|
||||||
|
|
||||||
local -i e ic c=${2:-'1 << 62'}
|
local -i e ic c=${2:-'1 << 62'}
|
||||||
local skip n s r state cmd prev
|
local skip n s r state token cmd prev
|
||||||
local -a aln alp alf v
|
local -a aln alp alf v
|
||||||
|
|
||||||
if [[ -o interactive_comments ]]; then
|
if [[ -o interactive_comments ]]; then
|
||||||
|
|
|
||||||
612
internal/wizard.zsh
Executable file → Normal file
612
internal/wizard.zsh
Executable file → Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -89,12 +89,15 @@ function _p9k_worker_invoke() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function _p9k_worker_cleanup() {
|
function _p9k_worker_cleanup() {
|
||||||
eval "$__p9k_intro"
|
# __p9k_intro bugs out here in some cases for some reason.
|
||||||
|
emulate -L zsh
|
||||||
[[ $_p9k__worker_shell_pid == $sysparams[pid] ]] && _p9k_worker_stop
|
[[ $_p9k__worker_shell_pid == $sysparams[pid] ]] && _p9k_worker_stop
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
function _p9k_worker_stop() {
|
function _p9k_worker_stop() {
|
||||||
|
# See comments in _p9k_worker_cleanup.
|
||||||
|
emulate -L zsh
|
||||||
add-zsh-hook -D zshexit _p9k_worker_cleanup
|
add-zsh-hook -D zshexit _p9k_worker_cleanup
|
||||||
[[ -n $_p9k__worker_resp_fd ]] && zle -F $_p9k__worker_resp_fd
|
[[ -n $_p9k__worker_resp_fd ]] && zle -F $_p9k__worker_resp_fd
|
||||||
[[ -n $_p9k__worker_resp_fd ]] && exec {_p9k__worker_resp_fd}>&-
|
[[ -n $_p9k__worker_resp_fd ]] && exec {_p9k__worker_resp_fd}>&-
|
||||||
|
|
@ -178,7 +181,13 @@ function _p9k_worker_start() {
|
||||||
setopt monitor || return
|
setopt monitor || return
|
||||||
{
|
{
|
||||||
[[ -n $_p9k__worker_resp_fd ]] && return
|
[[ -n $_p9k__worker_resp_fd ]] && return
|
||||||
_p9k__worker_file_prefix=${TMPDIR:-/tmp}/p10k.worker.$EUID.$sysparams[pid].$EPOCHSECONDS
|
|
||||||
|
if [[ -n "$TMPDIR" && ( ( -d "$TMPDIR" && -w "$TMPDIR" ) || ! ( -d /tmp && -w /tmp ) ) ]]; then
|
||||||
|
local tmpdir=$TMPDIR
|
||||||
|
else
|
||||||
|
local tmpdir=/tmp
|
||||||
|
fi
|
||||||
|
_p9k__worker_file_prefix=$tmpdir/p10k.worker.$EUID.$sysparams[pid].$EPOCHSECONDS
|
||||||
|
|
||||||
sysopen -r -o cloexec -u _p9k__worker_resp_fd <(
|
sysopen -r -o cloexec -u _p9k__worker_resp_fd <(
|
||||||
exec 0</dev/null
|
exec 0</dev/null
|
||||||
|
|
|
||||||
|
|
@ -22,9 +22,8 @@
|
||||||
# Leading spaces before `local` are important. Otherwise Antigen will remove `local` (!!!).
|
# Leading spaces before `local` are important. Otherwise Antigen will remove `local` (!!!).
|
||||||
# __p9k_trapint is to work around bugs in zsh: https://www.zsh.org/mla/workers/2020/msg00612.html.
|
# __p9k_trapint is to work around bugs in zsh: https://www.zsh.org/mla/workers/2020/msg00612.html.
|
||||||
# Likewise for `trap ":"` instead of the plain `trap ""`.
|
# Likewise for `trap ":"` instead of the plain `trap ""`.
|
||||||
typeset -gr __p9k_intro_base='emulate -L zsh -o no_hist_expand -o extended_glob -o no_prompt_bang -o prompt_percent -o no_prompt_subst -o no_aliases -o no_bg_nice -o typeset_silent
|
typeset -gr __p9k_intro_base='emulate -L zsh -o no_hist_expand -o extended_glob -o no_prompt_bang -o prompt_percent -o no_prompt_subst -o no_aliases -o no_bg_nice -o typeset_silent -o no_rematch_pcre
|
||||||
trap ":" INT
|
(( $+__p9k_trapped )) || { local -i __p9k_trapped; trap : INT; trap "trap ${(q)__p9k_trapint:--} INT" EXIT }
|
||||||
trap "trap ${(q)__p9k_trapint:--} INT" EXIT
|
|
||||||
local -a match mbegin mend
|
local -a match mbegin mend
|
||||||
local -i MBEGIN MEND OPTIND
|
local -i MBEGIN MEND OPTIND
|
||||||
local MATCH OPTARG IFS=$'\'' \t\n\0'\'
|
local MATCH OPTARG IFS=$'\'' \t\n\0'\'
|
||||||
|
|
@ -58,7 +57,7 @@ function _p9k_init_locale() {
|
||||||
if [[ $__p9k_dump_file != $__p9k_instant_prompt_dump_file ]] && (( ! $+functions[_p9k_preinit] )) && source $__p9k_dump_file 2>/dev/null && (( $+functions[_p9k_preinit] )); then
|
if [[ $__p9k_dump_file != $__p9k_instant_prompt_dump_file ]] && (( ! $+functions[_p9k_preinit] )) && source $__p9k_dump_file 2>/dev/null && (( $+functions[_p9k_preinit] )); then
|
||||||
_p9k_preinit
|
_p9k_preinit
|
||||||
fi
|
fi
|
||||||
typeset -gr __p9k_sourced=11
|
typeset -gr __p9k_sourced=13
|
||||||
if [[ $ZSH_VERSION == (5.<1->*|<6->.*) ]]; then
|
if [[ $ZSH_VERSION == (5.<1->*|<6->.*) ]]; then
|
||||||
if [[ -w $__p9k_root_dir && -w $__p9k_root_dir/internal && -w $__p9k_root_dir/gitstatus ]]; then
|
if [[ -w $__p9k_root_dir && -w $__p9k_root_dir/internal && -w $__p9k_root_dir/gitstatus ]]; then
|
||||||
local f
|
local f
|
||||||
|
|
@ -75,7 +74,7 @@ function _p9k_init_locale() {
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
source $__p9k_root_dir/internal/p10k.zsh || true
|
builtin source $__p9k_root_dir/internal/p10k.zsh || true
|
||||||
}
|
}
|
||||||
|
|
||||||
(( $+__p9k_instant_prompt_active )) && unsetopt prompt_cr prompt_sp || setopt prompt_cr prompt_sp
|
(( $+__p9k_instant_prompt_active )) && unsetopt prompt_cr prompt_sp || setopt prompt_cr prompt_sp
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue