Repository navigation
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·79 lines (64 loc) · 1.97 KB
/
Copy pathsetup.sh
File metadata and controls
executable file
·79 lines (64 loc) · 1.97 KB
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
74
75
76
77
78
79
option=$1
ZSH_DIR="$HOME/.oh-my-zsh"
ZSH_CUSTOM="$ZSH_DIR/custom"
if command -v stow &>/dev/null; then
echo "Stow is available!"
else
echo "Installing stow..."
if command -v dnf >/dev/null; then
echo "Installing prerequisites with DNF..."
sudo dnf install -y stow
elif command -v pacman >/dev/null; then
echo "Installing prerequisites with Pacman..."
sudo pacman -Syu --noconfirm stow
else
echo "WARNING: Unsupported distribution. Install prerequisities manually"
fi
fi
default_packages=(
aria2 brightnessctl btop git fastfetch fuse fuse-libs maim python3-xlib
qutebrowser ripgrep slop xev zathura zathura-pdf-poppler zsh tealdeer pass
)
optional_packages=(
pandoc texlive-schema-full sane-backends simple-scan rustup obs-studio
)
install_omz() {
if [ ! -d "$ZSH_DIR" ]; then
echo "Installing Oh My Zsh..."
git clone https://github.com/ohmyzsh/ohmyzsh.git "$ZSH_DIR/"
fi
}
uninstall_omz() {
if [ -d "$ZSH_DIR" ]; then
echo "Uninstalling Oh My Zsh..."
rm -rf "$ZSH_DIR"
fi
}
install_omz_plugins() {
declare -A plugins=(
["zsh-autosuggestions"]="https://github.com/zsh-users/zsh-autosuggestions"
["zsh-abbr"]="https://github.com/olets/zsh-abbr"
)
for plugin in "${!plugins[@]}"; do
local plugin_path="$ZSH_CUSTOM/plugins/$plugin"
[ ! -d "$plugin_path" ] && echo "Installing plugin '$plugin' for omz..." && git clone "${plugins[$plugin]}" "$plugin_path" --recurse-submodules
done
}
case "$option" in
uninstall)
echo "Attempting to remove dotfiles..."
stow -v -t "$HOME" --dotfiles -D user-config
stow -v -t "$HOME/.local/bin" --dotfiles -D bin
;;
*)
echo "Attempting to install dotfiles..."
mkdir -p \
"$HOME/.config" "$HOME/.local/bin" \
"$HOME/.config/systemd/user"
stow -v -t "$HOME" --dotfiles user-config
stow -v -t "$HOME/.local/bin" --dotfiles bin
install_omz
install_omz_plugins
echo "Done!"
;;
esac