Created
November 5, 2023 21:32
-
-
Save davawen/496bac15824cac14838df03ffe77a761 to your computer and use it in GitHub Desktop.
plugins
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[plugin] | |
prefix = plug | |
comment = List all plugin prefixes | |
icon = debug-run | |
exec = exec.sh | |
type = text |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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