xontrib-add-variable

This package allow add new variable.


Keywords
extension, python, xonsh, xontrib
License
MIT
Install
pip install xontrib-add-variable==1.2.0

Documentation

Xontrib Add Variable

Version number: 1.1.1

Author: Erick Tucto

Overview

This package allow add new variable to $PROMPT_FIELDS and create new aliases.

Installation / Usage

  1. To install use pip
pip install xontrib-add-variable
  1. Add on ~/.xonshrc

Now you can create new variables to $PROMPT on ~/.xonsh/add_variable.xsh, also create new aliases, please see Example or my wiki

1 xontrib load add_variable

Contributing

  1. Erick Tucto

Example

  1. On ~/.xonsh/add_variable.xsh or ~/.xonsh/add_variable.py
1 from time import strftime
2 from xontrib.add_variable.decorators import variable
3 
4 @variable
5 def timeNow():
6     return strftime('%H:%M:%S')
  1. On ~/.xonshrc
1 xontrib load add_variable
2 
3 $RIGHT_PROMPT = '{timeNow}'
  1. See image

terminal.png

Credits

This package was created with Cookiecutter and the xontrib template