Skip to main content

This package allows you to easily customize your PS1 bash prompt

Project description

github-issues github-languages-code-size github-stars github-forks

pypi-v pypi-status pypi-l pypi-dm pypi-pyversions pypi-implementation

TOC

PS1

This program is meant to take the pain out of generating nice bash PS1 prompts.

Pull requests welcome! And if you build an awesome theme, drop something in the examples folder!

Installation

To install this package from pypy run the following command.


pip3 install ps1

License

See: LICENSE

Quickstart

Here's an example to get you up and running!


pip3 install ps1

export PS1="$(ps1 template -t parrot)"

PS1 Command

subcommand listcolors

usage: ps1 listcolors [-h] [--filter [FILTER [FILTER ...]]]

optional arguments:
  -h, --help            show this help message and exit
  --filter [FILTER [FILTER ...]], -f [FILTER [FILTER ...]]
                        Filter color values

subcommand template

usage: ps1 template [-h] [-t TEMPLATE_NAME] [-l]

optional arguments:
  -h, --help            show this help message and exit
  -t TEMPLATE_NAME, --template_name TEMPLATE_NAME
                        Template Name
  -l, --list            List Templates

subcommand custom

usage: ps1 custom [-h] [--add_custom [ADD_CUSTOM [ADD_CUSTOM ...]]] [--add_exit_code [ADD_EXIT_CODE [ADD_EXIT_CODE ...]]]
                        [--add_git_branch [ADD_GIT_BRANCH [ADD_GIT_BRANCH ...]]] [--add_newline [ADD_NEWLINE [ADD_NEWLINE ...]]]
                        [--add_user_host [ADD_USER_HOST [ADD_USER_HOST ...]]]
                        [--add_working_directory [ADD_WORKING_DIRECTORY [ADD_WORKING_DIRECTORY ...]]]
                        [--set_ends [SET_ENDS [SET_ENDS ...]]] [--set_fancy_lines [SET_FANCY_LINES [SET_FANCY_LINES ...]]]
                        [--set_no_color [SET_NO_COLOR [SET_NO_COLOR ...]]]
                        [--set_prompt_color [SET_PROMPT_COLOR [SET_PROMPT_COLOR ...]]]
                        [--set_section_color [SET_SECTION_COLOR [SET_SECTION_COLOR ...]]]
                        [--set_section_delim [SET_SECTION_DELIM [SET_SECTION_DELIM ...]]]

optional arguments:
  -h, --help            show this help message and exit
  --add_custom [ADD_CUSTOM [ADD_CUSTOM ...]]
                        ARGS:value,color
                        Add custom section value/color.
  --add_exit_code [ADD_EXIT_CODE [ADD_EXIT_CODE ...]]
                        ARGS:ok_txt,err_txt,ok_color,err_color
                        Add Exit code indicator to prompt.
  --add_git_branch [ADD_GIT_BRANCH [ADD_GIT_BRANCH ...]]
                        ARGS:color
                        Add git branch to prompt.
  --add_newline [ADD_NEWLINE [ADD_NEWLINE ...]]
                        ARGS:None
                        Insert newline.
  --add_user_host [ADD_USER_HOST [ADD_USER_HOST ...]]
                        ARGS:user_color,at_sym_color,host_color
                        Add User/Host to prompt.
                        ::
                            [user@hostname]-[section2]
                                  ^ add this
  --add_working_directory [ADD_WORKING_DIRECTORY [ADD_WORKING_DIRECTORY ...]]
                        ARGS:color
                        Add Working directory to prompt.
                        ::
                            [user@hostame]─[~/path/i/am/in]
                                             ^ add this
  --set_ends [SET_ENDS [SET_ENDS ...]]
                        ARGS:start,end
                        Set Section start / end values.
                        ::
                            {}
                            {section1}-{section2}
                        
                            []
                            [section1]-[section2]
                        
                            ❰❱
                            ❰section1❱-❰section2❱
  --set_fancy_lines [SET_FANCY_LINES [SET_FANCY_LINES ...]]
                        ARGS:value
                        Set fancy line breaks like the following
                        ::
                            ┌───
                            ├───
                            └──╼
  --set_no_color [SET_NO_COLOR [SET_NO_COLOR ...]]
                        ARGS:value
                        Set terminal to no color.
  --set_prompt_color [SET_PROMPT_COLOR [SET_PROMPT_COLOR ...]]
                        ARGS:color
                        Set prompt color.
                        ::
                            i.e. $ or # depending on user
  --set_section_color [SET_SECTION_COLOR [SET_SECTION_COLOR ...]]
                        ARGS:color
                        Set default section color.
  --set_section_delim [SET_SECTION_DELIM [SET_SECTION_DELIM ...]]
                        ARGS:delim
                        Set section separator.
                        ::
                            i.e. [section1]-[section2]
                                           ^ separator

subcommand examples

usage: ps1 examples [-h]

optional arguments:
  -h, --help  show this help message and exit

Examples

entropy.sh

entropy.sh

parrot.sh

parrot.sh

skulls.sh

skulls.sh

purplegoblin.sh

purplegoblin.sh

plainjane.sh

plainjane.sh

greenguy.sh

greenguy.sh

filecount.sh

filecount.sh

magenta.sh

magenta.sh

powderpuff.sh

powderpuff.sh

fire_ice.sh

fire_ice.sh

Other Docs

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ps1-0.0.5.tar.gz (10.9 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page