-
Notifications
You must be signed in to change notification settings - Fork 0
/
install_package.sh
executable file
·90 lines (76 loc) · 2.11 KB
/
install_package.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
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
80
81
82
83
84
85
86
87
88
89
90
#!/usr/bin/env bash
# Exit on errors
set -e
read -r -p "write base of your distro for select package manager: [a]rch, [d]ebian, [v]oid, [r]ed hat: " response
case $response in
a)
package_manager() {
sudo pacman -Sy $@
}
;;
d)
package_manager() {
sudo apt update && sudo apt install -y $@
}
;;
v)
package_manager() {
sudo xbps-install -Suy && sudo xbps-install -y $@
}
;;
r)
package_manager() {
sudo dnf check-update && sudo dnf install -y $@
}
;;
*)
echo "Invalid option!"
exit 1
;;
esac
# install needed package
package_manager \
picom sxhkd tmux neovim sxiv \
mpv ranger lsd git zsh chromium \
rofi yt-dlp xclip curl aria2 fzf qrencode \
ripgrep fd bat exa zathura zathura-pdf-mupdf \
htop btop alacritty ffmpeg qutebrowser ranger \
imagemagick libnotify dunst pulseaudio \
xorg-xbacklight xorg-xrandr feh jq xdotool
exit
if [[ $! -ne 0 ]]; then
echo "Failed to install package!"
exit 1
fi
# install starship theme for zsh
curl -sS https://starship.rs/install.sh | sh
# set zsh for default shell
chsh -s "$(which zsh)"
# clone zsh plugins
clone_zsh_plugins() {
directory="$HOME/.config/zsh-plugins"
mkdir -p "$directory"
cd "$directory" || exit
xargs -n1 git clone <<end
https://github.com/unixorn/fzf-zsh-plugin.git
https://github.com/zsh-users/zsh-autosuggestions
https://github.com/MichaelAquilina/zsh-you-should-use.git
https://github.com/agkozak/zsh-z.git
https://github.com/zsh-users/zsh-history-substring-search.git
https://github.com/zsh-users/zsh-syntax-highlighting.git
end
curl -L -o vim-mode https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/plugins/vi-mode/vi-mode.plugin.zsh
if [[ -f vim-mode ]]; then
chmod +x vim-mode
else
echo "Failed to download vim-mode"
fi
}
clone_zsh_plugins
# NOTE:
# it have too much dependencies so I will install it manually for now
# install nodejs, npm, golang, rust, cargo for lvim
# python3 python3-pip nodejs npm golang rustc cargo
# install lvim
# LV_BRANCH='release-1.3/neovim-0.9' bash <(curl -s https://raw.githubusercontent.com/LunarVim/LunarVim/release-1.3/neovim-0.9/utils/installer/install.sh)
echo "All packages installed successfully!"