-
Notifications
You must be signed in to change notification settings - Fork 470
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
Layout block doesn't show the current active layout properly when running under Sway #404
Comments
I am also seeing wrong output in the
And |
Can you provide the output of |
This is the output of
|
I've found a workaround using custom block which its command executes this script, where
Credit: This solution is posted by @jeremejevs at Alexays/Waybar#85 (comment) |
The output is
and the output is the same independent of which layout is currently active.
|
Sway seems to respond to If this is not a bug, we may need to add a new |
I noticed that I had old X11 configuration in And
|
Another datapoint: swaylock recognizes the correct keyboard layout when in the lock screen. It uses xkbcommon for that. |
There appears to be an xkbcommon crate, but it's not clear how to retrieve the current layout or listen for changes from the docs. If anyone is willing to take this on I'd happily accept a PR. |
While digging this issue, I found a post describing this issue best. |
By the way, swaylock seems understand current keyboard layout only after you start typing in it, not when it actually changes. |
sway 1.2 provides a way to subscribe to input change event
now when you change the layout, you get notified To get the active layout:
|
It may be possible to use the |
Unfortunately it doesn't support sway's get_inputs or input events and the maintainer has been AWOL for over 6 months. |
And what about https://github.com/leshow/tokio-i3ipc ? UPD: meh, it similarly doesn't have required |
There's a sway one but might not be backwards compatible with i3. On mobile atm |
https://github.com/JayceFayne/swayipc-rs/blob/master/src/socket.rs If only this was updated to check for I3SOCK as well, then I think it could be used for i3 as well since sway is meant to be backwards compatible wrt the JSON protocol. |
I guess we could just call swaymsg ourselves |
@vvrein I wanted to see if we could replace i3ipc-rs that we use for the focused_window block with swayipc-rs, so I monkey patched swayipc-rs to read I3SOCK and swayipc-rs seemed to work fine on i3. So we can make this happen like this:
Related: Switching to swayipc-rs will probably make #532 happen too since i3ipc-rs doesn't look like it will be updated anytime soon |
I'm using Sway and I have two keyboard layouts which I switch between. The keyboard layout block always shows first (EN) layout even when the current active layout is switched to the secondary layout.
The text was updated successfully, but these errors were encountered: