My new laptop has a copilot key instead of a right ctrl key. When you press the copilot key it emits left shift + left Windows key + F23. I wanted to map that back to ctrl in Ubuntu 24.04. Here’s how I did it:
# Step 1 - change perms & groups for /usr/local/srcsudo groupadd --users=MYUSER usr-local-src# Reboot to pick up group changes, then...groups # Verify I'm in the new groupsudo chgrp usr-local-src /usr/local/srcsudo chmod g+w /usr/local/srccd /usr/local/src# Step 2 - Build keyd from sourcegit clone https://github.com/rvaiya/keydcd keydmake && sudo make installsudo systemctl enable --now keyd# Step 3 - configure keydcat <<- EOF | sudo tee -a /etc/keyd/default.conf &> /dev/null[ids]*[main]# Maps copilot keyleftshift+leftmeta+f23 = rightcontrolEOFsudo keyd reload
References:
- https://github.com/rvaiya/keyd
- Thanks to Tom Anderson and bennofs for explaining a command line way to create a here doc as sudo.