Compare commits
334 Commits
9c2695133c
...
3304143997
Author | SHA1 | Date |
---|---|---|
blankie | 3304143997 | |
Alexis Rouillard | a1adf6847f | |
Alexis Rouillard | 6322fa28f3 | |
Austin Horstman | e394485857 | |
Austin Horstman | edab49f291 | |
Alexis Rouillard | 486b99c22f | |
Viktar Lukashonak | e46a1c6bfc | |
Alexis Rouillard | cad18f39f5 | |
mslxl | c88a86f510 | |
Alexis Rouillard | 07f75e303c | |
Viktar Lukashonak | b4e97eb2f4 | |
Viktar Lukashonak | 773b1d4806 | |
Alex | 21af48fdc9 | |
Alexis Rouillard | b5395f4e6f | |
Sonter | 3462769fc1 | |
Alexis Rouillard | ac1a42291d | |
Lukas Fink | a3e7031fe2 | |
Lukas Fink | 254111ff91 | |
Lukas Fink | de170fa579 | |
Lukas Fink | 83992d29a0 | |
Lukas Fink | 3bb3c2d23f | |
Sonter | ff66b5dd57 | |
Sonter | 9e8ebe668d | |
Alexis Rouillard | 9cfb1e38fa | |
Alexis Rouillard | ae997ad73b | |
Kainoa Kanter | 085a1ede97 | |
Alexis Rouillard | 0d02f6877d | |
github-actions[bot] | e0be3ac178 | |
Aleksei Bavshin | 45fec7bcbb | |
Aleksei Bavshin | 7b23d58684 | |
Aleksei Bavshin | 0006e4713a | |
Aleksei Bavshin | f60c291b82 | |
Sonter | 8e2a742042 | |
Aleksei Bavshin | 4a6af0da99 | |
Alex | d177969f51 | |
Alexis Rouillard | 59b7715309 | |
Alex | d56dd6ee7f | |
Alex | 1142979581 | |
Alexis Rouillard | 8a89706d03 | |
Alex | a4d31ab10d | |
Ivan Molodetskikh | 34bfefcd2e | |
Ivan Molodetskikh | fef0bb995c | |
Ivan Molodetskikh | 46e7ed35de | |
Alex | d623a89cd1 | |
Alexis Rouillard | 1210bcd2b5 | |
Alexis Rouillard | 30f6ed05ec | |
Alex | 3ade275d10 | |
Alex | 4354da2849 | |
Alex | 6417782af6 | |
Alex | 64d99a5884 | |
Alexis Rouillard | 627e4a4a50 | |
Alex | c2f1a7894b | |
Alexis Rouillard | 6560e32bc1 | |
Ikko Eltociear Ashimine | 70f3c1d9e9 | |
Michal Suchanek | 5b1826d2f6 | |
Michal Suchanek | 1fa8019ad5 | |
github-actions[bot] | 7a6960842a | |
Leonard Cohnen | 9b5c2dc7ed | |
Antoine Bolvy | 0ee519753c | |
Sonter | bf36f2abed | |
Alexis Rouillard | 5d184f74d8 | |
Scott Moreau | 4d89c64bed | |
Alexis Rouillard | f665d1da52 | |
Sonter | 29459371b9 | |
Alexis Rouillard | 26329b660a | |
Andrea Scarpino | 0fb1957dae | |
Alexis Rouillard | c5a4266329 | |
yangyingchao | fd478bf2ab | |
Aleksei Bavshin | 1f23b30b56 | |
Sonter | 36497cd41a | |
Sonter | 367f156eb0 | |
Sonter | ed40168d89 | |
Sonter | 62cb61c670 | |
Alexis Rouillard | 21906f07b3 | |
hacrvlq | c468119f52 | |
Alexis Rouillard | 79d3a1a296 | |
Alexis Rouillard | 4ae144a724 | |
Scott Moreau | fdc8431709 | |
Alexis Rouillard | 9d15c666b2 | |
Alexis Rouillard | 2131678f6b | |
Austin Horstman | 17f07b2452 | |
Austin Horstman | 05d69ae822 | |
Austin Horstman | 3ae81d62bc | |
Austin Horstman | 4efa123183 | |
Gergő Sályi | 24a9886952 | |
yangyingchao | 7ec1343ad5 | |
github-actions[bot] | 7e1fffc455 | |
Alexis Rouillard | 003dd3a9a2 | |
Alexis Rouillard | cece04e02f | |
DomCristaldi | 58e21e876e | |
Alexis Rouillard | cb8fc1c10d | |
Austin Horstman | a544f4b2cd | |
Rene D. Obermueller | ee0912a254 | |
Alex | 15e1547661 | |
Alexis Rouillard | dcbcf90aef | |
Alexis Rouillard | ed0ed398b7 | |
Alexis Rouillard | 152053e069 | |
Alexis Rouillard | 496dd05e14 | |
Alexis Rouillard | 3ff8fc8a10 | |
Alexis Rouillard | d061d2259e | |
Austin Horstman | 90ac7d5d2c | |
Austin Horstman | 4295faa7c4 | |
Austin Horstman | 9c40137d05 | |
Austin Horstman | 17132b250d | |
Alexis Rouillard | 3f61df4e66 | |
Alexis Rouillard | 2d9cc623c2 | |
Alexis Rouillard | f6ff6492ef | |
yangyingchao | b65ca334a8 | |
Kefu Chai | b71dfce1f7 | |
Alexis Rouillard | 5f3a9d9423 | |
Austin Horstman | 895c870d02 | |
Austin Horstman | 47d7324a19 | |
Austin Horstman | b19890c0b1 | |
Austin Horstman | b41fcdedff | |
Austin Horstman | 0a78da0315 | |
Alexis Rouillard | 3d0fd14f3f | |
Siddhant Kameswar | e117bd7cb6 | |
Alexis Rouillard | 2655660509 | |
Matt Provost | 0dd6af5a7e | |
Rene D. Obermueller | e2e5d4d447 | |
Alexis Rouillard | 44f39ca0ce | |
Yao Zi | 7725f6ed5a | |
Alexis Rouillard | b26ab1f982 | |
yangyingchao | 21d42baa8e | |
Lauri Niskanen | 23274a9d57 | |
Austin Horstman | f78f29ee66 | |
Lars-Ragnar A. Haugen | 7e2d8ab2a3 | |
Alexis Rouillard | 6f994c849d | |
Austin Horstman | 702e10649e | |
Alexis Rouillard | ca3877d0b8 | |
Alexis Rouillard | 18e67afe09 | |
Austin Horstman | d66685a3aa | |
Austin Horstman | 14c3235c12 | |
Alexis Rouillard | 034760e8b6 | |
Rene D. Obermueller | 8f64caceb5 | |
Alexis Rouillard | 9997155617 | |
Alexis Rouillard | ff0f408ab8 | |
Alexis Rouillard | 3262b375c9 | |
Alexis Rouillard | 494cedb3bc | |
Alexis Rouillard | 93000e3fca | |
Alexis Rouillard | abfb654f90 | |
Alexis Rouillard | 9c7a275cd6 | |
github-actions[bot] | f609042ece | |
Rene D. Obermueller | 8eee568731 | |
Rene D. Obermueller | fb24e8cb1f | |
Rene D. Obermueller | 64a3133083 | |
Alexis Rouillard | 64f54e1fce | |
Austin Horstman | c08660d837 | |
Austin Horstman | f6482c36dc | |
Alexis Rouillard | ccc3c13212 | |
Alexis Rouillard | 1003c220be | |
OpenSauce04 | d68bcbd292 | |
Caleb Maclennan | 4126502fe8 | |
Felix Glinka | 136b207a12 | |
Felix Glinka | c4d769a586 | |
Alexis Rouillard | 1c1089bade | |
Austin Horstman | b114b1155c | |
Austin Horstman | f9e693b2a2 | |
Austin Horstman | bac4d03813 | |
Alexis Rouillard | 9ba5825009 | |
Lukas Fink | 0df3c84c0f | |
Alexis Rouillard | 3f49725834 | |
Lukas Fink | ab91d0bac3 | |
Alexis Rouillard | 79a6229522 | |
Oliver Locke | 01438f71a4 | |
Alex | 0bc43c1aa7 | |
Alexis Rouillard | e8a2882796 | |
Alexis Rouillard | b955e92276 | |
Alexis Rouillard | 562e1e59b1 | |
Oliver Locke | 892042eb92 | |
Alexis Rouillard | 0251e25f23 | |
Alexis Rouillard | 9bd09aa1b3 | |
giskard | 1cd013a09b | |
giskard | 7721dcdae8 | |
giskard | e8d91eb14b | |
giskard | 0773786766 | |
Austin Horstman | 71bb2b64bf | |
Austin Horstman | 06fa931de9 | |
Austin Horstman | 16ff5ee99b | |
Austin Horstman | 08c5df3633 | |
Austin Horstman | b365831839 | |
Austin Horstman | 959422f143 | |
Austin Horstman | fa2e21dfd5 | |
Austin Horstman | 58e7abba2c | |
Austin Horstman | 87eaa75b8a | |
Austin Horstman | 749f46f86f | |
Austin Horstman | 0055ee6910 | |
Austin Horstman | 1b3b45779a | |
Austin Horstman | e1a6d513cc | |
Alexis Rouillard | f4da203915 | |
Peter Jones | 637b220f82 | |
Alexis Rouillard | 365e77af58 | |
zspher | 1b1442e3ba | |
Nicolas Lenz | d0a8c1d90d | |
Nicolas Lenz | 76c2f3166e | |
williammmm | 02eaa8b46e | |
giskard | 4fbd4f212a | |
github-actions[bot] | 1474cc626d | |
Alexis Rouillard | 7163752aa0 | |
Jack Wilsdon | e9350cf25f | |
Alexis Rouillard | 1a1a61e917 | |
zjeffer | 532a90259b | |
zjeffer | cf66604f85 | |
Alexis Rouillard | 9332697ec1 | |
Alexis Rouillard | ab735f723c | |
Austin Horstman | c5b5b64dfa | |
Austin Horstman | 381fe83008 | |
Austin Horstman | 8adb0a5644 | |
Benjamin Voisin | 885290d907 | |
Benjamin Voisin | 8220dbb513 | |
Benjamin Voisin | d9f2e0f7d2 | |
Benjamin Voisin | 161c8c4c47 | |
Benjamin Voisin | f3ed5ca5af | |
Alexis Rouillard | 0d518cb5a3 | |
Austin Horstman | 24e8766aaa | |
alttabber | 29e3d8c371 | |
Benjamin Voisin | c3581fb66b | |
Alexis Rouillard | 57f2a57dac | |
John Titor | b6ca3ea4d9 | |
John Titor | 1a9952d0c0 | |
Alex | a4a4be3381 | |
Alexis Rouillard | b7ce0b05b1 | |
Alexis Rouillard | af87388eb4 | |
Alexis Rouillard | 2aa8008ae2 | |
Alexis Rouillard | d4413f5fa6 | |
Alexis Rouillard | af7945197e | |
Alexis Rouillard | ac2fa9870f | |
Alexis Rouillard | a3ac6cb099 | |
Alexis Rouillard | dc203b8439 | |
Austin Horstman | f5bb086460 | |
Austin Horstman | 9ba9d57c8c | |
Austin Horstman | 82ae474002 | |
Austin Horstman | 56319a4705 | |
Austin Horstman | 07c91c200a | |
Austin Horstman | d73051e980 | |
Austin Horstman | 9fe51af6b0 | |
Austin Horstman | e4353e548a | |
Alexis Rouillard | 63bb338343 | |
Unreal Hoang | d012124c03 | |
Alexis Rouillard | 10664922c9 | |
Viktar Lukashonak | 60a613ae51 | |
Alexis Rouillard | 35a9ca476d | |
yangyingchao | b8e68b0e63 | |
wmlhwl | b61ea62732 | |
Alexis Rouillard | 8ad7c75d79 | |
Viktar Lukashonak | 5a1454ab31 | |
Viktar Lukashonak | b288fdf8c1 | |
Lasse Luttermann | d2a719d67c | |
Lasse Luttermann | 28ef5b7db2 | |
Lasse Luttermann | 6413f25b8d | |
Alexis Rouillard | 912d0e83f3 | |
Lasse Luttermann | 3c075bcc53 | |
Lasse Luttermann | ba8a88acfb | |
zjeffer | e27488b48c | |
zjeffer | 1828a94b6c | |
zjeffer | 49afcdf715 | |
zjeffer | ff84c6dbaf | |
Alexis Rouillard | cb2d54a237 | |
Viktar Lukashonak | 5fe99ea0e1 | |
Benjamin Voisin | 21751b2faa | |
Benjamin Voisin | 3b87b83076 | |
Benjamin Voisin | 884b909e7d | |
giskard | b980dab6df | |
giskard | e298bf922f | |
ViktarL | 2ead1bbf84 | |
Tuur Vanhoutte | 29917fb073 | |
Alex | e627879b16 | |
Alex | 0572e02d7e | |
Eldar Yusupov | df1a9c5509 | |
Lars-Ragnar A. Haugen | e7779b5458 | |
Alex | fc6d708fb6 | |
Lars-Ragnar A. Haugen | a453ea3c70 | |
Lars-Ragnar A. Haugen | 8e8ce0c6bc | |
Bintang | c4e0c569aa | |
柳芭老爹 | 231d6972d7 | |
Jacob Birkett | 50476edc98 | |
Lars-Ragnar A. Haugen | 0b6476da32 | |
Jan Beich | 79ae530bd2 | |
Tuur Vanhoutte | f41458ea24 | |
clayton craft | 2481f7a292 | |
Alex | 61ac7e4e10 | |
Milo Mordaunt | 9a3044a54f | |
Alexis Rouillard | a597a994d2 | |
Kiri | a2c5a8215b | |
Kiri | 57197b8e01 | |
Kiri | 5c4e368819 | |
Kiri | 8d962430dd | |
Kiri | 54a85ea15f | |
Kiri | efa7dc7ba4 | |
Alex | a04016e0b6 | |
Alexis Rouillard | 08b0ed1b79 | |
Lars-Ragnar A. Haugen | 5b7d0a2810 | |
Alex | 501e63fba6 | |
Alexis Rouillard | 5ce5ceba62 | |
drendog | 2123995b03 | |
Alexis Rouillard | 87cc40e6e2 | |
Lars-Ragnar A. Haugen | 6c1125c1fe | |
Alex | 937bf2ba5d | |
Alexis Rouillard | 77df0c3e3b | |
Alexis Rouillard | 95788e8081 | |
vawvaw | f75b2ae91f | |
joesri | 2673a5a4f1 | |
Alex | 8ef4ddd7ef | |
Alexis Rouillard | f26efae569 | |
Kiri | 67bf98a93e | |
Alexis Rouillard | dd092a5fc1 | |
Alexis Rouillard | 3efebc2822 | |
Alexis Rouillard | fbcd7ebbfa | |
Jan-Peter Dhallé | fb88c06d78 | |
Raphael Nestler | 133dfc2e85 | |
Alexis Rouillard | ddacb111a9 | |
hrdl | 74773885c6 | |
Kiri | 3d54a6002d | |
Kiri | da47c94480 | |
Kiri | 986b348bc7 | |
Kiri | 421ba6e31a | |
Tom Benham | 084b561d5b | |
Tom Benham | cd3d588abd | |
Kiri | 24690248db | |
Kiri | 805faa47e6 | |
Kiri | a59593fde1 | |
Kiri | 7f1e623f77 | |
Kiri | 43511992d9 | |
Alexis Rouillard | e8038ef9f3 | |
Alex | a9088c7e7d | |
Alexis Rouillard | 896c578c0e | |
Hristo Venev | f68ac9119a | |
Daniel Kahn Gillmor | 3d15b96429 | |
Alexis Rouillard | 42dc9cb85f | |
Bruce Mills | 245043f9e7 | |
Alexis Rouillard | 3de9e0cbd3 | |
kvark | 9b4fc6d16b | |
Alexis Rouillard | ddc767cd81 | |
Kuruyia | fe15530f34 |
24
.clang-tidy
24
.clang-tidy
|
@ -15,15 +15,15 @@ Checks: >
|
||||||
-readability-redundant-member-init,
|
-readability-redundant-member-init,
|
||||||
-readability-redundant-string-init,
|
-readability-redundant-string-init,
|
||||||
-readability-identifier-length
|
-readability-identifier-length
|
||||||
CheckOptions:
|
# CheckOptions:
|
||||||
- { key: readability-identifier-naming.NamespaceCase, value: lower_case }
|
# - { key: readability-identifier-naming.NamespaceCase, value: lower_case }
|
||||||
- { key: readability-identifier-naming.ClassCase, value: CamelCase }
|
# - { key: readability-identifier-naming.ClassCase, value: CamelCase }
|
||||||
- { key: readability-identifier-naming.StructCase, value: CamelCase }
|
# - { key: readability-identifier-naming.StructCase, value: CamelCase }
|
||||||
- { key: readability-identifier-naming.FunctionCase, value: camelBack }
|
# - { key: readability-identifier-naming.FunctionCase, value: camelBack }
|
||||||
- { key: readability-identifier-naming.VariableCase, value: camelBack }
|
# - { key: readability-identifier-naming.VariableCase, value: camelBack }
|
||||||
- { key: readability-identifier-naming.PrivateMemberCase, value: camelBack }
|
# - { key: readability-identifier-naming.PrivateMemberCase, value: camelBack }
|
||||||
- { key: readability-identifier-naming.PrivateMemberSuffix, value: _ }
|
# - { key: readability-identifier-naming.PrivateMemberSuffix, value: _ }
|
||||||
- { key: readability-identifier-naming.EnumCase, value: CamelCase }
|
# - { key: readability-identifier-naming.EnumCase, value: CamelCase }
|
||||||
- { key: readability-identifier-naming.EnumConstantCase, value: UPPER_CASE }
|
# - { key: readability-identifier-naming.EnumConstantCase, value: UPPER_CASE }
|
||||||
- { key: readability-identifier-naming.GlobalConstantCase, value: UPPER_CASE }
|
# - { key: readability-identifier-naming.GlobalConstantCase, value: UPPER_CASE }
|
||||||
- { key: readability-identifier-naming.StaticConstantCase, value: UPPER_CASE }
|
# - { key: readability-identifier-naming.StaticConstantCase, value: UPPER_CASE }
|
||||||
|
|
|
@ -16,4 +16,5 @@ jobs:
|
||||||
with:
|
with:
|
||||||
source: "."
|
source: "."
|
||||||
extensions: "hpp,h,cpp,c"
|
extensions: "hpp,h,cpp,c"
|
||||||
clangFormatVersion: 16
|
style: "file:.clang-format"
|
||||||
|
clangFormatVersion: 18
|
||||||
|
|
|
@ -0,0 +1,33 @@
|
||||||
|
name: Build and Push Docker Image
|
||||||
|
|
||||||
|
on:
|
||||||
|
schedule:
|
||||||
|
# run every night at midnight
|
||||||
|
- cron: '0 0 * * *'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-and-push:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
if: github.repository == 'Alexays/Waybar'
|
||||||
|
strategy:
|
||||||
|
fail-fast: false # don't fail the other jobs if one of the images fails to build
|
||||||
|
matrix:
|
||||||
|
os: [ 'alpine', 'archlinux', 'debian', 'fedora', 'gentoo', 'opensuse' ]
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Login to Docker Hub
|
||||||
|
uses: docker/login-action@v3
|
||||||
|
with:
|
||||||
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Build and push Docker image
|
||||||
|
uses: docker/build-push-action@v5
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
file: Dockerfiles/${{ matrix.os }}
|
||||||
|
push: true
|
||||||
|
tags: alexays/waybar:${{ matrix.os }}
|
|
@ -14,23 +14,22 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- name: Test in FreeBSD VM
|
- name: Test in FreeBSD VM
|
||||||
uses: cross-platform-actions/action@v0.23.0
|
uses: cross-platform-actions/action@v0.25.0
|
||||||
timeout-minutes: 180
|
timeout-minutes: 180
|
||||||
env:
|
env:
|
||||||
CPPFLAGS: '-isystem/usr/local/include'
|
CPPFLAGS: '-isystem/usr/local/include'
|
||||||
LDFLAGS: '-L/usr/local/lib'
|
LDFLAGS: '-L/usr/local/lib'
|
||||||
with:
|
with:
|
||||||
operating_system: freebsd
|
operating_system: freebsd
|
||||||
version: "13.2"
|
version: "14.1"
|
||||||
environment_variables: CPPFLAGS LDFLAGS
|
environment_variables: CPPFLAGS LDFLAGS
|
||||||
sync_files: runner-to-vm
|
sync_files: runner-to-vm
|
||||||
run: |
|
run: |
|
||||||
sudo sed -i '' 's/quarterly/latest/' /etc/pkg/FreeBSD.conf
|
|
||||||
sudo pkg install -y git # subprojects/date
|
sudo pkg install -y git # subprojects/date
|
||||||
sudo pkg install -y catch evdev-proto gtk-layer-shell gtkmm30 jsoncpp \
|
sudo pkg install -y catch evdev-proto gtk-layer-shell gtkmm30 jsoncpp \
|
||||||
libdbusmenu libevdev libfmt libmpdclient libudev-devd meson \
|
libdbusmenu libevdev libfmt libmpdclient libudev-devd meson \
|
||||||
pkgconf pulseaudio scdoc sndio spdlog wayland-protocols upower \
|
pkgconf pipewire pulseaudio scdoc sndio spdlog wayland-protocols upower \
|
||||||
libinotify
|
libinotify
|
||||||
meson build -Dman-pages=enabled
|
meson setup build -Dman-pages=enabled
|
||||||
ninja -C build
|
ninja -C build
|
||||||
meson test -C build --no-rebuild --print-errorlogs --suite waybar
|
meson test -C build --no-rebuild --print-errorlogs --suite waybar
|
||||||
|
|
|
@ -9,6 +9,7 @@ concurrency:
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
strategy:
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
distro:
|
distro:
|
||||||
- alpine
|
- alpine
|
||||||
|
@ -26,7 +27,7 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- name: configure
|
- name: configure
|
||||||
run: meson -Dman-pages=enabled -Dcpp_std=${{matrix.cpp_std}} build
|
run: meson setup -Dman-pages=enabled -Dcpp_std=${{matrix.cpp_std}} build
|
||||||
- name: build
|
- name: build
|
||||||
run: ninja -C build
|
run: ninja -C build
|
||||||
- name: test
|
- name: test
|
||||||
|
|
|
@ -0,0 +1,17 @@
|
||||||
|
name: "Nix-Tests"
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
push:
|
||||||
|
jobs:
|
||||||
|
nix-flake-check:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- uses: cachix/install-nix-action@v27
|
||||||
|
with:
|
||||||
|
extra_nix_config: |
|
||||||
|
experimental-features = nix-command flakes
|
||||||
|
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
|
||||||
|
- run: nix flake show
|
||||||
|
- run: nix flake check --print-build-logs
|
||||||
|
- run: nix build --print-build-logs
|
|
@ -0,0 +1,22 @@
|
||||||
|
name: update-flake-lock
|
||||||
|
on:
|
||||||
|
workflow_dispatch: # allows manual triggering
|
||||||
|
schedule:
|
||||||
|
- cron: '0 0 1 * *' # Run monthly
|
||||||
|
push:
|
||||||
|
paths:
|
||||||
|
- 'flake.nix'
|
||||||
|
jobs:
|
||||||
|
lockfile:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
if: github.repository == 'Alexays/Waybar'
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
- name: Install Nix
|
||||||
|
uses: cachix/install-nix-action@v27
|
||||||
|
with:
|
||||||
|
extra_nix_config: |
|
||||||
|
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
|
||||||
|
- name: Update flake.lock
|
||||||
|
uses: DeterminateSystems/update-flake-lock@v21
|
|
@ -48,3 +48,5 @@ packagecache
|
||||||
# Nix
|
# Nix
|
||||||
result
|
result
|
||||||
result-*
|
result-*
|
||||||
|
|
||||||
|
.ccls-cache
|
||||||
|
|
|
@ -3,5 +3,5 @@
|
||||||
FROM archlinux:base-devel
|
FROM archlinux:base-devel
|
||||||
|
|
||||||
RUN pacman -Syu --noconfirm && \
|
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 iniparser fftw && \
|
pacman -S --noconfirm git meson base-devel libinput wayland wayland-protocols glib2-devel 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
|
sed -Ei 's/#(en_(US|GB)\.UTF)/\1/' /etc/locale.gen && locale-gen
|
||||||
|
|
|
@ -34,7 +34,7 @@ RUN apt update && \
|
||||||
libudev-dev \
|
libudev-dev \
|
||||||
libupower-glib-dev \
|
libupower-glib-dev \
|
||||||
libwayland-dev \
|
libwayland-dev \
|
||||||
libwireplumber-0.4-dev \
|
libwireplumber-0.5-dev \
|
||||||
libxkbcommon-dev \
|
libxkbcommon-dev \
|
||||||
libxkbregistry-dev \
|
libxkbregistry-dev \
|
||||||
locales \
|
locales \
|
||||||
|
|
|
@ -29,6 +29,6 @@ RUN dnf install -y @c-development \
|
||||||
'pkgconfig(wayland-client)' \
|
'pkgconfig(wayland-client)' \
|
||||||
'pkgconfig(wayland-cursor)' \
|
'pkgconfig(wayland-cursor)' \
|
||||||
'pkgconfig(wayland-protocols)' \
|
'pkgconfig(wayland-protocols)' \
|
||||||
'pkgconfig(wireplumber-0.4)' \
|
'pkgconfig(wireplumber-0.5)' \
|
||||||
'pkgconfig(xkbregistry)' && \
|
'pkgconfig(xkbregistry)' && \
|
||||||
dnf clean all -y
|
dnf clean all -y
|
||||||
|
|
|
@ -6,4 +6,4 @@ RUN zypper -n up && \
|
||||||
zypper addrepo https://download.opensuse.org/repositories/X11:Wayland/openSUSE_Tumbleweed/X11:Wayland.repo | echo 'a' && \
|
zypper addrepo https://download.opensuse.org/repositories/X11:Wayland/openSUSE_Tumbleweed/X11:Wayland.repo | echo 'a' && \
|
||||||
zypper -n refresh && \
|
zypper -n refresh && \
|
||||||
zypper -n install -t pattern devel_C_C++ && \
|
zypper -n install -t pattern devel_C_C++ && \
|
||||||
zypper -n install git meson clang libinput10 libinput-devel pugixml-devel libwayland-client0 libwayland-cursor0 wayland-protocols-devel wayland-devel Mesa-libEGL-devel Mesa-libGLESv2-devel libgbm-devel libxkbcommon-devel libudev-devel libpixman-1-0-devel gtkmm3-devel jsoncpp-devel libxkbregistry-devel scdoc playerctl-devel
|
zypper -n install git meson clang libinput10 libinput-devel pugixml-devel libwayland-client0 libwayland-cursor0 wayland-protocols-devel wayland-devel Mesa-libEGL-devel Mesa-libGLESv2-devel libgbm-devel libxkbcommon-devel libudev-devel libpixman-1-0-devel gtkmm3-devel jsoncpp-devel libxkbregistry-devel scdoc playerctl-devel python3-packaging
|
||||||
|
|
4
Makefile
4
Makefile
|
@ -3,11 +3,11 @@
|
||||||
default: build
|
default: build
|
||||||
|
|
||||||
build:
|
build:
|
||||||
meson build
|
meson setup build
|
||||||
ninja -C build
|
ninja -C build
|
||||||
|
|
||||||
build-debug:
|
build-debug:
|
||||||
meson build --buildtype=debug
|
meson setup build --buildtype=debug
|
||||||
ninja -C build
|
ninja -C build
|
||||||
|
|
||||||
install: build
|
install: build
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
- Sway (Workspaces, Binding mode, Focused window name)
|
- Sway (Workspaces, Binding mode, Focused window name)
|
||||||
- River (Mapping mode, Tags, Focused window name)
|
- River (Mapping mode, Tags, Focused window name)
|
||||||
- Hyprland (Window Icons, Workspaces, Focused window name)
|
- Hyprland (Window Icons, Workspaces, Focused window name)
|
||||||
|
- Niri (Workspaces, Focused window name, Language)
|
||||||
- DWL (Tags, Focused window name) [requires dwl ipc patch](https://github.com/djpohly/dwl/wiki/ipc)
|
- DWL (Tags, Focused window name) [requires dwl ipc patch](https://github.com/djpohly/dwl/wiki/ipc)
|
||||||
- Tray [#21](https://github.com/Alexays/Waybar/issues/21)
|
- Tray [#21](https://github.com/Alexays/Waybar/issues/21)
|
||||||
- Local time
|
- Local time
|
||||||
|
@ -48,7 +49,7 @@ An Ubuntu PPA with more recent versions is available
|
||||||
```bash
|
```bash
|
||||||
$ git clone https://github.com/Alexays/Waybar
|
$ git clone https://github.com/Alexays/Waybar
|
||||||
$ cd Waybar
|
$ cd Waybar
|
||||||
$ meson build
|
$ meson setup build
|
||||||
$ ninja -C build
|
$ ninja -C build
|
||||||
$ ./build/waybar
|
$ ./build/waybar
|
||||||
# If you want to install it
|
# If you want to install it
|
||||||
|
|
|
@ -18,11 +18,11 @@
|
||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1711163522,
|
"lastModified": 1726062873,
|
||||||
"narHash": "sha256-YN/Ciidm+A0fmJPWlHBGvVkcarYWSC+s3NTPk/P+q3c=",
|
"narHash": "sha256-IiA3jfbR7K/B5+9byVi9BZGWTD4VSbWe8VLpp9B/iYk=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "44d0940ea560dee511026a53f0e2e2cde489b4d4",
|
"rev": "4f807e8940284ad7925ebd0a0993d2a1791acb2f",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
38
flake.nix
38
flake.nix
|
@ -16,7 +16,12 @@
|
||||||
"x86_64-linux"
|
"x86_64-linux"
|
||||||
"aarch64-linux"
|
"aarch64-linux"
|
||||||
]
|
]
|
||||||
(system: func (import nixpkgs { inherit system; }));
|
(system: func (import nixpkgs {
|
||||||
|
inherit system;
|
||||||
|
overlays = with self.overlays; [
|
||||||
|
waybar
|
||||||
|
];
|
||||||
|
}));
|
||||||
|
|
||||||
mkDate = longDate: (lib.concatStringsSep "-" [
|
mkDate = longDate: (lib.concatStringsSep "-" [
|
||||||
(builtins.substring 0 4 longDate)
|
(builtins.substring 0 4 longDate)
|
||||||
|
@ -46,22 +51,25 @@
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
overlays.default = final: prev: {
|
overlays = {
|
||||||
waybar = final.callPackage ./nix/default.nix {
|
default = self.overlays.waybar;
|
||||||
# take the first "version: '...'" from meson.build
|
waybar = final: prev: {
|
||||||
version =
|
waybar = final.callPackage ./nix/default.nix {
|
||||||
(builtins.head (builtins.split "'"
|
waybar = prev.waybar;
|
||||||
(builtins.elemAt
|
# take the first "version: '...'" from meson.build
|
||||||
(builtins.split " version: '" (builtins.readFile ./meson.build))
|
version =
|
||||||
2)))
|
(builtins.head (builtins.split "'"
|
||||||
+ "+date=" + (mkDate (self.lastModifiedDate or "19700101")) + "_" + (self.shortRev or "dirty");
|
(builtins.elemAt
|
||||||
|
(builtins.split " version: '" (builtins.readFile ./meson.build))
|
||||||
|
2)))
|
||||||
|
+ "+date=" + (mkDate (self.lastModifiedDate or "19700101")) + "_" + (self.shortRev or "dirty");
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
packages = genSystems (pkgs:
|
packages = genSystems (pkgs: {
|
||||||
let packages = self.overlays.default pkgs pkgs;
|
default = self.packages.${pkgs.stdenv.hostPlatform.system}.waybar;
|
||||||
in packages // {
|
inherit (pkgs) waybar;
|
||||||
default = packages.waybar;
|
});
|
||||||
});
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,6 +27,10 @@ class ALabel : public AModule {
|
||||||
|
|
||||||
bool handleToggle(GdkEventButton *const &e) override;
|
bool handleToggle(GdkEventButton *const &e) override;
|
||||||
virtual std::string getState(uint8_t value, bool lesser = false);
|
virtual std::string getState(uint8_t value, bool lesser = false);
|
||||||
|
|
||||||
|
std::map<std::string, GtkMenuItem *> submenus_;
|
||||||
|
std::map<std::string, std::string> menuActionsMap_;
|
||||||
|
static void handleGtkMenuEvent(GtkMenuItem *menuitem, gpointer data);
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace waybar
|
} // namespace waybar
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
#include <glibmm/dispatcher.h>
|
#include <glibmm/dispatcher.h>
|
||||||
#include <glibmm/markup.h>
|
#include <glibmm/markup.h>
|
||||||
|
#include <gtkmm.h>
|
||||||
#include <gtkmm/eventbox.h>
|
#include <gtkmm/eventbox.h>
|
||||||
#include <json/json.h>
|
#include <json/json.h>
|
||||||
|
|
||||||
|
@ -13,9 +14,9 @@ class AModule : public IModule {
|
||||||
public:
|
public:
|
||||||
static constexpr const char *MODULE_CLASS = "module";
|
static constexpr const char *MODULE_CLASS = "module";
|
||||||
|
|
||||||
virtual ~AModule();
|
~AModule() override;
|
||||||
auto update() -> void override;
|
auto update() -> void override;
|
||||||
virtual auto refresh(int) -> void{};
|
virtual auto refresh(int shouldRefresh) -> void {};
|
||||||
operator Gtk::Widget &() override;
|
operator Gtk::Widget &() override;
|
||||||
auto doAction(const std::string &name) -> void override;
|
auto doAction(const std::string &name) -> void override;
|
||||||
|
|
||||||
|
@ -31,19 +32,25 @@ class AModule : public IModule {
|
||||||
enum SCROLL_DIR { NONE, UP, DOWN, LEFT, RIGHT };
|
enum SCROLL_DIR { NONE, UP, DOWN, LEFT, RIGHT };
|
||||||
|
|
||||||
SCROLL_DIR getScrollDir(GdkEventScroll *e);
|
SCROLL_DIR getScrollDir(GdkEventScroll *e);
|
||||||
bool tooltipEnabled();
|
bool tooltipEnabled() const;
|
||||||
|
|
||||||
const std::string name_;
|
const std::string name_;
|
||||||
const Json::Value &config_;
|
const Json::Value &config_;
|
||||||
Gtk::EventBox event_box_;
|
Gtk::EventBox event_box_;
|
||||||
|
|
||||||
|
virtual void setCursor(Gdk::CursorType const &c);
|
||||||
|
|
||||||
virtual bool handleToggle(GdkEventButton *const &ev);
|
virtual bool handleToggle(GdkEventButton *const &ev);
|
||||||
|
virtual bool handleMouseEnter(GdkEventCrossing *const &ev);
|
||||||
|
virtual bool handleMouseLeave(GdkEventCrossing *const &ev);
|
||||||
virtual bool handleScroll(GdkEventScroll *);
|
virtual bool handleScroll(GdkEventScroll *);
|
||||||
virtual bool handleRelease(GdkEventButton *const &ev);
|
virtual bool handleRelease(GdkEventButton *const &ev);
|
||||||
|
GObject *menu_;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool handleUserEvent(GdkEventButton *const &ev);
|
bool handleUserEvent(GdkEventButton *const &ev);
|
||||||
const bool isTooltip;
|
const bool isTooltip;
|
||||||
|
bool hasUserEvents_;
|
||||||
std::vector<int> pid_;
|
std::vector<int> pid_;
|
||||||
gdouble distance_scrolled_y_;
|
gdouble distance_scrolled_y_;
|
||||||
gdouble distance_scrolled_x_;
|
gdouble distance_scrolled_x_;
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
#include <json/json.h>
|
#include <json/json.h>
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
#include <optional>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "AModule.hpp"
|
#include "AModule.hpp"
|
||||||
|
@ -53,7 +54,7 @@ class BarIpcClient;
|
||||||
}
|
}
|
||||||
#endif // HAVE_SWAY
|
#endif // HAVE_SWAY
|
||||||
|
|
||||||
class Bar {
|
class Bar : public sigc::trackable {
|
||||||
public:
|
public:
|
||||||
using bar_mode_map = std::map<std::string, struct bar_mode>;
|
using bar_mode_map = std::map<std::string, struct bar_mode>;
|
||||||
static const bar_mode_map PRESET_MODES;
|
static const bar_mode_map PRESET_MODES;
|
||||||
|
@ -65,7 +66,7 @@ class Bar {
|
||||||
~Bar();
|
~Bar();
|
||||||
|
|
||||||
void setMode(const std::string &mode);
|
void setMode(const std::string &mode);
|
||||||
void setVisible(bool visible);
|
void setVisible(bool value);
|
||||||
void toggle();
|
void toggle();
|
||||||
void handleSignal(int);
|
void handleSignal(int);
|
||||||
|
|
||||||
|
|
|
@ -20,6 +20,9 @@ class Config {
|
||||||
static std::optional<std::string> findConfigPath(
|
static std::optional<std::string> findConfigPath(
|
||||||
const std::vector<std::string> &names, const std::vector<std::string> &dirs = CONFIG_DIRS);
|
const std::vector<std::string> &names, const std::vector<std::string> &dirs = CONFIG_DIRS);
|
||||||
|
|
||||||
|
static std::optional<std::string> tryExpandPath(const std::string &base,
|
||||||
|
const std::string &filename);
|
||||||
|
|
||||||
Config() = default;
|
Config() = default;
|
||||||
|
|
||||||
void load(const std::string &config);
|
void load(const std::string &config);
|
||||||
|
|
|
@ -11,15 +11,13 @@ namespace waybar {
|
||||||
|
|
||||||
class Group : public AModule {
|
class Group : public AModule {
|
||||||
public:
|
public:
|
||||||
Group(const std::string&, const std::string&, const Json::Value&, bool);
|
Group(const std::string &, const std::string &, const Json::Value &, bool);
|
||||||
virtual ~Group() = default;
|
~Group() override = default;
|
||||||
auto update() -> void override;
|
auto update() -> void override;
|
||||||
operator Gtk::Widget&() override;
|
operator Gtk::Widget &() override;
|
||||||
|
|
||||||
virtual Gtk::Box& getBox();
|
virtual Gtk::Box &getBox();
|
||||||
void addWidget(Gtk::Widget& widget);
|
void addWidget(Gtk::Widget &widget);
|
||||||
|
|
||||||
bool handleMouseHover(GdkEventCrossing* const& e);
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
Gtk::Box box;
|
Gtk::Box box;
|
||||||
|
@ -27,9 +25,13 @@ class Group : public AModule {
|
||||||
Gtk::Revealer revealer;
|
Gtk::Revealer revealer;
|
||||||
bool is_first_widget = true;
|
bool is_first_widget = true;
|
||||||
bool is_drawer = false;
|
bool is_drawer = false;
|
||||||
|
bool click_to_reveal = false;
|
||||||
std::string add_class_to_drawer_children;
|
std::string add_class_to_drawer_children;
|
||||||
|
bool handleMouseEnter(GdkEventCrossing *const &ev) override;
|
||||||
void addHoverHandlerTo(Gtk::Widget& widget);
|
bool handleMouseLeave(GdkEventCrossing *const &ev) override;
|
||||||
|
bool handleToggle(GdkEventButton *const &ev) override;
|
||||||
|
void show_group();
|
||||||
|
void hide_group();
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace waybar
|
} // namespace waybar
|
||||||
|
|
|
@ -32,7 +32,7 @@ class Battery : public ALabel {
|
||||||
void refreshBatteries();
|
void refreshBatteries();
|
||||||
void worker();
|
void worker();
|
||||||
const std::string getAdapterStatus(uint8_t capacity) const;
|
const std::string getAdapterStatus(uint8_t capacity) const;
|
||||||
const std::tuple<uint8_t, float, std::string, float> getInfos();
|
std::tuple<uint8_t, float, std::string, float, uint16_t, float> getInfos();
|
||||||
const std::string formatTimeRemaining(float hoursRemaining);
|
const std::string formatTimeRemaining(float hoursRemaining);
|
||||||
void setBarClass(std::string&);
|
void setBarClass(std::string&);
|
||||||
|
|
||||||
|
|
|
@ -49,6 +49,9 @@ class Bluetooth : public ALabel {
|
||||||
auto update() -> void override;
|
auto update() -> void override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
static auto onObjectAdded(GDBusObjectManager*, GDBusObject*, gpointer) -> void;
|
||||||
|
static auto onObjectRemoved(GDBusObjectManager*, GDBusObject*, gpointer) -> void;
|
||||||
|
|
||||||
static auto onInterfaceAddedOrRemoved(GDBusObjectManager*, GDBusObject*, GDBusInterface*,
|
static auto onInterfaceAddedOrRemoved(GDBusObjectManager*, GDBusObject*, GDBusInterface*,
|
||||||
gpointer) -> void;
|
gpointer) -> void;
|
||||||
static auto onInterfaceProxyPropertiesChanged(GDBusObjectManagerClient*, GDBusObjectProxy*,
|
static auto onInterfaceProxyPropertiesChanged(GDBusObjectManagerClient*, GDBusObjectProxy*,
|
||||||
|
|
|
@ -39,6 +39,7 @@ class Cava final : public ALabel {
|
||||||
std::chrono::seconds suspend_silence_delay_{0};
|
std::chrono::seconds suspend_silence_delay_{0};
|
||||||
bool silence_{false};
|
bool silence_{false};
|
||||||
bool hide_on_silence_{false};
|
bool hide_on_silence_{false};
|
||||||
|
std::string format_silent_{""};
|
||||||
int sleep_counter_{0};
|
int sleep_counter_{0};
|
||||||
// Cava method
|
// Cava method
|
||||||
void pause_resume();
|
void pause_resume();
|
||||||
|
|
|
@ -21,10 +21,12 @@ class Clock final : public ALabel {
|
||||||
auto doAction(const std::string&) -> void override;
|
auto doAction(const std::string&) -> void override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
const std::locale locale_;
|
const std::locale m_locale_;
|
||||||
// tooltip
|
// tooltip
|
||||||
const std::string tlpFmt_;
|
const std::string m_tlpFmt_;
|
||||||
std::string tlpText_{""}; // tooltip text to print
|
std::string m_tlpText_{""}; // tooltip text to print
|
||||||
|
const Glib::RefPtr<Gtk::Label> m_tooltip_; // tooltip as a separate Gtk::Label
|
||||||
|
bool query_tlp_cb(int, int, bool, const Glib::RefPtr<Gtk::Tooltip>& tooltip);
|
||||||
// Calendar
|
// Calendar
|
||||||
const bool cldInTooltip_; // calendar in tooltip
|
const bool cldInTooltip_; // calendar in tooltip
|
||||||
/*
|
/*
|
||||||
|
@ -49,8 +51,11 @@ class Clock final : public ALabel {
|
||||||
day cldBaseDay_{0}; // calendar Cached day. Is used when today is changing(midnight)
|
day cldBaseDay_{0}; // calendar Cached day. Is used when today is changing(midnight)
|
||||||
std::string cldText_{""}; // calendar text to print
|
std::string cldText_{""}; // calendar text to print
|
||||||
CldMode cldMode_{CldMode::MONTH};
|
CldMode cldMode_{CldMode::MONTH};
|
||||||
auto get_calendar(const year_month_day& today, const year_month_day& ymd, const time_zone* tz)
|
auto get_calendar(const year_month_day& today, const year_month_day& ymd,
|
||||||
-> const std::string;
|
const time_zone* tz) -> const std::string;
|
||||||
|
|
||||||
|
// get local time zone
|
||||||
|
auto local_zone() -> const time_zone*;
|
||||||
|
|
||||||
// time zoned time in tooltip
|
// time zoned time in tooltip
|
||||||
const bool tzInTooltip_; // if need to print time zones text
|
const bool tzInTooltip_; // if need to print time zones text
|
||||||
|
@ -70,6 +75,7 @@ class Clock final : public ALabel {
|
||||||
void cldModeSwitch();
|
void cldModeSwitch();
|
||||||
void cldShift_up();
|
void cldShift_up();
|
||||||
void cldShift_down();
|
void cldShift_down();
|
||||||
|
void cldShift_reset();
|
||||||
void tz_up();
|
void tz_up();
|
||||||
void tz_down();
|
void tz_down();
|
||||||
// Module Action Map
|
// Module Action Map
|
||||||
|
@ -77,6 +83,7 @@ class Clock final : public ALabel {
|
||||||
{"mode", &waybar::modules::Clock::cldModeSwitch},
|
{"mode", &waybar::modules::Clock::cldModeSwitch},
|
||||||
{"shift_up", &waybar::modules::Clock::cldShift_up},
|
{"shift_up", &waybar::modules::Clock::cldShift_up},
|
||||||
{"shift_down", &waybar::modules::Clock::cldShift_down},
|
{"shift_down", &waybar::modules::Clock::cldShift_down},
|
||||||
|
{"shift_reset", &waybar::modules::Clock::cldShift_reset},
|
||||||
{"tz_up", &waybar::modules::Clock::tz_up},
|
{"tz_up", &waybar::modules::Clock::tz_up},
|
||||||
{"tz_down", &waybar::modules::Clock::tz_down}};
|
{"tz_down", &waybar::modules::Clock::tz_down}};
|
||||||
};
|
};
|
||||||
|
|
|
@ -35,6 +35,7 @@ class Custom : public ALabel {
|
||||||
std::string id_;
|
std::string id_;
|
||||||
std::string alt_;
|
std::string alt_;
|
||||||
std::string tooltip_;
|
std::string tooltip_;
|
||||||
|
const bool tooltip_format_enabled_;
|
||||||
std::vector<std::string> class_;
|
std::vector<std::string> class_;
|
||||||
int percentage_;
|
int percentage_;
|
||||||
FILE* fp_;
|
FILE* fp_;
|
||||||
|
|
|
@ -14,7 +14,7 @@ namespace waybar::modules::dwl {
|
||||||
class Window : public AAppIconLabel, public sigc::trackable {
|
class Window : public AAppIconLabel, public sigc::trackable {
|
||||||
public:
|
public:
|
||||||
Window(const std::string &, const waybar::Bar &, const Json::Value &);
|
Window(const std::string &, const waybar::Bar &, const Json::Value &);
|
||||||
virtual ~Window() = default;
|
~Window();
|
||||||
|
|
||||||
void handle_layout(const uint32_t layout);
|
void handle_layout(const uint32_t layout);
|
||||||
void handle_title(const char *title);
|
void handle_title(const char *title);
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <filesystem>
|
||||||
#include <list>
|
#include <list>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <mutex>
|
#include <mutex>
|
||||||
|
@ -25,6 +26,10 @@ class IPC {
|
||||||
|
|
||||||
static std::string getSocket1Reply(const std::string& rq);
|
static std::string getSocket1Reply(const std::string& rq);
|
||||||
Json::Value getSocket1JsonReply(const std::string& rq);
|
Json::Value getSocket1JsonReply(const std::string& rq);
|
||||||
|
static std::filesystem::path getSocketFolder(const char* instanceSig);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
static std::filesystem::path socketFolder_;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void startIPC();
|
void startIPC();
|
||||||
|
|
|
@ -0,0 +1,61 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <gtkmm/button.h>
|
||||||
|
#include <gtkmm/label.h>
|
||||||
|
#include <json/value.h>
|
||||||
|
|
||||||
|
#include <cstddef>
|
||||||
|
#include <cstdint>
|
||||||
|
#include <map>
|
||||||
|
#include <memory>
|
||||||
|
#include <optional>
|
||||||
|
#include <regex>
|
||||||
|
#include <string>
|
||||||
|
#include <variant>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
|
#include "AModule.hpp"
|
||||||
|
#include "bar.hpp"
|
||||||
|
#include "modules/hyprland/backend.hpp"
|
||||||
|
#include "util/enum.hpp"
|
||||||
|
#include "util/regex_collection.hpp"
|
||||||
|
|
||||||
|
using WindowAddress = std::string;
|
||||||
|
|
||||||
|
namespace waybar::modules::hyprland {
|
||||||
|
|
||||||
|
class Workspaces;
|
||||||
|
|
||||||
|
class WindowCreationPayload {
|
||||||
|
public:
|
||||||
|
WindowCreationPayload(std::string workspace_name, WindowAddress window_address,
|
||||||
|
std::string window_repr);
|
||||||
|
WindowCreationPayload(std::string workspace_name, WindowAddress window_address,
|
||||||
|
std::string window_class, std::string window_title);
|
||||||
|
WindowCreationPayload(Json::Value const& client_data);
|
||||||
|
|
||||||
|
int incrementTimeSpentUncreated();
|
||||||
|
bool isEmpty(Workspaces& workspace_manager);
|
||||||
|
bool reprIsReady() const { return std::holds_alternative<Repr>(m_window); }
|
||||||
|
std::string repr(Workspaces& workspace_manager);
|
||||||
|
|
||||||
|
std::string getWorkspaceName() const { return m_workspaceName; }
|
||||||
|
WindowAddress getAddress() const { return m_windowAddress; }
|
||||||
|
|
||||||
|
void moveToWorksace(std::string& new_workspace_name);
|
||||||
|
|
||||||
|
private:
|
||||||
|
void clearAddr();
|
||||||
|
void clearWorkspaceName();
|
||||||
|
|
||||||
|
using Repr = std::string;
|
||||||
|
using ClassAndTitle = std::pair<std::string, std::string>;
|
||||||
|
std::variant<Repr, ClassAndTitle> m_window;
|
||||||
|
|
||||||
|
WindowAddress m_windowAddress;
|
||||||
|
std::string m_workspaceName;
|
||||||
|
|
||||||
|
int m_timeSpentUncreated = 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace waybar::modules::hyprland
|
|
@ -0,0 +1,88 @@
|
||||||
|
#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 "modules/hyprland/windowcreationpayload.hpp"
|
||||||
|
#include "util/enum.hpp"
|
||||||
|
#include "util/regex_collection.hpp"
|
||||||
|
|
||||||
|
using WindowAddress = std::string;
|
||||||
|
|
||||||
|
namespace waybar::modules::hyprland {
|
||||||
|
|
||||||
|
class Workspaces;
|
||||||
|
class Workspace {
|
||||||
|
public:
|
||||||
|
explicit Workspace(const Json::Value& workspace_data, Workspaces& workspace_manager,
|
||||||
|
const Json::Value& clients_data = Json::Value::nullRef);
|
||||||
|
std::string& selectIcon(std::map<std::string, std::string>& icons_map);
|
||||||
|
Gtk::Button& button() { return m_button; };
|
||||||
|
|
||||||
|
int id() const { return m_id; };
|
||||||
|
std::string name() const { return m_name; };
|
||||||
|
std::string output() const { return m_output; };
|
||||||
|
bool isActive() const { return m_isActive; };
|
||||||
|
bool isSpecial() const { return m_isSpecial; };
|
||||||
|
bool isPersistent() const { return m_isPersistentRule || m_isPersistentConfig; };
|
||||||
|
bool isPersistentConfig() const { return m_isPersistentConfig; };
|
||||||
|
bool isPersistentRule() const { return m_isPersistentRule; };
|
||||||
|
bool isVisible() const { return m_isVisible; };
|
||||||
|
bool isEmpty() const { return m_windows == 0; };
|
||||||
|
bool isUrgent() const { return m_isUrgent; };
|
||||||
|
|
||||||
|
bool handleClicked(GdkEventButton* bt) const;
|
||||||
|
void setActive(bool value = true) { m_isActive = value; };
|
||||||
|
void setPersistentRule(bool value = true) { m_isPersistentRule = value; };
|
||||||
|
void setPersistentConfig(bool value = true) { m_isPersistentConfig = value; };
|
||||||
|
void setUrgent(bool value = true) { m_isUrgent = value; };
|
||||||
|
void setVisible(bool value = true) { m_isVisible = value; };
|
||||||
|
void setWindows(uint value) { m_windows = value; };
|
||||||
|
void setName(std::string const& value) { m_name = value; };
|
||||||
|
void setOutput(std::string const& value) { m_output = value; };
|
||||||
|
bool containsWindow(WindowAddress const& addr) const { return m_windowMap.contains(addr); }
|
||||||
|
void insertWindow(WindowCreationPayload create_window_paylod);
|
||||||
|
std::string removeWindow(WindowAddress const& addr);
|
||||||
|
void initializeWindowMap(const Json::Value& clients_data);
|
||||||
|
|
||||||
|
bool onWindowOpened(WindowCreationPayload const& create_window_paylod);
|
||||||
|
std::optional<std::string> closeWindow(WindowAddress const& addr);
|
||||||
|
|
||||||
|
void update(const std::string& format, const std::string& icon);
|
||||||
|
|
||||||
|
private:
|
||||||
|
Workspaces& m_workspaceManager;
|
||||||
|
|
||||||
|
int m_id;
|
||||||
|
std::string m_name;
|
||||||
|
std::string m_output;
|
||||||
|
uint m_windows;
|
||||||
|
bool m_isActive = false;
|
||||||
|
bool m_isSpecial = false;
|
||||||
|
bool m_isPersistentRule = false; // represents the persistent state in hyprland
|
||||||
|
bool m_isPersistentConfig = false; // represents the persistent state in the Waybar config
|
||||||
|
bool m_isUrgent = false;
|
||||||
|
bool m_isVisible = false;
|
||||||
|
|
||||||
|
std::map<WindowAddress, std::string> m_windowMap;
|
||||||
|
|
||||||
|
Gtk::Button m_button;
|
||||||
|
Gtk::Box m_content;
|
||||||
|
Gtk::Label m_label;
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace waybar::modules::hyprland
|
|
@ -4,19 +4,18 @@
|
||||||
#include <gtkmm/label.h>
|
#include <gtkmm/label.h>
|
||||||
#include <json/value.h>
|
#include <json/value.h>
|
||||||
|
|
||||||
#include <cstddef>
|
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <optional>
|
|
||||||
#include <regex>
|
#include <regex>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <variant>
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "AModule.hpp"
|
#include "AModule.hpp"
|
||||||
#include "bar.hpp"
|
#include "bar.hpp"
|
||||||
#include "modules/hyprland/backend.hpp"
|
#include "modules/hyprland/backend.hpp"
|
||||||
|
#include "modules/hyprland/windowcreationpayload.hpp"
|
||||||
|
#include "modules/hyprland/workspace.hpp"
|
||||||
#include "util/enum.hpp"
|
#include "util/enum.hpp"
|
||||||
#include "util/regex_collection.hpp"
|
#include "util/regex_collection.hpp"
|
||||||
|
|
||||||
|
@ -26,97 +25,6 @@ namespace waybar::modules::hyprland {
|
||||||
|
|
||||||
class Workspaces;
|
class Workspaces;
|
||||||
|
|
||||||
class WindowCreationPayload {
|
|
||||||
public:
|
|
||||||
WindowCreationPayload(std::string workspace_name, WindowAddress window_address,
|
|
||||||
std::string window_repr);
|
|
||||||
WindowCreationPayload(std::string workspace_name, WindowAddress window_address,
|
|
||||||
std::string window_class, std::string window_title);
|
|
||||||
WindowCreationPayload(Json::Value const& client_data);
|
|
||||||
|
|
||||||
int incrementTimeSpentUncreated();
|
|
||||||
bool isEmpty(Workspaces& workspace_manager);
|
|
||||||
bool reprIsReady() const { return std::holds_alternative<Repr>(m_window); }
|
|
||||||
std::string repr(Workspaces& workspace_manager);
|
|
||||||
|
|
||||||
std::string getWorkspaceName() const { return m_workspaceName; }
|
|
||||||
WindowAddress getAddress() const { return m_windowAddress; }
|
|
||||||
|
|
||||||
void moveToWorksace(std::string& new_workspace_name);
|
|
||||||
|
|
||||||
private:
|
|
||||||
void clearAddr();
|
|
||||||
void clearWorkspaceName();
|
|
||||||
|
|
||||||
using Repr = std::string;
|
|
||||||
using ClassAndTitle = std::pair<std::string, std::string>;
|
|
||||||
std::variant<Repr, ClassAndTitle> m_window;
|
|
||||||
|
|
||||||
WindowAddress m_windowAddress;
|
|
||||||
std::string m_workspaceName;
|
|
||||||
|
|
||||||
int m_timeSpentUncreated = 0;
|
|
||||||
};
|
|
||||||
|
|
||||||
class Workspace {
|
|
||||||
public:
|
|
||||||
explicit Workspace(const Json::Value& workspace_data, Workspaces& workspace_manager,
|
|
||||||
const Json::Value& clients_data = Json::Value::nullRef);
|
|
||||||
std::string& selectIcon(std::map<std::string, std::string>& icons_map);
|
|
||||||
Gtk::Button& button() { return m_button; };
|
|
||||||
|
|
||||||
int id() const { return m_id; };
|
|
||||||
std::string name() const { return m_name; };
|
|
||||||
std::string output() const { return m_output; };
|
|
||||||
bool isActive() const { return m_isActive; };
|
|
||||||
bool isSpecial() const { return m_isSpecial; };
|
|
||||||
bool isPersistent() const { return m_isPersistentRule || m_isPersistentConfig; };
|
|
||||||
bool isPersistentConfig() const { return m_isPersistentConfig; };
|
|
||||||
bool isPersistentRule() const { return m_isPersistentRule; };
|
|
||||||
bool isVisible() const { return m_isVisible; };
|
|
||||||
bool isEmpty() const { return m_windows == 0; };
|
|
||||||
bool isUrgent() const { return m_isUrgent; };
|
|
||||||
|
|
||||||
bool handleClicked(GdkEventButton* bt) const;
|
|
||||||
void setActive(bool value = true) { m_isActive = value; };
|
|
||||||
void setPersistentRule(bool value = true) { m_isPersistentRule = value; };
|
|
||||||
void setPersistentConfig(bool value = true) { m_isPersistentConfig = value; };
|
|
||||||
void setUrgent(bool value = true) { m_isUrgent = value; };
|
|
||||||
void setVisible(bool value = true) { m_isVisible = value; };
|
|
||||||
void setWindows(uint value) { m_windows = value; };
|
|
||||||
void setName(std::string const& value) { m_name = value; };
|
|
||||||
void setOutput(std::string const& value) { m_output = value; };
|
|
||||||
bool containsWindow(WindowAddress const& addr) const { return m_windowMap.contains(addr); }
|
|
||||||
void insertWindow(WindowCreationPayload create_window_paylod);
|
|
||||||
std::string removeWindow(WindowAddress const& addr);
|
|
||||||
void initializeWindowMap(const Json::Value& clients_data);
|
|
||||||
|
|
||||||
bool onWindowOpened(WindowCreationPayload const& create_window_paylod);
|
|
||||||
std::optional<std::string> closeWindow(WindowAddress const& addr);
|
|
||||||
|
|
||||||
void update(const std::string& format, const std::string& icon);
|
|
||||||
|
|
||||||
private:
|
|
||||||
Workspaces& m_workspaceManager;
|
|
||||||
|
|
||||||
int m_id;
|
|
||||||
std::string m_name;
|
|
||||||
std::string m_output;
|
|
||||||
uint m_windows;
|
|
||||||
bool m_isActive = false;
|
|
||||||
bool m_isSpecial = false;
|
|
||||||
bool m_isPersistentRule = false; // represents the persistent state in hyprland
|
|
||||||
bool m_isPersistentConfig = false; // represents the persistent state in the Waybar config
|
|
||||||
bool m_isUrgent = false;
|
|
||||||
bool m_isVisible = false;
|
|
||||||
|
|
||||||
std::map<WindowAddress, std::string> m_windowMap;
|
|
||||||
|
|
||||||
Gtk::Button m_button;
|
|
||||||
Gtk::Box m_content;
|
|
||||||
Gtk::Label m_label;
|
|
||||||
};
|
|
||||||
|
|
||||||
class Workspaces : public AModule, public EventHandler {
|
class Workspaces : public AModule, public EventHandler {
|
||||||
public:
|
public:
|
||||||
Workspaces(const std::string&, const waybar::Bar&, const Json::Value&);
|
Workspaces(const std::string&, const waybar::Bar&, const Json::Value&);
|
||||||
|
@ -127,6 +35,7 @@ class Workspaces : public AModule, public EventHandler {
|
||||||
auto allOutputs() const -> bool { return m_allOutputs; }
|
auto allOutputs() const -> bool { return m_allOutputs; }
|
||||||
auto showSpecial() const -> bool { return m_showSpecial; }
|
auto showSpecial() const -> bool { return m_showSpecial; }
|
||||||
auto activeOnly() const -> bool { return m_activeOnly; }
|
auto activeOnly() const -> bool { return m_activeOnly; }
|
||||||
|
auto specialVisibleOnly() const -> bool { return m_specialVisibleOnly; }
|
||||||
auto moveToMonitor() const -> bool { return m_moveToMonitor; }
|
auto moveToMonitor() const -> bool { return m_moveToMonitor; }
|
||||||
|
|
||||||
auto getBarOutput() const -> std::string { return m_bar.output->name; }
|
auto getBarOutput() const -> std::string { return m_bar.output->name; }
|
||||||
|
@ -141,11 +50,24 @@ class Workspaces : public AModule, public EventHandler {
|
||||||
void onEvent(const std::string& e) override;
|
void onEvent(const std::string& e) override;
|
||||||
void updateWindowCount();
|
void updateWindowCount();
|
||||||
void sortWorkspaces();
|
void sortWorkspaces();
|
||||||
void createWorkspace(Json::Value const& workspaceData,
|
void createWorkspace(Json::Value const& workspace_data,
|
||||||
Json::Value const& clientsData = Json::Value::nullRef);
|
Json::Value const& clients_data = Json::Value::nullRef);
|
||||||
|
|
||||||
|
static Json::Value createMonitorWorkspaceData(std::string const& name,
|
||||||
|
std::string const& monitor);
|
||||||
void removeWorkspace(std::string const& name);
|
void removeWorkspace(std::string const& name);
|
||||||
void setUrgentWorkspace(std::string const& windowaddress);
|
void setUrgentWorkspace(std::string const& windowaddress);
|
||||||
|
|
||||||
|
// Config
|
||||||
void parseConfig(const Json::Value& config);
|
void parseConfig(const Json::Value& config);
|
||||||
|
auto populateIconsMap(const Json::Value& formatIcons) -> void;
|
||||||
|
static auto populateBoolConfig(const Json::Value& config, const std::string& key,
|
||||||
|
bool& member) -> void;
|
||||||
|
auto populateSortByConfig(const Json::Value& config) -> void;
|
||||||
|
auto populateIgnoreWorkspacesConfig(const Json::Value& config) -> void;
|
||||||
|
auto populateFormatWindowSeparatorConfig(const Json::Value& config) -> void;
|
||||||
|
auto populateWindowRewriteConfig(const Json::Value& config) -> void;
|
||||||
|
|
||||||
void registerIpc();
|
void registerIpc();
|
||||||
|
|
||||||
// workspace events
|
// workspace events
|
||||||
|
@ -171,7 +93,13 @@ class Workspaces : public AModule, public EventHandler {
|
||||||
|
|
||||||
int windowRewritePriorityFunction(std::string const& window_rule);
|
int windowRewritePriorityFunction(std::string const& window_rule);
|
||||||
|
|
||||||
|
// Update methods
|
||||||
void doUpdate();
|
void doUpdate();
|
||||||
|
void removeWorkspacesToRemove();
|
||||||
|
void createWorkspacesToCreate();
|
||||||
|
static std::vector<std::string> getVisibleWorkspaces();
|
||||||
|
void updateWorkspaceStates();
|
||||||
|
bool updateWindowsToCreate();
|
||||||
|
|
||||||
void extendOrphans(int workspaceId, Json::Value const& clientsJson);
|
void extendOrphans(int workspaceId, Json::Value const& clientsJson);
|
||||||
void registerOrphanWindow(WindowCreationPayload create_window_payload);
|
void registerOrphanWindow(WindowCreationPayload create_window_payload);
|
||||||
|
@ -184,6 +112,7 @@ class Workspaces : public AModule, public EventHandler {
|
||||||
bool m_allOutputs = false;
|
bool m_allOutputs = false;
|
||||||
bool m_showSpecial = false;
|
bool m_showSpecial = false;
|
||||||
bool m_activeOnly = false;
|
bool m_activeOnly = false;
|
||||||
|
bool m_specialVisibleOnly = false;
|
||||||
bool m_moveToMonitor = false;
|
bool m_moveToMonitor = false;
|
||||||
Json::Value m_persistentWorkspaceConfig;
|
Json::Value m_persistentWorkspaceConfig;
|
||||||
|
|
||||||
|
|
|
@ -41,6 +41,7 @@ class MPD : public ALabel {
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::string getTag(mpd_tag_type type, unsigned idx = 0) const;
|
std::string getTag(mpd_tag_type type, unsigned idx = 0) const;
|
||||||
|
Glib::ustring getArtistTitleOrFilename() const;
|
||||||
std::string getFilename() const;
|
std::string getFilename() const;
|
||||||
void setLabel();
|
void setLabel();
|
||||||
std::string getStateIcon() const;
|
std::string getStateIcon() const;
|
||||||
|
|
|
@ -40,6 +40,7 @@ class Network : public ALabel {
|
||||||
void parseEssid(struct nlattr**);
|
void parseEssid(struct nlattr**);
|
||||||
void parseSignal(struct nlattr**);
|
void parseSignal(struct nlattr**);
|
||||||
void parseFreq(struct nlattr**);
|
void parseFreq(struct nlattr**);
|
||||||
|
void parseBssid(struct nlattr**);
|
||||||
bool associatedOrJoined(struct nlattr**);
|
bool associatedOrJoined(struct nlattr**);
|
||||||
bool checkInterface(std::string name);
|
bool checkInterface(std::string name);
|
||||||
auto getInfo() -> void;
|
auto getInfo() -> void;
|
||||||
|
@ -69,6 +70,7 @@ class Network : public ALabel {
|
||||||
|
|
||||||
std::string state_;
|
std::string state_;
|
||||||
std::string essid_;
|
std::string essid_;
|
||||||
|
std::string bssid_;
|
||||||
bool carrier_;
|
bool carrier_;
|
||||||
std::string ifname_;
|
std::string ifname_;
|
||||||
std::string ipaddr_;
|
std::string ipaddr_;
|
||||||
|
|
|
@ -0,0 +1,52 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <list>
|
||||||
|
#include <mutex>
|
||||||
|
#include <string>
|
||||||
|
#include <utility>
|
||||||
|
|
||||||
|
#include "util/json.hpp"
|
||||||
|
|
||||||
|
namespace waybar::modules::niri {
|
||||||
|
|
||||||
|
class EventHandler {
|
||||||
|
public:
|
||||||
|
virtual void onEvent(const Json::Value& ev) = 0;
|
||||||
|
virtual ~EventHandler() = default;
|
||||||
|
};
|
||||||
|
|
||||||
|
class IPC {
|
||||||
|
public:
|
||||||
|
IPC() { startIPC(); }
|
||||||
|
|
||||||
|
void registerForIPC(const std::string& ev, EventHandler* ev_handler);
|
||||||
|
void unregisterForIPC(EventHandler* handler);
|
||||||
|
|
||||||
|
static Json::Value send(const Json::Value& request);
|
||||||
|
|
||||||
|
// The data members are only safe to access while dataMutex_ is locked.
|
||||||
|
std::lock_guard<std::mutex> lockData() { return std::lock_guard(dataMutex_); }
|
||||||
|
const std::vector<Json::Value>& workspaces() const { return workspaces_; }
|
||||||
|
const std::vector<Json::Value>& windows() const { return windows_; }
|
||||||
|
const std::vector<std::string>& keyboardLayoutNames() const { return keyboardLayoutNames_; }
|
||||||
|
unsigned keyboardLayoutCurrent() const { return keyboardLayoutCurrent_; }
|
||||||
|
|
||||||
|
private:
|
||||||
|
void startIPC();
|
||||||
|
static int connectToSocket();
|
||||||
|
void parseIPC(const std::string&);
|
||||||
|
|
||||||
|
std::mutex dataMutex_;
|
||||||
|
std::vector<Json::Value> workspaces_;
|
||||||
|
std::vector<Json::Value> windows_;
|
||||||
|
std::vector<std::string> keyboardLayoutNames_;
|
||||||
|
unsigned keyboardLayoutCurrent_;
|
||||||
|
|
||||||
|
util::JsonParser parser_;
|
||||||
|
std::mutex callbackMutex_;
|
||||||
|
std::list<std::pair<std::string, EventHandler*>> callbacks_;
|
||||||
|
};
|
||||||
|
|
||||||
|
inline std::unique_ptr<IPC> gIPC;
|
||||||
|
|
||||||
|
}; // namespace waybar::modules::niri
|
|
@ -0,0 +1,38 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
#include "ALabel.hpp"
|
||||||
|
#include "bar.hpp"
|
||||||
|
#include "modules/niri/backend.hpp"
|
||||||
|
|
||||||
|
namespace waybar::modules::niri {
|
||||||
|
|
||||||
|
class Language : public ALabel, public EventHandler {
|
||||||
|
public:
|
||||||
|
Language(const std::string &, const Bar &, const Json::Value &);
|
||||||
|
~Language() override;
|
||||||
|
void update() override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
void updateFromIPC();
|
||||||
|
void onEvent(const Json::Value &ev) override;
|
||||||
|
void doUpdate();
|
||||||
|
|
||||||
|
struct Layout {
|
||||||
|
std::string full_name;
|
||||||
|
std::string short_name;
|
||||||
|
std::string variant;
|
||||||
|
std::string short_description;
|
||||||
|
};
|
||||||
|
|
||||||
|
static Layout getLayout(const std::string &fullName);
|
||||||
|
|
||||||
|
std::mutex mutex_;
|
||||||
|
const Bar &bar_;
|
||||||
|
|
||||||
|
std::vector<Layout> layouts_;
|
||||||
|
unsigned current_idx_;
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace waybar::modules::niri
|
|
@ -0,0 +1,28 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <gtkmm/button.h>
|
||||||
|
#include <json/value.h>
|
||||||
|
|
||||||
|
#include "AAppIconLabel.hpp"
|
||||||
|
#include "bar.hpp"
|
||||||
|
#include "modules/niri/backend.hpp"
|
||||||
|
|
||||||
|
namespace waybar::modules::niri {
|
||||||
|
|
||||||
|
class Window : public AAppIconLabel, public EventHandler {
|
||||||
|
public:
|
||||||
|
Window(const std::string &, const Bar &, const Json::Value &);
|
||||||
|
~Window() override;
|
||||||
|
void update() override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
void onEvent(const Json::Value &ev) override;
|
||||||
|
void doUpdate();
|
||||||
|
void setClass(const std::string &className, bool enable);
|
||||||
|
|
||||||
|
const Bar &bar_;
|
||||||
|
|
||||||
|
std::string oldAppId_;
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace waybar::modules::niri
|
|
@ -0,0 +1,30 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <gtkmm/button.h>
|
||||||
|
#include <json/value.h>
|
||||||
|
|
||||||
|
#include "AModule.hpp"
|
||||||
|
#include "bar.hpp"
|
||||||
|
#include "modules/niri/backend.hpp"
|
||||||
|
|
||||||
|
namespace waybar::modules::niri {
|
||||||
|
|
||||||
|
class Workspaces : public AModule, public EventHandler {
|
||||||
|
public:
|
||||||
|
Workspaces(const std::string &, const Bar &, const Json::Value &);
|
||||||
|
~Workspaces() override;
|
||||||
|
void update() override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
void onEvent(const Json::Value &ev) override;
|
||||||
|
void doUpdate();
|
||||||
|
Gtk::Button &addButton(const Json::Value &ws);
|
||||||
|
std::string getIcon(const std::string &value, const Json::Value &ws);
|
||||||
|
|
||||||
|
const Bar &bar_;
|
||||||
|
Gtk::Box box_;
|
||||||
|
// Map from niri workspace id to button.
|
||||||
|
std::unordered_map<uint64_t, Gtk::Button> buttons_;
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace waybar::modules::niri
|
|
@ -10,6 +10,8 @@ namespace waybar::modules {
|
||||||
struct Profile {
|
struct Profile {
|
||||||
std::string name;
|
std::string name;
|
||||||
std::string driver;
|
std::string driver;
|
||||||
|
|
||||||
|
Profile(std::string n, std::string d) : name(std::move(n)), driver(std::move(d)) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
class PowerProfilesDaemon : public ALabel {
|
class PowerProfilesDaemon : public ALabel {
|
||||||
|
|
|
@ -1,10 +1,7 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <iostream>
|
|
||||||
#include <map>
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#include "ALabel.hpp"
|
|
||||||
#include "gtkmm/box.h"
|
#include "gtkmm/box.h"
|
||||||
#include "modules/privacy/privacy_item.hpp"
|
#include "modules/privacy/privacy_item.hpp"
|
||||||
#include "util/pipewire/pipewire_backend.hpp"
|
#include "util/pipewire/pipewire_backend.hpp"
|
||||||
|
|
|
@ -2,9 +2,6 @@
|
||||||
|
|
||||||
#include <json/value.h>
|
#include <json/value.h>
|
||||||
|
|
||||||
#include <iostream>
|
|
||||||
#include <map>
|
|
||||||
#include <mutex>
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#include "gtkmm/box.h"
|
#include "gtkmm/box.h"
|
||||||
|
|
|
@ -76,6 +76,8 @@ class Item : public sigc::trackable {
|
||||||
void makeMenu();
|
void makeMenu();
|
||||||
bool handleClick(GdkEventButton* const& /*ev*/);
|
bool handleClick(GdkEventButton* const& /*ev*/);
|
||||||
bool handleScroll(GdkEventScroll* const&);
|
bool handleScroll(GdkEventScroll* const&);
|
||||||
|
bool handleMouseEnter(GdkEventCrossing* const&);
|
||||||
|
bool handleMouseLeave(GdkEventCrossing* const&);
|
||||||
|
|
||||||
// smooth scrolling threshold
|
// smooth scrolling threshold
|
||||||
gdouble scroll_threshold_ = 0;
|
gdouble scroll_threshold_ = 0;
|
||||||
|
|
|
@ -19,7 +19,7 @@ namespace waybar::modules::sway {
|
||||||
class Workspaces : public AModule, public sigc::trackable {
|
class Workspaces : public AModule, public sigc::trackable {
|
||||||
public:
|
public:
|
||||||
Workspaces(const std::string&, const waybar::Bar&, const Json::Value&);
|
Workspaces(const std::string&, const waybar::Bar&, const Json::Value&);
|
||||||
virtual ~Workspaces() = default;
|
~Workspaces() override = default;
|
||||||
auto update() -> void override;
|
auto update() -> void override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -38,10 +38,10 @@ class Workspaces : public AModule, public sigc::trackable {
|
||||||
Gtk::Button& addButton(const Json::Value&);
|
Gtk::Button& addButton(const Json::Value&);
|
||||||
void onButtonReady(const Json::Value&, Gtk::Button&);
|
void onButtonReady(const Json::Value&, Gtk::Button&);
|
||||||
std::string getIcon(const std::string&, const Json::Value&);
|
std::string getIcon(const std::string&, const Json::Value&);
|
||||||
const std::string getCycleWorkspace(std::vector<Json::Value>::iterator, bool prev) const;
|
std::string getCycleWorkspace(std::vector<Json::Value>::iterator, bool prev) const;
|
||||||
uint16_t getWorkspaceIndex(const std::string& name) const;
|
uint16_t getWorkspaceIndex(const std::string& name) const;
|
||||||
std::string trimWorkspaceName(std::string);
|
static std::string trimWorkspaceName(std::string);
|
||||||
bool handleScroll(GdkEventScroll*) override;
|
bool handleScroll(GdkEventScroll* /*unused*/) override;
|
||||||
|
|
||||||
const Bar& bar_;
|
const Bar& bar_;
|
||||||
std::vector<Json::Value> workspaces_;
|
std::vector<Json::Value> workspaces_;
|
||||||
|
|
|
@ -0,0 +1,94 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <giomm/dbusconnection.h>
|
||||||
|
#include <gtkmm/icontheme.h>
|
||||||
|
#include <libupower-glib/upower.h>
|
||||||
|
|
||||||
|
#include <unordered_map>
|
||||||
|
|
||||||
|
#include "AIconLabel.hpp"
|
||||||
|
|
||||||
|
namespace waybar::modules {
|
||||||
|
|
||||||
|
class UPower final : public AIconLabel {
|
||||||
|
public:
|
||||||
|
UPower(const std::string &, const Json::Value &);
|
||||||
|
virtual ~UPower();
|
||||||
|
auto update() -> void override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
const std::string NO_BATTERY{"battery-missing-symbolic"};
|
||||||
|
|
||||||
|
// Config
|
||||||
|
bool showIcon_{true};
|
||||||
|
bool hideIfEmpty_{true};
|
||||||
|
int iconSize_{20};
|
||||||
|
int tooltip_spacing_{4};
|
||||||
|
int tooltip_padding_{4};
|
||||||
|
Gtk::Box contentBox_; // tooltip box
|
||||||
|
std::string tooltipFormat_;
|
||||||
|
|
||||||
|
// UPower device info
|
||||||
|
struct upDevice_output {
|
||||||
|
UpDevice *upDevice{NULL};
|
||||||
|
double percentage{0.0};
|
||||||
|
double temperature{0.0};
|
||||||
|
guint64 time_full{0u};
|
||||||
|
guint64 time_empty{0u};
|
||||||
|
gchar *icon_name{(char *)'\0'};
|
||||||
|
bool upDeviceValid{false};
|
||||||
|
UpDeviceState state;
|
||||||
|
UpDeviceKind kind;
|
||||||
|
char *nativePath{(char *)'\0'};
|
||||||
|
char *model{(char *)'\0'};
|
||||||
|
};
|
||||||
|
|
||||||
|
// Technical variables
|
||||||
|
std::string nativePath_;
|
||||||
|
std::string model_;
|
||||||
|
std::string lastStatus_;
|
||||||
|
Glib::ustring label_markup_;
|
||||||
|
std::mutex mutex_;
|
||||||
|
Glib::RefPtr<Gtk::IconTheme> gtkTheme_;
|
||||||
|
bool sleeping_;
|
||||||
|
|
||||||
|
// Technical functions
|
||||||
|
void addDevice(UpDevice *);
|
||||||
|
void removeDevice(const gchar *);
|
||||||
|
void removeDevices();
|
||||||
|
void resetDevices();
|
||||||
|
void setDisplayDevice();
|
||||||
|
const Glib::ustring getText(const upDevice_output &upDevice_, const std::string &format);
|
||||||
|
bool queryTooltipCb(int, int, bool, const Glib::RefPtr<Gtk::Tooltip> &);
|
||||||
|
|
||||||
|
// DBUS variables
|
||||||
|
guint watcherID_;
|
||||||
|
Glib::RefPtr<Gio::DBus::Connection> conn_;
|
||||||
|
guint subscrID_{0u};
|
||||||
|
|
||||||
|
// UPower variables
|
||||||
|
UpClient *upClient_;
|
||||||
|
upDevice_output upDevice_; // Device to display
|
||||||
|
typedef std::unordered_map<std::string, upDevice_output> Devices;
|
||||||
|
Devices devices_;
|
||||||
|
bool upRunning_{true};
|
||||||
|
|
||||||
|
// DBus callbacks
|
||||||
|
void getConn_cb(Glib::RefPtr<Gio::AsyncResult> &result);
|
||||||
|
void onAppear(const Glib::RefPtr<Gio::DBus::Connection> &, const Glib::ustring &,
|
||||||
|
const Glib::ustring &);
|
||||||
|
void onVanished(const Glib::RefPtr<Gio::DBus::Connection> &, const Glib::ustring &);
|
||||||
|
void prepareForSleep_cb(const Glib::RefPtr<Gio::DBus::Connection> &connection,
|
||||||
|
const Glib::ustring &sender_name, const Glib::ustring &object_path,
|
||||||
|
const Glib::ustring &interface_name, const Glib::ustring &signal_name,
|
||||||
|
const Glib::VariantContainerBase ¶meters);
|
||||||
|
|
||||||
|
// UPower callbacks
|
||||||
|
static void deviceAdded_cb(UpClient *client, UpDevice *device, gpointer data);
|
||||||
|
static void deviceRemoved_cb(UpClient *client, const gchar *objectPath, gpointer data);
|
||||||
|
static void deviceNotify_cb(UpDevice *device, GParamSpec *pspec, gpointer user_data);
|
||||||
|
// UPower secondary functions
|
||||||
|
void getUpDeviceInfo(upDevice_output &upDevice_);
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace waybar::modules
|
|
@ -1,82 +0,0 @@
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#include <libupower-glib/upower.h>
|
|
||||||
|
|
||||||
#include <iostream>
|
|
||||||
#include <map>
|
|
||||||
#include <string>
|
|
||||||
#include <unordered_map>
|
|
||||||
|
|
||||||
#include "ALabel.hpp"
|
|
||||||
#include "glibconfig.h"
|
|
||||||
#include "gtkmm/box.h"
|
|
||||||
#include "gtkmm/image.h"
|
|
||||||
#include "gtkmm/label.h"
|
|
||||||
#include "modules/upower/upower_tooltip.hpp"
|
|
||||||
|
|
||||||
namespace waybar::modules::upower {
|
|
||||||
|
|
||||||
class UPower : public AModule {
|
|
||||||
public:
|
|
||||||
UPower(const std::string &, const Json::Value &);
|
|
||||||
virtual ~UPower();
|
|
||||||
auto update() -> void override;
|
|
||||||
|
|
||||||
private:
|
|
||||||
typedef std::unordered_map<std::string, UpDevice *> Devices;
|
|
||||||
|
|
||||||
const std::string DEFAULT_FORMAT = "{percentage}";
|
|
||||||
const std::string DEFAULT_FORMAT_ALT = "{percentage} {time}";
|
|
||||||
|
|
||||||
static void deviceAdded_cb(UpClient *client, UpDevice *device, gpointer data);
|
|
||||||
static void deviceRemoved_cb(UpClient *client, const gchar *objectPath, gpointer data);
|
|
||||||
static void deviceNotify_cb(UpDevice *device, GParamSpec *pspec, gpointer user_data);
|
|
||||||
static void prepareForSleep_cb(GDBusConnection *system_bus, const gchar *sender_name,
|
|
||||||
const gchar *object_path, const gchar *interface_name,
|
|
||||||
const gchar *signal_name, GVariant *parameters,
|
|
||||||
gpointer user_data);
|
|
||||||
static void upowerAppear(GDBusConnection *conn, const gchar *name, const gchar *name_owner,
|
|
||||||
gpointer data);
|
|
||||||
static void upowerDisappear(GDBusConnection *connection, const gchar *name, gpointer user_data);
|
|
||||||
|
|
||||||
void removeDevice(const gchar *objectPath);
|
|
||||||
void addDevice(UpDevice *device);
|
|
||||||
void setDisplayDevice();
|
|
||||||
void resetDevices();
|
|
||||||
void removeDevices();
|
|
||||||
bool show_tooltip_callback(int, int, bool, const Glib::RefPtr<Gtk::Tooltip> &tooltip);
|
|
||||||
bool handleToggle(GdkEventButton *const &) override;
|
|
||||||
std::string timeToString(gint64 time);
|
|
||||||
|
|
||||||
const std::string getDeviceStatus(UpDeviceState &state);
|
|
||||||
|
|
||||||
Gtk::Box box_;
|
|
||||||
Gtk::Image icon_;
|
|
||||||
Gtk::Label label_;
|
|
||||||
|
|
||||||
// Config
|
|
||||||
bool hideIfEmpty = true;
|
|
||||||
bool tooltip_enabled = true;
|
|
||||||
uint tooltip_spacing = 4;
|
|
||||||
uint tooltip_padding = 4;
|
|
||||||
uint iconSize = 20;
|
|
||||||
std::string format = DEFAULT_FORMAT;
|
|
||||||
std::string format_alt = DEFAULT_FORMAT_ALT;
|
|
||||||
|
|
||||||
Devices devices;
|
|
||||||
std::mutex m_Mutex;
|
|
||||||
UpClient *client;
|
|
||||||
UpDevice *displayDevice = nullptr;
|
|
||||||
guint login1_id;
|
|
||||||
GDBusConnection *login1_connection;
|
|
||||||
std::unique_ptr<UPowerTooltip> upower_tooltip;
|
|
||||||
std::string lastStatus;
|
|
||||||
const char *lastWarningLevel;
|
|
||||||
bool showAltText;
|
|
||||||
bool showIcon = true;
|
|
||||||
bool upowerRunning;
|
|
||||||
guint upowerWatcher_id;
|
|
||||||
std::string nativePath_;
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace waybar::modules::upower
|
|
|
@ -1,33 +0,0 @@
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#include <libupower-glib/upower.h>
|
|
||||||
|
|
||||||
#include <memory>
|
|
||||||
#include <unordered_map>
|
|
||||||
|
|
||||||
#include "gtkmm/box.h"
|
|
||||||
#include "gtkmm/label.h"
|
|
||||||
#include "gtkmm/window.h"
|
|
||||||
|
|
||||||
namespace waybar::modules::upower {
|
|
||||||
|
|
||||||
class UPowerTooltip : public Gtk::Window {
|
|
||||||
private:
|
|
||||||
typedef std::unordered_map<std::string, UpDevice*> Devices;
|
|
||||||
|
|
||||||
const std::string getDeviceIcon(UpDeviceKind& kind);
|
|
||||||
|
|
||||||
std::unique_ptr<Gtk::Box> contentBox;
|
|
||||||
|
|
||||||
uint iconSize;
|
|
||||||
uint tooltipSpacing;
|
|
||||||
uint tooltipPadding;
|
|
||||||
|
|
||||||
public:
|
|
||||||
UPowerTooltip(uint iconSize, uint tooltipSpacing, uint tooltipPadding);
|
|
||||||
virtual ~UPowerTooltip();
|
|
||||||
|
|
||||||
uint updateTooltip(Devices& devices);
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace waybar::modules::upower
|
|
|
@ -24,6 +24,10 @@
|
||||||
|
|
||||||
namespace waybar::modules::wlr {
|
namespace waybar::modules::wlr {
|
||||||
|
|
||||||
|
struct widget_geometry {
|
||||||
|
int x, y, w, h;
|
||||||
|
};
|
||||||
|
|
||||||
class Taskbar;
|
class Taskbar;
|
||||||
|
|
||||||
class Task {
|
class Task {
|
||||||
|
@ -42,6 +46,7 @@ class Task {
|
||||||
};
|
};
|
||||||
// made public so TaskBar can reorder based on configuration.
|
// made public so TaskBar can reorder based on configuration.
|
||||||
Gtk::Button button;
|
Gtk::Button button;
|
||||||
|
struct widget_geometry minimize_hint;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static uint32_t global_id;
|
static uint32_t global_id;
|
||||||
|
@ -82,6 +87,8 @@ class Task {
|
||||||
private:
|
private:
|
||||||
std::string repr() const;
|
std::string repr() const;
|
||||||
std::string state_string(bool = false) const;
|
std::string state_string(bool = false) const;
|
||||||
|
void set_minimize_hint();
|
||||||
|
void on_button_size_allocated(Gtk::Allocation &alloc);
|
||||||
void set_app_info_from_app_id_list(const std::string &app_id_list);
|
void set_app_info_from_app_id_list(const std::string &app_id_list);
|
||||||
bool image_load_icon(Gtk::Image &image, const Glib::RefPtr<Gtk::IconTheme> &icon_theme,
|
bool image_load_icon(Gtk::Image &image, const Glib::RefPtr<Gtk::IconTheme> &icon_theme,
|
||||||
Glib::RefPtr<Gio::DesktopAppInfo> app_info, int size);
|
Glib::RefPtr<Gio::DesktopAppInfo> app_info, int size);
|
||||||
|
|
|
@ -56,10 +56,10 @@ class BacklightBackend {
|
||||||
|
|
||||||
void set_previous_best_device(const BacklightDevice *device);
|
void set_previous_best_device(const BacklightDevice *device);
|
||||||
|
|
||||||
void set_brightness(std::string preferred_device, ChangeType change_type, double step);
|
void set_brightness(const std::string &preferred_device, ChangeType change_type, double step);
|
||||||
|
|
||||||
void set_scaled_brightness(std::string preferred_device, int brightness);
|
void set_scaled_brightness(const std::string &preferred_device, int brightness);
|
||||||
int get_scaled_brightness(std::string preferred_device);
|
int get_scaled_brightness(const std::string &preferred_device);
|
||||||
|
|
||||||
bool is_login_proxy_initialized() const { return static_cast<bool>(login_proxy_); }
|
bool is_login_proxy_initialized() const { return static_cast<bool>(login_proxy_); }
|
||||||
|
|
||||||
|
@ -70,7 +70,7 @@ class BacklightBackend {
|
||||||
std::mutex udev_thread_mutex_;
|
std::mutex udev_thread_mutex_;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void set_brightness_internal(std::string device_name, int brightness, int max_brightness);
|
void set_brightness_internal(const std::string &device_name, int brightness, int max_brightness);
|
||||||
|
|
||||||
std::function<void()> on_updated_cb_;
|
std::function<void()> on_updated_cb_;
|
||||||
std::chrono::milliseconds polling_interval_;
|
std::chrono::milliseconds polling_interval_;
|
||||||
|
|
|
@ -622,8 +622,8 @@ inline auto convertInto(std::string const &source, bool &target) -> ParserResult
|
||||||
}
|
}
|
||||||
#ifdef CLARA_CONFIG_OPTIONAL_TYPE
|
#ifdef CLARA_CONFIG_OPTIONAL_TYPE
|
||||||
template <typename T>
|
template <typename T>
|
||||||
inline auto convertInto(std::string const &source, CLARA_CONFIG_OPTIONAL_TYPE<T> &target)
|
inline auto convertInto(std::string const &source,
|
||||||
-> ParserResult {
|
CLARA_CONFIG_OPTIONAL_TYPE<T> &target) -> ParserResult {
|
||||||
T temp;
|
T temp;
|
||||||
auto result = convertInto(source, temp);
|
auto result = convertInto(source, temp);
|
||||||
if (result) target = std::move(temp);
|
if (result) target = std::move(temp);
|
||||||
|
@ -751,8 +751,8 @@ class ParserBase {
|
||||||
public:
|
public:
|
||||||
virtual ~ParserBase() = default;
|
virtual ~ParserBase() = default;
|
||||||
virtual auto validate() const -> Result { return Result::ok(); }
|
virtual auto validate() const -> Result { return Result::ok(); }
|
||||||
virtual auto parse(std::string const &exeName, TokenStream const &tokens) const
|
virtual auto parse(std::string const &exeName,
|
||||||
-> InternalParseResult = 0;
|
TokenStream const &tokens) const -> InternalParseResult = 0;
|
||||||
virtual auto cardinality() const -> size_t { return 1; }
|
virtual auto cardinality() const -> size_t { return 1; }
|
||||||
|
|
||||||
auto parse(Args const &args) const -> InternalParseResult {
|
auto parse(Args const &args) const -> InternalParseResult {
|
||||||
|
@ -1098,8 +1098,8 @@ struct Parser : ParserBase {
|
||||||
|
|
||||||
using ParserBase::parse;
|
using ParserBase::parse;
|
||||||
|
|
||||||
auto parse(std::string const &exeName, TokenStream const &tokens) const
|
auto parse(std::string const &exeName,
|
||||||
-> InternalParseResult override {
|
TokenStream const &tokens) const -> InternalParseResult override {
|
||||||
struct ParserInfo {
|
struct ParserInfo {
|
||||||
ParserBase const *parser = nullptr;
|
ParserBase const *parser = nullptr;
|
||||||
size_t count = 0;
|
size_t count = 0;
|
||||||
|
|
|
@ -64,7 +64,7 @@ struct fmt::formatter<date::zoned_time<Duration, TimeZonePtr>> {
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename FormatContext>
|
template <typename FormatContext>
|
||||||
auto format(const date::zoned_time<Duration, TimeZonePtr>& ztime, FormatContext& ctx) {
|
auto format(const date::zoned_time<Duration, TimeZonePtr>& ztime, FormatContext& ctx) const {
|
||||||
if (ctx.locale()) {
|
if (ctx.locale()) {
|
||||||
const auto loc = ctx.locale().template get<std::locale>();
|
const auto loc = ctx.locale().template get<std::locale>();
|
||||||
return fmt::format_to(ctx.out(), "{}", date::format(loc, fmt::to_string(specs), ztime));
|
return fmt::format_to(ctx.out(), "{}", date::format(loc, fmt::to_string(specs), ztime));
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
class pow_format {
|
class pow_format {
|
||||||
public:
|
public:
|
||||||
pow_format(long long val, std::string&& unit, bool binary = false)
|
pow_format(long long val, std::string&& unit, bool binary = false)
|
||||||
: val_(val), unit_(unit), binary_(binary){};
|
: val_(val), unit_(unit), binary_(binary) {};
|
||||||
|
|
||||||
long long val_;
|
long long val_;
|
||||||
std::string unit_;
|
std::string unit_;
|
||||||
|
@ -45,7 +45,7 @@ struct formatter<pow_format> {
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class FormatContext>
|
template <class FormatContext>
|
||||||
auto format(const pow_format& s, FormatContext& ctx) -> decltype(ctx.out()) {
|
auto format(const pow_format& s, FormatContext& ctx) const -> decltype(ctx.out()) {
|
||||||
const char* units[] = {"", "k", "M", "G", "T", "P", nullptr};
|
const char* units[] = {"", "k", "M", "G", "T", "P", nullptr};
|
||||||
|
|
||||||
auto base = s.binary_ ? 1024ull : 1000ll;
|
auto base = s.binary_ ? 1024ull : 1000ll;
|
||||||
|
@ -92,7 +92,7 @@ struct formatter<pow_format> {
|
||||||
template <>
|
template <>
|
||||||
struct formatter<Glib::ustring> : formatter<std::string> {
|
struct formatter<Glib::ustring> : formatter<std::string> {
|
||||||
template <typename FormatContext>
|
template <typename FormatContext>
|
||||||
auto format(const Glib::ustring& value, FormatContext& ctx) {
|
auto format(const Glib::ustring& value, FormatContext& ctx) const {
|
||||||
return formatter<std::string>::format(static_cast<std::string>(value), ctx);
|
return formatter<std::string>::format(static_cast<std::string>(value), ctx);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -2,6 +2,8 @@
|
||||||
|
|
||||||
#include <pipewire/pipewire.h>
|
#include <pipewire/pipewire.h>
|
||||||
|
|
||||||
|
#include <unordered_map>
|
||||||
|
|
||||||
#include "util/backend_common.hpp"
|
#include "util/backend_common.hpp"
|
||||||
#include "util/pipewire/privacy_node_info.hpp"
|
#include "util/pipewire/privacy_node_info.hpp"
|
||||||
|
|
||||||
|
@ -13,7 +15,8 @@ class PipewireBackend {
|
||||||
pw_context* context_;
|
pw_context* context_;
|
||||||
pw_core* core_;
|
pw_core* core_;
|
||||||
|
|
||||||
spa_hook registry_listener;
|
pw_registry* registry_;
|
||||||
|
spa_hook registryListener_;
|
||||||
|
|
||||||
/* Hack to keep constructor inaccessible but still public.
|
/* Hack to keep constructor inaccessible but still public.
|
||||||
* This is required to be able to use std::make_shared.
|
* This is required to be able to use std::make_shared.
|
||||||
|
@ -21,20 +24,22 @@ class PipewireBackend {
|
||||||
* pointer because the destructor will manually free memory, and this could be
|
* pointer because the destructor will manually free memory, and this could be
|
||||||
* a problem with C++20's copy and move semantics.
|
* a problem with C++20's copy and move semantics.
|
||||||
*/
|
*/
|
||||||
struct private_constructor_tag {};
|
struct PrivateConstructorTag {};
|
||||||
|
|
||||||
public:
|
public:
|
||||||
std::mutex mutex_;
|
|
||||||
|
|
||||||
pw_registry* registry;
|
|
||||||
|
|
||||||
sigc::signal<void> privacy_nodes_changed_signal_event;
|
sigc::signal<void> privacy_nodes_changed_signal_event;
|
||||||
|
|
||||||
std::unordered_map<uint32_t, PrivacyNodeInfo*> privacy_nodes;
|
std::unordered_map<uint32_t, PrivacyNodeInfo*> privacy_nodes;
|
||||||
|
std::mutex mutex_;
|
||||||
|
|
||||||
static std::shared_ptr<PipewireBackend> getInstance();
|
static std::shared_ptr<PipewireBackend> getInstance();
|
||||||
|
|
||||||
PipewireBackend(private_constructor_tag tag);
|
// Handlers for PipeWire events
|
||||||
|
void handleRegistryEventGlobal(uint32_t id, uint32_t permissions, const char* type,
|
||||||
|
uint32_t version, const struct spa_dict* props);
|
||||||
|
void handleRegistryEventGlobalRemove(uint32_t id);
|
||||||
|
|
||||||
|
PipewireBackend(PrivateConstructorTag tag);
|
||||||
~PipewireBackend();
|
~PipewireBackend();
|
||||||
};
|
};
|
||||||
} // namespace waybar::util::PipewireBackend
|
} // namespace waybar::util::PipewireBackend
|
||||||
|
|
|
@ -34,29 +34,12 @@ class PrivacyNodeInfo {
|
||||||
|
|
||||||
void *data;
|
void *data;
|
||||||
|
|
||||||
std::string get_name() {
|
std::string getName();
|
||||||
const std::vector<std::string *> names{&application_name, &node_name};
|
std::string getIconName();
|
||||||
std::string name = "Unknown Application";
|
|
||||||
for (auto &name_ : names) {
|
|
||||||
if (name_ != nullptr && name_->length() > 0) {
|
|
||||||
name = *name_;
|
|
||||||
name[0] = toupper(name[0]);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return name;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::string get_icon_name() {
|
// Handlers for PipeWire events
|
||||||
const std::vector<std::string *> names{&application_icon_name, &pipewire_access_portal_app_id,
|
void handleProxyEventDestroy();
|
||||||
&application_name, &node_name};
|
void handleNodeEventInfo(const struct pw_node_info *info);
|
||||||
const std::string name = "application-x-executable-symbolic";
|
|
||||||
for (auto &name_ : names) {
|
|
||||||
if (name_ != nullptr && name_->length() > 0 && DefaultGtkIconThemeWrapper::has_icon(*name_)) {
|
|
||||||
return *name_;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return name;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace waybar::util::PipewireBackend
|
} // namespace waybar::util::PipewireBackend
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
#include <functional>
|
#include <functional>
|
||||||
#include <regex>
|
#include <regex>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
#include <utility>
|
||||||
|
|
||||||
namespace waybar::util {
|
namespace waybar::util {
|
||||||
|
|
||||||
|
@ -17,7 +18,7 @@ struct Rule {
|
||||||
// See https://en.cppreference.com/w/cpp/compiler_support/20 "Parenthesized initialization of
|
// See https://en.cppreference.com/w/cpp/compiler_support/20 "Parenthesized initialization of
|
||||||
// aggregates"
|
// aggregates"
|
||||||
Rule(std::regex rule, std::string repr, int priority)
|
Rule(std::regex rule, std::string repr, int priority)
|
||||||
: rule(rule), repr(repr), priority(priority) {}
|
: rule(std::move(rule)), repr(std::move(repr)), priority(priority) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
int default_priority_function(std::string& key);
|
int default_priority_function(std::string& key);
|
||||||
|
@ -36,12 +37,13 @@ class RegexCollection {
|
||||||
std::map<std::string, std::string> regex_cache;
|
std::map<std::string, std::string> regex_cache;
|
||||||
std::string default_repr;
|
std::string default_repr;
|
||||||
|
|
||||||
std::string& find_match(std::string& value, bool& matched_any);
|
std::string find_match(std::string& value, bool& matched_any);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
RegexCollection() = default;
|
RegexCollection() = default;
|
||||||
RegexCollection(const Json::Value& map, std::string default_repr = "",
|
RegexCollection(
|
||||||
std::function<int(std::string&)> priority_function = default_priority_function);
|
const Json::Value& map, std::string default_repr = "",
|
||||||
|
const std::function<int(std::string&)>& priority_function = default_priority_function);
|
||||||
~RegexCollection() = default;
|
~RegexCollection() = default;
|
||||||
|
|
||||||
std::string& get(std::string& value, bool& matched_any);
|
std::string& get(std::string& value, bool& matched_any);
|
||||||
|
|
|
@ -38,7 +38,7 @@ The *backlight* module displays the current backlight level.
|
||||||
|
|
||||||
*rotate*: ++
|
*rotate*: ++
|
||||||
typeof: integer ++
|
typeof: integer ++
|
||||||
Positive value to rotate the text label.
|
Positive value to rotate the text label (in 90 degree increments).
|
||||||
|
|
||||||
*states*: ++
|
*states*: ++
|
||||||
typeof: object ++
|
typeof: object ++
|
||||||
|
@ -81,6 +81,19 @@ The *backlight* module displays the current backlight level.
|
||||||
default: 1.0 ++
|
default: 1.0 ++
|
||||||
The speed at which to change the brightness when scrolling.
|
The speed at which to change the brightness when scrolling.
|
||||||
|
|
||||||
|
*menu*: ++
|
||||||
|
typeof: string ++
|
||||||
|
Action that popups the menu.
|
||||||
|
|
||||||
|
*menu-file*: ++
|
||||||
|
typeof: string ++
|
||||||
|
Location of the menu descriptor file. There need to be an element of type
|
||||||
|
GtkMenu with id *menu*
|
||||||
|
|
||||||
|
*menu-actions*: ++
|
||||||
|
typeof: array ++
|
||||||
|
The actions corresponding to the buttons of the menu.
|
||||||
|
|
||||||
# EXAMPLE:
|
# EXAMPLE:
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
|
@ -69,7 +69,7 @@ The *battery* module displays the current capacity and state (eg. charging) of y
|
||||||
|
|
||||||
*rotate*: ++
|
*rotate*: ++
|
||||||
typeof: integer++
|
typeof: integer++
|
||||||
Positive value to rotate the text label.
|
Positive value to rotate the text label (in 90 degree increments).
|
||||||
|
|
||||||
*on-click*: ++
|
*on-click*: ++
|
||||||
typeof: string ++
|
typeof: string ++
|
||||||
|
@ -109,6 +109,19 @@ The *battery* module displays the current capacity and state (eg. charging) of y
|
||||||
default: false ++
|
default: false ++
|
||||||
Option to enable battery compatibility if not detected.
|
Option to enable battery compatibility if not detected.
|
||||||
|
|
||||||
|
*menu*: ++
|
||||||
|
typeof: string ++
|
||||||
|
Action that popups the menu.
|
||||||
|
|
||||||
|
*menu-file*: ++
|
||||||
|
typeof: string ++
|
||||||
|
Location of the menu descriptor file. There need to be an element of type
|
||||||
|
GtkMenu with id *menu*
|
||||||
|
|
||||||
|
*menu-actions*: ++
|
||||||
|
typeof: array ++
|
||||||
|
The actions corresponding to the buttons of the menu.
|
||||||
|
|
||||||
# FORMAT REPLACEMENTS
|
# FORMAT REPLACEMENTS
|
||||||
|
|
||||||
*{capacity}*: Capacity in percentage
|
*{capacity}*: Capacity in percentage
|
||||||
|
@ -119,6 +132,10 @@ The *battery* module displays the current capacity and state (eg. charging) of y
|
||||||
|
|
||||||
*{time}*: Estimate of time until full or empty. Note that this is based on the power draw at the last refresh time, not an average.
|
*{time}*: Estimate of time until full or empty. Note that this is based on the power draw at the last refresh time, not an average.
|
||||||
|
|
||||||
|
*{cycles}*: Amount of charge cycles the highest-capacity battery has seen. *(Linux only)*
|
||||||
|
|
||||||
|
*{health}*: The percentage of the highest-capacity battery's original maximum charge it can still hold.
|
||||||
|
|
||||||
# TIME FORMAT
|
# TIME FORMAT
|
||||||
|
|
||||||
The *battery* module allows you to define how time should be formatted via *format-time*.
|
The *battery* module allows you to define how time should be formatted via *format-time*.
|
||||||
|
|
|
@ -54,7 +54,7 @@ Addressed by *bluetooth*
|
||||||
|
|
||||||
*rotate*: ++
|
*rotate*: ++
|
||||||
typeof: integer ++
|
typeof: integer ++
|
||||||
Positive value to rotate the text label.
|
Positive value to rotate the text label (in 90 degree increments).
|
||||||
|
|
||||||
*max-length*: ++
|
*max-length*: ++
|
||||||
typeof: integer ++
|
typeof: integer ++
|
||||||
|
@ -129,6 +129,19 @@ Addressed by *bluetooth*
|
||||||
typeof: string ++
|
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.
|
This format is used to define how each connected device should be displayed within the *device_enumerate* format replacement in the tooltip menu.
|
||||||
|
|
||||||
|
*menu*: ++
|
||||||
|
typeof: string ++
|
||||||
|
Action that popups the menu.
|
||||||
|
|
||||||
|
*menu-file*: ++
|
||||||
|
typeof: string ++
|
||||||
|
Location of the menu descriptor file. There need to be an element of type
|
||||||
|
GtkMenu with id *menu*
|
||||||
|
|
||||||
|
*menu-actions*: ++
|
||||||
|
typeof: array ++
|
||||||
|
The actions corresponding to the buttons of the menu.
|
||||||
|
|
||||||
# FORMAT REPLACEMENTS
|
# FORMAT REPLACEMENTS
|
||||||
|
|
||||||
*{status}*: Status of the bluetooth device.
|
*{status}*: Status of the bluetooth device.
|
||||||
|
|
|
@ -64,6 +64,10 @@ libcava lives in:
|
||||||
:[ bool
|
:[ bool
|
||||||
:[ false
|
:[ false
|
||||||
:[ Hides the widget if no input (after sleep_timer elapsed)
|
:[ Hides the widget if no input (after sleep_timer elapsed)
|
||||||
|
|[ *format_silent*
|
||||||
|
:[ string
|
||||||
|
:[
|
||||||
|
:[ Widget's text after sleep_timer elapsed (hide_on_silence has to be false)
|
||||||
|[ *method*
|
|[ *method*
|
||||||
:[ string
|
:[ string
|
||||||
:[ pulse
|
:[ pulse
|
||||||
|
@ -120,6 +124,18 @@ libcava lives in:
|
||||||
:[ string
|
:[ string
|
||||||
:[ /dev/stdout
|
:[ /dev/stdout
|
||||||
:[ It's impossible to set it. Waybar sets it to = /dev/stdout for internal needs
|
:[ It's impossible to set it. Waybar sets it to = /dev/stdout for internal needs
|
||||||
|
|[ *menu*
|
||||||
|
:[ string
|
||||||
|
:[
|
||||||
|
:[ Action that popups the menu.
|
||||||
|
|[ *menu-file*
|
||||||
|
:[ string
|
||||||
|
:[
|
||||||
|
:[ Location of the menu descriptor file. There need to be an element of type GtkMenu with id *menu*
|
||||||
|
|[ *menu-actions*
|
||||||
|
:[ array
|
||||||
|
:[
|
||||||
|
:[ The actions corresponding to the buttons of the menu.
|
||||||
|
|
||||||
Configuration can be provided as:
|
Configuration can be provided as:
|
||||||
- The only cava configuration file which is provided through *cava_config*. The rest configuration can be skipped
|
- The only cava configuration file which is provided through *cava_config*. The rest configuration can be skipped
|
||||||
|
@ -184,3 +200,8 @@ In case when cava releases new version and you're wanna get it, it should be rai
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
```
|
```
|
||||||
|
# STYLE
|
||||||
|
|
||||||
|
- *#cava*
|
||||||
|
- *#cava.silent* Applied after no sound has been detected for sleep_timer seconds
|
||||||
|
- *#cava.updated* Applied when a new frame is shown
|
||||||
|
|
|
@ -51,7 +51,7 @@ $XDG_CONFIG_HOME/waybar/config ++
|
||||||
|[ *rotate*
|
|[ *rotate*
|
||||||
:[ integer
|
:[ integer
|
||||||
:[
|
:[
|
||||||
:[ Positive value to rotate the text label
|
:[ Positive value to rotate the text label (in 90 degree increments)
|
||||||
|[ *on-click*
|
|[ *on-click*
|
||||||
:[ string
|
:[ string
|
||||||
:[
|
:[
|
||||||
|
@ -84,6 +84,18 @@ $XDG_CONFIG_HOME/waybar/config ++
|
||||||
:[ string
|
:[ string
|
||||||
:[ same as format
|
:[ same as format
|
||||||
:[ Tooltip on hover
|
:[ Tooltip on hover
|
||||||
|
|[ *menu*
|
||||||
|
:[ string
|
||||||
|
:[
|
||||||
|
:[ Action that popups the menu.
|
||||||
|
|[ *menu-file*
|
||||||
|
:[ string
|
||||||
|
:[
|
||||||
|
:[ Location of the menu descriptor file. There need to be an element of type GtkMenu with id *menu*
|
||||||
|
|[ *menu-actions*
|
||||||
|
:[ array
|
||||||
|
:[
|
||||||
|
:[ The actions corresponding to the buttons of the menu.
|
||||||
|
|
||||||
View all valid format options in *strftime(3)* or have a look https://en.cppreference.com/w/cpp/chrono/duration/formatter
|
View all valid format options in *strftime(3)* or have a look https://en.cppreference.com/w/cpp/chrono/duration/formatter
|
||||||
|
|
||||||
|
|
|
@ -43,7 +43,7 @@ The *cpu* module displays the current CPU utilization.
|
||||||
|
|
||||||
*rotate*: ++
|
*rotate*: ++
|
||||||
typeof: integer ++
|
typeof: integer ++
|
||||||
Positive value to rotate the text label.
|
Positive value to rotate the text label (in 90 degree increments).
|
||||||
|
|
||||||
*states*: ++
|
*states*: ++
|
||||||
typeof: object ++
|
typeof: object ++
|
||||||
|
|
|
@ -21,6 +21,10 @@ Addressed by *custom/<name>*
|
||||||
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* will be executed if the exit code of *exec-if* equals 0.
|
||||||
|
|
||||||
|
*hide-empty-text*: ++
|
||||||
|
typeof: bool ++
|
||||||
|
Disables the module when output is empty, but format might contain additional static content.
|
||||||
|
|
||||||
*exec-on-event*: ++
|
*exec-on-event*: ++
|
||||||
typeof: bool ++
|
typeof: bool ++
|
||||||
default: true ++
|
default: true ++
|
||||||
|
@ -51,8 +55,8 @@ Addressed by *custom/<name>*
|
||||||
|
|
||||||
*format*: ++
|
*format*: ++
|
||||||
typeof: string ++
|
typeof: string ++
|
||||||
default: {} ++
|
default: {text} ++
|
||||||
The format, how information should be displayed. On {} data gets inserted.
|
The format, how information should be displayed. On {text} data gets inserted.
|
||||||
|
|
||||||
*format-icons*: ++
|
*format-icons*: ++
|
||||||
typeof: array ++
|
typeof: array ++
|
||||||
|
@ -60,7 +64,7 @@ Addressed by *custom/<name>*
|
||||||
|
|
||||||
*rotate*: ++
|
*rotate*: ++
|
||||||
typeof: integer ++
|
typeof: integer ++
|
||||||
Positive value to rotate the text label.
|
Positive value to rotate the text label (in 90 degree increments).
|
||||||
|
|
||||||
*max-length*: ++
|
*max-length*: ++
|
||||||
typeof: integer ++
|
typeof: integer ++
|
||||||
|
@ -121,6 +125,19 @@ Addressed by *custom/<name>*
|
||||||
default: false ++
|
default: false ++
|
||||||
Option to enable escaping of script output.
|
Option to enable escaping of script output.
|
||||||
|
|
||||||
|
*menu*: ++
|
||||||
|
typeof: string ++
|
||||||
|
Action that popups the menu.
|
||||||
|
|
||||||
|
*menu-file*: ++
|
||||||
|
typeof: string ++
|
||||||
|
Location of the menu descriptor file. There need to be an element of type
|
||||||
|
GtkMenu with id *menu*
|
||||||
|
|
||||||
|
*menu-actions*: ++
|
||||||
|
typeof: array ++
|
||||||
|
The actions corresponding to the buttons of the menu.
|
||||||
|
|
||||||
# RETURN-TYPE
|
# RETURN-TYPE
|
||||||
|
|
||||||
When *return-type* is set to *json*, Waybar expects the *exec*-script to output its data in JSON format.
|
When *return-type* is set to *json*, Waybar expects the *exec*-script to output its data in JSON format.
|
||||||
|
@ -143,7 +160,7 @@ $text\\n$tooltip\\n$class*
|
||||||
|
|
||||||
# FORMAT REPLACEMENTS
|
# FORMAT REPLACEMENTS
|
||||||
|
|
||||||
*{}*: Output of the script.
|
*{text}*: 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.
|
||||||
|
|
||||||
|
@ -155,7 +172,7 @@ $text\\n$tooltip\\n$class*
|
||||||
|
|
||||||
```
|
```
|
||||||
"custom/spotify": {
|
"custom/spotify": {
|
||||||
"format": " {}",
|
"format": " {text}",
|
||||||
"max-length": 40,
|
"max-length": 40,
|
||||||
"interval": 30, // Remove this if your script is endless and write in loop
|
"interval": 30, // Remove this if your script is endless and write in loop
|
||||||
"exec": "$HOME/.config/waybar/mediaplayer.sh 2> /dev/null", // Script in resources folder
|
"exec": "$HOME/.config/waybar/mediaplayer.sh 2> /dev/null", // Script in resources folder
|
||||||
|
@ -168,7 +185,7 @@ $text\\n$tooltip\\n$class*
|
||||||
|
|
||||||
```
|
```
|
||||||
"custom/mpd": {
|
"custom/mpd": {
|
||||||
"format": "♪ {}",
|
"format": "♪ {text}",
|
||||||
//"max-length": 15,
|
//"max-length": 15,
|
||||||
"interval": 10,
|
"interval": 10,
|
||||||
"exec": "mpc current",
|
"exec": "mpc current",
|
||||||
|
@ -182,7 +199,7 @@ $text\\n$tooltip\\n$class*
|
||||||
|
|
||||||
```
|
```
|
||||||
"custom/cmus": {
|
"custom/cmus": {
|
||||||
"format": "♪ {}",
|
"format": "♪ {text}",
|
||||||
//"max-length": 15,
|
//"max-length": 15,
|
||||||
"interval": 10,
|
"interval": 10,
|
||||||
"exec": "cmus-remote -C \"format_print '%a - %t'\"", // artist - title
|
"exec": "cmus-remote -C \"format_print '%a - %t'\"", // artist - title
|
||||||
|
@ -197,7 +214,7 @@ $text\\n$tooltip\\n$class*
|
||||||
```
|
```
|
||||||
|
|
||||||
"custom/pacman": {
|
"custom/pacman": {
|
||||||
"format": "{} ",
|
"format": "{text} ",
|
||||||
"interval": "once",
|
"interval": "once",
|
||||||
"exec": "pacman_packages",
|
"exec": "pacman_packages",
|
||||||
"on-click": "update-system",
|
"on-click": "update-system",
|
||||||
|
@ -209,7 +226,7 @@ $text\\n$tooltip\\n$class*
|
||||||
|
|
||||||
```
|
```
|
||||||
"custom/pacman": {
|
"custom/pacman": {
|
||||||
"format": "{} ",
|
"format": "{text} ",
|
||||||
"interval": 3600, // every hour
|
"interval": 3600, // every hour
|
||||||
"exec": "checkupdates | wc -l", // # of updates
|
"exec": "checkupdates | wc -l", // # of updates
|
||||||
"exec-if": "exit 0", // always run; consider advanced run conditions
|
"exec-if": "exit 0", // always run; consider advanced run conditions
|
||||||
|
|
|
@ -29,7 +29,7 @@ Addressed by *disk*
|
||||||
|
|
||||||
*rotate*: ++
|
*rotate*: ++
|
||||||
typeof: integer ++
|
typeof: integer ++
|
||||||
Positive value to rotate the text label.
|
Positive value to rotate the text label (in 90 degree increments).
|
||||||
|
|
||||||
*states*: ++
|
*states*: ++
|
||||||
typeof: object ++
|
typeof: object ++
|
||||||
|
@ -93,6 +93,19 @@ Addressed by *disk*
|
||||||
typeof: string ++
|
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.
|
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.
|
||||||
|
|
||||||
|
*menu*: ++
|
||||||
|
typeof: string ++
|
||||||
|
Action that popups the menu.
|
||||||
|
|
||||||
|
*menu-file*: ++
|
||||||
|
typeof: string ++
|
||||||
|
Location of the menu descriptor file. There need to be an element of type
|
||||||
|
GtkMenu with id *menu*
|
||||||
|
|
||||||
|
*menu-actions*: ++
|
||||||
|
typeof: array ++
|
||||||
|
The actions corresponding to the buttons of the menu.
|
||||||
|
|
||||||
# FORMAT REPLACEMENTS
|
# FORMAT REPLACEMENTS
|
||||||
|
|
||||||
*{percentage_used}*: Percentage of disk in use.
|
*{percentage_used}*: Percentage of disk in use.
|
||||||
|
|
|
@ -19,7 +19,7 @@ Addressed by *dwl/window*
|
||||||
|
|
||||||
*rotate*: ++
|
*rotate*: ++
|
||||||
typeof: integer ++
|
typeof: integer ++
|
||||||
Positive value to rotate the text label.
|
Positive value to rotate the text label (in 90 degree increments).
|
||||||
|
|
||||||
*max-length*: ++
|
*max-length*: ++
|
||||||
typeof: integer ++
|
typeof: integer ++
|
||||||
|
|
|
@ -25,6 +25,19 @@ Addressed by *hyprland/language*
|
||||||
typeof: string ++
|
typeof: string ++
|
||||||
Specifies which keyboard to use from hyprctl devices output. Using the option that begins with "at-translated-set..." is recommended.
|
Specifies which keyboard to use from hyprctl devices output. Using the option that begins with "at-translated-set..." is recommended.
|
||||||
|
|
||||||
|
*menu*: ++
|
||||||
|
typeof: string ++
|
||||||
|
Action that popups the menu.
|
||||||
|
|
||||||
|
*menu-file*: ++
|
||||||
|
typeof: string ++
|
||||||
|
Location of the menu descriptor file. There need to be an element of type
|
||||||
|
GtkMenu with id *menu*
|
||||||
|
|
||||||
|
*menu-actions*: ++
|
||||||
|
typeof: array ++
|
||||||
|
The actions corresponding to the buttons of the menu.
|
||||||
|
|
||||||
|
|
||||||
# FORMAT REPLACEMENTS
|
# FORMAT REPLACEMENTS
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,7 @@ Addressed by *hyprland/submap*
|
||||||
|
|
||||||
*rotate*: ++
|
*rotate*: ++
|
||||||
typeof: integer ++
|
typeof: integer ++
|
||||||
Positive value to rotate the text label.
|
Positive value to rotate the text label (in 90 degree increments).
|
||||||
|
|
||||||
*max-length*: ++
|
*max-length*: ++
|
||||||
typeof: integer ++
|
typeof: integer ++
|
||||||
|
@ -80,6 +80,19 @@ Addressed by *hyprland/submap*
|
||||||
default: Default ++
|
default: Default ++
|
||||||
Option to set the submap name to display when not in an active submap.
|
Option to set the submap name to display when not in an active submap.
|
||||||
|
|
||||||
|
*menu*: ++
|
||||||
|
typeof: string ++
|
||||||
|
Action that popups the menu.
|
||||||
|
|
||||||
|
*menu-file*: ++
|
||||||
|
typeof: string ++
|
||||||
|
Location of the menu descriptor file. There need to be an element of type
|
||||||
|
GtkMenu with id *menu*
|
||||||
|
|
||||||
|
*menu-actions*: ++
|
||||||
|
typeof: array ++
|
||||||
|
The actions corresponding to the buttons of the menu.
|
||||||
|
|
||||||
|
|
||||||
# EXAMPLES
|
# EXAMPLES
|
||||||
|
|
||||||
|
|
|
@ -26,6 +26,7 @@ Addressed by *hyprland/workspaces*
|
||||||
Regex rules to map window class to an icon or preferred method of representation for a workspace's window.
|
Regex rules to map window class to an icon or preferred method of representation for a workspace's window.
|
||||||
Keys are the rules, while the values are the methods of representation. Values may use the placeholders {class} and {title} to use the window's original class and/or title respectively.
|
Keys are the rules, while the values are the methods of representation. Values may use the placeholders {class} and {title} to use the window's original class and/or title respectively.
|
||||||
Rules may specify `class<...>`, `title<...>`, or both in order to fine-tune the matching.
|
Rules may specify `class<...>`, `title<...>`, or both in order to fine-tune the matching.
|
||||||
|
You may assign an empty value to a rule to have it ignored from generating any representation in workspaces.
|
||||||
|
|
||||||
*window-rewrite-default*:
|
*window-rewrite-default*:
|
||||||
typeof: string ++
|
typeof: string ++
|
||||||
|
@ -42,6 +43,11 @@ Addressed by *hyprland/workspaces*
|
||||||
default: false ++
|
default: false ++
|
||||||
If set to true, special workspaces will be shown.
|
If set to true, special workspaces will be shown.
|
||||||
|
|
||||||
|
*special-visible-only*: ++
|
||||||
|
typeof: bool ++
|
||||||
|
default: false ++
|
||||||
|
If this and show-special are to true, special workspaces will be shown only if visible.
|
||||||
|
|
||||||
*all-outputs*: ++
|
*all-outputs*: ++
|
||||||
typeof: bool ++
|
typeof: bool ++
|
||||||
default: false ++
|
default: false ++
|
||||||
|
@ -142,6 +148,7 @@ Additional to workspace name matching, the following *format-icons* can be set.
|
||||||
"class<firefox> title<.*github.*>": "", // Windows whose class is "firefox" and title contains "github". Note that "class" always comes first.
|
"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.
|
"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": "",
|
"code": "",
|
||||||
|
"title<.* - (.*) - VSCodium>": "codium $1" // captures part of the window title and formats it into output
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
|
@ -21,7 +21,7 @@ screensaver, also known as "presentation mode".
|
||||||
|
|
||||||
*rotate*: ++
|
*rotate*: ++
|
||||||
typeof: integer ++
|
typeof: integer ++
|
||||||
Positive value to rotate the text label.
|
Positive value to rotate the text label (in 90 degree increments).
|
||||||
|
|
||||||
*max-length*: ++
|
*max-length*: ++
|
||||||
typeof: integer ++
|
typeof: integer ++
|
||||||
|
@ -89,6 +89,19 @@ screensaver, also known as "presentation mode".
|
||||||
typeof: string ++
|
typeof: string ++
|
||||||
This format is used when the inhibit is deactivated.
|
This format is used when the inhibit is deactivated.
|
||||||
|
|
||||||
|
*menu*: ++
|
||||||
|
typeof: string ++
|
||||||
|
Action that popups the menu. Cannot be "on-click".
|
||||||
|
|
||||||
|
*menu-file*: ++
|
||||||
|
typeof: string ++
|
||||||
|
Location of the menu descriptor file. There need to be an element of type
|
||||||
|
GtkMenu with id *menu*
|
||||||
|
|
||||||
|
*menu-actions*: ++
|
||||||
|
typeof: array ++
|
||||||
|
The actions corresponding to the buttons of the menu.
|
||||||
|
|
||||||
# FORMAT REPLACEMENTS
|
# FORMAT REPLACEMENTS
|
||||||
|
|
||||||
*{status}*: status (*activated* or *deactivated*)
|
*{status}*: status (*activated* or *deactivated*)
|
||||||
|
|
|
@ -25,7 +25,7 @@ See *systemd-inhibit*(1) for more information.
|
||||||
|
|
||||||
*rotate*: ++
|
*rotate*: ++
|
||||||
typeof: integer ++
|
typeof: integer ++
|
||||||
Positive value to rotate the text label.
|
Positive value to rotate the text label (in 90 degree increments).
|
||||||
|
|
||||||
*max-length*: ++
|
*max-length*: ++
|
||||||
typeof: integer ++
|
typeof: integer ++
|
||||||
|
@ -76,6 +76,19 @@ See *systemd-inhibit*(1) for more information.
|
||||||
default: true ++
|
default: true ++
|
||||||
Option to disable tooltip on hover.
|
Option to disable tooltip on hover.
|
||||||
|
|
||||||
|
*menu*: ++
|
||||||
|
typeof: string ++
|
||||||
|
Action that popups the menu. Cannot be "on-click".
|
||||||
|
|
||||||
|
*menu-file*: ++
|
||||||
|
typeof: string ++
|
||||||
|
Location of the menu descriptor file. There need to be an element of type
|
||||||
|
GtkMenu with id *menu*
|
||||||
|
|
||||||
|
*menu-actions*: ++
|
||||||
|
typeof: array ++
|
||||||
|
The actions corresponding to the buttons of the menu.
|
||||||
|
|
||||||
# FORMAT REPLACEMENTS
|
# FORMAT REPLACEMENTS
|
||||||
|
|
||||||
*{status}*: status (*activated* or *deactivated*)
|
*{status}*: status (*activated* or *deactivated*)
|
||||||
|
|
|
@ -51,7 +51,7 @@ Addressed by *jack*
|
||||||
|
|
||||||
*rotate*: ++
|
*rotate*: ++
|
||||||
typeof: integer ++
|
typeof: integer ++
|
||||||
Positive value to rotate the text label.
|
Positive value to rotate the text label (in 90 degree increments).
|
||||||
|
|
||||||
*max-length*: ++
|
*max-length*: ++
|
||||||
typeof: integer ++
|
typeof: integer ++
|
||||||
|
@ -85,6 +85,19 @@ Addressed by *jack*
|
||||||
typeof: string ++
|
typeof: string ++
|
||||||
Command to execute when the module is updated.
|
Command to execute when the module is updated.
|
||||||
|
|
||||||
|
*menu*: ++
|
||||||
|
typeof: string ++
|
||||||
|
Action that popups the menu.
|
||||||
|
|
||||||
|
*menu-file*: ++
|
||||||
|
typeof: string ++
|
||||||
|
Location of the menu descriptor file. There need to be an element of type
|
||||||
|
GtkMenu with id *menu*
|
||||||
|
|
||||||
|
*menu-actions*: ++
|
||||||
|
typeof: array ++
|
||||||
|
The actions corresponding to the buttons of the menu.
|
||||||
|
|
||||||
# FORMAT REPLACEMENTS
|
# FORMAT REPLACEMENTS
|
||||||
|
|
||||||
*{load}*: The current CPU load estimated by JACK.
|
*{load}*: The current CPU load estimated by JACK.
|
||||||
|
|
|
@ -29,7 +29,7 @@ Addressed by *memory*
|
||||||
|
|
||||||
*rotate*: ++
|
*rotate*: ++
|
||||||
typeof: integer ++
|
typeof: integer ++
|
||||||
Positive value to rotate the text label.
|
Positive value to rotate the text label (in 90 degree increments).
|
||||||
|
|
||||||
*states*: ++
|
*states*: ++
|
||||||
typeof: object ++
|
typeof: object ++
|
||||||
|
@ -84,6 +84,19 @@ Addressed by *memory*
|
||||||
default: true ++
|
default: true ++
|
||||||
Option to disable tooltip on hover.
|
Option to disable tooltip on hover.
|
||||||
|
|
||||||
|
*menu*: ++
|
||||||
|
typeof: string ++
|
||||||
|
Action that popups the menu.
|
||||||
|
|
||||||
|
*menu-file*: ++
|
||||||
|
typeof: string ++
|
||||||
|
Location of the menu descriptor file. There need to be an element of type
|
||||||
|
GtkMenu with id *menu*
|
||||||
|
|
||||||
|
*menu-actions*: ++
|
||||||
|
typeof: array ++
|
||||||
|
The actions corresponding to the buttons of the menu.
|
||||||
|
|
||||||
# FORMAT REPLACEMENTS
|
# FORMAT REPLACEMENTS
|
||||||
|
|
||||||
*{percentage}*: Percentage of memory in use.
|
*{percentage}*: Percentage of memory in use.
|
||||||
|
|
|
@ -0,0 +1,153 @@
|
||||||
|
waybar-menu(5)
|
||||||
|
|
||||||
|
# NAME
|
||||||
|
|
||||||
|
waybar - menu property
|
||||||
|
|
||||||
|
# OVERVIEW
|
||||||
|
|
||||||
|
|
||||||
|
Some modules support a 'menu', which allows to have a popup menu whan a defined
|
||||||
|
click is done over the module.
|
||||||
|
|
||||||
|
# PROPERTIES
|
||||||
|
|
||||||
|
A module that implements a 'menu' needs 3 properties defined in its config :
|
||||||
|
|
||||||
|
*menu*: ++
|
||||||
|
typeof: string ++
|
||||||
|
Action that popups the menu. The possibles actions are :
|
||||||
|
|
||||||
|
[- *Option*
|
||||||
|
:- *Description*
|
||||||
|
|[ *on-click*
|
||||||
|
:< When you left-click on the module
|
||||||
|
|[ *on-click-release*
|
||||||
|
:< When you release left button on the module
|
||||||
|
|[ *on-double-click*
|
||||||
|
:< When you double left click on the module
|
||||||
|
|[ *on-triple-click*
|
||||||
|
:< When you triple left click on the module
|
||||||
|
|[ *on-click-middle*
|
||||||
|
:< When you middle click on the module using mousewheel
|
||||||
|
|[ *on-click-middle-release*
|
||||||
|
:< When you release mousewheel button on the module
|
||||||
|
|[ *on-double-click-middle*
|
||||||
|
:< When you double middle click on the module
|
||||||
|
|[ *on-triple-click-middle*
|
||||||
|
:< When you triple middle click on the module
|
||||||
|
|[ *on-click-right*
|
||||||
|
:< When you right click on the module using
|
||||||
|
|[ *on-click-right-release*
|
||||||
|
:< When you release right button on the module
|
||||||
|
|[ *on-double-click-right*
|
||||||
|
:< When you double right click on the module
|
||||||
|
|[ *on-triple-click-right*
|
||||||
|
:< When you triple middle click on the module
|
||||||
|
|[ *on-click-backward*
|
||||||
|
:< When you click on the module using mouse backward button
|
||||||
|
|[ *on-click-backward-release*
|
||||||
|
:< When you release mouse backward button on the module
|
||||||
|
|[ *on-double-click-backward*
|
||||||
|
:< When you double click on the module using mouse backward button
|
||||||
|
|[ *on-triple-click-backward*
|
||||||
|
:< When you triple click on the module using mouse backawrd button
|
||||||
|
|[ *on-click-forward*
|
||||||
|
:< When you click on the module using mouse forward button
|
||||||
|
|[ *on-click-forward-release*
|
||||||
|
:< When you release mouse forward button on the module
|
||||||
|
|[ *on-double-click-forward*
|
||||||
|
:< When you double click on the module using mouse forward button
|
||||||
|
|[ *on-triple-click-forward*
|
||||||
|
:< When you triple click on the module using mouse forward button
|
||||||
|
|
||||||
|
*menu-file*: ++
|
||||||
|
typeof: string ++
|
||||||
|
Location of the menu descriptor file. There need to be an element of type
|
||||||
|
GtkMenu with id *menu*.
|
||||||
|
|
||||||
|
*menu-actions*: ++
|
||||||
|
typeof: array ++
|
||||||
|
The actions corresponding to the buttons of the menu. The identifiers of
|
||||||
|
each actions needs to exists as an id in the 'menu-file' for it to be linked
|
||||||
|
properly.
|
||||||
|
|
||||||
|
# MENU-FILE
|
||||||
|
|
||||||
|
The menu-file is an `.xml` file representing a GtkBuilder. Documentation for it
|
||||||
|
can be found here : https://docs.gtk.org/gtk4/class.Builder.html
|
||||||
|
|
||||||
|
Here, it needs to have an element of type GtkMenu with id "menu". Eeach actions
|
||||||
|
in *menu-actions* are linked to elements in the *menu-file* file by the id of
|
||||||
|
the elements.
|
||||||
|
|
||||||
|
# EXAMPLE
|
||||||
|
|
||||||
|
Module config :
|
||||||
|
```
|
||||||
|
"custom/power": {
|
||||||
|
"format" : "⏻ ",
|
||||||
|
"tooltip": false,
|
||||||
|
"menu": "on-click",
|
||||||
|
"menu-file": "~/.config/waybar/power_menu.xml",
|
||||||
|
"menu-actions": {
|
||||||
|
"shutdown": "shutdown",
|
||||||
|
"reboot": "reboot",
|
||||||
|
"suspend": "systemctl suspend",
|
||||||
|
"hibernate": "systemctl hibernate",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
```
|
||||||
|
|
||||||
|
~/.config/waybar/power_menu.xml :
|
||||||
|
```
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<interface>
|
||||||
|
<object class="GtkMenu" id="menu">
|
||||||
|
<child>
|
||||||
|
<object class="GtkMenuItem" id="suspend">
|
||||||
|
<property name="label">Suspend</property>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkMenuItem" id="hibernat">
|
||||||
|
<property name="label">Hibernate</property>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkMenuItem" id="shutdown">
|
||||||
|
<property name="label">Shutdown</property>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkSeparatorMenuItem" id="delimiter1"/>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkMenuItem" id="reboot">
|
||||||
|
<property name="label">Reboot</property>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
</interface>
|
||||||
|
```
|
||||||
|
|
||||||
|
# STYLING MENUS
|
||||||
|
|
||||||
|
- *menu*
|
||||||
|
Style for the menu
|
||||||
|
|
||||||
|
- *menuitem*
|
||||||
|
Style for items in the menu
|
||||||
|
|
||||||
|
# EXAMPLE:
|
||||||
|
|
||||||
|
```
|
||||||
|
menu {
|
||||||
|
border-radius: 15px;
|
||||||
|
background: #161320;
|
||||||
|
color: #B5E8E0;
|
||||||
|
}
|
||||||
|
menuitem {
|
||||||
|
border-radius: 15px;
|
||||||
|
}
|
||||||
|
```
|
|
@ -91,7 +91,7 @@ Addressed by *mpd*
|
||||||
|
|
||||||
*rotate*: ++
|
*rotate*: ++
|
||||||
typeof: integer ++
|
typeof: integer ++
|
||||||
Positive value to rotate the text label.
|
Positive value to rotate the text label (in 90 degree increments).
|
||||||
|
|
||||||
*max-length*: ++
|
*max-length*: ++
|
||||||
typeof: integer ++
|
typeof: integer ++
|
||||||
|
@ -162,6 +162,19 @@ Addressed by *mpd*
|
||||||
default: {} ++
|
default: {} ++
|
||||||
Icon to show depending on the "single" option (*{ "on": "...", "off": "..." }*)
|
Icon to show depending on the "single" option (*{ "on": "...", "off": "..." }*)
|
||||||
|
|
||||||
|
*menu*: ++
|
||||||
|
typeof: string ++
|
||||||
|
Action that popups the menu.
|
||||||
|
|
||||||
|
*menu-file*: ++
|
||||||
|
typeof: string ++
|
||||||
|
Location of the menu descriptor file. There need to be an element of type
|
||||||
|
GtkMenu with id *menu*
|
||||||
|
|
||||||
|
*menu-actions*: ++
|
||||||
|
typeof: array ++
|
||||||
|
The actions corresponding to the buttons of the menu.
|
||||||
|
|
||||||
# FORMAT REPLACEMENTS
|
# FORMAT REPLACEMENTS
|
||||||
|
|
||||||
## WHEN PLAYING/PAUSED
|
## WHEN PLAYING/PAUSED
|
||||||
|
|
|
@ -107,7 +107,7 @@ The *mpris* module displays currently playing media via libplayerctl.
|
||||||
|
|
||||||
*rotate*: ++
|
*rotate*: ++
|
||||||
typeof: integer ++
|
typeof: integer ++
|
||||||
Positive value to rotate the text label.
|
Positive value to rotate the text label (in 90 degree increments).
|
||||||
|
|
||||||
*max-length*: ++
|
*max-length*: ++
|
||||||
typeof: integer ++
|
typeof: integer ++
|
||||||
|
@ -142,11 +142,11 @@ The *mpris* module displays currently playing media via libplayerctl.
|
||||||
|
|
||||||
*player-icons*: ++
|
*player-icons*: ++
|
||||||
typeof: map[string]string ++
|
typeof: map[string]string ++
|
||||||
Allows setting _{player-icon}_ based on player-name property.
|
Allows setting _{player_icon}_ based on player-name property.
|
||||||
|
|
||||||
*status-icons*: ++
|
*status-icons*: ++
|
||||||
typeof: map[string]string ++
|
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
|
# FORMAT REPLACEMENTS
|
||||||
|
|
|
@ -58,7 +58,7 @@ Addressed by *network*
|
||||||
|
|
||||||
*rotate*: ++
|
*rotate*: ++
|
||||||
typeof: integer ++
|
typeof: integer ++
|
||||||
Positive value to rotate the text label.
|
Positive value to rotate the text label (in 90 degree increments).
|
||||||
|
|
||||||
*max-length*: ++
|
*max-length*: ++
|
||||||
typeof: integer ++
|
typeof: integer ++
|
||||||
|
@ -129,6 +129,19 @@ Addressed by *network*
|
||||||
typeof: string ++
|
typeof: string ++
|
||||||
This format is used when the displayed interface is disabled.
|
This format is used when the displayed interface is disabled.
|
||||||
|
|
||||||
|
*menu*: ++
|
||||||
|
typeof: string ++
|
||||||
|
Action that popups the menu.
|
||||||
|
|
||||||
|
*menu-file*: ++
|
||||||
|
typeof: string ++
|
||||||
|
Location of the menu descriptor file. There need to be an element of type
|
||||||
|
GtkMenu with id *menu*
|
||||||
|
|
||||||
|
*menu-actions*: ++
|
||||||
|
typeof: array ++
|
||||||
|
The actions corresponding to the buttons of the menu.
|
||||||
|
|
||||||
# FORMAT REPLACEMENTS
|
# FORMAT REPLACEMENTS
|
||||||
|
|
||||||
*{ifname}*: Name of the network interface.
|
*{ifname}*: Name of the network interface.
|
||||||
|
@ -143,6 +156,8 @@ Addressed by *network*
|
||||||
|
|
||||||
*{essid}*: Name (SSID) of the wireless network.
|
*{essid}*: Name (SSID) of the wireless network.
|
||||||
|
|
||||||
|
*{bssid}*: MAC address (BSSID) of the wireless access point.
|
||||||
|
|
||||||
*{signalStrength}*: Signal strength of the wireless network.
|
*{signalStrength}*: Signal strength of the wireless network.
|
||||||
|
|
||||||
*{signaldBm}*: Signal strength of the wireless network in dBm.
|
*{signaldBm}*: Signal strength of the wireless network in dBm.
|
||||||
|
|
|
@ -0,0 +1,58 @@
|
||||||
|
waybar-niri-language(5)
|
||||||
|
|
||||||
|
# NAME
|
||||||
|
|
||||||
|
waybar - niri language module
|
||||||
|
|
||||||
|
# DESCRIPTION
|
||||||
|
|
||||||
|
The *language* module displays the currently selected language in niri.
|
||||||
|
|
||||||
|
# CONFIGURATION
|
||||||
|
|
||||||
|
Addressed by *niri/language*
|
||||||
|
|
||||||
|
*format*: ++
|
||||||
|
typeof: string ++
|
||||||
|
default: {} ++
|
||||||
|
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.
|
||||||
|
|
||||||
|
*menu*: ++
|
||||||
|
typeof: string ++
|
||||||
|
Action that popups the menu.
|
||||||
|
|
||||||
|
*menu-file*: ++
|
||||||
|
typeof: string ++
|
||||||
|
Location of the menu descriptor file. There need to be an element of type GtkMenu with id *menu*
|
||||||
|
|
||||||
|
*menu-actions*: ++
|
||||||
|
typeof: array ++
|
||||||
|
The actions corresponding to the buttons of the menu.
|
||||||
|
|
||||||
|
# FORMAT REPLACEMENTS
|
||||||
|
|
||||||
|
*{short}*: Short name of layout (e.g. "us"). Equals to {}.
|
||||||
|
|
||||||
|
*{shortDescription}*: Short description of layout (e.g. "en").
|
||||||
|
|
||||||
|
*{long}*: Long name of layout (e.g. "English (Dvorak)").
|
||||||
|
|
||||||
|
*{variant}*: Variant of layout (e.g. "dvorak").
|
||||||
|
|
||||||
|
# EXAMPLES
|
||||||
|
|
||||||
|
```
|
||||||
|
"niri/language": {
|
||||||
|
"format": "Lang: {long}"
|
||||||
|
"format-en": "AMERICA, HELL YEAH!"
|
||||||
|
"format-tr": "As bayrakları"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
# STYLE
|
||||||
|
|
||||||
|
- *#language*
|
|
@ -0,0 +1,81 @@
|
||||||
|
waybar-niri-window(5)
|
||||||
|
|
||||||
|
# NAME
|
||||||
|
|
||||||
|
waybar - niri window module
|
||||||
|
|
||||||
|
# DESCRIPTION
|
||||||
|
|
||||||
|
The *window* module displays the title of the currently focused window in niri.
|
||||||
|
|
||||||
|
# CONFIGURATION
|
||||||
|
|
||||||
|
Addressed by *niri/window*
|
||||||
|
|
||||||
|
*format*: ++
|
||||||
|
typeof: string ++
|
||||||
|
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 "niri msg windows" for examples
|
||||||
|
|
||||||
|
*{title}*: The current title of the focused window.
|
||||||
|
|
||||||
|
*{app_id}*: The current app ID of the focused window.
|
||||||
|
|
||||||
|
# REWRITE RULES
|
||||||
|
|
||||||
|
*rewrite* is an object where keys are regular expressions and values are
|
||||||
|
rewrite rules if the expression matches. Rules may contain references to
|
||||||
|
captures of the expression.
|
||||||
|
|
||||||
|
Regular expression and replacement follow ECMA-script rules.
|
||||||
|
|
||||||
|
If no expression matches, the title is left unchanged.
|
||||||
|
|
||||||
|
Invalid expressions (e.g., mismatched parentheses) are skipped.
|
||||||
|
|
||||||
|
# EXAMPLES
|
||||||
|
|
||||||
|
```
|
||||||
|
"niri/window": {
|
||||||
|
"format": "{}",
|
||||||
|
"rewrite": {
|
||||||
|
"(.*) - Mozilla Firefox": "🌎 $1",
|
||||||
|
"(.*) - zsh": "> [$1]"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
# STYLE
|
||||||
|
|
||||||
|
- *#window*
|
||||||
|
- *window#waybar.empty #window* When no windows are on 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 only one window is on the workspace
|
||||||
|
- *window#waybar.<app-id>* Where *app-id* is the app ID of the only window on
|
||||||
|
the workspace
|
|
@ -0,0 +1,97 @@
|
||||||
|
waybar-niri-workspaces(5)
|
||||||
|
|
||||||
|
# NAME
|
||||||
|
|
||||||
|
waybar - niri workspaces module
|
||||||
|
|
||||||
|
# DESCRIPTION
|
||||||
|
|
||||||
|
The *workspaces* module displays the currently used workspaces in niri.
|
||||||
|
|
||||||
|
# CONFIGURATION
|
||||||
|
|
||||||
|
Addressed by *niri/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.
|
||||||
|
|
||||||
|
*format*: ++
|
||||||
|
typeof: string ++
|
||||||
|
default: {value} ++
|
||||||
|
The format, how information should be displayed.
|
||||||
|
|
||||||
|
*format-icons*: ++
|
||||||
|
typeof: array ++
|
||||||
|
Based on the workspace name, index and state, the corresponding icon gets selected. See *icons*.
|
||||||
|
|
||||||
|
*disable-click*: ++
|
||||||
|
typeof: bool ++
|
||||||
|
default: false ++
|
||||||
|
If set to false, you can click to change workspace. If set to true this behaviour is disabled.
|
||||||
|
|
||||||
|
*disable-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 the active or focused workspace will be shown.
|
||||||
|
|
||||||
|
*on-update*: ++
|
||||||
|
typeof: string ++
|
||||||
|
Command to execute when the module is updated.
|
||||||
|
|
||||||
|
# FORMAT REPLACEMENTS
|
||||||
|
|
||||||
|
*{value}*: Name of the workspace, or index for unnamed workspaces,
|
||||||
|
as defined by niri.
|
||||||
|
|
||||||
|
*{name}*: Name of the workspace for named workspaces.
|
||||||
|
|
||||||
|
*{icon}*: Icon, as defined in *format-icons*.
|
||||||
|
|
||||||
|
*{index}*: Index of the workspace on its output.
|
||||||
|
|
||||||
|
*{output}*: Output where the workspace is located.
|
||||||
|
|
||||||
|
# ICONS
|
||||||
|
|
||||||
|
Additional to workspace name matching, the following *format-icons* can be set.
|
||||||
|
|
||||||
|
- *default*: Will be shown, when no string matches are found.
|
||||||
|
- *focused*: Will be shown, when workspace is focused.
|
||||||
|
- *active*: Will be shown, when workspace is active on its output.
|
||||||
|
|
||||||
|
# EXAMPLES
|
||||||
|
|
||||||
|
```
|
||||||
|
"niri/workspaces": {
|
||||||
|
"format": "{icon}",
|
||||||
|
"format-icons": {
|
||||||
|
// Named workspaces
|
||||||
|
// (you need to configure them in niri)
|
||||||
|
"browser": "",
|
||||||
|
"discord": "",
|
||||||
|
"chat": "<b></b>",
|
||||||
|
|
||||||
|
// Icons by state
|
||||||
|
"active": "",
|
||||||
|
"default": ""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
# Style
|
||||||
|
|
||||||
|
- *#workspaces button*
|
||||||
|
- *#workspaces button.focused*: The single focused workspace.
|
||||||
|
- *#workspaces button.active*: The workspace is active (visible) on its output.
|
||||||
|
- *#workspaces button.empty*: The workspace is empty.
|
||||||
|
- *#workspaces button.current_output*: The workspace is from the same output as
|
||||||
|
the bar that it is displayed on.
|
||||||
|
- *#workspaces button#niri-workspace-<name>*: Workspaces named this, or index
|
||||||
|
for unnamed workspaces.
|
|
@ -31,7 +31,7 @@ The volume can be controlled by dragging the slider across the bar or clicking o
|
||||||
|
|
||||||
```
|
```
|
||||||
"modules-right": [
|
"modules-right": [
|
||||||
"pulseaudio-slider",
|
"pulseaudio/slider",
|
||||||
],
|
],
|
||||||
"pulseaudio/slider": {
|
"pulseaudio/slider": {
|
||||||
"min": 0,
|
"min": 0,
|
||||||
|
|
|
@ -40,7 +40,7 @@ Additionally, you can control the volume by scrolling *up* or *down* while the c
|
||||||
|
|
||||||
*rotate*: ++
|
*rotate*: ++
|
||||||
typeof: integer ++
|
typeof: integer ++
|
||||||
Positive value to rotate the text label.
|
Positive value to rotate the text label (in 90 degree increments).
|
||||||
|
|
||||||
*states*: ++
|
*states*: ++
|
||||||
typeof: object ++
|
typeof: object ++
|
||||||
|
@ -113,6 +113,19 @@ Additionally, you can control the volume by scrolling *up* or *down* while the c
|
||||||
typeof: array ++
|
typeof: array ++
|
||||||
Sinks in this list will not be shown as 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.
|
||||||
|
|
||||||
|
*menu*: ++
|
||||||
|
typeof: string ++
|
||||||
|
Action that popups the menu.
|
||||||
|
|
||||||
|
*menu-file*: ++
|
||||||
|
typeof: string ++
|
||||||
|
Location of the menu descriptor file. There need to be an element of type
|
||||||
|
GtkMenu with id *menu*
|
||||||
|
|
||||||
|
*menu-actions*: ++
|
||||||
|
typeof: array ++
|
||||||
|
The actions corresponding to the buttons of the menu.
|
||||||
|
|
||||||
# FORMAT REPLACEMENTS
|
# FORMAT REPLACEMENTS
|
||||||
|
|
||||||
*{desc}*: Pulseaudio port's description, for bluetooth it'll be the device name.
|
*{desc}*: Pulseaudio port's description, for bluetooth it'll be the device name.
|
||||||
|
@ -142,6 +155,8 @@ If they are found in the current PulseAudio port name, the corresponding icons w
|
||||||
- *hifi*
|
- *hifi*
|
||||||
- *phone*
|
- *phone*
|
||||||
|
|
||||||
|
Additionally, suffixing a device name or port with *-muted* will cause the icon
|
||||||
|
to be selected when the corresponding audio device is muted. This applies to *default* as well.
|
||||||
|
|
||||||
# EXAMPLES
|
# EXAMPLES
|
||||||
|
|
||||||
|
@ -152,10 +167,12 @@ If they are found in the current PulseAudio port name, the corresponding icons w
|
||||||
"format-muted": "",
|
"format-muted": "",
|
||||||
"format-icons": {
|
"format-icons": {
|
||||||
"alsa_output.pci-0000_00_1f.3.analog-stereo": "",
|
"alsa_output.pci-0000_00_1f.3.analog-stereo": "",
|
||||||
|
"alsa_output.pci-0000_00_1f.3.analog-stereo-muted": "",
|
||||||
"headphones": "",
|
"headphones": "",
|
||||||
"handsfree": "",
|
"handsfree": "",
|
||||||
"headset": "",
|
"headset": "",
|
||||||
"phone": "",
|
"phone": "",
|
||||||
|
"phone-muted": "",
|
||||||
"portable": "",
|
"portable": "",
|
||||||
"car": "",
|
"car": "",
|
||||||
"default": ["", ""]
|
"default": ["", ""]
|
||||||
|
|
|
@ -21,7 +21,7 @@ Addressed by *river/layout*
|
||||||
|
|
||||||
*rotate*: ++
|
*rotate*: ++
|
||||||
typeof: integer ++
|
typeof: integer ++
|
||||||
Positive value to rotate the text label.
|
Positive value to rotate the text label (in 90 degree increments).
|
||||||
|
|
||||||
*max-length*: ++
|
*max-length*: ++
|
||||||
typeof: integer ++
|
typeof: integer ++
|
||||||
|
@ -51,6 +51,19 @@ Addressed by *river/layout*
|
||||||
typeof: string ++
|
typeof: string ++
|
||||||
Command to execute when you right-click on the module.
|
Command to execute when you right-click on the module.
|
||||||
|
|
||||||
|
*menu*: ++
|
||||||
|
typeof: string ++
|
||||||
|
Action that popups the menu.
|
||||||
|
|
||||||
|
*menu-file*: ++
|
||||||
|
typeof: string ++
|
||||||
|
Location of the menu descriptor file. There need to be an element of type
|
||||||
|
GtkMenu with id *menu*
|
||||||
|
|
||||||
|
*menu-actions*: ++
|
||||||
|
typeof: array ++
|
||||||
|
The actions corresponding to the buttons of the menu.
|
||||||
|
|
||||||
# EXAMPLE
|
# EXAMPLE
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
|
@ -19,7 +19,7 @@ Addressed by *river/mode*
|
||||||
|
|
||||||
*rotate*: ++
|
*rotate*: ++
|
||||||
typeof: integer ++
|
typeof: integer ++
|
||||||
Positive value to rotate the text label.
|
Positive value to rotate the text label (in 90 degree increments).
|
||||||
|
|
||||||
*max-length*: ++
|
*max-length*: ++
|
||||||
typeof: integer ++
|
typeof: integer ++
|
||||||
|
@ -65,6 +65,19 @@ Addressed by *river/mode*
|
||||||
typeof: double ++
|
typeof: double ++
|
||||||
Threshold to be used when scrolling.
|
Threshold to be used when scrolling.
|
||||||
|
|
||||||
|
*menu*: ++
|
||||||
|
typeof: string ++
|
||||||
|
Action that popups the menu.
|
||||||
|
|
||||||
|
*menu-file*: ++
|
||||||
|
typeof: string ++
|
||||||
|
Location of the menu descriptor file. There need to be an element of type
|
||||||
|
GtkMenu with id *menu*
|
||||||
|
|
||||||
|
*menu-actions*: ++
|
||||||
|
typeof: array ++
|
||||||
|
The actions corresponding to the buttons of the menu.
|
||||||
|
|
||||||
# EXAMPLES
|
# EXAMPLES
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
|
@ -19,7 +19,7 @@ Addressed by *river/window*
|
||||||
|
|
||||||
*rotate*: ++
|
*rotate*: ++
|
||||||
typeof: integer ++
|
typeof: integer ++
|
||||||
Positive value to rotate the text label.
|
Positive value to rotate the text label (in 90 degree increments).
|
||||||
|
|
||||||
*max-length*: ++
|
*max-length*: ++
|
||||||
typeof: integer ++
|
typeof: integer ++
|
||||||
|
@ -49,6 +49,19 @@ Addressed by *river/window*
|
||||||
typeof: string ++
|
typeof: string ++
|
||||||
Command to execute when you right-click on the module.
|
Command to execute when you right-click on the module.
|
||||||
|
|
||||||
|
*menu*: ++
|
||||||
|
typeof: string ++
|
||||||
|
Action that popups the menu.
|
||||||
|
|
||||||
|
*menu-file*: ++
|
||||||
|
typeof: string ++
|
||||||
|
Location of the menu descriptor file. There need to be an element of type
|
||||||
|
GtkMenu with id *menu*
|
||||||
|
|
||||||
|
*menu-actions*: ++
|
||||||
|
typeof: array ++
|
||||||
|
The actions corresponding to the buttons of the menu.
|
||||||
|
|
||||||
# EXAMPLES
|
# EXAMPLES
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
|
@ -20,7 +20,7 @@ cursor is over the module, and clicking on the module toggles mute.
|
||||||
|
|
||||||
*rotate*: ++
|
*rotate*: ++
|
||||||
typeof: integer ++
|
typeof: integer ++
|
||||||
Positive value to rotate the text label.
|
Positive value to rotate the text label (in 90 degree increments).
|
||||||
|
|
||||||
*max-length*: ++
|
*max-length*: ++
|
||||||
typeof: integer ++
|
typeof: integer ++
|
||||||
|
@ -74,6 +74,19 @@ cursor is over the module, and clicking on the module toggles mute.
|
||||||
typeof: double ++
|
typeof: double ++
|
||||||
Threshold to be used when scrolling.
|
Threshold to be used when scrolling.
|
||||||
|
|
||||||
|
*menu*: ++
|
||||||
|
typeof: string ++
|
||||||
|
Action that popups the menu.
|
||||||
|
|
||||||
|
*menu-file*: ++
|
||||||
|
typeof: string ++
|
||||||
|
Location of the menu descriptor file. There need to be an element of type
|
||||||
|
GtkMenu with id *menu*
|
||||||
|
|
||||||
|
*menu-actions*: ++
|
||||||
|
typeof: array ++
|
||||||
|
The actions corresponding to the buttons of the menu.
|
||||||
|
|
||||||
# FORMAT REPLACEMENTS
|
# FORMAT REPLACEMENTS
|
||||||
|
|
||||||
*{volume}*: Volume in percentage.
|
*{volume}*: Volume in percentage.
|
||||||
|
|
|
@ -0,0 +1,78 @@
|
||||||
|
waybar-styles(5)
|
||||||
|
|
||||||
|
# NAME
|
||||||
|
|
||||||
|
waybar-styles - using stylesheets for waybar
|
||||||
|
|
||||||
|
# DESCRIPTION
|
||||||
|
|
||||||
|
Waybar uses Cascading Style Sheets (CSS) to configure its appearance.
|
||||||
|
|
||||||
|
It uses the first file found in this search order:
|
||||||
|
|
||||||
|
- *$XDG_CONFIG_HOME/waybar/style.css*
|
||||||
|
- *~/.config/waybar/style.css*
|
||||||
|
- *~/waybar/style.css*
|
||||||
|
- */etc/xdg/waybar/style.css*
|
||||||
|
- *@sysconfdir@/xdg/waybar/style.css*
|
||||||
|
|
||||||
|
# EXAMPLE
|
||||||
|
|
||||||
|
An example user-controlled stylesheet that just changes the color of the clock to be green on black, while keeping the rest of the system config the same would be:
|
||||||
|
|
||||||
|
```
|
||||||
|
@import url("file:///etc/xdg/waybar/style.css")
|
||||||
|
|
||||||
|
#clock {
|
||||||
|
background: #000000;
|
||||||
|
color: #00ff00;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Hover-effect
|
||||||
|
|
||||||
|
You can apply special styling to any module for when the cursor hovers it.
|
||||||
|
|
||||||
|
```
|
||||||
|
#clock:hover {
|
||||||
|
background-color: #ffffff;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Setting cursor style
|
||||||
|
|
||||||
|
Most, if not all, module types support setting the `cursor` option. This is
|
||||||
|
configured in your `config.jsonc`. If set to `false`, when hovering the module a
|
||||||
|
"pointer"(as commonly known from web CSS styling `cursor: pointer`) style cursor
|
||||||
|
will not be shown. Default behavior is to indicate an interaction event is
|
||||||
|
available.
|
||||||
|
|
||||||
|
There are more cursor types to choose from by setting the `cursor` option to
|
||||||
|
a number, see Gdk3 official docs for all possible cursor types:
|
||||||
|
https://docs.gtk.org/gdk3/enum.CursorType.html.
|
||||||
|
However, note that not all cursor options listed may be available on
|
||||||
|
your system. If you attempt to use a cursor which is not available, the
|
||||||
|
application will crash.
|
||||||
|
|
||||||
|
Example of disabling pointer(`Gdk::Hand2`) cursor type on a custom module:
|
||||||
|
|
||||||
|
```
|
||||||
|
"custom/my-custom-module": {
|
||||||
|
...
|
||||||
|
"cursor": false,
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
Example of setting cursor type to `Gdk::Boat`(according to
|
||||||
|
https://docs.gtk.org/gdk3/enum.CursorType.html#boat):
|
||||||
|
|
||||||
|
```
|
||||||
|
"custom/my-custom-module": {
|
||||||
|
...
|
||||||
|
"cursor": 8,
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
# SEE ALSO
|
||||||
|
|
||||||
|
- *waybar(5)*
|
|
@ -32,6 +32,19 @@ Addressed by *sway/language*
|
||||||
default: true ++
|
default: true ++
|
||||||
Option to disable tooltip on hover.
|
Option to disable tooltip on hover.
|
||||||
|
|
||||||
|
*menu*: ++
|
||||||
|
typeof: string ++
|
||||||
|
Action that popups the menu.
|
||||||
|
|
||||||
|
*menu-file*: ++
|
||||||
|
typeof: string ++
|
||||||
|
Location of the menu descriptor file. There need to be an element of type
|
||||||
|
GtkMenu with id *menu*
|
||||||
|
|
||||||
|
*menu-actions*: ++
|
||||||
|
typeof: array ++
|
||||||
|
The actions corresponding to the buttons of the menu.
|
||||||
|
|
||||||
# FORMAT REPLACEMENTS
|
# FORMAT REPLACEMENTS
|
||||||
|
|
||||||
*{short}*: Short name of layout (e.g. "us"). Equals to {}.
|
*{short}*: Short name of layout (e.g. "us"). Equals to {}.
|
||||||
|
|
|
@ -19,7 +19,7 @@ Addressed by *sway/mode*
|
||||||
|
|
||||||
*rotate*: ++
|
*rotate*: ++
|
||||||
typeof: integer ++
|
typeof: integer ++
|
||||||
Positive value to rotate the text label.
|
Positive value to rotate the text label (in 90 degree increments).
|
||||||
|
|
||||||
*max-length*: ++
|
*max-length*: ++
|
||||||
typeof: integer ++
|
typeof: integer ++
|
||||||
|
@ -70,6 +70,19 @@ Addressed by *sway/mode*
|
||||||
default: true ++
|
default: true ++
|
||||||
Option to disable tooltip on hover.
|
Option to disable tooltip on hover.
|
||||||
|
|
||||||
|
*menu*: ++
|
||||||
|
typeof: string ++
|
||||||
|
Action that popups the menu.
|
||||||
|
|
||||||
|
*menu-file*: ++
|
||||||
|
typeof: string ++
|
||||||
|
Location of the menu descriptor file. There need to be an element of type
|
||||||
|
GtkMenu with id *menu*
|
||||||
|
|
||||||
|
*menu-actions*: ++
|
||||||
|
typeof: array ++
|
||||||
|
The actions corresponding to the buttons of the menu.
|
||||||
|
|
||||||
# EXAMPLES
|
# EXAMPLES
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
|
@ -36,6 +36,19 @@ Addressed by *sway/scratchpad*
|
||||||
default: {app}: {title} ++
|
default: {app}: {title} ++
|
||||||
The format, how information in the tooltip should be displayed.
|
The format, how information in the tooltip should be displayed.
|
||||||
|
|
||||||
|
*menu*: ++
|
||||||
|
typeof: string ++
|
||||||
|
Action that popups the menu.
|
||||||
|
|
||||||
|
*menu-file*: ++
|
||||||
|
typeof: string ++
|
||||||
|
Location of the menu descriptor file. There need to be an element of type
|
||||||
|
GtkMenu with id *menu*
|
||||||
|
|
||||||
|
*menu-actions*: ++
|
||||||
|
typeof: array ++
|
||||||
|
The actions corresponding to the buttons of the menu.
|
||||||
|
|
||||||
# FORMAT REPLACEMENTS
|
# FORMAT REPLACEMENTS
|
||||||
|
|
||||||
*{icon}*: Icon, as defined in *format-icons*.
|
*{icon}*: Icon, as defined in *format-icons*.
|
||||||
|
|
|
@ -19,7 +19,7 @@ Addressed by *sway/window*
|
||||||
|
|
||||||
*rotate*: ++
|
*rotate*: ++
|
||||||
typeof: integer ++
|
typeof: integer ++
|
||||||
Positive value to rotate the text label.
|
Positive value to rotate the text label (in 90 degree increments).
|
||||||
|
|
||||||
*max-length*: ++
|
*max-length*: ++
|
||||||
typeof: integer ++
|
typeof: integer ++
|
||||||
|
|
|
@ -87,6 +87,7 @@ warp-on-scroll: ++
|
||||||
Regex rules to map window class to an icon or preferred method of representation for a workspace's window.
|
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.
|
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.
|
Rules may specify `class<...>`, `title<...>`, or both in order to fine-tune the matching.
|
||||||
|
You may assign an empty value to a rule to have it ignored from generating any representation in workspaces.
|
||||||
|
|
||||||
*window-rewrite-default*:
|
*window-rewrite-default*:
|
||||||
typeof: string ++
|
typeof: string ++
|
||||||
|
@ -171,6 +172,7 @@ n.b.: the list of outputs can be obtained from command line using *swaymsg -t ge
|
||||||
"window-rewrite": {
|
"window-rewrite": {
|
||||||
"class<firefox>": "",
|
"class<firefox>": "",
|
||||||
"class<kitty>": "k",
|
"class<kitty>": "k",
|
||||||
|
"title<.* - (.*) - VSCodium>": "codium $1" // captures part of the window title and formats it into output
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
|
@ -36,6 +36,19 @@ Addressed by *systemd-failed-units*
|
||||||
default: *true* ++
|
default: *true* ++
|
||||||
Option to hide this module when there is no failing units.
|
Option to hide this module when there is no failing units.
|
||||||
|
|
||||||
|
*menu*: ++
|
||||||
|
typeof: string ++
|
||||||
|
Action that popups the menu.
|
||||||
|
|
||||||
|
*menu-file*: ++
|
||||||
|
typeof: string ++
|
||||||
|
Location of the menu descriptor file. There need to be an element of type
|
||||||
|
GtkMenu with id *menu*
|
||||||
|
|
||||||
|
*menu-actions*: ++
|
||||||
|
typeof: array ++
|
||||||
|
The actions corresponding to the buttons of the menu.
|
||||||
|
|
||||||
# FORMAT REPLACEMENTS
|
# FORMAT REPLACEMENTS
|
||||||
|
|
||||||
*{nr_failed_system}*: Number of failed units from systemwide (PID=1) systemd.
|
*{nr_failed_system}*: Number of failed units from systemwide (PID=1) systemd.
|
||||||
|
|
|
@ -25,6 +25,7 @@ Addressed by *temperature*
|
||||||
*hwmon-path-abs*: ++
|
*hwmon-path-abs*: ++
|
||||||
typeof: string ++
|
typeof: string ++
|
||||||
The path of the hwmon-directory of the device, e.g. */sys/devices/pci0000:00/0000:00:18.3/hwmon*. (Note that the subdirectory *hwmon/hwmon#*, where *#* is a number is not part of the path!) Has to be used together with *input-filename*.
|
The path of the hwmon-directory of the device, e.g. */sys/devices/pci0000:00/0000:00:18.3/hwmon*. (Note that the subdirectory *hwmon/hwmon#*, where *#* is a number is not part of the path!) Has to be used together with *input-filename*.
|
||||||
|
This can also be an array of strings, for which, it just works like *hwmon-path*.
|
||||||
|
|
||||||
*input-filename*: ++
|
*input-filename*: ++
|
||||||
typeof: string ++
|
typeof: string ++
|
||||||
|
@ -59,7 +60,7 @@ Addressed by *temperature*
|
||||||
|
|
||||||
*rotate*: ++
|
*rotate*: ++
|
||||||
typeof: integer ++
|
typeof: integer ++
|
||||||
Positive value to rotate the text label.
|
Positive value to rotate the text label (in 90 degree increments).
|
||||||
|
|
||||||
*max-length*: ++
|
*max-length*: ++
|
||||||
typeof: integer ++
|
typeof: integer ++
|
||||||
|
@ -110,6 +111,19 @@ Addressed by *temperature*
|
||||||
default: true ++
|
default: true ++
|
||||||
Option to disable tooltip on hover.
|
Option to disable tooltip on hover.
|
||||||
|
|
||||||
|
*menu*: ++
|
||||||
|
typeof: string ++
|
||||||
|
Action that popups the menu.
|
||||||
|
|
||||||
|
*menu-file*: ++
|
||||||
|
typeof: string ++
|
||||||
|
Location of the menu descriptor file. There need to be an element of type
|
||||||
|
GtkMenu with id *menu*
|
||||||
|
|
||||||
|
*menu-actions*: ++
|
||||||
|
typeof: array ++
|
||||||
|
The actions corresponding to the buttons of the menu.
|
||||||
|
|
||||||
# FORMAT REPLACEMENTS
|
# FORMAT REPLACEMENTS
|
||||||
|
|
||||||
*{temperatureC}*: Temperature in Celsius.
|
*{temperatureC}*: Temperature in Celsius.
|
||||||
|
|
|
@ -17,6 +17,12 @@ compatible devices in the tooltip.
|
||||||
The battery to monitor. Refer to the https://upower.freedesktop.org/docs/UpDevice.html#UpDevice--native-path ++
|
The battery to monitor. Refer to the https://upower.freedesktop.org/docs/UpDevice.html#UpDevice--native-path ++
|
||||||
Can be obtained using `upower --dump`
|
Can be obtained using `upower --dump`
|
||||||
|
|
||||||
|
*model*: ++
|
||||||
|
typeof: string ++
|
||||||
|
default: ++
|
||||||
|
The battery to monitor, based on the model. (this option is ignored if *native-path* is given). ++
|
||||||
|
Can be obtained using `upower --dump`
|
||||||
|
|
||||||
*icon-size*: ++
|
*icon-size*: ++
|
||||||
typeof: integer ++
|
typeof: integer ++
|
||||||
default: 20 ++
|
default: 20 ++
|
||||||
|
@ -62,6 +68,19 @@ compatible devices in the tooltip.
|
||||||
default: true ++
|
default: true ++
|
||||||
Option to disable battery icon.
|
Option to disable battery icon.
|
||||||
|
|
||||||
|
*menu*: ++
|
||||||
|
typeof: string ++
|
||||||
|
Action that popups the menu.
|
||||||
|
|
||||||
|
*menu-file*: ++
|
||||||
|
typeof: string ++
|
||||||
|
Location of the menu descriptor file. There need to be an element of type
|
||||||
|
GtkMenu with id *menu*
|
||||||
|
|
||||||
|
*menu-actions*: ++
|
||||||
|
typeof: array ++
|
||||||
|
The actions corresponding to the buttons of the menu.
|
||||||
|
|
||||||
# FORMAT REPLACEMENTS
|
# FORMAT REPLACEMENTS
|
||||||
|
|
||||||
*{percentage}*: The battery capacity in percentage
|
*{percentage}*: The battery capacity in percentage
|
||||||
|
|
|
@ -31,7 +31,7 @@ The *wireplumber* module displays the current volume reported by WirePlumber.
|
||||||
|
|
||||||
*rotate*: ++
|
*rotate*: ++
|
||||||
typeof: integer ++
|
typeof: integer ++
|
||||||
Positive value to rotate the text label.
|
Positive value to rotate the text label (in 90 degree increments).
|
||||||
|
|
||||||
*states*: ++
|
*states*: ++
|
||||||
typeof: object ++
|
typeof: object ++
|
||||||
|
@ -87,6 +87,19 @@ The *wireplumber* module displays the current volume reported by WirePlumber.
|
||||||
default: 100 ++
|
default: 100 ++
|
||||||
The maximum volume that can be set, in percentage.
|
The maximum volume that can be set, in percentage.
|
||||||
|
|
||||||
|
*menu*: ++
|
||||||
|
typeof: string ++
|
||||||
|
Action that popups the menu.
|
||||||
|
|
||||||
|
*menu-file*: ++
|
||||||
|
typeof: string ++
|
||||||
|
Location of the menu descriptor file. There need to be an element of type
|
||||||
|
GtkMenu with id *menu*
|
||||||
|
|
||||||
|
*menu-actions*: ++
|
||||||
|
typeof: array ++
|
||||||
|
The actions corresponding to the buttons of the menu.
|
||||||
|
|
||||||
# FORMAT REPLACEMENTS
|
# FORMAT REPLACEMENTS
|
||||||
|
|
||||||
*{volume}*: Volume in percentage.
|
*{volume}*: Volume in percentage.
|
||||||
|
|
|
@ -19,6 +19,8 @@ Valid locations for this file are:
|
||||||
A good starting point is the default configuration found at https://github.com/Alexays/Waybar/blob/master/resources/config.jsonc
|
A good starting point is the default configuration found at https://github.com/Alexays/Waybar/blob/master/resources/config.jsonc
|
||||||
Also, a minimal example configuration can be found at the bottom of this man page.
|
Also, a minimal example configuration can be found at the bottom of this man page.
|
||||||
|
|
||||||
|
The visual display elements for waybar use a CSS stylesheet, see *waybar-styles(5)* for details.
|
||||||
|
|
||||||
# BAR CONFIGURATION
|
# BAR CONFIGURATION
|
||||||
|
|
||||||
*layer* ++
|
*layer* ++
|
||||||
|
@ -276,6 +278,11 @@ A group may hide all but one element, showing them only on mouse hover. In order
|
||||||
default: "hidden" ++
|
default: "hidden" ++
|
||||||
Defines the CSS class to be applied to the hidden elements.
|
Defines the CSS class to be applied to the hidden elements.
|
||||||
|
|
||||||
|
*click-to-reveal*: ++
|
||||||
|
typeof: bool ++
|
||||||
|
default: false ++
|
||||||
|
Whether left click should reveal the content rather than mouse over. Note that grouped modules may still process their own on-click events.
|
||||||
|
|
||||||
*transition-left-to-right*: ++
|
*transition-left-to-right*: ++
|
||||||
typeof: bool ++
|
typeof: bool ++
|
||||||
default: true ++
|
default: true ++
|
||||||
|
@ -316,6 +323,9 @@ A group may hide all but one element, showing them only on mouse hover. In order
|
||||||
- *waybar-hyprland-submap(5)*
|
- *waybar-hyprland-submap(5)*
|
||||||
- *waybar-hyprland-window(5)*
|
- *waybar-hyprland-window(5)*
|
||||||
- *waybar-hyprland-workspaces(5)*
|
- *waybar-hyprland-workspaces(5)*
|
||||||
|
- *waybar-niri-language(5)*
|
||||||
|
- *waybar-niri-window(5)*
|
||||||
|
- *waybar-niri-workspaces(5)*
|
||||||
- *waybar-idle-inhibitor(5)*
|
- *waybar-idle-inhibitor(5)*
|
||||||
- *waybar-image(5)*
|
- *waybar-image(5)*
|
||||||
- *waybar-inhibitor(5)*
|
- *waybar-inhibitor(5)*
|
||||||
|
@ -347,3 +357,4 @@ A group may hide all but one element, showing them only on mouse hover. In order
|
||||||
# SEE ALSO
|
# SEE ALSO
|
||||||
|
|
||||||
*sway-output(5)*
|
*sway-output(5)*
|
||||||
|
*waybar-styles(5)"
|
||||||
|
|
42
meson.build
42
meson.build
|
@ -1,6 +1,6 @@
|
||||||
project(
|
project(
|
||||||
'waybar', 'cpp', 'c',
|
'waybar', 'cpp', 'c',
|
||||||
version: '0.10.0',
|
version: '0.11.0',
|
||||||
license: 'MIT',
|
license: 'MIT',
|
||||||
meson_version: '>= 0.59.0',
|
meson_version: '>= 0.59.0',
|
||||||
default_options : [
|
default_options : [
|
||||||
|
@ -69,7 +69,7 @@ is_openbsd = host_machine.system() == 'openbsd'
|
||||||
|
|
||||||
thread_dep = dependency('threads')
|
thread_dep = dependency('threads')
|
||||||
fmt = dependency('fmt', version : ['>=8.1.1'], fallback : ['fmt', 'fmt_dep'])
|
fmt = dependency('fmt', version : ['>=8.1.1'], fallback : ['fmt', 'fmt_dep'])
|
||||||
spdlog = dependency('spdlog', version : ['>=1.10.0'], fallback : ['spdlog', 'spdlog_dep'], default_options : ['external_fmt=enabled'])
|
spdlog = dependency('spdlog', version : ['>=1.10.0'], fallback : ['spdlog', 'spdlog_dep'], default_options : ['external_fmt=enabled', 'std_format=disabled', 'tests=disabled'])
|
||||||
wayland_client = dependency('wayland-client')
|
wayland_client = dependency('wayland-client')
|
||||||
wayland_cursor = dependency('wayland-cursor')
|
wayland_cursor = dependency('wayland-cursor')
|
||||||
wayland_protos = dependency('wayland-protocols')
|
wayland_protos = dependency('wayland-protocols')
|
||||||
|
@ -106,7 +106,7 @@ if libsndio.found()
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
gtk_layer_shell = dependency('gtk-layer-shell-0', version: ['>=0.6.0'],
|
gtk_layer_shell = dependency('gtk-layer-shell-0', version: ['>=0.9.0'],
|
||||||
default_options: ['introspection=false', 'vapi=false'],
|
default_options: ['introspection=false', 'vapi=false'],
|
||||||
fallback: ['gtk-layer-shell', 'gtk_layer_shell'])
|
fallback: ['gtk-layer-shell', 'gtk_layer_shell'])
|
||||||
systemd = dependency('systemd', required: get_option('systemd'))
|
systemd = dependency('systemd', required: get_option('systemd'))
|
||||||
|
@ -192,6 +192,7 @@ man_files = files(
|
||||||
'man/waybar-idle-inhibitor.5.scd',
|
'man/waybar-idle-inhibitor.5.scd',
|
||||||
'man/waybar-image.5.scd',
|
'man/waybar-image.5.scd',
|
||||||
'man/waybar-states.5.scd',
|
'man/waybar-states.5.scd',
|
||||||
|
'man/waybar-menu.5.scd',
|
||||||
'man/waybar-temperature.5.scd',
|
'man/waybar-temperature.5.scd',
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -305,7 +306,9 @@ if true
|
||||||
'src/modules/hyprland/language.cpp',
|
'src/modules/hyprland/language.cpp',
|
||||||
'src/modules/hyprland/submap.cpp',
|
'src/modules/hyprland/submap.cpp',
|
||||||
'src/modules/hyprland/window.cpp',
|
'src/modules/hyprland/window.cpp',
|
||||||
|
'src/modules/hyprland/workspace.cpp',
|
||||||
'src/modules/hyprland/workspaces.cpp',
|
'src/modules/hyprland/workspaces.cpp',
|
||||||
|
'src/modules/hyprland/windowcreationpayload.cpp',
|
||||||
)
|
)
|
||||||
man_files += files(
|
man_files += files(
|
||||||
'man/waybar-hyprland-language.5.scd',
|
'man/waybar-hyprland-language.5.scd',
|
||||||
|
@ -315,6 +318,21 @@ if true
|
||||||
)
|
)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
if get_option('niri')
|
||||||
|
add_project_arguments('-DHAVE_NIRI', language: 'cpp')
|
||||||
|
src_files += files(
|
||||||
|
'src/modules/niri/backend.cpp',
|
||||||
|
'src/modules/niri/language.cpp',
|
||||||
|
'src/modules/niri/window.cpp',
|
||||||
|
'src/modules/niri/workspaces.cpp',
|
||||||
|
)
|
||||||
|
man_files += files(
|
||||||
|
'man/waybar-niri-language.5.scd',
|
||||||
|
'man/waybar-niri-window.5.scd',
|
||||||
|
'man/waybar-niri-workspaces.5.scd',
|
||||||
|
)
|
||||||
|
endif
|
||||||
|
|
||||||
if libnl.found() and libnlgen.found()
|
if libnl.found() and libnlgen.found()
|
||||||
add_project_arguments('-DHAVE_LIBNL', language: 'cpp')
|
add_project_arguments('-DHAVE_LIBNL', language: 'cpp')
|
||||||
src_files += files('src/modules/network.cpp')
|
src_files += files('src/modules/network.cpp')
|
||||||
|
@ -335,10 +353,7 @@ endif
|
||||||
|
|
||||||
if (upower_glib.found() and not get_option('logind').disabled())
|
if (upower_glib.found() and not get_option('logind').disabled())
|
||||||
add_project_arguments('-DHAVE_UPOWER', language: 'cpp')
|
add_project_arguments('-DHAVE_UPOWER', language: 'cpp')
|
||||||
src_files += files(
|
src_files += files('src/modules/upower.cpp')
|
||||||
'src/modules/upower/upower.cpp',
|
|
||||||
'src/modules/upower/upower_tooltip.cpp',
|
|
||||||
)
|
|
||||||
man_files += files('man/waybar-upower.5.scd')
|
man_files += files('man/waybar-upower.5.scd')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
@ -348,7 +363,8 @@ if pipewire.found()
|
||||||
src_files += files(
|
src_files += files(
|
||||||
'src/modules/privacy/privacy.cpp',
|
'src/modules/privacy/privacy.cpp',
|
||||||
'src/modules/privacy/privacy_item.cpp',
|
'src/modules/privacy/privacy_item.cpp',
|
||||||
'src/util/pipewire_backend.cpp',
|
'src/util/pipewire/pipewire_backend.cpp',
|
||||||
|
'src/util/pipewire/privacy_node_info.cpp',
|
||||||
)
|
)
|
||||||
man_files += files('man/waybar-privacy.5.scd')
|
man_files += files('man/waybar-privacy.5.scd')
|
||||||
endif
|
endif
|
||||||
|
@ -466,7 +482,7 @@ if get_option('experimental')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
cava = dependency('cava',
|
cava = dependency('cava',
|
||||||
version : '>=0.10.1',
|
version : '>=0.10.3',
|
||||||
required: get_option('cava'),
|
required: get_option('cava'),
|
||||||
fallback : ['cava', 'cava_dep'],
|
fallback : ['cava', 'cava_dep'],
|
||||||
not_found_message: 'cava is not found. Building waybar without cava')
|
not_found_message: 'cava is not found. Building waybar without cava')
|
||||||
|
@ -538,6 +554,14 @@ if scdoc.found()
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
man_files += configure_file(
|
||||||
|
input: 'man/waybar-styles.5.scd.in',
|
||||||
|
output: 'waybar-styles.5.scd',
|
||||||
|
configuration: {
|
||||||
|
'sysconfdir': prefix / sysconfdir
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
fs = import('fs')
|
fs = import('fs')
|
||||||
mandir = get_option('mandir')
|
mandir = get_option('mandir')
|
||||||
foreach file : man_files
|
foreach file : man_files
|
||||||
|
|
|
@ -19,3 +19,4 @@ option('experimental', type : 'boolean', value : false, description: 'Enable exp
|
||||||
option('jack', type: 'feature', value: 'auto', description: 'Enable support for JACK')
|
option('jack', type: 'feature', value: 'auto', description: 'Enable support for JACK')
|
||||||
option('wireplumber', type: 'feature', value: 'auto', description: 'Enable support for WirePlumber')
|
option('wireplumber', type: 'feature', value: 'auto', description: 'Enable support for WirePlumber')
|
||||||
option('cava', type: 'feature', value: 'auto', description: 'Enable support for Cava')
|
option('cava', type: 'feature', value: 'auto', description: 'Enable support for Cava')
|
||||||
|
option('niri', type: 'boolean', description: 'Enable support for niri')
|
||||||
|
|
|
@ -5,12 +5,12 @@
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
libcava = rec {
|
libcava = rec {
|
||||||
version = "0.10.1";
|
version = "0.10.3";
|
||||||
src = pkgs.fetchFromGitHub {
|
src = pkgs.fetchFromGitHub {
|
||||||
owner = "LukashonakV";
|
owner = "LukashonakV";
|
||||||
repo = "cava";
|
repo = "cava";
|
||||||
rev = version;
|
rev = version;
|
||||||
hash = "sha256-iIYKvpOWafPJB5XhDOSIW9Mb4I3A4pcgIIPQdQYEqUw=";
|
hash = "sha256-ZDFbI69ECsUTjbhlw2kHRufZbQMu+FQSMmncCJ5pagg=";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
|
@ -25,6 +25,9 @@ in
|
||||||
|
|
||||||
mesonFlags = lib.remove "-Dgtk-layer-shell=enabled" oldAttrs.mesonFlags;
|
mesonFlags = lib.remove "-Dgtk-layer-shell=enabled" oldAttrs.mesonFlags;
|
||||||
|
|
||||||
|
# downstream patch should not affect upstream
|
||||||
|
patches = [];
|
||||||
|
|
||||||
buildInputs = (builtins.filter (p: p.pname != "wireplumber") oldAttrs.buildInputs) ++ [
|
buildInputs = (builtins.filter (p: p.pname != "wireplumber") oldAttrs.buildInputs) ++ [
|
||||||
pkgs.wireplumber
|
pkgs.wireplumber
|
||||||
];
|
];
|
||||||
|
|
|
@ -30,7 +30,8 @@
|
||||||
"battery",
|
"battery",
|
||||||
"battery#bat2",
|
"battery#bat2",
|
||||||
"clock",
|
"clock",
|
||||||
"tray"
|
"tray",
|
||||||
|
"custom/power"
|
||||||
],
|
],
|
||||||
// Modules configuration
|
// Modules configuration
|
||||||
// "sway/workspaces": {
|
// "sway/workspaces": {
|
||||||
|
@ -188,7 +189,7 @@
|
||||||
"on-click": "pavucontrol"
|
"on-click": "pavucontrol"
|
||||||
},
|
},
|
||||||
"custom/media": {
|
"custom/media": {
|
||||||
"format": "{icon} {}",
|
"format": "{icon} {text}",
|
||||||
"return-type": "json",
|
"return-type": "json",
|
||||||
"max-length": 40,
|
"max-length": 40,
|
||||||
"format-icons": {
|
"format-icons": {
|
||||||
|
@ -198,5 +199,17 @@
|
||||||
"escape": true,
|
"escape": true,
|
||||||
"exec": "$HOME/.config/waybar/mediaplayer.py 2> /dev/null" // Script in resources folder
|
"exec": "$HOME/.config/waybar/mediaplayer.py 2> /dev/null" // Script in resources folder
|
||||||
// "exec": "$HOME/.config/waybar/mediaplayer.py --player spotify 2> /dev/null" // Filter player based on name
|
// "exec": "$HOME/.config/waybar/mediaplayer.py --player spotify 2> /dev/null" // Filter player based on name
|
||||||
|
},
|
||||||
|
"custom/power": {
|
||||||
|
"format" : "⏻ ",
|
||||||
|
"tooltip": false,
|
||||||
|
"menu": "on-click",
|
||||||
|
"menu-file": "$HOME/.config/waybar/power_menu.xml", // Menu file in resources folder
|
||||||
|
"menu-actions": {
|
||||||
|
"shutdown": "shutdown",
|
||||||
|
"reboot": "reboot",
|
||||||
|
"suspend": "systemctl suspend",
|
||||||
|
"hibernate": "systemctl hibernate"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -113,6 +113,7 @@ class PlayerManager:
|
||||||
player_name = player.props.player_name
|
player_name = player.props.player_name
|
||||||
artist = player.get_artist()
|
artist = player.get_artist()
|
||||||
title = player.get_title()
|
title = player.get_title()
|
||||||
|
title = title.replace("&", "&")
|
||||||
|
|
||||||
track_info = ""
|
track_info = ""
|
||||||
if player_name == "spotify" and "mpris:trackid" in metadata.keys() and ":ad:" in player.props.metadata["mpris:trackid"]:
|
if player_name == "spotify" and "mpris:trackid" in metadata.keys() and ":ad:" in player.props.metadata["mpris:trackid"]:
|
||||||
|
@ -136,6 +137,10 @@ class PlayerManager:
|
||||||
|
|
||||||
def on_player_appeared(self, _, player):
|
def on_player_appeared(self, _, player):
|
||||||
logger.info(f"Player has appeared: {player.name}")
|
logger.info(f"Player has appeared: {player.name}")
|
||||||
|
if player.name in self.excluded_player:
|
||||||
|
logger.debug(
|
||||||
|
"New player appeared, but it's in exclude player list, skipping")
|
||||||
|
return
|
||||||
if player is not None and (self.selected_player is None or player.name == self.selected_player):
|
if player is not None and (self.selected_player is None or player.name == self.selected_player):
|
||||||
self.init_player(player)
|
self.init_player(player)
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -0,0 +1,28 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<interface>
|
||||||
|
<object class="GtkMenu" id="menu">
|
||||||
|
<child>
|
||||||
|
<object class="GtkMenuItem" id="suspend">
|
||||||
|
<property name="label">Suspend</property>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkMenuItem" id="hibernate">
|
||||||
|
<property name="label">Hibernate</property>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkMenuItem" id="shutdown">
|
||||||
|
<property name="label">Shutdown</property>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkSeparatorMenuItem" id="delimiter1"/>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkMenuItem" id="reboot">
|
||||||
|
<property name="label">Reboot</property>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
</interface>
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue