Skip to content

Commit e0c9a66

Browse files
committed
feat: added new command prompt design
1 parent 04a4340 commit e0c9a66

3 files changed

Lines changed: 117 additions & 121 deletions

File tree

autosetup.sh

Lines changed: 56 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
# Author: Ravindran S
77
# =========================================
88

9+
10+
set -e
11+
912
RED='\033[0;31m'
1013
GREEN='\033[0;32m'
1114
YELLOW='\033[1;33m'
@@ -16,140 +19,105 @@ RESET='\033[0m'
1619
BOLD='\033[1m'
1720

1821
line() {
19-
printf "${BLUE}%*s${RESET}\n" "$(tput cols)" "" | tr ' ' '-'
22+
printf "${BLUE}%*s${RESET}\n" "$(tput cols)" "" | tr ' ' '='
2023
}
2124

22-
23-
2425
section() {
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

3935
section "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)"
4638
success "Zsh installed & configured"
4739

4840
section "System Update"
49-
5041
info "Updating system..."
5142
sudo pacman -Syu --noconfirm
5243
success "System up to date"
5344

54-
section "Mirrorlist"
55-
56-
info "Installing mirrorlist..."
57-
sudo pacman -Syu
58-
success "Mirrorlist synced"
59-
6045
section "Timezone Configuration"
61-
62-
info "Setting timezone to Asia/Kolkata..."
6346
sudo timedatectl set-timezone Asia/Kolkata
6447
success "Timezone set"
6548

6649
section "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
7354
success "Core packages installed"
7455

7556
section "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 ~
8065
fi
8166
success "paru ready"
8267

8368
section "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 ~
8873
fi
8974
success "yay ready"
9075

9176
section "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
10579
success "Browsers installed"
10680

10781
section "Installing Spotify"
108-
109-
yay -S spotify
82+
yay -S --needed --noconfirm spotify
11083
success "Spotify installed"
11184

11285
section "Zsh Theme & Plugins"
113-
11486
mkdir -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
127102
success "TPM installed"
128103

129104
section "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
133109
success "GitHub authenticated"
134110

135111
echo
136112
line
137113
echo -e "${MAGENTA}${BOLD} Setup Complete! ${RESET}"
138114
line
139-
140115
echo -e "${GREEN}✔ Run:${RESET} chsh -s $(which zsh)"
141116
echo -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-
148117
line
149118
echo -e "${BOLD}${GREEN}Done! Enjoy your Arch setup ${RESET}"
150119
line
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

configs/kitty/kitty.conf

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
shell /usr/bin/zsh
22

33

4-
5-
# For gnome-terminal transparency effect
6-
74
background_opacity 0.85
85

96
cursor_trail 50
107
cursor_trail_decay 0.1 1
118
cursor_shape beam
129
cursor_beam_thickness 5
1310
cursor_blink_interval 0.5
11+
12+
foreground #cdd6f4
13+
background #020617
14+
cursor #7aa2f7
15+
enable_audio_bell no

configs/zsh/.zshrc

Lines changed: 56 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1+
12
fastfetch
2-
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
3-
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
4-
fi
53

64
[[ $- != *i* ]] && return
75

@@ -28,31 +26,73 @@ alias ll='ls -alh'
2826
alias cat='bat'
2927
alias chatgpt='source /home/ravi/chatgpt-env/bin/activate && chmod +x chat.py && ./chat.py'
3028
alias metrics='sys'
31-
alias todo='cd todo-tui && cargo run'
29+
alias todo='cd todo-tui && cargo run && cd'
3230
alias gs='git status'
3331
alias ga='git add .'
3432
alias gc='git commit -m'
3533
alias gp='git push'
3634
alias gl='git pull'
3735
alias gb='git branch'
3836
alias gd='git diff'
37+
alias health='linux-health && go run ./cmd/linux-health && cd'
38+
alias jarvis='cd Jarvis && cargo run && cd'
39+
40+
41+
42+
43+
autoload -Uz colors && colors
44+
setopt prompt_subst
45+
46+
47+
NEON_BLUE="%F{39}"
48+
NEON_CYAN="%F{51}"
49+
NEON_GREEN="%F{82}"
50+
NEON_PINK="%F{213}"
51+
NEON_PURPLE="%F{141}"
52+
NEON_YELLOW="%F{226}"
53+
NEON_RED="%F{196}"
54+
RESET="%f"
3955

40-
autoload -Uz vcs_info
41-
autoload -U colors && colors
56+
ICON=""
4257

43-
zstyle ':vcs_info:git:*' formats "%F{magenta}  %b%f"
44-
zstyle ':vcs_info:git:*' actionformats "%F{red}  %b|%a%f"
45-
zstyle ':vcs_info:*' enable git
4658

47-
typeset -ga symbols=( "󱞩" "󱞩" "󱞩" "󱞩" "󱞩" "󱞩" )
48-
typeset -gi idx=1
59+
60+
git_prompt() {
61+
command git rev-parse --is-inside-work-tree &>/dev/null || return
62+
63+
local branch dirty
64+
65+
branch=$(command git symbolic-ref --short HEAD 2>/dev/null \
66+
|| command git describe --tags --exact-match 2>/dev/null)
67+
68+
command git diff --quiet --ignore-submodules HEAD &>/dev/null || dirty="*"
69+
70+
echo "%F{213} ${branch}${dirty}%f"
71+
}
72+
73+
74+
venv_prompt() {
75+
[[ -n "$VIRTUAL_ENV" ]] || return
76+
local venv_name="${VIRTUAL_ENV:t}"
77+
echo "${NEON_GREEN}${venv_name}${RESET}"
78+
}
79+
80+
81+
path_prompt() {
82+
echo "${NEON_BLUE}%~${RESET}"
83+
}
84+
4985

5086
precmd() {
51-
vcs_info
87+
local time="%D{%H:%M}"
88+
local user="%n@%m"
89+
local git="$(git_prompt)"
90+
local venv="$(venv_prompt)"
91+
local path="$(path_prompt)"
92+
5293
PROMPT="
53-
%F{yellow}%D{%H:%M}%f %F{cyan}%n@%m %F{blue}%~%f ${vcs_info_msg_0_}
54-
%F{magenta}${symbols[$idx]}%f "
55-
(( idx = (idx % ${#symbols[@]}) + 1 ))
94+
${NEON_CYAN}${ICON}${RESET} ${NEON_YELLOW}${time}${RESET} ${NEON_PURPLE}${user}${RESET} ${path} ${git} ${venv}
95+
${NEON_CYAN}󱞩${RESET} "
5696
}
5797

5898
setopt APPEND_HISTORY
@@ -95,27 +135,13 @@ sys() {
95135
fi
96136
}
97137

98-
display_image() {
99-
if command -v chafa &> /dev/null; then
100-
chafa "$1"
101-
elif command -v img2sixel &> /dev/null; then
102-
img2sixel "$1"
103-
else
104-
echo "Image viewer not found"
105-
fi
106-
}
107138

108139
source ~/.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh
109140
source ~/.zsh/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
110141

111-
typeset -g POWERLEVEL9K_INSTANT_PROMPT=quiet
112-
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
113-
114142
export PATH="$PATH:/home/ravi/.local/bin"
115-
export OPENAI_KEY="API_KEY_HERE"
143+
export OPENAI_KEY="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"
116144

117-
source ~/.zsh/powerlevel10k/powerlevel10k.zsh-theme
118-
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
119145

120146
notify_long_command() {
121147
if (( SECONDS > 10 )); then

0 commit comments

Comments
 (0)