Compare commits
26 Commits
cc61e6281d
...
7c4e99667c
| Author | SHA1 | Date | |
|---|---|---|---|
| 7c4e99667c | |||
| d7c08d5a4c | |||
| c039075927 | |||
| 84336c0a7b | |||
| 5ed49cc54c | |||
| 4bd8307bf0 | |||
| 27ff3de89d | |||
| 1c67eb6f05 | |||
| d0cb724706 | |||
| e56aecd1c0 | |||
| 73f23bcd61 | |||
| fa33ab13f0 | |||
| 8b5c833a1e | |||
| 3dcec1b51b | |||
| d3f586afbf | |||
| 80add3e09b | |||
| 85e9959fb0 | |||
| 19f3d58a42 | |||
| 4b9c29f895 | |||
| 24374eb9fa | |||
| cb36ca7cb9 | |||
| 5f0c3fa06e | |||
| 6922271334 | |||
| 5c336e77a4 | |||
| cbace1a1c7 | |||
| 87c49dab23 |
@@ -3,7 +3,8 @@
|
||||
"name": "Bashrc Dotfiles",
|
||||
"purpose": "Global and per-user bash prompt + banner with seasonal palettes and time/season emoji accents.",
|
||||
"repo_root": "/home/steffen/Bashrc",
|
||||
"default_branch": "main"
|
||||
"default_branch": "main",
|
||||
"release_state": "main is production-ready"
|
||||
},
|
||||
"branches": {
|
||||
"main": {
|
||||
@@ -42,7 +43,8 @@
|
||||
"Season pick (if single season)",
|
||||
"Contest layout selection (if contest/holidays)",
|
||||
"Style preset selection (if contest)",
|
||||
"Holiday selection (if holidays)"
|
||||
"Holiday selection (if holidays)",
|
||||
"Enable git capsule for all themes (if PS1 selected)"
|
||||
],
|
||||
"season_config_file": "/etc/ps1-season",
|
||||
"style_config_file": "/etc/ps1-style",
|
||||
@@ -63,7 +65,8 @@
|
||||
"Season pick (if single season)",
|
||||
"Contest layout selection (if contest/holidays)",
|
||||
"Style preset selection (if contest)",
|
||||
"Holiday selection (if holidays)"
|
||||
"Holiday selection (if holidays)",
|
||||
"Enable git capsule for all themes"
|
||||
],
|
||||
"season_config_file": "~/.config/ps1/season",
|
||||
"style_config_file": "~/.config/ps1/style"
|
||||
@@ -92,33 +95,41 @@
|
||||
},
|
||||
"palettes": {
|
||||
"winter": {
|
||||
"Z1_BG": 61,
|
||||
"Z1_BG": 60,
|
||||
"Z2_BG": 61,
|
||||
"Z3_BG": 62,
|
||||
"Z4_BG": 37,
|
||||
"Z1_FG": 255,
|
||||
"Z2_BG": 37,
|
||||
"Z2_FG": 255,
|
||||
"PATH_FG": 194,
|
||||
"FRAME": 60
|
||||
},
|
||||
"spring": {
|
||||
"Z1_BG": 71,
|
||||
"Z1_BG": 70,
|
||||
"Z2_BG": 71,
|
||||
"Z3_BG": 72,
|
||||
"Z4_BG": 120,
|
||||
"Z1_FG": 255,
|
||||
"Z2_BG": 120,
|
||||
"Z2_FG": 22,
|
||||
"PATH_FG": 22,
|
||||
"FRAME": 65
|
||||
},
|
||||
"summer": {
|
||||
"Z1_BG": 142,
|
||||
"Z1_BG": 141,
|
||||
"Z2_BG": 142,
|
||||
"Z3_BG": 143,
|
||||
"Z4_BG": 214,
|
||||
"Z1_FG": 255,
|
||||
"Z2_BG": 214,
|
||||
"Z2_FG": 0,
|
||||
"PATH_FG": 232,
|
||||
"FRAME": 130
|
||||
},
|
||||
"autumn": {
|
||||
"Z1_BG": 95,
|
||||
"Z1_BG": 94,
|
||||
"Z2_BG": 95,
|
||||
"Z3_BG": 96,
|
||||
"Z4_BG": 173,
|
||||
"Z1_FG": 255,
|
||||
"Z2_BG": 173,
|
||||
"Z2_FG": 255,
|
||||
"PATH_FG": 223,
|
||||
"FRAME": 95
|
||||
@@ -178,12 +189,13 @@
|
||||
}
|
||||
],
|
||||
"config": {
|
||||
"env": "PS1_STYLE=aurora|neon|forge|circuit|mono|git|hawolex; PS1_STYLE_PACK=standard|contest|holiday; PS1_CONTEST_LAYOUT=day-time-user|user-time|time-user|day-time; PS1_HOLIDAY=christmas|easter|halloween|valentine|thanksgiving|newyear",
|
||||
"env": "PS1_STYLE=aurora|neon|forge|circuit|mono|git|hawolex; PS1_STYLE_PACK=standard|contest|holiday; PS1_CONTEST_LAYOUT=day-time-user|user-time|time-user|day-time; PS1_HOLIDAY=christmas|easter|halloween|valentine|thanksgiving|newyear; PS1_GIT=0|1",
|
||||
"config_file_keys": [
|
||||
"PS1_STYLE",
|
||||
"PS1_STYLE_PACK",
|
||||
"PS1_CONTEST_LAYOUT",
|
||||
"PS1_HOLIDAY"
|
||||
"PS1_HOLIDAY",
|
||||
"PS1_GIT"
|
||||
]
|
||||
}
|
||||
},
|
||||
@@ -414,7 +426,9 @@
|
||||
"prompt_structure": {
|
||||
"zone1": "date time user",
|
||||
"zone2": "host path",
|
||||
"seasonal_segments": "date | time | user | host+path (subtle seasonal gradient)",
|
||||
"line2": "status arrow + emoji",
|
||||
"emoji_padding": "Two spaces after the emoji before the cursor",
|
||||
"path_shortening": "Keeps /home/user or /Users/user visible and shortens middle if deep.",
|
||||
"nerd_font_caps": "Always enabled unless PS1_FORCE_ASCII=1"
|
||||
},
|
||||
@@ -428,6 +442,8 @@
|
||||
"On Linux, installer affects all users by writing to /etc/profile.d and sourcing from /etc/bash.bashrc.",
|
||||
"On macOS, installer is per-user and sources from .bashrc/.bash_profile.",
|
||||
"Seasonal palettes and contest pack are now documented directly in main.",
|
||||
"README uses images/bash-pallete.png."
|
||||
"README uses images/bash-pallete.png.",
|
||||
"Git capsule prefers __git_ps1 and falls back to git symbolic-ref/short hash when git-prompt is unavailable or returns empty.",
|
||||
"Hawolex git capsule enables when PS1_GIT resolves to a truthy value (1/yes/true/on)."
|
||||
]
|
||||
}
|
||||
|
||||
118
README.md
118
README.md
@@ -1,5 +1,7 @@
|
||||
# Bashrc Dotfiles — Global & Portable Bash Prompt
|
||||
|
||||
Production-ready on `main`.
|
||||
|
||||
Elegant, portable, and easy-to-install Bash prompt with:
|
||||
|
||||
- ✨ Two color zones
|
||||
@@ -11,7 +13,7 @@ Elegant, portable, and easy-to-install Bash prompt with:
|
||||
|
||||
---
|
||||
|
||||
## 🚀 Install (step by step)
|
||||
## 🚀 Install
|
||||
|
||||
### 🐧 Linux / WSL (global, all users)
|
||||
|
||||
@@ -33,13 +35,6 @@ cd Bashrc
|
||||
sudo bash dotfiles/install/install-linux-global.sh
|
||||
```
|
||||
|
||||
You get 3 choices in the install script:
|
||||
1) PS1 only
|
||||
2) Banner only
|
||||
3) Both (PS1 + banner)
|
||||
|
||||
To "uninstall" one part, run the script again and choose only the other.
|
||||
|
||||
4) Open a new shell to see the prompt and banner.
|
||||
|
||||
### 🍏 macOS (per-user)
|
||||
@@ -79,10 +74,27 @@ After install:
|
||||
- Open your terminal settings
|
||||
- Set font to JetBrainsMono Nerd Font (or any Nerd Font)
|
||||
- Terminal must use a Nerd Font for glyphs like ``, ``, `` to render correctly
|
||||
- Manual download: https://www.nerdfonts.com/font-downloads
|
||||
|
||||
---
|
||||
|
||||
## ✅ What gets installed (PS1 + banner)
|
||||
<details>
|
||||
<summary><strong>Installer choices</strong></summary>
|
||||
|
||||
Linux/WSL:
|
||||
|
||||
- PS1 only / Banner only / Both
|
||||
- PS1 modes: Single season, Dynamic season, Contest pack, Holidays pack
|
||||
|
||||
macOS:
|
||||
|
||||
- PS1 modes: Single season, Dynamic season, Contest pack, Holidays pack
|
||||
</details>
|
||||
|
||||
---
|
||||
|
||||
<details>
|
||||
<summary><strong>What gets installed</strong></summary>
|
||||
|
||||
### Linux / WSL
|
||||
|
||||
@@ -98,20 +110,23 @@ After install:
|
||||
- Copies `ps1/ps1.sh` to `~/.config/ps1/ps1.sh`
|
||||
- Adds a source block in `~/.bashrc` and `~/.bash_profile`
|
||||
|
||||
</details>
|
||||
|
||||
---
|
||||
|
||||
## PS1 module (when it runs)
|
||||
|
||||
The prompt is loaded automatically by the installer:
|
||||
<details>
|
||||
<summary><strong>PS1 module (when it runs)</strong></summary>
|
||||
|
||||
- Linux/WSL: sourced from `/etc/bash.bashrc` (global)
|
||||
- macOS: sourced from `~/.bashrc` and `~/.bash_profile` (per-user)
|
||||
|
||||
You normally do not need to run `ps1.sh` manually.
|
||||
</details>
|
||||
|
||||
---
|
||||
|
||||
## Banner (hostname + punchline + sysinfo)
|
||||
<details>
|
||||
<summary><strong>Banner (hostname + punchline + sysinfo)</strong></summary>
|
||||
|
||||
On Linux/WSL, a banner is also shown on login:
|
||||
|
||||
@@ -130,24 +145,7 @@ The install script prompts for a punchline and stores it in the file. You can al
|
||||
```bash
|
||||
echo "Your punchline" | sudo tee /etc/ps1-punchline >/dev/null
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## PS1 install
|
||||
|
||||
Use the installer for your OS:
|
||||
|
||||
### Linux / WSL (global)
|
||||
|
||||
```bash
|
||||
sudo bash dotfiles/install/install-linux-global.sh
|
||||
```
|
||||
|
||||
### macOS (per-user)
|
||||
|
||||
```bash
|
||||
bash dotfiles/install/install-macos-user.sh
|
||||
```
|
||||
</details>
|
||||
|
||||
---
|
||||
|
||||
@@ -164,7 +162,9 @@ bash dotfiles/install/install-macos-user.sh
|
||||
|
||||
---
|
||||
|
||||
## 🏁 Contest Pack
|
||||
## 🎛️ Themes & Style Packs
|
||||
|
||||
### 🏁 Contest Pack
|
||||
|
||||
The contest pack is a bold, DEFCON-ready set of five styles (Aurora, Neon, Forge, Circuit, Mono) with optional layout order. It always starts on a new line and ends with `@host - /path`.
|
||||
|
||||
@@ -188,7 +188,18 @@ It uses the same two-block layout as Aurora, but focuses on signal and minimal n
|
||||
|
||||
---
|
||||
|
||||
## 😀 Emoji palette
|
||||
<details>
|
||||
<summary><strong>Holidays Pack (themes)</strong></summary>
|
||||
|
||||
Holidays pack uses themed palettes + emojis and the contest layout order:
|
||||
|
||||
- Christmas, Easter, Halloween, Valentine, Thanksgiving, New Year
|
||||
</details>
|
||||
|
||||
---
|
||||
|
||||
<details>
|
||||
<summary><strong>Emoji palette</strong></summary>
|
||||
|
||||
Fixed times (all seasons):
|
||||
|
||||
@@ -201,6 +212,7 @@ Seasonal sets (sunrise / work):
|
||||
- Summer: 🌞 🏖️ 🌅 🌤 / 🏄 🏖️ 🚤 🌴
|
||||
- Autumn: 🍁 🍂 🌫️ 🌦️ / 🍂 🍄 🎃 🪵
|
||||
- Winter: 🏔️ 🌨️ ❄️ 🌌 / 🎿 ⛷️ 🏂 🧊
|
||||
</details>
|
||||
|
||||
---
|
||||
|
||||
@@ -209,22 +221,25 @@ Seasonal sets (sunrise / work):
|
||||
```text
|
||||
.
|
||||
├── .context.json
|
||||
├── contest-styles.json
|
||||
├── images/
|
||||
│ └── bash-pallete.png
|
||||
dotfiles/
|
||||
├── banner/
|
||||
│ └── banner.sh
|
||||
├── ps1/
|
||||
│ └── ps1.sh
|
||||
├── install/
|
||||
│ ├── install-global-ps1.sh
|
||||
│ ├── install-linux-global.sh
|
||||
│ ├── install-macos-user.sh
|
||||
│ └── install-nerdfont.sh
|
||||
│ ├── bash-pallete.png
|
||||
│ └── contest.png
|
||||
├── dotfiles/
|
||||
│ ├── banner/
|
||||
│ │ └── banner.sh
|
||||
│ ├── ps1/
|
||||
│ │ └── ps1.sh
|
||||
│ └── install/
|
||||
│ ├── install-global-ps1.sh
|
||||
│ ├── install-linux-global.sh
|
||||
│ ├── install-macos-user.sh
|
||||
│ └── install-nerdfont.sh
|
||||
└── README.md
|
||||
```
|
||||
|
||||
## ⚙️ Overrides (Optional)
|
||||
<details>
|
||||
<summary><strong>Overrides (Optional)</strong></summary>
|
||||
|
||||
Sometimes autodetection doesn’t work (e.g., on macOS without fontconfig):
|
||||
|
||||
@@ -241,10 +256,12 @@ export PS1_FORCE_ASCII=1
|
||||
```
|
||||
|
||||
Add these to your `~/.bashrc` or `~/.bash_profile`.
|
||||
</details>
|
||||
|
||||
---
|
||||
|
||||
## 🙅 Disable Prompt (per user)
|
||||
<details>
|
||||
<summary><strong>Disable prompt (per user)</strong></summary>
|
||||
|
||||
If you want to disable the global prompt for your account:
|
||||
|
||||
@@ -266,10 +283,12 @@ To re-enable:
|
||||
```bash
|
||||
rm -f ~/.config/ps1/disable
|
||||
```
|
||||
</details>
|
||||
|
||||
---
|
||||
|
||||
## 🧪 Testing
|
||||
<details>
|
||||
<summary><strong>Testing</strong></summary>
|
||||
|
||||
After install, open a new shell and run:
|
||||
|
||||
@@ -278,10 +297,12 @@ bash -i -c 'echo OK'
|
||||
```
|
||||
|
||||
If you see a prompt with colors and emoji, things are working.
|
||||
</details>
|
||||
|
||||
---
|
||||
|
||||
## 💡 Usage Notes
|
||||
<details>
|
||||
<summary><strong>Usage notes</strong></summary>
|
||||
|
||||
Font matters: even with Nerd Fonts installed, you must select them in your terminal settings.
|
||||
|
||||
@@ -294,6 +315,7 @@ Works on terminals like:
|
||||
- Windows Terminal (WSL)
|
||||
|
||||
If you see squares or missing glyphs, your terminal is likely using a non-Nerd font.
|
||||
</details>
|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"project": "Bashrc Dotfiles",
|
||||
"branch": "dev",
|
||||
"branch": "main",
|
||||
"purpose": "DEFCON contest render pack for PS1 styles",
|
||||
"contest_pack": {
|
||||
"layout_options": [
|
||||
@@ -29,6 +29,10 @@
|
||||
"night": "🕶️"
|
||||
}
|
||||
},
|
||||
"prompt_spacing": {
|
||||
"emoji_padding": 2,
|
||||
"note": "Two spaces after the emoji before the cursor"
|
||||
},
|
||||
"holiday_pack": {
|
||||
"layout_options": [
|
||||
"day-time-user",
|
||||
@@ -226,10 +230,10 @@
|
||||
}
|
||||
],
|
||||
"seasonal_palettes": {
|
||||
"winter": { "Z1_BG": 61, "Z1_FG": 255, "Z2_BG": 37, "Z2_FG": 255, "PATH_FG": 194, "FRAME": 60 },
|
||||
"spring": { "Z1_BG": 71, "Z1_FG": 255, "Z2_BG": 120, "Z2_FG": 22, "PATH_FG": 22, "FRAME": 65 },
|
||||
"summer": { "Z1_BG": 142, "Z1_FG": 255, "Z2_BG": 214, "Z2_FG": 0, "PATH_FG": 232, "FRAME": 130 },
|
||||
"autumn": { "Z1_BG": 95, "Z1_FG": 255, "Z2_BG": 173, "Z2_FG": 255, "PATH_FG": 223, "FRAME": 95 }
|
||||
"winter": { "Z1_BG": 60, "Z2_BG": 61, "Z3_BG": 62, "Z4_BG": 37, "Z1_FG": 255, "Z2_FG": 255, "PATH_FG": 194, "FRAME": 60 },
|
||||
"spring": { "Z1_BG": 70, "Z2_BG": 71, "Z3_BG": 72, "Z4_BG": 120, "Z1_FG": 255, "Z2_FG": 22, "PATH_FG": 22, "FRAME": 65 },
|
||||
"summer": { "Z1_BG": 141, "Z2_BG": 142, "Z3_BG": 143, "Z4_BG": 214, "Z1_FG": 255, "Z2_FG": 0, "PATH_FG": 232, "FRAME": 130 },
|
||||
"autumn": { "Z1_BG": 94, "Z2_BG": 95, "Z3_BG": 96, "Z4_BG": 173, "Z1_FG": 255, "Z2_FG": 255, "PATH_FG": 223, "FRAME": 95 }
|
||||
},
|
||||
"notes": [
|
||||
"Palette values are 256-color codes.",
|
||||
|
||||
@@ -29,6 +29,7 @@ style_choice="aurora"
|
||||
style_pack="standard"
|
||||
contest_layout="day-time-user"
|
||||
holiday_choice="christmas"
|
||||
git_choice="0"
|
||||
if [[ -t 0 ]]; then
|
||||
echo "Install options:"
|
||||
echo " 1) PS1 only"
|
||||
@@ -162,9 +163,19 @@ if [[ -t 0 ]]; then
|
||||
""|1) style_choice="aurora" ;;
|
||||
*) echo "Invalid choice, using aurora."; style_choice="aurora" ;;
|
||||
esac
|
||||
|
||||
else
|
||||
style_choice="aurora"
|
||||
fi
|
||||
|
||||
read -r -p "Enable git capsule for all themes? [y/N]: " git_pick
|
||||
case "${git_pick}" in
|
||||
y|Y) git_choice="1" ;;
|
||||
*) git_choice="0" ;;
|
||||
esac
|
||||
if [[ "$style_choice" == "git" ]]; then
|
||||
git_choice="1"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -243,6 +254,7 @@ if [[ "$install_ps1" -eq 1 ]]; then
|
||||
if [[ "$style_pack" == "holiday" ]]; then
|
||||
printf 'PS1_HOLIDAY=%s\n' "${holiday_choice:-christmas}"
|
||||
fi
|
||||
printf 'PS1_GIT=%s\n' "$git_choice"
|
||||
} > /etc/ps1-style
|
||||
chmod 0644 /etc/ps1-style
|
||||
else
|
||||
|
||||
@@ -18,6 +18,7 @@ season_choice=""
|
||||
style_choice="aurora"
|
||||
contest_layout="day-time-user"
|
||||
holiday_choice="christmas"
|
||||
git_choice="0"
|
||||
if [[ -t 0 ]]; then
|
||||
style_pack="standard"
|
||||
echo "PS1 mode:"
|
||||
@@ -138,9 +139,19 @@ if [[ -t 0 ]]; then
|
||||
""|1) style_choice="aurora" ;;
|
||||
*) echo "Invalid choice, using aurora."; style_choice="aurora" ;;
|
||||
esac
|
||||
|
||||
else
|
||||
style_choice="aurora"
|
||||
fi
|
||||
|
||||
read -r -p "Enable git capsule for all themes? [y/N]: " git_pick
|
||||
case "${git_pick}" in
|
||||
y|Y) git_choice="1" ;;
|
||||
*) git_choice="0" ;;
|
||||
esac
|
||||
if [[ "$style_choice" == "git" ]]; then
|
||||
git_choice="1"
|
||||
fi
|
||||
fi
|
||||
|
||||
mkdir -p "$DST_DIR"
|
||||
@@ -164,6 +175,7 @@ chmod 0644 "$SEASON_FILE"
|
||||
if [[ "$style_pack" == "holiday" ]]; then
|
||||
printf 'PS1_HOLIDAY=%s\n' "${holiday_choice:-christmas}"
|
||||
fi
|
||||
printf 'PS1_GIT=%s\n' "$git_choice"
|
||||
} > "$STYLE_FILE"
|
||||
chmod 0644 "$STYLE_FILE"
|
||||
|
||||
|
||||
@@ -94,6 +94,7 @@ _ps1_season() {
|
||||
# PS1_STYLE_PACK=standard|contest|holiday
|
||||
# PS1_CONTEST_LAYOUT=day-time-user|user-time|time-user|day-time
|
||||
# PS1_HOLIDAY=christmas|easter|halloween|valentine|thanksgiving|newyear
|
||||
# PS1_GIT=0|1
|
||||
# Also reads config from /etc/ps1-style or ~/.config/ps1/style
|
||||
_ps1_style_config() {
|
||||
local cfg=""
|
||||
@@ -112,6 +113,7 @@ _ps1_style_config() {
|
||||
PS1_STYLE_PACK) export PS1_STYLE_PACK="$v" ;;
|
||||
PS1_CONTEST_LAYOUT) export PS1_CONTEST_LAYOUT="$v" ;;
|
||||
PS1_HOLIDAY) export PS1_HOLIDAY="$v" ;;
|
||||
PS1_GIT) export PS1_GIT="$v" ;;
|
||||
esac
|
||||
done < "$cfg"
|
||||
fi
|
||||
@@ -141,6 +143,30 @@ _ps1_holiday() {
|
||||
echo "$holiday"
|
||||
}
|
||||
|
||||
_ps1_git_enabled() {
|
||||
_ps1_style_config
|
||||
local v="${PS1_GIT:-0}"
|
||||
case "$v" in
|
||||
1|y|Y|yes|YES|true|TRUE|on|ON) echo "1" ;;
|
||||
*) echo "0" ;;
|
||||
esac
|
||||
}
|
||||
|
||||
_ps1_git_line_tail() {
|
||||
if [[ "$(_ps1_git_enabled)" == "1" ]]; then
|
||||
export GIT_PS1_SHOWDIRTYSTATE=1
|
||||
export GIT_PS1_SHOWSTASHSTATE=1
|
||||
export GIT_PS1_SHOWUNTRACKEDFILES=1
|
||||
local info
|
||||
info="$(__git_capsule)"
|
||||
if [[ -n "$info" ]]; then
|
||||
printf "%s " "$info"
|
||||
return
|
||||
fi
|
||||
fi
|
||||
printf " "
|
||||
}
|
||||
|
||||
# ---- Load Git prompt helper (best effort) ----
|
||||
__try_source_git_prompt() {
|
||||
local candidates=(
|
||||
@@ -156,39 +182,44 @@ __try_source_git_prompt() {
|
||||
__try_source_git_prompt >/dev/null 2>&1
|
||||
|
||||
__git_capsule() {
|
||||
if ! declare -F __git_ps1 >/dev/null 2>&1; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
local info status=""
|
||||
local clean="✨"
|
||||
local dirty="🔨"
|
||||
local staged="📌"
|
||||
local untracked="🧷"
|
||||
local stashed="📦"
|
||||
local has_ps1=0
|
||||
|
||||
if declare -F __git_ps1 >/dev/null 2>&1; then
|
||||
has_ps1=1
|
||||
info="$(__git_ps1 "%s" 2>/dev/null)"
|
||||
if [[ -z "$info" ]]; then
|
||||
has_ps1=0
|
||||
fi
|
||||
fi
|
||||
if [[ -z "$info" ]]; then
|
||||
if command -v git >/dev/null 2>&1; then
|
||||
info="$(git symbolic-ref --quiet --short HEAD 2>/dev/null || git rev-parse --short HEAD 2>/dev/null)"
|
||||
fi
|
||||
fi
|
||||
|
||||
info="$(__git_ps1 "%s" 2>/dev/null)"
|
||||
[[ -z "$info" ]] && return 0
|
||||
|
||||
if [[ "$info" == *"*"* ]]; then status+=" $dirty"; fi
|
||||
if [[ "$info" == *"+"* ]]; then status+=" $staged"; fi
|
||||
if [[ "$info" == *"%"* ]]; then status+=" $untracked"; fi
|
||||
if [[ "$info" == *"$"* ]]; then status+=" $stashed"; fi
|
||||
if [[ -z "$status" ]]; then status=" $clean"; fi
|
||||
if (( has_ps1 )); then
|
||||
if [[ "$info" == *"*"* ]]; then status+=" $dirty"; fi
|
||||
if [[ "$info" == *"+"* ]]; then status+=" $staged"; fi
|
||||
if [[ "$info" == *"%"* ]]; then status+=" $untracked"; fi
|
||||
if [[ "$info" == *"$"* ]]; then status+=" $stashed"; fi
|
||||
if [[ -z "$status" ]]; then status=" $clean"; fi
|
||||
|
||||
info="${info//\%/}"
|
||||
info="${info//\*/}"
|
||||
info="${info//\+/}"
|
||||
info="${info//\$/}"
|
||||
info="$(printf "%s" "$info" | xargs)"
|
||||
|
||||
printf " ⟦%s⟧%s" "$info" "$status"
|
||||
}
|
||||
|
||||
__git_capsule() {
|
||||
if declare -F __git_ps1 >/dev/null 2>&1; then
|
||||
__git_ps1 " (%s)" 2>/dev/null
|
||||
info="${info//\%/}"
|
||||
info="${info//\*/}"
|
||||
info="${info//\+/}"
|
||||
info="${info//\$/}"
|
||||
fi
|
||||
|
||||
info="$(printf "%s" "$info" | xargs)"
|
||||
printf " ⟦%s⟧%s" "$info" "$status"
|
||||
}
|
||||
|
||||
# Time-based emoji with seasonal accents (Europe/Oslo)
|
||||
@@ -349,74 +380,96 @@ __PS1_STYLE="aurora"
|
||||
__PS1_STYLE_PACK="standard"
|
||||
__PS1_CONTEST_LAYOUT="day-time-user"
|
||||
__PS1_HOLIDAY="christmas"
|
||||
__PS1_GIT=0
|
||||
|
||||
_ps1_set_prompt() {
|
||||
local RST="\[\e[0m\]"
|
||||
|
||||
# Seasonal palettes (Z1 is darker than Z2)
|
||||
local Z1_BG Z1_FG Z2_BG Z2_FG PATH_FG FRAME
|
||||
local Z1_BG Z1_FG Z2_BG Z2_FG Z3_BG Z4_BG PATH_FG FRAME
|
||||
local Z1_BG_CODE Z2_BG_CODE Z3_BG_CODE Z4_BG_CODE
|
||||
if [[ "$__PS1_STYLE_PACK" == "contest" ]]; then
|
||||
Z1_BG="\[\e[48;5;24m\]"
|
||||
Z1_BG_CODE=24
|
||||
Z2_BG_CODE=31
|
||||
Z1_BG="\[\e[48;5;${Z1_BG_CODE}m\]"
|
||||
Z1_FG="\[\e[38;5;255m\]"
|
||||
Z2_BG="\[\e[48;5;31m\]"
|
||||
Z2_BG="\[\e[48;5;${Z2_BG_CODE}m\]"
|
||||
Z2_FG="\[\e[38;5;255m\]"
|
||||
PATH_FG="\[\e[38;5;51m\]"
|
||||
FRAME="\[\e[38;5;23m\]"
|
||||
elif [[ "$__PS1_STYLE_PACK" == "holiday" ]]; then
|
||||
case "$__PS1_HOLIDAY" in
|
||||
christmas)
|
||||
Z1_BG="\[\e[48;5;52m\]"
|
||||
Z1_BG_CODE=52
|
||||
Z2_BG_CODE=28
|
||||
Z1_BG="\[\e[48;5;${Z1_BG_CODE}m\]"
|
||||
Z1_FG="\[\e[38;5;255m\]"
|
||||
Z2_BG="\[\e[48;5;28m\]"
|
||||
Z2_BG="\[\e[48;5;${Z2_BG_CODE}m\]"
|
||||
Z2_FG="\[\e[38;5;255m\]"
|
||||
PATH_FG="\[\e[38;5;194m\]"
|
||||
FRAME="\[\e[38;5;88m\]"
|
||||
;;
|
||||
easter)
|
||||
Z1_BG="\[\e[48;5;186m\]"
|
||||
Z1_BG_CODE=186
|
||||
Z2_BG_CODE=150
|
||||
Z1_BG="\[\e[48;5;${Z1_BG_CODE}m\]"
|
||||
Z1_FG="\[\e[38;5;16m\]"
|
||||
Z2_BG="\[\e[48;5;150m\]"
|
||||
Z2_BG="\[\e[48;5;${Z2_BG_CODE}m\]"
|
||||
Z2_FG="\[\e[38;5;16m\]"
|
||||
PATH_FG="\[\e[38;5;94m\]"
|
||||
FRAME="\[\e[38;5;143m\]"
|
||||
;;
|
||||
halloween)
|
||||
Z1_BG="\[\e[48;5;53m\]"
|
||||
Z1_BG_CODE=53
|
||||
Z2_BG_CODE=166
|
||||
Z1_BG="\[\e[48;5;${Z1_BG_CODE}m\]"
|
||||
Z1_FG="\[\e[38;5;255m\]"
|
||||
Z2_BG="\[\e[48;5;166m\]"
|
||||
Z2_BG="\[\e[48;5;${Z2_BG_CODE}m\]"
|
||||
Z2_FG="\[\e[38;5;16m\]"
|
||||
PATH_FG="\[\e[38;5;16m\]"
|
||||
FRAME="\[\e[38;5;89m\]"
|
||||
;;
|
||||
valentine)
|
||||
Z1_BG="\[\e[48;5;198m\]"
|
||||
Z1_BG_CODE=198
|
||||
Z2_BG_CODE=205
|
||||
Z1_BG="\[\e[48;5;${Z1_BG_CODE}m\]"
|
||||
Z1_FG="\[\e[38;5;255m\]"
|
||||
Z2_BG="\[\e[48;5;205m\]"
|
||||
Z2_BG="\[\e[48;5;${Z2_BG_CODE}m\]"
|
||||
Z2_FG="\[\e[38;5;255m\]"
|
||||
PATH_FG="\[\e[38;5;224m\]"
|
||||
FRAME="\[\e[38;5;162m\]"
|
||||
;;
|
||||
thanksgiving)
|
||||
Z1_BG="\[\e[48;5;94m\]"
|
||||
Z1_BG_CODE=94
|
||||
Z2_BG_CODE=136
|
||||
Z1_BG="\[\e[48;5;${Z1_BG_CODE}m\]"
|
||||
Z1_FG="\[\e[38;5;230m\]"
|
||||
Z2_BG="\[\e[48;5;136m\]"
|
||||
Z2_BG="\[\e[48;5;${Z2_BG_CODE}m\]"
|
||||
Z2_FG="\[\e[38;5;231m\]"
|
||||
PATH_FG="\[\e[38;5;223m\]"
|
||||
FRAME="\[\e[38;5;130m\]"
|
||||
;;
|
||||
newyear)
|
||||
Z1_BG="\[\e[48;5;17m\]"
|
||||
Z1_BG_CODE=17
|
||||
Z2_BG_CODE=20
|
||||
Z1_BG="\[\e[48;5;${Z1_BG_CODE}m\]"
|
||||
Z1_FG="\[\e[38;5;255m\]"
|
||||
Z2_BG="\[\e[48;5;20m\]"
|
||||
Z2_BG="\[\e[48;5;${Z2_BG_CODE}m\]"
|
||||
Z2_FG="\[\e[38;5;255m\]"
|
||||
PATH_FG="\[\e[38;5;229m\]"
|
||||
FRAME="\[\e[38;5;19m\]"
|
||||
;;
|
||||
*)
|
||||
Z1_BG="\[\e[48;5;24m\]"
|
||||
Z1_BG_CODE=24
|
||||
Z2_BG_CODE=31
|
||||
Z1_BG="\[\e[48;5;${Z1_BG_CODE}m\]"
|
||||
Z1_FG="\[\e[38;5;255m\]"
|
||||
Z2_BG="\[\e[48;5;31m\]"
|
||||
Z2_BG="\[\e[48;5;${Z2_BG_CODE}m\]"
|
||||
Z2_FG="\[\e[38;5;255m\]"
|
||||
Z3_BG_CODE="${Z2_BG_CODE}"
|
||||
Z4_BG_CODE="${Z2_BG_CODE}"
|
||||
Z3_BG="\[\e[48;5;${Z3_BG_CODE}m\]"
|
||||
Z4_BG="\[\e[48;5;${Z4_BG_CODE}m\]"
|
||||
PATH_FG="\[\e[38;5;51m\]"
|
||||
FRAME="\[\e[38;5;23m\]"
|
||||
;;
|
||||
@@ -424,35 +477,59 @@ _ps1_set_prompt() {
|
||||
else
|
||||
case "$__PS1_SEASON" in
|
||||
spring)
|
||||
Z1_BG="\[\e[48;5;71m\]"
|
||||
Z1_BG_CODE=70
|
||||
Z2_BG_CODE=71
|
||||
Z3_BG_CODE=72
|
||||
Z4_BG_CODE=120
|
||||
Z1_BG="\[\e[48;5;${Z1_BG_CODE}m\]"
|
||||
Z1_FG="\[\e[38;5;255m\]"
|
||||
Z2_BG="\[\e[48;5;120m\]"
|
||||
Z2_BG="\[\e[48;5;${Z2_BG_CODE}m\]"
|
||||
Z2_FG="\[\e[38;5;22m\]"
|
||||
Z3_BG="\[\e[48;5;${Z3_BG_CODE}m\]"
|
||||
Z4_BG="\[\e[48;5;${Z4_BG_CODE}m\]"
|
||||
PATH_FG="\[\e[38;5;22m\]"
|
||||
FRAME="\[\e[38;5;65m\]"
|
||||
;;
|
||||
summer)
|
||||
Z1_BG="\[\e[48;5;142m\]"
|
||||
Z1_BG_CODE=141
|
||||
Z2_BG_CODE=142
|
||||
Z3_BG_CODE=143
|
||||
Z4_BG_CODE=214
|
||||
Z1_BG="\[\e[48;5;${Z1_BG_CODE}m\]"
|
||||
Z1_FG="\[\e[38;5;255m\]"
|
||||
Z2_BG="\[\e[48;5;214m\]"
|
||||
Z2_BG="\[\e[48;5;${Z2_BG_CODE}m\]"
|
||||
Z2_FG="\[\e[38;5;0m\]"
|
||||
Z3_BG="\[\e[48;5;${Z3_BG_CODE}m\]"
|
||||
Z4_BG="\[\e[48;5;${Z4_BG_CODE}m\]"
|
||||
PATH_FG="\[\e[38;5;232m\]"
|
||||
FRAME="\[\e[38;5;130m\]"
|
||||
;;
|
||||
autumn)
|
||||
Z1_BG="\[\e[48;5;95m\]"
|
||||
Z1_BG_CODE=94
|
||||
Z2_BG_CODE=95
|
||||
Z3_BG_CODE=96
|
||||
Z4_BG_CODE=173
|
||||
Z1_BG="\[\e[48;5;${Z1_BG_CODE}m\]"
|
||||
Z1_FG="\[\e[38;5;255m\]"
|
||||
Z2_BG="\[\e[48;5;173m\]"
|
||||
Z2_BG="\[\e[48;5;${Z2_BG_CODE}m\]"
|
||||
Z2_FG="\[\e[38;5;255m\]"
|
||||
Z3_BG="\[\e[48;5;${Z3_BG_CODE}m\]"
|
||||
Z4_BG="\[\e[48;5;${Z4_BG_CODE}m\]"
|
||||
PATH_FG="\[\e[38;5;223m\]"
|
||||
FRAME="\[\e[38;5;95m\]"
|
||||
;;
|
||||
*)
|
||||
# winter (default)
|
||||
Z1_BG="\[\e[48;5;61m\]"
|
||||
Z1_BG_CODE=60
|
||||
Z2_BG_CODE=61
|
||||
Z3_BG_CODE=62
|
||||
Z4_BG_CODE=37
|
||||
Z1_BG="\[\e[48;5;${Z1_BG_CODE}m\]"
|
||||
Z1_FG="\[\e[38;5;255m\]"
|
||||
Z2_BG="\[\e[48;5;37m\]"
|
||||
Z2_BG="\[\e[48;5;${Z2_BG_CODE}m\]"
|
||||
Z2_FG="\[\e[38;5;255m\]"
|
||||
Z3_BG="\[\e[48;5;${Z3_BG_CODE}m\]"
|
||||
Z4_BG="\[\e[48;5;${Z4_BG_CODE}m\]"
|
||||
PATH_FG="\[\e[38;5;194m\]"
|
||||
FRAME="\[\e[38;5;60m\]"
|
||||
;;
|
||||
@@ -480,12 +557,17 @@ _ps1_set_prompt() {
|
||||
fi
|
||||
|
||||
local style="${__PS1_STYLE:-aurora}"
|
||||
local git_tail=""
|
||||
if [[ "$style" != "git" ]]; then
|
||||
git_tail="$(_ps1_git_line_tail)"
|
||||
fi
|
||||
local L1="\\d \\A \\u"
|
||||
local L_HOST="@\\h"
|
||||
local PREFIX=""
|
||||
local HOST_PART="${L_HOST}"
|
||||
local PATH_PART="${__PS1_PATH}"
|
||||
local PATH_SEP=" "
|
||||
local END_PAD=" "
|
||||
if [[ "$__PS1_STYLE_PACK" == "contest" || "$__PS1_STYLE_PACK" == "holiday" ]]; then
|
||||
local layout="${__PS1_CONTEST_LAYOUT:-day-time-user}"
|
||||
case "$layout" in
|
||||
@@ -502,30 +584,58 @@ _ps1_set_prompt() {
|
||||
|
||||
case "$style" in
|
||||
neon)
|
||||
local N1_BG="\[\e[48;5;201m\]"
|
||||
local N1_BG_CODE=201
|
||||
local N2_BG_CODE=45
|
||||
local N1_BG="\[\e[48;5;${N1_BG_CODE}m\]"
|
||||
local N1_FG="\[\e[38;5;255m\]"
|
||||
local N2_BG="\[\e[48;5;45m\]"
|
||||
local N2_BG="\[\e[48;5;${N2_BG_CODE}m\]"
|
||||
local N2_FG="\[\e[38;5;16m\]"
|
||||
local N_PATH_FG="\[\e[38;5;16m\]"
|
||||
local N_FRAME="\[\e[38;5;199m\]"
|
||||
local N_LEFT="${left}"
|
||||
local N_RIGHT="${right}"
|
||||
local N_SEP="${sep}"
|
||||
local N_LEFT_FG=""
|
||||
local N_RIGHT_FG=""
|
||||
if [[ "$__PS1_USE_NF" -eq 1 ]]; then
|
||||
N_LEFT=""
|
||||
N_RIGHT=""
|
||||
N_SEP=""
|
||||
N_LEFT_FG="\[\e[38;5;${N1_BG_CODE}m\]"
|
||||
N_RIGHT_FG="\[\e[38;5;${N2_BG_CODE}m\]"
|
||||
fi
|
||||
PS1="\
|
||||
${PREFIX}${N_FRAME}╭─${RST}\
|
||||
${N1_BG}${N1_FG}${left} ${BOLD}\\u${NOBOLD} \\d \\A ${RST}${N1_BG}${N2_BG}${N2_FG}${sep}${RST}\
|
||||
${N2_BG}${N2_FG} ${HOST_PART}${PATH_SEP}${N_PATH_FG}${PATH_PART} ${RST}${N2_BG}${N2_FG}${right}${RST}\
|
||||
\n${N_FRAME}╰── ${RST}${prompt_sym} ${__PS1_SYM} "
|
||||
${N_LEFT_FG}${N_LEFT}${RST}${N1_BG}${N1_FG} ${BOLD}\\u${NOBOLD} \\d \\A ${RST}${N1_BG}${N2_BG}${N2_FG}${N_SEP}${RST}\
|
||||
${N2_BG}${N2_FG} ${HOST_PART}${PATH_SEP}${N_PATH_FG}${PATH_PART}${END_PAD}${RST}${N_RIGHT_FG}${N_RIGHT}${RST}\
|
||||
\n${N_FRAME}╰── ${RST}${prompt_sym} ${__PS1_SYM}${git_tail}"
|
||||
;;
|
||||
forge)
|
||||
local F1_BG="\[\e[48;5;94m\]"
|
||||
local F1_BG_CODE=94
|
||||
local F2_BG_CODE=166
|
||||
local F1_BG="\[\e[48;5;${F1_BG_CODE}m\]"
|
||||
local F1_FG="\[\e[38;5;230m\]"
|
||||
local F2_BG="\[\e[48;5;166m\]"
|
||||
local F2_BG="\[\e[48;5;${F2_BG_CODE}m\]"
|
||||
local F2_FG="\[\e[38;5;231m\]"
|
||||
local F_PATH_FG="\[\e[38;5;224m\]"
|
||||
local F_FRAME="\[\e[38;5;130m\]"
|
||||
local F_LEFT="${left}"
|
||||
local F_RIGHT="${right}"
|
||||
local F_SEP="${sep}"
|
||||
local F_LEFT_FG=""
|
||||
local F_RIGHT_FG=""
|
||||
if [[ "$__PS1_USE_NF" -eq 1 ]]; then
|
||||
F_LEFT=""
|
||||
F_RIGHT=""
|
||||
F_SEP=""
|
||||
F_LEFT_FG="\[\e[38;5;${F1_BG_CODE}m\]"
|
||||
F_RIGHT_FG="\[\e[38;5;${F2_BG_CODE}m\]"
|
||||
fi
|
||||
PS1="\
|
||||
${PREFIX}${F_FRAME}╭─${RST}\
|
||||
${F1_BG}${F1_FG}${left} ${BOLD}${L1}${NOBOLD} ${RST}${F1_BG}${F2_BG}${F2_FG}${sep}${RST}\
|
||||
${F2_BG}${F2_FG} ${HOST_PART}${PATH_SEP}${F_PATH_FG}${PATH_PART} ${RST}${F2_BG}${F2_FG}${right}${RST}\
|
||||
\n${F_FRAME}╰── ${RST}${prompt_sym} ${__PS1_SYM} "
|
||||
${F_LEFT_FG}${F_LEFT}${RST}${F1_BG}${F1_FG} ${BOLD}${L1}${NOBOLD} ${RST}${F1_BG}${F2_BG}${F2_FG}${F_SEP}${RST}\
|
||||
${F2_BG}${F2_FG} ${HOST_PART}${PATH_SEP}${F_PATH_FG}${PATH_PART}${END_PAD}${RST}${F_RIGHT_FG}${F_RIGHT}${RST}\
|
||||
\n${F_FRAME}╰── ${RST}${prompt_sym} ${__PS1_SYM}${git_tail}"
|
||||
;;
|
||||
circuit)
|
||||
local C_FG="\[\e[38;5;46m\]"
|
||||
@@ -534,14 +644,14 @@ ${F2_BG}${F2_FG} ${HOST_PART}${PATH_SEP}${F_PATH_FG}${PATH_PART} ${RST}${F2_BG}$
|
||||
PS1="\
|
||||
${PREFIX}${C_DIM}┏━${RST}${C_FG}[${BOLD}\\u${NOBOLD} ${RST}${C_FG}\\A${RST}${C_DIM}]${RST}\
|
||||
${C_DIM}━${RST}${C_FG}${HOST_PART}${RST}${PATH_SEP}${C_PATH}${PATH_PART}${RST}\
|
||||
\n${C_DIM}┗━${RST}${prompt_sym} ${__PS1_SYM} "
|
||||
\n${C_DIM}┗━${RST}${prompt_sym} ${__PS1_SYM}${git_tail}"
|
||||
;;
|
||||
mono)
|
||||
local M_FG="\[\e[38;5;250m\]"
|
||||
local M_DIM="\[\e[38;5;240m\]"
|
||||
PS1="\
|
||||
${PREFIX}${M_FG}⟦${L1}⟧ ${M_DIM}${HOST_PART}${PATH_SEP}${M_FG}${PATH_PART}${RST}\
|
||||
\n${M_DIM}└─${RST}${prompt_sym} ${__PS1_SYM} "
|
||||
\n${M_DIM}└─${RST}${prompt_sym} ${__PS1_SYM}${git_tail}"
|
||||
;;
|
||||
git)
|
||||
export GIT_PS1_SHOWDIRTYSTATE=1
|
||||
@@ -554,11 +664,17 @@ ${PREFIX}${M_FG}⟦${L1}⟧ ${M_DIM}${HOST_PART}${PATH_SEP}${M_FG}${PATH_PART}${
|
||||
local G_Z2_FG="\[\e[38;5;255m\]"
|
||||
local G_PATH_FG="\[\e[38;5;194m\]"
|
||||
local GIT_INFO="$(__git_capsule)"
|
||||
local G_LEFT=""
|
||||
local G_RIGHT=""
|
||||
local G_SEP=""
|
||||
local G_END_PAD=" "
|
||||
local G_LEFT_FG="\[\e[38;5;61m\]"
|
||||
local G_RIGHT_FG="\[\e[38;5;37m\]"
|
||||
PS1="\
|
||||
${PREFIX}${G_FRAME}╭─${RST}\
|
||||
${G_Z1_BG}${G_Z1_FG}${left} ${L1} ${RST}${G_Z1_BG}${G_Z2_BG}${G_Z2_FG}${sep}${RST}\
|
||||
${G_Z2_BG}${G_Z2_FG} ${HOST_PART}${PATH_SEP}${G_PATH_FG}${PATH_PART} ${RST}${G_Z2_BG}${G_Z2_FG}${right}${RST}\
|
||||
\n${G_FRAME}╰── ${RST}${prompt_sym} ${__PS1_SYM}${GIT_INFO} "
|
||||
${G_LEFT_FG}${G_LEFT}${RST}${G_Z1_BG}${G_Z1_FG} ${L1} ${RST}${G_Z1_BG}${G_Z2_BG}${G_Z2_FG}${G_SEP}${RST}\
|
||||
${G_Z2_BG}${G_Z2_FG} ${HOST_PART}${PATH_SEP}${G_PATH_FG}${PATH_PART}${G_END_PAD}${RST}${G_RIGHT_FG}${G_RIGHT}${RST}\
|
||||
\n${G_FRAME}╰── ${RST}${prompt_sym} ${__PS1_SYM} ${GIT_INFO} "
|
||||
;;
|
||||
hawolex)
|
||||
local H_FRAME="\[\e[38;5;24m\]"
|
||||
@@ -567,19 +683,46 @@ ${G_Z2_BG}${G_Z2_FG} ${HOST_PART}${PATH_SEP}${G_PATH_FG}${PATH_PART} ${RST}${G_Z
|
||||
local H_Z2_BG="\[\e[48;5;31m\]"
|
||||
local H_Z2_FG="\[\e[38;5;255m\]"
|
||||
local H_PATH_FG="\[\e[38;5;230m\]"
|
||||
local H_LEFT=""
|
||||
local H_RIGHT=""
|
||||
local H_SEP=""
|
||||
local H_LEFT_FG="\[\e[38;5;54m\]"
|
||||
local H_RIGHT_FG="\[\e[38;5;31m\]"
|
||||
PS1="\
|
||||
${PREFIX}${H_FRAME}╭─${RST}\
|
||||
${H_Z1_BG}${H_Z1_FG}${left} ${L1} ${RST}${H_Z1_BG}${H_Z2_BG}${H_Z2_FG}${sep}${RST}\
|
||||
${H_Z2_BG}${H_Z2_FG} ${HOST_PART}${PATH_SEP}${H_PATH_FG}${PATH_PART} ${RST}${H_Z2_BG}${H_Z2_FG}${right}${RST}\
|
||||
\n${H_FRAME}╰── ${RST}${prompt_sym} ${__PS1_SYM} "
|
||||
${H_LEFT_FG}${H_LEFT}${RST}${H_Z1_BG}${H_Z1_FG} ${L1} ${RST}${H_Z1_BG}${H_Z2_BG}${H_Z2_FG}${H_SEP}${RST}\
|
||||
${H_Z2_BG}${H_Z2_FG} ${HOST_PART}${PATH_SEP}${H_PATH_FG}${PATH_PART}${END_PAD}${RST}${H_RIGHT_FG}${H_RIGHT}${RST}\
|
||||
\n${H_FRAME}╰── ${RST}${prompt_sym} ${__PS1_SYM}${git_tail}"
|
||||
;;
|
||||
*)
|
||||
# aurora (default)
|
||||
PS1="\
|
||||
local A_LEFT="${left}"
|
||||
local A_RIGHT="${right}"
|
||||
local A_SEP="${sep}"
|
||||
local A_LEFT_FG=""
|
||||
local A_RIGHT_FG=""
|
||||
if [[ "$__PS1_USE_NF" -eq 1 ]]; then
|
||||
A_LEFT=""
|
||||
A_RIGHT=""
|
||||
A_SEP=""
|
||||
A_LEFT_FG="\[\e[38;5;${Z1_BG_CODE}m\]"
|
||||
A_RIGHT_FG="\[\e[38;5;${Z4_BG_CODE:-$Z2_BG_CODE}m\]"
|
||||
fi
|
||||
if [[ "$__PS1_STYLE_PACK" == "standard" && "$__PS1_USE_NF" -eq 1 ]]; then
|
||||
local SEP12="\[\e[38;5;${Z2_BG_CODE}m\]\[\e[48;5;${Z1_BG_CODE}m\]${A_SEP}${RST}"
|
||||
local SEP23="\[\e[38;5;${Z3_BG_CODE}m\]\[\e[48;5;${Z2_BG_CODE}m\]${A_SEP}${RST}"
|
||||
local SEP34="\[\e[38;5;${Z4_BG_CODE}m\]\[\e[48;5;${Z3_BG_CODE}m\]${A_SEP}${RST}"
|
||||
PS1="\
|
||||
${PREFIX}${FRAME}╭─${RST}\
|
||||
${Z1_BG}${Z1_FG}${left} ${L1} ${RST}${Z1_BG}${Z2_BG}${Z2_FG}${sep}${RST}\
|
||||
${Z2_BG}${Z2_FG} ${HOST_PART}${PATH_SEP}${PATH_FG}${PATH_PART} ${RST}${Z2_BG}${Z2_FG}${right}${RST}\
|
||||
\n${FRAME}╰── ${RST}${prompt_sym} ${__PS1_SYM} "
|
||||
${A_LEFT_FG}${A_LEFT}${RST}${Z1_BG}${Z1_FG} \\d ${RST}${SEP12}${Z2_BG}${Z1_FG} \\A ${RST}${SEP23}${Z3_BG}${Z1_FG} \\u ${RST}${SEP34}${Z4_BG}${Z2_FG} ${HOST_PART}${PATH_SEP}${PATH_FG}${PATH_PART}${END_PAD}${RST}${A_RIGHT_FG}${A_RIGHT}${RST}\
|
||||
\n${FRAME}╰── ${RST}${prompt_sym} ${__PS1_SYM}${git_tail}"
|
||||
else
|
||||
PS1="\
|
||||
${PREFIX}${FRAME}╭─${RST}\
|
||||
${A_LEFT_FG}${A_LEFT}${RST}${Z1_BG}${Z1_FG} ${L1} ${RST}${Z1_BG}${Z2_BG}${Z2_FG}${A_SEP}${RST}\
|
||||
${Z2_BG}${Z2_FG} ${HOST_PART}${PATH_SEP}${PATH_FG}${PATH_PART}${END_PAD}${RST}${A_RIGHT_FG}${A_RIGHT}${RST}\
|
||||
\n${FRAME}╰── ${RST}${prompt_sym} ${__PS1_SYM}${git_tail}"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
}
|
||||
@@ -591,6 +734,7 @@ _ps1_update() {
|
||||
__PS1_CONTEST_LAYOUT="$(_ps1_contest_layout)"
|
||||
__PS1_HOLIDAY="$(_ps1_holiday)"
|
||||
__PS1_STYLE="$(_ps1_style)"
|
||||
__PS1_GIT="${PS1_GIT:-0}"
|
||||
__PS1_SYM="$(_ps1_symbol)"
|
||||
__PS1_PATH="$(_ps1_path)"
|
||||
if _ps1_has_nf; then __PS1_USE_NF=1; else __PS1_USE_NF=0; fi
|
||||
|
||||
Reference in New Issue
Block a user