Commit Graph
53 Commits
Author SHA1 Message Date
Alex db4941efe7 refactor(tooltip): migrate modules to ALabel generic tooltip helper
Migrate idle_inhibitor, sway/language, sway/scratchpad,
hyprland/language and hyprland/window to the shared label/tooltip
setters. idle_inhibitor uses updateLabelAndTooltipForState; the others
keep their custom label/tooltip resolution (trim, precomputed tooltip,
rewriteString, per-lang/variant formats) and switch to the dedup-aware
setLabelMarkup/setTooltipMarkup.
2026-07-04 00:00:15 +02:00
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 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 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
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 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
shiyi b28af75e62 feat(language): add tooltip support with configurable tooltip-format 2026-04-29 23:34:09 +08: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
dimti 4c12001569 do not need to remove css class from gtk label on init phase 2025-10-10 11:58:56 +03:00
dimti a36a5e89a9 Approach to dry pattern - separate remove/add css-classes logic to methods 2025-10-10 11:57:44 +03:00
dimti 2e6bf549a0 Change label css classes in initial and on event language class method. Used in getLabel - make a strange behaviour 2025-10-10 11:52:59 +03:00
dimti bdf501a8a5 make getLayout is not static and set css classes for short name keyboard layout in getLayout method 2025-10-10 11:35:47 +03:00
dimti cd820a100d also remove/add css class in onEvent method 2025-10-10 11:14:30 +03:00
dimti 192baa4556 Add css class to hyprland language module of short_name language code 2025-10-07 10:41:19 +03:00
zjeffer 5079884b78 Hyprland IPC improvements, fix tsan warning, WindowCount shouldn't create a separate IPC 2025-08-12 19:39:36 +02:00
mexanoz 7505e2c3f3 fix hyprland/language layout parsing 2025-06-27 20:54:38 +05:00
Alex ee91d18ad9 fix: lint 2025-06-22 10:01:36 +02:00
Rimsoo afeea62214 fixes #3676 including #3224 2025-04-24 23:32:47 +02:00
Rimsoo 20642f47df Fixed variant bug 2025-04-22 11:41:45 +02:00
zjeffer 5b8839ab5c Hyprland IPC improvements
Fixes IPC being blocked at shutdown
2025-02-19 20:45:47 +01:00
Victor Perez Cano 38cf981f78 fixed clang format for language.cpp 2024-10-25 18:58:55 +02:00
Victor Perez Cano 550d108a03 added tooltip-format-<short_description> on hyprland/language tooltip 2024-10-19 17:30:23 +02:00
Victor Perez Cano 696f7e1542 tooltip functionality on hyprland/language module 2024-10-18 20:41:13 +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
Caleb Maclennan 4126502fe8 Add debug information for keyboard layout selection 2024-06-23 00:02:48 +03: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
zjeffer 42f4386e2e fix clang-tidy errors in hyprland module 2024-02-25 12:11:22 +01:00
Austin Horstman 4cb8efbecc chore: cpplint fixes hyprland classes 2023-09-03 00:18:31 -05:00
czM1K3 b2279c9565 Differencing keyboard layout variant for hyprland/language 2023-07-17 22:20:50 +02:00
gardenapple fd7c2a2012 hyprland/language: Show language on startup 2023-06-20 00:43:33 +03:00
Alex 1445dc4151 fix: lint 2023-04-03 10:06:01 +02:00
en3wton bbcfb5e138 remove use of new on Layout 2023-03-21 19:30:35 +00:00
en3wton 4ab4ff790e add more format replacements for hyprland/language 2023-03-19 15:12:11 +00:00
Oleksandr Kulkov 220b859948 Fix kbName initialization
Second argument of substr is the length of the substring, _not_ the position. With positions, it's better to do like this.

Example:
```sh
[2023-01-29 13:08:00.927] [debug] hyprland IPC received activelayout>>ITE Tech. Inc. ITE Device(8910) Keyboard,Russian (with Ukrainian-Belorussian layout)
[2023-01-29 13:08:00.927] [debug] kbName is ITE Tech. Inc. ITE Device(8910) Keyboard,Russian (with
```

After the fix it's correct:
```sh
[2023-01-29 13:11:11.408] [debug] hyprland IPC received activelayout>>ITE Tech. Inc. ITE Device(8910) Keyboard,Russian (with Ukrainian-Belorussian layout)
[2023-01-29 13:11:11.408] [debug] kbName is ITE Tech. Inc. ITE Device(8910) Keyboard
```
2023-01-29 13:14:05 +01:00
Enes Hecan 3c8ca009ff Sanitize hyprland language string only instead of the whole format. Fixes #1940 2023-01-23 09:50:40 +01:00
Aleksei Bavshin ea17a66dfc fix: compilation errors with cpp_std=c++20
There were two main issues with fmtlib and C++20 mode:

 - `fmt::format` defaults to compile-time argument checking and requires
   using `fmt::runtime(format_string)` to bypass that.
 - `std::format` implementation introduces conflicting declarations and
   we have to specify the namespace for all `format`/`format_to` calls.
2023-01-20 22:50:02 -08:00
Enes Hecan f724cc3f9d Fix wrong layout name in hyprland language module when a variant is used 2022-12-27 15:29:10 +01:00
Enes Hecan 4136ffaecb Minor refactorings and formatting fixes for hyprland language module 2022-12-16 10:01:58 +01:00
Enes Hecan 531bdfb8bb Fix hyprland language initialization issues 2022-12-15 01:48:14 +01:00
Oleksandr Kulkov 459541ed89 Don't search "Keyboard at" from hyprland/language
The current output form of `hyprctl devices` is like this:
```
        Keyboard at 6f80ad70:
                ITE Tech. Inc. ITE Device(8910) Keyboard
                        rules: r "", m "", l "us,ru", v "", o "grp:alt_shift_toggle"
                        active keymap: Russian
                        main: no
```

That is, `Keyboard at` goes _before_ the keyboard name, so looking for `Keyboard at` only makes it skip to the keyboard _after_ the one that the user specified.
2022-11-29 01:11:25 +01:00
Simon Plakolb 5e9bbe5c76 modules: Revert button to label 2022-11-24 13:08:16 +01:00
Jef Steelant 8f4f67f69f Do not crash when a monitor is removed 2022-11-09 09:34:19 +01:00
Alex bfa3adcfd6 Merge pull request #1120 from pinselimo/use_gtk_button_v2 2022-10-17 09:09:12 +02:00
Mika Braunschweig f86dff60e6 utils: add sanitize_str to encode '&' etc.
gtk requires some chars (<>&"') to be encoded for them to render
properly. `sanitize_str` sanitizes raw strings that have such chars and
returns a properly encoded string
2022-10-17 00:31:19 +02:00
Simon Plakolb b8322c4b4b button: Add AButton class
The AButton class is designed as full a substitute to ALabel. The
GtkButton attribute 'button_' is initialized with a label. This
label can the be referenced by the subsequent inheritors of AButton
instead of the GtkLabel attribute 'label_' of ALabel.
For convenience a GtkLabel* 'label_' attribute is added to AButton.

If the button cannot be clicked it is disabled, effectively acting
like its label predecessor.

GtkButton seems to catch one-click mouse events regardless of the
flags set on it. Therefore, 'signal_pressed' is connected to a
function creating a fake GdkEventButton* and calling 'handleToggle'
(for details on this possible bug in GTK see:
https://stackoverflow.com/questions/45334911 )

In accordance with other GtkButtons (i.e. the sway/workspace ones)
set_relief(Gtk::RELIEF_NONE) is called on the 'button_' instance.
2022-10-12 10:25:29 +02:00
vaxerski 39c170bf10 remove one comment that I forgot to 2022-08-18 19:13:24 +02:00
vaxerski ed6467e785 fix linter 2022-08-18 19:02:46 +02:00
vaxerski 43c3ca1d38 added the thing i was talking about 2022-08-18 18:59:34 +02:00
vaxerski 8881b9a6ef fix linter the most 2022-08-18 18:06:34 +02:00