swaywm / sway

i3-compatible Wayland compositor
https://swaywm.org
MIT License
14.41k stars 1.1k forks source link

Keyboard switching #532

Closed ghost closed 8 years ago

ghost commented 8 years ago

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.

progandy commented 8 years ago

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
ghost commented 8 years ago

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.

kigerpunk commented 8 years ago

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

ghost commented 8 years ago

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.

riquito commented 7 years ago

@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

cafehaine commented 7 years ago

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

riquito commented 7 years ago

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

knezi commented 7 years ago

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?

ddevault commented 7 years ago

No, that's not presently possible.

knezi commented 7 years ago

Should I fill feature request?

ddevault commented 7 years ago

No. It should be possible when wlroots is complete.