project-repo / cagebreak

Cagebreak: A Wayland Tiling Compositor Inspired by Ratpoison
MIT License
284 stars 19 forks source link

keyboard shortcuts #33

Closed exit666 closed 1 year ago

exit666 commented 2 years ago

In config I use Latin letters to configure the shortcuts I want to use. For me having 2 different keyboard layouts it feels overwhelming to keep track of what is current layout to execute cagebreak shortcuts (obv. when it's not english, shorcuts don't work). So here's the question: is there a way to force cagebreak execute shortcuts in both layouts?

project-repo commented 2 years ago

I'm not sure I understand, what exactly you want cagebreak to do? If you want keybindings to work in both layouts, you could for example add all keybindings double: One with the latin key and once with whatever key it corresponds to in the other layout. Is this what you would like to have? If not, could you specify more precisely what your question is?

cheers project-repo

exit666 commented 1 year ago

Thanks for the response! I didn't consider doubleing because I lived with an assumption it will overwrite :facepalm:

When starting cagebreak with cyrillics in config the error is

00:00:00.046 [../cagebreak/parse.c:23] Could not convert key "ы" to keysym.
00:00:00.046 [../cagebreak/parse.c:92] Could not parse key definition "ы"
00:00:00.046 [../cagebreak/parse.c:371] Could not parse keybinding for "bind".
00:00:00.046 [../cagebreak/parse.c:974] Error parsing command.
00:00:00.046 [../cagebreak/cagebreak.c:197] Error in config file "/home/exit/.config/cagebreak/config", line 22

double free or corruption (!prev)
Aborted

LANG=C.UTF8. Could be the problem on my end? Because when I open config in terminal without graphics (X/Wayland) I don't see cyrillics it just shows as squares ■.

project-repo commented 1 year ago

Hi

Thanks for reporting back, the double free or corruption is indeed a bug in Cagebreak, we will look into it as soon as possible and get back to you. The squares in the tty are not related to the bug though.

Cheers project-repo

project-repo commented 1 year ago

Hi exit666,

our understanding of the problem is as follows: Currently, characters from the keybindings are translated into keysyms on startup and if the current keyboard does not have the corresponding character, Cagebreak fails hard - hence the bug. We are currently working on finding a solution but nothing is implemented yet.

The fix will be part of release 2.0.0.

There might be a workaround until then - If you can write a script which, first, changes your keyboard to cyrillic, and then, adds all the cyrillic keybindings, Cagebreak should not have an issue.

Incidentally, how exactly do you change your keyboard layout?

Again, huge thanks for pointing out the bug. We are always grateful when someone reports an issue.

cheers project-repo

exit666 commented 1 year ago

Thx for the reply!

Incidentally, how exactly do you change your keyboard layout?

export XKB_DEFAULT_LAYOUT="us,ru"
export XKB_DEFAULT_OPTIONS="grp:alt_space_toggle"
project-repo commented 1 year ago

Hi exit666

We looked into this a bit more and it turns out that actually it seems to be working as specified after all: The only change one must make is that instead of writing the literal symbol "ы", one should write its name "Cyrillic_yeru". These names can for example be obtained by running xev and pressing the respective keys. Does this work for you?

We recognise however that this is insufficiently documented on our side and will adjust the documentation accordingly.

Thanks a lot for reporting and merry Christmas! project-repo

project-repo commented 1 year ago

Hi exit666,

we have modified the FAQ (and the code for the "double free or corruption" issue) with release 2.0.0.

I am closing this issue

cheers project-repo