-
Notifications
You must be signed in to change notification settings - Fork 0
/
install
executable file
·225 lines (180 loc) · 7.91 KB
/
install
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
#!/bin/bash
current_dir=$(pwd)
create_symlinks() {
local source_directory="$1"
local target_directory="$2"
local full_source_directory="${current_dir}/$source_directory"
# Ensure the target directory exists
mkdir -p "$target_directory"
# Loop through each file in the source directory
for file in "$full_source_directory"/*; do
if [ -f "$file" ]; then
ln -s "$file" "$target_directory"
fi
done
}
packages=("wget" "ranger" "tmux" "curl" "unzip" "rustup" "base-devel" "hyprland" "xdg-desktop-portal-hyprland" "alacritty" "nautilus" "flatpak" "gammastep" "grim" "wl-clipboard" "slurp" "swaync" "waybar" "blueman" "btop" "zsh" "neovim" "zathura" "lsd" "fastfetch" "bat" "picom" "i3" "polybar" "nerd-fonts" "qemu-system-x86" "qemu-system-x86-firmware" "libvirt" "bridge-utils" "virt-manager" "qemu-hw-display-virtio-gpu-gl" "qemu-hw-display-virtio-gpu" "qemu-hw-display-virtio-gpu-pci" "qemu-hw-display-virtio-gpu-pci-gl" "dnsmasq" "qemu-img" "docker" "docker-compose" "hyprpaper" "hyprlock" "ripgrep" "qt5-wayland" "qt6-wayland" "lib32-glibc" "lib32-gcc-libs" "easyeffects" "firefox" "network-manager-applet" "zed" "feh" "xorg-server" "lxappearance" "zathura-pdf-poppler" "gnome-tweaks" "gnome-themes-extra" "plymouth" "obsidian" "polkit-kde-agent" "qemu-full" "gdb" "vlc" "jq" "man-pages" "hypridle" "vulkan-radeon" "exa")
# Filter out already installed packages
to_install=()
for pkg in "${packages[@]}"; do
if ! pacman -Qq $pkg &>/dev/null; then
to_install+=("$pkg")
fi
done
if (( ${#to_install[@]} > 0 )); then
sudo pacman -S --noconfirm "${to_install[@]}"
else
echo "Dependencies already installed."
fi
mkdir -p "$HOME/.cargo"
rm -rf "$HOME/.cargo/config.toml"
ln -s "${current_dir}/cargo/config.toml" "$HOME/.cargo/config.toml"
# Install paru
if ! pacman -Qq paru &>/dev/null; then
mkdir -p ~/aur
cd ~/aur
git clone https://aur.archlinux.org/paru-bin.git
cd paru-bin
makepkg -si --noconfirm
else
echo "Paru already installed."
fi
# Remove xdg-desktop-portal-gnome
# if pacman -Qq xdg-desktop-portal-gnome &>/dev/null; then
# sudo pacman -Rs --noconfirm xdg-desktop-portal-gnome
# fi
# Install AUR packages
aur_packages=("light" "hyprpicker" "rate-mirrors-bin" "swayosd-git" "visual-studio-code-bin" "rofi-lbonn-wayland-git" "wl-gammarelay-rs" "proton-vpn-gtk-app" "clipse-bin")
aur_to_install=()
for pkg in "${aur_packages[@]}"; do
if ! pacman -Qq $pkg &>/dev/null; then
aur_to_install+=("$pkg")
fi
done
if (( ${#aur_to_install[@]} > 0 )); then
paru -S --noconfirm --skipreview "${aur_to_install[@]}"
else
echo "AUR dependencies already installed."
fi
cd $current_dir
# Enable tap to click on i3
sudo mkdir -p /etc/X11/xorg.conf.d && sudo tee <<'EOF' /etc/X11/xorg.conf.d/90-touchpad.conf 1> /dev/null
Section "InputClass"
Identifier "touchpad"
MatchIsTouchpad "on"
Driver "libinput"
Option "Tapping" "on"
EndSection
EOF
# Install AstroNvim
rm -rf ~/.config/nvim ~/.local/share/nvim ~/.local/state/nvim ~/.cache/nvim
ln -s "${current_dir}/nvim" ~/.config/nvim
# Install tmux plugin manager
rm -rf ~/.tmux.conf
ln "${current_dir}/tmux.conf" ~/.tmux.conf
git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
# Install alacritty config
rm -rf ~/.config/alacritty
ln -s "${current_dir}/alacritty" ~/.config/alacritty
# Install dunst config
rm -rf ~/.config/swaync
ln -s "${current_dir}/swaync" ~/.config/swaync
# Install hyprland config
rm -rf ~/.config/hypr
ln -s "${current_dir}/hypr" ~/.config/hypr
# Install neofetch config
rm -rf ~/.config/fastfetch
ln -s "${current_dir}/fastfetch" ~/.config/fastfetch
# Install rofi config
rm -rf ~/.config/rofi
ln -s "${current_dir}/rofi" ~/.config/rofi
# Install waybar config
rm -rf ~/.config/waybar
ln -s "${current_dir}/waybar" ~/.config/waybar
# Install zathura config
rm -rf ~/.config/zathura
ln -s "${current_dir}/zathura" ~/.config/zathura
# Install polybar config
rm -rf ~/.config/polybar
ln -s "${current_dir}/polybar" ~/.config/polybar
# Install picom config
rm -rf ~/.config/picom
ln -s "${current_dir}/picom" ~/.config/picom
# Install i3 config
rm -rf ~/.config/i3
ln -s "${current_dir}/i3" ~/.config/i3
# Install fonts
# Needed for waybar
unzip ./icomoon.zip
mkdir -p ~/.local/share/fonts
cp -r ./icomoon/fonts ~/.local/share/fonts/icomoon
# https://github.com/rsms/inter/releases/download/v4.0/Inter-4.0.zip
wget https://github.com/rsms/inter/releases/download/v4.0/Inter-4.0.zip
unzip -d Inter Inter-4.0.zip
mv "./Inter/extras/otf" ~/.local/share/fonts/Inter
rm -rf Inter Inter-4.0.zip
# Reload cache
fc-cache
# Install code config
mkdir -p ~/.config/Code/User
rm -rf ~/.config/Code/User/settings.json ~/.config/Code/User/keybinds.json
ln -s "${current_dir}/Code/User/keybinds.json" ~/.config/Code/User/keybinds.json
ln -s "${current_dir}/Code/User/settings.json" ~/.config/Code/User/settings.json
# Install zed config
mkdir -p ~/.config/zed
rm -rf ~/.config/zed/settings.json
ln -s "${current_dir}/zed/settings.json" ~/.config/zed/settings.json
ln -s "${current_dir}/zed/keymap.json" ~/.config/zed/keymap.json
ln -s "${current_dir}/zed/themes" ~/.config/zed/themes
# Install bin
create_symlinks "bin" "$HOME/.local/bin/"
~/.local/bin/set_wallpaper ~/.config/hypr/wallpapers/wallpaper.png
# Install pacman config
sudo cp ./pacman.conf /etc/pacman.conf
# Ranger dev icons
git clone https://github.com/alexanderjeurissen/ranger_devicons ~/.config/ranger/plugins/ranger_devicons
rm -rf ~/.config/ranger/rc.conf
rm -rf ~/.config/ranger/scope.sh
rm -rf ~/.config/ranger/rifle.conf
ln -s "${current_dir}/ranger/rc.conf" ~/.config/ranger/rc.conf
ln -s "${current_dir}/ranger/scope.sh" ~/.config/ranger/scope.sh
ln -s "${current_dir}/ranger/rifle.conf" ~/.config/ranger/rifle.conf
# Webcord flags
rm -f ~/.config/code-flags.conf
ln -s "${current_dir}/electron-flags.conf" ~/.config/code-flags.conf
# Webcord flags
rm -f ~/.config/webcord-flags.conf
ln -s "${current_dir}/electron-flags.conf" ~/.config/webcord-flags.conf
# Obsidian flags
rm -f ~/.config/obsidian/user-flags.conf
ln -s "${current_dir}/electron-flags.conf" ~/.config/obsidian/user-flags.conf
# Firefox profile
mkdir -p ~/.mozilla/firefox/1l0qa58n.default-release
rm ~/.mozilla/firefox/profiles.ini
rm ~/.mozilla/firefox/installs.ini
rm ~/.mozilla/firefox/1l0qa58n.default-release/prefs.js
rm -rf ~/.mozilla/firefox/1l0qa58n.default-release/chrome
ln -s "${current_dir}/mozilla/firefox/profiles.ini" ~/.mozilla/firefox/profiles.ini
ln -s "${current_dir}/mozilla/firefox/installs.ini" ~/.mozilla/firefox/installs.ini
ln -s "${current_dir}/mozilla/firefox/1l0qa58n.default-release/prefs.js" ~/.mozilla/firefox/1l0qa58n.default-release/prefs.js
ln -s "${current_dir}/mozilla/firefox/1l0qa58n.default-release/chrome" ~/.mozilla/firefox/1l0qa58n.default-release/chrome
# Add shutdown, hibernate and suspend desktop entries for rofi
ln -sf "${current_dir}/applications/suspend.desktop" ~/.local/share/applications/suspend.desktop
ln -sf "${current_dir}/applications/shutdown.desktop" ~/.local/share/applications/shutdown.desktop
ln -sf "${current_dir}/applications/hibernate.desktop" ~/.local/share/applications/hibernate.desktop
# Enable bluetooth
sudo systemctl enable bluetooth.service --now
# Configure virtual machines
sudo systemctl enable libvirtd.service --now
sudo virsh net-start default
sudo virsh net-autostart default
sudo usermod -aG libvirt $USER
sudo usermod -aG libvirt-qemu $USER
sudo usermod -aG kvm $USER
sudo usermod -aG docker $USER
flatpak override --filesystem=~/.themes:ro --filesystem=~/.icons:ro --user
mkdir -p ~/.icons
ln -sf "${current_dir}/zshrc" ~/.zshrc
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended --keep-zshrc
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions