diff options
author | Raymaekers Luca <raymaekers.luca@gmail.com> | 2023-08-24 21:11:27 +0200 |
---|---|---|
committer | Raymaekers Luca <raymaekers.luca@gmail.com> | 2023-08-24 21:11:27 +0200 |
commit | 8b9e93321bfd229b8a29fdd1fc60de670e16636d (patch) | |
tree | 60963be78e9bca76d996be3de468fc4e03deb137 /bin/menuscripts/mhelp | |
parent | 067b271a243dafcf652fe7cfe85e723d25ff1a64 (diff) |
[menuscripts] use 'commander' in menuscripts
Diffstat (limited to 'bin/menuscripts/mhelp')
-rwxr-xr-x | bin/menuscripts/mhelp | 23 |
1 files changed, 6 insertions, 17 deletions
diff --git a/bin/menuscripts/mhelp b/bin/menuscripts/mhelp index 5963a88..339d6bf 100755 --- a/bin/menuscripts/mhelp +++ b/bin/menuscripts/mhelp @@ -1,29 +1,18 @@ #!/usr/bin/env sh -if [ "$MENUCMD" = "tofi" ] -then - program="$(tofi-run --prompt-text "program: ")" - menucmd="tofi --width 50% --height 30% --matching-algorithm normal --prompt-text $program:" -elif [ "$MENUCMD" = "dmenu" ] -then - program="$(dmenu_path | dmenu -l 4 -g 5 -p "program:")" - menucmd="dmenu -l 20 -g 1 -x -i -p $program:" -else - program="$(dmenu_path | fzf)" - menucmd="fzf" -fi +program="$(commander -r -c -d)" -test -z "$program" && exit 1 +[ "$program" ] || exit 1 -option="$($program --help | +option="$("$program" --help | # Parse options grep "^ *-[-a-zA-Z0-9]* " | tr -s ' ' | sort | uniq | column -l 2 -t | - $menucmd | + commander -l -x -c -d | awk '{print $1}')" -test -z "$option" && exit 1 +[ "$option" ] || exit 1 -setsid $program $option +setsid "$program" "$option" |