Sway: Allow setting keyboard layout in config file

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

Currently the only way to change the keyboard layout to anything other than English US is to set an environment variable before launching sway. For users with display managers, this is more complex since they have to create a new script and desktop file to have a session entry with their language appear.

To me this seems like a lot of extra initial setup for something simple on other DEs. Where users could instead be getting acquainted with sway keyboard shortcuts, features, etc. they are instead stuck reading wiki pages, as was my experience.

From what I understand display managers are not directly supported, and the preferred method is to launch sway manually (with the xkb environment variable). Unfortunately this excludes a large number of users, e.g. who have display managers preinstalled, or who have a multi user setup which is easier just to use a DM

Most helpful comment

@marcoms perhaps.

All 3 comments

Most display managers allow you to edit how a window manager is spawned. It's quite easy to change the relevant line to

export XKB_DEFAULT_LAYOUT=dvorak; sway

E.g, that's what I did for Way Cooler before I went DE-less.

Another alternative is to simply put it in your .bashrc, which is what I have opted to do.

Right now the way wlc is set up this is difficult to change, but might be easier in the future with wlroots.

Thanks for the suggestions. It would be better for users I think to have a configuration option as a single source of truth, but if there are technical limitations at the moment then that makes sense.

@sircmpwn could something like this be considered after migrating to wlroots?

@marcoms perhaps.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

WhyNotHugo picture WhyNotHugo  路  3Comments

Alphare picture Alphare  路  3Comments

StephenBrown2 picture StephenBrown2  路  4Comments

emersion picture emersion  路  4Comments

Olie440 picture Olie440  路  4Comments