onagre-launcher / onagre

A general purpose application launcher for X and wayland inspired by rofi/wofi and alfred
MIT License
511 stars 27 forks source link

Add configuration option to disable "close on focus" #49

Closed jam1garner closed 2 years ago

jam1garner commented 2 years ago

Is your feature request related to a problem? Please describe.

I use i3 as my window manager which uses changes focus on hover, so the "close on change focus" feature results in closing if the cursor doesn't remain over Onagre.

Describe the solution you'd like

An option in the configuration file for disabling this behavior. (I would add/PR it, but it appears the current version has removed the non-theme configuration file, best I can tell).

(Sidenote that is far less important and I can't justify making a unique issue for: the window includes the window manager window type hint of _NET_WM_WINDOW_TYPE_NORMAL, while a type of dock/popup/dialog might be more appropriate. Best I can tell, iced doesn't expose the ability to configure this yes, while winit does, so it would likely have to wait unless you want to handle window creation and the event loop manually (which I think Iced does support, but is likely more effort than it's worth). I can make an issue for this if you'd like one just for keeping track, the only reason I noticed is because I needed to add a shadow-exclude rule to my compositor since the blanket rules by window hints weren't applicable)

oknozor commented 2 years ago

I use i3 as my window manager which uses changes focus on hover, so the "close on change focus" feature results in closing if the cursor doesn't remain over Onagre.

This is already implemented in the 'next' branch which will eventually turn into the first beta release. It's not ready yet, there are a lot of ongoing changes there, if you feel adventurous you can try it but the configuration format has dramatically changed.

I will try to push a config example today so you can try it out.

so it would likely have to wait unless you want to handle window creation and the event loop manually

I'd rather wait for it indeed. I'll try to build with the PR you mentioned and talk to the iced folk to see what's keeping this from being merged.

I needed to add a shadow-exclude rule to my compositor since the blanket rules by window hints weren't applicable

Which compositor are you using ? The WM class is now set to "onagre" on the next branch. This works for me on picom :

shadow-exclude = [
  "class_g = 'onagre' && argb",
];
oknozor commented 2 years ago

Here is the config example for the next version : https://github.com/oknozor/onagre/blob/next/config.example-ugly.scss

To try the this version : cargo install --git https://github.com/oknozor/onagre --branch next

I could really use some help to spot bugs here, so if you try it please give me some feedback.

If you notice onagre is falling back to the default theme, run it in a terminal, you should get a human readable error explaining what went wrong.

jam1garner commented 2 years ago

I actually ended up with that same picom rule independently :P and I'll try to switch to the next branch when I get off work and will certainly report any issues I hit.

oknozor commented 2 years ago

Thanks, it's now on the main branch and I am mainly working on stabilizing icon lookup and theming for now.
Let me know how it goes for you, there are a few theme examples here : https://github.com/oknozor/onagre/tree/main/docs/theme_examples.

jam1garner commented 2 years ago

I gave it a shot, works great, closing the issue but will let you know what other snags (if any) I hit

I've been using it for roughly a day without issue, and it also seems to have fixed another issue (knock on wood) I was trying to track down where sometimes it would immediately close without any stdout/stderr output (and possibly launching vim? I think? but I wouldn't be able to tell) which I at first thought was just it being too eager to process keypresses on launch but I am less certain of the cause now. Regardless, I haven't hit it since switching and hopefully it's gone for good, as it was one of the bigger pain points now that I'm using it as my daily driver