#!/bin/bash # ======================================= # Helper functions # ======================================= # Ask a question and return true or false based on the users input ask() { # from https://djm.me/ask local prompt default reply while true; do if [ "${2:-}" = "Y" ]; then prompt="Y/n" default=Y elif [ "${2:-}" = "N" ]; then prompt="y/N" default=N else prompt="y/n" default= fi echo -n "$1 [$prompt] " read reply < | | | | (_| __/ " echo " \___\___/|_| |_|_| |_|\__, | \___/\/ |_| |_|\___\___| " echo " __/ | " echo " |___/ " echo "" } # ======================================= # Main loop # ======================================= # Run the intro function intro ask "Do you want to continue installing my config and rice?" Y && # Ask for dependency installation list_dependencies if ask "Do you want to install the list of applications above? (might prompt for password)" Y; then install_dependencies fi # Ask for config installation if ask "Do you want to install the config files?" Y; then install_config fi # Ask for HiDPI installation if ask "Do you want to install the HiDPI patches?" N; then install_HiDPI fi # Ask for font installation if ask "Do you want to install the fonts?" Y; then install_fonts fi # ask to enable gdm if ask "Do you want to enable GDM?" Y; then sudo systemctl enable gdm.service fi echo "Enjoy using my rice! Do not forget to select \"i3\" in GDM :)"