Replace setext header styles with atx header styles, make fully markdown

line length compliant
This commit is contained in:
speedie 2023-06-20 10:37:55 +02:00
parent d045fc9acb
commit b310536e78
23 changed files with 394 additions and 220 deletions

View file

@ -1,7 +1,8 @@
Compiling spmenu
================
# Compiling spmenu
### Existing packages
This article goes through compiling spmenu from source code.
## Existing packages
Note that I offer spmenu packages for both Arch and Gentoo. The Gentoo packages
(ebuilds) can be had from [my overlay](https://git.speedie.site/speedie/speedie-overlay).
@ -16,7 +17,7 @@ always going to be accurate for the latest spmenu version from Git, and not
any release version. For exact instructions, you may want to see the included
`README.md` file bundled with your chosen spmenu version.
### Supported operating systems
## Supported operating systems
This is not some arbitrary requirement. While it may run if it's not listed
here, I will not be providing support due to having a lack of experience with
@ -33,7 +34,7 @@ spmenu on macOS using `Xquartz`.
of them. Try it and see if it works. If it doesn't please try and fix it.
You know more about the BSDs than I do.
### Dependencies
## Dependencies
spmenu has several dependencies, but most of them are optional.
@ -64,7 +65,7 @@ disabled during compile time.
- meson
- Used to compile spmenu, not optional unless you're experienced with build systems.
### Compiling spmenu
## Compiling spmenu
You can get spmenu [from git](https://git.speedie.site/speedie/spmenu) or from
a [release tarball](https://ls.speedie.site/?b=releases%2Fspmenu).

View file

@ -2,7 +2,8 @@ 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.
through a config file. The default config file *should* have the default
keybinds already.
### List of valid modes

View file

@ -1,7 +1,14 @@
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.
# Configuring spmenu
What may be useful to know is that keybinds in your spmenu.conf (by default) override **all** hardcoded keybindings. This is because
otherwise keybindings can conflict or be executed twice. This creates a problem, because if a new function is implemented the user must manually add it to their config or restore the default config. This is the case with the fullscreen image feature.
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.
What may be useful to know is that keybinds in your spmenu.conf (by default)
override **all** hardcoded keybindings. This is because otherwise keybindings
can conflict or be executed twice. This creates a problem, because if a new
function is implemented the user must manually add it to their config or
restore the default config. This is the case with the fullscreen image feature.

View file

@ -1,10 +1,9 @@
Cool spmenu tricks
==================
# Cool spmenu tricks
This wiki article is intended to be a list of cool things you can do with
spmenu that I find very useful, and have changed the way I use my computer.
1. clipmenu-spmenu
- clipmenu-spmenu
This is listed in [[User scripts]] too, but clipmenu is extremely useful.
With clipmenu, everything in the clipboard is saved, and you can easily pull up
@ -13,18 +12,22 @@ a spmenu list of everything in your clipboard and then use it again.
If you're the kind of person that copies a lot of text all the time and then later
wants to use that same text again, this script is extremely useful.
2. spmenu_run: Web searches
- spmenu_run: Web searches
If you've read [[Functions in spmenu_run]] you're already aware that things like this
can be done with ease, but here's another use of the `run_post_func()` function.
If you've read [[Functions in spmenu_run]] you're already aware that things
like this can be done with ease, but here's another use of the
`run_post_func()` function.
Open `~/.config/spmenu/run/config` and add a function like this to the config:
```
```Shell
run_post_func() {
case "${1:0:1}" in # first char
"s") query="$(printf "%s\n" "$1" | sed "s/s //; s/ /+/g")" && chromium "http://localhost:8888/search?q=$query"; ;;
"s") query="$(printf "%s\n" "$1" | sed "s/s //; s/ /+/g")" && chromium
"http://localhost:8888/search?q=$query";
;;
esac
}
```
Note that you should replace `http://localhost:8888` here with the search engine
@ -36,13 +39,18 @@ we also replace all spaces with `+`, which search engines translate into a space
You can easily add more search engines, too if you want.
```
```Shell
run_post_func() {
case "${1:0:1}" in # first char
"s") query="$(printf "%s\n" "$1" | sed "s/s //; s/ /+/g")" && chromium "http://localhost:8888/search?q=$query" ;;
"d") query="$(printf "%s\n" "$1" | sed "s/d //; s/ /+/g")" && chromium "https://duckduckgo.com/search?q=$query" ;;
"r") query="$(printf "%s\n" "$1" | sed "s/r //; s/ /+/g")" && chromium "https://reddit.com/search?q=$query" ;;
"s") query="$(printf "%s\n" "$1" | sed "s/s //; s/ /+/g")" && chromium
"http://localhost:8888/search?q=$query" ;; "d") query="$(printf "%s\n"
"$1" | sed "s/d //; s/ /+/g")" && chromium
"https://duckduckgo.com/search?q=$query" ;; "r") query="$(printf "%s\n"
"$1" | sed "s/r //; s/ /+/g")" && chromium
"https://reddit.com/search?q=$query"
;;
esac
}
```
In this example, I've added duckduckgo searches using the `d` prefix and Reddit

View file

@ -1,5 +1,4 @@
Extensive code documentation
============================
# Extensive code documentation
Some of spmenu's code documented. If you want to hack on the project, this
should be useful. Note that these may be renamed in the future to make the
@ -7,7 +6,7 @@ codebase easier to understand and make changes to. Also note that this is
**definitely not** a complete list. Contributions that help expand this
would be greatly appreciated.
## Position and width/height variables
- Position and width/height variables
- `bh`
- Menu height divided by lines gets you `bh`. The name comes from dwm's `bh`
@ -106,7 +105,7 @@ would be greatly appreciated.
- Cursor/caret position. When text is added to the input, the width of that text
is added to this.
## Cairo functions
- Cairo functions
Most of these are in `libs/libdrw/drw.c` and `libs/libdrw/drw.h`
@ -114,7 +113,7 @@ Most of these are in `libs/libdrw/drw.c` and `libs/libdrw/drw.h`
- This function converts hex #RRGGBB colors into RGB format and sets the
cairo color to the color.
## Drawable abstraction functions
- Drawable abstraction functions
Most of these are in `libs/libdrw/drw.c` and `libs/libdrw/drw.h`.
@ -134,7 +133,7 @@ unsigned int h, Visual *visual, unsigned int depth, Colormap cmap);`
- This function will free the drawable from memory. It is *usually* called in
cleanup functions like `cleanup()` so most of the time you don't need to use this.
## Font abstraction functions
- Font abstraction functions
Most of these are in `libs/libdrw/drw.c` and `libs/libdrw/drw.h`.
@ -152,14 +151,14 @@ Most of these are in `libs/libdrw/drw.c` and `libs/libdrw/drw.h`.
int *w, unsigned int *h, Bool markup);`
- This function returns the length of the text with the used font.
## Cursor abstraction functions
- Cursor abstraction functions
- `drw_cur_create(Drw *drw, int shape);`
- This function creates and returns a cursor.
- `drw_cur_free(Drw *drw, Cur *cursor);`
- This function will free the cursor from memory.
## Drawing functions
- Drawing functions
- `drw_rect(Drw *drw, int x, int y, unsigned int w, unsigned int h, int filled
, int invert);`
@ -170,7 +169,7 @@ int lpad, const char *text, int invert, Bool markup);`
- Draws text on the drawable using the font created. `const char *text`
contains the text itself.
## Map functions
- Map functions
- `drw_map(Drw *drw, Window win, int x, int y, unsigned int w, unsigned int h);`
- Maps the drawable. (makes it visible)

View file

@ -1,7 +1,11 @@
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.
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.
@ -12,21 +16,35 @@ spmenu_run has a configuration file located in ~/.config/spmenu/run/config, whic
- '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.
- '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:
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:
```Shell
read_man() {
man "$1" | col -b | ${RUNLAUNCHER:-spmenu} --lines 40 --columns 1 -p "man $1"
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.
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.
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.
```Shell
run_pre_func() {
printf "discord\nelement\n"
}
@ -37,32 +55,48 @@ Let's say we want to display a few more entries in the run launcher. Let's say w
"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.
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.**
**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.
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.
```Shell
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)
*.pdf) zathura "$1"; exit 0 ;;
*.md|*.php|*.txt|*.c|*.h|*.css|*.conf) nvim "$1"; exit 0 ;;
*.html|*.htm) chromium "$1"; exit 0 ;;
*.png|*.jpg|*.jpeg|*.gif|*.tiff) nsxiv "$1"; exit 0 ;;
*.mp4|*.mkv|*.mp3|*.flac|*.wav) mpv "$1"; exit 0 ;;
*) [ ! -x "$1" ] && nvim "$1"; exit 0 ;;
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.
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.
Another one for the file launcher. This one however **requires** spmenu 1.0.
This function will display images if possible.
```Shell
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.
Note that this may add a lot of slowdown in some cases. Use with care, and feel
free to adjust.

View file

@ -1,12 +1,28 @@
Generating themes
=================
# Generating themes
The spmenu build script `spmenu_make` has a `theme` feature. As the name implies, this script generates a theme. Specifically it generates a theme from 18 different colors.
The spmenu build script `spmenu_make` has a `theme` feature. As the name
implies, this script generates a theme. Specifically it generates a theme from
18 different colors.
Creating a color list is the first step. This can be any file. For this article we're going to assume the file is `./colors`. In there you want to set 18 different colors. The first 16 are going to be set in the same order you set terminal colors. For the two last colors, color #17 is the foreground color and color #18 is the background color. Note that colors will be reused.
Creating a color list is the first step. This can be any file. For this article
we're going to assume the file is `./colors`. In there you want to set 18
different colors. The first 16 are going to be set in the same order you set
terminal colors. For the two last colors, color #17 is the foreground color and
color #18 is the background color. Note that colors will be reused.
Now that we have a color list, we can start generating a theme. To do this, run `scripts/spmenu_make theme ./colors` where obviously colors is the color list. This will output directly to standard output, so you may want to redirect this into a file. For testing, I usually do something like `scripts/spmenu_make theme ./colors > scheme && spmenu_test -tm ./scheme`.
Now that we have a color list, we can start generating a theme. To do this, run
`scripts/spmenu_make theme ./colors` where obviously colors is the color list.
This will output directly to standard output, so you may want to redirect this
into a file. For testing, I usually do something like `scripts/spmenu_make
theme ./colors > scheme && spmenu_test -tm ./scheme`.
It should be noted that the script doesn't provide an easy way to move around colors just yet, so it is assumed that you have a basic level of shell scripting knowledge here if you want to do that. If colors are incorrectly defined in your color list, the color will be set to #000000 as a default. Unless #000000 is part of your colorscheme, this is a good indication something is wrong.
It should be noted that the script doesn't provide an easy way to move around
colors just yet, so it is assumed that you have a basic level of shell
scripting knowledge here if you want to do that. If colors are incorrectly
defined in your color list, the color will be set to #000000 as a default.
Unless #000000 is part of your colorscheme, this is a good indication something
is wrong.
Now that we have a proper theme, we can use it. If you're using [spmenuify](https://git.speedie.site/speedie/spmenuify) you can simply choose 'Install' and navigate to the scheme you output.
Now that we have a proper theme, we can use it. If you're using
[spmenuify](https://git.speedie.site/speedie/spmenuify) you can simply choose
'Install' and navigate to the scheme you output.

View file

@ -1,5 +1,4 @@
Getting Started
---------------
# Getting Started
spmenu is a simple X11 and Wayland menu application which takes standard input, parses
it, lets the user choose an option and sends the selected option to standard output.
@ -13,12 +12,12 @@ spmenu introduces many new features which can be useful in shell scripting.
It also serves as a dmenu replacement for Wayland users.
### Installing spmenu
## Installing spmenu
For up-to-date compilation instructions for spmenu, see [[Compiling spmenu]] or
your bundled README.md.
### Using spmenu as a run launcher
## Using spmenu as a run launcher
There is a more detailed article covering this, called
[[Using spmenu as a run launcher]]. If you just want the basics though,
@ -38,7 +37,7 @@ with your selected item/input in the configuration file
which can be found at `~/.config/spmenu/run/config`.
Doing so is covered in [[Functions in spmenu_run]].
### Using spmenu as a .desktop entry launcher
## Using spmenu as a .desktop entry launcher
On the other hand, `spmenu_run` provides a .desktop launcher mode as well.
To use it, you simply run `spmenu_run -d`. The first time you run this
@ -59,7 +58,7 @@ To clear the cache manually, simply run `spmenu_run -cc`.
If you wish to clear the cache every time (this is quite slow), do
`spmenu_run -cc -d`.
### Using spmenu to parse text
## Using spmenu to parse text
The core concept of spmenu is to take standard input (or the contents
of a file), parse it and allow the user to select an item. All scripts
@ -67,14 +66,14 @@ written for spmenu use this concept.
This is covered in more detail in the article [[Using spmenu to parse text]].
### Customizing spmenu_run
## Customizing spmenu_run
To customize `spmenu_run`, you can edit the configuration file
which is `~/.config/spmenu/run/config`. For even more customization
you can also use functions. A dedicated page for functions exists,
called [[Functions in spmenu_run]].
### Customizing spmenu
## Customizing spmenu
A basic configuration file can be found at `/usr/share/spmenu/spmenu.conf`.
You can use this configuration file by simply copying it to
@ -85,7 +84,7 @@ This configuration file can be edited using any text editor you want.
If you're the kind of person who likes to have many themes, you may want
to consider checking out [[User themes]] and the powerful `theme.conf`.
### That's it
## That's it
That's it. That's all you need to know to get started with spmenu.. and
a little more for good measure. From here, you can take a break, or check

View file

@ -1,15 +1,17 @@
![preview image](/pages/images/banner.png)
Welcome to the spmenu wiki!
---------------------------
# Welcome to the spmenu wiki
spmenu is a simple X11 and Wayland menu application which takes standard input, parses
it, lets the user choose an option and sends the selected option to standard output.
It also serves as a run launcher and desktop launcher through the included shell script `spmenu_run`, which handles both $PATH
listing, .desktop entries, and file listing.
It also serves as a run launcher and desktop launcher through the included
shell script `spmenu_run`, which handles both $PATH listing, .desktop entries,
and file listing.
To contribute to the wiki, please submit issues/pull requests at [the Git repository](https://git.speedie.site/speedie/spmenu-wiki). The README contains instructions on how to do so.
To contribute to the wiki, please submit issues/pull requests at [the Git
repository](https://git.speedie.site/speedie/spmenu-wiki). The README contains
instructions on how to do so.
See also:

View file

@ -1,5 +1,4 @@
Pywal integration with wallpaper-spmenu
=======================================
# Pywal integration with wallpaper-spmenu
This wiki article goes through Pywal integration with
[wallpaper-spmenu](https://git.speedie.site/speedie/wallpaper-spmenu),
@ -16,14 +15,14 @@ What we want to do is append some extra lines to the `set_wallpaper.sh`
script. This script is the script that sets the wallpaper, and is usually
autostarted by your window manager, if you've set it up to be autostarted.
### Creating a post_write_script() hook function
## Creating a post_write_script() hook function
Open the config file up in your favorite text editor. You need to add a
`post_write_script()` function to this file. This function as the name
implies executes whenever the `set_wallpaper.sh` has been changed. A
simple example function might look like this:
```
```Shell
post_write_script() {
cat << EOF >> "$WALLPAPER_CONFIG_DIR/set_wallpaper.sh"
wal -nqi "$1"
@ -38,7 +37,7 @@ Pywal cache before `wal -nqi "$1"`.
If you want to replicate the behaviour of the old `speedwm-swal` script,
you might want your function to look like this:
```
```Shell
post_write_script() {
cat << EOF >> "$WALLPAPER_CONFIG_DIR/set_wallpaper.sh"
@ -64,7 +63,7 @@ command -v speedwm > /dev/null && \
It should be noted that some of this is speedwm specific, and as such
should be deleted if you're using a different window manager/compositor.
### startpage integration
## startpage integration
If you're using [startpage](https://git.speedie.site/speedie/startpage),
and wish to copy the wallpaper, you'll need to copy the script for your
@ -83,7 +82,7 @@ Do note that older versions of the startpage may set CWAL to
If this is the case then you'll want to change it to
`$HOME/.config/wallpaper-spmenu/currentwallpaper`.
### speedwm dynamic reloading integration
## speedwm dynamic reloading integration
To reload colors automatically, you should add
`xrdb ~/.cache/wal/colors.Xresources` and
@ -92,4 +91,3 @@ the file. The libspeedwm line simply signals to speedwm that
it should attempt to reload .Xresources. The xrdb line loads
the Pywal colors, and must therefore be added before the
libspeedwm line.

View file

@ -1,19 +1,28 @@
Reading files
=============
# Reading files
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.
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 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.
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:
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
@ -28,4 +37,7 @@ func &
spmenu -lf /tmp/date-file -p "The time is:"
```
[speedwm-extras](https://git.speedie.site/speedie/speedwm-extras)' speedwm-btctrl uses this feature to load Bluetooth entries every 5 seconds. There are more example scripts that also read from file in the `scripts/examples` directory.
[speedwm-extras](https://git.speedie.site/speedie/speedwm-extras)'
speedwm-btctrl uses this feature to load Bluetooth entries every 5 seconds.
There are more example scripts that also read from file in the
`scripts/examples` directory.

View file

@ -1,17 +1,16 @@
Scripting with spmenu
=====================
# Scripting with spmenu
This wiki article walks you through how to actually write a script using spmenu.
# Deciding what to write
## 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
## 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
## Starting off
First, I like to start off my scripts with a `main` function. I would start like this:

View file

@ -1,5 +1,4 @@
Basics
======
# Basics
- [[Home]]
- [[Getting Started]]
@ -8,8 +7,7 @@ Basics
- [[User scripts]]
- [[User themes]]
Hacker
======
## Hacker
- [[Scripting with spmenu]]
- [[Functions in spmenu_run]]

View file

@ -1,15 +1,13 @@
Theme managers
==============
# Theme managers
This article is intended to be a list of theme managers that can be installed and used.
spmenu does not decide or care 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.
This article is intended to be a list of theme managers that can be installed
and used. spmenu does not decide or care 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/speedie/spmenuify) for
an example on how to do this.
# Theme managers
- [spmenuify](https://git.speedie.site/speedie/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.
- spmenuify is the official theme manager for spmenu. It allows installation,
previewing, enabling and disabling of themes.

View file

@ -1,14 +1,18 @@
A list of spmenu scripts
========================
# 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 what the script does and the license.**
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 what the script does and the license.**
## Useful
- [clipmenu-spmenu](https://git.speedie.site/speedie/clipmenu-spmenu)
- Author: [Chris Down](https://github.com/cdown), [speedie](https://speedie.site) ([speedie@speedie.site](mailto:speedie@speedie.site))
- 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.
- 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.
- [pass-spmenu](https://git.speedie.site/speedie/pass-spmenu)
- Author: [speedie](https://speedie.site) ([speedie@speedie.site](mailto:speedie@speedie.site))
- License: GNU General Public License version 3.0
@ -31,15 +35,22 @@ This article is for various scripts written with spmenu. Anyone may add their sc
using spmenu and copy them to the clipboard, save them or upload them
to a file sharing site.
- [pirokit-spmenu](https://git.speedie.site/speedie/pirokit-spmenu)
- Author: [Bugswriter](https://github.com/Bugswriter), [speedie](https://speedie.site) ([speedie@speedie.site](mailto:speedie@speedie.site))
- Author: [Bugswriter](https://github.com/Bugswriter),
[speedie](https://speedie.site) ([speedie@speedie.site](mailto:speedie@speedie.site))
- License: MIT
- Script to get magnet links from 1337x. Fork of Bugswriter's pirokit that uses spmenu.
- Script to get magnet links from 1337x. Fork of Bugswriter's pirokit that
uses spmenu.
- [iron-spmenu](https://git.speedie.site/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.
- 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.
- [speedwm-extras](https://git.speedie.site/speedie/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.
- 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.

View file

@ -1,123 +1,157 @@
User themes
===========
# User themes
![image](/pages/images/spmenu-themes.gif)
**For Pywal notes, see [[Using Pywal with spmenu]].**
spmenu has since version 1.1 supported user themes. Themes override the overall design of spmenu, through for example defining colors. Version 0.3 through 1.0 supported profiles. Profiles are no longer supported in spmenu, but you can still find the old profiles [here](https://git.speedie.site/speedie/spmenu-themes).
spmenu has since version 1.1 supported user themes. Themes override the
overall design of spmenu, through for example defining colors.
Version 0.3 through 1.0 supported profiles. Profiles are no longer supported
in spmenu, but you can still find the old profiles
[here](https://git.speedie.site/speedie/spmenu-themes).
This wiki article is meant 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 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.
You may also want to see [[Theme managers]] for a list of theme managers that can be used to install these. If you do not want to use a theme manager, simply copy the theme you want to use to `~/.config/spmenu/theme.conf`
You may also want to see [[Theme managers]] for a list of theme managers that
can be used to install these. If you do not want to use a theme manager, simply
copy the theme you want to use to `~/.config/spmenu/theme.conf`
Tip: Use `Ctrl+f` to search through the page.
### Themes
## Themes
- [Default](https://git.speedie.site/speedie/spmenu/raw/branch/master/docs/spmenu.conf)
- 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.
- [Classic](https://git.speedie.site/speedie/spmenu-themes/raw/branch/master/Classic.conf)
- Author: [speedie](https://speedie.site) ([speedie@speedie.site](mailto:speedie@speedie.site))
- This config is the default configuration for spmenu used in version 2.0.1 and earlier.
- This config is the default configuration for spmenu used in version 2.0.1
and earlier.
![image](/pages/images/arc-dark.png)
- [Arc Dark](https://git.speedie.site/speedie/spmenu-themes/raw/branch/master/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.
- 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/speedie/spmenu-themes/raw/branch/master/Catppuccin.conf)
- 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.
![image](/pages/images/cyberpunk.png)
- [Cyberpunk Neon](https://git.speedie.site/speedie/spmenu-themes/raw/branch/master/Cyberpunk-Neon.conf)
- 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/).
![image](/pages/images/doom.png)
- [Doom One](https://git.speedie.site/speedie/spmenu-themes/raw/branch/master/Doom-One.conf)
- 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.
![image](/pages/images/dracula.png)
- [Dracula](https://git.speedie.site/speedie/spmenu-themes/raw/branch/master/Dracula.conf)
- Author: [speedie](https://eedie.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.
![image](/pages/images/gruvbox-dark.png)
- [Gruvbox (Dark)](https://git.speedie.site/speedie/spmenu-themes/raw/branch/master/Gruvbox-Dark.conf)
- 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.
![image](/pages/images/gruvbox-light.png)
- [Gruvbox (Light)](https://git.speedie.site/speedie/spmenu-themes/raw/branch/master/Gruvbox-Light.conf)
- Author: [speedie](https://speedie.site) ([speedie@speedie.site](mailto:speedie@speedie.site))
- This profile implements the [Gruvbox Light](https://github.com/morhetz/gruvbox) colorscheme into spmenu.
- This profile implements the [Gruvbox Light](https://github.com/morhetz/gruvbox)
colorscheme into spmenu.
![image](/pages/images/gruvbox-material.png)
- [Gruvbox Material](https://git.speedie.site/speedie/spmenu-themes/raw/branch/master/Gruvbox-Material.conf)
- Author: [speedie](https://speedie.site) ([speedie@speedie.site](mailto:speedie@speedie.site))
- This profile implements the [Gruvbox Material](https://github.com/sainnhe/gruvbox-material) colorscheme into spmenu.
- This profile implements the [Gruvbox
Material](https://github.com/sainnhe/gruvbox-material) colorscheme into
spmenu.
![image](/pages/images/everforest.png)
- [Everforest (Dark)](https://git.speedie.site/speedie/spmenu-themes/raw/branch/master/Everforest-Dark.conf)
- Author: [speedie](https://speedie.site) ([speedie@speedie.site](mailto:speedie@speedie.site))
- This profile implements the [Everforest](https://github.com/sainnhe/everforest) colorscheme into spmenu.
- Author: [speedie](https://speedie.site)
([speedie@speedie.site](mailto:speedie@speedie.site)) - This profile
implements the [Everforest](https://github.com/sainnhe/everforest)
colorscheme into spmenu.
![image](/pages/images/nord.png)
- [Nord](https://git.speedie.site/speedie/spmenu-themes/raw/branch/master/Nord.conf)
- 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.
![image](/pages/images/solarized-dark.png)
- [Solarized (Dark)](https://git.speedie.site/speedie/spmenu-themes/raw/branch/master/Solarized-Dark.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 'Dark' variant.
- 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://git.speedie.site/speedie/spmenu-themes/raw/branch/master/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.
- 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/ocean-dark.png)
- [Ocean (Dark)](https://git.speedie.site/speedie/spmenu-themes/raw/branch/master/Ocean-Dark.conf)
- Author: [speedie](https://speedie.site) ([speedie@speedie.site](mailto:speedie@speedie.site))
- This profile implements the Ocean Dark colorscheme into spmenu. Not sure who made the original theme, I got it from [terminal.sexy](https://terminal.sexy).
- This profile implements the Ocean Dark colorscheme into spmenu. Not sure
who made the original theme, I got it from
[terminal.sexy](https://terminal.sexy).
![image](/pages/images/one-half-dark.png)
- [One Half (Dark)](https://git.speedie.site/speedie/spmenu-themes/raw/branch/master/One-Half-Dark.conf)
- Author: [speedie](https://speedie.site) ([speedie@speedie.site](mailto:speedie@speedie.site))
- This profile implements the One Half colorscheme into spmenu, specifically the dark variant.
- This profile implements the One Half colorscheme into spmenu, specifically
the dark variant.
![image](/pages/images/one-half-light.png)
- [One Half (Light)](https://git.speedie.site/speedie/spmenu-themes/raw/branch/master/One-Half-Light.conf)
- Author: [speedie](https://speedie.site) ([speedie@speedie.site](mailto:speedie@speedie.site))
- This profile implements the One Half colorscheme into spmenu, specifically the light variant.
- Author: [speedie](https://speedie.site)
([speedie@speedie.site](mailto:speedie@speedie.site)) - This profile
implements the One Half colorscheme into spmenu, specifically the light
variant.
![image](/pages/images/tokyo-night.png)
- [Tokyo Night](https://git.speedie.site/speedie/spmenu-themes/raw/branch/master/Tokyo-Night.conf)
- 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.
![image](/pages/images/x-erosion.png)
@ -139,4 +173,5 @@ Tip: Use `Ctrl+f` to search through the page.
- [dmenu](https://git.speedie.site/speedie/spmenu-themes/raw/branch/master/dmenu.conf)
- 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.

View file

@ -1,5 +1,4 @@
Using Pywal with spmenu
=======================
# Using Pywal with spmenu
Using Pywal with spmenu is quite trivial, but the steps will vary depending on
whether you're using X11 or Wayland. Using Pywal with spmenu on X11 is slightly
@ -23,9 +22,10 @@ A `pywal` template can be found
You'll want to create the directory `~/.config/wal/templates` if it doesn't
already exist and move this file there.
Now that you have the template added, you can run `wal` to generate the theme. A theme
will now be placed in `~/.cache/wal/colors.spmenu` which can be installed and enabled
either using the argument or by copying it to `~/.config/spmenu/theme.conf`.
Now that you have the template added, you can run `wal` to generate the theme.
A theme will now be placed in `~/.cache/wal/colors.spmenu` which can be
installed and enabled either using the argument or by copying it to
`~/.config/spmenu/theme.conf`.
**NOTE: The following instructions do not apply to users of spmenu 2.0.1 and earlier.
Users of earlier versions should copy the theme to theme.conf every time a new colorscheme
@ -36,14 +36,14 @@ now edit your `spmenu.conf` again, and in there you'll want to set `themefile` t
your Pywal cache file. When you're done the `file` section should look something
like this:
```
```C
/* File options */
file = ( { xresources = 1; // Load .Xresources on startup (0/1)
global = 1; // Read global .Xresources colors, programs like Pywal use this. (*.color0, *.color1, etc.) (0/1)
theme = 1; // Load theme (~/.config/spmenu/theme.conf) on runtime
binds = 1; // Load binds (~/.config/spmenu/binds.conf) on runtime
themefile = "/home/speedie/.cache/wal/colors.spmenu"; // Path to theme file to load on runtime. NULL means default.
bindsfile = "NULL"; // Path to binds file to load on runtime. NULL means default.
file = ( { xresources = 1;
global = 1;
theme = 1;
binds = 1;
themefile = "/home/speedie/.cache/wal/colors.spmenu";
bindsfile = "NULL";
} );
```

View file

@ -1,44 +1,72 @@
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]].
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.
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`.
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
## 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.
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.
As if this wasn't enough, if an awesome URL such as
[https://speedie.site](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.
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
## 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.
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.
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
## 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
## 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
## Binding keys
See your window manager/desktop environment configuration file/man page for more information.
### More customization
## 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.

View file

@ -1,29 +1,35 @@
Using spmenu on macOS
=====================
# Using spmenu on macOS
**NOTE: This article is out of date and should no longer be considered accurate information. Read at your own risk.**
**NOTE: This article is out of date and should no longer be considered accurate
information. Read at your own risk.**
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.
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
## 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.
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.
## 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.**
**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)
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)
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
## 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.

View file

@ -1,5 +1,4 @@
Using spmenu to parse text
==========================
# Using spmenu to parse text
spmenu itself accepts standard input and this is a fact all scripts/programs
written for spmenu depend on. It's a core feature of spmenu. Nearly all of

View file

@ -0,0 +1,25 @@
# Using spmenu with GNOME
The GNOME desktop environment works perfectly with spmenu if you are using an
X11 session. If you're using a Wayland session however, it gets a little more
complicated.
GNOME, more specifically Mutter does not implement the wlr-layer-shell protocol
spmenu and other programs like it use. According to them it's because that is
not how GNOME is designed to work, so it's not the right place for this either.
([#973](https://gitlab.gnome.org/GNOME/mutter/-/issues/973)). This is very
frustrating, and as a result spmenu cannot run as a native Wayland program on
GNOME, it's not possible. Thanks GNOME.
However, spmenu can still be used on Wayland using X11 and XWayland. If you're
using a version of spmenu released after commit `ebd625ba1e`, spmenu will
automatically check for GNOME Wayland based on whether the
`$GNOME_SETUP_DISPLAY` variable is exported. If you're on an older version of
spmenu or the variable just isn't set, you can open up
`~/.config/spmenu/spmenu.conf` and set `protocol` to `0`, forcing X11 mode to
be used.
Thankfully, in X11 mode GNOME treats spmenu like an overlay anyway, unlike
wlroots based compositors so running spmenu in XWayland likely isn't going to
be noticeable, even if it's less than ideal. But hey, at least you get to keep
some X11 specific features, which cannot be ported over to Wayland.

View file

@ -1,4 +1,3 @@
binds.conf documentation
========================
# binds.conf documentation
TODO.

View file

@ -1,4 +1,3 @@
theme.conf documentation
========================
# theme.conf documentation
TODO.