eww icon indicating copy to clipboard operation
eww copied to clipboard

[FEATURE] Auto-focus for input widget

Open patri9ck opened this issue 6 months ago • 2 comments

Description of the requested feature

Many people including me use eww to create an app launcher. Those app launchers use an input widget to search through the desktop files. An auto-focus option for the input widget would be useful to automatically set keyboard focus to it as soon as its get visible so you can start typing right after opening the launcher instead of having to first click on the input widget to focus it.

Proposed configuration syntax

:auto-focus true

Additional context

No response

patri9ck avatar Dec 06 '23 16:12 patri9ck

You can achieve this feature by setting :focusable true in wayland or :windowtype "dialog" in x11, ej:

(defwindow launcher
  :monitor 0
  :stacking "fg"
  ;;;; this for x11
  :windowtype "dialog"
  ;;;; or this for wayland
  :focusable true
  :geometry (geometry
    :width "430px"
    :height "600px"
    :anchor "center"
  )
  (app_launcher)
)


and then using a keybing to open/close the launcher, ej in hyprland:

bind = $mainMod, R, exec, eww open launcher --toggle

T0kyoB0y avatar Dec 10 '23 01:12 T0kyoB0y

I'm already using :windowtype: dialog on X11 and :focusable true also didn't work on Wayland when I tested it. I still have to click the input field first to focus it. I use bspwm on X11 and tested it with Hyprland on Wayland. This is my config, the window is called apps.

patri9ck avatar Dec 10 '23 13:12 patri9ck