66# Author: Ravindran S
77# =========================================
88
9+
10+ set -e
11+
912RED=' \033[0;31m'
1013GREEN=' \033[0;32m'
1114YELLOW=' \033[1;33m'
@@ -16,140 +19,105 @@ RESET='\033[0m'
1619BOLD=' \033[1m'
1720
1821line () {
19- printf " ${BLUE} %*s${RESET} \n" " $( tput cols) " " " | tr ' ' ' - '
22+ printf " ${BLUE} %*s${RESET} \n" " $( tput cols) " " " | tr ' ' ' = '
2023}
2124
22-
23-
2425section () {
2526 echo
2627 line
2728 echo -e " ${BOLD}${CYAN} ⚙ $1 ${RESET} "
2829 line
2930}
3031
31- success () {
32- echo -e " ${GREEN} ✔ $1 ${RESET} "
33- }
34-
35- info () {
36- echo -e " ${YELLOW} ➜ $1 ${RESET} "
37- }
32+ success () { echo -e " ${GREEN} ✔ $1 ${RESET} " ; }
33+ info () { echo -e " ${YELLOW} ➜ $1 ${RESET} " ; }
3834
3935section " Shell Setup (Zsh)"
40-
41- sudo pacman -S --noconfirm zsh
42- if [ " $SHELL " != " $( which zsh) " ]; then
43- info " Changing default shell to zsh..."
44- chsh -s " $( which zsh) "
45- fi
36+ sudo pacman -S --needed --noconfirm zsh
37+ [[ " $SHELL " != " $( which zsh) " ]] && chsh -s " $( which zsh) "
4638success " Zsh installed & configured"
4739
4840section " System Update"
49-
5041info " Updating system..."
5142sudo pacman -Syu --noconfirm
5243success " System up to date"
5344
54- section " Mirrorlist"
55-
56- info " Installing mirrorlist..."
57- sudo pacman -Syu
58- success " Mirrorlist synced"
59-
6045section " Timezone Configuration"
61-
62- info " Setting timezone to Asia/Kolkata..."
6346sudo timedatectl set-timezone Asia/Kolkata
6447success " Timezone set"
6548
6649section " Installing Arch Essentials"
67-
68- sudo pacman -S --noconfirm \
69- base-devel git wget curl neovim tmux zsh htop btop \
70- kdeconnect fastfetch unzip zip zlib xz tk kcalc \
71- firefox discord power-profiles-daemon
72-
50+ sudo pacman -S --needed --noconfirm \
51+ base-devel git wget curl neovim tmux htop btop \
52+ kdeconnect fastfetch unzip zip zlib xz tk kcalc \
53+ firefox discord power-profiles-daemon
7354success " Core packages installed"
7455
7556section " Installing paru (AUR Helper)"
76-
77- if [ ! -d ~ /paru ]; then
78- git clone https://aur.archlinux.org/paru.git ~ /paru
79- cd ~ /paru && makepkg -si --noconfirm && cd ~
57+ if ! command -v paru & > /dev/null; then
58+ rm -rf ~ /paru
59+ git clone https://aur.archlinux.org/paru.git ~ /paru
60+ cd ~ /paru && makepkg -si --noconfirm && cd ~
61+ else
62+ rm -rf ~ /paru
63+ git clone https://aur.archlinux.org/paru.git ~ /paru
64+ cd ~ /paru && makepkg -si --noconfirm && cd ~
8065fi
8166success " paru ready"
8267
8368section " Installing yay (AUR Helper)"
84-
85- if [ ! -d ~ /yay ] ; then
86- git clone https://aur.archlinux.org/yay.git ~ /yay
87- cd ~ /yay && makepkg -si --noconfirm && cd ~
69+ if ! command -v yay & > /dev/null ; then
70+ rm -rf ~ /yay
71+ git clone https://aur.archlinux.org/yay.git ~ /yay
72+ cd ~ /yay && makepkg -si --noconfirm && cd ~
8873fi
8974success " yay ready"
9075
9176section " Installing Browsers"
92-
93- export PATH=" $HOME /.local/bin:$PATH "
94- if ! command -v paru & > /dev/null; then
95- echo -e " ${RED} paru not found. Restart shell or source ~/.zshrc${RESET} "
96- exit 1
97- fi
98-
99- info " Installing Brave..."
100- paru -S brave-bin
101-
102- info " Installing Google Chrome..."
103- yay -S google-chrome
104-
77+ paru -S --needed --noconfirm brave-bin
78+ yay -S --needed --noconfirm google-chrome
10579success " Browsers installed"
10680
10781section " Installing Spotify"
108-
109- yay -S spotify
82+ yay -S --needed --noconfirm spotify
11083success " Spotify installed"
11184
11285section " Zsh Theme & Plugins"
113-
11486mkdir -p ~ /.zsh
11587
116- git clone https://github.com/zsh-users/zsh-autosuggestions ~ /.zsh/zsh-autosuggestions
117- git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ~ /.zsh/zsh-syntax-highlighting
118- git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ~ /.zsh/powerlevel10k
88+ [[ ! -d ~ /.zsh/zsh-autosuggestions ]] && \
89+ git clone https://github.com/zsh-users/zsh-autosuggestions ~ /.zsh/zsh-autosuggestions
11990
120- success " Powerlevel10k & plugins cloned"
91+ [[ ! -d ~ /.zsh/zsh-syntax-highlighting ]] && \
92+ git clone https://github.com/zsh-users/zsh-syntax-highlighting ~ /.zsh/zsh-syntax-highlighting
12193
122- section " Tmux Plugin Manager"
94+ [[ ! -d ~ /.zsh/powerlevel10k ]] && \
95+ git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ~ /.zsh/powerlevel10k
12396
124- if [ ! -d ~ /.tmux/plugins/tpm ]; then
125- git clone https://github.com/tmux-plugins/tpm ~ /.tmux/plugins/tpm
126- fi
97+ success " Zsh plugins ready"
98+
99+ section " Tmux Plugin Manager"
100+ [[ ! -d ~ /.tmux/plugins/tpm ]] && \
101+ git clone https://github.com/tmux-plugins/tpm ~ /.tmux/plugins/tpm
127102success " TPM installed"
128103
129104section " GitHub CLI"
130-
131- sudo pacman -S github-cli
132- gh auth login
105+ sudo pacman -S --needed --noconfirm github-cli
106+ if ! gh auth status & > /dev/null; then
107+ gh auth login
108+ fi
133109success " GitHub authenticated"
134110
135111echo
136112line
137113echo -e " ${MAGENTA}${BOLD} Setup Complete! ${RESET} "
138114line
139-
140115echo -e " ${GREEN} ✔ Run:${RESET} chsh -s $( which zsh) "
141116echo -e " ${GREEN} ✔ Tmux:${RESET} prefix + I to install plugins"
142- echo
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-
148117line
149118echo -e " ${BOLD}${GREEN} Done! Enjoy your Arch setup ${RESET} "
150119line
151120
152-
153121# echo
154122# echo " Setup complete!"
155123# echo "--------------------------------------------------"
@@ -190,26 +158,26 @@ line
190158# ===========================================================================================================
191159
192160# Chatgpt in terminal:
193- # 1 . Install the chat.py file in the home directory
194- # 2 . create a python environment like python -m venv chatgpt-env
195- # 3 . source it using source /home/ravi/chatgpt-env/bin/activate and install openai using pip install openai
196- # 4 . Make the chat.py executable using chmod +x chat.py
197- # 5 . Now the chat.py to use gpt in terminal using ./chat.py
198- # 6 . Change the API_KEY value when cloning zshrc config
199- # 7 . Add alias for the chat.py to execute using "alias chatgpt = 'chmod +x chat.py && ./chat.py'"
161+ # 2 . Install the chat.py file in the home directory
162+ # 3 . create a python environment like python -m venv chatgpt-env
163+ # 4 . source it using source /home/ravi/chatgpt-env/bin/activate and install openai using pip install openai
164+ # 5 . Make the chat.py executable using chmod +x chat.py
165+ # 6 . Now the chat.py to use gpt in terminal using ./chat.py
166+ # 7 . Change the API_KEY value when cloning zshrc config
167+ # 8 . Add alias for the chat.py to execute using "alias chatgpt = 'chmod +x chat.py && ./chat.py'"
200168
201169# ===========================================================================================================
202170
203171# fastfetch configuration:
204- # 1 . Clone the fastfetch configuration repo
172+ # 2 . Clone the fastfetch configuration repo
205173# cd ~/.local/share
206174# git clone https://github.com/LierB/fastfetch
207- # 2 . Download the iron2.png image from the git repo
208- # 3 . place the image in /home/user/.local/share/images/
209- # 4 . Open /home/user/.config/fastfetch/config.jsonc
210- # 5 . Paste the fastfetch config in there
175+ # 3 . Download the iron2.png image from the git repo
176+ # 4 . place the image in /home/user/.local/share/images/
177+ # 5 . Open /home/user/.config/fastfetch/config.jsonc
178+ # 6 . Paste the fastfetch config in there
211179
212180# ===========================================================================================================
213181# Tmux configuration:
214- # 1 . Follow the instructions given in the readme file of the tmux github repository
215- # 2 . open the github repository https://github.com/ravindran-dev/tmux.git
182+ # 2 . Follow the instructions given in the readme file of the tmux github repository
183+ # 3 . open the github repository https://github.com/ravindran-dev/tmux.git
0 commit comments