Files
ps1-craft/README.md
2026-01-24 15:42:27 +00:00

8.7 KiB
Raw Blame History

Bashrc Dotfiles — Global & Portable Bash Prompt

Production-ready on main.

Elegant, portable, and easy-to-install Bash prompt with:

  • Two color zones
  • 🌅 Time-based emoji accents
  • 🖥️ Fallback when Nerd Fonts arent available
  • 📍 Shortened but informative path
  • 🔘 Status-colored prompt arrow
  • 🧠 Works on Linux, WSL, and macOS

🚀 Install

🐧 Linux / WSL (global, all users)

  1. Clone the repo:
git clone <repo-url>
  1. Enter the folder:
cd Bashrc
  1. Run the global installer (auto-installs deps + prompts for punchline):
sudo bash dotfiles/install/install-linux-global.sh
  1. Open a new shell to see the prompt and banner.

🍏 macOS (per-user)

  1. Clone the repo:
git clone <repo-url>
  1. Enter the folder:
cd Bashrc
  1. Run the user installer:
bash dotfiles/install/install-macos-user.sh
  1. Reload your shell (or open a new terminal):
source ~/.bashrc
bash dotfiles/install/install-nerdfont.sh

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

Installer choices

Linux/WSL:

  • PS1 only / Banner only / Both
  • PS1 modes: Single season, Dynamic season, Contest pack, Holidays pack, Custom pack
  • Dynamic season auto-switches by time of year (Spring: MarMay, Summer: JunAug, Autumn: SepNov 14, Winter: Nov 15Feb)

macOS:

  • PS1 modes: Single season, Dynamic season, Contest pack, Holidays pack, Custom pack
  • Dynamic season auto-switches by time of year (same ranges as Linux)

What gets installed

Linux / WSL

  • Installs the prompt module to /etc/profile.d/ps1.sh
  • Installs the banner module to /etc/profile.d/banner.sh
  • Sources both from /etc/bash.bashrc
  • Installs landscape-common, figlet, and lolcat if missing
  • Prompts for the global punchline used by the banner
  • You can change the selection or remove PS1/banner by running the installer again

macOS

  • Copies ps1/ps1.sh to ~/.config/ps1/ps1.sh
  • Adds a source block in ~/.bashrc and ~/.bash_profile

PS1 module (when it runs)
  • 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.


Banner (hostname + punchline + sysinfo)

On Linux/WSL, a banner is also shown on login:

  • figlet $(hostname) -c | lolcat
  • figlet -f digital "<punchline>" -c | lolcat
  • landscape-sysinfo | lolcat

Punchline (global)

The banner reads the punchline from:

  • /etc/ps1-punchline

The install script prompts for a punchline and stores it in the file. You can also set it manually:

echo "Your punchline" | sudo tee /etc/ps1-punchline >/dev/null

🧠 Features

  • Clean, modern powerline-style prompt
  • Zone 1: date/time/user (cool gray-blue)
  • Zone 2: host/path (turquoise / cool green)
  • Automatically switches emoji during the day
  • Smart path shortening (keeps your home dir visible)
  • Fallback to ASCII/Unicode if Nerd Fonts are not installed
  • Per-user disable support
  • Simple per-user or global install

🎛️ 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.

Note: This repo was built with AI assistance, and the contest pack itself is fully AI-authored.


Custom Pack (bold styles)

Seven extra styles, built to be loud and expressive:

  • Radar: green scanline HUD
  • Synthwave: pink/cyan/orange glow blocks
  • Noir: near-black minimal + red path
  • Topo: elevation-style path segments
  • Glitch: jitter separators + neon
  • ArcticFire: icy blues into ember orange
  • AcidLime: black + electric green

Custom styles add a small context badge when relevant (ssh, ctr, git).


Git Theme (details)

The Git theme adds a repo-aware capsule on line 2 that only appears inside a Git repo. The branch name is wrapped as ⟦branch⟧, and status emojis reflect state:

  • Clean:
  • Dirty: 🔨
  • Staged: 📌
  • Untracked: 🧷
  • Stashed: 📦

It uses the same two-block layout as Aurora, but focuses on signal and minimal noise for fast scanning. Use it when you want repo status on every command without a full VCS prompt.

Git capsule switch:

  • PS1_GIT=1 enables the git capsule on all themes
  • Git theme always shows it, regardless of PS1_GIT

Holidays Pack (themes)

Holidays pack uses themed palettes + emojis and the contest layout order:

  • Christmas, Easter, Halloween, Valentine, Thanksgiving, New Year

Emoji palette

Fixed times (all seasons):

  • Lunch 11:0011:29 = 🥪
  • Dinner 16:0016:59 = 🍲

Seasonal sets (sunrise / work):

  • Spring: 🌷 🌱 🐣 🌤 / 🌿 🪴 🐝 🌼
  • Summer: 🌞 🏖️ 🌅 🌤 / 🏄 🏖️ 🚤 🌴
  • Autumn: 🍁 🍂 🌫️ 🌦️ / 🍂 🍄 🎃 🪵
  • Winter: 🏔️ 🌨️ ❄️ 🌌 / 🎿 ⛷️ 🏂 🧊

Time slots:

  • Sunrise: 05:0008:59
  • Coffee: 09:0010:59
  • Work: 11:3015:59 (unless lunch overrides)
  • Evening: 17:0022:59
  • Night: 23:0004:59

Meaning:

  • Emoji is a light accent for time/season; it never replaces core info

🗂️ Repo Structure

.
├── .context.json
├── contest-styles.json
├── images/
│   ├── 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)

Sometimes autodetection doesnt work (e.g., on macOS without fontconfig):

Force Nerd Font glyphs:

export PS1_FORCE_NF=1

Force fallback (no powerline glyphs):

export PS1_FORCE_ASCII=1

Add these to your ~/.bashrc or ~/.bash_profile.


Disable prompt (per user)

If you want to disable the global prompt for your account:

Temporarily in a shell:

export DISABLE_GLOBAL_PS1=1

Permanently:

mkdir -p ~/.config/ps1
touch ~/.config/ps1/disable

To re-enable:

rm -f ~/.config/ps1/disable

Testing

After install, open a new shell and run:

bash -i -c 'echo OK'

If you see a prompt with colors and emoji, things are working.


Usage notes

Font matters: even with Nerd Fonts installed, you must select them in your terminal settings.

Works on terminals like:

  • GNOME Terminal
  • iTerm2
  • Kitty
  • VS Code integrated terminal
  • Windows Terminal (WSL)

If you see squares or missing glyphs, your terminal is likely using a non-Nerd font.


📸 Seasonal Previews

Placeholders for the four seasonal prompts (screenshots will be added here):

  • Winter: images/season-winter.png (placeholder)
  • Spring: images/season-spring.png (placeholder)
  • Summer: images/season-summer.png (placeholder)
  • Autumn: images/season-autumn.png (placeholder)

Current combined palette reference:


🔥 Why this is real high-end PS1 design

  • Semantic color use (identity vs location)
  • Few colors, but with meaning
  • Path is visible, but never dominant
  • Emoji is an accent, not a gimmick
  • Prompt line is calm → the command gets focus

🎨 Color palette (notes)

Role BG Description
Zone 1 BG 61 gray-blue pastel
Zone 1 FG 255 pure white
Zone 2 BG 37 turquoise / cool green
Path FG 194 (FG) light green, muted
Frame 60 darker blue

🛠️ Contribution

Want to help improve this project?

  • Fork the repository
  • Make your changes
  • Open a merge request
  • Please keep consistent colors and styles

📄 License

MIT © 2026 Steffen Skui