130 lines
4.9 KiB
Nix
130 lines
4.9 KiB
Nix
{pkgs, ...}: {
|
|
home.packages = with pkgs; [liquidprompt];
|
|
xdg.configFile."liquidpromptrc".text = ''
|
|
source ~/.config/liquidprompt.theme
|
|
LOCAL_RCFILE=$HOME/.config/liquidpromptrc.local
|
|
LP_ALWAYS_DISPLAY_VALUES=1
|
|
LP_BATTERY_THRESHOLD=75
|
|
LP_DISABLED_VCS_PATH=""
|
|
LP_DISPLAY_VALUES_AS_PERCENTS=1
|
|
LP_ENABLE_BATT=1
|
|
LP_ENABLE_BZR=0
|
|
LP_ENABLE_DIRSTACK=0
|
|
LP_ENABLE_FOSSIL=0
|
|
LP_ENABLE_FQDN=0
|
|
LP_ENABLE_GIT=1
|
|
LP_ENABLE_HG=0
|
|
LP_ENABLE_JOBS=1
|
|
LP_ENABLE_LOAD=1
|
|
LP_ENABLE_PERM=1
|
|
LP_ENABLE_PROXY=0
|
|
LP_ENABLE_RUNTIME=1
|
|
LP_ENABLE_SCLS=0
|
|
LP_ENABLE_SCREEN_TITLE=1
|
|
LP_ENABLE_SHLVL=0
|
|
LP_ENABLE_SHORTEN_PATH=1
|
|
LP_ENABLE_SSH_COLORS=1
|
|
LP_ENABLE_SUDO=0
|
|
LP_ENABLE_SVN=0
|
|
LP_ENABLE_TEMP=0
|
|
LP_ENABLE_TIME=1
|
|
LP_ENABLE_TITLE=0
|
|
LP_ENABLE_VCS_ROOT=0
|
|
LP_ENABLE_VIRTUALENV=1
|
|
LP_HOSTNAME_ALWAYS=1
|
|
LP_HOSTNAME_METHOD=short
|
|
LP_LOAD_THRESHOLD=0.60
|
|
LP_PATH_KEEP=2
|
|
LP_PATH_LENGTH=35
|
|
LP_RUNTIME_THRESHOLD=2
|
|
LP_TEMP_THRESHOLD=60
|
|
LP_TIME_ANALOG=0
|
|
LP_TIME_FORMAT="%_I:%M %p"
|
|
LP_USER_ALWAYS=1
|
|
[ -f "$LOCAL_RCFILE" ] && source "$LOCAL_RCFILE"
|
|
'';
|
|
xdg.configFile."liquidprompt.theme".text = ''
|
|
if [[ "$(locale -k LC_CTYPE | sed -n 's/^charmap="\(.*\)"/\1/p')" == *"UTF-8"* ]]; then
|
|
LP_MARK_BATTERY="⌁" # in front of the battery charge
|
|
LP_MARK_ADAPTER="⏚" # displayed when plugged
|
|
LP_MARK_LOAD="⌂" # in front of the load
|
|
LP_MARK_TEMP="θ" # in front of the temp
|
|
LP_MARK_PROXY="↥" # indicate a proxy in use
|
|
LP_MARK_HG="☿" # prompt mark in hg repositories
|
|
LP_MARK_SVN="‡" # prompt mark in svn repositories
|
|
LP_MARK_GIT="±" # prompt mark in git repositories
|
|
LP_MARK_FOSSIL="⌘" # prompt mark in fossil repositories
|
|
LP_MARK_DISABLED="⌀" # prompt mark in directory with disabled VCS info
|
|
LP_MARK_UNTRACKED="*" # if git has untracked files
|
|
LP_MARK_STASH="+" # if git has stashs
|
|
LP_MARK_SHORTEN_PATH=" … " # prompt mark in shortened paths
|
|
LP_MARK_PERM=":" # separator between host and path
|
|
else
|
|
LP_MARK_BATTERY="b"
|
|
LP_MARK_ADAPTER="p"
|
|
LP_MARK_LOAD="c"
|
|
LP_MARK_TEMP="T"
|
|
LP_MARK_PROXY="^"
|
|
LP_MARK_HG="m"
|
|
LP_MARK_SVN="="
|
|
LP_MARK_GIT="+"
|
|
LP_MARK_FOSSIL="f"
|
|
LP_MARK_DISABLED="!"
|
|
LP_MARK_UNTRACKED="*"
|
|
LP_MARK_STASH="+"
|
|
LP_MARK_SHORTEN_PATH=" ... "
|
|
LP_MARK_PERM=":"
|
|
fi
|
|
LP_MARK_BRACKET_OPEN="[" # open bracket
|
|
LP_MARK_BRACKET_CLOSE="]" # close bracket
|
|
LP_MARK_PREFIX=" " # prompt mark prefix
|
|
LP_PS1_PREFIX=""
|
|
LP_PS1_POSTFIX=""
|
|
LP_COLOR_PATH="$BOLD" # as normal user
|
|
LP_COLOR_PATH_ROOT="$BOLD_YELLOW" # as root
|
|
LP_COLOR_PROXY="$BOLD_BLUE"
|
|
LP_COLOR_JOB_D="$YELLOW" # Detached (aka screen sessions)
|
|
LP_COLOR_JOB_R="$BOLD_YELLOW" # Running (xterm &)
|
|
LP_COLOR_JOB_Z="$BOLD_YELLOW" # Sleeping (Ctrl-Z)
|
|
LP_COLOR_ERR="$PURPLE"
|
|
LP_COLOR_MARK="$BOLD" # as user
|
|
LP_COLOR_MARK_ROOT="$BOLD_RED" # as root
|
|
LP_COLOR_MARK_SUDO="$BOLD_RED" # when sudo credentials are cached
|
|
LP_COLOR_USER_LOGGED="" # user who logged in
|
|
LP_COLOR_USER_ALT="$BOLD" # user but not the one who logged in
|
|
LP_COLOR_USER_ROOT="$BOLD_YELLOW" # root
|
|
LP_COLOR_HOST="" # local host
|
|
LP_COLOR_SSH="$BLUE" # connected via SSH
|
|
LP_COLOR_SU="$BOLD_YELLOW" # connected remotely but in new environment through su/sudo
|
|
LP_COLOR_TELNET="$WARN_RED" # connected via telnet
|
|
LP_COLOR_X11_ON="$GREEN" # connected with X11 support
|
|
LP_COLOR_X11_OFF="$YELLOW" # connected without X11 support
|
|
LP_COLOR_WRITE="$GREEN" # have write permission
|
|
LP_COLOR_NOWRITE="$RED" # do not have write permission
|
|
LP_COLOR_UP="$GREEN" # repository is up to date / a push have been made
|
|
LP_COLOR_COMMITS="$YELLOW" # some commits have not been pushed
|
|
LP_COLOR_COMMITS_BEHIND="$BOLD_RED" # some commits have not been pushed
|
|
LP_COLOR_CHANGES="$RED" # there is some changes to commit
|
|
LP_COLOR_DIFF="$PURPLE" # number of lines impacted by current changes
|
|
LP_COLOR_CHARGING_ABOVE="$GREEN" # charging and above threshold
|
|
LP_COLOR_CHARGING_UNDER="$YELLOW" # charging but under threshold
|
|
LP_COLOR_DISCHARGING_ABOVE="$YELLOW" # discharging but above threshold
|
|
LP_COLOR_DISCHARGING_UNDER="$RED" # discharging and under threshold
|
|
LP_COLOR_TIME="$BOLD_WHITE"
|
|
LP_COLOR_IN_MULTIPLEXER="$BOLD_BLUE"
|
|
LP_COLOR_VIRTUALENV="$CYAN"
|
|
LP_COLOR_RUNTIME="$YELLOW"
|
|
LP_COLORMAP=(
|
|
""
|
|
"$GREEN"
|
|
"$BOLD_GREEN"
|
|
"$YELLOW"
|
|
"$BOLD_YELLOW"
|
|
"$RED"
|
|
"$BOLD_RED"
|
|
"$WARN_RED"
|
|
"$CRIT_RED"
|
|
"$DANGER_RED"
|
|
)
|
|
'';
|
|
}
|