regolith-linux / regolith-rofi-config

Regolith configuration for the rofi launcher.
1 stars 3 forks source link

Can't switch keyboard layouts while in rofi #1

Open niyumard opened 5 years ago

niyumard commented 5 years ago

Hi! When I try to run a program via rofi, I need to switch languages if my keyboard is set to Persian. I usually do this by pressing "Alt+Shift" but when I'm on rofi, this shortcut doesn't work and I have to close rofi first, switch the language to English and open rofi again. I'd appreciate it if you could fix this.

kgilmer commented 5 years ago

Hi @niyumard ! Hmm, yeah that sounds annoying. I looked into the Rofi configuration docs and it looks like you can override keybindings. In your case it's probably the screenshot keybinding that's capturing Alt+Shift, as you can see if you print Rofi's help:

$ rofi --help | grep kb-screenshot
 -kb-screenshot [string]                 Take a screenshot of the rofi window

I don't have your setup so I cannot test this myself. Would you be able verify a fix would be to remap the kb-screenshot to some other key sequence and determine if that allows your keyboard switching functionality to work? You could either make the change in ~/.config/i3-regolith/config here:

from:

bindsym $mod+space exec rofi -show drun -theme regolith-theme

to:

bindsym $mod+space exec rofi -kb-screenshot <something you decide> -show drun -theme regolith-theme

Or even just run rofi from the command line with the -kb-screenshot flag with a new binding specification.

niyumard commented 5 years ago

Hi! I can't change my keyboard layout via the shortcut I've set even when I run rofi like this: rofi -kb-screenshot Control+r -show drun -theme regolith-theme

niyumard commented 5 years ago

BTW, other keyboard shortcuts such as Fn+Right Arrow which usually set the brightness of my screen or Fn+Upwards Arrow which increases my sound volume don't work there (also other shortcuts such as the default $Mod+Enter, but it makes sense for these shortcuts to not work)

kgilmer commented 5 years ago

When you say they don't work, do you mean from within Rofi or generally? Can you share your ~/.config/i3-regolith/config file?

niyumard commented 5 years ago

Within rofi of course. Sure, here it is: https://paste.lucko.me/AGSDwq5NyU But I don't think it has anything to do with my config, you can try using shortcuts while on rofi and it'll also fail.

mjgritli commented 4 years ago

Hello @kgilmer is there any update to this issue I have been facing this issue for a while now. I have 2 languages, English & Arabic, and have to close rofi, switch language to English, and open again. isn't there a fix for this

kgilmer commented 4 years ago

Hi @mjgritli , I suggest you open an issue in the Rofi project: https://github.com/davatorium/rofi. There is nothing we can do in Regolith to deal with this issue as far as I know.

niyumard commented 4 years ago

Hi @mjgritli , I suggest you open an issue in the Rofi project: https://github.com/davatorium/rofi. There is nothing we can do in Regolith to deal with this issue as far as I know.

setxkbmap -layout us,ir 
setxkbmap -option 'grp:alt_shift_toggle'
rofi -modi drun -show drun

With this config rofi can easily handle changing layouts even while open. I think it actually is related to the configs in regolith.

kgilmer commented 4 years ago

Hi @niyumard , thanks for the information. I do not use multiple languages so am not very familiar with this aspect of the system. Given that, it would be helpful if you could provide more details.

Regarding your steps that demonstrate rofi working with Persian, can you explain how to set that up? I installed Persian keyboard on my computer, ran the commands you specified, but see no difference when pressing shift + alt in the drun dialog. What am I missing?

I think it actually is related to the configs in regolith.

Again, can you provide more detail? Here is where Rofi is launched from i3, which boils down to rofi -show drun -theme <theme file>. Here is the default theme. I see nothing in either of these files which would seem to impact keyboard switching functionality, but could be wrong.

niyumard commented 4 years ago

Hi @niyumard , thanks for the information. I do not use multiple languages so am not very familiar with this aspect of the system. Given that, it would be helpful if you could provide more details.

Regarding your steps that demonstrate rofi working with Persian, can you explain how to set that up? I installed Persian keyboard on my computer, ran the commands you specified, but see no difference when pressing shift + alt in the drun dialog. What am I missing?

I think it actually is related to the configs in regolith.

Again, can you provide more detail? Here is where Rofi is launched from i3, which boils down to rofi -show drun -theme <theme file>. Here is the default theme. I see nothing in either of these files which would seem to impact keyboard switching functionality, but could be wrong.

I'm not an expert but in Ubuntu in Language Support you have to set "Keyboard input method system" to none (instead of IBus) Only then that set of command works and you don't really have to change anything else and let setxkbmap take cart of the whole thing, try this one and let me know if you can successfully change your layout with the shortcut: setxkbmap -layout us,ir -option grp:alt_shift_toggle

karmicdude commented 1 year ago

+1 from me. I can't change my layouts with rofi on Gnome 43. I run rofi with run-on-raise as script:

setxkbmap -layout us,ru -variant 'alter-us,alter-ru'
setxkbmap -option 'ctrl:nocaps,grp:lctrl_toggle,lv3:ralt_switch'
rofi -show

And it doesn't work