Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/anki-code/xontrib-prompt-starship
Starship cross-shell prompt in xonsh shell.
https://github.com/anki-code/xontrib-prompt-starship
shell-prompt starship xonsh xonsh-prompt xontrib
Last synced: about 2 months ago
JSON representation
Starship cross-shell prompt in xonsh shell.
- Host: GitHub
- URL: https://github.com/anki-code/xontrib-prompt-starship
- Owner: anki-code
- License: mit
- Created: 2021-03-06T20:37:07.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2024-04-04T23:45:09.000Z (8 months ago)
- Last Synced: 2024-10-12T15:56:38.117Z (2 months ago)
- Topics: shell-prompt, starship, xonsh, xonsh-prompt, xontrib
- Language: Python
- Homepage:
- Size: 72.3 KB
- Stars: 52
- Watchers: 2
- Forks: 8
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
- awesome-xontribs - prompt_starship - [Starship prompt](https://github.com/starship/starship) in xonsh shell. (Prompts)
README
Starship cross-shell prompt in xonsh shell.
If you like the idea click ⭐ on the repo and tweet.Additional features:
* You can split the prompt to left, right and bottom parts.
## Installation
To install use pip:
```bash
# You already have Starship installed. Then:
xpip install xontrib-prompt-starship
# or: xpip install -U git+https://github.com/anki-code/xontrib-prompt-starship
```## Usage
```bash
xontrib load prompt_starship
```## Recommendation
We suggest to use `@` character to remember about [you're using xonsh syntax](https://github.com/anki-code/xonsh-cheatsheet/blob/main/README.md#three-most-frequent-things-that-newcomers-overlook) and to potentially [spread the word about xonsh](https://github.com/xonsh/xonsh#the-xonsh-shell-community) if you make a screenshot or show your terminal to friends or collegues:
```ini
mkdir -p ~/.config/ && echo @("""
[character]
success_symbol = "[@](bold green)"
error_symbol = "[@](bold red)"
""".strip()) > ~/.config/starship_xonsh.toml$STARSHIP_CONFIG = '~/.config/starship_xonsh.toml'
xontrib load prompt_starship
```## Configuration
You can set the different starship configs for left, right and bottom parts of prompt when your shell type is prompt-toolkit:
```python
$XONTRIB_PROMPT_STARSHIP_LEFT_CONFIG = "~/.config/starship_xonsh_left.toml"
$XONTRIB_PROMPT_STARSHIP_RIGHT_CONFIG = "~/.config/starship_xonsh_right.toml"
$XONTRIB_PROMPT_STARSHIP_BOTTOM_CONFIG = "~/.config/starship_xonsh_bottom.toml"
xontrib load prompt_starship
```In case of [using starship as part of another prompt](https://github.com/anki-code/xontrib-prompt-bar#using-starship-cross-shell-prompt-to-rendering-right-sections) you can add starship prompt to `$PROMPT_FIELDS` without replacing the current prompt:
```python
$XONTRIB_PROMPT_STARSHIP_REPLACE_PROMPT = False
xontrib load prompt_starship
print($PROMPT_FIELDS['starship_left']())
```[Prompt bar with starship](https://github.com/anki-code/xontrib-prompt-bar#using-starship-cross-shell-prompt-to-rendering-right-sections):
## Known issues
* [Prompt toolkit issue: the right prompt at the bottom.](https://github.com/prompt-toolkit/python-prompt-toolkit/issues/1241)
* The using of bottom toolbar is not properly tested and adopted to cute appearance.## Credits
* The xontrib-prompt-starship can be used as part of [xontrib-prompt-bar](https://github.com/anki-code/xontrib-prompt-bar).
* This package is the part of [ergopack](https://github.com/anki-code/xontrib-ergopack) - the pack of ergonomic xontribs.
* This package was created with [xontrib cookiecutter template](https://github.com/xonsh/xontrib-cookiecutter).
* [Adding support for xonsh inside Starship](https://github.com/starship/starship/pull/2807)