Add selectable PS1 styles

- Implement 5 bold styles and style config

- Prompt for style selection in installers
This commit is contained in:
2026-01-24 10:04:14 +00:00
parent da123e9574
commit a737cf90dd
3 changed files with 138 additions and 4 deletions

View File

@@ -8,12 +8,14 @@ SRC_PS1="$REPO_ROOT/ps1/ps1.sh"
DST_DIR="$HOME/.config/ps1"
DST_PS1="$DST_DIR/ps1.sh"
SEASON_FILE="$DST_DIR/season"
STYLE_FILE="$DST_DIR/style"
MARKER_START="# >>> user ps1 (managed) >>>"
MARKER_END="# <<< user ps1 (managed) <<<"
season_mode="dynamic"
season_choice=""
style_choice="aurora"
if [[ -t 0 ]]; then
echo "Season mode:"
echo " 1) Dynamic (auto by date)"
@@ -44,6 +46,28 @@ if [[ -t 0 ]]; then
season_mode="dynamic"
;;
esac
echo
echo "Style presets:"
echo " 1) Aurora - Powerline blocks, seasonal palette, two-line"
echo " Preview: [date time user] > [@host /path]"
echo " 2) Neon - Magenta/cyan cyber blocks, high contrast"
echo " Preview: [user time] > [@host /path]"
echo " 3) Forge - Warm copper blocks, heavy frame"
echo " Preview: [date time user] > [@host /path]"
echo " 4) Circuit - Green scanline, minimal rails"
echo " Preview: [user time] - @host /path"
echo " 5) Mono - Clean monochrome, fast read"
echo " Preview: [date time user] @host /path"
read -r -p "Choose style [1]: " style_pick
case "${style_pick}" in
2) style_choice="neon" ;;
3) style_choice="forge" ;;
4) style_choice="circuit" ;;
5) style_choice="mono" ;;
""|1) style_choice="aurora" ;;
*) echo "Invalid choice, using aurora."; style_choice="aurora" ;;
esac
fi
mkdir -p "$DST_DIR"
@@ -58,6 +82,9 @@ chmod 0644 "$DST_PS1"
} > "$SEASON_FILE"
chmod 0644 "$SEASON_FILE"
printf 'PS1_STYLE=%s\n' "$style_choice" > "$STYLE_FILE"
chmod 0644 "$STYLE_FILE"
add_source_block() {
local file="$1"
[[ -f "$file" ]] || touch "$file"