An advanced and highly configurable bash prompt with memory, CPU, temperature, Git, Conda display and more.
~/.bash_prompt ← main prompt script
~/.color ← ANSI color definitions
git clone https://github.com/Minard-Jules/My_prompt.git
mv My_prompt/.bash_prompt ~/
mv My_prompt/.color ~/
rm -rf My_promptAdd the following line at the end of ~/.bashrc:
if [ -f ~/.bash_prompt ]; then
. ~/.bash_prompt
fiAll options are located at the top of the ~/.bash_prompt file:
# ── Display ──────────────────────────────────────────────────
__show_memory_usage=true # Display memory usage
__show_cpu_usage=false # Display CPU usage
__show_cpu_temp=false # Display CPU temperature
# ── Memory Unit ──────────────────────────────────────────────
__memory_unit="MiB" # Display unit (see table)
__memory_unit_fr=true # Use French units
# ── CPU Smoothing ────────────────────────────────────────────
__cpu_history_size=5 # Moving average window| Value | English | French |
|---|---|---|
B |
B | o |
KiB |
KiB | Kio |
MiB |
MiB | Mio |
GiB |
GiB | Gio |
| Value | English | French |
|---|---|---|
KB |
KB | Ko |
MB |
MB | Mo |
GB |
GB | Go |
| Value | Unit |
|---|---|
bits |
bits |
Kbits |
Kbits |
Mbits |
Mbits |
Gbits |
Gbits |
Values read from
/proc/meminfoare in KiB (base 1024), despite thekBnotation used by the Linux kernel.
| Element | Description |
|---|---|
/ / |
Distribution logo (Debian / Ubuntu / Arch) |
user@hostname |
Current user — red if root, black otherwise |
14:32:05 |
Current time |
3840/7887Mio 48% |
RAM used / total + percentage (if enabled) |
12% |
Moving average CPU load (if enabled) |
55°C |
CPU temperature (if enabled) |
2.03s |
Last command duration |
master |
Current Git branch (if in a repository) |
⚙ 2 |
Number of background jobs (if > 0) |
• / • (ERROR 1) |
Return code — green if success, red if error |
- distribution
- RAM and CPU
git.mp4
- Jobs and exit code
error.mp4
Displays the path of the working directory.
| Element | Description |
|---|---|
| No active environment | |
base |
Base Conda environment |
Fortran_env |
Fortran environment |
Python_env |
Python environment |
C_env |
C environment |
Cpp_env |
C++ environment |
$ / # |
User symbol — $ normal, # root |
conda_env.mp4
root.mp4
The execution time of the last command is measured accurately and automatically formatted based on duration:
| Duration | Format | Example |
|---|---|---|
| < 1 second | ms |
423ms |
| < 1 minute | s |
12.34s |
| < 1 hour | min:sec |
2m05s |
| ≥ 1 hour | h:min:sec |
1h02m30s |
Real-time reading from /proc/meminfo:
RAM used = MemTotal - MemAvailable
MemAvailableis used (notMemFree) because it accounts for caches that can be reclaimed by the system.
- Calculated from
/proc/statbetween each prompt display - Moving average over the last
cpu_history_sizereadings - 3% update threshold to avoid spurious variations
- Early readings won't be displayed until the history is full
Read from /sys/class/thermal/thermal_zone0/temp. Automatically ignored if the file doesn't exist (virtual machine, etc.).
Displays the current Git branch if the directory is a Git repository. Branch caching in update_prompt_data avoids a double git call per prompt display.
Automatic detection of $CONDA_DEFAULT_ENV with dedicated icons per environment. Easily extensible for new environments.
| Tool | Usage | Optional |
|---|---|---|
bash ≥ 4.0 |
Arrays, (( )) |
No |
git |
Current branch | Yes |
awk |
Reading /proc/meminfo |
No |
bc |
Decimal calculations (GiB, MB…) | No |
conda |
Virtual environments | Yes |
Nerd Fonts |
Prompt icons | No |
Icons require a Nerd Fonts font.
Recommended fonts:
Cascadia Mono Nerd FontJetBrainsMono Nerd FontFiraCode Nerd FontHack Nerd Font









