dev #1

Merged
candifloss merged 23 commits from dev into main 2024-12-02 04:26:43 +00:00
Showing only changes of commit 859f16cd08 - Show all commits

View File

@ -30,7 +30,7 @@ A pretty shell prompt, written in rust.
- Order and position
- Custom components
- Static: Shell icon, Host name, etc.
- Dynamic: Time &date, system stats, or any custom commands
- Dynamic: Time & date, system stats, or any custom commands
## Current Limitations
@ -46,9 +46,8 @@ Ubuntu 24.04
## Installation
**Step 1. Get the binary**
- Option 1. Download the pre-built binary from the [releases page](https://git.candifloss.cc/candifloss/PrettyPrompt/releases).
- Option 2. Build from source(if you have [rust](https://www.rust-lang.org/tools/install) installed):
**Step 1. Build binary from source**
This requires [rust](https://www.rust-lang.org/tools/install) installed on your system.
```bash
git clone https://git.candifloss.cc/candifloss/PrettyPrompt.git
@ -60,7 +59,7 @@ cargo build --release
**Step 2. Add to `$PATH`**
- Option 1. Move the binary to a directory in your `$PATH`. Eg:
```bash
sudo mv /path/to/prettyprompt /usr/bin/
sudo mv target/release/prettyprompt /usr/bin/
```
- Option 2. Add the directory containing the binary to `$PATH`
System-wide: `/etc/profile`
@ -72,12 +71,12 @@ export PATH="$PATH:/path/where/the/binary/is/"
## Usage
Configuration varies by shell, and the file location varies by distro. Consult your shell's docs or community resources for details. Note that the exit code of the last command(usually `$?` variable) must be passed as a command-line argument.
Configuration varies by shell, and the file location varies by distro. Refer your shell's docs or community resources for details. Note that the exit code of the last command(usually `$?` variable) must be passed as a command-line argument.
### `bash`
- The `PS1` variable sets a fixed prompt string.
- This `PROMPT_COMMAND` variable updates the prompt every time.
- This `PROMPT_COMMAND` variable sets a dynamic prompt.
System-wide: `/etc/bash.bashrc`
User-specific: `~/.bashrc`:
@ -101,7 +100,7 @@ Export the `PS1` variable with the output of `prettyprompt $?` as its value.
User-specific: `~/.zshrc`
System-wide: `/etc/zsh/zshrc`
```sh
export PS1='$(prettyprompt $?)'
export PS1='$(prettyprompt $?)' # Notice the single quotes
```
### Other shells
@ -109,7 +108,7 @@ export PS1='$(prettyprompt $?)'
For other shells, refer their docs to set a dynamic prompt. Ensure the last command's exit code (`$?` or equivalent) is passed to `prettyprompt`.
## Changes since the last version
- **Updated Output String Type:** Improved compatibility with other shells.
- **Updated Output String Type:** Ansi strings improved compatibility with other shells.
- **Revamped Indicator Symbols:** Enhanced the visual aspect of the prompt.
- **Removed Shell Icon:** Determining the shell is practically not possible.
- **Conditional Component Inclusion:** A first step towards user-configuration expected in future versions.