santagada / xontrib-powerline

Powerline for Xonsh shell
MIT License
49 stars 20 forks source link

Feature adding extra sections #16

Open ericktucto opened 6 years ago

ericktucto commented 6 years ago

Create a new method, pl_add_section, to add new sections Examples:

On .xonshrc

$PL_EXTRA_SEC = { 'user': lambda: [' {user} ', 'WHITE', '#555'] }
$PL_PROMPT = 'user>time'
xontrib load powerline

Or (.xonshrc)

def user():
    return [' {user} ', 'WHITE', '#555']

$PL_EXTRA_SEC = { 'user': user }
$PL_PROMPT = 'user>time'
xontrib load powerline

On terminal

>>> $PL_EXTRA_SEC = { 'user': lambda: [' {user} ', 'WHITE', '#555'] }
>>> $PL_PROMPT = 'user>time'
>>> pl_build_prompt