diff --git a/README.pdf b/README.pdf index cf7694c..8a69c07 100644 Binary files a/README.pdf and b/README.pdf differ diff --git a/code.pdf b/code.pdf index 14424f1..e3db57b 100644 Binary files a/code.pdf and b/code.pdf differ diff --git a/docs/docs.md b/docs/docs.md index d5f073f..2ee9c16 100644 --- a/docs/docs.md +++ b/docs/docs.md @@ -656,8 +656,8 @@ else on startup, as if this feature did not exist. Not only can profiles be used to configure color schemes and fonts, allowing you to swap color schemes quickly, but also any other options you may want. -Note that any profiles are applied ON TOP of the current loaded profile, meaning if -any options are missing from the selected profile, the setting in +Note that any profiles are applied ON TOP of the current loaded profile, +meaning if any options are missing from the selected profile, the setting in the profile used before will be used in place. There are a few color schemes for spmenu included in the repository, see @@ -665,14 +665,9 @@ the `themes/` directory. Feel free to copy those to your profile directory. ## Run launcher -spmenu includes a shell script called spmenu_run. It lists executable programs -in $PATH and displays them to the user in a list. Not only that but it shows -recently run programs first in the list. - -spmenu_run will interpret any arguments as spmenu arguments and pass them to -spmenu. Therefore `spmenu_run --prompt 'Run:'` will set the prompt to `Run:`. -While it is similar to dmenu_run (and achieves the same goal), this -version has some extra features. +spmenu includes a powerful Bash script called spmenu_run. It lists +executable programs in $PATH and displays them to the user in a list. +Not only that but it optionally shows recently run programs first in the list. The selected option is piped to /bin/sh (by default). Unlike dmenu_run, spmenu_run has some cool features. For example: @@ -690,15 +685,11 @@ without the prefix. Same goes for magnet links. You can also configure the run launcher through editing `~/.config/spmenu/run/config` which is configured in shell syntax. -## spmenu_desktop +In addition to the $PATH listing, spmenu_run also allows listing out +and displaying .desktop entries. It does this in style, too by displaying +the program icon. -In addition to the aforementioned `spmenu_run`, the spmenu package also provides -`spmenu_desktop` which instead of reading $PATH only lists out .desktop entries. - -Unlike the regular run launcher though, spmenu_desktop supports displaying an -icon for entries that use one. - -It can be configured through editing `~/.config/spmenu/desktop/config`. The +It can be configured through editing `~/.config/spmenu/run/config`. The configuration file can also be moved by setting `${XDG_CONFIG_HOME}`. ## spmenu commands @@ -725,5 +716,5 @@ license. See the included LICENSE file for more information. ## Reporting issues Please report issues on the -[Codeberg repository](https://codeberg.org/speedie/speediegq) or alternatively +[Codeberg repository](https://codeberg.org/speedie/spmenu) or alternatively email me. diff --git a/scripts/spmenu_run b/scripts/spmenu_run index 8ec8634..37d3631 100755 --- a/scripts/spmenu_run +++ b/scripts/spmenu_run @@ -187,6 +187,8 @@ cat << EOF > "$CONFDIR/spmenu/run/config" # '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. # # You may create those functions below. @@ -408,8 +410,14 @@ prepare_dirnav() { # TODO: read line by line so we can append/prepend whatever we want listing() { command -v fm_pre_list_func > /dev/null && fm_pre_list_func - ls "${ls_args[@]}" # this allows us SGR colors - printf "..\n" + ls "${ls_args[@]}" > /tmp/spmenu_ls_list # this allows us SGR colors + printf "..\n" >> /tmp/spmenu_ls_list + + while read -r l; do + command -v fm_line_func > /dev/null && fm_line_func "$l" + printf "%s\n" "$l" + done < "/tmp/spmenu_ls_list"; rm -f /tmp/spmenu_ls_list + command -v fm_post_list_func > /dev/null && fm_post_list_func } @@ -421,6 +429,7 @@ prepare_dirnav() { *) if [ -d "$dir" ]; then dir="$(pwd)/$dir" + command -v fm_dir_func > /dev/null && fm_dir_func "$dir" prepare_dirnav elif [ -f "$dir" ]; then exec_file "$dir" && return 0 diff --git a/spmenu.1 b/spmenu.1 index 015e3bb..a592a10 100644 --- a/spmenu.1 +++ b/spmenu.1 @@ -714,17 +714,11 @@ the \f[V]themes/\f[R] directory. Feel free to copy those to your profile directory. .SS Run launcher .PP -spmenu includes a shell script called spmenu_run. +spmenu includes a powerful Bash script called spmenu_run. It lists executable programs in $PATH and displays them to the user in a list. -Not only that but it shows recently run programs first in the list. -.PP -spmenu_run will interpret any arguments as spmenu arguments and pass -them to spmenu. -Therefore \f[V]spmenu_run --prompt \[aq]Run:\[aq]\f[R] will set the -prompt to \f[V]Run:\f[R]. -While it is similar to dmenu_run (and achieves the same goal), this -version has some extra features. +Not only that but it optionally shows recently run programs first in the +list. .PP The selected option is piped to /bin/sh (by default). Unlike dmenu_run, spmenu_run has some cool features. @@ -748,17 +742,13 @@ Same goes for magnet links. You can also configure the run launcher through editing \f[V]\[ti]/.config/spmenu/run/config\f[R] which is configured in shell syntax. -.SS spmenu_desktop .PP -In addition to the aforementioned \f[V]spmenu_run\f[R], the spmenu -package also provides \f[V]spmenu_desktop\f[R] which instead of reading -$PATH only lists out .desktop entries. -.PP -Unlike the regular run launcher though, spmenu_desktop supports -displaying an icon for entries that use one. +In addition to the $PATH listing, spmenu_run also allows listing out and +displaying .desktop entries. +It does this in style, too by displaying the program icon. .PP It can be configured through editing -\f[V]\[ti]/.config/spmenu/desktop/config\f[R]. +\f[V]\[ti]/.config/spmenu/run/config\f[R]. The configuration file can also be moved by setting \f[V]${XDG_CONFIG_HOME}\f[R]. .SS spmenu commands @@ -787,5 +777,5 @@ See the included LICENSE file for more information. .SS Reporting issues .PP Please report issues on the Codeberg -repository (https://codeberg.org/speedie/speediegq) or alternatively -email me. +repository (https://codeberg.org/speedie/spmenu) or alternatively email +me. diff --git a/spmenu.html b/spmenu.html index de1cf06..adcd3fc 100644 --- a/spmenu.html +++ b/spmenu.html @@ -961,13 +961,10 @@ the setting in the profile used before will be used in place.

see the themes/ directory. Feel free to copy those to your profile directory.

Run launcher

-

spmenu includes a shell script called spmenu_run. It lists executable -programs in $PATH and displays them to the user in a list. Not only that -but it shows recently run programs first in the list.

-

spmenu_run will interpret any arguments as spmenu arguments and pass -them to spmenu. Therefore spmenu_run --prompt 'Run:' will -set the prompt to Run:. While it is similar to dmenu_run -(and achieves the same goal), this version has some extra features.

+

spmenu includes a powerful Bash script called spmenu_run. It lists +executable programs in $PATH and displays them to the user in a list. +Not only that but it optionally shows recently run programs first in the +list.

The selected option is piped to /bin/sh (by default). Unlike dmenu_run, spmenu_run has some cool features. For example: