Added persistent menu after program launches.

This commit is contained in:
Maxim Stewart 2016-01-13 17:36:45 -06:00
parent aba04f35b4
commit cd1f1be424
2 changed files with 40 additions and 68 deletions

View File

@ -1,48 +1,20 @@
#!/bin/bash
main(){
main()
{
clear
read -p "Please Press 1 to Install or 2 to Uninstall --> : " INPUT
if [ "$INPUT" == 1 ]; then
sudo cp shellMen /bin/
if [[ "$INPUT" == 1 ]]; then
sudo cp ./shellMen /bin/
sudo chown root:root /bin/shellMen
sudo chmod +x /bin/shellMen
elif [ "$INPUT" == 2 ]; then
elif [[ "$INPUT" == 2 ]]; then
sudo rm /bin/shellMen
elif [ "$INPUT" !== 1 ] || [ "$INPUT" !== 2 ] ; then
elif [[ "$INPUT" != 1 || "$INPUT" != 2 ]] ; then
echo "Please type 1 or 2."
sleep 2
main
fi
}
main
2>"${INPUT}"
menuitem=$(<"${INPUT}")
case $menuitem in
Main_Menu) bash /bin/shellMen ;;
esac
2>"${INPUT}"
menuitem=$(<"${INPUT}")
case $menuitem in
Main_Menu) bash /bin/shellMen ;;
esac
2>"${INPUT}"
menuitem=$(<"${INPUT}")
case $menuitem in
Main_Menu) bash /bin/shellMen ;;
esac
2>"${INPUT}"
menuitem=$(<"${INPUT}")
case $menuitem in
Main_Menu) bash /bin/shellMen ;;
esac
2>"${INPUT}"
menuitem=$(<"${INPUT}")
case $menuitem in
Main_Menu) bash /bin/shellMen ;;
esac
2>"${INPUT}"
menuitem=$(<"${INPUT}")
case $menuitem in
Main_Menu) bash /bin/shellMen ;;
esac

View File

@ -32,38 +32,6 @@ settngs="Settings" wine="Wine" pth="/tmp/sysMENU"
fi
}
mainMENU()
{
INPUT=/tmp/menu.txt
dialog --clear --backtitle "Shellmen" \
--title "[ M A I N - M E N U ]" \
--menu "Please Select An Option" 16 50 15 \
Accessories "General Programs" \
System "Main System Programs" \
Settings "Main System Settings" \
Multimedia "Audio & Video Programs" \
Graphics "Image Programs" \
Games "Gaming Programs" \
Office "Wordprocess & Documents Programs" \
Development "Programing Programs" \
Internet "Various Internet Related Programs" \
Wine "Windows Exe & Program Support" 2>"${INPUT}"
menuitem=$(<"${INPUT}")
case $menuitem in
Accessories) bash "${pth}"/Accessories.sh ;;
System) bash "${pth}"/System.sh ;;
Settings) bash "${pth}"/Settings.sh ;;
Multimedia) bash "${pth}"/Multimedia.sh ;;
Graphics) bash "${pth}"/Graphics.sh ;;
Games) bash "${pth}"/Game.sh ;;
Office) bash "${pth}"/Office.sh ;;
Development) bash "${pth}"/Development.sh ;;
Internet) bash "${pth}"/Internet.sh ;;
Wine) bash "${pth}"/Wine.sh ;;
Exit) echo "Bye!"; break ;;
esac
}
startScan()
{
clear
@ -150,7 +118,7 @@ i="1"
execMethod=$(grep -A 0 "Exec=" /usr/share/applications/"$line1")
catagory=$(grep -A 0 "Categories=" /usr/share/applications/"$line1")
preComment=$(grep -A 0 "Comment=" /usr/share/applications/"$line1")
execCMD=$(echo "${filename}) exec ${filename} ;;")
execCMD=$(echo "${filename}) ""${filename} %f 2&>1 /dev/null"" & shellMen ;;")
if [[ "$catagory" == *"$accss"* ]] || [[ "$catagory" == *"$util"* ]]; then
echo "$execCMD" >> "${pth}"/${accss}.sh
elif [[ "$catagory" == *"$dev"* ]]; then
@ -180,4 +148,36 @@ done
chmod +x "${pth}"/*.sh
mainMENU;
}
mainMENU()
{
INPUT=/tmp/menu.txt
dialog --clear --backtitle "Shellmen" \
--title "[ M A I N - M E N U ]" \
--menu "Please Select An Option" 16 50 15 \
Accessories "General Programs" \
System "Main System Programs" \
Settings "Main System Settings" \
Multimedia "Audio & Video Programs" \
Graphics "Image Programs" \
Games "Gaming Programs" \
Office "Wordprocess & Documents Programs" \
Development "Programing Programs" \
Internet "Various Internet Related Programs" \
Wine "Windows Exe & Program Support" 2>"${INPUT}"
menuitem=$(<"${INPUT}")
case $menuitem in
Accessories) bash "${pth}"/Accessories.sh ;;
System) bash "${pth}"/System.sh ;;
Settings) bash "${pth}"/Settings.sh ;;
Multimedia) bash "${pth}"/Multimedia.sh ;;
Graphics) bash "${pth}"/Graphics.sh ;;
Games) bash "${pth}"/Game.sh ;;
Office) bash "${pth}"/Office.sh ;;
Development) bash "${pth}"/Development.sh ;;
Internet) bash "${pth}"/Internet.sh ;;
Wine) bash "${pth}"/Wine.sh ;;
Exit) echo "Bye!"; break ;;
esac
}
pre;