Code Monkey home page Code Monkey logo

bash-prompt's Introduction

bash-prompt

A lightweight (single file), cross-compatible (bash v3/v4, MacOS, Linux) bash prompt.

Dark Theme

Features

  • Single file installation to keep it simple
  • Works on MacOS and Linux (and probably others)
  • Multiple color themes that can be switched in the same session
  • Text input colorized to emphasize commands being executed
  • Easy to modify contents of prompt

Default Prompt

The included multi-line prompt has the following items:

  • Time of day in HH:MM format
  • Duration of previous command, colorized to indicate success or failure
  • Username, colorized to indicate root or non-root user
  • Hostname
  • Current path trimmed to three directories (configurable)
  • Current git branch if in a git repo
  • Number of running/sleeping jobs

Installation

Download .bash_prompt to your $HOME directory. Select a theme from the list below or create your own. Then add the following block of code to your $HOME/.bashrc or $HOME/.bash_profile, which will ensure the prompt is loaded only during an interactive session.

if [[ -n $PS1 && -f ~/.bash_prompt ]]; then
  . ~/.bash_prompt
  ps1_dark_theme  # Choose your theme here
fi

Color Themes

Here are the included themes. To switch the theme in your current session, type the name of a theme.

Note: your colors will vary depending on the ANSI color definitions in your terminal emulator. I have included my MacOS Terminal theme in the misc directory if you want to mimic this exact look. That color theme is based on Will Stone's Plastic theme for VSCode.

Switching Themes

Switching Theme

ps1_dark_theme

ps1_dark_theme ps1_dark_theme

ps1_colorful_theme

ps1_colorful_theme ps1_colorful_theme

ps1_white_theme

ps1_white_theme ps1_white_theme

ps1_blue_theme

ps1_blue_theme ps1_blue_theme

ps1_green_theme

ps1_green_theme ps1_green_theme

ps1_yellow_theme

ps1_yellow_theme ps1_yellow_theme

ps1_red_theme

ps1_red_theme ps1_red_theme

VSCode Integrated Terminal

Here is a screenshot of the bash prompt in the VSCode's integrated terminal.

vscode_term.png

bash-prompt's People

Contributors

pkazmier avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.