Skip to content

Instantly share code, notes, and snippets.

@davawen
Created November 5, 2023 21:32
Show Gist options
  • Save davawen/496bac15824cac14838df03ffe77a761 to your computer and use it in GitHub Desktop.
Save davawen/496bac15824cac14838df03ffe77a761 to your computer and use it in GitHub Desktop.
plugins
[plugin]
prefix = plug
comment = List all plugin prefixes
icon = debug-run
exec = exec.sh
type = text
#!/bin/bash
shopt -s nullglob
function prefix() {
grep "prefix = " "$*/config.ini" | awk '{print $3}'
}
plugins=(../*)
for plugin in ${plugins[*]} ; do
echo "name:$(prefix $plugin)"
echo "comment:$(basename $plugin)"
done
echo "end"
old=$IFS
IFS="\n"
read selected
IFS=$old
echo "change_input:$(prefix ${plugins[$selected]}) "
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment