Last active
August 8, 2023 12:40
-
-
Save zw963/e8156358b2029c4f5a6f0d57fb9f6143 to your computer and use it in GitHub Desktop.
A script which change Capslock to Ctrl, and change rightAlt to Capslock for GNOME + Wayland for Arch linux.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
if ! fgrep -qs 'ctrl:new_ctrl = +new_ctrl(new_ctrl)' /usr/share/X11/xkb/rules/evdev; then | |
sudo sed -i.bak '/ctrl:nocaps[[:blank:]]*=[[:blank:]]*+ctrl(nocaps)/a\ | |
ctrl:new_ctrl = +new_ctrl(new_ctrl) | |
' /usr/share/X11/xkb/rules/evdev | |
fi | |
cat <<'HEREDOC' |sudo tee /usr/share/X11/xkb/symbols/new_ctrl | |
partial modifier_keys | |
xkb_symbols "new_ctrl" { | |
replace key <CAPS> { [ Control_L ] }; | |
modifier_map Control { <CAPS>, <LCTL> }; | |
replace key <RALT> { [ Caps_Lock ] }; | |
modifier_map Lock { <RALT> }; | |
}; | |
HEREDOC | |
gsettings set org.gnome.desktop.input-sources xkb-options "['ctrl:new_ctrl']" | |
# for to disable this run | |
# gsettings reset org.gnome.desktop.input-sources xkb-options |
dconf write /org/gnome/desktop/input-sources/xkb-options "['grp:caps_toggle']"
Does this remap any key back to capslock?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
dconf write /org/gnome/desktop/input-sources/xkb-options "['grp:caps_toggle']"