#!/bin/sh # ==== DELETE THIS LINES ===== echo "NOTHING HAPPENED!" echo "FIRST READ THE SCRIPT!" exit # ============================ set -e prog="${0##*/}" config() { mkdir -p ~/.config mkdir -p ~/.local/bin cp -ir config/* ~/.config cp -i bin/* ~/.local/bin cp -i zprofile ~/.zprofile if [ -n "$ZSH_VERSION" ]; then echo "You are not using Zsh, set your default shell:" echo "$ chsh --shell /usr/bin/zsh" fi } install() { source /etc/os-release distro="${NAME:-${DISTRIB_ID}}" distro_install="" pkglist="" case $distro in "Arch Linux") distro_install="pacman -S --needed" pkglist="arch-pkglist.txt" ;; *) echo "Distro not supported"; exit ;; esac sudo $distro_install $(cat $pkglist) [[ "$?" -ne 0 ]] && exit echo "==================================" echo " Packages successfully installed " echo "==================================" } usage() { cat <<-_EOF $prog OPTION Options: config - copy configs and scripts to their location install - install required packages _EOF exit } case "$1" in config) config ;; install) install ;; *) usage ;; esac