Skip to content

Bash plugin for powerlevel10k style prompt and WakaTime time tracking

License

Notifications You must be signed in to change notification settings

Freed-Wu/bash-prompt

Repository files navigation

bash-prompt

pre-commit.ci status github/workflow codecov

github/downloads github/downloads/latest github/issues github/issues-closed github/issues-pr github/issues-pr-closed github/discussions github/milestones github/forks github/stars github/watchers github/contributors github/commit-activity github/last-commit github/release-date

github/license github/languages github/languages/top github/directory-file-count github/code-size github/repo-size github/v

This project provides:

screenshot

  • A wakatime plugin to statistic how much time you write bash in REPL.

wakatime

Dependencies

Install

paru -S bash-prompt-git
nix-env -iA nixos.nur.repos.Freed-Wu.bash-prompt

Usage

~/.bashrc:

. /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:

PS1="$(prompt_get_ps1)"
# or you can customize
PS1="$(prompt_get_ps1 [prompt_string] [[format] fg_color:bg_color:text [sep]] ...)"

prompt_get_ps1

See powerline-extra-symbols for sep.

text can be:

  • "$prompt_icon": icon of OS
  • '${GITSTATUS_PROMPT}': git status information. See gitstatus to know how to customize it.
  • prompt escape code

fg_color/bg_color can be color name or color value. See Color Handling of man 5 terminfo.