Yet another powerline theme for xonsh with async prompt support.
Project description
Powerline3
Yet another powerline theme for xonsh with async prompt support.
Note:
This depends on xonsh's unreleased version (master branch will work. or in future >0.9.24)
Why another one?
- It uses
$PROMPT_FIELDS
and no need to have a separate functions and renderer. Since the addition of$PROMPT_TOKENS_FORMATTER
it is possible to use the existing set of functions to emulate powerline theme for xonsh prompts. - Async prompt mode works as well.
Installation
To install use pip:
xpip install xontrib-powerline3
# or: xpip install -U git+https://github.com/jnoortheen/xontrib-powerline3
Usage
xontrib load powerline3 prompt_ret_code
# the foreground/background colors of the prompt-fields can be configured as below.
# This works for custom fields as well
# The format is `<prompt-field-name>__pl_colors`. It can be a function returning `tuple[str, str]`
# or set tuples directly as below.
$PROMPT_FIELDS["cwd__pl_colors"] = ("WHITE", "CYAN")
# choose the powerline glyph used
$POWERLINE_MODE = "powerline" # if not set then it will choose random
# available modes: round/down/up/flame/squares/ruiny/lego
# define the prompts using the format style and you are good to go
$PROMPT = "".join(
[
"{vte_new_tab_cwd}",
"{cwd:{}}",
"{gitstatus:{}}",
"{ret_code}",
"{background_jobs}",
os.linesep,
"{full_env_name: 🐍{}}",
"$",
]
)
$RIGHT_PROMPT = "".join(
(
"{long_cmd_duration: ⌛{}}",
"{user: 🤖{}}",
"{hostname: 🖥{}}",
"{localtime: 🕰{}}",
)
)
Extra PROMPT_FIELDS
1. full_env_name
- When the
env_name
- is
.venv
show the name of the parent folder - contains
-py3.*
(when it is poetry created) shows the project name part alone
- is
2. background_jobs
- show number of running background jobs
Examples
Credits
This package was created with xontrib cookiecutter template.
- https://www.nerdfonts.com/cheat-sheet?set=nf-ple-
- https://github.com/romkatv/powerlevel10k#meslo-nerd-font-patched-for-powerlevel10k
Similar Projects
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for xontrib-powerline3-0.3.14.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 42e322f61e078afcdd1f3cc059bb93e0452daeb1ed1c5423958e5b93affa353d |
|
MD5 | 79b5905ec53fb84afd7c4989475fa71f |
|
BLAKE2b-256 | bf9b6c129511b1c20148eb58d553cea2455faf2ebb11b95beaaa1547eb42fae5 |
Close
Hashes for xontrib_powerline3-0.3.14-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9ee326002a92f895546a0b8398dd80140b3d7a987355c7934ecd2648b3e2f37b |
|
MD5 | 4314e05e96f565e317dff518fa7a8e83 |
|
BLAKE2b-256 | 17d313907d9e097e9bdefb014a5337c85b3ae5bc2da7a9f7b271f3e4fe59423d |