Sway: Keyboard switching

Created on 22 Mar 2016  路  11Comments  路  Source: swaywm/sway

language
I run all this commands in console, but i can switch keyboard language yet.
In i3 I use setxkbmap like this setxkbmap -model logitechdinovoedge -layout us,ru -option grp:alt_shift_toggle
What I doing wrong? Which is difference with setxkbmap and XKB.Please help me. I have been registered in Github for this.

Most helpful comment

export XKB_DEFAULT_LAYOUT=de,us
export XKB_DEFAULT_OPTIONS=grp:alt_shift_toggle
sway

then press alt and shift to switch layouts

There is now way to do it programmatically

All 11 comments

You have to set the xbk definitions before starting sway. The following settings work for me.

export XKB_DEFAULT_LAYOUT=de,us
export XKB_DEFAULT_OPTIONS=grp:alt_shift_toggle
sway

Thank you. 小锌邪褋懈斜芯.
I wrote alias in my zshrc
alias swaywm='export XKB_DEFAULT_LAYOUT=ru,us && export XKB_DEFAULT_OPTION=grp:alt_shift_toggle && sway -d 2> ~/sway.log'
Please write me if I doing something wrong again.

@VasilPupkin Sorry that this is off-topic, but are Rennaissance waifus a thing?

Sorry, I dont check my git acc yet. I dont understand what mean "Rennaissance", because聽 im from Russia and I learn english now in school. I just choose arch-tan picture for wallpaper. If you want to know my favorite anime girl is Azusa from K-ON, lol.

@cafehaine thanks for redirecting me here but it doesn't seem to help with my problem.
I cannot understand how to change the keyboard layout from inside a running sway (I usually change keyboard layouts to write in different languages to different people. Killing and restarting sway is not exactly the solution I was hoping for). If it isn't supported I'll open a feature request

export XKB_DEFAULT_LAYOUT=de,us
export XKB_DEFAULT_OPTIONS=grp:alt_shift_toggle
sway

then press alt and shift to switch layouts

There is now way to do it programmatically

My brain started working again, it's indeed a solution and I don't really need to do it programmatically. Thank you very much

Hi to all,
this option for switching layouts is not applicable to my use case. I use the following two layouts:

setxkbmap cz-prog,cz-moje -variant ,ucw -option grp:caps_switch

setxkbmap us,cz-moje -variant ,ucw -option grp:caps_switch

between which I toggle with a small bash script. I can't use Alt+Shift to toggle between them, because it uses capslock as a switch between the variants. The question is if there is any way to switch between these two without the need of restarting sway?

No, that's not presently possible.

Should I fill feature request?

No. It should be possible when wlroots is complete.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

emersion picture emersion  路  4Comments

ddevault picture ddevault  路  3Comments

DpoBoceka picture DpoBoceka  路  4Comments

RyanDwyer picture RyanDwyer  路  3Comments

J0nnyMak0 picture J0nnyMak0  路  3Comments