forked from speedie/spmenu
use long arguments
This commit is contained in:
parent
7e7d5481b7
commit
8d08f98791
|
@ -9,7 +9,7 @@
|
||||||
[ -z "$prefix" ] && prefix="/tmp/.list_songs"
|
[ -z "$prefix" ] && prefix="/tmp/.list_songs"
|
||||||
|
|
||||||
[ -z "$RUNLAUNCHER" ] && RUNLAUNCHER="spmenu"
|
[ -z "$RUNLAUNCHER" ] && RUNLAUNCHER="spmenu"
|
||||||
[ -z "$RUNLAUNCHER_ARGS" ] && RUNLAUNCHER_ARGS="-l 40 -g 1 -is 200 -ngc"
|
[ -z "$RUNLAUNCHER_ARGS" ] && RUNLAUNCHER_ARGS="--lines 40 --columns 1 --image-size 200 --no-generate-cache"
|
||||||
|
|
||||||
create_list() {
|
create_list() {
|
||||||
[ -z "$i" ] && i=1
|
[ -z "$i" ] && i=1
|
||||||
|
|
|
@ -3,7 +3,7 @@ c="$(find *.pdf -type f | wc -l)"
|
||||||
i=1
|
i=1
|
||||||
[ -z "$prefix" ] && prefix="/tmp/.list_pdfs"; mkdir -p ${prefix}
|
[ -z "$prefix" ] && prefix="/tmp/.list_pdfs"; mkdir -p ${prefix}
|
||||||
[ -z "$RUNLAUNCHER" ] && RUNLAUNCHER="spmenu"
|
[ -z "$RUNLAUNCHER" ] && RUNLAUNCHER="spmenu"
|
||||||
[ -z "$RUNLAUNCHER_ARGS" ] && RUNLAUNCHER_ARGS="-l 40 -g 1 -is 400 -ngc"
|
[ -z "$RUNLAUNCHER_ARGS" ] && RUNLAUNCHER_ARGS="--lines 40 --columns 1 --image-size 400 --no-generate-cache"
|
||||||
|
|
||||||
print_list() {
|
print_list() {
|
||||||
while true; do
|
while true; do
|
||||||
|
|
|
@ -15,4 +15,4 @@ ${bg_blue} ${bg_yellow} ${bg_blue}\n\
|
||||||
${bg_blue} ${bg_yellow} ${bg_blue}\n\
|
${bg_blue} ${bg_yellow} ${bg_blue}\n\
|
||||||
\n\
|
\n\
|
||||||
${reset}${fg_blue}c${fg_yellow}o${fg_blue}o${fg_yellow}l\n\
|
${reset}${fg_blue}c${fg_yellow}o${fg_blue}o${fg_yellow}l\n\
|
||||||
" | spmenu -sgr4 "$color1" -sgr5 "$color3" -sgr12 "$color1" -sgr13 "$color3" -na -l 40 -g 7 "$@"
|
" | spmenu --sgr4 "$color1" --sgr5 "$color3" --sgr12 "$color1" --sgr13 "$color3" --no-alpha --lines 40 --columns 7 "$@"
|
||||||
|
|
|
@ -8,7 +8,7 @@ path() { echo "$PATH" | tr ':' '\n' | uniq | sed 's#$#/#' | xargs ls -lu --time-
|
||||||
|
|
||||||
# run spmenu and parse it
|
# run spmenu and parse it
|
||||||
parse() {
|
parse() {
|
||||||
dout="$(path | sed "s/\&/\&/g" | spmenu -im -H "$HISTORY" "$@")"
|
dout="$(path | sed "s/\&/\&/g" | spmenu --insert --hist-file "$HISTORY" "$@")"
|
||||||
|
|
||||||
# parse
|
# parse
|
||||||
[ "$(printf '%c' "$dout")" = "#" ] && RUN_ARG="$TERMINAL"
|
[ "$(printf '%c' "$dout")" = "#" ] && RUN_ARG="$TERMINAL"
|
||||||
|
|
|
@ -46,7 +46,7 @@ command -v maim > /dev/null && maim -uB > /tmp/image.png
|
||||||
IMAGE="/tmp/image.png"
|
IMAGE="/tmp/image.png"
|
||||||
|
|
||||||
main() {
|
main() {
|
||||||
[ -e "$IMAGE" ] && IMAGEARG="-is 500" && IMAGEPREFIX="IMG:" || IMAGE=""
|
[ -e "$IMAGE" ] && IMAGEARG="--image-size 500" && IMAGEPREFIX="IMG:" || IMAGE=""
|
||||||
|
|
||||||
printf "$IMAGEPREFIX$IMAGE\t\
|
printf "$IMAGEPREFIX$IMAGE\t\
|
||||||
${v1}\
|
${v1}\
|
||||||
|
@ -107,7 +107,7 @@ ${v1}q${v2}w${v3}e${v4}r${v5}t${v6}y${v7}u${v8}i${v9}o${v10}p${v11}[${v12}]${v13
|
||||||
\n\
|
\n\
|
||||||
Arguments will be passed to spmenu.\n\
|
Arguments will be passed to spmenu.\n\
|
||||||
Report any issues at the Codeberg repo.\n\
|
Report any issues at the Codeberg repo.\n\
|
||||||
" | spmenu -na -l 40 $IMAGEARG "$@" -g 1 -p "<big>spmenu <i>test</i> <small>script</small></big>"
|
" | spmenu --no-alpha --lines 40 $IMAGEARG "$@" --columns 1 --prompt "<big>spmenu <i>test</i> <small>script</small></big>"
|
||||||
}
|
}
|
||||||
|
|
||||||
main "$@"
|
main "$@"
|
||||||
|
|
Loading…
Reference in a new issue