Compare commits
346 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 | ||
|
|
cdece498c1 | ||
|
|
5bfdbf116d | ||
|
|
bad6cfae6f |
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@v3
|
||||
- name: Test in FreeBSD VM
|
||||
uses: vmactions/freebsd-vm@v0
|
||||
with:
|
||||
mem: 2048
|
||||
usesh: true
|
||||
prepare: |
|
||||
export CPPFLAGS=-isystem/usr/local/include LDFLAGS=-L/usr/local/lib # sndio
|
||||
sed -i '' 's/quarterly/latest/' /etc/pkg/FreeBSD.conf
|
||||
pkg install -y git # subprojects/date
|
||||
pkg install -y catch evdev-proto gtk-layer-shell gtkmm30 jsoncpp \
|
||||
libdbusmenu libevdev libfmt libmpdclient libudev-devd meson \
|
||||
pkgconf pulseaudio scdoc sndio spdlog wayland-protocols upower \
|
||||
libinotify
|
||||
run: |
|
||||
meson build -Dman-pages=enabled
|
||||
ninja -C build
|
||||
meson test -C build --no-rebuild --print-errorlogs --suite waybar
|
||||
- uses: actions/checkout@v3
|
||||
- name: Test in FreeBSD VM
|
||||
uses: cross-platform-actions/action@v0.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
|
||||
|
||||
6
.github/workflows/lint.yml
vendored
6
.github/workflows/lint.yml
vendored
@@ -7,8 +7,8 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: DoozyX/clang-format-lint-action@v0.13
|
||||
- uses: DoozyX/clang-format-lint-action@v0.16.2
|
||||
with:
|
||||
source: '.'
|
||||
extensions: 'h,cpp,c'
|
||||
clangFormatVersion: 12
|
||||
extensions: 'hpp,h,cpp,c'
|
||||
clangFormatVersion: 16
|
||||
|
||||
2
.github/workflows/linux.yml
vendored
2
.github/workflows/linux.yml
vendored
@@ -13,7 +13,7 @@ jobs:
|
||||
- fedora
|
||||
- opensuse
|
||||
- gentoo
|
||||
cpp_std: [c++17]
|
||||
cpp_std: [c++20]
|
||||
include:
|
||||
- distro: fedora
|
||||
cpp_std: c++20
|
||||
|
||||
@@ -3,5 +3,5 @@
|
||||
FROM archlinux:base-devel
|
||||
|
||||
RUN pacman -Syu --noconfirm && \
|
||||
pacman -S --noconfirm git meson base-devel libinput wayland wayland-protocols pixman libxkbcommon mesa gtkmm3 jsoncpp pugixml scdoc libpulse libdbusmenu-gtk3 libmpdclient gobject-introspection libxkbcommon playerctl && \
|
||||
pacman -S --noconfirm git meson base-devel libinput wayland wayland-protocols pixman libxkbcommon mesa gtkmm3 jsoncpp pugixml scdoc libpulse libdbusmenu-gtk3 libmpdclient gobject-introspection libxkbcommon playerctl iniparser fftw && \
|
||||
sed -Ei 's/#(en_(US|GB)\.UTF)/\1/' /etc/locale.gen && locale-gen
|
||||
|
||||
@@ -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/extra/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)*
|
||||
|
||||
|
||||
76
flake.lock
generated
76
flake.lock
generated
@@ -2,15 +2,15 @@
|
||||
"nodes": {
|
||||
"devshell": {
|
||||
"inputs": {
|
||||
"flake-utils": "flake-utils",
|
||||
"nixpkgs": "nixpkgs"
|
||||
"nixpkgs": "nixpkgs",
|
||||
"systems": "systems"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1676293499,
|
||||
"narHash": "sha256-uIOTlTxvrXxpKeTvwBI1JGDGtCxMXE3BI0LFwoQMhiQ=",
|
||||
"lastModified": 1692523566,
|
||||
"narHash": "sha256-VDJDihK6jNebVw9y3qKCVD6+6QaC/x8kxZzL4MaIPPY=",
|
||||
"owner": "numtide",
|
||||
"repo": "devshell",
|
||||
"rev": "71e3022e3ab20bbf1342640547ef5bc14fb43bf4",
|
||||
"rev": "d208c58e2f7afef838add5f18a9936b12a71d695",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -36,27 +36,15 @@
|
||||
}
|
||||
},
|
||||
"flake-utils": {
|
||||
"locked": {
|
||||
"lastModified": 1642700792,
|
||||
"narHash": "sha256-XqHrk7hFb+zBvRg6Ghl+AZDq03ov6OshJLiSWOoX5es=",
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"rev": "846b2ae0fc4cc943637d3d1def4454213e203cba",
|
||||
"type": "github"
|
||||
"inputs": {
|
||||
"systems": "systems_2"
|
||||
},
|
||||
"original": {
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"flake-utils_2": {
|
||||
"locked": {
|
||||
"lastModified": 1676283394,
|
||||
"narHash": "sha256-XX2f9c3iySLCw54rJ/CZs+ZK6IQy7GXNY4nSOyu2QG4=",
|
||||
"lastModified": 1689068808,
|
||||
"narHash": "sha256-6ixXo3wt24N/melDWjq70UuHQLxGV8jZvooRanIHXw0=",
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"rev": "3db36a8b464d0c4532ba1c7dda728f4576d6d073",
|
||||
"rev": "919d646de7be200f3bf08cb76ae1f09402b6f9b4",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -67,11 +55,11 @@
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1643381941,
|
||||
"narHash": "sha256-pHTwvnN4tTsEKkWlXQ8JMY423epos8wUOhthpwJjtpc=",
|
||||
"lastModified": 1677383253,
|
||||
"narHash": "sha256-UfpzWfSxkfXHnb4boXZNaKsAcUrZT9Hw+tao1oZxd08=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "5efc8ca954272c4376ac929f4c5ffefcc20551d5",
|
||||
"rev": "9952d6bc395f5841262b006fbace8dd7e143b634",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -83,11 +71,11 @@
|
||||
},
|
||||
"nixpkgs_2": {
|
||||
"locked": {
|
||||
"lastModified": 1676300157,
|
||||
"narHash": "sha256-1HjRzfp6LOLfcj/HJHdVKWAkX9QRAouoh6AjzJiIerU=",
|
||||
"lastModified": 1692638711,
|
||||
"narHash": "sha256-J0LgSFgJVGCC1+j5R2QndadWI1oumusg6hCtYAzLID4=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "545c7a31e5dedea4a6d372712a18e00ce097d462",
|
||||
"rev": "91a22f76cd1716f9d0149e8a5c68424bb691de15",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -101,9 +89,39 @@
|
||||
"inputs": {
|
||||
"devshell": "devshell",
|
||||
"flake-compat": "flake-compat",
|
||||
"flake-utils": "flake-utils_2",
|
||||
"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",
|
||||
|
||||
17
flake.nix
17
flake.nix
@@ -16,6 +16,7 @@
|
||||
inherit (nixpkgs) lib;
|
||||
genSystems = lib.genAttrs [
|
||||
"x86_64-linux"
|
||||
"aarch64-linux"
|
||||
];
|
||||
|
||||
pkgsFor = genSystems (system:
|
||||
@@ -30,14 +31,14 @@
|
||||
]);
|
||||
in
|
||||
{
|
||||
overlays.default = _: prev: {
|
||||
waybar = prev.callPackage ./nix/default.nix {
|
||||
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 null pkgsFor.${system})
|
||||
(self.overlays.default pkgsFor.${system} pkgsFor.${system})
|
||||
// {
|
||||
default = self.packages.${system}.waybar;
|
||||
});
|
||||
@@ -47,17 +48,12 @@
|
||||
let pkgs = import nixpkgs {
|
||||
inherit system;
|
||||
|
||||
overlays = [ devshell.overlay ];
|
||||
overlays = [ devshell.overlays.default ];
|
||||
};
|
||||
in
|
||||
pkgs.devshell.mkShell {
|
||||
imports = [ "${pkgs.devshell.extraModulesDir}/language/c.nix" ];
|
||||
commands = [
|
||||
{
|
||||
package = pkgs.devshell.cli;
|
||||
help = "Per project developer environments";
|
||||
}
|
||||
];
|
||||
|
||||
devshell.packages = with pkgs; [
|
||||
clang-tools
|
||||
gdb
|
||||
@@ -79,6 +75,7 @@
|
||||
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"; }
|
||||
|
||||
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
|
||||
@@ -36,26 +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
|
||||
@@ -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_;
|
||||
};
|
||||
|
||||
|
||||
@@ -38,6 +38,9 @@
|
||||
#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)
|
||||
|
||||
@@ -5,18 +5,31 @@
|
||||
#include <json/json.h>
|
||||
|
||||
#include "AModule.hpp"
|
||||
#include "bar.hpp"
|
||||
#include "factory.hpp"
|
||||
#include "gtkmm/revealer.h"
|
||||
|
||||
namespace waybar {
|
||||
|
||||
class Group : public AModule {
|
||||
public:
|
||||
Group(const std::string&, const std::string&, const Json::Value&, bool);
|
||||
~Group() = default;
|
||||
virtual ~Group() = default;
|
||||
auto update() -> void override;
|
||||
operator Gtk::Widget&() override;
|
||||
|
||||
virtual Gtk::Box& getBox();
|
||||
void addWidget(Gtk::Widget& widget);
|
||||
|
||||
bool handleMouseHover(GdkEventCrossing* const& e);
|
||||
|
||||
protected:
|
||||
Gtk::Box box;
|
||||
Gtk::Box revealer_box;
|
||||
Gtk::Revealer revealer;
|
||||
bool is_first_widget = true;
|
||||
bool is_drawer = false;
|
||||
std::string add_class_to_drawer_children;
|
||||
|
||||
void addHoverHandlerTo(Gtk::Widget& widget);
|
||||
};
|
||||
|
||||
} // namespace waybar
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
#include <vector>
|
||||
|
||||
#include "ALabel.hpp"
|
||||
#include "giomm/dbusproxy.h"
|
||||
#include "util/backlight_backend.hpp"
|
||||
#include "util/json.hpp"
|
||||
#include "util/sleeper_thread.hpp"
|
||||
|
||||
struct udev;
|
||||
struct udev_device;
|
||||
@@ -16,54 +16,17 @@ struct udev_device;
|
||||
namespace waybar::modules {
|
||||
|
||||
class Backlight : public ALabel {
|
||||
class BacklightDev {
|
||||
public:
|
||||
BacklightDev() = default;
|
||||
BacklightDev(std::string name, int actual, int max, bool powered);
|
||||
std::string_view name() const;
|
||||
int get_actual() const;
|
||||
void set_actual(int actual);
|
||||
int get_max() const;
|
||||
void set_max(int max);
|
||||
bool get_powered() const;
|
||||
void set_powered(bool powered);
|
||||
friend inline bool operator==(const BacklightDev &lhs, const BacklightDev &rhs) {
|
||||
return lhs.name_ == rhs.name_ && lhs.actual_ == rhs.actual_ && lhs.max_ == rhs.max_;
|
||||
}
|
||||
|
||||
private:
|
||||
std::string name_;
|
||||
int actual_ = 1;
|
||||
int max_ = 1;
|
||||
bool powered_ = true;
|
||||
};
|
||||
|
||||
public:
|
||||
Backlight(const std::string &, const Json::Value &);
|
||||
virtual ~Backlight();
|
||||
virtual ~Backlight() = default;
|
||||
auto update() -> void override;
|
||||
|
||||
private:
|
||||
template <class ForwardIt>
|
||||
static const BacklightDev *best_device(ForwardIt first, ForwardIt last, std::string_view);
|
||||
template <class ForwardIt, class Inserter>
|
||||
static void upsert_device(ForwardIt first, ForwardIt last, Inserter inserter, udev_device *dev);
|
||||
template <class ForwardIt, class Inserter>
|
||||
static void enumerate_devices(ForwardIt first, ForwardIt last, Inserter inserter, udev *udev);
|
||||
|
||||
bool handleScroll(GdkEventScroll *e) override;
|
||||
|
||||
const std::string preferred_device_;
|
||||
static constexpr int EPOLL_MAX_EVENTS = 16;
|
||||
|
||||
std::optional<BacklightDev> previous_best_;
|
||||
std::string previous_format_;
|
||||
|
||||
std::mutex udev_thread_mutex_;
|
||||
std::vector<BacklightDev> devices_;
|
||||
// thread must destruct before shared data
|
||||
util::SleeperThread udev_thread_;
|
||||
|
||||
Glib::RefPtr<Gio::DBus::Proxy> login_proxy_;
|
||||
util::BacklightBackend backend;
|
||||
};
|
||||
} // namespace waybar::modules
|
||||
|
||||
24
include/modules/backlight_slider.hpp
Normal file
24
include/modules/backlight_slider.hpp
Normal file
@@ -0,0 +1,24 @@
|
||||
#pragma once
|
||||
|
||||
#include <chrono>
|
||||
|
||||
#include "ASlider.hpp"
|
||||
#include "util/backlight_backend.hpp"
|
||||
|
||||
namespace waybar::modules {
|
||||
|
||||
class BacklightSlider : public ASlider {
|
||||
public:
|
||||
BacklightSlider(const std::string&, const Json::Value&);
|
||||
virtual ~BacklightSlider() = default;
|
||||
|
||||
void update() override;
|
||||
void onValueChanged() override;
|
||||
|
||||
private:
|
||||
std::chrono::milliseconds interval_;
|
||||
std::string preferred_device_;
|
||||
util::BacklightBackend backend;
|
||||
};
|
||||
|
||||
} // namespace waybar::modules
|
||||
@@ -59,7 +59,8 @@ class Bluetooth : public ALabel {
|
||||
auto getDeviceProperties(GDBusObject*, DeviceInfo&) -> bool;
|
||||
auto getControllerProperties(GDBusObject*, ControllerInfo&) -> bool;
|
||||
|
||||
auto findCurController(ControllerInfo&) -> bool;
|
||||
// Returns std::nullopt if no controller could be found
|
||||
auto findCurController() -> std::optional<ControllerInfo>;
|
||||
auto findConnectedDevices(const std::string&, std::vector<DeviceInfo>&) -> void;
|
||||
|
||||
#ifdef WANT_RFKILL
|
||||
@@ -68,7 +69,7 @@ class Bluetooth : public ALabel {
|
||||
const std::unique_ptr<GDBusObjectManager, void (*)(GDBusObjectManager*)> manager_;
|
||||
|
||||
std::string state_;
|
||||
ControllerInfo cur_controller_;
|
||||
std::optional<ControllerInfo> cur_controller_;
|
||||
std::vector<DeviceInfo> connected_devices_;
|
||||
DeviceInfo cur_focussed_device_;
|
||||
std::string device_enumerate_;
|
||||
|
||||
@@ -3,9 +3,11 @@
|
||||
#include "ALabel.hpp"
|
||||
#include "util/sleeper_thread.hpp"
|
||||
|
||||
namespace cava {
|
||||
extern "C" {
|
||||
#include <cava/common.h>
|
||||
}
|
||||
} // namespace cava
|
||||
|
||||
namespace waybar::modules {
|
||||
using namespace std::literals::chrono_literals;
|
||||
@@ -21,13 +23,13 @@ class Cava final : public ALabel {
|
||||
util::SleeperThread thread_;
|
||||
util::SleeperThread thread_fetch_input_;
|
||||
|
||||
struct error_s error_ {}; // cava errors
|
||||
struct config_params prm_ {}; // cava parameters
|
||||
struct audio_raw audio_raw_ {}; // cava handled raw audio data(is based on audio_data)
|
||||
struct audio_data audio_data_ {}; // cava audio data
|
||||
struct cava_plan* plan_; //{new cava_plan{}};
|
||||
struct cava::error_s error_ {}; // cava errors
|
||||
struct cava::config_params prm_ {}; // cava parameters
|
||||
struct cava::audio_raw audio_raw_ {}; // cava handled raw audio data(is based on audio_data)
|
||||
struct cava::audio_data audio_data_ {}; // cava audio data
|
||||
struct cava::cava_plan* plan_; //{new cava_plan{}};
|
||||
// Cava API to read audio source
|
||||
ptr input_source_;
|
||||
cava::ptr input_source_;
|
||||
// Delay to handle audio source
|
||||
std::chrono::milliseconds frame_time_milsec_{1s};
|
||||
// Text to display
|
||||
@@ -36,6 +38,7 @@ class Cava final : public ALabel {
|
||||
std::chrono::seconds fetch_input_delay_{4};
|
||||
std::chrono::seconds suspend_silence_delay_{0};
|
||||
bool silence_{false};
|
||||
bool hide_on_silence_{false};
|
||||
int sleep_counter_{0};
|
||||
// Cava method
|
||||
void pause_resume();
|
||||
|
||||
@@ -34,11 +34,18 @@ class Clock final : public ALabel {
|
||||
|
||||
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
|
||||
@@ -52,8 +59,8 @@ class Clock final : public ALabel {
|
||||
std::string cldMonCached_{};
|
||||
date::day cldBaseDay_{0};
|
||||
/*Calendar functions*/
|
||||
auto get_calendar(const date::zoned_seconds& now, const date::zoned_seconds& wtime)
|
||||
-> std::string;
|
||||
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();
|
||||
|
||||
@@ -21,12 +21,6 @@ class Cpu : public ALabel {
|
||||
auto update() -> void override;
|
||||
|
||||
private:
|
||||
double getCpuLoad();
|
||||
std::tuple<std::vector<uint16_t>, std::string> getCpuUsage();
|
||||
std::tuple<float, float, float> getCpuFrequency();
|
||||
std::vector<std::tuple<size_t, size_t>> parseCpuinfo();
|
||||
std::vector<float> parseCpuFrequencies();
|
||||
|
||||
std::vector<std::tuple<size_t, size_t>> prev_times_;
|
||||
|
||||
util::SleeperThread thread_;
|
||||
|
||||
32
include/modules/cpu_frequency.hpp
Normal file
32
include/modules/cpu_frequency.hpp
Normal file
@@ -0,0 +1,32 @@
|
||||
#pragma once
|
||||
|
||||
#include <fmt/format.h>
|
||||
|
||||
#include <cstdint>
|
||||
#include <fstream>
|
||||
#include <numeric>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
#include "ALabel.hpp"
|
||||
#include "util/sleeper_thread.hpp"
|
||||
|
||||
namespace waybar::modules {
|
||||
|
||||
class CpuFrequency : public ALabel {
|
||||
public:
|
||||
CpuFrequency(const std::string&, const Json::Value&);
|
||||
virtual ~CpuFrequency() = default;
|
||||
auto update() -> void override;
|
||||
|
||||
// This is a static member because it is also used by the cpu module.
|
||||
static std::tuple<float, float, float> getCpuFrequency();
|
||||
|
||||
private:
|
||||
static std::vector<float> parseCpuFrequencies();
|
||||
|
||||
util::SleeperThread thread_;
|
||||
};
|
||||
|
||||
} // namespace waybar::modules
|
||||
35
include/modules/cpu_usage.hpp
Normal file
35
include/modules/cpu_usage.hpp
Normal file
@@ -0,0 +1,35 @@
|
||||
#pragma once
|
||||
|
||||
#include <fmt/format.h>
|
||||
|
||||
#include <cstdint>
|
||||
#include <fstream>
|
||||
#include <numeric>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
#include "ALabel.hpp"
|
||||
#include "util/sleeper_thread.hpp"
|
||||
|
||||
namespace waybar::modules {
|
||||
|
||||
class CpuUsage : public ALabel {
|
||||
public:
|
||||
CpuUsage(const std::string&, const Json::Value&);
|
||||
virtual ~CpuUsage() = default;
|
||||
auto update() -> void override;
|
||||
|
||||
// This is a static member because it is also used by the cpu module.
|
||||
static std::tuple<std::vector<uint16_t>, std::string> getCpuUsage(
|
||||
std::vector<std::tuple<size_t, size_t>>&);
|
||||
|
||||
private:
|
||||
static std::vector<std::tuple<size_t, size_t>> parseCpuinfo();
|
||||
|
||||
std::vector<std::tuple<size_t, size_t>> prev_times_;
|
||||
|
||||
util::SleeperThread thread_;
|
||||
};
|
||||
|
||||
} // namespace waybar::modules
|
||||
@@ -22,6 +22,7 @@ class Custom : public ALabel {
|
||||
private:
|
||||
void delayWorker();
|
||||
void continuousWorker();
|
||||
void waitingWorker();
|
||||
void parseOutputRaw();
|
||||
void parseOutputJson();
|
||||
void handleEvent();
|
||||
|
||||
@@ -20,6 +20,9 @@ class Disk : public ALabel {
|
||||
private:
|
||||
util::SleeperThread thread_;
|
||||
std::string path_;
|
||||
std::string unit_;
|
||||
|
||||
float calc_specific_divisor(const std::string divisor);
|
||||
};
|
||||
|
||||
} // namespace waybar::modules
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
#pragma once
|
||||
|
||||
#include <functional>
|
||||
#include <list>
|
||||
#include <memory>
|
||||
#include <mutex>
|
||||
#include <string>
|
||||
#include <thread>
|
||||
#include <utility>
|
||||
|
||||
#include "util/json.hpp"
|
||||
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
#pragma once
|
||||
|
||||
#include <fmt/format.h>
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "ALabel.hpp"
|
||||
#include "bar.hpp"
|
||||
#include "modules/hyprland/backend.hpp"
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
#pragma once
|
||||
|
||||
#include <fmt/format.h>
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "ALabel.hpp"
|
||||
#include "bar.hpp"
|
||||
#include "modules/hyprland/backend.hpp"
|
||||
|
||||
@@ -1,16 +1,20 @@
|
||||
#pragma once
|
||||
|
||||
#include <fmt/format.h>
|
||||
|
||||
#include "ALabel.hpp"
|
||||
#include <string>
|
||||
|
||||
#include "AAppIconLabel.hpp"
|
||||
#include "bar.hpp"
|
||||
#include "modules/hyprland/backend.hpp"
|
||||
#include "util/json.hpp"
|
||||
|
||||
namespace waybar::modules::hyprland {
|
||||
|
||||
class Window : public waybar::ALabel, public EventHandler {
|
||||
class Window : public waybar::AAppIconLabel, public EventHandler {
|
||||
public:
|
||||
Window(const std::string&, const waybar::Bar&, const Json::Value&);
|
||||
virtual ~Window();
|
||||
~Window() override;
|
||||
|
||||
auto update() -> void override;
|
||||
|
||||
@@ -24,6 +28,19 @@ class Window : public waybar::ALabel, public EventHandler {
|
||||
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;
|
||||
@@ -34,12 +51,13 @@ class Window : public waybar::ALabel, public EventHandler {
|
||||
std::mutex mutex_;
|
||||
const Bar& bar_;
|
||||
util::JsonParser parser_;
|
||||
std::string last_title_;
|
||||
WindowData window_data_;
|
||||
Workspace workspace_;
|
||||
std::string solo_class_;
|
||||
std::string last_solo_class_;
|
||||
bool solo_;
|
||||
bool all_floating_;
|
||||
bool swallowing_;
|
||||
bool fullscreen_;
|
||||
};
|
||||
|
||||
|
||||
@@ -1,35 +1,111 @@
|
||||
#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 {
|
||||
|
||||
struct WorkspaceDto {
|
||||
int id;
|
||||
class Workspaces;
|
||||
|
||||
static WorkspaceDto parse(const Json::Value& value);
|
||||
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:
|
||||
Workspace(int id);
|
||||
Workspace(WorkspaceDto dto);
|
||||
int id() const { return id_; };
|
||||
int active() const { return active_; };
|
||||
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);
|
||||
void set_active(bool value = true) { active_ = value; };
|
||||
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_;
|
||||
bool active_;
|
||||
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_;
|
||||
@@ -39,23 +115,86 @@ class Workspace {
|
||||
class Workspaces : public AModule, public EventHandler {
|
||||
public:
|
||||
Workspaces(const std::string&, const waybar::Bar&, const Json::Value&);
|
||||
virtual ~Workspaces();
|
||||
~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&) override;
|
||||
void onEvent(const std::string& e) override;
|
||||
void update_window_count();
|
||||
void sort_workspaces();
|
||||
void create_workspace(int id);
|
||||
void remove_workspace(int id);
|
||||
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_;
|
||||
int active_workspace_id;
|
||||
uint64_t monitor_id_;
|
||||
std::string active_workspace_name_;
|
||||
std::vector<std::unique_ptr<Workspace>> workspaces_;
|
||||
std::vector<int> workspaces_to_create_;
|
||||
std::vector<int> workspaces_to_remove_;
|
||||
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_;
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
#include <fmt/chrono.h>
|
||||
#include <gtkmm/label.h>
|
||||
|
||||
#include <set>
|
||||
#include <unordered_map>
|
||||
|
||||
#include "AModule.hpp"
|
||||
@@ -40,6 +41,7 @@ class KeyboardState : public AModule {
|
||||
|
||||
struct libinput* libinput_;
|
||||
std::unordered_map<std::string, struct libinput_device*> libinput_devices_;
|
||||
std::set<int> binding_keys;
|
||||
|
||||
util::SleeperThread libinput_thread_, hotplug_thread_;
|
||||
};
|
||||
|
||||
30
include/modules/load.hpp
Normal file
30
include/modules/load.hpp
Normal file
@@ -0,0 +1,30 @@
|
||||
#pragma once
|
||||
|
||||
#include <fmt/format.h>
|
||||
|
||||
#include <cstdint>
|
||||
#include <fstream>
|
||||
#include <numeric>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
#include "ALabel.hpp"
|
||||
#include "util/sleeper_thread.hpp"
|
||||
|
||||
namespace waybar::modules {
|
||||
|
||||
class Load : public ALabel {
|
||||
public:
|
||||
Load(const std::string&, const Json::Value&);
|
||||
virtual ~Load() = default;
|
||||
auto update() -> void override;
|
||||
|
||||
// This is a static member because it is also used by the cpu module.
|
||||
static std::tuple<double, double, double> getLoad();
|
||||
|
||||
private:
|
||||
util::SleeperThread thread_;
|
||||
};
|
||||
|
||||
} // namespace waybar::modules
|
||||
@@ -66,9 +66,9 @@ class Mpris : public ALabel {
|
||||
int album_len_;
|
||||
int title_len_;
|
||||
int dynamic_len_;
|
||||
std::string dynamic_separator_;
|
||||
std::vector<std::string> dynamic_order_;
|
||||
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_;
|
||||
|
||||
@@ -1,54 +1,27 @@
|
||||
#pragma once
|
||||
|
||||
#include <fmt/format.h>
|
||||
#include <pulse/pulseaudio.h>
|
||||
#include <pulse/volume.h>
|
||||
|
||||
#include <algorithm>
|
||||
#include <array>
|
||||
#include <memory>
|
||||
|
||||
#include "ALabel.hpp"
|
||||
#include "util/audio_backend.hpp"
|
||||
|
||||
namespace waybar::modules {
|
||||
|
||||
class Pulseaudio : public ALabel {
|
||||
public:
|
||||
Pulseaudio(const std::string&, const Json::Value&);
|
||||
virtual ~Pulseaudio();
|
||||
virtual ~Pulseaudio() = default;
|
||||
auto update() -> void override;
|
||||
|
||||
private:
|
||||
static void subscribeCb(pa_context*, pa_subscription_event_type_t, uint32_t, void*);
|
||||
static void contextStateCb(pa_context*, void*);
|
||||
static void sinkInfoCb(pa_context*, const pa_sink_info*, int, void*);
|
||||
static void sourceInfoCb(pa_context*, const pa_source_info* i, int, void* data);
|
||||
static void serverInfoCb(pa_context*, const pa_server_info*, void*);
|
||||
static void volumeModifyCb(pa_context*, int, void*);
|
||||
|
||||
bool handleScroll(GdkEventScroll* e) override;
|
||||
const std::vector<std::string> getPulseIcon() const;
|
||||
|
||||
pa_threaded_mainloop* mainloop_;
|
||||
pa_mainloop_api* mainloop_api_;
|
||||
pa_context* context_;
|
||||
// SINK
|
||||
uint32_t sink_idx_{0};
|
||||
uint16_t volume_;
|
||||
pa_cvolume pa_volume_;
|
||||
bool muted_;
|
||||
std::string port_name_;
|
||||
std::string form_factor_;
|
||||
std::string desc_;
|
||||
std::string monitor_;
|
||||
std::string current_sink_name_;
|
||||
bool current_sink_running_;
|
||||
// SOURCE
|
||||
uint32_t source_idx_{0};
|
||||
uint16_t source_volume_;
|
||||
bool source_muted_;
|
||||
std::string source_port_name_;
|
||||
std::string source_desc_;
|
||||
std::string default_source_name_;
|
||||
std::shared_ptr<util::AudioBackend> backend = nullptr;
|
||||
};
|
||||
|
||||
} // namespace waybar::modules
|
||||
|
||||
27
include/modules/pulseaudio_slider.hpp
Normal file
27
include/modules/pulseaudio_slider.hpp
Normal file
@@ -0,0 +1,27 @@
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "ASlider.hpp"
|
||||
#include "util/audio_backend.hpp"
|
||||
namespace waybar::modules {
|
||||
|
||||
enum class PulseaudioSliderTarget {
|
||||
Sink,
|
||||
Source,
|
||||
};
|
||||
|
||||
class PulseaudioSlider : public ASlider {
|
||||
public:
|
||||
PulseaudioSlider(const std::string&, const Json::Value&);
|
||||
virtual ~PulseaudioSlider() = default;
|
||||
|
||||
void update() override;
|
||||
void onValueChanged() override;
|
||||
|
||||
private:
|
||||
std::shared_ptr<util::AudioBackend> backend = nullptr;
|
||||
PulseaudioSliderTarget target = PulseaudioSliderTarget::Sink;
|
||||
};
|
||||
|
||||
} // namespace waybar::modules
|
||||
@@ -84,6 +84,8 @@ class Item : public sigc::trackable {
|
||||
// visibility of items with Status == Passive
|
||||
bool show_passive_ = false;
|
||||
|
||||
const Bar& bar_;
|
||||
|
||||
Glib::RefPtr<Gio::DBus::Proxy> proxy_;
|
||||
Glib::RefPtr<Gio::Cancellable> cancellable_;
|
||||
std::set<std::string_view> update_pending_;
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
#include <tuple>
|
||||
|
||||
#include "AIconLabel.hpp"
|
||||
#include "AAppIconLabel.hpp"
|
||||
#include "bar.hpp"
|
||||
#include "client.hpp"
|
||||
#include "modules/sway/ipc/client.hpp"
|
||||
@@ -12,7 +12,7 @@
|
||||
|
||||
namespace waybar::modules::sway {
|
||||
|
||||
class Window : public AIconLabel, public sigc::trackable {
|
||||
class Window : public AAppIconLabel, public sigc::trackable {
|
||||
public:
|
||||
Window(const std::string&, const waybar::Bar&, const Json::Value&);
|
||||
virtual ~Window() = default;
|
||||
@@ -25,8 +25,6 @@ class Window : public AIconLabel, public sigc::trackable {
|
||||
std::tuple<std::size_t, int, int, std::string, std::string, std::string, std::string, std::string>
|
||||
getFocusedNode(const Json::Value& nodes, std::string& output);
|
||||
void getTree();
|
||||
void updateAppIconName();
|
||||
void updateAppIcon();
|
||||
|
||||
const Bar& bar_;
|
||||
std::string window_;
|
||||
@@ -37,9 +35,6 @@ class Window : public AIconLabel, public sigc::trackable {
|
||||
std::string old_app_id_;
|
||||
std::size_t app_nb_;
|
||||
std::string shell_;
|
||||
unsigned app_icon_size_{24};
|
||||
bool update_app_icon_{true};
|
||||
std::string app_icon_name_;
|
||||
int floating_count_;
|
||||
util::JsonParser parser_;
|
||||
std::mutex mutex_;
|
||||
|
||||
@@ -41,6 +41,7 @@ class Workspaces : public AModule, public sigc::trackable {
|
||||
|
||||
const Bar& bar_;
|
||||
std::vector<Json::Value> workspaces_;
|
||||
std::vector<std::string> high_priority_named_;
|
||||
std::vector<std::string> workspaces_order_;
|
||||
Gtk::Box box_;
|
||||
util::JsonParser parser_;
|
||||
|
||||
@@ -69,7 +69,7 @@ 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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
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
|
||||
@@ -112,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;
|
||||
|
||||
19
include/util/enum.hpp
Normal file
19
include/util/enum.hpp
Normal file
@@ -0,0 +1,19 @@
|
||||
#pragma once
|
||||
|
||||
#include <map>
|
||||
#include <stdexcept>
|
||||
#include <string>
|
||||
|
||||
namespace waybar::util {
|
||||
|
||||
template <typename EnumType>
|
||||
struct EnumParser {
|
||||
public:
|
||||
EnumParser();
|
||||
~EnumParser();
|
||||
|
||||
EnumType parseStringToEnum(const std::string& str,
|
||||
const std::map<std::string, EnumType>& enumMap);
|
||||
};
|
||||
|
||||
} // namespace waybar::util
|
||||
@@ -93,7 +93,7 @@ template <>
|
||||
struct formatter<Glib::ustring> : formatter<std::string> {
|
||||
template <typename FormatContext>
|
||||
auto format(const Glib::ustring& value, FormatContext& ctx) {
|
||||
return formatter<std::string>::format(value, ctx);
|
||||
return formatter<std::string>::format(static_cast<std::string>(value), ctx);
|
||||
}
|
||||
};
|
||||
} // namespace fmt
|
||||
|
||||
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;
|
||||
};
|
||||
51
include/util/regex_collection.hpp
Normal file
51
include/util/regex_collection.hpp
Normal file
@@ -0,0 +1,51 @@
|
||||
#pragma once
|
||||
|
||||
#include <json/json.h>
|
||||
|
||||
#include <functional>
|
||||
#include <regex>
|
||||
#include <string>
|
||||
|
||||
namespace waybar::util {
|
||||
|
||||
struct Rule {
|
||||
std::regex rule;
|
||||
std::string repr;
|
||||
int priority;
|
||||
|
||||
// Fix for Clang < 16
|
||||
// See https://en.cppreference.com/w/cpp/compiler_support/20 "Parenthesized initialization of
|
||||
// aggregates"
|
||||
Rule(std::regex rule, std::string repr, int priority)
|
||||
: rule(rule), repr(repr), priority(priority) {}
|
||||
};
|
||||
|
||||
int default_priority_function(std::string& key);
|
||||
|
||||
/* A collection of regexes and strings, with a default string to return if no regexes.
|
||||
* When a regex is matched, the corresponding string is returned.
|
||||
* All regexes that are matched are cached, so that the regexes are only
|
||||
* evaluated once against a given string.
|
||||
* Regexes may be given a higher priority than others, so that they are matched
|
||||
* first. The priority function is given the regex string, and should return a
|
||||
* higher number for higher priority regexes.
|
||||
*/
|
||||
class RegexCollection {
|
||||
private:
|
||||
std::vector<Rule> rules;
|
||||
std::map<std::string, std::string> regex_cache;
|
||||
std::string default_repr;
|
||||
|
||||
std::string& find_match(std::string& value, bool& matched_any);
|
||||
|
||||
public:
|
||||
RegexCollection() = default;
|
||||
RegexCollection(const Json::Value& map, std::string default_repr = "",
|
||||
std::function<int(std::string&)> priority_function = default_priority_function);
|
||||
~RegexCollection() = default;
|
||||
|
||||
std::string& get(std::string& value, bool& matched_any);
|
||||
std::string& get(std::string& value);
|
||||
};
|
||||
|
||||
} // namespace waybar::util
|
||||
@@ -5,4 +5,6 @@
|
||||
|
||||
namespace waybar::util {
|
||||
std::string rewriteString(const std::string&, const Json::Value&);
|
||||
}
|
||||
std::string rewriteStringOnce(const std::string& value, const Json::Value& rules,
|
||||
bool& matched_any);
|
||||
} // namespace waybar::util
|
||||
|
||||
21
include/util/scope_guard.hpp
Normal file
21
include/util/scope_guard.hpp
Normal file
@@ -0,0 +1,21 @@
|
||||
#pragma once
|
||||
|
||||
#include <utility>
|
||||
|
||||
namespace waybar::util {
|
||||
|
||||
template <typename Func>
|
||||
class ScopeGuard {
|
||||
public:
|
||||
explicit ScopeGuard(Func&& exit_function) : f{std::forward<Func>(exit_function)} {}
|
||||
ScopeGuard(const ScopeGuard&) = delete;
|
||||
ScopeGuard(ScopeGuard&&) = default;
|
||||
ScopeGuard& operator=(const ScopeGuard&) = delete;
|
||||
ScopeGuard& operator=(ScopeGuard&&) = default;
|
||||
~ScopeGuard() { f(); }
|
||||
|
||||
private:
|
||||
Func f;
|
||||
};
|
||||
|
||||
} // namespace waybar::util
|
||||
@@ -58,10 +58,22 @@ class SleeperThread {
|
||||
|
||||
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(
|
||||
@@ -95,6 +107,7 @@ class SleeperThread {
|
||||
}
|
||||
|
||||
~SleeperThread() {
|
||||
connection_.disconnect();
|
||||
stop();
|
||||
if (thread_.joinable()) {
|
||||
thread_.join();
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
const std::string WHITESPACE = " \n\r\t\f\v";
|
||||
@@ -15,3 +16,10 @@ inline std::string rtrim(const std::string& s) {
|
||||
}
|
||||
|
||||
inline std::string trim(const std::string& s) { return rtrim(ltrim(s)); }
|
||||
|
||||
inline std::string capitalize(const std::string& str) {
|
||||
std::string result = str;
|
||||
std::transform(result.begin(), result.end(), result.begin(),
|
||||
[](unsigned char c) { return std::toupper(c); });
|
||||
return result;
|
||||
}
|
||||
|
||||
88
man/waybar-backlight-slider.5.scd
Normal file
88
man/waybar-backlight-slider.5.scd
Normal file
@@ -0,0 +1,88 @@
|
||||
waybar-backlight-slider(5)
|
||||
|
||||
# NAME
|
||||
|
||||
waybar - backlight slider module
|
||||
|
||||
# DESCRIPTION
|
||||
|
||||
The *backlight slider* module displays and controls the current brightness of the default or preferred device.
|
||||
|
||||
The brightness can be controlled by dragging the slider across the bar or clicking on a specific position.
|
||||
|
||||
# CONFIGURATION
|
||||
|
||||
*min*: ++
|
||||
typeof: int ++
|
||||
default: 0 ++
|
||||
The minimum volume value the slider should display and set.
|
||||
|
||||
*max*: ++
|
||||
typeof: int ++
|
||||
default: 100 ++
|
||||
The maximum volume value the slider should display and set.
|
||||
|
||||
*orientation*: ++
|
||||
typeof: string ++
|
||||
default: horizontal ++
|
||||
The orientation of the slider. Can be either `horizontal` or `vertical`.
|
||||
|
||||
*device*: ++
|
||||
typeof: string ++
|
||||
The name of the preferred device to control. If left empty, a device will be chosen automatically.
|
||||
|
||||
# EXAMPLES
|
||||
|
||||
```
|
||||
"modules-right": [
|
||||
"backlight-slider",
|
||||
],
|
||||
"backlight/slider": {
|
||||
"min": 0,
|
||||
"max": 100,
|
||||
"orientation": "horizontal",
|
||||
"device": "intel_backlight"
|
||||
}
|
||||
```
|
||||
|
||||
# STYLE
|
||||
|
||||
The slider is a component with multiple CSS Nodes, of which the following are exposed:
|
||||
|
||||
*#backlight-slider*: ++
|
||||
Controls the style of the box *around* the slider and bar.
|
||||
|
||||
*#backlight-slider slider*: ++
|
||||
Controls the style of the slider handle.
|
||||
|
||||
*#backlight-slider trough*: ++
|
||||
Controls the style of the part of the bar that has not been filled.
|
||||
|
||||
*#backlight-slider highlight*: ++
|
||||
Controls the style of the part of the bar that has been filled.
|
||||
|
||||
## STYLE EXAMPLE
|
||||
|
||||
```
|
||||
#backlight-slider slider {
|
||||
min-height: 0px;
|
||||
min-width: 0px;
|
||||
opacity: 0;
|
||||
background-image: none;
|
||||
border: none;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
#backlight-slider trough {
|
||||
min-height: 80px;
|
||||
min-width: 10px;
|
||||
border-radius: 5px;
|
||||
background-color: black;
|
||||
}
|
||||
|
||||
#backlight-slider highlight {
|
||||
min-width: 10px;
|
||||
border-radius: 5px;
|
||||
background-color: red;
|
||||
}
|
||||
```
|
||||
@@ -25,12 +25,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 ++
|
||||
@@ -75,15 +75,15 @@ The *backlight* module displays the current backlight level.
|
||||
*scroll-step*: ++
|
||||
typeof: float ++
|
||||
default: 1.0 ++
|
||||
The speed in which to change the brightness when scrolling.
|
||||
The speed at which to change the brightness when scrolling.
|
||||
|
||||
# EXAMPLE:
|
||||
|
||||
```
|
||||
"backlight": {
|
||||
"device": "intel_backlight",
|
||||
"format": "{percent}% {icon}",
|
||||
"format-icons": ["", ""]
|
||||
"device": "intel_backlight",
|
||||
"format": "{percent}% {icon}",
|
||||
"format-icons": ["", ""]
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@@ -23,9 +23,9 @@ The *battery* module displays the current capacity and state (eg. charging) of y
|
||||
Define the max percentage of the battery, for when you've set the battery to stop charging at a lower level to save it. For example, if you've set the battery to stop at 80% that will become the new 100%.
|
||||
|
||||
*design-capacity*: ++
|
||||
typeof: bool ++
|
||||
default: false ++
|
||||
Option to use the battery design capacity instead of it's current maximal capacity.
|
||||
typeof: bool ++
|
||||
default: false ++
|
||||
Option to use the battery design capacity instead of its current maximal capacity.
|
||||
|
||||
*interval*: ++
|
||||
typeof: integer ++
|
||||
@@ -56,12 +56,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"
|
||||
}
|
||||
},
|
||||
```
|
||||
@@ -2,7 +2,7 @@ waybar-clock(5) "waybar-clock" "User Manual"
|
||||
|
||||
# NAME
|
||||
|
||||
clock
|
||||
waybar - clock module
|
||||
|
||||
# DESCRIPTION
|
||||
|
||||
@@ -11,7 +11,7 @@ clock
|
||||
# FILES
|
||||
|
||||
$XDG_CONFIG_HOME/waybar/config ++
|
||||
Per user configuration file
|
||||
Per user configuration file
|
||||
|
||||
# CONFIGURATION
|
||||
|
||||
@@ -37,13 +37,13 @@ $XDG_CONFIG_HOME/waybar/config ++
|
||||
:[ 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.
|
||||
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
|
||||
timezones with the proper language and format
|
||||
|[ *max-length*
|
||||
:[ integer
|
||||
:[
|
||||
@@ -63,7 +63,7 @@ $XDG_CONFIG_HOME/waybar/config ++
|
||||
|[ *on-click-right*
|
||||
:[ string
|
||||
:[
|
||||
:[ Command to execute when you right clicked on the module
|
||||
:[ Command to execute when you right-click on the module
|
||||
|[ *on-scroll-up*
|
||||
:[ string
|
||||
:[
|
||||
@@ -104,14 +104,14 @@ View all valid format options in *strftime(3)* or have a look <https://fmt.dev/l
|
||||
:[ integer
|
||||
:[
|
||||
:[ The position where week numbers should be displayed. Disabled when is empty.
|
||||
Possible values: left|right
|
||||
Possible values: left|right
|
||||
|[ *on-scroll*
|
||||
:[ integer
|
||||
:[ 1
|
||||
:[ Value to scroll months/years forward/backward. Can be negative. Is
|
||||
configured under *on-scroll* option
|
||||
configured under *on-scroll* option
|
||||
|
||||
3. Adressed by *clock: calendar: format*
|
||||
3. Addressed by *clock: calendar: format*
|
||||
[- *Option*
|
||||
:- *Typeof*
|
||||
:- *Default*
|
||||
@@ -147,7 +147,7 @@ View all valid format options in *strftime(3)* or have a look <https://fmt.dev/l
|
||||
|[ *tz_up*
|
||||
:[ Switch to the next provided time zone
|
||||
|[ *tz_down*
|
||||
:[ Switch to the previous provided time zone
|
||||
:[ Switch to the previously provided time zone
|
||||
|[ *shift_up*
|
||||
:[ Switch to the next calendar month/year
|
||||
|[ *shift_down*
|
||||
@@ -164,9 +164,9 @@ View all valid format options in *strftime(3)* or have a look <https://fmt.dev/l
|
||||
|
||||
```
|
||||
"clock": {
|
||||
"interval": 60,
|
||||
"format": "{:%H:%M}",
|
||||
"max-length": 25
|
||||
"interval": 60,
|
||||
"format": "{:%H:%M}",
|
||||
"max-length": 25
|
||||
}
|
||||
```
|
||||
|
||||
@@ -174,30 +174,30 @@ View all valid format options in *strftime(3)* or have a look <https://fmt.dev/l
|
||||
|
||||
```
|
||||
"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"
|
||||
}
|
||||
"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"
|
||||
}
|
||||
},
|
||||
```
|
||||
|
||||
@@ -205,10 +205,10 @@ View all valid format options in *strftime(3)* or have a look <https://fmt.dev/l
|
||||
|
||||
```
|
||||
"clock": {
|
||||
"interval": 60,
|
||||
"tooltip": true,
|
||||
"format": "{:%H.%M}",
|
||||
"tooltip-format": "{:%Y-%m-%d}",
|
||||
"interval": 60,
|
||||
"tooltip": true,
|
||||
"format": "{:%H.%M}",
|
||||
"tooltip-format": "{:%Y-%m-%d}",
|
||||
}
|
||||
```
|
||||
|
||||
@@ -219,7 +219,7 @@ View all valid format options in *strftime(3)* or have a look <https://fmt.dev/l
|
||||
# Troubleshooting
|
||||
|
||||
If clock module is disabled at startup with locale::facet::\_S\_create\_c\_locale ++
|
||||
name not valid error message try one of the followings:
|
||||
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)
|
||||
@@ -238,31 +238,31 @@ 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"
|
||||
}
|
||||
},
|
||||
"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
|
||||
|
||||
@@ -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.
|
||||
|
||||
|
||||
@@ -33,19 +33,19 @@ Addressed by *disk*
|
||||
|
||||
*states*: ++
|
||||
typeof: object ++
|
||||
A number of disk utilization states which get activated on certain percentage thresholds (percentage_used). See *waybar-states(5)*.
|
||||
A number of disk utilization states that get activated on certain percentage thresholds (percentage_used). See *waybar-states(5)*.
|
||||
|
||||
*max-length*: ++
|
||||
typeof: integer ++
|
||||
The maximum length in character the module should display.
|
||||
|
||||
*min-length*: ++
|
||||
typeof: integer ++
|
||||
The minimum length in characters the module should take up.
|
||||
typeof: integer ++
|
||||
The minimum length in characters the module should accept.
|
||||
|
||||
*align*: ++
|
||||
typeof: float ++
|
||||
The alignment of the text, where 0 is left-aligned and 1 is right-aligned. If the module is rotated, it will follow the flow of the text.
|
||||
typeof: float ++
|
||||
The alignment of the 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 ++
|
||||
@@ -57,7 +57,7 @@ Addressed by *disk*
|
||||
|
||||
*on-click-right*: ++
|
||||
typeof: string ++
|
||||
Command to execute when you right clicked on the module.
|
||||
Command to execute when you right-click on the module.
|
||||
|
||||
*on-update*: ++
|
||||
typeof: string ++
|
||||
@@ -85,20 +85,30 @@ Addressed by *disk*
|
||||
default: "{used} out of {total} used ({percentage_used}%)" ++
|
||||
The format of the information displayed in the tooltip.
|
||||
|
||||
*unit*: ++
|
||||
typeof: string ++
|
||||
Use with specific_free, specific_used, and specific_total to force calculation to always be in a certain unit. Accepts kB, kiB, MB, Mib, GB, GiB, TB, TiB.
|
||||
|
||||
# FORMAT REPLACEMENTS
|
||||
|
||||
*{percentage_used}*: Percentage of disk in use.
|
||||
|
||||
*{percentage_free}*: Percentage of free disk space
|
||||
|
||||
*{total}*: Total amount of space on the disk, partition or mountpoint.
|
||||
*{total}*: Total amount of space on the disk, partition, or mountpoint. Automatically selects unit based on size remaining.
|
||||
|
||||
*{used}*: Amount of used disk space.
|
||||
*{used}*: Amount of used disk space. Automatically selects unit based on size remaining.
|
||||
|
||||
*{free}*: Amount of available disk space for normal users.
|
||||
*{free}*: Amount of available disk space for normal users. Automatically selects unit based on size remaining.
|
||||
|
||||
*{path}*: The path specified in the configuration.
|
||||
|
||||
*{specific_total}*: Total amount of space on the disk, partition, or mountpoint in a specific unit. Defaults to bytes.
|
||||
|
||||
*{specific_used}*: Amount of used disk space in a specific unit. Defaults to bytes.
|
||||
|
||||
*{specific_free}*: Amount of available disk space for normal users in a specific unit. Defaults to bytes.
|
||||
|
||||
# EXAMPLES
|
||||
|
||||
```
|
||||
@@ -108,6 +118,15 @@ Addressed by *disk*
|
||||
}
|
||||
```
|
||||
|
||||
```
|
||||
"disk": {
|
||||
"interval": 30,
|
||||
"format": "{specific_free:0.2f} GB out of {specific_total:0.2f} GB available. Alternatively {free} out of {total} available",
|
||||
"unit": "GB"
|
||||
// 1434.25 GB out of 2000.00 GB available. Alternatively 1.4TiB out of 1.9TiB available.
|
||||
}
|
||||
```
|
||||
|
||||
# STYLE
|
||||
|
||||
- *#disk*
|
||||
|
||||
@@ -13,24 +13,24 @@ The *tags* module displays the current state of tags in dwl.
|
||||
Addressed by *dwl/tags*
|
||||
|
||||
*num-tags*: ++
|
||||
typeof: uint ++
|
||||
default: 9 ++
|
||||
The number of tags that should be displayed. Max 32.
|
||||
typeof: uint ++
|
||||
default: 9 ++
|
||||
The number of tags that should be displayed. Max 32.
|
||||
|
||||
*tag-labels*: ++
|
||||
typeof: array ++
|
||||
The label to display for each tag.
|
||||
typeof: array ++
|
||||
The label to display for each tag.
|
||||
|
||||
*disable-click*: ++
|
||||
typeof: bool ++
|
||||
default: false ++
|
||||
If set to false, you can left click to set focused tag. Right click to toggle tag focus. If set to true this behaviour is disabled.
|
||||
typeof: bool ++
|
||||
default: false ++
|
||||
If set to false, you can left-click to set focused tag. Right-click to toggle tag focus. If set to true this behaviour is disabled.
|
||||
|
||||
# EXAMPLE
|
||||
|
||||
```
|
||||
"dwl/tags": {
|
||||
"num-tags": 5
|
||||
"num-tags": 5
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@@ -65,11 +65,11 @@ Feral Gamemode optimizations.
|
||||
|
||||
*{glyph}*: The string icon glyph to use instead.
|
||||
|
||||
*{count}*: The amount of games running with gamemode optimizations.
|
||||
*{count}*: The number of games running with gamemode optimizations.
|
||||
|
||||
# TOOLTIP FORMAT REPLACEMENTS
|
||||
|
||||
*{count}*: The amount of games running with gamemode optimizations.
|
||||
*{count}*: The number of games running with gamemode optimizations.
|
||||
|
||||
# EXAMPLES
|
||||
|
||||
|
||||
@@ -18,12 +18,12 @@ Addressed by *hyprland/language*
|
||||
The format, how information should be displayed.
|
||||
|
||||
*format-<lang>* ++
|
||||
typeof: string++
|
||||
Provide an alternative name to display per language where <lang> is the language of your choosing. Can be passed multiple times with multiple languages as shown by the example below.
|
||||
typeof: string++
|
||||
Provide an alternative name to display per language where <lang> is the language of your choosing. Can be passed multiple times with multiple languages as shown by the example below.
|
||||
|
||||
*keyboard-name*: ++
|
||||
typeof: string ++
|
||||
Specifies which keyboard to use from hyprctl devices output. Using the option that begins with "at-translated-set..." is recommended.
|
||||
typeof: string ++
|
||||
Specifies which keyboard to use from hyprctl devices output. Using the option that begins with "at-translated-set..." is recommended.
|
||||
|
||||
|
||||
# FORMAT REPLACEMENTS
|
||||
@@ -41,10 +41,10 @@ Addressed by *hyprland/language*
|
||||
|
||||
```
|
||||
"hyprland/language": {
|
||||
"format": "Lang: {long}"
|
||||
"format-en": "AMERICA, HELL YEAH!"
|
||||
"format-tr": "As bayrakları"
|
||||
"keyboard-name": "at-translated-set-2-keyboard"
|
||||
"format": "Lang: {long}"
|
||||
"format-en": "AMERICA, HELL YEAH!"
|
||||
"format-tr": "As bayrakları"
|
||||
"keyboard-name": "at-translated-set-2-keyboard"
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@@ -26,12 +26,12 @@ Addressed by *hyprland/submap*
|
||||
The maximum length in character the module should display.
|
||||
|
||||
*min-length*: ++
|
||||
typeof: integer ++
|
||||
The minimum length in characters the module should take up.
|
||||
typeof: integer ++
|
||||
The minimum length in characters the module should accept.
|
||||
|
||||
*align*: ++
|
||||
typeof: float ++
|
||||
The alignment of the text, where 0 is left-aligned and 1 is right-aligned. If the module is rotated, it will follow the flow of the text.
|
||||
typeof: float ++
|
||||
The alignment of the 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 ++
|
||||
@@ -43,7 +43,7 @@ Addressed by *hyprland/submap*
|
||||
|
||||
*on-click-right*: ++
|
||||
typeof: string ++
|
||||
Command to execute when you right clicked on the module.
|
||||
Command to execute when you right-click on the module.
|
||||
|
||||
*on-update*: ++
|
||||
typeof: string ++
|
||||
@@ -71,9 +71,9 @@ Addressed by *hyprland/submap*
|
||||
|
||||
```
|
||||
"hyprland/submap": {
|
||||
"format": "✌️ {}",
|
||||
"max-length": 8,
|
||||
"tooltip": false
|
||||
"format": "✌️ {}",
|
||||
"max-length": 8,
|
||||
"tooltip": false
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@@ -14,13 +14,38 @@ Addressed by *hyprland/window*
|
||||
|
||||
*format*: ++
|
||||
typeof: string ++
|
||||
default: {} ++
|
||||
default: {title} ++
|
||||
The format, how information should be displayed. On {} the current window title is displayed.
|
||||
|
||||
*rewrite*: ++
|
||||
typeof: object ++
|
||||
Rules to rewrite window title. See *rewrite rules*.
|
||||
|
||||
*separate-outputs*: ++
|
||||
typeof: bool ++
|
||||
Show the active window of the monitor the bar belongs to, instead of the focused window.
|
||||
|
||||
*icon*: ++
|
||||
typeof: bool ++
|
||||
default: false ++
|
||||
Option to hide the application icon.
|
||||
|
||||
*icon-size*: ++
|
||||
typeof: integer ++
|
||||
default: 24 ++
|
||||
Option to change the size of the application icon.
|
||||
|
||||
# FORMAT REPLACEMENTS
|
||||
See the output of "hyprctl clients" for examples
|
||||
|
||||
*{title}*: The current title of the focused window.
|
||||
|
||||
*{initialTitle}*: The initial title of the focused window.
|
||||
|
||||
*{class}*: The current class of the focused window.
|
||||
|
||||
*{initialClass}*: The initial class of the focused window.
|
||||
|
||||
# REWRITE RULES
|
||||
|
||||
*rewrite* is an object where keys are regular expressions and values are
|
||||
@@ -37,14 +62,28 @@ Invalid expressions (e.g., mismatched parentheses) are skipped.
|
||||
|
||||
```
|
||||
"hyprland/window": {
|
||||
"format": "{}",
|
||||
"rewrite": {
|
||||
"(.*) - Mozilla Firefox": "🌎 $1",
|
||||
"(.*) - zsh": "> [$1]"
|
||||
}
|
||||
"format": "{}",
|
||||
"rewrite": {
|
||||
"(.*) - Mozilla Firefox": "🌎 $1",
|
||||
"(.*) - zsh": "> [$1]"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
# STYLE
|
||||
|
||||
- *#window*
|
||||
- *window#waybar.empty #window* When no windows are in the workspace
|
||||
|
||||
The following classes are applied to the entire Waybar rather than just the
|
||||
window widget:
|
||||
|
||||
- *window#waybar.empty* When no windows are in the workspace
|
||||
- *window#waybar.solo* When one tiled window is visible in the workspace
|
||||
(floating windows may be present)
|
||||
- *window#waybar.<app_id>* Where *<app_id>* is the *class* (e.g. *chromium*) of
|
||||
the solo tiled window in the workspace (use *hyprctl clients* to see classes)
|
||||
- *window#waybar.floating* When there are only floating windows in the workspace
|
||||
- *window#waybar.fullscreen* When there is a fullscreen window in the workspace;
|
||||
useful with Hyprland's *fullscreen, 1* mode
|
||||
- *window#waybar.swallowing* When there is a swallowed window in the workspace
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
waybar-wlr-workspaces(5)
|
||||
waybar-hyprland-workspaces(5)
|
||||
|
||||
# NAME
|
||||
|
||||
@@ -19,25 +19,75 @@ Addressed by *hyprland/workspaces*
|
||||
|
||||
*format-icons*: ++
|
||||
typeof: array ++
|
||||
Based on the workspace id and state, the corresponding icon gets selected. See *icons*.
|
||||
Based on the workspace ID and state, the corresponding icon gets selected. See *icons*.
|
||||
|
||||
*window-rewrite*: ++
|
||||
typeof: object ++
|
||||
Regex rules to map window class to an icon or preferred method of representation for a workspace's window.
|
||||
Keys are the rules, while the values are the methods of representation.
|
||||
Rules may specify `class<...>`, `title<...>`, or both in order to fine-tune the matching.
|
||||
|
||||
*window-rewrite-default*:
|
||||
typeof: string ++
|
||||
default: "?" ++
|
||||
The default method of representation for a workspace's window. This will be used for windows whose classes do not match any of the rules in *window-rewrite*.
|
||||
|
||||
*format-window-separator*: ++
|
||||
typeof: string ++
|
||||
default: " " ++
|
||||
The separator to be used between windows in a workspace.
|
||||
|
||||
*show-special*: ++
|
||||
typeof: bool ++
|
||||
default: false ++
|
||||
If set to true, special workspaces will be shown.
|
||||
|
||||
*all-outputs*: ++
|
||||
typeof: bool ++
|
||||
default: false ++
|
||||
If set to false workspaces group will be shown only in assigned output. Otherwise, all workspace groups are shown.
|
||||
|
||||
*active-only*: ++
|
||||
typeof: bool ++
|
||||
default: false ++
|
||||
If set to true, only the active workspace will be shown.
|
||||
|
||||
*ignore-workspaces*: ++
|
||||
typeof: array ++
|
||||
default: [] ++
|
||||
Regexes to match against workspaces names. If there's a match, the workspace will not be shown. This takes precedence over *show-special*, *all-outputs*, and *active-only*.
|
||||
|
||||
*sort-by*: ++
|
||||
typeof: string ++
|
||||
default: "default" ++
|
||||
If set to number, workspaces will sort by number.
|
||||
If set to name, workspaces will sort by name.
|
||||
If set to id, workspaces will sort by id.
|
||||
If none of those, workspaces will sort with default behavior.
|
||||
|
||||
# FORMAT REPLACEMENTS
|
||||
|
||||
*{id}*: id of workspace assigned by compositor
|
||||
|
||||
*{name}*: workspace name assigned by compositor
|
||||
|
||||
*{icon}*: Icon, as defined in *format-icons*.
|
||||
|
||||
# ICONS
|
||||
|
||||
Additional to workspace name matching, the following *format-icons* can be set.
|
||||
|
||||
- *default*: Will be shown, when no string match is found.
|
||||
- *default*: Will be shown, when no string match is found and none of the below conditions have defined icons.
|
||||
- *active*: Will be shown, when workspace is active
|
||||
- *special*: Will be shown on non-active special workspaces
|
||||
- *empty*: Will be shown on non-active, non-special empty persistent workspaces
|
||||
- *visible*: Will be shown on workspaces that are visible but not active. For example: this is useful if you want your visible workspaces on other monitors to have the same look as active.
|
||||
- *persistent*: Will be shown on non-empty persistent workspaces
|
||||
|
||||
# EXAMPLES
|
||||
|
||||
```
|
||||
"wlr/workspaces": {
|
||||
"hyprland/workspaces": {
|
||||
"format": "{name}: {icon}",
|
||||
"format-icons": {
|
||||
"1": "",
|
||||
@@ -48,7 +98,52 @@ Additional to workspace name matching, the following *format-icons* can be set.
|
||||
"active": "",
|
||||
"default": ""
|
||||
},
|
||||
"sort-by-number": true
|
||||
"persistent-workspaces": {
|
||||
"*": 5, // 5 workspaces by default on every monitor
|
||||
"HDMI-A-1": 3 // but only three on HDMI-A-1
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
```
|
||||
"hyprland/workspaces": {
|
||||
"format": "{name}: {icon}",
|
||||
"format-icons": {
|
||||
"1": "",
|
||||
"2": "",
|
||||
"3": "",
|
||||
"4": "",
|
||||
"5": "",
|
||||
"active": "",
|
||||
"default": ""
|
||||
},
|
||||
"persistent-workspaces": {
|
||||
"*": [ 2,3,4,5 ], // 2-5 on every monitor
|
||||
"HDMI-A-1": [ 1 ] // but only workspace 1 on HDMI-A-1
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
```
|
||||
"hyprland/workspaces": {
|
||||
"format": "{name}\n{windows}",
|
||||
"format-window-separator": "\n",
|
||||
"window-rewrite-default": "",
|
||||
"window-rewrite": {
|
||||
"title<.*youtube.*>": "", // Windows whose titles contain "youtube"
|
||||
"class<firefox>": "", // Windows whose classes are "firefox"
|
||||
"class<firefox> title<.*github.*>": "", // Windows whose class is "firefox" and title contains "github". Note that "class" always comes first.
|
||||
"foot": "", // Windows that contain "foot" in either class or title. For optimization reasons, it will only match against a title if at least one other window explicitly matches against a title.
|
||||
"code": "",
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
"hyprland/workspaces": {
|
||||
// Formatting omitted for brevity
|
||||
"ignore-workspaces": [
|
||||
"(special:)?chrome-sharing-indicator"
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
@@ -57,3 +152,8 @@ Additional to workspace name matching, the following *format-icons* can be set.
|
||||
- *#workspaces*
|
||||
- *#workspaces button*
|
||||
- *#workspaces button.active*
|
||||
- *#workspaces button.empty*
|
||||
- *#workspaces button.visible*
|
||||
- *#workspaces button.persistent*
|
||||
- *#workspaces button.special*
|
||||
- *#workspaces button.urgent*
|
||||
|
||||
@@ -6,8 +6,8 @@ waybar - idle_inhibitor module
|
||||
|
||||
# DESCRIPTION
|
||||
|
||||
The *idle_inhibitor* module can inhibiting the idle behavior such as screen blanking, locking, and
|
||||
screensaving, also known as "presentation mode".
|
||||
The *idle_inhibitor* module can inhibit the idle behavior such as screen blanking, locking, and
|
||||
screensaver, also known as "presentation mode".
|
||||
|
||||
# CONFIGURATION
|
||||
|
||||
@@ -28,12 +28,12 @@ screensaving, also known as "presentation mode".
|
||||
The maximum length in character the module should display.
|
||||
|
||||
*min-length*: ++
|
||||
typeof: integer ++
|
||||
The minimum length in characters the module should take up.
|
||||
typeof: integer ++
|
||||
The minimum length in characters the module should accept.
|
||||
|
||||
*align*: ++
|
||||
typeof: float ++
|
||||
The alignment of the text, where 0 is left-aligned and 1 is right-aligned. If the module is rotated, it will follow the flow of the text.
|
||||
typeof: float ++
|
||||
The alignment of the 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 ++
|
||||
@@ -45,7 +45,7 @@ screensaving, also known as "presentation mode".
|
||||
|
||||
*on-click-right*: ++
|
||||
typeof: string ++
|
||||
Command to execute when you right clicked on the module.
|
||||
Command to execute when you right-click on the module.
|
||||
|
||||
*on-update*: ++
|
||||
typeof: string ++
|
||||
@@ -64,13 +64,13 @@ screensaving, also known as "presentation mode".
|
||||
Threshold to be used when scrolling.
|
||||
|
||||
*start-activated*: ++
|
||||
typeof: bool ++
|
||||
default: *false* ++
|
||||
Whether the inhibit should be activated when starting waybar.
|
||||
typeof: bool ++
|
||||
default: *false* ++
|
||||
Whether the inhibit should be activated when starting waybar.
|
||||
|
||||
*timeout*: ++
|
||||
typeof: double ++
|
||||
The number of minutes the inhibit should last.
|
||||
The number of minutes the inhibition should last.
|
||||
|
||||
*tooltip*: ++
|
||||
typeof: bool ++
|
||||
@@ -97,8 +97,8 @@ screensaving, also known as "presentation mode".
|
||||
"idle_inhibitor": {
|
||||
"format": "{icon}",
|
||||
"format-icons": {
|
||||
"activated": "",
|
||||
"deactivated": ""
|
||||
"activated": "",
|
||||
"deactivated": ""
|
||||
},
|
||||
"timeout": 30.5
|
||||
}
|
||||
|
||||
@@ -13,24 +13,26 @@ The *image* module displays an image from a path.
|
||||
*path*: ++
|
||||
typeof: string ++
|
||||
The path to the image.
|
||||
|
||||
*exec*: ++
|
||||
typeof: string ++
|
||||
The path to the script, which should return image path file
|
||||
it will only execute if the path is not set
|
||||
The path to the script, which should return image path file. ++
|
||||
It will only execute if the path is not set
|
||||
|
||||
*size*: ++
|
||||
typeof: integer ++
|
||||
The width/height to render the image.
|
||||
|
||||
*interval*: ++
|
||||
typeof: integer ++
|
||||
The interval (in seconds) to re-render the image.
|
||||
This is useful if the contents of *path* changes.
|
||||
The interval (in seconds) to re-render the image. ++
|
||||
This is useful if the contents of *path* changes. ++
|
||||
If no *interval* is defined, the image will only be rendered once.
|
||||
|
||||
*signal*: ++
|
||||
typeof: integer ++
|
||||
The signal number used to update the module.
|
||||
This can be used instead of *interval* if the file changes irregularly.
|
||||
The signal number used to update the module. ++
|
||||
This can be used instead of *interval* if the file changes irregularly. ++
|
||||
The number is valid between 1 and N, where *SIGRTMIN+N* = *SIGRTMAX*.
|
||||
|
||||
*on-click*: ++
|
||||
@@ -64,7 +66,7 @@ The *image* module displays an image from a path.
|
||||
|
||||
# SCRIPT OUTPUT
|
||||
|
||||
Similar to the *custom* module, output values of the script is *newline* separated.
|
||||
Similar to the *custom* module, output values of the script are *newline* separated.
|
||||
The following is the output format:
|
||||
|
||||
```
|
||||
|
||||
@@ -33,7 +33,7 @@ See *systemd-inhibit*(1) for more information.
|
||||
|
||||
*min-length*: ++
|
||||
typeof: integer ++
|
||||
The minimum length in characters the module should take up.
|
||||
The minimum length in characters the module should accept.
|
||||
|
||||
*align*: ++
|
||||
typeof: float ++
|
||||
@@ -49,7 +49,7 @@ See *systemd-inhibit*(1) for more information.
|
||||
|
||||
*on-click-right*: ++
|
||||
typeof: string ++
|
||||
Command to execute when you right clicked on the module.
|
||||
Command to execute when you right-click on the module.
|
||||
|
||||
*on-update*: ++
|
||||
typeof: string ++
|
||||
@@ -85,8 +85,8 @@ See *systemd-inhibit*(1) for more information.
|
||||
"what": "handle-lid-switch",
|
||||
"format": "{icon}",
|
||||
"format-icons": {
|
||||
"activated": "",
|
||||
"deactivated": ""
|
||||
"activated": "",
|
||||
"deactivated": ""
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
@@ -13,73 +13,73 @@ The *jack* module displays the current state of the JACK server.
|
||||
Addressed by *jack*
|
||||
|
||||
*format*: ++
|
||||
typeof: string ++
|
||||
default: *{load}%* ++
|
||||
The format, how information should be displayed. This format is used when other formats aren't specified.
|
||||
typeof: string ++
|
||||
default: *{load}%* ++
|
||||
The format, how information should be displayed. This format is used when other formats aren't specified.
|
||||
|
||||
*format-connected*: ++
|
||||
typeof: string ++
|
||||
This format is used when the module is connected to the JACK server.
|
||||
typeof: string ++
|
||||
This format is used when the module is connected to the JACK server.
|
||||
|
||||
*format-disconnected*: ++
|
||||
typeof: string ++
|
||||
This format is used when the module is not connected to the JACK server.
|
||||
typeof: string ++
|
||||
This format is used when the module is not connected to the JACK server.
|
||||
|
||||
*format-xrun*: ++
|
||||
typeof: string ++
|
||||
This format is used for one polling interval, when the JACK server reports an xrun.
|
||||
typeof: string ++
|
||||
This format is used for one polling interval when the JACK server reports an xrun.
|
||||
|
||||
*realtime*: ++
|
||||
typeof: bool ++
|
||||
default: *true* ++
|
||||
Option to drop real-time privileges for the JACK client opened by Waybar.
|
||||
typeof: bool ++
|
||||
default: *true* ++
|
||||
Option to drop real-time privileges for the JACK client opened by Waybar.
|
||||
|
||||
*tooltip*: ++
|
||||
typeof: bool ++
|
||||
default: *true* ++
|
||||
Option to disable tooltip on hover.
|
||||
typeof: bool ++
|
||||
default: *true* ++
|
||||
Option to disable tooltip on hover.
|
||||
|
||||
*tooltip-format*: ++
|
||||
typeof: string ++
|
||||
default: *{bufsize}/{samplerate} {latency}ms* ++
|
||||
The format of information displayed in the tooltip.
|
||||
typeof: string ++
|
||||
default: *{bufsize}/{samplerate} {latency}ms* ++
|
||||
The format of information displayed in the tooltip.
|
||||
|
||||
*interval*: ++
|
||||
typeof: integer ++
|
||||
default: 1 ++
|
||||
The interval in which the information gets polled.
|
||||
typeof: integer ++
|
||||
default: 1 ++
|
||||
The interval in which the information gets polled.
|
||||
|
||||
*rotate*: ++
|
||||
typeof: integer ++
|
||||
Positive value to rotate the text label.
|
||||
typeof: integer ++
|
||||
Positive value to rotate the text label.
|
||||
|
||||
*max-length*: ++
|
||||
typeof: integer ++
|
||||
The maximum length in character the module should display.
|
||||
typeof: integer ++
|
||||
The maximum length in character the module should display.
|
||||
|
||||
*min-length*: ++
|
||||
typeof: integer ++
|
||||
The minimum length in characters the module should take up.
|
||||
typeof: integer ++
|
||||
The minimum length in characters the module should accept.
|
||||
|
||||
*align*: ++
|
||||
typeof: float ++
|
||||
The alignment of the text, where 0 is left-aligned and 1 is right-aligned. If the module is rotated, it will follow the flow of the text.
|
||||
typeof: float ++
|
||||
The alignment of the 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 ++
|
||||
Command to execute when clicked on the module.
|
||||
typeof: string ++
|
||||
Command to execute when clicked on the module.
|
||||
|
||||
*on-click-middle*: ++
|
||||
typeof: string ++
|
||||
Command to execute when middle-clicked on the module using mousewheel.
|
||||
typeof: string ++
|
||||
Command to execute when middle-clicked on the module using mousewheel.
|
||||
|
||||
*on-click-right*: ++
|
||||
typeof: string ++
|
||||
Command to execute when you right clicked on the module.
|
||||
typeof: string ++
|
||||
Command to execute when you right-click on the module.
|
||||
|
||||
*on-update*: ++
|
||||
typeof: string ++
|
||||
Command to execute when the module is updated.
|
||||
typeof: string ++
|
||||
Command to execute when the module is updated.
|
||||
|
||||
# FORMAT REPLACEMENTS
|
||||
|
||||
@@ -87,7 +87,7 @@ Addressed by *jack*
|
||||
|
||||
*{bufsize}*: The size of the JACK buffer.
|
||||
|
||||
*{samplerate}*: The samplerate at which the JACK server is running.
|
||||
*{samplerate}*: The sample rate at which the JACK server is running.
|
||||
|
||||
*{latency}*: The duration, in ms, of the current buffer size.
|
||||
|
||||
@@ -97,10 +97,10 @@ Addressed by *jack*
|
||||
|
||||
```
|
||||
"jack": {
|
||||
"format": "DSP {}%",
|
||||
"format-xrun": "{xruns} xruns",
|
||||
"format-disconnected": "DSP off",
|
||||
"realtime": true
|
||||
"format": "DSP {}%",
|
||||
"format-xrun": "{xruns} xruns",
|
||||
"format-disconnected": "DSP off",
|
||||
"realtime": true
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ You must be a member of the input group to use this module.
|
||||
# CONFIGURATION
|
||||
|
||||
*interval*: ++
|
||||
Deprecated, this module use event loop now, the interval has no effect.
|
||||
Deprecated, this module uses event loop now, the interval has no effect.
|
||||
typeof: integer ++
|
||||
default: 1 ++
|
||||
The interval, in seconds, to poll the keyboard state.
|
||||
@@ -48,6 +48,11 @@ You must be a member of the input group to use this module.
|
||||
default: chooses first valid input device ++
|
||||
Which libevdev input device to show the state of. Libevdev devices can be found in /dev/input. The device should support number lock, caps lock, and scroll lock events.
|
||||
|
||||
*binding-keys*: ++
|
||||
typeof: array ++
|
||||
default: [58, 69, 70] ++
|
||||
Customize the key to trigger this module, the key number can be found in /usr/include/linux/input-event-codes.h or running sudo libinput debug-events --show-keycodes.
|
||||
|
||||
# FORMAT REPLACEMENTS
|
||||
|
||||
*{name}*: Caps, Num, or Scroll.
|
||||
@@ -65,13 +70,13 @@ The following *format-icons* can be set.
|
||||
|
||||
```
|
||||
"keyboard-state": {
|
||||
"numlock": true,
|
||||
"capslock": true,
|
||||
"format": "{name} {icon}",
|
||||
"format-icons": {
|
||||
"locked": "",
|
||||
"unlocked": ""
|
||||
}
|
||||
"numlock": true,
|
||||
"capslock": true,
|
||||
"format": "{name} {icon}",
|
||||
"format-icons": {
|
||||
"locked": "",
|
||||
"unlocked": ""
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@@ -40,12 +40,12 @@ Addressed by *memory*
|
||||
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 ++
|
||||
@@ -57,7 +57,7 @@ Addressed by *memory*
|
||||
|
||||
*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 ++
|
||||
|
||||
@@ -99,7 +99,7 @@ Addressed by *mpd*
|
||||
|
||||
*min-length*: ++
|
||||
typeof: integer ++
|
||||
The minimum length in characters the module should take up.
|
||||
The minimum length in characters the module should accept.
|
||||
|
||||
*align*: ++
|
||||
typeof: float ++
|
||||
@@ -115,7 +115,7 @@ Addressed by *mpd*
|
||||
|
||||
*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 ++
|
||||
@@ -182,7 +182,7 @@ Addressed by *mpd*
|
||||
|
||||
*{queueLength}*: The length of the current queue.
|
||||
|
||||
*{stateIcon}*: The icon corresponding the playing or paused status of the player (see *state-icons* option)
|
||||
*{stateIcon}*: The icon corresponding to the playing or paused status of the player (see *state-icons* option)
|
||||
|
||||
*{consumeIcon}*: The icon corresponding the "consume" option (see *consume-icons* option)
|
||||
|
||||
|
||||
@@ -13,8 +13,7 @@ The *mpris* module displays currently playing media via libplayerctl.
|
||||
*player*: ++
|
||||
typeof: string ++
|
||||
default: playerctld ++
|
||||
Name of the MPRIS player to attach to. Using the default value always
|
||||
follows the currenly active player.
|
||||
Name of the MPRIS player to attach to. Using the default value always follows the currently active player.
|
||||
|
||||
*ignored-players*: ++
|
||||
typeof: []string ++
|
||||
@@ -22,6 +21,7 @@ The *mpris* module displays currently playing media via libplayerctl.
|
||||
|
||||
*interval*: ++
|
||||
typeof: integer ++
|
||||
default: 0 ++
|
||||
Refresh MPRIS information on a timer.
|
||||
|
||||
*format*: ++
|
||||
@@ -49,18 +49,15 @@ The *mpris* module displays currently playing media via libplayerctl.
|
||||
|
||||
*artist-len*: ++
|
||||
typeof: integer ++
|
||||
Maximum length of the Artist tag (Wide/Fullwidth Unicode characters
|
||||
count as two). Set to zero to hide the artist in `{dynamic}` tag.
|
||||
Maximum length of the Artist tag (Wide/Fullwidth Unicode characters count as two). Set to zero to hide the artist in `{dynamic}` tag.
|
||||
|
||||
*album-len*: ++
|
||||
typeof: integer ++
|
||||
Maximum length of the Album tag (Wide/Fullwidth Unicode characters count
|
||||
as two). Set to zero to hide the album in `{dynamic}` tag.
|
||||
Maximum length of the Album tag (Wide/Fullwidth Unicode characters count as two). Set to zero to hide the album in `{dynamic}` tag.
|
||||
|
||||
*title-len*: ++
|
||||
typeof: integer ++
|
||||
Maximum length of the Title tag (Wide/Fullwidth Unicode characters count
|
||||
as two). Set to zero to hide the title in `{dynamic}` tag.
|
||||
Maximum length of the Title tag (Wide/Fullwidth Unicode characters count as two). Set to zero to hide the title in `{dynamic}` tag.
|
||||
|
||||
*dynamic-len*: ++
|
||||
typeof: integer ++
|
||||
@@ -101,14 +98,12 @@ The *mpris* module displays currently playing media via libplayerctl.
|
||||
*enable-tooltip-len-limits*: ++
|
||||
typeof: bool ++
|
||||
default: false ++
|
||||
Option to enable the length limits for the tooltip as well. By default
|
||||
the tooltip ignores all length limits.
|
||||
Option to enable the length limits for the tooltip as well. By default, the tooltip ignores all length limits.
|
||||
|
||||
*ellipsis*: ++
|
||||
typeof: string ++
|
||||
default: "…" ++
|
||||
This character will be used when any of the tags exceed their maximum
|
||||
length. If you don't want to use an ellipsis, set this to empty string.
|
||||
This character will be used when any of the tags exceed their maximum length. If you don't want to use an ellipsis, set this to empty string.
|
||||
|
||||
*rotate*: ++
|
||||
typeof: integer ++
|
||||
@@ -120,11 +115,11 @@ The *mpris* module displays currently playing media via libplayerctl.
|
||||
|
||||
*min-length*: ++
|
||||
typeof: integer ++
|
||||
The minimum length in characters the module should take up.
|
||||
The minimum length in characters the module should accept.
|
||||
|
||||
*align*: ++
|
||||
typeof: float ++
|
||||
The alignment of the text, where 0 is left-aligned and 1 is right-aligned.
|
||||
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*: ++
|
||||
@@ -132,12 +127,12 @@ The *mpris* module displays currently playing media via libplayerctl.
|
||||
default: play-pause ++
|
||||
Overwrite default action toggles.
|
||||
|
||||
*on-middle-click*: ++
|
||||
*on-click-middle*: ++
|
||||
typeof: string ++
|
||||
default: previous track ++
|
||||
Overwrite default action toggles.
|
||||
|
||||
*on-right-click*: ++
|
||||
*on-click-right*: ++
|
||||
typeof: string ++
|
||||
default: next track ++
|
||||
Overwrite default action toggles.
|
||||
@@ -148,8 +143,7 @@ The *mpris* module displays currently playing media via libplayerctl.
|
||||
|
||||
*status-icons*: ++
|
||||
typeof: map[string]string ++
|
||||
Allows setting _{status-icon}_ based on player status (playing, paused,
|
||||
stopped).
|
||||
Allows setting _{status-icon}_ based on player status (playing, paused, stopped).
|
||||
|
||||
|
||||
# FORMAT REPLACEMENTS
|
||||
@@ -167,7 +161,7 @@ The *mpris* module displays currently playing media via libplayerctl.
|
||||
*{length}*: Length of the track, formatted as HH:MM:SS
|
||||
|
||||
*{dynamic}*: Use _{artist}_, _{album}_, _{title}_ and _{length}_, automatically omit++
|
||||
empty values
|
||||
empty values
|
||||
|
||||
*{player_icon}*: Chooses an icon from _player-icons_ based on _{player}_
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ Addressed by *network*
|
||||
|
||||
*interface*: ++
|
||||
typeof: string ++
|
||||
Use the defined interface instead of auto detection. Accepts wildcard.
|
||||
Use the defined interface instead of auto-detection. Accepts wildcard.
|
||||
|
||||
*interval*: ++
|
||||
typeof: integer ++
|
||||
@@ -41,7 +41,7 @@ Addressed by *network*
|
||||
|
||||
*format-linked*: ++
|
||||
typeof: string ++
|
||||
This format is used when a linked interface with no ip address is displayed.
|
||||
This format is used when a linked interface with no IP address is displayed.
|
||||
|
||||
*format-disconnected*: ++
|
||||
typeof: string ++
|
||||
@@ -65,12 +65,12 @@ Addressed by *network*
|
||||
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 ++
|
||||
@@ -82,7 +82,7 @@ Addressed by *network*
|
||||
|
||||
*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 ++
|
||||
|
||||
83
man/waybar-pulseaudio-slider.5.scd
Normal file
83
man/waybar-pulseaudio-slider.5.scd
Normal file
@@ -0,0 +1,83 @@
|
||||
waybar-pulseaudio-slider(5)
|
||||
|
||||
# NAME
|
||||
|
||||
waybar - pulseaudio slider module
|
||||
|
||||
# DESCRIPTION
|
||||
|
||||
The *pulseaudio slider* module displays and controls the current volume of the default sink or source as a bar.
|
||||
|
||||
The volume 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`.
|
||||
|
||||
# EXAMPLES
|
||||
|
||||
```
|
||||
"modules-right": [
|
||||
"pulseaudio-slider",
|
||||
],
|
||||
"pulseaudio/slider": {
|
||||
"min": 0,
|
||||
"max": 100,
|
||||
"orientation": "horizontal"
|
||||
}
|
||||
```
|
||||
|
||||
# STYLE
|
||||
|
||||
The slider is a component with multiple CSS Nodes, of which the following are exposed:
|
||||
|
||||
*#pulseaudio-slider*: ++
|
||||
Controls the style of the box *around* the slider and bar.
|
||||
|
||||
*#pulseaudio-slider slider*: ++
|
||||
Controls the style of the slider handle.
|
||||
|
||||
*#pulseaudio-slider trough*: ++
|
||||
Controls the style of the part of the bar that has not been filled.
|
||||
|
||||
*#pulseaudio-slider highlight*: ++
|
||||
Controls the style of the part of the bar that has been filled.
|
||||
|
||||
## STYLE EXAMPLE
|
||||
|
||||
```
|
||||
#pulseaudio-slider slider {
|
||||
min-height: 0px;
|
||||
min-width: 0px;
|
||||
opacity: 0;
|
||||
background-image: none;
|
||||
border: none;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
#pulseaudio-slider trough {
|
||||
min-height: 80px;
|
||||
min-width: 10px;
|
||||
border-radius: 5px;
|
||||
background-color: black;
|
||||
}
|
||||
|
||||
#pulseaudio-slider highlight {
|
||||
min-width: 10px;
|
||||
border-radius: 5px;
|
||||
background-color: green;
|
||||
}
|
||||
```
|
||||
@@ -8,7 +8,7 @@ waybar - pulseaudio module
|
||||
|
||||
The *pulseaudio* module displays the current volume reported by PulseAudio.
|
||||
|
||||
Additionally you can control the volume by scrolling *up* or *down* while the cursor is over the module.
|
||||
Additionally, you can control the volume by scrolling *up* or *down* while the cursor is over the module.
|
||||
|
||||
# CONFIGURATION
|
||||
|
||||
@@ -36,7 +36,7 @@ Additionally you can control the volume by scrolling *up* or *down* while the cu
|
||||
|
||||
*format-icons*: ++
|
||||
typeof: array ++
|
||||
Based on the current port-name and volume, the corresponding icon gets selected. The order is *low* to *high*. See *Icons*.
|
||||
Based on the current port name and volume, the corresponding icon gets selected. The order is *low* to *high*. See *Icons*.
|
||||
|
||||
*rotate*: ++
|
||||
typeof: integer ++
|
||||
@@ -52,7 +52,7 @@ Additionally you can control the volume by scrolling *up* or *down* while the cu
|
||||
|
||||
*min-length*: ++
|
||||
typeof: integer ++
|
||||
The minimum length in characters the module should take up.
|
||||
The minimum length in characters the module should accept.
|
||||
|
||||
*align*: ++
|
||||
typeof: float ++
|
||||
@@ -61,7 +61,7 @@ Additionally you can control the volume by scrolling *up* or *down* while the cu
|
||||
*scroll-step*: ++
|
||||
typeof: float ++
|
||||
default: 1.0 ++
|
||||
The speed in which to change the volume when scrolling.
|
||||
The speed at which to change the volume when scrolling.
|
||||
|
||||
*on-click*: ++
|
||||
typeof: string ++
|
||||
@@ -73,7 +73,7 @@ Additionally you can control the volume by scrolling *up* or *down* while the cu
|
||||
|
||||
*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 ++
|
||||
@@ -107,7 +107,7 @@ Additionally you can control the volume by scrolling *up* or *down* while the cu
|
||||
|
||||
*ignored-sinks*: ++
|
||||
typeof: array ++
|
||||
Sinks in this list will not be shown as the active sink by Waybar. Entries should be the sink's description field.
|
||||
Sinks in this list will not be shown as active sink by Waybar. Entries should be the sink's description field.
|
||||
|
||||
# FORMAT REPLACEMENTS
|
||||
|
||||
|
||||
@@ -15,45 +15,45 @@ It may not be set until a layout is first applied.
|
||||
Addressed by *river/layout*
|
||||
|
||||
*format*: ++
|
||||
typeof: string ++
|
||||
default: {} ++
|
||||
The format, how information should be displayed. On {} data gets inserted.
|
||||
typeof: string ++
|
||||
default: {} ++
|
||||
The format, how information should be displayed. On {} data gets inserted.
|
||||
|
||||
*rotate*: ++
|
||||
typeof: integer ++
|
||||
Positive value to rotate the text label.
|
||||
typeof: integer ++
|
||||
Positive value to rotate the text label.
|
||||
|
||||
*max-length*: ++
|
||||
typeof: integer ++
|
||||
The maximum length in character the module should display.
|
||||
typeof: integer ++
|
||||
The maximum length in character the module should display.
|
||||
|
||||
*min-length*: ++
|
||||
typeof: integer ++
|
||||
The minimum length in characters the module should take up.
|
||||
typeof: integer ++
|
||||
The minimum length in characters the module should accept.
|
||||
|
||||
*align*: ++
|
||||
typeof: float ++
|
||||
The alignment of the text, where 0 is left-aligned and 1 is right-aligned. If the module is rotated, it will follow the flow of the text.
|
||||
typeof: float ++
|
||||
The alignment of the 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 ++
|
||||
Command to execute when clicked on the module.
|
||||
typeof: string ++
|
||||
Command to execute when clicked on the module.
|
||||
|
||||
*on-click-middle*: ++
|
||||
typeof: string ++
|
||||
Command to execute when middle-clicked on the module using mousewheel.
|
||||
typeof: string ++
|
||||
Command to execute when middle-clicked on the module using mousewheel.
|
||||
|
||||
*on-click-right*: ++
|
||||
typeof: string ++
|
||||
Command to execute when you right clicked on the module.
|
||||
typeof: string ++
|
||||
Command to execute when you right-click on the module.
|
||||
|
||||
# EXAMPLE
|
||||
|
||||
```
|
||||
"river/layout": {
|
||||
"format": "{}",
|
||||
"min-length": 4,
|
||||
"align": "right"
|
||||
"format": "{}",
|
||||
"min-length": 4,
|
||||
"align": "right"
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@@ -13,59 +13,59 @@ The *mode* module displays the current mapping mode of river.
|
||||
Addressed by *river/mode*
|
||||
|
||||
*format*: ++
|
||||
typeof: string ++
|
||||
default: {} ++
|
||||
The format, how information should be displayed. On {} data gets inserted.
|
||||
typeof: string ++
|
||||
default: {} ++
|
||||
The format, how information should be displayed. On {} data gets inserted.
|
||||
|
||||
*rotate*: ++
|
||||
typeof: integer ++
|
||||
Positive value to rotate the text label.
|
||||
typeof: integer ++
|
||||
Positive value to rotate the text label.
|
||||
|
||||
*max-length*: ++
|
||||
typeof: integer ++
|
||||
The maximum length in character the module should display.
|
||||
typeof: integer ++
|
||||
The maximum length in character the module should display.
|
||||
|
||||
*min-length*: ++
|
||||
typeof: integer ++
|
||||
The minimum length in characters the module should take up.
|
||||
typeof: integer ++
|
||||
The minimum length in characters the module should accept.
|
||||
|
||||
*align*: ++
|
||||
typeof: float ++
|
||||
The alignment of the text, where 0 is left-aligned and 1 is right-aligned. If the module is rotated, it will follow the flow of the text.
|
||||
typeof: float ++
|
||||
The alignment of the 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 ++
|
||||
Command to execute when clicked on the module.
|
||||
typeof: string ++
|
||||
Command to execute when clicked on the module.
|
||||
|
||||
*on-click-middle*: ++
|
||||
typeof: string ++
|
||||
Command to execute when middle-clicked on the module using mousewheel.
|
||||
typeof: string ++
|
||||
Command to execute when middle-clicked on the module using mousewheel.
|
||||
|
||||
*on-click-right*: ++
|
||||
typeof: string ++
|
||||
Command to execute when you right clicked on the module.
|
||||
typeof: string ++
|
||||
Command to execute when you right-click on the module.
|
||||
|
||||
*on-update*: ++
|
||||
typeof: string ++
|
||||
Command to execute when the module is updated.
|
||||
typeof: string ++
|
||||
Command to execute when the module is updated.
|
||||
|
||||
*on-scroll-up*: ++
|
||||
typeof: string ++
|
||||
Command to execute when scrolling up on the module.
|
||||
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.
|
||||
typeof: string ++
|
||||
Command to execute when scrolling down on the module.
|
||||
|
||||
*smooth-scrolling-threshold*: ++
|
||||
typeof: double ++
|
||||
Threshold to be used when scrolling.
|
||||
typeof: double ++
|
||||
Threshold to be used when scrolling.
|
||||
|
||||
# EXAMPLES
|
||||
|
||||
```
|
||||
"river/mode": {
|
||||
"format": " {}"
|
||||
"format": " {}"
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@@ -13,24 +13,24 @@ The *tags* module displays the current state of tags in river.
|
||||
Addressed by *river/tags*
|
||||
|
||||
*num-tags*: ++
|
||||
typeof: uint ++
|
||||
default: 9 ++
|
||||
The number of tags that should be displayed. Max 32.
|
||||
typeof: uint ++
|
||||
default: 9 ++
|
||||
The number of tags that should be displayed. Max 32.
|
||||
|
||||
*tag-labels*: ++
|
||||
typeof: array ++
|
||||
The label to display for each tag.
|
||||
typeof: array ++
|
||||
The label to display for each tag.
|
||||
|
||||
*disable-click*: ++
|
||||
typeof: bool ++
|
||||
default: false ++
|
||||
If set to false, you can left click to set focused tag. Right click to toggle tag focus. If set to true this behaviour is disabled.
|
||||
typeof: bool ++
|
||||
default: false ++
|
||||
If set to false, you can left-click to set focused tag. Right-click to toggle tag focus. If set to true this behaviour is disabled.
|
||||
|
||||
# EXAMPLE
|
||||
|
||||
```
|
||||
"river/tags": {
|
||||
"num-tags": 5
|
||||
"num-tags": 5
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@@ -26,12 +26,12 @@ Addressed by *river/window*
|
||||
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 ++
|
||||
@@ -43,17 +43,17 @@ Addressed by *river/window*
|
||||
|
||||
*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.
|
||||
|
||||
# EXAMPLES
|
||||
|
||||
```
|
||||
"river/window": {
|
||||
"format": "{}"
|
||||
"format": "{}"
|
||||
}
|
||||
```
|
||||
|
||||
# STYLE
|
||||
|
||||
- *#window*
|
||||
- *#window.focused* Applied when the output this module's bar belongs to is focused.
|
||||
- *#window.focused* Applied when the output this module's bar belongs to is focused.
|
||||
|
||||
@@ -27,17 +27,17 @@ cursor is over the module, and clicking on the module toggles mute.
|
||||
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.
|
||||
|
||||
*scroll-step*: ++
|
||||
typeof: int ++
|
||||
default: 5 ++
|
||||
The speed in which to change the volume when scrolling.
|
||||
The speed at which to change the volume when scrolling.
|
||||
|
||||
*on-click*: ++
|
||||
typeof: string ++
|
||||
@@ -50,7 +50,7 @@ cursor is over the module, and clicking on the module toggles mute.
|
||||
|
||||
*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 ++
|
||||
@@ -58,12 +58,12 @@ cursor is over the module, and clicking on the module toggles mute.
|
||||
|
||||
*on-scroll-up*: ++
|
||||
typeof: string ++
|
||||
Command to execute when scrolling up on the module.
|
||||
Command to execute when scrolling up on the module. ++
|
||||
This replaces the default behaviour of volume control.
|
||||
|
||||
*on-scroll-down*: ++
|
||||
typeof: string ++
|
||||
Command to execute when scrolling down on the module.
|
||||
Command to execute when scrolling down on the module. ++
|
||||
This replaces the default behaviour of volume control.
|
||||
|
||||
*smooth-scrolling-threshold*: ++
|
||||
@@ -80,8 +80,8 @@ cursor is over the module, and clicking on the module toggles mute.
|
||||
|
||||
```
|
||||
"sndio": {
|
||||
"format": "{raw_value} 🎜",
|
||||
"scroll-step": 3
|
||||
"format": "{raw_value} 🎜",
|
||||
"scroll-step": 3
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
waybar-states(5)
|
||||
|
||||
# NAME
|
||||
|
||||
waybar - states property
|
||||
|
||||
# OVERVIEW
|
||||
|
||||
Some modules support 'states' which allows percentage values to be used as styling triggers to
|
||||
|
||||
@@ -43,11 +43,11 @@ Addressed by *sway/language*
|
||||
|
||||
```
|
||||
"sway/language": {
|
||||
"format": "{}",
|
||||
"format": "{}",
|
||||
},
|
||||
|
||||
"sway/language": {
|
||||
"format": "{short} {variant}",
|
||||
"format": "{short} {variant}",
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@@ -26,12 +26,12 @@ Addressed by *sway/mode*
|
||||
The maximum length in character the module should display.
|
||||
|
||||
*min-length*: ++
|
||||
typeof: integer ++
|
||||
The minimum length in characters the module should take up.
|
||||
typeof: integer ++
|
||||
The minimum length in characters the module should accept.
|
||||
|
||||
*align*: ++
|
||||
typeof: float ++
|
||||
The alignment of the text, where 0 is left-aligned and 1 is right-aligned. If the module is rotated, it will follow the flow of the text.
|
||||
typeof: float ++
|
||||
The alignment of the 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 ++
|
||||
@@ -43,7 +43,7 @@ Addressed by *sway/mode*
|
||||
|
||||
*on-click-right*: ++
|
||||
typeof: string ++
|
||||
Command to execute when you right clicked on the module.
|
||||
Command to execute when you right-click on the module.
|
||||
|
||||
*on-update*: ++
|
||||
typeof: string ++
|
||||
@@ -70,8 +70,8 @@ Addressed by *sway/mode*
|
||||
|
||||
```
|
||||
"sway/mode": {
|
||||
"format": " {}",
|
||||
"max-length": 50
|
||||
"format": " {}",
|
||||
"max-length": 50
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@@ -50,11 +50,11 @@ Addressed by *sway/scratchpad*
|
||||
|
||||
```
|
||||
"sway/scratchpad": {
|
||||
"format": "{icon} {count}",
|
||||
"show-empty": false,
|
||||
"format-icons": ["", ""],
|
||||
"tooltip": true,
|
||||
"tooltip-format": "{app}: {title}"
|
||||
"format": "{icon} {count}",
|
||||
"show-empty": false,
|
||||
"format-icons": ["", ""],
|
||||
"tooltip": true,
|
||||
"tooltip-format": "{app}: {title}"
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@@ -26,12 +26,12 @@ Addressed by *sway/window*
|
||||
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 ++
|
||||
@@ -43,7 +43,7 @@ Addressed by *sway/window*
|
||||
|
||||
*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 ++
|
||||
@@ -78,13 +78,13 @@ Addressed by *sway/window*
|
||||
|
||||
*offscreen-css-text*: ++
|
||||
typeof: string ++
|
||||
Only effective when both all-outputs and offscreen-style are true. On screens currently not focused, show the given text along with that workspaces styles.
|
||||
Only effective when both all-outputs and offscreen-style are true. On screens currently not focused, show the given text along with that workspace styles.
|
||||
|
||||
*show-focused-workspace-name*: ++
|
||||
typeof: bool ++
|
||||
default: false ++
|
||||
If the workspace itself is focused and the workspace contains nodes or floating_nodes, show the workspace name. If not set, text remains empty but styles according to nodes in the workspace are still applied.
|
||||
|
||||
|
||||
*rewrite*: ++
|
||||
typeof: object ++
|
||||
Rules to rewrite the module format output. See *rewrite rules*.
|
||||
@@ -106,7 +106,7 @@ Addressed by *sway/window*
|
||||
*{app_id}*: The app_id of the focused window.
|
||||
|
||||
*{shell}*: The shell of the focused window. It's 'xwayland' when the window is
|
||||
running through xwayland, otherwise it's 'xdg-shell'.
|
||||
running through xwayland, otherwise, it's 'xdg-shell'.
|
||||
|
||||
# REWRITE RULES
|
||||
|
||||
@@ -124,18 +124,22 @@ Invalid expressions (e.g., mismatched parentheses) are skipped.
|
||||
|
||||
```
|
||||
"sway/window": {
|
||||
"format": "{}",
|
||||
"max-length": 50,
|
||||
"rewrite": {
|
||||
"(.*) - Mozilla Firefox": "🌎 $1",
|
||||
"(.*) - zsh": "> [$1]"
|
||||
}
|
||||
"format": "{}",
|
||||
"max-length": 50,
|
||||
"rewrite": {
|
||||
"(.*) - Mozilla Firefox": "🌎 $1",
|
||||
"(.*) - zsh": "> [$1]"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
# STYLE
|
||||
|
||||
- *#window*
|
||||
|
||||
The following classes are applied to the entire Waybar rather than just the
|
||||
window widget:
|
||||
|
||||
- *window#waybar.empty* When no windows are in the workspace, or screen is not focused and offscreen-css option is not set
|
||||
- *window#waybar.solo* When one tiled window is in the workspace
|
||||
- *window#waybar.floating* When there are only floating windows in the workspace
|
||||
|
||||
@@ -13,74 +13,74 @@ The *workspaces* module displays the currently used workspaces in Sway.
|
||||
Addressed by *sway/workspaces*
|
||||
|
||||
*all-outputs*: ++
|
||||
typeof: bool ++
|
||||
default: false ++
|
||||
If set to false, workspaces will only be shown on the output they are on. If set to true all workspaces will be shown on every output.
|
||||
typeof: bool ++
|
||||
default: false ++
|
||||
If set to false, workspaces will only be shown on the output they are on. If set to true all workspaces will be shown on every output.
|
||||
|
||||
*format*: ++
|
||||
typeof: string ++
|
||||
default: {value} ++
|
||||
The format, how information should be displayed.
|
||||
typeof: string ++
|
||||
default: {value} ++
|
||||
The format, how information should be displayed.
|
||||
|
||||
*format-icons*: ++
|
||||
typeof: array ++
|
||||
Based on the workspace name and state, the corresponding icon gets selected. See *icons*.
|
||||
typeof: array ++
|
||||
Based on the workspace name and state, the corresponding icon gets selected. See *icons*.
|
||||
|
||||
*disable-scroll*: ++
|
||||
typeof: bool ++
|
||||
default: false ++
|
||||
If set to false, you can scroll to cycle through workspaces. If set to true this behaviour is disabled.
|
||||
typeof: bool ++
|
||||
default: false ++
|
||||
If set to false, you can scroll to cycle through workspaces. If set to true this behaviour is disabled.
|
||||
|
||||
*disable-click*: ++
|
||||
typeof: bool ++
|
||||
default: false ++
|
||||
If set to false, you can click to change workspace. If set to true this behaviour is disabled.
|
||||
typeof: bool ++
|
||||
default: false ++
|
||||
If set to false, you can click to change workspace. If set to true this behaviour is disabled.
|
||||
|
||||
*smooth-scrolling-threshold*: ++
|
||||
typeof: double ++
|
||||
Threshold to be used when scrolling.
|
||||
typeof: double ++
|
||||
Threshold to be used when scrolling.
|
||||
|
||||
*disable-scroll-wraparound*: ++
|
||||
typeof: bool ++
|
||||
default: false ++
|
||||
If set to false, scrolling on the workspace indicator will wrap around to the first workspace when reading the end, and vice versa. If set to true this behavior is disabled.
|
||||
typeof: bool ++
|
||||
default: false ++
|
||||
If set to false, scrolling on the workspace indicator will wrap around to the first workspace when reading the end, and vice versa. If set to true this behavior is disabled.
|
||||
|
||||
*enable-bar-scroll*: ++
|
||||
typeof: bool ++
|
||||
default: false ++
|
||||
If set to false, you can't scroll to cycle throughout workspaces from the entire bar. If set to true this behaviour is enabled.
|
||||
typeof: bool ++
|
||||
default: false ++
|
||||
If set to false, you can't scroll to cycle throughout workspaces from the entire bar. If set to true this behaviour is enabled.
|
||||
|
||||
*disable-markup*: ++
|
||||
typeof: bool ++
|
||||
default: false ++
|
||||
If set to true, button label will escape pango markup.
|
||||
typeof: bool ++
|
||||
default: false ++
|
||||
If set to true, button label will escape pango markup.
|
||||
|
||||
*current-only*: ++
|
||||
typeof: bool ++
|
||||
default: false ++
|
||||
If set to true. Only focused workspaces will be shown.
|
||||
typeof: bool ++
|
||||
default: false ++
|
||||
If set to true. Only focused workspaces will be shown.
|
||||
|
||||
*persistent_workspaces*: ++
|
||||
typeof: json (see below) ++
|
||||
default: empty ++
|
||||
Lists workspaces that should always be shown, even when non existent
|
||||
*persistent-workspaces*: ++
|
||||
typeof: json (see below) ++
|
||||
default: empty ++
|
||||
Lists workspaces that should always be shown, even when non-existent
|
||||
|
||||
*on-update*: ++
|
||||
typeof: string ++
|
||||
Command to execute when the module is updated.
|
||||
typeof: string ++
|
||||
Command to execute when the module is updated.
|
||||
|
||||
*disable-auto-back-and-forth*: ++
|
||||
typeof: bool ++
|
||||
Whether to disable *workspace_auto_back_and_forth* when clicking on workspaces. If this is set to *true*, clicking on a workspace you are already on won't do anything, even if *workspace_auto_back_and_forth* is enabled in the Sway configuration.
|
||||
typeof: bool ++
|
||||
Whether to disable *workspace_auto_back_and_forth* when clicking on workspaces. If this is set to *true*, clicking on a workspace you are already on won't do anything, even if *workspace_auto_back_and_forth* is enabled in the Sway configuration.
|
||||
|
||||
*alphabetical_sort*: ++
|
||||
typeof: bool ++
|
||||
Whether to sort workspaces alphabetically. Please note this can make "swaymsg workspace prev/next" move to workspaces inconsistent with the ordering shown in Waybar.
|
||||
typeof: bool ++
|
||||
Whether to sort workspaces alphabetically. Please note this can make "swaymsg workspace prev/next" move to workspaces inconsistent with the ordering shown in Waybar.
|
||||
|
||||
warp-on-scroll: ++
|
||||
typeof: bool ++
|
||||
default: true ++
|
||||
If set to false, you can scroll to cycle through workspaces without mouse warping being enabled. If set to true this behaviour is disabled.
|
||||
typeof: bool ++
|
||||
default: true ++
|
||||
If set to false, you can scroll to cycle through workspaces without mouse warping being enabled. If set to true this behaviour is disabled.
|
||||
|
||||
# FORMAT REPLACEMENTS
|
||||
|
||||
@@ -98,10 +98,11 @@ warp-on-scroll: ++
|
||||
|
||||
Additional to workspace name matching, the following *format-icons* can be set.
|
||||
|
||||
- *default*: Will be shown, when no string matches is found.
|
||||
- *default*: Will be shown, when no string matches are found.
|
||||
- *urgent*: Will be shown, when workspace is flagged as urgent
|
||||
- *focused*: Will be shown, when workspace is focused
|
||||
- *persistent*: Will be shown, when workspace is persistent one.
|
||||
- *persistent*: Will be shown, when workspace is persistent.
|
||||
- *high-priority-named*: Icons by names will be shown always for those workspaces, independent by state.
|
||||
|
||||
# PERSISTENT WORKSPACES
|
||||
|
||||
@@ -111,11 +112,11 @@ an empty list denoting all outputs.
|
||||
|
||||
```
|
||||
"sway/workspaces": {
|
||||
"persistent_workspaces": {
|
||||
"3": [], // Always show a workspace with name '3', on all outputs if it does not exists
|
||||
"4": ["eDP-1"], // Always show a workspace with name '4', on output 'eDP-1' if it does not exists
|
||||
"5": ["eDP-1", "DP-2"] // Always show a workspace with name '5', on outputs 'eDP-1' and 'DP-2' if it does not exists
|
||||
}
|
||||
"persistent-workspaces": {
|
||||
"3": [], // Always show a workspace with name '3', on all outputs if it does not exist
|
||||
"4": ["eDP-1"], // Always show a workspace with name '4', on output 'eDP-1' if it does not exist
|
||||
"5": ["eDP-1", "DP-2"] // Always show a workspace with name '5', on outputs 'eDP-1' and 'DP-2' if it does not exist
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
@@ -125,19 +126,20 @@ n.b.: the list of outputs can be obtained from command line using *swaymsg -t ge
|
||||
|
||||
```
|
||||
"sway/workspaces": {
|
||||
"disable-scroll": true,
|
||||
"all-outputs": true,
|
||||
"format": "{name}: {icon}",
|
||||
"format-icons": {
|
||||
"1": "",
|
||||
"2": "",
|
||||
"3": "",
|
||||
"4": "",
|
||||
"5": "",
|
||||
"urgent": "",
|
||||
"focused": "",
|
||||
"default": ""
|
||||
}
|
||||
"disable-scroll": true,
|
||||
"all-outputs": true,
|
||||
"format": "{name}: {icon}",
|
||||
"format-icons": {
|
||||
"1": "",
|
||||
"2": "",
|
||||
"3": "",
|
||||
"4": "",
|
||||
"5": "",
|
||||
"high-priority-named": [ "1", "2" ],
|
||||
"urgent": "",
|
||||
"focused": "",
|
||||
"default": ""
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@@ -66,16 +66,16 @@ Addressed by *temperature*
|
||||
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.
|
||||
|
||||
*on-click*: ++
|
||||
typeof: string ++
|
||||
Command to execute when you clicked on the module.
|
||||
Command to execute when you click on the module.
|
||||
|
||||
*on-click-middle*: ++
|
||||
typeof: string ++
|
||||
@@ -83,7 +83,7 @@ Addressed by *temperature*
|
||||
|
||||
*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 ++
|
||||
|
||||
@@ -6,32 +6,32 @@ waybar - tray module
|
||||
|
||||
# DESCRIPTION
|
||||
|
||||
_WARNING_ *tray* is still in beta. There may me bugs. Breaking changes may occur.
|
||||
_WARNING_ *tray* is still in beta. There may be bugs. Breaking changes may occur.
|
||||
|
||||
# CONFIGURATION
|
||||
|
||||
Addressed by *tray*
|
||||
|
||||
*icon-size*: ++
|
||||
typeof: integer ++
|
||||
Defines the size of the tray icons.
|
||||
typeof: integer ++
|
||||
Defines the size of the tray icons.
|
||||
|
||||
*show-passive-items*: ++
|
||||
typeof: bool ++
|
||||
default: false ++
|
||||
Defines visibility of the tray icons with *Passive* status.
|
||||
typeof: bool ++
|
||||
default: false ++
|
||||
Defines visibility of the tray icons with *Passive* status.
|
||||
|
||||
*smooth-scrolling-threshold*: ++
|
||||
typeof: double ++
|
||||
Threshold to be used when scrolling.
|
||||
|
||||
*spacing*: ++
|
||||
typeof: integer ++
|
||||
Defines the spacing between the tray icons.
|
||||
typeof: integer ++
|
||||
Defines the spacing between the tray icons.
|
||||
|
||||
*reverse-direction*: ++
|
||||
typeof: bool ++
|
||||
Defines if new app icons should be added in a reverse order
|
||||
typeof: bool ++
|
||||
Defines if new app icons should be added in a reverse order
|
||||
|
||||
*on-update*: ++
|
||||
typeof: string ++
|
||||
@@ -41,8 +41,8 @@ Addressed by *tray*
|
||||
|
||||
```
|
||||
"tray": {
|
||||
"icon-size": 21,
|
||||
"spacing": 10
|
||||
"icon-size": 21,
|
||||
"spacing": 10
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
@@ -12,10 +12,10 @@ compatible devices in the tooltip.
|
||||
# CONFIGURATION
|
||||
|
||||
*native-path*: ++
|
||||
typeof: string ++
|
||||
default: ++
|
||||
The battery to monitor. Refer to the https://upower.freedesktop.org/docs/UpDevice.html#UpDevice--native-path ++
|
||||
Can be obtained using `upower --dump`
|
||||
typeof: string ++
|
||||
default: ++
|
||||
The battery to monitor. Refer to the https://upower.freedesktop.org/docs/UpDevice.html#UpDevice--native-path ++
|
||||
Can be obtained using `upower --dump`
|
||||
|
||||
*icon-size*: ++
|
||||
typeof: integer ++
|
||||
|
||||
@@ -43,7 +43,7 @@ The *wireplumber* module displays the current volume reported by WirePlumber.
|
||||
|
||||
*min-length*: ++
|
||||
typeof: integer ++
|
||||
The minimum length in characters the module should take up.
|
||||
The minimum length in characters the module should accept.
|
||||
|
||||
*align*: ++
|
||||
typeof: float ++
|
||||
@@ -52,7 +52,7 @@ The *wireplumber* module displays the current volume reported by WirePlumber.
|
||||
*scroll-step*: ++
|
||||
typeof: float ++
|
||||
default: 1.0 ++
|
||||
The speed in which to change the volume when scrolling.
|
||||
The speed at which to change the volume when scrolling.
|
||||
|
||||
*on-click*: ++
|
||||
typeof: string ++
|
||||
@@ -64,7 +64,7 @@ The *wireplumber* module displays the current volume reported by WirePlumber.
|
||||
|
||||
*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 ++
|
||||
@@ -93,9 +93,9 @@ The *wireplumber* module displays the current volume reported by WirePlumber.
|
||||
|
||||
```
|
||||
"wireplumber": {
|
||||
"format": "{volume}%",
|
||||
"format-muted": "",
|
||||
"on-click": "helvum"
|
||||
"format": "{volume}%",
|
||||
"format-muted": "",
|
||||
"on-click": "helvum"
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ waybar-wlr-taskbar(5)
|
||||
|
||||
# NAME
|
||||
|
||||
wlroots - Taskbar module
|
||||
waybar - wlr taskbar module
|
||||
|
||||
# DESCRIPTION
|
||||
|
||||
@@ -16,7 +16,7 @@ Addressed by *wlr/taskbar*
|
||||
*all-outputs*: ++
|
||||
typeof: bool ++
|
||||
default: false ++
|
||||
If set to false applications on the waybar's current output will be shown. Otherwise all applications are shown.
|
||||
If set to false applications on the waybar's current output will be shown. Otherwise, all applications are shown.
|
||||
|
||||
*format*: ++
|
||||
typeof: string ++
|
||||
@@ -89,7 +89,7 @@ Addressed by *wlr/taskbar*
|
||||
|
||||
*{icon}*: The icon of the application.
|
||||
|
||||
*{title}*: The application name as in desktop file if appropriate desktop fils found, otherwise same as {app_id}
|
||||
*{name}*: The application name as in desktop file if appropriate desktop files are found, otherwise same as {app_id}
|
||||
|
||||
*{title}*: The title of the application.
|
||||
|
||||
|
||||
@@ -29,19 +29,18 @@ Addressed by *wlr/workspaces*
|
||||
*sort-by-coordinates*: ++
|
||||
typeof: bool ++
|
||||
default: true ++
|
||||
Should workspaces be sorted by coordinates.
|
||||
Note that if both *sort-by-name* and *sort-by-coordinates* are true sort by name will be first.
|
||||
If both are false - sort by id will be performed.
|
||||
Should workspaces be sorted by coordinates. ++
|
||||
Note that if both *sort-by-name* and *sort-by-coordinates* are true sort-by name will be first. If both are false - sort by id will be performed.
|
||||
|
||||
*sort-by-number*: ++
|
||||
typeof: bool ++
|
||||
default: false ++
|
||||
If set to true, workspace names will be sorted numerically. Takes presedence over any other sort-by option.
|
||||
If set to true, workspace names will be sorted numerically. Takes precedence over any other sort-by option.
|
||||
|
||||
*all-outputs*: ++
|
||||
typeof: bool ++
|
||||
default: false ++
|
||||
If set to false workspaces group will be shown only in assigned output. Otherwise all workspace groups are shown.
|
||||
If set to false workspaces group will be shown only in assigned output. Otherwise, all workspace groups are shown.
|
||||
|
||||
*active-only*: ++
|
||||
typeof: bool ++
|
||||
@@ -62,7 +61,7 @@ Addressed by *wlr/workspaces*
|
||||
|
||||
# ICONS
|
||||
|
||||
Additional to workspace name matching, the following *format-icons* can be set.
|
||||
In addition to workspace name matching, the following *format-icons* can be set.
|
||||
|
||||
- *default*: Will be shown, when no string match is found.
|
||||
- *active*: Will be shown, when workspace is active
|
||||
|
||||
@@ -17,7 +17,7 @@ Valid locations for this file are:
|
||||
- *@sysconfdir@/xdg/waybar/config*
|
||||
|
||||
A good starting point is the default configuration found at https://github.com/Alexays/Waybar/blob/master/resources/config
|
||||
Also a minimal example configuration can be found on the at the bottom of this man page.
|
||||
Also, a minimal example configuration can be found at the bottom of this man page.
|
||||
|
||||
# BAR CONFIGURATION
|
||||
|
||||
@@ -30,7 +30,7 @@ Also a minimal example configuration can be found on the at the bottom of this m
|
||||
*output* ++
|
||||
typeof: string|array ++
|
||||
Specifies on which screen this bar will be displayed. Exclamation mark(*!*) can be used to exclude specific output.
|
||||
Output specification follows sway's and can either be the output port such as "HDMI-A-1" or a string consisting of the make, model and serial such as "Some Company ABC123 0x00000000". See *sway-output(5)* for details.
|
||||
Output specification follows sway's and can either be the output port such as "HDMI-A-1" or a string consisting of the make, model, and serial such as "Some Company ABC123 0x00000000". See *sway-output(5)* for details.
|
||||
In an array, star '*\**' can be used at the end to accept all outputs, in case all previous entries are exclusions.
|
||||
|
||||
*position* ++
|
||||
@@ -68,7 +68,7 @@ Also a minimal example configuration can be found on the at the bottom of this m
|
||||
|
||||
*spacing* ++
|
||||
typeof: integer ++
|
||||
Size of gaps in between of the different modules.
|
||||
Size of gaps in between the different modules.
|
||||
|
||||
*name* ++
|
||||
typeof: string ++
|
||||
@@ -89,7 +89,7 @@ Also a minimal example configuration can be found on the at the bottom of this m
|
||||
default: *press*
|
||||
Defines the timing of modifier key to reset the bar visibility.
|
||||
To reset the visibility of the bar with the press of the modifier key use *press*.
|
||||
Use *release* to reset the visibility upon the release of the modifier key and only if no other action happened while the key was pressed. This prevents hiding the bar when the modifier is used to switch a workspace, change binding mode or start a keybinding.
|
||||
Use *release* to reset the visibility upon the release of the modifier key and only if no other action happened while the key was pressed. This prevents hiding the bar when the modifier is used to switch a workspace, change binding mode, or start a keybinding.
|
||||
|
||||
*exclusive* ++
|
||||
typeof: bool ++
|
||||
@@ -118,11 +118,11 @@ Also a minimal example configuration can be found on the at the bottom of this m
|
||||
typeof: bool ++
|
||||
default: false ++
|
||||
Option to subscribe to the Sway IPC bar configuration and visibility events and control waybar with *swaymsg bar* commands. ++
|
||||
Requires *bar_id* value from sway configuration to be either passed with the *-b* commandline argument or specified with the *id* option.
|
||||
Requires *bar_id* value from sway configuration to be either passed with the *-b* command line argument or specified with the *id* option.
|
||||
|
||||
*id* ++
|
||||
typeof: string ++
|
||||
*bar_id* for the Sway IPC. Use this if you need to override the value passed with the *-b bar_id* commandline argument for the specific bar instance.
|
||||
*bar_id* for the Sway IPC. Use this if you need to override the value passed with the *-b bar_id* command line argument for the specific bar instance.
|
||||
|
||||
*include* ++
|
||||
typeof: string|array ++
|
||||
@@ -142,7 +142,7 @@ e.g.
|
||||
# MULTIPLE INSTANCES OF A MODULE
|
||||
|
||||
If you want to have a second instance of a module, you can suffix it by a '#' and a custom name.
|
||||
For example if you want a second battery module, you can add *"battery#bat2"* to your modules.
|
||||
For example, if you want a second battery module, you can add *"battery#bat2"* to your modules.
|
||||
To configure the newly added module, you then also add a module configuration with the same name.
|
||||
|
||||
This could then look something like this *(this is an incomplete example)*:
|
||||
@@ -236,11 +236,11 @@ When positioning Waybar on the left or right side of the screen, sometimes it's
|
||||
}
|
||||
```
|
||||
|
||||
Valid options for the "rotate" property are: 0, 90, 180 and 270.
|
||||
Valid options for the "rotate" property are: 0, 90, 180, and 270.
|
||||
|
||||
## Grouping modules
|
||||
|
||||
Module groups allow stacking modules in the direction orthogonal to the bar direction. When the bar is positioned on the top or bottom of the screen, modules in a group are stacked vertically. Likewise, when positioned on the left or right, modules in a group are stacked horizontally.
|
||||
Module groups allow stacking modules in any direction. By default, when the bar is positioned on the top or bottom of the screen, modules in a group are stacked vertically. Likewise, when positioned on the left or right, modules in a group are stacked horizontally. This can be changed with the "orientation" property.
|
||||
|
||||
A module group is defined by specifying a module named "group/some-group-name". The group must also be configured with a list of contained modules. Example:
|
||||
|
||||
@@ -263,37 +263,86 @@ A module group is defined by specifying a module named "group/some-group-name".
|
||||
|
||||
Valid options for the (optional) "orientation" property are: "horizontal", "vertical", "inherit", and "orthogonal" (default).
|
||||
|
||||
## Group Drawers
|
||||
|
||||
A group may hide all but one element, showing them only on mouse hover. In order to configure this, you can use the `drawer` property, whose value is an object with the following properties:
|
||||
|
||||
*transition-duration*: ++
|
||||
typeof: integer ++
|
||||
default: 500 ++
|
||||
Defines the duration of the transition animation in milliseconds.
|
||||
|
||||
*children-class*: ++
|
||||
typeof: string ++
|
||||
default: "hidden" ++
|
||||
Defines the CSS class to be applied to the hidden elements.
|
||||
|
||||
*transition-left-to-right*: ++
|
||||
typeof: bool ++
|
||||
default: true ++
|
||||
Defines the direction of the transition animation. If true, the hidden elements will slide from left to right. If false, they will slide from right to left.
|
||||
When the bar is vertical, it reads as top-to-bottom.
|
||||
|
||||
```
|
||||
"group/power": {
|
||||
"orientation": "inherit",
|
||||
"drawer": {
|
||||
"transition-duration": 500,
|
||||
"children-class": "not-power",
|
||||
"transition-left-to-right": false,
|
||||
},
|
||||
"modules": [
|
||||
"custom/power", // First element is the "group leader" and won't ever be hidden
|
||||
"custom/quit",
|
||||
"custom/lock",
|
||||
"custom/reboot",
|
||||
]
|
||||
},
|
||||
```
|
||||
|
||||
# SUPPORTED MODULES
|
||||
|
||||
- *waybar-backlight(5)*
|
||||
- *waybar-battery(5)*
|
||||
- *waybar-bluetooth(5)*
|
||||
- *waybar-cava(5)*
|
||||
- *waybar-clock(5)*
|
||||
- *waybar-cpu(5)*
|
||||
- *waybar-custom(5)*
|
||||
- *waybar-disk(5)*
|
||||
- *waybar-dwl-tags(5)*
|
||||
- *waybar-gamemode(5)*
|
||||
- *waybar-hyprland-language(5)*
|
||||
- *waybar-hyprland-submap(5)*
|
||||
- *waybar-hyprland-window(5)*
|
||||
- *waybar-hyprland-workspaces(5)*
|
||||
- *waybar-idle-inhibitor(5)*
|
||||
- *waybar-image(5)*
|
||||
- *waybar-inhibitor(5)*
|
||||
- *waybar-jack(5)*
|
||||
- *waybar-keyboard-state(5)*
|
||||
- *waybar-memory(5)*
|
||||
- *waybar-mpd(5)*
|
||||
- *waybar-mpris(5)*
|
||||
- *waybar-network(5)*
|
||||
- *waybar-pulseaudio(5)*
|
||||
- *waybar-river-layout(5)*
|
||||
- *waybar-river-mode(5)*
|
||||
- *waybar-river-tags(5)*
|
||||
- *waybar-river-window(5)*
|
||||
- *waybar-river-layout(5)*
|
||||
- *waybar-sndio(5)*
|
||||
- *waybar-states(5)*
|
||||
- *waybar-sway-language(5)*
|
||||
- *waybar-sway-mode(5)*
|
||||
- *waybar-sway-scratchpad(5)*
|
||||
- *waybar-sway-window(5)*
|
||||
- *waybar-sway-workspaces(5)*
|
||||
- *waybar-temperature(5)*
|
||||
- *waybar-tray(5)*
|
||||
- *waybar-upower(5)*
|
||||
- *waybar-wireplumber(5)*
|
||||
- *waybar-wlr-taskbar(5)*
|
||||
- *waybar-wlr-workspaces(5)*
|
||||
- *waybar-temperature(5)*
|
||||
- *waybar-tray(5)*
|
||||
|
||||
# SEE ALSO
|
||||
|
||||
|
||||
35
meson.build
35
meson.build
@@ -1,10 +1,10 @@
|
||||
project(
|
||||
'waybar', 'cpp', 'c',
|
||||
version: '0.9.19',
|
||||
version: '0.9.23',
|
||||
license: 'MIT',
|
||||
meson_version: '>= 0.50.0',
|
||||
default_options : [
|
||||
'cpp_std=c++17',
|
||||
'cpp_std=c++20',
|
||||
'buildtype=release',
|
||||
'default_library=static'
|
||||
],
|
||||
@@ -159,22 +159,28 @@ src_files = files(
|
||||
'src/AModule.cpp',
|
||||
'src/ALabel.cpp',
|
||||
'src/AIconLabel.cpp',
|
||||
'src/AAppIconLabel.cpp',
|
||||
'src/modules/custom.cpp',
|
||||
'src/modules/disk.cpp',
|
||||
'src/modules/idle_inhibitor.cpp',
|
||||
'src/modules/image.cpp',
|
||||
'src/modules/load.cpp',
|
||||
'src/modules/temperature.cpp',
|
||||
'src/modules/user.cpp',
|
||||
'src/ASlider.cpp',
|
||||
'src/main.cpp',
|
||||
'src/bar.cpp',
|
||||
'src/client.cpp',
|
||||
'src/config.cpp',
|
||||
'src/group.cpp',
|
||||
'src/util/portal.cpp',
|
||||
'src/util/enum.cpp',
|
||||
'src/util/prepare_for_sleep.cpp',
|
||||
'src/util/ustring_clen.cpp',
|
||||
'src/util/sanitize_str.cpp',
|
||||
'src/util/rewrite_string.cpp',
|
||||
'src/util/gtk_icon.cpp'
|
||||
'src/util/gtk_icon.cpp',
|
||||
'src/util/regex_collection.cpp'
|
||||
)
|
||||
|
||||
inc_dirs = ['include']
|
||||
@@ -184,8 +190,11 @@ if is_linux
|
||||
add_project_arguments('-DHAVE_MEMORY_LINUX', language: 'cpp')
|
||||
src_files += files(
|
||||
'src/modules/battery.cpp',
|
||||
'src/modules/cpu/common.cpp',
|
||||
'src/modules/cpu/linux.cpp',
|
||||
'src/modules/cpu.cpp',
|
||||
'src/modules/cpu_frequency/common.cpp',
|
||||
'src/modules/cpu_frequency/linux.cpp',
|
||||
'src/modules/cpu_usage/common.cpp',
|
||||
'src/modules/cpu_usage/linux.cpp',
|
||||
'src/modules/memory/common.cpp',
|
||||
'src/modules/memory/linux.cpp',
|
||||
)
|
||||
@@ -193,8 +202,11 @@ elif is_dragonfly or is_freebsd or is_netbsd or is_openbsd
|
||||
add_project_arguments('-DHAVE_CPU_BSD', language: 'cpp')
|
||||
add_project_arguments('-DHAVE_MEMORY_BSD', language: 'cpp')
|
||||
src_files += files(
|
||||
'src/modules/cpu/bsd.cpp',
|
||||
'src/modules/cpu/common.cpp',
|
||||
'src/modules/cpu.cpp',
|
||||
'src/modules/cpu_frequency/bsd.cpp',
|
||||
'src/modules/cpu_frequency/common.cpp',
|
||||
'src/modules/cpu_usage/bsd.cpp',
|
||||
'src/modules/cpu_usage/common.cpp',
|
||||
'src/modules/memory/bsd.cpp',
|
||||
'src/modules/memory/common.cpp',
|
||||
)
|
||||
@@ -269,6 +281,8 @@ endif
|
||||
if libpulse.found()
|
||||
add_project_arguments('-DHAVE_LIBPULSE', language: 'cpp')
|
||||
src_files += 'src/modules/pulseaudio.cpp'
|
||||
src_files += 'src/modules/pulseaudio_slider.cpp'
|
||||
src_files += 'src/util/audio_backend.cpp'
|
||||
endif
|
||||
|
||||
if libjack.found()
|
||||
@@ -294,6 +308,8 @@ endif
|
||||
if libudev.found() and (is_linux or libepoll.found())
|
||||
add_project_arguments('-DHAVE_LIBUDEV', language: 'cpp')
|
||||
src_files += 'src/modules/backlight.cpp'
|
||||
src_files += 'src/modules/backlight_slider.cpp'
|
||||
src_files += 'src/util/backlight_backend.cpp'
|
||||
endif
|
||||
|
||||
if libevdev.found() and (is_linux or libepoll.found()) and libinput.found() and (is_linux or libinotify.found())
|
||||
@@ -345,7 +361,7 @@ if get_option('experimental')
|
||||
endif
|
||||
|
||||
cava = dependency('cava',
|
||||
version : '>=0.8.4',
|
||||
version : '>=0.9.1',
|
||||
required: get_option('cava'),
|
||||
fallback : ['cava', 'cava_dep'],
|
||||
not_found_message: 'cava is not found. Building waybar without cava')
|
||||
@@ -421,7 +437,9 @@ if scdoc.found()
|
||||
man_files = [
|
||||
main_manpage_path,
|
||||
'waybar-backlight.5.scd',
|
||||
'waybar-backlight-slider.5.scd',
|
||||
'waybar-battery.5.scd',
|
||||
'waybar-cava.5.scd',
|
||||
'waybar-clock.5.scd',
|
||||
'waybar-cpu.5.scd',
|
||||
'waybar-custom.5.scd',
|
||||
@@ -435,6 +453,7 @@ if scdoc.found()
|
||||
'waybar-mpris.5.scd',
|
||||
'waybar-network.5.scd',
|
||||
'waybar-pulseaudio.5.scd',
|
||||
'waybar-pulseaudio-slider.5.scd',
|
||||
'waybar-river-mode.5.scd',
|
||||
'waybar-river-tags.5.scd',
|
||||
'waybar-river-window.5.scd',
|
||||
|
||||
@@ -1,89 +1,158 @@
|
||||
#!/usr/bin/env python3
|
||||
import gi
|
||||
gi.require_version("Playerctl", "2.0")
|
||||
from gi.repository import Playerctl, GLib
|
||||
from gi.repository.Playerctl import Player
|
||||
import argparse
|
||||
import logging
|
||||
import sys
|
||||
import signal
|
||||
import gi
|
||||
import json
|
||||
gi.require_version('Playerctl', '2.0')
|
||||
from gi.repository import Playerctl, GLib
|
||||
import os
|
||||
from typing import List
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
def write_output(text, player):
|
||||
logger.info('Writing output')
|
||||
|
||||
output = {'text': text,
|
||||
'class': 'custom-' + player.props.player_name,
|
||||
'alt': player.props.player_name}
|
||||
|
||||
sys.stdout.write(json.dumps(output) + '\n')
|
||||
sys.stdout.flush()
|
||||
|
||||
|
||||
def on_play(player, status, manager):
|
||||
logger.info('Received new playback status')
|
||||
on_metadata(player, player.props.metadata, manager)
|
||||
|
||||
|
||||
def on_metadata(player, metadata, manager):
|
||||
logger.info('Received new metadata')
|
||||
track_info = ''
|
||||
|
||||
if player.props.player_name == 'spotify' and \
|
||||
'mpris:trackid' in metadata.keys() and \
|
||||
':ad:' in player.props.metadata['mpris:trackid']:
|
||||
track_info = 'AD PLAYING'
|
||||
elif player.get_artist() != '' and player.get_title() != '':
|
||||
track_info = '{artist} - {title}'.format(artist=player.get_artist(),
|
||||
title=player.get_title())
|
||||
else:
|
||||
track_info = player.get_title()
|
||||
|
||||
if player.props.status != 'Playing' and track_info:
|
||||
track_info = ' ' + track_info
|
||||
write_output(track_info, player)
|
||||
|
||||
|
||||
def on_player_appeared(manager, player, selected_player=None):
|
||||
if player is not None and (selected_player is None or player.name == selected_player):
|
||||
init_player(manager, player)
|
||||
else:
|
||||
logger.debug("New player appeared, but it's not the selected player, skipping")
|
||||
|
||||
|
||||
def on_player_vanished(manager, player):
|
||||
logger.info('Player has vanished')
|
||||
sys.stdout.write('\n')
|
||||
sys.stdout.flush()
|
||||
|
||||
|
||||
def init_player(manager, name):
|
||||
logger.debug('Initialize player: {player}'.format(player=name.name))
|
||||
player = Playerctl.Player.new_from_name(name)
|
||||
player.connect('playback-status', on_play, manager)
|
||||
player.connect('metadata', on_metadata, manager)
|
||||
manager.manage_player(player)
|
||||
on_metadata(player, player.props.metadata, manager)
|
||||
|
||||
|
||||
def signal_handler(sig, frame):
|
||||
logger.debug('Received signal to stop, exiting')
|
||||
sys.stdout.write('\n')
|
||||
logger.info("Received signal to stop, exiting")
|
||||
sys.stdout.write("\n")
|
||||
sys.stdout.flush()
|
||||
# loop.quit()
|
||||
sys.exit(0)
|
||||
|
||||
|
||||
class PlayerManager:
|
||||
def __init__(self, selected_player=None):
|
||||
self.manager = Playerctl.PlayerManager()
|
||||
self.loop = GLib.MainLoop()
|
||||
self.manager.connect(
|
||||
"name-appeared", lambda *args: self.on_player_appeared(*args))
|
||||
self.manager.connect(
|
||||
"player-vanished", lambda *args: self.on_player_vanished(*args))
|
||||
|
||||
signal.signal(signal.SIGINT, signal_handler)
|
||||
signal.signal(signal.SIGTERM, signal_handler)
|
||||
signal.signal(signal.SIGPIPE, signal.SIG_DFL)
|
||||
self.selected_player = selected_player
|
||||
|
||||
self.init_players()
|
||||
|
||||
def init_players(self):
|
||||
for player in self.manager.props.player_names:
|
||||
if self.selected_player is not None and self.selected_player != player.name:
|
||||
logger.debug(f"{player.name} is not the filtered player, skipping it")
|
||||
continue
|
||||
self.init_player(player)
|
||||
|
||||
def run(self):
|
||||
logger.info("Starting main loop")
|
||||
self.loop.run()
|
||||
|
||||
def init_player(self, player):
|
||||
logger.info(f"Initialize new player: {player.name}")
|
||||
player = Playerctl.Player.new_from_name(player)
|
||||
player.connect("playback-status",
|
||||
self.on_playback_status_changed, None)
|
||||
player.connect("metadata", self.on_metadata_changed, None)
|
||||
self.manager.manage_player(player)
|
||||
self.on_metadata_changed(player, player.props.metadata)
|
||||
|
||||
def get_players(self) -> List[Player]:
|
||||
return self.manager.props.players
|
||||
|
||||
def write_output(self, text, player):
|
||||
logger.debug(f"Writing output: {text}")
|
||||
|
||||
output = {"text": text,
|
||||
"class": "custom-" + player.props.player_name,
|
||||
"alt": player.props.player_name}
|
||||
|
||||
sys.stdout.write(json.dumps(output) + "\n")
|
||||
sys.stdout.flush()
|
||||
|
||||
def clear_output(self):
|
||||
sys.stdout.write("\n")
|
||||
sys.stdout.flush()
|
||||
|
||||
def on_playback_status_changed(self, player, status, _=None):
|
||||
logger.debug(f"Playback status changed for player {player.props.player_name}: {status}")
|
||||
self.on_metadata_changed(player, player.props.metadata)
|
||||
|
||||
def get_first_playing_player(self):
|
||||
players = self.get_players()
|
||||
logger.debug(f"Getting first playing player from {len(players)} players")
|
||||
if len(players) > 0:
|
||||
# if any are playing, show the first one that is playing
|
||||
# reverse order, so that the most recently added ones are preferred
|
||||
for player in players[::-1]:
|
||||
if player.props.status == "Playing":
|
||||
return player
|
||||
# if none are playing, show the first one
|
||||
return players[0]
|
||||
else:
|
||||
logger.debug("No players found")
|
||||
return None
|
||||
|
||||
def show_most_important_player(self):
|
||||
logger.debug("Showing most important player")
|
||||
# show the currently playing player
|
||||
# or else show the first paused player
|
||||
# or else show nothing
|
||||
current_player = self.get_first_playing_player()
|
||||
if current_player is not None:
|
||||
self.on_metadata_changed(current_player, current_player.props.metadata)
|
||||
else:
|
||||
self.clear_output()
|
||||
|
||||
def on_metadata_changed(self, player, metadata, _=None):
|
||||
logger.debug(f"Metadata changed for player {player.props.player_name}")
|
||||
player_name = player.props.player_name
|
||||
artist = player.get_artist()
|
||||
title = player.get_title()
|
||||
|
||||
track_info = ""
|
||||
if player_name == "spotify" and "mpris:trackid" in metadata.keys() and ":ad:" in player.props.metadata["mpris:trackid"]:
|
||||
track_info = "Advertisement"
|
||||
elif artist is not None and title is not None:
|
||||
track_info = f"{artist} - {title}"
|
||||
else:
|
||||
track_info = title
|
||||
|
||||
if track_info:
|
||||
if player.props.status == "Playing":
|
||||
track_info = " " + track_info
|
||||
else:
|
||||
track_info = " " + track_info
|
||||
# only print output if no other player is playing
|
||||
current_playing = self.get_first_playing_player()
|
||||
if current_playing is None or current_playing.props.player_name == player.props.player_name:
|
||||
self.write_output(track_info, player)
|
||||
else:
|
||||
logger.debug(f"Other player {current_playing.props.player_name} is playing, skipping")
|
||||
|
||||
def on_player_appeared(self, _, player):
|
||||
logger.info(f"Player has appeared: {player.name}")
|
||||
if player is not None and (self.selected_player is None or player.name == self.selected_player):
|
||||
self.init_player(player)
|
||||
else:
|
||||
logger.debug(
|
||||
"New player appeared, but it's not the selected player, skipping")
|
||||
|
||||
def on_player_vanished(self, _, player):
|
||||
logger.info(f"Player {player.props.player_name} has vanished")
|
||||
self.show_most_important_player()
|
||||
|
||||
def parse_arguments():
|
||||
parser = argparse.ArgumentParser()
|
||||
|
||||
# Increase verbosity with every occurrence of -v
|
||||
parser.add_argument('-v', '--verbose', action='count', default=0)
|
||||
parser.add_argument("-v", "--verbose", action="count", default=0)
|
||||
|
||||
# Define for which player we're listening
|
||||
parser.add_argument('--player')
|
||||
# Define for which player we"re listening
|
||||
parser.add_argument("--player")
|
||||
|
||||
parser.add_argument("--enable-logging", action="store_true")
|
||||
|
||||
return parser.parse_args()
|
||||
|
||||
@@ -92,37 +161,22 @@ def main():
|
||||
arguments = parse_arguments()
|
||||
|
||||
# Initialize logging
|
||||
logging.basicConfig(stream=sys.stderr, level=logging.DEBUG,
|
||||
format='%(name)s %(levelname)s %(message)s')
|
||||
if arguments.enable_logging:
|
||||
logfile = os.path.join(os.path.dirname(
|
||||
os.path.realpath(__file__)), "media-player.log")
|
||||
logging.basicConfig(filename=logfile, level=logging.DEBUG,
|
||||
format="%(asctime)s %(name)s %(levelname)s:%(lineno)d %(message)s")
|
||||
|
||||
# Logging is set by default to WARN and higher.
|
||||
# With every occurrence of -v it's lowered by one
|
||||
logger.setLevel(max((3 - arguments.verbose) * 10, 0))
|
||||
|
||||
# Log the sent command line arguments
|
||||
logger.debug('Arguments received {}'.format(vars(arguments)))
|
||||
|
||||
manager = Playerctl.PlayerManager()
|
||||
loop = GLib.MainLoop()
|
||||
|
||||
manager.connect('name-appeared', lambda *args: on_player_appeared(*args, arguments.player))
|
||||
manager.connect('player-vanished', on_player_vanished)
|
||||
|
||||
signal.signal(signal.SIGINT, signal_handler)
|
||||
signal.signal(signal.SIGTERM, signal_handler)
|
||||
signal.signal(signal.SIGPIPE, signal.SIG_DFL)
|
||||
|
||||
for player in manager.props.player_names:
|
||||
if arguments.player is not None and arguments.player != player.name:
|
||||
logger.debug('{player} is not the filtered player, skipping it'
|
||||
.format(player=player.name)
|
||||
)
|
||||
continue
|
||||
|
||||
init_player(manager, player)
|
||||
|
||||
loop.run()
|
||||
logger.info("Creating player manager")
|
||||
if arguments.player:
|
||||
logger.info(f"Filtering for player: {arguments.player}")
|
||||
player = PlayerManager(arguments.player)
|
||||
player.run()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
||||
133
src/AAppIconLabel.cpp
Normal file
133
src/AAppIconLabel.cpp
Normal file
@@ -0,0 +1,133 @@
|
||||
#include "AAppIconLabel.hpp"
|
||||
|
||||
#include <gdkmm/pixbuf.h>
|
||||
#include <glibmm/fileutils.h>
|
||||
#include <glibmm/keyfile.h>
|
||||
#include <glibmm/miscutils.h>
|
||||
#include <spdlog/spdlog.h>
|
||||
|
||||
#include <filesystem>
|
||||
#include <optional>
|
||||
|
||||
#include "util/gtk_icon.hpp"
|
||||
|
||||
namespace waybar {
|
||||
|
||||
AAppIconLabel::AAppIconLabel(const Json::Value& config, const std::string& name,
|
||||
const std::string& id, const std::string& format, uint16_t interval,
|
||||
bool ellipsize, bool enable_click, bool enable_scroll)
|
||||
: AIconLabel(config, name, id, format, interval, ellipsize, enable_click, enable_scroll) {
|
||||
// Icon size
|
||||
if (config["icon-size"].isUInt()) {
|
||||
app_icon_size_ = config["icon-size"].asUInt();
|
||||
}
|
||||
image_.set_pixel_size(app_icon_size_);
|
||||
}
|
||||
|
||||
std::optional<std::string> getDesktopFilePath(const std::string& app_identifier,
|
||||
const std::string& alternative_app_identifier) {
|
||||
const auto data_dirs = Glib::get_system_data_dirs();
|
||||
for (const auto& data_dir : data_dirs) {
|
||||
const auto data_app_dir = data_dir + "applications/";
|
||||
auto desktop_file_path = data_app_dir + app_identifier + ".desktop";
|
||||
if (std::filesystem::exists(desktop_file_path)) {
|
||||
return desktop_file_path;
|
||||
}
|
||||
if (!alternative_app_identifier.empty()) {
|
||||
desktop_file_path = data_app_dir + alternative_app_identifier + ".desktop";
|
||||
if (std::filesystem::exists(desktop_file_path)) {
|
||||
return desktop_file_path;
|
||||
}
|
||||
}
|
||||
}
|
||||
return {};
|
||||
}
|
||||
|
||||
std::optional<Glib::ustring> getIconName(const std::string& app_identifier,
|
||||
const std::string& alternative_app_identifier) {
|
||||
const auto desktop_file_path = getDesktopFilePath(app_identifier, alternative_app_identifier);
|
||||
if (!desktop_file_path.has_value()) {
|
||||
// Try some heuristics to find a matching icon
|
||||
|
||||
if (DefaultGtkIconThemeWrapper::has_icon(app_identifier)) {
|
||||
return app_identifier;
|
||||
}
|
||||
|
||||
const auto app_identifier_desktop = app_identifier + "-desktop";
|
||||
if (DefaultGtkIconThemeWrapper::has_icon(app_identifier_desktop)) {
|
||||
return app_identifier_desktop;
|
||||
}
|
||||
|
||||
const auto to_lower = [](const std::string& str) {
|
||||
auto str_cpy = str;
|
||||
std::transform(str_cpy.begin(), str_cpy.end(), str_cpy.begin(),
|
||||
[](unsigned char c) { return std::tolower(c); });
|
||||
return str;
|
||||
};
|
||||
|
||||
const auto first_space = app_identifier.find_first_of(' ');
|
||||
if (first_space != std::string::npos) {
|
||||
const auto first_word = to_lower(app_identifier.substr(0, first_space));
|
||||
if (DefaultGtkIconThemeWrapper::has_icon(first_word)) {
|
||||
return first_word;
|
||||
}
|
||||
}
|
||||
|
||||
const auto first_dash = app_identifier.find_first_of('-');
|
||||
if (first_dash != std::string::npos) {
|
||||
const auto first_word = to_lower(app_identifier.substr(0, first_dash));
|
||||
if (DefaultGtkIconThemeWrapper::has_icon(first_word)) {
|
||||
return first_word;
|
||||
}
|
||||
}
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
try {
|
||||
Glib::KeyFile desktop_file;
|
||||
desktop_file.load_from_file(desktop_file_path.value());
|
||||
return desktop_file.get_string("Desktop Entry", "Icon");
|
||||
} catch (Glib::FileError& error) {
|
||||
spdlog::warn("Error while loading desktop file {}: {}", desktop_file_path.value(),
|
||||
error.what().c_str());
|
||||
} catch (Glib::KeyFileError& error) {
|
||||
spdlog::warn("Error while loading desktop file {}: {}", desktop_file_path.value(),
|
||||
error.what().c_str());
|
||||
}
|
||||
return {};
|
||||
}
|
||||
|
||||
void AAppIconLabel::updateAppIconName(const std::string& app_identifier,
|
||||
const std::string& alternative_app_identifier) {
|
||||
if (!iconEnabled()) {
|
||||
return;
|
||||
}
|
||||
|
||||
const auto icon_name = getIconName(app_identifier, alternative_app_identifier);
|
||||
if (icon_name.has_value()) {
|
||||
app_icon_name_ = icon_name.value();
|
||||
} else {
|
||||
app_icon_name_ = "";
|
||||
}
|
||||
update_app_icon_ = true;
|
||||
}
|
||||
|
||||
void AAppIconLabel::updateAppIcon() {
|
||||
if (update_app_icon_) {
|
||||
update_app_icon_ = false;
|
||||
if (app_icon_name_.empty()) {
|
||||
image_.set_visible(false);
|
||||
} else {
|
||||
image_.set_from_icon_name(app_icon_name_, Gtk::ICON_SIZE_INVALID);
|
||||
image_.set_visible(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
auto AAppIconLabel::update() -> void {
|
||||
updateAppIcon();
|
||||
AIconLabel::update();
|
||||
}
|
||||
|
||||
} // namespace waybar
|
||||
@@ -12,7 +12,7 @@ ALabel::ALabel(const Json::Value& config, const std::string& name, const std::st
|
||||
: AModule(config, name, id, config["format-alt"].isString() || enable_click, enable_scroll),
|
||||
format_(config_["format"].isString() ? config_["format"].asString() : format),
|
||||
interval_(config_["interval"] == "once"
|
||||
? std::chrono::seconds(100000000)
|
||||
? std::chrono::seconds::max()
|
||||
: std::chrono::seconds(
|
||||
config_["interval"].isUInt() ? config_["interval"].asUInt() : interval)),
|
||||
default_format_(format_) {
|
||||
|
||||
@@ -27,20 +27,28 @@ AModule::AModule(const Json::Value& config, const std::string& name, const std::
|
||||
}
|
||||
|
||||
// configure events' user commands
|
||||
if (enable_click) {
|
||||
// hasUserEvent is true if any element from eventMap_ is satisfying the condition in the lambda
|
||||
bool hasUserEvent =
|
||||
std::find_if(eventMap_.cbegin(), eventMap_.cend(), [&config](const auto& eventEntry) {
|
||||
// True if there is any non-release type event
|
||||
return eventEntry.first.second != GdkEventType::GDK_BUTTON_RELEASE &&
|
||||
config[eventEntry.second].isString();
|
||||
}) != eventMap_.cend();
|
||||
|
||||
if (enable_click || hasUserEvent) {
|
||||
event_box_.add_events(Gdk::BUTTON_PRESS_MASK);
|
||||
event_box_.signal_button_press_event().connect(sigc::mem_fun(*this, &AModule::handleToggle));
|
||||
} else {
|
||||
std::map<std::pair<uint, GdkEventType>, std::string>::const_iterator it{eventMap_.cbegin()};
|
||||
while (it != eventMap_.cend()) {
|
||||
if (config_[it->second].isString()) {
|
||||
event_box_.add_events(Gdk::BUTTON_PRESS_MASK);
|
||||
event_box_.signal_button_press_event().connect(
|
||||
sigc::mem_fun(*this, &AModule::handleToggle));
|
||||
break;
|
||||
}
|
||||
++it;
|
||||
}
|
||||
}
|
||||
|
||||
bool hasReleaseEvent =
|
||||
std::find_if(eventMap_.cbegin(), eventMap_.cend(), [&config](const auto& eventEntry) {
|
||||
// True if there is any non-release type event
|
||||
return eventEntry.first.second == GdkEventType::GDK_BUTTON_RELEASE &&
|
||||
config[eventEntry.second].isString();
|
||||
}) != eventMap_.cend();
|
||||
if (hasReleaseEvent) {
|
||||
event_box_.add_events(Gdk::BUTTON_RELEASE_MASK);
|
||||
event_box_.signal_button_release_event().connect(sigc::mem_fun(*this, &AModule::handleRelease));
|
||||
}
|
||||
if (config_["on-scroll-up"].isString() || config_["on-scroll-down"].isString() || enable_scroll) {
|
||||
event_box_.add_events(Gdk::SCROLL_MASK | Gdk::SMOOTH_SCROLL_MASK);
|
||||
@@ -72,7 +80,11 @@ auto AModule::doAction(const std::string& name) -> void {
|
||||
}
|
||||
}
|
||||
|
||||
bool AModule::handleToggle(GdkEventButton* const& e) {
|
||||
bool AModule::handleToggle(GdkEventButton* const& e) { return handleUserEvent(e); }
|
||||
|
||||
bool AModule::handleRelease(GdkEventButton* const& e) { return handleUserEvent(e); }
|
||||
|
||||
bool AModule::handleUserEvent(GdkEventButton* const& e) {
|
||||
std::string format{};
|
||||
const std::map<std::pair<uint, GdkEventType>, std::string>::const_iterator& rec{
|
||||
eventMap_.find(std::pair(e->button, e->type))};
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user