Open hucancode opened 2 years ago
I'm not a bit fan of adding keyboard input stuff into eww -- I'd think that it would make more sense to have a separate tool to just create temporary hotkey bindings, I'll probably start working on something like that soon-ish. about clicking outside of the window to close it: Not sure how trivial that is to do directly -- what some people have done is just create a separate, transparent widget in the background that fills the entire screen and closes the widgets when clicked -- that works pretty well.
Here's what I'm doing to have the "close on click outside" behaviour. It's exactly what Elk is describing.
(defwidget closer [window]
(eventbox :onclick "eww close ${window} && eww close ${window}-closer"))
(defwindow menu-closer
:monitor 0
:geometry (geometry :width "100%" :height "100%")
:stacking "fg"
:focusable false
(closer :window "menu"))
This accompanies my "menu" window, but I've made it modular enough that it could be used with other windows as well, given that the closer window is named XXX-closer
.
Abous your configuration syntax, while it might work with a :onlostfocus
property, keep in mind that not all windows you'd want to use this with are focusable. My global menu, for example, doesn't grab focus, and reacts to which window currently has focus.
Yeah I think my problem with clicking outside are solved.
About keyboard input, I'm using openbox
, it doesn't support adding new keyboard shortcut on the fly. For that I would need to create a new configuration set and reload when an eww window open, load the default config back when window close. I'm lazy I wouldn't do that lol. Using sxhkd
reduce the pain a little bit, but still, switching between 2, or 3, 4 configuration sets is not so elegant I think.
yea, that's why I'm saying, there should be some tool that would be explicitly made for such temporary keybinds, so you could just
tmpbindkey --once esc "eww close dashboard" &
which would just bind that keyboard shortcut for as long as that process is running, until it's hit once
that's what I'll probably be working on soon
What about focussing the next clickable element with tab?
What about focussing the next clickable element with tab?
I've implemented this
I just designed my first widget with eww as an "application launcher". Having the option to keyboard-only navigate menus through some sort of temporary keybinding system would be awesome.
@AlecsFerra, I don't see a PR for the changes you've made on tab navigation. Any chance you could make one we can get those into the latest release?
@AlecsFerra, I don't see a PR for the changes you've made on tab navigation. Any chance you could make one we can get those into the latest release?
Right now I don't have time, but you can try my fork at https://github.com/AlecsFerra/eww
Description of the requested feature
Hi elkowar, thanks for the tool, it's amazing. I am on my way to replace
polybar
androfi
witheww
and I am pretty succesful onpolybar
. Onrofi
I am able to bind ESC key to dismiss drun window, plus click outside of the window also close it. Press the triggering key again also does the job. Oneww
, I'm binding my key (super + x) toand I am able to open and close power menu with super + x.
Proposed configuration syntax
Additional context
No response