Skip to content

Latest commit

 

History

History
127 lines (87 loc) · 5.41 KB

README.md

File metadata and controls

127 lines (87 loc) · 5.41 KB

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