Sway: Capslock as control

Created on 12 May 2017  路  3Comments  路  Source: swaywm/sway

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?

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

sudo cp /usr/share/wayland-sessions/sway.desktop /usr/share/wayland-sessions/sway-custom.desktop

Change 'Exec' line to 'sway-custom'

[Desktop Entry]
Name=Sway (custom)
Comment=SirCmpwn's Wayland window manager
Exec=sway-custom
Type=Application

Create '/bin/sway-custom'

#!/bin/bash
export XKB_DEFAULT_OPTIONS=ctrl:nocaps,
sway
sudo chmod +x /bin/sway-custom

All 3 comments

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:

Copy default config

sudo cp /usr/share/wayland-sessions/sway.desktop /usr/share/wayland-sessions/sway-custom.desktop

Change 'Exec' line to 'sway-custom'

[Desktop Entry]
Name=Sway (custom)
Comment=SirCmpwn's Wayland window manager
Exec=sway-custom
Type=Application

Create '/bin/sway-custom'

#!/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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

J0nnyMak0 picture J0nnyMak0  路  3Comments

cauebs picture cauebs  路  3Comments

dnkl picture dnkl  路  4Comments

ddevault picture ddevault  路  3Comments

ddevault picture ddevault  路  4Comments