-
-
Save agingorange/3a49cf0f1670e90f62894a8206b67e03 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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment