title: Detect status of an input caret under any or most Linux DE's?
body: <p>So I have come up with this solution for Gnome 3 w/ ibus, but I need something that also works under KDE and XFCE or not be DE dependent at all. I just need to know if a text field is currently waiting for input and this is the solution that currently works under Ubuntu 19.10.</p>
  
  <p>I just need to make it more cross compatible with other DE's.</p>
  
  <pre><code>IBUSADD=$(cat ~/.config/ibus/bus/`ls ~/.config/ibus/bus -1rt | tail -n1` | awk -F'IBUS_ADDRESS=' '{print $2}' | xargs)
  
  dbus-monitor --address $IBUSADD "path='/org/freedesktop/IBus/Panel/Extension/Emoji',interface='org.freedesktop.IBus.Panel',member='FocusOut'"
  </code></pre>
  
  <p>If ibus needs to be installed then this is what I install, but under GalliumOS (xfce) I still don't have access to the org.freedesktop.ibus.panel location. I need to find another way.</p>
  
  <pre><code># Actually ibus-mozc ibus-anthy installs japanese support - 
  # may not need to do that just to run ibus-setup.. 
  # unless it brings in missing dependencies for ibus-setup?
  sudo apt-get install ibus-mozc ibus-anthy
  ibus-setup
  </code></pre>
  
  <p>I'd also be more than happy to see any solutions written in C, but a bash or scripting language solution will work just fine as that is what I currently have.</p>