Compare commits

...

866 Commits

Author SHA1 Message Date
Alexis Rouillard
2f94435014 Merge pull request #4789 from xander1421/fix/json-type-check-crash
fix(json): use local CharReaderBuilder for thread safety
2026-01-25 21:59:41 +01:00
xander1421
1639dec7d8 fix(json): use local CharReaderBuilder for thread safety 2026-01-24 23:40:07 +02:00
Alexis Rouillard
b4854f96a3 Merge pull request #4766 from zjeffer/fix/zjeffer/persistent-special-workspaces
hyprland/workspaces: don't show persistent special workspaces if show-special is disabled
2026-01-14 18:27:30 +01:00
zjeffer
8f5fc990a5 hyprland/workspaces: don't show persistent special workspaces if show-special is disabled 2026-01-10 13:29:40 +01:00
Alexis Rouillard
a02180a815 Merge pull request #4739 from LorenzBischof/man-reverse-mouse-scrolling
docs: add missing reverse-mouse-scrolling to pulseaudio module man page
2026-01-09 20:02:15 +01:00
Alexis Rouillard
af7eebba5e Merge pull request #4745 from cartok/docs/arch-update-readme
docs(arch): install build deps as deps to keep system clean
2026-01-09 20:01:17 +01:00
Alexis Rouillard
479ea9f3e8 Merge pull request #4746 from cartok/chore/maintainance
chore: update .gitingore
2026-01-09 20:01:02 +01:00
Alexis Rouillard
f990486a40 Merge pull request #4748 from Alexays/update_flake_lock_action
flake.lock: Update
2026-01-09 20:00:50 +01:00
github-actions[bot]
d0f5fab52b flake.lock: Update
Flake lock file updates:

• Updated input 'flake-compat':
    'github:edolstra/flake-compat/f387cd2afec9419c8ee37694406ca490c3f34ee5?narHash=sha256-XKUZz9zewJNUj46b4AJdiRZJAvSZ0Dqj2BNfXvFlJC4%3D' (2025-10-27)
  → 'github:edolstra/flake-compat/5edf11c44bc78a0d334f6334cdaf7d60d732daab?narHash=sha256-vNpUSpF5Nuw8xvDLj2KCwwksIbjua2LZCqhV1LNRDns%3D' (2025-12-29)
• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/2fad6eac6077f03fe109c4d4eb171cf96791faa4?narHash=sha256-sKoIWfnijJ0%2B9e4wRvIgm/HgE27bzwQxcEmo2J/gNpI%3D' (2025-11-27)
  → 'github:NixOS/nixpkgs/c0b0e0fddf73fd517c3471e546c0df87a42d53f4?narHash=sha256-coBu0ONtFzlwwVBzmjacUQwj3G%2BlybcZ1oeNSQkgC0M%3D' (2025-12-28)
2026-01-01 00:14:44 +00:00
Dennis Weiershaeuser
a05e6c6f74 chore: update .gitingore 2025-12-31 18:18:04 +01:00
Dennis Weiershaeuser
99867005a0 docs(arch): install build deps as deps to keep system clean 2025-12-31 13:43:21 +01:00
LorenzBischof
959f41ca9c docs: add missing reverse-mouse-scrolling to pulseaudio module man page 2025-12-30 12:30:30 +01:00
Alexis Rouillard
06484547d1 Merge pull request #4677 from mliszcz/remove-window-format
fix(sway/workspaces): window-rewrite: do not check for window-format
2025-12-28 23:12:44 +01:00
Alexis Rouillard
46a6f60138 Merge pull request #4728 from xav-ie/fix-cava-config
fix-cava-config
2025-12-28 23:11:05 +01:00
Alexis Rouillard
83a6998fcb Merge pull request #4708 from khaneliman/cava
nix: bump cava again
2025-12-28 21:50:21 +01:00
Alexis Rouillard
386036a67a Merge pull request #4710 from LukashonakV/cavaMan
cava man
2025-12-28 21:50:04 +01:00
Xavier Ruiz
e3186abdce fix(cava): handle all output methods in frontend
Default to raw Cava module for non-GLSL output methods.
Fixes "Unknown module" error when no cava_config is specified.
2025-12-27 14:52:28 -05:00
Viktar Lukashonak
c8c3287be3 cava man 2025-12-20 15:35:20 +03:00
Austin Horstman
601b5f0241 nix: bump cava again
Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
2025-12-18 23:47:01 -06:00
Alexis Rouillard
97eb60677e Merge pull request #4616 from schmop/battery-plugging-instant-updates
2. Try: Make battery module update on plugging/unplugging again (refs #2519)
2025-12-18 19:11:18 +01:00
Alexis Rouillard
3d0b942956 Merge pull request #4689 from ospafford/feat-dwl_tag_state
feat(dwl/tags): add empty tag option
2025-12-18 19:09:39 +01:00
Alexis Rouillard
c3d29b1185 Merge branch 'master' into battery-plugging-instant-updates 2025-12-18 19:04:31 +01:00
Alexis Rouillard
c6844781ea Merge pull request #4671 from touero/dev
Fix example error about update moudle by signal in man page
2025-12-18 19:03:11 +01:00
Alexis Rouillard
c1218fa889 Merge pull request #4646 from gszy/swap-abused
modules: memory: fix fully utilized swap percentage calculation
2025-12-18 19:02:47 +01:00
Alexis Rouillard
11c4e55376 Merge pull request #4591 from rrrnld/fix/multiple-batteries
Improve multiple battery support
2025-12-18 19:02:31 +01:00
Alexis Rouillard
6b05d73a64 Merge pull request #4589 from cebem1nt/master
fix: crash on group scrolling #4510
2025-12-18 19:01:15 +01:00
Alexis Rouillard
374ccbb878 Merge pull request #4705 from rwwiv/fix/duplicate-layers-on-monitor-hotplug
fix: prevent duplicate layer surfaces on monitor hotplug
2025-12-18 19:00:48 +01:00
Alexis Rouillard
d012de3cde Merge pull request #4682 from LukashonakV/cavaGLSL
Cava GLSL
2025-12-18 18:59:27 +01:00
Alexis Rouillard
7ecad3229d Merge pull request #4650 from BartiX259/master
fix(docs): pulseaudio man page example
2025-12-18 18:59:01 +01:00
Alexis Rouillard
278e8822ff Merge pull request #4686 from marvelpokemaster/fix-wireplumber-init-order
fix(wireplumber): reorder initializer list to match header and fix -Wreorder
2025-12-18 18:58:10 +01:00
Alexis Rouillard
a23cef457f Merge pull request #4615 from Alexays/update_flake_lock_action
flake.lock: Update
2025-12-18 18:57:57 +01:00
Will Wernert
a9ef11a2b3 fix: prevent duplicate layer surfaces on monitor hotplug
The monitor signal handlers (signal_monitor_added, signal_monitor_removed)
were never disconnected during SIGUSR2 reload. Each reload accumulated
additional handlers, causing multiple layer surfaces to be created when
monitors were hotplugged.

This fix:
- Stores signal connections as class members
- Disconnects them before reconnecting in bindInterfaces()
- Clears stale outputs_ on reload
2025-12-17 22:17:35 -05:00
Owen Spafford
07cb2c02d2 feat(dwl/tags): add empty tag option
Added option in the `dwl/tags` to theme empty tags (i.e. tags without any clients) in `style.css` using
`#tags button.empty`.

Signed-off-by: ospafford <ospafford@gmail.com>
2025-12-09 07:28:18 -08:00
Viktar Lukashonak
e03119fe94 Factory. cava_frontend 2025-12-09 18:13:45 +03:00
marvelpokemaster
5ee3bd5325 fix(wireplumber): reorder initializer list to match header and fix -Wreorder warnings 2025-12-08 01:44:19 +05:30
Viktar Lukashonak
3773021546 cavaGLSL 2025-12-07 23:08:55 +03:00
Viktar Lukashonak
52f4db1154 Moving GTK dispatcher into frontend 2025-12-05 10:04:52 +03:00
mliszcz
e362550e27 fix(sway/workspaces): window-rewrite: do not check for window-format
Remove check for unused window-format option.

Fixes #3797.
2025-12-02 17:19:44 +01:00
github-actions[bot]
cb0ee665a3 flake.lock: Update
Flake lock file updates:

• Updated input 'flake-compat':
    'github:edolstra/flake-compat/9100a0f413b0c601e0533d1d94ffd501ce2e7885?narHash=sha256-CIVLLkVgvHYbgI2UpXvIIBJ12HWgX%2BfjA8Xf8PUmqCY%3D' (2025-05-12)
  → 'github:edolstra/flake-compat/f387cd2afec9419c8ee37694406ca490c3f34ee5?narHash=sha256-XKUZz9zewJNUj46b4AJdiRZJAvSZ0Dqj2BNfXvFlJC4%3D' (2025-10-27)
• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/5e2a59a5b1a82f89f2c7e598302a9cacebb72a67?narHash=sha256-K5Osef2qexezUfs0alLvZ7nQFTGS9DL2oTVsIXsqLgs%3D' (2025-10-19)
  → 'github:NixOS/nixpkgs/2fad6eac6077f03fe109c4d4eb171cf96791faa4?narHash=sha256-sKoIWfnijJ0%2B9e4wRvIgm/HgE27bzwQxcEmo2J/gNpI%3D' (2025-11-27)
2025-12-01 00:15:02 +00:00
touero
e189649c33 docs(custom): fix example error about update moudle by signal 2025-11-29 17:29:52 +08:00
Viktar Lukashonak
13519ca5bf cava. nonsafe thread.= & cava bump 2025-11-26 13:26:32 +03:00
BartiX259
097c00c7bd fix(docs): pulseaudio man page example
The example configuration in the man page used 'headphones' and 'handsfree' as keys for format-icons. The correct keys are 'headphone' and 'hands-free'.
2025-11-22 20:09:34 +01:00
Grzegorz Szymaszek
73808dfacc modules: memory: fix fully utilized swap percentage calculation
Do calculate used swap percentage even if swapfree is 0, otherwise
reported used_swap_percentage would be 0, even though it should be 100.

Signed-off-by: Grzegorz Szymaszek <gszymaszek@short.pl>
2025-11-18 11:50:04 +01:00
schmop
ce1da5a178 Make udev_deleter not linux-only and fix freebsd build 2025-11-01 10:57:18 +01:00
schmop
4e25871655 Reapply "Make battery module update on plugging/unplugging again (refs #2519)"
This reverts commit bb2c67ebad.
2025-10-31 13:43:36 +01:00
arne
ca62481dc9 fix: default weighted average to true 2025-10-26 06:44:53 +01:00
arne
b701d7f70b docs: add information about weighted-average config option 2025-10-26 06:34:04 +01:00
cebem1nt
68cbb507d9 fixing crash on group scrolling 2025-10-24 21:57:58 -03:00
Alexis Rouillard
161367d961 Merge pull request #4579 from khaneliman/freebsd
fix(clock): fix freebsd compatibility
2025-10-23 09:36:19 +02:00
Alexis Rouillard
a62455e1b9 Merge pull request #4578 from khaneliman/fmt
fix(subprojects): fmt hash mismatch
2025-10-23 09:35:49 +02:00
Alexis Rouillard
588c344c8a Merge pull request #4577 from khaneliman/cava
fix(nix): bump cava and fix nix build
2025-10-23 09:35:39 +02:00
Austin Horstman
bf0ccfd90c fix(clock): fix freebsd compatibility
Recently introduced for ISO 8601 calendar compatibility. But, lib
differences causing the explicit type to break freebsd.

Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
2025-10-21 23:07:04 -05:00
Austin Horstman
8b0a82ad34 fix(subprojects): fmt hash mismatch
Failing ci for multiple runners

Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
2025-10-21 22:56:33 -05:00
Austin Horstman
37ac2daac8 flake.lock: update
Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
2025-10-21 22:08:57 -05:00
Austin Horstman
97682a1332 nix: bump cava
Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
2025-10-21 22:08:57 -05:00
Austin Horstman
4beb7ddac7 nix: remove useless parens
Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
2025-10-19 17:35:07 -05:00
Alexis Rouillard
84ec25bbeb Merge pull request #4551 from LukashonakV/cavaBump
cava bump & fixing memory leaks
2025-10-19 13:38:58 +02:00
Alexis Rouillard
b475399a22 Merge pull request #4541 from aanderse/master
backlight: gracefully handle a null epoll device
2025-10-19 13:38:39 +02:00
Alexis Rouillard
15a503ae21 Merge pull request #4546 from kosa12/fix/fmt-version
fix: FMT version update from 11.0.2 to 12.0.0
2025-10-19 13:38:15 +02:00
Alexis Rouillard
46d3e80bce Merge pull request #4559 from carljustineoyales/chore/update-pulseaudio-slider-module
fix(pulseaudio-slider): Use `background` in CSS example
2025-10-19 13:38:03 +02:00
Alexis Rouillard
9221508e51 Merge pull request #4560 from NicolasBuchin/fix-css-memory-leak
fix: resolve memory leak by removing old CSS provider before reloading CSS styles
2025-10-19 13:37:48 +02:00
NicolasBuchin
9d37dedb57 fix: resolve memory leak by removing old CSS provider before reloading styles 2025-10-16 10:04:12 +02:00
carljustineoyales
6021261383 fix(pulseaudio-slider): Use background in CSS example
The `background-color` property does not work as expected for the slider. Using the `background` shorthand property correctly applies the color.
2025-10-15 20:47:35 +08:00
Viktar Lukashonak
966da11f3b cava bump & fixing memory leaks 2025-10-12 14:53:49 +03:00
Kosa Matyas
7add8b2726 fix: FMT version update from 11.0.2 to 12.0.0 2025-10-10 19:40:43 +03:00
Aaron Andersen
bef35e48fe backlight: gracefully handle a null epoll device 2025-10-09 20:52:51 -04:00
Alex
559079e9a6 fix: lint 2025-10-05 10:56:24 +02:00
Alexis Rouillard
0c41cf47c2 Merge pull request #4359 from zjeffer/fix/zjeffer/thread-sanitizer-warning
Fix Hyprland IPC thread sanitizer warning, other IPC & general fixes
2025-10-05 10:56:02 +02:00
Alexis Rouillard
a16d53b30d Merge branch 'master' into fix/zjeffer/thread-sanitizer-warning 2025-10-05 10:51:47 +02:00
Alex
151cf54532 fix: lint 2025-10-05 09:58:34 +02:00
Alexis Rouillard
b3f1d02b16 Merge pull request #4516 from DreamMaoMao/fix-ext-ws
fix: right and middle button not work in ext/workspace module
2025-10-05 09:57:50 +02:00
Alexis Rouillard
bea012d06d Merge pull request #4518 from DreamMaoMao/fix-network
fix: Correct the error in converting network speed units
2025-10-05 09:57:29 +02:00
Alexis Rouillard
197ee78080 Merge pull request #4525 from lairez/makepkg
Fixes #4521 and #4522
2025-10-05 09:57:06 +02:00
Pierre Lairez
d8e2392410 Fixes #4521 and #4522
The problem is commit 2b552f7 which introduces a minimum interval time
of 1ms. But then, in modules/custom.cpp, the constructor tests if the
interval is nonzero to distinguish continuous workers from delay workers.
2025-10-03 11:24:18 +02:00
DreamMaoMao
801319f024 fix: Correct the error in converting network speed units 2025-10-02 08:55:40 +08:00
DreamMaoMao
6f308d8ea1 fix: right and middle button not work in ext/workspace module 2025-10-01 22:30:23 +08:00
Alexis Rouillard
18a9835b7c Merge pull request #4246 from edeustua/master
feat: Add ISO 8601 calendar to clock module
2025-10-01 14:29:37 +02:00
Alexis Rouillard
632af16b19 Merge pull request #4448 from winkelnp/gamemode-icon
Fix: styling: set gamemode icon size and spacing to 0 if use-icon is false
2025-10-01 14:28:30 +02:00
Alexis Rouillard
9acf032c0c Merge pull request #4458 from kolayne/patch-1
Fix: style: show active workspace on hyprland
2025-10-01 14:28:02 +02:00
Alexis Rouillard
9dd75d4f6b Merge pull request #4507 from workflow/niri-language-add-css-classes
feat(niri/language): add CSS classes
2025-10-01 14:27:35 +02:00
Alexis Rouillard
4f16ec16f9 Merge pull request #4395 from pol-rivero/workspace-taskbar-improvements
[hyprland/workspaces] Taskbar improvements
2025-10-01 14:27:13 +02:00
Alexis Rouillard
b4c80cfb56 Merge pull request #4387 from seschwar/include-xdg-data-home
fix: display icons for userwide installed applications
2025-10-01 14:26:39 +02:00
Alexis Rouillard
e00db5886e Merge pull request #4372 from rellimn/fix-menu-hover
Fix module and tray item staying in hover state after opening menu
2025-10-01 14:25:23 +02:00
Alexis Rouillard
a613cd54b0 Merge pull request #4371 from khaneliman/nixfmt
fix(flake): fix formatter configuration
2025-10-01 14:24:23 +02:00
Alexis Rouillard
5c01ad75f1 Merge pull request #4358 from labruzese/master
Moved workspace id failing to parse from an error to part of the trace
2025-10-01 14:23:59 +02:00
Alexis Rouillard
3cc5943c08 Merge pull request #4373 from Arkoniak/4354-wildcard-config-regression
bugfix: expanding wildcards in config includes (#4354)
2025-10-01 14:23:31 +02:00
Alexis Rouillard
c7a77f2c08 Merge pull request #4390 from aidansunbury/master
Support millisecond precision for script intervals
2025-10-01 14:22:17 +02:00
Alexis Rouillard
a15565ac48 Merge pull request #4408 from lfos/fix-hyprland-ipc-destructor
Prevent child zombie process from tearing down Hyprland IPC
2025-10-01 14:21:17 +02:00
Alexis Rouillard
23220eb541 Merge pull request #4410 from lfos/fix-clock-asan-use-after-scope
clock: fix use after scope
2025-10-01 14:20:34 +02:00
Alexis Rouillard
32d4cf4c7b Merge pull request #4414 from PedroManse/master
docs: fix waybar menu example and formatting
2025-10-01 14:20:07 +02:00
Alexis Rouillard
f29e843d6e Merge pull request #4428 from Alexays/update_flake_lock_action
flake.lock: Update
2025-10-01 14:19:50 +02:00
Alexis Rouillard
97f1e54b70 Merge pull request #4447 from guttermonk/clock-fix
Clock Module: Independent clock tooltip formatting and fix for blank line at the end of the timezone list
2025-10-01 14:18:28 +02:00
Alexis Rouillard
6824a76595 Merge pull request #4380 from khaneliman/test-tweak
feat(makefile): support more detailed test output
2025-10-01 14:18:01 +02:00
Alexis Rouillard
0f1d31147a Merge pull request #4457 from dmyTRUEk/fix-4455
fix(temperature): critical style not being removed
2025-10-01 14:17:14 +02:00
Alexis Rouillard
d3b094503e Merge pull request #4493 from LukashonakV/cava_backend
Cava backend. Comminication using signals
2025-10-01 14:16:51 +02:00
Alexis Rouillard
fbec045492 Merge pull request #4437 from jp7677/ext-workspaces-remove-dirty-tracking
ext/workspaces: fix appearing of hidden workspaces
2025-10-01 14:16:03 +02:00
Alexis Rouillard
c31d15045a Merge pull request #4452 from dmyTRUEk/master
docs(temperature): add missed `warning` style
2025-10-01 14:15:10 +02:00
Alexis Rouillard
8bb19a9505 Merge pull request #4474 from LordMZTE/river-vacant-startup
fix(river): hide vacant tags on initial startup
2025-10-01 14:14:54 +02:00
Alexis Rouillard
08b36955de Merge pull request #4488 from RQuarx/patch-1
fix: changed *waybar-styles(5)" to *waybar-styles(5)* in the last line
2025-10-01 14:13:54 +02:00
Alexis Rouillard
6978193c6a Merge pull request #4485 from coleleavitt/master
fix: handle null GDK window reference in surface initialization
2025-10-01 14:13:33 +02:00
Alexis Rouillard
7092244402 Merge pull request #4495 from stefonarch/patch-2
Fix example in waybar-niri-language.5.scd
2025-10-01 14:12:53 +02:00
Alexis Rouillard
8013556d2b Merge pull request #4476 from notpeelz/fix-sni-item-menu-destroy
fix: close sni menu on item destruction
2025-10-01 14:12:35 +02:00
Pol Rivero
5f1db15c2e Workspaces containing only ignored windows should be considered empty
This fixes #4479
2025-10-01 08:06:11 +02:00
github-actions[bot]
db2dfb6f3c flake.lock: Update
Flake lock file updates:

• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/dc9637876d0dcc8c9e5e22986b857632effeb727?narHash=sha256-cKgvtz6fKuK1Xr5LQW/zOUiAC0oSQoA9nOISB0pJZqM%3D' (2025-07-28)
  → 'github:NixOS/nixpkgs/e9f00bd893984bc8ce46c895c3bf7cac95331127?narHash=sha256-0m27AKv6ka%2Bq270dw48KflE0LwQYrO7Fm4/2//KCVWg%3D' (2025-09-28)
2025-10-01 00:13:30 +00:00
workflow
862ba2f568 feat(niri/language): add CSS classes 2025-09-29 17:43:23 +03:00
Viktar Lukashonak
76d3b47ffd Cava back/front end transformation 2025-09-26 23:34:11 +03:00
Viktar Lukashonak
cbab9c9713 spdlog bump 2025-09-25 21:46:13 +03:00
Standreas
cbd8930e22 Fix example in waybar-niri-language.5.scd 2025-09-23 16:32:45 +02:00
Jens Peters
b08d0c21f3 ext/workspaces: add deactivate action 2025-09-20 14:11:46 +02:00
RQuarx
9e3a9f7d35 fix: changed *waybar-styles(5)" to *waybar-styles(5)* in the last line 2025-09-20 15:05:16 +07:00
Cole Leavitt
45cfaf4a0b fix: validate 'swap-icon-label' configuration type and log warnings 2025-09-17 21:20:43 -07:00
Cole Leavitt
4a5358e8c5 fix: handle null GDK window reference in surface initialization 2025-09-17 21:17:26 -07:00
peelz
0c3e82219f fix: close sni menu on item destruction 2025-09-16 14:03:45 -04:00
LordMZTE
fd601801b4 fix(river): hide vacant tags on initial startup
Before this, vacant tags would show with `hide-vacant` set on initial
startup, because we receive initial tag events from River before we show
the bar. In that case, we won't call `set_visible(false)` on the
respective buttons because they're not shown yet. This registers the
output status listener after we show the bar so we won't miss any
events.
2025-09-16 16:04:25 +02:00
winkelnp
e87ece4462 set gamemode icon size and spacing to 0 if use-icon is false 2025-09-15 22:03:23 +02:00
Nikolai Nechaev
3435e33845 Fix: style: show active workspace on hyprland
The `hyprland/workspaces` module has the CSS class
`active` rather than `focused` for the current workspace.

Update the default CSS selector for the current workspace
to match both `button.focused` and `button.active`.
2025-09-13 08:40:30 +09:00
dmyTRUEk
09a07cd429 fix(temperature): critical style not being removed (#4455) 2025-09-12 20:00:43 +03:00
dmyTRUEk
e8a2e6c66f docs(temperature): add missed warning style 2025-09-10 13:21:04 +03:00
guttermonk
d45ce841e3 Keep the local timezone from being in the tooltip. 2025-09-06 08:40:09 -05:00
guttermonk
97fa6aa4dd Added option to show timezones in tooltip only and removed the extra
blank line at the bottom of the timezone list.
2025-09-05 21:01:23 -05:00
Jens Peters
af9c31ccd3 ext/workspaces: fix appearing of hidden workspaces
Do this by removing the needs-update tracking. The gain
was questionable to begin with and turns out it  doesn't
work correctly with multiple outputs.
2025-09-03 06:53:21 +02:00
Manse
19468d4365 docs: fix waybar menu example and formatting
fix example's hibernate id typo
fix xml and json formatting
2025-08-25 10:50:51 -03:00
zjeffer
9720d80524 add asan.supp 2025-08-23 18:25:45 +02:00
Lukas Fleischer
8e488b4d5e clock: fix use after scope
Signed-off-by: Lukas Fleischer <lfleischer@lfos.de>
2025-08-23 00:25:50 -04:00
Lukas Fleischer
5a29473080 Prevent child zombie process from tearing down Hyprland IPC
In rare circumstances, we may fork(), e.g., as part of a custom module,
and the child process may fail to exec() and exit. In those cases, the
IPC destructor will be called in the child process.

Prior to this commit, this call would then result in the shared socket
being closed. Prevent this by only closing the socket from the original
process.

Fixes #3975 and #4152.

Signed-off-by: Lukas Fleischer <lfleischer@lfos.de>
2025-08-22 18:58:53 -04:00
zjeffer
3c3164eb8e Fix warning if swap-icon-label is not defined in config 2025-08-19 23:56:10 +02:00
zjeffer
556c5f5a30 Add tsan.supp file to easily ignore common tsan issues from external libraries 2025-08-19 23:56:08 +02:00
Pol Rivero
45d01ce6e5 Implement "active-window-position" 2025-08-18 21:23:36 +02:00
Pol Rivero
691b7d427b Implement "reverse-direction" 2025-08-18 20:49:14 +02:00
Aidan Sunbury
5a87a9d60a Merge pull request #1 from aidansunbury/AS-millisecond-intervals 2025-08-16 16:02:43 -07:00
aidansunbury
2b81782fa9 more changes 2025-08-16 16:01:41 -07:00
aidansunbury
2b552f7fb6 compat 2025-08-16 15:34:43 -07:00
aidansunbury
6dc5a73a02 initial changes 2025-08-16 15:29:59 -07:00
Sebastian Schwarz
e8755b1a7f fix: display icons for userwide installed applications
Previously Waybar only displayed icons for applications which were
installed systemwide.  Icons were resolved via `.desktop` files in
directories specified by the environment variable `XDG_DATA_DIRS`.
However the [XDG specification](https://specifications.freedesktop.org/basedir-spec/0.8/#variables)
notes that this variable should only consulted **in addition** to
`XDG_DATA_HOME`:

> `$XDG_DATA_DIRS` defines the preference-ordered set of base
> directories to search for data files in addition to the
> `$XDG_DATA_HOME` base directory.

This because `XDG_DATA_DIRS` contains only systemwide directories,
whereas `XDG_DATA_HOME` contains the userwide directory.  Also
including the latter when looking up `.desktop` files allows Waybar to
display icons for applications which where installed userwide.
2025-08-16 14:14:59 +02:00
Austin Horstman
25ac6b7a80 refactor(makefile): allow build on test command
meson will skip building, if not needed, but we want to make sure we're
actually testing what we expect.

Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
2025-08-13 14:09:01 -05:00
Austin Horstman
8fe76317fb feat(makefile): support more detailed test output
Add a command to show a prettier test output so you can see what's going
on easier.

Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
2025-08-13 14:09:01 -05:00
Arkoniak
691e66a7fd tests: additional tests for bugfix (#4354) 2025-08-13 10:30:25 +03:00
Arkoniak
5ac28f3947 bugfix: expanding wildcards in config includes (#4354) 2025-08-12 22:31:59 +03:00
rellimn
089b9a20fc Fix module and tray item staying in hover state after opening menu
Fixes #3980
2025-08-12 20:51:35 +02:00
Austin Horstman
d09a4072e5 chore(flake): nixfmt-rfc-style -> nixfmt
Marked stable and uses new name after replacing classic.

Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
2025-08-12 13:28:07 -05:00
Austin Horstman
a0c21318f9 chore(format): run treefmt
Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
2025-08-12 13:26:02 -05:00
Austin Horstman
be48f6bff2 fix(flake): fix formatter configuration
Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
2025-08-12 13:25:50 -05:00
zjeffer
5079884b78 Hyprland IPC improvements, fix tsan warning, WindowCount shouldn't create a separate IPC 2025-08-12 19:39:36 +02:00
Pol Rivero
83f16a2092 Document newer config options of workspace-taskbar
Adds some configs that were only documented in the GitHub wiki to the manpage.
2025-08-12 16:43:31 +02:00
Skylar Abruzese
64b64d0316 Moved workspace id failing to parse from an error to part of the trace.
With named persistent workspaces it is expected behavior that they have
no id since their workspace may not have been created by hyprland yet.
2025-08-09 18:33:35 -04:00
Alex
41de8964f1 chore: 0.14.0 2025-08-08 09:15:22 +02:00
Alex
7e0cbf4a1f fix: lint 2025-08-08 08:59:10 +02:00
Alexis Rouillard
b3fbe1b5ed Merge pull request #4319 from M0streng0/master
wireplumber & backlight: fix states and support for microphone
2025-08-08 08:56:07 +02:00
Alexis Rouillard
477f30705c Merge pull request #4208 from markx86/feat/battery-events
battery: Add support for battery level related events
2025-08-08 08:54:32 +02:00
Alexis Rouillard
07d3a4da10 Merge pull request #4333 from Arkoniak/relative_paths_in_includes
Relative paths in included configs
2025-08-08 08:53:55 +02:00
Alexis Rouillard
61b3c6d7d1 Merge pull request #3929 from xb-bx/master
sway/workspaces: Implement reverse-scroll
2025-08-08 08:45:42 +02:00
Alexis Rouillard
c63e332fb2 Merge pull request #4278 from rwsalie/master
add openbsd support
2025-08-08 08:43:52 +02:00
Alex
79c30e77a7 fix: lint 2025-08-08 08:42:17 +02:00
Alexis Rouillard
b0983e9c37 Merge pull request #3833 from Bahnschrift/master 2025-08-08 08:26:21 +02:00
Alexis Rouillard
3dce0956ec Merge pull request #3930 from Invertisment/master 2025-08-08 08:24:58 +02:00
Alexis Rouillard
9a545e75e4 Merge pull request #4080 from proycon/river-layout-class 2025-08-08 08:23:12 +02:00
Alexis Rouillard
7cfa708b1a Merge pull request #4326 from notpeelz/feat-network-match-altnames 2025-08-08 08:21:33 +02:00
Alexis Rouillard
f1b7d829c2 Merge pull request #4016 from jp7677/ext-workspaces
ext/workspaces: port from wlr/workspaces to ext-workspace-v1 for a.o. labwc support
2025-08-08 08:18:01 +02:00
Alexis Rouillard
6679801a9c Merge pull request #3849 from haansn08/mpd-format-uri
mpd: add uri and filename format arguments
2025-08-07 23:04:02 +02:00
Alexis Rouillard
13a4e5d43d Merge pull request #4337 from Alexays/update_flake_lock_action
flake.lock: Update
2025-08-07 23:02:17 +02:00
Alexis Rouillard
b9a26f51b6 Merge pull request #3868 from pol-rivero/master
[hyprland/workspaces] Implement workspace taskbars
2025-08-07 23:00:22 +02:00
github-actions[bot]
ff69525e29 flake.lock: Update
Flake lock file updates:

• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/30e2e2857ba47844aa71991daa6ed1fc678bcbb7?narHash=sha256-krGXKxvkBhnrSC/kGBmg5MyupUUT5R6IBCLEzx9jhMM%3D' (2025-06-27)
  → 'github:NixOS/nixpkgs/dc9637876d0dcc8c9e5e22986b857632effeb727?narHash=sha256-cKgvtz6fKuK1Xr5LQW/zOUiAC0oSQoA9nOISB0pJZqM%3D' (2025-07-28)
2025-08-01 00:14:36 +00:00
Arkoniak
1e0037a873 fixed extra copy 2025-07-31 21:29:20 +03:00
Pol Rivero
5bbace1d43 Merge remote-tracking branch 'upstream/master' 2025-07-29 23:30:44 +02:00
peelz
4c72033309 refactor: why is that line there 2025-07-29 07:52:46 -04:00
peelz
b5093f3e58 feat: match network interfaces by their altnames 2025-07-29 07:52:46 -04:00
Arkoniak
f824ae9334 Relative paths in included configs 2025-07-29 10:45:31 +03:00
Henrique Oliveira
90f2490407 Fix: Backlight same issue with states 2025-07-23 20:26:17 +02:00
Henrique Oliveira
a6ac75983f Add: WirePlumber - format-source support 2025-07-23 16:59:07 +02:00
Henrique Oliveira
7cb1a0e3d6 Add: Wireplumber - support for microphone 2025-07-23 13:19:53 +02:00
Henrique Oliveira
91e57376ef Fix: WirePlumber module - states not working 2025-07-23 12:18:22 +02:00
Alexis Rouillard
0776e694df Merge pull request #4316 from erikeah/master 2025-07-23 08:31:48 +02:00
Erik Alonso
bb190409de fix: unable to disable upower's tooltip 2025-07-22 13:09:33 +01:00
Alexis Rouillard
39d6d80f64 Merge pull request #4315 from notpeelz/style-clang-format 2025-07-21 07:26:58 +02:00
peelz
b4d95b405c style: clang-format 2025-07-20 22:40:29 -04:00
Alexis Rouillard
71b01fe58f Merge pull request #4161 from blackxored/feat/electron-tray-hack
feat: add a way to override electron app tray icons
2025-07-20 18:55:01 +02:00
Alexis Rouillard
2baa93174b Merge pull request #4260 from notpeelz/feat-display-rfkill-setting
feat: add rfkill network setting
2025-07-20 18:54:24 +02:00
Alexis Rouillard
321ed85a67 Merge pull request #4298 from csskevin/docu-arch
adding dependency command for arch
2025-07-20 18:51:57 +02:00
Alexis Rouillard
e526afb963 Merge pull request #4310 from arnaud-ma/remove-persistent-workspace-rules
Fix #4307
2025-07-20 18:51:01 +02:00
arnaud-ma
8dcdd97879 small fixes 2025-07-19 05:01:29 +02:00
arnaud-ma
2dc2b5ccfd fix #4307 2025-07-19 04:50:59 +02:00
arnaud-ma
a4f200cdb5 revert 2025-07-19 04:47:31 +02:00
arnaud-ma
64ed2cd970 fix indentation 2025-07-19 03:23:32 +02:00
arnaud-ma
e45883088d hyprland: Remove redundant workspace rules loading 2025-07-19 03:18:48 +02:00
csskevin
061c561762 adding dependency command for arch 2025-07-15 00:19:55 +02:00
bilaliscarioth
506fd5c597 Merge branch 'Alexays:master' into master 2025-07-14 02:00:51 +02:00
bilaliscarioth
682fc34c1d fix linters for css_reload_helper.cpp 2025-07-13 14:03:09 +02:00
bilaliscarioth
f91889ce1c format SafeSignal.hpp as the linters want 2025-07-13 14:01:59 +02:00
Alexis Rouillard
94777921d9 Merge pull request #4272 from labruzese/master
fix: hyprland named persistent workspaces
2025-07-13 09:07:26 +02:00
Alexis Rouillard
ee9dc6ae05 Merge pull request #4292 from nraffp/4291
respect gtk color scheme variant for gtk css variable
2025-07-13 09:06:25 +02:00
Alexis Rouillard
1cb30e0f85 Merge pull request #4275 from acarl005/master
fix: prevent persistent workspaces from being duplicated if they exist…
2025-07-13 09:05:36 +02:00
Alexis Rouillard
50711bfb87 Merge pull request #4284 from hritix/feature/markup_support_for_tooltip_of_battery_and_pulseaudio
enabled pango markup support for tooltip of battery and pulseaudio modules
2025-07-13 09:04:47 +02:00
Nick Raffaele
19360462ba respect gtk color schema variant for gtk css variable 2025-07-12 09:45:14 -07:00
peelz
73d9c5f560 fix(network): reset is_p2p_ in clearIface 2025-07-10 08:01:20 -04:00
peelz
b85f0c17c3 fix(network): ignore carrier state when the interface is down
I'm not sure why, but my network card (mt7921e) sometimes will report
having a carrier when the interface is down. This usually happens
when rfkill was active before rebooting.
2025-07-10 08:01:20 -04:00
peelz
b02694caef fix(network): initialize all fields
Some fields were previously uninitialized (e.g. carrier), which
could lead to UB.
2025-07-10 08:01:20 -04:00
peelz
2dfbaabf31 fix(network): use atomic_bool to store the rfkill state 2025-07-10 08:01:20 -04:00
peelz
f991af2893 style(network): fix trailing white space 2025-07-10 08:01:20 -04:00
peelz
0e07c7ac5c feat(network): add rfkill setting
This setting makes it possible to have a configuration with two
network modules where one of them displays the ethernet state
(disconnected, linked, ethernet), and the other, the wifi state
(disabled, disconnected, linked, wifi).

Otherwise the ethernet state would show up as "disabled" (instead of
"disconnected") when rfkill is active.
2025-07-10 08:01:20 -04:00
peelz
46a152abc8 fix(network): display as disabled if rfkill and no carrier
We want the "disabled" state even when an interface is selected
explicitly.
2025-07-10 08:01:20 -04:00
hritix
310a473e65 enabled markup support for tooltip of battery and pulseaudio modules 2025-07-09 22:50:03 +05:30
Emiliano Deustua
be819be8bd fix: Revert formatting to clang 2025-07-07 22:10:09 -05:00
bilaliscarioth
d808c00324 avoid useless vars on cpu_frequency, mimic sigrtmin/sigrtmax 2025-07-08 02:21:48 +02:00
bilaliscarioth
0cb605b529 start openbsd ports 2025-07-08 02:13:33 +02:00
Maarten van Gompel
04796988e9 feat(river): set layout name as class
This allows for custom styling for specific river layouts (such as monocle).
2025-07-07 15:13:33 +02:00
xb-bx
4d74bb3004 sway/workspaces: implement reverse-scroll 2025-07-07 14:17:18 +03:00
Andy Carlson
fd67002662 fix: prevent persistent workspaces from being duplicated if they exist under a different name 2025-07-06 23:11:00 -04:00
Pol Rivero
c98cb7095d Merge remote-tracking branch 'upstream/master' 2025-07-06 10:18:59 +02:00
Alexis Rouillard
cae5f9a56f Merge pull request #4274 from tpaau-17DB/master 2025-07-04 21:21:30 +01:00
tpaau-17DB
10c116e54a Change default tooltip for the battery module. 2025-07-04 19:02:10 +02:00
Skylar Abruzese
6d3b93bbf7 fix: added active workspace matching by name as fallback
fixes bug where persistent workspaces would not be marked as active
because their id is based on creation time by hyprland and thus we can't
consistently match the id's without constantly changing them (this would
also cause issues with workspace sorting).
2025-07-03 18:48:04 -04:00
Skylar Abruzese
9ef6dc7380 fix: hyprland named persistent workspaces
allowed persistent workspaces to be defined with names instead of just
id's
2025-07-03 17:44:37 -04:00
Alexis Rouillard
f409f53131 Merge pull request #4256 from Alexays/update_flake_lock_action
flake.lock: Update
2025-07-02 09:51:31 +01:00
Alexis Rouillard
88766de1ee Merge pull request #4258 from notpeelz/fix-network-eth-rfkill-precedence
fix: 'ethernet' network state should have precedence over 'disabled'
2025-07-01 16:31:54 +01:00
peelz
b6c13ba58b fix: 'ethernet' network state should have precedence over 'disabled' 2025-07-01 10:37:31 -04:00
github-actions[bot]
e7a4bafede flake.lock: Update
Flake lock file updates:

• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/96ec055edbe5ee227f28cdbc3f1ddf1df5965102?narHash=sha256-7doLyJBzCllvqX4gszYtmZUToxKvMUrg45EUWaUYmBg%3D' (2025-05-28)
  → 'github:NixOS/nixpkgs/30e2e2857ba47844aa71991daa6ed1fc678bcbb7?narHash=sha256-krGXKxvkBhnrSC/kGBmg5MyupUUT5R6IBCLEzx9jhMM%3D' (2025-06-27)
2025-07-01 00:14:02 +00:00
Emiliano Deustua
08a39dd9eb refactor: Change config key name 2025-06-30 10:44:46 -05:00
Jens Peters
6c48db6cee ext/workspaces: log workspace id/name
This should help to distinguish between internal and
external ID in the logs.
2025-06-29 21:51:31 +02:00
Jens Peters
984d0de1fc ext/workspaces: introduce ignore-hidden option
Hide hidden workspaces by default, but add an option for overriding.

While at it, move button visibility handling to Workspaces and only
handle add/removal of buttons at WorkspaceManager. This makes it
easier to keep track if sorting is needed.
2025-06-29 21:51:31 +02:00
Jens Peters
29bf5d5da1 ext/workspaces: moved/renamed from wlr/workspaces
The ext-workspace-v1 protocol is not wlr/wlroots
specific.
2025-06-29 21:51:31 +02:00
Jens Peters
255c0ebe28 wlr/workspaces: port to ext-workspace-v1
Rework implementation to match new protocol behavior.
2025-06-29 21:51:31 +02:00
Emiliano Deustua
649a98a679 feat: Add ISO 8601 calendar to clock module 2025-06-28 19:42:55 -05:00
Alexis Rouillard
8516d457ad Merge pull request #4242 from mexanoz/fix-hyprland-language
fix hyprland/language layout parsing
2025-06-27 18:20:27 +01:00
mexanoz
7505e2c3f3 fix hyprland/language layout parsing 2025-06-27 20:54:38 +05:00
Martynas Maciulevičius
c8dc3e7024 Remove unused import 2025-06-27 09:31:51 +03:00
Martynas Maciulevičius
b7ff47fb05 User kill signal config keys: Use underscore instead of dash 2025-06-27 09:31:51 +03:00
Martynas Maciulevičius
7463be9b6a Fix initial null configuration; Fix doc compilation errors 2025-06-27 09:31:51 +03:00
Martynas Maciulevičius
125b59e23b Add more details on how 'reload' works in signals 2025-06-27 09:31:51 +03:00
Martynas Maciulevičius
3c7a9bf432 Documentation for sigusr1 and sigusr2 config 2025-06-27 09:31:51 +03:00
Martynas Maciulevičius
aaea814217 Idempotent bar show/hide via configurable user kill signals 2025-06-27 09:31:51 +03:00
Alexis Rouillard
c336bc5466 Merge pull request #4234 from Invertisment/fix-default-icon 2025-06-26 20:35:45 +01:00
Martynas Maciulevičius
460b19ba1b Fix default icon in tray module 2025-06-26 20:34:56 +03:00
Alex
0fcda9afa5 chore: 0.13.0 2025-06-23 09:10:48 +02:00
markx86
53d8d3cd2a fix: Code formatting for clang-format/lint CI 2025-06-22 18:55:07 +02:00
markx86
eae22f3273 battery: Document events in waybar-battery manpage 2025-06-22 17:45:16 +02:00
markx86
08da7b5282 feat: Add support for battery related events 2025-06-22 17:45:12 +02:00
Alexis Rouillard
4730fc4d77 Merge pull request #4219 from yuannan/nix_gpsd
Added IPC fix and Nix GPS fix
2025-06-22 13:22:19 +01:00
yuannan
2b9601b9a4 added IPC fix and Nix GPS fix 2025-06-22 13:15:18 +01:00
Alexis Rouillard
6a1d89e80d Merge pull request #4217 from Alexays/revert-2886-feat/upower_bat_bluetooth
Revert "Bluetooth module: fetch battery percentage from upower if not found from bluez"
2025-06-22 11:24:41 +01:00
Alexis Rouillard
35d5203b4e Revert "Bluetooth module: fetch battery percentage from upower if not found from bluez" 2025-06-22 12:24:22 +02:00
Alexis Rouillard
13ed499999 Merge pull request #2886 from levnikmyskin/feat/upower_bat_bluetooth
Bluetooth module: fetch battery percentage from upower if not found from bluez
2025-06-22 09:06:42 +01:00
Alexis Rouillard
0c1f1f2df9 Merge pull request #3544 from nktnet1/hyprland/windowcount
add Hyprland/windowcount module
2025-06-22 09:03:21 +01:00
Alex
ee91d18ad9 fix: lint 2025-06-22 10:01:36 +02:00
Alexis Rouillard
f27df33280 Merge pull request #3628 from adryzz/gps-module
Add GPS module
2025-06-22 08:59:46 +01:00
Alexis Rouillard
ea1ee2c027 Merge pull request #4068 from Rimsoo/patch-1
Fixed one layout with multiple variant bug hyprland/language Fixes #3676
2025-06-22 08:59:05 +01:00
Alexis Rouillard
54f7991325 Merge pull request #3762 from cc-nogueira/add_rewrite_to_wlr_tooltip
add rewrite to wlr tooltip
2025-06-22 08:58:33 +01:00
Alexis Rouillard
9246297d63 Merge pull request #4113 from Duncaen/niri-workspace-urgency
niri: add support for urgency indicators to workspaces
2025-06-22 08:57:57 +01:00
Alexis Rouillard
630f85dcb1 Merge branch 'master' into niri-workspace-urgency 2025-06-22 08:57:49 +01:00
Alexis Rouillard
77b42105a6 Merge pull request #4136 from Roc25/special-centered
hyprland workspaces: Add sorting Special Centered
2025-06-22 08:57:12 +01:00
Alex
df138e12c4 fix: compat freebsd 2025-06-22 09:55:57 +02:00
Alex
373fd77f7a chore: update cross-platform-actions/action 2025-06-22 09:54:46 +02:00
Alexis Rouillard
f5e6e5e9fc Merge pull request #3863 from yamader/wayfire
add module wayfire/window, wayfire/workspaces
2025-06-22 08:53:23 +01:00
Alexis Rouillard
a88e5795a4 Merge branch 'master' into wayfire 2025-06-22 08:53:02 +01:00
Alexis Rouillard
e9d0f2254d Merge pull request #1784 from ruanformigoni/issue-1681
exec runs after on-* events
2025-06-22 08:50:48 +01:00
Alexis Rouillard
71c6c6032b Merge pull request #4133 from Roc25/persistent-only
Add persistent-only setting for hyprland/workspaces
2025-06-22 08:50:33 +01:00
Alexis Rouillard
780e96bd78 Merge pull request #4131 from belcaik/master
Add support for mouse side buttons (back/forward) to control track navigation in mpris module
2025-06-22 08:45:41 +01:00
Alexis Rouillard
a563a3fceb Merge pull request #4127 from iostapyshyn/master
niri/workspaces: Add empty icon
2025-06-22 08:45:13 +01:00
Alex
286cff2e3d fix: lint 2025-06-22 09:44:35 +02:00
Alexis Rouillard
cbdbc492bb Merge pull request #4097 from RobertMueller2/sway-window-marks
feat: sway/window: provide {marks} format replacement
2025-06-22 08:43:27 +01:00
Alexis Rouillard
d6b6158ae9 Update custom.cpp 2025-06-22 09:42:14 +02:00
Alexis Rouillard
f314150736 Merge branch 'master' into issue-1681 2025-06-22 08:41:15 +01:00
Alexis Rouillard
6206cebd75 Merge pull request #3887 from torstehu/fix-typo
Fix typos in function, variable names and in documentation
2025-06-22 08:39:23 +01:00
Alexis Rouillard
0cae53747e Merge pull request #3881 from TripleTrable/AModules/fix-expand-fill-no-center
Fixes: Add stretching of modules and modules-center toggling
2025-06-22 08:38:08 +01:00
Alexis Rouillard
249b452829 Merge pull request #4040 from coreydoughty/hypr-submap-patch
hyprland/submap: allow pango markup.
2025-06-22 08:33:53 +01:00
Alexis Rouillard
bfedb7c446 Merge pull request #4155 from Yutsuten/fix/wide-char-calendar
Fix calendar extra padding if there are wide characters
2025-06-22 08:32:50 +01:00
Alexis Rouillard
9ca04ee2fd Merge pull request #4048 from LiterallyVoid/literallyvoid/fix-4047-deadlock
Fix signal safety deadlock
2025-06-22 08:32:36 +01:00
Alexis Rouillard
eea9561525 Merge pull request #4092 from RobertMueller2/issue_3981
Issue 3981: try and fix memory leak in privacy module
2025-06-22 08:31:06 +01:00
Alexis Rouillard
bef539e4de Update privacy_item.cpp 2025-06-22 09:30:46 +02:00
Alexis Rouillard
456c3add4a Merge pull request #4102 from edwin0cheng/style-sym
Use load_symbolic for gtk icon to support styling in tray icon
2025-06-22 08:29:42 +01:00
Alexis Rouillard
a48116799a Merge pull request #4088 from Alexays/update_flake_lock_action
flake.lock: Update
2025-06-22 08:27:57 +01:00
Alexis Rouillard
74a6726f4f Merge pull request #4096 from aereaux/idle_docs
Add idle_inhibitor style docs.
2025-06-22 08:27:37 +01:00
Alexis Rouillard
3d00c4bed4 Merge pull request #4160 from davidemanini/icon-label
AIconLabel.cpp: honour "rotation" property and add "swap-icon-label" propery
2025-06-22 08:27:07 +01:00
Alexis Rouillard
d8218a301d Merge pull request #4095 from Fengerros/patch-1
Update mediaplayer.py - Fix artist name display in mediaplayer.py
2025-06-22 08:26:37 +01:00
Alexis Rouillard
44a8910022 Merge pull request #4173 from S0nter/master
privacy: ignore some streams
2025-06-22 08:24:22 +01:00
Alexis Rouillard
341e39fbcf Merge pull request #4210 from stkth/feat/display-systemd-system-state
Feat/display systemd system state
2025-06-22 08:24:04 +01:00
Alexis Rouillard
7b9db134dd Merge pull request #4207 from markx86/fix/mpris
fix: MPRIS widget not hiding when no player is active
2025-06-22 08:23:09 +01:00
Alexis Rouillard
7d5905b38c Merge pull request #4204 from stkth/feat/add-swap-state-to-memory-module
modules: memory: Add swapState format argument
2025-06-22 08:22:36 +01:00
Alexis Rouillard
5a013bdba0 Merge pull request #4209 from notpeelz/fix-formatting
Fix CI clang-format
2025-06-22 08:21:38 +01:00
Alexis Rouillard
ae777c65a6 Merge pull request #4212 from notpeelz/fix-namespace-pollution
Fix namespace pollution
2025-06-22 08:21:24 +01:00
Alexis Rouillard
103487f672 Merge pull request #4213 from notpeelz/fix-missing-cxx20-chrono-literals
fix: don't use c++20 chrono literals
2025-06-22 08:21:01 +01:00
Alexis Rouillard
3c197811e2 Merge pull request #4214 from notpeelz/bump-freebsd-14-3
ci: bump FreeBSD to 14.3
2025-06-22 08:20:48 +01:00
peelz
0bdea1e46f ci: bump FreeBSD to 14.3 2025-06-22 01:02:53 -04:00
peelz
8daaad1e13 fix: don't use c++20 chrono literals
Unfortunately we can't use these yet because the freebsd build (clang)
still uses HowardHinnant/date, which doesn't provide literal suffixes.
2025-06-22 00:56:56 -04:00
peelz
25f432b0ce refactor: avoid Gio namespace pollution 2025-06-22 00:50:25 -04:00
peelz
e4dd2ecc5a refactor: avoid namespace pollution in util/date.hpp 2025-06-22 00:50:25 -04:00
Alexis Rouillard
a40c53bd5d Merge pull request #4211 from notpeelz/fix-ci-gentoo 2025-06-22 00:43:11 +01:00
peelz
84bd0d452e ci: run the docker workflow monthly instead of daily
Rebuilding the gentoo docker image daily is most definitely going to
bust through the free CI tier limits.
2025-06-21 16:05:00 -04:00
peelz
d4f61ad271 ci: allow manual triggering of docker workflow 2025-06-21 16:05:00 -04:00
peelz
c6fceb03c8 ci: relax gentoo gtkmm dependency requirement 2025-06-21 16:05:00 -04:00
Steffen Kothe
cfb47790ad modules: systemd_failed_units: Introduce systemd state variables
Systemd provides the status of a given user and system session as a
human readable string.

Retrieve this information via RequestSystemState and guard the
retrieve of failed units depending on this request.

The functionality is extended but does not change, which means that
failed units in any granularity are displayed as before.

Update documentation in the meantime.

Signed-off-by: Steffen Kothe <steffen.kothe@skothe.net>
2025-06-21 16:53:12 +00:00
Steffen Kothe
d5e3a9f894 modules: systemd_failed_units: Enforce visibility of event box on every update
Instead if guarding visibility in if condition, enforce visibility
regardless of the state of the current update.

Signed-off-by: Steffen Kothe <steffen.kothe@skothe.net>
2025-06-21 16:51:13 +00:00
Steffen Kothe
0731117679 modules: systemd_failed_units: Introduce RequestFailedUnits member
Split-out request of failed units from systemd into a separate member
function.

This increases the readability and extendability, but preserves the
current functionality (non-functional change).

Signed-off-by: Steffen Kothe <steffen.kothe@skothe.net>
2025-06-21 16:51:13 +00:00
Steffen Kothe
4bb06b86bc modules: systemd_failed_units: Use explicit g_variant_get_uint32
Determining of failed units can be done by usage of explicit uint32
function with direct return due to auto lambda expression.

Signed-off-by: Steffen Kothe <steffen.kothe@skothe.net>
2025-06-21 16:47:27 +00:00
Steffen Kothe
74255d0c7e modules: systemd_failed_units: Move DBUS proxy check into lambda function
Checking for the availability of a given proxy member can be done in the
lambda function as well.

Signed-off-by: Steffen Kothe <steffen.kothe@skothe.net>
2025-06-21 16:47:25 +00:00
Steffen Kothe
5c2cf4c65c modules: systemd_failed_units: Fail early if state did not change
Prefer early exit if last status matches the current status.

Signed-off-by: Steffen Kothe <steffen.kothe@skothe.net>
2025-06-21 16:47:07 +00:00
Steffen Kothe
dcbbe3bb97 modules: systemd_failed_units: Move nr_failed calculation to updateData
Signed-off-by: Steffen Kothe <steffen.kothe@skothe.net>
2025-06-21 16:46:06 +00:00
Steffen Kothe
37a6106d3e modules: systemd_failed_units: Introduce nr_failed as member
Keeping nr_failed as member allows to split-out calculation of overall
failed units into updateData.

Signed-off-by: Steffen Kothe <steffen.kothe@skothe.net>
2025-06-21 15:17:59 +00:00
peelz
b8a985d606 style: fix formatting 2025-06-21 10:54:16 -04:00
Sonter
8f35dc17b8 Merge branch 'Alexays:master' into master 2025-06-20 18:30:56 +00:00
Alexis Rouillard
dfbf1ff2a0 Merge pull request #4154 from VannTen/fix/service_file_description
Fix Description= in systemd service file
2025-06-20 16:15:30 +01:00
Alexis Rouillard
93d85a0cea Merge pull request #4190 from notpeelz/fix-network-rfkill-update
fix: network module not displaying rfkill state
2025-06-20 16:14:38 +01:00
Alexis Rouillard
3abbdb849d Merge pull request #4191 from notpeelz/fix-length-error-output-description
fix: length_error thrown in handleOutputDescription
2025-06-20 16:14:22 +01:00
Alexis Rouillard
7da053f1bd Merge pull request #4205 from stkth/feat/use-debian-slim-for-container
Dockerfiles: Use debian-slim for container
2025-06-20 16:13:43 +01:00
Sonter
2f6f9620d2 Merge branch 'Alexays:master' into master 2025-06-20 14:32:05 +00:00
markx86
c266befe0a fix: MPRIS widget not hiding when no player is active 2025-06-20 14:02:01 +02:00
Steffen Kothe
76d0b44214 Dockerfiles: Use debian-slim for container
Slim images of Debian tend to be smaller even during development. Hence
replace the full-fledged variant with the slim one.

Signed-off-by: Steffen Kothe <steffen.kothe@skothe.net>
2025-06-19 18:59:15 +00:00
Steffen Kothe
bdcab011ee modules: memory: Add swapState format argument
Add an argument to the memory module which displays the state of the
swap configuration of the local system.

Usage of swap does not necessarily indicate if swap is on or off.

Signed-off-by: Steffen Kothe <steffen.kothe@skothe.net>
2025-06-19 18:44:31 +00:00
Alexis Rouillard
f8f795ac38 Merge pull request #4202 from markx86/master
fix: `cldMonShift_` not getting initialized in `Clock()` constructor
2025-06-19 07:35:28 +01:00
markx86
af9d61fa8f fix: cldMonShift_ not getting initialized in Clock() constructor
Initialize `cldMonShift_` member in the `clock` module constructor. This
fixes a bug where the calendar tooltip would break after a reload, when
in month mode.
2025-06-19 00:35:54 +02:00
Bahnschrift
800c4b56cc Merge remote-tracking branch 'source/master' 2025-06-18 18:42:23 +10:00
peelz
bd28bb959f fix: use spdlog in zxdg_output_v1_listener callbacks 2025-06-13 22:57:31 -04:00
peelz
f4496c9648 fix: length_error thrown in handleOutputDescription 2025-06-13 22:51:03 -04:00
peelz
07468357f4 fix: network module not displaying rfkill state 2025-06-13 21:40:18 -04:00
Alexis Rouillard
2c482a2917 Merge pull request #4189 from notpeelz/fix-man-network-frequency 2025-06-13 08:32:27 +02:00
peelz
5e14698b4e fix: network frequency is reported in GHz 2025-06-12 17:01:10 -04:00
Alexis Rouillard
250f58eed6 Merge pull request #4183 from Talbrelliles/custom-module-memory-fix
Memory Fix for continuous scripts in custom module
2025-06-11 13:18:23 +02:00
Taimase
3ebf2d96e5 fix continuousWorker in the custom module by capturing the buffer by reference. 2025-06-11 01:12:08 -06:00
Sonter
4d9403601a privacy: format with clang-format 2025-06-08 12:53:46 +03:00
Sonter
f73d26722c privacy: add example configuration 2025-06-08 12:39:10 +03:00
Gregor Kleen
6cfaf4ff63 privacy: document ignore options 2025-06-08 12:23:50 +03:00
Gregor Kleen
831602a913 privacy: default to ignoring all stream.monitor pw nodes 2025-06-08 12:23:50 +03:00
Gregor Kleen
703be13b00 privacy: introduce ignore option 2025-06-08 12:23:50 +03:00
Дмитрий
fca159ad01 Update man page
Co-authored-by: Tuur Vanhoutte <4633209+zjeffer@users.noreply.github.com>
2025-06-07 12:19:13 +03:00
gred
35c6e9c21c Update man page 2025-06-07 11:23:19 +03:00
gred
b36a283f83 Update man 2025-06-07 11:06:06 +03:00
gred
715503ec3e Rename vector to hiddenWorkspaces 2025-06-07 10:50:29 +03:00
Adrian Perez
81fb0daad2 feat: add a way to override electron app tray icons 2025-06-03 16:13:41 -07:00
Davide Manini
c26978eca8 Update documentation 2025-06-03 14:54:41 +03:00
Davide Manini
34484919d6 AIconLabel: honour rotation' option; add swap-icon-label' option 2025-06-03 14:54:41 +03:00
Mateus Eto
05cfd73804 Fix calendar extra padding if there are wide characters 2025-06-01 21:43:43 +09:00
github-actions[bot]
c0e7aad60e flake.lock: Update
Flake lock file updates:

• Updated input 'flake-compat':
    'github:edolstra/flake-compat/ff81ac966bb2cae68946d5ed5fc4994f96d0ffec?narHash=sha256-NeCCThCEP3eCl2l/%2B27kNNK7QrwZB1IJCrXfrbv5oqU%3D' (2024-12-04)
  → 'github:edolstra/flake-compat/9100a0f413b0c601e0533d1d94ffd501ce2e7885?narHash=sha256-CIVLLkVgvHYbgI2UpXvIIBJ12HWgX%2BfjA8Xf8PUmqCY%3D' (2025-05-12)
• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/8a2f738d9d1f1d986b5a4cd2fd2061a7127237d7?narHash=sha256-sPwcCYuiEopaafePqlG826tBhctuJsLx/mhKKM5Fmjo%3D' (2025-04-23)
  → 'github:NixOS/nixpkgs/96ec055edbe5ee227f28cdbc3f1ddf1df5965102?narHash=sha256-7doLyJBzCllvqX4gszYtmZUToxKvMUrg45EUWaUYmBg%3D' (2025-05-28)
2025-06-01 00:14:43 +00:00
Max Gautier
d53135f834 Fix Description= in systemd service file
Description= should be a noun phrase, and not a full sentence, according
to man 5 systemd.unit.

In particular, using a dot at the end result in messages like this in
journalctl when running as a user service (not the superfluous dot at
the end):

May 31 16:03:38 framework systemd[1180]: Started Highly customizable Wayland bar for Sway and Wlroots based compositors..
May 31 16:20:39 framework systemd[1180]: Stopping Highly customizable Wayland bar for Sway and Wlroots based compositors....
May 31 16:20:39 framework systemd[1180]: Stopped Highly customizable Wayland bar for Sway and Wlroots based compositors..
2025-05-31 23:07:26 +02:00
gred
15f54cd6ef Fix hidden buttons 2025-05-21 01:38:03 +03:00
gred
24a30b7ffd Add sorting with centered special workspaces 2025-05-21 01:01:23 +03:00
gred
4f55d7da90 Add persistent-only setting for hyprland/workspaces 2025-05-20 23:00:09 +03:00
belcaik
7613069a40 Merge pull request #1 from belcaik/feature/mpris-fordward-backward-handle
Add mouse navigation support for side buttons in Mpris
2025-05-19 23:25:31 -04:00
belcaik
d41a664779 refactor: use command pattern for button actions 2025-05-19 23:12:42 -04:00
belcaik
cdf3ca910d feat: Add support for side buttons mouse navigation in handleToggle
mapped buttons config on-click-backward and on-click-forward on mpris module to previous/next handle
GTK codes are 9 and 8
2025-05-19 22:52:01 -04:00
Illia Ostapyshyn
19d2430516 niri/workspaces: Add empty icon 2025-05-19 23:01:19 +02:00
Duncan Overbruck
47e0f42523 niri: add support for urgency indicators to workspaces 2025-05-14 20:33:11 +02:00
Khiet Tam Nguyen
6319569ed0 Merge branch 'Alexays:master' into hyprland/windowcount 2025-05-09 20:46:00 +10:00
Edwin Cheng
0340760e12 Use load_symbolic for gtk icon instead of load_icon. 2025-05-07 16:57:54 +08:00
Rene D. Obermueller
f4b68f41e6 feat: sway/window: provide {marks} format replacement 2025-05-04 07:50:28 +02:00
Aidan Epstein
7b5206128c Add idle_inhibitor style docs. 2025-05-03 10:41:07 -07:00
Fengerros
9bf8c8277a Update mediaplayer.py - Fix artist name display in mediaplayer.py
Fixed an issue where artist names like Earth, Wind & Fire were not displayed correctly. The change ensures that artist names containing commas or special characters are now shown properly.
2025-05-03 15:52:05 +02:00
Rene D. Obermueller
ff4ed82693 memory leak: 2nd attempt 2025-05-03 11:29:53 +02:00
Pol Rivero
4ae2b6f1ba Implement ignore-list 2025-05-02 15:48:34 +02:00
Pol Rivero
c9215ad818 Minor code cleanup 2025-05-02 14:29:44 +02:00
Rene D. Obermueller
72184b2205 Issue 3981: try and fix memory leak 2025-05-02 10:01:09 +02:00
Pol Rivero
61c5dad895 Fix some windows not being marked as active when opened
In some cases, the active event is arriving before the create event. We need to store the currently active address and initialize the windows accordingly
2025-05-01 21:03:46 +02:00
Pol Rivero
998fd7a192 Fix window title not being updated properly 2025-05-01 20:51:12 +02:00
Pol Rivero
72404a77f0 Initial implementation of active window
TODO:
- Sometimes the active event arrives before the create, in which case the window is not activated.
- The window title event also looks unreliable in some cases, will need to investigate
2025-05-01 20:22:34 +02:00
Pol Rivero
59c270ec06 Respect format-window-separator if workspace-taskbar is enabled 2025-05-01 19:26:44 +02:00
Pol Rivero
a816812f81 Run clang-format 2025-04-30 16:20:11 +02:00
Pol Rivero
451d458545 Fix compilation errors after merge 2025-04-29 20:12:59 +02:00
Pol Rivero
4222032fa1 Merge remote-tracking branch 'upstream/master' 2025-04-29 19:59:42 +02:00
Rimsoo
afeea62214 fixes #3676 including #3224 2025-04-24 23:32:47 +02:00
Alexis Rouillard
0332d2ebf8 Merge pull request #4046 from ebeem/sway-workspace-current-not-shown-fix
Sway Workspace: Fix workspace button not showing for tabbed/nested layouts
2025-04-24 11:32:56 +02:00
Alexis Rouillard
7cbdce5064 Merge pull request #4075 from Alexays/update_flake_lock_action
flake.lock: Update
2025-04-24 11:30:08 +02:00
github-actions[bot]
ba8ea3d952 flake.lock: Update
Flake lock file updates:

• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/52faf482a3889b7619003c0daec593a1912fddc1?narHash=sha256-6hl6L/tRnwubHcA4pfUUtk542wn2Om%2BD4UnDhlDW9BE%3D' (2025-03-30)
  → 'github:NixOS/nixpkgs/8a2f738d9d1f1d986b5a4cd2fd2061a7127237d7?narHash=sha256-sPwcCYuiEopaafePqlG826tBhctuJsLx/mhKKM5Fmjo%3D' (2025-04-23)
2025-04-24 09:29:40 +00:00
Alexis Rouillard
8b48982bf6 Merge pull request #4032 from RobertMueller2/issue_3974
wireplumber: fix potential nullpointer deref
2025-04-24 11:28:56 +02:00
Alexis Rouillard
5382a09db0 Merge pull request #4025 from khaneliman/format
flake.nix: add treefmt; treewide: clang and nix format
2025-04-24 11:28:11 +02:00
Rimsoo
20642f47df Fixed variant bug 2025-04-22 11:41:45 +02:00
Lena
d0c6e91094 gps: add rfkill support 2025-04-18 22:56:47 +02:00
Lena
956e39d3d3 make gpsd receiver not poll 2025-04-18 22:56:47 +02:00
Lena
22ec8e0770 fix factory copy&paste typo 2025-04-18 22:56:47 +02:00
Lena
d331331b76 add manpage 2025-04-18 22:56:47 +02:00
Lena
dfa40d6a00 add all arguments 2025-04-18 22:56:47 +02:00
Lena
45ebf45343 Start GPS module 2025-04-18 22:56:36 +02:00
Austin Horstman
55f52c3457 treewide: clang and nix format 2025-04-15 14:56:28 -05:00
Austin Horstman
5c48373cfe flake.nix: add treefmt formatter
Easier to format everything properly.
2025-04-15 14:56:05 -05:00
Alexis Rouillard
c8484ebb1d Merge pull request #4058 from khaneliman/cava 2025-04-15 20:28:12 +02:00
Austin Horstman
bf4f3ab064 nix: cava bump 2025-04-15 12:06:41 -05:00
Alexis Rouillard
913e0665e7 Merge pull request #4056 from LukashonakV/cavaBump 2025-04-15 17:04:04 +02:00
Viktar Lukashonak
e85025f805 libCava bump: 0.10.4 2025-04-15 16:33:07 +03:00
literallyvoid
517eb7651e Run clang-format on main.cpp 2025-04-14 12:31:23 -07:00
Alexis Rouillard
67272cc47f Merge pull request #4042 from clemenscodes/wlr-taskbar-icon-title-fallback
wlr/taskbar: find icon by title as fallback
2025-04-14 20:53:06 +02:00
Alexis Rouillard
1dfde583df Merge pull request #4045 from khaneliman/pulse
audio_backend: fix crash
2025-04-14 20:52:45 +02:00
Alexis Rouillard
3e16c3f74e Merge pull request #4052 from AOSC-Tracking/aosc/v0.12.0 2025-04-14 08:34:57 +02:00
Kaiyang Wu
252e4f78bf fix: support libcava 0.10.4
Signed-off-by: Kaiyang Wu <self@origincode.me>
2025-04-13 22:23:40 -07:00
literallyvoid
dbd3ffd732 Convert reload to a local 2025-04-12 17:54:10 -07:00
literallyvoid
97591c825a Remove signalThread and move reaping to catchSignals 2025-04-12 17:52:37 -07:00
literallyvoid
b03ecb3d74 Move signal handling to main thread 2025-04-12 17:52:37 -07:00
Almarhoon Ibraheem
7e845f506e sway workspace: fix workspace button not shown in nested layouts 2025-04-12 18:31:34 +03:00
Austin Horstman
afb1ee5422 audio_backend: fix crash
Getting crashes when called before we have proper information.
2025-04-11 14:53:47 -05:00
Corey Doughty
682492f7a9 This commit fixes #4023 2025-04-10 07:05:45 -04:00
Corey Doughty
633bf9e00f Hyprland submap allow pango markup. 2025-04-10 06:56:00 -04:00
Clemens Horn
addf44d945 test 2025-04-07 20:51:35 +02:00
Clemens Horn
e92b0a86b5 wlr/taskbar: find icon by title as fallback 2025-04-07 20:33:18 +02:00
Rene D. Obermueller
9ca52a48c8 wireplumber: fix potential nullpointer deref 2025-04-06 09:46:06 +02:00
Alexis Rouillard
056295cbc6 Merge pull request #4026 from khaneliman/workflows
.github/workflows/clang-format: bump github action (fix clang-format check)
2025-04-04 10:20:16 +02:00
Alexis Rouillard
80669f7134 Merge pull request #4024 from khaneliman/hyprland-crash 2025-04-04 08:34:13 +02:00
Austin Horstman
5ff6b0ad0f .github/workflows: tweak job names
They didn't seem to correspond to the workflow, properly. Making
triggering them locally weird.
2025-04-04 00:04:51 -05:00
Austin Horstman
84162ec604 .github/workflows/clang-format: bump github action 2025-04-04 00:04:51 -05:00
Austin Horstman
91ef6e51ed hyprland/workspaces: range find lint cleanup 2025-04-03 23:31:18 -05:00
Austin Horstman
c5bc3bc59a hyprland/workspaces: fix crash 2025-04-03 23:31:14 -05:00
Alexis Rouillard
569445f8b3 Merge pull request #4017 from RobertMueller2/issue_4015
fix manpage for backlight/slider
2025-04-01 13:38:25 +02:00
Alexis Rouillard
eb254db867 Merge pull request #4018 from Alexays/update_flake_lock_action
flake.lock: Update
2025-04-01 13:38:15 +02:00
github-actions[bot]
c0b8c4d468 flake.lock: Update
Flake lock file updates:

• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/5135c59491985879812717f4c9fea69604e7f26f?narHash=sha256-Vr3Qi346M%2B8CjedtbyUevIGDZW8LcA1fTG0ugPY/Hic%3D' (2025-02-26)
  → 'github:NixOS/nixpkgs/52faf482a3889b7619003c0daec593a1912fddc1?narHash=sha256-6hl6L/tRnwubHcA4pfUUtk542wn2Om%2BD4UnDhlDW9BE%3D' (2025-03-30)
2025-04-01 00:12:37 +00:00
Rene D. Obermueller
9d2b137594 fix manpage for backlight/slider 2025-03-31 18:36:12 +02:00
Alexis Rouillard
4a8d527dd5 Merge pull request #3921 from bpandreotti/vertical-privacy
Add support for vertical orientation in privacy module
2025-03-28 09:52:48 +01:00
Alexis Rouillard
b98e717433 Merge pull request #3941 from ChaosInfinited/features/systray-custom-icons
Features/systray custom icons
2025-03-28 09:46:22 +01:00
Alexis Rouillard
fda7abb33d Merge pull request #3878 from matt-fff/mw/hyprland-events-workspaces-v2
Migrate Hyprland workspace events to v2
2025-03-28 09:45:44 +01:00
Alexis Rouillard
9681cfd2e8 Merge pull request #4009 from teatwig/master
fix incorrect type for `weeks-pos` in waybar-clock man page
2025-03-28 09:45:19 +01:00
tea
567ae16a68 fix incorrect type for weeks-pos in waybar-clock man page 2025-03-28 09:43:47 +01:00
Alexis Rouillard
2fdfd1028a Merge pull request #3959 from voiceroy/ip-address-display
Provide an option to show ipv4, ipv6 or both
2025-03-28 09:25:44 +01:00
Alexis Rouillard
8476a7dc84 Merge pull request #3970 from khaneliman/nativeinstallcheck
nix/default: disable version check
2025-03-28 09:24:43 +01:00
Alexis Rouillard
e74844b8d4 Merge pull request #3961 from Alexays/update_flake_lock_action
flake.lock: Update
2025-03-28 09:24:28 +01:00
Alexis Rouillard
a622dfd072 Merge pull request #3969 from LawnGnome/cffi-config-value-json
cffi: always return config values as JSON
2025-03-28 09:24:14 +01:00
Alexis Rouillard
775067f2da Merge pull request #3995 from spectrum70/wip/login-proxy
add login-proxy option
2025-03-28 09:23:32 +01:00
Alexis Rouillard
508d3cd3dd Merge pull request #3638 from RowanLeeder/ISSUE-3092
Resolves #3092 Add source support to wireplumber module
2025-03-28 09:23:01 +01:00
Alexis Rouillard
eb2df58f5a Merge pull request #4002 from lbartoletti/freebsd_temp
fix(FreeBSD): Use dev.cpu temperature sysctl
2025-03-24 22:19:40 +01:00
Loïc Bartoletti
4ba1947a50 fix(FreeBSD): Use dev.cpu temperature sysctl 2025-03-24 15:30:57 +01:00
Angelo Dureghello
6fd859c0c4 add login-proxy option
There are cases where systemd-logind is not used/running. Result is
that bcklight module will not run.

Add an option that, when set to false, allows backlight module to
work without systemd-logind.
2025-03-22 18:40:47 +01:00
Lars Niesen
8a15cbad5c Fixes: Add stretching of modules and modules-center toggling
Thanks to tmccombs this commit fixes some inconsitencies in #3730.
These inconsitencies were:
- Fixed the oversight of missing the implementation of expand_center for
  center_ and right_
- Removes a last minut printf debugging statment I missed.
2025-03-09 16:15:39 +01:00
Pol Rivero
e541936df9 Merge remote-tracking branch 'upstream/master' 2025-03-08 17:18:31 +01:00
Austin Horstman
f631d5eaf9 nix/default: disable version check
Downstream added version check, causes this flake to fail building.
2025-03-05 22:44:55 -06:00
Adam Harvey
906170400e cffi: always return config values as JSON
Previously, string JSON values were special cased to be provided as
bare strings, which means that CFFI modules have to either know what
type each value is expected to be, or use a heuristic such as trying to
decode and then treating the value as a string on failure.

Instead, we can always return JSON, and let the downstream consumer
handle deserialising the value into whatever type is expected.

The new behaviour is gated on a new ABI version 2: modules built against
version 1 will continue to get the old behaviour.
2025-03-05 17:11:26 -08:00
Harishankar G
5e4dac1c0a Newline as a seperator when displaying IPv4 and 6 at the same time 2025-03-05 15:29:21 +05:30
Matthew White
f7b4451564 fix(hyprland): support additional v2 events 2025-03-04 10:23:19 -07:00
Harishankar G
4a6c417ef5 Add format replacements
For cidr6, netmask6
2025-03-04 19:09:21 +05:30
github-actions[bot]
9f71de5227 flake.lock: Update
Flake lock file updates:

• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/9d3ae807ebd2981d593cddd0080856873139aa40?narHash=sha256-NGqpVVxNAHwIicXpgaVqJEJWeyqzoQJ9oc8lnK9%2BWC4%3D' (2025-01-29)
  → 'github:NixOS/nixpkgs/5135c59491985879812717f4c9fea69604e7f26f?narHash=sha256-Vr3Qi346M%2B8CjedtbyUevIGDZW8LcA1fTG0ugPY/Hic%3D' (2025-02-26)
2025-03-01 00:11:29 +00:00
Matt White
17cee0d876 feat(hyprland): support workspacev2 2025-02-26 18:56:11 -07:00
Matt White
0c6ca8321c feat(hyprland): support destroyworkspacev2 2025-02-26 18:56:11 -07:00
Matt White
26a344b131 feat(hyprland): support createworkspacev2 2025-02-26 18:56:11 -07:00
Harishankar G
8bd0285c88 Remove redundant if condition 2025-02-26 16:06:58 +05:30
Harishankar G
212c676251 Provide an option to show ipv4 or ipv6 or both of them 2025-02-26 15:59:33 +05:30
Alex
8490a1d9b9 chore: 0.12.0 2025-02-21 09:04:59 +01:00
Alexis Rouillard
a3ee5f1125 Update clang-format.yml 2025-02-21 09:04:22 +01:00
Alexis Rouillard
0b87af9372 Merge pull request #3922 from hansp27/niri-language-dont-ellipsize
turn off ellipsize for niri/language module
2025-02-20 09:11:33 +01:00
Alexis Rouillard
fe3dda4c23 Merge pull request #3932 from rokiden/fix-urgent-special
hyprland/workspaces: fixed urgent for special workspaces
2025-02-20 09:11:07 +01:00
Alexis Rouillard
0d8d42573b Merge pull request #3945 from zjeffer/fix/zjeffer/hyprland-ipc
Hyprland IPC improvements
2025-02-20 09:10:26 +01:00
Alexis Rouillard
d098dbbeb0 Merge pull request #3940 from Malix-Labs/patch-1
update(docs): link
2025-02-20 09:09:39 +01:00
Alexis Rouillard
533d5de243 Merge pull request #3942 from aruhier/pr_battery_module
fix: battery runtime estimation with negative sysfs values
2025-02-20 09:09:28 +01:00
Alexis Rouillard
d3c7ff6525 Merge pull request #3947 from zjeffer/fix/zjeffer/workspacerules-defaultname
Fix workspacerules not taking into account defaultName
2025-02-20 09:09:04 +01:00
zjeffer
bcee548f5e Fix workspacerules not taking into account defaultName 2025-02-20 00:06:05 +01:00
zjeffer
37c6cd42f5 fix freebsd compilation 2025-02-19 21:15:18 +01:00
zjeffer
a4989cedae formatting 2025-02-19 21:02:59 +01:00
zjeffer
5b8839ab5c Hyprland IPC improvements
Fixes IPC being blocked at shutdown
2025-02-19 20:45:47 +01:00
Anthony Ruhier
4be1f3bf42 fix: battery runtime estimation with negative sysfs values
Some drivers (example: qualcomm-battmgr, present on Snapdragon X1
laptops) expose the current_now and power_now values in sysfs as
negative int when the device is discharging, positive when charging.

This breaks the battery runtime estimation in Waybar, as it expects a
uint32 for power_now.

Change the battery module to use the absolute values of current_now and
power_now.
2025-02-16 18:33:03 +01:00
Kaosu
ddf5b3e07b add tray icons docs 2025-02-16 14:30:08 +01:00
Kaosu
d1998de47a add setCustomIcon and try to apply such when ID is known 2025-02-16 14:22:10 +01:00
Kaosu
78d5c3ef3a init custom icons from config per tray 2025-02-16 14:21:34 +01:00
Kaosu
937b62ea9a add SNI custom icon manager 2025-02-16 14:21:08 +01:00
Malix
6c4f0af2fe update(docs): link 2025-02-15 20:33:53 +01:00
Denis Kazimirov
cc94278c4e hyprland/workspaces: fixed urgent for special workspaces 2025-02-10 18:32:57 +05:00
hansi
0abb2166a4 turn off ellipsize for niri/language module 2025-02-08 00:29:09 +04:00
Bruno Andreotti
a26ed50d0f Add support for vertical bars in privacy module 2025-02-07 14:39:07 -03:00
Pol Rivero
4dbb874f7c Merge remote-tracking branch 'upstream/master' 2025-02-06 12:19:57 +01:00
Alexis Rouillard
c32d5e3883 Merge pull request #3898 from Duckulus/master
[hyprland/window] enable tooltip for hyprland window module
2025-02-05 11:44:28 +01:00
Alexis Rouillard
834868e0b5 Merge pull request #3914 from Alexays/update_flake_lock_action
flake.lock: Update
2025-02-05 09:34:43 +01:00
Alexis Rouillard
b2d11f9ec0 Merge pull request #3919 from KasyanDiGris/master
Hide upower module when specified device disconnected
2025-02-05 09:34:16 +01:00
Konstantin Vukolov
e32a678478 Hide upower module when specified device disconnected 2025-02-05 00:02:29 +03:00
Alexis Rouillard
0d5a4f82ec Merge pull request #3913 from ladenburger/fix-json-hyprland-kb-manpage
fix: JSON format for Hyprland keyboard example
2025-02-01 09:42:15 +01:00
github-actions[bot]
8bdb5c1906 flake.lock: Update
Flake lock file updates:

• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/88195a94f390381c6afcdaa933c2f6ff93959cb4?narHash=sha256-0q9NGQySwDQc7RhAV2ukfnu7Gxa5/ybJ2ANT8DQrQrs%3D' (2024-12-29)
  → 'github:NixOS/nixpkgs/9d3ae807ebd2981d593cddd0080856873139aa40?narHash=sha256-NGqpVVxNAHwIicXpgaVqJEJWeyqzoQJ9oc8lnK9%2BWC4%3D' (2025-01-29)
2025-02-01 00:10:55 +00:00
ladenburger
8a741f6ec7 fix: JSON format for Hyprland keyboard example 2025-02-01 00:38:52 +01:00
Pol Rivero
1a9f5aced7 workspace taskbars: Add button param to click command 2025-01-27 11:47:16 +01:00
Pol Rivero
7b854112ed workspace taskbars: Allow custom command on window click 2025-01-27 11:46:35 +01:00
Pol Rivero
b4519c0819 workspace taskbars: Use sigc::mem_fun instead of lambda 2025-01-27 11:46:35 +01:00
Pol Rivero
e0f3695523 workspace taskbars: Minor fixes
- Add missing CSS class to manpage
- Fix rare segfault when address is not found (seems to only happen when compiled for production)
2025-01-27 11:46:35 +01:00
Pol Rivero
42affa4eda workspace taskbars: Update manpage 2025-01-27 11:46:35 +01:00
Pol Rivero
5ee0d1c7fe workspace taskbars: Fix windows not showing
Windows were not being shown or updated unless the window-rewrite config were present.
2025-01-27 11:46:35 +01:00
Pol Rivero
3948c0d154 workspace taskbars: Focus window on click 2025-01-27 11:46:35 +01:00
Pol Rivero
53ca5a4883 workspace taskbars: Display windows in a consistent order
Use a vector instead of a map for for storing the workspace windows.
This orders the windows by the time they were added to the workspace, instead of sorting by address (which is effectively a random order). The new ordering seems to match the wlr/taskbar module
2025-01-27 11:46:35 +01:00
Pol Rivero
e1649b001f workspace taskbars: Fix title not updating
Fix another older bug where the title of a window will not be updated after moving it to another monitor.
In onWindowMoved, when moving an orphan window to the display of the current bar, that window should no longer be an orphan.
2025-01-27 11:46:35 +01:00
Pol Rivero
5e1d6d1cc5 workspace taskbars: Fix title not updating
This seems to be an old bug that has been made visible with the new workspace taskbars feature.
Sometimes, when closing a window and re-opening a window of the same program, hyprland reuses the window address. Since m_orphanWindowMap was not being cleaned up on window close, the new window would not be updated properly.
2025-01-27 11:46:35 +01:00
Pol Rivero
fdb9004048 workspace taskbars: More config options
- orientation
- icon-size
- icon-theme
2025-01-27 11:46:35 +01:00
Pol Rivero
1c07ca0099 workspace taskbars: Add config parsing
Use format from config instead of hardcoding
2025-01-27 11:46:35 +01:00
Pol Rivero
69e2e249a6 Initial implementation of workspace taskbars
Add a list of window titles and icons to each workspace (like wlr/taskbar but grouped by workspace).

Only implemented on hyprland for now.
2025-01-27 11:46:35 +01:00
Pol Rivero
bc2e143ac5 Extract icon loading logic to separate class 2025-01-27 11:46:35 +01:00
Alex
481b01d9af fix: lint 2025-01-25 09:31:32 +01:00
Alexis Rouillard
90911a15b6 Merge pull request #3902 from Alexays/revert-3474-battery-plugging-instant-updates
Revert "Make battery module update on plugging/unplugging again (refs #2519)"
2025-01-25 09:24:57 +01:00
Alexis Rouillard
bb2c67ebad Revert "Make battery module update on plugging/unplugging again (refs #2519)" 2025-01-25 09:24:48 +01:00
Alexis Rouillard
dc64b3542b Merge pull request #3474 from schmop/battery-plugging-instant-updates
Make battery module update on plugging/unplugging again (refs #2519)
2025-01-25 09:20:02 +01:00
Duckulus
ba12ca71c0 enable tooltip for hyprland window module 2025-01-22 18:39:50 +01:00
Torstein Husebø
6004316f1a Fix typos in function, variable names and in documentation 2025-01-16 13:25:19 +01:00
Khiet Tam Nguyen
36a1c89e30 Merge branch 'Alexays:master' into hyprland/windowcount 2025-01-13 10:33:05 +11:00
Alexis Rouillard
a4241d7008 Merge pull request #3823 from thetwistedlogic/feature/river-hide-vacant
Hide vacant tags config option on River
2025-01-12 11:32:45 +01:00
Alexis Rouillard
ab0acd07fe Merge pull request #3862 from emar10/config-include-wildcards
Allow using wildcards in config include paths
2025-01-12 11:29:26 +01:00
Alexis Rouillard
4ec121822a Merge pull request #3877 from pol-rivero/tray-tooltip
Escape tray tooltip text
2025-01-12 11:27:57 +01:00
Pol Rivero
0992bf1b87 Escape tray tooltip text
Fix errors when the tooltip set by the tray apps contains markup characters
2025-01-10 16:41:33 +01:00
Alexis Rouillard
369c81d6f2 Merge pull request #3875 from alexlnkp/master
fix: never sleep cava when sleep_timer is 0
2025-01-10 09:34:00 +01:00
Alex Murkoff
6a29abb49e fix: never sleep cava when sleep_timer is 0 2025-01-10 15:27:41 +07:00
Alexis Rouillard
9d9f1d6819 Merge pull request #3866 from AngryLoki/libcxx
Fix compilation with libc++
2025-01-04 15:38:23 +01:00
Sv. Lockal
865121b21d Fix compilation with libc++
This file uses std::sort and does not import correct header.
Compilation with libstdc++ worked due to some indirect import, but compilation with LLVM libc++ fails.
2025-01-04 10:28:14 +00:00
YamaD
d7e4a7d91f add module wayfire/window, wayfire/workspaces 2025-01-03 15:22:46 +09:00
Ethan Martin
d1dac2854a Allow using wildcards in config include paths
Updates `Config::tryExpandPath()` to return a vector of expanded path
matches instead of a single path wrapped in an optional, with an empty
vector indicating no matches.

`Config::resolveConfigIncludes()` iterates over all of these matches,
while other instances of path expansion (such as finding the base config
path) retain their existing behavior and only use the first match.
2025-01-02 20:50:39 -05:00
Khiet Tam Nguyen
565602114e Merge branch 'Alexays:master' into hyprland/windowcount 2025-01-03 12:18:38 +11:00
Alexis Rouillard
ac08b752e3 Merge pull request #3859 from Alexays/update_flake_lock_action
flake.lock: Update
2025-01-01 14:19:17 +01:00
Alexis Rouillard
fe2f847e6d Merge pull request #3860 from JasonnnW3000/master
Update LICENSE, fix copyright license year
2025-01-01 14:19:08 +01:00
JasonnnW3000
3555417a4f Update LICENSE, fix license year
Signed-off-by: JasonnnW3000 <sufssl04@gmail.com>
2025-01-01 06:34:11 -05:00
github-actions[bot]
884550964e flake.lock: Update
Flake lock file updates:

• Updated input 'flake-compat':
    'github:edolstra/flake-compat/9ed2ac151eada2306ca8c418ebd97807bb08f6ac?narHash=sha256-HRJ/18p%2BWoXpWJkcdsk9St5ZiukCqSDgbOGFa8Okehg%3D' (2024-11-27)
  → 'github:edolstra/flake-compat/ff81ac966bb2cae68946d5ed5fc4994f96d0ffec?narHash=sha256-NeCCThCEP3eCl2l/%2B27kNNK7QrwZB1IJCrXfrbv5oqU%3D' (2024-12-04)
• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/970e93b9f82e2a0f3675757eb0bfc73297cc6370?narHash=sha256-jNRNr49UiuIwaarqijgdTR2qLPifxsVhlJrKzQ8XUIE%3D' (2024-11-28)
  → 'github:NixOS/nixpkgs/88195a94f390381c6afcdaa933c2f6ff93959cb4?narHash=sha256-0q9NGQySwDQc7RhAV2ukfnu7Gxa5/ybJ2ANT8DQrQrs%3D' (2024-12-29)
2025-01-01 00:11:33 +00:00
Stefan Haan
d100e78872 mpd: add uri and filename format arguments 2024-12-28 13:58:19 +01:00
Alexis Rouillard
5346649fc6 Merge pull request #3827 from pope/master
Escape markup characters in dwl/window
2024-12-26 09:37:00 +01:00
Alexis Rouillard
6ce881abd5 Merge pull request #3826 from DreamMaoMao/fix-hyprland-window-crash
fix: hyprland/window get empty ipc json data
2024-12-26 09:36:33 +01:00
Alexis Rouillard
dbb708c88e Merge pull request #3831 from c4rlo/sway-fix-config-warning
sway: fix "Mapping is not an object" warning
2024-12-26 09:36:07 +01:00
Khiet Tam Nguyen
d29a17d703 Merge branch 'Alexays:master' into hyprland/windowcount 2024-12-22 17:12:54 +11:00
Bahnschrift
cf64b2c88c fix: un-hide tray when new icons are added 2024-12-19 12:29:58 +11:00
Bahnschrift
622f22d6b5 fix: hide tray when there are no non-passive icons 2024-12-19 12:09:31 +11:00
Carlo Teubner
8e276bb3f6 sway: fix "Mapping is not an object" warning
Fixes #3763.

Also a little code simplications while we're at it.
2024-12-17 22:05:16 +00:00
K. Adam Christensen
157ea44510 Escape markup characters in dwl/window
Without this, markup characters like [&><] will be injected directly
into the Label. Escaping them makes sure that the values will be printed
exactly as they appear in the window title or layout symbol.

Signed-off-by: K. Adam Christensen <pope@shifteleven.com>
2024-12-14 09:06:13 -08:00
DreamMaoMao
01ae117cfe fix: hyprland/window get empty ipc json data 2024-12-14 21:02:10 +08:00
twistedlogic
8e0964ad15 feat: is visible and urgent checks as well 2024-12-12 10:11:11 -04:00
twistedlogic
8024df0430 fix: edge case where tags get hidden after all views are killed
This fixes an edge case where focused tags would get hidden if all
clients on a tag get killed
2024-12-11 22:50:01 -04:00
twistedlogic
43af1b9ea0 feat: implement hide vacant for river 2024-12-11 22:18:00 -04:00
Alexis Rouillard
e959f1d230 Merge pull request #3808 from Nambers/master
Using 'auto' instead of 'self' in backlight module
2024-12-07 09:58:30 +01:00
Alexis Rouillard
347c44209d Merge pull request #3806 from meithecatte/livelock-fix
Add locking for interacting with the pulseaudio thread
2024-12-07 09:56:28 +01:00
Alexis Rouillard
758c14c5d8 Merge pull request #3801 from majutsushi/sway-workspaces-x11-class
sway/workspaces: use X11 class for XWayland windows
2024-12-07 09:55:57 +01:00
Alexis Rouillard
78d2ce3791 Merge pull request #3809 from gustafullberg/ipv4ipv6
Let network module handle ipv4 and ipv6 simultaneously
2024-12-07 09:55:24 +01:00
Gustaf Ullberg
db943dae98 Let network module handle ipv4 and ipv6 simultaneously 2024-12-05 15:31:40 +01:00
eritque0arcus
6bac784b51 fix: use auto and add self as fallback 2024-12-04 12:46:09 -06:00
Maja Kądziołka
6d28740896 Add locking for interacting with the pulseaudio thread
Before this commit, Waybar would sometimes get into a state
where it would consume 100% of a CPU core, and the pulseaudio widget
would stop responding to volume adjustments.

In this state, the pulseaudio mainloop thread would spin, with the
counter of enabled defer events at 1, but no actual enabled defer
event in the list to get the counter back to zero after an iteration
in the mainloop.

This could happen if the unsynchronized interactions with the mainloop
thread happened to modify the list of deferred events at the same
time as the mainloop.

This commit introduces locking in accordance with the PulseAudio
documentation on the threaded mainloop:

> The lock needs to be held whenever you call any PulseAudio function that
> uses an object associated with this main loop. Those objects include
> pa_mainloop, pa_context, pa_stream and pa_operation, and the various event
> objects (pa_io_event, pa_time_event, pa_defer_event).
2024-12-03 19:37:36 +01:00
Alexis Rouillard
3abac0abfd Merge pull request #3800 from Alexays/update_flake_lock_action
flake.lock: Update
2024-12-01 12:03:59 +01:00
github-actions[bot]
0e5728b533 flake.lock: Update
Flake lock file updates:

• Updated input 'flake-compat':
    'github:edolstra/flake-compat/0f9255e01c2351cc7d116c072cb317785dd33b33?narHash=sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U%3D' (2023-10-04)
  → 'github:edolstra/flake-compat/9ed2ac151eada2306ca8c418ebd97807bb08f6ac?narHash=sha256-HRJ/18p%2BWoXpWJkcdsk9St5ZiukCqSDgbOGFa8Okehg%3D' (2024-11-27)
• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/807e9154dcb16384b1b765ebe9cd2bba2ac287fd?narHash=sha256-l253w0XMT8nWHGXuXqyiIC/bMvh1VRszGXgdpQlfhvU%3D' (2024-10-29)
  → 'github:NixOS/nixpkgs/970e93b9f82e2a0f3675757eb0bfc73297cc6370?narHash=sha256-jNRNr49UiuIwaarqijgdTR2qLPifxsVhlJrKzQ8XUIE%3D' (2024-11-28)
2024-12-01 00:12:55 +00:00
Jan Larres
4e05659109 sway/workspaces: use X11 class for XWayland windows
When using `window-rewrite`, the `class<>` rule would previously only
match against the `app_id` of a window. However, XWayland windows don't
have an app ID.

This change falls back to checking the `class` window property if there
is no app ID to support matching against XWayland windows.
2024-12-01 12:48:07 +13:00
Khiet Tam Nguyen
334fc6e0e4 Merge branch 'Alexays:master' into hyprland/windowcount 2024-11-30 19:37:29 +11:00
Alexis Rouillard
20ca48c3b8 Merge pull request #3768 from deprekated/fix_privacy_null_deref
fix null-deref due to unconstructed PrivacyNodeInfo
2024-11-20 09:02:38 +01:00
Alexis Rouillard
b863627c22 Merge pull request #3730 from TripleTrable/AModuls/expand-fill-no-center
Add stretching of modules and  modules-center toggling
2024-11-20 09:01:33 +01:00
Lars Niesen
1e481b7ac0 fix broken clang-format to run pipeline 2024-11-20 00:00:51 +01:00
Lars Niesen
f9acc1fed9 Add stretching of modules and modules-center toggling
This Patch allows the stretching of modules-{left,center,right} as well
add a "expand" flag to AModule. This allows one module to consume the
leftover space.
To allow the left or right modules to fully consume the center, the
changes also include a way to remove the center box (center_)
altogether.
2024-11-20 00:00:27 +01:00
Khiet Tam Nguyen
17d7cea4fd Merge branch 'Alexays:master' into hyprland/windowcount 2024-11-17 08:37:04 +11:00
Kate Adkins
86ce9f7278 fix null-deref due to unconstructed PrivacyNodeInfo
This would cause Waybar to crash if the privacy module ever got
e.g. a empty (but properly null-terminated) string for the
application_name.
2024-11-15 12:32:55 -07:00
Alexis Rouillard
8645115619 Merge pull request #3736 from Alexays/update_flake_lock_action
flake.lock: Update
2024-11-13 16:36:28 +01:00
Alexis Rouillard
63edb402ef Merge pull request #3747 from Aqa-Ib/patch-1
fix hyprland's grouped window flags
2024-11-13 15:42:38 +01:00
Ricardo Nogueira
ddb3016440 add rewrite to wlr tooltip 2024-11-12 17:10:05 -03:00
Alexis Rouillard
52d582b93a Merge pull request #3758 from ArijanJ/signals-in-manpage 2024-11-10 17:28:07 +01:00
ArijanJ
724a4a5ed3 Add signals section to manpage 2024-11-10 12:50:26 +01:00
Aqa-Ib
77b50b4c7a fix hyprland's grouped window flags
Both flags are wrong, because:
- the active group member can be fullscreened.
- technically, a grouped window can be solo as well, because only the active group member is shown, the other members are hidden. Also you can have a group consisting of only one window.
2024-11-06 13:07:09 +00:00
github-actions[bot]
3f80e507fd flake.lock: Update
Flake lock file updates:

• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/06cf0e1da4208d3766d898b7fdab6513366d45b9?narHash=sha256-S5kVU7U82LfpEukbn/ihcyNt2%2BEvG7Z5unsKW9H/yFA%3D' (2024-09-29)
  → 'github:NixOS/nixpkgs/807e9154dcb16384b1b765ebe9cd2bba2ac287fd?narHash=sha256-l253w0XMT8nWHGXuXqyiIC/bMvh1VRszGXgdpQlfhvU%3D' (2024-10-29)
2024-11-01 00:11:22 +00:00
Alexis Rouillard
5f260516af Merge pull request #3674 from PassiHD2004/master
Add warning threshold to temperature module
2024-10-25 08:52:44 +02:00
Alexis Rouillard
9d89ddae9b Merge pull request #3464 from findus/pulseaudio-default-sink
pulseaudio: volume indicator update on default output switch
2024-10-25 08:52:18 +02:00
Blexyel
bb40e169fd feat: update man page 2024-10-22 10:56:26 +02:00
Alexis Rouillard
dacecb9b26 Merge pull request #3695 from cfillion/fix-hyprland-crashes
Fix a crash after handling SIGINT and a data race when initializing the Hyprland workspace modules
2024-10-21 14:58:34 +02:00
Christian Fillion
92242f0b9d hyprland: fix a data race at startup between sockets 1 and 2
`Workspaces::*` and `IPC::startIPC` may both call `getSocketFolder` at the same time.

This randomly causes crashes and/or corruption of the socket path.

Typical crash A:

    [2024-10-16 07:42:09.987] [info] Hyprland IPC starting
    malloc(): unaligned tcache chunk detected
    [2024-10-16 07:42:09.987] [error] Hyprland IPC: Unable to connect?
    Thread 1 "waybar" received signal SIGABRT, Aborted.
    (gdb) bt
    #0  __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at pthread_kill.c:44
    (omitted for brievety)
    #9  0x00007ffff64ae745 in operator new (sz=sz@entry=296) at /usr/src/debug/gcc/gcc/libstdc++-v3/libsupc++/new_op.cc:50
    #10 0x00007ffff65ab1f1 in std::filesystem::__cxx11::path::_List::_Impl::copy (this=0x555555a23350) at /usr/src/debug/gcc/gcc/libstdc++-v3/src/c++17/fs_path.cc:249
    #11 0x00007ffff65ab3bd in std::filesystem::__cxx11::path::_List::_List (this=0x7fffffff9d30, other=<optimized out>) at /usr/src/debug/gcc/gcc-build/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/unique_ptr.h:454
    #12 0x00005555556f4ab1 in waybar::modules::hyprland::IPC::getSocket1Reply(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) ()
    #13 0x00005555556f5e3d in waybar::modules::hyprland::IPC::getSocket1JsonReply(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) ()
    #14 0x000055555571289c in waybar::modules::hyprland::Workspaces::setCurrentMonitorId() ()

Typical crash B:

    [2024-10-16 10:01:15.859] [info] Hyprland IPC starting
    [2024-10-16 10:01:15.859] [info] Loading persistent workspaces from Hyprland workspace rules
    Thread 8 "waybar" received signal SIGSEGV, Segmentation fault.
    (gdb) bt
    #0  std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_S_copy
        (__d=0x5555558fbca8 "/", __s=0x2973961a26d35726 <error: Cannot access memory at address 0x2973961a26d35726>, __n=1)
        at /usr/src/debug/gcc/gcc-build/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/basic_string.h:433
    (omitted for brievety)
    #15 waybar::modules::hyprland::IPC::getSocketFolder[abi:cxx11](char const*)
        (instanceSig=0x7fffffffe604 "4520b30d498daca8079365bdb909a8dea38e8d55_1729051218_1982280648") at ../src/modules/hyprland/backend.cpp:41
    #16 0x000055555564230f in waybar::modules::hyprland::IPC::startIPC()::{lambda()#1}::operator()() const ()
        at ../src/modules/hyprland/backend.cpp:70
    #17 0x00007ffff64e1c34 in std::execute_native_thread_routine (__p=0x5555558119c0) at /usr/src/debug/gcc/gcc/libstdc++-v3/src/c++11/thread.cc:104
    #18 0x00007ffff62a339d in start_thread (arg=<optimized out>) at pthread_create.c:447
2024-10-17 06:46:07 -04:00
Christian Fillion
0e03c7a811 fix a segfault on signals received after main returns
The waybar process does not exit instantaneously.
Signals may be recevied after main has started freeing resources.

When a worker thread is in `fgets` this time window can last forever.
An easy way to duplicate the crash is pressing ^C twice with a Hyprland module.

    Thread 1 "waybar" received signal SIGSEGV, Segmentation fault.
    spdlog::sinks::sink::should_log (this=0x5f620b542ca5,
        msg_level=spdlog::level::info)
        at /usr/src/debug/spdlog/spdlog-1.14.1/include/spdlog/sinks/sink-inl.h:13
    13	  return msg_level >= level_.load(std::memory_order_relaxed);
    (gdb) p $_siginfo._sifields._sigfault.si_addr
    $1 = (void *) 0x5f620b542cad
2024-10-16 10:04:04 -04:00
PassiHD
6df26ccba7 feat: add warning threshold to temperature module
Signed-off-by: PassiHD <passihd@phoenixts.eu>
2024-10-09 20:22:58 +02:00
Khiet Tam Nguyen
278588b1a3 Merge branch 'Alexays:master' into hyprland/windowcount 2024-10-06 00:34:20 +10:00
Alexis Rouillard
280f11e247 Merge pull request #3658 from Alexays/update_flake_lock_action 2024-10-01 07:42:02 +02:00
github-actions[bot]
95eaffcfb1 flake.lock: Update
Flake lock file updates:

• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/4f807e8940284ad7925ebd0a0993d2a1791acb2f?narHash=sha256-IiA3jfbR7K/B5%2B9byVi9BZGWTD4VSbWe8VLpp9B/iYk%3D' (2024-09-11)
  → 'github:NixOS/nixpkgs/06cf0e1da4208d3766d898b7fdab6513366d45b9?narHash=sha256-S5kVU7U82LfpEukbn/ihcyNt2%2BEvG7Z5unsKW9H/yFA%3D' (2024-09-29)
2024-10-01 00:11:21 +00:00
Alexis Rouillard
e7b2d33d99 Merge pull request #3637 from TripleTrable/backlight/add_min_brightness
#2275  Backlight: Add minimum brightness
2024-09-30 09:17:15 +02:00
Alexis Rouillard
281911c9b3 Merge pull request #3652 from khaneliman/flake 2024-09-29 09:06:40 +02:00
Austin Horstman
e53497bab6 .github/workflows: allow forks to manually run flake lock update 2024-09-28 13:21:55 -05: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
Lars Niesen
d684a6de21 Backlight: Set default to 0 to prevent breaking existing setups 2024-09-25 16:37:21 +02:00
Alexis Rouillard
cad18f39f5 Merge pull request #3640 from mslxl/master
nix: remove patches from downstream
2024-09-25 14:18:52 +02:00
Lars Niesen
47f767b0ee Backlight: Add documentation for min-brightness 2024-09-25 06:24:24 +02:00
Lars Niesen
04bda9f443 Backlight: Add minimum brightness
As currently it is possible to turn the brightness to zero which may not
be desirable, this patch add a configurable brightness check.
2024-09-25 06:24:03 +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
Rowan Leeder
2dfef1c213 Issue-3092 Add node type to wireplumber logs
- The module only fetches nodes for "node-type". This causes the 'onMixerChanged' log to spam whenever two or more
  wireplumber modules were registered on different nodes. To reduce this the unknown node warning will now only print
  if the node is not the focus of any current module.
2024-09-25 05:06:15 +10:00
Rowan Leeder
71a53eb79d Issue-3092 Add source support to wireplumber module
- Adds microphone support etc to the wireplumber module.

  The existing module hardcodes the selected node type to "Audio/Sink". This feature allows the user to override this
  via `"node-type": "Audio/Source"`.

- Unlike the pulseaudio module, this change does not try to see the module manage both input and output. The same effect
  can be achieved by running two instances of the wireplumber module.

  This approach:
  - Works around some of the complexity overhead that seem to have caused similar PRs to stall.
  - Using separate module instances also allows both the microphone and speaker levels to be controlled with a scroll
    wheel. This is something a unified module like pulseaudio struggles with.
  - Similarly, separate instances allows the source volume level to be exposed as the state. Ie- the linear-gradient
    css patterns can be applied to both input and output.
2024-09-25 05:03:24 +10: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
Philipp Hentschel
57156bce7e removed manual flag from clang format again 2024-09-21 13:25:36 +02:00
Philipp Hentschel
e3095c6d1d clang-format 2024-09-21 13:25:36 +02:00
Findus
951b89ffcb Update clang-format.yml
workflow dispatch to debug failing workflow manually
2024-09-21 13:25:36 +02:00
Philipp Hentschel
d6bfeb5a44 added is running condition to default_sink_is_running check 2024-09-21 13:25:36 +02:00
Philipp Hentschel
8b1d73690d added running check to default sink return condition 2024-09-21 13:25:36 +02:00
Philipp Hentschel
9c47b2e9dd removed debug logging 2024-09-21 13:25:36 +02:00
Philipp Hentschel
dedee8cd14 pulseaudio: show correct sink volume on default output changes
on sinkInfo callbacks, the default sink now has highest priority.
That fixes an issue that the volume indicator is not updated when
the changes the default output to another devices.

added PA_SINK_IDLE as valid state. PA_SINK_RUNNING is only true
if any sound output is happening on sink switch. Indicator should
also update when no sound is being played.
2024-09-21 13:25:36 +02: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
Khiet Tam Nguyen
636ef21f6e Merge branch 'Alexays:master' into hyprland/windowcount 2024-09-15 18:11:41 +10: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
Khiet Tam Nguyen
4cb2bf06b7 Merge branch 'Alexays:master' into hyprland/windowcount 2024-09-14 13:42:04 +10: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
Khiet Tam Nguyen
fd67c6e915 docs: rewording of separate-outputs in man page 2024-08-25 00:05:41 +10:00
Khiet Tam Nguyen
b82bcdb515 docs: updated documentation for windowcount.5.scd 2024-08-24 15:21:33 +10:00
Khiet Tam Nguyen
13bc497abd style: clang-format 2024-08-24 15:21:04 +10:00
Khiet Tam Nguyen
8254bd72b7 style: applied clang-format on windowcount.cpp 2024-08-24 13:36:00 +10:00
Khiet Tam Nguyen
9254ef6f2f docs: updated scd man pages 2024-08-24 13:29:46 +10:00
Khiet Tam Nguyen
a5e322ee66 fix: remove rewrite 2024-08-24 12:59:57 +10:00
Khiet Tam Nguyen
6aa8aa3b22 fix: remove focused_ 2024-08-24 12:57:10 +10:00
Khiet Tam Nguyen
f7e1d34251 feat: added empty and fullscreen style classes 2024-08-24 01:33:15 +10:00
Khiet Tam Nguyen
38ffb24c52 feat: format-fullscreen and format-windowed override added 2024-08-24 01:25:50 +10:00
Khiet Tam Nguyen
1b282e67a7 fix: remove unused attributes 2024-08-24 01:06:00 +10:00
Khiet Tam Nguyen
1806edcb06 fix: remove unused variable 2024-08-24 01:04:58 +10:00
Khiet Tam Nguyen
e40bc27257 fix: default separate-outputs to true 2024-08-24 00:40:41 +10:00
Khiet Tam Nguyen
58e4f89a82 fix: allow custom format 2024-08-24 00:40:22 +10:00
Khiet Tam Nguyen
d64c80e234 temp: working implementation 2024-08-24 00:14:30 +10:00
Khiet Tam Nguyen
5c859bf520 temp: changed window -> windowcount 2024-08-24 00:06:24 +10: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
schmop
f4608b3e31 Fix battery status changes not being detected
Historically we listened to /sys/class/poewr_supply inotify events,
which does not seem to work anymore.
We switched now to udev netlink kernel events.
2024-07-27 01:15:42 +02: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
Alessio Molinari
ea4b95fdd2 Fix: move init gdbusproxy after proxy_device_bat nullcheck
Co-authored-by: Alexis Rouillard <alexisr245@gmail.com>
2024-03-04 16:34:45 +01:00
Alessio Molinari
d831a45622 fix: restore signature 2024-02-04 18:01:26 +01:00
Alessio Molinari
2de8a83d84 feat: fetch battery percentage from upower if not found from bluez 2024-02-04 17:20:45 +01:00
Alexis Rouillard
ee0958973b Merge branch 'master' into issue-1681 2023-07-04 22:49:35 +02:00
Ruan E. Formigoni
15132aeec3 Fix for leftover pids 2022-11-15 01:19:51 -03:00
Ruan E. Formigoni
38af4a6f16 exec runs after on-* events 2022-11-10 02:36:54 -03:00
270 changed files with 12474 additions and 5057 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

@@ -7,13 +7,16 @@ concurrency:
cancel-in-progress: true
jobs:
build:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: DoozyX/clang-format-lint-action@v0.16.2
# TODO: bump to clang 19 release
# - uses: DoozyX/clang-format-lint-action@v0.18.2
- uses: DoozyX/clang-format-lint-action@558090054b3f39e3d6af24f0cd73b319535da809
name: clang-format
with:
source: "."
extensions: "hpp,h,cpp,c"
clangFormatVersion: 16
style: "file:.clang-format"
clangFormatVersion: 19

View File

@@ -7,7 +7,7 @@ concurrency:
cancel-in-progress: true
jobs:
build:
lint:
runs-on: ubuntu-latest
container:
image: alexays/waybar:debian

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

@@ -0,0 +1,34 @@
name: Build and Push Docker Image
on:
workflow_dispatch:
schedule:
# run monthly
- cron: '0 0 1 * *'
jobs:
build-and-push:
runs-on: ubuntu-latest
if: github.event_name != 'schedule' || 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

@@ -7,30 +7,29 @@ concurrency:
cancel-in-progress: true
jobs:
clang:
build:
# Run actions in a FreeBSD VM on the ubuntu runner
# https://github.com/actions/runner/issues/385 - for FreeBSD runner support
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Test in FreeBSD VM
uses: cross-platform-actions/action@v0.23.0
uses: cross-platform-actions/action@v0.28.0
timeout-minutes: 180
env:
CPPFLAGS: '-isystem/usr/local/include'
LDFLAGS: '-L/usr/local/lib'
with:
operating_system: freebsd
version: "13.2"
version: "14.2"
environment_variables: CPPFLAGS LDFLAGS
sync_files: runner-to-vm
run: |
sudo sed -i '' 's/quarterly/latest/' /etc/pkg/FreeBSD.conf
sudo pkg install -y git # subprojects/date
sudo pkg install -y catch evdev-proto gtk-layer-shell gtkmm30 jsoncpp \
libdbusmenu libevdev libfmt libmpdclient libudev-devd meson \
pkgconf pulseaudio scdoc sndio spdlog wayland-protocols upower \
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.event_name != 'schedule' || 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

3
.gitignore vendored
View File

@@ -7,6 +7,7 @@ vgcore.*
*.swp
packagecache
/subprojects/**/
/subprojects/.wraplock
/build*
/dist
/meson.egg-info
@@ -48,3 +49,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

@@ -1,6 +1,6 @@
# vim: ft=Dockerfile
FROM debian:sid
FROM debian:sid-slim
RUN apt update && \
apt install --no-install-recommends --no-install-suggests -y \
@@ -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,6 +6,6 @@ RUN export FEATURES="-ipc-sandbox -network-sandbox -pid-sandbox -sandbox -usersa
emerge --sync && \
eselect news read --quiet new 1>/dev/null 2>&1 && \
emerge --verbose --update --deep --with-bdeps=y --backtrack=30 --newuse @world && \
USE="wayland gtk3 gtk -doc X pulseaudio minimal" emerge dev-vcs/git dev-libs/wayland dev-libs/wayland-protocols =dev-cpp/gtkmm-3.24.6 x11-libs/libxkbcommon \
USE="wayland gtk3 gtk -doc X pulseaudio minimal" emerge dev-vcs/git dev-libs/wayland dev-libs/wayland-protocols dev-cpp/gtkmm:3.0 x11-libs/libxkbcommon \
x11-libs/gtk+:3 dev-libs/libdbusmenu dev-libs/libnl sys-power/upower media-libs/libpulse dev-libs/libevdev media-libs/libmpdclient \
media-sound/sndio gui-libs/gtk-layer-shell app-text/scdoc media-sound/playerctl dev-libs/iniparser sci-libs/fftw

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

@@ -1,6 +1,6 @@
MIT License
Copyright (c) 2018 Alex
Copyright (c) 2025 Alex
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

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
@@ -20,8 +20,12 @@ debug-run: build-debug
./build/waybar --log-level debug
test:
meson test -C build --no-rebuild --verbose --suite waybar
meson test -C build --verbose --suite waybar
.PHONY: test
test-detailed:
meson test -C build --verbose --print-errorlogs --test-args='--reporter console -s'
.PHONY: test-detailed
clean:
rm -rf build

View File

@@ -8,7 +8,8 @@
- Sway (Workspaces, Binding mode, Focused window name)
- River (Mapping mode, Tags, Focused window name)
- Hyprland (Window Icons, Workspaces, Focused window name)
- DWL (Tags, Focused window name) [requires dwl ipc patch](https://github.com/djpohly/dwl/wiki/ipc)
- Niri (Workspaces, Focused window name, Language)
- DWL (Tags, Focused window name) [requires dwl ipc patch](https://codeberg.org/dwl/dwl-patches/src/branch/main/patches/ipc)
- Tray [#21](https://github.com/Alexays/Waybar/issues/21)
- Local time
- Battery
@@ -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
@@ -115,6 +116,36 @@ sudo apt install \
libxkbregistry-dev
```
On Arch, you can use this command:
```
pacman -S --asdeps \
gtkmm3 \
jsoncpp \
libsigc++ \
fmt \
wayland \
chrono-date \
spdlog \
gtk3 \
gobject-introspection \
libgirepository \
libpulse \
libnl \
libappindicator-gtk3 \
libdbusmenu-gtk3 \
libmpdclient \
sndio \
libevdev \
libxkbcommon \
upower \
meson \
cmake \
scdoc \
wayland-protocols \
glib2-devel
```
Contributions welcome!<br>
Have fun :)<br>

5
asan.supp Normal file
View File

@@ -0,0 +1,5 @@
# Suppress common address sanitizer issues in dependencies, these are often non-fixable or not an issue.
# Use it like this (when in repo root): ASAN_OPTIONS="suppressions=./asan.supp" ./build/waybar
leak:libpangoft2-1.0.so.0
leak:libgtk-3.so.0
leak:libfontconfig.so.1

View File

@@ -1,10 +1,9 @@
(import
(
let lock = builtins.fromJSON (builtins.readFile ./flake.lock); in
fetchTarball {
url = "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz";
sha256 = lock.nodes.flake-compat.locked.narHash;
}
)
{ src = ./.; }
).defaultNix
(import (
let
lock = builtins.fromJSON (builtins.readFile ./flake.lock);
in
fetchTarball {
url = "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz";
sha256 = lock.nodes.flake-compat.locked.narHash;
}
) { src = ./.; }).defaultNix

12
flake.lock generated
View File

@@ -3,11 +3,11 @@
"flake-compat": {
"flake": false,
"locked": {
"lastModified": 1696426674,
"narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
"lastModified": 1767039857,
"narHash": "sha256-vNpUSpF5Nuw8xvDLj2KCwwksIbjua2LZCqhV1LNRDns=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
"rev": "5edf11c44bc78a0d334f6334cdaf7d60d732daab",
"type": "github"
},
"original": {
@@ -18,11 +18,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1711163522,
"narHash": "sha256-YN/Ciidm+A0fmJPWlHBGvVkcarYWSC+s3NTPk/P+q3c=",
"lastModified": 1766902085,
"narHash": "sha256-coBu0ONtFzlwwVBzmjacUQwj3G+lybcZ1oeNSQkgC0M=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "44d0940ea560dee511026a53f0e2e2cde489b4d4",
"rev": "c0b0e0fddf73fd517c3471e546c0df87a42d53f4",
"type": "github"
},
"original": {

145
flake.nix
View File

@@ -9,59 +9,118 @@
};
};
outputs = { self, nixpkgs, ... }:
outputs =
{ self, nixpkgs, ... }:
let
inherit (nixpkgs) lib;
genSystems = func: lib.genAttrs [
"x86_64-linux"
"aarch64-linux"
]
(system: func (import nixpkgs { inherit system; }));
genSystems =
func:
lib.genAttrs
[
"x86_64-linux"
"aarch64-linux"
]
(
system:
func (
import nixpkgs {
inherit system;
overlays = with self.overlays; [
waybar
];
}
)
);
mkDate = longDate: (lib.concatStringsSep "-" [
(builtins.substring 0 4 longDate)
(builtins.substring 4 2 longDate)
(builtins.substring 6 2 longDate)
]);
mkDate =
longDate:
(lib.concatStringsSep "-" [
(builtins.substring 0 4 longDate)
(builtins.substring 4 2 longDate)
(builtins.substring 6 2 longDate)
]);
in
{
devShells = genSystems
(pkgs:
{
default =
pkgs.mkShell
{
name = "waybar-shell";
devShells = genSystems (pkgs: {
default = pkgs.mkShell {
name = "waybar-shell";
# inherit attributes from upstream nixpkgs derivation
inherit (pkgs.waybar) buildInputs depsBuildBuild depsBuildBuildPropagated depsBuildTarget
depsBuildTargetPropagated depsHostHost depsHostHostPropagated depsTargetTarget
depsTargetTargetPropagated propagatedBuildInputs propagatedNativeBuildInputs strictDeps;
# inherit attributes from upstream nixpkgs derivation
inherit (pkgs.waybar)
buildInputs
depsBuildBuild
depsBuildBuildPropagated
depsBuildTarget
depsBuildTargetPropagated
depsHostHost
depsHostHostPropagated
depsTargetTarget
depsTargetTargetPropagated
propagatedBuildInputs
propagatedNativeBuildInputs
strictDeps
;
# overrides for local development
nativeBuildInputs = pkgs.waybar.nativeBuildInputs ++ (with pkgs; [
clang-tools
gdb
]);
};
});
# overrides for local development
nativeBuildInputs =
pkgs.waybar.nativeBuildInputs
++ (with pkgs; [
nixfmt
clang-tools
gdb
]);
};
});
overlays.default = final: prev: {
waybar = final.callPackage ./nix/default.nix {
# take the first "version: '...'" from meson.build
version =
(builtins.head (builtins.split "'"
(builtins.elemAt
(builtins.split " version: '" (builtins.readFile ./meson.build))
2)))
+ "+date=" + (mkDate (self.lastModifiedDate or "19700101")) + "_" + (self.shortRev or "dirty");
formatter = genSystems (
pkgs:
pkgs.treefmt.withConfig {
settings = {
formatter = {
clang-format = {
options = [ "-i" ];
command = lib.getExe' pkgs.clang-tools "clang-format";
excludes = [ ];
includes = [
"*.c"
"*.cpp"
"*.h"
"*.hpp"
];
};
nixfmt = {
command = lib.getExe pkgs.nixfmt;
includes = [ "*.nix" ];
};
};
tree-root-file = ".git/index";
};
}
);
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

@@ -21,12 +21,16 @@ class ALabel : public AModule {
protected:
Gtk::Label label_;
std::string format_;
const std::chrono::seconds interval_;
const std::chrono::milliseconds interval_;
bool alt_ = false;
std::string default_format_;
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,15 +14,17 @@ 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;
/// Emitting on this dispatcher triggers a update() call
Glib::Dispatcher dp;
bool expandEnabled() const;
protected:
// Don't need to make an object directly
// Derived classes are able to use it
@@ -31,22 +34,27 @@ class AModule : public IModule {
enum SCROLL_DIR { NONE, UP, DOWN, LEFT, RIGHT };
SCROLL_DIR getScrollDir(GdkEventScroll *e);
bool tooltipEnabled();
bool tooltipEnabled() const;
std::vector<int> pid_children_;
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;
std::vector<int> pid_;
const bool isExpand;
bool hasUserEvents_;
gdouble distance_scrolled_y_;
gdouble distance_scrolled_x_;
std::map<std::string, std::string> eventActionMap_;

View File

@@ -9,10 +9,12 @@
#include <json/json.h>
#include <memory>
#include <optional>
#include <vector>
#include "AModule.hpp"
#include "group.hpp"
#include "util/kill_signal.hpp"
#include "xdg-output-unstable-v1-client-protocol.h"
namespace waybar {
@@ -53,7 +55,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,9 +67,13 @@ class Bar {
~Bar();
void setMode(const std::string &mode);
void setVisible(bool visible);
void setVisible(bool value);
void toggle();
void show();
void hide();
void handleSignal(int);
util::KillSignalAction getOnSigusr1Action();
util::KillSignalAction getOnSigusr2Action();
struct waybar_output *output;
Json::Value config;
@@ -117,6 +123,9 @@ class Bar {
std::unique_ptr<BarIpcClient> _ipc_client;
#endif
std::vector<std::shared_ptr<waybar::AModule>> modules_all_;
waybar::util::KillSignalAction onSigusr1 = util::SIGNALACTION_DEFAULT_SIGUSR1;
waybar::util::KillSignalAction onSigusr2 = util::SIGNALACTION_DEFAULT_SIGUSR2;
};
} // namespace waybar

View File

@@ -56,6 +56,8 @@ class Client {
std::list<struct waybar_output> outputs_;
std::unique_ptr<CssReloadHelper> m_cssReloadHelper;
std::string m_cssFile;
sigc::connection monitor_added_connection_;
sigc::connection monitor_removed_connection_;
};
} // namespace waybar

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::vector<std::string> tryExpandPath(const std::string &base,
const std::string &filename);
Config() = default;
void load(const std::string &config);
@@ -32,6 +35,8 @@ class Config {
void setupConfig(Json::Value &dst, const std::string &config_file, int depth);
void resolveConfigIncludes(Json::Value &config, int depth);
void mergeConfig(Json::Value &a_config_, Json::Value &b_config_);
static std::vector<std::string> findIncludePath(
const std::string &name, const std::vector<std::string> &dirs = CONFIG_DIRS);
std::string config_file_;

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

@@ -6,6 +6,7 @@
#if defined(__linux__)
#include <sys/inotify.h>
#endif
#include <sys/poll.h>
#include <algorithm>
#include <fstream>
@@ -15,6 +16,7 @@
#include "ALabel.hpp"
#include "bar.hpp"
#include "util/sleeper_thread.hpp"
#include "util/udev_deleter.hpp"
namespace waybar::modules {
@@ -35,15 +37,19 @@ class Battery : public ALabel {
std::tuple<uint8_t, float, std::string, float, uint16_t, float> getInfos();
const std::string formatTimeRemaining(float hoursRemaining);
void setBarClass(std::string&);
void processEvents(std::string& state, std::string& status, uint8_t capacity);
int global_watch;
std::map<fs::path, int> batteries_;
std::unique_ptr<udev, util::UdevDeleter> udev_;
std::array<pollfd, 1> poll_fds_;
std::unique_ptr<udev_monitor, util::UdevMonitorDeleter> mon_;
fs::path adapter_;
int battery_watch_fd_;
int global_watch_fd_;
std::mutex battery_list_mutex_;
std::string old_status_;
std::string last_event_;
bool warnFirstTime_{true};
bool weightedAverage_{true};
const Bar& bar_;
util::SleeperThread thread_;

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

@@ -1,49 +0,0 @@
#pragma once
#include "ALabel.hpp"
#include "util/sleeper_thread.hpp"
namespace cava {
extern "C" {
#include <cava/common.h>
}
} // namespace cava
namespace waybar::modules {
using namespace std::literals::chrono_literals;
class Cava final : public ALabel {
public:
Cava(const std::string&, const Json::Value&);
virtual ~Cava();
auto update() -> void override;
auto doAction(const std::string& name) -> void override;
private:
util::SleeperThread thread_;
util::SleeperThread thread_fetch_input_;
struct cava::error_s error_ {}; // cava errors
struct cava::config_params prm_ {}; // cava parameters
struct cava::audio_raw audio_raw_ {}; // cava handled raw audio data(is based on audio_data)
struct cava::audio_data audio_data_ {}; // cava audio data
struct cava::cava_plan* plan_; //{new cava_plan{}};
// Cava API to read audio source
cava::ptr input_source_;
// Delay to handle audio source
std::chrono::milliseconds frame_time_milsec_{1s};
// Text to display
std::string text_{""};
int rePaint_{1};
std::chrono::seconds fetch_input_delay_{4};
std::chrono::seconds suspend_silence_delay_{0};
bool silence_{false};
bool hide_on_silence_{false};
int sleep_counter_{0};
// Cava method
void pause_resume();
// ModuleActionMap
static inline std::map<const std::string, void (waybar::modules::Cava::*const)()> actionMap_{
{"mode", &waybar::modules::Cava::pause_resume}};
};
} // namespace waybar::modules

View File

@@ -0,0 +1,43 @@
#pragma once
#include <epoxy/gl.h>
#include "AModule.hpp"
#include "cava_backend.hpp"
namespace waybar::modules::cava {
class CavaGLSL final : public AModule, public Gtk::GLArea {
public:
CavaGLSL(const std::string&, const Json::Value&);
~CavaGLSL() = default;
private:
std::shared_ptr<CavaBackend> backend_;
struct ::cava::config_params prm_;
int frame_counter{0};
bool silence_{false};
bool hide_on_silence_{false};
// Cava method
auto onUpdate(const ::cava::audio_raw& input) -> void;
auto onSilence() -> void;
// Member variable to store the shared pointer
std::shared_ptr<::cava::audio_raw> m_data_;
GLuint shaderProgram_;
// OpenGL variables
GLuint fbo_;
GLuint texture_;
GLint uniform_bars_;
GLint uniform_previous_bars_;
GLint uniform_bars_count_;
GLint uniform_time_;
// Methods
void onRealize();
bool onRender(const Glib::RefPtr<Gdk::GLContext>& context);
void initShaders();
void initSurface();
void initGLSL();
GLuint loadShader(const std::string& fileName, GLenum type);
};
} // namespace waybar::modules::cava

View File

@@ -0,0 +1,30 @@
#pragma once
#include "ALabel.hpp"
#include "cava_backend.hpp"
namespace waybar::modules::cava {
class Cava final : public ALabel, public sigc::trackable {
public:
Cava(const std::string&, const Json::Value&);
~Cava() = default;
auto doAction(const std::string& name) -> void override;
private:
std::shared_ptr<CavaBackend> backend_;
// Text to display
Glib::ustring label_text_{""};
bool silence_{false};
bool hide_on_silence_{false};
std::string format_silent_{""};
int ascii_range_{0};
// Cava method
void pause_resume();
auto onUpdate(const std::string& input) -> void;
auto onSilence() -> void;
// ModuleActionMap
static inline std::map<const std::string, void (waybar::modules::cava::Cava::* const)()>
actionMap_{{"mode", &waybar::modules::cava::Cava::pause_resume}};
};
} // namespace waybar::modules::cava

View File

@@ -0,0 +1,84 @@
#pragma once
#include <json/json.h>
#include <sigc++/sigc++.h>
#include "util/sleeper_thread.hpp"
namespace cava {
extern "C" {
// Need sdl_glsl output feature to be enabled on libcava
#ifndef SDL_GLSL
#define SDL_GLSL
#endif
#include <cava/common.h>
#ifdef SDL_GLSL
#undef SDL_GLSL
#endif
}
} // namespace cava
namespace waybar::modules::cava {
using namespace std::literals::chrono_literals;
class CavaBackend final {
public:
static std::shared_ptr<CavaBackend> inst(const Json::Value& config);
virtual ~CavaBackend();
// Methods
int getAsciiRange();
void doPauseResume();
void Update();
const struct ::cava::config_params* getPrm();
std::chrono::milliseconds getFrameTimeMilsec();
// Signal accessor
using type_signal_update = sigc::signal<void(const std::string&)>;
type_signal_update signal_update();
using type_signal_audio_raw_update = sigc::signal<void(const ::cava::audio_raw&)>;
type_signal_audio_raw_update signal_audio_raw_update();
using type_signal_silence = sigc::signal<void()>;
type_signal_silence signal_silence();
private:
CavaBackend(const Json::Value& config);
util::SleeperThread read_thread_;
util::SleeperThread out_thread_;
// Cava API to read audio source
::cava::ptr input_source_{NULL};
struct ::cava::error_s error_{}; // cava errors
struct ::cava::config_params prm_{}; // cava parameters
struct ::cava::audio_raw audio_raw_{}; // cava handled raw audio data(is based on audio_data)
struct ::cava::audio_data audio_data_{}; // cava audio data
struct ::cava::cava_plan* plan_{NULL}; //{new cava_plan{}};
std::chrono::seconds fetch_input_delay_{4};
// Delay to handle audio source
std::chrono::milliseconds frame_time_milsec_{1s};
const Json::Value& config_;
int re_paint_{0};
bool silence_{false};
bool silence_prev_{false};
std::chrono::seconds suspend_silence_delay_{0};
int sleep_counter_{0};
std::string output_{};
// Methods
void invoke();
void execute();
bool isSilence();
void doUpdate(bool force = false);
void loadConfig();
void freeBackend();
// Signal
type_signal_update m_signal_update_;
type_signal_audio_raw_update m_signal_audio_raw_;
type_signal_silence m_signal_silence_;
};
} // namespace waybar::modules::cava

View File

@@ -0,0 +1,27 @@
#pragma once
#ifdef HAVE_LIBCAVA
#include "cavaRaw.hpp"
#include "cava_backend.hpp"
#ifdef HAVE_LIBCAVAGLSL
#include "cavaGLSL.hpp"
#endif
#endif
namespace waybar::modules::cava {
AModule* getModule(const std::string& id, const Json::Value& config) {
#ifdef HAVE_LIBCAVA
const std::shared_ptr<CavaBackend> backend_{waybar::modules::cava::CavaBackend::inst(config)};
switch (backend_->getPrm()->output) {
#ifdef HAVE_LIBCAVAGLSL
case ::cava::output_method::OUTPUT_SDL_GLSL:
return new waybar::modules::cava::CavaGLSL(id, config);
#endif
default:
return new waybar::modules::cava::Cava(id, config);
}
#else
throw std::runtime_error("Unknown module");
#endif
};
} // namespace waybar::modules::cava

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
/*
@@ -36,39 +38,41 @@ class Clock final : public ALabel {
5 - tooltip-format
*/
std::map<int, std::string const> fmtMap_;
uint cldMonCols_{3}; // calendar count month columns
int cldWnLen_{3}; // calendar week number length
const int cldMonColLen_{20}; // calendar month column length
WS cldWPos_{WS::HIDDEN}; // calendar week side to print
months cldCurrShift_{0}; // calendar months shift
int cldShift_{1}; // calendar months shift factor
year_month_day cldYearShift_; // calendar Year mode. Cached ymd
std::string cldYearCached_; // calendar Year mode. Cached calendar
year_month cldMonShift_; // calendar Month mode. Cached ym
std::string cldMonCached_; // calendar Month mode. Cached calendar
day cldBaseDay_{0}; // calendar Cached day. Is used when today is changing(midnight)
uint cldMonCols_{3}; // calendar count month columns
int cldWnLen_{3}; // calendar week number length
const int cldMonColLen_{20}; // calendar month column length
WS cldWPos_{WS::HIDDEN}; // calendar week side to print
date::months cldCurrShift_{0}; // calendar months shift
int cldShift_{1}; // calendar months shift factor
date::year_month_day cldYearShift_; // calendar Year mode. Cached ymd
std::string cldYearCached_; // calendar Year mode. Cached calendar
date::year_month cldMonShift_; // calendar Month mode. Cached ym
std::string cldMonCached_; // calendar Month mode. Cached calendar
date::day cldBaseDay_{0}; // calendar Cached day. Is used when today is changing(midnight)
std::string cldText_{""}; // calendar text to print
bool iso8601Calendar_{false}; // whether the calendar is in ISO8601
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 date::year_month_day& today, const date::year_month_day& ymd,
const date::time_zone* tz) -> const std::string;
// get local time zone
auto local_zone() -> const time_zone*;
auto local_zone() -> const date::time_zone*;
// time zoned time in tooltip
const bool tzInTooltip_; // if need to print time zones text
std::vector<const time_zone*> tzList_; // time zones list
int tzCurrIdx_; // current time zone index for tzList_
std::string tzText_{""}; // time zones text to print
const bool tzInTooltip_; // if need to print time zones text
std::vector<const date::time_zone*> tzList_; // time zones list
int tzCurrIdx_; // current time zone index for tzList_
std::string tzText_{""}; // time zones text to print
std::string tzTooltipFormat_{""}; // optional timezone tooltip format
util::SleeperThread thread_;
// ordinal date in tooltip
const bool ordInTooltip_;
std::string ordText_{""};
auto get_ordinal_date(const year_month_day& today) -> std::string;
auto get_ordinal_date(const date::year_month_day& today) -> std::string;
auto getTZtext(sys_seconds now) -> std::string;
auto first_day_of_week() -> weekday;
auto getTZtext(date::sys_seconds now) -> std::string;
auto first_day_of_week() -> date::weekday;
// Module actions
void cldModeSwitch();
void cldShift_up();
@@ -77,7 +81,7 @@ class Clock final : public ALabel {
void tz_up();
void tz_down();
// Module Action Map
static inline std::map<const std::string, void (waybar::modules::Clock::*const)()> actionMap_{
static inline std::map<const std::string, void (waybar::modules::Clock::* const)()> actionMap_{
{"mode", &waybar::modules::Clock::cldModeSwitch},
{"shift_up", &waybar::modules::Clock::cldShift_up},
{"shift_down", &waybar::modules::Clock::cldShift_down},

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

@@ -0,0 +1,141 @@
#pragma once
#include <fmt/format.h>
#include <gtkmm/button.h>
#include <gtkmm/image.h>
#include <gtkmm/label.h>
#include <map>
#include <memory>
#include <vector>
#include "AModule.hpp"
#include "bar.hpp"
#include "ext-workspace-v1-client-protocol.h"
namespace waybar::modules::ext {
class WorkspaceGroup;
class Workspace;
class WorkspaceManager final : public AModule {
public:
WorkspaceManager(const std::string &id, const waybar::Bar &bar, const Json::Value &config);
~WorkspaceManager() override;
void register_manager(wl_registry *registry, uint32_t name, uint32_t version);
void remove_workspace_group(uint32_t id);
void remove_workspace(uint32_t id);
void set_needs_sorting() { needs_sorting_ = true; }
// wl events
void handle_workspace_group(ext_workspace_group_handle_v1 *handle);
void handle_workspace(ext_workspace_handle_v1 *handle);
void handle_done();
void handle_finished();
// wl requests
void commit() const;
private:
void update() override;
bool has_button(const Gtk::Button *button);
void sort_workspaces();
void clear_buttons();
void update_buttons();
static uint32_t group_global_id;
static uint32_t workspace_global_id;
uint32_t workspace_name = 0;
bool sort_by_id_ = false;
bool sort_by_name_ = true;
bool sort_by_coordinates_ = false;
bool all_outputs_ = false;
const waybar::Bar &bar_;
Gtk::Box box_;
ext_workspace_manager_v1 *ext_manager_ = nullptr;
std::vector<std::unique_ptr<WorkspaceGroup>> groups_;
std::vector<std::unique_ptr<Workspace>> workspaces_;
bool needs_sorting_ = false;
};
class WorkspaceGroup {
public:
WorkspaceGroup(WorkspaceManager &manager, ext_workspace_group_handle_v1 *handle, uint32_t id);
~WorkspaceGroup();
u_int32_t id() const { return id_; }
bool has_output(const wl_output *output);
bool has_workspace(const ext_workspace_handle_v1 *workspace);
// wl events
void handle_capabilities(uint32_t capabilities);
void handle_output_enter(wl_output *output);
void handle_output_leave(wl_output *output);
void handle_workspace_enter(ext_workspace_handle_v1 *handle);
void handle_workspace_leave(ext_workspace_handle_v1 *handle);
void handle_removed();
private:
WorkspaceManager &workspaces_manager_;
ext_workspace_group_handle_v1 *ext_handle_;
uint32_t id_;
std::vector<wl_output *> outputs_;
std::vector<ext_workspace_handle_v1 *> workspaces_;
};
class Workspace {
public:
Workspace(const Json::Value &config, WorkspaceManager &manager, ext_workspace_handle_v1 *handle,
uint32_t id, const std::string &name);
~Workspace();
ext_workspace_handle_v1 *handle() const { return ext_handle_; }
u_int32_t id() const { return id_; }
std::string &workspace_id() { return workspace_id_; }
std::string &name() { return name_; }
std::vector<u_int32_t> &coordinates() { return coordinates_; }
Gtk::Button &button() { return button_; }
void update();
// wl events
void handle_id(const std::string &id);
void handle_name(const std::string &name);
void handle_coordinates(const std::vector<uint32_t> &coordinates);
void handle_state(uint32_t state);
void handle_capabilities(uint32_t capabilities);
void handle_removed();
// gdk events
bool handle_clicked(const GdkEventButton *button) const;
private:
bool has_state(uint32_t state) const { return (state_ & state) == state; }
std::string icon();
WorkspaceManager &workspace_manager_;
ext_workspace_handle_v1 *ext_handle_ = nullptr;
uint32_t id_;
uint32_t state_ = 0;
std::string workspace_id_;
std::string name_;
std::vector<uint32_t> coordinates_;
bool active_only_ = false;
bool ignore_hidden_ = true;
std::string format_;
bool with_icon_ = false;
static std::map<std::string, std::string> icon_map_;
std::string on_click_action_;
std::string on_click_middle_action_;
std::string on_click_right_action_;
Gtk::Button button_;
Gtk::Box content_;
Gtk::Label label_;
};
} // namespace waybar::modules::ext

View File

@@ -0,0 +1,10 @@
#include "ext-workspace-v1-client-protocol.h"
namespace waybar::modules::ext {
void add_registry_listener(void *data);
void add_workspace_listener(ext_workspace_handle_v1 *workspace_handle, void *data);
void add_workspace_group_listener(ext_workspace_group_handle_v1 *workspace_group_handle,
void *data);
ext_workspace_manager_v1 *workspace_manager_bind(wl_registry *registry, uint32_t name,
uint32_t version, void *data);
} // namespace waybar::modules::ext

40
include/modules/gps.hpp Normal file
View File

@@ -0,0 +1,40 @@
#pragma once
#include <fmt/format.h>
#include <sys/statvfs.h>
#ifdef WANT_RFKILL
#include "util/rfkill.hpp"
#endif
#include <gps.h>
#include "ALabel.hpp"
#include "util/sleeper_thread.hpp"
namespace waybar::modules {
class Gps : public ALabel {
public:
Gps(const std::string&, const Json::Value&);
virtual ~Gps();
auto update() -> void override;
private:
#ifdef WANT_RFKILL
util::Rfkill rfkill_;
#endif
const std::string getFixModeName() const;
const std::string getFixModeString() const;
const std::string getFixStatusString() const;
util::SleeperThread thread_, gps_thread_;
gps_data_t gps_data_;
std::string state_;
bool hideDisconnected = true;
bool hideNoFix = false;
};
} // namespace waybar::modules

View File

@@ -1,9 +1,10 @@
#pragma once
#include <filesystem>
#include <list>
#include <memory>
#include <mutex>
#include <string>
#include <thread>
#include <utility>
#include "util/json.hpp"
@@ -16,25 +17,36 @@ class EventHandler {
virtual ~EventHandler() = default;
};
/// If you want to use the Hyprland IPC, simply use IPC::inst() to get the singleton instance.
/// Do not create multiple instances.
class IPC {
protected:
IPC(); // use IPC::inst() instead.
public:
IPC() { startIPC(); }
~IPC();
static IPC& inst();
void registerForIPC(const std::string& ev, EventHandler* ev_handler);
void unregisterForIPC(EventHandler* handler);
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();
void socketListener();
void parseIPC(const std::string&);
std::thread ipcThread_;
std::mutex callbackMutex_;
util::JsonParser parser_;
std::list<std::pair<std::string, EventHandler*>> callbacks_;
int socketfd_; // the hyprland socket file descriptor
pid_t socketOwnerPid_;
bool running_ = true; // the ipcThread will stop running when this is false
};
inline std::unique_ptr<IPC> gIPC;
inline bool modulesReady = false;
}; // namespace waybar::modules::hyprland

View File

@@ -37,6 +37,8 @@ class Language : public waybar::ALabel, public EventHandler {
util::JsonParser parser_;
Layout layout_;
IPC& m_ipc;
};
} // namespace waybar::modules::hyprland

View File

@@ -28,6 +28,8 @@ class Submap : public waybar::ALabel, public EventHandler {
std::string submap_;
bool always_on_ = false;
std::string default_submap_ = "Default";
IPC& m_ipc;
};
} // namespace waybar::modules::hyprland

View File

@@ -60,6 +60,8 @@ class Window : public waybar::AAppIconLabel, public EventHandler {
bool swallowing_;
bool fullscreen_;
bool focused_;
IPC& m_ipc;
};
} // namespace waybar::modules::hyprland

View File

@@ -0,0 +1,41 @@
#pragma once
#include <fmt/format.h>
#include <string>
#include "AAppIconLabel.hpp"
#include "bar.hpp"
#include "modules/hyprland/backend.hpp"
namespace waybar::modules::hyprland {
class WindowCount : public waybar::AAppIconLabel, public EventHandler {
public:
WindowCount(const std::string&, const waybar::Bar&, const Json::Value&);
~WindowCount() override;
auto update() -> void override;
private:
struct Workspace {
int id;
int windows;
bool hasfullscreen;
static auto parse(const Json::Value& value) -> Workspace;
};
auto getActiveWorkspace(const std::string&) -> Workspace;
auto getActiveWorkspace() -> Workspace;
void onEvent(const std::string& ev) override;
void queryActiveWorkspace();
void setClass(const std::string&, bool enable);
bool separateOutputs_;
std::mutex mutex_;
const Bar& bar_;
Workspace workspace_;
IPC& m_ipc;
};
} // namespace waybar::modules::hyprland

View File

@@ -0,0 +1,75 @@
#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;
struct WindowRepr {
std::string address;
std::string window_class;
std::string window_title;
std::string repr_rewrite;
bool isActive = false;
public:
bool empty() const { return address.empty(); }
void setActive(bool value) { isActive = value; }
};
class WindowCreationPayload {
public:
WindowCreationPayload(std::string workspace_name, WindowAddress window_address,
WindowRepr window_repr);
WindowCreationPayload(std::string workspace_name, WindowAddress window_address,
std::string window_class, std::string window_title, bool is_active);
WindowCreationPayload(Json::Value const& client_data);
int incrementTimeSpentUncreated();
bool isEmpty(Workspaces& workspace_manager);
bool reprIsReady() const { return std::holds_alternative<Repr>(m_window); }
WindowRepr repr(Workspaces& workspace_manager);
void setActive(bool value) { m_isActive = value; }
std::string getWorkspaceName() const { return m_workspaceName; }
WindowAddress getAddress() const { return m_windowAddress; }
void moveToWorkspace(std::string& new_workspace_name);
private:
void clearAddr();
void clearWorkspaceName();
using Repr = WindowRepr;
using ClassAndTitle = std::pair<std::string, std::string>;
std::variant<Repr, ClassAndTitle> m_window;
WindowAddress m_windowAddress;
std::string m_workspaceName;
bool m_isActive = false;
int m_timeSpentUncreated = 0;
};
} // namespace waybar::modules::hyprland

View File

@@ -0,0 +1,97 @@
#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 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 std::ranges::any_of(m_windowMap,
[&addr](const auto& window) { return window.address == addr; });
};
void insertWindow(WindowCreationPayload create_window_payload);
void initializeWindowMap(const Json::Value& clients_data);
void setActiveWindow(WindowAddress const& addr);
bool onWindowOpened(WindowCreationPayload const& create_window_payload);
std::optional<WindowRepr> closeWindow(WindowAddress const& addr);
void update(const std::string& workspace_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::vector<WindowRepr> m_windowMap;
Gtk::Button m_button;
Gtk::Box m_content;
Gtk::Label m_labelBefore;
Gtk::Label m_labelAfter;
bool isEmpty() const;
void updateTaskbar(const std::string& workspace_icon);
bool handleClick(const GdkEventButton* event_button, WindowAddress const& addr) const;
bool shouldSkipWindow(const WindowRepr& window_repr) const;
IPC& m_ipc;
};
} // namespace waybar::modules::hyprland

View File

@@ -1,23 +1,25 @@
#pragma once
#include <gtkmm/button.h>
#include <gtkmm/enums.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 "modules/hyprland/workspace.hpp"
#include "util/enum.hpp"
#include "util/icon_loader.hpp"
#include "util/regex_collection.hpp"
using WindowAddress = std::string;
@@ -26,97 +28,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,35 +38,68 @@ 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 persistentOnly() const -> bool { return m_persistentOnly; }
auto moveToMonitor() const -> bool { return m_moveToMonitor; }
auto enableTaskbar() const -> bool { return m_enableTaskbar; }
auto taskbarWithIcon() const -> bool { return m_taskbarWithIcon; }
auto getBarOutput() const -> std::string { return m_bar.output->name; }
auto formatBefore() const -> std::string { return m_formatBefore; }
auto formatAfter() const -> std::string { return m_formatAfter; }
auto taskbarFormatBefore() const -> std::string { return m_taskbarFormatBefore; }
auto taskbarFormatAfter() const -> std::string { return m_taskbarFormatAfter; }
auto taskbarIconSize() const -> int { return m_taskbarIconSize; }
auto taskbarOrientation() const -> Gtk::Orientation { return m_taskbarOrientation; }
auto taskbarReverseDirection() const -> bool { return m_taskbarReverseDirection; }
auto onClickWindow() const -> std::string { return m_onClickWindow; }
auto getIgnoredWindows() const -> std::vector<std::regex> { return m_ignoreWindows; }
enum class ActiveWindowPosition { NONE, FIRST, LAST };
auto activeWindowPosition() const -> ActiveWindowPosition { return m_activeWindowPosition; }
std::string getRewrite(std::string window_class, std::string window_title);
std::string& getWindowSeparator() { return m_formatWindowSeparator; }
bool isWorkspaceIgnored(std::string const& workspace_name);
bool windowRewriteConfigUsesTitle() const { return m_anyWindowRewriteRuleUsesTitle; }
const IconLoader& iconLoader() const { return m_iconLoader; }
private:
void onEvent(const std::string& e) override;
void updateWindowCount();
void sortSpecialCentered();
void sortWorkspaces();
void createWorkspace(Json::Value const& workspaceData,
Json::Value const& clientsData = Json::Value::nullRef);
void removeWorkspace(std::string const& name);
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& workspaceString);
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;
auto populateWorkspaceTaskbarConfig(const Json::Value& config) -> void;
void registerIpc();
// workspace events
void onWorkspaceActivated(std::string const& payload);
void onSpecialWorkspaceActivated(std::string const& payload);
void onWorkspaceDestroyed(std::string const& payload);
void onWorkspaceCreated(std::string const& workspaceName,
void onWorkspaceCreated(std::string const& payload,
Json::Value const& clientsData = Json::Value::nullRef);
void onWorkspaceMoved(std::string const& payload);
void onWorkspaceRenamed(std::string const& payload);
static std::optional<int> parseWorkspaceId(std::string const& workspaceIdStr);
// monitor events
void onMonitorFocused(std::string const& payload);
@@ -166,12 +110,26 @@ class Workspaces : public AModule, public EventHandler {
void onWindowMoved(std::string const& payload);
void onWindowTitleEvent(std::string const& payload);
void onActiveWindowChanged(WindowAddress const& payload);
void onConfigReloaded();
int windowRewritePriorityFunction(std::string const& window_rule);
// event payload management
template <typename... Args>
static std::string makePayload(Args const&... args);
static std::pair<std::string, std::string> splitDoublePayload(std::string const& payload);
static std::tuple<std::string, std::string, std::string> splitTriplePayload(
std::string const& payload);
// Update methods
void doUpdate();
void removeWorkspacesToRemove();
void createWorkspacesToCreate();
static std::vector<int> getVisibleWorkspaces();
void updateWorkspaceStates();
bool updateWindowsToCreate();
void extendOrphans(int workspaceId, Json::Value const& clientsJson);
void registerOrphanWindow(WindowCreationPayload create_window_payload);
@@ -184,23 +142,27 @@ class Workspaces : public AModule, public EventHandler {
bool m_allOutputs = false;
bool m_showSpecial = false;
bool m_activeOnly = false;
bool m_specialVisibleOnly = false;
bool m_persistentOnly = false;
bool m_moveToMonitor = false;
Json::Value m_persistentWorkspaceConfig;
// Map for windows stored in workspaces not present in the current bar.
// This happens when the user has multiple monitors (hence, multiple bars)
// and doesn't share windows accross bars (a.k.a `all-outputs` = false)
std::map<WindowAddress, std::string> m_orphanWindowMap;
// and doesn't share windows across bars (a.k.a `all-outputs` = false)
std::map<WindowAddress, WindowRepr, std::less<>> m_orphanWindowMap;
enum class SortMethod { ID, NAME, NUMBER, DEFAULT };
enum class SortMethod { ID, NAME, NUMBER, SPECIAL_CENTERED, DEFAULT };
util::EnumParser<SortMethod> m_enumParser;
SortMethod m_sortBy = SortMethod::DEFAULT;
std::map<std::string, SortMethod> m_sortMap = {{"ID", SortMethod::ID},
{"NAME", SortMethod::NAME},
{"NUMBER", SortMethod::NUMBER},
{"SPECIAL-CENTERED", SortMethod::SPECIAL_CENTERED},
{"DEFAULT", SortMethod::DEFAULT}};
std::string m_format;
std::string m_formatBefore;
std::string m_formatAfter;
std::map<std::string, std::string> m_iconsMap;
util::RegexCollection m_windowRewriteRules;
@@ -209,18 +171,40 @@ class Workspaces : public AModule, public EventHandler {
bool m_withIcon;
uint64_t m_monitorId;
std::string m_activeWorkspaceName;
int m_activeWorkspaceId;
std::string m_activeSpecialWorkspaceName;
std::vector<std::unique_ptr<Workspace>> m_workspaces;
std::vector<std::pair<Json::Value, Json::Value>> m_workspacesToCreate;
std::vector<std::string> m_workspacesToRemove;
std::vector<WindowCreationPayload> m_windowsToCreate;
IconLoader m_iconLoader;
bool m_enableTaskbar = false;
bool m_updateActiveWindow = false;
bool m_taskbarWithIcon = false;
bool m_taskbarWithTitle = false;
std::string m_taskbarFormatBefore;
std::string m_taskbarFormatAfter;
int m_taskbarIconSize = 16;
Gtk::Orientation m_taskbarOrientation = Gtk::ORIENTATION_HORIZONTAL;
bool m_taskbarReverseDirection = false;
util::EnumParser<ActiveWindowPosition> m_activeWindowEnumParser;
ActiveWindowPosition m_activeWindowPosition = ActiveWindowPosition::NONE;
std::map<std::string, ActiveWindowPosition> m_activeWindowPositionMap = {
{"NONE", ActiveWindowPosition::NONE},
{"FIRST", ActiveWindowPosition::FIRST},
{"LAST", ActiveWindowPosition::LAST},
};
std::string m_onClickWindow;
std::string m_currentActiveWindowAddress;
std::vector<std::regex> m_ignoreWorkspaces;
std::vector<std::regex> m_ignoreWindows;
std::mutex m_mutex;
const Bar& m_bar;
Gtk::Box m_box;
IPC& m_ipc;
};
} // namespace waybar::modules::hyprland

View File

@@ -31,7 +31,7 @@ class Image : public AModule {
std::string path_;
std::string tooltip_;
int size_;
int interval_;
std::chrono::milliseconds interval_;
util::command::res output_;
util::SleeperThread thread_;

View File

@@ -9,6 +9,7 @@
#include <sys/epoll.h>
#include <optional>
#include <vector>
#include "ALabel.hpp"
#include "util/sleeper_thread.hpp"
@@ -16,6 +17,8 @@
#include "util/rfkill.hpp"
#endif
enum ip_addr_pref : uint8_t { IPV4, IPV6, IPV4_6 };
namespace waybar::modules {
class Network : public ALabel {
@@ -25,8 +28,8 @@ class Network : public ALabel {
auto update() -> void override;
private:
static const uint8_t MAX_RETRY = 5;
static const uint8_t EPOLL_MAX = 200;
static const uint8_t MAX_RETRY{5};
static const uint8_t EPOLL_MAX{200};
static int handleEvents(struct nl_msg*, void*);
static int handleEventsDone(struct nl_msg*, void*);
@@ -40,41 +43,46 @@ 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);
bool matchInterface(const std::string& ifname, const std::vector<std::string>& altnames,
std::string& matched) const;
auto getInfo() -> void;
const std::string getNetworkState() const;
void clearIface();
bool wildcardMatch(const std::string& pattern, const std::string& text) const;
std::optional<std::pair<unsigned long long, unsigned long long>> readBandwidthUsage();
int ifid_;
sa_family_t family_;
struct sockaddr_nl nladdr_ = {0};
struct nl_sock* sock_ = nullptr;
struct nl_sock* ev_sock_ = nullptr;
int efd_;
int ev_fd_;
int nl80211_id_;
int ifid_{-1};
ip_addr_pref addr_pref_{ip_addr_pref::IPV4};
struct sockaddr_nl nladdr_{0};
struct nl_sock* sock_{nullptr};
struct nl_sock* ev_sock_{nullptr};
int efd_{-1};
int ev_fd_{-1};
int nl80211_id_{-1};
std::mutex mutex_;
bool want_route_dump_;
bool want_link_dump_;
bool want_addr_dump_;
bool dump_in_progress_;
bool is_p2p_;
bool want_route_dump_{false};
bool want_link_dump_{false};
bool want_addr_dump_{false};
bool dump_in_progress_{false};
bool is_p2p_{false};
unsigned long long bandwidth_down_total_;
unsigned long long bandwidth_up_total_;
unsigned long long bandwidth_down_total_{0};
unsigned long long bandwidth_up_total_{0};
std::string state_;
std::string essid_;
bool carrier_;
std::string bssid_;
bool carrier_{false};
std::string ifname_;
std::string ipaddr_;
std::string ipaddr6_;
std::string gwaddr_;
std::string netmask_;
int cidr_;
std::string netmask6_;
int cidr_{0};
int cidr6_{0};
int32_t signal_strength_dbm_;
uint8_t signal_strength_;
std::string signal_strength_app_;
@@ -83,9 +91,9 @@ class Network : public ALabel {
util::SleeperThread thread_;
util::SleeperThread thread_timer_;
#ifdef WANT_RFKILL
util::Rfkill rfkill_;
util::Rfkill rfkill_{RFKILL_TYPE_WLAN};
#endif
float frequency_;
float frequency_{0};
};
} // namespace waybar::modules

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,39 @@
#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_;
std::string last_short_name_;
};
} // 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"
@@ -16,7 +13,7 @@ namespace waybar::modules::privacy {
class Privacy : public AModule {
public:
Privacy(const std::string &, const Json::Value &, const std::string &pos);
Privacy(const std::string &, const Json::Value &, Gtk::Orientation, const std::string &pos);
auto update() -> void override;
void onPrivacyNodesChanged();
@@ -34,6 +31,8 @@ class Privacy : public AModule {
uint iconSpacing = 4;
uint iconSize = 20;
uint transition_duration = 250;
std::set<std::pair<PrivacyNodeType, std::string>> ignore;
bool ignore_monitor = true;
std::shared_ptr<util::PipewireBackend::PipewireBackend> backend = nullptr;
};

View File

@@ -2,9 +2,6 @@
#include <json/value.h>
#include <iostream>
#include <map>
#include <mutex>
#include <string>
#include "gtkmm/box.h"
@@ -20,8 +17,8 @@ namespace waybar::modules::privacy {
class PrivacyItem : public Gtk::Revealer {
public:
PrivacyItem(const Json::Value &config_, enum PrivacyNodeType privacy_type_,
std::list<PrivacyNodeInfo *> *nodes, const std::string &pos, const uint icon_size,
const uint transition_duration);
std::list<PrivacyNodeInfo *> *nodes, Gtk::Orientation orientation,
const std::string &pos, const uint icon_size, const uint transition_duration);
enum PrivacyNodeType privacy_type;

View File

@@ -24,6 +24,7 @@ class Layout : public waybar::ALabel {
private:
const waybar::Bar &bar_;
std::string name_;
struct wl_output *output_; // stores the output this module belongs to
struct wl_output *focused_output_; // stores the currently focused output
struct zriver_output_status_v1 *output_status_;

View File

@@ -21,6 +21,7 @@ class Tags : public waybar::AModule {
void handle_view_tags(struct wl_array *tags);
void handle_urgent_tags(uint32_t tags);
void handle_show();
void handle_primary_clicked(uint32_t tag);
bool handle_button_press(GdkEventButton *event_button, uint32_t tag);

View File

@@ -0,0 +1,43 @@
#pragma once
#include <json/json.h>
#include <spdlog/spdlog.h>
#include <string>
#include <unordered_map>
class IconManager {
public:
static IconManager& instance() {
static IconManager instance;
return instance;
}
void setIconsConfig(const Json::Value& icons_config) {
if (icons_config.isObject()) {
for (const auto& key : icons_config.getMemberNames()) {
std::string app_name = key;
const Json::Value& icon_value = icons_config[key];
if (icon_value.isString()) {
std::string icon_path = icon_value.asString();
icons_map_[app_name] = icon_path;
}
}
} else {
spdlog::warn("Invalid icon config format.");
}
}
std::string getIconForApp(const std::string& app_name) const {
auto it = icons_map_.find(app_name);
if (it != icons_map_.end()) {
return it->second;
}
return "";
}
private:
IconManager() = default;
std::unordered_map<std::string, std::string> icons_map_;
};

View File

@@ -26,7 +26,7 @@ struct ToolTip {
class Item : public sigc::trackable {
public:
Item(const std::string&, const std::string&, const Json::Value&, const Bar&);
~Item() = default;
~Item();
std::string bus_name;
std::string object_path;
@@ -62,6 +62,7 @@ class Item : public sigc::trackable {
void proxyReady(Glib::RefPtr<Gio::AsyncResult>& result);
void setProperty(const Glib::ustring& name, Glib::VariantBase& value);
void setStatus(const Glib::ustring& value);
void setCustomIcon(const std::string& id);
void getUpdatedProperties();
void processUpdatedProperties(Glib::RefPtr<Gio::AsyncResult>& result);
void onSignal(const Glib::ustring& sender_name, const Glib::ustring& signal_name,
@@ -76,6 +77,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

@@ -21,6 +21,7 @@ class Tray : public AModule {
void onRemove(std::unique_ptr<Item>& item);
static inline std::size_t nb_hosts_ = 0;
bool show_passive_ = false;
Gtk::Box box_;
SNI::Watcher::singleton watcher_;
SNI::Host host_;

View File

@@ -21,7 +21,7 @@ class Language : public ALabel, public sigc::trackable {
auto update() -> void override;
private:
enum class DispayedShortFlag { None = 0, ShortName = 1, ShortDescription = 1 << 1 };
enum class DisplayedShortFlag { None = 0, ShortName = 1, ShortDescription = 1 << 1 };
struct Layout {
std::string full_name;
@@ -58,7 +58,7 @@ class Language : public ALabel, public sigc::trackable {
std::map<std::string, Layout> layouts_map_;
bool hide_single_;
bool is_variant_displayed;
std::byte displayed_short_flag = static_cast<std::byte>(DispayedShortFlag::None);
std::byte displayed_short_flag = static_cast<std::byte>(DisplayedShortFlag::None);
util::JsonParser parser_;
std::mutex mutex_;

View File

@@ -19,10 +19,11 @@ class Window : public AAppIconLabel, public sigc::trackable {
auto update() -> void override;
private:
void setClass(std::string classname, bool enable);
void setClass(const std::string& classname, bool enable);
void onEvent(const struct Ipc::ipc_response&);
void onCmd(const struct Ipc::ipc_response&);
std::tuple<std::size_t, int, int, std::string, std::string, std::string, std::string, std::string>
std::tuple<std::size_t, int, int, std::string, std::string, std::string, std::string, std::string,
std::string>
getFocusedNode(const Json::Value& nodes, std::string& output);
void getTree();
@@ -35,6 +36,7 @@ class Window : public AAppIconLabel, public sigc::trackable {
std::string old_app_id_;
std::size_t app_nb_;
std::string shell_;
std::string marks_;
int floating_count_;
util::JsonParser parser_;
std::mutex mutex_;

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,18 +38,17 @@ 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_;
std::vector<std::string> high_priority_named_;
std::vector<std::string> workspaces_order_;
Gtk::Box box_;
std::string m_formatWindowSeperator;
std::string m_windowRewriteDefault;
std::string m_formatWindowSeparator;
util::RegexCollection m_windowRewriteRules;
util::JsonParser parser_;
std::unordered_map<std::string, Gtk::Button> buttons_;

View File

@@ -19,12 +19,15 @@ class SystemdFailedUnits : public ALabel {
std::string format_ok;
bool update_pending;
uint32_t nr_failed_system, nr_failed_user;
std::string system_state, user_state, overall_state;
uint32_t nr_failed_system, nr_failed_user, nr_failed;
std::string last_status;
Glib::RefPtr<Gio::DBus::Proxy> system_proxy, user_proxy;
void notify_cb(const Glib::ustring &sender_name, const Glib::ustring &signal_name,
const Glib::VariantContainerBase &arguments);
void RequestFailedUnits();
void RequestSystemState();
void updateData();
};

View File

@@ -18,6 +18,7 @@ class Temperature : public ALabel {
private:
float getTemperature();
bool isCritical(uint16_t);
bool isWarning(uint16_t);
std::string file_path_;
util::SleeperThread thread_;

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

@@ -0,0 +1,122 @@
#pragma once
#include <json/json.h>
#include <unistd.h>
#include <functional>
#include <list>
#include <memory>
#include <mutex>
#include <optional>
#include <string>
#include <unordered_map>
#include <utility>
namespace waybar::modules::wayfire {
using EventHandler = std::function<void(const std::string& event)>;
struct State {
/*
┌───────────┐ ┌───────────┐
│ output #1 │ │ output #2 │
└─────┬─────┘ └─────┬─────┘
└─┐ └─────┐─ ─ ─ ─ ─ ─ ─ ─ ┐
┌───────┴───────┐ ┌───────┴──────┐ ┌───────┴───────┐
│ wset #1 │ │ wset #2 │ │ wset #3 │
│┌────────────┐ │ │┌────────────┐│ │┌────────────┐ │
││ workspaces │ │ ││ workspaces ││ ││ workspaces │ │
│└─┬──────────┘ │ │└────────────┘│ │└─┬──────────┘ │
│ │ ┌─────────┐│ └──────────────┘ │ │ ┌─────────┐│
│ ├─┤ view #1 ││ │ └─┤ view #3 ││
│ │ └─────────┘│ │ └─────────┘│
│ │ ┌─────────┐│ └───────────────┘
│ └─┤ view #2 ││
│ └─────────┘│
└───────────────┘
*/
struct Output {
size_t id;
size_t w, h;
size_t wset_idx;
};
struct Workspace {
size_t num_views;
size_t num_sticky_views;
};
struct Wset {
std::optional<std::reference_wrapper<Output>> output;
std::vector<Workspace> wss;
size_t ws_w, ws_h, ws_x, ws_y;
size_t focused_view_id;
auto ws_idx() const { return ws_w * ws_y + ws_x; }
auto count_ws(const Json::Value& pos) -> Workspace&;
auto locate_ws(const Json::Value& geo) -> Workspace&;
auto locate_ws(const Json::Value& geo) const -> const Workspace&;
};
std::unordered_map<std::string, Output> outputs;
std::unordered_map<size_t, Wset> wsets;
std::unordered_map<size_t, Json::Value> views;
std::string focused_output_name;
size_t maybe_empty_focus_wset_idx = {};
size_t vswitch_sticky_view_id = {};
bool new_output_detected = {};
bool vswitching = {};
auto update_view(const Json::Value& view) -> void;
};
struct Sock {
int fd;
Sock(int fd) : fd{fd} {}
~Sock() { close(fd); }
Sock(const Sock&) = delete;
auto operator=(const Sock&) = delete;
Sock(Sock&& rhs) noexcept {
fd = rhs.fd;
rhs.fd = -1;
}
auto& operator=(Sock&& rhs) noexcept {
fd = rhs.fd;
rhs.fd = -1;
return *this;
}
};
class IPC {
static std::weak_ptr<IPC> instance;
Json::CharReaderBuilder reader_builder;
Json::StreamWriterBuilder writer_builder;
std::list<std::pair<std::string, std::reference_wrapper<const EventHandler>>> handlers;
std::mutex handlers_mutex;
State state;
std::mutex state_mutex;
IPC() { start(); }
static auto connect() -> Sock;
auto receive(Sock& sock) -> Json::Value;
auto start() -> void;
auto root_event_handler(const std::string& event, const Json::Value& data) -> void;
auto update_state_handler(const std::string& event, const Json::Value& data) -> void;
public:
static auto get_instance() -> std::shared_ptr<IPC>;
auto send(const std::string& method, Json::Value&& data) -> Json::Value;
auto register_handler(const std::string& event, const EventHandler& handler) -> void;
auto unregister_handler(EventHandler& handler) -> void;
auto lock_state() -> std::lock_guard<std::mutex> { return std::lock_guard{state_mutex}; }
auto& get_outputs() const { return state.outputs; }
auto& get_wsets() const { return state.wsets; }
auto& get_views() const { return state.views; }
auto& get_focused_output_name() const { return state.focused_output_name; }
};
} // namespace waybar::modules::wayfire

View File

@@ -0,0 +1,24 @@
#pragma once
#include "AAppIconLabel.hpp"
#include "bar.hpp"
#include "modules/wayfire/backend.hpp"
namespace waybar::modules::wayfire {
class Window : public AAppIconLabel {
std::shared_ptr<IPC> ipc;
EventHandler handler;
const Bar& bar_;
std::string old_app_id_;
public:
Window(const std::string& id, const Bar& bar, const Json::Value& config);
~Window() override;
auto update() -> void override;
auto update_icon_label() -> void;
};
} // namespace waybar::modules::wayfire

View File

@@ -0,0 +1,32 @@
#pragma once
#include <gtkmm/button.h>
#include <json/json.h>
#include <memory>
#include <vector>
#include "AModule.hpp"
#include "bar.hpp"
#include "modules/wayfire/backend.hpp"
namespace waybar::modules::wayfire {
class Workspaces : public AModule {
std::shared_ptr<IPC> ipc;
EventHandler handler;
const Bar& bar_;
Gtk::Box box_;
std::vector<Gtk::Button> buttons_;
auto handleScroll(GdkEventScroll* e) -> bool override;
auto update() -> void override;
auto update_box() -> void;
public:
Workspaces(const std::string& id, const Bar& bar, const Json::Value& config);
~Workspaces() override;
};
} // namespace waybar::modules::wayfire

View File

@@ -18,10 +18,12 @@ class Wireplumber : public ALabel {
private:
void asyncLoadRequiredApiModules();
void prepare();
void prepare(waybar::modules::Wireplumber* self);
void activatePlugins();
static void updateVolume(waybar::modules::Wireplumber* self, uint32_t id);
static void updateNodeName(waybar::modules::Wireplumber* self, uint32_t id);
static void updateSourceVolume(waybar::modules::Wireplumber* self, uint32_t id);
static void updateSourceName(waybar::modules::Wireplumber* self, uint32_t id); // NEW
static void onPluginActivated(WpObject* p, GAsyncResult* res, waybar::modules::Wireplumber* self);
static void onDefaultNodesApiLoaded(WpObject* p, GAsyncResult* res,
waybar::modules::Wireplumber* self);
@@ -32,6 +34,8 @@ class Wireplumber : public ALabel {
bool handleScroll(GdkEventScroll* e) override;
static std::list<waybar::modules::Wireplumber*> modules;
WpCore* wp_core_;
GPtrArray* apis_;
WpObjectManager* om_;
@@ -44,6 +48,12 @@ class Wireplumber : public ALabel {
double min_step_;
uint32_t node_id_{0};
std::string node_name_;
std::string source_name_;
gchar* type_;
uint32_t source_node_id_;
bool source_muted_;
double source_volume_;
gchar* default_source_name_;
};
} // namespace waybar::modules

View File

@@ -19,11 +19,16 @@
#include "bar.hpp"
#include "client.hpp"
#include "giomm/desktopappinfo.h"
#include "util/icon_loader.hpp"
#include "util/json.hpp"
#include "wlr-foreign-toplevel-management-unstable-v1-client-protocol.h"
namespace waybar::modules::wlr {
struct widget_geometry {
int x, y, w, h;
};
class Taskbar;
class Task {
@@ -42,6 +47,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,9 +88,8 @@ class Task {
private:
std::string repr() const;
std::string state_string(bool = false) const;
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);
void set_minimize_hint();
void on_button_size_allocated(Gtk::Allocation &alloc);
void hide_if_ignored();
public:
@@ -146,7 +151,7 @@ class Taskbar : public waybar::AModule {
Gtk::Box box_;
std::vector<TaskPtr> tasks_;
std::vector<Glib::RefPtr<Gtk::IconTheme>> icon_themes_;
IconLoader icon_loader_;
std::unordered_set<std::string> ignore_list_;
std::map<std::string, std::string> app_ids_replace_map_;
@@ -171,7 +176,7 @@ class Taskbar : public waybar::AModule {
bool show_output(struct wl_output *) const;
bool all_outputs() const;
const std::vector<Glib::RefPtr<Gtk::IconTheme>> &icon_themes() const;
const IconLoader &icon_loader() const;
const std::unordered_set<std::string> &ignore_list() const;
const std::map<std::string, std::string> &app_ids_replace_map() const;
};

View File

@@ -1,172 +0,0 @@
#pragma once
#include <fmt/format.h>
#include <gtkmm/button.h>
#include <gtkmm/image.h>
#include <gtkmm/label.h>
#include <functional>
#include <map>
#include <memory>
#include <vector>
#include "AModule.hpp"
#include "bar.hpp"
#include "ext-workspace-unstable-v1-client-protocol.h"
namespace waybar::modules::wlr {
class WorkspaceManager;
class WorkspaceGroup;
class Workspace {
public:
Workspace(const waybar::Bar &bar, const Json::Value &config, WorkspaceGroup &workspace_group,
zext_workspace_handle_v1 *workspace, uint32_t id, std::string name);
~Workspace();
auto update() -> void;
auto id() const -> uint32_t { return id_; }
auto is_active() const -> bool { return state_ & static_cast<uint32_t>(State::ACTIVE); }
auto is_urgent() const -> bool { return state_ & static_cast<uint32_t>(State::URGENT); }
auto is_hidden() const -> bool { return state_ & static_cast<uint32_t>(State::HIDDEN); }
auto is_empty() const -> bool { return state_ & static_cast<uint32_t>(State::EMPTY); }
auto is_persistent() const -> bool { return persistent_; }
// wlr stuff
auto handle_name(const std::string &name) -> void;
auto handle_coordinates(const std::vector<uint32_t> &coordinates) -> void;
auto handle_state(const std::vector<uint32_t> &state) -> void;
auto handle_remove() -> void;
auto make_persistent() -> void;
auto handle_duplicate() -> void;
auto handle_done() -> void;
auto handle_clicked(GdkEventButton *bt) -> bool;
auto show() -> void;
auto hide() -> void;
auto get_button_ref() -> Gtk::Button & { return button_; }
auto get_name() -> std::string & { return name_; }
auto get_coords() -> std::vector<uint32_t> & { return coordinates_; }
enum class State {
ACTIVE = (1 << 0),
URGENT = (1 << 1),
HIDDEN = (1 << 2),
EMPTY = (1 << 3),
};
private:
auto get_icon() -> std::string;
const Bar &bar_;
const Json::Value &config_;
WorkspaceGroup &workspace_group_;
// wlr stuff
zext_workspace_handle_v1 *workspace_handle_;
uint32_t state_ = 0;
uint32_t id_;
std::string name_;
std::vector<uint32_t> coordinates_;
static std::map<std::string, std::string> icons_map_;
std::string format_;
bool with_icon_ = false;
bool persistent_ = false;
Gtk::Button button_;
Gtk::Box content_;
Gtk::Label label_;
};
class WorkspaceGroup {
public:
WorkspaceGroup(const waybar::Bar &bar, Gtk::Box &box, const Json::Value &config,
WorkspaceManager &manager, zext_workspace_group_handle_v1 *workspace_group_handle,
uint32_t id);
~WorkspaceGroup();
auto update() -> void;
auto id() const -> uint32_t { return id_; }
auto is_visible() const -> bool;
auto remove_workspace(uint32_t id_) -> void;
auto active_only() const -> bool;
auto creation_delayed() const -> bool;
auto workspaces() -> std::vector<std::unique_ptr<Workspace>> & { return workspaces_; }
auto persistent_workspaces() -> std::vector<std::string> & { return persistent_workspaces_; }
auto sort_workspaces() -> void;
auto set_need_to_sort() -> void { need_to_sort = true; }
auto add_button(Gtk::Button &button) -> void;
auto remove_button(Gtk::Button &button) -> void;
auto fill_persistent_workspaces() -> void;
auto create_persistent_workspaces() -> void;
// wlr stuff
auto handle_workspace_create(zext_workspace_handle_v1 *workspace_handle) -> void;
auto handle_remove() -> void;
auto handle_output_enter(wl_output *output) -> void;
auto handle_output_leave() -> void;
auto handle_done() -> void;
auto commit() -> void;
private:
static uint32_t workspace_global_id;
const waybar::Bar &bar_;
Gtk::Box &box_;
const Json::Value &config_;
WorkspaceManager &workspace_manager_;
// wlr stuff
zext_workspace_group_handle_v1 *workspace_group_handle_;
wl_output *output_ = nullptr;
uint32_t id_;
std::vector<std::unique_ptr<Workspace>> workspaces_;
bool need_to_sort = false;
std::vector<std::string> persistent_workspaces_;
bool persistent_created_ = false;
};
class WorkspaceManager : public AModule {
public:
WorkspaceManager(const std::string &id, const waybar::Bar &bar, const Json::Value &config);
~WorkspaceManager() override;
auto update() -> void override;
auto all_outputs() const -> bool { return all_outputs_; }
auto active_only() const -> bool { return active_only_; }
auto workspace_comparator() const
-> std::function<bool(std::unique_ptr<Workspace> &, std::unique_ptr<Workspace> &)>;
auto creation_delayed() const -> bool { return creation_delayed_; }
auto sort_workspaces() -> void;
auto remove_workspace_group(uint32_t id_) -> void;
// wlr stuff
auto register_manager(wl_registry *registry, uint32_t name, uint32_t version) -> void;
auto handle_workspace_group_create(zext_workspace_group_handle_v1 *workspace_group_handle)
-> void;
auto handle_done() -> void;
auto handle_finished() -> void;
auto commit() -> void;
private:
const waybar::Bar &bar_;
Gtk::Box box_;
std::vector<std::unique_ptr<WorkspaceGroup>> groups_;
// wlr stuff
zext_workspace_manager_v1 *workspace_manager_ = nullptr;
static uint32_t group_global_id;
bool sort_by_name_ = true;
bool sort_by_coordinates_ = true;
bool sort_by_number_ = false;
bool all_outputs_ = false;
bool active_only_ = false;
bool creation_delayed_ = false;
};
} // namespace waybar::modules::wlr

View File

@@ -1,10 +0,0 @@
#include "ext-workspace-unstable-v1-client-protocol.h"
namespace waybar::modules::wlr {
void add_registry_listener(void *data);
void add_workspace_listener(zext_workspace_handle_v1 *workspace_handle, void *data);
void add_workspace_group_listener(zext_workspace_group_handle_v1 *workspace_group_handle,
void *data);
zext_workspace_manager_v1 *workspace_manager_bind(wl_registry *registry, uint32_t name,
uint32_t version, void *data);
} // namespace waybar::modules::wlr

View File

@@ -11,6 +11,11 @@
#include <type_traits>
#include <utility>
#ifdef __OpenBSD__
#define SIGRTMIN SIGUSR1 - 1
#define SIGRTMAX SIGUSR1 + 1
#endif
namespace waybar {
/**

View File

@@ -38,6 +38,8 @@ class AudioBackend {
std::string desc_;
std::string monitor_;
std::string current_sink_name_;
std::string default_sink_name;
bool default_sink_running_;
bool current_sink_running_;
// SOURCE
uint32_t source_idx_{0};

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

@@ -15,7 +15,7 @@
namespace date {
#if HAVE_CHRONO_TIMEZONES
using namespace std::chrono;
using namespace std;
using std::format;
#else
using system_clock = std::chrono::system_clock;
@@ -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));
@@ -73,5 +73,3 @@ struct fmt::formatter<date::zoned_time<Duration, TimeZonePtr>> {
}
};
#endif
using namespace date;

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

@@ -10,5 +10,7 @@ class DefaultGtkIconThemeWrapper {
public:
static bool has_icon(const std::string&);
static Glib::RefPtr<Gdk::Pixbuf> load_icon(const char*, int, Gtk::IconLookupFlags);
static Glib::RefPtr<Gdk::Pixbuf> load_icon(
const char*, int, Gtk::IconLookupFlags,
Glib::RefPtr<Gtk::StyleContext> style = Glib::RefPtr<Gtk::StyleContext>());
};

View File

@@ -0,0 +1,34 @@
#pragma once
#include <gdkmm/general.h>
#include <gio/gdesktopappinfo.h>
#include <giomm/desktopappinfo.h>
#include <glibmm/fileutils.h>
#include <gtkmm/image.h>
#include <spdlog/spdlog.h>
#include <string>
#include <vector>
#include "util/gtk_icon.hpp"
class IconLoader {
private:
std::vector<Glib::RefPtr<Gtk::IconTheme>> custom_icon_themes_;
Glib::RefPtr<Gtk::IconTheme> default_icon_theme_ = Gtk::IconTheme::get_default();
static std::vector<std::string> search_prefix();
static Glib::RefPtr<Gio::DesktopAppInfo> get_app_info_by_name(const std::string &app_id);
static Glib::RefPtr<Gio::DesktopAppInfo> get_desktop_app_info(const std::string &app_id);
static Glib::RefPtr<Gdk::Pixbuf> load_icon_from_file(std::string const &icon_path, int size);
static std::string get_icon_name_from_icon_theme(const Glib::RefPtr<Gtk::IconTheme> &icon_theme,
const std::string &app_id);
static bool image_load_icon(Gtk::Image &image, const Glib::RefPtr<Gtk::IconTheme> &icon_theme,
Glib::RefPtr<Gio::DesktopAppInfo> app_info, int size);
public:
void add_custom_icon_theme(const std::string &theme_name);
bool image_load_icon(Gtk::Image &image, Glib::RefPtr<Gio::DesktopAppInfo> app_info,
int size) const;
static Glib::RefPtr<Gio::DesktopAppInfo> get_app_info_from_app_id_list(
const std::string &app_id_list);
};

View File

@@ -30,15 +30,16 @@ class JsonParser {
std::istringstream jsonStream(modifiedJsonStr);
std::string errs;
if (!Json::parseFromStream(m_readerBuilder, jsonStream, &root, &errs)) {
// Use local CharReaderBuilder for thread safety - the IPC singleton's
// parser can be called concurrently from multiple module threads
Json::CharReaderBuilder readerBuilder;
if (!Json::parseFromStream(readerBuilder, jsonStream, &root, &errs)) {
throw std::runtime_error("Error parsing JSON: " + errs);
}
return root;
}
private:
Json::CharReaderBuilder m_readerBuilder;
static std::string replaceHexadecimalEscape(const std::string& str) {
static std::regex re("\\\\x");
return std::regex_replace(str, re, "\\u00");

View File

@@ -0,0 +1,26 @@
#pragma once
#include <json/value.h>
#include <cstdint>
namespace waybar::util {
enum class KillSignalAction : std::uint8_t {
TOGGLE,
RELOAD,
SHOW,
HIDE,
NOOP,
};
const std::map<std::string, KillSignalAction> userKillSignalActions = {
{"TOGGLE", KillSignalAction::TOGGLE},
{"RELOAD", KillSignalAction::RELOAD},
{"SHOW", KillSignalAction::SHOW},
{"HIDE", KillSignalAction::HIDE},
{"NOOP", KillSignalAction::NOOP}};
const KillSignalAction SIGNALACTION_DEFAULT_SIGUSR1 = KillSignalAction::TOGGLE;
const KillSignalAction SIGNALACTION_DEFAULT_SIGUSR2 = KillSignalAction::RELOAD;
}; // namespace waybar::util

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"

View File

@@ -25,6 +25,7 @@ class PrivacyNodeInfo {
std::string media_name;
std::string node_name;
std::string application_name;
bool is_monitor = false;
std::string pipewire_access_portal_app_id;
std::string application_icon_name;

View File

@@ -6,14 +6,12 @@
namespace waybar {
using namespace Gio;
enum class Appearance {
UNKNOWN = 0,
DARK = 1,
LIGHT = 2,
};
class Portal : private DBus::Proxy {
class Portal : private Gio::DBus::Proxy {
public:
Portal();
void refreshAppearance();

View File

@@ -4,6 +4,6 @@
namespace waybar::util {
// Get a signal emited with value true when entering sleep, and false when exiting
// Get a signal emitted with value true when entering sleep, and false when exiting
SafeSignal<bool>& prepare_for_sleep();
} // namespace waybar::util

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,16 +37,17 @@ 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);
std::string& get(std::string& value);
};
} // namespace waybar::util
} // namespace waybar::util

View File

@@ -5,6 +5,8 @@
#include <sigc++/signal.h>
#include <sigc++/trackable.h>
#include <atomic>
namespace waybar::util {
class Rfkill : public sigc::trackable {
@@ -17,7 +19,7 @@ class Rfkill : public sigc::trackable {
private:
enum rfkill_type rfkill_type_;
bool state_ = false;
std::atomic_bool state_ = false;
int fd_ = -1;
bool on_event(Glib::IOCondition cond);

View File

@@ -23,3 +23,26 @@ inline std::string capitalize(const std::string& str) {
[](unsigned char c) { return std::toupper(c); });
return result;
}
inline std::string toLower(const std::string& str) {
std::string result = str;
std::transform(result.begin(), result.end(), result.begin(),
[](unsigned char c) { return std::tolower(c); });
return result;
}
inline std::vector<std::string> split(std::string_view s, std::string_view delimiter,
int max_splits = -1) {
std::vector<std::string> result;
size_t pos = 0;
size_t next_pos = 0;
while ((next_pos = s.find(delimiter, pos)) != std::string::npos) {
result.push_back(std::string(s.substr(pos, next_pos - pos)));
pos = next_pos + delimiter.size();
if (max_splits > 0 && result.size() == static_cast<size_t>(max_splits)) {
break;
}
}
result.push_back(std::string(s.substr(pos)));
return result;
}

View File

@@ -0,0 +1,21 @@
#pragma once
#include <libudev.h>
namespace waybar::util {
struct UdevDeleter {
void operator()(udev *ptr) const { udev_unref(ptr); }
};
struct UdevDeviceDeleter {
void operator()(udev_device *ptr) const { udev_device_unref(ptr); }
};
struct UdevEnumerateDeleter {
void operator()(udev_enumerate *ptr) const { udev_enumerate_unref(ptr); }
};
struct UdevMonitorDeleter {
void operator()(udev_monitor *ptr) const { udev_monitor_unref(ptr); }
};
} // namespace waybar::util

View File

@@ -31,11 +31,16 @@ The brightness can be controlled by dragging the slider across the bar or clicki
typeof: string ++
The name of the preferred device to control. If left empty, a device will be chosen automatically.
*expand*: ++
typeof: bool ++
default: false ++
Enables this module to consume all left over space dynamically.
# EXAMPLES
```
"modules-right": [
"backlight-slider",
"backlight/slider",
],
"backlight/slider": {
"min": 0,

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,29 @@ The *backlight* module displays the current backlight level.
default: 1.0 ++
The speed at which to change the brightness when scrolling.
*min-brightness*: ++
typeof: double ++
default: 0.0 ++
The minimum brightness of the backlight.
*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.
*expand*: ++
typeof: bool ++
default: false ++
Enables this module to consume all left over space dynamically.
# 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 ++
@@ -91,6 +91,11 @@ The *battery* module displays the current capacity and state (eg. charging) of y
typeof: string ++
Command to execute when scrolling up on the module.
*weighted-average*: ++
typeof: bool ++
default: true ++
Option to combine multiple batteries with different capacities.
*on-scroll-down*: ++
typeof: string ++
Command to execute when scrolling down on the module.
@@ -109,6 +114,28 @@ 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.
*expand*: ++
typeof: bool ++
default: false ++
Enables this module to consume all left over space dynamically.
*events*: ++
typeof: object ++
Specifies commands to be executed on specific battery states. See *EVENTS* section below.
# FORMAT REPLACEMENTS
*{capacity}*: Capacity in percentage
@@ -148,6 +175,19 @@ The *battery* module allows one to define custom formats based on up to two fact
- The state can be addressed as a CSS class in the *style.css*. The name of the CSS class is the *<name>* of the state. Each class gets activated when the current capacity is equal to or below the configured *<value>*.
- Also each state can have its own *format*. Those can be configured via *format-<name>*. Or if you want to differentiate a bit more even as *format-<status>-<state>*. For more information see *custom-formats*.
# EVENTS
Every entry in the *events* object consists of a *<event-name>* (typeof: *string*) and a *<command>* (typeof: *string*). ++
*<event-name>* can be in one of the following formats:
- *on-<status>-<state>*
- *on-<status>-<capacity>*
Where:
- *<status>* is either *charging* or *discharging*,
- *<state>* is the name of one of the states specified in the *states* object,
- *<capacity>* is a battery level value (between *0-100*).
# EXAMPLES
@@ -160,6 +200,11 @@ The *battery* module allows one to define custom formats based on up to two fact
"warning": 30,
"critical": 15
},
"events": {
"on-discharging-warning": "notify-send -u normal 'Low Battery'",
"on-discharging-critical": "notify-send -u critical 'Very Low Battery'",
"on-charging-100": "notify-send -u normal 'Battery Full!'"
},
"format": "{capacity}% {icon}",
"format-icons": ["", "", "", "", ""],
"max-length": 25

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,24 @@ 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.
*expand*: ++
typeof: bool ++
default: false ++
Enables this module to consume all left over space dynamically.
# FORMAT REPLACEMENTS
*{status}*: Status of the bluetooth device.

View File

@@ -8,6 +8,8 @@ waybar - cava module
*cava* module for karlstav/cava project. See it on github: https://github.com/karlstav/cava.
Module supports two different frontends starting from the 0.15.0 release. The frontend that
will be used is managed by the method parameter in the [output] section of the cava configuration file.
# FILES
@@ -32,6 +34,10 @@ libcava lives in:
:[ string
:[
:< Path where cava configuration file is placed to
|[ *method* \[output\]
:[ string
:[
:< Manages which frontend Waybar cava module should use. Values: raw, sdl_glsl
|[ *framerate*
:[ integer
:[ 30
@@ -43,7 +49,7 @@ libcava lives in:
|[ *sensitivity*
:[ integer
:[ 100
:[ Manual sensitivity in %. It's recommended to be omitted when *autosens* = 1
:[ Manual sensitivity in %. If autosens is enabled, this will only be the initial value. 200 means double height. Accepts only non-negative values
|[ *bars*
:[ integer
:[ 12
@@ -64,7 +70,11 @@ libcava lives in:
:[ bool
:[ false
:[ Hides the widget if no input (after sleep_timer elapsed)
|[ *method*
|[ *format_silent*
:[ string
:[
:[ Widget's text after sleep_timer elapsed (hide_on_silence has to be false)
|[ *method* \[input\]
:[ string
:[ pulse
:[ Audio capturing method. Possible methods are: pipewire, pulse, alsa, fifo, sndio or shmem
@@ -101,9 +111,9 @@ libcava lives in:
:[ false
:[ Disables or enables the so-called "Monstercat smoothing" with or without "waves"
|[ *noise_reduction*
:[ double
:[ 0.77
:[ Range between 0 - 1. The raw visualization is very noisy, this factor adjusts the integral and gravity filters to keep the signal smooth. 1 - will be very slow and smooth, 0 - will be fast but noisy
:[ integer
:[ 77
:[ Range between 0 - 100. The raw visualization is very noisy, this factor adjusts the integral and gravity filters to keep the signal smooth. 100 will be very slow and smooth, 0 will be fast but noisy
|[ *input_delay*
:[ integer
:[ 2
@@ -115,11 +125,67 @@ libcava lives in:
|[ *data_format*
:[ string
:[ asci
:[ It's impossible to set it. Waybar sets it to = asci for internal needs
:[ Raw data format. Can be 'binary' or 'ascii'
|[ *raw_target*
:[ string
:[ /dev/stdout
:[ It's impossible to set it. Waybar sets it to = /dev/stdout for internal needs
:[ Raw output target. A fifo will be created if target does not exist
|[ *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.
|[ *bar_spacing*
:[ integer
:[
:[ Bars' space between bars in number of characters
|[ *bar_width*
:[ integer
:[
:[ Bars' width between bars in number of characters
|[ *bar_height*
:[ integer
:[
:[ Useless. bar_height is only used for output in "noritake" format
|[ *background*
:[ string
:[
:[ GLSL actual. Support hex code colors only. Must be within ''
|[ *foreground*
:[ string
:[
:[ GLSL actual. Support hex code colors only. Must be within ''
|[ *gradient*
:[ integer
:[ 0
:[ GLSL actual. Gradient mode(0/1 - on/off)
|[ *gradient_count*
:[ integer
:[ 0
:[ GLSL actual. The count of colors for the gradient
|[ *gradient_color_N*
:[ string
:[
:[ GLSL actual. N - the number of the gradient color between 1 and 8. Only hex defined colors are supported. Must be within ''
|[ *sdl_width*
:[ integer
:[
:[ GLSL actual. Manages the width of the waybar cava GLSL frontend module
|[ *sdl_height*
:[ integer
:[
:[ GLSL actual. Manages the height of the waybar cava GLSL frontend module
|[ *continuous_rendering*
:[ integer
:[ 0
:[ GLSL actual. Keep rendering even if no audio. Recommended to set to 1
Configuration can be provided as:
- The only cava configuration file which is provided through *cava_config*. The rest configuration can be skipped
@@ -137,16 +203,17 @@ Configuration can be provided as:
- iniparser
- fftw3
- epoxy (GLSL frontend only)
# SOLVING ISSUES
. On start Waybar throws an exception "error while loading shared libraries: libcava.so: cannot open shared object file: No such file or directory".
It might happen when libcava for some reason hasn't been registered in the system. sudo ldconfig should help
. Waybar is starting but cava module doesn't react to the music
1. In such cases at first need to make sure usual cava application is working as well
2. If so, need to comment all configuration options. Uncomment cava_config and provide the path to the working cava config
3. You might set too huge or too small input_delay. Try to setup to 4 seconds, restart waybar, and check again 4 seconds past. Usual even on weak machines it should be enough
4. You might accidentally switch action mode to pause mode
1. In such cases at first need to make sure usual cava application is working as well
2. If so, need to comment all configuration options. Uncomment cava_config and provide the path to the working cava config
3. You might set too huge or too small input_delay. Try to setup to 4 seconds, restart waybar, and check again 4 seconds past. Usual even on weak machines it should be enough
4. You might accidentally switch action mode to pause mode
# RISING ISSUES
@@ -184,3 +251,458 @@ 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
# FRONTENDS
## RAW
The cava raw frontend uses ASCII characters to visualize incoming audio data. Each ASCII symbol position corresponds to the value of the audio power pulse.
Under the hood:
```
. Incoming audio power pulse list is : 12684
. Configured array of ASCII codes is: ["▁", "▂", "▃", "▄", "▅", "▆", "▇", "█" ]. See `format-icons` https://github.com/Alexays/Waybar/wiki/Module:-Cava#example
```
As a result cava frontend will give ▁▂▆█▄
Examples:
waybar config
```
"cava": {
"cava_config": "$XDG_CONFIG_HOME/cava/waybar_raw.conf",
"input_delay": 2,
"format-icons" : ["▁", "▂", "▃", "▄", "▅", "▆", "▇", "█" ],
"actions": {
"on-click-right": "mode"
}
},
```
waybar_raw.conf
```
## Configuration file for CAVA.
# Remove the ; to change parameters.
[general]
# Smoothing mode. Can be 'normal', 'scientific' or 'waves'. DEPRECATED as of 0.6.0
# Accepts only non-negative values.
# 'autosens' will attempt to decrease sensitivity if the bars peak. 1 = on, 0 = off
# new as of 0.6.0 autosens of low values (dynamic range)
# 'overshoot' allows bars to overshoot (in % of terminal height) without initiating autosens. DEPRECATED as of 0.6.0
# Manual sensitivity in %. If autosens is enabled, this will only be the initial value.
# 200 means double height. Accepts only non-negative values.
# The number of bars (0-512). 0 sets it to auto (fill up console).
# Bars' width and space between bars in number of characters.
bars = 12
# bar_height is only used for output in "noritake" format
# For SDL width and space between bars is in pixels, defaults are:
# sdl_glsl have these default values, they are only used to calculate max number of bars.
# Lower and higher cutoff frequencies for lowest and highest bars
# the bandwidth of the visualizer.
# Note: there is a minimum total bandwidth of 43Mhz x number of bars.
# Cava will automatically increase the higher cutoff if a too low band is specified.
# Seconds with no input before cava goes to sleep mode. Cava will not perform FFT or drawing and
# only check for input once per second. Cava will wake up once input is detected. 0 = disable.
sleep_timer = 5
[input]
# Audio capturing method. Possible methods are: 'fifo', 'portaudio', 'pipewire', 'alsa', 'pulse', 'sndio', 'oss', 'jack' or 'shmem'
# Defaults to 'oss', 'pipewire', 'sndio', 'jack', 'pulse', 'alsa', 'portaudio' or 'fifo', in that order, dependent on what support cava was built with.
# On Mac it defaults to 'portaudio' or 'fifo'
# On windows this is automatic and no input settings are needed.
#
# All input methods uses the same config variable 'source'
# to define where it should get the audio.
#
# For pulseaudio and pipewire 'source' will be the source. Default: 'auto', which uses the monitor source of the default sink
# (all pulseaudio sinks(outputs) have 'monitor' sources(inputs) associated with them).
#
# For pipewire 'source' will be the object name or object.serial of the device to capture from.
# Both input and output devices are supported.
#
# For alsa 'source' will be the capture device.
# For fifo 'source' will be the path to fifo-file.
# For shmem 'source' will be /squeezelite-AA:BB:CC:DD:EE:FF where 'AA:BB:CC:DD:EE:FF' will be squeezelite's MAC address
#
# For sndio 'source' will be a raw recording audio descriptor or a monitoring sub-device, e.g. 'rsnd/2' or 'snd/1'. Default: 'default'.
# README.md contains further information on how to setup CAVA for sndio.
#
# For oss 'source' will be the path to a audio device, e.g. '/dev/dsp2'. Default: '/dev/dsp', i.e. the default audio device.
# README.md contains further information on how to setup CAVA for OSS on FreeBSD.
#
# For jack 'source' will be the name of the JACK server to connect to, e.g. 'foobar'. Default: 'default'.
# README.md contains further information on how to setup CAVA for JACK.
#
# The options 'sample_rate', 'sample_bits', 'channels' and 'autoconnect' can be configured for some input methods:
# sample_rate: fifo, pipewire, sndio, oss
# sample_bits: fifo, pipewire, sndio, oss
# channels: sndio, oss, jack
# autoconnect: jack
# Other methods ignore these settings.
#
# For 'sndio' and 'oss' they are only preferred values, i.e. if the values are not supported
# by the chosen audio device, the device will use other supported values instead.
# Example: 48000, 32 and 2, but the device only supports 44100, 16 and 1, then it
# will use 44100, 16 and 1.
#
[output]
# Output method. Can be 'ncurses', 'noncurses', 'raw', 'noritake', 'sdl'
# or 'sdl_glsl'.
# 'noncurses' (default) uses a buffer and cursor movements to only print
# changes from frame to frame in the terminal. Uses less resources and is less
# prone to tearing (vsync issues) than 'ncurses'.
#
# 'raw' is an 8 or 16 bit (configurable via the 'bit_format' option) data
# stream of the bar heights that can be used to send to other applications.
# 'raw' defaults to 200 bars, which can be adjusted in the 'bars' option above.
#
# 'noritake' outputs a bitmap in the format expected by a Noritake VFD display
# in graphic mode. It only support the 3000 series graphical VFDs for now.
#
# 'sdl' uses the Simple DirectMedia Layer to render in a graphical context.
# 'sdl_glsl' uses SDL to create an OpenGL context. Write your own shaders or
# use one of the predefined ones.
method = raw
# Orientation of the visualization. Can be 'bottom', 'top', 'left', 'right' or
# 'horizontal'. Default is 'bottom'. 'left and 'right' are only supported on sdl
# and ncruses output. 'horizontal' (bars go up and down from center) is only supported
# on noncurses output.
# Note: many fonts have weird or missing glyphs for characters used in orientations
# other than 'bottom', which can make output not look right.
# Visual channels. Can be 'stereo' or 'mono'.
# 'stereo' mirrors both channels with low frequencies in center.
# 'mono' outputs left to right lowest to highest frequencies.
# 'mono_option' set mono to either take input from 'left', 'right' or 'average'.
# set 'reverse' to 1 to display frequencies the other way around.
# Raw output target. A fifo will be created if target does not exist.
raw_target = /dev/stdout
# Raw data format. Can be 'binary' or 'ascii'.
data_format = ascii
# Binary bit format, can be '8bit' (0-255) or '16bit' (0-65530).
# Ascii max value. In 'ascii' mode range will run from 0 to value specified here
# Ascii delimiters. In ascii format each bar and frame is separated by a delimiters.
# Use decimal value in ascii table (i.e. 59 = ';' and 10 = '\n' (line feed)).
bar_delimiter = 0
# sdl window size and position. -1,-1 is centered.
# set label on bars on the x-axis. Can be 'frequency' or 'none'. Default: 'none'
# 'frequency' displays the lower cut off frequency of the bar above.
# Only supported on ncurses and noncurses output.
# enable synchronized sync. 1 = on, 0 = off
# removes flickering in alacritty terminal emulator.
# defaults to off since the behaviour in other terminal emulators is unknown
# Shaders for sdl_glsl, located in $HOME/.config/cava/shaders
; for glsl output mode, keep rendering even if no audio
# disable console blank (screen saver) in tty
# (Not supported on FreeBSD)
# show a flat bar at the bottom of the screen when idle, 1 = on, 0 = off
# show waveform instead of frequency spectrum, 1 = on, 0 = off
[color]
# Colors can be one of seven predefined: black, blue, cyan, green, magenta, red, white, yellow.
# Or defined by hex code '#xxxxxx' (hex code must be within ''). User defined colors requires
# a terminal that can change color definitions such as Gnome-terminal or rxvt.
# default is to keep current terminal color
# SDL and sdl_glsl only support hex code colors, these are the default:
# Gradient mode, only hex defined colors are supported,
# background must also be defined in hex or remain commented out. 1 = on, 0 = off.
# You can define as many as 8 different colors. They range from bottom to top of screen
[smoothing]
# Disables or enables the so-called "Monstercat smoothing" with or without "waves". Set to 0 to disable.
# Noise reduction, int 0 - 100. default 77
# the raw visualization is very noisy, this factor adjusts the integral and gravity filters to keep the signal smooth
# 100 will be very slow and smooth, 0 will be fast but noisy.
[eq]
# This one is tricky. You can have as much keys as you want.
# Remember to uncomment more than one key! More keys = more precision.
# Look at readme.md on github for further explanations and examples.
```
## GLSL
The Cava GLSL frontend delegates the visualization of incoming audio data to the GPU via OpenGL.
There are some mandatory dependencies that need to be satisfied in order for Cava GLSL to be built and function properly:
. epoxy library must be installed on the system
. Vertex and fragment shaders from the original project must be used. They should be downloaded, and the file paths must be configured correctly in the Waybar Cava configuration:
1. cava shaders [cava shaders](https://github.com/karlstav/cava/tree/master/output/shaders)
2. libcava shaders [libcava shaders](https://github.com/LukashonakV/cava/tree/master/output/shaders)
. It is highly recommended to have a separate cava configuration for the Waybar Cava GLSL module and to use this as the cava_config in the Waybar configuration.
. It is common for cava configurations to be placed in the XDG_CONFIG_HOME directory, including shaders as well. Consider keeping them in the $XDG_CONFIG_HOME/cava/shaders folder.
Key configuration options:
. bars. The more values the parameter has, the more interesting the visualization becomes.
. method in output section must be set to sdl_glsl
. sdl_width and sdl_height manage the size of the module. Adjust them according to your needs.
. Shaders for sdl_glsl, located in $HOME/.config/cava/shaders. Example: "vertex_shader" = "pass_through.vert" "fragment_shader" = "spectrogram.frag"
. Set continuous_rendering to 1 to enable smooth rendering; set it to 0 otherwise. It is recommended to keep it set to 1.
. background, foreground, and gradient_color_N (where N is a number between 1 and 8) must be defined using hex code
Example:
waybar config
```
"cava": {
"cava_config": "$XDG_CONFIG_HOME/cava/waybar_cava#3.conf",
"input_delay": 2,
"actions": {
"on-click-right": "mode"
}
},
```
waybar_raw.conf
```
## Configuration file for CAVA.
# Remove the ; to change parameters.
[general]
# Smoothing mode. Can be 'normal', 'scientific' or 'waves'. DEPRECATED as of 0.6.0
# Accepts only non-negative values.
# 'autosens' will attempt to decrease sensitivity if the bars peak. 1 = on, 0 = off
# new as of 0.6.0 autosens of low values (dynamic range)
# 'overshoot' allows bars to overshoot (in % of terminal height) without initiating autosens. DEPRECATED as of 0.6.0
# Manual sensitivity in %. If autosens is enabled, this will only be the initial value.
# 200 means double height. Accepts only non-negative values.
# The number of bars (0-512). 0 sets it to auto (fill up console).
# Bars' width and space between bars in number of characters.
bars = 50
# bar_height is only used for output in "noritake" format
# For SDL width and space between bars is in pixels, defaults are:
# sdl_glsl have these default values, they are only used to calculate max number of bars.
# Lower and higher cutoff frequencies for lowest and highest bars
# the bandwidth of the visualizer.
# Note: there is a minimum total bandwidth of 43Mhz x number of bars.
# Cava will automatically increase the higher cutoff if a too low band is specified.
# Seconds with no input before cava goes to sleep mode. Cava will not perform FFT or drawing and
# only check for input once per second. Cava will wake up once input is detected. 0 = disable.
sleep_timer = 5
[input]
# Audio capturing method. Possible methods are: 'fifo', 'portaudio', 'pipewire', 'alsa', 'pulse', 'sndio', 'oss', 'jack' or 'shmem'
# Defaults to 'oss', 'pipewire', 'sndio', 'jack', 'pulse', 'alsa', 'portaudio' or 'fifo', in that order, dependent on what support cava was built with.
# On Mac it defaults to 'portaudio' or 'fifo'
# On windows this is automatic and no input settings are needed.
#
# All input methods uses the same config variable 'source'
# to define where it should get the audio.
#
# For pulseaudio and pipewire 'source' will be the source. Default: 'auto', which uses the monitor source of the default sink
# (all pulseaudio sinks(outputs) have 'monitor' sources(inputs) associated with them).
#
# For pipewire 'source' will be the object name or object.serial of the device to capture from.
# Both input and output devices are supported.
#
# For alsa 'source' will be the capture device.
# For fifo 'source' will be the path to fifo-file.
# For shmem 'source' will be /squeezelite-AA:BB:CC:DD:EE:FF where 'AA:BB:CC:DD:EE:FF' will be squeezelite's MAC address
#
# For sndio 'source' will be a raw recording audio descriptor or a monitoring sub-device, e.g. 'rsnd/2' or 'snd/1'. Default: 'default'.
# README.md contains further information on how to setup CAVA for sndio.
#
# For oss 'source' will be the path to a audio device, e.g. '/dev/dsp2'. Default: '/dev/dsp', i.e. the default audio device.
# README.md contains further information on how to setup CAVA for OSS on FreeBSD.
#
# For jack 'source' will be the name of the JACK server to connect to, e.g. 'foobar'. Default: 'default'.
# README.md contains further information on how to setup CAVA for JACK.
#
# The options 'sample_rate', 'sample_bits', 'channels' and 'autoconnect' can be configured for some input methods:
# sample_rate: fifo, pipewire, sndio, oss
# sample_bits: fifo, pipewire, sndio, oss
# channels: sndio, oss, jack
# autoconnect: jack
# Other methods ignore these settings.
#
# For 'sndio' and 'oss' they are only preferred values, i.e. if the values are not supported
# by the chosen audio device, the device will use other supported values instead.
# Example: 48000, 32 and 2, but the device only supports 44100, 16 and 1, then it
# will use 44100, 16 and 1.
#
[output]
# Output method. Can be 'ncurses', 'noncurses', 'raw', 'noritake', 'sdl'
# or 'sdl_glsl'.
# 'noncurses' (default) uses a buffer and cursor movements to only print
# changes from frame to frame in the terminal. Uses less resources and is less
# prone to tearing (vsync issues) than 'ncurses'.
#
# 'raw' is an 8 or 16 bit (configurable via the 'bit_format' option) data
# stream of the bar heights that can be used to send to other applications.
# 'raw' defaults to 200 bars, which can be adjusted in the 'bars' option above.
#
# 'noritake' outputs a bitmap in the format expected by a Noritake VFD display
# in graphic mode. It only support the 3000 series graphical VFDs for now.
#
# 'sdl' uses the Simple DirectMedia Layer to render in a graphical context.
# 'sdl_glsl' uses SDL to create an OpenGL context. Write your own shaders or
# use one of the predefined ones.
method = sdl_glsl
# Orientation of the visualization. Can be 'bottom', 'top', 'left', 'right' or
# 'horizontal'. Default is 'bottom'. 'left and 'right' are only supported on sdl
# and ncruses output. 'horizontal' (bars go up and down from center) is only supported
# on noncurses output.
# Note: many fonts have weird or missing glyphs for characters used in orientations
# other than 'bottom', which can make output not look right.
# Visual channels. Can be 'stereo' or 'mono'.
# 'stereo' mirrors both channels with low frequencies in center.
# 'mono' outputs left to right lowest to highest frequencies.
# 'mono_option' set mono to either take input from 'left', 'right' or 'average'.
# set 'reverse' to 1 to display frequencies the other way around.
# Raw output target. A fifo will be created if target does not exist.
# Raw data format. Can be 'binary' or 'ascii'.
# Binary bit format, can be '8bit' (0-255) or '16bit' (0-65530).
# Ascii max value. In 'ascii' mode range will run from 0 to value specified here
# Ascii delimiters. In ascii format each bar and frame is separated by a delimiters.
# Use decimal value in ascii table (i.e. 59 = ';' and 10 = '\n' (line feed)).
bar_delimiter = 0
# sdl window size and position. -1,-1 is centered.
sdl_width = 150
sdl_height = 39
# set label on bars on the x-axis. Can be 'frequency' or 'none'. Default: 'none'
# 'frequency' displays the lower cut off frequency of the bar above.
# Only supported on ncurses and noncurses output.
# enable synchronized sync. 1 = on, 0 = off
# removes flickering in alacritty terminal emulator.
# defaults to off since the behaviour in other terminal emulators is unknown
# Shaders for sdl_glsl, located in $HOME/.config/cava/shaders
vertex_shader = pass_through.vert
fragment_shader = bar_spectrum.frag
; for glsl output mode, keep rendering even if no audio
continuous_rendering = 1;
# disable console blank (screen saver) in tty
# (Not supported on FreeBSD)
# show a flat bar at the bottom of the screen when idle, 1 = on, 0 = off
# show waveform instead of frequency spectrum, 1 = on, 0 = off
[color]
# Colors can be one of seven predefined: black, blue, cyan, green, magenta, red, white, yellow.
# Or defined by hex code '#xxxxxx' (hex code must be within ''). User defined colors requires
# a terminal that can change color definitions such as Gnome-terminal or rxvt.
# default is to keep current terminal color
# SDL and sdl_glsl only support hex code colors, these are the default:
background = '#282C34'
# Gradient mode, only hex defined colors are supported,
# background must also be defined in hex or remain commented out. 1 = on, 0 = off.
# You can define as many as 8 different colors. They range from bottom to top of screen
gradient = 1
gradient_count = 2
gradient_color_1 = '#282C34'
gradient_color_2 = '#45475A'
; gradient_color_1 = '#59cc33'
; gradient_color_2 = '#80cc33'
gradient_color_3 = '#a6cc33'
gradient_color_4 = '#cccc33'
gradient_color_5 = '#cca633'
gradient_color_6 = '#cc8033'
gradient_color_7 = '#cc5933'
gradient_color_8 = '#cc3333'
[smoothing]
# Percentage value for integral smoothing. Takes values from 0 - 100.
# Higher values means smoother, but less precise. 0 to disable.
# DEPRECATED as of 0.8.0, use noise_reduction instead
# Disables or enables the so-called "Monstercat smoothing" with or without "waves". Set to 0 to disable.
# Set gravity percentage for "drop off". Higher values means bars will drop faster.
# Accepts only non-negative values. 50 means half gravity, 200 means double. Set to 0 to disable "drop off".
# DEPRECATED as of 0.8.0, use noise_reduction instead
# In bar height, bars that would have been lower that this will not be drawn.
# DEPRECATED as of 0.8.0
# Noise reduction, int 0 - 100. default 77
# the raw visualization is very noisy, this factor adjusts the integral and gravity filters to keep the signal smooth
# 100 will be very slow and smooth, 0 will be fast but noisy.
[eq]
# This one is tricky. You can have as much keys as you want.
# Remember to uncomment more than one key! More keys = more precision.
# Look at readme.md on github for further explanations and examples.
```
Different waybar_cava#N.conf see at [cava GLSL](https://github.com/Alexays/Waybar/wiki/Module:-Cava:-GLSL)

View File

@@ -15,6 +15,11 @@ Addressed by *cffi/<name>*
typeof: string ++
The path to the dynamic library to load to control the widget.
*expand*: ++
typeof: bool ++
default: false ++
Enables this module to consume all left over space dynamically.
Some additional configuration may be required depending on the cffi dynamic library being used.

Some files were not shown because too many files have changed in this diff Show More