Compare commits
751 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
32eac3ccb7 | ||
|
|
20f08b881a | ||
|
|
214858f413 | ||
|
|
7b3d155608 | ||
|
|
207e99876d | ||
|
|
4c46d7d245 | ||
|
|
25b85800a5 | ||
|
|
380607583e | ||
|
|
26af1066e1 | ||
|
|
97cd2b47b8 | ||
|
|
9de0e393ab | ||
|
|
5578c122ab | ||
|
|
5ba7c9eb60 | ||
|
|
cc759a8b8f | ||
|
|
bddc870340 | ||
|
|
09bb6a055d | ||
|
|
61fed6a214 | ||
|
|
c03fa38974 | ||
|
|
bb60d41842 | ||
|
|
653c24cee1 | ||
|
|
bdff489850 | ||
|
|
162b41c4d0 | ||
|
|
55915f95f1 | ||
|
|
e7c7ef6814 | ||
|
|
04f73e7303 | ||
|
|
ba48d26dd4 | ||
|
|
5a887fe1ef | ||
|
|
e79ea93d7d | ||
|
|
615c9050e7 | ||
|
|
c59bb509bd | ||
|
|
a7d8b1bacf | ||
|
|
968f469289 | ||
|
|
c38d05b04f | ||
|
|
695c786354 | ||
|
|
16aced7f9f | ||
|
|
d6d4d87cf7 | ||
|
|
b3ee94d87a | ||
|
|
3a5aa5ee83 | ||
|
|
0ead42e52b | ||
|
|
6703adc37f | ||
|
|
43aabf046c | ||
|
|
2108959644 | ||
|
|
3a33c0b290 | ||
|
|
fb193529fc | ||
|
|
75dce1ef4b | ||
|
|
42f4386e2e | ||
|
|
edd723d95c | ||
|
|
05fbbc1c43 | ||
|
|
2540c07f1d | ||
|
|
188789592e | ||
|
|
99c48bca36 | ||
|
|
601af3de81 | ||
|
|
3d31e9a22a | ||
|
|
793394c862 | ||
|
|
514d00803c | ||
|
|
977c66e7c5 | ||
|
|
450a344426 | ||
|
|
5fc2b97194 | ||
|
|
efb2eb5073 | ||
|
|
1606dce62e | ||
|
|
bb843e0494 | ||
|
|
1b4008c58b | ||
|
|
a45932973a | ||
|
|
00ee538c95 | ||
|
|
4ef5b48474 | ||
|
|
e6aa06cdf3 | ||
|
|
e42635197c | ||
|
|
b8324be8c4 | ||
|
|
197bc6a877 | ||
|
|
536933ca24 | ||
|
|
a118af0d1b | ||
|
|
f885baba61 | ||
|
|
a2deff3689 | ||
|
|
5d6acfd1d4 | ||
|
|
d59d6e8765 | ||
|
|
bdb2f2bd1a | ||
|
|
4a5444d196 | ||
|
|
ce5a1cf2f9 | ||
|
|
c6f5cbdf0c | ||
|
|
6048e23e09 | ||
|
|
3d75167e67 | ||
|
|
ee2407496f | ||
|
|
175852e527 | ||
|
|
d36f15c26b | ||
|
|
742cd7f371 | ||
|
|
41b2d0cb29 | ||
|
|
a95b6a39c9 | ||
|
|
bd0bf836c7 | ||
|
|
ae1e11db22 | ||
|
|
347197865f | ||
|
|
91b79a2e9e | ||
|
|
70dc388dff | ||
|
|
bba8da76b6 | ||
|
|
9abd0da1c7 | ||
|
|
6fbae3bd7b | ||
|
|
9191cae13b | ||
|
|
a18b6dcc29 | ||
|
|
c553e3028e | ||
|
|
745d5687b8 | ||
|
|
8a4a44896a | ||
|
|
4420447e74 | ||
|
|
11310b89f0 | ||
|
|
a02bacdd53 | ||
|
|
543290ab07 | ||
|
|
fd5a03dc5f | ||
|
|
f3063e86aa | ||
|
|
3cb587945a | ||
|
|
9a21884272 | ||
|
|
4f5dd53571 | ||
|
|
4b34486143 | ||
|
|
63935ba0fb | ||
|
|
d9f9fb51ff | ||
|
|
c2f37705ad | ||
|
|
72406fa3f2 | ||
|
|
104accdc34 | ||
|
|
d7d4dca6ba | ||
|
|
7f3e396383 | ||
|
|
3cd311819b | ||
|
|
9c3881f6f8 | ||
|
|
d590d508ca | ||
|
|
2f555a6936 | ||
|
|
28cd9dff47 | ||
|
|
77c7b91b40 | ||
|
|
a0bac34329 | ||
|
|
2c244b5e83 | ||
|
|
dd8d6fbe6c | ||
|
|
acf6611098 | ||
|
|
a2925fa5da | ||
|
|
240b49f9d2 | ||
|
|
d4331ce7fe | ||
|
|
4d076a71f7 | ||
|
|
90c2415b64 | ||
|
|
692f8f4ea4 | ||
|
|
61be2267ab | ||
|
|
c30541b954 | ||
|
|
3bfcd5e086 | ||
|
|
b6f4a0dae2 | ||
|
|
92875711c6 | ||
|
|
89b3203bfa | ||
|
|
08b32cb901 | ||
|
|
1fa1045af9 | ||
|
|
e02cb9cfb9 | ||
|
|
718dd4afae | ||
|
|
c641d52e06 | ||
|
|
029b380c15 | ||
|
|
4c5ff80bbd | ||
|
|
f1016322b9 | ||
|
|
6dcae2cade | ||
|
|
fb6658e8fd | ||
|
|
1dce607c42 | ||
|
|
10cb4180f6 | ||
|
|
5534fc48b1 | ||
|
|
9556b0fe89 | ||
|
|
ddad6ce136 | ||
|
|
14d168c254 | ||
|
|
167f04a4df | ||
|
|
5f115785cf | ||
|
|
7caf0b9ec4 | ||
|
|
94633c346a | ||
|
|
7e76369ec8 | ||
|
|
002ff002fe | ||
|
|
0948a407d0 | ||
|
|
90b5b21394 | ||
|
|
8e2fa0fdbd | ||
|
|
0af8f5c691 | ||
|
|
970a7519d4 | ||
|
|
0d9c492998 | ||
|
|
82b632e4ec | ||
|
|
27fec51439 | ||
|
|
20fa578b12 | ||
|
|
f7eca99496 | ||
|
|
53233e47a3 | ||
|
|
d7ed4f1fa8 | ||
|
|
d14a4a2b1a | ||
|
|
dacffdb095 | ||
|
|
74e863ed73 | ||
|
|
3de6d2e859 | ||
|
|
6e12f81223 | ||
|
|
4f0fbaba8e | ||
|
|
392f83e71d | ||
|
|
d343f616fc | ||
|
|
8c502378aa | ||
|
|
07eabc5328 | ||
|
|
95ffc291f6 | ||
|
|
8f5d0098d6 | ||
|
|
4eef1ce10f | ||
|
|
f744d906be | ||
|
|
fa3ce14b25 | ||
|
|
e6097229ce | ||
|
|
b239c77d74 | ||
|
|
9e08512927 | ||
|
|
eedd1f8e6a | ||
|
|
c69a6dde67 | ||
|
|
4339030c9d | ||
|
|
bc7acbde5c | ||
|
|
512c6fb127 | ||
|
|
b90af74d15 | ||
|
|
f1f3442e38 | ||
|
|
d4d5a54e63 | ||
|
|
748fc809b5 | ||
|
|
bdd7271da9 | ||
|
|
a34e3ccc86 | ||
|
|
3390c16f52 | ||
|
|
4b20f522f0 | ||
|
|
4636309117 | ||
|
|
7783c81861 | ||
|
|
3e55d0d7f2 | ||
|
|
ff09ef6d71 | ||
|
|
99d26e44ee | ||
|
|
19bf4d0544 | ||
|
|
6b860f8690 | ||
|
|
182272b8b5 | ||
|
|
e64d66ab24 | ||
|
|
41ebdc3cb6 | ||
|
|
8ccb959992 | ||
|
|
13e904c20d | ||
|
|
77f0584d0d | ||
|
|
d2767fb84a | ||
|
|
49caab47a6 | ||
|
|
08361be9f0 | ||
|
|
2674982c7b | ||
|
|
dbe02ebe41 | ||
|
|
0ea5143493 | ||
|
|
f5370fcff5 | ||
|
|
7b79281437 | ||
|
|
acc2da7310 | ||
|
|
68e525df58 | ||
|
|
2cd67fdd0a | ||
|
|
2600f53bdd | ||
|
|
da9cc77db8 | ||
|
|
75f9141cac | ||
|
|
f03b684bd8 | ||
|
|
4822f967b2 | ||
|
|
dc208b66b3 | ||
|
|
77ebc45336 | ||
|
|
d94519a93c | ||
|
|
4d5b715dc4 | ||
|
|
8a84cb609e | ||
|
|
5f8ae44233 | ||
|
|
4283195803 | ||
|
|
44f309678b | ||
|
|
4846ff7950 | ||
|
|
0ec2aada26 | ||
|
|
dfa0f5701e | ||
|
|
b1744278d1 | ||
|
|
2e2cb67cf1 | ||
|
|
1572bc8c75 | ||
|
|
6be5f7cb29 | ||
|
|
2334faa7fd | ||
|
|
58db0baaf4 | ||
|
|
0162dbd485 | ||
|
|
1fe4a4ee9d | ||
|
|
50a4fe9623 | ||
|
|
061c68ce92 | ||
|
|
20b89d5d13 | ||
|
|
c299ea9369 | ||
|
|
d2dd2d553f | ||
|
|
b6b495e1bc | ||
|
|
d4559c7f00 | ||
|
|
0a747ddafc | ||
|
|
375a38a489 | ||
|
|
9ac27de7d8 | ||
|
|
7308893adb | ||
|
|
a51dd8fc52 | ||
|
|
86a38980e4 | ||
|
|
c4330a1e36 | ||
|
|
4d339f05af | ||
|
|
e24adbc3c2 | ||
|
|
7d7a047fcc | ||
|
|
aa1f8a428b | ||
|
|
f21b1dfa4d | ||
|
|
6050fa3a43 | ||
|
|
ca7c9a68f1 | ||
|
|
48ec834ec9 | ||
|
|
e7c2e90236 | ||
|
|
23bc4d66bf | ||
|
|
c6a9b63189 | ||
|
|
7dfc72003f | ||
|
|
1c1a39f597 | ||
|
|
121dcc645f | ||
|
|
8555456050 | ||
|
|
22dc87934a | ||
|
|
335a736eed | ||
|
|
1149e51f72 | ||
|
|
9012cebbf2 | ||
|
|
6425bd2fe0 | ||
|
|
241938a86d | ||
|
|
f511e61832 | ||
|
|
b9b89cce7e | ||
|
|
e9a66d68b7 | ||
|
|
49caa4bf31 | ||
|
|
c60a8e9836 | ||
|
|
b37d0df89b | ||
|
|
67422eea36 | ||
|
|
c4226f3745 | ||
|
|
d32da917e4 | ||
|
|
46e36c0e68 | ||
|
|
86491e1512 | ||
|
|
e46f66b468 | ||
|
|
1f0ce1a5d9 | ||
|
|
4a4c888d7d | ||
|
|
ace319b515 | ||
|
|
e73ea8d608 | ||
|
|
f7224d8459 | ||
|
|
95b0647c91 | ||
|
|
9ef8faf9b1 | ||
|
|
7d8c1494d7 | ||
|
|
33f8a02fb5 | ||
|
|
1618ee78b7 | ||
|
|
efab1daa7e | ||
|
|
9a305b2d73 | ||
|
|
02c64f3f1e | ||
|
|
d86059016e | ||
|
|
088ca6b963 | ||
|
|
6ae354f564 | ||
|
|
799fce0dc6 | ||
|
|
68dfd6aa3a | ||
|
|
dd1de3efbf | ||
|
|
521dac8086 | ||
|
|
ad7d4eb07d | ||
|
|
a459d8a9b3 | ||
|
|
4aee5977d6 | ||
|
|
f2085fcd92 | ||
|
|
c47d75ceda | ||
|
|
9ecdbcc7bc | ||
|
|
dafe49d28c | ||
|
|
2d33c20231 | ||
|
|
5963bf6ace | ||
|
|
dab1493644 | ||
|
|
acc911737d | ||
|
|
2d614c68f5 | ||
|
|
d0cab2a367 | ||
|
|
7576611782 | ||
|
|
ed65d9cdbd | ||
|
|
dbb887b4a9 | ||
|
|
06f4028697 | ||
|
|
3413b70413 | ||
|
|
6a8b510db8 | ||
|
|
f598e348c4 | ||
|
|
6dd2cfba34 | ||
|
|
ae748b2644 | ||
|
|
a0b63d6b1e | ||
|
|
89e85db790 | ||
|
|
a73669be6a | ||
|
|
8c57756556 | ||
|
|
b8afde043c | ||
|
|
eefd6e8336 | ||
|
|
6829ed1bb4 | ||
|
|
7d5577a2ed | ||
|
|
a41225c4e0 | ||
|
|
a0d2d95b41 | ||
|
|
e14a3b8687 | ||
|
|
846842be80 | ||
|
|
e845db84ad | ||
|
|
193040c41e | ||
|
|
871f9a1269 | ||
|
|
5319cb6e10 | ||
|
|
208928ded5 | ||
|
|
4d7eb3bd15 | ||
|
|
6b73e2aa58 | ||
|
|
6ddd283d0f | ||
|
|
e70a67d958 | ||
|
|
67c0c9a66c | ||
|
|
42741c963e | ||
|
|
9d316de15a | ||
|
|
ecbcf242d5 | ||
|
|
fd3710d869 | ||
|
|
11d7ca1d73 | ||
|
|
c3779dd16e | ||
|
|
442a4b0da0 | ||
|
|
c9e129cda2 | ||
|
|
64d7fae03a | ||
|
|
44d8245605 | ||
|
|
93daf089b5 | ||
|
|
7645ae1907 | ||
|
|
3d496c2200 | ||
|
|
ff9b6c9469 | ||
|
|
05b97e9ec2 | ||
|
|
8f32d102ae | ||
|
|
5a380da3bb | ||
|
|
5e44cb6ba2 | ||
|
|
fad858782c | ||
|
|
5246ab15cb | ||
|
|
bbb7fb0c82 | ||
|
|
c59264d6b4 | ||
|
|
a3774dc586 | ||
|
|
ee652677a6 | ||
|
|
ceeb5bf8bd | ||
|
|
c995bafa7a | ||
|
|
f8340d88be | ||
|
|
592d5645a5 | ||
|
|
f9a7ecf3a9 | ||
|
|
387e54498e | ||
|
|
fad43d4b16 | ||
|
|
8d057e6f96 | ||
|
|
b2e88347b3 | ||
|
|
1af02e0a67 | ||
|
|
30cc88a4c5 | ||
|
|
32d326ca4a | ||
|
|
ae92d7d186 | ||
|
|
c16e791cdc | ||
|
|
fbd62e0071 | ||
|
|
1eb0777799 | ||
|
|
58e506a675 | ||
|
|
1b98a04c93 | ||
|
|
4c0347d9f2 | ||
|
|
9a3238c20b | ||
|
|
6e48b236a1 | ||
|
|
16f6d9dfa0 | ||
|
|
d37954322a | ||
|
|
258ab8b147 | ||
|
|
6663ca3d75 | ||
|
|
adbc9d95de | ||
|
|
fbe544984c | ||
|
|
b9d5912a4f | ||
|
|
3e2761e81f | ||
|
|
6997b34a81 | ||
|
|
5960e8f1ee | ||
|
|
81ffeebfb1 | ||
|
|
f14fe96e19 | ||
|
|
954bea36f4 | ||
|
|
388c024298 | ||
|
|
9b8adc1951 | ||
|
|
bf371f70d1 | ||
|
|
7c28ffc856 | ||
|
|
14820e5d18 | ||
|
|
80a34eec81 | ||
|
|
d5203e5b37 | ||
|
|
91b6629103 | ||
|
|
93d66a9258 | ||
|
|
8d7341da6e | ||
|
|
d1602e383c | ||
|
|
c45f6681b3 | ||
|
|
dce6a98f38 | ||
|
|
982ffde002 | ||
|
|
888adb57ec | ||
|
|
c36fe3a004 | ||
|
|
729564cc27 | ||
|
|
4d32991bee | ||
|
|
69736d68aa | ||
|
|
28a2d15fef | ||
|
|
a90e275d5e | ||
|
|
fc67558717 | ||
|
|
196b400abf | ||
|
|
05a2af2d7c | ||
|
|
1ff4464b2f | ||
|
|
60611e9c2b | ||
|
|
79cf33b9f1 | ||
|
|
b8630968b2 | ||
|
|
2fee12d930 | ||
|
|
3ae2fe3272 | ||
|
|
2b8c92e8fd | ||
|
|
8ce64ea784 | ||
|
|
8ea2626de8 | ||
|
|
65ba449460 | ||
|
|
cbc12e5443 | ||
|
|
587bd0cd62 | ||
|
|
309edd0585 | ||
|
|
2837b72064 | ||
|
|
38ef38b72f | ||
|
|
6c3565c520 | ||
|
|
9bb2c01a44 | ||
|
|
09873f0ed9 | ||
|
|
c9e1899594 | ||
|
|
b405dc436c | ||
|
|
4a6c1269fb | ||
|
|
44ac6b8044 | ||
|
|
80de22a159 | ||
|
|
04b39ea64e | ||
|
|
116aa5cdbd | ||
|
|
9c49f46b01 | ||
|
|
f7ff005dd5 | ||
|
|
d40ccd0da8 | ||
|
|
6f66af9ab9 | ||
|
|
2d27e484c7 | ||
|
|
a77ccf4bd1 | ||
|
|
4cb8efbecc | ||
|
|
8fc4187713 | ||
|
|
ce076927f3 | ||
|
|
8eb614f69e | ||
|
|
347dd1c799 | ||
|
|
82b7e4ea01 | ||
|
|
d7d4a6c632 | ||
|
|
a18b41911d | ||
|
|
52309615c1 | ||
|
|
65dfabc430 | ||
|
|
936937ec78 | ||
|
|
e163dd8216 | ||
|
|
06a9f98878 | ||
|
|
b665843085 | ||
|
|
ee4fbc58f7 | ||
|
|
3081b0c576 | ||
|
|
b7a527b122 | ||
|
|
54a6668846 | ||
|
|
ed0f7453c9 | ||
|
|
19fe929d1f | ||
|
|
392e863e6d | ||
|
|
2ff347f9a8 | ||
|
|
1d8331d0c5 | ||
|
|
718db71638 | ||
|
|
0a28b50a8c | ||
|
|
70bc318a01 | ||
|
|
22817089db | ||
|
|
aecd80702e | ||
|
|
abd7a0cf25 | ||
|
|
e30fba0b8f | ||
|
|
b5ea14c896 | ||
|
|
5b33a5917c | ||
|
|
66b71cc857 | ||
|
|
c8237437d2 | ||
|
|
57544fe694 | ||
|
|
e90c66a102 | ||
|
|
db1d859881 | ||
|
|
cc961d40b3 | ||
|
|
29cebaa0a7 | ||
|
|
2c7bbe9852 | ||
|
|
eb74623b7d | ||
|
|
b9260575e5 | ||
|
|
8cf676176d | ||
|
|
3db5673e70 | ||
|
|
46f5034030 | ||
|
|
6f7e7c5199 | ||
|
|
2ba11e8401 | ||
|
|
b084bf721e | ||
|
|
e40860c3e9 | ||
|
|
2bcd0eb09f | ||
|
|
94c34a29c4 | ||
|
|
7fb37c0069 | ||
|
|
ce2ede70f2 | ||
|
|
b91adc9f29 | ||
|
|
86b3e456e1 | ||
|
|
1eb4684b60 | ||
|
|
a3904ff039 | ||
|
|
88828265c0 | ||
|
|
600653538b | ||
|
|
28635c1f6d | ||
|
|
b09f6cc731 | ||
|
|
c8910901e5 | ||
|
|
6b7fd36863 | ||
|
|
20b091dcd8 | ||
|
|
106535e3eb | ||
|
|
d3520536c4 | ||
|
|
05e5a7e5fd | ||
|
|
2b07dea3a6 | ||
|
|
629686f760 | ||
|
|
c71c0fca6e | ||
|
|
9207fff627 | ||
|
|
dae7794bdf | ||
|
|
c087d8c318 | ||
|
|
6dfa74bd5d | ||
|
|
e9b29613b2 | ||
|
|
d01ce7d812 | ||
|
|
8ce1d15885 | ||
|
|
4d9e0ea802 | ||
|
|
2f04a49129 | ||
|
|
6dc33fe88f | ||
|
|
effad1a5c3 | ||
|
|
05efdb74f0 | ||
|
|
d3bcff31e5 | ||
|
|
430f0e5d65 | ||
|
|
4dff1d4b2b | ||
|
|
56df72f61c | ||
|
|
8fdd456fa9 | ||
|
|
3e1176e896 | ||
|
|
52a8b1d911 | ||
|
|
3ecd4030e3 | ||
|
|
841a004acd | ||
|
|
839975c348 | ||
|
|
185aa104b0 | ||
|
|
24d56023fd | ||
|
|
d3e7a8c797 | ||
|
|
b2279c9565 | ||
|
|
52906407af | ||
|
|
2721e19ee6 | ||
|
|
388912d4a7 | ||
|
|
f62b3d0e9d | ||
|
|
2d0fdaeec6 | ||
|
|
b9348180f5 | ||
|
|
1e2b9cb5ed | ||
|
|
62702a4878 | ||
|
|
c85738574c | ||
|
|
96a8e5df83 | ||
|
|
85b4ff4f81 | ||
|
|
0f6eff1f20 | ||
|
|
7a5e702334 | ||
|
|
8687ed2068 | ||
|
|
2be0e966e1 | ||
|
|
facb53e81f | ||
|
|
2bfc0e1da6 | ||
|
|
6d24b22b21 | ||
|
|
5f0fa71f32 | ||
|
|
4f81e55e41 | ||
|
|
ca0122c3cb | ||
|
|
7200b16520 | ||
|
|
e488daae16 | ||
|
|
f3df15650a | ||
|
|
f8a9a970b2 | ||
|
|
75e21c4853 | ||
|
|
495b63d7dc | ||
|
|
52983c7188 | ||
|
|
2211a79840 | ||
|
|
daca57129f | ||
|
|
19c7c0763f | ||
|
|
14c6550593 | ||
|
|
7aae93e7ed | ||
|
|
dffba78401 | ||
|
|
a8a1a4985f | ||
|
|
31683d9e2a | ||
|
|
00e143d47e | ||
|
|
6e9ba3fc01 | ||
|
|
a373f6b654 | ||
|
|
91bd28d410 | ||
|
|
acde076913 | ||
|
|
f5655526d0 | ||
|
|
56f956ff90 | ||
|
|
f97c1c7136 | ||
|
|
9ee883ee1b | ||
|
|
1887512ba1 | ||
|
|
2ae13c4092 | ||
|
|
c5f1771375 | ||
|
|
c4bace504c | ||
|
|
3bfeed31bc | ||
|
|
d774de6c46 | ||
|
|
b20041d85d | ||
|
|
e4900db9a2 | ||
|
|
e2bfa5e019 | ||
|
|
423d8495e4 | ||
|
|
1fb2b8efd5 | ||
|
|
3299d4a25c | ||
|
|
e125bbeb4d | ||
|
|
55c59253d6 | ||
|
|
e7deab92c7 | ||
|
|
d21f29cb14 | ||
|
|
d8a808f76c | ||
|
|
5ef6636237 | ||
|
|
fc632f50ec | ||
|
|
31e4c9023e | ||
|
|
3e1c341933 | ||
|
|
0d1016d4d2 | ||
|
|
12725f4418 | ||
|
|
5c64d034a2 | ||
|
|
14fa9cf7b7 | ||
|
|
6c196b8f8d | ||
|
|
18d6dfea88 | ||
|
|
d2eb8eb9fc | ||
|
|
65f73d3e95 | ||
|
|
265b4edb2e | ||
|
|
18f5af835f | ||
|
|
7ef80d563b | ||
|
|
d3be9a7363 | ||
|
|
5f29e5a5e8 | ||
|
|
cf4d58f30a | ||
|
|
bb61461aad | ||
|
|
c91c8bbc45 | ||
|
|
f26a125d15 | ||
|
|
de626dcbbc | ||
|
|
c9b963e82b | ||
|
|
a1cd0acac5 | ||
|
|
c2f9d889f4 | ||
|
|
cdece498c1 | ||
|
|
58bdc6a41c | ||
|
|
c55cd82b39 | ||
|
|
91588fb8bb | ||
|
|
6b9600fecd | ||
|
|
0bfb29789c | ||
|
|
f6a62e258e | ||
|
|
1ba05d1ffa | ||
|
|
7a01143359 | ||
|
|
35496f461f | ||
|
|
b9cd0287f4 | ||
|
|
9d741f89e2 | ||
|
|
cc4370f1b2 | ||
|
|
85854c71d6 | ||
|
|
6ed550117c | ||
|
|
15fe85d18d | ||
|
|
b62e5eb822 | ||
|
|
25c2aaabcb | ||
|
|
cd49eef229 | ||
|
|
4f9fbbfa54 | ||
|
|
0b602632f2 | ||
|
|
dbc7471f83 | ||
|
|
887c44bf68 | ||
|
|
33236c222f | ||
|
|
4116490535 | ||
|
|
08e18387c9 | ||
|
|
0fff38c751 | ||
|
|
afc489869a | ||
|
|
ce4da59f34 | ||
|
|
43434254e0 | ||
|
|
66ce74d29b | ||
|
|
77a8420aaf | ||
|
|
b0f89f2bc1 | ||
|
|
7cda2dfd1a | ||
|
|
238cfa9547 | ||
|
|
b163b21ace | ||
|
|
30c4f08773 | ||
|
|
fd7c2a2012 | ||
|
|
4f14ce3285 | ||
|
|
e233022d1a | ||
|
|
e403c3b71b | ||
|
|
d367b7e1d6 | ||
|
|
038644f8d9 | ||
|
|
d650c597f9 | ||
|
|
5196009656 | ||
|
|
4d8515930f | ||
|
|
192cea97f2 | ||
|
|
5bfdbf116d | ||
|
|
83f3c2321e | ||
|
|
dff0583c12 | ||
|
|
73c7e54535 | ||
|
|
0f8c156f24 | ||
|
|
fff4509723 | ||
|
|
17af49d421 | ||
|
|
9f38631c7f | ||
|
|
62f4125927 | ||
|
|
a67e692d4a | ||
|
|
3c9cbc99d7 | ||
|
|
c5379fa52d | ||
|
|
070110af0c | ||
|
|
6bf5b15c13 | ||
|
|
a9779c2aa2 | ||
|
|
3af1853260 | ||
|
|
d638610db1 | ||
|
|
87023c39f8 | ||
|
|
e96610e31a | ||
|
|
d61b1d54de | ||
|
|
e397f568b7 | ||
|
|
d22fd3bbd1 | ||
|
|
75990c2867 | ||
|
|
88a1a702b4 | ||
|
|
24407dbf4a | ||
|
|
108285e9ac | ||
|
|
b728a37b6d | ||
|
|
938a93a0d7 | ||
|
|
ff6f727631 | ||
|
|
84077e0253 | ||
|
|
d2787cc2d8 | ||
|
|
17a56aa4f7 | ||
|
|
ca52892ab9 | ||
|
|
655bc8f215 | ||
|
|
a3912436be | ||
|
|
339bea1213 | ||
|
|
bad6cfae6f | ||
|
|
9389c8d854 | ||
|
|
6a17139423 | ||
|
|
3f23792df0 | ||
|
|
529031f44f | ||
|
|
f51894614d | ||
|
|
a7dbab79e5 | ||
|
|
4dcce810d2 | ||
|
|
1130e8c8ec |
29
.clang-tidy
Normal file
29
.clang-tidy
Normal file
@@ -0,0 +1,29 @@
|
||||
Checks: >
|
||||
-*,
|
||||
bugprone-*
|
||||
misc-*,
|
||||
modernize-*,
|
||||
performance-*,
|
||||
portability-*,
|
||||
readability-*,
|
||||
-fuchsia-trailing-return,
|
||||
-readability-magic-numbers,
|
||||
-modernize-use-nodiscard,
|
||||
-modernize-use-trailing-return-type,
|
||||
-readability-braces-around-statements,
|
||||
-readability-redundant-access-specifiers,
|
||||
-readability-redundant-member-init,
|
||||
-readability-redundant-string-init,
|
||||
-readability-identifier-length
|
||||
CheckOptions:
|
||||
- { key: readability-identifier-naming.NamespaceCase, value: lower_case }
|
||||
- { key: readability-identifier-naming.ClassCase, value: CamelCase }
|
||||
- { key: readability-identifier-naming.StructCase, value: CamelCase }
|
||||
- { key: readability-identifier-naming.FunctionCase, value: camelBack }
|
||||
- { key: readability-identifier-naming.VariableCase, value: camelBack }
|
||||
- { key: readability-identifier-naming.PrivateMemberCase, value: camelBack }
|
||||
- { key: readability-identifier-naming.PrivateMemberSuffix, value: _ }
|
||||
- { key: readability-identifier-naming.EnumCase, value: CamelCase }
|
||||
- { key: readability-identifier-naming.EnumConstantCase, value: UPPER_CASE }
|
||||
- { key: readability-identifier-naming.GlobalConstantCase, value: UPPER_CASE }
|
||||
- { key: readability-identifier-naming.StaticConstantCase, value: UPPER_CASE }
|
||||
65
.github/labeler.yml
vendored
Normal file
65
.github/labeler.yml
vendored
Normal file
@@ -0,0 +1,65 @@
|
||||
bug:
|
||||
- "(crash|bug|error|coredump|freeze|segfault|issue|problem)"
|
||||
|
||||
enhancement:
|
||||
- "(feature|enhancement|improvement|request|suggestion)"
|
||||
|
||||
hyprland:
|
||||
- "(hyprland)"
|
||||
|
||||
network:
|
||||
- "(network|wifi|ethernet)"
|
||||
|
||||
bluetooth:
|
||||
- "(bluetooth|bluez)"
|
||||
|
||||
sway:
|
||||
- "(sway)"
|
||||
|
||||
cpu:
|
||||
- "(cpu)"
|
||||
|
||||
memory:
|
||||
- "(memory|ram)"
|
||||
|
||||
disk:
|
||||
- "(disk|storage)"
|
||||
|
||||
battery:
|
||||
- "(upower|battery)"
|
||||
|
||||
sni:
|
||||
- "(sni|tray)"
|
||||
|
||||
dwl:
|
||||
- "(dwl)"
|
||||
|
||||
custom:
|
||||
- "(custom|module|extension|plugin|script)"
|
||||
|
||||
mpd:
|
||||
- "(mpd|music)"
|
||||
|
||||
audio:
|
||||
- "(pulseaudio|alsa|jack|audio|pirewire|wireplumber)"
|
||||
|
||||
temperature:
|
||||
- "(temperature|thermal|hwmon)"
|
||||
|
||||
clock:
|
||||
- "(clock|time|date)"
|
||||
|
||||
gamemode:
|
||||
- "(gamemode|game|gaming)"
|
||||
|
||||
inhibitor:
|
||||
- "(inhibitor|idle|lock|suspend|hibernate|logout)"
|
||||
|
||||
cava:
|
||||
- "(cava|audio-visualizer)"
|
||||
|
||||
backlight:
|
||||
- "(backlight|brightness)"
|
||||
|
||||
keyboard:
|
||||
- "(keyboard|keymap|layout|shortcut)"
|
||||
19
.github/workflows/clang-format.yml
vendored
Normal file
19
.github/workflows/clang-format.yml
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
name: clang-format
|
||||
|
||||
on: [push, pull_request]
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-format-${{ github.event.pull_request.number || github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: DoozyX/clang-format-lint-action@v0.16.2
|
||||
name: clang-format
|
||||
with:
|
||||
source: "."
|
||||
extensions: "hpp,h,cpp,c"
|
||||
clangFormatVersion: 16
|
||||
39
.github/workflows/clang-tidy.yml
vendored
Normal file
39
.github/workflows/clang-tidy.yml
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
name: clang-tidy
|
||||
|
||||
on: [push, pull_request]
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-tidy-${{ github.event.pull_request.number || github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: alexays/waybar:debian
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: configure
|
||||
run: |
|
||||
meson -Dcpp_std=c++20 build # necessary to generate compile_commands.json
|
||||
ninja -C build # necessary to find certain .h files (xdg, wayland, etc.)
|
||||
- uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.10' # to be kept in sync with cpp-linter-action
|
||||
update-environment: true # the python dist installed by the action needs LD_LIBRARY_PATH to work
|
||||
- uses: cpp-linter/cpp-linter-action@v2.9.1
|
||||
name: clang-tidy
|
||||
id: clang-tidy-check
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
PIP_NO_CACHE_DIR: false
|
||||
with:
|
||||
style: "" # empty string => don't do clang-format checks here, we do them in clang-format.yml
|
||||
files-changed-only: true # only check files that have changed
|
||||
lines-changed-only: true # only check lines that have changed
|
||||
tidy-checks: "" # empty string => use the .clang-tidy file
|
||||
version: "17" # clang-tools version
|
||||
database: "build" # path to the compile_commands.json file
|
||||
- name: Check if clang-tidy failed on any files
|
||||
if: steps.clang-tidy-check.outputs.checks-failed > 0
|
||||
run: echo "Some files failed the linting checks!" && exit 1
|
||||
51
.github/workflows/freebsd.yml
vendored
51
.github/workflows/freebsd.yml
vendored
@@ -1,29 +1,36 @@
|
||||
name: freebsd
|
||||
|
||||
on: [ push, pull_request ]
|
||||
on: [push, pull_request]
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-freebsd-${{ github.event.pull_request.number || github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
clang:
|
||||
# Run actions in a FreeBSD VM on the macos-12 runner
|
||||
# Run actions in a FreeBSD VM on the ubuntu runner
|
||||
# https://github.com/actions/runner/issues/385 - for FreeBSD runner support
|
||||
# https://github.com/actions/virtual-environments/issues/4060 - for lack of VirtualBox on MacOS 11 runners
|
||||
runs-on: macos-12
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Test in FreeBSD VM
|
||||
uses: vmactions/freebsd-vm@v0
|
||||
with:
|
||||
mem: 2048
|
||||
usesh: true
|
||||
prepare: |
|
||||
export CPPFLAGS=-isystem/usr/local/include LDFLAGS=-L/usr/local/lib # sndio
|
||||
sed -i '' 's/quarterly/latest/' /etc/pkg/FreeBSD.conf
|
||||
pkg install -y git # subprojects/date
|
||||
pkg install -y catch evdev-proto gtk-layer-shell gtkmm30 jsoncpp \
|
||||
libdbusmenu libevdev libfmt libmpdclient libudev-devd meson \
|
||||
pkgconf pulseaudio scdoc sndio spdlog wayland-protocols upower \
|
||||
libinotify
|
||||
run: |
|
||||
meson build -Dman-pages=enabled
|
||||
ninja -C build
|
||||
meson test -C build --no-rebuild --print-errorlogs --suite waybar
|
||||
- uses: actions/checkout@v3
|
||||
- name: Test in FreeBSD VM
|
||||
uses: cross-platform-actions/action@v0.23.0
|
||||
timeout-minutes: 180
|
||||
env:
|
||||
CPPFLAGS: '-isystem/usr/local/include'
|
||||
LDFLAGS: '-L/usr/local/lib'
|
||||
with:
|
||||
operating_system: freebsd
|
||||
version: "13.2"
|
||||
environment_variables: CPPFLAGS LDFLAGS
|
||||
sync_files: runner-to-vm
|
||||
run: |
|
||||
sudo sed -i '' 's/quarterly/latest/' /etc/pkg/FreeBSD.conf
|
||||
sudo pkg install -y git # subprojects/date
|
||||
sudo pkg install -y catch evdev-proto gtk-layer-shell gtkmm30 jsoncpp \
|
||||
libdbusmenu libevdev libfmt libmpdclient libudev-devd meson \
|
||||
pkgconf pulseaudio scdoc sndio spdlog wayland-protocols upower \
|
||||
libinotify
|
||||
meson build -Dman-pages=enabled
|
||||
ninja -C build
|
||||
meson test -C build --no-rebuild --print-errorlogs --suite waybar
|
||||
|
||||
19
.github/workflows/labeler.yml
vendored
Normal file
19
.github/workflows/labeler.yml
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
name: "Issue Labeler"
|
||||
on:
|
||||
issues:
|
||||
types: [opened, edited]
|
||||
|
||||
permissions:
|
||||
issues: write
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
triage:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: github/issue-labeler@v3.4
|
||||
with:
|
||||
configuration-path: .github/labeler.yml
|
||||
enable-versioned-regex: 0
|
||||
include-title: 1
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
14
.github/workflows/lint.yml
vendored
14
.github/workflows/lint.yml
vendored
@@ -1,14 +0,0 @@
|
||||
name: Linter
|
||||
|
||||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: DoozyX/clang-format-lint-action@v0.13
|
||||
with:
|
||||
source: '.'
|
||||
extensions: 'h,cpp,c'
|
||||
clangFormatVersion: 12
|
||||
9
.github/workflows/linux.yml
vendored
9
.github/workflows/linux.yml
vendored
@@ -2,6 +2,10 @@ name: linux
|
||||
|
||||
on: [push, pull_request]
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-linux-${{ github.event.pull_request.number || github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build:
|
||||
strategy:
|
||||
@@ -13,10 +17,7 @@ jobs:
|
||||
- fedora
|
||||
- opensuse
|
||||
- gentoo
|
||||
cpp_std: [c++17]
|
||||
include:
|
||||
- distro: fedora
|
||||
cpp_std: c++20
|
||||
cpp_std: [c++20]
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
|
||||
4
.gitignore
vendored
4
.gitignore
vendored
@@ -44,3 +44,7 @@ packagecache
|
||||
*.out
|
||||
*.app
|
||||
/.direnv/
|
||||
|
||||
# Nix
|
||||
result
|
||||
result-*
|
||||
|
||||
@@ -3,5 +3,5 @@
|
||||
FROM archlinux:base-devel
|
||||
|
||||
RUN pacman -Syu --noconfirm && \
|
||||
pacman -S --noconfirm git meson base-devel libinput wayland wayland-protocols pixman libxkbcommon mesa gtkmm3 jsoncpp pugixml scdoc libpulse libdbusmenu-gtk3 libmpdclient gobject-introspection libxkbcommon playerctl && \
|
||||
pacman -S --noconfirm git meson base-devel libinput wayland wayland-protocols pixman libxkbcommon mesa gtkmm3 jsoncpp pugixml scdoc libpulse libdbusmenu-gtk3 libmpdclient gobject-introspection libxkbcommon playerctl iniparser fftw && \
|
||||
sed -Ei 's/#(en_(US|GB)\.UTF)/\1/' /etc/locale.gen && locale-gen
|
||||
|
||||
@@ -2,6 +2,48 @@
|
||||
|
||||
FROM debian:sid
|
||||
|
||||
RUN apt-get update && \
|
||||
apt-get install -y build-essential meson ninja-build git pkg-config libinput10 libpugixml-dev libinput-dev wayland-protocols libwayland-client0 libwayland-cursor0 libwayland-dev libegl1-mesa-dev libgles2-mesa-dev libgbm-dev libxkbcommon-dev libudev-dev libpixman-1-dev libgtkmm-3.0-dev libjsoncpp-dev scdoc libdbusmenu-gtk3-dev libnl-3-dev libnl-genl-3-dev libpulse-dev libmpdclient-dev gobject-introspection libgirepository1.0-dev libxkbcommon-dev libxkbregistry-dev libxkbregistry0 libplayerctl-dev && \
|
||||
apt-get clean
|
||||
RUN apt update && \
|
||||
apt install --no-install-recommends --no-install-suggests -y \
|
||||
build-essential \
|
||||
catch2 \
|
||||
cmake \
|
||||
git \
|
||||
gobject-introspection \
|
||||
libdbusmenu-gtk3-dev \
|
||||
libegl1-mesa-dev \
|
||||
libfmt-dev \
|
||||
libgbm-dev \
|
||||
libgirepository1.0-dev \
|
||||
libgles2-mesa-dev \
|
||||
libgtk-layer-shell-dev \
|
||||
libgtkmm-3.0-dev \
|
||||
libhowardhinnant-date-dev \
|
||||
libiniparser-dev \
|
||||
libinput-dev \
|
||||
libjack-jackd2-dev \
|
||||
libjsoncpp-dev \
|
||||
libmpdclient-dev \
|
||||
libnl-3-dev \
|
||||
libnl-genl-3-dev \
|
||||
libpixman-1-dev \
|
||||
libplayerctl-dev \
|
||||
libpugixml-dev \
|
||||
libpulse-dev \
|
||||
libsndio-dev \
|
||||
libspdlog-dev \
|
||||
libudev-dev \
|
||||
libupower-glib-dev \
|
||||
libwayland-dev \
|
||||
libwireplumber-0.4-dev \
|
||||
libxkbcommon-dev \
|
||||
libxkbregistry-dev \
|
||||
locales \
|
||||
meson \
|
||||
ninja-build \
|
||||
pkg-config \
|
||||
python3-pip \
|
||||
python3-venv \
|
||||
scdoc \
|
||||
sudo \
|
||||
wayland-protocols \
|
||||
&& apt clean
|
||||
|
||||
@@ -6,6 +6,6 @@ RUN export FEATURES="-ipc-sandbox -network-sandbox -pid-sandbox -sandbox -usersa
|
||||
emerge --sync && \
|
||||
eselect news read --quiet new 1>/dev/null 2>&1 && \
|
||||
emerge --verbose --update --deep --with-bdeps=y --backtrack=30 --newuse @world && \
|
||||
USE="wayland gtk3 gtk -doc X" emerge dev-vcs/git dev-libs/wayland dev-libs/wayland-protocols =dev-cpp/gtkmm-3.24.6 x11-libs/libxkbcommon \
|
||||
USE="wayland gtk3 gtk -doc X pulseaudio minimal" emerge dev-vcs/git dev-libs/wayland dev-libs/wayland-protocols =dev-cpp/gtkmm-3.24.6 x11-libs/libxkbcommon \
|
||||
x11-libs/gtk+:3 dev-libs/libdbusmenu dev-libs/libnl sys-power/upower media-libs/libpulse dev-libs/libevdev media-libs/libmpdclient \
|
||||
media-sound/sndio gui-libs/gtk-layer-shell app-text/scdoc media-sound/playerctl dev-libs/iniparser
|
||||
media-sound/sndio gui-libs/gtk-layer-shell app-text/scdoc media-sound/playerctl dev-libs/iniparser sci-libs/fftw
|
||||
|
||||
@@ -1,22 +1,23 @@
|
||||
# Waybar [](LICENSE) [](https://paypal.me/ARouillard)<br>
|
||||
|
||||
> Highly customizable Wayland bar for Sway and Wlroots based compositors.<br>
|
||||
> Available in Arch [community](https://www.archlinux.org/packages/community/x86_64/waybar/) or
|
||||
[AUR](https://aur.archlinux.org/packages/waybar-git/), [Gentoo](https://packages.gentoo.org/packages/gui-apps/waybar), [openSUSE](https://build.opensuse.org/package/show/X11:Wayland/waybar), and [Alpine Linux](https://pkgs.alpinelinux.org/packages?name=waybar).<br>
|
||||
> Available in [all major distributions](https://github.com/Alexays/Waybar/wiki/Installation)<br>
|
||||
> *Waybar [examples](https://github.com/Alexays/Waybar/wiki/Examples)*
|
||||
|
||||
#### Current features
|
||||
- Sway (Workspaces, Binding mode, Focused window name)
|
||||
- River (Mapping mode, Tags, Focused window name)
|
||||
- Hyprland (Focused window name)
|
||||
- Hyprland (Window Icons, Workspaces, Focused window name)
|
||||
- DWL (Tags) [requires dwl ipc patch](https://github.com/djpohly/dwl/wiki/ipc)
|
||||
- Tray [#21](https://github.com/Alexays/Waybar/issues/21)
|
||||
- Local time
|
||||
- Battery
|
||||
- UPower
|
||||
- Power profiles daemon
|
||||
- Network
|
||||
- Bluetooth
|
||||
- Pulseaudio
|
||||
- Privacy Info
|
||||
- Wireplumber
|
||||
- Disk
|
||||
- Memory
|
||||
|
||||
10
default.nix
Normal file
10
default.nix
Normal file
@@ -0,0 +1,10 @@
|
||||
(import
|
||||
(
|
||||
let lock = builtins.fromJSON (builtins.readFile ./flake.lock); in
|
||||
fetchTarball {
|
||||
url = "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz";
|
||||
sha256 = lock.nodes.flake-compat.locked.narHash;
|
||||
}
|
||||
)
|
||||
{ src = ./.; }
|
||||
).defaultNix
|
||||
78
flake.lock
generated
78
flake.lock
generated
@@ -1,77 +1,28 @@
|
||||
{
|
||||
"nodes": {
|
||||
"devshell": {
|
||||
"inputs": {
|
||||
"flake-utils": "flake-utils",
|
||||
"nixpkgs": "nixpkgs"
|
||||
},
|
||||
"flake-compat": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1667210711,
|
||||
"narHash": "sha256-IoErjXZAkzYWHEpQqwu/DeRNJGFdR7X2OGbkhMqMrpw=",
|
||||
"owner": "numtide",
|
||||
"repo": "devshell",
|
||||
"rev": "96a9dd12b8a447840cc246e17a47b81a4268bba7",
|
||||
"lastModified": 1696426674,
|
||||
"narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
|
||||
"owner": "edolstra",
|
||||
"repo": "flake-compat",
|
||||
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "numtide",
|
||||
"repo": "devshell",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"flake-utils": {
|
||||
"locked": {
|
||||
"lastModified": 1642700792,
|
||||
"narHash": "sha256-XqHrk7hFb+zBvRg6Ghl+AZDq03ov6OshJLiSWOoX5es=",
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"rev": "846b2ae0fc4cc943637d3d1def4454213e203cba",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"flake-utils_2": {
|
||||
"locked": {
|
||||
"lastModified": 1667395993,
|
||||
"narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=",
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"owner": "edolstra",
|
||||
"repo": "flake-compat",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1643381941,
|
||||
"narHash": "sha256-pHTwvnN4tTsEKkWlXQ8JMY423epos8wUOhthpwJjtpc=",
|
||||
"lastModified": 1704538339,
|
||||
"narHash": "sha256-1734d3mQuux9ySvwf6axRWZRBhtcZA9Q8eftD6EZg6U=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "5efc8ca954272c4376ac929f4c5ffefcc20551d5",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NixOS",
|
||||
"ref": "nixpkgs-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs_2": {
|
||||
"locked": {
|
||||
"lastModified": 1670152712,
|
||||
"narHash": "sha256-LJttwIvJqsZIj8u1LxVRv82vwUtkzVqQVi7Wb8gxPS4=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "14ddeaebcbe9a25748221d1d7ecdf98e20e2325e",
|
||||
"rev": "46ae0210ce163b3cba6c7da08840c1d63de9c701",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -83,9 +34,8 @@
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"devshell": "devshell",
|
||||
"flake-utils": "flake-utils_2",
|
||||
"nixpkgs": "nixpkgs_2"
|
||||
"flake-compat": "flake-compat",
|
||||
"nixpkgs": "nixpkgs"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
90
flake.nix
90
flake.nix
@@ -1,23 +1,22 @@
|
||||
{
|
||||
description = "Highly customizable Wayland bar for Sway and Wlroots based compositors.";
|
||||
description = "Highly customizable Wayland bar for Sway and Wlroots based compositors";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
devshell.url = "github:numtide/devshell";
|
||||
flake-utils.url = "github:numtide/flake-utils";
|
||||
flake-compat = {
|
||||
url = "github:edolstra/flake-compat";
|
||||
flake = false;
|
||||
};
|
||||
};
|
||||
|
||||
outputs = { self, flake-utils, devshell, nixpkgs }:
|
||||
outputs = { self, nixpkgs, ... }:
|
||||
let
|
||||
inherit (nixpkgs) lib;
|
||||
genSystems = lib.genAttrs [
|
||||
genSystems = func: lib.genAttrs [
|
||||
"x86_64-linux"
|
||||
];
|
||||
|
||||
pkgsFor = genSystems (system:
|
||||
import nixpkgs {
|
||||
inherit system;
|
||||
});
|
||||
"aarch64-linux"
|
||||
]
|
||||
(system: func (import nixpkgs { inherit system; }));
|
||||
|
||||
mkDate = longDate: (lib.concatStringsSep "-" [
|
||||
(builtins.substring 0 4 longDate)
|
||||
@@ -26,40 +25,43 @@
|
||||
]);
|
||||
in
|
||||
{
|
||||
overlays.default = _: prev: rec {
|
||||
waybar = prev.callPackage ./nix/default.nix {
|
||||
version = "0.9.16" + "+date=" + (mkDate (self.lastModifiedDate or "19700101")) + "_" + (self.shortRev or "dirty");
|
||||
devShells = genSystems
|
||||
(pkgs:
|
||||
{
|
||||
default =
|
||||
pkgs.mkShell
|
||||
{
|
||||
name = "waybar-shell";
|
||||
|
||||
# inherit attributes from upstream nixpkgs derivation
|
||||
inherit (pkgs.waybar) buildInputs depsBuildBuild depsBuildBuildPropagated depsBuildTarget
|
||||
depsBuildTargetPropagated depsHostHost depsHostHostPropagated depsTargetTarget
|
||||
depsTargetTargetPropagated propagatedBuildInputs propagatedNativeBuildInputs strictDeps;
|
||||
|
||||
# overrides for local development
|
||||
nativeBuildInputs = pkgs.waybar.nativeBuildInputs ++ (with pkgs; [
|
||||
clang-tools
|
||||
gdb
|
||||
]);
|
||||
};
|
||||
});
|
||||
|
||||
overlays.default = final: prev: {
|
||||
waybar = final.callPackage ./nix/default.nix {
|
||||
# take the first "version: '...'" from meson.build
|
||||
version =
|
||||
(builtins.head (builtins.split "'"
|
||||
(builtins.elemAt
|
||||
(builtins.split " version: '" (builtins.readFile ./meson.build))
|
||||
2)))
|
||||
+ "+date=" + (mkDate (self.lastModifiedDate or "19700101")) + "_" + (self.shortRev or "dirty");
|
||||
};
|
||||
};
|
||||
packages = genSystems
|
||||
(system:
|
||||
(self.overlays.default null pkgsFor.${system})
|
||||
// {
|
||||
default = self.packages.${system}.waybar;
|
||||
});
|
||||
} //
|
||||
flake-utils.lib.eachDefaultSystem (system: {
|
||||
devShell =
|
||||
let pkgs = import nixpkgs {
|
||||
inherit system;
|
||||
|
||||
overlays = [ devshell.overlay ];
|
||||
};
|
||||
in
|
||||
pkgs.devshell.mkShell {
|
||||
imports = [ "${pkgs.devshell.extraModulesDir}/language/c.nix" ];
|
||||
commands = [
|
||||
{
|
||||
package = pkgs.devshell.cli;
|
||||
help = "Per project developer environments";
|
||||
}
|
||||
];
|
||||
devshell.packages = with pkgs; [
|
||||
clang-tools
|
||||
gdb
|
||||
];
|
||||
language.c.libraries = with pkgs; [
|
||||
];
|
||||
};
|
||||
});
|
||||
packages = genSystems (pkgs:
|
||||
let packages = self.overlays.default pkgs pkgs;
|
||||
in packages // {
|
||||
default = packages.waybar;
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
27
include/AAppIconLabel.hpp
Normal file
27
include/AAppIconLabel.hpp
Normal file
@@ -0,0 +1,27 @@
|
||||
#pragma once
|
||||
|
||||
#include <gtkmm/box.h>
|
||||
#include <gtkmm/image.h>
|
||||
|
||||
#include "AIconLabel.hpp"
|
||||
|
||||
namespace waybar {
|
||||
|
||||
class AAppIconLabel : public AIconLabel {
|
||||
public:
|
||||
AAppIconLabel(const Json::Value &config, const std::string &name, const std::string &id,
|
||||
const std::string &format, uint16_t interval = 0, bool ellipsize = false,
|
||||
bool enable_click = false, bool enable_scroll = false);
|
||||
virtual ~AAppIconLabel() = default;
|
||||
auto update() -> void override;
|
||||
|
||||
protected:
|
||||
void updateAppIconName(const std::string &app_identifier,
|
||||
const std::string &alternative_app_identifier);
|
||||
void updateAppIcon();
|
||||
unsigned app_icon_size_{24};
|
||||
bool update_app_icon_{true};
|
||||
std::string app_icon_name_;
|
||||
};
|
||||
|
||||
} // namespace waybar
|
||||
@@ -11,12 +11,15 @@ namespace waybar {
|
||||
|
||||
class AModule : public IModule {
|
||||
public:
|
||||
static constexpr const char *MODULE_CLASS = "module";
|
||||
|
||||
virtual ~AModule();
|
||||
auto update() -> void override;
|
||||
virtual auto refresh(int) -> void{};
|
||||
operator Gtk::Widget &() override;
|
||||
auto doAction(const std::string &name) -> void override;
|
||||
|
||||
/// Emitting on this dispatcher triggers a update() call
|
||||
Glib::Dispatcher dp;
|
||||
|
||||
protected:
|
||||
@@ -36,26 +39,34 @@ class AModule : public IModule {
|
||||
|
||||
virtual bool handleToggle(GdkEventButton *const &ev);
|
||||
virtual bool handleScroll(GdkEventScroll *);
|
||||
virtual bool handleRelease(GdkEventButton *const &ev);
|
||||
|
||||
private:
|
||||
bool handleUserEvent(GdkEventButton *const &ev);
|
||||
const bool isTooltip;
|
||||
std::vector<int> pid_;
|
||||
gdouble distance_scrolled_y_;
|
||||
gdouble distance_scrolled_x_;
|
||||
std::map<std::string, std::string> eventActionMap_;
|
||||
static const inline std::map<std::pair<uint, GdkEventType>, std::string> eventMap_{
|
||||
{std::make_pair(1, GdkEventType::GDK_BUTTON_PRESS), "on-click"},
|
||||
{std::make_pair(1, GdkEventType::GDK_BUTTON_RELEASE), "on-click-release"},
|
||||
{std::make_pair(1, GdkEventType::GDK_2BUTTON_PRESS), "on-double-click"},
|
||||
{std::make_pair(1, GdkEventType::GDK_3BUTTON_PRESS), "on-triple-click"},
|
||||
{std::make_pair(2, GdkEventType::GDK_BUTTON_PRESS), "on-click-middle"},
|
||||
{std::make_pair(2, GdkEventType::GDK_BUTTON_RELEASE), "on-click-middle-release"},
|
||||
{std::make_pair(2, GdkEventType::GDK_2BUTTON_PRESS), "on-double-click-middle"},
|
||||
{std::make_pair(2, GdkEventType::GDK_3BUTTON_PRESS), "on-triple-click-middle"},
|
||||
{std::make_pair(3, GdkEventType::GDK_BUTTON_PRESS), "on-click-right"},
|
||||
{std::make_pair(3, GdkEventType::GDK_BUTTON_RELEASE), "on-click-right-release"},
|
||||
{std::make_pair(3, GdkEventType::GDK_2BUTTON_PRESS), "on-double-click-right"},
|
||||
{std::make_pair(3, GdkEventType::GDK_3BUTTON_PRESS), "on-triple-click-right"},
|
||||
{std::make_pair(8, GdkEventType::GDK_BUTTON_PRESS), "on-click-backward"},
|
||||
{std::make_pair(8, GdkEventType::GDK_BUTTON_RELEASE), "on-click-backward-release"},
|
||||
{std::make_pair(8, GdkEventType::GDK_2BUTTON_PRESS), "on-double-click-backward"},
|
||||
{std::make_pair(8, GdkEventType::GDK_3BUTTON_PRESS), "on-triple-click-backward"},
|
||||
{std::make_pair(9, GdkEventType::GDK_BUTTON_PRESS), "on-click-forward"},
|
||||
{std::make_pair(9, GdkEventType::GDK_BUTTON_RELEASE), "on-click-forward-release"},
|
||||
{std::make_pair(9, GdkEventType::GDK_2BUTTON_PRESS), "on-double-click-forward"},
|
||||
{std::make_pair(9, GdkEventType::GDK_3BUTTON_PRESS), "on-triple-click-forward"}};
|
||||
};
|
||||
|
||||
19
include/ASlider.hpp
Normal file
19
include/ASlider.hpp
Normal file
@@ -0,0 +1,19 @@
|
||||
#pragma once
|
||||
|
||||
#include "AModule.hpp"
|
||||
#include "gtkmm/scale.h"
|
||||
|
||||
namespace waybar {
|
||||
|
||||
class ASlider : public AModule {
|
||||
public:
|
||||
ASlider(const Json::Value& config, const std::string& name, const std::string& id);
|
||||
virtual void onValueChanged();
|
||||
|
||||
protected:
|
||||
bool vertical_ = false;
|
||||
int min_ = 0, max_ = 100, curr_ = 50;
|
||||
Gtk::Scale scale_;
|
||||
};
|
||||
|
||||
} // namespace waybar
|
||||
@@ -12,6 +12,7 @@
|
||||
#include <vector>
|
||||
|
||||
#include "AModule.hpp"
|
||||
#include "group.hpp"
|
||||
#include "xdg-output-unstable-v1-client-protocol.h"
|
||||
|
||||
namespace waybar {
|
||||
@@ -52,34 +53,18 @@ class BarIpcClient;
|
||||
}
|
||||
#endif // HAVE_SWAY
|
||||
|
||||
class BarSurface {
|
||||
protected:
|
||||
BarSurface() = default;
|
||||
|
||||
public:
|
||||
virtual void setExclusiveZone(bool enable) = 0;
|
||||
virtual void setLayer(bar_layer layer) = 0;
|
||||
virtual void setMargins(const struct bar_margins &margins) = 0;
|
||||
virtual void setPassThrough(bool enable) = 0;
|
||||
virtual void setPosition(const std::string_view &position) = 0;
|
||||
virtual void setSize(uint32_t width, uint32_t height) = 0;
|
||||
virtual void commit(){};
|
||||
|
||||
virtual ~BarSurface() = default;
|
||||
};
|
||||
|
||||
class Bar {
|
||||
public:
|
||||
using bar_mode_map = std::map<std::string_view, struct bar_mode>;
|
||||
using bar_mode_map = std::map<std::string, struct bar_mode>;
|
||||
static const bar_mode_map PRESET_MODES;
|
||||
static const std::string_view MODE_DEFAULT;
|
||||
static const std::string_view MODE_INVISIBLE;
|
||||
static const std::string MODE_DEFAULT;
|
||||
static const std::string MODE_INVISIBLE;
|
||||
|
||||
Bar(struct waybar_output *w_output, const Json::Value &);
|
||||
Bar(const Bar &) = delete;
|
||||
~Bar();
|
||||
|
||||
void setMode(const std::string_view &);
|
||||
void setMode(const std::string &mode);
|
||||
void setVisible(bool visible);
|
||||
void toggle();
|
||||
void handleSignal(int);
|
||||
@@ -88,8 +73,12 @@ class Bar {
|
||||
Json::Value config;
|
||||
struct wl_surface *surface;
|
||||
bool visible = true;
|
||||
bool vertical = false;
|
||||
Gtk::Window window;
|
||||
Gtk::Orientation orientation = Gtk::ORIENTATION_HORIZONTAL;
|
||||
Gtk::PositionType position = Gtk::POS_TOP;
|
||||
|
||||
int x_global;
|
||||
int y_global;
|
||||
|
||||
#ifdef HAVE_SWAY
|
||||
std::string bar_id;
|
||||
@@ -98,16 +87,24 @@ class Bar {
|
||||
private:
|
||||
void onMap(GdkEventAny *);
|
||||
auto setupWidgets() -> void;
|
||||
void getModules(const Factory &, const std::string &, Gtk::Box *);
|
||||
void getModules(const Factory &, const std::string &, waybar::Group *);
|
||||
void setupAltFormatKeyForModule(const std::string &module_name);
|
||||
void setupAltFormatKeyForModuleList(const char *module_list_name);
|
||||
void setMode(const bar_mode &);
|
||||
void setPassThrough(bool passthrough);
|
||||
void setPosition(Gtk::PositionType position);
|
||||
void onConfigure(GdkEventConfigure *ev);
|
||||
void configureGlobalOffset(int width, int height);
|
||||
void onOutputGeometryChanged();
|
||||
|
||||
/* Copy initial set of modes to allow customization */
|
||||
bar_mode_map configured_modes = PRESET_MODES;
|
||||
std::string last_mode_{MODE_DEFAULT};
|
||||
|
||||
std::unique_ptr<BarSurface> surface_impl_;
|
||||
struct bar_margins margins_;
|
||||
uint32_t width_, height_;
|
||||
bool passthrough_;
|
||||
|
||||
Gtk::Box left_;
|
||||
Gtk::Box center_;
|
||||
Gtk::Box right_;
|
||||
|
||||
@@ -7,8 +7,9 @@
|
||||
|
||||
#include "bar.hpp"
|
||||
#include "config.hpp"
|
||||
#include "util/css_reload_helper.hpp"
|
||||
#include "util/portal.hpp"
|
||||
|
||||
struct zwlr_layer_shell_v1;
|
||||
struct zwp_idle_inhibitor_v1;
|
||||
struct zwp_idle_inhibit_manager_v1;
|
||||
|
||||
@@ -24,7 +25,6 @@ class Client {
|
||||
Glib::RefPtr<Gdk::Display> gdk_display;
|
||||
struct wl_display *wl_display = nullptr;
|
||||
struct wl_registry *registry = nullptr;
|
||||
struct zwlr_layer_shell_v1 *layer_shell = nullptr;
|
||||
struct zxdg_output_manager_v1 *xdg_output_manager = nullptr;
|
||||
struct zwp_idle_inhibit_manager_v1 *idle_inhibit_manager = nullptr;
|
||||
std::vector<std::unique_ptr<Bar>> bars;
|
||||
@@ -33,7 +33,7 @@ class Client {
|
||||
|
||||
private:
|
||||
Client() = default;
|
||||
const std::string getStyle(const std::string &style);
|
||||
const std::string getStyle(const std::string &style, std::optional<Appearance> appearance);
|
||||
void bindInterfaces();
|
||||
void handleOutput(struct waybar_output &output);
|
||||
auto setupCss(const std::string &css_file) -> void;
|
||||
@@ -52,7 +52,10 @@ class Client {
|
||||
|
||||
Glib::RefPtr<Gtk::StyleContext> style_context_;
|
||||
Glib::RefPtr<Gtk::CssProvider> css_provider_;
|
||||
std::unique_ptr<Portal> portal;
|
||||
std::list<struct waybar_output> outputs_;
|
||||
std::unique_ptr<CssReloadHelper> m_cssReloadHelper;
|
||||
std::string m_cssFile;
|
||||
};
|
||||
|
||||
} // namespace waybar
|
||||
|
||||
@@ -1,103 +1,17 @@
|
||||
#pragma once
|
||||
|
||||
#include <json/json.h>
|
||||
#if defined(HAVE_CHRONO_TIMEZONES) || defined(HAVE_LIBDATE)
|
||||
#include "modules/clock.hpp"
|
||||
#else
|
||||
#include "modules/simpleclock.hpp"
|
||||
#endif
|
||||
#ifdef HAVE_SWAY
|
||||
#include "modules/sway/language.hpp"
|
||||
#include "modules/sway/mode.hpp"
|
||||
#include "modules/sway/scratchpad.hpp"
|
||||
#include "modules/sway/window.hpp"
|
||||
#include "modules/sway/workspaces.hpp"
|
||||
#endif
|
||||
#ifdef HAVE_WLR
|
||||
#include "modules/wlr/taskbar.hpp"
|
||||
#include "modules/wlr/workspace_manager.hpp"
|
||||
#endif
|
||||
#ifdef HAVE_RIVER
|
||||
#include "modules/river/layout.hpp"
|
||||
#include "modules/river/mode.hpp"
|
||||
#include "modules/river/tags.hpp"
|
||||
#include "modules/river/window.hpp"
|
||||
#endif
|
||||
#ifdef HAVE_DWL
|
||||
#include "modules/dwl/tags.hpp"
|
||||
#endif
|
||||
#ifdef HAVE_HYPRLAND
|
||||
#include "modules/hyprland/backend.hpp"
|
||||
#include "modules/hyprland/language.hpp"
|
||||
#include "modules/hyprland/submap.hpp"
|
||||
#include "modules/hyprland/window.hpp"
|
||||
#endif
|
||||
#if defined(__FreeBSD__) || (defined(__linux__) && !defined(NO_FILESYSTEM))
|
||||
#include "modules/battery.hpp"
|
||||
#endif
|
||||
#if defined(HAVE_CPU_LINUX) || defined(HAVE_CPU_BSD)
|
||||
#include "modules/cpu.hpp"
|
||||
#endif
|
||||
#include "modules/idle_inhibitor.hpp"
|
||||
#if defined(HAVE_MEMORY_LINUX) || defined(HAVE_MEMORY_BSD)
|
||||
#include "modules/memory.hpp"
|
||||
#endif
|
||||
#include "modules/disk.hpp"
|
||||
#ifdef HAVE_DBUSMENU
|
||||
#include "modules/sni/tray.hpp"
|
||||
#endif
|
||||
#ifdef HAVE_MPRIS
|
||||
#include "modules/mpris/mpris.hpp"
|
||||
#endif
|
||||
#ifdef HAVE_LIBNL
|
||||
#include "modules/network.hpp"
|
||||
#endif
|
||||
#ifdef HAVE_LIBUDEV
|
||||
#include "modules/backlight.hpp"
|
||||
#endif
|
||||
#ifdef HAVE_LIBEVDEV
|
||||
#include "modules/keyboard_state.hpp"
|
||||
#endif
|
||||
#ifdef HAVE_GAMEMODE
|
||||
#include "modules/gamemode.hpp"
|
||||
#endif
|
||||
#ifdef HAVE_UPOWER
|
||||
#include "modules/upower/upower.hpp"
|
||||
#endif
|
||||
#ifdef HAVE_LIBPULSE
|
||||
#include "modules/pulseaudio.hpp"
|
||||
#endif
|
||||
#ifdef HAVE_LIBMPDCLIENT
|
||||
#include "modules/mpd/mpd.hpp"
|
||||
#endif
|
||||
#ifdef HAVE_LIBSNDIO
|
||||
#include "modules/sndio.hpp"
|
||||
#endif
|
||||
#ifdef HAVE_GIO_UNIX
|
||||
#include "modules/bluetooth.hpp"
|
||||
#include "modules/inhibitor.hpp"
|
||||
#endif
|
||||
#ifdef HAVE_LIBJACK
|
||||
#include "modules/jack.hpp"
|
||||
#endif
|
||||
#ifdef HAVE_LIBWIREPLUMBER
|
||||
#include "modules/wireplumber.hpp"
|
||||
#endif
|
||||
#ifdef HAVE_LIBCAVA
|
||||
#include "modules/cava.hpp"
|
||||
#endif
|
||||
#include "bar.hpp"
|
||||
#include "modules/custom.hpp"
|
||||
#include "modules/image.hpp"
|
||||
#include "modules/temperature.hpp"
|
||||
#include "modules/user.hpp"
|
||||
|
||||
#include <AModule.hpp>
|
||||
|
||||
namespace waybar {
|
||||
|
||||
class Bar;
|
||||
|
||||
class Factory {
|
||||
public:
|
||||
Factory(const Bar& bar, const Json::Value& config);
|
||||
AModule* makeModule(const std::string& name) const;
|
||||
AModule* makeModule(const std::string& name, const std::string& pos) const;
|
||||
|
||||
private:
|
||||
const Bar& bar_;
|
||||
|
||||
@@ -5,18 +5,31 @@
|
||||
#include <json/json.h>
|
||||
|
||||
#include "AModule.hpp"
|
||||
#include "bar.hpp"
|
||||
#include "factory.hpp"
|
||||
#include "gtkmm/revealer.h"
|
||||
|
||||
namespace waybar {
|
||||
|
||||
class Group : public AModule {
|
||||
public:
|
||||
Group(const std::string&, const std::string&, const Json::Value&, bool);
|
||||
~Group() = default;
|
||||
virtual ~Group() = default;
|
||||
auto update() -> void override;
|
||||
operator Gtk::Widget&() override;
|
||||
|
||||
virtual Gtk::Box& getBox();
|
||||
void addWidget(Gtk::Widget& widget);
|
||||
|
||||
bool handleMouseHover(GdkEventCrossing* const& e);
|
||||
|
||||
protected:
|
||||
Gtk::Box box;
|
||||
Gtk::Box revealer_box;
|
||||
Gtk::Revealer revealer;
|
||||
bool is_first_widget = true;
|
||||
bool is_drawer = false;
|
||||
std::string add_class_to_drawer_children;
|
||||
|
||||
void addHoverHandlerTo(Gtk::Widget& widget);
|
||||
};
|
||||
|
||||
} // namespace waybar
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
#include <vector>
|
||||
|
||||
#include "ALabel.hpp"
|
||||
#include "giomm/dbusproxy.h"
|
||||
#include "util/backlight_backend.hpp"
|
||||
#include "util/json.hpp"
|
||||
#include "util/sleeper_thread.hpp"
|
||||
|
||||
struct udev;
|
||||
struct udev_device;
|
||||
@@ -16,54 +16,17 @@ struct udev_device;
|
||||
namespace waybar::modules {
|
||||
|
||||
class Backlight : public ALabel {
|
||||
class BacklightDev {
|
||||
public:
|
||||
BacklightDev() = default;
|
||||
BacklightDev(std::string name, int actual, int max, bool powered);
|
||||
std::string_view name() const;
|
||||
int get_actual() const;
|
||||
void set_actual(int actual);
|
||||
int get_max() const;
|
||||
void set_max(int max);
|
||||
bool get_powered() const;
|
||||
void set_powered(bool powered);
|
||||
friend inline bool operator==(const BacklightDev &lhs, const BacklightDev &rhs) {
|
||||
return lhs.name_ == rhs.name_ && lhs.actual_ == rhs.actual_ && lhs.max_ == rhs.max_;
|
||||
}
|
||||
|
||||
private:
|
||||
std::string name_;
|
||||
int actual_ = 1;
|
||||
int max_ = 1;
|
||||
bool powered_ = true;
|
||||
};
|
||||
|
||||
public:
|
||||
Backlight(const std::string &, const Json::Value &);
|
||||
virtual ~Backlight();
|
||||
virtual ~Backlight() = default;
|
||||
auto update() -> void override;
|
||||
|
||||
private:
|
||||
template <class ForwardIt>
|
||||
static const BacklightDev *best_device(ForwardIt first, ForwardIt last, std::string_view);
|
||||
template <class ForwardIt, class Inserter>
|
||||
static void upsert_device(ForwardIt first, ForwardIt last, Inserter inserter, udev_device *dev);
|
||||
template <class ForwardIt, class Inserter>
|
||||
static void enumerate_devices(ForwardIt first, ForwardIt last, Inserter inserter, udev *udev);
|
||||
|
||||
bool handleScroll(GdkEventScroll *e) override;
|
||||
|
||||
const std::string preferred_device_;
|
||||
static constexpr int EPOLL_MAX_EVENTS = 16;
|
||||
|
||||
std::optional<BacklightDev> previous_best_;
|
||||
std::string previous_format_;
|
||||
|
||||
std::mutex udev_thread_mutex_;
|
||||
std::vector<BacklightDev> devices_;
|
||||
// thread must destruct before shared data
|
||||
util::SleeperThread udev_thread_;
|
||||
|
||||
Glib::RefPtr<Gio::DBus::Proxy> login_proxy_;
|
||||
util::BacklightBackend backend;
|
||||
};
|
||||
} // namespace waybar::modules
|
||||
|
||||
24
include/modules/backlight_slider.hpp
Normal file
24
include/modules/backlight_slider.hpp
Normal file
@@ -0,0 +1,24 @@
|
||||
#pragma once
|
||||
|
||||
#include <chrono>
|
||||
|
||||
#include "ASlider.hpp"
|
||||
#include "util/backlight_backend.hpp"
|
||||
|
||||
namespace waybar::modules {
|
||||
|
||||
class BacklightSlider : public ASlider {
|
||||
public:
|
||||
BacklightSlider(const std::string&, const Json::Value&);
|
||||
virtual ~BacklightSlider() = default;
|
||||
|
||||
void update() override;
|
||||
void onValueChanged() override;
|
||||
|
||||
private:
|
||||
std::chrono::milliseconds interval_;
|
||||
std::string preferred_device_;
|
||||
util::BacklightBackend backend;
|
||||
};
|
||||
|
||||
} // namespace waybar::modules
|
||||
@@ -1,11 +1,8 @@
|
||||
#pragma once
|
||||
|
||||
#ifdef FILESYSTEM_EXPERIMENTAL
|
||||
#include <experimental/filesystem>
|
||||
#else
|
||||
#include <filesystem>
|
||||
#endif
|
||||
#include <fmt/format.h>
|
||||
|
||||
#include <filesystem>
|
||||
#if defined(__linux__)
|
||||
#include <sys/inotify.h>
|
||||
#endif
|
||||
@@ -16,19 +13,16 @@
|
||||
#include <vector>
|
||||
|
||||
#include "ALabel.hpp"
|
||||
#include "bar.hpp"
|
||||
#include "util/sleeper_thread.hpp"
|
||||
|
||||
namespace waybar::modules {
|
||||
|
||||
#ifdef FILESYSTEM_EXPERIMENTAL
|
||||
namespace fs = std::experimental::filesystem;
|
||||
#else
|
||||
namespace fs = std::filesystem;
|
||||
#endif
|
||||
|
||||
class Battery : public ALabel {
|
||||
public:
|
||||
Battery(const std::string&, const Json::Value&);
|
||||
Battery(const std::string&, const waybar::Bar&, const Json::Value&);
|
||||
virtual ~Battery();
|
||||
auto update() -> void override;
|
||||
|
||||
@@ -40,6 +34,7 @@ class Battery : public ALabel {
|
||||
const std::string getAdapterStatus(uint8_t capacity) const;
|
||||
const std::tuple<uint8_t, float, std::string, float> getInfos();
|
||||
const std::string formatTimeRemaining(float hoursRemaining);
|
||||
void setBarClass(std::string&);
|
||||
|
||||
int global_watch;
|
||||
std::map<fs::path, int> batteries_;
|
||||
@@ -49,6 +44,7 @@ class Battery : public ALabel {
|
||||
std::mutex battery_list_mutex_;
|
||||
std::string old_status_;
|
||||
bool warnFirstTime_{true};
|
||||
const Bar& bar_;
|
||||
|
||||
util::SleeperThread thread_;
|
||||
util::SleeperThread thread_battery_update_;
|
||||
|
||||
@@ -59,7 +59,8 @@ class Bluetooth : public ALabel {
|
||||
auto getDeviceProperties(GDBusObject*, DeviceInfo&) -> bool;
|
||||
auto getControllerProperties(GDBusObject*, ControllerInfo&) -> bool;
|
||||
|
||||
auto findCurController(ControllerInfo&) -> bool;
|
||||
// Returns std::nullopt if no controller could be found
|
||||
auto findCurController() -> std::optional<ControllerInfo>;
|
||||
auto findConnectedDevices(const std::string&, std::vector<DeviceInfo>&) -> void;
|
||||
|
||||
#ifdef WANT_RFKILL
|
||||
@@ -68,7 +69,7 @@ class Bluetooth : public ALabel {
|
||||
const std::unique_ptr<GDBusObjectManager, void (*)(GDBusObjectManager*)> manager_;
|
||||
|
||||
std::string state_;
|
||||
ControllerInfo cur_controller_;
|
||||
std::optional<ControllerInfo> cur_controller_;
|
||||
std::vector<DeviceInfo> connected_devices_;
|
||||
DeviceInfo cur_focussed_device_;
|
||||
std::string device_enumerate_;
|
||||
|
||||
@@ -3,9 +3,11 @@
|
||||
#include "ALabel.hpp"
|
||||
#include "util/sleeper_thread.hpp"
|
||||
|
||||
namespace cava {
|
||||
extern "C" {
|
||||
#include <cava/common.h>
|
||||
}
|
||||
} // namespace cava
|
||||
|
||||
namespace waybar::modules {
|
||||
using namespace std::literals::chrono_literals;
|
||||
@@ -21,13 +23,13 @@ class Cava final : public ALabel {
|
||||
util::SleeperThread thread_;
|
||||
util::SleeperThread thread_fetch_input_;
|
||||
|
||||
struct error_s error_ {}; // cava errors
|
||||
struct config_params prm_ {}; // cava parameters
|
||||
struct audio_raw audio_raw_ {}; // cava handled raw audio data(is based on audio_data)
|
||||
struct audio_data audio_data_ {}; // cava audio data
|
||||
struct cava_plan* plan_; //{new cava_plan{}};
|
||||
struct cava::error_s error_ {}; // cava errors
|
||||
struct cava::config_params prm_ {}; // cava parameters
|
||||
struct cava::audio_raw audio_raw_ {}; // cava handled raw audio data(is based on audio_data)
|
||||
struct cava::audio_data audio_data_ {}; // cava audio data
|
||||
struct cava::cava_plan* plan_; //{new cava_plan{}};
|
||||
// Cava API to read audio source
|
||||
ptr input_source_;
|
||||
cava::ptr input_source_;
|
||||
// Delay to handle audio source
|
||||
std::chrono::milliseconds frame_time_milsec_{1s};
|
||||
// Text to display
|
||||
@@ -36,6 +38,7 @@ class Cava final : public ALabel {
|
||||
std::chrono::seconds fetch_input_delay_{4};
|
||||
std::chrono::seconds suspend_silence_delay_{0};
|
||||
bool silence_{false};
|
||||
bool hide_on_silence_{false};
|
||||
int sleep_counter_{0};
|
||||
// Cava method
|
||||
void pause_resume();
|
||||
|
||||
60
include/modules/cffi.hpp
Normal file
60
include/modules/cffi.hpp
Normal file
@@ -0,0 +1,60 @@
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "AModule.hpp"
|
||||
#include "util/command.hpp"
|
||||
#include "util/json.hpp"
|
||||
#include "util/sleeper_thread.hpp"
|
||||
|
||||
namespace waybar::modules {
|
||||
|
||||
namespace ffi {
|
||||
extern "C" {
|
||||
typedef struct wbcffi_module wbcffi_module;
|
||||
|
||||
typedef struct {
|
||||
wbcffi_module* obj;
|
||||
const char* waybar_version;
|
||||
GtkContainer* (*get_root_widget)(wbcffi_module*);
|
||||
void (*queue_update)(wbcffi_module*);
|
||||
} wbcffi_init_info;
|
||||
|
||||
struct wbcffi_config_entry {
|
||||
const char* key;
|
||||
const char* value;
|
||||
};
|
||||
}
|
||||
} // namespace ffi
|
||||
|
||||
class CFFI : public AModule {
|
||||
public:
|
||||
CFFI(const std::string&, const std::string&, const Json::Value&);
|
||||
virtual ~CFFI();
|
||||
|
||||
virtual auto refresh(int signal) -> void override;
|
||||
virtual auto doAction(const std::string& name) -> void override;
|
||||
virtual auto update() -> void override;
|
||||
|
||||
private:
|
||||
///
|
||||
void* cffi_instance_ = nullptr;
|
||||
|
||||
typedef void*(InitFn)(const ffi::wbcffi_init_info* init_info,
|
||||
const ffi::wbcffi_config_entry* config_entries, size_t config_entries_len);
|
||||
typedef void(DenitFn)(void* instance);
|
||||
typedef void(RefreshFn)(void* instance, int signal);
|
||||
typedef void(DoActionFn)(void* instance, const char* name);
|
||||
typedef void(UpdateFn)(void* instance);
|
||||
|
||||
// FFI hooks
|
||||
struct {
|
||||
std::function<InitFn> init = nullptr;
|
||||
std::function<DenitFn> deinit = nullptr;
|
||||
std::function<RefreshFn> refresh = [](void*, int) {};
|
||||
std::function<DoActionFn> doAction = [](void*, const char*) {};
|
||||
std::function<UpdateFn> update = [](void*) {};
|
||||
} hooks_;
|
||||
};
|
||||
|
||||
} // namespace waybar::modules
|
||||
@@ -6,62 +6,72 @@
|
||||
|
||||
namespace waybar::modules {
|
||||
|
||||
const std::string kCalendarPlaceholder = "calendar";
|
||||
const std::string KTimezonedTimeListPlaceholder = "timezoned_time_list";
|
||||
|
||||
enum class WeeksSide {
|
||||
LEFT,
|
||||
RIGHT,
|
||||
HIDDEN,
|
||||
};
|
||||
const std::string kCldPlaceholder{"calendar"};
|
||||
const std::string kTZPlaceholder{"tz_list"};
|
||||
const std::string kOrdPlaceholder{"ordinal_date"};
|
||||
|
||||
enum class CldMode { MONTH, YEAR };
|
||||
enum class WS { LEFT, RIGHT, HIDDEN };
|
||||
|
||||
class Clock final : public ALabel {
|
||||
public:
|
||||
Clock(const std::string&, const Json::Value&);
|
||||
virtual ~Clock() = default;
|
||||
auto update() -> void override;
|
||||
auto doAction(const std::string& name) -> void override;
|
||||
auto doAction(const std::string&) -> void override;
|
||||
|
||||
private:
|
||||
util::SleeperThread thread_;
|
||||
std::locale locale_;
|
||||
std::vector<const date::time_zone*> time_zones_;
|
||||
int current_time_zone_idx_;
|
||||
bool is_calendar_in_tooltip_;
|
||||
bool is_timezoned_list_in_tooltip_;
|
||||
|
||||
auto first_day_of_week() -> date::weekday;
|
||||
const date::time_zone* current_timezone();
|
||||
bool is_timezone_fixed();
|
||||
auto timezones_text(std::chrono::system_clock::time_point* now) -> std::string;
|
||||
|
||||
/*Calendar properties*/
|
||||
WeeksSide cldWPos_{WeeksSide::HIDDEN};
|
||||
const std::locale locale_;
|
||||
// tooltip
|
||||
const std::string tlpFmt_;
|
||||
std::string tlpText_{""}; // tooltip text to print
|
||||
// Calendar
|
||||
const bool cldInTooltip_; // calendar in tooltip
|
||||
/*
|
||||
0 - calendar.format.months
|
||||
1 - calendar.format.weekdays
|
||||
2 - calendar.format.days
|
||||
3 - calendar.format.today
|
||||
4 - calendar.format.weeks
|
||||
5 - tooltip-format
|
||||
*/
|
||||
std::map<int, std::string const> fmtMap_;
|
||||
uint cldMonCols_{3}; // calendar count month columns
|
||||
int cldWnLen_{3}; // calendar week number length
|
||||
const int cldMonColLen_{20}; // calendar month column length
|
||||
WS cldWPos_{WS::HIDDEN}; // calendar week side to print
|
||||
months cldCurrShift_{0}; // calendar months shift
|
||||
year_month_day cldYearShift_; // calendar Year mode. Cached ymd
|
||||
std::string cldYearCached_; // calendar Year mode. Cached calendar
|
||||
year_month cldMonShift_; // calendar Month mode. Cached ym
|
||||
std::string cldMonCached_; // calendar Month mode. Cached calendar
|
||||
day cldBaseDay_{0}; // calendar Cached day. Is used when today is changing(midnight)
|
||||
std::string cldText_{""}; // calendar text to print
|
||||
CldMode cldMode_{CldMode::MONTH};
|
||||
uint cldMonCols_{3}; // Count of the month in the row
|
||||
int cldMonColLen_{20}; // Length of the month column
|
||||
int cldWnLen_{3}; // Length of the week number
|
||||
date::year_month_day cldYearShift_;
|
||||
date::year_month cldMonShift_;
|
||||
date::months cldCurrShift_{0};
|
||||
date::months cldShift_{0};
|
||||
std::string cldYearCached_{};
|
||||
std::string cldMonCached_{};
|
||||
date::day cldBaseDay_{0};
|
||||
/*Calendar functions*/
|
||||
auto get_calendar(const date::zoned_seconds& now, const date::zoned_seconds& wtime)
|
||||
-> std::string;
|
||||
/*Clock actions*/
|
||||
auto get_calendar(const year_month_day& today, const year_month_day& ymd, const time_zone* tz)
|
||||
-> const std::string;
|
||||
|
||||
// time zoned time in tooltip
|
||||
const bool tzInTooltip_; // if need to print time zones text
|
||||
std::vector<const time_zone*> tzList_; // time zones list
|
||||
int tzCurrIdx_; // current time zone index for tzList_
|
||||
std::string tzText_{""}; // time zones text to print
|
||||
util::SleeperThread thread_;
|
||||
|
||||
// ordinal date in tooltip
|
||||
const bool ordInTooltip_;
|
||||
std::string ordText_{""};
|
||||
auto get_ordinal_date(const year_month_day& today) -> std::string;
|
||||
|
||||
auto getTZtext(sys_seconds now) -> std::string;
|
||||
auto first_day_of_week() -> weekday;
|
||||
// Module actions
|
||||
void cldModeSwitch();
|
||||
void cldShift_up();
|
||||
void cldShift_down();
|
||||
void tz_up();
|
||||
void tz_down();
|
||||
|
||||
// ModuleActionMap
|
||||
// Module Action Map
|
||||
static inline std::map<const std::string, void (waybar::modules::Clock::*const)()> actionMap_{
|
||||
{"mode", &waybar::modules::Clock::cldModeSwitch},
|
||||
{"shift_up", &waybar::modules::Clock::cldShift_up},
|
||||
@@ -69,4 +79,5 @@ class Clock final : public ALabel {
|
||||
{"tz_up", &waybar::modules::Clock::tz_up},
|
||||
{"tz_down", &waybar::modules::Clock::tz_down}};
|
||||
};
|
||||
|
||||
} // namespace waybar::modules
|
||||
|
||||
@@ -21,12 +21,6 @@ class Cpu : public ALabel {
|
||||
auto update() -> void override;
|
||||
|
||||
private:
|
||||
double getCpuLoad();
|
||||
std::tuple<std::vector<uint16_t>, std::string> getCpuUsage();
|
||||
std::tuple<float, float, float> getCpuFrequency();
|
||||
std::vector<std::tuple<size_t, size_t>> parseCpuinfo();
|
||||
std::vector<float> parseCpuFrequencies();
|
||||
|
||||
std::vector<std::tuple<size_t, size_t>> prev_times_;
|
||||
|
||||
util::SleeperThread thread_;
|
||||
|
||||
32
include/modules/cpu_frequency.hpp
Normal file
32
include/modules/cpu_frequency.hpp
Normal file
@@ -0,0 +1,32 @@
|
||||
#pragma once
|
||||
|
||||
#include <fmt/format.h>
|
||||
|
||||
#include <cstdint>
|
||||
#include <fstream>
|
||||
#include <numeric>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
#include "ALabel.hpp"
|
||||
#include "util/sleeper_thread.hpp"
|
||||
|
||||
namespace waybar::modules {
|
||||
|
||||
class CpuFrequency : public ALabel {
|
||||
public:
|
||||
CpuFrequency(const std::string&, const Json::Value&);
|
||||
virtual ~CpuFrequency() = default;
|
||||
auto update() -> void override;
|
||||
|
||||
// This is a static member because it is also used by the cpu module.
|
||||
static std::tuple<float, float, float> getCpuFrequency();
|
||||
|
||||
private:
|
||||
static std::vector<float> parseCpuFrequencies();
|
||||
|
||||
util::SleeperThread thread_;
|
||||
};
|
||||
|
||||
} // namespace waybar::modules
|
||||
35
include/modules/cpu_usage.hpp
Normal file
35
include/modules/cpu_usage.hpp
Normal file
@@ -0,0 +1,35 @@
|
||||
#pragma once
|
||||
|
||||
#include <fmt/format.h>
|
||||
|
||||
#include <cstdint>
|
||||
#include <fstream>
|
||||
#include <numeric>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
#include "ALabel.hpp"
|
||||
#include "util/sleeper_thread.hpp"
|
||||
|
||||
namespace waybar::modules {
|
||||
|
||||
class CpuUsage : public ALabel {
|
||||
public:
|
||||
CpuUsage(const std::string&, const Json::Value&);
|
||||
virtual ~CpuUsage() = default;
|
||||
auto update() -> void override;
|
||||
|
||||
// This is a static member because it is also used by the cpu module.
|
||||
static std::tuple<std::vector<uint16_t>, std::string> getCpuUsage(
|
||||
std::vector<std::tuple<size_t, size_t>>&);
|
||||
|
||||
private:
|
||||
static std::vector<std::tuple<size_t, size_t>> parseCpuinfo();
|
||||
|
||||
std::vector<std::tuple<size_t, size_t>> prev_times_;
|
||||
|
||||
util::SleeperThread thread_;
|
||||
};
|
||||
|
||||
} // namespace waybar::modules
|
||||
@@ -14,7 +14,7 @@ namespace waybar::modules {
|
||||
|
||||
class Custom : public ALabel {
|
||||
public:
|
||||
Custom(const std::string&, const std::string&, const Json::Value&);
|
||||
Custom(const std::string&, const std::string&, const Json::Value&, const std::string&);
|
||||
virtual ~Custom();
|
||||
auto update() -> void override;
|
||||
void refresh(int /*signal*/) override;
|
||||
@@ -22,6 +22,7 @@ class Custom : public ALabel {
|
||||
private:
|
||||
void delayWorker();
|
||||
void continuousWorker();
|
||||
void waitingWorker();
|
||||
void parseOutputRaw();
|
||||
void parseOutputJson();
|
||||
void handleEvent();
|
||||
@@ -29,6 +30,7 @@ class Custom : public ALabel {
|
||||
bool handleToggle(GdkEventButton* const& e) override;
|
||||
|
||||
const std::string name_;
|
||||
const std::string output_name_;
|
||||
std::string text_;
|
||||
std::string id_;
|
||||
std::string alt_;
|
||||
|
||||
@@ -20,6 +20,9 @@ class Disk : public ALabel {
|
||||
private:
|
||||
util::SleeperThread thread_;
|
||||
std::string path_;
|
||||
std::string unit_;
|
||||
|
||||
float calc_specific_divisor(const std::string divisor);
|
||||
};
|
||||
|
||||
} // namespace waybar::modules
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
#pragma once
|
||||
#include <functional>
|
||||
|
||||
#include <list>
|
||||
#include <memory>
|
||||
#include <mutex>
|
||||
#include <string>
|
||||
#include <thread>
|
||||
#include <utility>
|
||||
|
||||
#include "util/json.hpp"
|
||||
|
||||
namespace waybar::modules::hyprland {
|
||||
|
||||
@@ -18,17 +20,19 @@ class IPC {
|
||||
public:
|
||||
IPC() { startIPC(); }
|
||||
|
||||
void registerForIPC(const std::string&, EventHandler*);
|
||||
void unregisterForIPC(EventHandler*);
|
||||
void registerForIPC(const std::string& ev, EventHandler* ev_handler);
|
||||
void unregisterForIPC(EventHandler* handler);
|
||||
|
||||
std::string getSocket1Reply(const std::string& rq);
|
||||
static std::string getSocket1Reply(const std::string& rq);
|
||||
Json::Value getSocket1JsonReply(const std::string& rq);
|
||||
|
||||
private:
|
||||
void startIPC();
|
||||
void parseIPC(const std::string&);
|
||||
|
||||
std::mutex callbackMutex;
|
||||
std::list<std::pair<std::string, EventHandler*>> callbacks;
|
||||
std::mutex callbackMutex_;
|
||||
util::JsonParser parser_;
|
||||
std::list<std::pair<std::string, EventHandler*>> callbacks_;
|
||||
};
|
||||
|
||||
inline std::unique_ptr<IPC> gIPC;
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
#pragma once
|
||||
|
||||
#include <fmt/format.h>
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "ALabel.hpp"
|
||||
#include "bar.hpp"
|
||||
#include "modules/hyprland/backend.hpp"
|
||||
@@ -26,7 +30,7 @@ class Language : public waybar::ALabel, public EventHandler {
|
||||
std::string short_description;
|
||||
};
|
||||
|
||||
auto getLayout(const std::string&) -> Layout;
|
||||
static auto getLayout(const std::string&) -> Layout;
|
||||
|
||||
std::mutex mutex_;
|
||||
const Bar& bar_;
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
#pragma once
|
||||
|
||||
#include <fmt/format.h>
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "ALabel.hpp"
|
||||
#include "bar.hpp"
|
||||
#include "modules/hyprland/backend.hpp"
|
||||
@@ -10,12 +14,12 @@ namespace waybar::modules::hyprland {
|
||||
class Submap : public waybar::ALabel, public EventHandler {
|
||||
public:
|
||||
Submap(const std::string&, const waybar::Bar&, const Json::Value&);
|
||||
virtual ~Submap();
|
||||
~Submap() override;
|
||||
|
||||
auto update() -> void override;
|
||||
|
||||
private:
|
||||
void onEvent(const std::string&) override;
|
||||
void onEvent(const std::string& ev) override;
|
||||
|
||||
std::mutex mutex_;
|
||||
const Bar& bar_;
|
||||
|
||||
@@ -1,31 +1,65 @@
|
||||
#pragma once
|
||||
|
||||
#include <fmt/format.h>
|
||||
|
||||
#include <tuple>
|
||||
#include <string>
|
||||
|
||||
#include "ALabel.hpp"
|
||||
#include "AAppIconLabel.hpp"
|
||||
#include "bar.hpp"
|
||||
#include "modules/hyprland/backend.hpp"
|
||||
#include "util/json.hpp"
|
||||
|
||||
namespace waybar::modules::hyprland {
|
||||
|
||||
class Window : public waybar::ALabel, public EventHandler {
|
||||
class Window : public waybar::AAppIconLabel, public EventHandler {
|
||||
public:
|
||||
Window(const std::string&, const waybar::Bar&, const Json::Value&);
|
||||
virtual ~Window();
|
||||
~Window() override;
|
||||
|
||||
auto update() -> void override;
|
||||
|
||||
private:
|
||||
int getActiveWorkspaceID(std::string);
|
||||
std::string getLastWindowTitle(int);
|
||||
void onEvent(const std::string&) override;
|
||||
struct Workspace {
|
||||
int id;
|
||||
int windows;
|
||||
std::string last_window;
|
||||
std::string last_window_title;
|
||||
|
||||
bool separate_outputs;
|
||||
static auto parse(const Json::Value& value) -> Workspace;
|
||||
};
|
||||
|
||||
struct WindowData {
|
||||
bool floating;
|
||||
int monitor = -1;
|
||||
std::string class_name;
|
||||
std::string initial_class_name;
|
||||
std::string title;
|
||||
std::string initial_title;
|
||||
bool fullscreen;
|
||||
bool grouped;
|
||||
|
||||
static auto parse(const Json::Value&) -> WindowData;
|
||||
};
|
||||
|
||||
static auto getActiveWorkspace(const std::string&) -> Workspace;
|
||||
static auto getActiveWorkspace() -> Workspace;
|
||||
void onEvent(const std::string& ev) override;
|
||||
void queryActiveWorkspace();
|
||||
void setClass(const std::string&, bool enable);
|
||||
|
||||
bool separateOutputs_;
|
||||
std::mutex mutex_;
|
||||
const Bar& bar_;
|
||||
util::JsonParser parser_;
|
||||
std::string lastView;
|
||||
WindowData windowData_;
|
||||
Workspace workspace_;
|
||||
std::string soloClass_;
|
||||
std::string lastSoloClass_;
|
||||
bool solo_;
|
||||
bool allFloating_;
|
||||
bool swallowing_;
|
||||
bool fullscreen_;
|
||||
bool focused_;
|
||||
};
|
||||
|
||||
} // namespace waybar::modules::hyprland
|
||||
|
||||
223
include/modules/hyprland/workspaces.hpp
Normal file
223
include/modules/hyprland/workspaces.hpp
Normal file
@@ -0,0 +1,223 @@
|
||||
#pragma once
|
||||
|
||||
#include <gtkmm/button.h>
|
||||
#include <gtkmm/label.h>
|
||||
#include <json/value.h>
|
||||
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <optional>
|
||||
#include <regex>
|
||||
#include <string>
|
||||
#include <variant>
|
||||
#include <vector>
|
||||
|
||||
#include "AModule.hpp"
|
||||
#include "bar.hpp"
|
||||
#include "modules/hyprland/backend.hpp"
|
||||
#include "util/enum.hpp"
|
||||
#include "util/regex_collection.hpp"
|
||||
|
||||
using WindowAddress = std::string;
|
||||
|
||||
namespace waybar::modules::hyprland {
|
||||
|
||||
class Workspaces;
|
||||
|
||||
class WindowCreationPayload {
|
||||
public:
|
||||
WindowCreationPayload(std::string workspace_name, WindowAddress window_address,
|
||||
std::string window_repr);
|
||||
WindowCreationPayload(std::string workspace_name, WindowAddress window_address,
|
||||
std::string window_class, std::string window_title);
|
||||
WindowCreationPayload(Json::Value const& client_data);
|
||||
|
||||
int incrementTimeSpentUncreated();
|
||||
bool isEmpty(Workspaces& workspace_manager);
|
||||
bool reprIsReady() const { return std::holds_alternative<Repr>(m_window); }
|
||||
std::string repr(Workspaces& workspace_manager);
|
||||
|
||||
std::string getWorkspaceName() const { return m_workspaceName; }
|
||||
WindowAddress getAddress() const { return m_windowAddress; }
|
||||
|
||||
void moveToWorksace(std::string& new_workspace_name);
|
||||
|
||||
private:
|
||||
void clearAddr();
|
||||
void clearWorkspaceName();
|
||||
|
||||
using Repr = std::string;
|
||||
using ClassAndTitle = std::pair<std::string, std::string>;
|
||||
std::variant<Repr, ClassAndTitle> m_window;
|
||||
|
||||
WindowAddress m_windowAddress;
|
||||
std::string m_workspaceName;
|
||||
|
||||
int m_timeSpentUncreated = 0;
|
||||
};
|
||||
|
||||
class Workspace {
|
||||
public:
|
||||
explicit Workspace(const Json::Value& workspace_data, Workspaces& workspace_manager,
|
||||
const Json::Value& clients_data = Json::Value::nullRef);
|
||||
std::string& selectIcon(std::map<std::string, std::string>& icons_map);
|
||||
Gtk::Button& button() { return m_button; };
|
||||
|
||||
int id() const { return m_id; };
|
||||
std::string name() const { return m_name; };
|
||||
std::string output() const { return m_output; };
|
||||
bool isActive() const { return m_isActive; };
|
||||
bool isSpecial() const { return m_isSpecial; };
|
||||
bool isPersistent() const { return m_isPersistentRule || m_isPersistentConfig; };
|
||||
bool isPersistentConfig() const { return m_isPersistentConfig; };
|
||||
bool isPersistentRule() const { return m_isPersistentRule; };
|
||||
bool isVisible() const { return m_isVisible; };
|
||||
bool isEmpty() const { return m_windows == 0; };
|
||||
bool isUrgent() const { return m_isUrgent; };
|
||||
|
||||
bool handleClicked(GdkEventButton* bt) const;
|
||||
void setActive(bool value = true) { m_isActive = value; };
|
||||
void setPersistentRule(bool value = true) { m_isPersistentRule = value; };
|
||||
void setPersistentConfig(bool value = true) { m_isPersistentConfig = value; };
|
||||
void setUrgent(bool value = true) { m_isUrgent = value; };
|
||||
void setVisible(bool value = true) { m_isVisible = value; };
|
||||
void setWindows(uint value) { m_windows = value; };
|
||||
void setName(std::string const& value) { m_name = value; };
|
||||
bool containsWindow(WindowAddress const& addr) const { return m_windowMap.contains(addr); }
|
||||
void insertWindow(WindowCreationPayload create_window_paylod);
|
||||
std::string removeWindow(WindowAddress const& addr);
|
||||
void initializeWindowMap(const Json::Value& clients_data);
|
||||
|
||||
bool onWindowOpened(WindowCreationPayload const& create_window_paylod);
|
||||
std::optional<std::string> closeWindow(WindowAddress const& addr);
|
||||
|
||||
void update(const std::string& format, const std::string& icon);
|
||||
|
||||
private:
|
||||
Workspaces& m_workspaceManager;
|
||||
|
||||
int m_id;
|
||||
std::string m_name;
|
||||
std::string m_output;
|
||||
uint m_windows;
|
||||
bool m_isActive = false;
|
||||
bool m_isSpecial = false;
|
||||
bool m_isPersistentRule = false; // represents the persistent state in hyprland
|
||||
bool m_isPersistentConfig = false; // represents the persistent state in the Waybar config
|
||||
bool m_isUrgent = false;
|
||||
bool m_isVisible = false;
|
||||
|
||||
std::map<WindowAddress, std::string> m_windowMap;
|
||||
|
||||
Gtk::Button m_button;
|
||||
Gtk::Box m_content;
|
||||
Gtk::Label m_label;
|
||||
};
|
||||
|
||||
class Workspaces : public AModule, public EventHandler {
|
||||
public:
|
||||
Workspaces(const std::string&, const waybar::Bar&, const Json::Value&);
|
||||
~Workspaces() override;
|
||||
void update() override;
|
||||
void init();
|
||||
|
||||
auto allOutputs() const -> bool { return m_allOutputs; }
|
||||
auto showSpecial() const -> bool { return m_showSpecial; }
|
||||
auto activeOnly() const -> bool { return m_activeOnly; }
|
||||
|
||||
auto getBarOutput() const -> std::string { return m_bar.output->name; }
|
||||
|
||||
std::string getRewrite(std::string window_class, std::string window_title);
|
||||
std::string& getWindowSeparator() { return m_formatWindowSeparator; }
|
||||
bool isWorkspaceIgnored(std::string const& workspace_name);
|
||||
|
||||
bool windowRewriteConfigUsesTitle() const { return m_anyWindowRewriteRuleUsesTitle; }
|
||||
|
||||
private:
|
||||
void onEvent(const std::string& e) override;
|
||||
void updateWindowCount();
|
||||
void sortWorkspaces();
|
||||
void createWorkspace(Json::Value const& workspaceData,
|
||||
Json::Value const& clientsData = Json::Value::nullRef);
|
||||
void removeWorkspace(std::string const& name);
|
||||
void setUrgentWorkspace(std::string const& windowaddress);
|
||||
void parseConfig(const Json::Value& config);
|
||||
void registerIpc();
|
||||
|
||||
// workspace events
|
||||
void onWorkspaceActivated(std::string const& payload);
|
||||
void onSpecialWorkspaceActivated(std::string const& payload);
|
||||
void onWorkspaceDestroyed(std::string const& payload);
|
||||
void onWorkspaceCreated(std::string const& workspaceName,
|
||||
Json::Value const& clientsData = Json::Value::nullRef);
|
||||
void onWorkspaceMoved(std::string const& payload);
|
||||
void onWorkspaceRenamed(std::string const& payload);
|
||||
|
||||
// monitor events
|
||||
void onMonitorFocused(std::string const& payload);
|
||||
|
||||
// window events
|
||||
void onWindowOpened(std::string const& payload);
|
||||
void onWindowClosed(std::string const& addr);
|
||||
void onWindowMoved(std::string const& payload);
|
||||
|
||||
void onWindowTitleEvent(std::string const& payload);
|
||||
|
||||
void onConfigReloaded();
|
||||
|
||||
int windowRewritePriorityFunction(std::string const& window_rule);
|
||||
|
||||
void doUpdate();
|
||||
|
||||
void extendOrphans(int workspaceId, Json::Value const& clientsJson);
|
||||
void registerOrphanWindow(WindowCreationPayload create_window_payload);
|
||||
|
||||
void initializeWorkspaces();
|
||||
void setCurrentMonitorId();
|
||||
void loadPersistentWorkspacesFromConfig(Json::Value const& clientsJson);
|
||||
void loadPersistentWorkspacesFromWorkspaceRules(const Json::Value& clientsJson);
|
||||
|
||||
bool m_allOutputs = false;
|
||||
bool m_showSpecial = false;
|
||||
bool m_activeOnly = false;
|
||||
Json::Value m_persistentWorkspaceConfig;
|
||||
|
||||
// Map for windows stored in workspaces not present in the current bar.
|
||||
// This happens when the user has multiple monitors (hence, multiple bars)
|
||||
// and doesn't share windows accross bars (a.k.a `all-outputs` = false)
|
||||
std::map<WindowAddress, std::string> m_orphanWindowMap;
|
||||
|
||||
enum class SortMethod { ID, NAME, NUMBER, DEFAULT };
|
||||
util::EnumParser<SortMethod> m_enumParser;
|
||||
SortMethod m_sortBy = SortMethod::DEFAULT;
|
||||
std::map<std::string, SortMethod> m_sortMap = {{"ID", SortMethod::ID},
|
||||
{"NAME", SortMethod::NAME},
|
||||
{"NUMBER", SortMethod::NUMBER},
|
||||
{"DEFAULT", SortMethod::DEFAULT}};
|
||||
|
||||
std::string m_format;
|
||||
|
||||
std::map<std::string, std::string> m_iconsMap;
|
||||
util::RegexCollection m_windowRewriteRules;
|
||||
bool m_anyWindowRewriteRuleUsesTitle = false;
|
||||
std::string m_formatWindowSeparator;
|
||||
|
||||
bool m_withIcon;
|
||||
uint64_t m_monitorId;
|
||||
std::string m_activeWorkspaceName;
|
||||
std::string m_activeSpecialWorkspaceName;
|
||||
std::vector<std::unique_ptr<Workspace>> m_workspaces;
|
||||
std::vector<std::pair<Json::Value, Json::Value>> m_workspacesToCreate;
|
||||
std::vector<std::string> m_workspacesToRemove;
|
||||
std::vector<WindowCreationPayload> m_windowsToCreate;
|
||||
|
||||
std::vector<std::regex> m_ignoreWorkspaces;
|
||||
|
||||
std::mutex m_mutex;
|
||||
const Bar& m_bar;
|
||||
Gtk::Box m_box;
|
||||
};
|
||||
|
||||
} // namespace waybar::modules::hyprland
|
||||
@@ -24,12 +24,15 @@ class Image : public AModule {
|
||||
private:
|
||||
void delayWorker();
|
||||
void handleEvent();
|
||||
void parseOutputRaw();
|
||||
|
||||
Gtk::Box box_;
|
||||
Gtk::Image image_;
|
||||
std::string path_;
|
||||
std::string tooltip_;
|
||||
int size_;
|
||||
int interval_;
|
||||
util::command::res output_;
|
||||
|
||||
util::SleeperThread thread_;
|
||||
};
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
#include <fmt/chrono.h>
|
||||
#include <gtkmm/label.h>
|
||||
|
||||
#include <set>
|
||||
#include <unordered_map>
|
||||
|
||||
#include "AModule.hpp"
|
||||
@@ -40,6 +41,7 @@ class KeyboardState : public AModule {
|
||||
|
||||
struct libinput* libinput_;
|
||||
std::unordered_map<std::string, struct libinput_device*> libinput_devices_;
|
||||
std::set<int> binding_keys;
|
||||
|
||||
util::SleeperThread libinput_thread_, hotplug_thread_;
|
||||
};
|
||||
|
||||
30
include/modules/load.hpp
Normal file
30
include/modules/load.hpp
Normal file
@@ -0,0 +1,30 @@
|
||||
#pragma once
|
||||
|
||||
#include <fmt/format.h>
|
||||
|
||||
#include <cstdint>
|
||||
#include <fstream>
|
||||
#include <numeric>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
#include "ALabel.hpp"
|
||||
#include "util/sleeper_thread.hpp"
|
||||
|
||||
namespace waybar::modules {
|
||||
|
||||
class Load : public ALabel {
|
||||
public:
|
||||
Load(const std::string&, const Json::Value&);
|
||||
virtual ~Load() = default;
|
||||
auto update() -> void override;
|
||||
|
||||
// This is a static member because it is also used by the cpu module.
|
||||
static std::tuple<double, double, double> getLoad();
|
||||
|
||||
private:
|
||||
util::SleeperThread thread_;
|
||||
};
|
||||
|
||||
} // namespace waybar::modules
|
||||
@@ -148,6 +148,7 @@ class Stopped : public State {
|
||||
class Disconnected : public State {
|
||||
Context* const ctx_;
|
||||
sigc::connection timer_connection_;
|
||||
int last_interval_;
|
||||
|
||||
public:
|
||||
Disconnected(Context* const ctx) : ctx_{ctx} {}
|
||||
@@ -162,7 +163,7 @@ class Disconnected : public State {
|
||||
Disconnected(Disconnected const&) = delete;
|
||||
Disconnected& operator=(Disconnected const&) = delete;
|
||||
|
||||
void arm_timer(int interval) noexcept;
|
||||
bool arm_timer(int interval) noexcept;
|
||||
void disarm_timer() noexcept;
|
||||
|
||||
bool on_timer();
|
||||
|
||||
@@ -67,6 +67,8 @@ class Mpris : public ALabel {
|
||||
int title_len_;
|
||||
int dynamic_len_;
|
||||
std::vector<std::string> dynamic_prio_;
|
||||
std::vector<std::string> dynamic_order_;
|
||||
std::string dynamic_separator_;
|
||||
bool truncate_hours_;
|
||||
bool tooltip_len_limits_;
|
||||
std::string ellipsis_;
|
||||
@@ -80,6 +82,7 @@ class Mpris : public ALabel {
|
||||
std::string lastPlayer;
|
||||
|
||||
util::SleeperThread thread_;
|
||||
std::chrono::time_point<std::chrono::system_clock> last_update_;
|
||||
};
|
||||
|
||||
} // namespace waybar::modules::mpris
|
||||
|
||||
@@ -78,7 +78,6 @@ class Network : public ALabel {
|
||||
int32_t signal_strength_dbm_;
|
||||
uint8_t signal_strength_;
|
||||
std::string signal_strength_app_;
|
||||
float frequency_;
|
||||
uint32_t route_priority;
|
||||
|
||||
util::SleeperThread thread_;
|
||||
@@ -86,6 +85,7 @@ class Network : public ALabel {
|
||||
#ifdef WANT_RFKILL
|
||||
util::Rfkill rfkill_;
|
||||
#endif
|
||||
float frequency_;
|
||||
};
|
||||
|
||||
} // namespace waybar::modules
|
||||
|
||||
46
include/modules/power_profiles_daemon.hpp
Normal file
46
include/modules/power_profiles_daemon.hpp
Normal file
@@ -0,0 +1,46 @@
|
||||
#pragma once
|
||||
|
||||
#include <fmt/format.h>
|
||||
|
||||
#include "ALabel.hpp"
|
||||
#include "giomm/dbusproxy.h"
|
||||
|
||||
namespace waybar::modules {
|
||||
|
||||
struct Profile {
|
||||
std::string name;
|
||||
std::string driver;
|
||||
};
|
||||
|
||||
class PowerProfilesDaemon : public ALabel {
|
||||
public:
|
||||
PowerProfilesDaemon(const std::string &, const Json::Value &);
|
||||
auto update() -> void override;
|
||||
void profileChangedCb(const Gio::DBus::Proxy::MapChangedProperties &,
|
||||
const std::vector<Glib::ustring> &);
|
||||
void busConnectedCb(Glib::RefPtr<Gio::AsyncResult> &r);
|
||||
void getAllPropsCb(Glib::RefPtr<Gio::AsyncResult> &r);
|
||||
void setPropCb(Glib::RefPtr<Gio::AsyncResult> &r);
|
||||
void populateInitState();
|
||||
bool handleToggle(GdkEventButton *const &e) override;
|
||||
|
||||
private:
|
||||
// True if we're connected to the dbug interface. False if we're
|
||||
// not.
|
||||
bool connected_;
|
||||
// Look for a profile name in the list of available profiles and
|
||||
// switch activeProfile_ to it.
|
||||
void switchToProfile(std::string const &);
|
||||
// Used to toggle/display the profiles
|
||||
std::vector<Profile> availableProfiles_;
|
||||
// Points to the active profile in the profiles list
|
||||
std::vector<Profile>::iterator activeProfile_;
|
||||
// Current CSS class applied to the label
|
||||
std::string currentStyle_;
|
||||
// Format string
|
||||
std::string tooltipFormat_;
|
||||
// DBus Proxy used to track the current active profile
|
||||
Glib::RefPtr<Gio::DBus::Proxy> powerProfilesProxy_;
|
||||
};
|
||||
|
||||
} // namespace waybar::modules
|
||||
41
include/modules/privacy/privacy.hpp
Normal file
41
include/modules/privacy/privacy.hpp
Normal file
@@ -0,0 +1,41 @@
|
||||
#pragma once
|
||||
|
||||
#include <iostream>
|
||||
#include <map>
|
||||
#include <string>
|
||||
|
||||
#include "ALabel.hpp"
|
||||
#include "gtkmm/box.h"
|
||||
#include "modules/privacy/privacy_item.hpp"
|
||||
#include "util/pipewire/pipewire_backend.hpp"
|
||||
#include "util/pipewire/privacy_node_info.hpp"
|
||||
|
||||
using waybar::util::PipewireBackend::PrivacyNodeInfo;
|
||||
|
||||
namespace waybar::modules::privacy {
|
||||
|
||||
class Privacy : public AModule {
|
||||
public:
|
||||
Privacy(const std::string &, const Json::Value &, const std::string &pos);
|
||||
auto update() -> void override;
|
||||
|
||||
void onPrivacyNodesChanged();
|
||||
|
||||
private:
|
||||
std::list<PrivacyNodeInfo *> nodes_screenshare; // Screen is being shared
|
||||
std::list<PrivacyNodeInfo *> nodes_audio_in; // Application is using the microphone
|
||||
std::list<PrivacyNodeInfo *> nodes_audio_out; // Application is outputting audio
|
||||
|
||||
std::mutex mutex_;
|
||||
sigc::connection visibility_conn;
|
||||
|
||||
// Config
|
||||
Gtk::Box box_;
|
||||
uint iconSpacing = 4;
|
||||
uint iconSize = 20;
|
||||
uint transition_duration = 250;
|
||||
|
||||
std::shared_ptr<util::PipewireBackend::PipewireBackend> backend = nullptr;
|
||||
};
|
||||
|
||||
} // namespace waybar::modules::privacy
|
||||
51
include/modules/privacy/privacy_item.hpp
Normal file
51
include/modules/privacy/privacy_item.hpp
Normal file
@@ -0,0 +1,51 @@
|
||||
#pragma once
|
||||
|
||||
#include <json/value.h>
|
||||
|
||||
#include <iostream>
|
||||
#include <map>
|
||||
#include <mutex>
|
||||
#include <string>
|
||||
|
||||
#include "gtkmm/box.h"
|
||||
#include "gtkmm/image.h"
|
||||
#include "gtkmm/revealer.h"
|
||||
#include "util/pipewire/privacy_node_info.hpp"
|
||||
|
||||
using waybar::util::PipewireBackend::PrivacyNodeInfo;
|
||||
using waybar::util::PipewireBackend::PrivacyNodeType;
|
||||
|
||||
namespace waybar::modules::privacy {
|
||||
|
||||
class PrivacyItem : public Gtk::Revealer {
|
||||
public:
|
||||
PrivacyItem(const Json::Value &config_, enum PrivacyNodeType privacy_type_,
|
||||
std::list<PrivacyNodeInfo *> *nodes, const std::string &pos, const uint icon_size,
|
||||
const uint transition_duration);
|
||||
|
||||
enum PrivacyNodeType privacy_type;
|
||||
|
||||
void set_in_use(bool in_use);
|
||||
|
||||
private:
|
||||
std::list<PrivacyNodeInfo *> *nodes;
|
||||
|
||||
sigc::connection signal_conn;
|
||||
|
||||
Gtk::Box tooltip_window;
|
||||
|
||||
bool init = false;
|
||||
bool in_use = false;
|
||||
|
||||
// Config
|
||||
std::string iconName = "image-missing-symbolic";
|
||||
bool tooltip = true;
|
||||
uint tooltipIconSize = 24;
|
||||
|
||||
Gtk::Box box_;
|
||||
Gtk::Image icon_;
|
||||
|
||||
void update_tooltip();
|
||||
};
|
||||
|
||||
} // namespace waybar::modules::privacy
|
||||
@@ -1,54 +1,27 @@
|
||||
#pragma once
|
||||
|
||||
#include <fmt/format.h>
|
||||
#include <pulse/pulseaudio.h>
|
||||
#include <pulse/volume.h>
|
||||
|
||||
#include <algorithm>
|
||||
#include <array>
|
||||
#include <memory>
|
||||
|
||||
#include "ALabel.hpp"
|
||||
#include "util/audio_backend.hpp"
|
||||
|
||||
namespace waybar::modules {
|
||||
|
||||
class Pulseaudio : public ALabel {
|
||||
public:
|
||||
Pulseaudio(const std::string&, const Json::Value&);
|
||||
virtual ~Pulseaudio();
|
||||
virtual ~Pulseaudio() = default;
|
||||
auto update() -> void override;
|
||||
|
||||
private:
|
||||
static void subscribeCb(pa_context*, pa_subscription_event_type_t, uint32_t, void*);
|
||||
static void contextStateCb(pa_context*, void*);
|
||||
static void sinkInfoCb(pa_context*, const pa_sink_info*, int, void*);
|
||||
static void sourceInfoCb(pa_context*, const pa_source_info* i, int, void* data);
|
||||
static void serverInfoCb(pa_context*, const pa_server_info*, void*);
|
||||
static void volumeModifyCb(pa_context*, int, void*);
|
||||
|
||||
bool handleScroll(GdkEventScroll* e) override;
|
||||
const std::vector<std::string> getPulseIcon() const;
|
||||
|
||||
pa_threaded_mainloop* mainloop_;
|
||||
pa_mainloop_api* mainloop_api_;
|
||||
pa_context* context_;
|
||||
// SINK
|
||||
uint32_t sink_idx_{0};
|
||||
uint16_t volume_;
|
||||
pa_cvolume pa_volume_;
|
||||
bool muted_;
|
||||
std::string port_name_;
|
||||
std::string form_factor_;
|
||||
std::string desc_;
|
||||
std::string monitor_;
|
||||
std::string current_sink_name_;
|
||||
bool current_sink_running_;
|
||||
// SOURCE
|
||||
uint32_t source_idx_{0};
|
||||
uint16_t source_volume_;
|
||||
bool source_muted_;
|
||||
std::string source_port_name_;
|
||||
std::string source_desc_;
|
||||
std::string default_source_name_;
|
||||
std::shared_ptr<util::AudioBackend> backend = nullptr;
|
||||
};
|
||||
|
||||
} // namespace waybar::modules
|
||||
|
||||
27
include/modules/pulseaudio_slider.hpp
Normal file
27
include/modules/pulseaudio_slider.hpp
Normal file
@@ -0,0 +1,27 @@
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "ASlider.hpp"
|
||||
#include "util/audio_backend.hpp"
|
||||
namespace waybar::modules {
|
||||
|
||||
enum class PulseaudioSliderTarget {
|
||||
Sink,
|
||||
Source,
|
||||
};
|
||||
|
||||
class PulseaudioSlider : public ASlider {
|
||||
public:
|
||||
PulseaudioSlider(const std::string&, const Json::Value&);
|
||||
virtual ~PulseaudioSlider() = default;
|
||||
|
||||
void update() override;
|
||||
void onValueChanged() override;
|
||||
|
||||
private:
|
||||
std::shared_ptr<util::AudioBackend> backend = nullptr;
|
||||
PulseaudioSliderTarget target = PulseaudioSliderTarget::Sink;
|
||||
};
|
||||
|
||||
} // namespace waybar::modules
|
||||
@@ -84,6 +84,8 @@ class Item : public sigc::trackable {
|
||||
// visibility of items with Status == Passive
|
||||
bool show_passive_ = false;
|
||||
|
||||
const Bar& bar_;
|
||||
|
||||
Glib::RefPtr<Gio::DBus::Proxy> proxy_;
|
||||
Glib::RefPtr<Gio::Cancellable> cancellable_;
|
||||
std::set<std::string_view> update_pending_;
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#include <cstring>
|
||||
#include <memory>
|
||||
#include <mutex>
|
||||
#include <stdexcept>
|
||||
#include <string>
|
||||
|
||||
#include "ipc.hpp"
|
||||
|
||||
@@ -56,6 +56,7 @@ class Language : public ALabel, public sigc::trackable {
|
||||
Layout layout_;
|
||||
std::string tooltip_format_ = "";
|
||||
std::map<std::string, Layout> layouts_map_;
|
||||
bool hide_single_;
|
||||
bool is_variant_displayed;
|
||||
std::byte displayed_short_flag = static_cast<std::byte>(DispayedShortFlag::None);
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
#include <tuple>
|
||||
|
||||
#include "AIconLabel.hpp"
|
||||
#include "AAppIconLabel.hpp"
|
||||
#include "bar.hpp"
|
||||
#include "client.hpp"
|
||||
#include "modules/sway/ipc/client.hpp"
|
||||
@@ -12,7 +12,7 @@
|
||||
|
||||
namespace waybar::modules::sway {
|
||||
|
||||
class Window : public AIconLabel, public sigc::trackable {
|
||||
class Window : public AAppIconLabel, public sigc::trackable {
|
||||
public:
|
||||
Window(const std::string&, const waybar::Bar&, const Json::Value&);
|
||||
virtual ~Window() = default;
|
||||
@@ -25,8 +25,6 @@ class Window : public AIconLabel, public sigc::trackable {
|
||||
std::tuple<std::size_t, int, int, std::string, std::string, std::string, std::string, std::string>
|
||||
getFocusedNode(const Json::Value& nodes, std::string& output);
|
||||
void getTree();
|
||||
void updateAppIconName();
|
||||
void updateAppIcon();
|
||||
|
||||
const Bar& bar_;
|
||||
std::string window_;
|
||||
@@ -37,9 +35,6 @@ class Window : public AIconLabel, public sigc::trackable {
|
||||
std::string old_app_id_;
|
||||
std::size_t app_nb_;
|
||||
std::string shell_;
|
||||
unsigned app_icon_size_{24};
|
||||
bool update_app_icon_{true};
|
||||
std::string app_icon_name_;
|
||||
int floating_count_;
|
||||
util::JsonParser parser_;
|
||||
std::mutex mutex_;
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
#include "client.hpp"
|
||||
#include "modules/sway/ipc/client.hpp"
|
||||
#include "util/json.hpp"
|
||||
#include "util/regex_collection.hpp"
|
||||
|
||||
namespace waybar::modules::sway {
|
||||
|
||||
@@ -27,10 +28,13 @@ class Workspaces : public AModule, public sigc::trackable {
|
||||
R"(workspace {} "{}"; move workspace to output "{}"; workspace {} "{}")";
|
||||
|
||||
static int convertWorkspaceNameToNum(std::string name);
|
||||
static int windowRewritePriorityFunction(std::string const& window_rule);
|
||||
|
||||
void onCmd(const struct Ipc::ipc_response&);
|
||||
void onEvent(const struct Ipc::ipc_response&);
|
||||
bool filterButtons();
|
||||
static bool hasFlag(const Json::Value&, const std::string&);
|
||||
void updateWindows(const Json::Value&, std::string&);
|
||||
Gtk::Button& addButton(const Json::Value&);
|
||||
void onButtonReady(const Json::Value&, Gtk::Button&);
|
||||
std::string getIcon(const std::string&, const Json::Value&);
|
||||
@@ -41,8 +45,12 @@ class Workspaces : public AModule, public sigc::trackable {
|
||||
|
||||
const Bar& bar_;
|
||||
std::vector<Json::Value> workspaces_;
|
||||
std::vector<std::string> high_priority_named_;
|
||||
std::vector<std::string> workspaces_order_;
|
||||
Gtk::Box box_;
|
||||
std::string m_formatWindowSeperator;
|
||||
std::string m_windowRewriteDefault;
|
||||
util::RegexCollection m_windowRewriteRules;
|
||||
util::JsonParser parser_;
|
||||
std::unordered_map<std::string, Gtk::Button> buttons_;
|
||||
std::mutex mutex_;
|
||||
|
||||
31
include/modules/systemd_failed_units.hpp
Normal file
31
include/modules/systemd_failed_units.hpp
Normal file
@@ -0,0 +1,31 @@
|
||||
#pragma once
|
||||
|
||||
#include <giomm/dbusproxy.h>
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "ALabel.hpp"
|
||||
|
||||
namespace waybar::modules {
|
||||
|
||||
class SystemdFailedUnits : public ALabel {
|
||||
public:
|
||||
SystemdFailedUnits(const std::string &, const Json::Value &);
|
||||
virtual ~SystemdFailedUnits();
|
||||
auto update() -> void override;
|
||||
|
||||
private:
|
||||
bool hide_on_ok;
|
||||
std::string format_ok;
|
||||
|
||||
bool update_pending;
|
||||
uint32_t nr_failed_system, nr_failed_user;
|
||||
std::string last_status;
|
||||
Glib::RefPtr<Gio::DBus::Proxy> system_proxy, user_proxy;
|
||||
|
||||
void notify_cb(const Glib::ustring &sender_name, const Glib::ustring &signal_name,
|
||||
const Glib::VariantContainerBase &arguments);
|
||||
void updateData();
|
||||
};
|
||||
|
||||
} // namespace waybar::modules
|
||||
@@ -66,14 +66,16 @@ class UPower : public AModule {
|
||||
Devices devices;
|
||||
std::mutex m_Mutex;
|
||||
UpClient *client;
|
||||
UpDevice *displayDevice;
|
||||
UpDevice *displayDevice = nullptr;
|
||||
guint login1_id;
|
||||
GDBusConnection *login1_connection;
|
||||
UPowerTooltip *upower_tooltip;
|
||||
std::unique_ptr<UPowerTooltip> upower_tooltip;
|
||||
std::string lastStatus;
|
||||
bool showAltText;
|
||||
bool showIcon = true;
|
||||
bool upowerRunning;
|
||||
guint upowerWatcher_id;
|
||||
std::string nativePath_;
|
||||
};
|
||||
|
||||
} // namespace waybar::modules::upower
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
#include <libupower-glib/upower.h>
|
||||
|
||||
#include <memory>
|
||||
#include <unordered_map>
|
||||
|
||||
#include "gtkmm/box.h"
|
||||
@@ -16,7 +17,7 @@ class UPowerTooltip : public Gtk::Window {
|
||||
|
||||
const std::string getDeviceIcon(UpDeviceKind& kind);
|
||||
|
||||
Gtk::Box* contentBox;
|
||||
std::unique_ptr<Gtk::Box> contentBox;
|
||||
|
||||
uint iconSize;
|
||||
uint tooltipSpacing;
|
||||
|
||||
@@ -27,6 +27,8 @@ class Wireplumber : public ALabel {
|
||||
static void onMixerChanged(waybar::modules::Wireplumber* self, uint32_t id);
|
||||
static void onDefaultNodesApiChanged(waybar::modules::Wireplumber* self);
|
||||
|
||||
bool handleScroll(GdkEventScroll* e) override;
|
||||
|
||||
WpCore* wp_core_;
|
||||
GPtrArray* apis_;
|
||||
WpObjectManager* om_;
|
||||
@@ -36,6 +38,7 @@ class Wireplumber : public ALabel {
|
||||
uint32_t pending_plugins_;
|
||||
bool muted_;
|
||||
double volume_;
|
||||
double min_step_;
|
||||
uint32_t node_id_{0};
|
||||
std::string node_name_;
|
||||
};
|
||||
|
||||
96
include/util/audio_backend.hpp
Normal file
96
include/util/audio_backend.hpp
Normal file
@@ -0,0 +1,96 @@
|
||||
#pragma once
|
||||
|
||||
#include <json/value.h>
|
||||
#include <pulse/context.h>
|
||||
#include <pulse/introspect.h>
|
||||
#include <pulse/thread-mainloop.h>
|
||||
#include <pulse/volume.h>
|
||||
|
||||
#include <functional>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
#include "util/backend_common.hpp"
|
||||
|
||||
namespace waybar::util {
|
||||
|
||||
class AudioBackend {
|
||||
private:
|
||||
static void subscribeCb(pa_context*, pa_subscription_event_type_t, uint32_t, void*);
|
||||
static void contextStateCb(pa_context*, void*);
|
||||
static void sinkInfoCb(pa_context*, const pa_sink_info*, int, void*);
|
||||
static void sourceInfoCb(pa_context*, const pa_source_info* i, int, void* data);
|
||||
static void serverInfoCb(pa_context*, const pa_server_info*, void*);
|
||||
static void volumeModifyCb(pa_context*, int, void*);
|
||||
void connectContext();
|
||||
|
||||
pa_threaded_mainloop* mainloop_;
|
||||
pa_mainloop_api* mainloop_api_;
|
||||
pa_context* context_;
|
||||
pa_cvolume pa_volume_;
|
||||
|
||||
// SINK
|
||||
uint32_t sink_idx_{0};
|
||||
uint16_t volume_;
|
||||
bool muted_;
|
||||
std::string port_name_;
|
||||
std::string form_factor_;
|
||||
std::string desc_;
|
||||
std::string monitor_;
|
||||
std::string current_sink_name_;
|
||||
bool current_sink_running_;
|
||||
// SOURCE
|
||||
uint32_t source_idx_{0};
|
||||
uint16_t source_volume_;
|
||||
bool source_muted_;
|
||||
std::string source_port_name_;
|
||||
std::string source_desc_;
|
||||
std::string default_source_name_;
|
||||
|
||||
std::vector<std::string> ignored_sinks_;
|
||||
|
||||
std::function<void()> on_updated_cb_ = NOOP;
|
||||
|
||||
/* Hack to keep constructor inaccessible but still public.
|
||||
* This is required to be able to use std::make_shared.
|
||||
* It is important to keep this class only accessible via a reference-counted
|
||||
* pointer because the destructor will manually free memory, and this could be
|
||||
* a problem with C++20's copy and move semantics.
|
||||
*/
|
||||
struct private_constructor_tag {};
|
||||
|
||||
public:
|
||||
static std::shared_ptr<AudioBackend> getInstance(std::function<void()> on_updated_cb = NOOP);
|
||||
|
||||
AudioBackend(std::function<void()> on_updated_cb, private_constructor_tag tag);
|
||||
~AudioBackend();
|
||||
|
||||
void changeVolume(uint16_t volume, uint16_t min_volume = 0, uint16_t max_volume = 100);
|
||||
void changeVolume(ChangeType change_type, double step = 1, uint16_t max_volume = 100);
|
||||
|
||||
void setIgnoredSinks(const Json::Value& config);
|
||||
|
||||
std::string getSinkPortName() const { return port_name_; }
|
||||
std::string getFormFactor() const { return form_factor_; }
|
||||
std::string getSinkDesc() const { return desc_; }
|
||||
std::string getMonitor() const { return monitor_; }
|
||||
std::string getCurrentSinkName() const { return current_sink_name_; }
|
||||
bool getCurrentSinkRunning() const { return current_sink_running_; }
|
||||
uint16_t getSinkVolume() const { return volume_; }
|
||||
bool getSinkMuted() const { return muted_; }
|
||||
uint16_t getSourceVolume() const { return source_volume_; }
|
||||
bool getSourceMuted() const { return source_muted_; }
|
||||
std::string getSourcePortName() const { return source_port_name_; }
|
||||
std::string getSourceDesc() const { return source_desc_; }
|
||||
std::string getDefaultSourceName() const { return default_source_name_; }
|
||||
|
||||
void toggleSinkMute();
|
||||
void toggleSinkMute(bool);
|
||||
|
||||
void toggleSourceMute();
|
||||
void toggleSourceMute(bool);
|
||||
|
||||
bool isBluetooth();
|
||||
};
|
||||
|
||||
} // namespace waybar::util
|
||||
10
include/util/backend_common.hpp
Normal file
10
include/util/backend_common.hpp
Normal file
@@ -0,0 +1,10 @@
|
||||
#pragma once
|
||||
|
||||
#include "AModule.hpp"
|
||||
|
||||
namespace waybar::util {
|
||||
|
||||
const static auto NOOP = []() {};
|
||||
enum class ChangeType : char { Increase, Decrease };
|
||||
|
||||
} // namespace waybar::util
|
||||
93
include/util/backlight_backend.hpp
Normal file
93
include/util/backlight_backend.hpp
Normal file
@@ -0,0 +1,93 @@
|
||||
#pragma once
|
||||
|
||||
#include <libudev.h>
|
||||
#include <spdlog/spdlog.h>
|
||||
|
||||
#include <chrono>
|
||||
#include <mutex>
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
#include <vector>
|
||||
|
||||
#include "giomm/dbusproxy.h"
|
||||
#include "util/backend_common.hpp"
|
||||
#include "util/sleeper_thread.hpp"
|
||||
|
||||
#define GET_BEST_DEVICE(varname, backend, preferred_device) \
|
||||
decltype((backend).devices_) __devices; \
|
||||
{ \
|
||||
std::scoped_lock<std::mutex> lock((backend).udev_thread_mutex_); \
|
||||
__devices = (backend).devices_; \
|
||||
} \
|
||||
auto varname = (backend).best_device(__devices.cbegin(), __devices.cend(), preferred_device);
|
||||
|
||||
namespace waybar::util {
|
||||
|
||||
class BacklightDevice {
|
||||
public:
|
||||
BacklightDevice() = default;
|
||||
BacklightDevice(std::string name, int actual, int max, bool powered);
|
||||
|
||||
std::string name() const;
|
||||
int get_actual() const;
|
||||
void set_actual(int actual);
|
||||
int get_max() const;
|
||||
void set_max(int max);
|
||||
bool get_powered() const;
|
||||
void set_powered(bool powered);
|
||||
friend inline bool operator==(const BacklightDevice &lhs, const BacklightDevice &rhs) {
|
||||
return lhs.name_ == rhs.name_ && lhs.actual_ == rhs.actual_ && lhs.max_ == rhs.max_;
|
||||
}
|
||||
|
||||
private:
|
||||
std::string name_;
|
||||
int actual_ = 1;
|
||||
int max_ = 1;
|
||||
bool powered_ = true;
|
||||
};
|
||||
|
||||
class BacklightBackend {
|
||||
public:
|
||||
BacklightBackend(std::chrono::milliseconds interval, std::function<void()> on_updated_cb = NOOP);
|
||||
|
||||
// const inline BacklightDevice *get_best_device(std::string_view preferred_device);
|
||||
const BacklightDevice *get_previous_best_device();
|
||||
|
||||
void set_previous_best_device(const BacklightDevice *device);
|
||||
|
||||
void set_brightness(std::string preferred_device, ChangeType change_type, double step);
|
||||
|
||||
void set_scaled_brightness(std::string preferred_device, int brightness);
|
||||
int get_scaled_brightness(std::string preferred_device);
|
||||
|
||||
template <class ForwardIt, class Inserter>
|
||||
static void upsert_device(ForwardIt first, ForwardIt last, Inserter inserter, udev_device *dev);
|
||||
|
||||
template <class ForwardIt, class Inserter>
|
||||
static void enumerate_devices(ForwardIt first, ForwardIt last, Inserter inserter, udev *udev);
|
||||
|
||||
bool is_login_proxy_initialized() const { return static_cast<bool>(login_proxy_); }
|
||||
|
||||
template <class ForwardIt>
|
||||
static const BacklightDevice *best_device(ForwardIt first, ForwardIt last, std::string_view);
|
||||
|
||||
std::vector<BacklightDevice> devices_;
|
||||
std::mutex udev_thread_mutex_;
|
||||
|
||||
private:
|
||||
void set_brightness_internal(std::string device_name, int brightness, int max_brightness);
|
||||
|
||||
std::function<void()> on_updated_cb_;
|
||||
std::chrono::milliseconds polling_interval_;
|
||||
|
||||
std::optional<BacklightDevice> previous_best_;
|
||||
// thread must destruct before shared data
|
||||
util::SleeperThread udev_thread_;
|
||||
|
||||
Glib::RefPtr<Gio::DBus::Proxy> login_proxy_;
|
||||
|
||||
static constexpr int EPOLL_MAX_EVENTS = 16;
|
||||
};
|
||||
|
||||
} // namespace waybar::util
|
||||
@@ -66,7 +66,7 @@ inline int close(FILE* fp, pid_t pid) {
|
||||
return stat;
|
||||
}
|
||||
|
||||
inline FILE* open(const std::string& cmd, int& pid) {
|
||||
inline FILE* open(const std::string& cmd, int& pid, const std::string& output_name) {
|
||||
if (cmd == "") return nullptr;
|
||||
int fd[2];
|
||||
// Open the pipe with the close-on-exec flag set, so it will not be inherited
|
||||
@@ -109,6 +109,9 @@ inline FILE* open(const std::string& cmd, int& pid) {
|
||||
::close(fd[0]);
|
||||
dup2(fd[1], 1);
|
||||
setpgid(child_pid, child_pid);
|
||||
if (output_name != "") {
|
||||
setenv("WAYBAR_OUTPUT_NAME", output_name.c_str(), 1);
|
||||
}
|
||||
execlp("/bin/sh", "sh", "-c", cmd.c_str(), (char*)0);
|
||||
exit(0);
|
||||
} else {
|
||||
@@ -118,9 +121,9 @@ inline FILE* open(const std::string& cmd, int& pid) {
|
||||
return fdopen(fd[0], "r");
|
||||
}
|
||||
|
||||
inline struct res exec(const std::string& cmd) {
|
||||
inline struct res exec(const std::string& cmd, const std::string& output_name) {
|
||||
int pid;
|
||||
auto fp = command::open(cmd, pid);
|
||||
auto fp = command::open(cmd, pid, output_name);
|
||||
if (!fp) return {-1, ""};
|
||||
auto output = command::read(fp);
|
||||
auto stat = command::close(fp, pid);
|
||||
@@ -129,7 +132,7 @@ inline struct res exec(const std::string& cmd) {
|
||||
|
||||
inline struct res execNoRead(const std::string& cmd) {
|
||||
int pid;
|
||||
auto fp = command::open(cmd, pid);
|
||||
auto fp = command::open(cmd, pid, "");
|
||||
if (!fp) return {-1, ""};
|
||||
auto stat = command::close(fp, pid);
|
||||
return {WEXITSTATUS(stat), ""};
|
||||
|
||||
49
include/util/css_reload_helper.hpp
Normal file
49
include/util/css_reload_helper.hpp
Normal file
@@ -0,0 +1,49 @@
|
||||
#pragma once
|
||||
|
||||
#include <functional>
|
||||
#include <string>
|
||||
#include <unordered_map>
|
||||
#include <vector>
|
||||
|
||||
#include "giomm/file.h"
|
||||
#include "giomm/filemonitor.h"
|
||||
#include "glibmm/refptr.h"
|
||||
|
||||
struct pollfd;
|
||||
|
||||
namespace waybar {
|
||||
class CssReloadHelper {
|
||||
public:
|
||||
CssReloadHelper(std::string cssFile, std::function<void()> callback);
|
||||
|
||||
virtual ~CssReloadHelper() = default;
|
||||
|
||||
virtual void monitorChanges();
|
||||
|
||||
protected:
|
||||
std::vector<std::string> parseImports(const std::string& cssFile);
|
||||
|
||||
void parseImports(const std::string& cssFile, std::unordered_map<std::string, bool>& imports);
|
||||
|
||||
void watchFiles(const std::vector<std::string>& files);
|
||||
|
||||
bool handleInotifyEvents(int fd);
|
||||
|
||||
bool watch(int inotifyFd, pollfd* pollFd);
|
||||
|
||||
virtual std::string getFileContents(const std::string& filename);
|
||||
|
||||
virtual std::string findPath(const std::string& filename);
|
||||
|
||||
void handleFileChange(Glib::RefPtr<Gio::File> const& file,
|
||||
Glib::RefPtr<Gio::File> const& other_type,
|
||||
Gio::FileMonitorEvent event_type);
|
||||
|
||||
private:
|
||||
std::string m_cssFile;
|
||||
|
||||
std::function<void()> m_callback;
|
||||
|
||||
std::vector<std::tuple<Glib::RefPtr<Gio::FileMonitor>>> m_fileMonitors;
|
||||
};
|
||||
} // namespace waybar
|
||||
@@ -1,34 +1,48 @@
|
||||
#pragma once
|
||||
|
||||
#include <fmt/format.h>
|
||||
#include <chrono>
|
||||
|
||||
#if HAVE_CHRONO_TIMEZONES
|
||||
#include <chrono>
|
||||
#include <format>
|
||||
|
||||
/* Compatibility layer for <date/tz.h> on top of C++20 <chrono> */
|
||||
namespace date {
|
||||
|
||||
using namespace std::chrono;
|
||||
|
||||
namespace literals {
|
||||
using std::chrono::last;
|
||||
}
|
||||
|
||||
inline auto format(const std::string& spec, const auto& ztime) {
|
||||
return spec.empty() ? "" : std::vformat("{:L" + spec + "}", std::make_format_args(ztime));
|
||||
}
|
||||
|
||||
inline auto format(const std::locale& loc, const std::string& spec, const auto& ztime) {
|
||||
return spec.empty() ? "" : std::vformat(loc, "{:L" + spec + "}", std::make_format_args(ztime));
|
||||
}
|
||||
|
||||
} // namespace date
|
||||
|
||||
#else
|
||||
#include <date/tz.h>
|
||||
#include <fmt/format.h>
|
||||
|
||||
#include <regex>
|
||||
#endif
|
||||
|
||||
// Date
|
||||
namespace date {
|
||||
#if HAVE_CHRONO_TIMEZONES
|
||||
using namespace std::chrono;
|
||||
using namespace std;
|
||||
#else
|
||||
|
||||
using system_clock = std::chrono::system_clock;
|
||||
using seconds = std::chrono::seconds;
|
||||
|
||||
template <typename T>
|
||||
inline auto format(const char* spec, const T& arg) {
|
||||
return date::format(std::regex_replace(spec, std::regex("\\{:L|\\}"), ""), arg);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline auto format(const std::locale& loc, const char* spec, const T& arg) {
|
||||
return date::format(loc, std::regex_replace(spec, std::regex("\\{:L|\\}"), ""), arg);
|
||||
}
|
||||
#endif
|
||||
} // namespace date
|
||||
|
||||
// Format
|
||||
namespace waybar::util::date::format {
|
||||
#if HAVE_CHRONO_TIMEZONES
|
||||
using namespace std;
|
||||
#else
|
||||
using namespace fmt;
|
||||
#endif
|
||||
} // namespace waybar::util::date::format
|
||||
|
||||
#if not HAVE_CHRONO_TIMEZONES
|
||||
template <typename Duration, typename TimeZonePtr>
|
||||
struct fmt::formatter<date::zoned_time<Duration, TimeZonePtr>> {
|
||||
std::string_view specs;
|
||||
@@ -58,3 +72,6 @@ struct fmt::formatter<date::zoned_time<Duration, TimeZonePtr>> {
|
||||
return fmt::format_to(ctx.out(), "{}", date::format(fmt::to_string(specs), ztime));
|
||||
}
|
||||
};
|
||||
#endif
|
||||
|
||||
using namespace date;
|
||||
|
||||
19
include/util/enum.hpp
Normal file
19
include/util/enum.hpp
Normal file
@@ -0,0 +1,19 @@
|
||||
#pragma once
|
||||
|
||||
#include <map>
|
||||
#include <stdexcept>
|
||||
#include <string>
|
||||
|
||||
namespace waybar::util {
|
||||
|
||||
template <typename EnumType>
|
||||
struct EnumParser {
|
||||
public:
|
||||
EnumParser();
|
||||
~EnumParser();
|
||||
|
||||
EnumType parseStringToEnum(const std::string& str,
|
||||
const std::map<std::string, EnumType>& enumMap);
|
||||
};
|
||||
|
||||
} // namespace waybar::util
|
||||
@@ -93,7 +93,7 @@ template <>
|
||||
struct formatter<Glib::ustring> : formatter<std::string> {
|
||||
template <typename FormatContext>
|
||||
auto format(const Glib::ustring& value, FormatContext& ctx) {
|
||||
return formatter<std::string>::format(value, ctx);
|
||||
return formatter<std::string>::format(static_cast<std::string>(value), ctx);
|
||||
}
|
||||
};
|
||||
} // namespace fmt
|
||||
|
||||
14
include/util/gtk_icon.hpp
Normal file
14
include/util/gtk_icon.hpp
Normal file
@@ -0,0 +1,14 @@
|
||||
#pragma once
|
||||
#include <gtkmm/icontheme.h>
|
||||
|
||||
#include <mutex>
|
||||
#include <string>
|
||||
|
||||
class DefaultGtkIconThemeWrapper {
|
||||
private:
|
||||
static std::mutex default_theme_mutex;
|
||||
|
||||
public:
|
||||
static bool has_icon(const std::string&);
|
||||
static Glib::RefPtr<Gdk::Pixbuf> load_icon(const char*, int, Gtk::IconLookupFlags);
|
||||
};
|
||||
@@ -3,6 +3,12 @@
|
||||
#include <fmt/ostream.h>
|
||||
#include <json/json.h>
|
||||
|
||||
#include <algorithm>
|
||||
#include <codecvt>
|
||||
#include <iostream>
|
||||
#include <locale>
|
||||
#include <regex>
|
||||
|
||||
#if (FMT_VERSION >= 90000)
|
||||
|
||||
template <>
|
||||
@@ -12,25 +18,30 @@ struct fmt::formatter<Json::Value> : ostream_formatter {};
|
||||
|
||||
namespace waybar::util {
|
||||
|
||||
struct JsonParser {
|
||||
JsonParser() {}
|
||||
class JsonParser {
|
||||
public:
|
||||
JsonParser() = default;
|
||||
|
||||
const Json::Value parse(const std::string& data) const {
|
||||
Json::Value root(Json::objectValue);
|
||||
if (data.empty()) {
|
||||
return root;
|
||||
Json::Value parse(const std::string& jsonStr) {
|
||||
Json::Value root;
|
||||
|
||||
// replace all occurrences of "\x" with "\u00", because JSON doesn't allow "\x" escape sequences
|
||||
std::string modifiedJsonStr = replaceHexadecimalEscape(jsonStr);
|
||||
|
||||
std::istringstream jsonStream(modifiedJsonStr);
|
||||
std::string errs;
|
||||
if (!Json::parseFromStream(m_readerBuilder, jsonStream, &root, &errs)) {
|
||||
throw std::runtime_error("Error parsing JSON: " + errs);
|
||||
}
|
||||
std::unique_ptr<Json::CharReader> const reader(builder_.newCharReader());
|
||||
std::string err;
|
||||
bool res = reader->parse(data.c_str(), data.c_str() + data.size(), &root, &err);
|
||||
if (!res) throw std::runtime_error(err);
|
||||
return root;
|
||||
}
|
||||
|
||||
~JsonParser() = default;
|
||||
|
||||
private:
|
||||
Json::CharReaderBuilder builder_;
|
||||
};
|
||||
Json::CharReaderBuilder m_readerBuilder;
|
||||
|
||||
static std::string replaceHexadecimalEscape(const std::string& str) {
|
||||
static std::regex re("\\\\x");
|
||||
return std::regex_replace(str, re, "\\u00");
|
||||
}
|
||||
};
|
||||
} // namespace waybar::util
|
||||
|
||||
40
include/util/pipewire/pipewire_backend.hpp
Normal file
40
include/util/pipewire/pipewire_backend.hpp
Normal file
@@ -0,0 +1,40 @@
|
||||
#pragma once
|
||||
|
||||
#include <pipewire/pipewire.h>
|
||||
|
||||
#include "util/backend_common.hpp"
|
||||
#include "util/pipewire/privacy_node_info.hpp"
|
||||
|
||||
namespace waybar::util::PipewireBackend {
|
||||
|
||||
class PipewireBackend {
|
||||
private:
|
||||
pw_thread_loop* mainloop_;
|
||||
pw_context* context_;
|
||||
pw_core* core_;
|
||||
|
||||
spa_hook registry_listener;
|
||||
|
||||
/* Hack to keep constructor inaccessible but still public.
|
||||
* This is required to be able to use std::make_shared.
|
||||
* It is important to keep this class only accessible via a reference-counted
|
||||
* pointer because the destructor will manually free memory, and this could be
|
||||
* a problem with C++20's copy and move semantics.
|
||||
*/
|
||||
struct private_constructor_tag {};
|
||||
|
||||
public:
|
||||
std::mutex mutex_;
|
||||
|
||||
pw_registry* registry;
|
||||
|
||||
sigc::signal<void> privacy_nodes_changed_signal_event;
|
||||
|
||||
std::unordered_map<uint32_t, PrivacyNodeInfo*> privacy_nodes;
|
||||
|
||||
static std::shared_ptr<PipewireBackend> getInstance();
|
||||
|
||||
PipewireBackend(private_constructor_tag tag);
|
||||
~PipewireBackend();
|
||||
};
|
||||
} // namespace waybar::util::PipewireBackend
|
||||
62
include/util/pipewire/privacy_node_info.hpp
Normal file
62
include/util/pipewire/privacy_node_info.hpp
Normal file
@@ -0,0 +1,62 @@
|
||||
#pragma once
|
||||
|
||||
#include <pipewire/pipewire.h>
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "util/gtk_icon.hpp"
|
||||
|
||||
namespace waybar::util::PipewireBackend {
|
||||
|
||||
enum PrivacyNodeType {
|
||||
PRIVACY_NODE_TYPE_NONE,
|
||||
PRIVACY_NODE_TYPE_VIDEO_INPUT,
|
||||
PRIVACY_NODE_TYPE_AUDIO_INPUT,
|
||||
PRIVACY_NODE_TYPE_AUDIO_OUTPUT
|
||||
};
|
||||
|
||||
class PrivacyNodeInfo {
|
||||
public:
|
||||
PrivacyNodeType type = PRIVACY_NODE_TYPE_NONE;
|
||||
uint32_t id;
|
||||
uint32_t client_id;
|
||||
enum pw_node_state state = PW_NODE_STATE_IDLE;
|
||||
std::string media_class;
|
||||
std::string media_name;
|
||||
std::string node_name;
|
||||
std::string application_name;
|
||||
|
||||
std::string pipewire_access_portal_app_id;
|
||||
std::string application_icon_name;
|
||||
|
||||
struct spa_hook object_listener;
|
||||
struct spa_hook proxy_listener;
|
||||
|
||||
void *data;
|
||||
|
||||
std::string get_name() {
|
||||
const std::vector<std::string *> names{&application_name, &node_name};
|
||||
std::string name = "Unknown Application";
|
||||
for (auto &name_ : names) {
|
||||
if (name_ != nullptr && name_->length() > 0) {
|
||||
name = *name_;
|
||||
name[0] = toupper(name[0]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return name;
|
||||
}
|
||||
|
||||
std::string get_icon_name() {
|
||||
const std::vector<std::string *> names{&application_icon_name, &pipewire_access_portal_app_id,
|
||||
&application_name, &node_name};
|
||||
const std::string name = "application-x-executable-symbolic";
|
||||
for (auto &name_ : names) {
|
||||
if (name_ != nullptr && name_->length() > 0 && DefaultGtkIconThemeWrapper::has_icon(*name_)) {
|
||||
return *name_;
|
||||
}
|
||||
}
|
||||
return name;
|
||||
}
|
||||
};
|
||||
} // namespace waybar::util::PipewireBackend
|
||||
38
include/util/portal.hpp
Normal file
38
include/util/portal.hpp
Normal file
@@ -0,0 +1,38 @@
|
||||
#include <giomm/dbusproxy.h>
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "fmt/format.h"
|
||||
|
||||
namespace waybar {
|
||||
|
||||
using namespace Gio;
|
||||
|
||||
enum class Appearance {
|
||||
UNKNOWN = 0,
|
||||
DARK = 1,
|
||||
LIGHT = 2,
|
||||
};
|
||||
class Portal : private DBus::Proxy {
|
||||
public:
|
||||
Portal();
|
||||
void refreshAppearance();
|
||||
Appearance getAppearance();
|
||||
|
||||
typedef sigc::signal<void, Appearance> type_signal_appearance_changed;
|
||||
type_signal_appearance_changed signal_appearance_changed() { return m_signal_appearance_changed; }
|
||||
|
||||
private:
|
||||
type_signal_appearance_changed m_signal_appearance_changed;
|
||||
Appearance currentMode;
|
||||
void on_signal(const Glib::ustring& sender_name, const Glib::ustring& signal_name,
|
||||
const Glib::VariantContainerBase& parameters);
|
||||
};
|
||||
|
||||
} // namespace waybar
|
||||
|
||||
template <>
|
||||
struct fmt::formatter<waybar::Appearance> : formatter<fmt::string_view> {
|
||||
// parse is inherited from formatter<string_view>.
|
||||
auto format(waybar::Appearance c, format_context& ctx) const;
|
||||
};
|
||||
9
include/util/prepare_for_sleep.h
Normal file
9
include/util/prepare_for_sleep.h
Normal file
@@ -0,0 +1,9 @@
|
||||
#pragma once
|
||||
|
||||
#include "SafeSignal.hpp"
|
||||
|
||||
namespace waybar::util {
|
||||
|
||||
// Get a signal emited with value true when entering sleep, and false when exiting
|
||||
SafeSignal<bool>& prepare_for_sleep();
|
||||
} // namespace waybar::util
|
||||
51
include/util/regex_collection.hpp
Normal file
51
include/util/regex_collection.hpp
Normal file
@@ -0,0 +1,51 @@
|
||||
#pragma once
|
||||
|
||||
#include <json/json.h>
|
||||
|
||||
#include <functional>
|
||||
#include <regex>
|
||||
#include <string>
|
||||
|
||||
namespace waybar::util {
|
||||
|
||||
struct Rule {
|
||||
std::regex rule;
|
||||
std::string repr;
|
||||
int priority;
|
||||
|
||||
// Fix for Clang < 16
|
||||
// See https://en.cppreference.com/w/cpp/compiler_support/20 "Parenthesized initialization of
|
||||
// aggregates"
|
||||
Rule(std::regex rule, std::string repr, int priority)
|
||||
: rule(rule), repr(repr), priority(priority) {}
|
||||
};
|
||||
|
||||
int default_priority_function(std::string& key);
|
||||
|
||||
/* A collection of regexes and strings, with a default string to return if no regexes.
|
||||
* When a regex is matched, the corresponding string is returned.
|
||||
* All regexes that are matched are cached, so that the regexes are only
|
||||
* evaluated once against a given string.
|
||||
* Regexes may be given a higher priority than others, so that they are matched
|
||||
* first. The priority function is given the regex string, and should return a
|
||||
* higher number for higher priority regexes.
|
||||
*/
|
||||
class RegexCollection {
|
||||
private:
|
||||
std::vector<Rule> rules;
|
||||
std::map<std::string, std::string> regex_cache;
|
||||
std::string default_repr;
|
||||
|
||||
std::string& find_match(std::string& value, bool& matched_any);
|
||||
|
||||
public:
|
||||
RegexCollection() = default;
|
||||
RegexCollection(const Json::Value& map, std::string default_repr = "",
|
||||
std::function<int(std::string&)> priority_function = default_priority_function);
|
||||
~RegexCollection() = default;
|
||||
|
||||
std::string& get(std::string& value, bool& matched_any);
|
||||
std::string& get(std::string& value);
|
||||
};
|
||||
|
||||
} // namespace waybar::util
|
||||
@@ -5,4 +5,6 @@
|
||||
|
||||
namespace waybar::util {
|
||||
std::string rewriteString(const std::string&, const Json::Value&);
|
||||
}
|
||||
std::string rewriteStringOnce(const std::string& value, const Json::Value& rules,
|
||||
bool& matched_any);
|
||||
} // namespace waybar::util
|
||||
|
||||
21
include/util/scope_guard.hpp
Normal file
21
include/util/scope_guard.hpp
Normal file
@@ -0,0 +1,21 @@
|
||||
#pragma once
|
||||
|
||||
#include <utility>
|
||||
|
||||
namespace waybar::util {
|
||||
|
||||
template <typename Func>
|
||||
class ScopeGuard {
|
||||
public:
|
||||
explicit ScopeGuard(Func&& exit_function) : f{std::forward<Func>(exit_function)} {}
|
||||
ScopeGuard(const ScopeGuard&) = delete;
|
||||
ScopeGuard(ScopeGuard&&) = default;
|
||||
ScopeGuard& operator=(const ScopeGuard&) = delete;
|
||||
ScopeGuard& operator=(ScopeGuard&&) = default;
|
||||
~ScopeGuard() { f(); }
|
||||
|
||||
private:
|
||||
Func f;
|
||||
};
|
||||
|
||||
} // namespace waybar::util
|
||||
@@ -6,6 +6,8 @@
|
||||
#include <functional>
|
||||
#include <thread>
|
||||
|
||||
#include "prepare_for_sleep.h"
|
||||
|
||||
namespace waybar::util {
|
||||
|
||||
/**
|
||||
@@ -33,7 +35,11 @@ class SleeperThread {
|
||||
signal_ = false;
|
||||
func();
|
||||
}
|
||||
}} {}
|
||||
}} {
|
||||
connection_ = prepare_for_sleep().connect([this](bool sleep) {
|
||||
if (not sleep) wake_up();
|
||||
});
|
||||
}
|
||||
|
||||
SleeperThread& operator=(std::function<void()> func) {
|
||||
thread_ = std::thread([this, func] {
|
||||
@@ -42,15 +48,32 @@ class SleeperThread {
|
||||
func();
|
||||
}
|
||||
});
|
||||
if (connection_.empty()) {
|
||||
connection_ = prepare_for_sleep().connect([this](bool sleep) {
|
||||
if (not sleep) wake_up();
|
||||
});
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
bool isRunning() const { return do_run_; }
|
||||
|
||||
auto sleep() {
|
||||
std::unique_lock lk(mutex_);
|
||||
CancellationGuard cancel_lock;
|
||||
return condvar_.wait(lk, [this] { return signal_ || !do_run_; });
|
||||
}
|
||||
|
||||
auto sleep_for(std::chrono::system_clock::duration dur) {
|
||||
std::unique_lock lk(mutex_);
|
||||
CancellationGuard cancel_lock;
|
||||
return condvar_.wait_for(lk, dur, [this] { return signal_ || !do_run_; });
|
||||
constexpr auto max_time_point = std::chrono::steady_clock::time_point::max();
|
||||
auto wait_end = max_time_point;
|
||||
auto now = std::chrono::steady_clock::now();
|
||||
if (now < max_time_point - dur) {
|
||||
wait_end = now + dur;
|
||||
}
|
||||
return condvar_.wait_until(lk, wait_end, [this] { return signal_ || !do_run_; });
|
||||
}
|
||||
|
||||
auto sleep_until(
|
||||
@@ -61,7 +84,7 @@ class SleeperThread {
|
||||
return condvar_.wait_until(lk, time_point, [this] { return signal_ || !do_run_; });
|
||||
}
|
||||
|
||||
auto wake_up() {
|
||||
void wake_up() {
|
||||
{
|
||||
std::lock_guard<std::mutex> lck(mutex_);
|
||||
signal_ = true;
|
||||
@@ -84,6 +107,7 @@ class SleeperThread {
|
||||
}
|
||||
|
||||
~SleeperThread() {
|
||||
connection_.disconnect();
|
||||
stop();
|
||||
if (thread_.joinable()) {
|
||||
thread_.join();
|
||||
@@ -96,6 +120,7 @@ class SleeperThread {
|
||||
std::mutex mutex_;
|
||||
bool do_run_ = true;
|
||||
bool signal_ = false;
|
||||
sigc::connection connection_;
|
||||
};
|
||||
|
||||
} // namespace waybar::util
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
const std::string WHITESPACE = " \n\r\t\f\v";
|
||||
@@ -15,3 +16,10 @@ inline std::string rtrim(const std::string& s) {
|
||||
}
|
||||
|
||||
inline std::string trim(const std::string& s) { return rtrim(ltrim(s)); }
|
||||
|
||||
inline std::string capitalize(const std::string& str) {
|
||||
std::string result = str;
|
||||
std::transform(result.begin(), result.end(), result.begin(),
|
||||
[](unsigned char c) { return std::toupper(c); });
|
||||
return result;
|
||||
}
|
||||
|
||||
88
man/waybar-backlight-slider.5.scd
Normal file
88
man/waybar-backlight-slider.5.scd
Normal file
@@ -0,0 +1,88 @@
|
||||
waybar-backlight-slider(5)
|
||||
|
||||
# NAME
|
||||
|
||||
waybar - backlight slider module
|
||||
|
||||
# DESCRIPTION
|
||||
|
||||
The *backlight slider* module displays and controls the current brightness of the default or preferred device.
|
||||
|
||||
The brightness can be controlled by dragging the slider across the bar or clicking on a specific position.
|
||||
|
||||
# CONFIGURATION
|
||||
|
||||
*min*: ++
|
||||
typeof: int ++
|
||||
default: 0 ++
|
||||
The minimum volume value the slider should display and set.
|
||||
|
||||
*max*: ++
|
||||
typeof: int ++
|
||||
default: 100 ++
|
||||
The maximum volume value the slider should display and set.
|
||||
|
||||
*orientation*: ++
|
||||
typeof: string ++
|
||||
default: horizontal ++
|
||||
The orientation of the slider. Can be either `horizontal` or `vertical`.
|
||||
|
||||
*device*: ++
|
||||
typeof: string ++
|
||||
The name of the preferred device to control. If left empty, a device will be chosen automatically.
|
||||
|
||||
# EXAMPLES
|
||||
|
||||
```
|
||||
"modules-right": [
|
||||
"backlight-slider",
|
||||
],
|
||||
"backlight/slider": {
|
||||
"min": 0,
|
||||
"max": 100,
|
||||
"orientation": "horizontal",
|
||||
"device": "intel_backlight"
|
||||
}
|
||||
```
|
||||
|
||||
# STYLE
|
||||
|
||||
The slider is a component with multiple CSS Nodes, of which the following are exposed:
|
||||
|
||||
*#backlight-slider*: ++
|
||||
Controls the style of the box *around* the slider and bar.
|
||||
|
||||
*#backlight-slider slider*: ++
|
||||
Controls the style of the slider handle.
|
||||
|
||||
*#backlight-slider trough*: ++
|
||||
Controls the style of the part of the bar that has not been filled.
|
||||
|
||||
*#backlight-slider highlight*: ++
|
||||
Controls the style of the part of the bar that has been filled.
|
||||
|
||||
## STYLE EXAMPLE
|
||||
|
||||
```
|
||||
#backlight-slider slider {
|
||||
min-height: 0px;
|
||||
min-width: 0px;
|
||||
opacity: 0;
|
||||
background-image: none;
|
||||
border: none;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
#backlight-slider trough {
|
||||
min-height: 80px;
|
||||
min-width: 10px;
|
||||
border-radius: 5px;
|
||||
background-color: black;
|
||||
}
|
||||
|
||||
#backlight-slider highlight {
|
||||
min-width: 10px;
|
||||
border-radius: 5px;
|
||||
background-color: red;
|
||||
}
|
||||
```
|
||||
@@ -25,12 +25,16 @@ The *backlight* module displays the current backlight level.
|
||||
The maximum length in characters the module should display.
|
||||
|
||||
*min-length*: ++
|
||||
typeof: integer ++
|
||||
The minimum length in characters the module should take up.
|
||||
typeof: integer ++
|
||||
The minimum length in characters the module should accept.
|
||||
|
||||
*align*: ++
|
||||
typeof: float ++
|
||||
The alignment of the text, where 0 is left-aligned and 1 is right-aligned. If the module is rotated, it will follow the flow of the text.
|
||||
typeof: float ++
|
||||
The alignment of the label within the module, where 0 is left-aligned and 1 is right-aligned. If the module is rotated, it will follow the flow of the text.
|
||||
|
||||
*justify*: ++
|
||||
typeof: string ++
|
||||
The alignment of the text within the module's label, allowing options 'left', 'right', or 'center' to define the positioning.
|
||||
|
||||
*rotate*: ++
|
||||
typeof: integer ++
|
||||
@@ -46,11 +50,11 @@ The *backlight* module displays the current backlight level.
|
||||
|
||||
*on-click-middle*: ++
|
||||
typeof: string ++
|
||||
Command to execute when middle-clicked on the module using mousewheel.
|
||||
Command to execute when middle-clicked on the module using mouse scroll wheel.
|
||||
|
||||
*on-click-right*: ++
|
||||
typeof: string ++
|
||||
Command to execute when the module is right clicked.
|
||||
Command to execute when the module is right-clicked.
|
||||
|
||||
*on-update*: ++
|
||||
typeof: string ++
|
||||
@@ -75,15 +79,15 @@ The *backlight* module displays the current backlight level.
|
||||
*scroll-step*: ++
|
||||
typeof: float ++
|
||||
default: 1.0 ++
|
||||
The speed in which to change the brightness when scrolling.
|
||||
The speed at which to change the brightness when scrolling.
|
||||
|
||||
# EXAMPLE:
|
||||
|
||||
```
|
||||
"backlight": {
|
||||
"device": "intel_backlight",
|
||||
"format": "{percent}% {icon}",
|
||||
"format-icons": ["", ""]
|
||||
"device": "intel_backlight",
|
||||
"format": "{percent}% {icon}",
|
||||
"format-icons": ["", ""]
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@@ -23,9 +23,9 @@ The *battery* module displays the current capacity and state (eg. charging) of y
|
||||
Define the max percentage of the battery, for when you've set the battery to stop charging at a lower level to save it. For example, if you've set the battery to stop at 80% that will become the new 100%.
|
||||
|
||||
*design-capacity*: ++
|
||||
typeof: bool ++
|
||||
default: false ++
|
||||
Option to use the battery design capacity instead of it's current maximal capacity.
|
||||
typeof: bool ++
|
||||
default: false ++
|
||||
Option to use the battery design capacity instead of its current maximal capacity.
|
||||
|
||||
*interval*: ++
|
||||
typeof: integer ++
|
||||
@@ -56,12 +56,16 @@ The *battery* module displays the current capacity and state (eg. charging) of y
|
||||
The maximum length in character the module should display.
|
||||
|
||||
*min-length*: ++
|
||||
typeof: integer ++
|
||||
The minimum length in characters the module should take up.
|
||||
typeof: integer ++
|
||||
The minimum length in characters the module should accept.
|
||||
|
||||
*align*: ++
|
||||
typeof: float ++
|
||||
The alignment of the text, where 0 is left-aligned and 1 is right-aligned. If the module is rotated, it will follow the flow of the text.
|
||||
typeof: float ++
|
||||
The alignment of the label within the module, where 0 is left-aligned and 1 is right-aligned. If the module is rotated, it will follow the flow of the text.
|
||||
|
||||
*justify*: ++
|
||||
typeof: string ++
|
||||
The alignment of the text within the module's label, allowing options 'left', 'right', or 'center' to define the positioning.
|
||||
|
||||
*rotate*: ++
|
||||
typeof: integer++
|
||||
@@ -77,7 +81,7 @@ The *battery* module displays the current capacity and state (eg. charging) of y
|
||||
|
||||
*on-click-right*: ++
|
||||
typeof: string ++
|
||||
Command to execute when you right clicked on the module.
|
||||
Command to execute when you right-click on the module.
|
||||
|
||||
*on-update*: ++
|
||||
typeof: string ++
|
||||
@@ -100,6 +104,11 @@ The *battery* module displays the current capacity and state (eg. charging) of y
|
||||
default: true ++
|
||||
Option to disable tooltip on hover.
|
||||
|
||||
*bat-compatibility*: ++
|
||||
typeof: bool ++
|
||||
default: false ++
|
||||
Option to enable battery compatibility if not detected.
|
||||
|
||||
# FORMAT REPLACEMENTS
|
||||
|
||||
*{capacity}*: Capacity in percentage
|
||||
@@ -121,7 +130,7 @@ The three arguments are:
|
||||
|
||||
# CUSTOM FORMATS
|
||||
|
||||
The *battery* module allows one to define custom formats based on up to two factors. The best fitting format will be selected.
|
||||
The *battery* module allows one to define custom formats based on up to two factors. The best-fitting format will be selected.
|
||||
|
||||
*format-<state>*: With *states*, a custom format can be set depending on the capacity of your battery.
|
||||
|
||||
@@ -132,8 +141,8 @@ The *battery* module allows one to define custom formats based on up to two fact
|
||||
# STATES
|
||||
|
||||
- Every entry (*state*) consists of a *<name>* (typeof: *string*) and a *<value>* (typeof: *integer*).
|
||||
- The state can be addressed as a CSS class in the *style.css*. The name of the CSS class is the *<name>* of the state. Each class gets activated when the current capacity is equal or below the configured *<value>*.
|
||||
- Also each state can have its own *format*. Those con be configured via *format-<name>*. Or if you want to differentiate a bit more even as *format-<status>-<state>*. For more information see *custom-formats*.
|
||||
- The state can be addressed as a CSS class in the *style.css*. The name of the CSS class is the *<name>* of the state. Each class gets activated when the current capacity is equal to or below the configured *<value>*.
|
||||
- Also each state can have its own *format*. Those can be configured via *format-<name>*. Or if you want to differentiate a bit more even as *format-<status>-<state>*. For more information see *custom-formats*.
|
||||
|
||||
|
||||
|
||||
@@ -141,15 +150,15 @@ The *battery* module allows one to define custom formats based on up to two fact
|
||||
|
||||
```
|
||||
"battery": {
|
||||
"bat": "BAT2",
|
||||
"interval": 60,
|
||||
"states": {
|
||||
"warning": 30,
|
||||
"critical": 15
|
||||
},
|
||||
"format": "{capacity}% {icon}",
|
||||
"format-icons": ["", "", "", "", ""],
|
||||
"max-length": 25
|
||||
"bat": "BAT2",
|
||||
"interval": 60,
|
||||
"states": {
|
||||
"warning": 30,
|
||||
"critical": 15
|
||||
},
|
||||
"format": "{capacity}% {icon}",
|
||||
"format-icons": ["", "", "", "", ""],
|
||||
"max-length": 25
|
||||
}
|
||||
```
|
||||
|
||||
@@ -162,3 +171,10 @@ The *battery* module allows one to define custom formats based on up to two fact
|
||||
- *<state>* can be defined in the *config*. For more information see *states*.
|
||||
- *#battery.<status>.<state>*
|
||||
- Combination of both *<status>* and *<state>*.
|
||||
|
||||
The following classes are applied to the entire Waybar rather than just the
|
||||
battery widget:
|
||||
|
||||
- *window#waybar.battery-<state>*
|
||||
- *<state>* can be defined in the *config*, as previously mentioned.
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ Addressed by *bluetooth*
|
||||
|
||||
*controller*: ++
|
||||
typeof: string ++
|
||||
Use the controller with the defined alias. Otherwise a random controller is used. Recommended to define when there is more than 1 controller available to the system.
|
||||
Use the controller with the defined alias. Otherwise, a random controller is used. Recommended to define when there is more than 1 controller available to the system.
|
||||
|
||||
*format-device-preference*: ++
|
||||
typeof: array ++
|
||||
@@ -42,6 +42,10 @@ Addressed by *bluetooth*
|
||||
typeof: string ++
|
||||
This format is used when the displayed controller is connected to at least 1 device.
|
||||
|
||||
*format-no-controller*: ++
|
||||
typeof: string ++
|
||||
This format is used when no bluetooth controller can be found
|
||||
|
||||
*format-icons*: ++
|
||||
typeof: array/object ++
|
||||
Based on the current battery percentage (see section *EXPERIMENTAL BATTERY PERCENTAGE FEATURE*), the corresponding icon gets selected. ++
|
||||
@@ -57,12 +61,16 @@ Addressed by *bluetooth*
|
||||
The maximum length in character the module should display.
|
||||
|
||||
*min-length*: ++
|
||||
typeof: integer ++
|
||||
The minimum length in characters the module should take up.
|
||||
typeof: integer ++
|
||||
The minimum length in characters the module should accept.
|
||||
|
||||
*align*: ++
|
||||
typeof: float ++
|
||||
The alignment of the text, where 0 is left-aligned and 1 is right-aligned. If the module is rotated, it will follow the flow of the text.
|
||||
typeof: float ++
|
||||
The alignment of the label within the module, where 0 is left-aligned and 1 is right-aligned. If the module is rotated, it will follow the flow of the text.
|
||||
|
||||
*justify*: ++
|
||||
typeof: string ++
|
||||
The alignment of the text within the module's label, allowing options 'left', 'right', or 'center' to define the positioning.
|
||||
|
||||
*on-click*: ++
|
||||
typeof: string ++
|
||||
@@ -74,7 +82,7 @@ Addressed by *bluetooth*
|
||||
|
||||
*on-click-right*: ++
|
||||
typeof: string ++
|
||||
Command to execute when you right clicked on the module.
|
||||
Command to execute when you right-click on the module.
|
||||
|
||||
*on-scroll-up*: ++
|
||||
typeof: string ++
|
||||
@@ -113,6 +121,10 @@ Addressed by *bluetooth*
|
||||
typeof: string ++
|
||||
This format is used when the displayed controller is connected to at least 1 device.
|
||||
|
||||
*tooltip-format-no-controller*: ++
|
||||
typeof: string ++
|
||||
This format is used when no bluetooth controller can be found
|
||||
|
||||
*tooltip-format-enumerate-connected*: ++
|
||||
typeof: string ++
|
||||
This format is used to define how each connected device should be displayed within the *device_enumerate* format replacement in the tooltip menu.
|
||||
@@ -138,7 +150,7 @@ Addressed by *bluetooth*
|
||||
*{device_alias}*: Alias of the displayed device.
|
||||
|
||||
*{device_enumerate}*: Show a list of all connected devices, each on a separate line. Define the format of each device with the *tooltip-format-enumerate-connected* ++
|
||||
and/or *tooltip-format-enumerate-connected-battery* config options. Can only be used in the tooltip related format options.
|
||||
and/or *tooltip-format-enumerate-connected-battery* config options. Can only be used in the tooltip-related format options.
|
||||
|
||||
# EXPERIMENTAL BATTERY PERCENTAGE FEATURE
|
||||
|
||||
|
||||
186
man/waybar-cava.5.scd
Normal file
186
man/waybar-cava.5.scd
Normal file
@@ -0,0 +1,186 @@
|
||||
waybar-cava(5) "waybar-cava" "User Manual"
|
||||
|
||||
# NAME
|
||||
|
||||
waybar - cava module
|
||||
|
||||
# DESCRIPTION
|
||||
|
||||
*cava* module for karlstav/cava project. See it on github: https://github.com/karlstav/cava.
|
||||
|
||||
|
||||
# FILES
|
||||
|
||||
$XDG_CONFIG_HOME/waybar/config ++
|
||||
Per user configuration file
|
||||
|
||||
# ADDITIONAL FILES
|
||||
|
||||
libcava lives in:
|
||||
|
||||
. /usr/lib/libcava.so or /usr/lib64/libcava.so
|
||||
. /usr/lib/pkgconfig/cava.pc or /usr/lib64/pkgconfig/cava.pc
|
||||
. /usr/include/cava
|
||||
|
||||
# CONFIGURATION
|
||||
|
||||
[- *Option*
|
||||
:- *Typeof*
|
||||
:- *Default*
|
||||
:- *Description*
|
||||
|[ *cava_config*
|
||||
:[ string
|
||||
:[
|
||||
:< Path where cava configuration file is placed to
|
||||
|[ *framerate*
|
||||
:[ integer
|
||||
:[ 30
|
||||
:[ Frames per second. Is used as a replacement for *interval*
|
||||
|[ *autosens*
|
||||
:[ integer
|
||||
:[ 1
|
||||
:[ Will attempt to decrease sensitivity if the bars peak
|
||||
|[ *sensitivity*
|
||||
:[ integer
|
||||
:[ 100
|
||||
:[ Manual sensitivity in %. It's recommended to be omitted when *autosens* = 1
|
||||
|[ *bars*
|
||||
:[ integer
|
||||
:[ 12
|
||||
:[ The number of bars
|
||||
|[ *lower_cutoff_freq*
|
||||
:[ long integer
|
||||
:[ 50
|
||||
:[ Lower cutoff frequencies for lowest bars the bandwidth of the visualizer
|
||||
|[ *higher_cutoff_freq*
|
||||
:[ long integer
|
||||
:[ 10000
|
||||
:[ Higher cutoff frequencies for highest bars the bandwidth of the visualizer
|
||||
|[ *sleep_timer*
|
||||
:[ integer
|
||||
:[ 5
|
||||
:[ Seconds with no input before cava main thread goes to sleep mode
|
||||
|[ *hide_on_silence*
|
||||
:[ bool
|
||||
:[ false
|
||||
:[ Hides the widget if no input (after sleep_timer elapsed)
|
||||
|[ *method*
|
||||
:[ string
|
||||
:[ pulse
|
||||
:[ Audio capturing method. Possible methods are: pipewire, pulse, alsa, fifo, sndio or shmem
|
||||
|[ *source*
|
||||
:[ string
|
||||
:[ auto
|
||||
:[ See cava configuration
|
||||
|[ *sample_rate*
|
||||
:[ long integer
|
||||
:[ 44100
|
||||
:[ See cava configuration
|
||||
|[ *sample_bits*
|
||||
:[ integer
|
||||
:[ 16
|
||||
:[ See cava configuration
|
||||
|[ *stereo*
|
||||
:[ bool
|
||||
:[ true
|
||||
:[ Visual channels
|
||||
|[ *reverse*
|
||||
:[ bool
|
||||
:[ false
|
||||
:[ Displays frequencies the other way around
|
||||
|[ *bar_delimiter*
|
||||
:[ integer
|
||||
:[ 0
|
||||
:[ Each bar is separated by a delimiter. Use decimal value in ascii table(i.e. 59 = ";"). 0 means no delimiter
|
||||
|[ *monstercat*
|
||||
:[ bool
|
||||
:[ false
|
||||
:[ Disables or enables the so-called "Monstercat smoothing" with or without "waves"
|
||||
|[ *waves*
|
||||
:[ bool
|
||||
:[ false
|
||||
:[ Disables or enables the so-called "Monstercat smoothing" with or without "waves"
|
||||
|[ *noise_reduction*
|
||||
:[ double
|
||||
:[ 0.77
|
||||
:[ Range between 0 - 1. The raw visualization is very noisy, this factor adjusts the integral and gravity filters to keep the signal smooth. 1 - will be very slow and smooth, 0 - will be fast but noisy
|
||||
|[ *input_delay*
|
||||
:[ integer
|
||||
:[ 2
|
||||
:[ Sets the delay before fetching audio source thread start working. On author's machine, Waybar starts much faster than pipewire audio server, and without a little delay cava module fails because pipewire is not ready
|
||||
|[ *ascii_max_range*
|
||||
:[ integer
|
||||
:[ 7
|
||||
:[ It's impossible to set it directly. The value is dictated by the number of icons in the array *format-icons*
|
||||
|[ *data_format*
|
||||
:[ string
|
||||
:[ asci
|
||||
:[ It's impossible to set it. Waybar sets it to = asci for internal needs
|
||||
|[ *raw_target*
|
||||
:[ string
|
||||
:[ /dev/stdout
|
||||
:[ It's impossible to set it. Waybar sets it to = /dev/stdout for internal needs
|
||||
|
||||
Configuration can be provided as:
|
||||
- The only cava configuration file which is provided through *cava_config*. The rest configuration can be skipped
|
||||
- Without cava configuration file. In such case cava should be configured through provided list of the configuration option
|
||||
- Mix. When provided both And cava configuration file And configuration options. In such case, waybar applies configuration file first and then overrides particular options by the provided list of configuration options
|
||||
|
||||
# ACTIONS
|
||||
|
||||
[- *String*
|
||||
:- *Action*
|
||||
|[ *mode*
|
||||
:< Switch main cava thread and fetch audio source thread from/to pause/resume
|
||||
|
||||
# DEPENDENCIES
|
||||
|
||||
- iniparser
|
||||
- fftw3
|
||||
|
||||
# SOLVING ISSUES
|
||||
|
||||
. On start Waybar throws an exception "error while loading shared libraries: libcava.so: cannot open shared object file: No such file or directory".
|
||||
It might happen when libcava for some reason hasn't been registered in the system. sudo ldconfig should help
|
||||
. Waybar is starting but cava module doesn't react to the music
|
||||
1. In such cases at first need to make sure usual cava application is working as well
|
||||
2. If so, need to comment all configuration options. Uncomment cava_config and provide the path to the working cava config
|
||||
3. You might set too huge or too small input_delay. Try to setup to 4 seconds, restart waybar, and check again 4 seconds past. Usual even on weak machines it should be enough
|
||||
4. You might accidentally switch action mode to pause mode
|
||||
|
||||
# RISING ISSUES
|
||||
|
||||
For clear understanding: this module is a cava API's consumer. So for any bugs related to cava engine you should contact Cava upstream(https://github.com/karlstav/cava) ++
|
||||
with the one Exception. Cava upstream doesn't provide cava as a shared library. For that, this module author made a fork libcava(https://github.com/LukashonakV/cava). ++
|
||||
So the order is:
|
||||
. cava upstream
|
||||
. libcava upstream.
|
||||
In case when cava releases new version and you're wanna get it, it should be raised an issue to libcava(https://github.com/LukashonakV/cava) with title ++
|
||||
\[Bump\]x.x.x where x.x.x is cava release version.
|
||||
|
||||
# EXAMPLES
|
||||
|
||||
```
|
||||
"cava": {
|
||||
//"cava_config": "$XDG_CONFIG_HOME/cava/cava.conf",
|
||||
"framerate": 30,
|
||||
"autosens": 1,
|
||||
//"sensitivity": 100,
|
||||
"bars": 14,
|
||||
"lower_cutoff_freq": 50,
|
||||
"higher_cutoff_freq": 10000,
|
||||
"method": "pulse",
|
||||
"source": "auto",
|
||||
"stereo": true,
|
||||
"reverse": false,
|
||||
"bar_delimiter": 0,
|
||||
"monstercat": false,
|
||||
"waves": false,
|
||||
"noise_reduction": 0.77,
|
||||
"input_delay": 2,
|
||||
"format-icons" : ["▁", "▂", "▃", "▄", "▅", "▆", "▇", "█" ],
|
||||
"actions": {
|
||||
"on-click-right": "mode"
|
||||
}
|
||||
},
|
||||
```
|
||||
37
man/waybar-cffi.5.scd
Normal file
37
man/waybar-cffi.5.scd
Normal file
@@ -0,0 +1,37 @@
|
||||
waybar-cffi(5)
|
||||
# NAME
|
||||
|
||||
waybar - cffi module
|
||||
|
||||
# DESCRIPTION
|
||||
|
||||
The *cffi* module gives full control of a GTK widget to a third-party dynamic library, to create more complex modules using different programming languages.
|
||||
|
||||
# CONFIGURATION
|
||||
|
||||
Addressed by *cffi/<name>*
|
||||
|
||||
*module_path*: ++
|
||||
typeof: string ++
|
||||
The path to the dynamic library to load to control the widget.
|
||||
|
||||
Some additional configuration may be required depending on the cffi dynamic library being used.
|
||||
|
||||
|
||||
# EXAMPLES
|
||||
|
||||
## C example:
|
||||
|
||||
An example module written in C can be found at https://github.com/Alexays/Waybar/resources/custom_modules/cffi_example/
|
||||
|
||||
Waybar config to enable the module:
|
||||
```
|
||||
"cffi/c_example": {
|
||||
"module_path": ".config/waybar/cffi/wb_cffi_example.so"
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
# STYLE
|
||||
|
||||
The classes and IDs are managed by the cffi dynamic library.
|
||||
@@ -1,4 +1,4 @@
|
||||
waybar-clock(5)
|
||||
waybar-clock(5) "waybar-clock" "User Manual"
|
||||
|
||||
# NAME
|
||||
|
||||
@@ -6,108 +6,266 @@ waybar - clock module
|
||||
|
||||
# DESCRIPTION
|
||||
|
||||
The *clock* module displays the current date and time.
|
||||
*clock* module displays current date and time
|
||||
|
||||
# FILES
|
||||
|
||||
$XDG_CONFIG_HOME/waybar/config ++
|
||||
Per user configuration file
|
||||
|
||||
# CONFIGURATION
|
||||
|
||||
*interval*: ++
|
||||
typeof: integer ++
|
||||
default: 60 ++
|
||||
The interval in which the information gets polled.
|
||||
1. Addressed by *clock*
|
||||
[- *Option*
|
||||
:- *Typeof*
|
||||
:- *Default*
|
||||
:- *Description*
|
||||
|[ *interval*
|
||||
:[ integer
|
||||
:[ 60
|
||||
:[ The interval in which the information gets polled
|
||||
|[ *format*
|
||||
:[ string
|
||||
:[ *{:%H:%M}*
|
||||
:[ The format, how the date and time should be displayed. See format options below
|
||||
|[ *timezone*
|
||||
:[ string
|
||||
:[
|
||||
:[ The timezone to display the time in, e.g. America/New_York. "" represents
|
||||
the system's local timezone. See Wikipedia's unofficial list of timezones <https://en.wikipedia.org/wiki/List_of_tz_database_time_zones>
|
||||
|[ *timezones*
|
||||
:[ list of strings
|
||||
:[
|
||||
:[ A list of timezones (as in *timezone*) to use for time display, changed using
|
||||
the scroll wheel. Do not specify *timezone* option when *timezones* is specified.
|
||||
"" represents the system's local timezone
|
||||
|[ *locale*
|
||||
:[ string
|
||||
:[
|
||||
:[ A locale to be used to display the time. Intended to render times in custom
|
||||
timezones with the proper language and format
|
||||
|[ *max-length*
|
||||
:[ integer
|
||||
:[
|
||||
:[ The maximum length in character the module should display
|
||||
|[ *rotate*
|
||||
:[ integer
|
||||
:[
|
||||
:[ Positive value to rotate the text label
|
||||
|[ *on-click*
|
||||
:[ string
|
||||
:[
|
||||
:[ Command to execute when clicked on the module
|
||||
|[ *on-click-middle*
|
||||
:[ string
|
||||
:[
|
||||
:[ Command to execute when you middle clicked on the module using mousewheel
|
||||
|[ *on-click-right*
|
||||
:[ string
|
||||
:[
|
||||
:[ Command to execute when you right-click on the module
|
||||
|[ *on-scroll-up*
|
||||
:[ string
|
||||
:[
|
||||
:[ Command to execute when scrolling up on the module
|
||||
|[ *on-scroll-down*
|
||||
:[ string
|
||||
:[
|
||||
:[ Command to execute when scrolling down on the module
|
||||
|[ *smooth-scrolling-threshold*
|
||||
:[ double
|
||||
:[
|
||||
:[ Threshold to be used when scrolling
|
||||
|[ *tooltip*
|
||||
:[ bool
|
||||
:[ true
|
||||
:[ Option to enable tooltip on hover
|
||||
|[ *tooltip-format*
|
||||
:[ string
|
||||
:[ same as format
|
||||
:[ Tooltip on hover
|
||||
|
||||
*format*: ++
|
||||
typeof: string ++
|
||||
default: {:%H:%M} ++
|
||||
The format, how the date and time should be displayed. ++
|
||||
It uses the format of the date library. See https://howardhinnant.github.io/date/date.html#to_stream_formatting for details.
|
||||
View all valid format options in *strftime(3)* or have a look https://en.cppreference.com/w/cpp/chrono/duration/formatter
|
||||
|
||||
*timezone*: ++
|
||||
typeof: string ++
|
||||
default: inferred local timezone ++
|
||||
The timezone to display the time in, e.g. America/New_York. ++
|
||||
This field will be ignored if *timezones* field is set and have at least one value.
|
||||
2. Addressed by *clock: calendar*
|
||||
[- *Option*
|
||||
:- *Typeof*
|
||||
:- *Default*
|
||||
:- *Description*
|
||||
|[ *mode*
|
||||
:[ string
|
||||
:[ month
|
||||
:[ Calendar view mode. Possible values: year|month
|
||||
|[ *mode-mon-col*
|
||||
:[ integer
|
||||
:[ 3
|
||||
:[ Relevant for *mode=year*. Count of months per row
|
||||
|[ *weeks-pos*
|
||||
:[ integer
|
||||
:[
|
||||
:[ The position where week numbers should be displayed. Disabled when is empty.
|
||||
Possible values: left|right
|
||||
|[ *on-scroll*
|
||||
:[ integer
|
||||
:[ 1
|
||||
:[ Value to scroll months/years forward/backward. Can be negative. Is
|
||||
configured under *on-scroll* option
|
||||
|
||||
*timezones*: ++
|
||||
typeof: list of strings ++
|
||||
A list of timezones to use for time display, changed using the scroll wheel. ++
|
||||
Use "" to represent the system's local timezone. Using %Z in the format or tooltip format is useful to track which time zone is currently displayed.
|
||||
3. Addressed by *clock: calendar: format*
|
||||
[- *Option*
|
||||
:- *Typeof*
|
||||
:- *Default*
|
||||
:- *Description*
|
||||
|[ *months*
|
||||
:[ string
|
||||
:[
|
||||
:[ Format is applied to months header(January, February,...etc.)
|
||||
|[ *days*
|
||||
:[ string
|
||||
:[
|
||||
:[ Format is applied to days
|
||||
|[ *weeks*
|
||||
:[ string
|
||||
:[ *{:%U}*
|
||||
:[ Format is applied to week numbers. When weekday format is not provided then
|
||||
is used default format: '{:%W}' when week starts with Monday, '{:%U}' otherwise
|
||||
|[ *weekdays*
|
||||
:[ string
|
||||
:[
|
||||
:[ Format is applied to weeks header(Su,Mo,...etc.)
|
||||
|[ *today*
|
||||
:[ string
|
||||
:[ *<b><u>{}</u></b>*
|
||||
:[ Format is applied to Today
|
||||
|
||||
*locale*: ++
|
||||
typeof: string ++
|
||||
default: inferred from current locale ++
|
||||
A locale to be used to display the time. Intended to render times in custom timezones with the proper language and format.
|
||||
## Actions
|
||||
|
||||
*today-format*: ++
|
||||
typeof: string ++
|
||||
default: <b><u>{}</u></b> ++
|
||||
The format of today's date in the calendar.
|
||||
|
||||
*max-length*: ++
|
||||
typeof: integer ++
|
||||
The maximum length in character the module should display.
|
||||
|
||||
*min-length*: ++
|
||||
typeof: integer ++
|
||||
The minimum length in characters the module should take up.
|
||||
|
||||
*align*: ++
|
||||
typeof: float ++
|
||||
The alignment of the text, where 0 is left-aligned and 1 is right-aligned. If the module is rotated, it will follow the flow of the text.
|
||||
|
||||
*rotate*: ++
|
||||
typeof: integer ++
|
||||
Positive value to rotate the text label.
|
||||
|
||||
*on-click*: ++
|
||||
typeof: string ++
|
||||
Command to execute when clicked on the module.
|
||||
|
||||
*on-click-middle*: ++
|
||||
typeof: string ++
|
||||
Command to execute when middle-clicked on the module using mousewheel.
|
||||
|
||||
*on-click-right*: ++
|
||||
typeof: string ++
|
||||
Command to execute when you right clicked on the module.
|
||||
|
||||
*on-update*: ++
|
||||
typeof: string ++
|
||||
Command to execute when the module is updated.
|
||||
|
||||
*on-scroll-up*: ++
|
||||
typeof: string ++
|
||||
Command to execute when scrolling up on the module.
|
||||
|
||||
*on-scroll-down*: ++
|
||||
typeof: string ++
|
||||
Command to execute when scrolling down on the module.
|
||||
|
||||
*smooth-scrolling-threshold*: ++
|
||||
typeof: double ++
|
||||
Threshold to be used when scrolling.
|
||||
|
||||
*tooltip*: ++
|
||||
typeof: bool ++
|
||||
default: true ++
|
||||
Option to disable tooltip on hover.
|
||||
|
||||
View all valid format options in *strftime(3)*.
|
||||
[- *String*
|
||||
:- *Action*
|
||||
|[ *mode*
|
||||
:[ Switch calendar mode between year/month
|
||||
|[ *tz_up*
|
||||
:[ Switch to the next provided time zone
|
||||
|[ *tz_down*
|
||||
:[ Switch to the previously provided time zone
|
||||
|[ *shift_up*
|
||||
:[ Switch to the next calendar month/year
|
||||
|[ *shift_down*
|
||||
:[ Switch to the previous calendar month/year
|
||||
|
||||
# FORMAT REPLACEMENTS
|
||||
|
||||
*{calendar}*: Current month calendar
|
||||
*{timezoned_time_list}*: List of time in the rest timezones, if more than one timezone is set in the config
|
||||
- *{calendar}*: Current month calendar
|
||||
- *{tz_list}*: List of time in the rest timezones, if more than one timezone is set in the config
|
||||
- *{ordinal_date}*: The current day in (English) ordinal form, e.g. 21st
|
||||
|
||||
# EXAMPLES
|
||||
|
||||
1. General
|
||||
|
||||
```
|
||||
"clock": {
|
||||
"interval": 60,
|
||||
"format": "{:%H:%M}",
|
||||
"max-length": 25
|
||||
"interval": 60,
|
||||
"format": "{:%H:%M}",
|
||||
"max-length": 25
|
||||
}
|
||||
```
|
||||
|
||||
2. Calendar
|
||||
|
||||
```
|
||||
"clock": {
|
||||
"format": "{:%H:%M} ",
|
||||
"format-alt": "{:%A, %B %d, %Y (%R)} ",
|
||||
"tooltip-format": "<tt><small>{calendar}</small></tt>",
|
||||
"calendar": {
|
||||
"mode" : "year",
|
||||
"mode-mon-col" : 3,
|
||||
"weeks-pos" : "right",
|
||||
"on-scroll" : 1,
|
||||
"on-click-right": "mode",
|
||||
"format": {
|
||||
"months": "<span color='#ffead3'><b>{}</b></span>",
|
||||
"days": "<span color='#ecc6d9'><b>{}</b></span>",
|
||||
"weeks": "<span color='#99ffdd'><b>W{}</b></span>",
|
||||
"weekdays": "<span color='#ffcc66'><b>{}</b></span>",
|
||||
"today": "<span color='#ff6699'><b><u>{}</u></b></span>"
|
||||
}
|
||||
},
|
||||
"actions": {
|
||||
"on-click-right": "mode",
|
||||
"on-click-forward": "tz_up",
|
||||
"on-click-backward": "tz_down",
|
||||
"on-scroll-up": "shift_up",
|
||||
"on-scroll-down": "shift_down"
|
||||
}
|
||||
},
|
||||
```
|
||||
|
||||
3. Full date on hover
|
||||
|
||||
```
|
||||
"clock": {
|
||||
"interval": 60,
|
||||
"tooltip": true,
|
||||
"format": "{:%H.%M}",
|
||||
"tooltip-format": "{:%Y-%m-%d}",
|
||||
}
|
||||
```
|
||||
|
||||
# STYLE
|
||||
|
||||
- *#clock*
|
||||
|
||||
# Troubleshooting
|
||||
|
||||
If clock module is disabled at startup with locale::facet::\_S\_create\_c\_locale ++
|
||||
name not valid error message try one of the following:
|
||||
|
||||
- check if LC_TIME is set properly (glibc)
|
||||
- set locale to C in the config file (musl)
|
||||
|
||||
The locale option must be set for {calendar} to use the correct start-of-week, regardless of system locale.
|
||||
|
||||
## Calendar in Chinese. Alignment
|
||||
|
||||
In order to have aligned Chinese calendar there are some useful recommendations:
|
||||
|
||||
. Use "WenQuanYi Zen Hei Mono" which is provided in most Linux distributions
|
||||
. Try different font sizes and find best for you. size = 9pt should be fine
|
||||
. In case when "WenQuanYi Zen Hei Mono" font is used disable monospace font pango tag
|
||||
|
||||
Example of working config
|
||||
|
||||
```
|
||||
"clock": {
|
||||
"format": "{:%H:%M} ",
|
||||
"format-alt": "{:%A, %B %d, %Y (%R)} ",
|
||||
"tooltip-format": "\n<span size='9pt' font='WenQuanYi Zen Hei Mono'>{calendar}</span>",
|
||||
"calendar": {
|
||||
"mode" : "year",
|
||||
"mode-mon-col" : 3,
|
||||
"weeks-pos" : "right",
|
||||
"on-scroll" : 1,
|
||||
"on-click-right": "mode",
|
||||
"format": {
|
||||
"months": "<span color='#ffead3'><b>{}</b></span>",
|
||||
"days": "<span color='#ecc6d9'><b>{}</b></span>",
|
||||
"weeks": "<span color='#99ffdd'><b>W{}</b></span>",
|
||||
"weekdays": "<span color='#ffcc66'><b>{}</b></span>",
|
||||
"today": "<span color='#ff6699'><b><u>{}</u></b></span>"
|
||||
}
|
||||
},
|
||||
"actions": {
|
||||
"on-click-right": "mode",
|
||||
"on-click-forward": "tz_up",
|
||||
"on-click-backward": "tz_down",
|
||||
"on-scroll-up": "shift_up",
|
||||
"on-scroll-down": "shift_down"
|
||||
}
|
||||
},
|
||||
```
|
||||
|
||||
# AUTHOR
|
||||
|
||||
Alexis Rouillard <contact@arouillard.fr>
|
||||
|
||||
@@ -6,7 +6,7 @@ waybar - cpu module
|
||||
|
||||
# DESCRIPTION
|
||||
|
||||
The *cpu* module displays the current cpu utilization.
|
||||
The *cpu* module displays the current CPU utilization.
|
||||
|
||||
# CONFIGURATION
|
||||
|
||||
@@ -30,12 +30,16 @@ The *cpu* module displays the current cpu utilization.
|
||||
The maximum length in character the module should display.
|
||||
|
||||
*min-length*: ++
|
||||
typeof: integer ++
|
||||
The minimum length in characters the module should take up.
|
||||
typeof: integer ++
|
||||
The minimum length in characters the module should accept.
|
||||
|
||||
*align*: ++
|
||||
typeof: float ++
|
||||
The alignment of the text, where 0 is left-aligned and 1 is right-aligned. If the module is rotated, it will follow the flow of the text.
|
||||
typeof: float ++
|
||||
The alignment of the label within the module, where 0 is left-aligned and 1 is right-aligned. If the module is rotated, it will follow the flow of the text.
|
||||
|
||||
*justify*: ++
|
||||
typeof: string ++
|
||||
The alignment of the text within the module's label, allowing options 'left', 'right', or 'center' to define the positioning.
|
||||
|
||||
*rotate*: ++
|
||||
typeof: integer ++
|
||||
@@ -43,7 +47,7 @@ The *cpu* module displays the current cpu utilization.
|
||||
|
||||
*states*: ++
|
||||
typeof: object ++
|
||||
A number of cpu usage states which get activated on certain usage levels. See *waybar-states(5)*.
|
||||
A number of CPU usage states which get activated on certain usage levels. See *waybar-states(5)*.
|
||||
|
||||
*on-click*: ++
|
||||
typeof: string ++
|
||||
@@ -55,7 +59,7 @@ The *cpu* module displays the current cpu utilization.
|
||||
|
||||
*on-click-right*: ++
|
||||
typeof: string ++
|
||||
Command to execute when you right clicked on the module.
|
||||
Command to execute when you right-click on the module.
|
||||
|
||||
*on-update*: ++
|
||||
typeof: string ++
|
||||
@@ -80,21 +84,21 @@ The *cpu* module displays the current cpu utilization.
|
||||
|
||||
# FORMAT REPLACEMENTS
|
||||
|
||||
*{load}*: Current cpu load.
|
||||
*{load}*: Current CPU load.
|
||||
|
||||
*{usage}*: Current overall cpu usage.
|
||||
*{usage}*: Current overall CPU usage.
|
||||
|
||||
*{usage*{n}*}*: Current cpu core n usage. Cores are numbered from zero, so first core will be {usage0} and 4th will be {usage3}.
|
||||
*{usage*{n}*}*: Current CPU core n usage. Cores are numbered from zero, so first core will be {usage0} and 4th will be {usage3}.
|
||||
|
||||
*{avg_frequency}*: Current cpu average frequency (based on all cores) in GHz.
|
||||
*{avg_frequency}*: Current CPU average frequency (based on all cores) in GHz.
|
||||
|
||||
*{max_frequency}*: Current cpu max frequency (based on the core with the highest frequency) in GHz.
|
||||
*{max_frequency}*: Current CPU max frequency (based on the core with the highest frequency) in GHz.
|
||||
|
||||
*{min_frequency}*: Current cpu min frequency (based on the core with the lowest frequency) in GHz.
|
||||
*{min_frequency}*: Current CPU min frequency (based on the core with the lowest frequency) in GHz.
|
||||
|
||||
*{icon}*: Icon for overall cpu usage.
|
||||
*{icon}*: Icon for overall CPU usage.
|
||||
|
||||
*{icon*{n}*}*: Icon for cpu core n usage. Use like {icon0}.
|
||||
*{icon*{n}*}*: Icon for CPU core n usage. Use like {icon0}.
|
||||
|
||||
# EXAMPLES
|
||||
|
||||
@@ -108,7 +112,7 @@ Basic configuration:
|
||||
}
|
||||
```
|
||||
|
||||
Cpu usage per core rendered as icons:
|
||||
CPU usage per core rendered as icons:
|
||||
|
||||
```
|
||||
"cpu": {
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
waybar-custom(5)
|
||||
|
||||
# NAME
|
||||
|
||||
waybar - custom module
|
||||
@@ -19,14 +18,13 @@ Addressed by *custom/<name>*
|
||||
|
||||
*exec-if*: ++
|
||||
typeof: string ++
|
||||
The path to a script, which determines if the script in *exec* should be executed.
|
||||
The path to a script, which determines if the script in *exec* should be executed. ++
|
||||
*exec* will be executed if the exit code of *exec-if* equals 0.
|
||||
|
||||
*exec-on-event*: ++
|
||||
typeof: bool ++
|
||||
default: true ++
|
||||
If an event command is set (e.g. *on-click* or *on-scroll-up*) then re-execute the script after
|
||||
executing the event command.
|
||||
If an event command is set (e.g. *on-click* or *on-scroll-up*) then re-execute the script after executing the event command.
|
||||
|
||||
*return-type*: ++
|
||||
typeof: string ++
|
||||
@@ -34,21 +32,22 @@ Addressed by *custom/<name>*
|
||||
|
||||
*interval*: ++
|
||||
typeof: integer ++
|
||||
The interval (in seconds) in which the information gets polled.
|
||||
Use *once* if you want to execute the module only on startup.
|
||||
You can update it manually with a signal. If no *interval* is defined,
|
||||
it is assumed that the out script loops it self.
|
||||
The interval (in seconds) in which the information gets polled. ++
|
||||
Use *once* if you want to execute the module only on startup. ++
|
||||
You can update it manually with a signal. If no *interval* or *signal* is defined, it is assumed that the out script loops itself. ++
|
||||
If a *signal* is defined then the script will run once on startup and will only update with a signal.
|
||||
|
||||
*restart-interval*: ++
|
||||
typeof: integer ++
|
||||
The restart interval (in seconds).
|
||||
Can't be used with the *interval* option, so only with continuous scripts.
|
||||
Once the script exit, it'll be re-executed after the *restart-interval*.
|
||||
The restart interval (in seconds). ++
|
||||
Can't be used with the *interval* option, so only with continuous scripts. ++
|
||||
Once the script exits, it'll be re-executed after the *restart-interval*.
|
||||
|
||||
*signal*: ++
|
||||
typeof: integer ++
|
||||
The signal number used to update the module.
|
||||
The number is valid between 1 and N, where *SIGRTMIN+N* = *SIGRTMAX*.
|
||||
The signal number used to update the module. ++
|
||||
The number is valid between 1 and N, where *SIGRTMIN+N* = *SIGRTMAX*. ++
|
||||
If no interval is defined then a signal will be the only way to update the module.
|
||||
|
||||
*format*: ++
|
||||
typeof: string ++
|
||||
@@ -68,12 +67,16 @@ Addressed by *custom/<name>*
|
||||
The maximum length in character the module should display.
|
||||
|
||||
*min-length*: ++
|
||||
typeof: integer ++
|
||||
The minimum length in characters the module should take up.
|
||||
typeof: integer ++
|
||||
The minimum length in characters the module should accept.
|
||||
|
||||
*align*: ++
|
||||
typeof: float ++
|
||||
The alignment of the text, where 0 is left-aligned and 1 is right-aligned. If the module is rotated, it will follow the flow of the text.
|
||||
typeof: float ++
|
||||
The alignment of the label within the module, where 0 is left-aligned and 1 is right-aligned. If the module is rotated, it will follow the flow of the text.
|
||||
|
||||
*justify*: ++
|
||||
typeof: string ++
|
||||
The alignment of the text within the module's label, allowing options 'left', 'right', or 'center' to define the positioning.
|
||||
|
||||
*on-click*: ++
|
||||
typeof: string ++
|
||||
@@ -85,7 +88,7 @@ Addressed by *custom/<name>*
|
||||
|
||||
*on-click-right*: ++
|
||||
typeof: string ++
|
||||
Command to execute when you right clicked on the module.
|
||||
Command to execute when you right-click on the module.
|
||||
|
||||
*on-update*: ++
|
||||
typeof: string ++
|
||||
@@ -108,6 +111,11 @@ Addressed by *custom/<name>*
|
||||
default: true ++
|
||||
Option to disable tooltip on hover.
|
||||
|
||||
*tooltip-format*: ++
|
||||
typeof: string ++
|
||||
The tooltip format. If specified, overrides any tooltip output from the script in *exec*. ++
|
||||
Uses the same format replacements as *format*.
|
||||
|
||||
*escape*: ++
|
||||
typeof: bool ++
|
||||
default: false ++
|
||||
@@ -137,7 +145,7 @@ $text\\n$tooltip\\n$class*
|
||||
|
||||
*{}*: Output of the script.
|
||||
|
||||
*{percentage}* Percentage which can be set via a json return-type.
|
||||
*{percentage}* Percentage which can be set via a json return type.
|
||||
|
||||
*{icon}*: An icon from 'format-icons' according to percentage.
|
||||
|
||||
|
||||
@@ -33,19 +33,23 @@ Addressed by *disk*
|
||||
|
||||
*states*: ++
|
||||
typeof: object ++
|
||||
A number of disk utilization states which get activated on certain percentage thresholds (percentage_used). See *waybar-states(5)*.
|
||||
A number of disk utilization states that get activated on certain percentage thresholds (percentage_used). See *waybar-states(5)*.
|
||||
|
||||
*max-length*: ++
|
||||
typeof: integer ++
|
||||
The maximum length in character the module should display.
|
||||
|
||||
*min-length*: ++
|
||||
typeof: integer ++
|
||||
The minimum length in characters the module should take up.
|
||||
typeof: integer ++
|
||||
The minimum length in characters the module should accept.
|
||||
|
||||
*align*: ++
|
||||
typeof: float ++
|
||||
The alignment of the text, where 0 is left-aligned and 1 is right-aligned. If the module is rotated, it will follow the flow of the text.
|
||||
typeof: float ++
|
||||
The alignment of the label within the module, where 0 is left-aligned and 1 is right-aligned. If the module is rotated, it will follow the flow of the text.
|
||||
|
||||
*justify*: ++
|
||||
typeof: string ++
|
||||
The alignment of the text within the module's label, allowing options 'left', 'right', or 'center' to define the positioning.
|
||||
|
||||
*on-click*: ++
|
||||
typeof: string ++
|
||||
@@ -57,7 +61,7 @@ Addressed by *disk*
|
||||
|
||||
*on-click-right*: ++
|
||||
typeof: string ++
|
||||
Command to execute when you right clicked on the module.
|
||||
Command to execute when you right-click on the module.
|
||||
|
||||
*on-update*: ++
|
||||
typeof: string ++
|
||||
@@ -85,20 +89,30 @@ Addressed by *disk*
|
||||
default: "{used} out of {total} used ({percentage_used}%)" ++
|
||||
The format of the information displayed in the tooltip.
|
||||
|
||||
*unit*: ++
|
||||
typeof: string ++
|
||||
Use with specific_free, specific_used, and specific_total to force calculation to always be in a certain unit. Accepts kB, kiB, MB, Mib, GB, GiB, TB, TiB.
|
||||
|
||||
# FORMAT REPLACEMENTS
|
||||
|
||||
*{percentage_used}*: Percentage of disk in use.
|
||||
|
||||
*{percentage_free}*: Percentage of free disk space
|
||||
|
||||
*{total}*: Total amount of space on the disk, partition or mountpoint.
|
||||
*{total}*: Total amount of space on the disk, partition, or mountpoint. Automatically selects unit based on size remaining.
|
||||
|
||||
*{used}*: Amount of used disk space.
|
||||
*{used}*: Amount of used disk space. Automatically selects unit based on size remaining.
|
||||
|
||||
*{free}*: Amount of available disk space for normal users.
|
||||
*{free}*: Amount of available disk space for normal users. Automatically selects unit based on size remaining.
|
||||
|
||||
*{path}*: The path specified in the configuration.
|
||||
|
||||
*{specific_total}*: Total amount of space on the disk, partition, or mountpoint in a specific unit. Defaults to bytes.
|
||||
|
||||
*{specific_used}*: Amount of used disk space in a specific unit. Defaults to bytes.
|
||||
|
||||
*{specific_free}*: Amount of available disk space for normal users in a specific unit. Defaults to bytes.
|
||||
|
||||
# EXAMPLES
|
||||
|
||||
```
|
||||
@@ -108,6 +122,15 @@ Addressed by *disk*
|
||||
}
|
||||
```
|
||||
|
||||
```
|
||||
"disk": {
|
||||
"interval": 30,
|
||||
"format": "{specific_free:0.2f} GB out of {specific_total:0.2f} GB available. Alternatively {free} out of {total} available",
|
||||
"unit": "GB"
|
||||
// 1434.25 GB out of 2000.00 GB available. Alternatively 1.4TiB out of 1.9TiB available.
|
||||
}
|
||||
```
|
||||
|
||||
# STYLE
|
||||
|
||||
- *#disk*
|
||||
|
||||
@@ -13,24 +13,24 @@ The *tags* module displays the current state of tags in dwl.
|
||||
Addressed by *dwl/tags*
|
||||
|
||||
*num-tags*: ++
|
||||
typeof: uint ++
|
||||
default: 9 ++
|
||||
The number of tags that should be displayed. Max 32.
|
||||
typeof: uint ++
|
||||
default: 9 ++
|
||||
The number of tags that should be displayed. Max 32.
|
||||
|
||||
*tag-labels*: ++
|
||||
typeof: array ++
|
||||
The label to display for each tag.
|
||||
typeof: array ++
|
||||
The label to display for each tag.
|
||||
|
||||
*disable-click*: ++
|
||||
typeof: bool ++
|
||||
default: false ++
|
||||
If set to false, you can left click to set focused tag. Right click to toggle tag focus. If set to true this behaviour is disabled.
|
||||
typeof: bool ++
|
||||
default: false ++
|
||||
If set to false, you can left-click to set focused tag. Right-click to toggle tag focus. If set to true this behaviour is disabled.
|
||||
|
||||
# EXAMPLE
|
||||
|
||||
```
|
||||
"dwl/tags": {
|
||||
"num-tags": 5
|
||||
"num-tags": 5
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@@ -65,11 +65,11 @@ Feral Gamemode optimizations.
|
||||
|
||||
*{glyph}*: The string icon glyph to use instead.
|
||||
|
||||
*{count}*: The amount of games running with gamemode optimizations.
|
||||
*{count}*: The number of games running with gamemode optimizations.
|
||||
|
||||
# TOOLTIP FORMAT REPLACEMENTS
|
||||
|
||||
*{count}*: The amount of games running with gamemode optimizations.
|
||||
*{count}*: The number of games running with gamemode optimizations.
|
||||
|
||||
# EXAMPLES
|
||||
|
||||
|
||||
@@ -18,12 +18,12 @@ Addressed by *hyprland/language*
|
||||
The format, how information should be displayed.
|
||||
|
||||
*format-<lang>* ++
|
||||
typeof: string++
|
||||
Provide an alternative name to display per language where <lang> is the language of your choosing. Can be passed multiple times with multiple languages as shown by the example below.
|
||||
typeof: string++
|
||||
Provide an alternative name to display per language where <lang> is the language of your choosing. Can be passed multiple times with multiple languages as shown by the example below.
|
||||
|
||||
*keyboard-name*: ++
|
||||
typeof: string ++
|
||||
Specifies which keyboard to use from hyprctl devices output. Using the option that begins with "at-translated-set..." is recommended.
|
||||
typeof: string ++
|
||||
Specifies which keyboard to use from hyprctl devices output. Using the option that begins with "at-translated-set..." is recommended.
|
||||
|
||||
|
||||
# FORMAT REPLACEMENTS
|
||||
@@ -41,10 +41,10 @@ Addressed by *hyprland/language*
|
||||
|
||||
```
|
||||
"hyprland/language": {
|
||||
"format": "Lang: {long}"
|
||||
"format-en": "AMERICA, HELL YEAH!"
|
||||
"format-tr": "As bayrakları"
|
||||
"keyboard-name": "at-translated-set-2-keyboard"
|
||||
"format": "Lang: {long}"
|
||||
"format-en": "AMERICA, HELL YEAH!"
|
||||
"format-tr": "As bayrakları"
|
||||
"keyboard-name": "at-translated-set-2-keyboard"
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@@ -26,12 +26,16 @@ Addressed by *hyprland/submap*
|
||||
The maximum length in character the module should display.
|
||||
|
||||
*min-length*: ++
|
||||
typeof: integer ++
|
||||
The minimum length in characters the module should take up.
|
||||
typeof: integer ++
|
||||
The minimum length in characters the module should accept.
|
||||
|
||||
*align*: ++
|
||||
typeof: float ++
|
||||
The alignment of the text, where 0 is left-aligned and 1 is right-aligned. If the module is rotated, it will follow the flow of the text.
|
||||
typeof: float ++
|
||||
The alignment of the label within the module, where 0 is left-aligned and 1 is right-aligned. If the module is rotated, it will follow the flow of the text.
|
||||
|
||||
*justify*: ++
|
||||
typeof: string ++
|
||||
The alignment of the text within the module's label, allowing options 'left', 'right', or 'center' to define the positioning.
|
||||
|
||||
*on-click*: ++
|
||||
typeof: string ++
|
||||
@@ -43,7 +47,7 @@ Addressed by *hyprland/submap*
|
||||
|
||||
*on-click-right*: ++
|
||||
typeof: string ++
|
||||
Command to execute when you right clicked on the module.
|
||||
Command to execute when you right-click on the module.
|
||||
|
||||
*on-update*: ++
|
||||
typeof: string ++
|
||||
@@ -71,12 +75,13 @@ Addressed by *hyprland/submap*
|
||||
|
||||
```
|
||||
"hyprland/submap": {
|
||||
"format": "✌️ {}",
|
||||
"max-length": 8,
|
||||
"tooltip": false
|
||||
"format": "✌️ {}",
|
||||
"max-length": 8,
|
||||
"tooltip": false
|
||||
}
|
||||
```
|
||||
|
||||
# STYLE
|
||||
|
||||
- *#submap*
|
||||
- *#submap.<name>*
|
||||
|
||||
@@ -14,13 +14,38 @@ Addressed by *hyprland/window*
|
||||
|
||||
*format*: ++
|
||||
typeof: string ++
|
||||
default: {} ++
|
||||
default: {title} ++
|
||||
The format, how information should be displayed. On {} the current window title is displayed.
|
||||
|
||||
*rewrite*: ++
|
||||
typeof: object ++
|
||||
Rules to rewrite window title. See *rewrite rules*.
|
||||
|
||||
*separate-outputs*: ++
|
||||
typeof: bool ++
|
||||
Show the active window of the monitor the bar belongs to, instead of the focused window.
|
||||
|
||||
*icon*: ++
|
||||
typeof: bool ++
|
||||
default: false ++
|
||||
Option to hide the application icon.
|
||||
|
||||
*icon-size*: ++
|
||||
typeof: integer ++
|
||||
default: 24 ++
|
||||
Option to change the size of the application icon.
|
||||
|
||||
# FORMAT REPLACEMENTS
|
||||
See the output of "hyprctl clients" for examples
|
||||
|
||||
*{title}*: The current title of the focused window.
|
||||
|
||||
*{initialTitle}*: The initial title of the focused window.
|
||||
|
||||
*{class}*: The current class of the focused window.
|
||||
|
||||
*{initialClass}*: The initial class of the focused window.
|
||||
|
||||
# REWRITE RULES
|
||||
|
||||
*rewrite* is an object where keys are regular expressions and values are
|
||||
@@ -37,14 +62,28 @@ Invalid expressions (e.g., mismatched parentheses) are skipped.
|
||||
|
||||
```
|
||||
"hyprland/window": {
|
||||
"format": "{}",
|
||||
"rewrite": {
|
||||
"(.*) - Mozilla Firefox": "🌎 $1",
|
||||
"(.*) - zsh": "> [$1]"
|
||||
}
|
||||
"format": "{}",
|
||||
"rewrite": {
|
||||
"(.*) - Mozilla Firefox": "🌎 $1",
|
||||
"(.*) - zsh": "> [$1]"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
# STYLE
|
||||
|
||||
- *#window*
|
||||
- *window#waybar.empty #window* When no windows are in the workspace
|
||||
|
||||
The following classes are applied to the entire Waybar rather than just the
|
||||
window widget:
|
||||
|
||||
- *window#waybar.empty* When no windows are in the workspace
|
||||
- *window#waybar.solo* When one tiled window is visible in the workspace
|
||||
(floating windows may be present)
|
||||
- *window#waybar.<app_id>* Where *<app_id>* is the *class* (e.g. *chromium*) of
|
||||
the solo tiled window in the workspace (use *hyprctl clients* to see classes)
|
||||
- *window#waybar.floating* When there are only floating windows in the workspace
|
||||
- *window#waybar.fullscreen* When there is a fullscreen window in the workspace;
|
||||
useful with Hyprland's *fullscreen, 1* mode
|
||||
- *window#waybar.swallowing* When there is a swallowed window in the workspace
|
||||
|
||||
160
man/waybar-hyprland-workspaces.5.scd
Normal file
160
man/waybar-hyprland-workspaces.5.scd
Normal file
@@ -0,0 +1,160 @@
|
||||
waybar-hyprland-workspaces(5)
|
||||
|
||||
# NAME
|
||||
|
||||
waybar - hyprland workspaces module
|
||||
|
||||
# DESCRIPTION
|
||||
|
||||
The *workspaces* module displays the currently used workspaces in hyprland compositor.
|
||||
|
||||
# CONFIGURATION
|
||||
|
||||
Addressed by *hyprland/workspaces*
|
||||
|
||||
*format*: ++
|
||||
typeof: string ++
|
||||
default: {id} ++
|
||||
The format, how information should be displayed.
|
||||
|
||||
*format-icons*: ++
|
||||
typeof: array ++
|
||||
Based on the workspace ID and state, the corresponding icon gets selected. See *icons*.
|
||||
|
||||
*window-rewrite*: ++
|
||||
typeof: object ++
|
||||
Regex rules to map window class to an icon or preferred method of representation for a workspace's window.
|
||||
Keys are the rules, while the values are the methods of representation. Values may use the placeholders {class} and {title} to use the window's original class and/or title respectively.
|
||||
Rules may specify `class<...>`, `title<...>`, or both in order to fine-tune the matching.
|
||||
|
||||
*window-rewrite-default*:
|
||||
typeof: string ++
|
||||
default: "?" ++
|
||||
The default method of representation for a workspace's window. This will be used for windows whose classes do not match any of the rules in *window-rewrite*.
|
||||
|
||||
*format-window-separator*: ++
|
||||
typeof: string ++
|
||||
default: " " ++
|
||||
The separator to be used between windows in a workspace.
|
||||
|
||||
*show-special*: ++
|
||||
typeof: bool ++
|
||||
default: false ++
|
||||
If set to true, special workspaces will be shown.
|
||||
|
||||
*all-outputs*: ++
|
||||
typeof: bool ++
|
||||
default: false ++
|
||||
If set to false workspaces group will be shown only in assigned output. Otherwise, all workspace groups are shown.
|
||||
|
||||
*active-only*: ++
|
||||
typeof: bool ++
|
||||
default: false ++
|
||||
If set to true, only the active workspace will be shown.
|
||||
|
||||
*ignore-workspaces*: ++
|
||||
typeof: array ++
|
||||
default: [] ++
|
||||
Regexes to match against workspaces names. If there's a match, the workspace will not be shown. This takes precedence over *show-special*, *all-outputs*, and *active-only*.
|
||||
|
||||
*sort-by*: ++
|
||||
typeof: string ++
|
||||
default: "default" ++
|
||||
If set to number, workspaces will sort by number.
|
||||
If set to name, workspaces will sort by name.
|
||||
If set to id, workspaces will sort by id.
|
||||
If none of those, workspaces will sort with default behavior.
|
||||
|
||||
# FORMAT REPLACEMENTS
|
||||
|
||||
*{id}*: id of workspace assigned by compositor
|
||||
|
||||
*{name}*: workspace name assigned by compositor
|
||||
|
||||
*{icon}*: Icon, as defined in *format-icons*.
|
||||
|
||||
# ICONS
|
||||
|
||||
Additional to workspace name matching, the following *format-icons* can be set.
|
||||
|
||||
- *default*: Will be shown, when no string match is found and none of the below conditions have defined icons.
|
||||
- *active*: Will be shown, when workspace is active
|
||||
- *special*: Will be shown on non-active special workspaces
|
||||
- *empty*: Will be shown on non-active, non-special empty persistent workspaces
|
||||
- *visible*: Will be shown on workspaces that are visible but not active. For example: this is useful if you want your visible workspaces on other monitors to have the same look as active.
|
||||
- *persistent*: Will be shown on non-empty persistent workspaces
|
||||
|
||||
# EXAMPLES
|
||||
|
||||
```
|
||||
"hyprland/workspaces": {
|
||||
"format": "{name}: {icon}",
|
||||
"format-icons": {
|
||||
"1": "",
|
||||
"2": "",
|
||||
"3": "",
|
||||
"4": "",
|
||||
"5": "",
|
||||
"active": "",
|
||||
"default": ""
|
||||
},
|
||||
"persistent-workspaces": {
|
||||
"*": 5, // 5 workspaces by default on every monitor
|
||||
"HDMI-A-1": 3 // but only three on HDMI-A-1
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
```
|
||||
"hyprland/workspaces": {
|
||||
"format": "{name}: {icon}",
|
||||
"format-icons": {
|
||||
"1": "",
|
||||
"2": "",
|
||||
"3": "",
|
||||
"4": "",
|
||||
"5": "",
|
||||
"active": "",
|
||||
"default": ""
|
||||
},
|
||||
"persistent-workspaces": {
|
||||
"*": [ 2,3,4,5 ], // 2-5 on every monitor
|
||||
"HDMI-A-1": [ 1 ] // but only workspace 1 on HDMI-A-1
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
```
|
||||
"hyprland/workspaces": {
|
||||
"format": "{name}\n{windows}",
|
||||
"format-window-separator": "\n",
|
||||
"window-rewrite-default": "",
|
||||
"window-rewrite": {
|
||||
"title<.*youtube.*>": "", // Windows whose titles contain "youtube"
|
||||
"class<firefox>": "", // Windows whose classes are "firefox"
|
||||
"class<firefox> title<.*github.*>": "", // Windows whose class is "firefox" and title contains "github". Note that "class" always comes first.
|
||||
"foot": "", // Windows that contain "foot" in either class or title. For optimization reasons, it will only match against a title if at least one other window explicitly matches against a title.
|
||||
"code": "",
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
```
|
||||
"hyprland/workspaces": {
|
||||
// Formatting omitted for brevity
|
||||
"ignore-workspaces": [
|
||||
"(special:)?chrome-sharing-indicator"
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
# Style
|
||||
|
||||
- *#workspaces*
|
||||
- *#workspaces button*
|
||||
- *#workspaces button.active*
|
||||
- *#workspaces button.empty*
|
||||
- *#workspaces button.visible*
|
||||
- *#workspaces button.persistent*
|
||||
- *#workspaces button.special*
|
||||
- *#workspaces button.urgent*
|
||||
@@ -6,8 +6,8 @@ waybar - idle_inhibitor module
|
||||
|
||||
# DESCRIPTION
|
||||
|
||||
The *idle_inhibitor* module can inhibiting the idle behavior such as screen blanking, locking, and
|
||||
screensaving, also known as "presentation mode".
|
||||
The *idle_inhibitor* module can inhibit the idle behavior such as screen blanking, locking, and
|
||||
screensaver, also known as "presentation mode".
|
||||
|
||||
# CONFIGURATION
|
||||
|
||||
@@ -28,12 +28,16 @@ screensaving, also known as "presentation mode".
|
||||
The maximum length in character the module should display.
|
||||
|
||||
*min-length*: ++
|
||||
typeof: integer ++
|
||||
The minimum length in characters the module should take up.
|
||||
typeof: integer ++
|
||||
The minimum length in characters the module should accept.
|
||||
|
||||
*align*: ++
|
||||
typeof: float ++
|
||||
The alignment of the text, where 0 is left-aligned and 1 is right-aligned. If the module is rotated, it will follow the flow of the text.
|
||||
typeof: float ++
|
||||
The alignment of the label within the module, where 0 is left-aligned and 1 is right-aligned. If the module is rotated, it will follow the flow of the text.
|
||||
|
||||
*justify*: ++
|
||||
typeof: string ++
|
||||
The alignment of the text within the module's label, allowing options 'left', 'right', or 'center' to define the positioning.
|
||||
|
||||
*on-click*: ++
|
||||
typeof: string ++
|
||||
@@ -45,7 +49,7 @@ screensaving, also known as "presentation mode".
|
||||
|
||||
*on-click-right*: ++
|
||||
typeof: string ++
|
||||
Command to execute when you right clicked on the module.
|
||||
Command to execute when you right-click on the module.
|
||||
|
||||
*on-update*: ++
|
||||
typeof: string ++
|
||||
@@ -64,13 +68,13 @@ screensaving, also known as "presentation mode".
|
||||
Threshold to be used when scrolling.
|
||||
|
||||
*start-activated*: ++
|
||||
typeof: bool ++
|
||||
default: *false* ++
|
||||
Whether the inhibit should be activated when starting waybar.
|
||||
typeof: bool ++
|
||||
default: *false* ++
|
||||
Whether the inhibit should be activated when starting waybar.
|
||||
|
||||
*timeout*: ++
|
||||
typeof: double ++
|
||||
The number of minutes the inhibit should last.
|
||||
The number of minutes the inhibition should last.
|
||||
|
||||
*tooltip*: ++
|
||||
typeof: bool ++
|
||||
@@ -97,8 +101,8 @@ screensaving, also known as "presentation mode".
|
||||
"idle_inhibitor": {
|
||||
"format": "{icon}",
|
||||
"format-icons": {
|
||||
"activated": "",
|
||||
"deactivated": ""
|
||||
"activated": "",
|
||||
"deactivated": ""
|
||||
},
|
||||
"timeout": 30.5
|
||||
}
|
||||
|
||||
@@ -13,24 +13,26 @@ The *image* module displays an image from a path.
|
||||
*path*: ++
|
||||
typeof: string ++
|
||||
The path to the image.
|
||||
|
||||
*exec*: ++
|
||||
typeof: string ++
|
||||
The path to the script, which should return image path file
|
||||
it will only execute if the path is not set
|
||||
The path to the script, which should return image path file. ++
|
||||
It will only execute if the path is not set
|
||||
|
||||
*size*: ++
|
||||
typeof: integer ++
|
||||
The width/height to render the image.
|
||||
|
||||
*interval*: ++
|
||||
typeof: integer ++
|
||||
The interval (in seconds) to re-render the image.
|
||||
This is useful if the contents of *path* changes.
|
||||
The interval (in seconds) to re-render the image. ++
|
||||
This is useful if the contents of *path* changes. ++
|
||||
If no *interval* is defined, the image will only be rendered once.
|
||||
|
||||
*signal*: ++
|
||||
typeof: integer ++
|
||||
The signal number used to update the module.
|
||||
This can be used instead of *interval* if the file changes irregularly.
|
||||
The signal number used to update the module. ++
|
||||
This can be used instead of *interval* if the file changes irregularly. ++
|
||||
The number is valid between 1 and N, where *SIGRTMIN+N* = *SIGRTMAX*.
|
||||
|
||||
*on-click*: ++
|
||||
@@ -57,6 +59,20 @@ The *image* module displays an image from a path.
|
||||
typeof: double ++
|
||||
Threshold to be used when scrolling.
|
||||
|
||||
*tooltip*: ++
|
||||
typeof: bool ++
|
||||
default: true ++
|
||||
Option to enable tooltip on hover.
|
||||
|
||||
# SCRIPT OUTPUT
|
||||
|
||||
Similar to the *custom* module, output values of the script are *newline* separated.
|
||||
The following is the output format:
|
||||
|
||||
```
|
||||
$path\\n$tooltip
|
||||
```
|
||||
|
||||
# EXAMPLES
|
||||
|
||||
```
|
||||
@@ -71,3 +87,4 @@ The *image* module displays an image from a path.
|
||||
# STYLE
|
||||
|
||||
- *#image*
|
||||
- *#image.empty*
|
||||
|
||||
@@ -33,11 +33,15 @@ See *systemd-inhibit*(1) for more information.
|
||||
|
||||
*min-length*: ++
|
||||
typeof: integer ++
|
||||
The minimum length in characters the module should take up.
|
||||
The minimum length in characters the module should accept.
|
||||
|
||||
*align*: ++
|
||||
typeof: float ++
|
||||
The alignment of the text, where 0 is left-aligned and 1 is right-aligned. If the module is rotated, it will follow the flow of the text.
|
||||
The alignment of the label within the module, where 0 is left-aligned and 1 is right-aligned. If the module is rotated, it will follow the flow of the text.
|
||||
|
||||
*justify*: ++
|
||||
typeof: string ++
|
||||
The alignment of the text within the module's label, allowing options 'left', 'right', or 'center' to define the positioning.
|
||||
|
||||
*on-click*: ++
|
||||
typeof: string ++
|
||||
@@ -49,7 +53,7 @@ See *systemd-inhibit*(1) for more information.
|
||||
|
||||
*on-click-right*: ++
|
||||
typeof: string ++
|
||||
Command to execute when you right clicked on the module.
|
||||
Command to execute when you right-click on the module.
|
||||
|
||||
*on-update*: ++
|
||||
typeof: string ++
|
||||
@@ -85,8 +89,8 @@ See *systemd-inhibit*(1) for more information.
|
||||
"what": "handle-lid-switch",
|
||||
"format": "{icon}",
|
||||
"format-icons": {
|
||||
"activated": "",
|
||||
"deactivated": ""
|
||||
"activated": "",
|
||||
"deactivated": ""
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
@@ -13,73 +13,77 @@ The *jack* module displays the current state of the JACK server.
|
||||
Addressed by *jack*
|
||||
|
||||
*format*: ++
|
||||
typeof: string ++
|
||||
default: *{load}%* ++
|
||||
The format, how information should be displayed. This format is used when other formats aren't specified.
|
||||
typeof: string ++
|
||||
default: *{load}%* ++
|
||||
The format, how information should be displayed. This format is used when other formats aren't specified.
|
||||
|
||||
*format-connected*: ++
|
||||
typeof: string ++
|
||||
This format is used when the module is connected to the JACK server.
|
||||
typeof: string ++
|
||||
This format is used when the module is connected to the JACK server.
|
||||
|
||||
*format-disconnected*: ++
|
||||
typeof: string ++
|
||||
This format is used when the module is not connected to the JACK server.
|
||||
typeof: string ++
|
||||
This format is used when the module is not connected to the JACK server.
|
||||
|
||||
*format-xrun*: ++
|
||||
typeof: string ++
|
||||
This format is used for one polling interval, when the JACK server reports an xrun.
|
||||
typeof: string ++
|
||||
This format is used for one polling interval when the JACK server reports an xrun.
|
||||
|
||||
*realtime*: ++
|
||||
typeof: bool ++
|
||||
default: *true* ++
|
||||
Option to drop real-time privileges for the JACK client opened by Waybar.
|
||||
typeof: bool ++
|
||||
default: *true* ++
|
||||
Option to drop real-time privileges for the JACK client opened by Waybar.
|
||||
|
||||
*tooltip*: ++
|
||||
typeof: bool ++
|
||||
default: *true* ++
|
||||
Option to disable tooltip on hover.
|
||||
typeof: bool ++
|
||||
default: *true* ++
|
||||
Option to disable tooltip on hover.
|
||||
|
||||
*tooltip-format*: ++
|
||||
typeof: string ++
|
||||
default: *{bufsize}/{samplerate} {latency}ms* ++
|
||||
The format of information displayed in the tooltip.
|
||||
typeof: string ++
|
||||
default: *{bufsize}/{samplerate} {latency}ms* ++
|
||||
The format of information displayed in the tooltip.
|
||||
|
||||
*interval*: ++
|
||||
typeof: integer ++
|
||||
default: 1 ++
|
||||
The interval in which the information gets polled.
|
||||
typeof: integer ++
|
||||
default: 1 ++
|
||||
The interval in which the information gets polled.
|
||||
|
||||
*rotate*: ++
|
||||
typeof: integer ++
|
||||
Positive value to rotate the text label.
|
||||
typeof: integer ++
|
||||
Positive value to rotate the text label.
|
||||
|
||||
*max-length*: ++
|
||||
typeof: integer ++
|
||||
The maximum length in character the module should display.
|
||||
typeof: integer ++
|
||||
The maximum length in character the module should display.
|
||||
|
||||
*min-length*: ++
|
||||
typeof: integer ++
|
||||
The minimum length in characters the module should take up.
|
||||
typeof: integer ++
|
||||
The minimum length in characters the module should accept.
|
||||
|
||||
*align*: ++
|
||||
typeof: float ++
|
||||
The alignment of the text, where 0 is left-aligned and 1 is right-aligned. If the module is rotated, it will follow the flow of the text.
|
||||
typeof: float ++
|
||||
The alignment of the label within the module, where 0 is left-aligned and 1 is right-aligned. If the module is rotated, it will follow the flow of the text.
|
||||
|
||||
*justify*: ++
|
||||
typeof: string ++
|
||||
The alignment of the text within the module's label, allowing options 'left', 'right', or 'center' to define the positioning.
|
||||
|
||||
*on-click*: ++
|
||||
typeof: string ++
|
||||
Command to execute when clicked on the module.
|
||||
typeof: string ++
|
||||
Command to execute when clicked on the module.
|
||||
|
||||
*on-click-middle*: ++
|
||||
typeof: string ++
|
||||
Command to execute when middle-clicked on the module using mousewheel.
|
||||
typeof: string ++
|
||||
Command to execute when middle-clicked on the module using mousewheel.
|
||||
|
||||
*on-click-right*: ++
|
||||
typeof: string ++
|
||||
Command to execute when you right clicked on the module.
|
||||
typeof: string ++
|
||||
Command to execute when you right-click on the module.
|
||||
|
||||
*on-update*: ++
|
||||
typeof: string ++
|
||||
Command to execute when the module is updated.
|
||||
typeof: string ++
|
||||
Command to execute when the module is updated.
|
||||
|
||||
# FORMAT REPLACEMENTS
|
||||
|
||||
@@ -87,7 +91,7 @@ Addressed by *jack*
|
||||
|
||||
*{bufsize}*: The size of the JACK buffer.
|
||||
|
||||
*{samplerate}*: The samplerate at which the JACK server is running.
|
||||
*{samplerate}*: The sample rate at which the JACK server is running.
|
||||
|
||||
*{latency}*: The duration, in ms, of the current buffer size.
|
||||
|
||||
@@ -97,10 +101,10 @@ Addressed by *jack*
|
||||
|
||||
```
|
||||
"jack": {
|
||||
"format": "DSP {}%",
|
||||
"format-xrun": "{xruns} xruns",
|
||||
"format-disconnected": "DSP off",
|
||||
"realtime": true
|
||||
"format": "DSP {}%",
|
||||
"format-xrun": "{xruns} xruns",
|
||||
"format-disconnected": "DSP off",
|
||||
"realtime": true
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user