This project is an attempt to create a launcher, that behaves decently on sway, but also on i3 window manager. It may also be used in some floating WMs, but I only use Openbox, and don't test it elsewhere.
sgtk-menu uses pygobject
to create a themeable, searchable, gtk3-based system menu w/ some optional features:
.desktop
entries-based system menu;- search box to find what you need quickly;
- favourites (most frequently used entries) menu above (optional
[-f | -fn FN]
argument); - user-defined menu below (optional
[-a | -af AF]
argument); sgtk-bar
command: user-defined horizontal or vertical button bar;sgtk-dmenu
command: search and run commands in$PATH
.
Read wiki for more information. See screenshots for usage examples.
The menu in Adwaita-dark GTK theme w/ Aqatix icons
Well, I didn't even think that sway needed a menu, being happy with wofi and dmenu-wayland. I started coding just to find out what the Desktop Menu Specification looks like, and also to learn some more pygobject. The best menu I know, however, does not (yet?) behave well on sway. So, I thought to share the code, which has already taken me more time that I had ever expected.
This code by
Johan Malm helped me understand how to make use of .desktop
entries. Many thanks!
The problem to resolve is, that the Gtk.Menu class behaves differently / unexpectedly when open over Wayland and X11 windows. To work it around, the script opens the menu over a (semi-)transparent, floating window, that covers all the screen.
Even if there exist plenty of good X11 menus, with the most excellent jgmenu on top, I'm doing my best to make sgtk-menu i3-compatible. It's also possible to use sgtk-menu in some floating window managers, e.g. to replace the Openbox / Fluxbox menu. See wiki/Launching for details.
- On next sway / GTK release, check if the overflowed menus issue on sway is fixed; remove 50 SLOC long workaround if so.