Compare commits

...

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

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

And fix focused icon (#3095)
2024-03-31 21:53:56 +07:00
Alexis Rouillard
ddc767cd81 Merge pull request #3082 from Kuruyia/refactor/privacy-module
refactor(privacy): clean up the module
2024-03-28 13:15:24 +01:00
Kuruyia
fe15530f34 refactor(privacy): clean up the module 2024-03-25 20:16:47 +01:00
Alexis Rouillard
b652b4296d Merge pull request #3066 from MauroGuida/master
fix(sway/workspaces): Visible class doesn't work on visible and empty workspaces
2024-03-25 19:03:06 +01:00
Alexis Rouillard
e8627e140c Merge pull request #3068 from ordy/master
(Fix) Alt format on group modules
2024-03-25 19:01:48 +01:00
Alexis Rouillard
d6c0d59224 Merge pull request #3081 from iynaix/master
nix: build against wireplumber 0.5
2024-03-25 17:13:11 +01:00
Lin Xianyi
5056309963 nix: build against wireplumber 0.5 2024-03-25 22:47:37 +08:00
Alexis Rouillard
487ab23259 Merge pull request #3076 from cptpcrd/reload-config
Fix reloading config
2024-03-24 22:06:56 +01:00
cptpcrd
e3ceaf63d1 Fix reloading config
Fully clear the configuration before reloading, so that when the config
is read and merged in there are no existing values which mergeConfig
refuses to overwrite.
2024-03-24 15:41:19 -04:00
Alexis Rouillard
c6cbf57a38 Merge pull request #3067 from encbar5/restore_intertible_month_scroll
Fix clock on-scroll value not being used for calendar
2024-03-24 17:19:27 +01:00
encbar5
abd7ca2a1e Fix clock on-scroll value not being used for calendar, which was broken by 86a3898 2024-03-24 10:37:31 -05:00
Sano
70ef406d6b check for group modules array in key conversion 2024-03-23 18:39:22 +01:00
Mauro Guida
7cd2a6c003 fix(sway/workspaces): Visible class doesn't work on visible and empty workspaces 2024-03-23 13:02:39 +01:00
Alexis Rouillard
cc084f5f86 Merge pull request #3028 from bartelsielski/upower-warning_level
Upower warning level
2024-03-22 23:22:56 +01:00
Alex
19f3ce6f85 fix: lint 2024-03-22 23:21:57 +01:00
Alexis Rouillard
32e241dc47 Merge pull request #2917 from alttabber/master
Add always on option for hyprland/submap
2024-03-22 23:21:17 +01:00
Alexis Rouillard
c4907a6065 Merge pull request #3005 from eyusupov/dwl-title
Add dwl/window module
2024-03-22 23:20:26 +01:00
Alexis Rouillard
f228c13802 Merge pull request #2638 from staticssleever668/fix_mold_linking
refactor(backlight): use concrete types for some helper functions
2024-03-22 23:19:49 +01:00
Alexis Rouillard
e30ddda23a Merge pull request #2987 from tomben13/master
[hyprland/workspaces] New options to change on click behaviour and active workspace status
2024-03-22 23:16:57 +01:00
Alexis Rouillard
38634a0ca8 Merge pull request #3034 from wispl/master
Add empty workspace style for Sway
2024-03-22 23:13:29 +01:00
Alex
fe0716bf39 fix: lint 2024-03-22 23:13:10 +01:00
Alexis Rouillard
9d95eaaac4 Merge pull request #2919 from tokyovigilante/wireplumber-0.5
Update Wireplumber API to 0.5
2024-03-22 23:12:07 +01:00
Ryan Walklin
2326727ccb Update Wireplumber API to 0.5
The WP component loader API has changed to be asynchronous, so implement a (GAsyncReadyCallback)-based loader to manage them. Logging integration change was required for 0.5.0 RCs but not for the 0.5.0 release.

Fix clang-tidy and clang-format warnings. Note these are significantly wider than the changes for 0.5.0 so optional beyond the existing patchset.
2024-03-21 13:37:03 +13:00
Alexis Rouillard
1ecca055f7 Merge pull request #3051 from MauroGuida/master
fix(sway/workspaces): visible class doesn't work
2024-03-20 15:26:31 +01:00
Mauro Guida
c841bf567b fix(sway/workspaces): visible class doesn't work 2024-03-20 15:03:25 +01:00
Alexis Rouillard
49a13ab28f Merge pull request #3049 from MauroGuida/master
fix(wlr/taskbar): crash on taskbar drag and drop event
2024-03-20 14:02:41 +01:00
Mauro Guida
6d690ad48b fix(wlr/taskbar): crash on taskbar drag and drop event 2024-03-20 13:28:35 +01:00
Alexis Rouillard
b9688eb067 Merge pull request #3032 from leiserfg/ppd-right-click
Make right-click to circle down ppd
2024-03-20 10:34:10 +01:00
wispl
0fcf6bcebc Document sway workspace button.empty 2024-03-19 22:56:20 -04:00
wispl
cf3389e5d7 Add empty workspace style for Sway 2024-03-19 22:56:20 -04:00
Alexis Rouillard
cbe42a8536 Merge pull request #3037 from grimpy/fixperistentclass
Fix peristent class on buttons
2024-03-19 22:56:37 +01:00
Alexis Rouillard
73e24af71c Merge pull request #3039 from hrdl-github/fix-floating
Also consider floating nodes when checking for flags
2024-03-19 14:25:20 +01:00
hrdl
856a34e16d Also consider floating nodes when checking for flags
Fixes #3030
2024-03-19 11:53:04 +01:00
Jo De Boeck
2ffd9a94a5 Fix peristent class on buttons
Fixes: #3009

Signed-off-by: Jo De Boeck <deboeck.jo@gmail.com>
2024-03-19 08:22:33 +02:00
leiserfg
67218d5554 Make right-click to circle down ppd 2024-03-18 21:49:40 +01:00
Bartel Sielski
bbb69bd977 upower: Initialize variables
There are code paths in which some of these variables were used but not
initialized, causing undefined behavior.
2024-03-18 20:38:50 +01:00
Bartel Sielski
bd8b215416 upower: Add 'low' and 'critical' CSS classes
Add secondary CSS class based on the 'warning_level' field reported by UPower
over D-Bus.  This makes it possible to add custom styling when the battery is
near empty.
2024-03-18 20:36:46 +01:00
Alexis Rouillard
2c927de4c6 Merge pull request #3023 from tomben13/fix_segfault 2024-03-17 23:09:38 +01:00
Tom Benham
736309ef1f Fixed segfault 2024-03-17 23:00:48 +01:00
Alexis Rouillard
ca17bdb214 Merge pull request #2968 from jramrath/hyprland_workspaces_monitor_class
Hyprland workspaces `hosting-monitor` css class
2024-03-17 13:06:50 +01:00
Jannik
f014a7d2e5 man docs & different css class name 2024-03-16 21:22:01 +01:00
Alexis Rouillard
376b4d1c09 Merge pull request #3015 from DreamMaoMao/master 2024-03-16 13:54:06 +01:00
DreamMaoMao
c5a6299398 fix:dwl tag crash when use wlr-randr enable monitor 2024-03-16 20:10:05 +08:00
Alexis Rouillard
8174dce776 Merge pull request #3011 from nicolarevelant/master
Use the correct thermal zone in FreeBSD
2024-03-15 17:37:07 +01:00
Nicola Revelant
01ff7ebb36 Fix clang-format to src/modules/temperature.cpp 2024-03-15 17:12:31 +01:00
Nicola Revelant
fbf66530a3 Explicit convert from std::string to const char* 2024-03-15 16:52:52 +01:00
Nicola Revelant
e1f876b981 Fix fmt::format: missing argument 2024-03-15 16:36:54 +01:00
Alexis Rouillard
1eb509a86d Merge pull request #3010 from luzpaz/repology-badge
README: tweak repology badge
2024-03-15 16:10:11 +01:00
Nicola Revelant
2d12236726 Use the correct thermal zone in FreeBSD 2024-03-15 16:09:18 +01:00
luzpaz
4ccefa0902 README: tweak repology badge
* Change repology badge header  
* Use 3 columns instead of 1 to display badge
2024-03-15 11:05:55 -04:00
Alexis Rouillard
fc4b9fa22b Merge pull request #3008 from alebastr/ppd-fix-initial-visibility 2024-03-15 10:16:56 +01:00
Aleksei Bavshin
dcddddd3f1 fix(power-profiles-daemon): correctly set initial visibility
The bus error when the daemon is not reachable prevents the initial
update and keeps the module visible, as an empty section on the bar.

Do the update explicitly before connecting to set initial visibility.

While we at it, remove a couple of redundant `update()` calls.
2024-03-14 20:47:07 -07:00
Eldar Yusupov
17734f0364 Add dwl/window module 2024-03-14 23:51:46 +03:00
Alex
32eac3ccb7 chore: 0.10.0 2024-03-13 19:46:56 +01:00
Alexis Rouillard
20f08b881a Merge pull request #2996 from rroohhh/feat/horizontal_scroll
feat: allow horizontal scroll
2024-03-13 19:45:20 +01:00
Alexis Rouillard
214858f413 Merge pull request #3001 from grimpy/fixpersitantworkspaces
Fix peristant workspaces for sway
2024-03-12 14:22:18 +01:00
Jo De Boeck
7b3d155608 Fix peristant workspaces for sway
Fixes: #2998

Signed-off-by: Jo De Boeck <deboeck.jo@gmail.com>
2024-03-12 04:40:54 +02:00
Robin Ole Heinemann
207e99876d feat: allow horizontal scroll 2024-03-08 21:48:27 +01:00
Tom Benham
68889494d0 Removed option active-per-monitor 2024-03-05 11:12:46 +01:00
Alexis Rouillard
4c46d7d245 Merge pull request #2887 from dann-merlin/master
Add justify config option for Labels
2024-03-05 09:01:44 +01:00
Merlin Sievers
25b85800a5 Add documentation for justify option 2024-03-04 20:00:57 +01: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
Alexis Rouillard
380607583e Merge pull request #2971 from picnoir/pic/power-profiles-daemon
Introduce a power-profiles-daemon module
2024-03-04 14:25:16 +01:00
Tom Benham
df7f1fffcf feat(hyprland/workspaces): added options move-to-monitor and active-per-monitor 2024-03-04 13:17:52 +01:00
Alexis Rouillard
26af1066e1 Merge pull request #2984 from alebastr/too-much-logs-mpd
mpd: less aggressive logging and reconnections
2024-03-03 10:05:22 +01:00
Alexis Rouillard
97cd2b47b8 Merge pull request #2986 from ErikReider/sway-workspaces-scroll-fix 2024-03-02 23:37:06 +01:00
Erik Reider
9de0e393ab Sway-Workspaces: Fixed scrolling not working
Fixes regression in bb843e0 that caused scrolling over the bar not working
2024-03-02 23:08:21 +01:00
Félix Baylac Jacqué
5578c122ab modules/power-profiles-daemon: kebab case name in config
power_profiles_daemon => power-profiles-daemon
2024-03-02 18:44:25 +01:00
Félix Baylac Jacqué
5ba7c9eb60 modules/power-profiles-daemon: add some right padding
The icon is not really centered in the box. This is likely coming from
a bogus glyph width calculation. It's not a big deal, but that's not
really pleasant aesthetically-wise.

Adding a bit of right padding makes it much more pleasant to watch. It
does not really disrupt a wider display form, like one that
explicitely writes the active profile.
2024-03-02 18:20:46 +01:00
Félix Baylac Jacqué
cc759a8b8f Power profiles daemon: address review comments
Adding :
- A missing try/catch
- Glib::Error catch
- Remove the useless destructor
- Populate the profiles vector more efficiently
- Numerous nits
2024-03-02 18:20:46 +01:00
Félix Baylac Jacqué
bddc870340 modules/power-profiles-daemon: add man page
There was no way to display the default value of format-icons without
breaking the table :(
2024-03-02 09:46:14 +01:00
Félix Baylac Jacqué
09bb6a055d modules/power_profiles_daemon: safely call dbus asynchronously
2 changes to address the review feedback:

1. Aleksei pointed out in this
   comment (https://github.com/Alexays/Waybar/pull/2971#issuecomment-1972364896)
   that there's no way to tell if a proxy is alive other than trying to
   call a method on it. We perform a little dance to check whether or
   not power-profiles-daemon is available on the system by calling
   properties.GetAll. If something responds, we assume
   power-profiles-daemon is installed, it's then safe to draw the
   widget and attach the callback to the active profile.
2. We replaced all the synchronous DBus operations by their async
   counterparts.
2024-03-01 12:55:37 +01:00
Félix Baylac Jacqué
61fed6a214 modules/power_profiles_daemon: add custom format from config
We move to a single icon label format to save space on the bar. We
still display the profile name and the driver in the tooltip.
2024-03-01 11:18:24 +01:00
Aleksei Bavshin
c03fa38974 fix(mpd): use default interval in the example config
2 seconds is 2.5 times more often than the default for the module.
2024-03-01 00:53:12 -08:00
Aleksei Bavshin
bb60d41842 fix(mpd): use timers with second granularity where possible
Reuse already armed timer in Disconnected state.
2024-03-01 00:27:23 -08:00
Aleksei Bavshin
653c24cee1 feat(mpd): tone down logs if the server is not running 2024-03-01 00:16:19 -08:00
Alexis Rouillard
bdff489850 Merge pull request #2983 from alebastr/ci-freebsd-on-ubuntu
ci: move FreeBSD to ubuntu runners
2024-03-01 05:41:40 +01:00
Félix Baylac Jacqué
162b41c4d0 modules/power-profiles-daemon: apply clang-tidy suggestions 2024-02-29 21:46:27 +01:00
Aleksei Bavshin
55915f95f1 ci: move FreeBSD to ubuntu runners
With the recent runner hardware upgrade[1] and support in the
cross-platform-actions[2] it became possible to use a Linux runner for
this workflow.
Linux-based configuration appears to be faster and stabler than macOS,
so it's now recommended for use.

[1]: https://github.blog/2024-01-17-github-hosted-runners-double-the-power-for-open-source/
[2]: https://github.com/cross-platform-actions/action/releases/tag/v0.23.0
2024-02-28 23:56:10 -08:00
alttabber
d9abc080e1 Fix merge conflict with #2930 2024-02-28 22:52:08 +01:00
Alexis Rouillard
e7c7ef6814 Merge pull request #2979 from grimpy/filterscratch
Filter out special output __i3 which contains scratchpad
2024-02-28 10:38:33 +01:00
Alexis Rouillard
04f73e7303 Merge pull request #2973 from Azazel-Woodwind/feature/hyprland-window-improvements
Improved hyprland/window by fixing icon search and implementing configurable spacing
2024-02-28 09:29:54 +01:00
Azazel
ba48d26dd4 chore: amend default icon spacing 2024-02-28 00:24:58 +00:00
Jo De Boeck
5a887fe1ef Filter out special output __i3 which contains scratchpad
Fixes: #2966

Signed-off-by: Jo De Boeck <deboeck.jo@gmail.com>
2024-02-27 23:43:00 +02:00
Alexis Rouillard
e79ea93d7d Merge pull request #2967 from aruhier/pr_hyprland_workspaces
hyprland/workspaces: Improve the workspaces persistency logic
2024-02-27 16:41:32 +01:00
Azazel
615c9050e7 fix: prevent icon showing when app_identifier is empty 2024-02-26 22:52:28 +00:00
Azazel
c59bb509bd fix: hide icon if window is unfocused 2024-02-26 21:00:16 +00:00
Azazel
a7d8b1bacf feat: re-add default and configurable icon spacing 2024-02-26 20:58:38 +00:00
Félix Baylac Jacqué
968f469289 modules/power-profiles-daemon: run clang format 2024-02-26 14:44:14 +01:00
Félix Baylac Jacqué
c38d05b04f Introduce power-profiles-daemon module
We introduce a module in charge to display and toggle on click the
power profiles via power-profiles-daemon.

https://gitlab.freedesktop.org/upower/power-profiles-daemon

This daemon is pretty widespread. It's the component used by Gnome and
KDE to manage the power profiles. The power management daemon is a
pretty important software component for laptops and other
battery-powered devices.

We're using the daemon DBus interface to:

- Fetch the available power profiles.
- Track the active power profile.
- Change the active power profile.

The original author recently gave up maintenance on the project. The
Upower group took over the maintenance burden… …and created a new
DBus name for the project. The old name is still advertised for now.
We use the old name for compatibility sake: most distributions did not
release 0.20, which introduces this new DBus name. We'll likely revisit
this in the future and point to the new bus name. See the inline
comment for more details.

Given how widespread this daemon is, I activated the module in the
default configuration.
2024-02-26 14:44:14 +01:00
Azazel
695c786354 refactor: reuse toLowerCase function 2024-02-26 04:17:45 +00:00
Azazel
16aced7f9f feat: move name and classes from label_ to box_ 2024-02-26 04:07:03 +00:00
Anthony Ruhier
d6d4d87cf7 Attributes doc format fix from the review
Co-authored-by: Tuur Vanhoutte <4633209+zjeffer@users.noreply.github.com>
2024-02-26 00:21:36 +01:00
Anthony Ruhier
b3ee94d87a Improve hyprland/workspaces persistency logic
Fixes #2945

Split the config and rule persistency in 2 attributes, one storing the
persistency as set in Waybar's config, the other one storing the
persistency as set in Hyprland.

It fixes some conflicts between the persistency state of a workspace as
set in Waybar's config and its dynamic state in Hyprland.

It allows to remove a persistent workspace in Waybar if this workspace
is removed from Hyprland and if the workspace is not set as persistent
in Waybar's config.
2024-02-26 00:14:25 +01:00
Azazel
3a5aa5ee83 feat: improve default spacing and add to config 2024-02-25 22:56:52 +00:00
Azazel
0ead42e52b feat: improve search of .desktop files 2024-02-25 22:55:30 +00:00
Alexis Rouillard
6703adc37f Merge pull request #2972 from alebastr/config-tweaks
RFC: Rename config to config.jsonc
2024-02-25 23:43:25 +01:00
Aleksei Bavshin
43aabf046c chore: rename config to config.jsonc
Only changes the name of the default config we install and does not
affect the lookup logic in any way.

Man pages were already fixed in #2744
2024-02-25 12:00:53 -08:00
Aleksei Bavshin
2108959644 chore(config): add modeline for Emacs json-mode
json-mode supports jsonc format since 1.8.0, but does not register
.jsonc as a file extension.
2024-02-25 11:21:58 -08:00
Alexis Rouillard
3a33c0b290 Merge pull request #2930 from zjeffer/fix/zjeffer/hyprland-clang-tidy
fix clang-tidy errors in hyprland module
2024-02-25 17:11:13 +01:00
Alexis Rouillard
fb193529fc Merge pull request #2961 from alebastr/sway-language-single-layout
feat(sway/language): option to hide module with single layout
2024-02-25 17:10:50 +01:00
Alexis Rouillard
75dce1ef4b Merge pull request #2969 from alebastr/config-tweaks
Config tweaks
2024-02-25 17:10:22 +01:00
Jannik
9bc8de8876 fix clang complaints 2024-02-25 13:46:49 +01:00
zjeffer
42f4386e2e fix clang-tidy errors in hyprland module 2024-02-25 12:11:22 +01:00
zjeffer
edd723d95c Change PrivateMember styling to use trailing underscore instead of m_ in .clang-tidy 2024-02-25 11:44:55 +01:00
Aleksei Bavshin
05fbbc1c43 style: align 'sway/mode' text with other modules
Use `box-shadow` instead of borders for consistent vertical alignment.
See 77c7e10 for a similar conversion of other modules.
2024-02-24 18:26:02 -08:00
Aleksei Bavshin
2540c07f1d chore: wrap module lists in the config
"modules-right" has gotten too long, and it's easier to compare configs
that way.
2024-02-24 18:24:39 -08:00
Jannik
4cc2800a78 add 'onThisMonitor' css class 2024-02-25 00:52:33 +01:00
Jannik
16079eae09 update m_output 2024-02-25 00:51:52 +01:00
Aleksei Bavshin
188789592e feat(sway/language): option to hide module with single layout 2024-02-24 00:30:45 -08:00
Aleksei Bavshin
99c48bca36 fix: formatting 2024-02-24 00:30:44 -08:00
Alexis Rouillard
601af3de81 Merge pull request #2958 from JonnyTischbein/mediaplayer-exclude 2024-02-24 00:06:03 +01:00
Jonny Tischbein
3d31e9a22a mediaplayer: add exclude player option 2024-02-23 18:41:45 +01:00
Alexis Rouillard
793394c862 Merge pull request #2949 from aokblast/feat/bsd_cpufreq
feat: implement cpufreq for bsd by sysctl
2024-02-22 01:25:21 +01:00
aokblast
514d00803c feat: implement cpufreq for bsd by sysctl 2024-02-22 04:47:09 +08:00
Alexis Rouillard
977c66e7c5 Merge pull request #2948 from alebastr/clang-tidy-fix
ci: fix clang-tidy action
2024-02-21 09:19:20 +01:00
Alex
450a344426 chore: only label issues 2024-02-21 09:19:03 +01:00
Aleksei Bavshin
5fc2b97194 ci: fix clang-tidy action 2024-02-20 17:22:33 -08:00
Alex
efb2eb5073 chore: update cpp-linter 2024-02-20 22:24:30 +01:00
Alexis Rouillard
1606dce62e Merge pull request #2944 from grimpy/waybarwindows
Implement windows formating in sway/workspaces
2024-02-20 18:34:32 +01:00
Jo De Boeck
bb843e0494 Implement windows formating in sway/workspaces
This implementation mimics to some extend the implementation of hyprland

Signed-off-by: Jo De Boeck <deboeck.jo@gmail.com>
2024-02-20 19:12:26 +02:00
Alexis Rouillard
1b4008c58b Merge pull request #2943 from iynaix/master
nix: update libcava version and removal of gtk-layer-shell meson option
2024-02-20 11:34:04 +01:00
Alex
a45932973a fix: lint 2024-02-20 11:33:41 +01:00
Lin Xianyi
00ee538c95 nix: update libcava version and removal of gtk-layer-shell meson option 2024-02-20 17:57:07 +08:00
Alexis Rouillard
4ef5b48474 Merge pull request #2934 from tomben13/master
Fixed window#waybar.swallowing for module hyprland/window
2024-02-20 10:39:33 +01:00
Tom Benham
e6aa06cdf3 window#waybar.swallowing -- backward compatibility 2024-02-20 09:39:03 +01:00
Alex
e42635197c chore: more labels 2024-02-20 08:35:28 +01:00
Alex
b8324be8c4 fix: token 2024-02-20 08:26:14 +01:00
Alexis Rouillard
197bc6a877 Merge pull request #2938 from thejch/click-special 2024-02-20 08:03:16 +01:00
Alexis Rouillard
536933ca24 Merge pull request #2940 from alebastr/clock 2024-02-20 08:02:08 +01:00
Alexis Rouillard
a118af0d1b Merge pull request #2939 from alebastr/ci-update-debian-dependencies 2024-02-20 08:01:18 +01:00
Aleksei Bavshin
f885baba61 fix(clock): remove literal operator with reserved name
```
../include/util/date.hpp:34:26: warning: literal operator suffixes not preceded by ‘_’ are reserved for future standardization [-Wliteral-suffix]
   34 | constexpr decltype(auto) operator""d(unsigned long long d) noexcept {
```
2024-02-19 21:56:47 -08:00
Aleksei Bavshin
a2deff3689 fix(clock): crash on scrolling with local timezone ("") in the list
While we at it, eliminate use of non-portable GCC conditional expression
syntax. There are no significant side-effects that would justify use of
the language extension.
2024-02-19 21:56:46 -08:00
Aleksei Bavshin
5d6acfd1d4 test: restore compatibility with older Catch2 releases 2024-02-19 17:00:01 -08:00
Aleksei Bavshin
d59d6e8765 chore: remove duplicate fedora/c++20 job definition 2024-02-19 16:35:56 -08:00
Aleksei Bavshin
bdb2f2bd1a chore: update Debian CI dependencies
This should speed-up "linux (debian)" and "clang-tidy" builds and enable
lints for more modules.
2024-02-19 16:35:21 -08:00
Jeremy Huang
4a5444d196 fix click special 2024-02-19 16:16:46 -08:00
Alexis Rouillard
ce5a1cf2f9 Merge pull request #2937 from alebastr/factory-includes
refactor: move all module includes to factory.cpp
2024-02-20 00:44:38 +01:00
Aleksei Bavshin
c6f5cbdf0c refactor: move all module includes to factory.cpp
None of these includes are required in the header.
2024-02-19 15:11:08 -08:00
Alexis Rouillard
6048e23e09 Merge pull request #2926 from alebastr/meson-cleanup
build: refactorings and deprecation fixes
2024-02-19 23:44:52 +01:00
Alexis Rouillard
3d75167e67 Merge pull request #2936 from Alexays/revert-2773-waybarwindows
Revert "Implement windows formating in sway/workspaces"
2024-02-19 23:28:15 +01:00
Alexis Rouillard
ee2407496f Revert "Implement windows formating in sway/workspaces" 2024-02-19 23:28:08 +01:00
Alex
175852e527 chore: auto label 2024-02-19 23:24:20 +01:00
Alexis Rouillard
d36f15c26b Merge pull request #2935 from Alexays/revert-2915-cpu_style
Revert "Add style class for CPU state"
2024-02-19 23:10:20 +01:00
Alexis Rouillard
742cd7f371 Revert "Add style class for CPU state" 2024-02-19 23:10:10 +01:00
Alex
41b2d0cb29 chore(workflows): concurrency 2024-02-19 23:09:24 +01:00
Aleksei Bavshin
a95b6a39c9 build: mark bluetooth as Linux-specific 2024-02-19 14:08:22 -08:00
Alex
bd0bf836c7 fix: lint 2024-02-19 23:07:50 +01:00
Alexis Rouillard
ae1e11db22 Merge pull request #2773 from grimpy/waybarwindows
Implement windows formating in sway/workspaces
2024-02-19 23:05:24 +01:00
Alexis Rouillard
347197865f Merge pull request #2885 from jones-josh/ordinal-date
Add ordinal date toolbar format specifier to clock module
2024-02-19 23:03:40 +01:00
Alexis Rouillard
91b79a2e9e Merge pull request #2894 from jramrath/active-for-hyprland-special-workspaces
Add css classes to hyprland special workspaces
2024-02-19 23:02:17 +01:00
Alexis Rouillard
70dc388dff Merge pull request #2915 from haasn/cpu_style
Add style class for CPU state
2024-02-19 22:58:21 +01:00
Alexis Rouillard
bba8da76b6 Merge pull request #2836 from alebastr/require-gtk-layer-shell
Require gtk-layer-shell
2024-02-19 22:57:50 +01:00
Alexis Rouillard
9abd0da1c7 Merge pull request #2603 from zjeffer/hyprland/persistent-workspaces
Hyprland/workspaces: use Hyprland's workspace rules for persistency
2024-02-19 22:55:28 +01:00
Alexis Rouillard
6fbae3bd7b Merge pull request #2888 from imran1008/hwmon-path-abs-subdir
Search for the first hwmon* directory
2024-02-19 22:53:31 +01:00
Alexis Rouillard
9191cae13b Merge pull request #2923 from jones-josh/custom-tooltip-format
Add check for tooltip-format for custom modules
2024-02-19 22:47:22 +01:00
Alexis Rouillard
a18b6dcc29 Merge pull request #2925 from LukashonakV/bump_cava
libcava bump 0.10.1
2024-02-19 22:47:04 +01:00
Alexis Rouillard
c553e3028e Merge pull request #2928 from zjeffer/fix/zjeffer/build-warnings
fix build warning in bar.cpp
2024-02-19 22:41:44 +01:00
Tom Benham
745d5687b8 Fixed window#waybar.swallowing for module hyprland/window 2024-02-19 22:23:03 +01:00
Aleksei Bavshin
8a4a44896a refactor: merge BarSurface into Bar
With only one implementation left, the abstraction is no longer
necessary.
2024-02-19 03:00:38 -08:00
Aleksei Bavshin
4420447e74 fix(bar): use std::string for mode names
`string_view` leads to UAF when reading custom mode definitions from the
configuration.
2024-02-19 01:50:40 -08:00
zjeffer
11310b89f0 hyprland/workspaces: Use hyprland's persistent workspaces configuration 2024-02-18 16:04:47 +01:00
zjeffer
a02bacdd53 fix build warning 2024-02-18 12:01:36 +01:00
Aleksei Bavshin
543290ab07 fix: -Wnon-virtual-dtor warning in CssReloadHelper
```
../include/util/css_reload_helper.hpp:15:7: warning: 'class waybar::CssReloadHelper' has virtual functions and accessible non-virtual destructor [-Wnon-virtual-dtor]
```
2024-02-17 21:43:10 -08:00
Aleksei Bavshin
fd5a03dc5f build: disable catch2 unit-tests
The library tests take more time to complie than the entire Waybar.
2024-02-17 21:43:09 -08:00
Aleksei Bavshin
f3063e86aa build: install man pages only for enabled modules 2024-02-17 21:43:08 -08:00
Aleksei Bavshin
3cb587945a fix: use gtk_layer_set_keyboard_mode()
`gtk_layer_set_keyboard_interactivity()` is deprecated and was removed
in gtk4-layer-shell.
Note that this bumps version requirement to 0.6.0
2024-02-17 11:23:19 -08:00
Aleksei Bavshin
9a21884272 feat!: drop RawSurfaceImpl with direct use of wlr-layer-shell
BREAKING CHANGE: gtk-layer-shell is now required and unconditionally
used. The corresponding config option is removed.

As a part of preparation for future versions of GTK, remove an ability
to use wlr-layer-shell directly. The APIs it required were dropped in
GTK4, and with the menus/tooltips positioning issue being practically
unsolvable it doesn't make sense to keep maintaining the code.
2024-02-17 11:23:17 -08:00
Aleksei Bavshin
4f5dd53571 chore: update gtk-layer-shell subproject to 0.8.2 2024-02-17 11:21:43 -08:00
Aleksei Bavshin
4b34486143 man: fix missing code block fence in hyprland-workspaces 2024-02-17 08:45:44 -08:00
Aleksei Bavshin
63935ba0fb build: don't use sh for scdoc 2024-02-17 08:45:18 -08:00
Aleksei Bavshin
d9f9fb51ff build: use / instead of join_paths 2024-02-17 08:45:17 -08:00
Aleksei Bavshin
c2f37705ad build: address meson deprecation warnings:
- `ExternalProgram.path`
- `dependency.get_pkgconfig_variable`
- `meson.build_root`
- `meson.source_root`
2024-02-17 08:45:16 -08:00
Aleksei Bavshin
72406fa3f2 build: require gio-unix-2.0 unconditionally
We already use it without checking (`<gio/gdesktopappinfo.h>` in
wlr/taskbar), it's a transitive dependency of GTK and it's always
available on Unix platforms.
2024-02-17 08:33:31 -08:00
Aleksei Bavshin
104accdc34 build: drop std::filesystem checks
The `<experimental/filesystem>` and `-lc++experimental` aren't needed
since LLVM 9.0. And since we now require C++20, checking for the
`<filesystem>` support shouldn't be necessary either.
2024-02-17 08:33:22 -08:00
Viktar Lukashonak
d7d4dca6ba libcava bump 0.10.1
Signed-off-by: Viktar Lukashonak <myxabeer@gmail.com>
2024-02-17 18:20:03 +03:00
Josh Jones
7f3e396383 add tooltip-format to custom module man page 2024-02-16 15:26:36 +01:00
Alexis Rouillard
3cd311819b Merge pull request #2921 from alebastr/module-classes
Add `module` class to the root elements of the modules
2024-02-16 13:34:50 +01:00
Josh Jones
9c3881f6f8 add check for tooltip-format for custom modules 2024-02-16 01:33:04 +01:00
Aleksei Bavshin
d590d508ca feat: add module class to the root elements of the modules
Previously, the only way to select all the module labels was with the
following kind of selector:
```css
.modules-left > widget > label,
.modules-center > widget > label,
.modules-right > widget > label {
    /* ... */
}
```
(and a matching block for the `box` containers).

Now, this can be expressed as
```css
label.module, box.module {
    /* ... */
}
```
2024-02-14 22:41:13 -08:00
Aleksei Bavshin
2f555a6936 refactor(bar): use Gtk enums for position and orientation
Ensure that the position and the corresponding CSS class on window are
always set.
2024-02-14 22:11:21 -08:00
alttabber
9ea470410f Add always on option for hyprland/submap 2024-02-13 17:02:14 +01:00
Alexis Rouillard
28cd9dff47 Merge pull request #2916 from alttabber/master
Add style classes for hyprland/submap
2024-02-13 13:25:23 +01:00
alttabber
77c7b91b40 Add style classes for hyprland/submap 2024-02-13 11:46:27 +01:00
Niklas Haas
a0bac34329 Add style class for CPU state
Fixes: https://github.com/Alexays/Waybar/issues/2911
2024-02-13 10:49:57 +01:00
Alexis Rouillard
2c244b5e83 Merge pull request #2912 from zjeffer/fix/zjeffer/build-warnings
Fix build warnings
2024-02-12 20:30:58 +01:00
zjeffer
dd8d6fbe6c Fix build warnings 2024-02-12 20:09:22 +01:00
Jannik
acf6611098 clang-format 2024-02-10 17:35:46 +01:00
Jannik
a2925fa5da fix 'visible' class for special workspaces 2024-02-10 17:26:44 +01:00
Jannik
240b49f9d2 Add 'empty' css class to special workspaces 2024-02-10 16:59:53 +01:00
Jannik
d4331ce7fe improve handling of special workspace name 2024-02-09 13:49:39 +01:00
Alexis Rouillard
4d076a71f7 Merge pull request #2899 from OpenSauce04/battery-full-no-alt
Make battery estimate inaccessible in the "Full" state on default config
2024-02-09 10:54:22 +01:00
OpenSauce04
90c2415b64 Battery estimate is no longer accessible in the "Full" state on default config 2024-02-08 15:10:21 +00:00
Jannik
692f8f4ea4 add/remove 'active' on 'focusedmon' IPC event 2024-02-07 22:42:05 +01:00
Jannik
61be2267ab add 'visible' css class to special workspaces 2024-02-07 21:10:17 +01:00
Jannik
c30541b954 remove whitespaces 2024-02-07 16:56:37 +01:00
Jannik
3bfcd5e086 Add 'active' css class to special workspaces 2024-02-07 16:33:19 +01:00
Alexis Rouillard
b6f4a0dae2 Merge pull request #2881 from jramrath/drawer-direction
Fix: drawer not appearing on configured side
2024-02-06 16:18:52 +01:00
Imran Haider
92875711c6 Search for the first hwmon* directory
Background and Motivation
-------------------------
When the `hwmon-path-abs` and the `input-filename` fields are used for
the temperature module, we evaluated the following path:

```
[hwmon-path-abs] / [gap] / [input-filename]
```

where `gap` is the first file or directory in the `hwmon-path-abs`
directory. This usually works but it doesn't seem to work for NVME or
WiFi temperature sensors. For those cases, there are a bunch of other
files in the `hwmon-path-abs` directory. In the bad case, the first
selected file is not the one with the prefix `hwmon` and we end up
checking the wrong location for the `input-filename`.

Change description
------------------
We are simply going through the `hwmon-path-abs` directory and searching
for the first file/directory that begins with `hwmon`.

Test case
---------
I tested this on a AMD based Framework 13 laptop.
2024-02-05 21:40:24 -05:00
Merlin Sievers
89b3203bfa Add justify config option for Labels
This is especially useful for centering labels on vertical bars.
2024-02-05 14:44:59 +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
Jannik
08b32cb901 Removing unnecessary parts of transition_type handling 2024-02-04 16:17:06 +01:00
Josh Jones
1fa1045af9 remove duplicated segment 2024-02-04 16:11:39 +01:00
Josh Jones
e02cb9cfb9 add ordinal format specifier to man clock 2024-02-04 15:49:14 +01:00
Josh Jones
718dd4afae add ordinal date toolbar format specifier to clock module 2024-02-04 15:41:39 +01:00
Jo De Boeck
c641d52e06 Implement windows formating in sway/workspaces
This implementation mimics to some extend the implementation of hyprland

Signed-off-by: Jo De Boeck <deboeck.jo@gmail.com>
2024-02-03 12:31:06 +02:00
Jannik
029b380c15 Fix: drawer not appearing on configured side 2024-02-02 20:54:16 +01:00
Alexis Rouillard
4c5ff80bbd Merge pull request #2874 from Alexays/fix-reload-style
fix: reload style
2024-01-31 23:09:54 +01:00
Alex
f1016322b9 fix: tpyo 2024-01-31 22:59:09 +01:00
Alex
6dcae2cade fix: reload style 2024-01-31 22:57:20 +01:00
Alex
fb6658e8fd chore: lint 2024-01-30 09:07:37 +01:00
Alexis Rouillard
1dce607c42 Merge pull request #2852 from dpayne/add_css_reload
Adding css reloader
2024-01-29 22:44:29 +01:00
dpayne
10cb4180f6 * Fixing clang tidy comments
* Fixing missing includes
* Fixing formatting
2024-01-28 14:44:25 -08:00
Alexis Rouillard
5534fc48b1 Merge pull request #2496 from zjeffer/tests/json
Fix JSON parsing with hexadecimal characters
2024-01-28 23:38:54 +01:00
dpayne
9556b0fe89 Adding a man page entry for the realod_style_on_change option 2024-01-28 14:25:00 -08:00
Alexis Rouillard
ddad6ce136 Merge pull request #2866 from Jay-716/pa-reconnect
pulseaudio: reconnect context when pulseaudio server restarts
2024-01-28 17:04:57 +01:00
Jay-716
14d168c254 pulseaudio: extract context connecting into connectContext() 2024-01-27 23:47:39 +08:00
Jay-716
167f04a4df pulseaudio: reconnect context when pulseaudio server restarts
When pulseaudio server restarts, the context is not reconnect
automatically. So the pulseaudio module will stop updating.
2024-01-25 23:59:32 +08:00
Alexis Rouillard
5f115785cf Merge pull request #2862 from Sryther/master
Move `.empty` CSS class from Img to Box in the Image module
2024-01-25 16:12:02 +01:00
Alexis Rouillard
7caf0b9ec4 Merge pull request #2865 from chntllh/Battery-animations
Using steps() in animation to reduce cpu usage.
2024-01-25 16:11:00 +01:00
Paul Rey
94633c346a retrigger checks 2024-01-25 11:02:44 +01:00
Siddhartha Singh
7e76369ec8 Using steps() in animation 2024-01-25 14:00:21 +05:30
Paul Rey
002ff002fe Move .empty CSS class from Img to Box in the Image module
Since the GTK Image is hidden, the CSS class wasn't used for every cases.
2024-01-24 11:10:16 +01:00
Alexis Rouillard
0948a407d0 Merge pull request #2810 from ArneshRC/master
feat(battery): added support for battery state-based classes on the entire waybar
2024-01-23 22:45:24 +01:00
Arnesh Roychowdhury
90b5b21394 Merge branch 'Alexays:master' into master 2024-01-24 02:01:17 +05:30
Alexis Rouillard
8e2fa0fdbd Merge pull request #2859 from Sryther/master
Add "empty" class for Image module when path/exec is returning an empty value.
2024-01-23 18:50:50 +01:00
Paul Rey
0af8f5c691 Add "empty" class for Image module when path/exec is returning an empty value. 2024-01-23 18:15:47 +01:00
dpayne
970a7519d4 Merge branch 'master' of github.com:Alexays/Waybar into add_css_reload 2024-01-22 12:40:02 -08:00
Alexis Rouillard
0d9c492998 Merge pull request #2855 from SquishyPandaDev/upower-ptr-fix
Fix module UPower display device poniter
2024-01-22 09:49:55 +01:00
SquishyPandaDev
82b632e4ec Fix module UPower display device poniter
Force displayDevice to be a nullptr on class setup
2024-01-22 03:22:19 -05:00
Alexis Rouillard
27fec51439 Merge pull request #2853 from dpayne/fix_use_after_free_on_task_close 2024-01-22 09:01:48 +01:00
dpayne
20fa578b12 Adding config option to enable reloading style on file change 2024-01-21 21:02:01 -08:00
dpayne
f7eca99496 Using Gio::FileMonitor for watching style changes 2024-01-21 20:49:13 -08:00
dpayne
53233e47a3 Fix use after free on task close 2024-01-21 19:08:23 -08:00
dpayne
d7ed4f1fa8 Adding css reloader 2024-01-21 18:23:46 -08:00
ArneshRC
d14a4a2b1a fixed early dereference error 2024-01-19 16:00:13 +05:30
ArneshRC
dacffdb095 removed duplicate code 2024-01-19 15:27:11 +05:30
ArneshRC
74e863ed73 updated man waybar-battery 2024-01-19 14:45:49 +05:30
Arnesh Roychowdhury
3de6d2e859 Merge branch 'Alexays:master' into master 2024-01-17 18:29:14 +05:30
Alexis Rouillard
6e12f81223 Merge pull request #2840 from m-bdf/clock-tz-changes
clock: fix construction with calendar.format.today
2024-01-17 13:44:28 +01:00
Maëlys Bras de fer
4f0fbaba8e clock: fix construction with calendar.format.today 2024-01-17 13:30:32 +01:00
Alexis Rouillard
392f83e71d Merge pull request #2838 from m-bdf/clock-tz-changes 2024-01-16 22:48:31 +01:00
Maëlys Bras de fer
d343f616fc clock: handle timezone changes (again again) 2024-01-16 21:35:42 +01:00
Arnesh Roychowdhury
8c502378aa Merge branch 'Alexays:master' into master 2024-01-15 14:24:27 +05:30
Alexis Rouillard
07eabc5328 Merge pull request #2831 from JManch/tray-fix-spacing
fix(tray): completely hide tray when it is empty
2024-01-14 16:33:28 +01:00
Joshua Manchester
95ffc291f6 fix: hide tray event box instead of box 2024-01-14 15:06:06 +00:00
zjeffer
8f5d0098d6 Fixed json parsing with hexadecimal characters
* replace \x with \u00 to follow JSON spec
* fixes #2475 and #2495
* added unit tests for json parsing
2024-01-14 14:06:06 +01:00
Arnesh Roychowdhury
4eef1ce10f Merge branch 'Alexays:master' into master 2024-01-13 16:07:11 +05:30
Alexis Rouillard
f744d906be Merge pull request #2820 from oxalica/feat/systemd-failed-units
Add module systemd-failed-units to monitor failed systemd units
2024-01-12 09:45:40 +01:00
Alexis Rouillard
fa3ce14b25 Merge pull request #2817 from Syndelis/fix/window-rewrite-multiple-bars-no-overlap
Fix/Hyprland/Workspaces: Window Rewrite on multiple non-overlapping bars
2024-01-12 09:44:03 +01:00
Alexis Rouillard
e6097229ce Merge pull request #2814 from khaneliman/flake-update
flake update and direnv fix
2024-01-12 09:43:19 +01:00
Austin Horstman
b239c77d74 fix: temporary catch2_3 override until upstreamed to nixpkgs 2024-01-10 12:17:46 -06:00
Brenno Lemos
9e08512927 feat: strip workspace qualifiers when creating windows 2024-01-10 02:24:51 -03:00
oxalica
eedd1f8e6a Add module systemd-failed-units 2024-01-09 18:19:30 +08:00
Brenno Lemos
c69a6dde67 chore: update Hyprland's featureset in readme 2024-01-08 20:31:15 -03:00
Brenno Lemos
4339030c9d feat: fetch clients data when moving workspaces accross monitors 2024-01-08 20:11:39 -03:00
Brenno Lemos
bc7acbde5c fix: rename windows while queued for creation
this avoids the window arriving with the wrong icon when its eventually
able to be created
2024-01-08 18:30:53 -03:00
Brenno Lemos
512c6fb127 feat: add orphan windows attribute to workspaces
this attribute will keep every window that doesn't have an associated
workspace in the current bar
2024-01-08 18:30:53 -03:00
Austin Horstman
b90af74d15 feat: enable direnv and fix flake devshell output 2024-01-08 12:47:32 -06:00
Arnesh Roychowdhury
f1f3442e38 Merge branch 'Alexays:master' into master 2024-01-08 22:54:08 +05:30
Austin Horstman
d4d5a54e63 chore: flake lock update 2024-01-08 09:37:48 -06:00
Alexis Rouillard
748fc809b5 Merge pull request #2813 from yangyingchao/master
Improvements for Hyprland worskspaces & backend
2024-01-08 14:03:23 +01:00
yangyingchao
bdd7271da9 Improvements for Hyprland backend
1. Fix warnings reported by clang tidy
2. Use unique lock instead of manully lock/unlock on mutex.
   The RAII style locking makes sure mutex is unlocked when exceptions are thrown
2024-01-08 09:26:16 +08:00
yangyingchao
a34e3ccc86 Improvements for Hyprland workspace
1. Utilize `m_mutex` to safeguard member fields of `hyprland::Workspaces` as they are modified by multiple threads, including the event listener thread and UI thread. This applies to all member fields, not just `m_workspacesToCreate`.

2. Tidy up the create/remove workspace code.
2024-01-08 09:14:36 +08:00
ArneshRC
3390c16f52 added support for battery state-based classes on the entire waybar 2024-01-07 17:22:34 +05:30
Alexis Rouillard
4b20f522f0 Merge pull request #2789 from DreamMaoMao/master
fix:#2769
2024-01-04 15:33:26 +01:00
Alexis Rouillard
4636309117 Merge pull request #2803 from LukashonakV/catch_bump
Catch2 bump
2024-01-04 15:33:06 +01:00
Viktar Lukashonak
7783c81861 Catch2 bump
Signed-off-by: Viktar Lukashonak <myxabeer@gmail.com>
2024-01-04 17:22:27 +03:00
Alexis Rouillard
3e55d0d7f2 Merge pull request #2787 from scgtrp/master
hyprland/workspaces: allow using the original window class/title
2023-12-31 12:40:06 +01:00
Emily Ellis
ff09ef6d71 hyprland/workspaces: allow using the original window class/title
This turns the values of window rewrite rules in hyprland/workspaces from static strings to format strings with the values {class} and {title} available.
2023-12-30 21:07:40 -05:00
Alexis Rouillard
99d26e44ee Merge pull request #2778 from an-prata/master
fix `restart-interval` being ignored while `signal` is defined (#2650)
2023-12-29 10:59:13 +01:00
Evan Overman
19bf4d0544 clang format trailing whitespace 2023-12-28 19:38:01 -08:00
Evan Overman
6b860f8690 clang formating 2023-12-28 19:36:21 -08:00
Evan Overman
182272b8b5 fix #2650 2023-12-28 19:30:26 -08:00
DreamMaoMao
e64d66ab24 fix:the workspace data is null in a small probability
update

fix clang-format warn

no manual unlock
2023-12-25 21:55:46 +08:00
Alexis Rouillard
41ebdc3cb6 Merge pull request #2768 from zjeffer/feat/zjeffer/freebsd-bump 2023-12-25 08:31:03 +01:00
Alexis Rouillard
8ccb959992 Merge pull request #2767 from zjeffer/master 2023-12-25 00:28:32 +01:00
zjeffer
13e904c20d Bump cross-platform-action to attempt fixing freebsd runner 2023-12-25 00:26:39 +01:00
zjeffer
77f0584d0d Bump clang-tidy cpp-linter-action version to v2.7.5 2023-12-24 23:08:22 +01:00
Alexis Rouillard
d2767fb84a Merge pull request #2760 from avannereau/wireplumber-scroll-fix
Fix wireplumber reverse-scroll option
2023-12-22 12:00:39 +01:00
Alan Vannereau
49caab47a6 Fix wireplumber reverse-scroll option 2023-12-22 11:50:41 +01:00
Alexis Rouillard
08361be9f0 Merge pull request #2756 from grimpy/custom_output_env_var
Pass WAYBAR_OUTPUT_NAME environment variable to custom exec scripts
2023-12-21 08:55:30 +01:00
Alexis Rouillard
2674982c7b Merge pull request #2755 from zjeffer/master
Added clang-tidy GitHub action
2023-12-20 23:25:33 +01:00
Tuur Vanhoutte
dbe02ebe41 Added clang-tidy GitHub action
Created clang-tidy.yml
Renamed lint.yml to clang-format.yml
2023-12-20 14:31:27 +01:00
Jo De Boeck
0ea5143493 Pass WAYBAR_OUTPUT_NAME environment variable to custom exec scripts
Signed-off-by: Jo De Boeck <deboeck.jo@gmail.com>
2023-12-19 22:54:12 +02:00
Alexis Rouillard
f5370fcff5 Merge pull request #2573 from CromFr/cabi_plugins
C ABI plugin system
2023-12-18 14:10:02 +01:00
Alexis Rouillard
7b79281437 Merge pull request #2742 from zjeffer/feat/zjeffer/debian-docker-add-clang-tidy-requirements
Added sudo, python3-pip & python3-venv to debian image, required for clang-tidy GH action
2023-12-18 09:06:54 +01:00
Alexis Rouillard
acc2da7310 Merge pull request #2744 from rpdelaney/jsonC
Specify config is JSONC
2023-12-18 09:06:28 +01:00
Ryan Delaney
68e525df58 Remove 'config' from list of valid locations
Since the file can also be named config.jsonc, that will remove ambiguity
2023-12-13 11:22:57 -05:00
Ryan Delaney
2cd67fdd0a The file can also be named config.jsonc 2023-12-13 10:40:13 -05:00
Ryan Delaney
2600f53bdd Clarify that the configuration file is JSON*C*
JSON is JSONC
2023-12-13 10:39:59 -05:00
zjeffer
da9cc77db8 Added sudo, python3-pip & python3-venv to debian image, required for clang-tidy GH action 2023-12-13 11:54:04 +01:00
Crom (Thibaut CHARLES)
75f9141cac Added cffi man page 2023-12-12 16:23:03 +01:00
Alexis Rouillard
f03b684bd8 Merge pull request #2736 from Rice8Dyb6/master 2023-12-10 19:27:52 +01:00
Rice8Dyb6
4822f967b2 Sway/workspaces: fix persistent icon 2023-12-11 00:17:35 +07:00
Alexis Rouillard
dc208b66b3 Merge pull request #2720 from zjeffer/master
Applied clang-tidy suggestions for hyprland workspaces
2023-12-07 08:34:19 +01:00
Alexis Rouillard
77ebc45336 Merge pull request #2731 from mcepl/patch-1 2023-12-07 08:25:49 +01:00
Matěj Cepl
d94519a93c Clear README.md from duplicated list of distributions
It doesn’t make sense to keep the list in README.md when we maintain it in Wiki as well.
2023-12-07 07:53:45 +01:00
zjeffer
4d5b715dc4 applied clang-tidy suggestions for hyprland workspaces 2023-12-06 21:58:26 +01:00
zjeffer
8a84cb609e clang-tidy: added StaticConstantCase CheckOption 2023-12-06 21:58:26 +01:00
Alexis Rouillard
5f8ae44233 Merge pull request #2703 from czadowanie/master
upower: show-icon config option
2023-12-05 23:34:43 +01:00
czadowanie
4283195803 man: add dot in upower/show-icon 2023-12-04 21:32:08 +01:00
czadowanie
44f309678b man: document upower/show-icon 2023-12-04 21:28:37 +01:00
Alexis Rouillard
4846ff7950 Merge pull request #2595 from zjeffer/master
Added initial .clang-tidy file
2023-12-04 09:29:12 +01:00
Alexis Rouillard
0ec2aada26 Merge pull request #2711 from chayleaf/flake
flake: update & cleanup
2023-12-04 09:28:16 +01:00
Alexis Rouillard
dfa0f5701e Merge pull request #2712 from khaneliman/fix/nix-flake
chore: lint fix
2023-12-04 09:28:05 +01:00
Austin Horstman
b1744278d1 chore: lint fix 2023-12-01 22:05:40 -06:00
chayleaf
2e2cb67cf1 flake: update & cleanup 2023-12-02 02:41:59 +07:00
Alexis Rouillard
1572bc8c75 Merge pull request #2707 from alexbakker/fix-2154 2023-11-30 08:37:59 +01:00
Alexander Bakker
6be5f7cb29 Disconnect from PipeWire when destroying the WirePlumber module
This fixes a crash where PipeWire tries to send events to a destroyed
WirePlumber module.
2023-11-29 22:46:58 +01:00
czadowanie
2334faa7fd upower: show-icon config option 2023-11-28 19:39:08 +01:00
Alexis Rouillard
58db0baaf4 Merge pull request #2701 from thejch/hl-ws-click
Add button click check to hyprland workspaces module
2023-11-28 09:20:51 +01:00
Jeremy Huang
0162dbd485 add button single click check to hyprland workspaces 2023-11-27 16:20:05 -08:00
Alexis Rouillard
1fe4a4ee9d Merge pull request #2686 from aruhier/pr_privacy_visibility
privacy: fix visibility when a module is disabled
2023-11-23 09:52:44 +01:00
Anthony Ruhier
50a4fe9623 privacy: fix visibility when a module is disabled
Only consider a privacy module as visible if it is enabled in the
configuration. Otherwise, when screensharing or audio-in or audio-out is
in use but the associated module is not enabled, the privacy widget is
empty but still considered as visible.
2023-11-23 00:45:31 +01:00
Alexis Rouillard
061c68ce92 Merge pull request #2677 from sjoblomj/master
Using 'image-missing' fallback if no taskbar icon is found
2023-11-20 14:03:52 +01:00
Alexis Rouillard
20b89d5d13 Merge pull request #2679 from aserowy/master
hyprland module: added sort_workspaces after rename occured
2023-11-20 14:02:39 +01:00
Alexis Rouillard
c299ea9369 Merge pull request #2681 from tactikauan/master 2023-11-19 14:20:54 +01:00
Kauan Decarli
d2dd2d553f cpu_usage/linux: count iowait toward idle time 2023-11-18 13:59:21 -03:00
aserowy
b6b495e1bc hyprland module: added sort_workspaces after rename occured
Signed-off-by: aserowy <serowy@hotmail.com>
2023-11-18 11:36:47 +01:00
Johan Sjöblom
d4559c7f00 Using 'image-missing' fallback if no taskbar icon is found 2023-11-16 16:59:05 +01:00
Alexis Rouillard
0a747ddafc Merge pull request #2672 from fdev31/master 2023-11-15 17:53:48 +01:00
fdev31
375a38a489 Fix for #2646 2023-11-14 21:26:17 +01:00
Alexis Rouillard
9ac27de7d8 Merge pull request #2668 from LukashonakV/cpp20_clock 2023-11-13 08:34:59 +01:00
Viktar Lukashonak
7308893adb Happy clang. fmt9-10
Signed-off-by: Viktar Lukashonak <myxabeer@gmail.com>
2023-11-13 09:59:50 +03:00
Alexis Rouillard
a51dd8fc52 Merge pull request #2659 from LukashonakV/cpp20_clock
c++20. clock chrono API. STL + format
2023-11-12 09:17:59 +01:00
Viktar Lukashonak
86a38980e4 c++20. clock chrono API. STL + format
Signed-off-by: Viktar Lukashonak <myxabeer@gmail.com>
2023-11-10 17:57:26 +03:00
Alexis Rouillard
c4330a1e36 Merge pull request #2648 from Mrcarrot1/wp-segfault
Fix segmentation fault in WirePlumber module
2023-11-06 16:58:40 +01:00
Caleb Harper
4d339f05af Fix segmentation fault in WirePlumber module
The WirePlumber module assumes that either the node's name or
description will not be null. This leads to a segmentation fault when
both are.

The solution provided is to set self->node_name_ to a default value in
this case.
2023-11-06 09:50:13 -06:00
Alexis Rouillard
e24adbc3c2 Merge pull request #2612 from ErikReider/privacy-module
Add Privacy Module
2023-11-06 09:42:35 +01:00
Alexis Rouillard
7d7a047fcc Merge pull request #2643 from qbe/bugfix-dst-ambiguous-hour-err 2023-11-06 08:51:26 +01:00
Lukas Hannen
aa1f8a428b avoid converting to local_time when converting to zoned_time afterwards 2023-11-06 01:28:48 +01:00
Yaroslav Chvanov
c420b40668 refactor(backlight): use concrete types for some helper functions
This fixes linking of the best_device() function with 'mold' linker.
2023-11-04 18:31:25 +03:00
Erik Reider
f21b1dfa4d fixed linter issues 2023-11-04 15:16:13 +01:00
Erik Reider
6050fa3a43 Added documentation 2023-11-04 15:16:13 +01:00
Erik Reider
ca7c9a68f1 Made creation of privacy modules more modular 2023-11-04 14:05:01 +01:00
zjeffer
23bc4d66bf Added initial .clang-tidy file 2023-11-02 23:09:49 +01:00
Erik Reider
49caa4bf31 Add the PrivacyNodeInfo object as pw_proxy data 2023-10-31 11:38:01 +01:00
Erik Reider
c60a8e9836 free pipewire listeners on proxy destruction 2023-10-31 08:52:54 +01:00
Erik Reider
c4226f3745 Readded signal_timeout instead of map to fix indicator being stuck 2023-10-30 18:01:47 +01:00
Erik Reider
d32da917e4 Added tooltips 2023-10-29 00:17:53 +02:00
Erik Reider
46e36c0e68 Simplified the privacy_item hiding/showing logic 2023-10-28 18:30:50 +02:00
Erik Reider
86491e1512 Call module emit in privacy module contructor 2023-10-28 16:47:06 +02:00
Erik Reider
4a4c888d7d Fixed linter complaining 2023-10-27 00:01:40 +02:00
Erik Reider
ace319b515 Updated default CSS to include the privacy module 2023-10-26 23:44:04 +02:00
Erik Reider
e73ea8d608 Fixed cases where the module would be hidden when it should be visible 2023-10-26 23:37:10 +02:00
Erik Reider
f7224d8459 Initial implementation 2023-10-26 23:22:02 +02:00
Crom (Thibaut CHARLES)
02c64f3f1e Moved all waybar info into a single struct 2023-10-24 20:16:50 +02:00
Crom (Thibaut CHARLES)
d86059016e Send update dispatcher though FFI 2023-10-24 20:16:50 +02:00
Crom (Thibaut CHARLES)
088ca6b963 Added cffi/* module for third-party advanced modules 2023-10-24 20:16:50 +02:00
Crom (Thibaut CHARLES)
6ae354f564 PoC 2023-10-24 20:16:23 +02: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
293 changed files with 17315 additions and 6705 deletions

29
.clang-tidy Normal file
View File

@@ -0,0 +1,29 @@
Checks: >
-*,
bugprone-*
misc-*,
modernize-*,
performance-*,
portability-*,
readability-*,
-fuchsia-trailing-return,
-readability-magic-numbers,
-modernize-use-nodiscard,
-modernize-use-trailing-return-type,
-readability-braces-around-statements,
-readability-redundant-access-specifiers,
-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 }

65
.github/labeler.yml vendored Normal file
View File

@@ -0,0 +1,65 @@
bug:
- "(crash|bug|error|coredump|freeze|segfault|issue|problem)"
enhancement:
- "(feature|enhancement|improvement|request|suggestion)"
hyprland:
- "(hyprland)"
network:
- "(network|wifi|ethernet)"
bluetooth:
- "(bluetooth|bluez)"
sway:
- "(sway)"
cpu:
- "(cpu)"
memory:
- "(memory|ram)"
disk:
- "(disk|storage)"
battery:
- "(upower|battery)"
sni:
- "(sni|tray)"
dwl:
- "(dwl)"
custom:
- "(custom|module|extension|plugin|script)"
mpd:
- "(mpd|music)"
audio:
- "(pulseaudio|alsa|jack|audio|pirewire|wireplumber)"
temperature:
- "(temperature|thermal|hwmon)"
clock:
- "(clock|time|date)"
gamemode:
- "(gamemode|game|gaming)"
inhibitor:
- "(inhibitor|idle|lock|suspend|hibernate|logout)"
cava:
- "(cava|audio-visualizer)"
backlight:
- "(backlight|brightness)"
keyboard:
- "(keyboard|keymap|layout|shortcut)"

22
.github/workflows/clang-format.yml vendored Normal file
View File

@@ -0,0 +1,22 @@
name: clang-format
on: [push, pull_request]
concurrency:
group: ${{ github.workflow }}-format-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# 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"
style: "file:.clang-format"
clangFormatVersion: 19

39
.github/workflows/clang-tidy.yml.bak vendored Normal file
View File

@@ -0,0 +1,39 @@
name: clang-tidy
on: [push, pull_request]
concurrency:
group: ${{ github.workflow }}-tidy-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
lint:
runs-on: ubuntu-latest
container:
image: alexays/waybar:debian
steps:
- uses: actions/checkout@v3
- name: configure
run: |
meson -Dcpp_std=c++20 build # necessary to generate compile_commands.json
ninja -C build # necessary to find certain .h files (xdg, wayland, etc.)
- uses: actions/setup-python@v5
with:
python-version: '3.10' # to be kept in sync with cpp-linter-action
update-environment: true # the python dist installed by the action needs LD_LIBRARY_PATH to work
- uses: cpp-linter/cpp-linter-action@v2.9.1
name: clang-tidy
id: clang-tidy-check
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PIP_NO_CACHE_DIR: false
with:
style: "" # empty string => don't do clang-format checks here, we do them in clang-format.yml
files-changed-only: true # only check files that have changed
lines-changed-only: true # only check lines that have changed
tidy-checks: "" # empty string => use the .clang-tidy file
version: "17" # clang-tools version
database: "build" # path to the compile_commands.json file
- name: Check if clang-tidy failed on any files
if: steps.clang-tidy-check.outputs.checks-failed > 0
run: echo "Some files failed the linting checks!" && exit 1

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

@@ -2,28 +2,34 @@ name: freebsd
on: [push, pull_request]
concurrency:
group: ${{ github.workflow }}-freebsd-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
clang:
# Run actions in a FreeBSD VM on the macos-12 runner
build:
# Run actions in a FreeBSD VM on the ubuntu runner
# https://github.com/actions/runner/issues/385 - for FreeBSD runner support
# https://github.com/actions/virtual-environments/issues/4060 - for lack of VirtualBox on MacOS 11 runners
runs-on: macos-12
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Test in FreeBSD VM
uses: cross-platform-actions/action@v0.19.1
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"
environment_variables: CPPFLAGS=-isystem/usr/local/include LDFLAGS=-L/usr/local/lib
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

19
.github/workflows/labeler.yml vendored Normal file
View File

@@ -0,0 +1,19 @@
name: "Issue Labeler"
on:
issues:
types: [opened, edited]
permissions:
issues: write
contents: read
jobs:
triage:
runs-on: ubuntu-latest
steps:
- uses: github/issue-labeler@v3.4
with:
configuration-path: .github/labeler.yml
enable-versioned-regex: 0
include-title: 1
repo-token: ${{ secrets.GITHUB_TOKEN }}

View File

@@ -1,14 +0,0 @@
name: Linter
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: DoozyX/clang-format-lint-action@v0.16.2
with:
source: '.'
extensions: 'hpp,h,cpp,c'
clangFormatVersion: 16

View File

@@ -2,9 +2,14 @@ name: linux
on: [push, pull_request]
concurrency:
group: ${{ github.workflow }}-linux-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
build:
strategy:
fail-fast: false
matrix:
distro:
- alpine
@@ -14,9 +19,6 @@ jobs:
- opensuse
- gentoo
cpp_std: [c++20]
include:
- distro: fedora
cpp_std: c++20
runs-on: ubuntu-latest
container:
@@ -25,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

7
.gitignore vendored
View File

@@ -7,6 +7,7 @@ vgcore.*
*.swp
packagecache
/subprojects/**/
/subprojects/.wraplock
/build*
/dist
/meson.egg-info
@@ -44,3 +45,9 @@ packagecache
*.out
*.app
/.direnv/
# 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,7 +1,49 @@
# vim: ft=Dockerfile
FROM debian:sid
FROM debian:sid-slim
RUN apt-get update && \
apt-get install -y build-essential meson ninja-build git pkg-config libinput10 libpugixml-dev libinput-dev wayland-protocols libwayland-client0 libwayland-cursor0 libwayland-dev libegl1-mesa-dev libgles2-mesa-dev libgbm-dev libxkbcommon-dev libudev-dev libpixman-1-dev libgtkmm-3.0-dev libjsoncpp-dev scdoc libdbusmenu-gtk3-dev libnl-3-dev libnl-genl-3-dev libpulse-dev libmpdclient-dev gobject-introspection libgirepository1.0-dev libxkbcommon-dev libxkbregistry-dev libxkbregistry0 libplayerctl-dev && \
apt-get clean
RUN apt update && \
apt install --no-install-recommends --no-install-suggests -y \
build-essential \
catch2 \
cmake \
git \
gobject-introspection \
libdbusmenu-gtk3-dev \
libegl1-mesa-dev \
libfmt-dev \
libgbm-dev \
libgirepository1.0-dev \
libgles2-mesa-dev \
libgtk-layer-shell-dev \
libgtkmm-3.0-dev \
libhowardhinnant-date-dev \
libiniparser-dev \
libinput-dev \
libjack-jackd2-dev \
libjsoncpp-dev \
libmpdclient-dev \
libnl-3-dev \
libnl-genl-3-dev \
libpixman-1-dev \
libplayerctl-dev \
libpugixml-dev \
libpulse-dev \
libsndio-dev \
libspdlog-dev \
libudev-dev \
libupower-glib-dev \
libwayland-dev \
libwireplumber-0.5-dev \
libxkbcommon-dev \
libxkbregistry-dev \
locales \
meson \
ninja-build \
pkg-config \
python3-pip \
python3-venv \
scdoc \
sudo \
wayland-protocols \
&& apt clean

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

@@ -1,22 +1,24 @@
# Waybar [![Licence](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE) [![Paypal Donate](https://img.shields.io/badge/Donate-Paypal-2244dd.svg)](https://paypal.me/ARouillard)<br>![Waybar](https://raw.githubusercontent.com/alexays/waybar/master/preview-2.png)
> Highly customizable Wayland bar for Sway and Wlroots based compositors.<br>
> Available in Arch [extra](https://www.archlinux.org/packages/extra/x86_64/waybar/) or
[AUR](https://aur.archlinux.org/packages/waybar-git/), [Gentoo](https://packages.gentoo.org/packages/gui-apps/waybar), [openSUSE](https://build.opensuse.org/package/show/X11:Wayland/waybar), and [Alpine Linux](https://pkgs.alpinelinux.org/packages?name=waybar).<br>
> Available in [all major distributions](https://github.com/Alexays/Waybar/wiki/Installation)<br>
> *Waybar [examples](https://github.com/Alexays/Waybar/wiki/Examples)*
#### Current features
- Sway (Workspaces, Binding mode, Focused window name)
- River (Mapping mode, Tags, Focused window name)
- Hyprland (Focused window name)
- DWL (Tags) [requires dwl ipc patch](https://github.com/djpohly/dwl/wiki/ipc)
- Hyprland (Window Icons, Workspaces, Focused window name)
- 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
- UPower
- Power profiles daemon
- Network
- Bluetooth
- Pulseaudio
- Privacy Info
- Wireplumber
- Disk
- Memory
@@ -36,7 +38,7 @@
Waybar is available from a number of Linux distributions:
[![Packaging status](https://repology.org/badge/vertical-allrepos/waybar.svg)](https://repology.org/project/waybar/versions)
[![Packaging status](https://repology.org/badge/vertical-allrepos/waybar.svg?columns=3&header=Waybar%20Downstream%20Packaging)](https://repology.org/project/waybar/versions)
An Ubuntu PPA with more recent versions is available
[here](https://launchpad.net/~nschloe/+archive/ubuntu/waybar).
@@ -47,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
@@ -114,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

99
flake.lock generated
View File

@@ -1,32 +1,13 @@
{
"nodes": {
"devshell": {
"inputs": {
"nixpkgs": "nixpkgs",
"systems": "systems"
},
"locked": {
"lastModified": 1692523566,
"narHash": "sha256-VDJDihK6jNebVw9y3qKCVD6+6QaC/x8kxZzL4MaIPPY=",
"owner": "numtide",
"repo": "devshell",
"rev": "d208c58e2f7afef838add5f18a9936b12a71d695",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "devshell",
"type": "github"
}
},
"flake-compat": {
"flake": false,
"locked": {
"lastModified": 1673956053,
"narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=",
"lastModified": 1767039857,
"narHash": "sha256-vNpUSpF5Nuw8xvDLj2KCwwksIbjua2LZCqhV1LNRDns=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9",
"rev": "5edf11c44bc78a0d334f6334cdaf7d60d732daab",
"type": "github"
},
"original": {
@@ -35,47 +16,13 @@
"type": "github"
}
},
"flake-utils": {
"inputs": {
"systems": "systems_2"
},
"locked": {
"lastModified": 1689068808,
"narHash": "sha256-6ixXo3wt24N/melDWjq70UuHQLxGV8jZvooRanIHXw0=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "919d646de7be200f3bf08cb76ae1f09402b6f9b4",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1677383253,
"narHash": "sha256-UfpzWfSxkfXHnb4boXZNaKsAcUrZT9Hw+tao1oZxd08=",
"lastModified": 1766902085,
"narHash": "sha256-coBu0ONtFzlwwVBzmjacUQwj3G+lybcZ1oeNSQkgC0M=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "9952d6bc395f5841262b006fbace8dd7e143b634",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1692638711,
"narHash": "sha256-J0LgSFgJVGCC1+j5R2QndadWI1oumusg6hCtYAzLID4=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "91a22f76cd1716f9d0149e8a5c68424bb691de15",
"rev": "c0b0e0fddf73fd517c3471e546c0df87a42d53f4",
"type": "github"
},
"original": {
@@ -87,40 +34,8 @@
},
"root": {
"inputs": {
"devshell": "devshell",
"flake-compat": "flake-compat",
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs_2"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"systems_2": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
"nixpkgs": "nixpkgs"
}
}
},

178
flake.nix
View File

@@ -1,90 +1,126 @@
{
description = "Highly customizable Wayland bar for Sway and Wlroots based compositors.";
description = "Highly customizable Wayland bar for Sway and Wlroots based compositors";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
devshell.url = "github:numtide/devshell";
flake-utils.url = "github:numtide/flake-utils";
flake-compat = {
url = "github:edolstra/flake-compat";
flake = false;
};
};
outputs = { self, flake-utils, devshell, nixpkgs, flake-compat }:
outputs =
{ self, nixpkgs, ... }:
let
inherit (nixpkgs) lib;
genSystems = lib.genAttrs [
"x86_64-linux"
"aarch64-linux"
];
genSystems =
func:
lib.genAttrs
[
"x86_64-linux"
"aarch64-linux"
]
(
system:
func (
import nixpkgs {
inherit system;
overlays = with self.overlays; [
waybar
];
}
)
);
pkgsFor = genSystems (system:
import nixpkgs {
inherit system;
});
mkDate = longDate: (lib.concatStringsSep "-" [
(builtins.substring 0 4 longDate)
(builtins.substring 4 2 longDate)
(builtins.substring 6 2 longDate)
]);
mkDate =
longDate:
(lib.concatStringsSep "-" [
(builtins.substring 0 4 longDate)
(builtins.substring 4 2 longDate)
(builtins.substring 6 2 longDate)
]);
in
{
overlays.default = final: prev: {
waybar = final.callPackage ./nix/default.nix {
version = prev.waybar.version + "+date=" + (mkDate (self.lastModifiedDate or "19700101")) + "_" + (self.shortRev or "dirty");
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
;
# overrides for local development
nativeBuildInputs =
pkgs.waybar.nativeBuildInputs
++ (with pkgs; [
nixfmt
clang-tools
gdb
]);
};
});
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
(system:
(self.overlays.default pkgsFor.${system} pkgsFor.${system})
// {
default = self.packages.${system}.waybar;
});
} //
flake-utils.lib.eachDefaultSystem (system: {
devShell =
let pkgs = import nixpkgs {
inherit system;
overlays = [ devshell.overlays.default ];
};
in
pkgs.devshell.mkShell {
imports = [ "${pkgs.devshell.extraModulesDir}/language/c.nix" ];
devshell.packages = with pkgs; [
clang-tools
gdb
# from nativeBuildInputs
gnumake
meson
ninja
pkg-config
scdoc
] ++ (map lib.getDev [
# from buildInputs
wayland wlroots gtkmm3 libsigcxx jsoncpp spdlog gtk-layer-shell howard-hinnant-date libxkbcommon
# optional dependencies
gobject-introspection glib playerctl python3.pkgs.pygobject3
libevdev libinput libjack2 libmpdclient playerctl libnl
libpulseaudio sndio sway libdbusmenu-gtk3 udev upower wireplumber
# from propagated build inputs?
at-spi2-atk atkmm cairo cairomm catch2 fmt_8 fontconfig
gdk-pixbuf glibmm gtk3 harfbuzz pango pangomm wayland-protocols
]);
env = with pkgs; [
{ name = "CPLUS_INCLUDE_PATH"; prefix = "$DEVSHELL_DIR/include"; }
{ name = "PKG_CONFIG_PATH"; prefix = "$DEVSHELL_DIR/lib/pkgconfig"; }
{ name = "PKG_CONFIG_PATH"; prefix = "$DEVSHELL_DIR/share/pkgconfig"; }
{ name = "PATH"; prefix = "${wayland.bin}/bin"; }
{ name = "LIBRARY_PATH"; prefix = "${lib.getLib sndio}/lib"; }
{ name = "LIBRARY_PATH"; prefix = "${lib.getLib zlib}/lib"; }
{ name = "LIBRARY_PATH"; prefix = "${lib.getLib howard-hinnant-date}/lib"; }
];
};
});
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>
@@ -11,14 +12,19 @@ namespace waybar {
class AModule : public IModule {
public:
virtual ~AModule();
static constexpr const char *MODULE_CLASS = "module";
~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
@@ -28,20 +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);
std::vector<int> pid_;
const bool isTooltip;
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,44 +55,33 @@ class BarIpcClient;
}
#endif // HAVE_SWAY
class BarSurface {
protected:
BarSurface() = default;
class Bar : public sigc::trackable {
public:
virtual void setExclusiveZone(bool enable) = 0;
virtual void setLayer(bar_layer layer) = 0;
virtual void setMargins(const struct bar_margins &margins) = 0;
virtual void setPassThrough(bool enable) = 0;
virtual void setPosition(const std::string_view &position) = 0;
virtual void setSize(uint32_t width, uint32_t height) = 0;
virtual void commit(){};
virtual ~BarSurface() = default;
};
class Bar {
public:
using bar_mode_map = std::map<std::string_view, struct bar_mode>;
using bar_mode_map = std::map<std::string, struct bar_mode>;
static const bar_mode_map PRESET_MODES;
static const std::string_view MODE_DEFAULT;
static const std::string_view MODE_INVISIBLE;
static const std::string MODE_DEFAULT;
static const std::string MODE_INVISIBLE;
Bar(struct waybar_output *w_output, const Json::Value &);
Bar(const Bar &) = delete;
~Bar();
void setMode(const std::string_view &);
void setVisible(bool visible);
void setMode(const std::string &mode);
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;
struct wl_surface *surface;
bool visible = true;
bool vertical = false;
Gtk::Window window;
Gtk::Orientation orientation = Gtk::ORIENTATION_HORIZONTAL;
Gtk::PositionType position = Gtk::POS_TOP;
int x_global;
int y_global;
@@ -106,6 +97,8 @@ class Bar {
void setupAltFormatKeyForModule(const std::string &module_name);
void setupAltFormatKeyForModuleList(const char *module_list_name);
void setMode(const bar_mode &);
void setPassThrough(bool passthrough);
void setPosition(Gtk::PositionType position);
void onConfigure(GdkEventConfigure *ev);
void configureGlobalOffset(int width, int height);
void onOutputGeometryChanged();
@@ -115,8 +108,9 @@ class Bar {
std::string last_mode_{MODE_DEFAULT};
struct bar_margins margins_;
uint32_t width_, height_;
bool passthrough_;
std::unique_ptr<BarSurface> surface_impl_;
Gtk::Box left_;
Gtk::Box center_;
Gtk::Box right_;
@@ -129,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

@@ -7,9 +7,9 @@
#include "bar.hpp"
#include "config.hpp"
#include "util/css_reload_helper.hpp"
#include "util/portal.hpp"
struct zwlr_layer_shell_v1;
struct zwp_idle_inhibitor_v1;
struct zwp_idle_inhibit_manager_v1;
@@ -25,7 +25,6 @@ class Client {
Glib::RefPtr<Gdk::Display> gdk_display;
struct wl_display *wl_display = nullptr;
struct wl_registry *registry = nullptr;
struct zwlr_layer_shell_v1 *layer_shell = nullptr;
struct zxdg_output_manager_v1 *xdg_output_manager = nullptr;
struct zwp_idle_inhibit_manager_v1 *idle_inhibit_manager = nullptr;
std::vector<std::unique_ptr<Bar>> bars;
@@ -55,6 +54,10 @@ class Client {
Glib::RefPtr<Gtk::CssProvider> css_provider_;
std::unique_ptr<Portal> portal;
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

@@ -1,107 +1,17 @@
#pragma once
#include <json/json.h>
#if defined(HAVE_CHRONO_TIMEZONES) || defined(HAVE_LIBDATE)
#include "modules/clock.hpp"
#else
#include "modules/simpleclock.hpp"
#endif
#ifdef HAVE_SWAY
#include "modules/sway/language.hpp"
#include "modules/sway/mode.hpp"
#include "modules/sway/scratchpad.hpp"
#include "modules/sway/window.hpp"
#include "modules/sway/workspaces.hpp"
#endif
#ifdef HAVE_WLR
#include "modules/wlr/taskbar.hpp"
#include "modules/wlr/workspace_manager.hpp"
#endif
#ifdef HAVE_RIVER
#include "modules/river/layout.hpp"
#include "modules/river/mode.hpp"
#include "modules/river/tags.hpp"
#include "modules/river/window.hpp"
#endif
#ifdef HAVE_DWL
#include "modules/dwl/tags.hpp"
#endif
#ifdef HAVE_HYPRLAND
#include "modules/hyprland/backend.hpp"
#include "modules/hyprland/language.hpp"
#include "modules/hyprland/submap.hpp"
#include "modules/hyprland/window.hpp"
#include "modules/hyprland/workspaces.hpp"
#endif
#if defined(__FreeBSD__) || (defined(__linux__) && !defined(NO_FILESYSTEM))
#include "modules/battery.hpp"
#endif
#if defined(HAVE_CPU_LINUX) || defined(HAVE_CPU_BSD)
#include "modules/cpu.hpp"
#include "modules/cpu_frequency.hpp"
#include "modules/cpu_usage.hpp"
#include "modules/load.hpp"
#endif
#include "modules/idle_inhibitor.hpp"
#if defined(HAVE_MEMORY_LINUX) || defined(HAVE_MEMORY_BSD)
#include "modules/memory.hpp"
#endif
#include "modules/disk.hpp"
#ifdef HAVE_DBUSMENU
#include "modules/sni/tray.hpp"
#endif
#ifdef HAVE_MPRIS
#include "modules/mpris/mpris.hpp"
#endif
#ifdef HAVE_LIBNL
#include "modules/network.hpp"
#endif
#ifdef HAVE_LIBUDEV
#include "modules/backlight.hpp"
#endif
#ifdef HAVE_LIBEVDEV
#include "modules/keyboard_state.hpp"
#endif
#ifdef HAVE_GAMEMODE
#include "modules/gamemode.hpp"
#endif
#ifdef HAVE_UPOWER
#include "modules/upower/upower.hpp"
#endif
#ifdef HAVE_LIBPULSE
#include "modules/pulseaudio.hpp"
#endif
#ifdef HAVE_LIBMPDCLIENT
#include "modules/mpd/mpd.hpp"
#endif
#ifdef HAVE_LIBSNDIO
#include "modules/sndio.hpp"
#endif
#ifdef HAVE_GIO_UNIX
#include "modules/bluetooth.hpp"
#include "modules/inhibitor.hpp"
#endif
#ifdef HAVE_LIBJACK
#include "modules/jack.hpp"
#endif
#ifdef HAVE_LIBWIREPLUMBER
#include "modules/wireplumber.hpp"
#endif
#ifdef HAVE_LIBCAVA
#include "modules/cava.hpp"
#endif
#include "bar.hpp"
#include "modules/custom.hpp"
#include "modules/image.hpp"
#include "modules/temperature.hpp"
#include "modules/user.hpp"
#include <AModule.hpp>
namespace waybar {
class Bar;
class Factory {
public:
Factory(const Bar& bar, const Json::Value& config);
AModule* makeModule(const std::string& name) const;
AModule* makeModule(const std::string& name, const std::string& pos) const;
private:
const Bar& bar_;

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

@@ -1,14 +1,12 @@
#pragma once
#ifdef FILESYSTEM_EXPERIMENTAL
#include <experimental/filesystem>
#else
#include <filesystem>
#endif
#include <fmt/format.h>
#include <filesystem>
#if defined(__linux__)
#include <sys/inotify.h>
#endif
#include <sys/poll.h>
#include <algorithm>
#include <fstream>
@@ -16,19 +14,17 @@
#include <vector>
#include "ALabel.hpp"
#include "bar.hpp"
#include "util/sleeper_thread.hpp"
#include "util/udev_deleter.hpp"
namespace waybar::modules {
#ifdef FILESYSTEM_EXPERIMENTAL
namespace fs = std::experimental::filesystem;
#else
namespace fs = std::filesystem;
#endif
class Battery : public ALabel {
public:
Battery(const std::string&, const Json::Value&);
Battery(const std::string&, const waybar::Bar&, const Json::Value&);
virtual ~Battery();
auto update() -> void override;
@@ -38,17 +34,23 @@ class Battery : public ALabel {
void refreshBatteries();
void worker();
const std::string getAdapterStatus(uint8_t capacity) const;
const std::tuple<uint8_t, float, std::string, float> getInfos();
std::tuple<uint8_t, float, std::string, float, uint16_t, float> getInfos();
const std::string formatTimeRemaining(float hoursRemaining);
void setBarClass(std::string&);
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_;
util::SleeperThread thread_battery_update_;

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

60
include/modules/cffi.hpp Normal file
View File

@@ -0,0 +1,60 @@
#pragma once
#include <string>
#include "AModule.hpp"
#include "util/command.hpp"
#include "util/json.hpp"
#include "util/sleeper_thread.hpp"
namespace waybar::modules {
namespace ffi {
extern "C" {
typedef struct wbcffi_module wbcffi_module;
typedef struct {
wbcffi_module* obj;
const char* waybar_version;
GtkContainer* (*get_root_widget)(wbcffi_module*);
void (*queue_update)(wbcffi_module*);
} wbcffi_init_info;
struct wbcffi_config_entry {
const char* key;
const char* value;
};
}
} // namespace ffi
class CFFI : public AModule {
public:
CFFI(const std::string&, const std::string&, const Json::Value&);
virtual ~CFFI();
virtual auto refresh(int signal) -> void override;
virtual auto doAction(const std::string& name) -> void override;
virtual auto update() -> void override;
private:
///
void* cffi_instance_ = nullptr;
typedef void*(InitFn)(const ffi::wbcffi_init_info* init_info,
const ffi::wbcffi_config_entry* config_entries, size_t config_entries_len);
typedef void(DenitFn)(void* instance);
typedef void(RefreshFn)(void* instance, int signal);
typedef void(DoActionFn)(void* instance, const char* name);
typedef void(UpdateFn)(void* instance);
// FFI hooks
struct {
std::function<InitFn> init = nullptr;
std::function<DenitFn> deinit = nullptr;
std::function<RefreshFn> refresh = [](void*, int) {};
std::function<DoActionFn> doAction = [](void*, const char*) {};
std::function<UpdateFn> update = [](void*) {};
} hooks_;
};
} // namespace waybar::modules

View File

@@ -6,38 +6,29 @@
namespace waybar::modules {
const std::string kCalendarPlaceholder = "calendar";
const std::string KTimezonedTimeListPlaceholder = "timezoned_time_list";
enum class WeeksSide {
LEFT,
RIGHT,
HIDDEN,
};
const std::string kCldPlaceholder{"calendar"};
const std::string kTZPlaceholder{"tz_list"};
const std::string kOrdPlaceholder{"ordinal_date"};
enum class CldMode { MONTH, YEAR };
enum class WS { LEFT, RIGHT, HIDDEN };
class Clock final : public ALabel {
public:
Clock(const std::string&, const Json::Value&);
virtual ~Clock() = default;
auto update() -> void override;
auto doAction(const std::string& name) -> void override;
auto doAction(const std::string&) -> void override;
private:
util::SleeperThread thread_;
std::locale locale_;
std::vector<const date::time_zone*> time_zones_;
int current_time_zone_idx_;
bool is_calendar_in_tooltip_;
bool is_timezoned_list_in_tooltip_;
auto first_day_of_week() -> date::weekday;
const date::time_zone* current_timezone();
auto timezones_text(std::chrono::system_clock::time_point now) -> std::string;
/*Calendar properties*/
WeeksSide cldWPos_{WeeksSide::HIDDEN};
const std::locale m_locale_;
// tooltip
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
/*
0 - calendar.format.months
1 - calendar.format.weekdays
@@ -47,33 +38,56 @@ 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
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};
uint cldMonCols_{3}; // Count of the month in the row
int cldMonColLen_{20}; // Length of the month column
int cldWnLen_{3}; // Length of the week number
date::year_month_day cldYearShift_;
date::year_month cldMonShift_;
date::months cldCurrShift_{0};
date::months cldShift_{0};
std::string cldYearCached_{};
std::string cldMonCached_{};
date::day cldBaseDay_{0};
/*Calendar functions*/
auto get_calendar(const date::year_month_day& today, const date::year_month_day& ymd,
const date::time_zone* tz) -> const std::string;
/*Clock actions*/
// get local 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 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 date::year_month_day& today) -> std::string;
auto getTZtext(date::sys_seconds now) -> std::string;
auto first_day_of_week() -> date::weekday;
// Module actions
void cldModeSwitch();
void cldShift_up();
void cldShift_down();
void cldShift_reset();
void tz_up();
void tz_down();
// ModuleActionMap
static inline std::map<const std::string, void (waybar::modules::Clock::*const)()> actionMap_{
// Module Action Map
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},
{"shift_reset", &waybar::modules::Clock::cldShift_reset},
{"tz_up", &waybar::modules::Clock::tz_up},
{"tz_down", &waybar::modules::Clock::tz_down}};
};
} // namespace waybar::modules

View File

@@ -14,7 +14,7 @@ namespace waybar::modules {
class Custom : public ALabel {
public:
Custom(const std::string&, const std::string&, const Json::Value&);
Custom(const std::string&, const std::string&, const Json::Value&, const std::string&);
virtual ~Custom();
auto update() -> void override;
void refresh(int /*signal*/) override;
@@ -30,10 +30,12 @@ class Custom : public ALabel {
bool handleToggle(GdkEventButton* const& e) override;
const std::string name_;
const std::string output_name_;
std::string text_;
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

@@ -0,0 +1,38 @@
#pragma once
#include <fmt/format.h>
#include <string>
#include "AAppIconLabel.hpp"
#include "bar.hpp"
#include "dwl-ipc-unstable-v2-client-protocol.h"
#include "util/json.hpp"
namespace waybar::modules::dwl {
class Window : public AAppIconLabel, public sigc::trackable {
public:
Window(const std::string &, const waybar::Bar &, const Json::Value &);
~Window();
void handle_layout(const uint32_t layout);
void handle_title(const char *title);
void handle_appid(const char *ppid);
void handle_layout_symbol(const char *layout_symbol);
void handle_frame();
struct zdwl_ipc_manager_v2 *status_manager_;
private:
const Bar &bar_;
std::string title_;
std::string appid_;
std::string layout_symbol_;
uint32_t layout_;
struct zdwl_ipc_output_v2 *output_status_;
};
} // namespace waybar::modules::dwl

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,8 +1,7 @@
#pragma once
#include <functional>
#include <filesystem>
#include <list>
#include <memory>
#include <mutex>
#include <string>
#include <thread>
@@ -18,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&, EventHandler*);
void unregisterForIPC(EventHandler*);
void registerForIPC(const std::string& ev, EventHandler* ev_handler);
void unregisterForIPC(EventHandler* handler);
std::string getSocket1Reply(const std::string& rq);
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::mutex callbackMutex;
std::thread ipcThread_;
std::mutex callbackMutex_;
util::JsonParser parser_;
std::list<std::pair<std::string, EventHandler*>> callbacks;
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

@@ -30,13 +30,15 @@ class Language : public waybar::ALabel, public EventHandler {
std::string short_description;
};
auto getLayout(const std::string&) -> Layout;
static auto getLayout(const std::string&) -> Layout;
std::mutex mutex_;
const Bar& bar_;
util::JsonParser parser_;
Layout layout_;
IPC& m_ipc;
};
} // namespace waybar::modules::hyprland

View File

@@ -14,17 +14,22 @@ namespace waybar::modules::hyprland {
class Submap : public waybar::ALabel, public EventHandler {
public:
Submap(const std::string&, const waybar::Bar&, const Json::Value&);
virtual ~Submap();
~Submap() override;
auto update() -> void override;
private:
void onEvent(const std::string&) override;
auto parseConfig(const Json::Value&) -> void;
void onEvent(const std::string& ev) override;
std::mutex mutex_;
const Bar& bar_;
util::JsonParser parser_;
std::string submap_;
bool always_on_ = false;
std::string default_submap_ = "Default";
IPC& m_ipc;
};
} // namespace waybar::modules::hyprland

View File

@@ -25,7 +25,7 @@ class Window : public waybar::AAppIconLabel, public EventHandler {
std::string last_window;
std::string last_window_title;
static auto parse(const Json::Value&) -> Workspace;
static auto parse(const Json::Value& value) -> Workspace;
};
struct WindowData {
@@ -41,24 +41,27 @@ class Window : public waybar::AAppIconLabel, public EventHandler {
static auto parse(const Json::Value&) -> WindowData;
};
auto getActiveWorkspace(const std::string&) -> Workspace;
auto getActiveWorkspace() -> Workspace;
void onEvent(const std::string&) override;
static auto getActiveWorkspace(const std::string&) -> Workspace;
static auto getActiveWorkspace() -> Workspace;
void onEvent(const std::string& ev) override;
void queryActiveWorkspace();
void setClass(const std::string&, bool enable);
bool separate_outputs;
bool separateOutputs_;
std::mutex mutex_;
const Bar& bar_;
util::JsonParser parser_;
WindowData window_data_;
WindowData windowData_;
Workspace workspace_;
std::string solo_class_;
std::string last_solo_class_;
std::string soloClass_;
std::string lastSoloClass_;
bool solo_;
bool all_floating_;
bool allFloating_;
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,92 +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 increment_time_spent_uncreated();
bool is_empty(Workspaces& workspace_manager);
bool repr_is_ready() const { return std::holds_alternative<Repr>(window_); }
std::string repr(Workspaces& workspace_manager);
std::string workspace_name() const { return workspace_name_; }
WindowAddress addr() const { return window_address_; }
void move_to_worksace(std::string& new_workspace_name);
private:
void clear_addr();
void clear_workspace_name();
using Repr = std::string;
using ClassAndTitle = std::pair<std::string, std::string>;
std::variant<Repr, ClassAndTitle> window_;
WindowAddress window_address_;
std::string workspace_name_;
int time_spent_uncreated_ = 0;
};
class Workspace {
public:
explicit Workspace(const Json::Value& workspace_data, Workspaces& workspace_manager,
const Json::Value& clients_data = Json::Value::nullRef);
std::string& select_icon(std::map<std::string, std::string>& icons_map);
Gtk::Button& button() { return button_; };
int id() const { return id_; };
std::string name() const { return name_; };
std::string output() const { return output_; };
bool active() const { return active_; };
bool is_special() const { return is_special_; };
bool is_persistent() const { return is_persistent_; };
bool is_visible() const { return is_visible_; };
bool is_empty() const { return windows_ == 0; };
bool is_urgent() const { return is_urgent_; };
bool handle_clicked(GdkEventButton* bt) const;
void set_active(bool value = true) { active_ = value; };
void set_persistent(bool value = true) { is_persistent_ = value; };
void set_urgent(bool value = true) { is_urgent_ = value; };
void set_visible(bool value = true) { is_visible_ = value; };
void set_windows(uint value) { windows_ = value; };
void set_name(std::string const& value) { name_ = value; };
bool contains_window(WindowAddress const& addr) const { return window_map_.contains(addr); }
void insert_window(WindowCreationPayload create_window_paylod);
std::string remove_window(WindowAddress const& addr);
void initialize_window_map(const Json::Value& clients_data);
bool on_window_opened(WindowCreationPayload const& create_window_paylod);
std::optional<std::string> close_window(WindowAddress const& addr);
void update(const std::string& format, const std::string& icon);
private:
Workspaces& workspace_manager_;
int id_;
std::string name_;
std::string output_;
uint windows_;
bool active_ = false;
bool is_special_ = false;
bool is_persistent_ = false;
bool is_urgent_ = false;
bool is_visible_ = false;
std::map<WindowAddress, std::string> window_map_;
Gtk::Button button_;
Gtk::Box content_;
Gtk::Label label_;
};
class Workspaces : public AModule, public EventHandler {
public:
Workspaces(const std::string&, const waybar::Bar&, const Json::Value&);
@@ -119,85 +35,176 @@ class Workspaces : public AModule, public EventHandler {
void update() override;
void init();
auto all_outputs() const -> bool { return all_outputs_; }
auto show_special() const -> bool { return show_special_; }
auto active_only() const -> bool { return active_only_; }
auto 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 get_bar_output() const -> std::string { return bar_.output->name; }
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; }
std::string get_rewrite(std::string window_class, std::string window_title);
std::string& get_window_separator() { return format_window_separator_; }
bool is_workspace_ignored(std::string const& workspace_name);
enum class ActiveWindowPosition { NONE, FIRST, LAST };
auto activeWindowPosition() const -> ActiveWindowPosition { return m_activeWindowPosition; }
bool window_rewrite_config_uses_title() const { return any_window_rewrite_rule_uses_title_; }
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 update_window_count();
void sort_workspaces();
void create_workspace(Json::Value const& workspace_data,
Json::Value const& clients_data = Json::Value::nullRef);
void remove_workspace(std::string const& name);
void set_urgent_workspace(std::string const& windowaddress);
void parse_config(const Json::Value& config);
void register_ipc();
void updateWindowCount();
void sortSpecialCentered();
void sortWorkspaces();
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 on_workspace_activated(std::string const& payload);
void on_workspace_destroyed(std::string const& payload);
void on_workspace_created(std::string const& payload);
void on_workspace_moved(std::string const& payload);
void on_workspace_renamed(std::string const& payload);
void onWorkspaceActivated(std::string const& payload);
void onSpecialWorkspaceActivated(std::string const& payload);
void onWorkspaceDestroyed(std::string const& payload);
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 on_monitor_focused(std::string const& payload);
void onMonitorFocused(std::string const& payload);
// window events
void on_window_opened(std::string const& payload);
void on_window_closed(std::string const& payload);
void on_window_moved(std::string const& payload);
void onWindowOpened(std::string const& payload);
void onWindowClosed(std::string const& addr);
void onWindowMoved(std::string const& payload);
void on_window_title_event(std::string const& payload);
void onWindowTitleEvent(std::string const& payload);
void onActiveWindowChanged(WindowAddress const& payload);
int window_rewrite_priority_function(std::string const& window_rule);
void onConfigReloaded();
bool all_outputs_ = false;
bool show_special_ = false;
bool active_only_ = false;
int windowRewritePriorityFunction(std::string const& window_rule);
enum class SORT_METHOD { ID, NAME, NUMBER, DEFAULT };
util::EnumParser<SORT_METHOD> enum_parser_;
SORT_METHOD sort_by_ = SORT_METHOD::DEFAULT;
std::map<std::string, SORT_METHOD> sort_map_ = {{"ID", SORT_METHOD::ID},
{"NAME", SORT_METHOD::NAME},
{"NUMBER", SORT_METHOD::NUMBER},
{"DEFAULT", SORT_METHOD::DEFAULT}};
// 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);
void fill_persistent_workspaces();
void create_persistent_workspaces();
std::vector<std::string> persistent_workspaces_to_create_;
bool persistent_created_ = false;
// Update methods
void doUpdate();
void removeWorkspacesToRemove();
void createWorkspacesToCreate();
static std::vector<int> getVisibleWorkspaces();
void updateWorkspaceStates();
bool updateWindowsToCreate();
std::string format_;
void extendOrphans(int workspaceId, Json::Value const& clientsJson);
void registerOrphanWindow(WindowCreationPayload create_window_payload);
std::map<std::string, std::string> icons_map_;
util::RegexCollection window_rewrite_rules_;
bool any_window_rewrite_rule_uses_title_ = false;
std::string format_window_separator_;
void initializeWorkspaces();
void setCurrentMonitorId();
void loadPersistentWorkspacesFromConfig(Json::Value const& clientsJson);
void loadPersistentWorkspacesFromWorkspaceRules(const Json::Value& clientsJson);
bool with_icon_;
uint64_t monitor_id_;
std::string active_workspace_name_;
std::vector<std::unique_ptr<Workspace>> workspaces_;
std::vector<Json::Value> workspaces_to_create_;
std::vector<std::string> workspaces_to_remove_;
std::vector<WindowCreationPayload> windows_to_create_;
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;
std::vector<std::regex> ignore_workspaces_;
// 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 across bars (a.k.a `all-outputs` = false)
std::map<WindowAddress, WindowRepr, std::less<>> m_orphanWindowMap;
std::mutex mutex_;
const Bar& bar_;
Gtk::Box box_;
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_formatBefore;
std::string m_formatAfter;
std::map<std::string, std::string> m_iconsMap;
util::RegexCollection m_windowRewriteRules;
bool m_anyWindowRewriteRuleUsesTitle = false;
std::string m_formatWindowSeparator;
bool m_withIcon;
uint64_t m_monitorId;
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

@@ -148,6 +148,7 @@ class Stopped : public State {
class Disconnected : public State {
Context* const ctx_;
sigc::connection timer_connection_;
int last_interval_;
public:
Disconnected(Context* const ctx) : ctx_{ctx} {}
@@ -162,7 +163,7 @@ class Disconnected : public State {
Disconnected(Disconnected const&) = delete;
Disconnected& operator=(Disconnected const&) = delete;
void arm_timer(int interval) noexcept;
bool arm_timer(int interval) noexcept;
void disarm_timer() noexcept;
bool on_timer();

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

@@ -0,0 +1,48 @@
#pragma once
#include <fmt/format.h>
#include "ALabel.hpp"
#include "giomm/dbusproxy.h"
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 {
public:
PowerProfilesDaemon(const std::string &, const Json::Value &);
auto update() -> void override;
void profileChangedCb(const Gio::DBus::Proxy::MapChangedProperties &,
const std::vector<Glib::ustring> &);
void busConnectedCb(Glib::RefPtr<Gio::AsyncResult> &r);
void getAllPropsCb(Glib::RefPtr<Gio::AsyncResult> &r);
void setPropCb(Glib::RefPtr<Gio::AsyncResult> &r);
void populateInitState();
bool handleToggle(GdkEventButton *const &e) override;
private:
// True if we're connected to the dbug interface. False if we're
// not.
bool connected_;
// Look for a profile name in the list of available profiles and
// switch activeProfile_ to it.
void switchToProfile(std::string const &);
// Used to toggle/display the profiles
std::vector<Profile> availableProfiles_;
// Points to the active profile in the profiles list
std::vector<Profile>::iterator activeProfile_;
// Current CSS class applied to the label
std::string currentStyle_;
// Format string
std::string tooltipFormat_;
// DBus Proxy used to track the current active profile
Glib::RefPtr<Gio::DBus::Proxy> powerProfilesProxy_;
};
} // namespace waybar::modules

View File

@@ -0,0 +1,40 @@
#pragma once
#include <string>
#include "gtkmm/box.h"
#include "modules/privacy/privacy_item.hpp"
#include "util/pipewire/pipewire_backend.hpp"
#include "util/pipewire/privacy_node_info.hpp"
using waybar::util::PipewireBackend::PrivacyNodeInfo;
namespace waybar::modules::privacy {
class Privacy : public AModule {
public:
Privacy(const std::string &, const Json::Value &, Gtk::Orientation, const std::string &pos);
auto update() -> void override;
void onPrivacyNodesChanged();
private:
std::list<PrivacyNodeInfo *> nodes_screenshare; // Screen is being shared
std::list<PrivacyNodeInfo *> nodes_audio_in; // Application is using the microphone
std::list<PrivacyNodeInfo *> nodes_audio_out; // Application is outputting audio
std::mutex mutex_;
sigc::connection visibility_conn;
// Config
Gtk::Box box_;
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;
};
} // namespace waybar::modules::privacy

View File

@@ -0,0 +1,48 @@
#pragma once
#include <json/value.h>
#include <string>
#include "gtkmm/box.h"
#include "gtkmm/image.h"
#include "gtkmm/revealer.h"
#include "util/pipewire/privacy_node_info.hpp"
using waybar::util::PipewireBackend::PrivacyNodeInfo;
using waybar::util::PipewireBackend::PrivacyNodeType;
namespace waybar::modules::privacy {
class PrivacyItem : public Gtk::Revealer {
public:
PrivacyItem(const Json::Value &config_, enum PrivacyNodeType privacy_type_,
std::list<PrivacyNodeInfo *> *nodes, Gtk::Orientation orientation,
const std::string &pos, const uint icon_size, const uint transition_duration);
enum PrivacyNodeType privacy_type;
void set_in_use(bool in_use);
private:
std::list<PrivacyNodeInfo *> *nodes;
sigc::connection signal_conn;
Gtk::Box tooltip_window;
bool init = false;
bool in_use = false;
// Config
std::string iconName = "image-missing-symbolic";
bool tooltip = true;
uint tooltipIconSize = 24;
Gtk::Box box_;
Gtk::Image icon_;
void update_tooltip();
};
} // namespace waybar::modules::privacy

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;
@@ -56,8 +56,9 @@ class Language : public ALabel, public sigc::trackable {
Layout layout_;
std::string tooltip_format_ = "";
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

@@ -12,13 +12,14 @@
#include "client.hpp"
#include "modules/sway/ipc/client.hpp"
#include "util/json.hpp"
#include "util/regex_collection.hpp"
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:
@@ -27,23 +28,28 @@ class Workspaces : public AModule, public sigc::trackable {
R"(workspace {} "{}"; move workspace to output "{}"; workspace {} "{}")";
static int convertWorkspaceNameToNum(std::string name);
static int windowRewritePriorityFunction(std::string const& window_rule);
void onCmd(const struct Ipc::ipc_response&);
void onEvent(const struct Ipc::ipc_response&);
bool filterButtons();
static bool hasFlag(const Json::Value&, const std::string&);
void updateWindows(const Json::Value&, std::string&);
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_formatWindowSeparator;
util::RegexCollection m_windowRewriteRules;
util::JsonParser parser_;
std::unordered_map<std::string, Gtk::Button> buttons_;
std::mutex mutex_;

View File

@@ -0,0 +1,34 @@
#pragma once
#include <giomm/dbusproxy.h>
#include <string>
#include "ALabel.hpp"
namespace waybar::modules {
class SystemdFailedUnits : public ALabel {
public:
SystemdFailedUnits(const std::string &, const Json::Value &);
virtual ~SystemdFailedUnits();
auto update() -> void override;
private:
bool hide_on_ok;
std::string format_ok;
bool update_pending;
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();
};
} // namespace waybar::modules

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,80 +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;
guint login1_id;
GDBusConnection *login1_connection;
std::unique_ptr<UPowerTooltip> upower_tooltip;
std::string lastStatus;
bool showAltText;
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

@@ -17,18 +17,25 @@ class Wireplumber : public ALabel {
auto update() -> void override;
private:
void loadRequiredApiModules();
void prepare();
void asyncLoadRequiredApiModules();
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);
static void onMixerApiLoaded(WpObject* p, GAsyncResult* res, waybar::modules::Wireplumber* self);
static void onObjectManagerInstalled(waybar::modules::Wireplumber* self);
static void onMixerChanged(waybar::modules::Wireplumber* self, uint32_t id);
static void onDefaultNodesApiChanged(waybar::modules::Wireplumber* self);
bool handleScroll(GdkEventScroll* e) override;
static std::list<waybar::modules::Wireplumber*> modules;
WpCore* wp_core_;
GPtrArray* apis_;
WpObjectManager* om_;
@@ -41,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

@@ -22,6 +22,7 @@ class AudioBackend {
static void sourceInfoCb(pa_context*, const pa_source_info* i, int, void* data);
static void serverInfoCb(pa_context*, const pa_server_info*, void*);
static void volumeModifyCb(pa_context*, int, void*);
void connectContext();
pa_threaded_mainloop* mainloop_;
pa_mainloop_api* mainloop_api_;
@@ -37,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

@@ -20,7 +20,7 @@
std::scoped_lock<std::mutex> lock((backend).udev_thread_mutex_); \
__devices = (backend).devices_; \
} \
auto varname = (backend).best_device(__devices.cbegin(), __devices.cend(), preferred_device);
auto varname = (backend).best_device(__devices, preferred_device);
namespace waybar::util {
@@ -56,27 +56,21 @@ 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);
template <class ForwardIt, class Inserter>
static void upsert_device(ForwardIt first, ForwardIt last, Inserter inserter, udev_device *dev);
template <class ForwardIt, class Inserter>
static void enumerate_devices(ForwardIt first, ForwardIt last, Inserter inserter, udev *udev);
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_); }
template <class ForwardIt>
static const BacklightDevice *best_device(ForwardIt first, ForwardIt last, std::string_view);
static const BacklightDevice *best_device(const std::vector<BacklightDevice> &devices,
std::string_view);
std::vector<BacklightDevice> devices_;
std::mutex udev_thread_mutex_;
private:
void set_brightness_internal(std::string device_name, int brightness, int max_brightness);
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_;
@@ -90,4 +84,4 @@ class BacklightBackend {
static constexpr int EPOLL_MAX_EVENTS = 16;
};
} // namespace waybar::util
} // namespace waybar::util

View File

@@ -66,7 +66,7 @@ inline int close(FILE* fp, pid_t pid) {
return stat;
}
inline FILE* open(const std::string& cmd, int& pid) {
inline FILE* open(const std::string& cmd, int& pid, const std::string& output_name) {
if (cmd == "") return nullptr;
int fd[2];
// Open the pipe with the close-on-exec flag set, so it will not be inherited
@@ -109,6 +109,9 @@ inline FILE* open(const std::string& cmd, int& pid) {
::close(fd[0]);
dup2(fd[1], 1);
setpgid(child_pid, child_pid);
if (output_name != "") {
setenv("WAYBAR_OUTPUT_NAME", output_name.c_str(), 1);
}
execlp("/bin/sh", "sh", "-c", cmd.c_str(), (char*)0);
exit(0);
} else {
@@ -118,9 +121,9 @@ inline FILE* open(const std::string& cmd, int& pid) {
return fdopen(fd[0], "r");
}
inline struct res exec(const std::string& cmd) {
inline struct res exec(const std::string& cmd, const std::string& output_name) {
int pid;
auto fp = command::open(cmd, pid);
auto fp = command::open(cmd, pid, output_name);
if (!fp) return {-1, ""};
auto output = command::read(fp);
auto stat = command::close(fp, pid);
@@ -129,7 +132,7 @@ inline struct res exec(const std::string& cmd) {
inline struct res execNoRead(const std::string& cmd) {
int pid;
auto fp = command::open(cmd, pid);
auto fp = command::open(cmd, pid, "");
if (!fp) return {-1, ""};
auto stat = command::close(fp, pid);
return {WEXITSTATUS(stat), ""};

View File

@@ -0,0 +1,49 @@
#pragma once
#include <functional>
#include <string>
#include <unordered_map>
#include <vector>
#include "giomm/file.h"
#include "giomm/filemonitor.h"
#include "glibmm/refptr.h"
struct pollfd;
namespace waybar {
class CssReloadHelper {
public:
CssReloadHelper(std::string cssFile, std::function<void()> callback);
virtual ~CssReloadHelper() = default;
virtual void monitorChanges();
protected:
std::vector<std::string> parseImports(const std::string& cssFile);
void parseImports(const std::string& cssFile, std::unordered_map<std::string, bool>& imports);
void watchFiles(const std::vector<std::string>& files);
bool handleInotifyEvents(int fd);
bool watch(int inotifyFd, pollfd* pollFd);
virtual std::string getFileContents(const std::string& filename);
virtual std::string findPath(const std::string& filename);
void handleFileChange(Glib::RefPtr<Gio::File> const& file,
Glib::RefPtr<Gio::File> const& other_type,
Gio::FileMonitorEvent event_type);
private:
std::string m_cssFile;
std::function<void()> m_callback;
std::vector<std::tuple<Glib::RefPtr<Gio::FileMonitor>>> m_fileMonitors;
};
} // namespace waybar

View File

@@ -1,34 +1,48 @@
#pragma once
#include <fmt/format.h>
#include <chrono>
#if HAVE_CHRONO_TIMEZONES
#include <chrono>
#include <format>
/* Compatibility layer for <date/tz.h> on top of C++20 <chrono> */
namespace date {
using namespace std::chrono;
namespace literals {
using std::chrono::last;
}
inline auto format(const std::string& spec, const auto& ztime) {
return spec.empty() ? "" : std::vformat("{:L" + spec + "}", std::make_format_args(ztime));
}
inline auto format(const std::locale& loc, const std::string& spec, const auto& ztime) {
return spec.empty() ? "" : std::vformat(loc, "{:L" + spec + "}", std::make_format_args(ztime));
}
} // namespace date
#else
#include <date/tz.h>
#include <fmt/format.h>
#include <regex>
#endif
// Date
namespace date {
#if HAVE_CHRONO_TIMEZONES
using namespace std::chrono;
using std::format;
#else
using system_clock = std::chrono::system_clock;
using seconds = std::chrono::seconds;
template <typename T>
inline auto format(const char* spec, const T& arg) {
return date::format(std::regex_replace(spec, std::regex("\\{:L|\\}"), ""), arg);
}
template <typename T>
inline auto format(const std::locale& loc, const char* spec, const T& arg) {
return date::format(loc, std::regex_replace(spec, std::regex("\\{:L|\\}"), ""), arg);
}
#endif
} // namespace date
// Format
namespace waybar::util::date::format {
#if HAVE_CHRONO_TIMEZONES
using namespace std;
#else
using namespace fmt;
#endif
} // namespace waybar::util::date::format
#if not HAVE_CHRONO_TIMEZONES
template <typename Duration, typename TimeZonePtr>
struct fmt::formatter<date::zoned_time<Duration, TimeZonePtr>> {
std::string_view specs;
@@ -50,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));
@@ -58,3 +72,4 @@ struct fmt::formatter<date::zoned_time<Duration, TimeZonePtr>> {
return fmt::format_to(ctx.out(), "{}", date::format(fmt::to_string(specs), ztime));
}
};
#endif

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

@@ -3,6 +3,12 @@
#include <fmt/ostream.h>
#include <json/json.h>
#include <algorithm>
#include <codecvt>
#include <iostream>
#include <locale>
#include <regex>
#if (FMT_VERSION >= 90000)
template <>
@@ -12,25 +18,31 @@ struct fmt::formatter<Json::Value> : ostream_formatter {};
namespace waybar::util {
struct JsonParser {
JsonParser() {}
class JsonParser {
public:
JsonParser() = default;
const Json::Value parse(const std::string& data) const {
Json::Value root(Json::objectValue);
if (data.empty()) {
return root;
Json::Value parse(const std::string& jsonStr) {
Json::Value root;
// replace all occurrences of "\x" with "\u00", because JSON doesn't allow "\x" escape sequences
std::string modifiedJsonStr = replaceHexadecimalEscape(jsonStr);
std::istringstream jsonStream(modifiedJsonStr);
std::string 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);
}
std::unique_ptr<Json::CharReader> const reader(builder_.newCharReader());
std::string err;
bool res = reader->parse(data.c_str(), data.c_str() + data.size(), &root, &err);
if (!res) throw std::runtime_error(err);
return root;
}
~JsonParser() = default;
private:
Json::CharReaderBuilder builder_;
static std::string replaceHexadecimalEscape(const std::string& str) {
static std::regex re("\\\\x");
return std::regex_replace(str, re, "\\u00");
}
};
} // namespace waybar::util

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

@@ -0,0 +1,45 @@
#pragma once
#include <pipewire/pipewire.h>
#include <unordered_map>
#include "util/backend_common.hpp"
#include "util/pipewire/privacy_node_info.hpp"
namespace waybar::util::PipewireBackend {
class PipewireBackend {
private:
pw_thread_loop* mainloop_;
pw_context* context_;
pw_core* core_;
pw_registry* registry_;
spa_hook registryListener_;
/* Hack to keep constructor inaccessible but still public.
* This is required to be able to use std::make_shared.
* It is important to keep this class only accessible via a reference-counted
* pointer because the destructor will manually free memory, and this could be
* a problem with C++20's copy and move semantics.
*/
struct PrivateConstructorTag {};
public:
sigc::signal<void> privacy_nodes_changed_signal_event;
std::unordered_map<uint32_t, PrivacyNodeInfo*> privacy_nodes;
std::mutex mutex_;
static std::shared_ptr<PipewireBackend> getInstance();
// Handlers for PipeWire events
void handleRegistryEventGlobal(uint32_t id, uint32_t permissions, const char* type,
uint32_t version, const struct spa_dict* props);
void handleRegistryEventGlobalRemove(uint32_t id);
PipewireBackend(PrivateConstructorTag tag);
~PipewireBackend();
};
} // namespace waybar::util::PipewireBackend

View File

@@ -0,0 +1,46 @@
#pragma once
#include <pipewire/pipewire.h>
#include <string>
#include "util/gtk_icon.hpp"
namespace waybar::util::PipewireBackend {
enum PrivacyNodeType {
PRIVACY_NODE_TYPE_NONE,
PRIVACY_NODE_TYPE_VIDEO_INPUT,
PRIVACY_NODE_TYPE_AUDIO_INPUT,
PRIVACY_NODE_TYPE_AUDIO_OUTPUT
};
class PrivacyNodeInfo {
public:
PrivacyNodeType type = PRIVACY_NODE_TYPE_NONE;
uint32_t id;
uint32_t client_id;
enum pw_node_state state = PW_NODE_STATE_IDLE;
std::string media_class;
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;
struct spa_hook object_listener;
struct spa_hook proxy_listener;
void *data;
std::string getName();
std::string getIconName();
// Handlers for PipeWire events
void handleProxyEventDestroy();
void handleNodeEventInfo(const struct pw_node_info *info);
};
} // namespace waybar::util::PipewireBackend

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

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