Keyboard layout switcher for sway windows
Project description
sway-xkb-switcher
Description
sway-xkb-switcher records keyboard layout for a sway windows when you leave them. And when you come back it is restore keyboard layout.
This project is forked from https://github.com/inn0kenty/i3-xkb-switcher and adapted to work with sway window manager.
There is also helper switcher for emacs.
On layout switch event emacs-sway-xkb tool checks if focused window is emacs window. In case of emacs window it switches emacs input method.
In case of non-emacs window, emacs-sway-xkb switches wayland keyboard layout.
NOTE: emacs-sway-xkb is able to only detect emacs native window. If you open emacs frame in terminal, it will not detect it.
Install
$ pip install sway-xkb-switcher
Also you can download compiled binary from release page.
Usage
sway-xkb-switcher
$ sway-xkb-switcher --input-identifier <identifier>
You can view a list of actual identifiers by looking at
$ swaymsg -t get_inputs | grep identifier
The identifier corresponds to that from the input section of your sway config.
To enable debug mode run with --debug
key.
By default it writes logs to stdout. You can specify path by --log-path
option.
emacs-sway-xkb
If you are using emacs you can keep emacs with its own state of input method.
Bind some key to switch keyboard layout and completely disable xkb native switching option in your sway config file.
input "1:1:AT_Translated_Set_2_keyboard" {
xkb_layout us,ru
# xkb_options grp:alts_toggle,shift:both_capslock
}
bindsym --to-code $mod+n exec emacs-sway-xkb
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for sway_xkb_switcher-0.2.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cd26cb8095f8219598058d0504fbfb4ee691a00d36bd8359d205d1d84c3fc20c |
|
MD5 | ba41dcabe51526a27ee0269cc10f7ba0 |
|
BLAKE2b-256 | 1857b74d7dc748dc896513e3ce73770c9b150f693972dc09b16ae0ebcd5a19d8 |