Full powerline version for ash

This commit is contained in:
2025-10-05 04:54:53 +03:00
parent 6dcb4cbbf9
commit 057919629d
3 changed files with 24 additions and 3 deletions

View File

@@ -1,5 +1,21 @@
#!/bin/sh
# 30 is the color you may want to modify, \h is the label
prompt() {
local label="\h"
local color=30 # 30 green, 131 red
local bold=1
PS1="\n\[\e[1;48;5;30;38;5;231m\] \h \[\e[;38;5;30;48;5;240m\]\[\e[38;5;252m\] \w \[\e[;38;5;240m\]\[\e[m\] "
prompt_part() { printf "\[\e[$2;38;5;$3;48;5;${4}m\] $1 \[\e[;38;5;$4${5+;48;5;$5}m\]"; }
printf "\n"
if [ -n "$MC_SID" ]; then
prompt_part "$label" $bold 231 $color 237
prompt_part "mc" $bold 231 237 240
else
prompt_part "$label" $bold 231 $color 240
fi
prompt_part "\w" 0 252 240
printf "\[\e[m\] "
}
PS1="$(prompt)"