Commit Graph
412 Commits
Author SHA1 Message Date
Alexis Rouillard fffb4b3159 Merge pull request #5012 from yihangwu539-png/feat/language-tooltip
feat(language): add tooltip support with configurable tooltip-format
2026-07-03 23:00:06 +02:00
Alexis Rouillard 2f6720c053 Merge pull request #4981 from xiyori/max-windows
Add max-windows option to hyprland/workspaces
2026-07-03 22:58:37 +02:00
Alexis Rouillard 8c4787bd88 Merge pull request #4529 from dimti/hyprland-language-class
Add css class to hyprland language module of short_name language code
2026-07-03 22:58:31 +02:00
Alexis Rouillard 3033e15868 Merge pull request #4958 from v-dermichev/feature/workspace-name-css-class
feat (hyprland/workspaces): expose workspace name as CSS class
2026-07-03 22:52:06 +02:00
Alexis Rouillard 5ff20943a9 Merge branch 'master' into hide-active 2026-07-03 22:22:24 +02:00
Alexis Rouillard 4700f2b423 Merge branch 'master' into max-windows 2026-07-03 22:22:16 +02:00
Alexis Rouillard 96696d0ec4 Merge branch 'master' into feat/language-tooltip 2026-07-03 22:22:14 +02:00
Alexis Rouillard 8ec7bd0939 Merge branch 'master' into hyprland-language-class 2026-07-03 22:22:11 +02:00
Alexis Rouillard 57689fe96b Merge branch 'master' into feature/workspace-name-css-class 2026-07-03 22:21:54 +02:00
Alexis Rouillard 9735efec5d Merge pull request #4353 from shibjyoti555/feature/if-empty
added a "fallback" option to hyprland/window when no window in focus
2026-07-03 22:04:05 +02:00
Alex 25e57bc625 fix(hyprland/window): use 2-space indentation for fallback block (clang-format) 2026-07-03 21:51:20 +02:00
Alex 4bba01c258 Merge remote-tracking branch 'origin/master' into feature/if-empty 2026-07-03 21:49:04 +02:00
Alexis Rouillard e852360106 Merge branch 'master' into refactor-bool-cleanup 2026-07-03 21:47:49 +02:00
Alexis Rouillard ee9737bf94 Merge pull request #4692 from aaronred345/hyprland-special-workspaces-multi-monitor
fix(hyprland/workspaces) Special Workspace Multi-Monitor Support
2026-07-03 21:46:43 +02:00
Alex 806f633318 hyprland/workspaces: refresh locally instead of reloading Hyprland config
Replace the getSocket1JsonReply("reload") call in onSpecialWorkspaceActivated
with the module's normal local refresh path: the state update to
m_activeSpecialWorkspaceName is picked up by the update() render (triggered by
the dp.emit() already issued at the end of onEvent), which re-evaluates active
state, icons and CSS classes. This avoids reloading the entire Hyprland config
on every special workspace activation while keeping the special-active icon and
CSS improvements.
2026-07-03 21:38:46 +02:00
Alex 9930c7be8a Merge remote-tracking branch 'origin/master' into hyprland-special-workspaces-multi-monitor 2026-07-03 21:37:55 +02:00
Alex dc017d8fd3 fix(hyprland/workspaces): disconnect hover-check timeout on Workspace destruction
The hover-check Glib::signal_timeout re-arms every 50ms and is not owned by
the Workspace. Since Workspaces are destroyed at runtime, a workspace removed
while its check is armed would let the timeout fire on freed memory (use-after-
free, also touching the destroyed m_button). Add a destructor that calls
stopHoverCheck() to disconnect the source.
2026-07-03 21:32:55 +02:00
Alex 987d5758a6 Merge remote-tracking branch 'origin/master' into fix/hyprland-workspace-taskbar-hover 2026-07-03 21:32:20 +02:00
Alexis Rouillard 8b5f5b3aea Merge pull request #5155 from Alexays/fix/hyprland-language-keyboard-name-commas
fix(hyprland/language): handle commas in keyboard-name config
2026-07-03 21:23:06 +02:00
Alexis Rouillard 1f2394aa78 Merge pull request #3698 from vpcano/hyprland-language-tooltip
Add tooltip functionality on hyprland/language module
2026-07-03 21:20:16 +02:00
Alex 6793b97eed fix(hyprland/language): handle commas in keyboard-name config
The active-layout event payload is `KEYBOARDNAME,LAYOUT`, and kbName was
taken as everything before the first comma. Keyboard names reported by
Hyprland can themselves contain commas (e.g. some MSI keyboards), so a
`keyboard-name` configured with a comma never matched the truncated value
and the module stopped updating.

Match the configured keyboard-name as a full prefix (followed by the ','
separator) instead. Layout parsing already handles commas via the
last-comma-before-parenthesis heuristic, so only the keyboard-name filter
needed fixing.

Addresses the keyboard-name case originally reported by @tirsek in #3406.
2026-07-03 21:15:35 +02:00
Alex f158f29acf Merge remote-tracking branch 'origin/master' into hyprland-window_no_title_from_special
# Conflicts:
#	src/modules/hyprland/window.cpp
2026-07-03 21:06:18 +02:00
Alex 6de8871882 Merge remote-tracking branch 'origin/master' into hyprland-language-tooltip
# Conflicts:
#	man/waybar-hyprland-language.5.scd
2026-07-03 21:01:53 +02:00
Alexis Rouillard fd81ff299e Merge pull request #4753 from The-Robin-Hood/master
hyprland/workspaces persistent fix and improve cursor handling configuration
2026-07-03 21:00:47 +02:00
Alexis Rouillard 1143444561 Merge pull request #5061 from buzz/fix/hyprland-workspaces-scroll
fix(hyprland): support custom scroll commands
2026-07-03 20:59:12 +02:00
Alexis Rouillard 279aa67206 Merge branch 'master' into fix/hyprland-workspaces-scroll 2026-07-03 20:45:08 +02:00
Alexis Rouillard 5fce3926e0 Merge branch 'master' into master 2026-07-03 20:45:06 +02:00
Alexis Rouillard 9b016d8158 Merge branch 'master' into fix/hyprland-workspaces-taskbar-hover 2026-07-03 20:45:03 +02:00
Ansari 2ff2861e88 Merge remote-tracking branch 'upstream/master' 2026-05-27 12:13:51 +05:30
buzz 85163c6847 fix(hyprland/workspaces): replace EventBox with Button for taskbar windows 2026-05-21 18:50:43 +02:00
buzz eb3b86c4d8 fix(hyprland/workspaces): support on-scroll-up and on-scroll-down config options
The handleScroll method unconditionally dispatched workspace cycling commands
and never checked for custom on-scroll-up/on-scroll-down config values.

Register the scroll handler when custom scroll commands are configured (even
without enable-bar-scroll), and delegate to AModule::handleScroll so user
commands are executed, matching the pattern used by other modules.
2026-05-21 17:02:39 +02:00
Adam Druzd ff76e96786 fix(hyprland): keep workspace hover over taskbar icons 2026-05-17 09:12:08 +02:00
Tom Benham cdb792af41 fix(hyprland/workspaces): fix IPC call when using "move-to-monitor": true 2026-05-16 18:03:09 +02:00
Higor Prado e17c0d9f0a fix(hyprland/workspaces): adapt dispatch commands for Lua IPC protocol
Hyprland 0.54 replaced the text-based dispatch socket protocol with a
Lua-based one. Commands like "dispatch workspace 1" are now interpreted
as invalid Lua (return hl.dispatch(workspace 1)), breaking workspace
clicks and scroll navigation.

Add IPC::dispatch() that probes the running Hyprland on first call and
routes commands through the new hl.dsp Lua API when the Lua protocol is
detected, falling back to the old text format otherwise.
2026-04-29 16:41:11 -03:00
shiyi b28af75e62 feat(language): add tooltip support with configurable tooltip-format 2026-04-29 23:34:09 +08:00
Visal Vijay a8a46d1f1e Refactor: simplify complex conditional expressions in Hyprland workspace module 2026-04-09 19:40:05 +05:30
xiyori 503d99b128 Add max-windows option to hyprland/workspaces 2026-04-09 14:15:56 +03:00
vdermichev 2c2901e8f7 hyprland/workspaces: expose workspace name as CSS class
Enable per-workspace styling by adding the workspace name as a
CSS class to each workspace button. The name is sanitized to a
valid CSS identifier: lowercased, non-alphanumeric characters
collapsed to hyphens, digit-leading names prefixed with "ws-".

Examples: "IDE" → .ide, "special:telegram" → .telegram, "1" → .ws-1

Allows users to style individual workspaces:
  #workspaces button.telegram { color: #54a0e0; }
2026-04-05 11:44:56 +02:00
Emir Baha Yıldırım 83e1949dd8 fix(hyprland/window): Fix segfault caused by use-after-free
The window module registers itself with the Hyprland IPC singleton at
the start of its constructor, before calling update(). If update()
throws an exception (e.g. from an invalid format string), the object is
destroyed without the destructor running, leaving a dangling pointer in
the IPC callback list. When the IPC thread receives an event, it
attempts to call onEvent() on this invalid memory, causing a crash.

Moving the update() call before IPC registration ensures that any
initialization errors occur before the pointer is shared. If the
configuration is invalid, the module fails to construct and is
gracefully disabled by the factory without leaving a "landmine" in the
background IPC thread.

Fixes: #4923

Signed-off-by: Emir Baha Yıldırım <jayshozie@gmail.com>
2026-03-19 19:49:48 +03:00
Austin Horstman 6317022304 fix(hyprland): guard malformed module events
The language and submap modules assumed their Hyprland payload delimiters were
always present. When that assumption is violated, the old code could perform
invalid iterator math or throw while slicing the event string.

Validate the expected separators up front and bail out with a warning when the
event is malformed so the modules degrade safely instead of crashing the update
path.

Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
2026-03-07 21:06:30 -06:00
Austin Horstman dd47a2b826 fix(hyprland/workspaces): stabilize reload and event handling
Hyprland workspace reloads could stack duplicate scroll-event connections,
causing a single wheel gesture to switch multiple workspaces after repeated
config reloads. The persistent-workspaces monitor-array form also created the
monitor name instead of the configured workspace name.

Disconnect and replace the scroll handler on reinit, fix the persistent
workspace name selection, normalize urgent-window address matching, and reject
malformed workspace payloads before they corrupt the local state machine.

Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
2026-03-07 21:06:30 -06:00
Austin Horstman b1a87f943c fix(hyprland/window): avoid stale state during IPC refresh
The window module re-entered the same shared_mutex while refreshing IPC state:
update() took the lock and then called queryActiveWorkspace(), which tried to
lock it again. That is undefined behavior for std::shared_mutex and could
manifest as a deadlock.

Remove the recursive lock path and reset the derived window state before each
IPC refresh. That keeps solo/floating/swallowing/fullscreen classes from
sticking around when the client lookup fails or a workspace becomes empty.

Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
2026-03-07 21:06:30 -06:00
Austin Horstman 0a35b86e20 fix(hyprland/ipc): honor the requested instance signature
The Hyprland IPC helper cached the socket folder with the first instance
signature already appended, so later calls ignored their instanceSig argument
and always reused the first path. That made the helper violate its own API even
though most real Waybar sessions only talk to a single Hyprland instance.

Cache only the base socket directory and append the requested signature per
lookup. This fixes correctness for tests, nested or debug multi-instance
setups, and future code that needs to resolve a different signature, without
claiming support for one Waybar process managing multiple Hyprland sessions.

Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
2026-03-07 21:06:30 -06:00
Austin Horstman 790101f824 chore: format
Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
2026-03-06 18:49:02 -06:00
Alexis Rouillard 100d4ec4a4 Merge pull request #4891 from khaneliman/bugfix/stab-003-test-001-hyprland-ipc
fix(hyprland-ipc): harden fd lifecycle and listener loop
2026-03-04 22:41:30 +01:00
Austin Horstman fe03dfaa3b perf(memory): eliminate deep copies in range-based for loops and lambdas
This commit addresses memory churn caused by implicit deep copies during traversal and allocation of complex structures:

- Replaced pass-by-value 'Json::Value' in std::ranges and range-based for loops with 'const auto&' or 'const Json::Value&' in Hyprland modules, preventing large JSON tree duplications on every update.

- Fixed implicit string and pair copies in UPower and CPU Frequency loops by converting 'auto' to 'const auto&' where possible.

- Added 'std::vector::reserve' calls before 'push_back' loops in MPRIS, Niri, and CFFI modules to prevent exponential vector reallocation during initialization.

Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
2026-03-02 22:54:07 -06:00
Austin Horstman 4c71b2bf9f perf(memory): optimize C++ string operations to reduce heap fragmentation
- Replaced pass-by-value std::string parameters with const std::string&
or std::string_view to prevent SSO overallocations.

- Refactored static mapping functions in UPower to return
std::string_view instead of constructing std::string literals, enabling
perfect cache locality.

- Optimized string concatenation in hot loops (network IPs, inhibitor
lists, sway window marks) by using std::string::append() and
pre-reserving capacity instead of overloaded operator+ which produces
temporary heap instances.

These optimizations reduce high-frequency memory churn and overall heap
fragmentation within the main rendering loops.

Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
2026-03-02 22:54:07 -06:00
Austin Horstman e83ab7609c refactor(hyprland): use shared ScopedFd utility
Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
2026-03-02 08:21:15 -06:00
Austin Horstman d0363313b8 fix(hyprland-ipc): harden fd lifecycle and listener loop
Hyprland IPC had fd lifecycle risks on failure/shutdown paths and used a
spin-sleep listener model.

I initialized fd state defensively, tightened connect/close/shutdown handling,
moved to blocking read with newline framing, and added RAII-style fd cleanup in
socket1 reply paths.

Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
2026-03-02 08:09:44 -06:00
Alex e18939210b fix: lint 2026-02-24 00:00:57 +01:00