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HSRKFQC
LEY3QGCOMNZLJFZ5JQBSAUAZIJ7JRTMRFQADOG3EUPLNDZZB2YZQC
4BXYTJPI3YWWXJ4JFUNFUO6ANCMJNALQ7L3XK3U3AXQGFDV7CAEQC
UATCBX2NJNUSOUJ5KCXRM6RY7FIGWJ6NUXU3Y666MFJYQPE7PD6QC
CDREIJJY5W3HWMX5SBTP72RV4KCZSDPAH3RIWVXTCDCPM6JG52IAC
QLUDE7G7ZFDWGSBHAF6WXNZQJ3A7EOYDUEDLBPOYCCJO4O7MMNDAC
57YU55IK55Q4QDV45LD3ILNQDQV46NKLYK3HS6VWR2SDTOFSYXKAC
B2QAMNLQ2HMR6ENO3MS4VPIS62I5X6ZOCT4CMEB72RFXIY7MC27QC
7OOJFR5YEVMWKWPKPNNS2KORW2NNLB6KH74AOZWHLJO6JYJGUIUQC
#!/bin/bash
dotfiles="$HOME/dotfiles"
# symbolic links
fi
mydaemons=$dotfiles/start_scripts/daemons/macos
daemon_dir=$HOME/Library/LaunchAgents
done;
fi
# link private variables from google drive if available
eb_gdrive="$HOME/Google Drive File Stream/My Drive/config_backups"
test -d "$eb_gdrive" && \
# link private variables from icould drive if available
icloud="$HOME/Library/Mobile Documents/com~apple~CloudDocs/config_backups"
test -d "$icloud" && \
ln -fs "$icloud/.personal_variables" "$HOME"
ln -fs "$eb_gdrive/.private_variables" "$HOME"
# 2. create and link hammerspoon config
mkdir "$HOME/.hammerspoon"
ln -fs "$dotfiles/hammerspoon/init.lua" "$HOME/.hammerspoon/"
for daemon in "$mydaemons"/*.plist; do
ln -fs "$daemon" "$daemon_dir"
if test "$(uname)" = "Darwin"; then
# if this is macOS
# 1. move stuff into launch control
# link spacemacs layers and snippets if spacemacs is installed
if test -d "$HOME/.emacs.d/private"; then
ln -fs "$dotfiles/spacemacs/layers/$layer_dir" "$HOME/.emacs.d/private/"
done;
ln -fs "$dotfiles/spacemacs/snippets/$snippet_dir" "$HOME/.emacs.d/private/snippets/"
done;
for snippet_dir in "$dotfiles"/spacemacs/snippets/*; do
for layer_dir in "$dotfiles"/spacemacs/layers/*; do
echo -n "
$dotfiles/.profile $HOME
$dotfiles/.tmux.conf $HOME
$dotfiles/.vimrc $HOME
$dotfiles/bash/.bash_profile $HOME
$dotfiles/bash/.bashrc $HOME
$dotfiles/zsh/.zshenv $HOME
$dotfiles/zsh/.zshrc $HOME
" | _trim | xargs ln -fs
$dotfiles/.config $HOME/.config
$dotfiles/.myclirc $HOME
function _trim {
# remove blank lines, leading and trailing whitespace
sed '/^$/d' | sed -e 's/^ *//' | sed -e 's/ *$//'
}
#! /bin/bash
stderr_log=/tmp/install_important_packages_errors.log
stdout_log=/tmp/install_important_packages.log
function _trim {
# remove blank lines, leading and trailing whitespace
sed '/^$/d' | sed -e 's/^ *//' | sed -e 's/ *$//'
}
function _filter_known_ok {
# filter out log messages known to be ok
# brew related filters
grep -v "brew upgrade " | \
grep -v "already installed" | \
grep -v "It seems there is already an App at" \
# rustup related filters
}
function install_everything {
###################
# install homebrew
###################
which brew &> /dev/null || \
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# NOTE: don't try to be smart with OS, let brew decide what it can and can't install
###################
# install packages
###################
echo -n '
coreutils
curl
fd
fish
fzf
go
ispell
lastpass-cli
moreutils
mycli
neovim
node
ripgrep
socat
sd
the_silver_searcher
tmux
wget
zsh
' | _trim | xargs brew install
echo -n '
docker
firefox
flux
flycut
spectacle
' | _trim | xargs brew cask install
#################################
# install apps from special taps
#################################
####################
# install oh-my-zsh
####################
sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
####################
# install spacemacs
####################
emacs_d=$HOME/.emacs.d
######################################
# install vim-plug for vim and neovim
######################################
vim_plug_file=$HOME/.vim/autoload/plug.vim
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
nvim_plug_file=$HOME/.local/share/nvim/site/autoload/plug.vim
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
################
# install pyenv
################
curl https://pyenv.run | bash
#################
# install rustup
#################
which rustup &> /dev/null || \
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
}
function on_success {
_filter_known_ok $stderr_log | wc -l
echo "Install completed without error."
rm $stderr_log
rm $stdout_log
return 0
else
echo "Install completed but errors were logged."
echo "See full stderr at $stderr_log"
echo "See full stdout at $stdout_log"
return 1
fi
}
function on_error {
echo "Install did not complete or partially completed with unhandled error."
echo "See full stderr at $stderr_log"
echo "See full stdout at $stdout_log"
return 2
}
# you can redirect stderr like this if you want to more easily debug:
# 2> >(tee -a $stderr_log >&2)
if install_everything > $stdout_log 2> $stderr_log; then
on_success
else
on_error
fi
)" -eq 0; then
if test "$(
################################################
# globally install poetry python package manager
################################################
curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python -
test -d "$HOME/.pyenv" || \
test -f "$nvim_plug_file" || \
curl -fLo "$nvim_plug_file" --create-dirs \
test -f "$vim_plug_file" || \
curl -fLo "$vim_plug_file" --create-dirs \
test -d "$emacs_d" || \
git clone https://github.com/syl20bnr/spacemacs "$emacs_d"
test -d "$HOME/.oh-my-zsh" || \
brew list | grep -q emacs-plus || {
brew tap d12frosted/emacs-plus && brew install emacs-plus
}
karabiner-elements
hammerspoon
############################
# install gui and cask apps
############################
koekeishiya/formulae/skhd
koekeishiya/formulae/yabai
terminal-notifier
openssl
mysql
grep -Ev "info: (latest)|(downloading)|(installing)|(default)"
gerp -Eiv "re-?install" | \
_trim < "$1" | \
set -o pipefail
# tries to open an emacsclient new window
# if a server isn't started, starts one
# and tries to connect to it repeatedly
# until ~30 seconds are up then gives up
#
# meant to be called from GUI apps or hot keys
# notifications are sent to the macos notification
# widget / tray thing
emacs_frame_quiet_emacsclient() {
}
emacs_frame_start_emacs() {
terminal-notifier -message "Emacs server starting"
brew services restart 'emacs-plus@28' > /dev/null 2>&1
START_EMACS_COUNT=100
until [ "$START_EMACS_COUNT" -eq 0 ] || emacs_frame_quiet_emacsclient;
do sleep .25 && let START_EMACS_COUNT=START_EMACS_COUNT-1; done;
[ "$START_EMACS_COUNT" -eq 0 ] && terminal-notifier -message "Emacs server failed to start"
}
emacs_frame_quiet_emacsclient || emacs_frame_start_emacs
# the elisp here forces emacs to focus the new frame
emacsclient -nc -e "(progn (raise-frame) (x-focus-frame (selected-frame)))" \
> /dev/null 2>&1
export NVM_DIR="$HOME/.nvm"
[ -s "/usr/local/opt/nvm/nvm.sh" ] && . "/usr/local/opt/nvm/nvm.sh" # This loads nvm
[ -s "/usr/local/opt/nvm/etc/bash_completion.d/nvm" ] && . "/usr/local/opt/nvm/etc/bash_completion.d/nvm" # This loads nvm bash_completion