aboutsummaryrefslogtreecommitdiffstats
path: root/install.sh
blob: 06ce5d7819ba8273724916472eca1cdff91f02c0 (plain) (blame)
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
51
52
53
54
55
56
57
58
59
60
#!/bin/sh
set -e

. "$(dirname "$0")/shlib/bootstrap.sh"
. "$(dirname "$0")/shlib/log.sh"
. "$(dirname "$0")/shlib/os.sh"
. "$(dirname "$0")/shlib/tmux.sh"

main() {
  if os_is_macos; then
    bootstrap_macos
  elif os_is_openbsd; then
    bootstrap_openbsd
  else
    log_error "Unexpected OS: $(os_print)"
    exit 1
  fi || {
    log_error "Failed to bootstrap install script"
    exit 1
  }

  if os_is_macos; then
    stow ghostty
  fi
  if os_is_openbsd; then
    stow ksh
    stow x
    stow feh
    stow cwm
    stow kitty
    stow lemonbar-xft
    stow newsboat
    stow ansiweather
  fi
  stow wallpapers
  stow ssh
  stow bin
  stow vim
  stow nvim
  stow zsh
  stow git
  stow gpg
  stow tmux
  stow aerc
  stow isync
  stow msmtp
  stow lazygit
  log_success "Successfully linked all dotfiles."

  mkdir -p ~/Mail/Gmail/INBOX ~/Mail/iCloud/INBOX ~/bin/ ~/src/

  log_info "Initializing TPM (Tmux Plugin Manager)..."
  if ! tmux_setup_tpm; then
    log_error "Failed to setup tpm"
    exit 1
  fi
  log_success "Setup complete!"
}

main "$@"