I have been working on getting a new Debian (Stretch) install working satisfactorily on my new computer (Lenovo X270), including setting up xmonad/xmobar. Since I am studying Japanese, I wanted to set up an IME, which I managed to do using fcitx/fcitx-mozc. However, I wanted to include a plugin in my xmobar setup that indicates whether the current input method (according to fcitx) is japanese or not. The Kbd plugin doesn't seem to do this, since fcitx doesn't directly interface with XKB (as far as I can tell), so it shows "us" all the time. I also haven't been able to find out any way of querying the current fcitx IM from a terminal. Is there any way to do this (as if this is possible, I might be able to hack together an xmobar indicator), or is it far more trouble than it is worth?

[For the record, I tried setting up ibus, but I had trouble with it, so I switched over to fcitx.]

If necessary, I am more than happy to provide more details about my setup.

2 Answers 2


Hint: you can query DBus, e.g. by qdbus console tool, so:

$ qdbus "org.fcitx.Fcitx" "/inputmethod" "GetCurrentIM"

Another approach with xkb-switch: xkb-switch -p

  • This is really helpful. My only followup is, is there a clean way of integrating this into an xmobar config so that it doesn't constantly update when the state remains the same, but also doesn't lag behind when the method is switched? Aug 25, 2017 at 5:19

I'm not sure if this will help with xmobar, but you can follow changes in the CurrentIM property by monitoring at the output of

gdbus monitor -e -d org.fcitx.Fcitx

Unfortunately this doesn't seem to tell the new value; the lines I get are just:

/inputmethod: org.freedesktop.DBus.Properties.PropertiesChanged ('org.fcitx.Fcitx.InputMethod', @a{sv} {}, ['CurrentIM'])

but every time you see a line like that you can query the state either using the qdbus command in the accepted answer or using gdbus like this:

gdbus call -e -d org.fcitx.Fcitx -o "/inputmethod" -m "org.fcitx.Fcitx.InputMethod.GetCurrentIM"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.