Add new theme: axira

Add initial version of the Axira Zsh theme.
Features:
- VPN IP detection with fallback to eth0
- Smart icon: 🔒 for VPN, 🌐 when not connected
- Python venv and Git branch shown
- Clean multi-line style with Nerd Font symbols
This commit is contained in:
Suraj Sharma 2025-07-11 16:30:20 +05:30 committed by GitHub
commit 0ca609e0cf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

47
themes/axira.zsh-theme Normal file
View file

@ -0,0 +1,47 @@
# ~/.oh-my-zsh/custom/themes/axira.zsh-theme
autoload -U colors && colors
local BLUE="%F{33}"
local GREEN="%F{76}"
local RED="%F{196}"
local YELLOW="%F{226}"
local MAGENTA="%F{201}"
local CYAN="%F{51}"
local RESET="%f%k"
local PROMPT_CORNER="┌─"
local PROMPT_BOTTOM="└─"
local PROMPT_ARROW="➜"
get_ip() {
local ip=$(ip -4 addr show tun0 2>/dev/null | grep -oP '(?<=inet\s)\d+(\.\d+){3}' | head -1)
if [[ -z "$ip" ]]; then
ip=$(ip -4 addr show eth0 2>/dev/null | grep -oP '(?<=inet\s)\d+(\.\d+){3}' | head -1)
fi
[[ -z "$ip" ]] && ip="NoNet"
echo "$ip"
}
get_ip_icon() {
ip link show tun0 2>/dev/null | grep -q "state UP" && echo "🔒" || echo "🌐"
}
git_branch() {
local branch=$(git rev-parse --abbrev-ref HEAD 2>/dev/null)
[[ -n "$branch" ]] && echo "%{$YELLOW%} $branch%{$RESET%}"
}
python_venv() {
[[ -n "$VIRTUAL_ENV" ]] && echo "%{$MAGENTA%}[🐍 $(basename $VIRTUAL_ENV)]%{$RESET%}"
}
exit_status() {
[[ $? -eq 0 ]] && echo "%{$GREEN%}✔%{$RESET%}" || echo "%{$RED%}✗%{$RESET%}"
}
PROMPT='
%{$CYAN%}${PROMPT_CORNER}[%{$BLUE%}%~%{$CYAN%}] [%{$CYAN%}$(get_ip_icon) %{$GREEN%}$(get_ip)%{$CYAN%}] $(python_venv) $(git_branch)
%{$CYAN%}${PROMPT_BOTTOM}${PROMPT_ARROW} %{$RESET%}'
RPROMPT='$(exit_status)'