Skip to content

Instantly share code, notes, and snippets.

@clo4
Created February 2, 2020 00:48
Show Gist options
  • Save clo4/c820e603a6e2a1a46e44fd4855aceabf to your computer and use it in GitHub Desktop.
Save clo4/c820e603a6e2a1a46e44fd4855aceabf to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
# --- Variables and folder structure ---
: ${SCREENSHOT_LOCATION:="$HOME/Pictures/Screenshots"} && mkdir -p "$SCREENSHOT_LOCATION"
: ${ENV_MGR_LOCATION:="$HOME/.local/share"} && mkdir -p "$ENV_MGR_LOCATION"
: ${WORKSPACES_LOCATION:="$HOME/Workspaces"} && mkdir -p "$WORKSPACES_LOCATION"
: ${LISTS_LOCATION:="$HOME/Lists"} && mkdir -p "$LISTS_LOCATION"
mkdir -p \
"$SCREENSHOT_LOCATION" \
"$ENV_MGR_LOCATION" \
"$WORKSPACES_LOCATION" \
"$LISTS_LOCATION" \
"$HOME/.config" \
"$HOME/.vim"
# --- Defaults ---
# Better Finder settings
defaults write com.apple.finder AppleShowAllFiles -bool true
defaults write com.apple.finder FXEnableExtensionChangeWarning -bool false
defaults write com.apple.finder EmptyTrashSecurely -bool true
# Better screenshot settings
defaults write com.apple.screencapture location "$SCREENSHOT_LOCATION"
defaults write com.apple.screencapture disable-shadow -bool true
# Better keyboard settings
defaults write -g InitialKeyRepeat -int 10
defaults write -g KeyRepeat -int 2
defaults write -g ApplePressAndHoldEnabled -bool false
# Don't write .DS_Store on network drives
defaults write com.apple.desktopservices DSDontWriteNetworkStores true
# Restart the services affected by the changes above
killall Dock Finder SystemUIServer
# --- Tools ---
# Homebrew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# xxenv managers
[[ $XXENV_LOCATION == $HOME ]] && maybe_dot="." || maybe_dot=
git clone https://github.com/pyenv/pyenv "$XXENV_LOCATION/${maybe_dot}pyenv"
git clone https://github.com/syndbg/goenv "$XXENV_LOCATION/${maybe_dot}goenv"
# These two will still require their respective **env-build plugins
git clone https://github.com/nodenv/nodenv "$XXENV_LOCATION/${maybe_dot}nodenv"
git clone https://github.com/rbenv/rbenv "$XXENV_LOCATION/${maybe_dot}rbenv"
# The rust toolchain
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment