2023-01-20 23:17:30 +01:00
|
|
|
# spmenu
|
2023-03-31 18:01:57 +02:00
|
|
|
|
2023-04-02 20:12:21 +02:00
|
|
|
![image](docs/preview.png)
|
2023-01-20 23:17:30 +01:00
|
|
|
|
2023-03-31 18:01:57 +02:00
|
|
|
## What is spmenu?
|
2023-01-20 23:17:30 +01:00
|
|
|
|
|
|
|
spmenu is an X11 menu application based on
|
|
|
|
[dmenu](https://tools.suckless.org/dmenu) which takes standard input, parses
|
|
|
|
it, and lets the user choose an option and sends the
|
|
|
|
selected option to standard output.
|
|
|
|
|
2023-03-29 23:08:24 +02:00
|
|
|
In addition to this, it also serves as a run launcher through the included
|
2023-04-30 01:00:49 +02:00
|
|
|
shell script `spmenu_run`, which handles both $PATH listing, .desktop entries
|
|
|
|
and file listing.
|
2023-03-29 23:08:24 +02:00
|
|
|
|
2023-04-13 23:50:59 +02:00
|
|
|
It is designed to integrate well with my [dwm](https://dwm.suckless.org) fork, [speedwm](https://git.speedie.site/speedwm).
|
2023-01-20 23:17:30 +01:00
|
|
|
|
2023-04-27 08:21:46 +02:00
|
|
|
## Improvements over dmenu
|
2023-01-20 23:17:30 +01:00
|
|
|
|
2023-04-25 18:11:49 +02:00
|
|
|
- Proper configuration file, including keybinds.
|
2023-04-02 18:22:32 +02:00
|
|
|
- dwm-like key/mouse bind array (See keybinds.h and mouse.h)
|
2023-03-20 16:33:23 +01:00
|
|
|
- Vim-like modes, including indicator.
|
|
|
|
- The ability to move around items with keybinds.
|
2023-03-29 23:08:24 +02:00
|
|
|
- Customizable/dynamic line/column size.
|
2023-05-07 01:41:30 +02:00
|
|
|
- Ability to update entries dynamically by reading from file
|
2023-04-02 18:22:32 +02:00
|
|
|
- IME support
|
|
|
|
- Was removed from suckless dmenu years ago due to issues I've resolved
|
2023-03-29 23:08:24 +02:00
|
|
|
- Powerlines
|
2023-03-20 16:33:23 +01:00
|
|
|
- Web browser like keybindings.
|
2023-01-20 23:17:30 +01:00
|
|
|
- 256 color support through SGR codes.
|
2023-04-02 18:22:32 +02:00
|
|
|
- Image support
|
|
|
|
- Somewhat based on [this repository](https://github.com/Cloudef/dmenu-pango-imlib)
|
2023-01-20 23:17:30 +01:00
|
|
|
- Option to block typing.
|
|
|
|
- Rewritten arguments, old arguments still work though.
|
2023-03-20 16:33:23 +01:00
|
|
|
- Hiding each part of the menu.
|
|
|
|
|
2023-04-27 08:21:46 +02:00
|
|
|
..and more! Note that spmenu is still **compatible** with dmenu.
|
|
|
|
Just pass the original arguments.
|
2023-01-20 23:17:30 +01:00
|
|
|
|
2023-03-31 18:01:57 +02:00
|
|
|
## Dependencies
|
2023-01-20 23:17:30 +01:00
|
|
|
|
|
|
|
- libX11
|
|
|
|
- libXrender
|
|
|
|
- freetype
|
2023-02-25 13:52:55 +01:00
|
|
|
- imlib2
|
2023-03-31 18:01:57 +02:00
|
|
|
- Used for image support, can be disabled if you don't want this by:
|
|
|
|
- build.sh: Setting `imlib2=false` in `buildconf`.
|
|
|
|
- Makefile: Editing `toggle.mk` and commenting out a few lines.
|
2023-01-20 23:17:30 +01:00
|
|
|
- libXinerama
|
2023-03-31 18:01:57 +02:00
|
|
|
- Can be disabled if you don't want/need multi-monitor support by:
|
|
|
|
- build.sh: Setting `xinerama=false` in `buildconf`.
|
|
|
|
- Makefile: Editing `toggle.mk` and commenting out a few lines.
|
|
|
|
- tcc compiler
|
|
|
|
- You can swap it out for GCC or any other C99 compatible compiler by:
|
|
|
|
- Makefile: Passing `CC="gcc"` to the `make` command.
|
|
|
|
- build.sh: Adding `CC="gcc"` to the `buildconf`.
|
|
|
|
command if you want)
|
2023-03-17 15:44:46 +01:00
|
|
|
- OpenSSL
|
2023-03-31 18:01:57 +02:00
|
|
|
- Used to calculate MD5 of images if image support is enabled, can be
|
|
|
|
disabled if you don't want this by:
|
|
|
|
- build.sh: Setting `imlib2=false` and `openssl=false` in `buildconf`.
|
|
|
|
- Makefile: Editing `toggle.mk` and commenting out a few lines.
|
|
|
|
- Pango
|
|
|
|
- Can be disabled if you don't want/need Pango markup by:
|
|
|
|
- build.sh: Setting `pango=false` and `pangoxft=false` in `buildconf`.
|
|
|
|
- Makefile: Editing `toggle.mk` and commenting out a few lines.
|
2023-04-04 21:39:38 +02:00
|
|
|
- libconfig
|
|
|
|
- Can be disabled if you don't want/need config file support by:
|
|
|
|
- build.sh: Setting `libconfig=false` in `buildconf`.
|
|
|
|
- Makefile: Editing `toggle.mk` and commenting out a few lines.
|
2023-01-20 23:17:30 +01:00
|
|
|
|
2023-04-26 11:28:44 +02:00
|
|
|
## Installation (GNU/Linux, \*BSD)
|
2023-01-20 23:17:30 +01:00
|
|
|
|
2023-04-30 01:00:49 +02:00
|
|
|
`emerge dev-vcs/git`, `pacman -S git`, `apt-get install git`
|
2023-01-20 23:17:30 +01:00
|
|
|
|
2023-04-13 23:50:59 +02:00
|
|
|
`git clone https://git.speedie.site/spmenu`
|
2023-01-20 23:17:30 +01:00
|
|
|
|
|
|
|
`cd spmenu/`
|
|
|
|
|
2023-04-30 01:00:49 +02:00
|
|
|
`./build.sh # Run as root. Install any missing dependencies.`
|
2023-03-31 18:01:57 +02:00
|
|
|
|
|
|
|
Report any issues with the build.sh script. There's also a Makefile which
|
|
|
|
you can use but it may require editing host.mk and toggle.mk manually.
|
2023-01-20 23:17:30 +01:00
|
|
|
|
2023-04-26 11:28:44 +02:00
|
|
|
## Installation (macOS/OS X/Mac OS X)
|
|
|
|
|
2023-04-27 08:21:46 +02:00
|
|
|
NOTE: Adds Xquartz as a dependency. I highly recommend you use Homebrew
|
|
|
|
to install all the dependencies.
|
|
|
|
|
2023-04-26 11:28:44 +02:00
|
|
|
Follow 'Installation (GNU/Linux, \*BSD)' for the most part. macOS requires
|
2023-04-27 08:21:46 +02:00
|
|
|
some minor changes though, such as disabling pango, pangoxft, imlib2, and
|
|
|
|
openssl. It is not possible to compile spmenu with these as of now, unless
|
|
|
|
you're a developer.
|
|
|
|
|
|
|
|
PREFIX must also be set to /usr/local instead of the default /usr
|
|
|
|
if you're using macOS Catalina or newer, because Apple made /usr read-only.
|
2023-04-26 11:28:44 +02:00
|
|
|
|
|
|
|
See [this wiki article](https://spmenu.speedie.site/index.php/Using+spmenu+on+macOS)
|
|
|
|
for more information.
|
|
|
|
|
2023-03-31 18:01:57 +02:00
|
|
|
## Installation (Gentoo GNU/Linux)
|
2023-01-20 23:17:30 +01:00
|
|
|
|
|
|
|
If you are on Gentoo GNU/Linux, you can add
|
2023-04-13 23:50:59 +02:00
|
|
|
[my overlay](https://git.speedie.site/speedie-overlay) which includes
|
2023-01-20 23:17:30 +01:00
|
|
|
`x11-misc/spmenu` as well as other useful packages.
|
|
|
|
|
2023-03-31 18:01:57 +02:00
|
|
|
## Installation (Arch GNU/Linux)
|
2023-03-02 10:07:56 +01:00
|
|
|
|
|
|
|
If you are on Arch GNU/Linux, you can add
|
2023-04-13 23:50:59 +02:00
|
|
|
[my repository](https://git.speedie.site/speedie-repository) which includes
|
2023-03-02 10:07:56 +01:00
|
|
|
`spmenu` as well as other useful packages.
|
|
|
|
|
2023-03-31 18:05:12 +02:00
|
|
|
There's also a PKGBUILD. To use it, simply `make install_arch` in the directory
|
2023-03-31 18:01:57 +02:00
|
|
|
the PKGBUILD is located.
|
|
|
|
|
|
|
|
If you wish to package spmenu for your GNU/Linux distribution, feel free to add
|
|
|
|
it to this list.
|
|
|
|
|
|
|
|
## 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.
|
2023-04-03 00:53:42 +02:00
|
|
|
- Image support: Ability to display icons, similar to rofi
|
2023-03-31 18:01:57 +02:00
|
|
|
- Text drawing: Use cairo for text drawing over Xft.
|
2023-05-07 03:44:33 +02:00
|
|
|
- Typing: Disable insert mode completely when !type
|
2023-04-30 01:00:49 +02:00
|
|
|
- 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.
|
2023-03-31 18:01:57 +02:00
|
|
|
|
|
|
|
### Unlikely, but maybe at some point in the distant future
|
|
|
|
|
2023-05-07 03:44:33 +02:00
|
|
|
- X11: Move from Xlib to libXcb
|
2023-03-31 18:01:57 +02:00
|
|
|
- Wayland: Wayland support, but only if it doesn't require writing any extra
|
2023-04-30 01:00:49 +02:00
|
|
|
code which as of now seems unlikely, or if someone makes a patch.
|
2023-04-04 21:39:38 +02:00
|
|
|
- Before this can even be done, replace Xft with cairo,
|
2023-04-30 01:00:49 +02:00
|
|
|
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.
|
2023-03-31 18:01:57 +02:00
|
|
|
- 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.
|
2023-03-17 15:44:46 +01:00
|
|
|
|
2023-03-31 18:01:57 +02:00
|
|
|
### Bugs
|
2023-03-29 23:08:24 +02:00
|
|
|
|
2023-03-31 18:01:57 +02:00
|
|
|
- Text drawing: Pango will sometimes spit out errors for invalid markup.
|
|
|
|
Silencing this would be a good idea.
|
|
|
|
- Image support: Images take a long time to load sometimes, particularly when
|
2023-04-02 13:44:47 +02:00
|
|
|
items are selected using the cursor so what we really need is a way to
|
2023-04-25 18:11:49 +02:00
|
|
|
skip over images after a set time limit.
|
2023-02-25 14:00:22 +01:00
|
|
|
|
2023-03-31 18:01:57 +02:00
|
|
|
## Scripts
|
2023-02-25 14:00:22 +01:00
|
|
|
|
2023-05-06 15:02:25 +02:00
|
|
|
There's a page dedicated to user scripts
|
|
|
|
[over on the wiki](https://spmenu.speedie.site/index.php/User+scripts). Feel
|
|
|
|
free to contribute and try scripts on there.
|
2023-02-25 15:31:06 +01:00
|
|
|
|
2023-03-31 18:01:57 +02:00
|
|
|
## More information
|
2023-01-20 23:17:30 +01:00
|
|
|
|
2023-03-31 18:01:57 +02:00
|
|
|
See the included `man` page.
|
2023-01-20 23:17:30 +01:00
|
|
|
|
2023-03-31 18:01:57 +02:00
|
|
|
## License
|
2023-01-20 23:17:30 +01:00
|
|
|
|
2023-03-31 18:01:57 +02:00
|
|
|
spmenu is licensed under the MIT license. See the included LICENSE file for
|
|
|
|
more information!
|
2023-04-30 01:00:49 +02:00
|
|
|
|
|
|
|
## Wiki
|
|
|
|
|
|
|
|
spmenu has [a wiki](https://spmenu.speedie.site) for more extensive
|
|
|
|
documentation. Contributions to the wiki are appreciated!
|