Cleaned up code by a lot. Smaller file size....

This commit is contained in:
Maxim Stewart 2015-12-09 23:56:29 -06:00
parent 59fb8f8058
commit d19ee08fb6
2 changed files with 65 additions and 112 deletions

0
install.sh Normal file → Executable file
View File

65
shellMen Normal file → Executable file
View File

@ -102,7 +102,7 @@ menuHeaderInsert;
menuHeaderInsert() menuHeaderInsert()
{ {
x=$(cat /tmp/sysMENU/menu.list | wc -l) >> /dev/null ; # Variable set to number of lines filled in list.txt x=$(cat /tmp/sysMENU/menu.list | wc -l) >> /dev/null ;
i="1" i="1"
while [ $i -le $x ]; do while [ $i -le $x ]; do
@ -139,50 +139,12 @@ i="1"
fi fi
i=$[$i++1]; i=$[$i++1];
done done
endMenuInsert=$(echo "2>"\"'${INPUT}'"\"")
menuitmVar=$(echo 'menuitem=$(<"${INPUT}")') echo "2>"\"'${INPUT}'"\"" | tee -a /tmp/sysMENU/*.sh
preCMD=$(echo "case \$menuitem in") echo 'menuitem=$(<"${INPUT}")' | tee -a /tmp/sysMENU/*.sh
menuCall=$(echo "Main_Menu) bash /bin/shellMen ;;") echo "case \$menuitem in" | tee -a /tmp/sysMENU/*.sh
echo "$endMenuInsert" >> /tmp/sysMENU/${accss}.sh echo "Main_Menu) bash /bin/shellMen ;;" | tee -a /tmp/sysMENU/*.sh
echo "$menuitmVar" >> /tmp/sysMENU/${accss}.sh
echo "$preCMD" >> /tmp/sysMENU/${accss}.sh
echo "$menuCall" >> /tmp/sysMENU/${accss}.sh
echo "$endMenuInsert" >> /tmp/sysMENU/${dev}.sh
echo "$menuitmVar" >> /tmp/sysMENU/${dev}.sh
echo "$preCMD" >> /tmp/sysMENU/${dev}.sh
echo "$menuCall" >> /tmp/sysMENU/${dev}.sh
echo "$endMenuInsert" >> /tmp/sysMENU/${gme}.sh
echo "$menuitmVar" >> /tmp/sysMENU/${gme}.sh
echo "$preCMD" >> /tmp/sysMENU/${gme}.sh
echo "$menuCall" >> /tmp/sysMENU/${gme}.sh
echo "$endMenuInsert" >> /tmp/sysMENU/${int}.sh
echo "$menuitmVar" >> /tmp/sysMENU/${int}.sh
echo "$preCMD" >> /tmp/sysMENU/${int}.sh
echo "$menuCall" >> /tmp/sysMENU/${int}.sh
echo "$endMenuInsert" >> /tmp/sysMENU/${graph}.sh
echo "$menuitmVar" >> /tmp/sysMENU/${graph}.sh
echo "$preCMD" >> /tmp/sysMENU/${graph}.sh
echo "$menuCall" >> /tmp/sysMENU/${graph}.sh
echo "$endMenuInsert" >> /tmp/sysMENU/${offce}.sh
echo "$menuitmVar" >> /tmp/sysMENU/${offce}.sh
echo "$preCMD" >> /tmp/sysMENU/${offce}.sh
echo "$menuCall" >> /tmp/sysMENU/${offce}.sh
echo "$endMenuInsert" >> /tmp/sysMENU/${media}.sh
echo "$menuitmVar" >> /tmp/sysMENU/${media}.sh
echo "$preCMD" >> /tmp/sysMENU/${media}.sh
echo "$menuCall" >> /tmp/sysMENU/${media}.sh
echo "$endMenuInsert" >> /tmp/sysMENU/${sys}.sh
echo "$menuitmVar" >> /tmp/sysMENU/${sys}.sh
echo "$preCMD" >> /tmp/sysMENU/${sys}.sh
echo "$menuCall" >> /tmp/sysMENU/${sys}.sh
echo "$endMenuInsert" >> /tmp/sysMENU/${settngs}.sh
echo "$menuitmVar" >> /tmp/sysMENU/${settngs}.sh
echo "$preCMD" >> /tmp/sysMENU/${settngs}.sh
echo "$menuCall" >> /tmp/sysMENU/${settngs}.sh
echo "$endMenuInsert" >> /tmp/sysMENU/${wine}.sh
echo "$menuitmVar" >> /tmp/sysMENU/${wine}.sh
echo "$preCMD" >> /tmp/sysMENU/${wine}.sh
echo "$menuCall" >> /tmp/sysMENU/${wine}.sh
commandInsert; commandInsert;
} }
@ -197,7 +159,7 @@ i="1"
execMethod=$(grep -A 0 "Exec=" /usr/share/applications/"$line1") execMethod=$(grep -A 0 "Exec=" /usr/share/applications/"$line1")
catagory=$(grep -A 0 "Categories=" /usr/share/applications/"$line1") catagory=$(grep -A 0 "Categories=" /usr/share/applications/"$line1")
preComment=$(grep -A 0 "Comment=" /usr/share/applications/"$line1") preComment=$(grep -A 0 "Comment=" /usr/share/applications/"$line1")
execCMD=$(echo "${filename}) exec ${filename} ;;") execCMD=$(echo "${filename}) exec ${filename} & ;;")
if [[ "$catagory" == *"$accss"* ]] || [[ "$catagory" == *"$util"* ]]; then if [[ "$catagory" == *"$accss"* ]] || [[ "$catagory" == *"$util"* ]]; then
echo "$execCMD" >> /tmp/sysMENU/${accss}.sh echo "$execCMD" >> /tmp/sysMENU/${accss}.sh
elif [[ "$catagory" == *"$dev"* ]]; then elif [[ "$catagory" == *"$dev"* ]]; then
@ -223,16 +185,7 @@ i="1"
fi fi
i=$[$i++1]; i=$[$i++1];
done done
echo "esac" >> /tmp/sysMENU/${accss}.sh echo "esac" | tee -a /tmp/sysMENU/*.sh
echo "esac" >> /tmp/sysMENU/${dev}.sh
echo "esac" >> /tmp/sysMENU/${gme}.sh
echo "esac" >> /tmp/sysMENU/${int}.sh
echo "esac" >> /tmp/sysMENU/${graph}.sh
echo "esac" >> /tmp/sysMENU/${offce}.sh
echo "esac" >> /tmp/sysMENU/${media}.sh
echo "esac" >> /tmp/sysMENU/${sys}.sh
echo "esac" >> /tmp/sysMENU/${settngs}.sh
echo "esac" >> /tmp/sysMENU/${wine}.sh
chmod +x /tmp/sysMENU/*.sh chmod +x /tmp/sysMENU/*.sh
mainMENU; mainMENU;
} }