Focusing dmenu/rofi in another qube

I am building a script for changing bluetooth devices in my sys-audio qube and would like to key bind this up with my dom0 i3 configuration.

However I am running rofi in the sys-audio qube in order to select the bluetooth device but the problem with this is that I need to have my mouse focusing a sys-audio window in order for any input to be provided to rofi. This causes a problem because I will not usually be having such a window open and it’s very inconvenient.

An alternative solution is to pipe the output from sys-audio back to dom0 and running dmenu there. The obvious reason I don’t want to do this is that it seems pointlessly dangerous to pipe anything from sys-audio to dom0.

Does anyone have a solution for this? Is it perhaps possible to programmatically from dom0 to select a focus for a certain qube?

You might enjoy this little self-contained hack:

1 Like

Gracias, I will look over this!

I’ve looked into this and can’t figure out a way to make this work with rofi or dmenu I’ve tried using core.SetInputFocusChecked API with no luck.

If you remove the remap code you’ll get a “non-window” dmenu in the sense that hovering over the graphical part will not focus any new window.

I’ve tried running the following code but it will not let me enter anything into dmenu without also switching to a window for the used qube.
qvm-run a-qube "echo hi | dmenu -i"

Ideally there is also a solution that allows a program to open dmenu or rofi several times and have the focus work throughout.

It’s used as a wrapper, so wherever there’s dmenu in a pipeline (looks like it’s not compatible with rofi) you’d use x11-unoverride-redirect dmenu instead like:

qvm-run a-qube "echo hi | x11-unoverride-redirect dmenu -i"

To also set the window title:

qvm-run a-qube "echo hi | _NET_WM_NAME='A New Title' x11-unoverride-redirect dmenu -i"
1 Like

Ah wow, it works great. I assumed you had to manage the windows from dom0 in order to handle focus capture. Running it in my sys-audio qube seems to work great. Thanks! :slight_smile: