0

Using Ubuntu 22.04 with Cinnamon.

I want to configure separate shortcut-keys (for each keyboard layout) to switch the keyboard layout of the current window.

I use the gsettings or system-settings to configure my keyboard layouts.

  • switch keyboard layout for each window separately
  • and cycle with shortcut key ctrl_left+ctrl_right.
gsettings set org.gnome.libgnomekbd.keyboard layouts "['us', 'il', 'br', 'gr']"
gsettings set org.gnome.libgnomekbd.keyboard options "['grp\tgrp:ctrls_toggle']"
gsettings set org.gnome.libgnomekbd.desktop group-per-window true

But there isn't an option to configure a separate shortcut key for each layout, instead of cycling (still changing only the current window).

e.g.

Super+Shift+1 == switch current window to 'en' 
Super+Shift+2 == switch current window to 'il' 
Super+Shift+3 == switch current window to 'br' 
Super+Shift+4 == switch current window to 'gr' 

Is there any available settings/program/script to set such custom shortcut-keys?

I do not need to be able to switch all windows together. I only wish to be able to switch the current window.

Please note that questions/answers like the following does not solve my problem, becuase it only works to change the layout for all windows. I want to change only current window. Separate keyboard shortcuts for switching between keyboard layouts

itaj
  • 11
  • You mean "keyboard layout of current window" instead of "layout of current window"? Your title is currently very misleading. You may want to edit it. Anyway, I do not think you can have different keyboard layouts associated with individual windows. You can have shortcut keys that allow quick switching, though. – vanadium Mar 12 '23 at 13:25
  • @vanadium, omg, I wasn't thinking about that, thanks. – itaj Mar 12 '23 at 15:23
  • @vanadium, however, you can have different keyboard layouts associtated with each window. There's an option for that which I use (org.gnome.libgnomekbd.desktop group-per-window true). The keyboard shortcut cycles between my 4 layouts for the current window. I want to have 4 keyboard shortcuts, one for each layout. – itaj Mar 12 '23 at 15:26
  • Answer to do that here: https://askubuntu.com/questions/1176703/switch-between-keyboard-languages-by-cli-in-gnome, however I have the impression that that does not work anymore in Gnome 43 – vanadium Mar 14 '23 at 11:53
  • @vanadium, does it fail only because of the safety changes or other reasons? https://askubuntu.com/questions/1412130/dbus-calls-to-gnome-shell-dont-work-under-ubuntu-22-04 – itaj Mar 14 '23 at 18:44
  • Yes, I did not think of it, but that very likely will be why it does not anymore work. – vanadium Mar 15 '23 at 13:04

0 Answers0