From 45106cc0e683cd2f7ecba1cd30975faaa4da2af0 Mon Sep 17 00:00:00 2001 From: Daniel Marsee Date: Wed, 26 Sep 2018 12:09:52 -0900 Subject: [PATCH] Add PyCalc installation script --- calcsetup.sh | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 calcsetup.sh diff --git a/calcsetup.sh b/calcsetup.sh new file mode 100644 index 0000000..f656086 --- /dev/null +++ b/calcsetup.sh @@ -0,0 +1,41 @@ +# This script will fetch necessary packages +# Note: An Internet connection is REQUIRED for this script to succeed. + +read -e -n 1 -p "Do you have an Internet connection? " ans +if [ $ans == "n" ]; then + echo -e "\e[31mPlease connect to the Internet and rerun this command. \e[39m" + echo "Exiting..." + sleep .5 + exit 1 +fi + +read -e -n 1 -p "Are you running Raspbian Stretch Lite? " ans +if [ &ans == "n" ]; then + echo -e "\e[33m\e[1mThis script is useful only in Raspbian Lite." + echo -e "Running this in the full Raspbian desktop is untested and will likely break.\e[39m\e[0m" + read -e -n 1 -p "Do you still want to try? " ans + if [ $ans == "n" ]; then + echo "Exiting..." + sleep .5 + exit 2 + fi +fi + +read -e -n 1 -p "Have you changed the default username or password? " ans +if [ $ans == "y" ]; then + sudo apt update +else + echo raspberry | sudo -S apt update +fi + +sudo apt install xorg ratpoison idle3 python3-matplotlib -y + +if [[ -e ~/.xinitrc ]]; then + echo "xinitrc exists... skipping" +else + cp /etc/X11/xinit/xinitrc ~/.xinitrc +fi + +# Copy X11 and ratpoison skeleton files to PATH +echo "exec /usr/bin/ratpoison" >> ~/.xinitrc +echo "exec /usr/bin/idle3" >> ~/.ratpoisonrc