87 lines
1.9 KiB
Markdown
87 lines
1.9 KiB
Markdown
# CommandPrompt
|
|
|
|
## Description
|
|
|
|
This CommandPrompt is an *highly* customised prompt for bash
|
|
|
|

|
|
|
|
It show the time, user, current directory and an info.
|
|
The info is an icon if pwd is in the configured special folders (see more below).
|
|
However if pwd is in the directory or sub-directory of a project, it will find by probabilities
|
|
where the project root is and show the project's folder name.
|
|
It also detect the majority language in the current directory and displays an icon depending on it !
|
|
|
|
For the moment the supported language are :
|
|
- C
|
|
- C++
|
|
- Rust
|
|
- Go
|
|
- Python
|
|
- Java
|
|
- Ruby
|
|
- Javascript
|
|
- PHP
|
|
- C#
|
|
- HTML/CSS (considered same language)
|
|
|
|
## How to install
|
|
|
|
You can install this prompt by copying the file to any directory you want (for example ~/.config/bash/)
|
|
and calling with **source** the file at the end of your .bashrc or .profile depending on your system.
|
|
|
|
If your system is in a different language you can change the special folder names direcly at the beginning
|
|
of the file.
|
|
|
|
It is recommended to personalize your terminal colors instead of modifying it in the script.
|
|
|
|
The terminal used in showcase is kitty, here are the colors used :
|
|
```Bash
|
|
cursor #B3B1AC
|
|
|
|
foreground #BFBDC0
|
|
background #151416
|
|
|
|
# black
|
|
color0 #151416
|
|
color8 #5E5C64
|
|
|
|
# red
|
|
color1 #2C312C
|
|
color9 #2C312C
|
|
|
|
# green
|
|
color2 #324637
|
|
color10 #324637
|
|
|
|
# yellow
|
|
color3 #375A47
|
|
color11 #375A47
|
|
|
|
# blue
|
|
color4 #45745A
|
|
color12 #45745A
|
|
|
|
# magenta
|
|
color5 #78A486
|
|
color13 #78A486
|
|
|
|
# cyan
|
|
color6 #B3C5B5
|
|
color14 #B3C5B5
|
|
|
|
# white
|
|
color7 #D0CFCC
|
|
color15 #FFFFFF
|
|
```
|
|
|
|
## Internal commands
|
|
|
|
This command prompt include 2 internal command that you can call manually if you want to
|
|
manipulate cache or debug the prompt.
|
|
These are :
|
|
- find_project_root_dir
|
|
- find_dir_majority_language
|
|
|
|
For more info call them with --help.
|