Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sway input method #54

Open
whoizit opened this issue May 3, 2023 · 2 comments
Open

sway input method #54

whoizit opened this issue May 3, 2023 · 2 comments

Comments

@whoizit
Copy link

whoizit commented May 3, 2023

https://github.com/swaywm/sway

this configuration works for me on Sway:

  "vim.autoSwitchInputMethod.defaultIM": "0",
  "vim.autoSwitchInputMethod.obtainIMCmd": "/home/user/.config/sway/get-im.sh",
  "vim.autoSwitchInputMethod.switchIMCmd": "/home/user/.config/sway/set-im.sh {im}",
  "vim.autoSwitchInputMethod.enable": true,
 ❯ cat ~/.config/sway/get-im.sh
#!/bin/sh
source $(dirname "$0")/.env
swaymsg -t get_inputs | jq -r "[.[] | select(.identifier == \"$KEYBOARD\")][0] | .xkb_active_layout_index"
 ❯ cat ~/.config/sway/set-im.sh
#!/bin/sh
source $(dirname "$0")/.env
swaymsg input "$KEYBOARD" xkb_switch_layout "$1"
 ❯ cat ~/.config/sway/.env
# swaymsg -t get_inputs  
KEYBOARD='6700:8484:SEM_USB_Keyboard'
@daipeihust
Copy link
Owner

What is sway?

@daipeihust
Copy link
Owner

Add it to README?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants