From 8c23582694eed17689dd2192305c895b961344bf Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Thu, 23 Jun 2022 22:46:52 +1200 Subject: Move Caps-Ctrl modifier into .keyboard file This particular option works on the console, at least on Debian. May as well track it, and avoid setting it in the system-wide config. --- Makefile | 1 + x/keyboard | 10 ++++++++++ x/xsession.sh | 6 ++---- 3 files changed, 13 insertions(+), 4 deletions(-) create mode 100644 x/keyboard diff --git a/Makefile b/Makefile index aa4d8ed1..e0f4b5f2 100644 --- a/Makefile +++ b/Makefile @@ -669,6 +669,7 @@ install-x: x/xsession check-xsession install-logrotate cp -p -- x/xsession $(HOME)/.xsession cp -p -- x/Xresources $(HOME)/.Xresources cp -p -- x/Xresources.d/* $(HOME)/.Xresources.d + cp -p -- x/keyboard $(HOME)/.keyboard cp -p -- x/logrotate/config.d/* $(XDG_CONFIG_HOME)/logrotate/config.d install-yt-dlp install-youtube-dl: diff --git a/x/keyboard b/x/keyboard new file mode 100644 index 00000000..385f3530 --- /dev/null +++ b/x/keyboard @@ -0,0 +1,10 @@ +# Import the system keyboard settings... +. /etc/default/keyboard + +# ...but then make Caps Lock act as Control, just for us. I feel like +# caps:ctrl_modifier is a better option name to describe the intent here, and +# it works fine in X, but not on the console. +# +XKBOPTIONS=ctrl:nocaps + +# We set X-specific options in ~/.xsession. diff --git a/x/xsession.sh b/x/xsession.sh index c0b5cb1c..805d8ef1 100644 --- a/x/xsession.sh +++ b/x/xsession.sh @@ -20,14 +20,12 @@ xargs xrandr \ xargs xwallpaper \ < "${XDG_CONFIG_HOME:-"$HOME"/.config}"/xwallpaper/config & -# Set a few keyboard map options: +# Add a couple more options to any set in ~/.keyboard: # -# - Remap Caps Lock as another Control key. -# - Remap right Alt as a Compose key. +# - Remap right Alt as an X Compose key. # - Kill X server with Ctrl+Alt+Backspace. # setxkbmap \ - -option caps:ctrl_modifier \ -option compose:ralt \ -option terminate:ctrl_alt_bksp \ & -- cgit v1.2.3