Skip to content

Dynamic bash prompt#529

Closed
jardahrazdera wants to merge 3 commits into
basecamp:masterfrom
jardahrazdera:master
Closed

Dynamic bash prompt#529
jardahrazdera wants to merge 3 commits into
basecamp:masterfrom
jardahrazdera:master

Conversation

@jardahrazdera
Copy link
Copy Markdown
Contributor

This enhancement replaces the simple default bash prompt with a dynamic, theme-aware prompt that automatically adapts to any Omarchy theme.

Features

  • Dynamic color extraction - Automatically reads colors from alacritty.toml
  • Light/dark theme support - Detects light.mode files and adjusts text brightness
  • Git integration - Shows current branch and status with visual indicators
  • Universal compatibility - Works with all themes without requiring additional theme files
  • Performance optimized - Caches colors and only updates when theme changes
  • Fallback support - Gracefully handles missing color definitions

How It Works

  • Dynamic color extraction from alacritty.toml using pattern matching
  • Theme change detection via symlink monitoring with caching for performance
  • Light/dark mode adaptation based on light.mode file presence
  • Git status integration with visual indicators for branch and working directory state

Installation

The prompt can be enabled by adding this line to your .bashrc:

# Load Omarchy dynamic prompt
source ~/.config/omarchy/default/bash/prompt

Prompt Format

╭─[ user@hostname ]─[ /current/path ] main✓
╰─❯❯❯ 

Visual Elements

  • Borders and arrows - Frame and navigation elements
  • Username section - [ user@hostname ]
  • Path section - [ /current/path ]
  • Git branch indicator - Shows current branch name
  • Git status symbols:
    • - Clean working directory
    • - Uncommitted changes
    • + - Staged changes
  • Prompt character - Final ❯❯❯ input indicator

Benefits

  • Consistent theming - Prompt colors always match your current Omarchy theme
  • No maintenance - Automatically works with new themes as they're added
  • Enhanced workflow - Git integration helps with development tasks
  • Performance focused - Minimal overhead compared to complex prompt frameworks

What This PR Does

Adds a dynamic, theme-aware bash prompt that automatically adapts to Omarchy themes.

Problem Solved

  • Current bash prompt is very minimalistic and could be more informative
  • No git integration in the terminal prompt for development workflows
  • Limited visual elements compared to Omarchy's rich theming capabilities

Changes Made

  • Created default/bash/prompt with dynamic color extraction
  • Integrated with existing theme switching mechanism
  • Added git status indicators with visual symbols
  • Optimized for performance with color caching
  • Works with all existing themes without requiring theme modifications

Testing

  • Tested with dark themes (Tokyo Night, Gruvbox, etc.)
  • Tested with light themes (Catppuccin Latte, etc.)
  • Verified git integration works correctly
  • Confirmed performance impact is minimal
  • Tested fallback behavior with missing configs
  • Verified compatibility across different terminal sizes

Screenshots

screenshot-2025-08-06_23-25-10 screenshot-2025-08-06_23-26-45 screenshot-2025-08-06_23-28-01

Replaces static prompt with dynamic color extraction from theme files.
Automatically adapts to any theme by reading alacritty.toml colors.
Includes git integration and light/dark theme support.

Co-authored-by: jarek <jarek@jaroslav.tech>
@dhh
Copy link
Copy Markdown
Member

dhh commented Aug 7, 2025

Thanks for working on this, but I prefer a super minimal prompt. But this would be a good Omarchy plugin or command that builds on top of it. Please do explore that!

@dhh dhh closed this Aug 7, 2025
@jardahrazdera
Copy link
Copy Markdown
Contributor Author

Thanks for working on this, but I prefer a super minimal prompt. But this would be a good Omarchy plugin or command that builds on top of it. Please do explore that!

Thanks for your honest opinion. I'll look forward to make plugin as you mentioned. Have a good day.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants