https://github.com/freed-wu/bash-prompt
Bash plugin for powerlevel10k style prompt and WakaTime time tracking
https://github.com/freed-wu/bash-prompt
bash git plugin powerlevel10k wakatime
Last synced: 16 days ago
JSON representation
Bash plugin for powerlevel10k style prompt and WakaTime time tracking
- Host: GitHub
- URL: https://github.com/freed-wu/bash-prompt
- Owner: Freed-Wu
- License: gpl-3.0
- Created: 2023-08-26T07:32:06.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-10-21T20:20:06.000Z (12 months ago)
- Last Synced: 2024-10-22T14:37:08.512Z (12 months ago)
- Topics: bash, git, plugin, powerlevel10k, wakatime
- Language: Shell
- Homepage:
- Size: 37.1 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# bash-prompt
[](https://results.pre-commit.ci/latest/github/Freed-Wu/bash-prompt/main)
[](https://github.com/Freed-Wu/bash-prompt/actions)
[](https://codecov.io/gh/Freed-Wu/bash-prompt)[](https://github.com/Freed-Wu/bash-prompt/releases)
[](https://github.com/Freed-Wu/bash-prompt/releases/latest)
[](https://github.com/Freed-Wu/bash-prompt/issues)
[](https://github.com/Freed-Wu/bash-prompt/issues?q=is%3Aissue+is%3Aclosed)
[](https://github.com/Freed-Wu/bash-prompt/pulls)
[](https://github.com/Freed-Wu/bash-prompt/pulls?q=is%3Apr+is%3Aclosed)
[](https://github.com/Freed-Wu/bash-prompt/discussions)
[](https://github.com/Freed-Wu/bash-prompt/milestones)
[](https://github.com/Freed-Wu/bash-prompt/network/members)
[](https://github.com/Freed-Wu/bash-prompt/stargazers)
[](https://github.com/Freed-Wu/bash-prompt/watchers)
[](https://github.com/Freed-Wu/bash-prompt/graphs/contributors)
[](https://github.com/Freed-Wu/bash-prompt/graphs/commit-activity)
[](https://github.com/Freed-Wu/bash-prompt/commits)
[](https://github.com/Freed-Wu/bash-prompt/releases/latest)[](https://github.com/Freed-Wu/bash-prompt/blob/main/LICENSE)
[](https://github.com/Freed-Wu/bash-prompt)
[](https://github.com/Freed-Wu/bash-prompt)
[](https://github.com/Freed-Wu/bash-prompt)
[](https://github.com/Freed-Wu/bash-prompt)
[](https://github.com/Freed-Wu/bash-prompt)
[](https://github.com/Freed-Wu/bash-prompt)This project provides:
- A [powerlevel10k](https://github.com/romkatv/powerlevel10k)-like prompt style
of bash.
- A wakatime plugin to statistic how much time you write bash in REPL.

## Dependencies
- [gitstatus](https://github.com/romkatv/gitstatus): provide git status
- [wakatime-cli](https://github.com/wakatime/wakatime-cli)## Install
### [AUR](https://aur.archlinux.org/packages/bash-prompt-git)
```sh
paru -S bash-prompt-git
```### [NUR](https://nur.nix-community.org/repos/freed-wu)
```sh
nix-env -iA nixos.nur.repos.Freed-Wu.bash-prompt
```## Usage
`~/.bashrc`:
```sh
. /the/path/of/this/plugin/prompt.sh
# GNU/Linux
. /usr/share/bash-prompt/prompt.sh
# NixOS
. /run/current-system/sw/share/bash-prompt/prompt.sh
# Nix
. "${XDG_STATE_HOME:-$HOME/.local/state}/nix/profile/share/bash-prompt/prompt.sh"
```By default, it will enable wakatime. You can disable it by removing
`prompt_wakatime` from `$PROMPT_COMMAND`.By default, it will not change your prompt. You should enable it by:
```sh
PS1="$(prompt_get_ps1)"
# or you can customize
PS1="$(prompt_get_ps1 [prompt_string] [[format] fg_color:bg_color:text [sep]] ...)"
```
See
[powerline-extra-symbols](https://github.com/ryanoasis/powerline-extra-symbols)
for `sep`.`text` can be:
- `"$prompt_icon"`: icon of OS
- `'${GITSTATUS_PROMPT}'`: git status information. See
[gitstatus](https://github.com/romkatv/gitstatus) to know how to customize
it.
- [prompt escape code](https://www.gnu.org/software/bash/manual/bash.html#Controlling-the-Prompt)`fg_color`/`bg_color` can be color name or color value.
See _Color Handling_ of
[`man 5 terminfo`](https://man7.org/linux/man-pages/man5/terminfo.5.html).