In X11 window managers I can use setxkbmap -option ctrl:nocaps to make the capslock key function as a control key. How can I accomplish the same with Sway?
Please read the FAQ.
@SirCmpwn Thanks. I fixed it as soon as I posted the issue (funny how that seems to happen sometimes). For future reference in case anyone stumbles upon this, I solved my issue as follows:
sudo cp /usr/share/wayland-sessions/sway.desktop /usr/share/wayland-sessions/sway-custom.desktop
[Desktop Entry]
Name=Sway (custom)
Comment=SirCmpwn's Wayland window manager
Exec=sway-custom
Type=Application
#!/bin/bash
export XKB_DEFAULT_OPTIONS=ctrl:nocaps,
sway
sudo chmod +x /bin/sway-custom
For future reference, I think the right way to do it is mentioned in docs now: https://github.com/swaywm/sway/wiki#keyboard-layout
Most helpful comment
@SirCmpwn Thanks. I fixed it as soon as I posted the issue (funny how that seems to happen sometimes). For future reference in case anyone stumbles upon this, I solved my issue as follows:
Copy default config
Change 'Exec' line to 'sway-custom'
Create '/bin/sway-custom'