Last active
May 23, 2020 07:51
-
-
Save XenitXTD/336354adee3d6b36d42a01c1d0bc0c97 to your computer and use it in GitHub Desktop.
Config to get Homestead VM configured with basics after ssh in. This makes destroying box and updating it less painful as all manual work is in here.
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 | |
# Install Oh-My-ZSH Shell | |
if [ ! -d ~/.oh-my-zsh ] | |
then | |
curl -Lo install.sh https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh | |
sh install.sh --unattended | |
#set as default Shell This will use the echo to auto input password | |
chsh -s /usr/bin/zsh | |
echo "" | |
#once done an exit/logout of ssh would be required for this to take effect | |
fi | |
# This gives and error because it tries to default to system fonts folder... | |
# Updated it to create folder in user directory | |
# Install Fonts | |
git clone https://github.com/powerline/fonts.git --depth=1 ~/fonts | |
cd ~/fonts | |
./install.sh | |
cd .. | |
rm -rf ~/fonts | |
# Theme | |
if [ ! -d ~/.oh-my-zsh/custom/themes/powerlevel9k ] | |
then | |
git clone https://github.com/bhilburn/powerlevel9k.git ~/.oh-my-zsh/custom/themes/powerlevel9k | |
fi | |
# replace line in zshrc file | |
sed -i -r '/ZSH_THEME/s|(.*)".*"|\1"powerlevel9k/powerlevel9k"|' ~/.zshrc | |
sed -i -r '/plugins/s|(.*)\(.*\)|\1\(`cat ~/zsh_plugins`\)|' ~/.zshrc | |
#Plugins | |
#syntax highlights | |
if [ ! -d ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting ] | |
then | |
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting | |
fi | |
# add to plugins - zsh-syntax-highlighting | |
#auto suggest | |
if [ ! -d ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions ] | |
then | |
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions | |
fi | |
# add to plugins - zsh-autosuggestions | |
# Create a zsh_plugins file which will hold the plugins to be pulled on sourcing | |
if [ ! -f ~/zsh_plugins ] | |
then | |
touch ~/zsh_plugins | |
else | |
rm ~/zsh_plugins | |
touch ~/zsh_plugins | |
fi | |
# Append to the list of plugins to be sourced | |
echo "git" >> ~/zsh_plugins | |
echo "zsh-syntax-highlighting" >> ~/zsh_plugins | |
echo "zsh-autosuggestions" >> ~/zsh_plugins | |
# Overwrite Plugin block to pull in zsh_plugins \ is used to escape ( and ) because they are command functions. | |
sed -i -r '/plugins/s|(.*)\(.*\)|\1\(`cat ~/zsh_plugins`\)|' ~/.zshrc | |
# Install Laravel globally to quickly setup laravel projects from local cache | |
composer global require laravel/installer | |
# Update global config with user and email for commits | |
# git config --global user.name "User" | |
# git config --global user.email "[email protected]" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment