update stuff

This commit is contained in:
speedie 2023-05-09 17:37:40 +00:00
parent d7ff6f27f4
commit 8afec92d86
32 changed files with 725 additions and 41 deletions

View file

@ -197,7 +197,7 @@ function fileNameForPage($page)
function imageLinkText($imgName) function imageLinkText($imgName)
{ {
return "![".__("Image Description")."](/".UPLOAD_FOLDER."/$imgName)"; return "![".__("Image Description")."](/pages/".UPLOAD_FOLDER."/$imgName)";
} }
function sanitizeFilename($inFileName) function sanitizeFilename($inFileName)

View file

@ -1,2 +0,0 @@
A list of spmenu scripts
========================

View file

@ -0,0 +1,222 @@
Configurable keybindings
========================
spmenu has since version 1.0 supported configuring keybinds and mouse binds through a config file. The default config file *should* have the default keybinds already.
# List of valid modes
- -1
- Any mode
- 0
- Normal mode
- 1
- Insert mode
# List of valid clicks
- clickwindow
- Clicking on the spmenu window
- clickprompt
- Clicking on the prompt
- clickinput
- Clicking on the input
- clicklarrow
- Clicking on the left arrow
- clickrarrow
- Clicking on the right arrow
- clickitem
- Clicking on the item area
- clickselitem
- Clicking on an item, function here doesn't matter, it will always be selected
- clicknumber
- Clicking on the match count indicator
- clickcaps
- Clicking on the caps lock indicator
- clickmode
- Clicking on the mode indicator
# List of valid modifiers
- Ctrl
- Shift
- Super
- Alt
- AltGr
- ShiftGr
- None
These can also be combined by using '+' as a separator (ie. Ctrl+Shift)
# List of valid buttons
- Left Click
- Middle Click
- Right Click
- Scroll Up
- Scroll Down
# List of valid functions
**NOTE: This applies to both mouse and keybinds.**
- moveup
- movedown
- moveleft
- moveright
- moveend
- movestart
- move
- move
- paste
- pastesel
- restoresel
- clear
- clearins
- viewhist
- moveword
- moveword
- deleteword
- movecursor
- movecursor
- navhistory
- navhistory
- backspace
- selectitem
- quit
- complete
- setimgsize
- setimgsize
- toggleimg
- defaultimg
- rotateimg
- flipimg
- setimgpos
- setimgpos
- setimggaps
- setimggaps
- setlines
- setlines
- setcolumns
- togglehighlight
- setprofile
- switchmode
# List of valid arguments
**NOTE: This applies to both mouse and keybinds.**
- 0
- 1 through 100
- +1 through +100
- -1 through -100
# List of valid modes
- -1
- Any mode
- 0
- Normal mode
- 1
- Insert mode
# List of valid keys
- None
- Space
- Enter
- Tab
- a
- b
- c
- d
- e
- f
- g
- h
- i
- j
- k
- l
- m
- n
- o
- p
- q
- r
- s
- t
- u
- v
- w
- x
- y
- z
- 0
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- !
- "
- #
- $
- %
- &
- '
- (
- )
- *
- +
- ,
- -
- .
- /
- :
- ;
- <
- =
- >
- ?
- @
- [
- \\
- ]
- _
- grave
- {
- bar
- }
- ~
- F1
- F2
- F3
- F4
- F5
- F6
- F7
- F8
- F9
- F10
- F11
- F12
- PageUp
- PageDown
- Home
- End
- Delete
- PrintScr
- Esc
- Pause
- ScrollLock
- Backspace
- Up
- Down
- Left
- Right
- Next
- Prior

6
pages/Configuring spmenu.md Normal file → Executable file
View file

@ -1,2 +1,6 @@
Configuring spmenu Configuring spmenu
================== ==================
A fully complete configuration file is available in /usr/share/spmenu/spmenu.conf. This config is more or less identical to the default options. This makes it an excellent place to start because everything is already defined, you just make the changes you want.
To use this config, simply copy it to ~/.config/spmenu/spmenu.conf and restart spmenu. It should be used immediately.

0
pages/Extensive code documentation.md Normal file → Executable file
View file

68
pages/Functions in spmenu_run.md Normal file → Executable file
View file

@ -1,2 +1,68 @@
Functions in spmenu_run Functions in spmenu_run
======================= =======================
spmenu_run has a configuration file located in ~/.config/spmenu/run/config, which should be generated when you run it for the first time. This file is simply sourced by spmenu_run meaning all functions, variables and arrays are imported. The script looks for a few functions which will run if found during different stages. There are a few of these functions, and the default config file should list them out.
- 'run_pre_func' before spawning spmenu.
- 'run_post_func' after spawning spmenu, selected item passed as an argument.
- 'desktop_pre_func' before spawning spmenu.
- 'desktop_post_func' after spawning spmenu, selected item passed as an argument.
- 'fm_pre_func' before spawning spmenu.
- 'fm_post_func' after spawning spmenu, selected item passed as an argument.
- 'fm_pre_list_func' right before listing out files.
- 'fm_post_list_func' right after listing out files.
- 'fm_dir_func' before changing directory to the selected directory.
- 'fm_line_func' for each line in ls output, the line is passed as an argument, including SGR colors.
- 'read_man' when reading a man page, selected item passed as an argument.
These are quite self-explanatory. The default configuration file even gives an example of how this can be used. Additionally the default config file should already have a 'read_man' function. It looks something like this:
read_man() {
man "$1" | col -b | ${RUNLAUNCHER:-spmenu} --lines 40 --columns 1 -p "man $1"
}
In case you are new to shell scripting, $1 here is the first argument passed to this function, outside of the function name itself which is $0. This function gets passed the input minus the '?' character, and then looks up the man page for that. Then it will parse the output and display it in an spmenu prompt. Same goes for many of the other functions.
## Writing a function
Let's say we want to display a few more entries in the run launcher. Let's say we want to open Discord and Element in our web browser (Chromium) as an app, but don't want to have a shell script for it. Well, then we can do something like this.
run_pre_func() {
printf "discord\nelement\n"
}
run_post_func() {
case "$1" in
"discord") chromium --app="https://discord.com/channels/@me"; exit 0 ;;
"element") chromium --app="https://app.element.io/index.html"; exit 0 ;;
esac
}
So as you can see, run_pre_func is useful if we want to print stuff. We can then use run_post_func to parse the user input. Entries from run_pre_func should be sorted before being displayed to the user, provided SORT=true in the config.
**NOTE: Do not forget to exit in the case statement, otherwise spmenu will attempt to run the input. spmenu does not exit after running the function.**
Now let's do one for the file launcher provided by spmenu_run -fm. For this example, let's open the file depending on the file extension. A pre_func is not necessary here.
fm_post_func() {
case "$1" in
*.pdf) zathura "$1"; exit 0 ;; # PDFs are opened in zathura
*.md|*.php|*.txt|*.c|*.h|*.css|*.conf) nvim "$1"; exit 0 ;; # various text files are opened in neovim
*.html|*.htm) chromium "$1"; exit 0 ;; # html and htm is opened in chromium
*.png|*.jpg|*.jpeg|*.gif|*.tiff) nsxiv "$1"; exit 0 ;; # images are displayed in nsxiv
*.mp4|*.mkv|*.mp3|*.flac|*.wav) mpv "$1"; exit 0 ;; # music and videos are opened in mpv
*) [ ! -x "$1" ] && nvim "$1"; exit 0 ;; # everything else is treated as text as long as its not executable (most likely a binary)
esac
}
This function will handle opening of files based on the file extension. Case statements are very useful and powerful for things like matching strings. Again, do not forget to exit or else spmenu_run will try to handle running it. Also note that the --stdout flag will **not** run this function.
Another one for the file launcher. This one however **requires** spmenu 1.0. This function will display images if possible.
fm_line_func() {
case "$1" in
*.png|*.jpg|*.jpeg|*.svg|*.gif|*.tiff) printf "IMG:$1\t" ;;
esac
}
Note that this may add a lot of slowdown in some cases. Use with care, and feel free to adjust.

View file

@ -22,7 +22,7 @@ most likely to run it.
- There are likely more BSDs that can run speedwm, but I cannot support all - There are likely more BSDs that can run speedwm, but I cannot support all
of them. Try it and see if it works. of them. Try it and see if it works.
- macOS/Mac OS X - macOS/Mac OS X
- macOS *should* be supported, however it requires `Xquartz` to be installed on the system. Mac support has not yet been tested, however please report any issues you find on it. `dmenu` also supports macOS, although the guys at suckless surely don't promote it. - macOS *should* be supported, however it requires `Xquartz` to be installed on the system. See [[Using spmenu on macOS]] for more information.
### Installation on Gentoo GNU/Linux ### Installation on Gentoo GNU/Linux
@ -48,14 +48,12 @@ Installing spmenu on most GNU/Linux distributions is very simple. First,
determine if you want to install it using Git (the absolute latest version) or determine if you want to install it using Git (the absolute latest version) or
using a stable tarball. using a stable tarball.
As of 24/04/2023, 0.4.1 is the latest tarball release. While it is stable, it's not going to have any bug fixes or features I'm adding. This software is still pre-1.0 release so issues can be fixed rather often. For this reason, it is recommended that you `git While using a tarball can sometimes be more stable, it's not going to have any bug fixes or features I'm adding. With Git, issues can be fixed rather often. For this reason, it is recommended that you `git clone` the repository. If you do not have `git`, install it using your
clone` the repository. If you do not have `git`, install it using your distribution's package manager. If you're going to be using a 'stable' tarball, you do not need to install `git`.
distribution's package manager. If you're going to be using a 'stable'
tarball, you do not need to install `git`.
While the list of dependencies will vary depending on the spmenu version While the list of dependencies will vary depending on the spmenu version
you're going to install (see README.md for your specific version), you're going to install (see README.md for your specific version),
below is a list for the latest release, 0.4.1. below is a list for the latest release, 1.0.
- libX11 - libX11
- libXrender - libXrender
@ -108,8 +106,6 @@ Now, it's time to compile it! Provided you have all dependencies installed,
this should be very, very easy and quick. Run `./build.sh` to install spmenu. The binary will be in `/usr/bin/spmenu` if PREFIX wasn't changed. If you need to use a this should be very, very easy and quick. Run `./build.sh` to install spmenu. The binary will be in `/usr/bin/spmenu` if PREFIX wasn't changed. If you need to use a
different compiler (tcc in Arch repositories has a few issues), you can set the compiler to use in the `buildconf`. The `buildconf` file is loaded by the build script and allows you to set various options. By default the buildconf is identical to what is used to build the Arch packages. different compiler (tcc in Arch repositories has a few issues), you can set the compiler to use in the `buildconf`. The `buildconf` file is loaded by the build script and allows you to set various options. By default the buildconf is identical to what is used to build the Arch packages.
**Warning: If you lose your source code, you will be unable to add any key/mouse binds. Next version of spmenu will hopefully have keybinds configurable in spmenu.conf.**
Now follow along with 'Using spmenu'. Now follow along with 'Using spmenu'.
#### Installation using a tarball #### Installation using a tarball
@ -135,8 +131,6 @@ Now, it's time to compile it! Provided you have all dependencies installed,
this should be very, very easy and quick. Run `./build.sh` to install spmenu. The binary will be in `/usr/bin/spmenu` if PREFIX wasn't changed. If you need to use a this should be very, very easy and quick. Run `./build.sh` to install spmenu. The binary will be in `/usr/bin/spmenu` if PREFIX wasn't changed. If you need to use a
different compiler (tcc in Arch repositories has a few issues), you can set the compiler to use in the `buildconf`. The `buildconf` file is loaded by the build script and allows you to set various options. By default the buildconf is identical to what is used to build the Arch packages. different compiler (tcc in Arch repositories has a few issues), you can set the compiler to use in the `buildconf`. The `buildconf` file is loaded by the build script and allows you to set various options. By default the buildconf is identical to what is used to build the Arch packages.
**Warning: If you lose your source code, you will be unable to add any key/mouse binds. Next version of spmenu will hopefully have keybinds configurable in spmenu.conf.**
Now follow along with 'Using spmenu'. Now follow along with 'Using spmenu'.
### Using spmenu ### Using spmenu
@ -149,5 +143,5 @@ spmenu also has a lot of arguments you can give. `spmenu --help` or if you prefe
spmenu also has a config file through libconfig. A default config should be installed at `/usr/share/spmenu/spmenu.conf`. You can copy this to `~/.config/spmenu/spmenu.conf`. You may edit this file using your favorite text editor. Note that .Xresources takes priority over spmenu.conf configuration, as long as `xresources = 1`. You can find a list of accepted .Xresources values in `/usr/share/spmenu/example.Xresources`, and this file should more or less be identical to the defaults. For more information regarding the configuration file, see [[Configuring spmenu]]. spmenu also has a config file through libconfig. A default config should be installed at `/usr/share/spmenu/spmenu.conf`. You can copy this to `~/.config/spmenu/spmenu.conf`. You may edit this file using your favorite text editor. Note that .Xresources takes priority over spmenu.conf configuration, as long as `xresources = 1`. You can find a list of accepted .Xresources values in `/usr/share/spmenu/example.Xresources`, and this file should more or less be identical to the defaults. For more information regarding the configuration file, see [[Configuring spmenu]].
Great, you should now know how spmenu works on a basic level. Now, if you are a tiling window manager user or just want a better run launcher, you can check out the article 'Using spmenu as a run launcher'. Alternatively, if you want to use this for scripting you can check out [[Scripting with spmenu]]. There are also many scripts that use spmenu to display items, see [[A list of spmenu scripts]] for that. Great, you should now know how spmenu works on a basic level. Now, if you are a tiling window manager user or just want a better run launcher, you can check out the article 'Using spmenu as a run launcher'. Alternatively, if you want to use this for scripting you can check out [[Scripting with spmenu]]. There are also many scripts that use spmenu to display items, see [[User scripts]] for that.

View file

@ -1,7 +1,7 @@
Welcome to the spmenu wiki! Welcome to the spmenu wiki!
--------------------------- ---------------------------
![image](https://codeberg.org/speedie/spmenu-screenshots/raw/branch/master/spmenu-iron.png) ![preview image](/pages/images/preview.png)
[spmenu](https://git.speedie.site/spmenu) is an X11 menu application based on [spmenu](https://git.speedie.site/spmenu) is an X11 menu application based on
[dmenu](https://tools.suckless.org/dmenu) which takes standard input, parses [dmenu](https://tools.suckless.org/dmenu) which takes standard input, parses
@ -9,4 +9,6 @@ it, and lets the user choose an option and sends the
selected option to standard output. Options are separated by newlines. In addition to this, it also serves as a run launcher through the included selected option to standard output. Options are separated by newlines. In addition to this, it also serves as a run launcher through the included
shell script `spmenu_run` which supports running binaries from $PATH but also file management and .desktop entries. shell script `spmenu_run` which supports running binaries from $PATH but also file management and .desktop entries.
What are you waiting for? Check it out! It is recommended that you start out by following [[Getting Started]]. What are you waiting for? Check it out!
It is recommended that you start out by following [[Getting Started]]. Then, you may be interested in [[Using spmenu as a run launcher]].

33
pages/Reading files.md Normal file
View file

@ -0,0 +1,33 @@
Reading files
=============
**NOTE: The following information only applies to spmenu 1.1 and later.**
spmenu is designed to read files. Most of the time it reads standard input which is also a file (/dev/stdin which is a symlink to /proc/self/fd/0 on systems using the Linux kernel). You don't necessarily have to read standard input or stdin though, as of spmenu 1.1 you can read any file you want.
Reading from a file has benefits. When reading from standard input the entries are only loaded once. When reading from a file however, if the file is modified the new entries will be loaded and displayed on the next X11 event.
## Reading from a file
To read from any file you want, simply run spmenu with the `-lf` or `--list-file` argument. You can actually read from standard output using `--list-file` as well, by using `stdin | spmenu --list-file /dev/stdin`, but there is really no reason to do this as reading standard input is the default spmenu behavior anyway.
For instance, `spmenu --list-file /tmp/file` would load entries from /tmp/file.
## Real world use case
Let's say we want to display the time and update it every second. In that case we can write a script like this:
```
#!/bin/sh
func() {
while true; do
date > /tmp/date-file
sleep 1
done
}
func &
spmenu -lf /tmp/date-file -p "The time is:"
```
[speedwm-extras](https://git.speedie.site/speedwm-extras)' speedwm-btctrl uses this feature to load Bluetooth entries every 5 seconds.

109
pages/Scripting with spmenu.md Normal file → Executable file
View file

@ -1,2 +1,109 @@
Scripting with spmenu Scripting with spmenu
===================== =====================
This wiki article walks you through how to actually write a script using spmenu.
# Deciding what to write
Before you write anything, you need to have a concept. For this example, we're going to write a script which lists out all Arch packages you could install and then installs it. You could of course do anything you want, though.
# spmenu basics
The core concept of spmenu is to take standard input, list out items separated by a newline character, and output the selected item. For example `printf "1\n2\n3\n" | spmenu --lines 30 --prompt 'Select a number'` will allow you to choose between 1, 2 and 3. The selected item is then output to standard output (stdout)
# Starting off
First, I like to start off my scripts with a `main` function. I would start like this:
```
#!/bin/sh
# My super awesome shell script
# Licensed under the GNU General Public License version 3.0
# See LICENSE file for more information.
main() {
:
}
```
Now, I know the command to list out all packages in the Arch repositories on your system is `pacman -Sl`. This is going to list out the repository name followed by a space though, and we don't really need to see that. So what I'm going to do is `pacman -Sl | awk '{ print $2 }'`, which gets the second and final column.
```
[speedie@arch ~]$ pacman -Sl | awk '{ print $2 }'
acl
amd-ucode
archlinux-keyring
argon2
attr
audit
autoconf
automake
b43-fwctter
base
...
```
Then what I would do is create another function, and perhaps call it `list_packages()` or something like that, and then I would replace the placeholder `:` with assigning a variable.
```
...
list_packages() {
pacman -Sl | awk '{ print $2 }'
}
main() {
sel_item="$(list_packages | spmenu --lines 10 --columns 3 --prompt "Select a package to install:"
}
```
## Checking the output
Alright, now we have the selected item in a variable called `sel_item`. We can easily print what this variable contains by running something like `printf "%s\n" "$sel_item"`. Now we need to use this variable for something. What I would do next is use something like sudo or doas, and enable root without a password. This *could* be insecure, so be careful. For this example though, I'm going to assume you're using sudo, and sudo can execute `pacman -S` without a password.
```
...
main() {
sel_item="$(list_packages | spmenu --lines 10 --columns 3 --prompt "Select a package to install:")"
sudo pacman -S --noconfirm "${sel_item}"
}
```
## Notify
Now what I like to do is add a nice litte notification if the package installed successfully. This is optional but I would do it like this:
```
...
main() {
sel_item="$(list_packages | spmenu --lines 10 --columns 3 --prompt "Select a package to install:")"
sudo pacman -S --noconfirm "${sel_item}" && notify-send "Installed" "Installed '${sel_item}'." || notify-send "Failed" "Installation of package '${sel_item}' failed."
}
```
Now, finally we need to call the `main()` function, so simply add `main` to the bottom of the script.
The script should look something like this:
```
#!/bin/sh
# My super awesome shell script
# Licensed under the GNU General Public License version 3.0
# See LICENSE file for more information.
list_packages() {
pacman -Sl | awk '{ print $2 }'
}
main() {
sel_item="$(list_packages | spmenu --lines 10 --columns 3 --prompt "Select a package to install:")"
[ -z "${sel_item}" ] && exit # This will exit if we didn't select anything.
sudo pacman -S --noconfirm "${sel_item}" && notify-send "Installed" "Installed '${sel_item}'." || notify-send "Failed" "Installation of package '${sel_item}' failed."
}
main
```
Now, you could easily expand this to do removal as well, but I'm not going to cover that.

21
pages/Theme managers.md Normal file
View file

@ -0,0 +1,21 @@
Theme managers
==============
**NOTE: This article only applies to spmenu 1.1 and later. Users of spmenu 1.0 and earlier should first upgrade, or alternatively use the regular profiles.**
This article is intended to be a list of theme managers that can be installed and used. spmenu does not decide what theme manager is used, spmenu simply runs `spmenu_profile --spmenu-set-profile` when the keybind for setting a profile is activated. This means you must parse this in a separate program. See [spmenuify](https://git.speedie.site/spmenuify) for an example on how to do this.
# Rules for editors
- The theme managers must all be licensed under a free/libre license, preferably but not necessarily a copyleft license.
- Please try to use stable hosting if possible for links. If this is not possible, consider emailing me so I can host it on my site.
- Any programming language. Go wild.
- No malware/software with antifeatures.
# Official theme managers
- [spmenuify](https://git.speedie.site/spmenuify)
- Author: [speedie](https://speedie.site) ([speedie@speedie.site](mailto:speedie@speedie.site))
- spmenuify is the official theme manager for spmenu. It allows installation, previewing, enabling and disabling of themes.
# User theme managers

30
pages/User scripts.md Executable file
View file

@ -0,0 +1,30 @@
A list of spmenu scripts
========================
This article is for various scripts written with spmenu. Anyone may add their scripts to this list, provided they serve some use and are free/libre as in freedom. Additionally, please **specify any possible antifeatures and network requests made and the license.**
## Useful
- [speedwm-extras](https://git.speedie.site/speedwm-extras)
- Author: [speedie](https://speedie.site) ([speedie@speedie.site](mailto:speedie@speedie.site))
- License: GNU General Public License version 3.0
- Collection of scripts for things like WLAN, Bluetooth, Wallpaper setting, audio management, screen recording and more. Designed with speedwm in mind, but can be used with any window manager or setup.
- [clipmenu-spmenu](https://github.com/speediegq/clipmenu-spmenu)
- Author: [Chris Down](https://github.com/cdown), [speedie](https://speedie.site) ([speedie@speedie.site](mailto:speedie@speedie.site))
- License: Public domain
- Fork of clipmenu, now supports spmenu specific features a little better. clipmenu allows you to navigate and view past history. History is collected through a daemon which should be autostarted in your window manager config.
- [iron-spmenu](https://codeberg.org/speedie/iron-spmenu)
- Author: [speedie](https://speedie.site) ([speedie@speedie.site](mailto:speedie@speedie.site))
- License: GNU General Public License version 3.0
- Fork of the [iron rautafarmi client](https://codeberg.org/speedie/iron), now displays messages and images using spmenu. Depends on `jq`, `curl`, `sed` and a POSIX compliant shell (no, not fish). Supports sending messages using the -s (send) argument.
## Show-off
- [spmenu-test](https://git.speedie.site/spmenu)
- Author: [speedie](https://speedie.site) ([speedie@speedie.site](mailto:speedie@speedie.site))
- License: MIT
- Script bundled with spmenu, used to test various functionality. When making colorschemes, I highly recommend taking a screenshot of this as it allows you to view every color.
- [spmenu_sweden.sh](https://git.speedie.site/spmenu/plain/scripts/examples/spmenu_sweden.sh)
- Author: [speedie](https://speedie.site) ([speedie@speedie.site](mailto:speedie@speedie.site))
- License: MIT
- Shell script written with spmenu SGR sequence support in mind. Simply recreates the flag of Sweden with blue and yellow background SGR sequences.

125
pages/User themes.md Normal file → Executable file
View file

@ -3,9 +3,9 @@ User themes
spmenu has since version 0.3 supported profiles. Profiles allow the user to bring up a list of themes (or options in general) and override options on-the-fly. This in itself is done through a shell script called `spmenu_profile` bundled with spmenu. This script interacts with spmenu. If you press `Ctrl+Shift+p` with the default configuration, a list of profiles should pop up. By default you likely have none, and that's maybe also why you're here. spmenu has since version 0.3 supported profiles. Profiles allow the user to bring up a list of themes (or options in general) and override options on-the-fly. This in itself is done through a shell script called `spmenu_profile` bundled with spmenu. This script interacts with spmenu. If you press `Ctrl+Shift+p` with the default configuration, a list of profiles should pop up. By default you likely have none, and that's maybe also why you're here.
This wiki article is supposed to be a list of themes for spmenu. Users may edit this article to add their own profiles with credit given of course, and users may download others' profiles to use with spmenu. This wiki article is meant to be a list of themes and profiles for spmenu. Users may edit this article to add their own profiles with credit given of course, and users may download others' profiles to use with spmenu.
There are two different types of profiles. There are config files and profiles. Config files should either be included from your spmenu.conf or simply replace your spmenu.conf (the latter is more common) but profiles are in .Xresources syntax and should be placed in `~/.config/spmenu/profiles/` for the profile list to find it. There are two different types. There are themes and profiles. Themes should either be copied to `~/.config/spmenu/theme.conf` either manually or by using a theme manager. Profiles are in .Xresources syntax and should be placed in `~/.config/spmenu/profiles/` for the profile list to find it. Profiles are only compatible with spmenu 1.0 and earlier and is considered a legacy format, while themes are compatible with spmenu 1.1 and later.
Tip: Use `Ctrl+f` to search through the page. Tip: Use `Ctrl+f` to search through the page.
@ -14,49 +14,76 @@ Tip: Use `Ctrl+f` to search through the page.
- Must be licensed under a free (as in freedom) license. - Must be licensed under a free (as in freedom) license.
- No duplicates, we don't need multiple versions of Nord for example. - No duplicates, we don't need multiple versions of Nord for example.
- Please try to use stable hosting if possible for links. If this is not possible, consider [emailing me](mailto:speedie@speedie.site) so I can host it on my site. - Please try to use stable hosting if possible for links. If this is not possible, consider [emailing me](mailto:speedie@speedie.site) so I can host it on my site.
- You may not edit 'Official profiles' or 'Official config files' unless I have forgotten to include a profile or config file
- Outdated profiles may be removed if necessary. Please try to maintain it, if you don't have time to do so a disclaimer would be nice. - Outdated profiles may be removed if necessary. Please try to maintain it, if you don't have time to do so a disclaimer would be nice.
### Official profiles ### Official themes
- [Catppuccin](https://git.speedie.site/spmenu/plain/themes/legacy/Catppuccin) **NOTE: Themes are only compatible with spmenu 1.1 and later. Users of 1.0 and earlier should use the older profiles feature.**
![image](/pages/images/arc-dark.png)
- [Arc Dark](https://git.speedie.site/spmenu/plain/themes/Arc-Dark.conf)
- Author: [speedie](https://speedie.site) ([speedie@speedie.site](mailto:speedie@speedie.site))
- This profile implements the [Arc Dark theme](https://github.com/arc-design/arc-theme) into spmenu.
![image](/pages/images/catppucino.png)
- [Catppuccin](https://git.speedie.site/spmenu/plain/themes/Catppuccin.conf)
- Author: [speedie](https://speedie.site) ([speedie@speedie.site](mailto:speedie@speedie.site)) - Author: [speedie](https://speedie.site) ([speedie@speedie.site](mailto:speedie@speedie.site))
- This profile implements the [Catppuccin theme](https://github.com/catppuccin/catppuccin) into spmenu which all furries seem to like. - This profile implements the [Catppuccin theme](https://github.com/catppuccin/catppuccin) into spmenu which all furries seem to like.
- [Cyberpunk Neon](https://git.speedie.site/spmenu/plain/themes/legacy/Cyberpunk-Neon) ![image](/pages/images/cyberpunk.png)
- [Cyberpunk Neon](https://git.speedie.site/spmenu/plain/themes/Cyberpunk-Neon.conf)
- Author: [speedie](https://speedie.site) ([speedie@speedie.site](mailto:speedie@speedie.site)) - Author: [speedie](https://speedie.site) ([speedie@speedie.site](mailto:speedie@speedie.site))
- This profile implements the [Cyberpunk Neon colorscheme](https://github.com/Roboron3042/Cyberpunk-Neon) into spmenu. This was partially taken from the [st patch](https://st.suckless.org/patches/cyberpunk-neon/), credit where credit is due. - This profile implements the [Cyberpunk Neon colorscheme](https://github.com/Roboron3042/Cyberpunk-Neon) into spmenu. This was partially taken from the [st patch](https://st.suckless.org/patches/cyberpunk-neon/), credit where credit is due.
- [Doom One](https://git.speedie.site/spmenu/plain/themes/legacy/Doom-One) ![image](/pages/images/doom.png)
- [Doom One](https://git.speedie.site/spmenu/plain/themes/Doom-One.conf)
- Author: [speedie](https://speedie.site) ([speedie@speedie.site](mailto:speedie@speedie.site)) - Author: [speedie](https://speedie.site) ([speedie@speedie.site](mailto:speedie@speedie.site))
- This profile implements the [Doom One](https://github.com/doomemacs/themes) colorscheme into spmenu. For those of you that like DistroTube's dmenu, this should get you close to that look. - This profile implements the [Doom One](https://github.com/doomemacs/themes) colorscheme into spmenu. For those of you that like DistroTube's dmenu, this should get you close to that look.
- [Dracula](https://git.speedie.site/spmenu/plain/themes/legacy/Dracula) ![image](/pages/images/dracula.png)
- [Dracula](https://git.speedie.site/spmenu/plain/themes/Dracula.conf)
- Author: [speedie](https://speedie.site) ([speedie@speedie.site](mailto:speedie@speedie.site)) - Author: [speedie](https://speedie.site) ([speedie@speedie.site](mailto:speedie@speedie.site))
- This profile implements the [Dracula](https://draculatheme.com/) colorscheme into spmenu. - This profile implements the [Dracula](https://draculatheme.com/) colorscheme into spmenu.
- [Gruvbox (Dark)](https://git.speedie.site/spmenu/plain/themes/legacy/Gruvbox-Dark) ![image](/pages/images/gruvbox-dark.png)
- [Gruvbox (Dark)](https://git.speedie.site/spmenu/plain/themes/Gruvbox-Dark.conf)
- Author: [speedie](https://speedie.site) ([speedie@speedie.site](mailto:speedie@speedie.site)) - Author: [speedie](https://speedie.site) ([speedie@speedie.site](mailto:speedie@speedie.site))
- This profile implements the [Gruvbox Dark](https://github.com/morhetz/gruvbox) colorscheme into spmenu. - This profile implements the [Gruvbox Dark](https://github.com/morhetz/gruvbox) colorscheme into spmenu.
- [Disable global colors](https://git.speedie.site/spmenu/plain/themes/legacy/No-Global-Colors) - [Disable global colors](https://git.speedie.site/spmenu/plain/themes/No-Global-Colors.conf)
- Author: [speedie](https://speedie.site) ([speedie@speedie.site](mailto:speedie@speedie.site)) - Author: [speedie](https://speedie.site) ([speedie@speedie.site](mailto:speedie@speedie.site))
- This profile disables global colors, meaning programs like Pywal will not function with spmenu. This is nice if you want to use Pywal everywhere except spmenu. - This profile disables global colors, meaning programs like Pywal will not function with spmenu. This is nice if you want to use Pywal everywhere except spmenu.
- [Nord](https://git.speedie.site/spmenu/plain/themes/legacy/Nord) ![image](/pages/images/nord.png)
- [Nord](https://git.speedie.site/spmenu/plain/themes/Nord.conf)
- Author: [speedie](https://speedie.site) ([speedie@speedie.site](mailto:speedie@speedie.site)) - Author: [speedie](https://speedie.site) ([speedie@speedie.site](mailto:speedie@speedie.site))
- This profile implements the [Nord](https://www.nordtheme.com/) colorscheme into spmenu. - This profile implements the [Nord](https://www.nordtheme.com/) colorscheme into spmenu.
- [Solarized (Dark)](https://git.speedie.site/spmenu/plain/themes/legacy/Solarized-Dark) ![image](/pages/images/solarized-dark.png)
- [Solarized (Dark)](https://git.speedie.site/spmenu/plain/themes/Solarized-Dark.conf)
- Author: [speedie](https://speedie.site) ([speedie@speedie.site](mailto:speedie@speedie.site)) - Author: [speedie](https://speedie.site) ([speedie@speedie.site](mailto:speedie@speedie.site))
- This profile implements the [Solarized](https://ethanschoonover.com/solarized/) colorscheme into spmenu. Specifically the 'Dark' variant. - This profile implements the [Solarized](https://ethanschoonover.com/solarized/) colorscheme into spmenu. Specifically the 'Dark' variant.
- [Tokyo Night](https://git.speedie.site/spmenu/plain/themes/legacy/Tokyo-Night) ![image](/pages/images/solarized-light.png)
- [Solarized (Light)](https://git.speedie.site/spmenu/plain/themes/Solarized-Light.conf)
- Author: [speedie](https://speedie.site) ([speedie@speedie.site](mailto:speedie@speedie.site))
- This profile implements the [Solarized](https://ethanschoonover.com/solarized/) colorscheme into spmenu. Specifically the 'Light' variant.
![image](/pages/images/tokyo-night.png)
- [Tokyo Night](https://git.speedie.site/spmenu/plain/themes/Tokyo-Night.conf)
- Author: [speedie](https://speedie.site) ([speedie@speedie.site](mailto:speedie@speedie.site)) - Author: [speedie](https://speedie.site) ([speedie@speedie.site](mailto:speedie@speedie.site))
- This profile implements the [Tokyo Night](https://github.com/enkia/tokyo-night-vscode-theme) colorscheme into spmenu, ported from the VS Code theme. - This profile implements the [Tokyo Night](https://github.com/enkia/tokyo-night-vscode-theme) colorscheme into spmenu, ported from the VS Code theme.
### Official config files
- [dmenu](https://git.speedie.site/spmenu/plain/themes/dmenu.conf) - [dmenu](https://git.speedie.site/spmenu/plain/themes/dmenu.conf)
- Author: [speedie](https://speedie.site) ([speedie@speedie.site](mailto:speedie@speedie.site)) - Author: [speedie](https://speedie.site) ([speedie@speedie.site](mailto:speedie@speedie.site))
- This config tries to match dmenu as closely as possible, even stripping away spmenu only features to an extent. - This config tries to match dmenu as closely as possible, even stripping away spmenu only features to an extent.
@ -65,6 +92,74 @@ Tip: Use `Ctrl+f` to search through the page.
- Author: [speedie](https://speedie.site) ([speedie@speedie.site](mailto:speedie@speedie.site)) - Author: [speedie](https://speedie.site) ([speedie@speedie.site](mailto:speedie@speedie.site))
- This config is the default configuration for spmenu. This is automatically installed to `/usr/share/spmenu/spmenu.conf` so you *usually* don't need a copy of this. - This config is the default configuration for spmenu. This is automatically installed to `/usr/share/spmenu/spmenu.conf` so you *usually* don't need a copy of this.
### Official profiles
**NOTE: Profiles are only compatible with spmenu 1.0 and earlier. Users of 1.1 and later should use the newer theme.conf instead, along with optionally a theme manager.**
![image](/pages/images/arc-dark.png)
- [Arc Dark](https://raw.githubusercontent.com/speediegq/spmenu-themes/master/legacy/Arc-Dark)
- Author: [speedie](https://speedie.site) ([speedie@speedie.site](mailto:speedie@speedie.site))
- This profile implements the [Arc Dark theme](https://github.com/arc-design/arc-theme) into spmenu.
![image](/pages/images/catppucino.png)
- [Catppuccin](https://raw.githubusercontent.com/speediegq/spmenu-themes/master/legacy/Catppuccin)
- Author: [speedie](https://speedie.site) ([speedie@speedie.site](mailto:speedie@speedie.site))
- This profile implements the [Catppuccin theme](https://github.com/catppuccin/catppuccin) into spmenu which all furries seem to like.
![image](/pages/images/cyberpunk.png)
- [Cyberpunk Neon](https://raw.githubusercontent.com/speediegq/spmenu-themes/master/legacy/Cyberpunk-Neon)
- Author: [speedie](https://speedie.site) ([speedie@speedie.site](mailto:speedie@speedie.site))
- This profile implements the [Cyberpunk Neon colorscheme](https://github.com/Roboron3042/Cyberpunk-Neon) into spmenu. This was partially taken from the [st patch](https://st.suckless.org/patches/cyberpunk-neon/), credit where credit is due.
![image](/pages/images/doom.png)
- [Doom One](https://raw.githubusercontent.com/speediegq/spmenu-themes/master/legacy/Doom-One)
- Author: [speedie](https://speedie.site) ([speedie@speedie.site](mailto:speedie@speedie.site))
- This profile implements the [Doom One](https://github.com/doomemacs/themes) colorscheme into spmenu. For those of you that like DistroTube's dmenu, this should get you close to that look.
![image](/pages/images/dracula.png)
- [Dracula](https://raw.githubusercontent.com/speediegq/spmenu-themes/master/legacy/Dracula)
- Author: [speedie](https://speedie.site) ([speedie@speedie.site](mailto:speedie@speedie.site))
- This profile implements the [Dracula](https://draculatheme.com/) colorscheme into spmenu.
![image](/pages/images/gruvbox-dark.png)
- [Gruvbox (Dark)](https://raw.githubusercontent.com/speediegq/spmenu-themes/master/legacy/Gruvbox-Dark)
- Author: [speedie](https://speedie.site) ([speedie@speedie.site](mailto:speedie@speedie.site))
- This profile implements the [Gruvbox Dark](https://github.com/morhetz/gruvbox) colorscheme into spmenu.
- [Disable global colors](https://raw.githubusercontent.com/speediegq/spmenu-themes/master/legacy/No-Global-Colors)
- Author: [speedie](https://speedie.site) ([speedie@speedie.site](mailto:speedie@speedie.site))
- This profile disables global colors, meaning programs like Pywal will not function with spmenu. This is nice if you want to use Pywal everywhere except spmenu.
![image](/pages/images/nord.png)
- [Nord](https://raw.githubusercontent.com/speediegq/spmenu-themes/master/legacy/Nord)
- Author: [speedie](https://speedie.site) ([speedie@speedie.site](mailto:speedie@speedie.site))
- This profile implements the [Nord](https://www.nordtheme.com/) colorscheme into spmenu.
![image](/pages/images/solarized-dark.png)
- [Solarized (Dark)](https://raw.githubusercontent.com/speediegq/spmenu-themes/master/legacy/Solarized-Dark)
- Author: [speedie](https://speedie.site) ([speedie@speedie.site](mailto:speedie@speedie.site))
- This profile implements the [Solarized](https://ethanschoonover.com/solarized/) colorscheme into spmenu. Specifically the 'Dark' variant.
![image](/pages/images/solarized-light.png)
- [Solarized (Light)](https://raw.githubusercontent.com/speediegq/spmenu-themes/master/legacy/Solarized-Light)
- Author: [speedie](https://speedie.site) ([speedie@speedie.site](mailto:speedie@speedie.site))
- This profile implements the [Solarized](https://ethanschoonover.com/solarized/) colorscheme into spmenu. Specifically the 'Light' variant.
![image](/pages/images/tokyo-night.png)
- [Tokyo Night](https://raw.githubusercontent.com/speediegq/spmenu-themes/master/legacy/Tokyo-Night)
- Author: [speedie](https://speedie.site) ([speedie@speedie.site](mailto:speedie@speedie.site))
- This profile implements the [Tokyo Night](https://github.com/enkia/tokyo-night-vscode-theme) colorscheme into spmenu, ported from the VS Code theme.
### User-submitted profiles ### User-submitted profiles
### User-submitted config files ### User-submitted config files

44
pages/Using spmenu as a run launcher.md Normal file → Executable file
View file

@ -1,2 +1,44 @@
Using spmenu as a run launcher Using spmenu as a run launcher
============================== ==============================
spmenu provides an extensible Bash script called `spmenu_run`. This program handles listing of binaries in $PATH (all paths where binaries can be located), .desktop entries, file listing, and more. While it *is* just a Bash script, this is an advantage for those who like to extensively customize their run launcher. If you want to learn more about this, see [[Functions in spmenu_run]].
When running it for the first time, you should get a helpful message telling you how it works, because chances are most spmenu users are using it for the run launcher component. After that, by default $PATH will be used. The default behaviour can be set in the configuration file, `~/.config/spmenu/run/config`, which should be created when you run spmenu_run for the first time.
spmenu_run unlike dmenu_run does **not** pass arguments to the menu, because it uses arguments for itself. If you want to pass arguments to spmenu, you use the `-a` flag or `--args`. For example to set the prompt to `Run:`, you would do `spmenu_run --args "--prompt Run:"`. spmenu_run accepts more arguments, and you can see all of them by running `spmenu_run -h`. Of course, you can see spmenu arguments by running `spmenu -h`.
### General launcher
The normal, default run launcher mode lists out executables in $PATH. You can change the sorting of these items, as well as prevent duplicates. You can even choose to whitelist/blacklist certain entries in your config file.
As if this wasn't enough, if an awesome URL such as https://speedie.site is typed in, it will be opened in the user's default web browser. It should be noted that this also works with magnet links. You can also add your own. See [[Functions in spmenu_run]] for that.
If you prepend `#`, the selected item will be ran in the user's default terminal emulator instead of just a shell. For example, if you want to open `vim` you can just type in `#vim`. You can also prepend `?`, which will open the man page for the selected item. For example `?spmenu` will open the man page for spmenu. By default the man page will be displayed in spmenu, which is very useful. You can (of course) customize this. Typing in `?` alone will display the help you saw the first time you used spmenu_run.
### Desktop launcher
spmenu_run supports .desktop entries too. To use it, simply pass the `-d` argument to spmenu_run. By default it should take quite some time as it caches entries. To speed things up, arrays are used.
If `IMAGE=true` (default), images will also be parsed and displayed. You can set the directories spmenu will look for images in by overriding `ICON_DIR` in the config file. When an item is selected, the command will run as usual.
Note that when you want to display new entries, you need to refresh the cache.
### File manager
spmenu_run provides a basic file manager. To use it, pass the `-f` argument to spmenu_run. If you wish, you can also specify a path after. It doesn't actually do anything except list out files and directories, change directories and open files. However its very useful in shell scripting. The entries are (by default) colorized, as the standard `ls` command supports this. You can pass extra arguments to `ls` by overriding `LS_ARGS` in your config.
If `--stdout` is passed, the last selected **file** is output to standard output. Otherwise the selected file will be opened in an appropriate program determined by the file extension.
### Standard output
If you're going to be using spmenu_run to script, it may be useful to output the selected item to standard output rather than handling it directly. To enable this you can simply pass the `-o` flag or `--stdout` if you prefer. For example, to set a wallpaper you could do something like this:
`spmenu_run -fm ~/Wallpapers --stdout | xargs xwallpaper --stretch`
### Binding keys
speedwm uses spmenu by default as of 1.9, for other window manager you'll want to bind a keybind. Doing so is out of scope for this article though, check your window manager's documentation for this.
### More customization
For more advanced customization, you may want to consider using functions. It's not too difficult, especially if you're familiar with shell scripting. See [[Functions in spmenu_run]] for more information.

28
pages/Using spmenu on macOS.md Executable file
View file

@ -0,0 +1,28 @@
Using spmenu on macOS
=====================
spmenu (sort of) supports macOS. This is done through an X11 implementation for macOS called [XQuartz](https://www.xquartz.org/). It requires some extra effort however.
# Install Homebrew
Start by installing Homebrew (the package manager) on your Mac. From there run: `brew install libxft libxinerama xquartz libconfig libx11 freetype`. Make sure Xquartz is set up and functional before proceeding.
# Editing the buildconf.
**NOTE: The following instructions only apply to users of spmenu 1.0 and greater. Previous versions require a significant amount of work to get running.**
The buildconf is just a shell script that the build script (build.sh) reads. So if we want to append any options we simply edit this file.
First we need to set `PREFIX` to `/usr/local` instead of the default `/usr`. This is because Apple as of macOS 10.15 Catalina no longer allows us to write to `/usr/bin` and `/usr/share`. This avoids any `Permission denied` errors you may get (yes, even with sudo)
Now we need to set `pango=false`, `pangoxft=false`, `imlib2=false` and `openssl=false`. Currently, these features are **not supported** on macOS. [Should've installed a better operating system, bud.](https://archlinux.org)
# Compiling and installing
Now that we've edited our buildconf, we can simply run `sudo ./build.sh`.
# Notes
- Image support and Pango markup will not work, because spmenu was not compiled with those. It *is* possible to compile spmenu with support for this but it is not easy for the beginner, for various reasons.
- spmenu_run is non-functional, and it will warn you about this during runtime on 1.0 and greater.
- Profile menu does not work, it does absolutely nothing.

0
pages/Using the wiki.md Normal file → Executable file
View file

View file

@ -1,2 +1,26 @@
Wayland, and why it sucks. Wayland support
-------------------------- ---------------
As of now there are no plans to add Wayland support into spmenu. It is no secret that [I strongly dislike Wayland's ideas](https://speedie.site/articles/post56.php). That said, if someone wants to put in the work, it will be merged in. However not all hope is lost because for now and likely the very distant future, you'll be able to use spmenu on Wayland through XWayland, which is an X11 server running on Wayland.
spmenu has been tested on Hyprland using XWayland, and it works perfectly and feels like any native Wayland program. That said, please report any Wayland related issues you face.
If native Wayland support were to be added, it would require the following changes at a base minimum:
- Removal of .Xresources, at least on Wayland sessions
- .Xresources is an X11 feature, and Wayland does not seem to have anything like it. Due to the libconfig configuration I don't see it being a huge issue though.
- Rewritten keybinds
- Keybinds are done using libX11 which as the name implies is X11 specific. We would need to do this in some Wayland specific way, or at the very least find a library for handling keybinds which works on both protocols.
- Maybe do wrapper functions for keybindings.
- Rewritten drawing
- Drawing of everything will also have to be rewritten, because it all depends on X11 only libraries.
- spmenu uses a modified version of suckless' libdrw. Because it's a separate library we could potentially handle it all in the same function with the same argument, leading to cleaner code.
- I don't know how we detect if we're using an X11 or Wayland session
- Rewritten fonts
- Pango markup works fine, but currently spmenu uses libXft which is an X11 specific library and will not work .
- Cairo would be a good fit if we swap libXft out entirely. libXft has a long history of issues, so it would be a benefit on the X11 side too.
- Rewritten client creation and resizing
- Finally we would have to rewrite client creation and resizing.
- libXinerama would have to be replaced with something else for the Wayland side.
- Support both Wayland and X11
- I think it is important to support both X11 and Wayland, or at the very least decide on one during compile time and providing multiple packages (ie. `spmenu-x11` and `spmenu-wayland`).

0
pages/Where do I go?.md Normal file → Executable file
View file

View file

@ -1,16 +1,26 @@
Basics Getting Started
====== ===============
- [[Home]] - [[Home]]
- [[Where do I go?]] - [[Where do I go?]]
- [[Getting Started]] - [[Getting Started]]
Basics
======
- [[Using spmenu as a run launcher]] - [[Using spmenu as a run launcher]]
- [[A list of spmenu scripts]] - [[User scripts]]
- [[Configuring spmenu]] - [[Configuring spmenu]]
- [[User themes]]
Advanced Advanced
======== ========
- [[Scripting with spmenu]] - [[Scripting with spmenu]]
- [[Functions in spmenu_run]] - [[Functions in spmenu_run]]
- [[Extensive code documentation]] - [[Extensive code documentation]]
Frequently asked questions
==========================
- [[Wayland support]]

BIN
pages/images/arc-dark.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 242 KiB

BIN
pages/images/catppucino.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 280 KiB

BIN
pages/images/cyberpunk.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 396 KiB

BIN
pages/images/doom.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 442 KiB

BIN
pages/images/dracula.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 417 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 359 KiB

BIN
pages/images/nord.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 411 KiB

BIN
pages/images/preview.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 414 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 254 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 449 KiB

View file

@ -0,0 +1,4 @@
keybinds.h documentation
========================
TODO.

View file

@ -0,0 +1,4 @@
mouse.h documentation
=====================
TODO.