You are not logged in.

#1 2022-06-04 16:43:33

greeenstone
Member
Registered: 2022-02-20
Posts: 7

Close dmenu if loses Focus or super-key is pressed

Hi everyone,

To hide Dmenu there seem to be two ways:
1. select an entry
2. Escape-key

Can one hide/close it on other events like:
3. Lose focus
4. Super/Alt key

I am using i3 and I was already thinking of writing myself a wrapper, but I don't know how to deal with X events.

Offline

#2 2022-06-04 21:17:23

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,573

Re: Close dmenu if loses Focus or super-key is pressed

dmenu grabs the input - rofi has a "-normal-window" switch that would allow this at least in theory.
"xdotool behave blur" and a smart enough wrapper for the super key shortcut should handle the rest.

Offline

#3 2022-06-05 14:59:21

qinohe
Member
From: Netherlands
Registered: 2012-06-20
Posts: 1,596

Re: Close dmenu if loses Focus or super-key is pressed

You showed one escape, there are 3: 'escape' 'Ctrl-c' & 'Ctrl-g'

You can have more if you use some patch like 'mouse-support'
Using this patch dmenu can be closed using the right-mouse button.

Still not enough, patch 'dmenu.c' to get 'Ctrl-q' to escape dmenu F.I.
Add a similar line like the next to the 'keypress' function and create a patch, etc...

case XK_q: ksym = XK_Escape;    break;

Offline

Board footer

Powered by FluxBB