Skip to content

πŸ§°πŸš€ Cross-shell prompt framework

License

Notifications You must be signed in to change notification settings

info-mono/diyship

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

37 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Cross-shell prompt framework

License: GPL-3.0 Development completed

πŸ’‘ About

DIYship is a cross-shell prompt framework that let you write your prompt with any programing language for any shell.

Learn more about how its work.

πŸš€ Setup

πŸ“₯ Installation

To install DIYship to your shell, simply append the correspond code file on this repo to your shell config file.

🐚 Bash

curl https://raw.githubusercontent.com/info-mono/diyship/main/bash >> ~/.bashrc

🐚 Zsh

curl https://raw.githubusercontent.com/info-mono/diyship/main/zshrc >> ~/.zshrc

🐚 Fish

curl https://raw.githubusercontent.com/info-mono/diyship/main/fish >> ~/.config/fish/config.fish

🐚 PowerShell

curl https://raw.githubusercontent.com/info-mono/diyship/main/powerShell >> ~/.config/powershell/Microsoft.PowerShell_profile.ps1

🐚 Ion

curl https://raw.githubusercontent.com/info-mono/diyship/main/ion >> ~/.config/ion/initrc

🐚 Elvish

curl https://raw.githubusercontent.com/info-mono/diyship/main/elvish >> ~/.elvish/rc.elv

Warning Only Elvish v0.18 or higher is supported.

🐚 Tcsh

curl https://raw.githubusercontent.com/info-mono/diyship/main/tcsh >> ~/.tcshrc

🐚 Nushell

curl https://raw.githubusercontent.com/info-mono/diyship/main/nushell >> ~/.config/nu/config.toml

🐚 Xonsh

curl https://raw.githubusercontent.com/info-mono/diyship/main/xonsh >> ~/.xonshrc

Warning Only Nushell version v0.33 or higher is supported.

βš™οΈ Configuration

DIYship is basically execute a command (which could be a path to an executable script file or program) and take it output as a prompt, you can change the command through variable:

Environment variable Description
DIYSHIP_COMMAND_LEFT Command to print left prompt.
DIYSHIP_COMMAND_RIGHT Command to print right prompt.

Note You can disable right prompt by DIYSHIP_COMMAND_RIGHT="test"

DIYship will export these following environment variables before running the commands to print out prompts, so you could utilize theme informations in your script/program:

Environment variable Description
$DIYSHIP_SHELL Current shell name.
$DIYSHIP_STATUS The status code of the previously run command.
$DIYSHIP_PIPESTATUS Status codes from a command pipeline.
$DIYSHIP_DURATION The execution duration of the last command (in milliseconds).
$DIYSHIP_JOBS The number of currently running jobs
$DIYSHIP_KEYMAP The current keymap.

Do to many technical limitation, not every shell support all features:

Feature Bash Zsh Fish Powershell Ion Elvish Tcsh Nushell Xonsh
Left prompt βœ… βœ… βœ… βœ… βœ… βœ… βœ… βœ… βœ…
Right prompt βœ… βœ… βœ… βœ…
Export current shell βœ… βœ… βœ… βœ… βœ… βœ… βœ… βœ… βœ…
Export status βœ… βœ… βœ… βœ… βœ… βœ… βœ…
Export pipe status βœ… βœ… βœ…
Export duration βœ… βœ… βœ… βœ… βœ… βœ… βœ… βœ… βœ…
Export jobs βœ… βœ… βœ… βœ… βœ… βœ… βœ…
Export keymap βœ… βœ…

Note For more documentation and inspiration about writing your own prompt, checkout ours wiki and Starship's custom modules.

πŸ’Œ Credits

This project was heavily based on and inspired by Starship.






Made with ❀️ by @info-mono

Buy Me a Coffee