Remap caps key to function as left-side return key.
Find a file
2026-03-29 15:31:31 +02:00
caps-remap Fix 2026-03-28 04:21:46 +01:00
caps-remap-resume Fix for resume from suspend 2026-03-29 15:31:31 +02:00
install.sh Fix for resume from suspend 2026-03-29 15:31:31 +02:00
LICENSE init 2026-03-28 00:36:25 +01:00
README.md Fix for resume from suspend 2026-03-29 15:31:31 +02:00

caps-remap

Remap Caps Lock to Enter on Void Linux using setxkbmap.

Install

sudo ./install.sh

This installs:

  • caps-remap script to /usr/local/bin/
  • caps-remap-resume hook to /usr/libexec/elogind/system-sleep/ (fixes suspend/resume)
  • Adds setxkbmap line to ~/.xprofile for session persistence

Usage

caps-remap          # Apply the remap (default)
caps-remap apply    # Apply the remap
caps-remap remove   # Clear xkb option overrides
caps-remap status   # Check if the remap is active

How it works

Uses setxkbmap -option caps:enter to remap Caps Lock to Enter at the X keyboard level.

Persistence

  • X session start: The install script adds the command to ~/.xprofile, which is sourced by display managers (LightDM, etc.) and can be sourced from ~/.xinitrc for startx users.
  • Suspend/resume: An elogind sleep hook is installed to /usr/libexec/elogind/system-sleep/caps-remap-resume. This hook runs after waking from suspend and re-applies the keyboard mapping.

Requirements

  • setxkbmap (usually installed with X11)
  • elogind (for suspend/resume hook support)

Uninstall

sudo rm /usr/local/bin/caps-remap
sudo rm /usr/libexec/elogind/system-sleep/caps-remap-resume

Remove the # caps-remap block from ~/.xprofile.