Compare commits
648 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c6a9b63189 | ||
|
|
7dfc72003f | ||
|
|
1c1a39f597 | ||
|
|
121dcc645f | ||
|
|
8555456050 | ||
|
|
22dc87934a | ||
|
|
335a736eed | ||
|
|
1149e51f72 | ||
|
|
9012cebbf2 | ||
|
|
6425bd2fe0 | ||
|
|
241938a86d | ||
|
|
f511e61832 | ||
|
|
b9b89cce7e | ||
|
|
e9a66d68b7 | ||
|
|
b37d0df89b | ||
|
|
67422eea36 | ||
|
|
e46f66b468 | ||
|
|
1f0ce1a5d9 | ||
|
|
95b0647c91 | ||
|
|
9ef8faf9b1 | ||
|
|
7d8c1494d7 | ||
|
|
33f8a02fb5 | ||
|
|
1618ee78b7 | ||
|
|
efab1daa7e | ||
|
|
9a305b2d73 | ||
|
|
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 | ||
|
|
47193a3d2f | ||
|
|
097cbc0c53 | ||
|
|
13a9c4a08b | ||
|
|
ebba529682 | ||
|
|
b97b0ae605 | ||
|
|
7e9bfc504c | ||
|
|
7b0d2e8043 | ||
|
|
75eacb95ef | ||
|
|
2b24b16023 | ||
|
|
5cbbfd5c8a | ||
|
|
6163be687d | ||
|
|
df65cab17a | ||
|
|
339bea1213 | ||
|
|
7b704071ff | ||
|
|
5748e56aeb | ||
|
|
5b29119dab | ||
|
|
4bc30e040f | ||
|
|
919ad0a8bb | ||
|
|
5df43be11f | ||
|
|
56fa6b6afc | ||
|
|
c04485a5d0 | ||
|
|
b06953757e | ||
|
|
f5ef13c7f1 | ||
|
|
8c83af75a1 | ||
|
|
e253c34cd4 | ||
|
|
e4faf252b2 | ||
|
|
3da3732cc9 | ||
|
|
757f20fc04 | ||
|
|
f00602058c | ||
|
|
bad6cfae6f | ||
|
|
9389c8d854 | ||
|
|
6a17139423 | ||
|
|
a9a2223469 | ||
|
|
33d1ee413f | ||
|
|
0b4c1cb877 | ||
|
|
5e5569bb10 | ||
|
|
272d672953 | ||
|
|
ede1d25440 | ||
|
|
8be889c5aa | ||
|
|
b1e3347fca | ||
|
|
da2163ae41 | ||
|
|
1d7d1a8fe8 | ||
|
|
7d20034067 | ||
|
|
8aafe817bf | ||
|
|
a5607b66ca | ||
|
|
61648c55d9 | ||
|
|
4dff1b91fe | ||
|
|
1368ba64b5 | ||
|
|
6de3b58d6a | ||
|
|
731eaeb0be | ||
|
|
022c9abad4 | ||
|
|
a46b8a0109 | ||
|
|
3b2dfeec01 | ||
|
|
e62d339b57 | ||
|
|
18a2b90fc0 | ||
|
|
60cdf10e64 | ||
|
|
51f0fc6b72 | ||
|
|
6f3a27905d | ||
|
|
659fea07ee | ||
|
|
bd908f6d97 | ||
|
|
cb82326b22 | ||
|
|
33c4964187 | ||
|
|
3d980f92a3 | ||
|
|
626a1f58be | ||
|
|
1445dc4151 | ||
|
|
a6084ea7e6 | ||
|
|
60467ad7f2 | ||
|
|
ef99b0226c | ||
|
|
60e0584d16 | ||
|
|
ba6faa7859 | ||
|
|
02b3c125a1 | ||
|
|
20a8039a25 | ||
|
|
ffeef7f40f | ||
|
|
0cfd1c7094 | ||
|
|
e5524d5059 | ||
|
|
774d8880cd | ||
|
|
a301b8c4cd | ||
|
|
5383f7bd56 | ||
|
|
a53c97f7f6 | ||
|
|
9fd2703cb9 | ||
|
|
918de59988 | ||
|
|
4b27385da2 | ||
|
|
f557697e92 | ||
|
|
63525ec956 | ||
|
|
5791a6abc6 | ||
|
|
bbcfb5e138 | ||
|
|
4ab4ff790e | ||
|
|
473eb0982b | ||
|
|
fa9f3a6dc5 | ||
|
|
c26849217e | ||
|
|
90206f55be | ||
|
|
9a0dbd555d | ||
|
|
a9015c7c98 | ||
|
|
5b6e9d4e34 | ||
|
|
8ccf00f0fe | ||
|
|
823c13a8c0 | ||
|
|
3c96881a59 | ||
|
|
b34d325a71 | ||
|
|
3bda22da72 | ||
|
|
61a6c00c02 | ||
|
|
39bc54e3ad | ||
|
|
4cb7e55a91 | ||
|
|
43862ceb34 | ||
|
|
f29a400c97 | ||
|
|
ce16e029ed | ||
|
|
79eb2f5bc1 | ||
|
|
b7e6a2dc25 | ||
|
|
23f39938fb | ||
|
|
8cc8820369 | ||
|
|
c9c8b09e3f | ||
|
|
fb1f550c1a | ||
|
|
e25a7c9719 | ||
|
|
09142fa322 | ||
|
|
1af25094b7 | ||
|
|
0d99d38089 | ||
|
|
a10464d9bb | ||
|
|
3f23792df0 | ||
|
|
529031f44f | ||
|
|
f51894614d | ||
|
|
a7dbab79e5 | ||
|
|
4dcce810d2 | ||
|
|
43958ef560 | ||
|
|
5e4a47c0a8 | ||
|
|
ea38eec2af | ||
|
|
286a3c70f4 | ||
|
|
9049de583e | ||
|
|
a6eaaad97f | ||
|
|
d25930793c | ||
|
|
67ab269706 | ||
|
|
48312f4c91 | ||
|
|
677cbb3384 | ||
|
|
973aa09f8b | ||
|
|
e8c4b85328 | ||
|
|
b5ad77ea8c | ||
|
|
74a8464c09 | ||
|
|
a78f0124d2 | ||
|
|
8da5425189 | ||
|
|
a9c9f1d705 | ||
|
|
301b106c48 | ||
|
|
757a450324 | ||
|
|
7b3a6fbaa7 | ||
|
|
c93811b158 | ||
|
|
7554d7f071 | ||
|
|
220b859948 | ||
|
|
012baadaca | ||
|
|
0ecfce9c61 | ||
|
|
d2116acb62 | ||
|
|
5d8f9a8273 | ||
|
|
9068b7548f | ||
|
|
1495b957f1 | ||
|
|
47cdd6f988 | ||
|
|
f3f0b008c6 | ||
|
|
c1ceb7ac42 | ||
|
|
e128c48573 | ||
|
|
dd9e3d0172 | ||
|
|
a9613892bb | ||
|
|
e7af29ac1e | ||
|
|
3b28af8b51 | ||
|
|
ed31b20c26 | ||
|
|
fea7ec9133 | ||
|
|
3c8ca009ff | ||
|
|
f4cfafd238 | ||
|
|
5182fadede | ||
|
|
18e0e0c7c1 | ||
|
|
69b95e6d71 | ||
|
|
5e2895ccb3 | ||
|
|
0ca1c3957a | ||
|
|
de77787b60 | ||
|
|
51b6c22cab | ||
|
|
01cee153a4 | ||
|
|
93e340a081 | ||
|
|
6225db0a48 | ||
|
|
ea17a66dfc | ||
|
|
67efe1af89 | ||
|
|
ba498869c5 | ||
|
|
43d52c59d9 | ||
|
|
ca9d237b00 | ||
|
|
bc07a82579 | ||
|
|
6e9f21fc6b | ||
|
|
eb9d2d9c5d | ||
|
|
be3df41ae0 | ||
|
|
4e8ccf36b5 | ||
|
|
5649c3f552 | ||
|
|
a4b1b0a211 | ||
|
|
6c8e186586 | ||
|
|
544c6deb88 | ||
|
|
e59b4e4c93 | ||
|
|
d71a4569fe | ||
|
|
120cba0f5e | ||
|
|
328573332f | ||
|
|
df0fdce92b | ||
|
|
1130e8c8ec | ||
|
|
d5a86526bc | ||
|
|
55d7868f86 | ||
|
|
0540977e45 | ||
|
|
385726e701 | ||
|
|
f5a24d12e5 |
1
.envrc.sample
Normal file
1
.envrc.sample
Normal file
@@ -0,0 +1 @@
|
||||
use flake
|
||||
38
.github/workflows/freebsd.yml
vendored
38
.github/workflows/freebsd.yml
vendored
@@ -1,6 +1,6 @@
|
||||
name: freebsd
|
||||
|
||||
on: [ push, pull_request ]
|
||||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
clang:
|
||||
@@ -9,21 +9,21 @@ jobs:
|
||||
# https://github.com/actions/virtual-environments/issues/4060 - for lack of VirtualBox on MacOS 11 runners
|
||||
runs-on: macos-12
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- 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.19.1
|
||||
timeout-minutes: 180
|
||||
with:
|
||||
operating_system: freebsd
|
||||
version: "13.2"
|
||||
environment_variables: CPPFLAGS=-isystem/usr/local/include LDFLAGS=-L/usr/local/lib
|
||||
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
|
||||
|
||||
8
.github/workflows/lint.yml
vendored
8
.github/workflows/lint.yml
vendored
@@ -6,9 +6,9 @@ jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: DoozyX/clang-format-lint-action@v0.13
|
||||
- uses: actions/checkout@v3
|
||||
- uses: DoozyX/clang-format-lint-action@v0.16.2
|
||||
with:
|
||||
source: '.'
|
||||
extensions: 'h,cpp,c'
|
||||
clangFormatVersion: 12
|
||||
extensions: 'hpp,h,cpp,c'
|
||||
clangFormatVersion: 16
|
||||
|
||||
10
.github/workflows/linux.yml
vendored
10
.github/workflows/linux.yml
vendored
@@ -13,16 +13,20 @@ jobs:
|
||||
- fedora
|
||||
- opensuse
|
||||
- gentoo
|
||||
cpp_std: [c++20]
|
||||
include:
|
||||
- distro: fedora
|
||||
cpp_std: c++20
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: alexays/waybar:${{ matrix.distro }}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
- name: configure
|
||||
run: meson -Dman-pages=enabled build
|
||||
run: meson -Dman-pages=enabled -Dcpp_std=${{matrix.cpp_std}} build
|
||||
- name: build
|
||||
run: ninja -C build
|
||||
- name: test
|
||||
run: meson test -C build --no-rebuild --print-errorlogs --suite waybar
|
||||
run: make test
|
||||
|
||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -43,3 +43,4 @@ packagecache
|
||||
*.exe
|
||||
*.out
|
||||
*.app
|
||||
/.direnv/
|
||||
|
||||
@@ -3,4 +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,12 +2,33 @@
|
||||
|
||||
FROM fedora:latest
|
||||
|
||||
RUN dnf install -y @c-development git-core meson scdoc 'pkgconfig(date)' \
|
||||
'pkgconfig(dbusmenu-gtk3-0.4)' 'pkgconfig(fmt)' 'pkgconfig(gdk-pixbuf-2.0)' \
|
||||
'pkgconfig(gio-unix-2.0)' 'pkgconfig(gtk-layer-shell-0)' 'pkgconfig(gtkmm-3.0)' \
|
||||
'pkgconfig(jsoncpp)' 'pkgconfig(libinput)' 'pkgconfig(libmpdclient)' \
|
||||
'pkgconfig(libnl-3.0)' 'pkgconfig(libnl-genl-3.0)' 'pkgconfig(libpulse)' \
|
||||
'pkgconfig(libudev)' 'pkgconfig(pugixml)' 'pkgconfig(sigc++-2.0)' 'pkgconfig(spdlog)' \
|
||||
'pkgconfig(wayland-client)' 'pkgconfig(wayland-cursor)' 'pkgconfig(wayland-protocols)' 'pkgconfig(xkbregistry)' \
|
||||
'pkgconfig(playerctl)' && \
|
||||
RUN dnf install -y @c-development \
|
||||
git-core glibc-langpack-en meson scdoc \
|
||||
'pkgconfig(catch2)' \
|
||||
'pkgconfig(date)' \
|
||||
'pkgconfig(dbusmenu-gtk3-0.4)' \
|
||||
'pkgconfig(fmt)' \
|
||||
'pkgconfig(gdk-pixbuf-2.0)' \
|
||||
'pkgconfig(gio-unix-2.0)' \
|
||||
'pkgconfig(gtk-layer-shell-0)' \
|
||||
'pkgconfig(gtkmm-3.0)' \
|
||||
'pkgconfig(jack)' \
|
||||
'pkgconfig(jsoncpp)' \
|
||||
'pkgconfig(libevdev)' \
|
||||
'pkgconfig(libinput)' \
|
||||
'pkgconfig(libmpdclient)' \
|
||||
'pkgconfig(libnl-3.0)' \
|
||||
'pkgconfig(libnl-genl-3.0)' \
|
||||
'pkgconfig(libpulse)' \
|
||||
'pkgconfig(libudev)' \
|
||||
'pkgconfig(playerctl)' \
|
||||
'pkgconfig(pugixml)' \
|
||||
'pkgconfig(sigc++-2.0)' \
|
||||
'pkgconfig(spdlog)' \
|
||||
'pkgconfig(upower-glib)' \
|
||||
'pkgconfig(wayland-client)' \
|
||||
'pkgconfig(wayland-cursor)' \
|
||||
'pkgconfig(wayland-protocols)' \
|
||||
'pkgconfig(wireplumber-0.4)' \
|
||||
'pkgconfig(xkbregistry)' && \
|
||||
dnf clean all -y
|
||||
|
||||
@@ -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
|
||||
media-sound/sndio gui-libs/gtk-layer-shell app-text/scdoc media-sound/playerctl dev-libs/iniparser sci-libs/fftw
|
||||
|
||||
4
Makefile
4
Makefile
@@ -19,5 +19,9 @@ run: build
|
||||
debug-run: build-debug
|
||||
./build/waybar --log-level debug
|
||||
|
||||
test:
|
||||
meson test -C build --no-rebuild --verbose --suite waybar
|
||||
.PHONY: test
|
||||
|
||||
clean:
|
||||
rm -rf build
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# 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
|
||||
> Available in Arch [extra](https://www.archlinux.org/packages/extra/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>
|
||||
> *Waybar [examples](https://github.com/Alexays/Waybar/wiki/Examples)*
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
- Sway (Workspaces, Binding mode, Focused window name)
|
||||
- River (Mapping mode, Tags, Focused window name)
|
||||
- Hyprland (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
|
||||
|
||||
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
|
||||
129
flake.lock
generated
Normal file
129
flake.lock
generated
Normal file
@@ -0,0 +1,129 @@
|
||||
{
|
||||
"nodes": {
|
||||
"devshell": {
|
||||
"inputs": {
|
||||
"nixpkgs": "nixpkgs",
|
||||
"systems": "systems"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1692523566,
|
||||
"narHash": "sha256-VDJDihK6jNebVw9y3qKCVD6+6QaC/x8kxZzL4MaIPPY=",
|
||||
"owner": "numtide",
|
||||
"repo": "devshell",
|
||||
"rev": "d208c58e2f7afef838add5f18a9936b12a71d695",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "numtide",
|
||||
"repo": "devshell",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"flake-compat": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1673956053,
|
||||
"narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=",
|
||||
"owner": "edolstra",
|
||||
"repo": "flake-compat",
|
||||
"rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "edolstra",
|
||||
"repo": "flake-compat",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"flake-utils": {
|
||||
"inputs": {
|
||||
"systems": "systems_2"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1689068808,
|
||||
"narHash": "sha256-6ixXo3wt24N/melDWjq70UuHQLxGV8jZvooRanIHXw0=",
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"rev": "919d646de7be200f3bf08cb76ae1f09402b6f9b4",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1677383253,
|
||||
"narHash": "sha256-UfpzWfSxkfXHnb4boXZNaKsAcUrZT9Hw+tao1oZxd08=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "9952d6bc395f5841262b006fbace8dd7e143b634",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NixOS",
|
||||
"ref": "nixpkgs-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs_2": {
|
||||
"locked": {
|
||||
"lastModified": 1692638711,
|
||||
"narHash": "sha256-J0LgSFgJVGCC1+j5R2QndadWI1oumusg6hCtYAzLID4=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "91a22f76cd1716f9d0149e8a5c68424bb691de15",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NixOS",
|
||||
"ref": "nixos-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"devshell": "devshell",
|
||||
"flake-compat": "flake-compat",
|
||||
"flake-utils": "flake-utils",
|
||||
"nixpkgs": "nixpkgs_2"
|
||||
}
|
||||
},
|
||||
"systems": {
|
||||
"locked": {
|
||||
"lastModified": 1681028828,
|
||||
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"systems_2": {
|
||||
"locked": {
|
||||
"lastModified": 1681028828,
|
||||
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"type": "github"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
"version": 7
|
||||
}
|
||||
90
flake.nix
Normal file
90
flake.nix
Normal file
@@ -0,0 +1,90 @@
|
||||
{
|
||||
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, flake-compat }:
|
||||
let
|
||||
inherit (nixpkgs) lib;
|
||||
genSystems = lib.genAttrs [
|
||||
"x86_64-linux"
|
||||
"aarch64-linux"
|
||||
];
|
||||
|
||||
pkgsFor = genSystems (system:
|
||||
import nixpkgs {
|
||||
inherit system;
|
||||
});
|
||||
|
||||
mkDate = longDate: (lib.concatStringsSep "-" [
|
||||
(builtins.substring 0 4 longDate)
|
||||
(builtins.substring 4 2 longDate)
|
||||
(builtins.substring 6 2 longDate)
|
||||
]);
|
||||
in
|
||||
{
|
||||
overlays.default = final: prev: {
|
||||
waybar = final.callPackage ./nix/default.nix {
|
||||
version = prev.waybar.version + "+date=" + (mkDate (self.lastModifiedDate or "19700101")) + "_" + (self.shortRev or "dirty");
|
||||
};
|
||||
};
|
||||
packages = genSystems
|
||||
(system:
|
||||
(self.overlays.default pkgsFor.${system} pkgsFor.${system})
|
||||
// {
|
||||
default = self.packages.${system}.waybar;
|
||||
});
|
||||
} //
|
||||
flake-utils.lib.eachDefaultSystem (system: {
|
||||
devShell =
|
||||
let pkgs = import nixpkgs {
|
||||
inherit system;
|
||||
|
||||
overlays = [ devshell.overlays.default ];
|
||||
};
|
||||
in
|
||||
pkgs.devshell.mkShell {
|
||||
imports = [ "${pkgs.devshell.extraModulesDir}/language/c.nix" ];
|
||||
|
||||
devshell.packages = with pkgs; [
|
||||
clang-tools
|
||||
gdb
|
||||
# from nativeBuildInputs
|
||||
gnumake
|
||||
meson
|
||||
ninja
|
||||
pkg-config
|
||||
scdoc
|
||||
] ++ (map lib.getDev [
|
||||
# from buildInputs
|
||||
wayland wlroots gtkmm3 libsigcxx jsoncpp spdlog gtk-layer-shell howard-hinnant-date libxkbcommon
|
||||
# optional dependencies
|
||||
gobject-introspection glib playerctl python3.pkgs.pygobject3
|
||||
libevdev libinput libjack2 libmpdclient playerctl libnl
|
||||
libpulseaudio sndio sway libdbusmenu-gtk3 udev upower wireplumber
|
||||
|
||||
# from propagated build inputs?
|
||||
at-spi2-atk atkmm cairo cairomm catch2 fmt_8 fontconfig
|
||||
gdk-pixbuf glibmm gtk3 harfbuzz pango pangomm wayland-protocols
|
||||
]);
|
||||
|
||||
env = with pkgs; [
|
||||
{ name = "CPLUS_INCLUDE_PATH"; prefix = "$DEVSHELL_DIR/include"; }
|
||||
{ name = "PKG_CONFIG_PATH"; prefix = "$DEVSHELL_DIR/lib/pkgconfig"; }
|
||||
{ name = "PKG_CONFIG_PATH"; prefix = "$DEVSHELL_DIR/share/pkgconfig"; }
|
||||
{ name = "PATH"; prefix = "${wayland.bin}/bin"; }
|
||||
{ name = "LIBRARY_PATH"; prefix = "${lib.getLib sndio}/lib"; }
|
||||
{ name = "LIBRARY_PATH"; prefix = "${lib.getLib zlib}/lib"; }
|
||||
{ name = "LIBRARY_PATH"; prefix = "${lib.getLib howard-hinnant-date}/lib"; }
|
||||
];
|
||||
};
|
||||
});
|
||||
}
|
||||
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
|
||||
@@ -13,7 +13,7 @@ class AIconLabel : public ALabel {
|
||||
const std::string &format, uint16_t interval = 0, bool ellipsize = false,
|
||||
bool enable_click = false, bool enable_scroll = false);
|
||||
virtual ~AIconLabel() = default;
|
||||
virtual auto update() -> void;
|
||||
auto update() -> void override;
|
||||
|
||||
protected:
|
||||
Gtk::Image image_;
|
||||
|
||||
@@ -14,7 +14,7 @@ class ALabel : public AModule {
|
||||
uint16_t interval = 0, bool ellipsize = false, bool enable_click = false,
|
||||
bool enable_scroll = false);
|
||||
virtual ~ALabel() = default;
|
||||
virtual auto update() -> void;
|
||||
auto update() -> void override;
|
||||
virtual std::string getIcon(uint16_t, const std::string &alt = "", uint16_t max = 0);
|
||||
virtual std::string getIcon(uint16_t, const std::vector<std::string> &alts, uint16_t max = 0);
|
||||
|
||||
@@ -25,7 +25,7 @@ class ALabel : public AModule {
|
||||
bool alt_ = false;
|
||||
std::string default_format_;
|
||||
|
||||
virtual bool handleToggle(GdkEventButton *const &e);
|
||||
bool handleToggle(GdkEventButton *const &e) override;
|
||||
virtual std::string getState(uint8_t value, bool lesser = false);
|
||||
};
|
||||
|
||||
|
||||
@@ -11,15 +11,20 @@ namespace waybar {
|
||||
|
||||
class AModule : public IModule {
|
||||
public:
|
||||
AModule(const Json::Value &, const std::string &, const std::string &, bool enable_click = false,
|
||||
bool enable_scroll = false);
|
||||
virtual ~AModule();
|
||||
virtual auto update() -> void;
|
||||
virtual operator Gtk::Widget &();
|
||||
auto update() -> void override;
|
||||
virtual auto refresh(int) -> void{};
|
||||
operator Gtk::Widget &() override;
|
||||
auto doAction(const std::string &name) -> void override;
|
||||
|
||||
Glib::Dispatcher dp;
|
||||
|
||||
protected:
|
||||
// Don't need to make an object directly
|
||||
// Derived classes are able to use it
|
||||
AModule(const Json::Value &, const std::string &, const std::string &, bool enable_click = false,
|
||||
bool enable_scroll = false);
|
||||
|
||||
enum SCROLL_DIR { NONE, UP, DOWN, LEFT, RIGHT };
|
||||
|
||||
SCROLL_DIR getScrollDir(GdkEventScroll *e);
|
||||
@@ -31,25 +36,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);
|
||||
|
||||
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
|
||||
@@ -9,6 +9,7 @@ class IModule {
|
||||
virtual ~IModule() = default;
|
||||
virtual auto update() -> void = 0;
|
||||
virtual operator Gtk::Widget&() = 0;
|
||||
virtual auto doAction(const std::string& name) -> void = 0;
|
||||
};
|
||||
|
||||
} // namespace waybar
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
#include <vector>
|
||||
|
||||
#include "AModule.hpp"
|
||||
#include "group.hpp"
|
||||
#include "xdg-output-unstable-v1-client-protocol.h"
|
||||
|
||||
namespace waybar {
|
||||
@@ -91,6 +92,9 @@ class Bar {
|
||||
bool vertical = false;
|
||||
Gtk::Window window;
|
||||
|
||||
int x_global;
|
||||
int y_global;
|
||||
|
||||
#ifdef HAVE_SWAY
|
||||
std::string bar_id;
|
||||
#endif
|
||||
@@ -98,15 +102,20 @@ 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 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};
|
||||
|
||||
struct bar_margins margins_;
|
||||
|
||||
std::unique_ptr<BarSurface> surface_impl_;
|
||||
Gtk::Box left_;
|
||||
Gtk::Box center_;
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
|
||||
#include "bar.hpp"
|
||||
#include "config.hpp"
|
||||
#include "util/portal.hpp"
|
||||
|
||||
struct zwlr_layer_shell_v1;
|
||||
struct zwp_idle_inhibitor_v1;
|
||||
@@ -33,7 +34,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,6 +53,7 @@ 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_;
|
||||
};
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <json/json.h>
|
||||
#ifdef HAVE_LIBDATE
|
||||
#if defined(HAVE_CHRONO_TIMEZONES) || defined(HAVE_LIBDATE)
|
||||
#include "modules/clock.hpp"
|
||||
#else
|
||||
#include "modules/simpleclock.hpp"
|
||||
@@ -18,21 +18,29 @@
|
||||
#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"
|
||||
#include "modules/hyprland/workspaces.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"
|
||||
#include "modules/cpu_frequency.hpp"
|
||||
#include "modules/cpu_usage.hpp"
|
||||
#include "modules/load.hpp"
|
||||
#endif
|
||||
#include "modules/idle_inhibitor.hpp"
|
||||
#if defined(HAVE_MEMORY_LINUX) || defined(HAVE_MEMORY_BSD)
|
||||
@@ -79,6 +87,9 @@
|
||||
#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"
|
||||
|
||||
@@ -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 Bar&, const Json::Value&);
|
||||
~Group() = default;
|
||||
auto update() -> void;
|
||||
operator Gtk::Widget&();
|
||||
Group(const std::string&, const std::string&, const Json::Value&, bool);
|
||||
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,13 +1,14 @@
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
#include <vector>
|
||||
|
||||
#include "ALabel.hpp"
|
||||
#include "util/backlight_backend.hpp"
|
||||
#include "util/json.hpp"
|
||||
#include "util/sleeper_thread.hpp"
|
||||
|
||||
struct udev;
|
||||
struct udev_device;
|
||||
@@ -15,50 +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 &);
|
||||
~Backlight();
|
||||
auto update() -> void;
|
||||
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_;
|
||||
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
|
||||
@@ -29,8 +29,8 @@ namespace fs = std::filesystem;
|
||||
class Battery : public ALabel {
|
||||
public:
|
||||
Battery(const std::string&, const Json::Value&);
|
||||
~Battery();
|
||||
auto update() -> void;
|
||||
virtual ~Battery();
|
||||
auto update() -> void override;
|
||||
|
||||
private:
|
||||
static inline const fs::path data_dir_ = "/sys/class/power_supply/";
|
||||
|
||||
@@ -45,8 +45,8 @@ class Bluetooth : public ALabel {
|
||||
|
||||
public:
|
||||
Bluetooth(const std::string&, const Json::Value&);
|
||||
~Bluetooth() = default;
|
||||
auto update() -> void;
|
||||
virtual ~Bluetooth() = default;
|
||||
auto update() -> void override;
|
||||
|
||||
private:
|
||||
static auto onInterfaceAddedOrRemoved(GDBusObjectManager*, GDBusObject*, GDBusInterface*,
|
||||
@@ -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_;
|
||||
|
||||
49
include/modules/cava.hpp
Normal file
49
include/modules/cava.hpp
Normal file
@@ -0,0 +1,49 @@
|
||||
#pragma once
|
||||
|
||||
#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;
|
||||
|
||||
class Cava final : public ALabel {
|
||||
public:
|
||||
Cava(const std::string&, const Json::Value&);
|
||||
virtual ~Cava();
|
||||
auto update() -> void override;
|
||||
auto doAction(const std::string& name) -> void override;
|
||||
|
||||
private:
|
||||
util::SleeperThread thread_;
|
||||
util::SleeperThread thread_fetch_input_;
|
||||
|
||||
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
|
||||
cava::ptr input_source_;
|
||||
// Delay to handle audio source
|
||||
std::chrono::milliseconds frame_time_milsec_{1s};
|
||||
// Text to display
|
||||
std::string text_{""};
|
||||
int rePaint_{1};
|
||||
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();
|
||||
// ModuleActionMap
|
||||
static inline std::map<const std::string, void (waybar::modules::Cava::*const)()> actionMap_{
|
||||
{"mode", &waybar::modules::Cava::pause_resume}};
|
||||
};
|
||||
} // namespace waybar::modules
|
||||
@@ -1,47 +1,79 @@
|
||||
#pragma once
|
||||
|
||||
#include <date/tz.h>
|
||||
|
||||
#include "ALabel.hpp"
|
||||
#include "util/date.hpp"
|
||||
#include "util/sleeper_thread.hpp"
|
||||
|
||||
namespace waybar {
|
||||
|
||||
struct waybar_time;
|
||||
|
||||
namespace modules {
|
||||
namespace waybar::modules {
|
||||
|
||||
const std::string kCalendarPlaceholder = "calendar";
|
||||
const std::string KTimezonedTimeListPlaceholder = "timezoned_time_list";
|
||||
|
||||
class Clock : public ALabel {
|
||||
enum class WeeksSide {
|
||||
LEFT,
|
||||
RIGHT,
|
||||
HIDDEN,
|
||||
};
|
||||
|
||||
enum class CldMode { MONTH, YEAR };
|
||||
|
||||
class Clock final : public ALabel {
|
||||
public:
|
||||
Clock(const std::string&, const Json::Value&);
|
||||
~Clock() = default;
|
||||
auto update() -> void;
|
||||
virtual ~Clock() = default;
|
||||
auto update() -> void override;
|
||||
auto doAction(const std::string& name) -> void override;
|
||||
|
||||
private:
|
||||
util::SleeperThread thread_;
|
||||
std::locale locale_;
|
||||
std::vector<const date::time_zone*> time_zones_;
|
||||
int current_time_zone_idx_;
|
||||
date::year_month_day calendar_cached_ymd_{date::January / 1 / 0};
|
||||
date::months calendar_shift_{0}, calendar_shift_init_{0};
|
||||
std::string calendar_cached_text_;
|
||||
bool is_calendar_in_tooltip_;
|
||||
bool is_timezoned_list_in_tooltip_;
|
||||
|
||||
bool handleScroll(GdkEventScroll* e);
|
||||
|
||||
std::string fmt_str_weeks_;
|
||||
std::string fmt_str_calendar_;
|
||||
int fmt_weeks_left_pad_{0};
|
||||
auto calendar_text(const waybar_time& wtime) -> std::string;
|
||||
auto weekdays_header(const date::weekday& first_dow, std::ostream& os) -> void;
|
||||
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;
|
||||
auto timezones_text(std::chrono::system_clock::time_point now) -> std::string;
|
||||
|
||||
/*Calendar properties*/
|
||||
WeeksSide cldWPos_{WeeksSide::HIDDEN};
|
||||
/*
|
||||
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_;
|
||||
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::year_month_day& today, const date::year_month_day& ymd,
|
||||
const date::time_zone* tz) -> const std::string;
|
||||
/*Clock actions*/
|
||||
void cldModeSwitch();
|
||||
void cldShift_up();
|
||||
void cldShift_down();
|
||||
void tz_up();
|
||||
void tz_down();
|
||||
|
||||
// ModuleActionMap
|
||||
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},
|
||||
{"shift_down", &waybar::modules::Clock::cldShift_down},
|
||||
{"tz_up", &waybar::modules::Clock::tz_up},
|
||||
{"tz_down", &waybar::modules::Clock::tz_down}};
|
||||
};
|
||||
} // namespace modules
|
||||
} // namespace waybar
|
||||
} // namespace waybar::modules
|
||||
|
||||
@@ -17,16 +17,10 @@ namespace waybar::modules {
|
||||
class Cpu : public ALabel {
|
||||
public:
|
||||
Cpu(const std::string&, const Json::Value&);
|
||||
~Cpu() = default;
|
||||
auto update() -> void;
|
||||
virtual ~Cpu() = default;
|
||||
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
|
||||
@@ -15,18 +15,19 @@ namespace waybar::modules {
|
||||
class Custom : public ALabel {
|
||||
public:
|
||||
Custom(const std::string&, const std::string&, const Json::Value&);
|
||||
~Custom();
|
||||
auto update() -> void;
|
||||
void refresh(int /*signal*/);
|
||||
virtual ~Custom();
|
||||
auto update() -> void override;
|
||||
void refresh(int /*signal*/) override;
|
||||
|
||||
private:
|
||||
void delayWorker();
|
||||
void continuousWorker();
|
||||
void waitingWorker();
|
||||
void parseOutputRaw();
|
||||
void parseOutputJson();
|
||||
void handleEvent();
|
||||
bool handleScroll(GdkEventScroll* e);
|
||||
bool handleToggle(GdkEventButton* const& e);
|
||||
bool handleScroll(GdkEventScroll* e) override;
|
||||
bool handleToggle(GdkEventButton* const& e) override;
|
||||
|
||||
const std::string name_;
|
||||
std::string text_;
|
||||
|
||||
@@ -14,12 +14,15 @@ namespace waybar::modules {
|
||||
class Disk : public ALabel {
|
||||
public:
|
||||
Disk(const std::string&, const Json::Value&);
|
||||
~Disk() = default;
|
||||
auto update() -> void;
|
||||
virtual ~Disk() = default;
|
||||
auto update() -> void override;
|
||||
|
||||
private:
|
||||
util::SleeperThread thread_;
|
||||
std::string path_;
|
||||
std::string unit_;
|
||||
|
||||
float calc_specific_divisor(const std::string divisor);
|
||||
};
|
||||
|
||||
} // namespace waybar::modules
|
||||
|
||||
34
include/modules/dwl/tags.hpp
Normal file
34
include/modules/dwl/tags.hpp
Normal file
@@ -0,0 +1,34 @@
|
||||
#pragma once
|
||||
|
||||
#include <gtkmm/button.h>
|
||||
#include <wayland-client.h>
|
||||
|
||||
#include "AModule.hpp"
|
||||
#include "bar.hpp"
|
||||
#include "dwl-ipc-unstable-v2-client-protocol.h"
|
||||
#include "xdg-output-unstable-v1-client-protocol.h"
|
||||
|
||||
namespace waybar::modules::dwl {
|
||||
|
||||
class Tags : public waybar::AModule {
|
||||
public:
|
||||
Tags(const std::string &, const waybar::Bar &, const Json::Value &);
|
||||
virtual ~Tags();
|
||||
|
||||
// Handlers for wayland events
|
||||
void handle_view_tags(uint32_t tag, uint32_t state, uint32_t clients, uint32_t focused);
|
||||
|
||||
void handle_primary_clicked(uint32_t tag);
|
||||
bool handle_button_press(GdkEventButton *event_button, uint32_t tag);
|
||||
|
||||
struct zdwl_ipc_manager_v2 *status_manager_;
|
||||
struct wl_seat *seat_;
|
||||
|
||||
private:
|
||||
const waybar::Bar &bar_;
|
||||
Gtk::Box box_;
|
||||
std::vector<Gtk::Button> buttons_;
|
||||
struct zdwl_ipc_output_v2 *output_status_;
|
||||
};
|
||||
|
||||
} /* namespace waybar::modules::dwl */
|
||||
@@ -18,8 +18,8 @@ namespace waybar::modules {
|
||||
class Gamemode : public AModule {
|
||||
public:
|
||||
Gamemode(const std::string &, const Json::Value &);
|
||||
~Gamemode();
|
||||
auto update() -> void;
|
||||
virtual ~Gamemode();
|
||||
auto update() -> void override;
|
||||
|
||||
private:
|
||||
const std::string DEFAULT_ICON_NAME = "input-gaming-symbolic";
|
||||
@@ -39,7 +39,7 @@ class Gamemode : public AModule {
|
||||
const Glib::VariantContainerBase &arguments);
|
||||
|
||||
void getData();
|
||||
bool handleToggle(GdkEventButton *const &);
|
||||
bool handleToggle(GdkEventButton *const &) override;
|
||||
|
||||
// Config
|
||||
std::string format = DEFAULT_FORMAT;
|
||||
|
||||
@@ -1,10 +1,14 @@
|
||||
#pragma once
|
||||
|
||||
#include <functional>
|
||||
#include <list>
|
||||
#include <memory>
|
||||
#include <mutex>
|
||||
#include <string>
|
||||
#include <thread>
|
||||
#include <utility>
|
||||
|
||||
#include "util/json.hpp"
|
||||
|
||||
namespace waybar::modules::hyprland {
|
||||
|
||||
@@ -22,12 +26,14 @@ class IPC {
|
||||
void unregisterForIPC(EventHandler*);
|
||||
|
||||
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;
|
||||
util::JsonParser parser_;
|
||||
std::list<std::pair<std::string, EventHandler*>> callbacks;
|
||||
};
|
||||
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
#pragma once
|
||||
|
||||
#include <fmt/format.h>
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "ALabel.hpp"
|
||||
#include "bar.hpp"
|
||||
#include "modules/hyprland/backend.hpp"
|
||||
@@ -10,20 +14,29 @@ namespace waybar::modules::hyprland {
|
||||
class Language : public waybar::ALabel, public EventHandler {
|
||||
public:
|
||||
Language(const std::string&, const waybar::Bar&, const Json::Value&);
|
||||
~Language();
|
||||
virtual ~Language();
|
||||
|
||||
auto update() -> void;
|
||||
auto update() -> void override;
|
||||
|
||||
private:
|
||||
void onEvent(const std::string&);
|
||||
void onEvent(const std::string&) override;
|
||||
|
||||
void initLanguage();
|
||||
std::string getShortFrom(const std::string&);
|
||||
|
||||
struct Layout {
|
||||
std::string full_name;
|
||||
std::string short_name;
|
||||
std::string variant;
|
||||
std::string short_description;
|
||||
};
|
||||
|
||||
auto getLayout(const std::string&) -> Layout;
|
||||
|
||||
std::mutex mutex_;
|
||||
const Bar& bar_;
|
||||
util::JsonParser parser_;
|
||||
std::string layoutName_;
|
||||
|
||||
Layout layout_;
|
||||
};
|
||||
|
||||
} // namespace waybar::modules::hyprland
|
||||
|
||||
@@ -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&);
|
||||
~Submap();
|
||||
virtual ~Submap();
|
||||
|
||||
auto update() -> void;
|
||||
auto update() -> void override;
|
||||
|
||||
private:
|
||||
void onEvent(const std::string&);
|
||||
void onEvent(const std::string&) override;
|
||||
|
||||
std::mutex mutex_;
|
||||
const Bar& bar_;
|
||||
|
||||
@@ -1,31 +1,64 @@
|
||||
#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&);
|
||||
~Window();
|
||||
~Window() override;
|
||||
|
||||
auto update() -> void;
|
||||
auto update() -> void override;
|
||||
|
||||
private:
|
||||
int getActiveWorkspaceID(std::string);
|
||||
std::string getLastWindowTitle(int);
|
||||
void onEvent(const std::string&);
|
||||
struct Workspace {
|
||||
int id;
|
||||
int windows;
|
||||
std::string last_window;
|
||||
std::string last_window_title;
|
||||
|
||||
static auto parse(const Json::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;
|
||||
};
|
||||
|
||||
auto getActiveWorkspace(const std::string&) -> Workspace;
|
||||
auto getActiveWorkspace() -> Workspace;
|
||||
void onEvent(const std::string&) override;
|
||||
void queryActiveWorkspace();
|
||||
void setClass(const std::string&, bool enable);
|
||||
|
||||
bool separate_outputs;
|
||||
std::mutex mutex_;
|
||||
const Bar& bar_;
|
||||
util::JsonParser parser_;
|
||||
std::string lastView;
|
||||
WindowData window_data_;
|
||||
Workspace workspace_;
|
||||
std::string solo_class_;
|
||||
std::string last_solo_class_;
|
||||
bool solo_;
|
||||
bool all_floating_;
|
||||
bool swallowing_;
|
||||
bool fullscreen_;
|
||||
};
|
||||
|
||||
} // namespace waybar::modules::hyprland
|
||||
|
||||
203
include/modules/hyprland/workspaces.hpp
Normal file
203
include/modules/hyprland/workspaces.hpp
Normal file
@@ -0,0 +1,203 @@
|
||||
#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 increment_time_spent_uncreated();
|
||||
bool is_empty(Workspaces& workspace_manager);
|
||||
bool repr_is_ready() const { return std::holds_alternative<Repr>(window_); }
|
||||
std::string repr(Workspaces& workspace_manager);
|
||||
|
||||
std::string workspace_name() const { return workspace_name_; }
|
||||
WindowAddress addr() const { return window_address_; }
|
||||
|
||||
void move_to_worksace(std::string& new_workspace_name);
|
||||
|
||||
private:
|
||||
void clear_addr();
|
||||
void clear_workspace_name();
|
||||
|
||||
using Repr = std::string;
|
||||
using ClassAndTitle = std::pair<std::string, std::string>;
|
||||
std::variant<Repr, ClassAndTitle> window_;
|
||||
|
||||
WindowAddress window_address_;
|
||||
std::string workspace_name_;
|
||||
|
||||
int time_spent_uncreated_ = 0;
|
||||
};
|
||||
|
||||
class Workspace {
|
||||
public:
|
||||
explicit Workspace(const Json::Value& workspace_data, Workspaces& workspace_manager,
|
||||
const Json::Value& clients_data = Json::Value::nullRef);
|
||||
std::string& select_icon(std::map<std::string, std::string>& icons_map);
|
||||
Gtk::Button& button() { return button_; };
|
||||
|
||||
int id() const { return id_; };
|
||||
std::string name() const { return name_; };
|
||||
std::string output() const { return output_; };
|
||||
bool active() const { return active_; };
|
||||
bool is_special() const { return is_special_; };
|
||||
bool is_persistent() const { return is_persistent_; };
|
||||
bool is_visible() const { return is_visible_; };
|
||||
bool is_empty() const { return windows_ == 0; };
|
||||
bool is_urgent() const { return is_urgent_; };
|
||||
|
||||
bool handle_clicked(GdkEventButton* bt) const;
|
||||
void set_active(bool value = true) { active_ = value; };
|
||||
void set_persistent(bool value = true) { is_persistent_ = value; };
|
||||
void set_urgent(bool value = true) { is_urgent_ = value; };
|
||||
void set_visible(bool value = true) { is_visible_ = value; };
|
||||
void set_windows(uint value) { windows_ = value; };
|
||||
void set_name(std::string const& value) { name_ = value; };
|
||||
bool contains_window(WindowAddress const& addr) const { return window_map_.contains(addr); }
|
||||
void insert_window(WindowCreationPayload create_window_paylod);
|
||||
std::string remove_window(WindowAddress const& addr);
|
||||
void initialize_window_map(const Json::Value& clients_data);
|
||||
|
||||
bool on_window_opened(WindowCreationPayload const& create_window_paylod);
|
||||
std::optional<std::string> close_window(WindowAddress const& addr);
|
||||
|
||||
void update(const std::string& format, const std::string& icon);
|
||||
|
||||
private:
|
||||
Workspaces& workspace_manager_;
|
||||
|
||||
int id_;
|
||||
std::string name_;
|
||||
std::string output_;
|
||||
uint windows_;
|
||||
bool active_ = false;
|
||||
bool is_special_ = false;
|
||||
bool is_persistent_ = false;
|
||||
bool is_urgent_ = false;
|
||||
bool is_visible_ = false;
|
||||
|
||||
std::map<WindowAddress, std::string> window_map_;
|
||||
|
||||
Gtk::Button button_;
|
||||
Gtk::Box content_;
|
||||
Gtk::Label 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 all_outputs() const -> bool { return all_outputs_; }
|
||||
auto show_special() const -> bool { return show_special_; }
|
||||
auto active_only() const -> bool { return active_only_; }
|
||||
|
||||
auto get_bar_output() const -> std::string { return bar_.output->name; }
|
||||
|
||||
std::string get_rewrite(std::string window_class, std::string window_title);
|
||||
std::string& get_window_separator() { return format_window_separator_; }
|
||||
bool is_workspace_ignored(std::string const& workspace_name);
|
||||
|
||||
bool window_rewrite_config_uses_title() const { return any_window_rewrite_rule_uses_title_; }
|
||||
|
||||
private:
|
||||
void onEvent(const std::string& e) override;
|
||||
void update_window_count();
|
||||
void sort_workspaces();
|
||||
void create_workspace(Json::Value const& workspace_data,
|
||||
Json::Value const& clients_data = Json::Value::nullRef);
|
||||
void remove_workspace(std::string const& name);
|
||||
void set_urgent_workspace(std::string const& windowaddress);
|
||||
void parse_config(const Json::Value& config);
|
||||
void register_ipc();
|
||||
|
||||
// workspace events
|
||||
void on_workspace_activated(std::string const& payload);
|
||||
void on_workspace_destroyed(std::string const& payload);
|
||||
void on_workspace_created(std::string const& payload);
|
||||
void on_workspace_moved(std::string const& payload);
|
||||
void on_workspace_renamed(std::string const& payload);
|
||||
|
||||
// monitor events
|
||||
void on_monitor_focused(std::string const& payload);
|
||||
|
||||
// window events
|
||||
void on_window_opened(std::string const& payload);
|
||||
void on_window_closed(std::string const& payload);
|
||||
void on_window_moved(std::string const& payload);
|
||||
|
||||
void on_window_title_event(std::string const& payload);
|
||||
|
||||
int window_rewrite_priority_function(std::string const& window_rule);
|
||||
|
||||
bool all_outputs_ = false;
|
||||
bool show_special_ = false;
|
||||
bool active_only_ = false;
|
||||
|
||||
enum class SORT_METHOD { ID, NAME, NUMBER, DEFAULT };
|
||||
util::EnumParser<SORT_METHOD> enum_parser_;
|
||||
SORT_METHOD sort_by_ = SORT_METHOD::DEFAULT;
|
||||
std::map<std::string, SORT_METHOD> sort_map_ = {{"ID", SORT_METHOD::ID},
|
||||
{"NAME", SORT_METHOD::NAME},
|
||||
{"NUMBER", SORT_METHOD::NUMBER},
|
||||
{"DEFAULT", SORT_METHOD::DEFAULT}};
|
||||
|
||||
void fill_persistent_workspaces();
|
||||
void create_persistent_workspaces();
|
||||
std::vector<std::string> persistent_workspaces_to_create_;
|
||||
bool persistent_created_ = false;
|
||||
|
||||
std::string format_;
|
||||
|
||||
std::map<std::string, std::string> icons_map_;
|
||||
util::RegexCollection window_rewrite_rules_;
|
||||
bool any_window_rewrite_rule_uses_title_ = false;
|
||||
std::string format_window_separator_;
|
||||
|
||||
bool with_icon_;
|
||||
uint64_t monitor_id_;
|
||||
std::string active_workspace_name_;
|
||||
std::vector<std::unique_ptr<Workspace>> workspaces_;
|
||||
std::vector<Json::Value> workspaces_to_create_;
|
||||
std::vector<std::string> workspaces_to_remove_;
|
||||
std::vector<WindowCreationPayload> windows_to_create_;
|
||||
|
||||
std::vector<std::regex> ignore_workspaces_;
|
||||
|
||||
std::mutex mutex_;
|
||||
const Bar& bar_;
|
||||
Gtk::Box box_;
|
||||
};
|
||||
|
||||
} // namespace waybar::modules::hyprland
|
||||
@@ -13,13 +13,13 @@ class IdleInhibitor : public ALabel {
|
||||
|
||||
public:
|
||||
IdleInhibitor(const std::string&, const waybar::Bar&, const Json::Value&);
|
||||
~IdleInhibitor();
|
||||
auto update() -> void;
|
||||
virtual ~IdleInhibitor();
|
||||
auto update() -> void override;
|
||||
static std::list<waybar::AModule*> modules;
|
||||
static bool status;
|
||||
|
||||
private:
|
||||
bool handleToggle(GdkEventButton* const& e);
|
||||
bool handleToggle(GdkEventButton* const& e) override;
|
||||
void toggleStatus();
|
||||
|
||||
const Bar& bar_;
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
#include <string>
|
||||
|
||||
#include "ALabel.hpp"
|
||||
#include "gtkmm/box.h"
|
||||
#include "util/command.hpp"
|
||||
#include "util/json.hpp"
|
||||
#include "util/sleeper_thread.hpp"
|
||||
@@ -15,18 +16,23 @@ namespace waybar::modules {
|
||||
|
||||
class Image : public AModule {
|
||||
public:
|
||||
Image(const std::string&, const std::string&, const Json::Value&);
|
||||
auto update() -> void;
|
||||
void refresh(int /*signal*/);
|
||||
Image(const std::string&, const Json::Value&);
|
||||
virtual ~Image() = default;
|
||||
auto update() -> void override;
|
||||
void refresh(int /*signal*/) override;
|
||||
|
||||
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_;
|
||||
};
|
||||
|
||||
@@ -12,12 +12,12 @@ namespace waybar::modules {
|
||||
class Inhibitor : public ALabel {
|
||||
public:
|
||||
Inhibitor(const std::string&, const waybar::Bar&, const Json::Value&);
|
||||
~Inhibitor() override;
|
||||
auto update() -> void;
|
||||
virtual ~Inhibitor();
|
||||
auto update() -> void override;
|
||||
auto activated() -> bool;
|
||||
|
||||
private:
|
||||
auto handleToggle(::GdkEventButton* const& e) -> bool;
|
||||
auto handleToggle(::GdkEventButton* const& e) -> bool override;
|
||||
|
||||
const std::unique_ptr<::GDBusConnection, void (*)(::GDBusConnection*)> dbus_;
|
||||
const std::string inhibitors_;
|
||||
|
||||
@@ -14,8 +14,8 @@ namespace waybar::modules {
|
||||
class JACK : public ALabel {
|
||||
public:
|
||||
JACK(const std::string &, const Json::Value &);
|
||||
~JACK() = default;
|
||||
auto update() -> void;
|
||||
virtual ~JACK() = default;
|
||||
auto update() -> void override;
|
||||
|
||||
int bufSize(jack_nframes_t size);
|
||||
int sampleRate(jack_nframes_t rate);
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
#include <fmt/chrono.h>
|
||||
#include <gtkmm/label.h>
|
||||
|
||||
#include <set>
|
||||
#include <unordered_map>
|
||||
|
||||
#include "AModule.hpp"
|
||||
@@ -19,8 +20,8 @@ namespace waybar::modules {
|
||||
class KeyboardState : public AModule {
|
||||
public:
|
||||
KeyboardState(const std::string&, const waybar::Bar&, const Json::Value&);
|
||||
~KeyboardState();
|
||||
auto update() -> void;
|
||||
virtual ~KeyboardState();
|
||||
auto update() -> void override;
|
||||
|
||||
private:
|
||||
auto tryAddDevice(const std::string&) -> void;
|
||||
@@ -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
|
||||
@@ -13,8 +13,8 @@ namespace waybar::modules {
|
||||
class Memory : public ALabel {
|
||||
public:
|
||||
Memory(const std::string&, const Json::Value&);
|
||||
~Memory() = default;
|
||||
auto update() -> void;
|
||||
virtual ~Memory() = default;
|
||||
auto update() -> void override;
|
||||
|
||||
private:
|
||||
void parseMeminfo();
|
||||
|
||||
@@ -37,7 +37,7 @@ class MPD : public ALabel {
|
||||
public:
|
||||
MPD(const std::string&, const Json::Value&);
|
||||
virtual ~MPD() noexcept = default;
|
||||
auto update() -> void;
|
||||
auto update() -> void override;
|
||||
|
||||
private:
|
||||
std::string getTag(mpd_tag_type type, unsigned idx = 0) const;
|
||||
|
||||
@@ -16,12 +16,12 @@ extern "C" {
|
||||
|
||||
namespace waybar::modules::mpris {
|
||||
|
||||
class Mpris : public AModule {
|
||||
class Mpris : public ALabel {
|
||||
public:
|
||||
Mpris(const std::string&, const Json::Value&);
|
||||
~Mpris();
|
||||
auto update() -> void;
|
||||
bool handleToggle(GdkEventButton* const&);
|
||||
virtual ~Mpris();
|
||||
auto update() -> void override;
|
||||
bool handleToggle(GdkEventButton* const&) override;
|
||||
|
||||
private:
|
||||
static auto onPlayerNameAppeared(PlayerctlPlayerManager*, PlayerctlPlayerName*, gpointer) -> void;
|
||||
@@ -39,21 +39,40 @@ class Mpris : public AModule {
|
||||
std::optional<std::string> artist;
|
||||
std::optional<std::string> album;
|
||||
std::optional<std::string> title;
|
||||
std::optional<std::string> length; // as HH:MM:SS
|
||||
std::optional<std::string> length; // as HH:MM:SS
|
||||
std::optional<std::string> position; // same format
|
||||
};
|
||||
|
||||
auto getPlayerInfo() -> std::optional<PlayerInfo>;
|
||||
auto getIcon(const Json::Value&, const std::string&) -> std::string;
|
||||
|
||||
Gtk::Box box_;
|
||||
Gtk::Label label_;
|
||||
auto getIconFromJson(const Json::Value&, const std::string&) -> std::string;
|
||||
auto getArtistStr(const PlayerInfo&, bool) -> std::string;
|
||||
auto getAlbumStr(const PlayerInfo&, bool) -> std::string;
|
||||
auto getTitleStr(const PlayerInfo&, bool) -> std::string;
|
||||
auto getLengthStr(const PlayerInfo&, bool) -> std::string;
|
||||
auto getPositionStr(const PlayerInfo&, bool) -> std::string;
|
||||
auto getDynamicStr(const PlayerInfo&, bool, bool) -> std::string;
|
||||
|
||||
// config
|
||||
std::string format_;
|
||||
std::string format_playing_;
|
||||
std::string format_paused_;
|
||||
std::string format_stopped_;
|
||||
std::chrono::seconds interval_;
|
||||
|
||||
std::string tooltip_;
|
||||
std::string tooltip_playing_;
|
||||
std::string tooltip_paused_;
|
||||
std::string tooltip_stopped_;
|
||||
|
||||
int artist_len_;
|
||||
int album_len_;
|
||||
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_;
|
||||
|
||||
std::string player_;
|
||||
std::vector<std::string> ignored_players_;
|
||||
|
||||
@@ -63,6 +82,7 @@ class Mpris : public AModule {
|
||||
std::string lastPlayer;
|
||||
|
||||
util::SleeperThread thread_;
|
||||
std::chrono::time_point<std::chrono::system_clock> last_update_;
|
||||
};
|
||||
|
||||
} // namespace waybar::modules::mpris
|
||||
|
||||
@@ -21,8 +21,8 @@ namespace waybar::modules {
|
||||
class Network : public ALabel {
|
||||
public:
|
||||
Network(const std::string&, const Json::Value&);
|
||||
~Network();
|
||||
auto update() -> void;
|
||||
virtual ~Network();
|
||||
auto update() -> void override;
|
||||
|
||||
private:
|
||||
static const uint8_t MAX_RETRY = 5;
|
||||
@@ -62,6 +62,7 @@ class Network : public ALabel {
|
||||
bool want_link_dump_;
|
||||
bool want_addr_dump_;
|
||||
bool dump_in_progress_;
|
||||
bool is_p2p_;
|
||||
|
||||
unsigned long long bandwidth_down_total_;
|
||||
unsigned long long bandwidth_up_total_;
|
||||
@@ -77,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_;
|
||||
@@ -85,6 +85,7 @@ class Network : public ALabel {
|
||||
#ifdef WANT_RFKILL
|
||||
util::Rfkill rfkill_;
|
||||
#endif
|
||||
float frequency_;
|
||||
};
|
||||
|
||||
} // namespace waybar::modules
|
||||
|
||||
@@ -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&);
|
||||
~Pulseaudio();
|
||||
auto update() -> void;
|
||||
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);
|
||||
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
|
||||
33
include/modules/river/layout.hpp
Normal file
33
include/modules/river/layout.hpp
Normal file
@@ -0,0 +1,33 @@
|
||||
#pragma once
|
||||
|
||||
#include <wayland-client.h>
|
||||
|
||||
#include "ALabel.hpp"
|
||||
#include "bar.hpp"
|
||||
#include "river-status-unstable-v1-client-protocol.h"
|
||||
|
||||
namespace waybar::modules::river {
|
||||
|
||||
class Layout : public waybar::ALabel {
|
||||
public:
|
||||
Layout(const std::string &, const waybar::Bar &, const Json::Value &);
|
||||
virtual ~Layout();
|
||||
|
||||
// Handlers for wayland events
|
||||
void handle_name(const char *name);
|
||||
void handle_clear();
|
||||
void handle_focused_output(struct wl_output *output);
|
||||
void handle_unfocused_output(struct wl_output *output);
|
||||
|
||||
struct zriver_status_manager_v1 *status_manager_;
|
||||
struct wl_seat *seat_;
|
||||
|
||||
private:
|
||||
const waybar::Bar &bar_;
|
||||
struct wl_output *output_; // stores the output this module belongs to
|
||||
struct wl_output *focused_output_; // stores the currently focused output
|
||||
struct zriver_output_status_v1 *output_status_;
|
||||
struct zriver_seat_status_v1 *seat_status_;
|
||||
};
|
||||
|
||||
} /* namespace waybar::modules::river */
|
||||
@@ -11,7 +11,7 @@ namespace waybar::modules::river {
|
||||
class Mode : public waybar::ALabel {
|
||||
public:
|
||||
Mode(const std::string &, const waybar::Bar &, const Json::Value &);
|
||||
~Mode();
|
||||
virtual ~Mode();
|
||||
|
||||
// Handlers for wayland events
|
||||
void handle_mode(const char *mode);
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace waybar::modules::river {
|
||||
class Tags : public waybar::AModule {
|
||||
public:
|
||||
Tags(const std::string &, const waybar::Bar &, const Json::Value &);
|
||||
~Tags();
|
||||
virtual ~Tags();
|
||||
|
||||
// Handlers for wayland events
|
||||
void handle_focused_tags(uint32_t tags);
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace waybar::modules::river {
|
||||
class Window : public waybar::ALabel {
|
||||
public:
|
||||
Window(const std::string &, const waybar::Bar &, const Json::Value &);
|
||||
~Window();
|
||||
virtual ~Window();
|
||||
|
||||
// Handlers for wayland events
|
||||
void handle_focused_view(const char *title);
|
||||
|
||||
@@ -10,8 +10,8 @@ namespace waybar::modules {
|
||||
class Clock : public ALabel {
|
||||
public:
|
||||
Clock(const std::string&, const Json::Value&);
|
||||
~Clock() = default;
|
||||
auto update() -> void;
|
||||
virtual ~Clock() = default;
|
||||
auto update() -> void override;
|
||||
|
||||
private:
|
||||
util::SleeperThread thread_;
|
||||
|
||||
@@ -12,12 +12,12 @@ namespace waybar::modules {
|
||||
class Sndio : public ALabel {
|
||||
public:
|
||||
Sndio(const std::string &, const Json::Value &);
|
||||
~Sndio();
|
||||
auto update() -> void;
|
||||
virtual ~Sndio();
|
||||
auto update() -> void override;
|
||||
auto set_desc(struct sioctl_desc *, unsigned int) -> void;
|
||||
auto put_val(unsigned int, unsigned int) -> void;
|
||||
bool handleScroll(GdkEventScroll *);
|
||||
bool handleToggle(GdkEventButton *const &);
|
||||
bool handleScroll(GdkEventScroll *) override;
|
||||
bool handleToggle(GdkEventButton *const &) override;
|
||||
|
||||
private:
|
||||
auto connect_to_sndio() -> void;
|
||||
|
||||
@@ -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_;
|
||||
|
||||
@@ -13,8 +13,8 @@ namespace waybar::modules::SNI {
|
||||
class Tray : public AModule {
|
||||
public:
|
||||
Tray(const std::string&, const Bar&, const Json::Value&);
|
||||
~Tray() = default;
|
||||
auto update() -> void;
|
||||
virtual ~Tray() = default;
|
||||
auto update() -> void override;
|
||||
|
||||
private:
|
||||
void onAdd(std::unique_ptr<Item>& item);
|
||||
|
||||
@@ -8,6 +8,8 @@
|
||||
#include <cstring>
|
||||
#include <memory>
|
||||
#include <mutex>
|
||||
#include <stdexcept>
|
||||
#include <string>
|
||||
|
||||
#include "ipc.hpp"
|
||||
#include "util/sleeper_thread.hpp"
|
||||
|
||||
@@ -17,8 +17,8 @@ namespace waybar::modules::sway {
|
||||
class Language : public ALabel, public sigc::trackable {
|
||||
public:
|
||||
Language(const std::string& id, const Json::Value& config);
|
||||
~Language() = default;
|
||||
auto update() -> void;
|
||||
virtual ~Language() = default;
|
||||
auto update() -> void override;
|
||||
|
||||
private:
|
||||
enum class DispayedShortFlag { None = 0, ShortName = 1, ShortDescription = 1 << 1 };
|
||||
|
||||
@@ -13,8 +13,8 @@ namespace waybar::modules::sway {
|
||||
class Mode : public ALabel, public sigc::trackable {
|
||||
public:
|
||||
Mode(const std::string&, const Json::Value&);
|
||||
~Mode() = default;
|
||||
auto update() -> void;
|
||||
virtual ~Mode() = default;
|
||||
auto update() -> void override;
|
||||
|
||||
private:
|
||||
void onEvent(const struct Ipc::ipc_response&);
|
||||
|
||||
@@ -15,8 +15,8 @@ namespace waybar::modules::sway {
|
||||
class Scratchpad : public ALabel {
|
||||
public:
|
||||
Scratchpad(const std::string&, const Json::Value&);
|
||||
~Scratchpad() = default;
|
||||
auto update() -> void;
|
||||
virtual ~Scratchpad() = default;
|
||||
auto update() -> void override;
|
||||
|
||||
private:
|
||||
auto getTree() -> void;
|
||||
@@ -32,4 +32,4 @@ class Scratchpad : public ALabel {
|
||||
Ipc ipc_;
|
||||
util::JsonParser parser_;
|
||||
};
|
||||
} // namespace waybar::modules::sway
|
||||
} // namespace waybar::modules::sway
|
||||
|
||||
@@ -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,32 +12,30 @@
|
||||
|
||||
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&);
|
||||
~Window() = default;
|
||||
auto update() -> void;
|
||||
virtual ~Window() = default;
|
||||
auto update() -> void override;
|
||||
|
||||
private:
|
||||
void setClass(std::string classname, bool enable);
|
||||
void onEvent(const struct Ipc::ipc_response&);
|
||||
void onCmd(const struct Ipc::ipc_response&);
|
||||
std::tuple<std::size_t, int, std::string, std::string, std::string, std::string> getFocusedNode(
|
||||
const Json::Value& nodes, std::string& output);
|
||||
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_;
|
||||
int windowId_;
|
||||
std::string app_id_;
|
||||
std::string app_class_;
|
||||
std::string layout_;
|
||||
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_;
|
||||
Ipc ipc_;
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
#include <gtkmm/button.h>
|
||||
#include <gtkmm/label.h>
|
||||
|
||||
#include <string_view>
|
||||
#include <unordered_map>
|
||||
|
||||
#include "AModule.hpp"
|
||||
@@ -17,11 +18,13 @@ namespace waybar::modules::sway {
|
||||
class Workspaces : public AModule, public sigc::trackable {
|
||||
public:
|
||||
Workspaces(const std::string&, const waybar::Bar&, const Json::Value&);
|
||||
~Workspaces() = default;
|
||||
auto update() -> void;
|
||||
virtual ~Workspaces() = default;
|
||||
auto update() -> void override;
|
||||
|
||||
private:
|
||||
static inline const std::string workspace_switch_cmd_ = "workspace {} \"{}\"";
|
||||
static constexpr std::string_view workspace_switch_cmd_ = "workspace {} \"{}\"";
|
||||
static constexpr std::string_view persistent_workspace_switch_cmd_ =
|
||||
R"(workspace {} "{}"; move workspace to output "{}"; workspace {} "{}")";
|
||||
|
||||
static int convertWorkspaceNameToNum(std::string name);
|
||||
|
||||
@@ -34,10 +37,11 @@ class Workspaces : public AModule, public sigc::trackable {
|
||||
const std::string getCycleWorkspace(std::vector<Json::Value>::iterator, bool prev) const;
|
||||
uint16_t getWorkspaceIndex(const std::string& name) const;
|
||||
std::string trimWorkspaceName(std::string);
|
||||
bool handleScroll(GdkEventScroll*);
|
||||
bool handleScroll(GdkEventScroll*) override;
|
||||
|
||||
const Bar& bar_;
|
||||
std::vector<Json::Value> workspaces_;
|
||||
std::vector<std::string> high_priority_named_;
|
||||
std::vector<std::string> workspaces_order_;
|
||||
Gtk::Box box_;
|
||||
util::JsonParser parser_;
|
||||
|
||||
@@ -12,8 +12,8 @@ namespace waybar::modules {
|
||||
class Temperature : public ALabel {
|
||||
public:
|
||||
Temperature(const std::string&, const Json::Value&);
|
||||
~Temperature() = default;
|
||||
auto update() -> void;
|
||||
virtual ~Temperature() = default;
|
||||
auto update() -> void override;
|
||||
|
||||
private:
|
||||
float getTemperature();
|
||||
|
||||
@@ -19,8 +19,8 @@ namespace waybar::modules::upower {
|
||||
class UPower : public AModule {
|
||||
public:
|
||||
UPower(const std::string &, const Json::Value &);
|
||||
~UPower();
|
||||
auto update() -> void;
|
||||
virtual ~UPower();
|
||||
auto update() -> void override;
|
||||
|
||||
private:
|
||||
typedef std::unordered_map<std::string, UpDevice *> Devices;
|
||||
@@ -45,7 +45,7 @@ class UPower : public AModule {
|
||||
void resetDevices();
|
||||
void removeDevices();
|
||||
bool show_tooltip_callback(int, int, bool, const Glib::RefPtr<Gtk::Tooltip> &tooltip);
|
||||
bool handleToggle(GdkEventButton *const &);
|
||||
bool handleToggle(GdkEventButton *const &) override;
|
||||
std::string timeToString(gint64 time);
|
||||
|
||||
const std::string getDeviceStatus(UpDeviceState &state);
|
||||
@@ -69,11 +69,12 @@ class UPower : public AModule {
|
||||
UpDevice *displayDevice;
|
||||
guint login1_id;
|
||||
GDBusConnection *login1_connection;
|
||||
UPowerTooltip *upower_tooltip;
|
||||
std::unique_ptr<UPowerTooltip> upower_tooltip;
|
||||
std::string lastStatus;
|
||||
bool showAltText;
|
||||
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;
|
||||
@@ -24,7 +25,7 @@ class UPowerTooltip : public Gtk::Window {
|
||||
|
||||
public:
|
||||
UPowerTooltip(uint iconSize, uint tooltipSpacing, uint tooltipPadding);
|
||||
~UPowerTooltip();
|
||||
virtual ~UPowerTooltip();
|
||||
|
||||
uint updateTooltip(Devices& devices);
|
||||
};
|
||||
|
||||
@@ -11,8 +11,8 @@ namespace waybar::modules {
|
||||
class User : public AIconLabel {
|
||||
public:
|
||||
User(const std::string&, const Json::Value&);
|
||||
~User() = default;
|
||||
auto update() -> void;
|
||||
virtual ~User() = default;
|
||||
auto update() -> void override;
|
||||
|
||||
bool handleToggle(GdkEventButton* const& e) override;
|
||||
|
||||
|
||||
@@ -13,25 +13,32 @@ namespace waybar::modules {
|
||||
class Wireplumber : public ALabel {
|
||||
public:
|
||||
Wireplumber(const std::string&, const Json::Value&);
|
||||
~Wireplumber();
|
||||
auto update() -> void;
|
||||
virtual ~Wireplumber();
|
||||
auto update() -> void override;
|
||||
|
||||
private:
|
||||
void loadRequiredApiModules();
|
||||
void prepare();
|
||||
void activatePlugins();
|
||||
static void updateVolume(waybar::modules::Wireplumber* self);
|
||||
static void updateNodeName(waybar::modules::Wireplumber* self);
|
||||
static uint32_t getDefaultNodeId(waybar::modules::Wireplumber* self);
|
||||
static void updateVolume(waybar::modules::Wireplumber* self, uint32_t id);
|
||||
static void updateNodeName(waybar::modules::Wireplumber* self, uint32_t id);
|
||||
static void onPluginActivated(WpObject* p, GAsyncResult* res, waybar::modules::Wireplumber* self);
|
||||
static void onObjectManagerInstalled(waybar::modules::Wireplumber* self);
|
||||
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_;
|
||||
WpPlugin* mixer_api_;
|
||||
WpPlugin* def_nodes_api_;
|
||||
gchar* default_node_name_;
|
||||
uint32_t pending_plugins_;
|
||||
bool muted_;
|
||||
double volume_;
|
||||
double min_step_;
|
||||
uint32_t node_id_{0};
|
||||
std::string node_name_;
|
||||
};
|
||||
|
||||
@@ -40,6 +40,8 @@ class Task {
|
||||
FULLSCREEN = (1 << 3),
|
||||
INVALID = (1 << 4)
|
||||
};
|
||||
// made public so TaskBar can reorder based on configuration.
|
||||
Gtk::Button button;
|
||||
|
||||
private:
|
||||
static uint32_t global_id;
|
||||
@@ -53,7 +55,6 @@ class Task {
|
||||
|
||||
uint32_t id_;
|
||||
|
||||
Gtk::Button button_;
|
||||
Gtk::Box content_;
|
||||
Gtk::Image icon_;
|
||||
Gtk::Label text_before_;
|
||||
|
||||
@@ -22,7 +22,7 @@ class WorkspaceGroup;
|
||||
class Workspace {
|
||||
public:
|
||||
Workspace(const waybar::Bar &bar, const Json::Value &config, WorkspaceGroup &workspace_group,
|
||||
zext_workspace_handle_v1 *workspace, uint32_t id);
|
||||
zext_workspace_handle_v1 *workspace, uint32_t id, std::string name);
|
||||
~Workspace();
|
||||
auto update() -> void;
|
||||
|
||||
@@ -30,11 +30,15 @@ class Workspace {
|
||||
auto is_active() const -> bool { return state_ & static_cast<uint32_t>(State::ACTIVE); }
|
||||
auto is_urgent() const -> bool { return state_ & static_cast<uint32_t>(State::URGENT); }
|
||||
auto is_hidden() const -> bool { return state_ & static_cast<uint32_t>(State::HIDDEN); }
|
||||
auto is_empty() const -> bool { return state_ & static_cast<uint32_t>(State::EMPTY); }
|
||||
auto is_persistent() const -> bool { return persistent_; }
|
||||
// wlr stuff
|
||||
auto handle_name(const std::string &name) -> void;
|
||||
auto handle_coordinates(const std::vector<uint32_t> &coordinates) -> void;
|
||||
auto handle_state(const std::vector<uint32_t> &state) -> void;
|
||||
auto handle_remove() -> void;
|
||||
auto make_persistent() -> void;
|
||||
auto handle_duplicate() -> void;
|
||||
|
||||
auto handle_done() -> void;
|
||||
auto handle_clicked(GdkEventButton *bt) -> bool;
|
||||
@@ -48,6 +52,7 @@ class Workspace {
|
||||
ACTIVE = (1 << 0),
|
||||
URGENT = (1 << 1),
|
||||
HIDDEN = (1 << 2),
|
||||
EMPTY = (1 << 3),
|
||||
};
|
||||
|
||||
private:
|
||||
@@ -67,6 +72,7 @@ class Workspace {
|
||||
static std::map<std::string, std::string> icons_map_;
|
||||
std::string format_;
|
||||
bool with_icon_ = false;
|
||||
bool persistent_ = false;
|
||||
|
||||
Gtk::Button button_;
|
||||
Gtk::Box content_;
|
||||
@@ -87,11 +93,14 @@ class WorkspaceGroup {
|
||||
auto active_only() const -> bool;
|
||||
auto creation_delayed() const -> bool;
|
||||
auto workspaces() -> std::vector<std::unique_ptr<Workspace>> & { return workspaces_; }
|
||||
auto persistent_workspaces() -> std::vector<std::string> & { return persistent_workspaces_; }
|
||||
|
||||
auto sort_workspaces() -> void;
|
||||
auto set_need_to_sort() -> void { need_to_sort = true; }
|
||||
auto add_button(Gtk::Button &button) -> void;
|
||||
auto remove_button(Gtk::Button &button) -> void;
|
||||
auto fill_persistent_workspaces() -> void;
|
||||
auto create_persistent_workspaces() -> void;
|
||||
|
||||
// wlr stuff
|
||||
auto handle_workspace_create(zext_workspace_handle_v1 *workspace_handle) -> void;
|
||||
@@ -115,6 +124,8 @@ class WorkspaceGroup {
|
||||
uint32_t id_;
|
||||
std::vector<std::unique_ptr<Workspace>> workspaces_;
|
||||
bool need_to_sort = false;
|
||||
std::vector<std::string> persistent_workspaces_;
|
||||
bool persistent_created_ = false;
|
||||
};
|
||||
|
||||
class WorkspaceManager : public AModule {
|
||||
|
||||
95
include/util/audio_backend.hpp
Normal file
95
include/util/audio_backend.hpp
Normal file
@@ -0,0 +1,95 @@
|
||||
#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*);
|
||||
|
||||
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
|
||||
@@ -989,7 +989,7 @@ struct Help : Opt {
|
||||
showHelpFlag = flag;
|
||||
return ParserResult::ok(ParseResultType::ShortCircuitAll);
|
||||
}) {
|
||||
static_cast<Opt &> (*this)("display usage information")["-?"]["-h"]["--help"].optional();
|
||||
static_cast<Opt &>(*this)("display usage information")["-?"]["-h"]["--help"].optional();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include <fcntl.h>
|
||||
#include <giomm.h>
|
||||
#include <spdlog/spdlog.h>
|
||||
#include <sys/wait.h>
|
||||
@@ -68,7 +69,11 @@ inline int close(FILE* fp, pid_t pid) {
|
||||
inline FILE* open(const std::string& cmd, int& pid) {
|
||||
if (cmd == "") return nullptr;
|
||||
int fd[2];
|
||||
if (pipe(fd) != 0) {
|
||||
// Open the pipe with the close-on-exec flag set, so it will not be inherited
|
||||
// by any other subprocesses launched by other threads (which could result in
|
||||
// the pipe staying open after this child dies, causing us to hang when trying
|
||||
// to read from it)
|
||||
if (pipe2(fd, O_CLOEXEC) != 0) {
|
||||
spdlog::error("Unable to pipe fd");
|
||||
return nullptr;
|
||||
}
|
||||
@@ -77,6 +82,8 @@ inline FILE* open(const std::string& cmd, int& pid) {
|
||||
|
||||
if (child_pid < 0) {
|
||||
spdlog::error("Unable to exec cmd {}, error {}", cmd.c_str(), strerror(errno));
|
||||
::close(fd[0]);
|
||||
::close(fd[1]);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@@ -105,6 +112,10 @@ inline FILE* open(const std::string& cmd, int& pid) {
|
||||
execlp("/bin/sh", "sh", "-c", cmd.c_str(), (char*)0);
|
||||
exit(0);
|
||||
} else {
|
||||
reap_mtx.lock();
|
||||
reap.push_back(child_pid);
|
||||
reap_mtx.unlock();
|
||||
|
||||
::close(fd[1]);
|
||||
}
|
||||
pid = child_pid;
|
||||
|
||||
60
include/util/date.hpp
Normal file
60
include/util/date.hpp
Normal file
@@ -0,0 +1,60 @@
|
||||
#pragma once
|
||||
|
||||
#include <fmt/format.h>
|
||||
|
||||
#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>
|
||||
#endif
|
||||
|
||||
template <typename Duration, typename TimeZonePtr>
|
||||
struct fmt::formatter<date::zoned_time<Duration, TimeZonePtr>> {
|
||||
std::string_view specs;
|
||||
|
||||
template <typename ParseContext>
|
||||
constexpr auto parse(ParseContext& ctx) -> decltype(ctx.begin()) {
|
||||
auto it = ctx.begin();
|
||||
if (it != ctx.end() && *it == ':') {
|
||||
++it;
|
||||
}
|
||||
auto end = it;
|
||||
while (end != ctx.end() && *end != '}') {
|
||||
++end;
|
||||
}
|
||||
if (end != it) {
|
||||
specs = {it, std::string_view::size_type(end - it)};
|
||||
}
|
||||
return end;
|
||||
}
|
||||
|
||||
template <typename FormatContext>
|
||||
auto format(const date::zoned_time<Duration, TimeZonePtr>& ztime, FormatContext& ctx) {
|
||||
if (ctx.locale()) {
|
||||
const auto loc = ctx.locale().template get<std::locale>();
|
||||
return fmt::format_to(ctx.out(), "{}", date::format(loc, fmt::to_string(specs), ztime));
|
||||
}
|
||||
return fmt::format_to(ctx.out(), "{}", date::format(fmt::to_string(specs), ztime));
|
||||
}
|
||||
};
|
||||
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
|
||||
@@ -66,9 +66,9 @@ struct formatter<pow_format> {
|
||||
std::string string;
|
||||
switch (spec) {
|
||||
case '>':
|
||||
return format_to(ctx.out(), "{:>{}}", fmt::format("{}", s), max_width);
|
||||
return fmt::format_to(ctx.out(), "{:>{}}", fmt::format("{}", s), max_width);
|
||||
case '<':
|
||||
return format_to(ctx.out(), "{:<{}}", fmt::format("{}", s), max_width);
|
||||
return fmt::format_to(ctx.out(), "{:<{}}", fmt::format("{}", s), max_width);
|
||||
case '=':
|
||||
format = "{coefficient:<{number_width}.1f}{padding}{prefix}{unit}";
|
||||
break;
|
||||
@@ -77,8 +77,8 @@ struct formatter<pow_format> {
|
||||
format = "{coefficient:.1f}{prefix}{unit}";
|
||||
break;
|
||||
}
|
||||
return format_to(
|
||||
ctx.out(), format, fmt::arg("coefficient", fraction),
|
||||
return fmt::format_to(
|
||||
ctx.out(), fmt::runtime(format), fmt::arg("coefficient", fraction),
|
||||
fmt::arg("number_width", number_width),
|
||||
fmt::arg("prefix", std::string() + units[pow] + ((s.binary_ && pow) ? "i" : "")),
|
||||
fmt::arg("unit", s.unit_),
|
||||
@@ -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);
|
||||
};
|
||||
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
|
||||
10
include/util/rewrite_string.hpp
Normal file
10
include/util/rewrite_string.hpp
Normal file
@@ -0,0 +1,10 @@
|
||||
#pragma once
|
||||
#include <json/json.h>
|
||||
|
||||
#include <string>
|
||||
|
||||
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
|
||||
@@ -1,8 +0,0 @@
|
||||
#pragma once
|
||||
#include <json/json.h>
|
||||
|
||||
#include <string>
|
||||
|
||||
namespace waybar::util {
|
||||
std::string rewriteTitle(const std::string&, const Json::Value&);
|
||||
}
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -1,39 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include <date/tz.h>
|
||||
#include <fmt/format.h>
|
||||
|
||||
namespace waybar {
|
||||
|
||||
struct waybar_time {
|
||||
std::locale locale;
|
||||
date::zoned_seconds ztime;
|
||||
};
|
||||
|
||||
} // namespace waybar
|
||||
|
||||
template <>
|
||||
struct fmt::formatter<waybar::waybar_time> {
|
||||
std::string_view specs;
|
||||
|
||||
template <typename ParseContext>
|
||||
constexpr auto parse(ParseContext& ctx) -> decltype(ctx.begin()) {
|
||||
auto it = ctx.begin();
|
||||
if (it != ctx.end() && *it == ':') {
|
||||
++it;
|
||||
}
|
||||
auto end = it;
|
||||
while (end != ctx.end() && *end != '}') {
|
||||
++end;
|
||||
}
|
||||
if (end != it) {
|
||||
specs = {it, std::string_view::size_type(end - it)};
|
||||
}
|
||||
return end;
|
||||
}
|
||||
|
||||
template <typename FormatContext>
|
||||
auto format(const waybar::waybar_time& t, FormatContext& ctx) {
|
||||
return format_to(ctx.out(), "{}", date::format(t.locale, fmt::to_string(specs), t.ztime));
|
||||
}
|
||||
};
|
||||
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,12 @@ 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 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 ++
|
||||
@@ -46,11 +46,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 ++
|
||||
@@ -58,23 +58,32 @@ The *backlight* module displays the current backlight level.
|
||||
|
||||
*on-scroll-up*: ++
|
||||
typeof: string ++
|
||||
Command to execute when performing a scroll up on the module.
|
||||
Command to execute when performing a scroll up on the module. This replaces the default behaviour of brightness control.
|
||||
|
||||
*on-scroll-down*: ++
|
||||
typeof: string
|
||||
Command to execute when performing a scroll down on the module.
|
||||
Command to execute when performing a scroll down on the module. This replaces the default behaviour of brightness control.
|
||||
|
||||
*smooth-scrolling-threshold*: ++
|
||||
typeof: double
|
||||
Threshold to be used when scrolling.
|
||||
|
||||
*reverse-scrolling*: ++
|
||||
typeof: bool ++
|
||||
Option to reverse the scroll direction.
|
||||
|
||||
*scroll-step*: ++
|
||||
typeof: float ++
|
||||
default: 1.0 ++
|
||||
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,12 @@ 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 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++
|
||||
@@ -77,7 +77,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 +100,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 +126,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 +137,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 +146,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
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@@ -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,12 @@ 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 text, where 0 is left-aligned and 1 is right-aligned. If the module is rotated, it will follow the flow of the text.
|
||||
|
||||
*on-click*: ++
|
||||
typeof: string ++
|
||||
@@ -74,7 +78,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 +117,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 +146,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"
|
||||
}
|
||||
},
|
||||
```
|
||||
@@ -1,4 +1,4 @@
|
||||
waybar-clock(5)
|
||||
waybar-clock(5) "waybar-clock" "User Manual"
|
||||
|
||||
# NAME
|
||||
|
||||
@@ -6,108 +6,265 @@ 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://fmt.dev/latest/syntax.html#chrono-specs>
|
||||
|
||||
*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
|
||||
- *{timezoned_time_list}*: List of time in the rest timezones, if more than one timezone is set in the config
|
||||
|
||||
# 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,12 @@ 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 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 ++
|
||||
@@ -43,7 +43,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 +55,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 +80,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 +108,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,12 @@ 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 text, where 0 is left-aligned and 1 is right-aligned. If the module is rotated, it will follow the flow of the text.
|
||||
|
||||
*on-click*: ++
|
||||
typeof: string ++
|
||||
@@ -85,7 +84,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 ++
|
||||
@@ -137,7 +136,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.
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user