https://github.com/saravanabalagi/zsh-plugin-singularityenv
https://github.com/saravanabalagi/zsh-plugin-singularityenv
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/saravanabalagi/zsh-plugin-singularityenv
- Owner: saravanabalagi
- License: gpl-3.0
- Created: 2022-10-26T16:49:33.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2022-10-26T16:50:19.000Z (about 3 years ago)
- Last Synced: 2025-05-14T11:21:27.836Z (6 months ago)
- Language: Shell
- Size: 20.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-zsh-plugins - singularityenv - Provides a `singularityenv_prompt_info` function which returns the current singularity environment name (Plugins / ZSH on Windows)
- fucking-awesome-zsh-plugins - singularityenv - Provides a `singularityenv_prompt_info` function which returns the current singularity environment name (Plugins / ZSH on Windows)
README
# zsh-singularityenv
Plugin provides `singularityenv_prompt_info` function which returns the current singularity environment name.

## Installation
1. Download the plugin
```
git clone https://github.com/saravanabalagi/zsh-plugin-singularityenv $ZSH_CUSTOM/plugins/singularityenv
```
1. Add to `plugins` in `.zshrc` file
```
plugins=(
...
singularityenv
)
```
Then launch a new terminal or source `.zshrc` in your current terminal.
## Usage
This plugin exposes:
- `singularityenv_prompt_info` function based on two env vars
1. `ZSH_THEME_SINGULARITYENV_PREFIX` default `(`
1. `ZSH_THEME_SINGULARITYENV_SUFFIX` default `)`
Using this you can build a theme as below:
```zsh
base_prompt=PROMPT
PROMPT=$(singularityenv_prompt_info)"$base_prompt"
ZSH_THEME_SINGULARITYENV_PREFIX="%{$fg[blue]%}("
ZSH_THEME_SINGULARITYENV_SUFFIX=")%{$reset_color%}"
```
## License
Please refer to the [License](LICENSE) file.