.\" Automatically generated by Pandoc 3.0.1 .\" .\" Define V font for inline verbatim, using C font in formats .\" that render this, and otherwise B font. .ie "\f[CB]x\f[]"x" \{\ . ftr V B . ftr VI BI . ftr VB B . ftr VBI BI .\} .el \{\ . ftr V CR . ftr VI CI . ftr VB CB . ftr VBI CBI .\} .TH "spmenu" "1" "" "0.4.1" "fancy dynamic menu" .hy .SH spmenu .PP spmenu is a program for X11 that reads standard input and allows the user to select items separated by a newline. It is a fork of suckless\[cq]s dmenu (https://tools.suckless.org/dmenu) which is a good more minimal alternative to spmenu. .PP What makes spmenu different from all the dmenu forks is that spmenu has features like color support, Vim-like modes, image support, proper mouse/keybind configuration, and more. .PP It should be noted that most of these features may be disabled by the user, either during compile time or through configuration. .SH Usage .PP On runtime, spmenu reads from standard input (stdin). spmenu items are separated by a newline (\f[V]\[rs]n\f[R]). When (by default) Enter is pressed, the selected item will be piped to stdout. .PP This allows things like \f[V]printf \[dq]Apple\[rs]nOrange\[rs]nPear\[rs]n\[dq] | spmenu\f[R]. This command will spawn an spmenu window with three items, `Apple', `Orange' and `Pear'. This can be used in shell scripts to create interactive menus. .PP On top of this, you can specify arguments to change the behavior of spmenu. See a list below for a list. .SH Arguments .PP You may use long, descriptive arguments or the shorter arguments. .TP \f[V]-mh, --lineheight height\f[R] Set spmenu line height to height .TP \f[V]-mw, --min-width width\f[R] Set minimum width to width .TP \f[V]-g, --columns grid\f[R] Set the number of grids to grid .TP \f[V]-gc, --generate-cache\f[R] Generate image cache .TP \f[V]-ngc, --no-generate-cache\f[R] Don\[cq]t generate image cache .TP \f[V]-mc, --max-cache size\f[R] Set max image cache size to size .TP \f[V]-rw, --relative-width\f[R] Enable relative input width .TP \f[V]-nrw, --no-relative-width\f[R] Disable relative input width .TP \f[V]-f, --fast\f[R] Grabs keyboard before reading stdin .TP \f[V]-F, --fuzzy\f[R] Enable fuzzy matching .TP \f[V]-NF, --no-fuzzy\f[R] Disable fuzzy matching .TP \f[V]-P, --password\f[R] Hide characters .TP \f[V]-nP, --no-password\f[R] Don\[cq]t hide characters .TP \f[V]-p, --prompt text\f[R] Set spmenu prompt text to text .TP \f[V]-It, --input text\f[R] Set initial input text to text .TP \f[V]-ip, --indent\f[R] Indent items to prompt width .TP \f[V]-nip, --no-indent\f[R] Don\[cq]t indent items to prompt width .TP \f[V]-ci, --color-items\f[R] Color items .TP \f[V]-nci, --no-color-items\f[R] Don\[cq]t color items .TP \f[V]-a, --alpha\f[R] Enable alpha .TP \f[V]-na, --no-alpha\f[R] Disable alpha .TP \f[V]-tp, --allow-typing\f[R] Allow the user to type .TP \f[V]-nt, --no-allow-typing\f[R] Don\[cq]t allow typing, the user must select an option .TP \f[V]-x, --x-position x offset\f[R] Offset spmenu x position by x offset .TP \f[V]-y, --y-position y offset\f[R] Offset spmenu y position by y offset .TP \f[V]-n, --preselect line\f[R] Preselect line line in the list of items .TP \f[V]-z, --width width\f[R] Width of the spmenu window .TP \f[V]-nmt, --normal-mode-text text\f[R] Set normal mode text to text .TP \f[V]-imt, --insert-mode-text text\f[R] Set insert mode text to text .TP \f[V]-bw, --border-width width\f[R] Set width of the border to width . 0 will disable the border .TP \f[V]-so, --sort\f[R] Sort matches .TP \f[V]-nso, --no-sort\f[R] Don\[cq]t sort matches .TP \f[V]-pri, --priority pri1,pri2,pri3\f[R] Specify a list of items that take priority .TP \f[V]-s, --case-sensitive\f[R] Use case-sensitive matching .TP \f[V]-ns, --case-insensitive\f[R] Use case-insensitive matching .TP \f[V]-nm, --normal\f[R] Start spmenu in normal mode .TP \f[V]-im, --insert\f[R] Start spmenu in insert mode .TP \f[V]-t, --top\f[R] Position spmenu at the top of the screen .TP \f[V]-b, --bottom\f[R] Position spmenu at the bottom of the screen .TP \f[V]-c, --center\f[R] Position spmenu at the center of the screen .TP \f[V]-hm, --hide-mode\f[R] Hide mode indicator .TP \f[V]-hit, --hide-item\f[R] Hide items .TP \f[V]-hmc, --hide-match-count\f[R] Hide match count .TP \f[V]-hla, --hide-left-arrow\f[R] Hide left arrow .TP \f[V]-hra, --hide-right-arrow\f[R] Hide right arrow .TP \f[V]-hpr, --hide-prompt\f[R] Hide prompt .TP \f[V]-hip, --hide-input\f[R] Hide input .TP \f[V]-hpl, --hide-powerline\f[R] Hide powerline .TP \f[V]-hc, --hide-caret, --hide-cursor\f[R] Hide caret .TP \f[V]-hhl, --hide-highlighting\f[R] Hide highlight .TP \f[V]-hi, --hide-image\f[R] Hide image .TP \f[V]-sm, --show-mode\f[R] Show mode indicator .TP \f[V]-sit, --show-item\f[R] Show items .TP \f[V]-smc, --show-match-count\f[R] Show match count .TP \f[V]-sla, --show-left-arrow\f[R] Show left arrow .TP \f[V]-sra, --show-right-arrow\f[R] Show right arrow .TP \f[V]-spr, --show-prompt\f[R] Show prompt .TP \f[V]-sin, --show-input\f[R] Show input .TP \f[V]-spl, --show-powerline\f[R] Show powerline .TP \f[V]-sc, --show-caret, --show-cursor\f[R] Show caret .TP \f[V]-shl, --show-highlighting\f[R] Show highlight .TP \f[V]-si, --show-image\f[R] Show image .TP \f[V]-xrdb, --xrdb\f[R] Load .Xresources on runtime .TP \f[V]-nxrdb, --no-xrdb\f[R] Don\[cq]t load .Xresources on runtime .TP \f[V]-gbc, --global-colors\f[R] Recognize global colors (such as *.color1) on runtime .TP \f[V]-ngbc, --no-global-colors\f[R] Don\[cq]t recognize global colors (such as *.color1) on runtime .TP \f[V]-m, --monitor monitor\f[R] Specify a monitor to run spmenu on .TP \f[V]-w, --embed window id\f[R] Embed spmenu inside window id .TP \f[V]-H, --hist-file hist file\f[R] Specify a path to save the history to .TP \f[V]-ig, --image-gaps gaps\f[R] Set image gaps to gaps .TP \f[V]-txp, --text-padding padding\f[R] Set text padding to padding .TP \f[V]-vem, --vertical-margin margin\f[R] Set the vertical margin .TP \f[V]-hem, --horizontal-margin margin\f[R] Set the horizontal margin .TP \f[V]-lp, --vertical-padding padding\f[R] Set the vertical padding .TP \f[V]-hp, --horizontal-padding padding\f[R] Set the horizontal padding .TP \f[V]-la, --left-arrow-symbol symbol\f[R] Set the left arrow to symbol .TP \f[V]-ra, --right-arrow-symbol symbol\f[R] Set the right arrow to symbol .TP \f[V]-is, --image-size size\f[R] Image size .TP \f[V]-it, --image-top\f[R] Position the image at the top .TP \f[V]-ib, --image-bottom\f[R] Position the image at the bottom .TP \f[V]-ic, --image-center\f[R] Position the image in the center .TP \f[V]-itc, --image-topcenter\f[R] Position the image in the top center .TP \f[V]-wm, --managed, --x11-client\f[R] Spawn spmenu as a window manager controlled client/window. Useful for testing .TP \f[V]-nwm, --unmanaged\f[R] Don\[cq]t spawn spmenu as a window manager controlled client/window. Useful for testing .TP \f[V]-cf, --config-file file\f[R] Set config file to load to file .TP \f[V]-lcfg, --load-config\f[R] Load spmenu configuration (\[ti]/.config/spmenu/spmenu.conf, \[ti]/.spmenurc or \[ti]/.config/spmenu/spmenurc) .TP \f[V]-ncfg, --no-load-config\f[R] Don\[cq]t load spmenu configuration (\[ti]/.config/spmenu/spmenu.conf, \[ti]/.spmenurc or \[ti]/.config/spmenu/spmenurc) .TP \f[V]-v, --version\f[R] Print spmenu version to stdout .TP \f[V]-fn, --font font\f[R] Set the spmenu font to font .TP \f[V]-nif, --normal-item-foreground color\f[R] Set the normal item foreground color .TP \f[V]-nib, --normal-item-background color\f[R] Set the normal item background color .TP \f[V]-sif, --selected-item-foreground color\f[R] Set the selected item foreground color .TP \f[V]-sib, --selected-item-background color\f[R] Set the selected item background color .TP \f[V]-npf, --normal-item-priority-foreground color\f[R] Set the normal item (high priority) foreground color .TP \f[V]-npb, --normal-item-priority-background color\f[R] Set the normal item (high priority) background color .TP \f[V]-spf, --selected-item-priority-foreground color\f[R] Set the selected item (high priority) foreground color .TP \f[V]-spb, --selected-item-priority-background color\f[R] Set the selected item (high priority) background color .TP \f[V]-pfg, --prompt-foreground color\f[R] Set the prompt foreground color .TP \f[V]-pbg, --prompt-background color\f[R] Set the prompt background color .TP \f[V]-ifg, --input-foreground color\f[R] Set input foreground color .TP \f[V]-ibg, --input-background color\f[R] Set input background color .TP \f[V]-mnbg, --menu-background color\f[R] Set the menu background color .TP \f[V]-nhf, --normal-highlight-foreground color\f[R] Set the normal highlight foreground color .TP \f[V]-nhb, --normal-highlight-background color\f[R] Set the normal highlight background color .TP \f[V]-shf, --selected-highlight-foreground color\f[R] Set the selected highlight foreground color .TP \f[V]-shb, --selected-highlight-background color\f[R] Set the selected highlight background color .TP \f[V]-nfg, --number-foreground color\f[R] Set the foreground color for the match count .TP \f[V]-nbg, --number-background color\f[R] Set the background color for the match count .TP \f[V]-mfg, --mode-foreground color\f[R] Set the foreground color for the mode indicator .TP \f[V]-mbg, --mode-background color\f[R] Set the background color for the mode indicator .TP \f[V]-laf, --left-arrow-foreground color\f[R] Set the left arrow foreground color .TP \f[V]-raf, --right-arrow-foreground color\f[R] Set the right arrow foreground color .TP \f[V]-lab, --left-arrow-background color\f[R] Set the left arrow background color .TP \f[V]-rab, --right-arrow-background color\f[R] Set the right arrow background color .TP \f[V]-cc, --caret-foreground color\f[R] Set the caret color .TP \f[V]-bc, --border-background color\f[R] Set the border color .TP \f[V]-sgr0, --sgr0 color\f[R] Set the SGR 0 color .TP \f[V]-sgr1, --sgr1 color\f[R] Set the SGR 1 color .TP \f[V]-sgr2, --sgr2 color\f[R] Set the SGR 2 color .TP \f[V]-sgr3, --sgr3 color\f[R] Set the SGR 3 color .TP \f[V]-sgr4, --sgr4 color\f[R] Set the SGR 4 color .TP \f[V]-sgr5, --sgr5 color\f[R] Set the SGR 5 color .TP \f[V]-sgr6, --sgr6 color\f[R] Set the SGR 6 color .TP \f[V]-sgr7, --sgr7 color\f[R] Set the SGR 7 color .TP \f[V]-sgr8, --sgr8 color\f[R] Set the SGR 8 color .TP \f[V]-sgr9, --sgr9 color\f[R] Set the SGR 9 color .TP \f[V]-sgr10, --sgr10 color\f[R] Set the SGR 10 color .TP \f[V]-sgr11, --sgr11 color\f[R] Set the SGR 11 color .TP \f[V]-sgr12, --sgr12 color\f[R] Set the SGR 12 color .TP \f[V]-sgr13, --sgr13 color\f[R] Set the SGR 13 color .TP \f[V]-sgr14, --sgr14 color\f[R] Set the SGR 14 color .TP \f[V]-sgr15, --sgr15 color\f[R] Set the SGR 15 color .PP dmenu compatibility can be achieved using these arguments: .TP \f[V]-S\f[R] Don\[cq]t sort matches .TP \f[V]-i\f[R] Use case-insensitive matching .TP \f[V]-nb color\f[R] Set the normal background color .TP \f[V]-nf color\f[R] Set the normal foreground color .TP \f[V]-sb color\f[R] Set the selected background color .TP \f[V]-sf color\f[R] Set the selected foreground color .SH Keybinds .PP See \f[V]keybinds.h\f[R] for a list. .SH Modes .PP One of the features that separate spmenu from dmenu is spmenu\[cq]s different modes. As of version 0.2, there are two modes. Normal mode and Insert mode. These modes are of course similar to Vim. .PP Normal mode is the mode spmenu starts in unless a mode argument is specified. In normal mode, all keys perform some action, but you cannot type any actual text to filter items. This mode is used for navigation, as well as quickly selecting an item. .PP Insert mode is entered through (by default) pressing \f[V]i\f[R] in normal mode. In this mode, most keybinds do nothing. When you are in insert mode, you filter items by typing text into the field. Once you\[cq]re done with insert mode, you can press Escape to enter normal mode again. .SH -p option .PP spmenu has a -p option, which stands for prompt. It allows you to specify text to display next to the item list. It is displayed on the left side of the spmenu window. It should be noted that the prompt is purely visual though. .SH Images .PP spmenu supports drawing images. This image is placed on the left side of the menu window. To use an image, pipe \f[V]IMG:/path/to/image\f[R] to spmenu. If you want you can specify arguments like usual. Note that you should add a Tab (\f[V]\[rs]t\f[R]) character after the path to the image file. Otherwise the text after will be interpreted as part of the filename and the image will not be drawn. .PP Any text after the Tab character will be interpreted as a regular item. In practice, drawing an image might look like this: .PP \f[V]printf \[dq]IMG:/path/to/image\[rs]tLook at that image, isn\[aq]t it awesome?\[rs]n\[dq] | spmenu\f[R] .PP There are also a few image related arguments, such as: .PP \f[V]-is\f[R], \f[V]-ig\f[R], \f[V]-it\f[R], \f[V]-ib\f[R], \f[V]-ic\f[R], \f[V]-itc\f[R] and \f[V]-gc\f[R]. .PP NOTE: Vector images (such as .svg) can be displayed too. .SH Colored text .PP spmenu supports colored text through SGR sequences. This is the same colors that you might already be using in your shell scripts. This means you can pipe practically any colored shell script straight into spmenu, no need to filter the output or anything. .PP Not only does it support colored text, but it also supports colored backgrounds. This allows something similar to the emoji highlight patch, except even more useful. Example: \f[V]printf \[dq]\[rs]033[0;44m😀\[rs]033[0m Emoji highlighting\[rs]n\[dq] | spmenu --columns 1\f[R] .PP For 256 color support to work, you must add to the array. See \f[V]libs/color.h\f[R] if you want this. .PP See `SGR sequences' for more information. .SH SGR sequences .PP A basic supported SGR sequence looks like this: \f[V]\[rs]033[X;YZm\f[R] .PP Here, X specifies if you want normal or bright colors. Y specifies if you want background or foreground. Z specifies the color number. .PP Foreground colors: \f[V]30\f[R] through \f[V]37\f[R] Background colors: \f[V]40\f[R] through \f[V]47\f[R] Reset: \f[V]0\f[R] .PP NOTE: \f[V];\f[R] is a separator, and in this example it separates the color number and normal/bright. \[rs]033 may also be written as \f[V]\[ha]]\f[R] or simply \f[V]ESC\f[R]. The separator may be omitted for some sequences, such as \f[V]\[rs]033[0m\f[R] which resets the colorscheme. .PP spmenu supports most color sequences, although not true color by default (unless -sgr arguments are used). .PP There are a few arguments, you can override SGR colors on-the-fly using the \f[V]-sgrX\f[R] arguments. See `Arguments' for more information. .PP Just as a tip, you can pipe your colored spmenu output to \f[V]sed -e \[aq]s/\[rs]x1b\[rs][[0-9;]*m//g\[aq]\f[R]. This will clear the SGR sequences from the output. This is useful when you want to check what the output actually is. .SH Pango markup .PP If spmenu was compiled with Pango enabled (default), you should be able to utilize Pango markup in every part of spmenu. That is, the mode indicator, items, input, prompt, etc. .PP Pango markup allows you to style text similar to an HTML document. It also provides the \f[V]\f[R] tag, which can be used to do surprisingly complex things. .PP There are many convenient tags as well which can be used to avoid using a \f[V]\f[R] tag, such as: .TP \f[V]\f[R] \f[B]Bold\f[R] text (\f[V]Bold\f[R]) .TP \f[V]\f[R] \f[I]Italic\f[R] text (\f[V]Italic\f[R]) .TP \f[V]\f[R] Strikethrough text (\f[V]Strikethrough\f[R]) .TP \f[V]\f[R] Underline text (\f[V]Underline\f[R]) .TP \f[V]\f[R] Subscript (\f[V]Subscript\f[R]) .TP \f[V]\f[R] Superscript (\f[V]Supscript\f[R]) .TP \f[V]\f[R] Monospace font (\f[V]Monospaced font is used here\f[R]) .TP \f[V]\f[R] Small text (\f[V]text is so small here\f[R]) .TP \f[V]\f[R] Big text (\f[V]text is so big here\f[R]) .PP Note that Pango markup is NOT escaped, and is piped to stdout. Therefore you need to parse it manually. Doing so with \f[V]sed\f[R] is very easy. For example: \f[V]... | spmenu ... | sed \[aq]s///g; s///g\[aq]\f[R] .PP See this page (https://docs.gtk.org/Pango/pango_markup.html) for more information. .SH Configuration .PP Unlike dmenu, spmenu has a configuration file which can be edited by hand. It is located in \[ti]/.config/spmenu/spmenu.conf, but you can override this by exporting \f[V]$XDG_CONFIG_HOME\f[R]. .PP When spmenu is installed, it copies a sample configuration to /usr/share/spmenu/spmenu.conf. You can copy this to your \f[V].config/spmenu\f[R] directory. This configuration file is loaded on startup. .PP You can also include other configuration files in the configuration file using \f[V]\[at]include \[dq]path/to/config\[dq]\f[R]. .SH .Xresources .PP spmenu also has .Xresources (xrdb) support built in. It reads the xrdb (.Xresources database) on runtime. You may disable it by passing -nxrdb, or enable it by padding -xrdb. You can also set this in the regular config file. .PP spmenu loads \f[V]\[ti]/.config/spmenu/spmenurc\f[R] or alternatively if you\[cq]re old fashioned, \f[V]\[ti]/.spmenurc\f[R] on startup. This requires that \f[V]xrdb\f[R] is available on your operating system. Of course, you don\[cq]t NEED to use them, as you can just \f[V]xrdb -override\f[R] any .Xresources file you want. .PP You can also use wildcards (such as \f[V]*\f[R]) to achieve a global colorscheme. Programs like \f[V]pywal\f[R] do this to apply universal colorschemes. .SH Profiles .PP spmenu supports profiles. Profiles are like configuration files (See \f[V]Configuration\f[R]) that can be switched between quickly using a keybind. .PP Pressing (by default) Ctrl+Shift+p will list out profiles, and also allow you to add/remove existing profiles. Selecting a profile will switch to that profile. The selected profile will now be loaded on startup just like the spmenurc until another profile is selected. .PP Selecting `Add' allows you to create a new profile. When a new profile is created it is going to use the spmenu defaults (copied from \f[V]/usr/share/spmenu/example.Xresources\f[R]). Profiles are going to be in \f[V]\[ti]/.config/spmenu/profiles/\f[R] and the current profile is in \f[V]\[ti]/.config/spmenu/.profile\f[R]. The profile can simply be edited using any text editor and be configured in .Xresources syntax. .PP Selecting \f[V]Remove\f[R] will allow you to pick a profile which will be permanently removed. Selecting \f[V]Default\f[R] will simply load \f[V]spmenurc\f[R] and nothing else on startup, as if this feature did not exist. .PP Not only can profiles be used to configure color schemes and fonts, allowing you to swap color schemes quickly, but also any other options you may want. .PP Note that any profiles are applied ON TOP of the current loaded profile, meaning if any options are missing from the selected profile, the setting in the profile used before will be used in place. .PP There are a few color schemes for spmenu included in the repository, see the \f[V]themes/\f[R] directory. Feel free to copy those to your profile directory. .SH Run launcher .PP spmenu includes a shell script called spmenu_run. It lists executable programs in $PATH and displays them to the user in a list. Not only that but it shows recently run programs first in the list. .PP spmenu_run will interpret any arguments as spmenu arguments and pass them to spmenu. Therefore \f[V]spmenu_run --prompt \[aq]Run:\[aq]\f[R] will set the prompt to \f[V]Run:\f[R]. While it is similar to dmenu_run (and achieves the same goal), this version has some extra features. .PP The selected option is piped to /bin/sh (by default). Unlike dmenu_run, spmenu_run has some cool features. For example: .IP \[bu] 2 Prepending \f[V]#\f[R] will spawn it in a terminal instead of just a shell. .IP \[bu] 2 Prepending \f[V]?\f[R] will run the command in a function, most of the time used to display the man page. .IP \[bu] 2 Prepending \f[V]magnet\f[R] will open a magnet link in $TORRENT .IP \[bu] 2 Prepending \f[V]www\f[R] will open a page in $BROWSER .PP Most of the time you don\[cq]t need to prepend \f[V]www\f[R] though, for example typing in \f[V]https://gnu.org\f[R] will open gnu.org in $BROWSER even without the prefix. Same goes for magnet links. .PP You can also configure the run launcher through editing \f[V]\[ti]/.config/spmenu/run/config\f[R] which is configured in shell syntax. .SH spmenu_desktop .PP In addition to the aforementioned \f[V]spmenu_run\f[R], the spmenu package also provides \f[V]spmenu_desktop\f[R] which instead of reading $PATH only lists out .desktop entries. .PP Unlike the regular run launcher though, spmenu_desktop supports displaying an icon for entries that use one. .PP It can be configured through editing \f[V]\[ti]/.config/spmenu/desktop/config\f[R]. The configuration file can also be moved by setting \f[V]${XDG_CONFIG_HOME}\f[R]. .SH spmenu commands .PP spmenu has a few special commands. These work similar to the images. For example to list the version, in addition to the \f[V]--version\f[R] argument you can also simply run \f[V]printf \[aq]spmenu:version\[aq] | spmenu\f[R]. There are a few of these. .TP \f[V]spmenu:version\f[R] Print the spmenu version .TP \f[V]spmenu:license\f[R] Print the spmenu license .TP \f[V]spmenu:test\f[R] Print a test script for spmenu which tests various features. Report any weird issues you may have. .SH License .PP spmenu is licensed under the MIT license because that\[cq]s the original suckless license. See the included LICENSE file for more information. .SH Reporting issues .PP Please report issues on the Codeberg repository (https://codeberg.org/speedie/speediegq) or alternatively email me.