Skip to content

BadRat-in/zsh-modern-theme

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Modern ZSH Theme

A sleek and modern ZSH theme that automatically adapts to light and dark terminal themes. This theme provides a clean and informative prompt with git integration, command execution time, and a beautiful rainbow directory path.

Theme Preview Dark Theme Preview Light

Features

  • 🌗 Automatic Theme Detection: Automatically switches between light and dark color schemes
  • 🌈 Rainbow Directory Path: Each directory level has its own color for better visibility
  • 🔄 Git Integration:
    • Shows current branch name
    • Displays repository status (clean/dirty)
    • Uses distinct symbols (✓/✗) for status indication
  • ⏱️ Command Execution Timer:
    • Shows how long each command took to execute
    • Smart time formatting:
      • Seconds only for quick commands (e.g., "5s")
      • Minutes and seconds for longer commands (e.g., "2m 30s")
      • Hours, minutes, and seconds for extended operations (e.g., "1h 25m 15s")
  • 👤 User Context: Displays username
  • Error Indication: Changes prompt color on command failure
  • 🎨 Color Optimized: Carefully selected colors for both light and dark themes
  • 🖥️ Terminal Support:
    • Apple Terminal
    • iTerm2
    • GNOME Terminal
    • Konsole
    • Support for tmux and screen

Installation

Prerequisites

  • ZSH shell
  • Git (optional, for git status features)

Manual Installation

  1. Clone the repository:
git clone https://github.com/BadRat-in/zsh-modern-theme.git $HOME/.zsh/zsh-modern-theme
  1. Set the theme in your ~/.zshrc:
source $HOME/.zsh/zsh-modern-theme/modern-theme.zsh
  1. Reload your configuration:
source ~/.zshrc

Customization

You can customize various aspects of the theme by modifying the variables in modern-theme.zsh:

Colors

The theme automatically selects appropriate colors for light and dark themes, but you can customize them:

# For dark theme
typeset -g PROMPT_COLOR=$'%F{033}'    # Change prompt color
typeset -g USER_COLOR=$'%F{226}'      # Change username color
# ... more color variables available

# For light theme
typeset -g PROMPT_COLOR=$'%F{020}'    # Change prompt color for light theme
# ... more color variables available

Git Symbols

typeset -g GIT_CLEAN_SYMBOL=''       # Change clean repository symbol
typeset -g GIT_DIRTY_SYMBOL=''       # Change dirty repository symbol
typeset -g GIT_PREFIX=' & '           # Change prefix before git branch

Contributing

Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Author

Ravindra Singh

Acknowledgments

  • Inspired by various ZSH themes in the community
  • Special thanks to the Oh My Zsh project

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages