I'd like to change the mod key to "AltGr" or "the right Alt key. Furthermore I'd like to disable the new mod key for any other input in Linux. So when I am writing text in my text editor I don't want to get any Greek signs when commanding i3.
I3 – How to change the mod key to AltGr and disable it for “normal” input
i3keyboard-layoutx11
Related Solutions
You need to make the AltGr key send the Alt_R
or Meta_R
keysym, and to associate these keysyms with the Alt modifier (which for you is mod1
). Put the following lines in your .Xmodmap
file (assuming a PC keyboard):
keycode 108 = Alt_R Meta_R
add Mod1 = Alt_L Alt_R Meta_L Meta_R
That's if you want to configure this manually. There's probably an XKB option to do what you want — pick a US non-international layout, for example.
It is (somewhat) possible to emulate this "feature" (For me, the workspace behaviour of i3
is one of the main features, so I do not really recommend to do this unless you really cannot work without workspaces spanning all monitors while still wanting to use i3
).
You can bind multiple commands to shortcuts, so you just can switch workspaces on both monitors at once. For example:
# Default modifier key
set $mod Mod4
# variables for left and right monitor
# (assuming names DP-1 and DP-3 with DP-1 being left of DP-3)
set $monL DP-1
set $monR DP-3
# variables for workpacenames;
set $ws1L 1:A
set $ws1R 11:A
set $ws2L 2:B
set $ws2R 12:B
set $ws3L 3:C
set $ws3R 13:C
# assign workspaces to specific outputs
workspace $ws1L output $monL
workspace $ws1R output $monR
workspace $ws2L output $monL
workspace $ws2R output $monR
workspace $ws3L output $monL
workspace $ws3R output $monR
# do not toggle automatically between the current and previous
# workspace on repeated calls to `workspace NAME` (with identical NAME)
workspace_auto_back_and_forth no
# Toggle between both monitors
# (focus output left wraps from the leftmost to the rightmost output)
bindsym $mod+Tab focus output left
# switch two workspaces at once (the need to be on different outputs)
bindsym $mod+1 workspace $ws1L, workspace $ws1R
bindsym $mod+2 workspace $ws2L, workspace $ws2R
bindsym $mod+3 workspace $ws3L, workspace $ws3R
# move a window to a specific workpace;
# $mod+Shift for left side, $mod+Control for right side
bindsym $mod+Shift+1 move workspace $ws1L
bindsym $mod+Control+1 move workspace $ws1R
bindsym $mod+Shift+2 move workspace $ws2L
bindsym $mod+Control+2 move workspace $ws2R
bindsym $mod+Shift+3 move workspace $ws3L
bindsym $mod+Control+3 move workspace $ws3R
bar {
# [...]
# Do not show workspace numbers (optional)
strip_workspace_numbers yes
}
This uses variables to keep the workspace and output names consistent. The workspace names for the left and right monitor need to be different. In this case I chose to use different numbers because they can be hidden, if so desired. Whith these settings Super+1 will switch to workspace 1:A
on the left monitor and 11:A
on the right monitor. workspace_auto_back_and_forth
should be disabled to avoid possibly confusing and undesired behavior.
Caveats:
- This works only for the keyboard shortcuts, if you click on a workspace button on the i3bar, only the workspace on one monitor will change and not its companion.
- Any command that focuses a window on a currently not visible workspace (
[criteria] focus
) will only focus that workspace without the one on the other output - When switching two workspaces with one binding, the second workspace will always be the focused one (in the above example the right one).
- Focusing and movement across display borders may require different commands/keybindings in some cases. (While this is also the case with non-synchronized workspaces, it may be more noticeable/disrupting when expecting one big workspace)
Some if not all of the caveats could probably be solved by utilizing the IPC interface, for example to automatically switch to the companion workspace, too.
Personally, I would suggest to at least adopt a hybrid approach: Use synchronized workspaces where you absolutely need them for your workflow, but use the default (for i3
) single display approach anywhere else. Otherwise, if you absolutely need/want synchronized workspaces all the time, it might be that i3
is just not the window manager you are looking for.
Best Answer
See xmodmap.
Something like
xmodmap -e "remove mod1 = Alt_R"