{ "info": { "author": "Jiri Tyr", "author_email": "jiri.tyr@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Environment :: Console", "Intended Audience :: End Users/Desktop", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Operating System :: MacOS", "Operating System :: POSIX", "Programming Language :: Python", "Topic :: System :: Shells" ], "description": "Python Bullet Train (PBT)\n=========================\n\nHighly configurable prompt decoration for ZSH and Bash written in Python. It's\ninspired by the [Oh My ZSH](https://github.com/robbyrussell/oh-my-zsh) [Bullet\nTrain](https://github.com/caiogondim/bullet-train.zsh) theme.\n\n![Screenshot](https://raw.githubusercontent.com/jtyr/pbt/master/images/screenshot01.png \"Screenshot\")\n\nWorks well on Linux (Terminator, Konsole, Gnome Terminal) and Mac (Terminal,\niTerm). It has no other dependencies than Python (v2.x or v3.x) and its\nstandard libraries.\n\n\nTable of contents\n-----------------\n\n- [Installation](#installation)\n- [Usage](#usage)\n- [Configuration](#configuration)\n - [Colors](#colors)\n - [Formatting](#formatting)\n - [Train variables](#train-variables)\n - [Cars variables](#cars-variables)\n - [`Custom` car](#custom-car)\n - [`Dir` car](#dir-car)\n - [`ExecTime` car](#exectime-car)\n - [`Git` car](#git-car)\n - [`Hostname` car](#hostname-car)\n - [`Os` car](#os-car)\n - [`PyVirtEnv` car](#pyvirtenv-car)\n - [`Sign` car](#sign-car)\n - [`Status` car](#status-car)\n - [`Time` car](#time-car)\n- [Compilation](#compilation)\n- [Author](#author)\n- [License](#license)\n\n\nInstallation\n------------\n\nOn Arch Linux:\n\n```shell\nyaourt -S pbt\n# For ZSH\nPROMPT='$(pbt $?)'\n# For Bash\nPS1='$(pbt $?)'\n```\n\nor on Mac via [`brew`](https://brew.sh/):\n\n```\nbrew tap jtyr/repo\nbrew install pbt\n# For ZSH\nPROMPT='$(pbt $?)'\n# For Bash\nPS1='$(pbt $?)'\n```\n\nor via PyPi:\n\n```shell\npip install pbt\n# For ZSH\nPROMPT='$(pbt $?)'\n# For Bash\nPS1='$(pbt $?)'\n```\n\nor directly from GitHub:\n\n```shell\ngit clone https://github.com/jtyr/python-bullettrain.git ~/pbt\n# For ZSH\nPROMPT='$(~/pbt/pbt.py $?)'\n# For Bash\nPS1='$(~/pbt/pbt.py $?)'\n```\n\nIn order to display all colors correctly, the terminal should use 256 color\nscheme:\n\n```shell\nexport TERM=\"xterm-256color\"\n```\n\nIn order to display all characters of the prompt correctly, the shell should\nsupport UTF-8 and [Nerd](https://github.com/ryanoasis/nerd-fonts) (or at least\n[Powerline](https://github.com/ryanoasis/powerline-extra-symbols)) fonts should\nbe installed and set in the terminal application.\n\n\nUsage\n-----\n\n```shell\n### Test the Status car\nfalse\ntrue\n### Test the Dir car\ncd /\ncd /usr/share/doc/sudo\n# Display only last 3 elements of the path\nexport PBT_CAR_DIR_DEPTH=\"3\"\n# Display full path\nexport PBT_CAR_DIR_DEPTH=\"9999\"\n# Show only last element of the path\nunset PBT_CAR_DIR_DEPTH\ncd ~\n### Test Time car\n# Add the Time car into the train\nexport PBT_CARS=\"Status, Os, Time, Hostname, Dir, Sign\"\n# Set 12h format\nexport PBT_CAR_TIME_TIME_FORMAT=\"%I:%M:%S %p\"\n# Change background color of the all car\nexport PBT_CAR_TIME_BG=\"yellow\"\n# Change color of Date part\nexport PBT_CAR_TIME_DATE_FG=\"black\"\n# Reset the color of the Date part\nunset PBT_CAR_TIME_DATE_FG\n# Reset the background color of all Time car\nunset PBT_CAR_TIME_BG\n# Remove the Date part from the car\nexport PBT_CAR_TIME_FORMAT=\" {{ Time }} \"\n# Reset the format of the car\nunset PBT_CAR_TIME_FORMAT\n# Reset the original train\nunset PBT_CARS\n### Themes\n# Load theme\nsource /usr/share/pbt/themes/square_brackets_multiline\n```\n\n\nConfiguration\n-------------\n\nThe prompt (train) is assembled from several elements (cars). The look and\nbehavior of whole train as well as each car can be influenced by a set of\nenvironment variables. Majority of the \n\n\n### Colors\n\nThe value of all `_BG` and `_FG` variables defines the background and\nforeground color of the particular element. The value of the color can be\nspecified in 3 ways:\n\n#### Color name\n\nOnly a limited number of named colors is supported:\n\n- ![black](https://placehold.it/10/000000/000000?text=+) `black`\n- ![red](https://placehold.it/10/aa0000/000000?text=+) `red`\n- ![green](https://placehold.it/10/00aa00/000000?text=+) `green`\n- ![yellow](https://placehold.it/10/aa5500/000000?text=+) `yellow`\n- ![blue](https://placehold.it/10/0000aa/000000?text=+) `blue`\n- ![magenta](https://placehold.it/10/aa00aa/000000?text=+) `magenta`\n- ![cyan](https://placehold.it/10/00aaaa/000000?text=+) `cyan`\n- ![light_gray](https://placehold.it/10/aaaaaa/000000?text=+) `light_gray`\n- ![dark_gray](https://placehold.it/10/555555/000000?text=+) `dark_gray`\n- ![light_red](https://placehold.it/10/ff5555/000000?text=+) `light_red`\n- ![light_green](https://placehold.it/10/55ff55/000000?text=+) `light_green`\n- ![light_green](https://placehold.it/10/ffff55/000000?text=+) `light_yellow`\n- ![light_blue](https://placehold.it/10/5555ff/000000?text=+) `light_blue`\n- ![light_magenta](https://placehold.it/10/ff55ff/000000?text=+) `light_magenta`\n- ![light_cyan](https://placehold.it/10/55ffff/000000?text=+) `light_cyan`\n- ![white](https://placehold.it/10/ffffff/000000?text=+) `white`\n- `default` (default color of the terminal)\n\nExamples:\n\n```shell\n# Set the background color of the `Dir` car to red\nexport PBT_CAR_DIR_BG=\"red\"\n# Set the foreground color of the `Dir` car to white\nexport PBT_CAR_DIR_FG=\"white\"\n```\n\n#### Color number\n\nColor can also by expressed by a single number in the range from `0` to\n`255`. The color of each number in that range is visible in the 256-color\nlookup table on\n[Wikipedia](https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit). The named\ncolors described above are the first 16 numbers from the lookup table.\n\nExamples:\n\n```shell\n# Set the background color of the `Dir` car to red\nexport PBT_CAR_DIR_BG=\"1\"\n# Set the foreground color of the `Dir` car to white\nexport PBT_CAR_DIR_FG=\"15\"\n```\n\n#### RGB number\n\nArbitrary color can be expressed in the form of RGB triplet.\n\nExamples:\n\n```shell\n# Set the background color of the `Dir` car to red\nexport PBT_CAR_DIR_BG=\"170;0;0\"\n# Set the foreground color of the `Dir` car to white\nexport PBT_CAR_DIR_FG=\"255;255;255\"\n```\n\n\n### Formatting\n\nFormatting is done via `_FM` variables. The possible values are:\n\n- `bold`\n\n Makes the text bold. Not all font characters have variant for bold formatting.\n\n- `underline`\n\n Makes the text underlined.\n\n- `blink`\n\n Makes the text to blink.\n\n- `none`\n\n No formatting applied.\n\n Example:\n\n ```shell\n # Set the directory name to be bold\n export PBT_CAR_DIR_FM=\"bold\"\n ```\n\n\n### Train variables\n\n- `PBT_CARS=\"Status, Os, Hostname, Dir, Git, Sign\"`\n\n List of cars used in the train. The car name must be the same as the filename\n without the extension in the `pbt/cars/` directory.\n\n To add a new car into the train, the whole variable must be redefined. For\n example in order to add the `Time` car into the default set of cars between\n the `Os` and `Hostname` car, the variable should look like this:\n\n ```shell\n export PBT_CARS=\"Status, Os, Time, Hostname, Dir, Git, Sign\"\n ```\n\n- `PBT_RCARS=\"Time\"`\n\n The same like `PBT_CARS` but for the right hand side prompt.\n\n ```shell\n # Add the Custom car into the right hand site car to have the separator visible\n export PBT_RCARS=\"Custom, Time\"\n # Make the Custom car to be invisible (zero length text)\n export PBT_CAR_CUSTOM_BG=\"default\"\n export PBT_CAR_CUSTOM_FORMAT=\"\"\n # Show only time\n export PBT_CAR_TIME_FORMAT=\" {{ Time }} \"\n # Set the right hand side prompt (ZSH only)\n export RPROMPT='$(pbt -r)'\n ```\n\n- `PBT_SEPARATOR=\"\ue0b0\"`\n\n Character used to separate cars in the train.\n\n- `PBT_RSEPARATOR=\"\ue0b2\"`\n\n The same like `PBT_SEPARATOR` but for the righ hand side prompt.\n\n- `PBT_CAR_BG`\n\n Background color inherited by the top background color variable of every car.\n That allows to set the background color of all cars via single variable.\n\n- `PBT_CAR_FG`\n\n Foreground color inherited by the top foreground color variable of every car.\n That allows to set the foreground color of all cars via single variable.\n\n- `PBT_CAR_FM`\n\n Formatting inherited by the top formatting variable of every car. That allows\n to set the formatting of all cars via single variable.\n\n- `PBT_BEGINNING_BG=\"default\"`\n\n Background color of the text shown at the beginning of the train.\n\n- `PBT_BEGINNING_FG=\"default\"`\n\n Foreground color of the text shown at the beginning of the train.\n\n- `PBT_BEGINNING_FM=\"none\"`\n\n Formatting of the text shown at the beginning of the train.\n\n- `PBT_BEGINNING_TEXT=\"\"`\n\n Text shown at the beginning of the train.\n\n- `PBT_SHELL`\n\n Indicates which shell is used. The value can be either `zsh` or `bash`. By\n default, the value is extracted from the `$SHELL` environment variable. Set\n this variable to `bash` if your default shell is ZSH but you want to test PBT\n in Bash:\n\n ```shell\n export PBT_SHELL=\"bash\"\n bash\n ```\n\n- `PBT_DEBUG=\"0\"`\n\n Shows more verbose output if some of the car modules cannot be imported.\n\n\n### Cars variables\n\n#### `Custom` car\n\nThe main purpose of this car is to provide the possibility to create car with\ncustom text.\n\n- `PBT_CAR_CUSTOM_BG=\"yellow\"`\n\n Background color of the car.\n\n- `PBT_CAR_CUSTOM_FG=\"default\"`\n\n Foreground color of the car.\n\n- `PBT_CAR_CUSTOM_FM=\"none\"`\n\n Formatting of the car.\n\n- `PBT_CAR_CUSTOM_FORMAT=\" {{ Text }} \"`\n\n Format of the car.\n\n- `PBT_CAR_CUSTOM_TEXT_BG`\n\n Background color of the `{{ Text }}` element.\n\n- `PBT_CAR_CUSTOM_TEXT_FG`\n\n Foreground color of the `{{ Text }}` element.\n\n- `PBT_CAR_CUSTOM_TEXT_FM`\n\n Formatting of the `{{ Text }}` element.\n\n- `PBT_CAR_CUSTOM_TEXT_TEXT=\"?\"`\n\n Text content of the `{{ Text }}` element.\n\n- `PBT_CAR_CUSTOM_DISPLAY=\"1\"`\n\n Whether to display this car if it's in the list of cars (`PBT_CARS`).\n\n- `PBT_CAR_CUSTOM_WRAP=\"0\"`\n\n Whether to wrap the prompt line in front of this car.\n\n- `PBT_CAR_CUSTOM_SEP`\n\n Custom separator string for this car.\n\n\n#### `Dir` car\n\nCar that displays current directory name.\n\n- `PBT_CAR_DIR_BG=\"blue\"`\n\n Background color of the car.\n\n- `PBT_CAR_DIR_FG=\"light_gray\"`\n\n Foreground color of the car.\n\n- `PBT_CAR_DIR_FM=\"none\"`\n\n Formatting of the car.\n\n- `PBT_CAR_DIR_FORMAT=\" {{ Dir }} \"`\n\n Format of the car.\n\n- `PBT_CAR_DIR_DIR_BG`\n\n Background color of the `{{ Dir }}` element.\n\n- `PBT_CAR_DIR_DIR_FG`\n\n Foreground color of the `{{ Dir }}` element.\n\n- `PBT_CAR_DIR_DIR_FM`\n\n Formatting of the `{{ Dir }}` element.\n\n- `PBT_CAR_DIR_DIR_TEXT`\n\n Text content of the `{{ Dir }}` element. The directory name.\n\n- `PBT_CAR_DIR_DIRSEP`\n\n OS-default character used to separate directories.\n\n- `PBT_CAR_DIR_HOMESIGN=\"~\"`\n\n Character which represents the user's home directory. If set to empty\n string, full home directory path is used instead.\n\n- `PBT_CAR_DIR_DEPTH=\"1\"`\n\n Number of directories to show.\n\n- `PBT_CAR_DIR_DISPLAY=\"1\"`\n\n Whether to display this car if it's in the list of cars (`PBT_CARS`).\n\n- `PBT_CAR_DIR_WRAP=\"0\"`\n\n Whether to wrap the prompt line in front of this car.\n\n- `PBT_CAR_DIR_SEP`\n\n Custom separator string for this car.\n\n\n#### `ExecTime` car\n\nCar that displays how long each shell command run.\n\n- `PBT_CAR_EXECTIME_BG=\"light_gray\"`\n\n Background color of the car.\n\n- `PBT_CAR_EXECTIME_FG=\"black\"`\n\n Foreground color of the car.\n\n- `PBT_CAR_EXECTIME_FM=\"none\"`\n\n Formatting of the car.\n\n- `PBT_CAR_EXECTIME_FORMAT=\" {{ Time }} \"`\n\n Format of the car.\n\n- `PBT_CAR_EXECTIME_TIME_BG`\n\n Background color of the `{{ Time }}` element.\n\n- `PBT_CAR_EXECTIME_TIME_FG`\n\n Foreground color of the `{{ Time }}` element.\n\n- `PBT_CAR_EXECTIME_TIME_FM`\n\n Formatting of the `{{ Time }}` element.\n\n- `PBT_CAR_EXECTIME_TIME_TEXT`\n\n Text content of the `{{ Time }}` element. The execution time.\n\n- `PBT_CAR_EXECTIME_DIRSEP`\n\n OS-default character used to separate directories.\n\n- `PBT_CAR_EXECTIME_PRECISION=\"0\"`\n\n Sub-second precision to show.\n\n- `PBT_CAR_EXECTIME_SECS`\n\n The number of seconds the command run in shell. This variable is defined in\n the source file as shown bellow.\n\n- `PBT_CAR_EXECTIME_BELL=\"0\"`\n\n Sound console bell if the executed command exceeds specified number of\n seconds. Value set to `0` disables the bell (default).\n\n- `PBT_CAR_EXECTIME_DISPLAY=\"1\"`\n\n Whether to display this car if it's in the list of cars (`PBT_CARS`).\n\n- `PBT_CAR_EXECTIME_WRAP=\"0\"`\n\n Whether to wrap the prompt line in front of this car.\n\n- `PBT_CAR_EXECTIME_SEP`\n\n Custom separator string for this car.\n\nIn order to allow this car to calculate the execution time, the following must\nbe loaded in the shell:\n\n```shell\n# For ZSH\nsource /usr/share/pbt/sources/ExecTime.zsh\n# For Bash\nsource /usr/share/pbt/sources/ExecTime.bash\n```\n\n\n#### `Git` car\n\nCar that displays information about a local Git repository. This car is\ndisplayed only if the current directory is a Git repository.\n\n- `PBT_CAR_GIT_BG=\"light_gray\"`\n\n Background color of the car.\n\n- `PBT_CAR_GIT_FG=\"black\"`\n\n Foreground color of the car.\n\n- `PBT_CAR_GIT_FM=\"none\"`\n\n Formatting of the car.\n\n- `PBT_CAR_GIT_FORMAT=\" {{ Icon }} {{ Head }} {{ Status }}{{ Ahead }}{{ Behind }} \"`\n\n Format of the car.\n\n- `PBT_CAR_GIT_ICON_BG`\n\n Background color of the `{{ Icon }}` element.\n\n- `PBT_CAR_GIT_ICON_FG`\n\n Foreground color of the `{{ Icon }}` element.\n\n- `PBT_CAR_GIT_ICON_FM`\n\n Formatting of the `{{ Icon }}` element.\n\n- `PBT_CAR_GIT_ICON_TEXT=\"\ue0a0\"`\n\n Text content of the `{{ Icon }}` element.\n\n- `PBT_CAR_GIT_HEAD_BG`\n\n Background color of the `{{ Head }}` element.\n\n- `PBT_CAR_GIT_HEAD_FG`\n\n Foreground color of the `{{ Head }}` element.\n\n- `PBT_CAR_GIT_HEAD_FM`\n\n Formatting of the `{{ Head }}` element.\n\n- `PBT_CAR_GIT_HEAD_TEXT`\n\n Text content of the `{{ Head }}` element. The branch or tag name or the\n commit ID.\n\n- `PBT_CAR_GIT_STATUS_BG`\n\n Background color of the `{{ Status }}` element.\n\n- `PBT_CAR_GIT_STATUS_FG`\n\n Foreground color of the `{{ Status }}` element.\n\n- `PBT_CAR_GIT_STATUS_FM`\n\n Formatting of the `{{ Status }}` element.\n\n- `PBT_CAR_GIT_STATUS_FORMAT`\n\n Format of the `{{ Status }}` element. The content is either `{{ Dirty }}` or\n `{{ Clean }}` depending on the state of the local Git repository.\n\n- `PBT_CAR_GIT_DIRTY_BG`\n\n Background color of the `{{ Dirty }}` element.\n\n- `PBT_CAR_GIT_DIRTY_FG=\"red\"`\n\n Foreground color of the `{{ Dirty }}` element.\n\n- `PBT_CAR_GIT_DIRTY_FM`\n\n Formatting of the `{{ Dirty }}` element.\n\n- `PBT_CAR_GIT_DIRTY_TEXT=\"\u2718\"`\n\n Text content of the `{{ Dirty }}` element.\n\n- `PBT_CAR_GIT_CLEAN_BG`\n\n Background color of the `{{ Clean }}` element.\n\n- `PBT_CAR_GIT_CLEAN_FG=\"green\"`\n\n Foreground color of the `{{ Clean }}` element.\n\n- `PBT_CAR_GIT_CLEAN_FM`\n\n Formatting of the `{{ Clean }}` element.\n\n- `PBT_CAR_GIT_CLEAN_TEXT=\"\u2714\"`\n\n Text content of the `{{ Clean }}` element.\n\n- `PBT_CAR_GIT_AHEAD_BG`\n\n Background color of the `{{ Ahead }}` element.\n\n- `PBT_CAR_GIT_AHEAD_FG`\n\n Foreground color of the `{{ Ahead }}` element.\n\n- `PBT_CAR_GIT_AHEAD_FM`\n\n Formatting of the `{{ Ahead }}` element.\n\n- `PBT_CAR_GIT_AHEAD_TEXT=\" \u2b06\"`\n\n Text content of the `{{ Ahead }}` element.\n\n- `PBT_CAR_GIT_BEHIND_BG`\n\n Background color of the `{{ Behind }}` element.\n\n- `PBT_CAR_GIT_BEHIND_FG`\n\n Foreground color of the `{{ Behind }}` element.\n\n- `PBT_CAR_GIT_BEHIND_FM`\n\n Formatting of the `{{ Behind }}` element.\n\n- `PBT_CAR_GIT_BEHIND_TEXT=\" \u2b07\"`\n\n Text content of the `{{ Behind }}` element.\n\n- `PBT_CAR_GIT_DISPLAY`\n\n Whether to display this car if it's in the list of cars (`PBT_CARS`).\n\n- `PBT_CAR_GIT_WRAP=\"0\"`\n\n Whether to wrap the prompt line in front of this car.\n\n- `PBT_CAR_GIT_SEP`\n\n Custom separator string for this car.\n\n\n#### `Hostname` car\n\nCar that displays username of the currently logged user and the hostname of the\nlocal machine.\n\n- `PBT_CAR_HOSTNAME_BG=\"dark_gray\"`\n\n Background color of the car.\n\n- `PBT_CAR_HOSTNAME_FG=\"252\"`\n\n Foreground color of the car.\n\n- `PBT_CAR_HOSTNAME_FM=\"none\"`\n\n Formatting of the car.\n\n- `PBT_CAR_HOSTNAME_FORMAT=\" {{ UserHost }} \"`\n\n Format of the car.\n\n- `PBT_CAR_HOSTNAME_USERHOST_BG`\n\n Background color of the `{{ UserHost }}` element.\n\n- `PBT_CAR_HOSTNAME_USERHOST_FG`\n\n Foreground color of the `{{ UserHost }}` element.\n\n- `PBT_CAR_HOSTNAME_USERHOST_FM`\n\n Formatting of the `{{ UserHost }}` element.\n\n- `PBT_CAR_HOSTNAME_USERHOST_FORMAT=\"{{ User }}@{{ Host }}\"`\n\n Format of the `{{ UserHost }}` element.\n\n- `PBT_CAR_HOSTNAME_USER_BG`\n\n Background color of the `{{ User }}` element.\n\n- `PBT_CAR_HOSTNAME_USER_FG`\n\n Foreground color of the `{{ User }}` element.\n\n- `PBT_CAR_HOSTNAME_USER_FM`\n\n Formatting of the `{{ User }}` element.\n\n- `PBT_CAR_HOSTNAME_USER_TEXT`\n\n Text content of the `{{ User }}` element. The user name.\n\n- `PBT_CAR_HOSTNAME_HOST_BG`\n\n Background color of the `{{ Host }}` element.\n\n- `PBT_CAR_HOSTNAME_HOST_FG`\n\n Foreground color of the `{{ Host }}` element.\n\n- `PBT_CAR_HOSTNAME_HOST_FM`\n\n Formatting of the `{{ Host }}` element.\n\n- `PBT_CAR_HOSTNAME_HOST_TEXT`\n\n Text content of the `{{ Host }}` element. The host name.\n\n- `PBT_CAR_HOSTNAME_DISPLAY=\"1\"`\n\n Whether to display this car if it's in the list of cars (`PBT_CARS`).\n\n- `PBT_CAR_HOSTNAME_WRAP=\"0\"`\n\n Whether to wrap the prompt line in front of this car.\n\n- `PBT_CAR_HOSTNAME_SEP`\n\n Custom separator string for this car.\n\n\n#### `Os` car\n\nCar that displays icon of the operating system.\n\n- `PBT_CAR_OS_BG=\"235\"`\n\n Background color of the car.\n\n- `PBT_CAR_OS_FG=\"white\"`\n\n Foreground color of the car.\n\n- `PBT_CAR_OS_FM=\"none\"`\n\n Formatting of the car.\n\n- `PBT_CAR_OS_FORMAT=\" {{ Symbol }} \"`\n\n Format of the car.\n\n- `PBT_CAR_OS_SYMBOL_BG`\n\n Background color of the `{{ Symbol }}` element.\n\n- `PBT_CAR_OS_SYMBOL_FG`\n\n Foreground color of the `{{ Symbol }}` element.\n\n- `PBT_CAR_OS_SYMBOL_FM`\n\n Formatting of the `{{ Symbol }}` element.\n\n- `PBT_CAR_OS_SYMBOL_TEXT`\n\n Text content of the `{{ Symbol }}` element.\n\n- `PBT_CAR_OS_NAME`\n\n The name of the symbol to display. Default value is selected by the system\n the shell runs at. Possible names and their icons are:\n\n - `arch` \uf300\n - `centos` \uf301\n - `coreos` \uf30f\n - `darwin` \ue711\n - `debian` \uf302\n - `docker` \ue7b0\n - `elementary` \uf311\n - `fedora` \uf303\n - `freebsd` \uf30e\n - `gentoo` \uf310\n - `linux` \ue712\n - `linuxmint` \uf304\n - `mageia` \uf306\n - `mandriva` \uf307\n - `opensuse` \uf308\n - `raspbian` \ue722\n - `redhat` \uf309\n - `sabayon` \uf313\n - `slackware` \uf30a\n - `ubuntu` \uf30c\n - `windows` \ue70f\n\n Example:\n\n ```shell\n export PBT_CAR_OS_NAME=\"arch\"\n ```\n\n- `PBT_CAR_OS_DISPLAY=\"1\"`\n\n Whether to display this car if it's in the list of cars (`PBT_CARS`).\n\n- `PBT_CAR_OS_WRAP=\"0\"`\n\n Whether to wrap the prompt line in front of this car.\n\n- `PBT_CAR_OS_SEP`\n\n Custom separator string for this car.\n\n\n#### `PyVirtEnv` car\n\nCar that displays Python Virtual Environment name. This car is displayed only\nif the Python Virtual Environment is activated. The activation script usually\nprepends the shell prompt by the Virtual Environment name by default. In order\nto disable it, the following environment variable must be set:\n\n```shell\nexport VIRTUAL_ENV_DISABLE_PROMPT=\"1\"\n```\n\nVariables used by the car:\n\n- `PBT_CAR_PYVIRTENV_BG=\"222\"`\n\n Background color of the car.\n\n- `PBT_CAR_PYVIRTENV_FG=\"black\"`\n\n Foreground color of the car.\n\n- `PBT_CAR_PYVIRTENV_FM=\"none\"`\n\n Formatting of the car.\n\n- `PBT_CAR_PYVIRTENV_FORMAT=\" {{ Icon }} {{ Name }} \"`\n\n Format of the car.\n\n- `PBT_CAR_PYVIRTENV_ICON_BG`\n\n Background color of the `{{ Icon }}` element.\n\n- `PBT_CAR_PYVIRTENV_ICON_FG`\n\n Foreground color of the `{{ Icon }}` element.\n\n- `PBT_CAR_PYVIRTENV_ICON_FM`\n\n Formatting of the `{{ Icon }}` element.\n\n- `PBT_CAR_PYVIRTENV_ICON_TEXT`\n\n Text content of the `{{ Icon }}` element.\n\n- `PBT_CAR_PYVIRTENV_NAME_BG`\n\n Background color of the `{{ Name }}` element.\n\n- `PBT_CAR_PYVIRTENV_NAME_FG=\"33\"`\n\n Foreground color of the `{{ NAME }}` element.\n\n- `PBT_CAR_PYVIRTENV_NAME_FM`\n\n Formatting of the `{{ Name }}` element.\n\n- `PBT_CAR_PYVIRTENV_NAME_TEXT`\n\n The name of the Python Virtual Environment deducted from the `VIRTUAL_ENV`\n environment variable.\n\n- `PBT_CAR_PYVIRTENV_DISPLAY`\n\n Whether to display this car if it's in the list of cars (`PBT_CARS`).\n\n- `PBT_CAR_PYVIRTENV_WRAP=\"0\"`\n\n Whether to wrap the prompt line in front of this car.\n\n- `PBT_CAR_PYVIRTENV_SEP`\n\n Custom separator string for this car.\n\n\n#### `Sign` car\n\nCar that displays prompt character for the admin and user at the end of the\ntrain.\n\n- `PBT_CAR_SIGN_BG=\"default\"`\n\n Background color of the car.\n\n- `PBT_CAR_SIGN_FG=\"default\"`\n\n Foreground color of the car.\n\n- `PBT_CAR_SIGN_FM=\"none\"`\n\n Formatting of the car.\n\n- `PBT_CAR_SIGN_FORMAT=\" {{ Symbol }} \"`\n\n Format of the car.\n\n- `PBT_CAR_SIGN_SYMBOL_BG`\n\n Background color of the `{{ Symbol }}` element.\n\n- `PBT_CAR_SIGN_SYMBOL_FG`\n\n Foreground color of the `{{ Symbol }}` element.\n\n- `PBT_CAR_SIGN_SYMBOL_FM=\"bold\"`\n\n Formatting of the `{{ Symbol }}` element.\n\n- `PBT_CAR_SIGN_SYMBOL_FORMAT`\n\n Format of the `{{ Symbol }}` element. The format is either `{{ Admin }}` if\n the UID is 0 or `{{ User }}` if the UID is not 0.\n\n- `PBT_CAR_SIGN_ADMIN_BG`\n\n Background color of the `{{ Admin }}` element.\n\n- `PBT_CAR_SIGN_ADMIN_FG=\"red\"`\n\n Foreground color of the `{{ Admin }}` element.\n\n- `PBT_CAR_SIGN_ADMIN_FM`\n\n Formatting of the `{{ Admin }}` element.\n\n- `PBT_CAR_SIGN_ADMIN_TEXT=\"#\"`\n\n Text content of the `{{ Admin }}` element.\n\n- `PBT_CAR_SIGN_USER_BG`\n\n Background color of the `{{ User }}` element.\n\n- `PBT_CAR_SIGN_USER_FG=\"light_green\"`\n\n Foreground color of the `{{ User }}` element.\n\n- `PBT_CAR_SIGN_USER_FM`\n\n Formatting of the `{{ User }}` element.\n\n- `PBT_CAR_SIGN_USER_TEXT=\"$\"`\n\n Text content of the `{{ User }}` element. The user name.\n\n- `PBT_CAR_SIGN_DISPLAY=\"1\"`\n\n Whether to display this car if it's in the list of cars (`PBT_CARS`).\n\n- `PBT_CAR_SIGN_WRAP=\"0\"`\n\n Whether to wrap the prompt line in front of this car.\n\n- `PBT_CAR_SIGN_SEP`\n\n Custom separator string for this car.\n\n\n#### `Status` car\n\nCar that visualizes return code of every command. By default, this car is\ndisplayed only when the return code is non-zero. If you want to display it even\nwhen if the return code is zere, set the following variable:\n\n```shell\nexport PBT_CAR_STATUS_DISPLAY=\"1\"\n```\n\nVariables used by the car:\n\n- `PBT_CAR_STATUS_BG`\n\n Background color of the car. It's either `PBT_CAR_STATUS_OK_BG` if the last\n command returned `0` return code otherwise the `PBT_CAR_STATUS_ERROR_BG` is\n used.\n\n- `PBT_CAR_STATUS_FG=\"default\"`\n\n Foreground color of the car. It's either `PBT_CAR_STATUS_OK_FG` if the last\n command returned `0` return code otherwise the `PBT_CAR_STATUS_ERROR_FG` is\n used.\n\n- `PBT_CAR_STATUS_FM=\"none\"`\n\n Formatting of the car. It's either `PBT_CAR_STATUS_OK_FM` if the last command\n returned `0` return code otherwise the `PBT_CAR_STATUS_ERROR_FM` is used.\n\n- `PBT_CAR_STATUS_FORMAT=\" {{ Symbol }} \"`\n\n Format of the car. This can be changed to contain also the value of the\n return code:\n\n ```shell\n export PBT_CAR_STATUS_FORMAT=\" {{ Symbol }} {{ Code }} \"\n ```\n\n- `PBT_CAR_STATUS_SYMBOL_BG`\n\n Background color of the `{{ Symbol }}` element.\n\n- `PBT_CAR_STATUS_SYMBOL_FG`\n\n Foreground color of the `{{ Symbol }}` element.\n\n- `PBT_CAR_STATUS_SYMBOL_FM=\"bold\"`\n\n Formatting of the `{{ Symbol }}` element.\n\n- `PBT_CAR_STATUS_SYMBOL_FORMAT`\n\n Format of the `{{ Symbol }}` element. The format is either `{{ Error }}` if\n the last command returned non zero return code otherwise `{{ User }}` is\n used.\n\n- `PBT_CAR_STATUS_CODE_BG=\"red\"`\n\n Background color of the `{{ Code }}` element.\n\n- `PBT_CAR_STATUS_CODE_FG=\"light_gray\"`\n\n Foreground color of the `{{ Code }}` element.\n\n- `PBT_CAR_STATUS_CODE_FM=\"none\"`\n\n Formatting of the `{{ Code }}` element.\n\n- `PBT_CAR_STATUS_CODE_TEXT`\n\n Text content of the `{{ Code }}` element. The return code.\n\n- `PBT_CAR_STATUS_ERROR_BG=\"red\"`\n\n Background color of the `{{ Error }}` element.\n\n- `PBT_CAR_STATUS_ERROR_FG=\"light_gray\"`\n\n Foreground color of the `{{ Error }}` element.\n\n- `PBT_CAR_STATUS_ERROR_FM=\"none\"`\n\n Formatting of the `{{ Error }}` element.\n\n- `PBT_CAR_STATUS_ERROR_TEXT=\"\u2718\"`\n\n Text content of the `{{ Error }}` element.\n\n- `PBT_CAR_STATUS_OK_BG=\"green\"`\n\n Background color of the `{{ Ok }}` element.\n\n- `PBT_CAR_STATUS_OK_FG=\"light_gray\"`\n\n Foreground color of the `{{ Ok }}` element.\n\n- `PBT_CAR_STATUS_OK_FM=\"none\"`\n\n Formatting of the `{{ Ok }}` element.\n\n- `PBT_CAR_STATUS_OK_TEXT=\"\u2714\"`\n\n Text content of the `{{ Ok }}` element.\n\n- `PBT_CAR_STATUS_DISPLAY`\n\n Whether to display this car if it's in the list of cars (`PBT_CARS`).\n\n- `PBT_CAR_STATUS_WRAP=\"0\"`\n\n Whether to wrap the prompt line in front of this car.\n\n- `PBT_CAR_STATUS_SEP`\n\n Custom separator string for this car.\n\n\n#### `Time` car\n\nCar that displays current date and time.\n\n- `PBT_CAR_TIME_BG=\"light_blue\"`\n\n Background color of the car.\n\n- `PBT_CAR_TIME_FG=\"light_gray\"`\n\n Foreground color of the car.\n\n- `PBT_CAR_TIME_FM=\"none\"`\n\n Formatting of the car.\n\n- `PBT_CAR_TIME_FORMAT=\" {{ DateTime }} \"`\n\n Format of the car.\n\n- `PBT_CAR_TIME_DATETIME_BG`\n\n Background color of the `{{ DateTime }}` element.\n\n- `PBT_CAR_TIME_DATETIME_FG`\n\n Foreground color of the `{{ DateTime }}` element.\n\n- `PBT_CAR_TIME_DATETIME_FM`\n\n Formatting of the `{{ DateTime }}` element.\n\n- `PBT_CAR_TIME_DATETIME_FORMAT=\"{{ Date }} {{ Time }}\"`\n\n Format of the `{{ DateTime }}` element.\n\n- `PBT_CAR_TIME_DATE_BG`\n\n Background color of the `{{ Date }}` element.\n\n- `PBT_CAR_TIME_DATE_FG`\n\n Foreground color of the `{{ Date }}` element.\n\n- `PBT_CAR_TIME_DATE_FM`\n\n Formatting of the `{{ Date }}` element.\n\n- `PBT_CAR_TIME_DATE_FORMAT=\"%a %d %b\"`\n\n Format of the `{{ Date }}` element. The format is using sequences known from\n the `date` command.\n\n- `PBT_CAR_TIME_TIME_BG`\n\n Background color of the `{{ Host }}` element.\n\n- `PBT_CAR_TIME_TIME_FG=\"light_yellow\"`\n\n Foreground color of the `{{ Host }}` element.\n\n- `PBT_CAR_TIME_TIME_FM`\n\n Formatting of the `{{ Host }}` element.\n\n- `PBT_CAR_TIME_TIME_FORMAT=\"%H:%M:%S\"`\n\n Text content of the `{{ Host }}` element. The format is using sequences known\n from the `date` command.\n\n- `PBT_CAR_TIME_DISPLAY=\"1\"`\n\n Whether to display this car if it's in the list of cars (`PBT_CARS`).\n\n- `PBT_CAR_TIME_WRAP=\"0\"`\n\n Whether to wrap the prompt line in front of this car.\n\n- `PBT_CAR_TIME_SEP`\n\n Custom separator string for this car.\n\n\nCompilation\n-----------\n\nIt's also possible to compile the script into a binary executable file which\nshould make it run about 10-20% faster. For that we will need a tool called\n[`freeze`](https://wiki.python.org/moin/Freeze) which we can find in the Python\nsource tree:\n\n```shell\ngit clone https://github.com/python/cpython.git -b \"v$(python --version 2>&1 | grep -Po '.* \\K\\d.*')\" --depth 1 /tmp/cpython\n```\n\nThen we can compile it:\n\n```shell\npython /tmp/cpython/Tools/freeze/freeze.py pbt.py\nmake\n```\n\nThat will create a binary file `pbt` which can be used in the `PROMPT`\nenvironment variable instead of the Python script as shown above.\n\nThe compilation process sometimes incorrectly recognizes where Python's libraries\nare exactly installed. Then we can get errors like this:\n\n```\nError: needed directory /usr/lib/python3.6/config-3.6m not found\n```\n\nand\n\n```\ngcc: error: /usr/lib/python3.6/config-3.6m/libpython3.6m.so: No such file or directory\n```\n\nThat can be solved by symlinks:\n\n```shell\nln -s /usr/lib/python3.6/config-3.6m{-x86_64-linux-gnu,}\n```\n\nand\n\n```shell\nln -s /usr/lib/{libpython3.6m.so,python3.6/config-3.6m/}\n```\n\n\nAuthor\n------\n\nJiri Tyr\n\n\nLicense\n-------\n\nMIT", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/jtyr/pbt", "keywords": "shell bash zsh bullet train prompt", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "pbt", "package_url": "https://pypi.org/project/pbt/", "platform": "", "project_url": "https://pypi.org/project/pbt/", "project_urls": { "Homepage": "http://github.com/jtyr/pbt" }, "release_url": "https://pypi.org/project/pbt/1.1.0/", "requires_dist": null, "requires_python": "", "summary": "Prompt decoration for ZSH and Bash written in Python", "version": "1.1.0" }, "last_serial": 3269174, "releases": { "1.1.0": [ { "comment_text": "", "digests": { "md5": "c1a479bf71622f2a06e6d1305a82d681", "sha256": "df438fe2c81d443129a687f48938d20e6a83d11b535c621aee82ba96d4122315" }, "downloads": -1, "filename": "pbt-1.1.0.tar.gz", "has_sig": false, "md5_digest": "c1a479bf71622f2a06e6d1305a82d681", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 21047, "upload_time": "2017-10-22T02:51:18", "url": "https://files.pythonhosted.org/packages/f3/50/440660a6684fcd392a870b36c909bbf0d752456ef2a84712e17e073cb445/pbt-1.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "c1a479bf71622f2a06e6d1305a82d681", "sha256": "df438fe2c81d443129a687f48938d20e6a83d11b535c621aee82ba96d4122315" }, "downloads": -1, "filename": "pbt-1.1.0.tar.gz", "has_sig": false, "md5_digest": "c1a479bf71622f2a06e6d1305a82d681", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 21047, "upload_time": "2017-10-22T02:51:18", "url": "https://files.pythonhosted.org/packages/f3/50/440660a6684fcd392a870b36c909bbf0d752456ef2a84712e17e073cb445/pbt-1.1.0.tar.gz" } ] }