Last active
March 13, 2023 14:53
-
-
Save RyanNorooz/233f5dee27b5631764bcadd5d6abb347 to your computer and use it in GitHub Desktop.
My starter script for new linux machines. use this to download and run script: (curl -s {link} | bash)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
current_user=$(whoami) | |
# =================== welcome & notice =================== | |
echo | |
echo "User: $current_user" | |
echo | |
echo "wassssuuuuup....!" | |
echo "script will install basic tools and configs apps for the current user: $current_user" | |
echo | |
read -p "sounds good? [y/n] " -n 1 -r | |
echo | |
if [[ ! $REPLY =~ ^[Yy]$ ]] | |
then | |
[[ "$0" = "$BASH_SOURCE" ]] && exit 1 || return 1 | |
fi | |
# ===================== install stuff ===================== | |
echo | |
echo "Installing packages..." | |
echo | |
curl -fsSL https://deb.nodesource.com/setup_18.x | bash | |
sudo apt update -y | |
sudo apt install -y git tmux nodejs npm fonts-powerline zsh | |
npm i -g npm@latest | |
npm i -g pnpm | |
pnpm i -g pnpm@latest | |
# ================ download config files ================ | |
git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm | |
git clone https://github.com/RyanNorooz/dotfiles ~/.dotfiles.tmp | |
# ====================== config stuff ====================== | |
echo | |
echo "Configuring stuff..." | |
echo | |
cp ~/.dotfiles.tmp/.tmux.conf ~/.tmux.conf | |
cp ~/.dotfiles.tmp/.nanorc ~/.nanorc | |
cp ~/.dotfiles.tmp/.gitconfig ~/.gitconfig | |
# ======================== cleanup ======================== | |
echo | |
echo "Cleaning up..." | |
echo | |
sudo rm -r ~/.dotfiles.tmp | |
sudo apt autoremove -y | |
sudo apt autoclean -y | |
# ======================= OhMyZsh ======================= | |
echo | |
echo "Installing OhMyZsh for ($currentUser)" | |
echo | |
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended | |
zsh_config=" | |
# fix for tmux END/HOME keys not working | |
export TERM=xterm-256color | |
# some more ls aliases | |
alias ll='ls -lF' | |
alias la='ls -ACF' | |
alias l='ls -CF' | |
" | |
echo $zsh_config >> ~/.zshrc # append to zshrc | |
# ======================== goodbye ======================== | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment