-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcosmic-theme
More file actions
84 lines (65 loc) · 2.55 KB
/
Copy pathcosmic-theme
File metadata and controls
84 lines (65 loc) · 2.55 KB
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
# .bashrc
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
# User specific environment
if ! [[ "$PATH" =~ "$HOME/.local/bin:$HOME/bin:" ]]; then
PATH="$HOME/.local/bin:$PATH"
fi
export PATH
###########################
export VIRTUAL_ENV_DISABLE_PROMPT=true
# ── Stellar Theme with Custom Hull Colour ──────────────────
ST_HULL='\[\e[38;2;120;180;185m\]'
ST_STAR='\[\e[38;5;255m\]'
ST_BLUE='\[\e[38;5;75m\]'
ST_DEEP='\[\e[38;2;70;170;185m\]'
ST_GOLD='\[\e[38;2;200;160;80m\]'
ST_AMBER='\[\e[38;5;214m\]'
ST_RED='\[\e[38;5;196m\]'
ST_CYAN='\[\e[38;5;87m\]'
ST_GREEN='\[\e[38;5;84m\]'
ST_DIM='\[\e[38;2;150;150;160m\]'
ST_RESET='\[\e[0m\]'
# ── Immediate background job notifications ───────────────
set -b
# ── Prompt update hook ───────────────────────────────────
__qubes_update_prompt_data() {
local RETVAL=$?
__qubes_venv=''
[[ -n "$VIRTUAL_ENV" ]] && __qubes_venv=$(basename "$VIRTUAL_ENV")
__qubes_git=''
__qubes_git_color="${ST_GREEN}"
local git_branch=$(git --no-optional-locks rev-parse --abbrev-ref HEAD 2>/dev/null)
if [[ -n "$git_branch" ]]; then
local git_status=$(git --no-optional-locks status --porcelain 2>/dev/null | tail -n 1)
[[ -n "$git_status" ]] && __qubes_git_color="${ST_AMBER}"
__qubes_git="◈ ${git_branch}"
fi
__qubes_prompt_symbol_color="${ST_CYAN}"
__qubes_alert=''
[[ "$RETVAL" -ne 0 ]] && {
__qubes_prompt_symbol_color="${ST_RED}"
__qubes_alert=" ⚠ FAULT"
}
# Build prompt dynamically — NO nested command substitution in PS1
PS1=""
# Top line
PS1+="${ST_HULL}┌─${ST_CYAN}[ ${ST_BLUE}NCC-\h${ST_CYAN} ]●[ ${ST_GOLD}\u${ST_CYAN} ]●[ ${ST_DEEP}$(findmnt -n -o SOURCE /)${ST_CYAN} ]"
# Venv module
[[ -n "$__qubes_venv" ]] && PS1+="${ST_HULL}──[ ${ST_CYAN}MOD:$__qubes_venv${ST_HULL} ]"
# Clock module
[[ -n "$QUBES_THEME_SHOW_TIME" ]] && PS1+="${ST_HULL}──[ ${ST_GREEN}STARDATE $(date +%H:%M:%S)${ST_HULL} ]"
PS1+="\n"
# Middle line
PS1+="${ST_HULL}│ ${ST_STAR}NAV"
[[ -n "$__qubes_git" ]] && PS1+="${ST_HULL} › ${__qubes_git_color}$__qubes_git"
PS1+="${ST_HULL} › ${ST_CYAN}COORD:\w"
[[ -n "$__qubes_alert" ]] && PS1+="${ST_RED}$__qubes_alert"
PS1+="\n"
# Bottom line
PS1+="${ST_HULL}└─${__qubes_prompt_symbol_color}➤ ${ST_RESET}"
return $RETVAL
}
PROMPT_COMMAND='__qubes_update_prompt_data'