I finally figured out how to have an application launcher with my usual Emacs completion keybindings:
This is with Icomplete. If you use another completion framework it will look different. Crucially, it’s what you are already used to using inside Emacs, with the same completion style (flex vs. orderless vs. …), bindings etc..
Here is my Sway binding:
bindsym p exec i3-dmenu-desktop \
--dmenu="dmenu_emacsclient 'Application: '", \
mode "default"
(for me this is inside a mode { }
block)
The dmenu_emacsclient script is
here.
It relies on the function spw/sway-completing-read
from my
init.el.
As usual, this code is available for your reuse under the terms of the GNU GPL. Please see the license and copyright information in the linked files.
You also probably want a for_window directive in your Sway config to enable floating the window, and perhaps to resize it. Enjoy having your Emacs completion bindings for application launching, too!