Compare commits

...

334 Commits

Author SHA1 Message Date
blankie 3304143997
mpd: Add a format option for artist + title, or filename 2024-09-29 16:03:24 +10:00
Alexis Rouillard a1adf6847f
Merge pull request #3650 from khaneliman/nix 2024-09-28 20:16:12 +02:00
Alexis Rouillard 6322fa28f3
Merge pull request #3651 from khaneliman/github 2024-09-28 20:15:50 +02:00
Austin Horstman e394485857
.github/workflows: don't run on forks 2024-09-28 12:55:47 -05:00
Austin Horstman edab49f291
nix/default: cava bump 2024-09-28 12:41:10 -05:00
Alexis Rouillard 486b99c22f
Merge pull request #3646 from LukashonakV/cava_bump 2024-09-28 07:54:57 +02:00
Viktar Lukashonak e46a1c6bfc
cava bump
Signed-off-by: Viktar Lukashonak <myxabeer@gmail.com>
2024-09-28 00:57:02 +03:00
Alexis Rouillard cad18f39f5
Merge pull request #3640 from mslxl/master
nix: remove patches from downstream
2024-09-25 14:18:52 +02:00
mslxl c88a86f510
nix: remove patches from downstream
The patches is the modification of downstream, it should not affect upstream. Any changes of upstream would caused patch fail.
2024-09-25 10:01:41 +08:00
Alexis Rouillard 07f75e303c
Merge pull request #3632 from LukashonakV/ISSUE#3383
Fix: 3383. Clock. Default value for cldYearShift_ = 1900/01/01
2024-09-23 17:45:03 +02:00
Viktar Lukashonak b4e97eb2f4
FreeBSD format fix
Signed-off-by: Viktar Lukashonak <myxabeer@gmail.com>
2024-09-23 16:06:50 +03:00
Viktar Lukashonak 773b1d4806
Default value for cldYearShift_ = 1900/01/01
Signed-off-by: Viktar Lukashonak <myxabeer@gmail.com>
2024-09-23 15:51:01 +03:00
Alex 21af48fdc9 chore: lint 2024-09-19 17:31:07 +02:00
Alexis Rouillard b5395f4e6f
Merge pull request #3523 from S0nter/master
cava: Add format_silent option and css triggers
2024-09-19 17:30:34 +02:00
Sonter 3462769fc1
Merge branch 'Alexays:master' into master 2024-09-19 14:45:33 +00:00
Alexis Rouillard ac1a42291d
Merge pull request #3617 from lukasfink1/fix-custom-format-bug
fix(custom): stop mixing manual and automatic arg indexing
2024-09-19 13:50:45 +02:00
Lukas Fink a3e7031fe2 Fix formatting 2024-09-18 17:30:55 +02:00
Lukas Fink 254111ff91 Improve error message for mixed arg indexing in format string 2024-09-18 17:28:58 +02:00
Lukas Fink de170fa579 Update documentation 2024-09-17 02:56:38 +02:00
Lukas Fink 83992d29a0 Fix formatting 2024-09-17 00:39:33 +02:00
Lukas Fink 3bb3c2d23f fix(custom): stop mixing manual and automatic arg indexing
The current documentation for the custom module suggests mixing manual
(`{icon}`) and automatic (`{}`) indexing of format args. Newer versions
of the fmt library seem to not support this anymore (see issue #3605).

This commit introduces a name for the `text` output of the script, so
that `{text}` can now be used instead of `{}` in the configuration.
2024-09-17 00:13:23 +02:00
Sonter ff66b5dd57
Update waybar-cava man page 2024-09-16 17:47:10 +00:00
Sonter 9e8ebe668d
Merge branch 'Alexays:master' into master 2024-09-16 17:11:32 +00:00
Alexis Rouillard 9cfb1e38fa
Merge pull request #3528 from alebastr/sway-scene-fixes
Fixes for Sway modes and wlr_scene support
2024-09-16 14:44:17 +02:00
Alexis Rouillard ae997ad73b
Merge pull request #3613 from ThatOneCalculator/fix/3612 2024-09-16 08:09:13 +02:00
Kainoa Kanter 085a1ede97 fix: use app_identifier itself in AAppIconLabel if it's an absolute path 2024-09-15 21:28:15 -03:00
Alexis Rouillard 0d02f6877d
Merge pull request #3604 from alebastr/tray-fix 2024-09-15 09:04:58 +02:00
github-actions[bot] e0be3ac178 flake.lock: Update
Flake lock file updates:

• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/71e91c409d1e654808b2621f28a327acfdad8dc2?narHash=sha256-GnR7/ibgIH1vhoy8cYdmXE6iyZqKqFxQSVkFgosBh6w%3D' (2024-08-28)
  → 'github:NixOS/nixpkgs/4f807e8940284ad7925ebd0a0993d2a1791acb2f?narHash=sha256-IiA3jfbR7K/B5%2B9byVi9BZGWTD4VSbWe8VLpp9B/iYk%3D' (2024-09-11)
2024-09-14 23:09:16 -07:00
Aleksei Bavshin 45fec7bcbb
Revert "change layer for mode invisible to nullopt"
Previous commit should have a better workaround for #3211.

This reverts commit b61ea62732.
2024-09-14 22:43:07 -07:00
Aleksei Bavshin 7b23d58684
fix(bar): force commit for occluded surfaces
All the mode or visibility changes require `wl_surface_commit` to be
applied. gtk-layer-shell will attempt to force GTK to commit, but may
fail if the surface has stopped receiving frame callbacks[^1].
Thus, we could get stuck in a state where the bar is hidden and unable
to regain visibility.

To address this, a new API has been added to gtk-layer-shell,
`gtk_layer_try_force_commit`, which does `wl_surface_commit` with the
necessary safety checks to avoid corrupting GTK internal state.

Note: this change bumps gtk-layer-shell requirement to 0.9.0.

[^1]: https://github.com/wmww/gtk-layer-shell/issues/185
2024-09-14 22:43:06 -07:00
Aleksei Bavshin 0006e4713a
fix(tray): revert ustring formatting changes
This reverts commit a4d31ab10d.
2024-09-14 07:38:41 -07:00
Aleksei Bavshin f60c291b82
chore: update fmt wrap to 11.0.2 2024-09-14 07:36:23 -07:00
Sonter 8e2a742042
Merge branch 'Alexays:master' into master 2024-09-13 11:31:22 +00:00
Aleksei Bavshin 4a6af0da99
fix(bar): use overlay layer for `hide` and `overlay` modes
This fixes a major inconsistency with the swaybar implementation of
these modes[^1]. `overlay` layer no longer has security implications due
to a wide adoption of `ext-session-lock`, so it's safe to use.

Following config will restore the previous behavior:
```json
"modes": {
    "hide": { "layer": "top" },
    "overlay": { "layer": "top" }
},
```

[^1]: 2f7247e08a
2024-09-13 01:26:25 -07:00
Alex d177969f51 chore: lint 2024-09-13 09:53:15 +02:00
Alexis Rouillard 59b7715309
Merge pull request #3580 from hramrach/rotate-doc
Clarify documentation of 'rotate' option.
2024-09-13 09:52:59 +02:00
Alex d56dd6ee7f chore: v0.11.0 2024-09-13 09:51:11 +02:00
Alex 1142979581 chore: lint 2024-09-13 09:43:19 +02:00
Alexis Rouillard 8a89706d03
Merge pull request #3551 from YaLTeR/niri
Add niri/workspaces, niri/window, niri/language
2024-09-13 09:41:52 +02:00
Alex a4d31ab10d fix: sni item fmt 2024-09-13 09:40:35 +02:00
Ivan Molodetskikh 34bfefcd2e niri: Gate behind a meson option 2024-09-13 10:34:55 +03:00
Ivan Molodetskikh fef0bb995c niri: Replace gnu extension with GDataInputStream 2024-09-13 10:34:55 +03:00
Ivan Molodetskikh 46e7ed35de Add niri/workspaces, niri/window, niri/language 2024-09-13 10:34:55 +03:00
Alex d623a89cd1 fix: sni item fmt 2024-09-13 09:33:40 +02:00
Alexis Rouillard 1210bcd2b5
Merge pull request #3565 from saveman71/hidpi_image_module
feat: hidpi support for image module
2024-09-13 09:09:51 +02:00
Alexis Rouillard 30f6ed05ec
Merge pull request #3554 from 3u13r/fix/upower/dont-override-existing-upDevice
fix/upower: upower module selection with multiple devices
2024-09-13 09:08:49 +02:00
Alex 3ade275d10 fix: version 2024-09-13 09:02:23 +02:00
Alex 4354da2849 chore: disable fmt tests 2024-09-13 08:59:36 +02:00
Alex 6417782af6 chore: lint 2024-09-13 08:55:14 +02:00
Alex 64d99a5884 chore(fmt): std format 2024-09-13 08:50:12 +02:00
Alexis Rouillard 627e4a4a50
Merge pull request #3555 from Alexays/update_flake_lock_action
flake.lock: Update
2024-09-13 08:41:29 +02:00
Alex c2f1a7894b chore: update deps 2024-09-13 08:40:25 +02:00
Alexis Rouillard 6560e32bc1
Merge pull request #3585 from eltociear/patch-1 2024-09-10 07:37:16 +02:00
Ikko Eltociear Ashimine 70f3c1d9e9
chore: update power_profiles_daemon.cpp
minor fix
2024-09-10 01:16:42 +09:00
Michal Suchanek 5b1826d2f6 label: Add warning for invalid rotate property 2024-09-08 13:57:37 +02:00
Michal Suchanek 1fa8019ad5 man: Clarify rotate option
fixes: #3576
2024-09-08 13:56:12 +02:00
github-actions[bot] 7a6960842a flake.lock: Update
Flake lock file updates:

• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/52ec9ac3b12395ad677e8b62106f0b98c1f8569d?narHash=sha256-veKR07psFoJjINLC8RK4DiLniGGMgF3QMlS4tb74S6k%3D' (2024-07-28)
  → 'github:NixOS/nixpkgs/71e91c409d1e654808b2621f28a327acfdad8dc2?narHash=sha256-GnR7/ibgIH1vhoy8cYdmXE6iyZqKqFxQSVkFgosBh6w%3D' (2024-08-28)
2024-09-01 00:11:30 +00:00
Leonard Cohnen 9b5c2dc7ed fix: upower module selection with multiple devices
While looping over all the upower devices, the currently set device that will be rendered in the waybar, is overridden. Since the loop doesn't end when the device is found, the upDevice_ is overridden with NULL in the iteration for the next device.

Now we only override upDevice_ if the current device matches the constraints.

Fixes d2a719d67c ("Redo to minimize code duplication.")
Fixes #3267
2024-08-31 20:44:29 +02:00
Antoine Bolvy 0ee519753c
feat: hidpi support for image module 2024-08-27 15:43:19 +02:00
Sonter bf36f2abed
Merge branch 'Alexays:master' into master 2024-08-27 11:44:53 +00:00
Alexis Rouillard 5d184f74d8
Merge pull request #3506 from soreau/taskbar-minimize-hints
taskbar: Send minimize geometry hints
2024-08-26 13:10:43 +02:00
Scott Moreau 4d89c64bed taskbar: Fixup whitespace 2024-08-26 04:44:22 -06:00
Alexis Rouillard f665d1da52
Merge pull request #3527 from alebastr/hypr-getaddrinfo
hyprland/backend: drop unnecessary getaddrinfo call
2024-08-26 09:03:51 +02:00
Sonter 29459371b9
Merge branch 'Alexays:master' into master 2024-08-21 19:14:32 +03:00
Alexis Rouillard 26329b660a
Merge pull request #3534 from ilpianista/bugfix/check-format-source
fix: check format-source before use
2024-08-20 14:03:50 +02:00
Andrea Scarpino 0fb1957dae fix: check format-source before use 2024-08-20 13:57:29 +02:00
Alexis Rouillard c5a4266329
Merge pull request #3531 from yangyingchao/master
fix crash caused by use bar instance after it is freed (use-after-free)
2024-08-19 09:05:30 +02:00
yangyingchao fd478bf2ab fix crash caused by use bar instance after it is freed (use-after-free) 2024-08-19 13:47:56 +08:00
Aleksei Bavshin 1f23b30b56
hyprland/backend: drop unnecessary getaddrinfo call
Hyprland hasn't been using TCP sockets for IPC since the first release,
so this getaddrinfo call and its result was never needed.

Additionally, it leaks the `aiRes`, causing test failure under ASan.
2024-08-17 22:32:17 -07:00
Sonter 36497cd41a Rename cava css values 2024-08-14 19:27:12 +03:00
Sonter 367f156eb0 Add cava.update to css 2024-08-14 19:25:37 +03:00
Sonter ed40168d89
Add cava.silence to css 2024-08-14 14:43:17 +00:00
Sonter 62cb61c670 Add format_silent to cava module 2024-08-14 11:56:32 +03:00
Alexis Rouillard 21906f07b3
Merge pull request #3511 from hacrvlq/wireplumber-fix
Accept "default-node-changed" signals from wireplumber, even if only the node ID is changed
2024-08-07 09:22:33 +02:00
hacrvlq c468119f52
fix(wireplumber): Handle changes to the default node ID 2024-08-06 19:59:58 +02:00
Alexis Rouillard 79d3a1a296
Merge pull request #3494 from yangyingchao/master
fix #3490: expand menu file before opening it
2024-08-05 09:51:35 +02:00
Alexis Rouillard 4ae144a724
Merge pull request #3499 from gergo-salyi/cpuhotplug
Handle offline CPUs and CPU hotplug
2024-08-05 09:51:00 +02:00
Scott Moreau fdc8431709 taskbar: Send minimize geometry hints
This allows compositors to know the minimize widget geometry so that
minimize animations work properly.
2024-08-04 22:49:51 -06:00
Alexis Rouillard 9d15c666b2
Merge pull request #3493 from Alexays/update_flake_lock_action 2024-08-03 08:10:45 +02:00
Alexis Rouillard 2131678f6b
Merge pull request #3500 from khaneliman/group 2024-08-03 08:10:02 +02:00
Austin Horstman 17f07b2452
group: proper fix of enter/leave
Ignore mouse leave event when we are still within the parent element
2024-08-02 23:37:52 -05:00
Austin Horstman 05d69ae822
src/util/css_reload_helper: clang-format 2024-08-02 23:06:53 -05:00
Austin Horstman 3ae81d62bc
group: fix hover regression
We aren't including the hover detection on the revealer, so when the
animation fires we fire the leave event which starts an infinite loop of
enter/leave while we watch boxes move back and forth.
2024-08-02 23:06:53 -05:00
Austin Horstman 4efa123183
group: clang-tidy 2024-08-02 23:06:53 -05:00
Gergő Sályi 24a9886952 Handle offline CPUs and CPU hotplug
First of all in case when the number CPUs change
prevent out-of-bound index access in
waybar::modules::CpuUsage::getCpuUsage()

Secondly on Linux when updating CPU usage
read /sys/devices/system/cpu/present
and use it to detect the offline CPUs missing from /proc/stat

For offline CPUs report 0 usage and "offline" in the tooltip

Fixes issue #3498

On Linux one can test this functionality with:
echo 0 > /sys/devices/system/cpu/cpu1/online
echo 1 > /sys/devices/system/cpu/cpu1/online

On non-Linux OSes I'm not sure how to detect offline CPUs,
so I didn't add the offline CPU detection there
but at least CPU number change should not cause a crash there anymore
or cause memory safety issues after this fix
2024-08-02 17:32:07 +02:00
yangyingchao 7ec1343ad5 fix #3490: expand menu file before opening it 2024-08-01 18:06:00 +08:00
github-actions[bot] 7e1fffc455 flake.lock: Update
Flake lock file updates:

• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/693bc46d169f5af9c992095736e82c3488bf7dbb?narHash=sha256-oedh2RwpjEa%2BTNxhg5Je9Ch6d3W1NKi7DbRO1ziHemA%3D' (2024-07-14)
  → 'github:NixOS/nixpkgs/52ec9ac3b12395ad677e8b62106f0b98c1f8569d?narHash=sha256-veKR07psFoJjINLC8RK4DiLniGGMgF3QMlS4tb74S6k%3D' (2024-07-28)
2024-08-01 00:09:59 +00:00
Alexis Rouillard 003dd3a9a2
Merge pull request #3457 from RobertMueller2/issue_3414
Issue #3414/clock: Shift ONLY calendar
2024-07-22 09:06:08 +02:00
Alexis Rouillard cece04e02f
Merge pull request #3462 from DomCristaldi/walk-symlink-chain 2024-07-21 09:47:43 +02:00
DomCristaldi 58e21e876e walk up symlink tree
"reload_style_on_change" would check if the target file is a symlink,
but only resolves the first link. If the symlink is acutally a chain of
symlink, such as what happens with NixOS's mkOutOfStoreSymlink, we will
not find the actual file style file.

Update the symlink resolution logic to walk down the symlink chain until
it finds a non-symlink. Also check against a the original filename
(which may be a symlink) to guard against infinitely looping on a
circular symlink chain.
2024-07-20 22:58:03 -04:00
Alexis Rouillard cb8fc1c10d
Merge pull request #3459 from khaneliman/bar-visible 2024-07-20 18:16:06 +02:00
Austin Horstman a544f4b2cd
bar: fix setVisible
Accidentally removed updating the visible variable
2024-07-20 09:33:13 -05:00
Rene D. Obermueller ee0912a254 Issue #3414/clock: Shift ONLY calendar
Right now, for the tooltip, all times are shifted if shift-down/shift-up
actions are used. But it really only makes sense for this to apply to
the {calendar} replacement, so use shiftedNow there and now for all
the rest.
2024-07-20 09:03:49 +02:00
Alex 15e1547661 chore: 0.10.4 2024-07-17 23:04:05 +02:00
Alexis Rouillard dcbcf90aef
Update freebsd.yml 2024-07-17 22:52:39 +02:00
Alexis Rouillard ed0ed398b7
Update freebsd.yml 2024-07-17 22:46:58 +02:00
Alexis Rouillard 152053e069
Merge pull request #3398 from khaneliman/cursor
AModule: Cursor config option
2024-07-17 22:40:12 +02:00
Alexis Rouillard 496dd05e14
Merge pull request #3443 from yangyingchao/master
fix #3442
2024-07-17 22:38:22 +02:00
Alexis Rouillard 3ff8fc8a10
Merge pull request #3447 from khaneliman/hyprland-disable
hyprland: disable modules instead of rendering empty
2024-07-17 22:37:48 +02:00
Alexis Rouillard d061d2259e
Merge pull request #3448 from khaneliman/sway
sway/workspaces: remove deprecated field and ignore empty rewrite rules
2024-07-17 22:36:58 +02:00
Austin Horstman 90ac7d5d2c
sway/workspaces: support ignore window-rewrite
Similar to hyprland implementation to ignore "" empty rules
2024-07-16 22:50:26 -05:00
Austin Horstman 4295faa7c4
hyprland/backend: throw runtime_error instead of log
Allows us to disable modules entirely when socket connection isn't
working. This is similar to how sway handles their socket connections
disabling modules. This supports a single waybar config for multiple
IPCs.
2024-07-16 18:40:47 -05:00
Austin Horstman 9c40137d05
sway/workspaces: clang-tidy 2024-07-16 18:33:43 -05:00
Austin Horstman 17132b250d
sway/workspaces: remove deprecated field
Was deprecated a long time ago, we removed the Hyprland version.
Removing this, as well.
2024-07-16 18:33:43 -05:00
Alexis Rouillard 3f61df4e66
Merge pull request #3416 from Ape/pr/ignored_sink_never_running
pulseaudio: Consider ignored sinks never running
2024-07-16 14:20:32 +02:00
Alexis Rouillard 2d9cc623c2
Merge pull request #3422 from RobertMueller2/issue_feat_3256
feat/issue 3256: Toggle drawer state
2024-07-16 14:19:30 +02:00
Alexis Rouillard f6ff6492ef
Merge pull request #3441 from tchaikov/fmt-format-const 2024-07-16 08:12:29 +02:00
yangyingchao b65ca334a8 fix #3442 2024-07-16 09:07:39 +08:00
Kefu Chai b71dfce1f7 Fix build with fmt11
Since fmt 11.0.0, formatter:format() is required to be const. Mark
all of the specializations as const to be compatible with fmt 11.

This change is implemented in the same spirit of 7725f6ed5a.

Signed-off-by: Kefu Chai <tchaikov@gmail.com>
2024-07-16 08:46:55 +08:00
Alexis Rouillard 5f3a9d9423
Merge pull request #3440 from khaneliman/hyprland-fix
hyprland/window: fix crash when no return from socket
2024-07-15 19:16:06 +02:00
Austin Horstman 895c870d02
network: use fmt for format
Fixes the gentoo build
2024-07-15 09:44:39 -05:00
Austin Horstman 47d7324a19
client: clang-format 2024-07-15 09:02:27 -05:00
Austin Horstman b19890c0b1
network: clang-format 2024-07-15 09:02:27 -05:00
Austin Horstman b41fcdedff
hyprland/window: fix crash when no return from socket
Gracefully handle lack of response from the IPC. If socket isn't
available, we already log the IPC isn't running. We dont need to crash
program just because we couldn't get responses. We can just return an
empty object.
2024-07-15 09:02:27 -05:00
Austin Horstman 0a78da0315
flake.lock: update 2024-07-15 08:55:32 -05:00
Alexis Rouillard 3d0fd14f3f
Merge pull request #3435 from grimsteel/network-bssid 2024-07-13 07:05:19 +02:00
Siddhant Kameswar e117bd7cb6
network: add bssid format replacement 2024-07-12 20:46:26 -05:00
Alexis Rouillard 2655660509
Merge pull request #3432 from BSFishy/readme_update 2024-07-11 21:01:52 +02:00
Matt Provost 0dd6af5a7e chore: update meson build command
Signed-off-by: Matt Provost <mattprovost6@gmail.com>
2024-07-11 08:01:54 -05:00
Rene D. Obermueller e2e5d4d447 feat/issue 3256: Toggle drawer state 2024-07-10 07:42:18 +02:00
Alexis Rouillard 44f39ca0ce
Merge pull request #3429 from ziyao233/outgoing/fix-fmt11 2024-07-09 21:08:16 +02:00
Yao Zi 7725f6ed5a Fix build with fmt11
Since fmt 11.0.0, formatter:format() is required to be const.Mark
affected functions as const to stay compatible with fmt 11.

Signed-off-by: Yao Zi <ziyao@disroot.org>
2024-07-08 20:28:26 +00:00
Alexis Rouillard b26ab1f982
Merge pull request #3417 from yangyingchao/master
(temperature) fix clang-tidy lint .
2024-07-06 09:40:02 +02:00
yangyingchao 21d42baa8e (temperature) fix clang-tidy lint . 2024-07-06 08:16:45 +08:00
Lauri Niskanen 23274a9d57
pulseaudio: Consider ignored sinks never running
If the current sink happens to be ignored it is never considered running
so it will be replaced with another sink.
2024-07-06 01:30:11 +03:00
Austin Horstman f78f29ee66
AModule: retain existing default behavior when unconfigured 2024-07-03 08:20:48 -05:00
Lars-Ragnar A. Haugen 7e2d8ab2a3
fix(#3239): hide cursor type change behind config flag
also, statically configure the cursor type
2024-07-03 08:11:15 -05:00
Alexis Rouillard 6f994c849d
Merge pull request #3407 from khaneliman/rewrite-ignore
modules/hyprland/workspace: ignore empty window-rewrite
2024-07-03 08:41:15 +02:00
Austin Horstman 702e10649e
modules/hyprland/workspace: ignore empty window-rewrite
I'd like to ignore some windows from having icons or empty space taken
on the bar. By filtering out empty repr we can supply rewrite rules that
will ignore them from being processed and showing an empty space or
default icon.
2024-07-03 00:21:49 -05:00
Alexis Rouillard ca3877d0b8
Merge pull request #3325 from williamwith4ms/escape_&_in_mediaplayer.py
fix: display titles with '&' correctly
2024-07-02 22:34:10 +02:00
Alexis Rouillard 18e67afe09
Merge pull request #3404 from khaneliman/clang-tidy
treewide: clang-tidy
2024-07-02 22:33:52 +02:00
Austin Horstman d66685a3aa
util: clang-tidy 2024-07-02 10:38:58 -05:00
Austin Horstman 14c3235c12
src: clang-tidy 2024-07-02 10:38:58 -05:00
Alexis Rouillard 034760e8b6
Merge pull request #3399 from RobertMueller2/discussion_3373
fix example in manpage for pulseaudio/slider
2024-07-01 19:27:02 +02:00
Rene D. Obermueller 8f64caceb5 fix example in manpage for pulseaudio/slider 2024-07-01 18:30:58 +02:00
Alexis Rouillard 9997155617
Merge pull request #3267 from luttermann/upower_model
Add config option to select UPower device based on device model.
2024-07-01 09:22:59 +02:00
Alexis Rouillard ff0f408ab8
Merge pull request #3380 from alerque/debug-keyboard-layout
Add keyboard debug info to hyprland language module
2024-07-01 09:22:08 +02:00
Alexis Rouillard 3262b375c9
Merge pull request #3377 from fglinka/master
Fix build error on Ubuntu 22.04
2024-07-01 09:21:56 +02:00
Alexis Rouillard 494cedb3bc
Merge pull request #3393 from RobertMueller2/issue_3366
workaround for icons not rendered for apps existing before waybar launch
2024-07-01 09:21:40 +02:00
Alexis Rouillard 93000e3fca
Merge pull request #3395 from RobertMueller2/issue_33341
add hide-empty-text option to hide module whenever output is empty but format is not
2024-07-01 09:20:56 +02:00
Alexis Rouillard abfb654f90
Merge pull request #3396 from Alexays/update_flake_lock_action
flake.lock: Update
2024-07-01 09:20:39 +02:00
Alexis Rouillard 9c7a275cd6
Merge pull request #3247 from benjamin-voisin/menu
Adding the ability to have dropdown menu for modules
2024-07-01 09:18:13 +02:00
github-actions[bot] f609042ece flake.lock: Update
Flake lock file updates:

• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/ad57eef4ef0659193044870c731987a6df5cf56b?narHash=sha256-SzDKxseEcHR5KzPXLwsemyTR/kaM9whxeiJohbL04rs%3D' (2024-05-29)
  → 'github:NixOS/nixpkgs/b2852eb9365c6de48ffb0dc2c9562591f652242a?narHash=sha256-C8e9S7RzshSdHB7L%2Bv9I51af1gDM5unhJ2xO1ywxNH8%3D' (2024-06-27)
2024-07-01 00:09:58 +00:00
Rene D. Obermueller 8eee568731 manpage for PR #3395 2024-06-30 21:23:54 +02:00
Rene D. Obermueller fb24e8cb1f add hide-empty-text option to hide module whenever output is empty but format is not 2024-06-30 21:16:52 +02:00
Rene D. Obermueller 64a3133083 workaround for icons not rendered for apps existing before waybar launch 2024-06-30 14:52:49 +02:00
Alexis Rouillard 64f54e1fce
Merge pull request #3389 from khaneliman/cleanup 2024-06-28 21:50:08 +02:00
Austin Horstman c08660d837
modules/hyprland/backend: handle empty json responses
Fixes https://github.com/Alexays/Waybar/issues/3388
2024-06-28 13:18:44 -05:00
Austin Horstman f6482c36dc
hyprland: clangd cleanup 2024-06-28 13:06:14 -05:00
Alexis Rouillard ccc3c13212
Update archlinux 2024-06-24 08:58:29 +02:00
Alexis Rouillard 1003c220be
Merge pull request #3381 from OpenSauce04/deprioritize-battery-capacity
modules/battery: Deprioritize `capacity` /sys value for battery calculation if other methods are available
2024-06-24 08:57:30 +02:00
OpenSauce04 d68bcbd292 modules/battery: Deprioritize `capacity` /sys value 2024-06-23 14:39:41 +01:00
Caleb Maclennan 4126502fe8
Add debug information for keyboard layout selection 2024-06-23 00:02:48 +03:00
Felix Glinka 136b207a12 Add suggestion by clang-format 2024-06-21 16:43:21 +02:00
Felix Glinka c4d769a586 Add explicit constructor to struct Profile
Not adding the constructor causes a compilation error on Ubuntu 22.04
with both clang 14 and gcc 11:

/usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/alloc_traits.h:518:4: error: no matching function for call to 'construct_at'
          std::construct_at(__p, std::forward<_Args>(__args)...);
          ^~~~~~~~~~~~~~~~~
/usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/vector.tcc:117:21: note: in instantiation of function template specialization 'std::allocator_traits<std::allocator<waybar::modules::Profile>>::construct<waybar::modules::Profile, Glib::ustring, Glib::ustring>' requested here
            _Alloc_traits::construct(this->_M_impl, this->_M_impl._M_finish,
                           ^
../src/modules/power_profiles_daemon.cpp:106:26: note: in instantiation of function template specialization 'std::vector<waybar::modules::Profile>::emplace_back<Glib::ustring, Glib::ustring>' requested here
      availableProfiles_.emplace_back(std::move(name), std::move(driver));
                         ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/stl_construct.h:94:5: note: candidate template ignored: substitution failure [with _Tp = waybar::modules::Profile, _Args = <Glib::ustring, Glib::ustring>]: no matching constructor for initialization of 'waybar::modules::Profile'
    construct_at(_Tp* __location, _Args&&... __args)
    ^
2024-06-21 15:32:04 +02:00
Alexis Rouillard 1c1089bade
Merge pull request #3364 from khaneliman/persistent-rename 2024-06-16 09:47:03 +02:00
Austin Horstman b114b1155c
treewide: clang-format 2024-06-15 18:44:46 -05:00
Austin Horstman f9e693b2a2
modules/hyprland/backend: remove testing log warn 2024-06-15 18:37:25 -05:00
Austin Horstman bac4d03813
modules/hyprland/workspaces: remove deprecated property 2024-06-15 18:34:45 -05:00
Alexis Rouillard 9ba5825009
Merge pull request #3362 from lukasfink1/bt-dyn-controller-pr
Fix device list not being updated on selecting new bluetooth controller
2024-06-14 14:54:22 +02:00
Lukas Fink 0df3c84c0f Fix device list not being updated on selecting new bluetooth controller 2024-06-14 14:00:55 +02:00
Alexis Rouillard 3f49725834
Merge pull request #3360 from lukasfink1/bt-dyn-controller-pr
Add hotplug detection of bluetooth controllers
2024-06-14 09:06:57 +02:00
Lukas Fink ab91d0bac3 Add hotplug detection of bluetooth controllers 2024-06-14 02:24:24 +02:00
Alexis Rouillard 79a6229522
Merge pull request #3353 from locked-out/muted_icons
Support for muted icons for pulseaudio devices/ports
2024-06-13 08:47:53 +02:00
Oliver Locke 01438f71a4 Added muted icons usage to waybar-pulseaudio man page 2024-06-13 15:59:42 +10:00
Alex 0bc43c1aa7 fix: lint 2024-06-12 23:08:27 +02:00
Alexis Rouillard e8a2882796
Merge pull request #3320 from rtgiskard/dev
fix mpris: hide on current player vanished
2024-06-12 23:08:00 +02:00
Alexis Rouillard b955e92276
Merge pull request #3244 from rtgiskard/fix.privacy
fix privacy: consider only configured modules
2024-06-12 23:07:51 +02:00
Alexis Rouillard 562e1e59b1
Merge pull request #3331 from Eisfunke/eisfunke/regex-collection-replace
Enable using capture groups in window-rewrite
2024-06-12 23:02:52 +02:00
Oliver Locke 892042eb92 Support muted icons for pulseaudio devices/ports 2024-06-12 17:03:39 +10:00
Alexis Rouillard 0251e25f23
Merge pull request #3345 from khaneliman/testing
Organize tests and start Hyprland testing
2024-06-10 21:38:01 +02:00
Alexis Rouillard 9bd09aa1b3
Merge pull request #3318 from Alexays/update_flake_lock_action
flake.lock: Update
2024-06-10 21:36:26 +02:00
giskard 1cd013a09b clock: respect tooltip option 2024-06-10 17:31:00 +08:00
giskard 7721dcdae8 mpris: some clang-tidy fix 2024-06-10 17:31:00 +08:00
giskard e8d91eb14b mpris: hide on current player vanished 2024-06-10 17:31:00 +08:00
giskard 0773786766 privacy: consider only configured modules
along with the local clang-tidy warning fixes
2024-06-10 17:31:00 +08:00
Austin Horstman 71bb2b64bf
subprojects/spdlog: bump spdlog
Fixes alpine build and is a commonly distributed version
2024-06-09 15:08:43 -05:00
Austin Horstman 06fa931de9
Dockerfiles/opensuse: add python3-packaging dependency 2024-06-09 13:41:01 -05:00
Austin Horstman 16ff5ee99b
.github/workflows/linux: fail-fast 2024-06-09 13:41:01 -05:00
Austin Horstman 08c5df3633
modules/sway/workspaces: clang-format fix 2024-06-09 13:05:47 -05:00
Austin Horstman b365831839
test/hyprland/backend: fix 2024-06-09 13:04:09 -05:00
Austin Horstman 959422f143
modules/hyprland/backend: protect against crash when XDG_RUNTIME_DIR not set 2024-06-09 10:18:20 -05:00
Austin Horstman fa2e21dfd5
modules/hyprland/backend: move getSocketFolder to class 2024-06-09 10:18:20 -05:00
Austin Horstman 58e7abba2c
tests: split into separate binaries 2024-06-08 22:43:48 -05:00
Austin Horstman 87eaa75b8a
test/hyprland/backend: init 2024-06-08 22:43:48 -05:00
Austin Horstman 749f46f86f
test/fixtures: Add GlibTestsFixture 2024-06-08 22:18:23 -05:00
Austin Horstman 0055ee6910
modules/hyprland/workspaces: remove unneccesary visibleWorkspaces variable 2024-06-07 13:56:49 -05:00
Austin Horstman 1b3b45779a
modules/hyprland/backend: add getSocketFolder to header 2024-06-07 13:56:49 -05:00
Austin Horstman e1a6d513cc
test/config: add hyprland-workspaces config 2024-06-07 13:56:49 -05:00
Alexis Rouillard f4da203915
Merge pull request #3336 from pjones/pjones/current-only 2024-06-07 08:35:02 +02:00
Peter Jones 637b220f82
sway/workspaces: Correct behavior when "current-only" is set
The `current-only` workspace setting should display only the active
workspace name as determined by its `focused` attribute.  However,
according to the `get_tree` output, workspaces that contain a focused
window will report `"focused": false` and the window will report
`"focused": true.` In this case, Waybar will not display a workspace
name at all.

This change updates the logic for determining if a workspace is
focused by also looking for a focused window.
2024-06-06 15:29:33 -07:00
Alexis Rouillard 365e77af58
Merge pull request #3332 from zspher/patch-wlr-taskbar 2024-06-05 22:07:55 +02:00
zspher 1b1442e3ba
fix: taskbar not applying empty class on empty 2024-06-06 03:23:47 +08:00
Nicolas Lenz d0a8c1d90d
document capturing in window-rewrite 2024-06-05 20:16:30 +02:00
Nicolas Lenz 76c2f3166e
format RegexCollection output using match results 2024-06-05 19:58:27 +02:00
williammmm 02eaa8b46e
escape & in mediaplayer 2024-06-03 19:46:55 +01:00
giskard 4fbd4f212a privacy: consider only configured modules
along with the local clang-tidy warning fixes
2024-06-02 04:07:12 +08:00
github-actions[bot] 1474cc626d flake.lock: Update
Flake lock file updates:

• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/44d0940ea560dee511026a53f0e2e2cde489b4d4?narHash=sha256-YN/Ciidm%2BA0fmJPWlHBGvVkcarYWSC%2Bs3NTPk/P%2Bq3c%3D' (2024-03-23)
  → 'github:NixOS/nixpkgs/ad57eef4ef0659193044870c731987a6df5cf56b?narHash=sha256-SzDKxseEcHR5KzPXLwsemyTR/kaM9whxeiJohbL04rs%3D' (2024-05-29)
2024-06-01 00:09:05 +00:00
Alexis Rouillard 7163752aa0
Merge pull request #3317 from jackwilsdon/patch-1
Fix format replacement names
2024-05-31 17:59:21 +02:00
Jack Wilsdon e9350cf25f
Fix format replacement names 2024-05-31 14:31:29 +00:00
Alexis Rouillard 1a1a61e917
Merge pull request #3313 from zjeffer/fix/zjeffer/dockerfiles 2024-05-30 20:28:55 +02:00
zjeffer 532a90259b Dont fail docker image builds when another build fails 2024-05-30 20:18:33 +02:00
zjeffer cf66604f85 fix fedora image 2024-05-30 19:35:32 +02:00
Alexis Rouillard 9332697ec1
Merge pull request #3064 from alttabber/master
Hyprland/Workspaces: Added option to hide non-visible special workspaces
2024-05-29 10:23:26 +02:00
Alexis Rouillard ab735f723c
Merge pull request #3309 from khaneliman/workflows 2024-05-29 08:07:05 +02:00
Austin Horstman c5b5b64dfa
modules/temperature: remove unused import 2024-05-28 15:41:10 -05:00
Austin Horstman 381fe83008
Makefile: fix meson deprecations 2024-05-28 15:41:10 -05:00
Austin Horstman 8adb0a5644
.github/workflows: fix meson deprecations 2024-05-28 15:41:10 -05:00
Benjamin Voisin 885290d907
📝 improve waybar-menu file 2024-05-28 21:02:07 +02:00
Benjamin Voisin 8220dbb513
📝 add a wayba-menu entry for documenting popup menus. 2024-05-28 20:42:47 +02:00
Benjamin Voisin d9f2e0f7d2
📝 add menu config informations in manpages 2024-05-28 20:42:12 +02:00
Benjamin Voisin 161c8c4c47
🥅 do not crash when unable to make the menu
When the menu cannot be built (file not existing, or wrongly formatted),
     the menu is not created and a warning with an explanaition is
     displayed.
2024-05-28 19:31:26 +02:00
Benjamin Voisin f3ed5ca5af
🌱 update default config with a menu example 2024-05-28 18:18:51 +02:00
Alexis Rouillard 0d518cb5a3
Merge pull request #3308 from khaneliman/bugfix/3280
modules/hyprland/backend: use /tmp
2024-05-28 18:00:53 +02:00
Austin Horstman 24e8766aaa
hyprland/backend: use /tmp
Was hardcoded to /tmp in previous versions
2024-05-28 11:00:20 -05:00
alttabber 29e3d8c371
Hide non-visible special workspaces 2024-05-28 17:45:01 +02:00
Benjamin Voisin c3581fb66b
🥅 only check menu if speciifed in the conf 2024-05-28 17:33:44 +02:00
Alexis Rouillard 57f2a57dac
Merge pull request #3306 from JohnRTitor/workflows-patch
workflows: add nix workflows
2024-05-28 10:21:39 +02:00
John Titor b6ca3ea4d9
worflows: add update-flake-lock action
automatically updates the nix flake lock file

runs once a month
2024-05-28 13:29:25 +05:30
John Titor 1a9952d0c0
workflows: add nix-test workflow
Checks the flake
Builds and tests the package
2024-05-28 13:29:25 +05:30
Alex a4a4be3381 fix: lint 2024-05-28 09:19:21 +02:00
Alexis Rouillard b7ce0b05b1
Merge pull request #3281 from VlctM/master
fix(#3211) change layer for mode invisible to nullopt
2024-05-28 09:18:36 +02:00
Alexis Rouillard af87388eb4
Update docker.yml 2024-05-28 09:13:11 +02:00
Alexis Rouillard 2aa8008ae2
Merge pull request #3259 from zjeffer/docker-images-action
Add GitHub action for nightly Docker image building
2024-05-28 09:11:07 +02:00
Alexis Rouillard d4413f5fa6
Merge pull request #3255 from LukashonakV/ISSUE#2240
Fix Clock. Tooltip calendar text overflows(#2240)
2024-05-28 09:08:31 +02:00
Alexis Rouillard af7945197e
Merge pull request #3260 from zjeffer/clang-tidy
clang-tidy fixes in the privacy module
2024-05-28 09:07:57 +02:00
Alexis Rouillard ac2fa9870f
Merge pull request #3241 from rtgiskard/master
temperature: allow hwmon-path-abs as array
2024-05-27 09:03:08 +02:00
Alexis Rouillard a3ac6cb099
Merge pull request #3258 from zjeffer/master
Fix debian dockerfile
2024-05-27 08:47:33 +02:00
Alexis Rouillard dc203b8439
Merge pull request #3299 from khaneliman/cleanup
hyprland: refactor and cleanup
2024-05-27 08:47:09 +02:00
Austin Horstman f5bb086460
hyprland/workspaces: sort methods 2024-05-24 14:41:59 -05:00
Austin Horstman 9ba9d57c8c
hyprland/windowcreationpayload: sort methods 2024-05-24 14:30:31 -05:00
Austin Horstman 82ae474002
hyprland/workspace: sort methods 2024-05-24 14:29:03 -05:00
Austin Horstman 56319a4705
hyprland/workspaces: break up implementations 2024-05-24 14:21:31 -05:00
Austin Horstman 07c91c200a
hyprland/workspaces: break up headers 2024-05-24 14:21:31 -05:00
Austin Horstman d73051e980
hyprland/workspaces: break up doUpdate 2024-05-24 14:21:31 -05:00
Austin Horstman 9fe51af6b0
hyprland/workspaces: break up parseConfig 2024-05-24 14:21:31 -05:00
Austin Horstman e4353e548a
.gitignore: add .ccls-cache 2024-05-24 14:21:31 -05:00
Alexis Rouillard 63bb338343
Merge pull request #3296 from unrealhoang/nix_cava_bump 2024-05-24 06:16:41 +02:00
Unreal Hoang d012124c03
cava bump: 0.10.2 for nix 2024-05-24 09:18:25 +09:00
Alexis Rouillard 10664922c9
Merge pull request #3294 from LukashonakV/cava_bump 2024-05-23 23:03:49 +02:00
Viktar Lukashonak 60a613ae51
cava bump: 0.10.2
Signed-off-by: Viktar Lukashonak <myxabeer@gmail.com>
2024-05-23 16:15:48 +03:00
Alexis Rouillard 35a9ca476d
Merge pull request #3289 from yangyingchao/yc-hacking 2024-05-22 09:17:07 +02:00
yangyingchao b8e68b0e63 (hyprland) fix crash when failed to parse IPC message
IPC messages are parsed in a dedicated thread, and the thread terminates when
an exception is not caught, which causes the waybar process to crash with
SIGABORT.

While this issue might be related to Hyprland, it is really annoying to see
waybar crash. It would be better to catch those exceptions and report errors
instead of crashing.
2024-05-22 12:52:01 +08:00
wmlhwl b61ea62732 change layer for mode invisible to nullopt 2024-05-19 13:53:09 +02:00
Alexis Rouillard 8ad7c75d79
Merge pull request #3278 from LukashonakV/ISSUE#3276_cava 2024-05-18 11:42:14 +02:00
Viktar Lukashonak 5a1454ab31
Cava. $XDG_CONFIG_HOME validation
Signed-off-by: Viktar Lukashonak <myxabeer@gmail.com>
2024-05-18 11:28:10 +03:00
Viktar Lukashonak b288fdf8c1
ISSUE#2240. Clock Gtk::Label as a calendar tooltip
Signed-off-by: Viktar Lukashonak <myxabeer@gmail.com>
2024-05-17 20:17:33 +03:00
Lasse Luttermann d2a719d67c Redo to minimize code duplication. 2024-05-16 12:37:53 +02:00
Lasse Luttermann 28ef5b7db2 Fix formatting 2024-05-14 10:21:24 +02:00
Lasse Luttermann 6413f25b8d Add config option to select UPower device based on device model. 2024-05-14 10:13:22 +02:00
Alexis Rouillard 912d0e83f3
Merge pull request #3266 from luttermann/master 2024-05-14 09:37:11 +02:00
Lasse Luttermann 3c075bcc53 Fixed formatting 2024-05-14 08:26:44 +02:00
Lasse Luttermann ba8a88acfb Do not try to compare a string that may be a null-pointer 2024-05-14 08:16:10 +02:00
zjeffer e27488b48c clang-tidy improvements in privacy module 2024-05-11 16:19:46 +02:00
zjeffer 1828a94b6c clang-tidy: comment case styling options 2024-05-11 16:19:46 +02:00
zjeffer 49afcdf715 Add GitHub action for nightly Dockerfiles building 2024-05-11 16:16:02 +02:00
zjeffer ff84c6dbaf fix debian dockerfile 2024-05-11 15:59:20 +02:00
Alexis Rouillard cb2d54a237
Merge pull request #3248 from LukashonakV/ISSUE3223_upower 2024-05-10 06:50:40 +02:00
Viktar Lukashonak 5fe99ea0e1
Upower. Fix segmentation fault
Signed-off-by: Viktar Lukashonak <myxabeer@gmail.com>
2024-05-10 00:00:47 +03:00
Benjamin Voisin 21751b2faa
🎨 clang-tidy 2024-05-09 20:59:25 +02:00
Benjamin Voisin 3b87b83076
♻️ move GMenu to ALabel class 2024-05-09 18:34:26 +02:00
Benjamin Voisin 884b909e7d
add GtkMenu to the AModule class
You can configure what key launch the menu with the "menu" element in
the config, the xml file that describes the menu with the "menu-file"
element in the config, and the actions of each buttons with the
"menu-actions" field.
2024-05-09 17:28:08 +02:00
giskard b980dab6df doc: update waybar-temperature manual page 2024-05-08 23:56:44 +08:00
giskard e298bf922f temperature: allow hwmon-path-abs as array 2024-05-08 23:55:51 +08:00
ViktarL 2ead1bbf84
Upower refactoring (#3220)
Signed-off-by: Viktar Lukashonak <myxabeer@gmail.com>
2024-05-07 10:29:52 +02:00
Tuur Vanhoutte 29917fb073
Fix hyprland/language events not working with keyboard names with commas in them (#3224) 2024-05-07 08:26:05 +02:00
Alex e627879b16 chore: 0.10.3 2024-05-06 10:54:52 +02:00
Alex 0572e02d7e fix: lint 2024-05-06 10:51:30 +02:00
Eldar Yusupov df1a9c5509
Remove listener when window is destroyed (#3215) 2024-05-06 10:51:14 +02:00
Lars-Ragnar A. Haugen e7779b5458
feat(#3174): hover for whole group (#3201)
* feat(#3174): hover for whole group

* fix: target eventbox for class also

* fix: actually no reason to add handler, just override AModule

* fix: actually remove existing handler as well

drawer functionality still works from my testing. anything else to think
abotu?

* revert: keep id and class on original box

* refactor: clang-format group.hpp

* dev: try stop workflow
2024-05-06 10:51:03 +02:00
Alex fc6d708fb6 chore: disable cland-tidy for now 2024-05-06 10:50:55 +02:00
Lars-Ragnar A. Haugen a453ea3c70
fix(#3210): tooltip-format on custom modules not working in some cases (#3213) 2024-05-06 10:47:52 +02:00
Lars-Ragnar A. Haugen 8e8ce0c6bc
feat(#3182): style tray icon on hover (#3203) 2024-05-06 10:47:25 +02:00
Bintang c4e0c569aa
flake: fix overlay not actually being applied (#3208) 2024-05-06 10:46:10 +02:00
柳芭老爹 231d6972d7
fix: custom module mediaplayer doesn't respect argument (#3198)
fix custom module mediaplayer which doesn't consider  --exclude argument on player appear
2024-05-03 08:47:41 +02:00
Jacob Birkett 50476edc98
Nix Flake: Fix overlay (again) (#3196) 2024-05-03 08:31:39 +02:00
Lars-Ragnar A. Haugen 0b6476da32
fix: set cursor appropriately on user event hover (#3195) 2024-05-02 22:09:21 +02:00
Jan Beich 79ae530bd2
pipewire: unbreak build on FreeBSD (#3193) 2024-05-02 08:31:40 +02:00
Tuur Vanhoutte f41458ea24
Fix Hyprland socketpath changed to XDG_RUNTIME_DIR (#3183) 2024-04-29 19:46:28 +02:00
clayton craft 2481f7a292
upower: fix segfault by initializing lastWarningLevel (#3171)
fixes bd8b215416
2024-04-25 10:36:43 +02:00
Alex 61ac7e4e10 fix: lint 2024-04-25 00:16:15 +02:00
Milo Mordaunt 9a3044a54f
Cursor change to indicate module clickability (#3108)
* Indicate clickability on mouse hover

* Avoid messy overrides situation

* Update AModule.cpp

* Update AModule.cpp

* Update AModule.cpp

* Update AModule.cpp

---------

Co-authored-by: Alexis Rouillard <alexisr245@gmail.com>
2024-04-25 00:15:40 +02:00
Alexis Rouillard a597a994d2
Merge pull request #3167 from kiriDevs/battery-health-fix
fix(battery): Fix `{health}` format replacement
2024-04-24 23:16:18 +02:00
Kiri a2c5a8215b
style(battery): Capitalize float 'F' suffix 2024-04-24 15:07:26 +02:00
Kiri 57197b8e01
feat(battery): Also support energy_full (instead of charge_full) 2024-04-24 14:57:11 +02:00
Kiri 5c4e368819
style(battery): Indent level
It's now *inconsistent* in the file, but clang-tidy should be happy, sooo...
2024-04-24 09:05:11 +00:00
Kiri 8d962430dd
fix(battery): Remove duplicate line
This is what happens when you copy-paste from GitHub actions
2024-04-24 09:02:03 +00:00
Kiri 54a85ea15f
style: Apply clang-format change
At least I hope I copy-pased it correctly
2024-04-24 08:56:24 +00:00
Kiri efa7dc7ba4
fix(battery): Register health replacement for main format 2024-04-24 10:34:35 +02:00
Alex a04016e0b6 chore: 0.10.2 2024-04-23 17:59:08 +02:00
Alexis Rouillard 08b0ed1b79
Merge pull request #3165 from haug1/fix/group-drawer-hover
fix(#3162): hover event did not propagate causing issues
2024-04-23 16:23:05 +02:00
Lars-Ragnar A. Haugen 5b7d0a2810
fix(#3162): hover event did not propagate causing issues 2024-04-23 16:18:54 +02:00
Alex 501e63fba6 chore: 0.10.1 2024-04-23 07:53:22 +02:00
Alexis Rouillard 5ce5ceba62
Merge pull request #3155 from drendog/master 2024-04-21 18:47:42 +02:00
drendog 2123995b03 fix: update clock tooltip without placeholders scenario 2024-04-21 18:02:26 +02:00
Alexis Rouillard 87cc40e6e2
Merge pull request #3145 from haug1/feat/hover-for-all-modules-by-class
feat(#2989): (optional) hover for all modules
2024-04-20 23:39:41 +02:00
Lars-Ragnar A. Haugen 6c1125c1fe
feat(#2989): (optional) hover for all modules 2024-04-19 19:16:39 +02:00
Alex 937bf2ba5d fix: lint 2024-04-19 06:21:10 +02:00
Alexis Rouillard 77df0c3e3b
Merge pull request #3147 from joesri/joesri-patch-1-custom
Escape tooltip in custom module
2024-04-19 06:20:45 +02:00
Alexis Rouillard 95788e8081
Merge pull request #3148 from VAWVAW/sway-scroll
sway/workspaces: Fix scroll on unfocused monitor
2024-04-19 06:20:28 +02:00
vawvaw f75b2ae91f
sway/workspaces: Fix scroll on unfocused monitor 2024-04-18 22:56:49 +02:00
joesri 2673a5a4f1
Escape tooltip in custom module 2024-04-18 14:17:30 +00:00
Alex 8ef4ddd7ef fix: lint 2024-04-18 08:34:02 +02:00
Alexis Rouillard f26efae569
Merge pull request #3130 from kiriDevs/kiridevs/battery-cycles
battery: Add {cycles}, {health} format replacements
2024-04-18 08:33:17 +02:00
Kiri 67bf98a93e
style: Change more var names to camelCase 2024-04-17 14:46:35 +02:00
Alexis Rouillard dd092a5fc1
Merge pull request #3143 from tomben13/fix_workspaces
Fixes for hyprland/workspaces
2024-04-17 08:28:00 +02:00
Alexis Rouillard 3efebc2822
Merge pull request #3142 from janpeterd/master
calendar: add shift_reset action
2024-04-15 22:18:17 +02:00
Alexis Rouillard fbcd7ebbfa
Merge pull request #3141 from rnestler/remove-unused-variable
Remove unused variable in Workspaces::updateWindows
2024-04-15 22:18:07 +02:00
Jan-Peter Dhallé fb88c06d78 calendar: add shift_reset action 2024-04-15 21:59:35 +02:00
Raphael Nestler 133dfc2e85 Remove unused variable in Workspaces::updateWindows 2024-04-15 13:50:41 +02:00
Alexis Rouillard ddacb111a9
Merge pull request #3136 from hrdl-github/fix-pipewire-locking
Pipewire backend: use pipewire thread lock
2024-04-14 10:33:22 +02:00
hrdl 74773885c6 Pipewire backend: use pipewire thread lock
Fixes #3047.
2024-04-13 14:25:28 +02:00
Kiri 3d54a6002d
style: Remove superfluous 'const' on getInfo()
was here before, but is an easy fix for a clang-tidy warning
2024-04-13 13:19:54 +02:00
Kiri da47c94480
fix: Also use camelCase for usages of new vars 2024-04-13 13:18:50 +02:00
Kiri 986b348bc7
style: Change new variables to camelCase 2024-04-13 13:11:14 +02:00
Kiri 421ba6e31a
fix: Add dummy information for battery cycles,health on FreeBSD 2024-04-12 18:48:54 +02:00
Tom Benham 084b561d5b [hyprland/workspaces] Update window count and sort workspaces AFTER their creation 2024-04-12 11:40:05 +02:00
Tom Benham cd3d588abd [hyprland/workspaces] Fix active workspace not getting updated on multi monitor setups 2024-04-12 11:33:29 +02:00
Kiri 24690248db
fix: Calculate battery health the right way around
I even did this originally, then got confused when my battery in particular showed 102% and, instead of checking the values I calculate with, just decided to do the stupid thing and do maths the wrong around
2024-04-11 02:40:04 +02:00
Kiri 805faa47e6
style: Remove debug output
Oops
2024-04-10 18:48:03 +02:00
Kiri a59593fde1
feat(battery): Add {health} format replacement 2024-04-10 18:19:55 +02:00
Kiri 7f1e623f77
style: Refactor battery cycle count choosing 2024-04-10 17:30:47 +02:00
Kiri 43511992d9
feat(battery): Add {cycles} format replacement 2024-04-10 17:00:50 +02:00
Alexis Rouillard e8038ef9f3
Merge pull request #3127 from dkg/man-waybar-styles
Add waybar-styles(5) manual page
2024-04-10 11:00:32 +02:00
Alex a9088c7e7d fix: lint 2024-04-10 10:20:21 +02:00
Alexis Rouillard 896c578c0e
Merge pull request #3128 from hvenev/master
Fix #3125
2024-04-10 10:19:47 +02:00
Hristo Venev f68ac9119a Use $TZ for local time if it is set
libstdc++ doesn't.
2024-04-09 23:27:36 +03:00
Daniel Kahn Gillmor 3d15b96429 Add waybar-styles(5) manual page
waybar(5) describes the configuration syntax but doesn't mention how
the stylesheets are handled.

This documentation would have been helpful to me as i figured out how
to configure waybar.
2024-04-09 10:02:33 -04:00
Alexis Rouillard 42dc9cb85f
Merge pull request #3102 from dep4/taskbar-directories
taskbar: search user directories first for desktop files
2024-04-03 08:58:49 +02:00
Bruce Mills 245043f9e7 taskbar: search user directories first for desktop files 2024-04-01 14:30:31 -04:00
Alexis Rouillard 3de9e0cbd3
Merge pull request #3099 from kkvark/master 2024-04-01 07:53:23 +02:00
kvark 9b4fc6d16b fix(sway/workspaces): floating_nodes and focused icon
Floating nodes are not taken into account for visible and empty workspaces

And fix focused icon (#3095)
2024-03-31 21:53:56 +07:00
Alexis Rouillard ddc767cd81
Merge pull request #3082 from Kuruyia/refactor/privacy-module
refactor(privacy): clean up the module
2024-03-28 13:15:24 +01:00
Kuruyia fe15530f34 refactor(privacy): clean up the module 2024-03-25 20:16:47 +01:00
177 changed files with 5180 additions and 2425 deletions

View File

@ -15,15 +15,15 @@ Checks: >
-readability-redundant-member-init,
-readability-redundant-string-init,
-readability-identifier-length
CheckOptions:
- { key: readability-identifier-naming.NamespaceCase, value: lower_case }
- { key: readability-identifier-naming.ClassCase, value: CamelCase }
- { key: readability-identifier-naming.StructCase, value: CamelCase }
- { key: readability-identifier-naming.FunctionCase, value: camelBack }
- { key: readability-identifier-naming.VariableCase, value: camelBack }
- { key: readability-identifier-naming.PrivateMemberCase, value: camelBack }
- { key: readability-identifier-naming.PrivateMemberSuffix, value: _ }
- { key: readability-identifier-naming.EnumCase, value: CamelCase }
- { key: readability-identifier-naming.EnumConstantCase, value: UPPER_CASE }
- { key: readability-identifier-naming.GlobalConstantCase, value: UPPER_CASE }
- { key: readability-identifier-naming.StaticConstantCase, value: UPPER_CASE }
# CheckOptions:
# - { key: readability-identifier-naming.NamespaceCase, value: lower_case }
# - { key: readability-identifier-naming.ClassCase, value: CamelCase }
# - { key: readability-identifier-naming.StructCase, value: CamelCase }
# - { key: readability-identifier-naming.FunctionCase, value: camelBack }
# - { key: readability-identifier-naming.VariableCase, value: camelBack }
# - { key: readability-identifier-naming.PrivateMemberCase, value: camelBack }
# - { key: readability-identifier-naming.PrivateMemberSuffix, value: _ }
# - { key: readability-identifier-naming.EnumCase, value: CamelCase }
# - { key: readability-identifier-naming.EnumConstantCase, value: UPPER_CASE }
# - { key: readability-identifier-naming.GlobalConstantCase, value: UPPER_CASE }
# - { key: readability-identifier-naming.StaticConstantCase, value: UPPER_CASE }

View File

@ -16,4 +16,5 @@ jobs:
with:
source: "."
extensions: "hpp,h,cpp,c"
clangFormatVersion: 16
style: "file:.clang-format"
clangFormatVersion: 18

33
.github/workflows/docker.yml vendored Normal file
View File

@ -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 }}

View File

@ -14,23 +14,22 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Test in FreeBSD VM
uses: cross-platform-actions/action@v0.23.0
uses: cross-platform-actions/action@v0.25.0
timeout-minutes: 180
env:
CPPFLAGS: '-isystem/usr/local/include'
LDFLAGS: '-L/usr/local/lib'
with:
operating_system: freebsd
version: "13.2"
version: "14.1"
environment_variables: CPPFLAGS LDFLAGS
sync_files: runner-to-vm
run: |
sudo sed -i '' 's/quarterly/latest/' /etc/pkg/FreeBSD.conf
sudo pkg install -y git # subprojects/date
sudo pkg install -y catch evdev-proto gtk-layer-shell gtkmm30 jsoncpp \
libdbusmenu libevdev libfmt libmpdclient libudev-devd meson \
pkgconf pulseaudio scdoc sndio spdlog wayland-protocols upower \
pkgconf pipewire pulseaudio scdoc sndio spdlog wayland-protocols upower \
libinotify
meson build -Dman-pages=enabled
meson setup build -Dman-pages=enabled
ninja -C build
meson test -C build --no-rebuild --print-errorlogs --suite waybar

View File

@ -9,6 +9,7 @@ concurrency:
jobs:
build:
strategy:
fail-fast: false
matrix:
distro:
- alpine
@ -26,7 +27,7 @@ jobs:
steps:
- uses: actions/checkout@v3
- 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
run: ninja -C build
- name: test

17
.github/workflows/nix-tests.yml vendored Normal file
View File

@ -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

View File

@ -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

2
.gitignore vendored
View File

@ -48,3 +48,5 @@ packagecache
# Nix
result
result-*
.ccls-cache

View File

@ -3,5 +3,5 @@
FROM archlinux:base-devel
RUN pacman -Syu --noconfirm && \
pacman -S --noconfirm git meson base-devel libinput wayland wayland-protocols pixman libxkbcommon mesa gtkmm3 jsoncpp pugixml scdoc libpulse libdbusmenu-gtk3 libmpdclient gobject-introspection libxkbcommon playerctl 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

View File

@ -34,7 +34,7 @@ RUN apt update && \
libudev-dev \
libupower-glib-dev \
libwayland-dev \
libwireplumber-0.4-dev \
libwireplumber-0.5-dev \
libxkbcommon-dev \
libxkbregistry-dev \
locales \

View File

@ -29,6 +29,6 @@ RUN dnf install -y @c-development \
'pkgconfig(wayland-client)' \
'pkgconfig(wayland-cursor)' \
'pkgconfig(wayland-protocols)' \
'pkgconfig(wireplumber-0.4)' \
'pkgconfig(wireplumber-0.5)' \
'pkgconfig(xkbregistry)' && \
dnf clean all -y

View File

@ -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 -n refresh && \
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

View File

@ -3,11 +3,11 @@
default: build
build:
meson build
meson setup build
ninja -C build
build-debug:
meson build --buildtype=debug
meson setup build --buildtype=debug
ninja -C build
install: build

View File

@ -8,6 +8,7 @@
- Sway (Workspaces, Binding mode, Focused window name)
- River (Mapping mode, Tags, 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)
- Tray [#21](https://github.com/Alexays/Waybar/issues/21)
- Local time
@ -48,7 +49,7 @@ An Ubuntu PPA with more recent versions is available
```bash
$ git clone https://github.com/Alexays/Waybar
$ cd Waybar
$ meson build
$ meson setup build
$ ninja -C build
$ ./build/waybar
# If you want to install it

View File

@ -18,11 +18,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1711163522,
"narHash": "sha256-YN/Ciidm+A0fmJPWlHBGvVkcarYWSC+s3NTPk/P+q3c=",
"lastModified": 1726062873,
"narHash": "sha256-IiA3jfbR7K/B5+9byVi9BZGWTD4VSbWe8VLpp9B/iYk=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "44d0940ea560dee511026a53f0e2e2cde489b4d4",
"rev": "4f807e8940284ad7925ebd0a0993d2a1791acb2f",
"type": "github"
},
"original": {

View File

@ -16,7 +16,12 @@
"x86_64-linux"
"aarch64-linux"
]
(system: func (import nixpkgs { inherit system; }));
(system: func (import nixpkgs {
inherit system;
overlays = with self.overlays; [
waybar
];
}));
mkDate = longDate: (lib.concatStringsSep "-" [
(builtins.substring 0 4 longDate)
@ -46,22 +51,25 @@
};
});
overlays.default = final: prev: {
waybar = final.callPackage ./nix/default.nix {
# take the first "version: '...'" from meson.build
version =
(builtins.head (builtins.split "'"
(builtins.elemAt
(builtins.split " version: '" (builtins.readFile ./meson.build))
2)))
+ "+date=" + (mkDate (self.lastModifiedDate or "19700101")) + "_" + (self.shortRev or "dirty");
overlays = {
default = self.overlays.waybar;
waybar = final: prev: {
waybar = final.callPackage ./nix/default.nix {
waybar = prev.waybar;
# take the first "version: '...'" from meson.build
version =
(builtins.head (builtins.split "'"
(builtins.elemAt
(builtins.split " version: '" (builtins.readFile ./meson.build))
2)))
+ "+date=" + (mkDate (self.lastModifiedDate or "19700101")) + "_" + (self.shortRev or "dirty");
};
};
};
packages = genSystems (pkgs:
let packages = self.overlays.default pkgs pkgs;
in packages // {
default = packages.waybar;
});
packages = genSystems (pkgs: {
default = self.packages.${pkgs.stdenv.hostPlatform.system}.waybar;
inherit (pkgs) waybar;
});
};
}

View File

@ -27,6 +27,10 @@ class ALabel : public AModule {
bool handleToggle(GdkEventButton *const &e) override;
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

View File

@ -2,6 +2,7 @@
#include <glibmm/dispatcher.h>
#include <glibmm/markup.h>
#include <gtkmm.h>
#include <gtkmm/eventbox.h>
#include <json/json.h>
@ -13,9 +14,9 @@ class AModule : public IModule {
public:
static constexpr const char *MODULE_CLASS = "module";
virtual ~AModule();
~AModule() override;
auto update() -> void override;
virtual auto refresh(int) -> void{};
virtual auto refresh(int shouldRefresh) -> void {};
operator Gtk::Widget &() 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 };
SCROLL_DIR getScrollDir(GdkEventScroll *e);
bool tooltipEnabled();
bool tooltipEnabled() const;
const std::string name_;
const Json::Value &config_;
Gtk::EventBox event_box_;
virtual void setCursor(Gdk::CursorType const &c);
virtual bool handleToggle(GdkEventButton *const &ev);
virtual bool handleMouseEnter(GdkEventCrossing *const &ev);
virtual bool handleMouseLeave(GdkEventCrossing *const &ev);
virtual bool handleScroll(GdkEventScroll *);
virtual bool handleRelease(GdkEventButton *const &ev);
GObject *menu_;
private:
bool handleUserEvent(GdkEventButton *const &ev);
const bool isTooltip;
bool hasUserEvents_;
std::vector<int> pid_;
gdouble distance_scrolled_y_;
gdouble distance_scrolled_x_;

View File

@ -9,6 +9,7 @@
#include <json/json.h>
#include <memory>
#include <optional>
#include <vector>
#include "AModule.hpp"
@ -53,7 +54,7 @@ class BarIpcClient;
}
#endif // HAVE_SWAY
class Bar {
class Bar : public sigc::trackable {
public:
using bar_mode_map = std::map<std::string, struct bar_mode>;
static const bar_mode_map PRESET_MODES;
@ -65,7 +66,7 @@ class Bar {
~Bar();
void setMode(const std::string &mode);
void setVisible(bool visible);
void setVisible(bool value);
void toggle();
void handleSignal(int);

View File

@ -20,6 +20,9 @@ class Config {
static std::optional<std::string> findConfigPath(
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;
void load(const std::string &config);

View File

@ -11,15 +11,13 @@ namespace waybar {
class Group : public AModule {
public:
Group(const std::string&, const std::string&, const Json::Value&, bool);
virtual ~Group() = default;
Group(const std::string &, const std::string &, const Json::Value &, bool);
~Group() override = default;
auto update() -> void override;
operator Gtk::Widget&() override;
operator Gtk::Widget &() override;
virtual Gtk::Box& getBox();
void addWidget(Gtk::Widget& widget);
bool handleMouseHover(GdkEventCrossing* const& e);
virtual Gtk::Box &getBox();
void addWidget(Gtk::Widget &widget);
protected:
Gtk::Box box;
@ -27,9 +25,13 @@ class Group : public AModule {
Gtk::Revealer revealer;
bool is_first_widget = true;
bool is_drawer = false;
bool click_to_reveal = false;
std::string add_class_to_drawer_children;
void addHoverHandlerTo(Gtk::Widget& widget);
bool handleMouseEnter(GdkEventCrossing *const &ev) override;
bool handleMouseLeave(GdkEventCrossing *const &ev) override;
bool handleToggle(GdkEventButton *const &ev) override;
void show_group();
void hide_group();
};
} // namespace waybar

View File

@ -32,7 +32,7 @@ class Battery : public ALabel {
void refreshBatteries();
void worker();
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);
void setBarClass(std::string&);

View File

@ -49,6 +49,9 @@ class Bluetooth : public ALabel {
auto update() -> void override;
private:
static auto onObjectAdded(GDBusObjectManager*, GDBusObject*, gpointer) -> void;
static auto onObjectRemoved(GDBusObjectManager*, GDBusObject*, gpointer) -> void;
static auto onInterfaceAddedOrRemoved(GDBusObjectManager*, GDBusObject*, GDBusInterface*,
gpointer) -> void;
static auto onInterfaceProxyPropertiesChanged(GDBusObjectManagerClient*, GDBusObjectProxy*,

View File

@ -39,6 +39,7 @@ class Cava final : public ALabel {
std::chrono::seconds suspend_silence_delay_{0};
bool silence_{false};
bool hide_on_silence_{false};
std::string format_silent_{""};
int sleep_counter_{0};
// Cava method
void pause_resume();

View File

@ -21,10 +21,12 @@ class Clock final : public ALabel {
auto doAction(const std::string&) -> void override;
private:
const std::locale locale_;
const std::locale m_locale_;
// tooltip
const std::string tlpFmt_;
std::string tlpText_{""}; // tooltip text to print
const std::string m_tlpFmt_;
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
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)
std::string cldText_{""}; // calendar text to print
CldMode cldMode_{CldMode::MONTH};
auto get_calendar(const year_month_day& today, const year_month_day& ymd, const time_zone* tz)
-> const std::string;
auto get_calendar(const year_month_day& today, const year_month_day& ymd,
const time_zone* tz) -> const std::string;
// get local time zone
auto local_zone() -> const time_zone*;
// time zoned time in tooltip
const bool tzInTooltip_; // if need to print time zones text
@ -70,6 +75,7 @@ class Clock final : public ALabel {
void cldModeSwitch();
void cldShift_up();
void cldShift_down();
void cldShift_reset();
void tz_up();
void tz_down();
// Module Action Map
@ -77,6 +83,7 @@ class Clock final : public ALabel {
{"mode", &waybar::modules::Clock::cldModeSwitch},
{"shift_up", &waybar::modules::Clock::cldShift_up},
{"shift_down", &waybar::modules::Clock::cldShift_down},
{"shift_reset", &waybar::modules::Clock::cldShift_reset},
{"tz_up", &waybar::modules::Clock::tz_up},
{"tz_down", &waybar::modules::Clock::tz_down}};
};

View File

@ -35,6 +35,7 @@ class Custom : public ALabel {
std::string id_;
std::string alt_;
std::string tooltip_;
const bool tooltip_format_enabled_;
std::vector<std::string> class_;
int percentage_;
FILE* fp_;

View File

@ -14,7 +14,7 @@ namespace waybar::modules::dwl {
class Window : public AAppIconLabel, public sigc::trackable {
public:
Window(const std::string &, const waybar::Bar &, const Json::Value &);
virtual ~Window() = default;
~Window();
void handle_layout(const uint32_t layout);
void handle_title(const char *title);

View File

@ -1,5 +1,6 @@
#pragma once
#include <filesystem>
#include <list>
#include <memory>
#include <mutex>
@ -25,6 +26,10 @@ class IPC {
static std::string getSocket1Reply(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:
void startIPC();

View File

@ -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

View File

@ -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

View File

@ -4,19 +4,18 @@
#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 "modules/hyprland/workspace.hpp"
#include "util/enum.hpp"
#include "util/regex_collection.hpp"
@ -26,97 +25,6 @@ namespace waybar::modules::hyprland {
class Workspaces;
class WindowCreationPayload {
public:
WindowCreationPayload(std::string workspace_name, WindowAddress window_address,
std::string window_repr);
WindowCreationPayload(std::string workspace_name, WindowAddress window_address,
std::string window_class, std::string window_title);
WindowCreationPayload(Json::Value const& client_data);
int incrementTimeSpentUncreated();
bool isEmpty(Workspaces& workspace_manager);
bool reprIsReady() const { return std::holds_alternative<Repr>(m_window); }
std::string repr(Workspaces& workspace_manager);
std::string getWorkspaceName() const { return m_workspaceName; }
WindowAddress getAddress() const { return m_windowAddress; }
void moveToWorksace(std::string& new_workspace_name);
private:
void clearAddr();
void clearWorkspaceName();
using Repr = std::string;
using ClassAndTitle = std::pair<std::string, std::string>;
std::variant<Repr, ClassAndTitle> m_window;
WindowAddress m_windowAddress;
std::string m_workspaceName;
int m_timeSpentUncreated = 0;
};
class Workspace {
public:
explicit Workspace(const Json::Value& workspace_data, Workspaces& workspace_manager,
const Json::Value& clients_data = Json::Value::nullRef);
std::string& selectIcon(std::map<std::string, std::string>& icons_map);
Gtk::Button& button() { return m_button; };
int id() const { return m_id; };
std::string name() const { return m_name; };
std::string output() const { return m_output; };
bool isActive() const { return m_isActive; };
bool isSpecial() const { return m_isSpecial; };
bool isPersistent() const { return m_isPersistentRule || m_isPersistentConfig; };
bool isPersistentConfig() const { return m_isPersistentConfig; };
bool isPersistentRule() const { return m_isPersistentRule; };
bool isVisible() const { return m_isVisible; };
bool isEmpty() const { return m_windows == 0; };
bool isUrgent() const { return m_isUrgent; };
bool handleClicked(GdkEventButton* bt) const;
void setActive(bool value = true) { m_isActive = value; };
void setPersistentRule(bool value = true) { m_isPersistentRule = value; };
void setPersistentConfig(bool value = true) { m_isPersistentConfig = value; };
void setUrgent(bool value = true) { m_isUrgent = value; };
void setVisible(bool value = true) { m_isVisible = value; };
void setWindows(uint value) { m_windows = value; };
void setName(std::string const& value) { m_name = value; };
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 {
public:
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 showSpecial() const -> bool { return m_showSpecial; }
auto activeOnly() const -> bool { return m_activeOnly; }
auto specialVisibleOnly() const -> bool { return m_specialVisibleOnly; }
auto moveToMonitor() const -> bool { return m_moveToMonitor; }
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 updateWindowCount();
void sortWorkspaces();
void createWorkspace(Json::Value const& workspaceData,
Json::Value const& clientsData = Json::Value::nullRef);
void createWorkspace(Json::Value const& workspace_data,
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 setUrgentWorkspace(std::string const& windowaddress);
// 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();
// workspace events
@ -171,7 +93,13 @@ class Workspaces : public AModule, public EventHandler {
int windowRewritePriorityFunction(std::string const& window_rule);
// Update methods
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 registerOrphanWindow(WindowCreationPayload create_window_payload);
@ -184,6 +112,7 @@ class Workspaces : public AModule, public EventHandler {
bool m_allOutputs = false;
bool m_showSpecial = false;
bool m_activeOnly = false;
bool m_specialVisibleOnly = false;
bool m_moveToMonitor = false;
Json::Value m_persistentWorkspaceConfig;

View File

@ -41,6 +41,7 @@ class MPD : public ALabel {
private:
std::string getTag(mpd_tag_type type, unsigned idx = 0) const;
Glib::ustring getArtistTitleOrFilename() const;
std::string getFilename() const;
void setLabel();
std::string getStateIcon() const;

View File

@ -40,6 +40,7 @@ class Network : public ALabel {
void parseEssid(struct nlattr**);
void parseSignal(struct nlattr**);
void parseFreq(struct nlattr**);
void parseBssid(struct nlattr**);
bool associatedOrJoined(struct nlattr**);
bool checkInterface(std::string name);
auto getInfo() -> void;
@ -69,6 +70,7 @@ class Network : public ALabel {
std::string state_;
std::string essid_;
std::string bssid_;
bool carrier_;
std::string ifname_;
std::string ipaddr_;

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -10,6 +10,8 @@ namespace waybar::modules {
struct Profile {
std::string name;
std::string driver;
Profile(std::string n, std::string d) : name(std::move(n)), driver(std::move(d)) {}
};
class PowerProfilesDaemon : public ALabel {

View File

@ -1,10 +1,7 @@
#pragma once
#include <iostream>
#include <map>
#include <string>
#include "ALabel.hpp"
#include "gtkmm/box.h"
#include "modules/privacy/privacy_item.hpp"
#include "util/pipewire/pipewire_backend.hpp"

View File

@ -2,9 +2,6 @@
#include <json/value.h>
#include <iostream>
#include <map>
#include <mutex>
#include <string>
#include "gtkmm/box.h"

View File

@ -76,6 +76,8 @@ class Item : public sigc::trackable {
void makeMenu();
bool handleClick(GdkEventButton* const& /*ev*/);
bool handleScroll(GdkEventScroll* const&);
bool handleMouseEnter(GdkEventCrossing* const&);
bool handleMouseLeave(GdkEventCrossing* const&);
// smooth scrolling threshold
gdouble scroll_threshold_ = 0;

View File

@ -19,7 +19,7 @@ namespace waybar::modules::sway {
class Workspaces : public AModule, public sigc::trackable {
public:
Workspaces(const std::string&, const waybar::Bar&, const Json::Value&);
virtual ~Workspaces() = default;
~Workspaces() override = default;
auto update() -> void override;
private:
@ -38,10 +38,10 @@ class Workspaces : public AModule, public sigc::trackable {
Gtk::Button& addButton(const Json::Value&);
void onButtonReady(const Json::Value&, Gtk::Button&);
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;
std::string trimWorkspaceName(std::string);
bool handleScroll(GdkEventScroll*) override;
static std::string trimWorkspaceName(std::string);
bool handleScroll(GdkEventScroll* /*unused*/) override;
const Bar& bar_;
std::vector<Json::Value> workspaces_;

View File

@ -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 &parameters);
// 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

View File

@ -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

View File

@ -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

View File

@ -24,6 +24,10 @@
namespace waybar::modules::wlr {
struct widget_geometry {
int x, y, w, h;
};
class Taskbar;
class Task {
@ -42,6 +46,7 @@ class Task {
};
// made public so TaskBar can reorder based on configuration.
Gtk::Button button;
struct widget_geometry minimize_hint;
private:
static uint32_t global_id;
@ -82,6 +87,8 @@ class Task {
private:
std::string repr() 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);
bool image_load_icon(Gtk::Image &image, const Glib::RefPtr<Gtk::IconTheme> &icon_theme,
Glib::RefPtr<Gio::DesktopAppInfo> app_info, int size);

View File

@ -56,10 +56,10 @@ class BacklightBackend {
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);
int get_scaled_brightness(std::string preferred_device);
void set_scaled_brightness(const std::string &preferred_device, int brightness);
int get_scaled_brightness(const std::string &preferred_device);
bool is_login_proxy_initialized() const { return static_cast<bool>(login_proxy_); }
@ -70,7 +70,7 @@ class BacklightBackend {
std::mutex udev_thread_mutex_;
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::chrono::milliseconds polling_interval_;

View File

@ -622,8 +622,8 @@ inline auto convertInto(std::string const &source, bool &target) -> ParserResult
}
#ifdef CLARA_CONFIG_OPTIONAL_TYPE
template <typename T>
inline auto convertInto(std::string const &source, CLARA_CONFIG_OPTIONAL_TYPE<T> &target)
-> ParserResult {
inline auto convertInto(std::string const &source,
CLARA_CONFIG_OPTIONAL_TYPE<T> &target) -> ParserResult {
T temp;
auto result = convertInto(source, temp);
if (result) target = std::move(temp);
@ -751,8 +751,8 @@ class ParserBase {
public:
virtual ~ParserBase() = default;
virtual auto validate() const -> Result { return Result::ok(); }
virtual auto parse(std::string const &exeName, TokenStream const &tokens) const
-> InternalParseResult = 0;
virtual auto parse(std::string const &exeName,
TokenStream const &tokens) const -> InternalParseResult = 0;
virtual auto cardinality() const -> size_t { return 1; }
auto parse(Args const &args) const -> InternalParseResult {
@ -1098,8 +1098,8 @@ struct Parser : ParserBase {
using ParserBase::parse;
auto parse(std::string const &exeName, TokenStream const &tokens) const
-> InternalParseResult override {
auto parse(std::string const &exeName,
TokenStream const &tokens) const -> InternalParseResult override {
struct ParserInfo {
ParserBase const *parser = nullptr;
size_t count = 0;

View File

@ -64,7 +64,7 @@ struct fmt::formatter<date::zoned_time<Duration, TimeZonePtr>> {
}
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()) {
const auto loc = ctx.locale().template get<std::locale>();
return fmt::format_to(ctx.out(), "{}", date::format(loc, fmt::to_string(specs), ztime));

View File

@ -6,7 +6,7 @@
class pow_format {
public:
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_;
std::string unit_;
@ -45,7 +45,7 @@ struct formatter<pow_format> {
}
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};
auto base = s.binary_ ? 1024ull : 1000ll;
@ -92,7 +92,7 @@ struct formatter<pow_format> {
template <>
struct formatter<Glib::ustring> : formatter<std::string> {
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);
}
};

View File

@ -2,6 +2,8 @@
#include <pipewire/pipewire.h>
#include <unordered_map>
#include "util/backend_common.hpp"
#include "util/pipewire/privacy_node_info.hpp"
@ -13,7 +15,8 @@ class PipewireBackend {
pw_context* context_;
pw_core* core_;
spa_hook registry_listener;
pw_registry* registry_;
spa_hook registryListener_;
/* Hack to keep constructor inaccessible but still public.
* 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
* a problem with C++20's copy and move semantics.
*/
struct private_constructor_tag {};
struct PrivateConstructorTag {};
public:
std::mutex mutex_;
pw_registry* registry;
sigc::signal<void> privacy_nodes_changed_signal_event;
std::unordered_map<uint32_t, PrivacyNodeInfo*> privacy_nodes;
std::mutex mutex_;
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();
};
} // namespace waybar::util::PipewireBackend

View File

@ -34,29 +34,12 @@ class PrivacyNodeInfo {
void *data;
std::string get_name() {
const std::vector<std::string *> names{&application_name, &node_name};
std::string name = "Unknown Application";
for (auto &name_ : names) {
if (name_ != nullptr && name_->length() > 0) {
name = *name_;
name[0] = toupper(name[0]);
break;
}
}
return name;
}
std::string getName();
std::string getIconName();
std::string get_icon_name() {
const std::vector<std::string *> names{&application_icon_name, &pipewire_access_portal_app_id,
&application_name, &node_name};
const std::string name = "application-x-executable-symbolic";
for (auto &name_ : names) {
if (name_ != nullptr && name_->length() > 0 && DefaultGtkIconThemeWrapper::has_icon(*name_)) {
return *name_;
}
}
return name;
}
// Handlers for PipeWire events
void handleProxyEventDestroy();
void handleNodeEventInfo(const struct pw_node_info *info);
};
} // namespace waybar::util::PipewireBackend

View File

@ -5,6 +5,7 @@
#include <functional>
#include <regex>
#include <string>
#include <utility>
namespace waybar::util {
@ -17,7 +18,7 @@ struct Rule {
// See https://en.cppreference.com/w/cpp/compiler_support/20 "Parenthesized initialization of
// aggregates"
Rule(std::regex rule, std::string repr, int priority)
: rule(rule), repr(repr), priority(priority) {}
: rule(std::move(rule)), repr(std::move(repr)), priority(priority) {}
};
int default_priority_function(std::string& key);
@ -36,12 +37,13 @@ class RegexCollection {
std::map<std::string, std::string> regex_cache;
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:
RegexCollection() = default;
RegexCollection(const Json::Value& map, std::string default_repr = "",
std::function<int(std::string&)> priority_function = default_priority_function);
RegexCollection(
const Json::Value& map, std::string default_repr = "",
const std::function<int(std::string&)>& priority_function = default_priority_function);
~RegexCollection() = default;
std::string& get(std::string& value, bool& matched_any);

View File

@ -38,7 +38,7 @@ The *backlight* module displays the current backlight level.
*rotate*: ++
typeof: integer ++
Positive value to rotate the text label.
Positive value to rotate the text label (in 90 degree increments).
*states*: ++
typeof: object ++
@ -81,6 +81,19 @@ The *backlight* module displays the current backlight level.
default: 1.0 ++
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:
```

View File

@ -69,7 +69,7 @@ The *battery* module displays the current capacity and state (eg. charging) of y
*rotate*: ++
typeof: integer++
Positive value to rotate the text label.
Positive value to rotate the text label (in 90 degree increments).
*on-click*: ++
typeof: string ++
@ -109,6 +109,19 @@ The *battery* module displays the current capacity and state (eg. charging) of y
default: false ++
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
*{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.
*{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
The *battery* module allows you to define how time should be formatted via *format-time*.

View File

@ -54,7 +54,7 @@ Addressed by *bluetooth*
*rotate*: ++
typeof: integer ++
Positive value to rotate the text label.
Positive value to rotate the text label (in 90 degree increments).
*max-length*: ++
typeof: integer ++
@ -129,6 +129,19 @@ Addressed by *bluetooth*
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.
*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
*{status}*: Status of the bluetooth device.

View File

@ -64,6 +64,10 @@ libcava lives in:
:[ bool
:[ false
:[ 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*
:[ string
:[ pulse
@ -120,6 +124,18 @@ libcava lives in:
:[ string
:[ /dev/stdout
:[ 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:
- 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

View File

@ -51,7 +51,7 @@ $XDG_CONFIG_HOME/waybar/config ++
|[ *rotate*
:[ integer
:[
:[ Positive value to rotate the text label
:[ Positive value to rotate the text label (in 90 degree increments)
|[ *on-click*
:[ string
:[
@ -84,6 +84,18 @@ $XDG_CONFIG_HOME/waybar/config ++
:[ string
:[ same as format
:[ 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 File

@ -43,7 +43,7 @@ The *cpu* module displays the current CPU utilization.
*rotate*: ++
typeof: integer ++
Positive value to rotate the text label.
Positive value to rotate the text label (in 90 degree increments).
*states*: ++
typeof: object ++

View File

@ -21,6 +21,10 @@ Addressed by *custom/<name>*
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.
*hide-empty-text*: ++
typeof: bool ++
Disables the module when output is empty, but format might contain additional static content.
*exec-on-event*: ++
typeof: bool ++
default: true ++
@ -51,8 +55,8 @@ Addressed by *custom/<name>*
*format*: ++
typeof: string ++
default: {} ++
The format, how information should be displayed. On {} data gets inserted.
default: {text} ++
The format, how information should be displayed. On {text} data gets inserted.
*format-icons*: ++
typeof: array ++
@ -60,7 +64,7 @@ Addressed by *custom/<name>*
*rotate*: ++
typeof: integer ++
Positive value to rotate the text label.
Positive value to rotate the text label (in 90 degree increments).
*max-length*: ++
typeof: integer ++
@ -121,6 +125,19 @@ Addressed by *custom/<name>*
default: false ++
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
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
*{}*: Output of the script.
*{text}*: Output of the script.
*{percentage}* Percentage which can be set via a json return type.
@ -155,7 +172,7 @@ $text\\n$tooltip\\n$class*
```
"custom/spotify": {
"format": " {}",
"format": " {text}",
"max-length": 40,
"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
@ -168,7 +185,7 @@ $text\\n$tooltip\\n$class*
```
"custom/mpd": {
"format": "♪ {}",
"format": "♪ {text}",
//"max-length": 15,
"interval": 10,
"exec": "mpc current",
@ -182,7 +199,7 @@ $text\\n$tooltip\\n$class*
```
"custom/cmus": {
"format": "♪ {}",
"format": "♪ {text}",
//"max-length": 15,
"interval": 10,
"exec": "cmus-remote -C \"format_print '%a - %t'\"", // artist - title
@ -197,7 +214,7 @@ $text\\n$tooltip\\n$class*
```
"custom/pacman": {
"format": "{} ",
"format": "{text} ",
"interval": "once",
"exec": "pacman_packages",
"on-click": "update-system",
@ -209,7 +226,7 @@ $text\\n$tooltip\\n$class*
```
"custom/pacman": {
"format": "{} ",
"format": "{text} ",
"interval": 3600, // every hour
"exec": "checkupdates | wc -l", // # of updates
"exec-if": "exit 0", // always run; consider advanced run conditions

View File

@ -29,7 +29,7 @@ Addressed by *disk*
*rotate*: ++
typeof: integer ++
Positive value to rotate the text label.
Positive value to rotate the text label (in 90 degree increments).
*states*: ++
typeof: object ++
@ -93,6 +93,19 @@ Addressed by *disk*
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.
*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
*{percentage_used}*: Percentage of disk in use.

View File

@ -19,7 +19,7 @@ Addressed by *dwl/window*
*rotate*: ++
typeof: integer ++
Positive value to rotate the text label.
Positive value to rotate the text label (in 90 degree increments).
*max-length*: ++
typeof: integer ++

View File

@ -25,6 +25,19 @@ Addressed by *hyprland/language*
typeof: string ++
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

View File

@ -19,7 +19,7 @@ Addressed by *hyprland/submap*
*rotate*: ++
typeof: integer ++
Positive value to rotate the text label.
Positive value to rotate the text label (in 90 degree increments).
*max-length*: ++
typeof: integer ++
@ -80,6 +80,19 @@ Addressed by *hyprland/submap*
default: Default ++
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

View File

@ -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.
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.
You may assign an empty value to a rule to have it ignored from generating any representation in workspaces.
*window-rewrite-default*:
typeof: string ++
@ -42,6 +43,11 @@ Addressed by *hyprland/workspaces*
default: false ++
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*: ++
typeof: bool ++
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.
"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": "󰨞",
"title<.* - (.*) - VSCodium>": "codium $1" // captures part of the window title and formats it into output
}
}
```

View File

@ -21,7 +21,7 @@ screensaver, also known as "presentation mode".
*rotate*: ++
typeof: integer ++
Positive value to rotate the text label.
Positive value to rotate the text label (in 90 degree increments).
*max-length*: ++
typeof: integer ++
@ -89,6 +89,19 @@ screensaver, also known as "presentation mode".
typeof: string ++
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
*{status}*: status (*activated* or *deactivated*)

View File

@ -25,7 +25,7 @@ See *systemd-inhibit*(1) for more information.
*rotate*: ++
typeof: integer ++
Positive value to rotate the text label.
Positive value to rotate the text label (in 90 degree increments).
*max-length*: ++
typeof: integer ++
@ -76,6 +76,19 @@ See *systemd-inhibit*(1) for more information.
default: true ++
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
*{status}*: status (*activated* or *deactivated*)

View File

@ -51,7 +51,7 @@ Addressed by *jack*
*rotate*: ++
typeof: integer ++
Positive value to rotate the text label.
Positive value to rotate the text label (in 90 degree increments).
*max-length*: ++
typeof: integer ++
@ -85,6 +85,19 @@ Addressed by *jack*
typeof: string ++
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
*{load}*: The current CPU load estimated by JACK.

View File

@ -29,7 +29,7 @@ Addressed by *memory*
*rotate*: ++
typeof: integer ++
Positive value to rotate the text label.
Positive value to rotate the text label (in 90 degree increments).
*states*: ++
typeof: object ++
@ -84,6 +84,19 @@ Addressed by *memory*
default: true ++
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
*{percentage}*: Percentage of memory in use.

153
man/waybar-menu.5.scd Normal file
View File

@ -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;
}
```

View File

@ -91,7 +91,7 @@ Addressed by *mpd*
*rotate*: ++
typeof: integer ++
Positive value to rotate the text label.
Positive value to rotate the text label (in 90 degree increments).
*max-length*: ++
typeof: integer ++
@ -162,6 +162,19 @@ Addressed by *mpd*
default: {} ++
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
## WHEN PLAYING/PAUSED

View File

@ -107,7 +107,7 @@ The *mpris* module displays currently playing media via libplayerctl.
*rotate*: ++
typeof: integer ++
Positive value to rotate the text label.
Positive value to rotate the text label (in 90 degree increments).
*max-length*: ++
typeof: integer ++
@ -142,11 +142,11 @@ The *mpris* module displays currently playing media via libplayerctl.
*player-icons*: ++
typeof: map[string]string ++
Allows setting _{player-icon}_ based on player-name property.
Allows setting _{player_icon}_ based on player-name property.
*status-icons*: ++
typeof: map[string]string ++
Allows setting _{status-icon}_ based on player status (playing, paused, stopped).
Allows setting _{status_icon}_ based on player status (playing, paused, stopped).
# FORMAT REPLACEMENTS

View File

@ -58,7 +58,7 @@ Addressed by *network*
*rotate*: ++
typeof: integer ++
Positive value to rotate the text label.
Positive value to rotate the text label (in 90 degree increments).
*max-length*: ++
typeof: integer ++
@ -129,6 +129,19 @@ Addressed by *network*
typeof: string ++
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
*{ifname}*: Name of the network interface.
@ -143,6 +156,8 @@ Addressed by *network*
*{essid}*: Name (SSID) of the wireless network.
*{bssid}*: MAC address (BSSID) of the wireless access point.
*{signalStrength}*: Signal strength of the wireless network.
*{signaldBm}*: Signal strength of the wireless network in dBm.

View File

@ -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*

View File

@ -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

View File

@ -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.

View File

@ -31,7 +31,7 @@ The volume can be controlled by dragging the slider across the bar or clicking o
```
"modules-right": [
"pulseaudio-slider",
"pulseaudio/slider",
],
"pulseaudio/slider": {
"min": 0,

View File

@ -40,7 +40,7 @@ Additionally, you can control the volume by scrolling *up* or *down* while the c
*rotate*: ++
typeof: integer ++
Positive value to rotate the text label.
Positive value to rotate the text label (in 90 degree increments).
*states*: ++
typeof: object ++
@ -113,6 +113,19 @@ Additionally, you can control the volume by scrolling *up* or *down* while the c
typeof: array ++
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
*{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*
- *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
@ -152,10 +167,12 @@ If they are found in the current PulseAudio port name, the corresponding icons w
"format-muted": "",
"format-icons": {
"alsa_output.pci-0000_00_1f.3.analog-stereo": "",
"alsa_output.pci-0000_00_1f.3.analog-stereo-muted": "",
"headphones": "",
"handsfree": "",
"headset": "",
"phone": "",
"phone-muted": "",
"portable": "",
"car": "",
"default": ["", ""]

View File

@ -21,7 +21,7 @@ Addressed by *river/layout*
*rotate*: ++
typeof: integer ++
Positive value to rotate the text label.
Positive value to rotate the text label (in 90 degree increments).
*max-length*: ++
typeof: integer ++
@ -51,6 +51,19 @@ Addressed by *river/layout*
typeof: string ++
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
```

View File

@ -19,7 +19,7 @@ Addressed by *river/mode*
*rotate*: ++
typeof: integer ++
Positive value to rotate the text label.
Positive value to rotate the text label (in 90 degree increments).
*max-length*: ++
typeof: integer ++
@ -65,6 +65,19 @@ Addressed by *river/mode*
typeof: double ++
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
```

View File

@ -19,7 +19,7 @@ Addressed by *river/window*
*rotate*: ++
typeof: integer ++
Positive value to rotate the text label.
Positive value to rotate the text label (in 90 degree increments).
*max-length*: ++
typeof: integer ++
@ -49,6 +49,19 @@ Addressed by *river/window*
typeof: string ++
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
```

View File

@ -20,7 +20,7 @@ cursor is over the module, and clicking on the module toggles mute.
*rotate*: ++
typeof: integer ++
Positive value to rotate the text label.
Positive value to rotate the text label (in 90 degree increments).
*max-length*: ++
typeof: integer ++
@ -74,6 +74,19 @@ cursor is over the module, and clicking on the module toggles mute.
typeof: double ++
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
*{volume}*: Volume in percentage.

View File

@ -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)*

View File

@ -32,6 +32,19 @@ Addressed by *sway/language*
default: true ++
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
*{short}*: Short name of layout (e.g. "us"). Equals to {}.

View File

@ -19,7 +19,7 @@ Addressed by *sway/mode*
*rotate*: ++
typeof: integer ++
Positive value to rotate the text label.
Positive value to rotate the text label (in 90 degree increments).
*max-length*: ++
typeof: integer ++
@ -70,6 +70,19 @@ Addressed by *sway/mode*
default: true ++
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
```

View File

@ -36,6 +36,19 @@ Addressed by *sway/scratchpad*
default: {app}: {title} ++
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
*{icon}*: Icon, as defined in *format-icons*.

View File

@ -19,7 +19,7 @@ Addressed by *sway/window*
*rotate*: ++
typeof: integer ++
Positive value to rotate the text label.
Positive value to rotate the text label (in 90 degree increments).
*max-length*: ++
typeof: integer ++

View File

@ -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.
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.
You may assign an empty value to a rule to have it ignored from generating any representation in workspaces.
*window-rewrite-default*:
typeof: string ++
@ -171,6 +172,7 @@ n.b.: the list of outputs can be obtained from command line using *swaymsg -t ge
"window-rewrite": {
"class<firefox>": "",
"class<kitty>": "k",
"title<.* - (.*) - VSCodium>": "codium $1" // captures part of the window title and formats it into output
}
}
```

View File

@ -36,6 +36,19 @@ Addressed by *systemd-failed-units*
default: *true* ++
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
*{nr_failed_system}*: Number of failed units from systemwide (PID=1) systemd.

View File

@ -25,6 +25,7 @@ Addressed by *temperature*
*hwmon-path-abs*: ++
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*.
This can also be an array of strings, for which, it just works like *hwmon-path*.
*input-filename*: ++
typeof: string ++
@ -59,7 +60,7 @@ Addressed by *temperature*
*rotate*: ++
typeof: integer ++
Positive value to rotate the text label.
Positive value to rotate the text label (in 90 degree increments).
*max-length*: ++
typeof: integer ++
@ -110,6 +111,19 @@ Addressed by *temperature*
default: true ++
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
*{temperatureC}*: Temperature in Celsius.

View File

@ -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 ++
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*: ++
typeof: integer ++
default: 20 ++
@ -62,6 +68,19 @@ compatible devices in the tooltip.
default: true ++
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
*{percentage}*: The battery capacity in percentage

View File

@ -31,7 +31,7 @@ The *wireplumber* module displays the current volume reported by WirePlumber.
*rotate*: ++
typeof: integer ++
Positive value to rotate the text label.
Positive value to rotate the text label (in 90 degree increments).
*states*: ++
typeof: object ++
@ -87,6 +87,19 @@ The *wireplumber* module displays the current volume reported by WirePlumber.
default: 100 ++
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
*{volume}*: Volume in percentage.

View File

@ -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
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
*layer* ++
@ -276,6 +278,11 @@ A group may hide all but one element, showing them only on mouse hover. In order
default: "hidden" ++
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*: ++
typeof: bool ++
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-window(5)*
- *waybar-hyprland-workspaces(5)*
- *waybar-niri-language(5)*
- *waybar-niri-window(5)*
- *waybar-niri-workspaces(5)*
- *waybar-idle-inhibitor(5)*
- *waybar-image(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
*sway-output(5)*
*waybar-styles(5)"

View File

@ -1,6 +1,6 @@
project(
'waybar', 'cpp', 'c',
version: '0.10.0',
version: '0.11.0',
license: 'MIT',
meson_version: '>= 0.59.0',
default_options : [
@ -69,7 +69,7 @@ is_openbsd = host_machine.system() == 'openbsd'
thread_dep = dependency('threads')
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_cursor = dependency('wayland-cursor')
wayland_protos = dependency('wayland-protocols')
@ -106,7 +106,7 @@ if libsndio.found()
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'],
fallback: ['gtk-layer-shell', 'gtk_layer_shell'])
systemd = dependency('systemd', required: get_option('systemd'))
@ -192,6 +192,7 @@ man_files = files(
'man/waybar-idle-inhibitor.5.scd',
'man/waybar-image.5.scd',
'man/waybar-states.5.scd',
'man/waybar-menu.5.scd',
'man/waybar-temperature.5.scd',
)
@ -305,7 +306,9 @@ if true
'src/modules/hyprland/language.cpp',
'src/modules/hyprland/submap.cpp',
'src/modules/hyprland/window.cpp',
'src/modules/hyprland/workspace.cpp',
'src/modules/hyprland/workspaces.cpp',
'src/modules/hyprland/windowcreationpayload.cpp',
)
man_files += files(
'man/waybar-hyprland-language.5.scd',
@ -315,6 +318,21 @@ if true
)
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()
add_project_arguments('-DHAVE_LIBNL', language: 'cpp')
src_files += files('src/modules/network.cpp')
@ -335,10 +353,7 @@ endif
if (upower_glib.found() and not get_option('logind').disabled())
add_project_arguments('-DHAVE_UPOWER', language: 'cpp')
src_files += files(
'src/modules/upower/upower.cpp',
'src/modules/upower/upower_tooltip.cpp',
)
src_files += files('src/modules/upower.cpp')
man_files += files('man/waybar-upower.5.scd')
endif
@ -348,7 +363,8 @@ if pipewire.found()
src_files += files(
'src/modules/privacy/privacy.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')
endif
@ -466,7 +482,7 @@ if get_option('experimental')
endif
cava = dependency('cava',
version : '>=0.10.1',
version : '>=0.10.3',
required: get_option('cava'),
fallback : ['cava', 'cava_dep'],
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')
mandir = get_option('mandir')
foreach file : man_files

View File

@ -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('wireplumber', type: 'feature', value: 'auto', description: 'Enable support for WirePlumber')
option('cava', type: 'feature', value: 'auto', description: 'Enable support for Cava')
option('niri', type: 'boolean', description: 'Enable support for niri')

View File

@ -5,12 +5,12 @@
}:
let
libcava = rec {
version = "0.10.1";
version = "0.10.3";
src = pkgs.fetchFromGitHub {
owner = "LukashonakV";
repo = "cava";
rev = version;
hash = "sha256-iIYKvpOWafPJB5XhDOSIW9Mb4I3A4pcgIIPQdQYEqUw=";
hash = "sha256-ZDFbI69ECsUTjbhlw2kHRufZbQMu+FQSMmncCJ5pagg=";
};
};
in
@ -25,6 +25,9 @@ in
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) ++ [
pkgs.wireplumber
];

View File

@ -30,7 +30,8 @@
"battery",
"battery#bat2",
"clock",
"tray"
"tray",
"custom/power"
],
// Modules configuration
// "sway/workspaces": {
@ -188,7 +189,7 @@
"on-click": "pavucontrol"
},
"custom/media": {
"format": "{icon} {}",
"format": "{icon} {text}",
"return-type": "json",
"max-length": 40,
"format-icons": {
@ -198,5 +199,17 @@
"escape": true,
"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
},
"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"
}
}
}

View File

@ -113,6 +113,7 @@ class PlayerManager:
player_name = player.props.player_name
artist = player.get_artist()
title = player.get_title()
title = title.replace("&", "&amp;")
track_info = ""
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):
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):
self.init_player(player)
else:

View File

@ -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