Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Prevent XKB layout switch vs shortcuts

I use setxkbmap to define layout change shortcut as ctrl+shift, as I am used to. But I face a problem sometimes that it clashes with shortcuts of the software I use, like ctrl+shift+A. How can I avoid changing layout when I press ctrl+shift+other_button? I use OpenSuse Linux with i3 wm.

like image 949
Alexey Mints Avatar asked Jan 29 '26 01:01

Alexey Mints


1 Answers

There isn't really a way around this if you want to use ctrl+shift to switch you layouts because ctrl+shift is now caught by xkb at a lower level than the applications you are using. I had the same issue and just switched to using both ctrls to change layout. Have a look at

$ grep 'grp:' /usr/share/X11/xkb/rules/base.lst
  grp:switch           Right Alt (while pressed)
  grp:lswitch          Left Alt (while pressed)
  grp:lwin_switch      Left Win (while pressed)
  grp:rwin_switch      Right Win (while pressed)
  grp:win_switch       Any Win key (while pressed)
  grp:caps_switch      Caps Lock (while pressed), Alt+Caps Lock does the original capslock action
  grp:rctrl_switch     Right Ctrl (while pressed)
  grp:toggle           Right Alt
  grp:lalt_toggle      Left Alt
  grp:caps_toggle      Caps Lock
  grp:shift_caps_toggle Shift+Caps Lock
  grp:shift_caps_switch Caps Lock (to first layout), Shift+Caps Lock (to last layout)
  grp:win_menu_switch  Left Win (to first layout), Right Win/Menu (to last layout)
  grp:lctrl_rctrl_switch Left Ctrl (to first layout), Right Ctrl (to last layout)
  grp:alt_caps_toggle  Alt+Caps Lock
  grp:shifts_toggle    Both Shift keys together
  grp:alts_toggle      Both Alt keys together
  grp:ctrls_toggle     Both Ctrl keys together
  grp:ctrl_shift_toggle Ctrl+Shift
  grp:lctrl_lshift_toggle Left Ctrl+Left Shift
  grp:rctrl_rshift_toggle Right Ctrl+Right Shift
  grp:ctrl_alt_toggle  Alt+Ctrl
  grp:alt_shift_toggle Alt+Shift
  grp:lalt_lshift_toggle Left Alt+Left Shift
  grp:alt_space_toggle Alt+Space
  grp:menu_toggle      Menu
  grp:lwin_toggle      Left Win
  grp:win_space_toggle Win Key+Space
  grp:rwin_toggle      Right Win
  grp:lshift_toggle    Left Shift
  grp:rshift_toggle    Right Shift
  grp:lctrl_toggle     Left Ctrl
  grp:rctrl_toggle     Right Ctrl
  grp:sclk_toggle      Scroll Lock
  grp:lctrl_lwin_rctrl_menu LeftCtrl+LeftWin (to first layout), RightCtrl+Menu (to second layout)
  grp:lctrl_lwin_toggle LeftCtrl+LeftWin

These are all the different key combinations you can use to change the layout. I use grp:ctrls_toggle but you have a lot of options to play with and see what you like.

like image 105
Yep_It's_Me Avatar answered Feb 02 '26 06:02

Yep_It's_Me