mirror of
https://github.com/ivuorinen/dotfiles.git
synced 2026-02-13 22:53:07 +00:00
settler.sh, fixes, updates
This commit is contained in:
1
Brewfile
1
Brewfile
@@ -229,6 +229,7 @@ cask "vlc"
|
|||||||
# Rust-based terminal
|
# Rust-based terminal
|
||||||
cask "warp"
|
cask "warp"
|
||||||
mas "1Password for Safari", id: 1569813296
|
mas "1Password for Safari", id: 1569813296
|
||||||
|
mas "Flow", id: 1423210932
|
||||||
mas "GarageBand", id: 682658836
|
mas "GarageBand", id: 682658836
|
||||||
mas "iMovie", id: 408981434
|
mas "iMovie", id: 408981434
|
||||||
mas "Keynote", id: 409183694
|
mas "Keynote", id: 409183694
|
||||||
|
|||||||
38
install.sh
38
install.sh
@@ -66,21 +66,23 @@ handle_file_ln()
|
|||||||
$MKDIR -p "$($DIRNAME "$2")"
|
$MKDIR -p "$($DIRNAME "$2")"
|
||||||
$LN -sf "$1" "$2"
|
$LN -sf "$1" "$2"
|
||||||
}
|
}
|
||||||
handle_file_ln "/Users/ivuorinen/.dotfiles/bash_profile" "/Users/ivuorinen/.bash_profile"
|
handle_file_ln "~/.dotfiles/bash_profile" "~/.bash_profile"
|
||||||
handle_file_ln "/Users/ivuorinen/.dotfiles/bashrc" "/Users/ivuorinen/.bashrc"
|
handle_file_ln "~/.dotfiles/bashrc" "~/.bashrc"
|
||||||
handle_file_ln "/Users/ivuorinen/.dotfiles/config/alias" "/Users/ivuorinen/.config/alias"
|
handle_file_ln "~/.dotfiles/config/alias" "~/.config/alias"
|
||||||
handle_file_ln "/Users/ivuorinen/.dotfiles/config/antigen.zsh" "/Users/ivuorinen/.config/antigen.zsh"
|
handle_file_ln "~/.dotfiles/config/antigen.zsh" "~/.config/antigen.zsh"
|
||||||
handle_file_ln "/Users/ivuorinen/.dotfiles/config/gh/config.yml" "/Users/ivuorinen/.config/gh/config.yml"
|
handle_file_ln "~/.dotfiles/config/exports" "~/.config/exports"
|
||||||
handle_file_ln "/Users/ivuorinen/.dotfiles/config/git/config" "/Users/ivuorinen/.config/git/config"
|
handle_file_ln "~/.dotfiles/config/functions" "~/.config/functions"
|
||||||
handle_file_ln "/Users/ivuorinen/.dotfiles/config/git/gitignore" "/Users/ivuorinen/.config/git/gitignore"
|
handle_file_ln "~/.dotfiles/config/gh/config.yml" "~/.config/gh/config.yml"
|
||||||
handle_file_ln "/Users/ivuorinen/.dotfiles/config/wtf/config.yml" "/Users/ivuorinen/.config/wtf/config.yml"
|
handle_file_ln "~/.dotfiles/config/git/config" "~/.config/git/config"
|
||||||
handle_file_ln "/Users/ivuorinen/.dotfiles/git_profiles" "/Users/ivuorinen/.git_profiles"
|
handle_file_ln "~/.dotfiles/config/git/gitignore" "~/.config/git/gitignore"
|
||||||
handle_file_ln "/Users/ivuorinen/.dotfiles/huskyrc" "/Users/ivuorinen/.huskyrc"
|
handle_file_ln "~/.dotfiles/config/wtf/config.yml" "~/.config/wtf/config.yml"
|
||||||
handle_file_ln "/Users/ivuorinen/.dotfiles/local/bin/dotfiles" "/Users/ivuorinen/.local/bin/dotfiles"
|
handle_file_ln "~/.dotfiles/git_profiles" "~/.git_profiles"
|
||||||
handle_file_ln "/Users/ivuorinen/.dotfiles/local/bin/x-check-git-attributes" "/Users/ivuorinen/.local/bin/x-check-git-attributes"
|
handle_file_ln "~/.dotfiles/huskyrc" "~/.huskyrc"
|
||||||
handle_file_ln "/Users/ivuorinen/.dotfiles/local/bin/x-open-ports" "/Users/ivuorinen/.local/bin/x-open-ports"
|
handle_file_ln "~/.dotfiles/local/bin/dotfiles" "~/.local/bin/dotfiles"
|
||||||
handle_file_ln "/Users/ivuorinen/.dotfiles/rcrc" "/Users/ivuorinen/.rcrc"
|
handle_file_ln "~/.dotfiles/local/bin/x-check-git-attributes" "~/.local/bin/x-check-git-attributes"
|
||||||
handle_file_ln "/Users/ivuorinen/.dotfiles/ssh/allowed_signers" "/Users/ivuorinen/.ssh/allowed_signers"
|
handle_file_ln "~/.dotfiles/local/bin/x-open-ports" "~/.local/bin/x-open-ports"
|
||||||
handle_file_ln "/Users/ivuorinen/.dotfiles/ssh/config" "/Users/ivuorinen/.ssh/config"
|
handle_file_ln "~/.dotfiles/rcrc" "~/.rcrc"
|
||||||
handle_file_ln "/Users/ivuorinen/.dotfiles/vuerc" "/Users/ivuorinen/.vuerc"
|
handle_file_ln "~/.dotfiles/ssh/allowed_signers" "~/.ssh/allowed_signers"
|
||||||
handle_file_ln "/Users/ivuorinen/.dotfiles/zshrc" "/Users/ivuorinen/.zshrc"
|
handle_file_ln "~/.dotfiles/ssh/config" "~/.ssh/config"
|
||||||
|
handle_file_ln "~/.dotfiles/vuerc" "~/.vuerc"
|
||||||
|
handle_file_ln "~/.dotfiles/zshrc" "~/.zshrc"
|
||||||
|
|||||||
@@ -90,6 +90,7 @@ function section_dotfiles
|
|||||||
rcup -B 0 -g \
|
rcup -B 0 -g \
|
||||||
| tee "$INSTALL_SCRIPT" 1> /dev/null \
|
| tee "$INSTALL_SCRIPT" 1> /dev/null \
|
||||||
&& shfmt -w -l "$INSTALL_SCRIPT" \
|
&& shfmt -w -l "$INSTALL_SCRIPT" \
|
||||||
|
&& sed -i '' "s|$HOME|\~|g" "$INSTALL_SCRIPT" \
|
||||||
&& echo "🎉 Done!"
|
&& echo "🎉 Done!"
|
||||||
;;
|
;;
|
||||||
shfmt)
|
shfmt)
|
||||||
|
|||||||
@@ -4,7 +4,8 @@ echo 'start osx/set-defaults.sh'
|
|||||||
# Ask for the administrator password upfront
|
# Ask for the administrator password upfront
|
||||||
sudo -v
|
sudo -v
|
||||||
|
|
||||||
# Keep-alive: update existing `sudo` time stamp until `.osx` has finished
|
# Keep-alive: update existing `sudo` time stamp
|
||||||
|
# until this script has finished
|
||||||
while true; do
|
while true; do
|
||||||
sudo -n true
|
sudo -n true
|
||||||
sleep 60
|
sleep 60
|
||||||
|
|||||||
59
scripts/settler.sh
Executable file
59
scripts/settler.sh
Executable file
@@ -0,0 +1,59 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
#
|
||||||
|
# Settler - my macOS setup automator
|
||||||
|
|
||||||
|
# Ask for the administrator password upfront
|
||||||
|
sudo -v
|
||||||
|
|
||||||
|
# Keep-alive: update existing `sudo` time stamp until `settler` has finished
|
||||||
|
while true; do
|
||||||
|
sudo -n true
|
||||||
|
sleep 60
|
||||||
|
kill -0 "$$" || exit
|
||||||
|
done 2> /dev/null &
|
||||||
|
|
||||||
|
# https://unix.stackexchange.com/a/408305
|
||||||
|
# check if user has git installed and propose to install if not installed
|
||||||
|
if [ "$(which git)" ]; then
|
||||||
|
echo "You already have git. Continuing..."
|
||||||
|
else
|
||||||
|
XCODE_MESSAGE="$(
|
||||||
|
osascript -e \
|
||||||
|
'tell app "System Events" to display dialog "Please click install when Command Line Developer Tools appears"'
|
||||||
|
)"
|
||||||
|
|
||||||
|
if [ "$XCODE_MESSAGE" = "button returned:OK" ]; then
|
||||||
|
xcode-select --install
|
||||||
|
else
|
||||||
|
echo "You have cancelled the installation, please rerun the installer."
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
until [ "$(which git)" ]; do
|
||||||
|
echo -n "."
|
||||||
|
sleep 1
|
||||||
|
done
|
||||||
|
|
||||||
|
# Install brew
|
||||||
|
if [ "$(which brew)" ]; then
|
||||||
|
echo 'Brew already installed'
|
||||||
|
else
|
||||||
|
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
|
||||||
|
fi
|
||||||
|
|
||||||
|
bash ../local/bin/dotfiles brew install && "Installed Brewfile contents"
|
||||||
|
bash ../local/bin/dotfiles dotfiles link && "Linked all dotfiles"
|
||||||
|
|
||||||
|
read -r -p "Do you want to set macOS defaults? (y/N) " yn
|
||||||
|
|
||||||
|
case $yn in
|
||||||
|
[yY])
|
||||||
|
bash "set-defaults.sh"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Skipping..."
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
echo "Done. Note that some of these changes require a logout/restart to take effect."
|
||||||
Reference in New Issue
Block a user