-
Notifications
You must be signed in to change notification settings - Fork 3
/
bootstrap
executable file
·73 lines (56 loc) · 2.07 KB
/
bootstrap
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
61
62
63
64
65
66
67
68
69
70
71
72
73
#!/bin/sh
# Where the repo has been cloned to
dotfiles_repo="$(dirname $0)"
is_installed(){
(echo "$@" | tr ' ' '\n' | xargs -L 1 xbps-query)>/dev/null
}
# Take packages to install, and install it any aren't already installed.
install(){
(echo "$@" | tr ' ' '\n' | xargs -L 1 xbps-query)>/dev/null || sudo xbps-install "$@"
}
stowstar(){
stow "--dir=${dotfiles_repo}" "$@"
}
# Install GNU Stow
install stow
# Setup dotfiles
mkdir -p ~/.config ~/.config/nvim ~/.config/sway ~/.local/share # Prevent stow from symlinking these root folders
stowstar --dotfiles "--target=$HOME" dotfiles
if [ ! -f ~/.config/nvim/init.vim ]; then
cp ~/.config/nvim/init.vim.template ~/.config/nvim/init.vim
echo "Please see ~/.config/nvim/init.vim for information"
fi
# Dependencies of dotfiles
install zsh dunst sxhkd rofi bspwm wmname xrdb xsetroot neovim neovim-remote curl fzf mpd polybar nerd-fonts-otf
# Wayland dependencies
install mako bemenu dmenu hikari sway Waybar xdg-desktop-portal-wlr
# Setup shell
if [ ! "/bin/zsh" = "$(getent passwd $(id -un) | awk -F : '{print $NF}')" ]; then
chsh -s /bin/zsh
fi
# Setup zinit
zinit_dir="${XDG_DATA_HOME:-$HOME/.local/share}/zinit"
if [ ! -e "$zinit_dir" ]; then
git clone https://github.com/zdharma-continuum/zinit.git "$zinit_dir"
fi
# Create local bin directory
mkdir -p ~/bin/
# Compile xgetresource
if [ ! -e ~/bin/xgetresource ]; then
install make gcc libX11-devel
(cd "$dotfiles_repo/src/getresource" && make && cp xgetresource ~/bin/)
sudo xbps-remove -R make gcc libX11-devel
fi
sudo stow --no-folding --dir=${dotfiles_repo} --target=/ global
# All hail the desktop stack
## Manually:
## sudo ln -s /etv/sv/seatd /var/service/
## sudo ln -s /etc/sv/turnstile /var/service/
install pipewire wireplumber seatd turnstile
if ! id -nG "$USER" | grep -qw "_seatd"; then
echo "Adding to _seatd"
sudo usermod -a -G _seatd "$USER"
fi
mkdir -p $HOME/.config/service
stowstar --no-folding --target $HOME/.config/service services
git config --replace-all --global include.path "$(realpath "$dotfiles_repo")/gitconfig" "$(realpath "$dotfiles_repo")/gitconfig"