posh-transient

Crates.ioposh-transient
lib.rsposh-transient
version0.2.1
sourcesrc
created_at2023-05-24 15:05:17.031515
updated_at2023-05-24 15:28:32.193187
descriptionA simple command-line tool that automatically adds transient-prompt to your oh-my-posh configuration.
homepage
repositoryhttps://github.com/Sssssaltyfish/posh-transient
max_upload_size
id873153
size735,721
Salty Fish (Sssssaltyfish)

documentation

README

Posh-Transient

A simple command-line tool that automatically adds transient-prompt to your oh-my-posh configuration, based on the rightest left segment of your input line.

Install

cargo install posh-transient

Usage

One-time generate

# prints path to the generated file
posh-transient <input theme json> <output folder or file>

If an output folder (instead of a preexisted file) is specified, assume your input is theme.json, the output filename would be theme.transient.json.

Put it inside oh-my-posh init

Replace your configuration path to an invocation of this program.

Take pwsh as an example:

# Change this
oh-my-posh init pwsh --config "$env:POSH_THEMES_PATH/catppuccin_mocha.omp.json" | Invoke-Expression

# Into this
oh-my-posh init pwsh --config (&posh-transient "$env:POSH_THEMES_PATH/catppuccin_mocha.omp.json" "<Some folder you want to place the generated file in>") | Invoke-Expression

posh-transient will exit early if the destination file is already generated.

Example

atomic

Commit count: 8

cargo fmt