From cd15a1e143f053632901c084675dffa92f5d5bce Mon Sep 17 00:00:00 2001 From: Thomas Vanbesien Date: Mon, 15 Jun 2026 16:14:22 +0200 Subject: misc: bind capslock → esc/ctrl, leftctrl → compose, and more MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .config/keyd/default.conf | 21 +++++++++++++++++++++ .config/kxkbrc | 3 +++ .local/bin/dotfiles | 18 +++++++++++++++++- 3 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 .config/keyd/default.conf create mode 100644 .config/kxkbrc diff --git a/.config/keyd/default.conf b/.config/keyd/default.conf new file mode 100644 index 0000000..3c841d9 --- /dev/null +++ b/.config/keyd/default.conf @@ -0,0 +1,21 @@ +# Apply config to all keyboards +[ids] +* + +# Tap CapsLock for Escape, hold it for Control. +# +# Right control is mapped to the compose key: +# - leftcontrol is bound to emit altgr (rightalt) +# - rightalt is bound to the compose key (in KDE shortcuts) +# This works well since I don't use altgr/rightalt +[main] +capslock = overload(control, esc) +leftcontrol = layer(altgr) + +# CTRL+M Enter +# CTRL+; Delete +# CTRL+H Backspace +[control] +m = enter +; = delete +h = backspace diff --git a/.config/kxkbrc b/.config/kxkbrc new file mode 100644 index 0000000..c83ebbd --- /dev/null +++ b/.config/kxkbrc @@ -0,0 +1,3 @@ +[Layout] +Options=compose:ralt +ResetOldOptions=true diff --git a/.local/bin/dotfiles b/.local/bin/dotfiles index 9e6bff3..1868358 100755 --- a/.local/bin/dotfiles +++ b/.local/bin/dotfiles @@ -5,7 +5,7 @@ declare NVIM_SRC_DIR="$HOME/.local/share/dotfiles/deps/neovim" declare NVIM_BUILD_DIR="$HOME/.local/share/nvim" declare -a PACKAGES_YAY=(7zip atool base-devel bash bash-completion bash-language-server bat browserpass browserpass-firefox bzip2 cmake cpio - ctags docker docker-buildx fd firefox foot fzf git glib2 gzip lhasa + ctags docker docker-buildx fd firefox foot fzf git glib2 gzip keyd lhasa lua-language-server lzop marksman ninja pass pigz python-black ranger ripgrep shfmt stylua tar texinfo tig tk tmux tree-sitter-cli unrar unzip vim-language-server wl-clipboard xz yay zip) @@ -179,6 +179,20 @@ _sync_vpn() { _sync_protonvpn } +################################################################################ +# keyd ######################################################################### +################################################################################ + +_install_keyd() { + local src="$HOME/.config/keyd/default.conf" dst=/etc/keyd/default.conf + if [[ ! -f "$dst" ]] || ! cmp --quiet "$src" "$dst"; then + sudo install -D --mode 644 "$src" "$dst" + sudo keyd check + systemctl is-active --quiet keyd && sudo keyd reload + fi + systemctl is-active --quiet keyd || sudo systemctl enable --now keyd +} + ################################################################################ # main() ####################################################################### ################################################################################ @@ -211,6 +225,8 @@ _sync_all() { _sync_nvim echo "Syncing Proton VPN…" _sync_vpn + echo "Installing keyd…" + _install_keyd } main() { -- cgit v1.3.1