adding keyboard layout in i3

So, i'm trying to add another keyboard layout

setxkbmap -layout us,ge
setxkbmap -option 'grp:alt_shift_toggle'

Which works when i run through terminal, but gives me this error when i add into i3 config file

ERROR: CONFIG: Expected one of these tokens: <end>, '#', 'set ', 'set
   ', 'set_from_resource', 'bindsym', 'bindcode', 'bind', 'bar', 'font'
, 'mode', 'gaps', 'smart_borders', 'smart_gaps', 'floating_minimum_size
', 'floating_maximum_size', 'floating_modifier', 'default_orientation',
 'workspace_layout', 'default_border', 'new_window', 'default_floating_
border', 'new_float', 'hide_edge_borders', 'for_window', 'assign', 'no_
focus', 'focus_follows_mouse', 'mouse_warping', 'focus_wrapping', 'forc
e_focus_wrapping', 'force_xinerama', 'force-xinerama', 'disable_randr15
', 'disable-randr15', 'workspace_auto_back_and_forth', 'fake_outputs', 
'fake-outputs', 'force_display_urgency_hint', 'focus_on_window_activati
on', 'title_align', 'show_marks', 'workspace', 'ipc_socket', 'ipc-socke
t', 'ipc_kill_timeout', 'restart_state', 'popup_during_fullscreen', 'ex
ec_always', 'exec', 'client.background', 'client.focused_inactive', 'cl
ient.focused', 'client.unfocused', 'client.urgent', 'client.placeholder
'
ERROR: CONFIG: (in file /home/kaneda/.i3/config)
ERROR: CONFIG: Line  45: 
ERROR: CONFIG: Line  46: #keyboard language
ERROR: CONFIG: Line  47: setxkbmap -layout us,ge
ERROR: CONFIG:           ^^^^^^^^^^^^^^^^^^^^^^^
ERROR: CONFIG: Line  48: setxkbmap -option 'grp:alt_shift_toggle'
ERROR: CONFIG: Line  49: 
ERROR: CONFIG: Expected one of these tokens: <end>, '#', 'set ', 'set
   ', 'set_from_resource', 'bindsym', 'bindcode', 'bind', 'bar', 'font', 'mode', 'gaps', 'smart_borders', 'smart_gaps', 'floating_minimum_size', 'floating_maximum_size', 'floating_modifier', 'default_orientation', 'workspace_layout', 'default_border', 'new_window', 'default_floating_border', 'new_float', 'hide_edge_borders', 'for_window', 'assign', 'no_focus', 'focus_follows_mouse', 'mouse_warping', 'focus_wrapping', 'force_focus_wrapping', 'force_xinerama', 'force-xinerama', 'disable_randr15', 'disable-randr15', 'workspace_auto_back_and_forth', 'fake_outputs', 'fake-outputs', 'force_display_urgency_hint', 'focus_on_window_activation', 'title_align', 'show_marks', 'workspace', 'ipc_socket', 'ipc-socket', 'ipc_kill_timeout', 'restart_state', 'popup_during_fullscreen', 'exec_always', 'exec', 'client.background', 'client.focused_inactive', 'client.focused', 'client.unfocused', 'client.urgent', 'client.placeholder'
ERROR: CONFIG: (in file /home/kaneda/.i3/config)
ERROR: CONFIG: Line  46: #keyboard language
ERROR: CONFIG: Line  47: setxkbmap -layout us,ge
ERROR: CONFIG: Line  48: setxkbmap -option 'grp:alt_shift_toggle'
ERROR: CONFIG:           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
:

How do you add them to i3config and where? The correct code would be:
exec --no-startup-id “setxkbmap -layout us,ge -option grp:alt_shift_toggle”

Is that what you added to your i3config ? :slight_smile:

Also see this

Edit: Found this and seems nice

1 Like

added this
exec --no-startup-id “setxkbmap -layout us,ge -option grp:alt_shift_toggle”
and rebooted. Works perfectly fine, thanks :wink:

1 Like

Forum kindly sponsored by