# This script will fetch necessary packages echo Note: An Internet connection is REQUIRED for this script to succeed. if [[ -e .alreadyrun ]]; then sleep 1 cat .alreadyrun sleep 1 exit fi #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 # Asks the user if they're on the correct version 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 # If the default rpi password is unchanged, skip prompting for the password 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 sudo apt upgrade -y fi # Install drivers for LCD sudo rpi-update sudo apt install raspi-gpio sudo raspi-gpio get sleep 1 wget https://raw.githubusercontent.com/adafruit/Adafruit-DPI-Kippah/master/dt-blob.bin sudo cp dt-blob.bin /boot/ sleep 1 touch tmpboot.txt echo "# Disable spi and i2c, we need these pins." >> tmpboot.txt echo "dtparam=spi=off" >> tmpboot.txt echo "dtparam=i2c_arm=off" >> tmpboot.txt echo "" >> tmpboot.txt echo "# Set screen size and any overscan required" >> tmpboot.txt echo "overscan_left=0" >> tmpboot.txt echo "overscan_right=0" >> tmpboot.txt echo "overscan_top=0" >> tmpboot.txt echo "overscan_bottom=0" >> tmpboot.txt echo "framebuffer_width=800" >> tmpboot.txt echo "framebuffer_height=480" >> tmpboot.txt echo "" >> tmpboot.txt echo "# enable the DPI display" >> tmpboot.txt echo "enable_dpi_lcd=1" >> tmpboot.txt echo "display_default_lcd=1" >> tmpboot.txt echo "" >> tmpboot.txt echo "# set up the size to 800x480" >> tmpboot.txt echo "dpi_group=2" >> tmpboot.txt echo "dpi_mode=87" >> tmpboot.txt echo "" >> tmpboot.txt echo "# set up the hsync/vsync/clock polarity and format" >> tmpboot.txt echo "dpi_output_format=454661" >> tmpboot.txt echo "" >> tmpboot.txt echo "# set up the size to 800x480" >> tmpboot.txt echo "hdmi_timings=800 0 40 48 88 480 0 13 3 32 0 0 0 60 0 32000000 6" >> tmpboot.txt sudo cat tmpboot.txt >> /boot/config.txt # Install X server, DM, WM, vim (for some reason), and python stuff sudo apt install vim xorg lightdm ratpoison idle3 python3-matplotlib -y # Checks to see if the init config for X exists, and copies the skeleton file if [[ -e ~/.xinitrc ]]; then echo "xinitrc exists... skipping" else cp /etc/X11/xinit/xinitrc ~/.xinitrc fi # Modify init configs for X and Ratpoison echo "exec /usr/bin/ratpoison" >> ~/.xinitrc echo "banish" >> ~/.ratpoisonrc echo "exec /usr/bin/idle3" >> ~/.ratpoisonrc touch .alreadyrun echo "This script can only be run once." >> .alreadyrun echo "Shutting down. Connect LCD, then power back on." sleep 2 sudo shutdown -h now EOF