lbonn / rofi

Rofi: A window switcher, run dialog and dmenu replacement - fork with wayland support
Other
943 stars 37 forks source link

[BUG] Unable to set a keybinding on Control+l #139

Closed doc-ar closed 1 month ago

doc-ar commented 1 month ago

Rofi version (rofi -v or git commit in case of build issue)

1.7.5+wayland3

Configuration

https://gist.github.com/doc-ar/a393b0c1a53bd9ddd8f5a85c026552f0

Theme

https://gist.github.com/doc-ar/a393b0c1a53bd9ddd8f5a85c026552f0

Timing report

No response

Launch command

rofi -show drun -show-icons

Step to reproduce

Step 1

Add the following vim style keybindings to ~/.config/rofi/config.rasi

  kb-row-up:                      "Up,Control+k,Shift+Tab,Shift+ISO_Left_Tab";
  kb-row-down:                    "Down,Control+j";
  kb-accept-entry:                "Control+m,Return,KP_Enter";
  kb-remove-to-eol:               "Control+Shift+e";
  kb-mode-next:                   "Shift+Right,Control+Tab,Control+l";
  kb-mode-previous:               "Shift+Left,Control+Shift+Tab,Control+h";
  kb-remove-char-back:            "BackSpace";

Step 2

Run rofi launch command

Expected behavior

Rofi runs as usual and i can navigate using the vim style bindings I configured.

Actual behavior

Rofi generates an error window. The error is attached in screenshot

image

Additional information

For the time being I am using Control+semicolon for the next mode keybinding. However it doesn't come very natural since i'm so used to moving right with the L key in vim.

I am using the config and theme file from this repo.

At first I thought that that it might be mapped elsewhere in the configurations. I have checked both the config file and the theme file but control+l is not mapped anywhere else.

Just in case I search for all the .rasi files using sudo find / -type f -name "*.rasi" in my machine and all of them are theme files

Using wayland display server protocol

I've checked if the issue exists in the latest stable release

lbonn commented 1 month ago

It says it in your screenshot, run rofi -list-keybindings. Then probably, you will have this lines coming from the defaults: kb-mode-complete - Control+l.

Please re-open if it persists

doc-ar commented 1 month ago

It says it in your screenshot, run rofi -list-keybindings. Then probably, you will have this lines coming from the defaults: kb-mode-complete - Control+l.

rofi -list-keybindings just displays all keybindings that are available. It does not provide any information on where the bindings are set. As far as I have found from the rofi documentation, there is a system config file in /etc/rofi.rasi. However in my case that file is empty.

So the only file where keybindings are set is ~/.config/rofi/config.rasi and that file has no other bindings set for kb-mode-complete

I moved all custom keybindings to /etc/rofi.rasi as follows:

configuration {
  kb-row-up:                      "Up,Control+k,Shift+Tab,Shift+ISO_Left_Tab";
  kb-row-down:                    "Down,Control+j";
  kb-accept-entry:                "Control+m,Return,KP_Enter";
  kb-remove-to-eol:               "Control+Shift+e";
  kb-mode-next:                   "Shift+Right,Control+Tab,Control+l";
  kb-mode-previous:               "Shift+Left,Control+Shift+Tab,Control+h";
  kb-remove-char-back:            "BackSpace";
}

The issue still persists.

doc-ar commented 1 month ago

I somehow fixed this problem but I don't understand how it works. First i checked rofi -help to see all the keybinds, in there the kb-mode-complete was listed as a default binding not a rasi file binding. Therefore, it doesn't make sense to disallow any other command using the same shortcut key.

First I tried to bind kb-mode-complete to other shortcuts like Control+u or Control+x that resulted in the same error. I tried to unbind it as well by doing kb-mode-complete: "" and that also didn't work.

I finally tried to bind kb-mode-complete to Control+8 and that somehow worked. If anyone has any insight on what the problem could be please share here. Thank you.