-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit.sh
executable file
·50 lines (38 loc) · 965 Bytes
/
init.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/bin/bash
# This script installs base software I use on a new OSX machine
set -e
# Change into the directory this script is in
cd "$(dirname "$0")"
# Default stow packages (sourced subscripts can add items to this array)
STOW_PACKAGES=(
atuin
espanso
lsd
nvim
scripts
zellij
zsh
)
case $(uname) in
# Mac OSX
Darwin)
source .init_scripts/_init_osx.sh
;;
Linux)
osID=$(grep -Po '(?<=^ID=).*' /etc/os-release)
initFile=".init_scripts/_init_linux_$osID.sh"
if [ -f "$initFile" ]; then
echo "Running init file for $osID linux..."
# shellcheck disable=SC1090
source "$initFile"
else
echo "Linux '$osID' is not supported!"
fi
;;
esac
# Use stow to create symlinks for config files
echo "Stowing packages (${STOW_PACKAGES[*]})..."
stow --target="$HOME/" --dir=stow_packages "${STOW_PACKAGES[@]}"
# Replace with new zsh process to apply changes
# source ~/.config/zsh/.zshrc
exec zsh