Merge branch 'master' of git.covalent.cz:overwatch/over-prompt

This commit is contained in:
Martinez 2017-01-03 23:16:24 +01:00
commit 043f433455
3 changed files with 5 additions and 2 deletions

View file

@ -4,7 +4,7 @@
#OVER_PROMPT_SYSLOAD_WARN=1.25
# Indicators of system load will turn red when system load (loadavg divided by nproc) exceeds this value.
#OVER_PROMPT_SYSLOAD_YELL=2.50
#OVER_PROMPT_SYSLOAD_YELL=3.0
# Indicators of free space (storage, memory and swap) will turn yellow when there's at most this fraction of free space left.
#OVER_PROMPT_FREESPACE_WARN=0.15

View file

@ -22,6 +22,7 @@ COLOR_TERM_SCREEN = 27
COLOR_CLOCK = 27
COLOR_CLOCK_DELTA = 11
COLOR_MEMSWAP = 7
COLOR_SPACE_BTRFS = 12
COLOR_SPACE_OK = 2
COLOR_SPACE_WARN = 3
COLOR_SPACE_ERROR = 1
@ -617,7 +618,9 @@ class StatsPart(Part):
self.fragments.append(" |")
first_mountpoint = False
if type == "btrfs": self.fragments.append(style_color(COLOR_SPACE_BTRFS))
self.fragments.append(short_name)
if type == "btrfs": self.fragments.append(style_reset())
self.fragments.append(style_bold())
self.fragments.append(style_color(settings.get_space_color(stor_free, stor_total)))
stor_free_si = si_number(stor_free)

View file

@ -21,7 +21,7 @@ function preexec {
function precmd {
set_title "${USER}: ${PWD}"
python3 /usr/libexec/over-prompt.py "${COLUMNS}" "${PWD}" "${OVER_PROMPT_LAST_REFRESH}" "${OVER_PROMPT_SYSLOAD_WARN:=1.25}" "${OVER_PROMPT_SYSLOAD_YELL:=2.5}" "${OVER_PROMPT_FREESPACE_WARN:=0.15}" "${OVER_PROMPT_FREESPACE_YELL:=0.05}"
python3 /usr/libexec/over-prompt.py "${COLUMNS}" "${PWD}" "${OVER_PROMPT_LAST_REFRESH}" "${OVER_PROMPT_SYSLOAD_WARN:=1.25}" "${OVER_PROMPT_SYSLOAD_YELL:=3.0}" "${OVER_PROMPT_FREESPACE_WARN:=0.15}" "${OVER_PROMPT_FREESPACE_YELL:=0.05}"
PS1="$(print "%(?.%{\e[1;36m%}.%{\e[1;31m%}%?%{\e[0m%}:%{\e[1;31m%})%(\!.#.$)%{\e[0m%} ")"
OVER_PROMPT_LAST_REFRESH=$(date +%s)
}