-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
91e6469
commit 35366e1
Showing
5 changed files
with
124 additions
and
133 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,65 @@ | ||
#!/bin/bash | ||
# | ||
# Run all dotfiles installers and related setup | ||
|
||
sudo apt update | ||
set -e # Exit immediately if a command exits with a non-zero status | ||
set -o pipefail # Exit if any command in a pipeline fails | ||
|
||
# run all dotfiles installers | ||
export DOTFILES="$HOME/.dotfiles" | ||
# Utility functions for consistent output | ||
info() { | ||
printf "\r [ \033[00;34m..\033[0m ] %s\n" "$1" | ||
} | ||
|
||
success() { | ||
printf "\r\033[2K [ \033[00;32mOK\033[0m ] %s\n" "$1" | ||
} | ||
|
||
cd "$(dirname "$0")"/.. || exit | ||
find -H "$DOTFILES" -maxdepth 4 -name 'install.sh' -not -path '*.git*' -exec sh -c 'FILE="$1"; "$FILE"' _ {} \; | ||
fail() { | ||
printf "\r\033[2K [ \033[0;31mFAIL\033[0m ] %s\n" "$1" | ||
echo '' | ||
exit 1 | ||
} | ||
|
||
export DOTFILES="$HOME/.dotfiles" | ||
|
||
info "adding zsh extensions" | ||
git clone https://github.com/zsh-users/zsh-autosuggestions.git ~/.oh-my-zsh/custom/plugins/zsh-autosuggestions | ||
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ~/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting | ||
info "Updating package lists" | ||
sudo apt update || fail "Failed to update package lists" | ||
|
||
info "adding vscode repo" | ||
wget -q https://packages.microsoft.com/keys/microsoft.asc -O- | sudo apt-key add - | ||
sudo add-apt-repository "deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main" | ||
info "Running all dotfiles installers" | ||
cd "$(dirname "$0")/.." || fail "Failed to change directory" | ||
find -H "$DOTFILES" -maxdepth 4 -name 'install.sh' -not -path '*.git*' -exec sh -c 'FILE="$1"; "$FILE"' _ {} \; || fail "Failed to run dotfiles installers" | ||
|
||
info "install the packages inside specific/linux/packages.txt" | ||
xargs sudo apt -y -qq install < ~/.dotfiles/specific/linux/packages.txt | ||
if [[ "$(uname)" == "Linux" ]]; then | ||
info "Installing Zsh Autosuggestions" | ||
ZSH_PLUGIN_DIR="$HOME/.oh-my-zsh/custom/plugins/zsh-autosuggestions" | ||
if [[ ! -d "$ZSH_PLUGIN_DIR" ]]; then | ||
git clone https://github.com/zsh-users/zsh-autosuggestions "$ZSH_PLUGIN_DIR" || fail "Failed to clone zsh-autosuggestions" | ||
success "Zsh Autosuggestions installed" | ||
else | ||
success "Zsh Autosuggestions already installed" | ||
fi | ||
|
||
info "installing lambda stack" | ||
wget -nv -O- https://lambdalabs.com/install-lambda-stack.sh | sh - | ||
info "Installing Zsh Syntax Highlighting" | ||
ZSH_HIGHLIGHT_DIR="$HOME/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting" | ||
if [[ ! -d "$ZSH_HIGHLIGHT_DIR" ]]; then | ||
git clone https://github.com/zsh-users/zsh-syntax-highlighting "$ZSH_HIGHLIGHT_DIR" || fail "Failed to clone zsh-syntax-highlighting" | ||
success "Zsh Syntax Highlighting installed" | ||
else | ||
success "Zsh Syntax Highlighting already installed" | ||
fi | ||
|
||
info "Installing packages from specific/linux/packages.txt" | ||
PACKAGE_FILE="$DOTFILES/specific/linux/packages.txt" | ||
if [[ -f "$PACKAGE_FILE" ]]; then | ||
xargs sudo apt -y -qq install <"$PACKAGE_FILE" || fail "Failed to install packages from $PACKAGE_FILE" | ||
success "Packages installed from $PACKAGE_FILE" | ||
else | ||
fail "Package list not found at $PACKAGE_FILE" | ||
fi | ||
|
||
info "Installing Lambda Stack" | ||
wget -nv -O- https://lambdalabs.com/install-lambda-stack.sh | sh - || fail "Failed to install Lambda Stack" | ||
success "Lambda Stack installed" | ||
fi | ||
|
||
success "Dotfiles setup completed successfully!" |
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
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,3 @@ vim | |
tmux | ||
htop | ||
neofetch | ||
code |
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