40 lines
1.3 KiB
Bash
Executable file
40 lines
1.3 KiB
Bash
Executable file
#!/bin/sh
|
|
|
|
fgalpha="FF"
|
|
bgalpha="CC"
|
|
|
|
export fgblack="foreground='#15161E$fgalpha'"
|
|
export fgred="foreground='#F7768E$fgalpha'"
|
|
export fggreen="foreground='#9ECE6A$fgalpha'"
|
|
export fgorange="foreground='#E0AF68$fgalpha'"
|
|
export fgblue="foreground='#7AA2F7$fgalpha'"
|
|
export fgmagenta="foreground='#BB9AF7$fgalpha'"
|
|
export fgcyan="foreground='#7DCFFF$fgalpha'"
|
|
export fggray="foreground='#414868$fgalpha'"
|
|
export fgwhite="foreground='#C0CAF5$fgalpha'"
|
|
export bgblack="background='#15161E$bgalpha'"
|
|
export bgred="background='#F7768E$bgalpha'"
|
|
export bggreen="background='#9ECE6A$bgalpha'"
|
|
export bgorange="background='#E0AF68$bgalpha'"
|
|
export bgblue="background='#7AA2F7$bgalpha'"
|
|
export bgmagenta="background='#BB9AF7$bgalpha'"
|
|
export bgcyan="background='#7DCFFF$bgalpha'"
|
|
export bggray="background='#414868$bgalpha'"
|
|
export bgwhite="background='#C0CAF5$bgalpha'"
|
|
|
|
meter_bar() {
|
|
# shellcheck disable=SC2194
|
|
case $1 in
|
|
9[0-9] | 100) color="$fgred" bar="▉" ;;
|
|
8[0-9]) color="$fgred" bar="█" ;;
|
|
7[0-9]) color="$fgorange" bar="▇" ;;
|
|
6[0-9]) color="$fgorange" bar="▆" ;;
|
|
5[0-9]) color="$fggreen" bar="▅" ;;
|
|
4[0-9]) color="$fggreen" bar="▄" ;;
|
|
3[0-9]) color="$fggreen" bar="▂" ;;
|
|
2[0-9]) color="$fggreen" bar="▂" ;;
|
|
1[0-9]) color="$fggreen" bar="▁" ;;
|
|
0[0-9] | [0-9]) color="$fggreen" bar=" " ;;
|
|
esac
|
|
printf "%s:%s" "${color}" "${bar}"
|
|
}
|