JakeStanger / ironbar

Customisable Wayland gtk bar written in Rust.
https://crates.io/crates/ironbar
MIT License
600 stars 52 forks source link

Language/keyboard layout module #575

Open madfanat opened 5 months ago

madfanat commented 5 months ago

Request It would be great to have a built-in module similar to Waybar’s "sway/language" or "hyprland/language".

JakeStanger commented 5 months ago

Could you expand on the request please, as I don't have the context on what Waybar's module does, or what you potentially want this one to do differently?

madfanat commented 5 months ago

Well, shortly, the main feature of both these modules is the display of the current keyboard layout/language (qwerty, dvorak, ENG, RUS, etc whatever you want). Also, it’s nice to have a popup box with these settings.

yavko commented 5 months ago

Well, shortly, the main feature of both these modules is the display of the current keyboard layout/language (qwerty, dvorak, ENG, RUS, etc whatever you want). Also, it’s nice to have a popup box with these settings.

For hyprland I think the layoutchanged event in hyprland-rs can be used, but I'm not totally sure

JakeStanger commented 5 months ago

Is there any standardised protocol/service this should be using, or is it down to the compositor to expose over its IPC?

yavko commented 5 months ago

I'm pretty sure it's compositor specific

bluebyt commented 5 months ago

I tried to do a script for Ironbar to do that, I can change the current layout with this command:

hyprctl switchxkblayout logitech-craft next

But I cannot get the current layout like explained in this tread: https://github.com/hyprwm/Hyprland/discussions/2616