Fancy dynamic menu for X11 and Wayland, compatible with dmenu!
Go to file
2023-05-17 18:57:51 +02:00
docs update documentation 2023-05-17 08:15:21 +02:00
libs some minor changes to spmenu_imageviewer and remove additional line when 2023-05-16 22:06:24 +02:00
scripts remove opt variable, it makes no sense 2023-05-17 08:17:04 +02:00
themes allow rofi like "next" colors 2023-05-13 16:07:29 +02:00
.gitignore deprecate build.sh script 2023-05-13 21:27:12 +02:00
code.html bump version to 1.1.2, fixed arch package 2023-05-12 14:33:19 +02:00
keybinds.h add support for marking items (ie. multi selection) 2023-05-16 18:54:26 +02:00
LICENSE use my newer email in the LICENSE 2023-05-17 18:57:51 +02:00
meson.build remove opt variable, it makes no sense 2023-05-17 08:17:04 +02:00
meson.options remove opt variable, it makes no sense 2023-05-17 08:17:04 +02:00
mouse.h add LICENSE notice to all code 2023-05-14 00:21:16 +02:00
options.h fix horrible default colors 2023-05-16 21:36:45 +02:00
PKGBUILD pandoc is not required to make spmenu anymore 2023-05-14 00:14:23 +02:00
README.html update documentation 2023-05-17 08:15:21 +02:00
README.md deprecate build.sh script 2023-05-13 21:27:12 +02:00
spmenu.1 update documentation 2023-05-17 08:15:21 +02:00
spmenu.c display number of selected items as well, run subshell in the background 2023-05-16 21:16:51 +02:00
spmenu.html update documentation 2023-05-17 08:15:21 +02:00
spmenu_run.1 update documentation 2023-05-17 08:15:21 +02:00

spmenu logo{ width=25% }

spmenu

What is spmenu?

spmenu is an X11 menu application which takes standard input, parses it, and lets the user choose an option and sends the selected option to standard output.

In addition to this, it also serves as a run launcher through the included shell script spmenu_run, which handles both $PATH listing, .desktop entries and file listing.

While spmenu is based on dmenu, and is also fully compatible with dmenu, spmenu introduces many new features which can be useful in shell scripting. There are way too many to list, but spmenu has a wiki which goes through features in more detail.

Dependencies

  • libX11
    • If you're using macOS, XQuartz is a dependency instead.
    • If you're using Wayland, xorg-xwayland is a dependency.
  • libXrender
  • freetype
  • imlib2
    • Used for image support, can be disabled during compile time.
  • libXinerama
    • Used for multi-monitor support, can be disabled during compile time.
  • OpenSSL
    • Used to calculate MD5 of images if image support is enabled, can be disabled during compile time.
  • Pango
    • Can be disabled if you don't want/need Pango markup during compile time.
  • libconfig
    • Can be disabled if you don't want/need config file support during compile time.
  • meson
    • Used to compile spmenu, not optional unless you're experienced with build systems.

Installation

  • If you're using macOS you may want to consider looking at this wiki artic le for more information.

  • If you are on Arch GNU/Linux, you can add my repository which includes spmenu as well as other useful packages. Then simply pacman -S spmenu.

  • Or if you are on Gentoo GNU/Linux, you can add my overlay which includes x11-misc/spmenu as well as other useful packages. Then simply emerge spmenu.

If you still need/want to manually compile, follow along with manual compilation.

Here we're manually compiling spmenu. This is likely what you'll want to do if you're using any distribution but Arch or Gentoo.

Git is required to clone the repository, but you can also use releases. Those can be unpacked using tar -xpvf /path/to/spmenu-version.tar.gz.

To install Git:

  • Gentoo: emerge dev-vcs/git

  • Arch: pacman -S git

  • Debian: apt-get install git

You will also need the dependencies for spmenu. You'll have to find those packages in your distribution repositories.

To clone the repository using Git:

git clone https://git.speedie.site/spmenu

cd spmenu/

Configure the build by running these commands:

mkdir -p build/ # Create a build/ directory, Meson will use this as the working directory

meson setup build # This will check to make sure all dependencies are found. If you're recompiling you may want to pass --reconfigure as an argument

Now, to build it run ninja -C build. If all went well you should have a binary in the build/ directory.

Finally, to install it all, run:

meson install -C build --destdir /usr # /usr may be overriden to /usr/local or anything else if you use macOS or simply want another destination directory

To generate documentation, which may be necessary if you're pushing new changes to your Git repository, run scripts/make/generate-docs.sh in the current directory.

To generate a tarball, run scripts/make/generate-pkg.sh in the current directory. If you want to generate a Pacman package, run scripts/make/generate-pacman-pkg.sh instead.

See this wiki article for more information.

TODO

Pull requests would be greatly appreciated for any of these issues!

General

  • Image support: Stop using OpenSSL for caching images, mostly because MD5() is deprecated as of OpenSSL 3.0, but this would also make it very easy to have LibreSSL compatibility.
  • Image support: Ability to display icons, similar to rofi
  • Text drawing: Use cairo for text drawing over Xft.
  • Lines: Rofi-like newlines in the same entry
    • Just need to XMoveResizeWindow() as well as mh += bh and y += bh for each added line.
  • Matching: Add support for contextual completions similar to xprompt
  • Matching: Regex matching
    • Probably use some minimal public domain library for this, I'd like to avoid adding more external dependencies unless it's a common dependency most people already have.

Unlikely, but maybe at some point in the distant future

  • X11: Move from Xlib to libXcb
  • Wayland: Wayland support, but only if it doesn't require writing any extra code which as of now seems unlikely, or if someone makes a patch.
    • Before this can even be done, replace Xft with cairo, deal with keybinds in some Wayland compatible way, remove .Xresources usage and figure out a way to preserve X11 compatibility as I do not want to use Wayland as of now.
    • You can just use XWayland anyway if you happen to use Wayland, so it's not like you will be unable to use spmenu in its current state.

Bugs

None discovered yet! :)

Scripts

There's a page dedicated to user scripts over on the wiki. Feel free to contribute and try scripts on there.

More information

See the included man page.

License

spmenu is licensed under the MIT license. See the included LICENSE file for more information!

Wiki

spmenu has a wiki for more extensive documentation. Contributions to the wiki are appreciated!