move configuration variables in a separated file
This commit is contained in:
parent
93b701a637
commit
8d5d088f1d
@ -49,26 +49,13 @@ unset bash bmajor bminor
|
|||||||
# CONFIGURATION #
|
# CONFIGURATION #
|
||||||
#################
|
#################
|
||||||
|
|
||||||
# Maximal value under which the battery level is displayed
|
LP_BATTERY_THRESHOLD=75
|
||||||
# Recommended value is 75
|
LP_LOAD_THRESHOLD=60
|
||||||
BATTERY_THRESHOLD=75
|
LP_PATH_LENGTH=35
|
||||||
|
LP_PATH_KEEP=2
|
||||||
|
LP_REVERSE=0
|
||||||
|
|
||||||
# Minimal value after which the load average is displayed
|
source ~/.liquidpromptrc 2> /dev/null
|
||||||
# Recommended value is 60
|
|
||||||
LOAD_THRESHOLD=60
|
|
||||||
|
|
||||||
# The maximum percentage of the screen width used to display the path
|
|
||||||
# Recommended value is 35
|
|
||||||
PATH_LENGTH=35
|
|
||||||
|
|
||||||
# How many directories to keep at the beginning of a shortened path
|
|
||||||
# Recommended value is 2
|
|
||||||
PATH_KEEP=2
|
|
||||||
|
|
||||||
# Do we use reverse colors (black on white) instead of normal theme (white on black)
|
|
||||||
# Defaults to 0 (normal colors)
|
|
||||||
# set to 1 if you use black on white
|
|
||||||
REVERSE=0
|
|
||||||
|
|
||||||
|
|
||||||
###############
|
###############
|
||||||
@ -150,7 +137,7 @@ fi
|
|||||||
# can be set to white or black
|
# can be set to white or black
|
||||||
FG=$WHITE
|
FG=$WHITE
|
||||||
BOLD_FG=$BOLD_WHITE
|
BOLD_FG=$BOLD_WHITE
|
||||||
if [[ $REVERSE == 1 ]] ; then
|
if [[ $LP_REVERSE == 1 ]] ; then
|
||||||
FG=$BLACK
|
FG=$BLACK
|
||||||
BOLD_FG=$BOLD_GRAY
|
BOLD_FG=$BOLD_GRAY
|
||||||
fi
|
fi
|
||||||
@ -300,7 +287,7 @@ __shorten_path()
|
|||||||
# the character that will replace the part of the path that is masked
|
# the character that will replace the part of the path that is masked
|
||||||
local mask=" … "
|
local mask=" … "
|
||||||
# index of the directory to keep from the root (starts at 0)
|
# index of the directory to keep from the root (starts at 0)
|
||||||
local keep=$((PATH_KEEP-1))
|
local keep=$((LP_PATH_KEEP-1))
|
||||||
|
|
||||||
local len_percent=$2
|
local len_percent=$2
|
||||||
|
|
||||||
@ -556,7 +543,7 @@ __battery()
|
|||||||
if [[ "${bat}" == "" ]] ; then
|
if [[ "${bat}" == "" ]] ; then
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
if [[ ${bat} -le $BATTERY_THRESHOLD ]] ; then
|
if [[ ${bat} -le $LP_BATTERY_THRESHOLD ]] ; then
|
||||||
echo -n "${bat}"
|
echo -n "${bat}"
|
||||||
return 0
|
return 0
|
||||||
else
|
else
|
||||||
@ -571,7 +558,7 @@ __battery_color()
|
|||||||
if [[ "$?" = "1" ]] ; then return; fi; # no battery support
|
if [[ "$?" = "1" ]] ; then return; fi; # no battery support
|
||||||
|
|
||||||
if [[ "$bat" != "" ]] ; then
|
if [[ "$bat" != "" ]] ; then
|
||||||
if [[ ${bat} -gt $BATTERY_THRESHOLD ]] ; then
|
if [[ ${bat} -gt $LP_BATTERY_THRESHOLD ]] ; then
|
||||||
return; # nothing displayed above 75%
|
return; # nothing displayed above 75%
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -614,7 +601,7 @@ __load_color()
|
|||||||
fi
|
fi
|
||||||
let "load=$load/$__CPUNUM"
|
let "load=$load/$__CPUNUM"
|
||||||
|
|
||||||
if [[ $load -ge $LOAD_THRESHOLD ]]
|
if [[ $load -ge $LP_LOAD_THRESHOLD ]]
|
||||||
then
|
then
|
||||||
ret="l${NO_COL}"
|
ret="l${NO_COL}"
|
||||||
if [[ $load -lt 70 ]] ; then
|
if [[ $load -lt 70 ]] ; then
|
||||||
@ -702,7 +689,7 @@ __set_bash_prompt()
|
|||||||
__USER=$(__user)
|
__USER=$(__user)
|
||||||
__HOST=$(__host_color)
|
__HOST=$(__host_color)
|
||||||
__PERM=$(__permissions_color)
|
__PERM=$(__permissions_color)
|
||||||
__PWD=$(__shorten_path $PWD $PATH_LENGTH)
|
__PWD=$(__shorten_path $PWD $LP_PATH_LENGTH)
|
||||||
|
|
||||||
# right of main prompt: space at left
|
# right of main prompt: space at left
|
||||||
__GIT=$(__sl "$(__git_branch_color)")
|
__GIT=$(__sl "$(__git_branch_color)")
|
||||||
|
26
liquidpromptrc-dist
Normal file
26
liquidpromptrc-dist
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
|
||||||
|
####################################
|
||||||
|
# LIQUID PROMPT CONFIGURATION FILE #
|
||||||
|
####################################
|
||||||
|
|
||||||
|
# Maximal value under which the battery level is displayed
|
||||||
|
# Recommended value is 75
|
||||||
|
LP_BATTERY_THRESHOLD=75
|
||||||
|
|
||||||
|
# Minimal value after which the load average is displayed
|
||||||
|
# Recommended value is 60
|
||||||
|
LP_LOAD_THRESHOLD=60
|
||||||
|
|
||||||
|
# The maximum percentage of the screen width used to display the path
|
||||||
|
# Recommended value is 35
|
||||||
|
LP_PATH_LENGTH=35
|
||||||
|
|
||||||
|
# How many directories to keep at the beginning of a shortened path
|
||||||
|
# Recommended value is 2
|
||||||
|
LP_PATH_KEEP=2
|
||||||
|
|
||||||
|
# Do we use reverse colors (black on white) instead of normal theme (white on black)
|
||||||
|
# Defaults to 0 (normal colors)
|
||||||
|
# set to 1 if you use black on white
|
||||||
|
LP_REVERSE=0
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user