sophuwu.site > bashprompt
finish touch
sophuwu sophie@skisiel.com
Sat, 24 Aug 2024 23:25:34 +0200
commit

6166a6ef04a1b0a2f2415327aa6b80eb09762fff

parent

c1fcfea71bb0b2664367a27944470cb8044ae7ca

3 files changed, 15 insertions(+), 7 deletions(-)

jump to
M MakefileMakefile

@@ -1,7 +1,8 @@

-build: src/*.cpp +defualt: bashprompt + +bashprompt: src/ mkdir -p build g++ -std=c++17 -o build/bashprompt src/*.cpp -run: - ./build/bashprompt + clean: - @echo "unimplemented"+ @echo "unimplemented"
M README.mdREADME.md

@@ -1,12 +1,19 @@

# Bash Prompt Generator -<center><img src="./example.png" alt="Example" width="50%"></center> +<pre><code><span style="background-color:#D7AF00!important;"><span style="color: #AFFFAF!important;">▄</span></span><span style="background-color:#D75F00!important;"><span style="color: #5F0000!important;">▄</span></span><span style="color: #875FFF!important;">|</span><span style="color: #FF5F00!important;">0</span><span style="color: #00FFFF!important;"> </span><span style="color: #0095FF!important;">1</span><span style="color: #002BFF!important;">7</span> <span style="color: #0000FF!important;">:</span><span style="color: #6A00FF!important;">3</span><span style="color: #D400FF!important;"> </span><span style="color: #FF0095!important;">p</span><span style="color: #FF002B!important;">r</span><span style="color: #FF0000!important;">o</span><span style="color: #FF6A00!important;">j</span><span style="color: #FFD400!important;">e</span><span style="color: #FFFF00!important;">c</span><span style="color: #95FF00!important;">t</span><span style="color: #2BFF00!important;"> </span><span style="color: #00FF6A!important;">b</span><span style="color: #00FFD4!important;">a</span><span style="color: #00FFFF!important;">s</span><span style="color: #0095FF!important;">h</span><span style="color: #002BFF!important;">p</span><span style="color: #0000FF!important;">r</span><span style="color: #6A00FF!important;">o</span><span style="color: #D400FF!important;">m</span><span style="color: #FF0095!important;">p</span><span style="color: #FF002B!important;">t</span> <span style="color: #FF0000!important;">$</span> +<span style="background-color:#D7AF00!important;"><span style="color: #AFFFAF!important;">▄</span></span><span style="background-color:#D75F00!important;"><span style="color: #5F0000!important;">▄</span></span><span style="color: #875FFF!important;">|</span><span style="color: #FF5F00!important;">0</span><span style="color: #0000FF!important;"> </span><span style="color: #6A00FF!important;">1</span><span style="color: #D400FF!important;">8</span> <span style="color: #FF0095!important;">;</span><span style="color: #FF002B!important;">&gt;</span><span style="color: #FF0000!important;"> </span><span style="color: #FF6A00!important;">p</span><span style="color: #FFD400!important;">r</span><span style="color: #FFFF00!important;">o</span><span style="color: #95FF00!important;">j</span><span style="color: #2BFF00!important;">e</span><span style="color: #00FF6A!important;">c</span><span style="color: #00FFD4!important;">t</span><span style="color: #00FFFF!important;"> </span><span style="color: #0095FF!important;">b</span><span style="color: #002BFF!important;">a</span><span style="color: #0000FF!important;">s</span><span style="color: #6A00FF!important;">h</span><span style="color: #D400FF!important;">p</span><span style="color: #FF0095!important;">r</span><span style="color: #FF002B!important;">o</span><span style="color: #FF0000!important;">m</span><span style="color: #FF6A00!important;">p</span><span style="color: #FFD400!important;">t</span> <span style="color: #FFFF00!important;">$</span> cd build/ +<span style="background-color:#D7AF00!important;"><span style="color: #AFFFAF!important;">▄</span></span><span style="background-color:#D75F00!important;"><span style="color: #5F0000!important;">▄</span></span><span style="color: #875FFF!important;">|</span><span style="color: #FF5F00!important;">0</span><span style="color: #FF0095!important;"> </span><span style="color: #FF002B!important;">1</span><span style="color: #FF0000!important;">9</span> <span style="color: #FF6A00!important;">:</span><span style="color: #FFD400!important;">&gt;</span><span style="color: #FFFF00!important;"> </span><span style="color: #95FF00!important;">b</span><span style="color: #2BFF00!important;">a</span><span style="color: #00FF6A!important;">s</span><span style="color: #00FFD4!important;">h</span><span style="color: #00FFFF!important;">p</span><span style="color: #0095FF!important;">r</span><span style="color: #002BFF!important;">o</span><span style="color: #0000FF!important;">m</span><span style="color: #6A00FF!important;">p</span><span style="color: #D400FF!important;">t</span><span style="color: #FF0095!important;"> </span><span style="color: #FF002B!important;">b</span><span style="color: #FF0000!important;">u</span><span style="color: #FF6A00!important;">i</span><span style="color: #FFD400!important;">l</span><span style="color: #FFFF00!important;">d</span> <span style="color: #95FF00!important;">$</span> false +<span style="background-color:#D7AF00!important;"><span style="color: #AFFFAF!important;">▄</span></span><span style="background-color:#D75F00!important;"><span style="color: #5F0000!important;">▄</span></span><span style="color: #875FFF!important;">|</span><span style="color: #FF5F00!important;">1</span><span style="color: #FF002B!important;"> </span><span style="color: #FF0000!important;">2</span><span style="color: #FF6A00!important;">0</span> <span style="color: #FFD400!important;">:</span><span style="color: #FFFF00!important;">)</span><span style="color: #95FF00!important;"> </span><span style="color: #2BFF00!important;">b</span><span style="color: #00FF6A!important;">a</span><span style="color: #00FFD4!important;">s</span><span style="color: #00FFFF!important;">h</span><span style="color: #0095FF!important;">p</span><span style="color: #002BFF!important;">r</span><span style="color: #0000FF!important;">o</span><span style="color: #6A00FF!important;">m</span><span style="color: #D400FF!important;">p</span><span style="color: #FF0095!important;">t</span><span style="color: #FF002B!important;"> </span><span style="color: #FF0000!important;">b</span><span style="color: #FF6A00!important;">u</span><span style="color: #FFD400!important;">i</span><span style="color: #FFFF00!important;">l</span><span style="color: #95FF00!important;">d</span> <span style="color: #2BFF00!important;">$</span> [[ &quot;str&quot; == &quot;str&quot; ]] +<span style="background-color:#D7AF00!important;"><span style="color: #AFFFAF!important;">▄</span></span><span style="background-color:#D75F00!important;"><span style="color: #5F0000!important;">▄</span></span><span style="color: #875FFF!important;">|</span><span style="color: #FF5F00!important;">0</span><span style="color: #FF002B!important;"> </span><span style="color: #FF0000!important;">2</span><span style="color: #FF6A00!important;">1</span> <span style="color: #FFD400!important;">;</span><span style="color: #FFFF00!important;">P</span><span style="color: #95FF00!important;"> </span><span style="color: #2BFF00!important;">b</span><span style="color: #00FF6A!important;">a</span><span style="color: #00FFD4!important;">s</span><span style="color: #00FFFF!important;">h</span><span style="color: #0095FF!important;">p</span><span style="color: #002BFF!important;">r</span><span style="color: #0000FF!important;">o</span><span style="color: #6A00FF!important;">m</span><span style="color: #D400FF!important;">p</span><span style="color: #FF0095!important;">t</span><span style="color: #FF002B!important;"> </span><span style="color: #FF0000!important;">b</span><span style="color: #FF6A00!important;">u</span><span style="color: #FFD400!important;">i</span><span style="color: #FFFF00!important;">l</span><span style="color: #95FF00!important;">d</span> <span style="color: #2BFF00!important;">$</span> [[ &quot;str&quot; == &quot;strs&quot; ]] +<span style="background-color:#D7AF00!important;"><span style="color: #AFFFAF!important;">▄</span></span><span style="background-color:#D75F00!important;"><span style="color: #5F0000!important;">▄</span></span><span style="color: #875FFF!important;">|</span><span style="color: #FF5F00!important;">1</span><span style="color: #FF0095!important;"> </span><span style="color: #FF002B!important;">2</span><span style="color: #FF0000!important;">2</span> <span style="color: #FF6A00!important;">;</span><span style="color: #FFD400!important;">&gt;</span><span style="color: #FFFF00!important;"> </span><span style="color: #95FF00!important;">b</span><span style="color: #2BFF00!important;">a</span><span style="color: #00FF6A!important;">s</span><span style="color: #00FFD4!important;">h</span><span style="color: #00FFFF!important;">p</span><span style="color: #0095FF!important;">r</span><span style="color: #002BFF!important;">o</span><span style="color: #0000FF!important;">m</span><span style="color: #6A00FF!important;">p</span><span style="color: #D400FF!important;">t</span><span style="color: #FF0095!important;"> </span><span style="color: #FF002B!important;">b</span><span style="color: #FF0000!important;">u</span><span style="color: #FF6A00!important;">i</span><span style="color: #FFD400!important;">l</span><span style="color: #FFFF00!important;">d</span> <span style="color: #95FF00!important;">$</span> +</code></pre> ## Installation ```bash make ./build/bashprompt help -# run the output to enable the prompt ``` +Run the output to enable the prompt. +Ensure that the file is executable and that you use an absolute path to the file. Copy the output to your .bashrc for automatic start up. **DO NOT** USE .bash_profile or .profile.
M src/common.cppsrc/common.cpp

@@ -84,6 +84,6 @@ str ret = "48;5;";

ret += std::to_string(top); ret += ";38;5;" + std::to_string(bot); ret = wrap(ret); - ret+="▌"; // "▌" "▀" "▄" + ret+="▄"; // "▌" "▀" "▄" "▌" return ret+wrap("0"); }