forked from speedie/spmenu
master #1
|
@ -182,3 +182,5 @@ Before contributing, please see [this article](https://spmenu.speedie.site/Contr
|
|||
spmenu has [a wiki](https://spmenu.speedie.site) for more extensive
|
||||
documentation. Contributions to the wiki are appreciated, and
|
||||
can be done through [the Git repository](https://git.speedie.site/speedie/spmenu-wiki).
|
||||
|
||||
If you need help, you can also check out [my Matrix space](https://matrix.speedie.site).
|
||||
|
|
|
@ -52,6 +52,11 @@ cache (useful if you just installed/uninstalled a program) run `spmenu_run -cc`.
|
|||
**NOTE: By default it will hide any entries matching `spmenu` (for convenience)
|
||||
but you can unhide these if you wish through the configuration file.**
|
||||
|
||||
Flatpaks are also functional, provided they use valid .desktop entries. You
|
||||
can use Flatpaks with spmenu_run by passing `-d`. $DESKTOP_DIR and
|
||||
$ICON_DIR must contain Flatpak paths though. If you have a new config,
|
||||
these variables should be defined properly already.
|
||||
|
||||
## Bookmarking
|
||||
|
||||
spmenu_run provides bookmarking entries or just general text if preferred. To
|
||||
|
|
13
scripts/spmenu_desktop
Normal file → Executable file
13
scripts/spmenu_desktop
Normal file → Executable file
|
@ -67,7 +67,7 @@ print_desktop_list() {
|
|||
|
||||
[ "$PRINT_LOGS_STDERR" = "true" ] && printf "spmenu_run: Updating .desktop entries.\n" >> /dev/stderr
|
||||
|
||||
icons="$(find "${icondir[@]}" -type f 2>/dev/null)"
|
||||
icons="$(find -L "${icondir[@]}" -type f 2>/dev/null)"
|
||||
[ -z "$entry" ] && entry="$(find -L "${desktopdir[@]}" -type f -name '*.desktop' 2>/dev/null)"
|
||||
[ -z "$entry_c" ] && entry_c="$(printf "%s\n" "$entry" | grep -c "")"
|
||||
|
||||
|
@ -143,13 +143,20 @@ print_desktop_list() {
|
|||
mapfile -t it_only < "$ONLYFILE"
|
||||
mapfile -t it_comment < "$COMMENTFILE"
|
||||
|
||||
d_print_array
|
||||
d_print_array | \
|
||||
sort -k 2 "${sort_args[@]}" | \
|
||||
uniq "${uniq_args[@]}" | \
|
||||
grep -vE "$HIDDEN_ENTRY_KEYWORDS" | \
|
||||
grep -E "$ENTRY_KEYWORDS"
|
||||
fi
|
||||
}
|
||||
|
||||
d_print_array() {
|
||||
command -v print_array > /dev/null && print_array && return
|
||||
|
||||
printf "SORT_ARGS: %s\n" "${sort_args[*]}" >> "$LOGFILE"
|
||||
printf "UNIQ_ARGS: %s\n" "${uniq_args[*]}" >> "$LOGFILE"
|
||||
|
||||
for i in "${!it_title[@]}"; do
|
||||
[ "$RESPECT_ONLYSHOWIN" != "false" ] && [ "${it_only[i]}" != "false" ] && continue
|
||||
[ "$RESPECT_NODISPLAY" != "false" ] && [ "${it_display[i]}" != "true" ] && continue
|
||||
|
@ -214,7 +221,7 @@ print_desktop_menu() {
|
|||
|
||||
HIDDEN_ENTRY_KEYWORDS="${HIDDEN_ENTRY_KEYWORDS:-NULL_ENTRY}"
|
||||
|
||||
print_desktop_list "" | uniq "${uniq_args[@]}" | sort "${sort_args[@]}" | grep -vE "$HIDDEN_ENTRY_KEYWORDS" | grep -E "$ENTRY_KEYWORDS" | $RUNLAUNCHER "${rl_desktop[@]}" > /tmp/spmenu_out
|
||||
print_desktop_list "" | $RUNLAUNCHER "${rl_desktop[@]}" > /tmp/spmenu_out
|
||||
|
||||
while read -r menusel; do
|
||||
[ "$menusel" = "?" ] && print_desktop_help && print_desktop_menu
|
||||
|
|
|
@ -5,13 +5,6 @@
|
|||
# See LICENSE file for copyright and license details.
|
||||
|
||||
path() {
|
||||
[ "$SORT_BY_NUMBER" != "false" ] && NUMBERSORTARG="-n"
|
||||
[ "$SORT_IN_REVERSE" != "false" ] && REVERSESORTARG="-r"
|
||||
SORT_ARGS="$NUMBERSORTARG $REVERSESORTARG $SORT_ARGS"
|
||||
|
||||
read -ra uniq_args <<< "${UNIQ_ARGS}"
|
||||
read -ra sort_args <<< "${SORT_ARGS}"
|
||||
|
||||
HIDDEN_KEYWORDS="${HIDDEN_KEYWORDS:-NULL_ENTRY}"
|
||||
|
||||
print_menu() {
|
||||
|
@ -23,11 +16,7 @@ path() {
|
|||
[ "$DISPLAY_BOOKMARKS" != "false" ] && bookmark_path
|
||||
}
|
||||
|
||||
if [ "$SORT_BY_RECENT" != "false" ]; then
|
||||
print | sort "${sort_args[@]}" | cut -d' ' -f 2 2>&1
|
||||
else
|
||||
print | sort "${sort_args[@]}" | cut -d' ' -f 2 2>&1
|
||||
fi
|
||||
}
|
||||
|
||||
# uniq
|
||||
|
|
11
scripts/spmenu_run
Normal file → Executable file
11
scripts/spmenu_run
Normal file → Executable file
|
@ -20,8 +20,8 @@ RUNLAUNCHER="${RUNLAUNCHER:-spmenu}"
|
|||
PREFIX="${PREFIX:-/usr}"
|
||||
DESTDIR="${DESTDIR:-}"
|
||||
STDOUT="${STDOUT:-false}"
|
||||
SORT_BY_NUMBER="${SORT_BY_NUMBER:-true}"
|
||||
SORT_IN_REVERSE="${SORT_IN_REVERSE:-true}"
|
||||
SORT_BY_NUMBER="${SORT_BY_NUMBER:-false}"
|
||||
SORT_IN_REVERSE="${SORT_IN_REVERSE:-false}"
|
||||
SORT_BY_RECENT="${SORT_BY_RECENT:-false}"
|
||||
SORT_ARGS="${SORT_ARGS:-}"
|
||||
UNIQ_ARGS="${UNIQ_ARGS:-}"
|
||||
|
@ -435,6 +435,13 @@ main() {
|
|||
rl_bm+=("$RUNLAUNCHER_BM_PRETEXT")
|
||||
fi
|
||||
|
||||
[ "$SORT_BY_NUMBER" != "false" ] && NUMBERSORTARG="-n"
|
||||
[ "$SORT_IN_REVERSE" != "false" ] && REVERSESORTARG="-r"
|
||||
SORT_ARGS="$NUMBERSORTARG $REVERSESORTARG $SORT_ARGS"
|
||||
|
||||
read -ra uniq_args <<< "${UNIQ_ARGS}"
|
||||
read -ra sort_args <<< "${SORT_ARGS}"
|
||||
|
||||
# $PATH listing
|
||||
case "$function" in
|
||||
"run")
|
||||
|
|
2
spmenu.1
2
spmenu.1
|
@ -1,5 +1,5 @@
|
|||
'\" t
|
||||
.\" Automatically generated by Pandoc 3.1.2
|
||||
.\" Automatically generated by Pandoc 3.1.6
|
||||
.\"
|
||||
.\" Define V font for inline verbatim, using C font in formats
|
||||
.\" that render this, and otherwise B font.
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
.\" Automatically generated by Pandoc 3.1.2
|
||||
.\" Automatically generated by Pandoc 3.1.6
|
||||
.\"
|
||||
.\" Define V font for inline verbatim, using C font in formats
|
||||
.\" that render this, and otherwise B font.
|
||||
|
@ -77,6 +77,12 @@ run \f[V]spmenu_run -cc\f[R].
|
|||
\f[B]NOTE: By default it will hide any entries matching
|
||||
\f[VB]spmenu\f[B] (for convenience) but you can unhide these if you wish
|
||||
through the configuration file.\f[R]
|
||||
.PP
|
||||
Flatpaks are also functional, provided they use valid .desktop entries.
|
||||
You can use Flatpaks with spmenu_run by passing \f[V]-d\f[R].
|
||||
$DESKTOP_DIR and $ICON_DIR must contain Flatpak paths though.
|
||||
If you have a new config, these variables should be defined properly
|
||||
already.
|
||||
.SS Bookmarking
|
||||
.PP
|
||||
spmenu_run provides bookmarking entries or just general text if
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
.\" Automatically generated by Pandoc 3.1.2
|
||||
.\" Automatically generated by Pandoc 3.1.6
|
||||
.\"
|
||||
.\" Define V font for inline verbatim, using C font in formats
|
||||
.\" that render this, and otherwise B font.
|
||||
|
|
Loading…
Reference in a new issue