Skip to main content

The bar theme for xonsh shell.

Project description

The bar theme for xonsh shell.

[Demo]

If you like the idea of bar theme click ⭐ on the repo and stay tuned.

Install

xpip install -U xontrib-prompt-bar
echo 'xontrib load prompt_bar' >> ~/.xonshrc
# Reload xonsh

Use cases

Fields and colors

The bar theme supports xonsh default fields and colors notation.

To customize the appearance of the fields on the bar you can use wrappers:

  • {hostname} - no wrapper
  • {hostname#section} - add backlight for the text
  • {hostname#accent} - bold font and lighter color
  • Also you can create your own fields and wrapper. See the section below.

Add custom fields and wrappers

How to add two new fields called my_left_custom and my_left_custom and one new wrapper called brackets.

$PROMPT_FIELDS['my_left_custom'] = 'Hello left!'
$PROMPT_FIELDS['my_right_custom'] = lambda: '>'*3 + ' {YELLOW}Hello right!'

$XONTRIB_PROMPT_BAR_WRAPPERS = {
    'brackets': lambda v: f'[{v}]'
}

$XONTRIB_PROMPT_BAR_LEFT = '{hostname}{user}{pwd#accent}{my_left_custom#brackets}'
$XONTRIB_PROMPT_BAR_RIGHT = '{my_right_custom#section}{env_name#section}{gitstatus_noc#section}{date_time_tz}'

xontrib load prompt_bar

Result:

[Demo custom fields]

Future

It will be great if it will be reimplemented as shown in awesome example from Jonathan Slenders. Xonsh guru help wanted :)

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

xontrib-prompt-bar-0.1.0.tar.gz (3.5 kB view hashes)

Uploaded Source

Built Distribution

xontrib_prompt_bar-0.1.0-py3-none-any.whl (4.4 kB view hashes)

Uploaded Python 3

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