Commit Graph

25 Commits

Author SHA1 Message Date
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
vaxerski e8942feefc fix linter more 2022-08-18 18:05:40 +02:00
vaxerski a23d58e900 fix linter 2022-08-18 18:04:39 +02:00
vaxerski 16d5619f3b added a basic hyprland/language module 2022-08-18 18:00:27 +02:00