Merge pull request #1 from edneville/menu_padding
Pad menu items and align enable status
This commit is contained in:
@@ -72,6 +72,21 @@ createscript() {
|
|||||||
### END NEW SCRIPT ###
|
### END NEW SCRIPT ###
|
||||||
|
|
||||||
vim "$newscriptav"
|
vim "$newscriptav"
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
echo "------------------------------------"
|
||||||
|
echo " Editor aborted!"
|
||||||
|
echo " Continue or remove $namenewscript?"
|
||||||
|
echo "------------------------------------"
|
||||||
|
echo " 1 | Continue "
|
||||||
|
echo " 2 | Abort "
|
||||||
|
echo " Def | Continue "
|
||||||
|
echo "------------------------------------"
|
||||||
|
read answer
|
||||||
|
if [ "${answer}x" = "2x" ]; then
|
||||||
|
rm "$newscriptav"
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
fi
|
||||||
echo "------------------------------------"
|
echo "------------------------------------"
|
||||||
echo " Script $namenewscript created!"
|
echo " Script $namenewscript created!"
|
||||||
echo " Do you want to enable it?"
|
echo " Do you want to enable it?"
|
||||||
@@ -95,11 +110,11 @@ listitem() {
|
|||||||
for i in $(ls "$available_scripts"); do
|
for i in $(ls "$available_scripts"); do
|
||||||
inotext=${i:0:-3}
|
inotext=${i:0:-3}
|
||||||
(( index ++ ))
|
(( index ++ ))
|
||||||
|
enabled=""
|
||||||
if [ -f "$enabled_scripts$i" ]; then
|
if [ -f "$enabled_scripts$i" ]; then
|
||||||
echo "$index) - $inotext"
|
enabled="-"
|
||||||
else
|
|
||||||
echo "$index) $inotext"
|
|
||||||
fi
|
fi
|
||||||
|
printf "%5d | %1s %s\n" "$index" "$enabled" "$inotext"
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user