Initial commit
This commit is contained in:
13
bash/colors.sh
Normal file
13
bash/colors.sh
Normal file
@@ -0,0 +1,13 @@
|
||||
#!/bin/sh
|
||||
|
||||
label="localhost"
|
||||
bold=1
|
||||
|
||||
prompt_part() { printf "\e[$2;38;5;$3;48;5;${4}m $1 \e[;38;5;$4${5+;48;5;$5}m"; }
|
||||
|
||||
for color in {0..255}; do
|
||||
printf "\n"
|
||||
prompt_part "$label" $bold 231 $color 240
|
||||
prompt_part "~" 0 252 240
|
||||
printf "\e[m $color\n"
|
||||
done
|
||||
21
bash/powerline.sh
Normal file
21
bash/powerline.sh
Normal file
@@ -0,0 +1,21 @@
|
||||
#!/bin/sh
|
||||
|
||||
prompt() {
|
||||
local label="\h"
|
||||
local color=30 # 30 green, 131 red
|
||||
local bold=1
|
||||
|
||||
prompt_part() { PS1+="\[\e[$2;38;5;$3;48;5;${4}m\] $1 \[\e[;38;5;$4${5+;48;5;$5}m\]"; }
|
||||
|
||||
PS1="\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
|
||||
PS1+="\[\e[m\] "
|
||||
}
|
||||
|
||||
PROMPT_COMMAND=prompt
|
||||
Reference in New Issue
Block a user