Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move working to main... #25

Merged
merged 4 commits into from
Oct 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions Mac/dot-aliases.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,12 @@ then
# Make standard 'ls' look prettier, with colors and sorting
# alias ls='ls -FG'
else
## Aliasing 'ls' commands to use 'eza'
alias ll='eza --long --sort=Name --git --git-repos -I "Icon?" --group-directories-first --no-quotes --no-permissions --no-user'
alias lls='eza --sort=Name --git --git-repos -I "Icon?" --group-directories-first --no-quotes'
alias lla='eza -a --long --sort=Name --git -I "Icon?" -I ".DS_Store" --group-directories-first'
alias llx='eza -a --long --sort=Name --git -I "Icon?" -I ".DS_Store" --group-directories-first -@ -Z'
alias llt='eza --tree'
## Aliasing 'ls' commands to use 'eza'
alias ll='eza --long --sort=Name --git --git-repos -I "Icon?" --group-directories-first --no-quotes --no-permissions --no-user'
alias lls='eza --sort=Name --git --git-repos -I "Icon?" --group-directories-first --no-quotes'
alias lla='eza -a --long --sort=Name --git -I "Icon?" -I ".DS_Store" --group-directories-first'
alias llx='eza -a --long --sort=Name --git -I "Icon?" -I ".DS_Store" --group-directories-first -@ -Z'
alias llt='eza --tree'
fi


Expand Down
32 changes: 17 additions & 15 deletions Mac/dotfiles.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,30 @@
echo
source "$DOTFILES_ROOT/Mac/dot-functions.sh"

message "DOTFILES_ROOT" "$DOTFILES_ROOT"
message "✳️ DOTFILES_ROOT" "$DOTFILES_ROOT"
#message "dotfiles.sh" "run location = ${0:a:h}"


# ==============================================================================
# Require `zsh` as the default, and set the default shell if needed
if [ $SHELL != "/bin/zsh" ]; then
chsh -s /bin/zsh
echo "Requires \"zsh\". Switched default shell to /bin/zsh -- re-run setup.sh file"
echo "Requires \"zsh\". Switched default shell to /bin/zsh -- re-run setup.sh file"
exit 0
fi

# If Xcode isn't installed, then abort the install
if xcode-select -p &> /dev/null
then
message "xcode-selected -p:" "$(xcode-select -p)"
message "✳️ xcode-selected -p:" "$(xcode-select -p)"
else
error "Xcode missing! Install Xcode, then re-run the script."
error "Xcode missing! Install Xcode, then re-run the script."
exit 0
fi


# ==============================================================================
message "SUDO may be required" "Setting file permissions and ownership"
message "🔐 SUDO may be required" "Setting file permissions and ownership"

# Claim ownership of all my dotfiles
sudo chown -R $USER $DOTFILES_ROOT 2> /dev/null
Expand Down Expand Up @@ -57,7 +57,7 @@ sudo chmod 744 /usr/local/bin


# ==============================================================================
message "Setup root dotfiles" "Overwriting existing files at $HOME"
message "Setup root dotfiles" "Overwriting existing files at $HOME"
cp $DOTFILES_ROOT/Mac/dot-zshrc.sh $HOME/.zshrc
cp $DOTFILES_ROOT/Mac/dot-zshenv.sh $HOME/.zshenv
cp $DOTFILES_ROOT/Mac/dot-aliases.sh $HOME/.aliases
Expand All @@ -72,7 +72,7 @@ cp $DOTFILES_ROOT/Config/dot-vimrc $HOME/.vimrc
# Register gitignore and other git stuff
git config --global core.excludesfile ~/.gitignore

message "Setup app preferences" "Overwriting Terminal, Xcode, and other settings"
message "Setup app preferences" "Overwriting Terminal, Xcode, and other settings"
# Copy app settings
cp $DOTFILES_ROOT/Config/Preferences/* $HOME/Library/Preferences/

Expand All @@ -82,7 +82,7 @@ cp -R $DOTFILES_ROOT/Config/Xcode/* $HOME/Library/Developer/Xcode/UserData/FontA


# ==============================================================================
message "Setup defaults" "Adding paths and variables to .zshenv"
message "Setup defaults" "Adding paths and variables to .zshenv"
echo " " >> ~/.zshenv
echo "# Add global DOTFILES_ROOT pointing Dotfiles install folder" >> ~/.zshenv
echo "export DOTFILES_ROOT=$DOTFILES_ROOT" >> ~/.zshenv
Expand All @@ -104,25 +104,27 @@ defaults write com.apple.desktopservices DSDontWriteUSBStores -bool TRUE
# ==============================================================================
# Create ~/Developer folder in which to put local developer stuff, e.g. repos
if [[ -d "$HOME/Developer/" ]]; then
message "~/Developer exists" "To reset, delete and rerun dotfiles.sh"
message "✳️ ~/Developer exists" "To reset, delete and rerun dotfiles.sh"
else
message "Setup ~/Developer" "Creating new folder for local developer work"
message "Setup ~/Developer" "Creating new folder for local developer work"
fi

# ==============================================================================
# Check if the "~/local.sh" file exists, and if not, copy the stub version to user home
if [[ -f "$HOME/local.sh" ]]; then
message "Setup /local.sh (existed)" "Delete the file to re-install a template"
message "✳️ Setup /local.sh (existed)" "Delete the file to re-install a template"
else
message "Set ~/local.sh" "Installing file from original template in ./Dotfiles"
message "Set ~/local.sh" "Installing file from original template in ./Dotfiles"
cp $DOTFILES_ROOT/Home/local-template.sh $HOME/local.sh
fi


# ==============================================================================
message "git config --global user.name =" "$(git config --get user.name)"
message "git config --global user.email =" "$(git config --get user.email)"
message "Restart terminal" "Optionally run: setup-brew.sh and setup-ruby.sh"
message "✅ git config --global user.name =" "$(git config --get user.name)"
message "✅ git config --global user.email =" "$(git config --get user.email)"
echo
message "🎉 Success!" "Restart Terminal and run setup-brew.sh and setup-ruby.sh"

echo

exit 0
Expand Down
8 changes: 0 additions & 8 deletions dotfiles.code-workspace

This file was deleted.

2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Dotfiles for Tim Triemstra

On a Mac or Linux system, simply run:
To setup on Mac or Linux, type the following (assumes `zsh`):

```
git clone https://github.com/timtr/Dotfiles.git
Expand Down