i3status-rust icon indicating copy to clipboard operation
i3status-rust copied to clipboard

Keyboard block doesn't catch layout changes

Open cfsmp3 opened this issue 3 years ago • 6 comments

For me, at least.

dbus-monitor shows this event for me - totally different info:

signal time=1642201033.914655 sender=:1.85 -> destination=(null destination) serial=1073 path=/org/freedesktop/portal/desktop; interface=org.freedesktop.impl.portal.Settings; member=SettingChanged
   string "org.gnome.desktop.input-sources"
   string "mru-sources"
   variant       array [
         struct {
            string "xkb"
            string "es"
         }
         struct {
            string "xkb"
            string "us"
         }
      ]
signal time=1642201033.914770 sender=:1.84 -> destination=(null destination) serial=4586 path=/org/freedesktop/portal/desktop; interface=org.freedesktop.portal.Settings; member=SettingChanged
   string "org.gnome.desktop.input-sources"
   string "mru-sources"
   variant       array [
         struct {
            string "xkb"
            string "es"
         }
         struct {
            string "xkb"
            string "us"
         }
      ]

cfsmp3 avatar Jan 14 '22 23:01 cfsmp3

Do you use sway or i3? Which driver have you set in your config? How do you change your layout?

MaxVerevkin avatar Jan 15 '22 10:01 MaxVerevkin

Do you use sway or i3? Which driver have you set in your config? How do you change your layout?

i3

  • kbddbus doesn't work ("is kbdddaemon bus running?")
  • localebus -> Doesn't work (that path just doesn't get updated)

I haven't tried the other two as polling here is out of the question :-)

I change the layout by pressing Super + Alt + Backspace , I haven't looked into what that triggers (I was just casually looking into this block)

cfsmp3 avatar Jan 15 '22 11:01 cfsmp3

kbddbus doesn't work ("is kbdddaemon bus running?")

So, do you run https://github.com/qnikst/kbdd?

MaxVerevkin avatar Jan 15 '22 11:01 MaxVerevkin

kbddbus doesn't work ("is kbdddaemon bus running?")

So, do you run https://github.com/qnikst/kbdd?

No, I don't need to have per-window setting. I was just mentioning that I tried the driver, I didn't expect it to work :-)

BTW I tried

setxkbmap us

And it doesn't seem to trigger any D-Bus notification (I might be filtering wrong).

cfsmp3 avatar Jan 15 '22 11:01 cfsmp3

AFAIK there is no standard way to monitor kbd layout on X11.

I imagine you can create a script that somehow toggles the layout and sends a signal to i3status-rs to update. In this case you can use setxkbmap driver with a large interval.

However signal support for keyboard_layout is not implemented yet. It shouldn't be hard to implement signal option support generically for all the blocks (analogous to on_click). (You can send SIGUSR1 but it will update every block.)

MaxVerevkin avatar Jan 15 '22 12:01 MaxVerevkin

It shouldn't be hard to implement signal option support generically for all the blocks

Well, that was a lie :) Anyway, implemented in https://github.com/greshake/i3status-rust/commit/f0431aea84b465c98f3b14caa1f4a85fa88eb316.

MaxVerevkin avatar Apr 26 '22 16:04 MaxVerevkin