some changes..

This commit is contained in:
Harri Lahtinen 2020-03-18 21:00:09 +02:00
parent 220413fb09
commit feb0d37215
4 changed files with 156 additions and 340 deletions

483
.p10k.zsh
View File

@ -1,353 +1,172 @@
# Original location: https://github.com/romkatv/dotfiles-public/blob/master/.purepower.
# If you copy this file, keep the link to the original and this sentence intact; you are encouraged
# to change everything else.
# Generated by Powerlevel10k configuration wizard on 2020-02-29 at 21:38 EET.
# Based on romkatv/powerlevel10k/config/p10k-pure.zsh, checksum 30812.
# Wizard options: nerdfont-complete + powerline, small icons, pure, original, 2 lines,
# sparse, transient_prompt, instant_prompt=quiet.
# Type `p10k configure` to generate another config.
#
# This file defines configuration options for Powerlevel10k ZSH theme that will make your prompt
# lightweight and sleek, unlike the default bulky look. You can also use it with Powerlevel9k -- a
# great choice if you need an excuse to have a cup of coffee after every command you type.
# Config file for Powerlevel10k with the style of Pure (https://github.com/sindresorhus/pure).
#
# This is how it'll look:
# https://raw.githubusercontent.com/romkatv/dotfiles-public/master/dotfiles/purepower.png.
# Differences from Pure:
#
# Pure Power needs to be installed in addition to Powerlevel10k, not instead of it. Pure Power
# defines a set of configuration parameters that affect the styling of Powerlevel10k; there is no
# code in it.
# - Git:
# - `@c4d3ec2c` instead of something like `v1.4.0~11` when in detached HEAD state.
# - No automatic `git fetch` (the same as in Pure with `PURE_GIT_PULL=0`).
#
# PHILOSOPHY
# Apart from the differences listed above, the replication of Pure prompt is exact. This includes
# even the questionable parts. For example, just like in Pure, there is no indication of Git status
# being stale; prompt symbol is the same in command, visual and overwrite vi modes; when prompt
# doesn't fit on one line, it wraps around with no attempt to shorten it.
#
# This configuration is made for those who care about style and value clear UI without redundancy
# and tacky ornaments that serve no function.
#
# * No overwhelming background that steals attention from real content on your screen.
# * No redundant icons. A clock icon next to the current time takes space without conveying any
# information. This is your personal prompt -- you don't need an icon to remind you that the
# segment on the right shows current time.
# * No separators between prompt segments. Different foreground colors are enough to keep them
# visually distinct.
# * Bright colors for important things, low-contrast colors for everything else.
# * No needless color switching. The number of stashes you have in a git repository is always
# green. Since its meaning is the same in a clean and in a dirty repository, it doesn't change
# color.
# * Works with any font.
#
# LEFT PROMPT
#
# * Your current directory is bright blue when it's writable and brownish when not.
# * The prompt symbol on the left is '' when vicmd keymap is active and '' otherwise. It's green
# if the last command has succeeded and red if it has failed.
# * Git prompt colors:
# * Grey: prompt is refreshing in the background (happens only in large repositories).
# * Green: clean (no stated or unstaged changes and no untracked files).
# * Yellow: dirty (some stated or unstaged changes).
# * Teal: some untracked files but otherwise clean (no staged or unstaged changes).
# * Git prompt icons:
# * '@12345678' (git prompt color): detached HEAD at commit 12345678.
# * 'my-feature' (git prompt color): on branch my-feature.
# * 'my-feature|master' (git prompt color): on branch my-feature tracking remote branch master.
# * '#my-release' (git prompt color): on tag my-release.
# * '+' (yellow): staged changes.
# * '!' (yellow): unstaged changes.
# * '?' (teal): untracked files.
# * '⇡42' (green): 42 commits ahead of remote.
# * '⇣42' (green): 42 commits behind remote.
# * '*42' (green): 42 stashes.
#
# RIGHT PROMPT
#
# * Error code with an optional signal name of the last command if it failed, in red.
# * Last command execution time (in seconds).
# * '⇶' if you have background jobs.
# * user@host in bright yellow if root, grey otherwise.
# * If you type `custom_rprompt() { echo 'message' }` in your terminal, you'll get 'message' shown
# on the right. Useful for integration with your scripts that change some sort of
# state/environment.
#
# INSTALLATION
#
# 1. Copy this file to your home directory.
#
# ( cd && curl -fsSLO https://raw.githubusercontent.com/romkatv/dotfiles-public/master/.purepower )
#
# 2. Source the file from ~/.zshrc.
#
# echo 'source ~/.purepower' >>! ~/.zshrc
#
# 3. Enable Powerlevel10k ZSH theme. The easiest way is this:
#
# git clone https://github.com/romkatv/powerlevel10k.git ~/powerlevel10k
# echo 'source ~/powerlevel10k/powerlevel10k.zsh-theme' >>! ~/.zshrc
#
# If you are using a plugin manager, see https://github.com/romkatv/powerlevel10k for installation
# options.
#
# CONFIGURATION
#
# You can set PURE_POWER_MODE before sourcing ~/.purepower to restrict the range of used characters.
#
# * PURE_POWER_MODE=fancy use unicode characters in the prompt (default)
# * PURE_POWER_MODE=portable use only ascii characters in the prompt
#
# You can switch mode on the fly by setting PURE_POWER_MODE and executing zsh. Useful when you end
# up in a prehistoric environment and see gibberish on your screen.
#
# PURE_POWER_MODE=portable exec zsh # switch to portable mode
# PURE_POWER_MODE=fancy exec zsh # switch to fancy mode
#
# To automatically switch to portable mode when logging in from a terminal that doesn't support
# unicode, put the following incantation in your ~/.zshrc.
#
# [[ $TERM == xterm* ]] || : ${PURE_POWER_MODE:=portable}
# source ~/.purepower
#
# To configure what gets shown in the prompt, edit ~/.purepower. See
# https://github.com/romkatv/powerlevel10k/blob/master/README.md#installation-and-configuration for
# configuration options. Prompt configuration is a deeply personal affair, so take your time to
# craft the right prompt just for you. The stock configuration is merely a starting point, a source
# of inspiration, a frame for your own creation. Mercilessly slash everything of little value to
# you. Don't care how long commands take to execute? Get rid of command_execution_time segment!
# Boldly mold prompt pieces useful to you to ensure a perfect fit to your workflow and aesthetic
# preferences. Take full advantage of powerlevel over 9k!
#
# Remember that colors looks differently in different terminals. Use this script to choose what
# works best for you.
#
# for i in {0..255}; do print -P "%F{${(l:3::0:)i}}${(l:3::0:)i} TEST%f"; done
#
# Keep in mind that some prompt segments can appear and disappear depending on the state of your
# environment. Make sure colors work well in every situation. Neighboring segments should always
# have distinct colors.
#
# Try different fonts. Pure Power doesn't use esoteric symbols even in fancy mode and thus doesn't
# require a patched font. Any monospace font will do, although some are notoriously bad at
# displaying non-ascii symbols in terminals.
#
# If you are using Pure Power with Powerlevel9k rather than Powerlevel10k, you'll need to set
# PURE_POWER_USE_P10K_EXTENSIONS=0 before sourcing ~/.purepower or you'll see gibberish in your left
# prompt. This option will turn off vi keymap integration, so your prompt symbol will always be ''.
# Your prompt will also be 10-100 times slower with Powerlevel9k. This is not the fault of Pure
# Power. Powerlevel9k is slow with any styling.
#
# ATTRIBUTION
#
# Visual design of this configuration borrows heavily from https://github.com/sindresorhus/pure.
# Recreation of Pure look and feel in Powerlevel10k was inspired by
# https://github.com/iboyperson/p9k-theme-pastel. The origin myth is chiseled onto
# https://www.reddit.com/r/zsh/comments/b45w6v/.
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
# Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block; everything else may go below.
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi
# Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block; everything else may go below.
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi
# If you like the general style of Pure but not particularly attached to all its quirks, type
# `p10k configure` and pick "Lean" style. This will give you slick minimalist prompt while taking
# advantage of Powerlevel10k features that aren't present in Pure.
if test -z "${ZSH_VERSION}"; then
echo "purepower: unsupported shell; try zsh instead" >&2
return 1
exit 1
fi
# Temporarily change options.
'builtin' 'local' '-a' 'p10k_config_opts'
[[ ! -o 'aliases' ]] || p10k_config_opts+=('aliases')
[[ ! -o 'sh_glob' ]] || p10k_config_opts+=('sh_glob')
[[ ! -o 'no_brace_expand' ]] || p10k_config_opts+=('no_brace_expand')
'builtin' 'setopt' 'no_aliases' 'no_sh_glob' 'brace_expand'
() {
emulate -L zsh && setopt no_unset pipe_fail
emulate -L zsh
typeset -ga POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(
dir # current directory
vcs # git status
autoload -Uz is-at-least && is-at-least 5.1 || return
# Unset all configuration options.
unset -m 'POWERLEVEL9K_*'
# Prompt colors.
local grey='242'
local red='1'
local yellow='3'
local blue='4'
local magenta='5'
local cyan='6'
local white='7'
# Left prompt segments.
typeset -g POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(
# =========================[ Line #1 ]=========================
context # user@host
dir # current directory
vcs # git status
command_execution_time # previous command duration
# =========================[ Line #2 ]=========================
newline # \n
virtualenv # python virtual environment
prompt_char # prompt symbol
)
typeset -ga POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(
status # exit code of the last command
# command_execution_time # duration of the last command
background_jobs # presence of background jobs
# virtualenv # python virtual environment (https://docs.python.org/3/library/venv.html)
# anaconda # conda environment (https://conda.io/)
# pyenv # python environment (https://github.com/pyenv/pyenv)
# kubecontext # current kubernetes context (https://kubernetes.io/)
custom_rprompt # the output of function `custom_rprompt()` if it is defined
context # user@host
# time # current time
battery
# Right prompt segments.
typeset -g POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(
# =========================[ Line #1 ]=========================
# command_execution_time # previous command duration
# virtualenv # python virtual environment
# context # user@host
# time # current time
# =========================[ Line #2 ]=========================
newline # \n
)
# `$(_pp_c x y`) evaluates to `y` if the terminal supports >= 256 colors and to `x` otherwise.
zmodload zsh/terminfo
if (( terminfo[colors] >= 256 )); then
function _pp_c() { print -nr -- $2 }
else
function _pp_c() { print -nr -- $1 }
typeset -g POWERLEVEL9K_IGNORE_TERM_COLORS=true
fi
# Basic style options that define the overall prompt look.
typeset -g POWERLEVEL9K_BACKGROUND= # transparent background
typeset -g POWERLEVEL9K_{LEFT,RIGHT}_{LEFT,RIGHT}_WHITESPACE= # no surrounding whitespace
typeset -g POWERLEVEL9K_{LEFT,RIGHT}_SUBSEGMENT_SEPARATOR=' ' # separate segments with a space
typeset -g POWERLEVEL9K_{LEFT,RIGHT}_SEGMENT_SEPARATOR= # no end-of-line symbol
typeset -g POWERLEVEL9K_VISUAL_IDENTIFIER_EXPANSION= # no segment icons
# `$(_pp_s x y`) evaluates to `x` in portable mode and to `y` in fancy mode.
if [[ ${PURE_POWER_MODE:-fancy} == fancy ]]; then
function _pp_s() { print -nr -- $2 }
else
if [[ $PURE_POWER_MODE != portable ]]; then
echo -En "purepower: invalid mode: ${(qq)PURE_POWER_MODE}; " >&2
echo -E "valid options are 'fancy' and 'portable'; falling back to 'portable'" >&2
fi
function _pp_s() { print -nr -- $1 }
fi
# Add an empty line before each prompt except the first. This doesn't emulate the bug
# in Pure that makes prompt drift down whenever you use the Alt-C binding from fzf or similar.
typeset -g POWERLEVEL9K_PROMPT_ADD_NEWLINE=true
local ins=$(_pp_s '>' '')
local cmd=$(_pp_s '<' '')
if (( ${PURE_POWER_USE_P10K_EXTENSIONS:-1} )); then
local p="\${\${\${KEYMAP:-0}:#vicmd}:+${${ins//\\/\\\\}//\}/\\\}}}"
p+="\${\${\$((!\${#\${KEYMAP:-0}:#vicmd})):#0}:+${${cmd//\\/\\\\}//\}/\\\}}}"
else
local p=$ins
fi
# Magenta prompt symbol if the last command succeeded.
typeset -g POWERLEVEL9K_PROMPT_CHAR_OK_{VIINS,VICMD,VIVIS}_FOREGROUND=$magenta
# Red prompt symbol if the last command failed.
typeset -g POWERLEVEL9K_PROMPT_CHAR_ERROR_{VIINS,VICMD,VIVIS}_FOREGROUND=$red
# Default prompt symbol.
typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIINS_CONTENT_EXPANSION=''
# Prompt symbol in command vi mode.
typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VICMD_CONTENT_EXPANSION=''
# Prompt symbol in visual vi mode is the same as in command mode.
typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIVIS_CONTENT_EXPANSION=''
# Prompt symbol in overwrite vi mode is the same as in command mode.
typeset -g POWERLEVEL9K_PROMPT_CHAR_OVERWRITE_STATE=false
if (( ${PURE_POWER_USE_P10K_EXTENSIONS:-1} )); then
typeset -g POWERLEVEL9K_SHOW_RULER=true
typeset -g POWERLEVEL9K_RULER_CHAR=$(_pp_s '-' '─')
typeset -g POWERLEVEL9K_RULER_BACKGROUND=none
typeset -g POWERLEVEL9K_RULER_FOREGROUND=$(_pp_c 7 237)
else
typeset -g POWERLEVEL9K_PROMPT_ADD_NEWLINE=true
function custom_rprompt() { }
fi
typeset -g POWERLEVEL9K_MODE=nerdfont-complete
# Grey Python Virtual Environment.
typeset -g POWERLEVEL9K_VIRTUALENV_FOREGROUND=$grey
# Don't show Python version.
typeset -g POWERLEVEL9K_VIRTUALENV_SHOW_PYTHON_VERSION=false
typeset -g POWERLEVEL9K_VIRTUALENV_{LEFT,RIGHT}_DELIMITER=
typeset -g POWERLEVEL9K_LEFT_SEGMENT_END_SEPARATOR=
typeset -g POWERLEVEL9K_PROMPT_ON_NEWLINE=true
typeset -g POWERLEVEL9K_RPROMPT_ON_NEWLINE=false
typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_PREFIX=
typeset -g POWERLEVEL9K_MULTILINE_LAST_PROMPT_PREFIX="%F{%(?.$(_pp_c 2 76).$(_pp_c 1 196))}$p%f "
# Blue current directory.
typeset -g POWERLEVEL9K_DIR_FOREGROUND=$blue
typeset -g POWERLEVEL9K_{LEFT,RIGHT}_SEGMENT_SEPARATOR=
typeset -g POWERLEVEL9K_{LEFT,RIGHT}_SUBSEGMENT_SEPARATOR=' '
typeset -g POWERLEVEL9K_WHITESPACE_BETWEEN_{LEFT,RIGHT}_SEGMENTS=
# Context format when root: user@host. The first part white, the rest grey.
typeset -g POWERLEVEL9K_CONTEXT_ROOT_TEMPLATE="%F{$white}%n%f%F{$grey}@%m%f"
# Context format when not root: user@host. The whole thing grey.
typeset -g POWERLEVEL9K_CONTEXT_TEMPLATE="%F{$grey}%n@%m%f"
# Don't show context unless root or in SSH.
typeset -g POWERLEVEL9K_CONTEXT_{DEFAULT,SUDO}_CONTENT_EXPANSION=
typeset -g POWERLEVEL9K_DIR_SHOW_WRITABLE=true
typeset -g POWERLEVEL9K_DIR_{ETC,HOME,HOME_SUBFOLDER,DEFAULT,NOT_WRITABLE}_BACKGROUND=none
typeset -g POWERLEVEL9K_DIR_NOT_WRITABLE_FOREGROUND=$(_pp_c 3 209)
typeset -g POWERLEVEL9K_DIR_{HOME,HOME_SUBFOLDER,ETC,DEFAULT}_FOREGROUND=$(_pp_c 4 6)
typeset -g POWERLEVEL9K_{ETC,FOLDER,HOME,HOME_SUB,LOCK}_ICON=
typeset -g POWERLEVEL9K_DIR_HYPERLINK=false
# Show battery in red when it's below this level and not connected to power supply.
typeset -g POWERLEVEL9K_BATTERY_LOW_THRESHOLD=20
typeset -g POWERLEVEL9K_BATTERY_LOW_FOREGROUND=1
# Show battery in green when it's charging.
typeset -g POWERLEVEL9K_BATTERY_CHARGING_FOREGROUND=2
# Show battery in yellow when not connected to power supply.
typeset -g POWERLEVEL9K_BATTERY_DISCONNECTED_FOREGROUND=3
# Battery pictograms going from low to high level of charge.
typeset -g POWERLEVEL9K_BATTERY_STAGES='▁▂▃▄▅▆▇'
# Display battery pictogram on black background.
typeset -g POWERLEVEL9K_BATTERY_VISUAL_IDENTIFIER_EXPANSION='%0K${P9K_VISUAL_IDENTIFIER}%k'
# Don't show battery when it's fully charged and connected to power supply.
typeset -g POWERLEVEL9K_BATTERY_CHARGED_{CONTENT,VISUAL_IDENTIFIER}_EXPANSION=
# Don't show the remaining time to charge/discharge.
typeset -g POWERLEVEL9K_BATTERY_VERBOSE=false
# Show previous command duration only if it's >= 5s.
typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_THRESHOLD=5
# Don't show fractional seconds. Thus, 7s rather than 7.3s.
typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_PRECISION=0
# Duration format: 1d 2h 3m 4s.
typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_FORMAT='d h m s'
# Yellow previous command duration.
typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_FOREGROUND=$yellow
typeset -g POWERLEVEL9K_VCS_{CLEAN,UNTRACKED,MODIFIED,LOADING}_BACKGROUND=none
typeset -g POWERLEVEL9K_VCS_CLEAN_FOREGROUND=$(_pp_c 2 76)
typeset -g POWERLEVEL9K_VCS_UNTRACKED_FOREGROUND=$(_pp_c 6 14)
typeset -g POWERLEVEL9K_VCS_MODIFIED_FOREGROUND=$(_pp_c 3 11)
typeset -g POWERLEVEL9K_VCS_LOADING_FOREGROUND=$(_pp_c 5 244)
typeset -g POWERLEVEL9K_VCS_{CLEAN,UNTRACKED,MODIFIED}_UNTRACKEDFORMAT_FOREGROUND=$POWERLEVEL9K_VCS_UNTRACKED_FOREGROUND
typeset -g POWERLEVEL9K_VCS_{CLEAN,UNTRACKED,MODIFIED}_UNSTAGEDFORMAT_FOREGROUND=$POWERLEVEL9K_VCS_MODIFIED_FOREGROUND
typeset -g POWERLEVEL9K_VCS_{CLEAN,UNTRACKED,MODIFIED}_STAGEDFORMAT_FOREGROUND=$POWERLEVEL9K_VCS_MODIFIED_FOREGROUND
typeset -g POWERLEVEL9K_VCS_{CLEAN,UNTRACKED,MODIFIED}_INCOMING_CHANGESFORMAT_FOREGROUND=$POWERLEVEL9K_VCS_CLEAN_FOREGROUND
typeset -g POWERLEVEL9K_VCS_{CLEAN,UNTRACKED,MODIFIED}_OUTGOING_CHANGESFORMAT_FOREGROUND=$POWERLEVEL9K_VCS_CLEAN_FOREGROUND
typeset -g POWERLEVEL9K_VCS_{CLEAN,UNTRACKED,MODIFIED}_STASHFORMAT_FOREGROUND=$POWERLEVEL9K_VCS_CLEAN_FOREGROUND
typeset -g POWERLEVEL9K_VCS_{CLEAN,UNTRACKED,MODIFIED}_ACTIONFORMAT_FOREGROUND=1
typeset -g POWERLEVEL9K_VCS_LOADING_ACTIONFORMAT_FOREGROUND=$POWERLEVEL9K_VCS_LOADING_FOREGROUND
typeset -g POWERLEVEL9K_VCS_{GIT,GIT_GITHUB,GIT_BITBUCKET,GIT_GITLAB,BRANCH}_ICON=
typeset -g POWERLEVEL9K_VCS_REMOTE_BRANCH_ICON=$'%{\b|%}'
typeset -g POWERLEVEL9K_VCS_BRANCH_ICON='\uE0A0 '
# Grey Git prompt. This makes stale prompts indistinguishable from up-to-date ones.
typeset -g POWERLEVEL9K_VCS_FOREGROUND=$grey
# Disable async loading indicator to make directories that aren't Git repositories
# indistinguishable from large Git repositories without known state.
typeset -g POWERLEVEL9K_VCS_LOADING_TEXT=
# Don't wait for Git status even for a millisecond, so that prompt always updates
# asynchronously when Git state changes.
typeset -g POWERLEVEL9K_VCS_MAX_SYNC_LATENCY_SECONDS=0
# Cyan ahead/behind arrows.
typeset -g POWERLEVEL9K_VCS_{INCOMING,OUTGOING}_CHANGESFORMAT_FOREGROUND=$cyan
# Don't show remote branch, current tag or stashes.
typeset -g POWERLEVEL9K_VCS_GIT_HOOKS=(vcs-detect-changes git-untracked git-aheadbehind)
# Don't show the branch icon.
typeset -g POWERLEVEL9K_VCS_BRANCH_ICON=
# When in detached HEAD state, show @commit where branch normally goes.
typeset -g POWERLEVEL9K_VCS_COMMIT_ICON='@'
typeset -g POWERLEVEL9K_VCS_INCOMING_CHANGES_ICON=$(_pp_s '<' '⇣')
typeset -g POWERLEVEL9K_VCS_OUTGOING_CHANGES_ICON=$(_pp_s '>' '⇡')
typeset -g POWERLEVEL9K_VCS_STASH_ICON='*'
typeset -g POWERLEVEL9K_VCS_TAG_ICON=$'%{\b#%}'
if (( ${PURE_POWER_USE_P10K_EXTENSIONS:-1} )); then
typeset -g POWERLEVEL9K_VCS_{STAGED,UNSTAGED}_MAX_NUM=99
typeset -g POWERLEVEL9K_VCS_UNTRACKED_ICON='?'
typeset -g POWERLEVEL9K_VCS_UNSTAGED_ICON='!'
typeset -g POWERLEVEL9K_VCS_STAGED_ICON='+'
else
typeset -g POWERLEVEL9K_VCS_UNTRACKED_ICON=$'%{\b?%}'
typeset -g POWERLEVEL9K_VCS_UNSTAGED_ICON=$'%{\b!%}'
typeset -g POWERLEVEL9K_VCS_STAGED_ICON=$'%{\b+%}'
fi
# Don't show staged, unstaged, untracked indicators.
typeset -g POWERLEVEL9K_VCS_{STAGED,UNSTAGED,UNTRACKED}_ICON=
# Show '*' when there are staged, unstaged or untracked files.
typeset -g POWERLEVEL9K_VCS_DIRTY_ICON='*'
# Show '⇣' if local branch is behind remote.
typeset -g POWERLEVEL9K_VCS_INCOMING_CHANGES_ICON=':⇣'
# Show '⇡' if local branch is ahead of remote.
typeset -g POWERLEVEL9K_VCS_OUTGOING_CHANGES_ICON=':⇡'
# Don't show the number of commits next to the ahead/behind arrows.
typeset -g POWERLEVEL9K_VCS_{COMMITS_AHEAD,COMMITS_BEHIND}_MAX_NUM=1
# Remove space between '⇣' and '⇡' and all trailing spaces.
typeset -g POWERLEVEL9K_VCS_CONTENT_EXPANSION='${${${P9K_CONTENT/⇣* :⇡/⇣⇡}// }//:/ }'
typeset -g POWERLEVEL9K_STATUS_OK=false
typeset -g POWERLEVEL9K_STATUS_ERROR_BACKGROUND=none
typeset -g POWERLEVEL9K_STATUS_ERROR_FOREGROUND=$(_pp_c 1 9)
typeset -g POWERLEVEL9K_CARRIAGE_RETURN_ICON=
typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_THRESHOLD=0
typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_BACKGROUND=none
typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_FOREGROUND=$(_pp_c 5 101)
typeset -g POWERLEVEL9K_EXECUTION_TIME_ICON=
typeset -g POWERLEVEL9K_BACKGROUND_JOBS_VERBOSE=false
typeset -g POWERLEVEL9K_BACKGROUND_JOBS_BACKGROUND=none
typeset -g POWERLEVEL9K_BACKGROUND_JOBS_VISUAL_IDENTIFIER_COLOR=2
typeset -g POWERLEVEL9K_BACKGROUND_JOBS_ICON=$(_pp_s '%%' '⇶')
typeset -g POWERLEVEL9K_CUSTOM_RPROMPT=custom_rprompt
typeset -g POWERLEVEL9K_CUSTOM_RPROMPT_BACKGROUND=none
typeset -g POWERLEVEL9K_CUSTOM_RPROMPT_FOREGROUND=$(_pp_c 4 12)
typeset -g POWERLEVEL9K_CONTEXT_{DEFAULT,ROOT,REMOTE_SUDO,REMOTE,SUDO}_BACKGROUND=none
typeset -g POWERLEVEL9K_CONTEXT_{DEFAULT,REMOTE_SUDO,REMOTE,SUDO}_FOREGROUND=$(_pp_c 7 244)
typeset -g POWERLEVEL9K_CONTEXT_ROOT_FOREGROUND=$(_pp_c 3 11)
typeset -g POWERLEVEL9K_VIRTUALENV_BACKGROUND=none
typeset -g POWERLEVEL9K_VIRTUALENV_FOREGROUND=6
typeset -g POWERLEVEL9K_VIRTUALENV_SHOW_PYTHON_VERSION=true
typeset -g POWERLEVEL9K_VIRTUALENV_LEFT_DELIMITER=
typeset -g POWERLEVEL9K_VIRTUALENV_RIGHT_DELIMITER=
typeset -g POWERLEVEL9K_ANACONDA_BACKGROUND=none
typeset -g POWERLEVEL9K_ANACONDA_FOREGROUND=6
typeset -g POWERLEVEL9K_ANACONDA_SHOW_PYTHON_VERSION=true
typeset -g POWERLEVEL9K_ANACONDA_LEFT_DELIMITER=
typeset -g POWERLEVEL9K_ANACONDA_RIGHT_DELIMITER=
typeset -g POWERLEVEL9K_PYENV_BACKGROUND=none
typeset -g POWERLEVEL9K_PYENV_FOREGROUND=6
typeset -g POWERLEVEL9K_PYENV_PROMPT_ALWAYS_SHOW=false
# Icon for virtualenv, anaconda and pyenv.
typeset -g POWERLEVEL9K_PYTHON_ICON=
# Don't show trailing "/default" in kubernetes context.
typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_DEFAULT_NAMESPACE=false
# Kubernetes context classes for the purpose of using different colors with different contexts.
#
# POWERLEVEL9K_KUBECONTEXT_CLASSES is an array with even number of elements. The first element in
# each pair defines a pattern against which the current kubernetes context (in the format it is
# displayed in the prompt) gets matched. The second element defines the context class. Patterns
# are tried in order. The first match wins.
#
# For example, if your current kubernetes context is "deathray-testing", its class is TEST because
# "deathray-testing" doesn't match the pattern '*prod*' but does match '*test*'. Hence it'll be
# shown with the color of $POWERLEVEL9K_KUBECONTEXT_TEST_FOREGROUND.
typeset -g POWERLEVEL9K_KUBECONTEXT_CLASSES=(
'*prod*' PROD
'*test*' TEST
'*' DEFAULT)
typeset -g POWERLEVEL9K_KUBECONTEXT_{PROD,TEST,DEFAULT}_BACKGROUND=none
typeset -g POWERLEVEL9K_KUBECONTEXT_PROD_FOREGROUND=1
typeset -g POWERLEVEL9K_KUBECONTEXT_TEST_FOREGROUND=2
typeset -g POWERLEVEL9K_KUBECONTEXT_DEFAULT_FOREGROUND=3
typeset -g POWERLEVEL9K_KUBERNETES_ICON=
typeset -g POWERLEVEL9K_TIME_BACKGROUND=none
typeset -g POWERLEVEL9K_TIME_FOREGROUND=$(_pp_c 7 66)
typeset -g POWERLEVEL9K_TIME_ICON=
# Format for the time segment: 09:51:02. See `man 3 strftime`.
# Grey current time.
typeset -g POWERLEVEL9K_TIME_FOREGROUND=$grey
# Format for the current time: 09:51:02. See `man 3 strftime`.
typeset -g POWERLEVEL9K_TIME_FORMAT='%D{%H:%M:%S}'
# If set to true, time will update when you hit enter. This way prompts for the past
# commands will contain the start times of their commands rather than the end times of
# their preceding commands.
typeset -g POWERLEVEL9K_TIME_UPDATE_ON_COMMAND=false
# Transient prompt works similarly to the builtin transient_rprompt option. It trims down prompt
# when accepting a command line. Supported values:
#
# - off: Don't change prompt when accepting a command line.
# - always: Trim down prompt when accepting a command line.
# - same-dir: Trim down prompt when accepting a command line unless this is the first command
# typed after changing current working directory.
typeset -g POWERLEVEL9K_TRANSIENT_PROMPT=always
# Instant prompt mode.
#
@ -366,5 +185,11 @@ fi
# can slow down prompt by 1-2 milliseconds, so it's better to keep it turned off unless you
# really need it.
typeset -g POWERLEVEL9K_DISABLE_HOT_RELOAD=true
unfunction _pp_c _pp_s
} "$@"
# If p10k is already loaded, reload configuration.
# This works even with POWERLEVEL9K_DISABLE_HOT_RELOAD=true.
(( ! $+functions[p10k] )) || p10k reload
}
(( ${#p10k_config_opts} )) && setopt ${p10k_config_opts[@]}
'builtin' 'unset' 'p10k_config_opts'

11
.zshrc
View File

@ -67,7 +67,7 @@ plugins=(
source $ZSH/oh-my-zsh.sh
# My scripts
PATH=/usr/local/bin:/home/hate/.local/bin:/home/hate/.config/Scripts:/home/hate/.gem/ruby/2.5.0/bin:$PATH
PATH=/usr/local/bin:/home/hate/.local/bin:/home/hate/.config/Scripts:$PATH
# Wpg restore on terminals
(cat ~/.config/wpg/sequences &)
@ -96,14 +96,5 @@ LFCD="/home/hate/.config/lf/lfcd.sh"
bindkey -s '^o' 'lfcd\n'
# The next line updates PATH for the Google Cloud SDK.
if [ -f '/home/hate/google-cloud-sdk/path.zsh.inc' ]; then source '/home/hate/google-cloud-sdk/path.zsh.inc'; fi
# The next line enables shell command completion for gcloud.
if [ -f '/home/hate/google-cloud-sdk/completion.zsh.inc' ]; then source '/home/hate/google-cloud-sdk/completion.zsh.inc'; fi
# Spaceship
SPACESHIP_BATTERY_THRESHOLD=40
# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh

View File

@ -126,6 +126,7 @@ python-musicbrainzngs
python-mutagen
python-pillow
python-pip
python-pynvim
python-pyqt5
python-pywal
python-setuptools

View File

@ -19,7 +19,6 @@ lightdm-mini-greeter
mcomix-gtk3-git
networkmanager-dmenu-git
numix-cursor-theme
oomox-git
otf-font-awesome-4
pac-util-git
pacback