osx/install.sh

41 lines
1.3 KiB
Bash
Raw Normal View History

2019-11-27 04:28:59 +00:00
#!/bin/bash
function run_install {
2019-11-27 04:43:36 +00:00
mkdir -p $HOME/Library/Caches/Homebrew
rm -rf $HOME/Library/Caches/Homebrew/*
2020-02-19 23:24:40 +00:00
REPO="https://git.eeqj.de/sneak/osx.git"
DEST="$TMPDIR/osx"
2019-11-27 04:28:59 +00:00
if [[ ! -d "$DEST" ]]; then
git clone "$REPO" "$DEST"
else
cd "$DEST" && git pull && cd -
2019-11-27 04:28:59 +00:00
fi
rsync -avP "$DEST/custompkg/root/etc/skel/" "$HOME/"
mkdir -p $HOME/Library/bashrc.d
mkdir -p $HOME/Library/profile.d
touch $HOME/Library/bashrc.d/000keep.sh
touch $HOME/Library/profile.d/000keep.sh
2021-09-11 02:41:10 +00:00
# FIXME move this into the modular setup scripts
mkdir -p "$HOME/Library/Desktop Pictures"
rsync -avP $TMPDIR/osx/custompkg/root/Library/Desktop?Pictures/ $HOME/Library/Desktop?Pictures/
defaults write \
~/Library/Preferences/com.apple.systempreferences DSKDesktopPrefPane \
'<dict><key>UserFolderPaths</key><array><string>/Users/user/Library/Desktop Pictures</string></array></dict>'
2019-11-27 04:28:59 +00:00
# run modular setup scripts
2021-09-10 22:29:29 +00:00
for FN in "$HOME/Library/user-setup/"*.sh ; do
2021-09-10 22:28:29 +00:00
echo "new-user-setup: starting $(basename "$FN")..."
# we used to run these in a subshell but not we don't because we want the environment to persist between
source "$FN"
2019-11-27 04:28:59 +00:00
rm "$FN"
echo "new-user-setup: removed $(basename $FN)..."
done
}
run_install