|
| 1 | + |
1 | 2 | #!/bin/zsh |
2 | 3 | # ========================================= |
3 | 4 | # Arch Linux Essentials Setup Script |
4 | 5 | # Use this after resetting your Arch PC |
5 | 6 | # Author: Ravindran S |
6 | 7 | # ========================================= |
7 | 8 |
|
| 9 | +RED='\033[0;31m' |
| 10 | +GREEN='\033[0;32m' |
| 11 | +YELLOW='\033[1;33m' |
| 12 | +BLUE='\033[1;34m' |
| 13 | +CYAN='\033[1;36m' |
| 14 | +MAGENTA='\033[1;35m' |
| 15 | +RESET='\033[0m' |
| 16 | +BOLD='\033[1m' |
| 17 | + |
| 18 | +line() { |
| 19 | + printf "${BLUE}%*s${RESET}\n" "$(tput cols)" "" | tr ' ' '-' |
| 20 | +} |
| 21 | + |
| 22 | + |
| 23 | + |
| 24 | +section() { |
| 25 | + echo |
| 26 | + line |
| 27 | + echo -e "${BOLD}${CYAN}⚙ $1${RESET}" |
| 28 | + line |
| 29 | +} |
| 30 | + |
| 31 | +success() { |
| 32 | + echo -e "${GREEN}✔ $1${RESET}" |
| 33 | +} |
| 34 | + |
| 35 | +info() { |
| 36 | + echo -e "${YELLOW}➜ $1${RESET}" |
| 37 | +} |
| 38 | + |
| 39 | +section "Shell Setup (Zsh)" |
8 | 40 |
|
9 | 41 | sudo pacman -S --noconfirm zsh |
10 | 42 | if [ "$SHELL" != "$(which zsh)" ]; then |
11 | | - echo ">>> Changing default shell to zsh..." |
| 43 | + info "Changing default shell to zsh..." |
12 | 44 | chsh -s "$(which zsh)" |
13 | 45 | fi |
| 46 | +success "Zsh installed & configured" |
14 | 47 |
|
| 48 | +section "System Update" |
15 | 49 |
|
16 | | -echo ">>> Updating system..." |
| 50 | +info "Updating system..." |
17 | 51 | sudo pacman -Syu --noconfirm |
| 52 | +success "System up to date" |
18 | 53 |
|
| 54 | +section "Mirrorlist" |
19 | 55 |
|
20 | | -echo ">>> Installing mirrorlist..." |
| 56 | +info "Installing mirrorlist..." |
21 | 57 | sudo pacman -Syu |
| 58 | +success "Mirrorlist synced" |
22 | 59 |
|
| 60 | +section "Timezone Configuration" |
23 | 61 |
|
24 | | -echo ">>> Setting timezone to Asia/Kolkata..." |
| 62 | +info "Setting timezone to Asia/Kolkata..." |
25 | 63 | sudo timedatectl set-timezone Asia/Kolkata |
| 64 | +success "Timezone set" |
26 | 65 |
|
| 66 | +section "Installing Arch Essentials" |
27 | 67 |
|
28 | | -echo ">>> Installing Arch essentials..." |
29 | 68 | sudo pacman -S --noconfirm \ |
30 | 69 | base-devel git wget curl neovim tmux zsh htop btop \ |
31 | 70 | kdeconnect fastfetch unzip zip zlib xz tk kcalc \ |
32 | 71 | firefox discord power-profiles-daemon |
33 | 72 |
|
| 73 | +success "Core packages installed" |
34 | 74 |
|
| 75 | +section "Installing paru (AUR Helper)" |
35 | 76 |
|
36 | | -echo ">>> Installing paru (AUR helper)..." |
37 | 77 | if [ ! -d ~/paru ]; then |
38 | 78 | git clone https://aur.archlinux.org/paru.git ~/paru |
39 | 79 | cd ~/paru && makepkg -si --noconfirm && cd ~ |
40 | 80 | fi |
| 81 | +success "paru ready" |
41 | 82 |
|
| 83 | +section "Installing yay (AUR Helper)" |
42 | 84 |
|
43 | | -echo ">>> Installing yay (AUR helper)..." |
44 | 85 | if [ ! -d ~/yay ]; then |
45 | 86 | git clone https://aur.archlinux.org/yay.git ~/yay |
46 | 87 | cd ~/yay && makepkg -si --noconfirm && cd ~ |
47 | 88 | fi |
| 89 | +success "yay ready" |
48 | 90 |
|
| 91 | +section "Installing Browsers" |
49 | 92 |
|
50 | | -echo ">>> Installing Brave browser..." |
51 | 93 | export PATH="$HOME/.local/bin:$PATH" |
52 | 94 | if ! command -v paru &> /dev/null; then |
53 | | - echo "paru not found. Please restart your shell or source ~/.zshrc before running this script." |
| 95 | + echo -e "${RED}paru not found. Restart shell or source ~/.zshrc${RESET}" |
54 | 96 | exit 1 |
55 | 97 | fi |
56 | | -paru -S brave-bin |
57 | 98 |
|
| 99 | +info "Installing Brave..." |
| 100 | +paru -S brave-bin |
58 | 101 |
|
59 | | -echo ">>> Installing Google Chrome..." |
| 102 | +info "Installing Google Chrome..." |
60 | 103 | yay -S google-chrome |
61 | 104 |
|
62 | | -echo ">>> Installing Spotify..." |
| 105 | +success "Browsers installed" |
| 106 | + |
| 107 | +section "Installing Spotify" |
| 108 | + |
63 | 109 | yay -S spotify |
| 110 | +success "Spotify installed" |
64 | 111 |
|
| 112 | +section "Zsh Theme & Plugins" |
65 | 113 |
|
66 | | -echo ">>> Cloning Powerlevel10k and Zsh plugins..." |
67 | 114 | mkdir -p ~/.zsh |
68 | 115 |
|
69 | 116 | git clone https://github.com/zsh-users/zsh-autosuggestions ~/.zsh/zsh-autosuggestions |
70 | 117 | git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ~/.zsh/zsh-syntax-highlighting |
71 | 118 | git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ~/.zsh/powerlevel10k |
72 | 119 |
|
73 | | -echo ">>> Cloning Tmux Plugin Manager..." |
| 120 | +success "Powerlevel10k & plugins cloned" |
| 121 | + |
| 122 | +section "Tmux Plugin Manager" |
| 123 | + |
74 | 124 | if [ ! -d ~/.tmux/plugins/tpm ]; then |
75 | 125 | git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm |
76 | 126 | fi |
| 127 | +success "TPM installed" |
77 | 128 |
|
| 129 | +section "GitHub CLI" |
78 | 130 |
|
79 | | -echo ">>> Installing GitHub CLI and authenticating..." |
80 | 131 | sudo pacman -S github-cli |
81 | 132 | gh auth login |
82 | | - |
| 133 | +success "GitHub authenticated" |
83 | 134 |
|
84 | 135 | echo |
85 | | -echo " Setup complete!" |
86 | | -echo "--------------------------------------------------" |
87 | | -echo "✔ Run: chsh -s $(which zsh) to set zsh as default shell." |
88 | | -echo "✔ Open tmux and press prefix + I to install plugins." |
| 136 | +line |
| 137 | +echo -e "${MAGENTA}${BOLD} Setup Complete! ${RESET}" |
| 138 | +line |
| 139 | + |
| 140 | +echo -e "${GREEN}✔ Run:${RESET} chsh -s $(which zsh)" |
| 141 | +echo -e "${GREEN}✔ Tmux:${RESET} prefix + I to install plugins" |
89 | 142 | echo |
90 | | -echo " After setup, consider:" |
91 | | -echo " - cd into each repo & install dependencies" |
92 | | -echo " - Download the mirrorlist from the github repo and save it in Downloads and use the below commands to activate" |
93 | | -echo " - sudo cp -rf /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.bak" |
94 | | -echo " - sudo cp -rf ~/Downloads/mirrorlist /etc/pacman.d/mirrorlist" |
95 | | -echo "--------------------------------------------------" |
96 | | -echo " Done! Enjoy your Arch setup :)" |
| 143 | +echo -e "${CYAN}Post Setup Tips:${RESET}" |
| 144 | +echo " • Activate custom mirrorlist if needed" |
| 145 | +echo " • Sync Neovim plugins (:Lazy sync)" |
| 146 | +echo " • Configure fastfetch & tmux" |
| 147 | + |
| 148 | +line |
| 149 | +echo -e "${BOLD}${GREEN}Done! Enjoy your Arch setup ${RESET}" |
| 150 | +line |
| 151 | + |
| 152 | + |
| 153 | +# echo |
| 154 | +# echo " Setup complete!" |
| 155 | +# echo "--------------------------------------------------" |
| 156 | +# echo "✔ Run: chsh -s $(which zsh) to set zsh as default shell." |
| 157 | +# echo "✔ Open tmux and press prefix + I to install plugins." |
| 158 | +# echo |
| 159 | +# echo " After setup, consider:" |
| 160 | +# echo " - cd into each repo & install dependencies" |
| 161 | +# echo " - Download the mirrorlist from the github repo and save it in Downloads and use the below commands to activate" |
| 162 | +# echo " - sudo cp -rf /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.bak" |
| 163 | +# echo " - sudo cp -rf ~/Downloads/mirrorlist /etc/pacman.d/mirrorlist" |
| 164 | +# echo "--------------------------------------------------" |
| 165 | +# echo " Done! Enjoy your Arch setup :)" |
97 | 166 | # ========================================================================================================= |
98 | 167 |
|
99 | 168 | # Instructions: |
|
0 commit comments