From 6771b74180157e408edba8071cdcc5f49e8f32b2 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Sun, 3 Jan 2021 15:24:44 +0100 Subject: home-manager tweaks --- user-profiles/zsh/p10k.zsh | 121 +++++++++++++++++++++++++++------------------ 1 file changed, 72 insertions(+), 49 deletions(-) (limited to 'user-profiles') diff --git a/user-profiles/zsh/p10k.zsh b/user-profiles/zsh/p10k.zsh index 517b6a9b..dd540296 100644 --- a/user-profiles/zsh/p10k.zsh +++ b/user-profiles/zsh/p10k.zsh @@ -1,8 +1,7 @@ -# Generated by Powerlevel10k configuration wizard on 2020-10-15 at 12:01 UTC. +# Generated by Powerlevel10k configuration wizard on 2021-01-03 at 14:51 CET. # Based on romkatv/powerlevel10k/config/p10k-lean.zsh. -# Wizard options: nerdfont-complete + powerline, small icons, unicode, lean, 24h time, -# 2 lines, solid, no frame, dark-ornaments, sparse, many icons, concise, -# transient_prompt, instant_prompt=off. +# Wizard options: powerline, unicode, lean, 24h time, 2 lines, solid, no frame, +# darkest-ornaments, sparse, concise, transient_prompt, instant_prompt=quiet. # Type `p10k configure` to generate another config. # # Config for Powerlevel10k with lean prompt style. Type `p10k configure` to generate @@ -32,7 +31,7 @@ # The list of segments shown on the left. Fill it with the most important segments. typeset -g POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=( # =========================[ Line #1 ]========================= - os_icon # os identifier + # os_icon # os identifier dir # current directory vcs # git status # =========================[ Line #2 ]========================= @@ -73,6 +72,7 @@ jenv # java version from jenv (https://github.com/jenv/jenv) plenv # perl version from plenv (https://github.com/tokuhirom/plenv) phpenv # php version from phpenv (https://github.com/phpenv/phpenv) + scalaenv # scala version from scalaenv (https://github.com/scalaenv/scalaenv) haskell_stack # haskell version from stack (https://haskellstack.org/) kubecontext # current kubernetes context (https://kubernetes.io/) terraform # terraform workspace (https://www.terraform.io) @@ -108,7 +108,7 @@ ) # Defines character set used by powerlevel10k. It's best to let `p10k configure` set it for you. - typeset -g POWERLEVEL9K_MODE=nerdfont-complete + typeset -g POWERLEVEL9K_MODE=powerline # When set to `moderate`, some icons will have an extra space after them. This is meant to avoid # icon overlap when using non-monospace fonts. When set to `none`, spaces are not added. typeset -g POWERLEVEL9K_ICON_PADDING=none @@ -155,7 +155,7 @@ # POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_CHAR=' ' below. typeset -g POWERLEVEL9K_SHOW_RULER=false typeset -g POWERLEVEL9K_RULER_CHAR='─' # reasonable alternative: '·' - typeset -g POWERLEVEL9K_RULER_FOREGROUND=240 + typeset -g POWERLEVEL9K_RULER_FOREGROUND=238 # Filler between left and right prompt on the first prompt line. You can set it to '·' or '─' # to make it easier to see the alignment between left and right prompt and to separate prompt @@ -166,7 +166,7 @@ typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_CHAR='─' if [[ $POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_CHAR != ' ' ]]; then # The color of the filler. - typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_FOREGROUND=240 + typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_FOREGROUND=238 # Add a space between the end of left prompt and the filler. typeset -g POWERLEVEL9K_LEFT_PROMPT_LAST_SEGMENT_END_SYMBOL=' ' # Add a space between the filler and the start of right prompt. @@ -180,8 +180,8 @@ #################################[ os_icon: os identifier ]################################## # OS identifier color. typeset -g POWERLEVEL9K_OS_ICON_FOREGROUND= - # Make the icon bold. - typeset -g POWERLEVEL9K_OS_ICON_CONTENT_EXPANSION='${P9K_CONTENT}' + # Custom icon. + # typeset -g POWERLEVEL9K_OS_ICON_CONTENT_EXPANSION='⭐' ################################[ prompt_char: prompt symbol ]################################ # Green prompt symbol if the last command succeeded. @@ -248,6 +248,11 @@ # /foo/bar/git_repo/nested_git_repo/baz, prompt will display git_repo/nested_git_repo/baz (first) # or nested_git_repo/baz (last). This assumes that git_repo and nested_git_repo contain markers # and other directories don't. + # + # Optionally, "first" and "last" can be followed by ":" where is an integer. + # This moves the truncation point to the right (positive offset) or to the left (negative offset) + # relative to the marker. Plain "first" and "last" are equivalent to "first:0" and "last:0" + # respectively. typeset -g POWERLEVEL9K_DIR_TRUNCATE_BEFORE_MARKER=false # Don't shorten this many last directory segments. They are anchors. typeset -g POWERLEVEL9K_SHORTEN_DIR_LENGTH=1 @@ -269,13 +274,13 @@ # the full directory that was used in previous commands. typeset -g POWERLEVEL9K_DIR_HYPERLINK=false - # Enable special styling for non-writable directories. See POWERLEVEL9K_LOCK_ICON and - # POWERLEVEL9K_DIR_CLASSES below. - typeset -g POWERLEVEL9K_DIR_SHOW_WRITABLE=v2 + # Enable special styling for non-writable and non-existent directories. See POWERLEVEL9K_LOCK_ICON + # and POWERLEVEL9K_DIR_CLASSES below. + typeset -g POWERLEVEL9K_DIR_SHOW_WRITABLE=v3 - # The default icon shown next to non-writable directories when POWERLEVEL9K_DIR_SHOW_WRITABLE is - # set to v2. - # typeset -g POWERLEVEL9K_LOCK_ICON='⭐' + # The default icon shown next to non-writable and non-existent directories when + # POWERLEVEL9K_DIR_SHOW_WRITABLE is set to v3. + typeset -g POWERLEVEL9K_LOCK_ICON='∅' # POWERLEVEL9K_DIR_CLASSES allows you to specify custom icons and colors for different # directories. It must be an array with 3 * N elements. Each triplet consists of: @@ -287,8 +292,8 @@ # # Triplets are tried in order. The first triplet whose pattern matches $PWD wins. # - # If POWERLEVEL9K_DIR_SHOW_WRITABLE is set to v2 and the current directory is not writable, - # its class gets suffix _NOT_WRITABLE. + # If POWERLEVEL9K_DIR_SHOW_WRITABLE is set to v3, non-writable and non-existent directories + # acquire class suffix _NOT_WRITABLE and NON_EXISTENT respectively. # # For example, given these settings: # @@ -297,10 +302,11 @@ # '~(|/*)' HOME '' # '*' DEFAULT '') # - # Whenever the current directory is ~/work or a subdirectory of ~/work, it gets styled with class - # WORK or WORK_NOT_WRITABLE. + # Whenever the current directory is ~/work or a subdirectory of ~/work, it gets styled with one + # of the following classes depending on its writability and existence: WORK, WORK_NOT_WRITABLE or + # WORK_NON_EXISTENT. # - # Simply assigning classes to directories don't have any visible effects. It merely gives you an + # Simply assigning classes to directories doesn't have any visible effects. It merely gives you an # option to define custom colors and icons for different directory classes. # # # Styling for WORK. @@ -315,18 +321,24 @@ # typeset -g POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_SHORTENED_FOREGROUND=103 # typeset -g POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_ANCHOR_FOREGROUND=39 # + # # Styling for WORK_NON_EXISTENT. + # typeset -g POWERLEVEL9K_DIR_WORK_NON_EXISTENT_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_DIR_WORK_NON_EXISTENT_FOREGROUND=31 + # typeset -g POWERLEVEL9K_DIR_WORK_NON_EXISTENT_SHORTENED_FOREGROUND=103 + # typeset -g POWERLEVEL9K_DIR_WORK_NON_EXISTENT_ANCHOR_FOREGROUND=39 + # # If a styling parameter isn't explicitly defined for some class, it falls back to the classless # parameter. For example, if POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_FOREGROUND is not set, it falls # back to POWERLEVEL9K_DIR_FOREGROUND. # - # typeset -g POWERLEVEL9K_DIR_CLASSES=() + typeset -g POWERLEVEL9K_DIR_CLASSES=() # Custom prefix. # typeset -g POWERLEVEL9K_DIR_PREFIX='%fin ' #####################################[ vcs: git status ]###################################### # Branch icon. Set this parameter to '\uF126 ' for the popular Powerline branch icon. - typeset -g POWERLEVEL9K_VCS_BRANCH_ICON='\uF126 ' + typeset -g POWERLEVEL9K_VCS_BRANCH_ICON= # Untracked files icon. It's really a question mark, your font isn't broken. # Change the value of this parameter to show a different icon. @@ -380,6 +392,7 @@ # Otherwise show the first 12 … the last 12. # Tip: To always show local branch name in full without truncation, delete the next line. (( $#where > 32 )) && where[13,-13]="…" + res+="${clean}${where//\%/%%}" # escape % # Display the current Git commit if there is no branch or tag. @@ -452,7 +465,7 @@ typeset -g POWERLEVEL9K_VCS_VISUAL_IDENTIFIER_COLOR=76 typeset -g POWERLEVEL9K_VCS_LOADING_VISUAL_IDENTIFIER_COLOR=244 # Custom icon. - # typeset -g POWERLEVEL9K_VCS_VISUAL_IDENTIFIER_EXPANSION='⭐' + typeset -g POWERLEVEL9K_VCS_VISUAL_IDENTIFIER_EXPANSION= # Custom prefix. # typeset -g POWERLEVEL9K_VCS_PREFIX='%fon ' @@ -504,7 +517,7 @@ typeset -g POWERLEVEL9K_STATUS_ERROR_PIPE_VISUAL_IDENTIFIER_EXPANSION='✘' ###################[ command_execution_time: duration of the last command ]################### - # Show duration of the last command if takes longer than this many seconds. + # Show duration of the last command if takes at least this many seconds. typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_THRESHOLD=3 # Show this many fractional digits. Zero means round to seconds. typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_PRECISION=0 @@ -513,7 +526,7 @@ # Duration format: 1d 2h 3m 4s. typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_FORMAT='d h m s' # Custom icon. - # typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_VISUAL_IDENTIFIER_EXPANSION='⭐' + typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_VISUAL_IDENTIFIER_EXPANSION= # Custom prefix. # typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_PREFIX='%ftook ' @@ -523,7 +536,7 @@ # Background jobs color. typeset -g POWERLEVEL9K_BACKGROUND_JOBS_FOREGROUND=70 # Custom icon. - # typeset -g POWERLEVEL9K_BACKGROUND_JOBS_VISUAL_IDENTIFIER_EXPANSION='⭐' + typeset -g POWERLEVEL9K_BACKGROUND_JOBS_VISUAL_IDENTIFIER_EXPANSION='≡' #######################[ direnv: direnv status (https://direnv.net/) ]######################## # Direnv color. @@ -579,7 +592,7 @@ typeset -g POWERLEVEL9K_ASDF_SHOW_SYSTEM=true # If set to non-empty value, hide tools unless there is a file matching the specified file pattern - # in the current directory, or its parent diretory, or its grandparent directory, and so on. + # in the current directory, or its parent directory, or its grandparent directory, and so on. # # Note: If this parameter is set to empty value, it won't hide tools. # Note: SHOW_ON_UPGLOB isn't specific to asdf. It works with all prompt segments. @@ -678,13 +691,13 @@ typeset -g POWERLEVEL9K_NORDVPN_{DISCONNECTED,CONNECTING,DISCONNECTING}_CONTENT_EXPANSION= typeset -g POWERLEVEL9K_NORDVPN_{DISCONNECTED,CONNECTING,DISCONNECTING}_VISUAL_IDENTIFIER_EXPANSION= # Custom icon. - # typeset -g POWERLEVEL9K_NORDVPN_VISUAL_IDENTIFIER_EXPANSION='⭐' + typeset -g POWERLEVEL9K_NORDVPN_VISUAL_IDENTIFIER_EXPANSION='nord' #################[ ranger: ranger shell (https://github.com/ranger/ranger) ]################## # Ranger shell color. typeset -g POWERLEVEL9K_RANGER_FOREGROUND=178 # Custom icon. - # typeset -g POWERLEVEL9K_RANGER_VISUAL_IDENTIFIER_EXPANSION='⭐' + typeset -g POWERLEVEL9K_RANGER_VISUAL_IDENTIFIER_EXPANSION='▲' ######################[ nnn: nnn shell (https://github.com/jarun/nnn) ]####################### # Nnn shell color. @@ -836,7 +849,8 @@ typeset -g POWERLEVEL9K_VIRTUALENV_FOREGROUND=37 # Don't show Python version next to the virtual environment name. typeset -g POWERLEVEL9K_VIRTUALENV_SHOW_PYTHON_VERSION=false - # Don't show virtualenv if pyenv is already shown. + # If set to "false", won't show virtualenv if pyenv is already shown. + # If set to "if-different", won't show virtualenv if it's the same as pyenv. typeset -g POWERLEVEL9K_VIRTUALENV_SHOW_WITH_PYENV=false # Separate environment name from Python version only with a space. typeset -g POWERLEVEL9K_VIRTUALENV_{LEFT,RIGHT}_DELIMITER= @@ -1093,6 +1107,19 @@ # Custom icon. # typeset -g POWERLEVEL9K_PHPENV_VISUAL_IDENTIFIER_EXPANSION='⭐' + #######[ scalaenv: scala version from scalaenv (https://github.com/scalaenv/scalaenv) ]####### + # Scala color. + typeset -g POWERLEVEL9K_SCALAENV_FOREGROUND=160 + # Hide scala version if it doesn't come from one of these sources. + typeset -g POWERLEVEL9K_SCALAENV_SOURCES=(shell local global) + # If set to false, hide scala version if it's the same as global: + # $(scalaenv version-name) == $(scalaenv global). + typeset -g POWERLEVEL9K_SCALAENV_PROMPT_ALWAYS_SHOW=false + # If set to false, hide scala version if it's equal to "system". + typeset -g POWERLEVEL9K_SCALAENV_SHOW_SYSTEM=true + # Custom icon. + # typeset -g POWERLEVEL9K_SCALAENV_VISUAL_IDENTIFIER_EXPANSION='⭐' + ##########[ haskell_stack: haskell version from stack (https://haskellstack.org/) ]########### # Haskell color. typeset -g POWERLEVEL9K_HASKELL_STACK_FOREGROUND=172 @@ -1110,7 +1137,7 @@ #############[ kubecontext: current kubernetes context (https://kubernetes.io/) ]############# # Show kubecontext only when the the command you are typing invokes one of these tools. # Tip: Remove the next line to always show kubecontext. - typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito' + typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito|k9s|helmfile' # Kubernetes context classes for the purpose of using different colors, icons and expansions with # different contexts. @@ -1143,7 +1170,7 @@ # '*test*' TEST # to match your needs. Customize them as needed. '*' DEFAULT) typeset -g POWERLEVEL9K_KUBECONTEXT_DEFAULT_FOREGROUND=134 - # typeset -g POWERLEVEL9K_KUBECONTEXT_DEFAULT_VISUAL_IDENTIFIER_EXPANSION='⭐' + typeset -g POWERLEVEL9K_KUBECONTEXT_DEFAULT_VISUAL_IDENTIFIER_EXPANSION='○' # Use POWERLEVEL9K_KUBECONTEXT_CONTENT_EXPANSION to specify the content displayed by kubecontext # segment. Parameter expansions are very flexible and fast, too. See reference: @@ -1230,7 +1257,7 @@ #[ aws: aws profile (https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html) ]# # Show aws only when the the command you are typing invokes one of these tools. # Tip: Remove the next line to always show aws. - typeset -g POWERLEVEL9K_AWS_SHOW_ON_COMMAND='aws|awless|terraform|pulumi' + typeset -g POWERLEVEL9K_AWS_SHOW_ON_COMMAND='aws|awless|terraform|pulumi|terragrunt' # POWERLEVEL9K_AWS_CLASSES is an array with even number of elements. The first element # in each pair defines a pattern against which the current AWS profile gets matched. @@ -1266,16 +1293,16 @@ # AWS Elastic Beanstalk environment color. typeset -g POWERLEVEL9K_AWS_EB_ENV_FOREGROUND=70 # Custom icon. - # typeset -g POWERLEVEL9K_AWS_EB_ENV_VISUAL_IDENTIFIER_EXPANSION='⭐' + typeset -g POWERLEVEL9K_AWS_EB_ENV_VISUAL_IDENTIFIER_EXPANSION='eb' ##########[ azure: azure account name (https://docs.microsoft.com/en-us/cli/azure) ]########## # Show azure only when the the command you are typing invokes one of these tools. # Tip: Remove the next line to always show azure. - typeset -g POWERLEVEL9K_AZURE_SHOW_ON_COMMAND='az|terraform|pulumi' + typeset -g POWERLEVEL9K_AZURE_SHOW_ON_COMMAND='az|terraform|pulumi|terragrunt' # Azure account name color. typeset -g POWERLEVEL9K_AZURE_FOREGROUND=32 # Custom icon. - # typeset -g POWERLEVEL9K_AZURE_VISUAL_IDENTIFIER_EXPANSION='⭐' + typeset -g POWERLEVEL9K_AZURE_VISUAL_IDENTIFIER_EXPANSION='az' ##########[ gcloud: google cloud account and project (https://cloud.google.com/) ]########### # Show gcloud only when the the command you are typing invokes one of these tools. @@ -1296,7 +1323,7 @@ # P9K_GCLOUD_PROJECT_ID | gcloud config get-value project # P9K_GCLOUD_PROJECT_NAME | gcloud projects describe $P9K_GCLOUD_PROJECT_ID --format='value(name)' # - # Note: ${VARIABLE//\%/%%} expands to ${VARIABLE} with all occurences of '%' replaced with '%%'. + # Note: ${VARIABLE//\%/%%} expands to ${VARIABLE} with all occurrences of '%' replaced with '%%'. # # Obtaining project name requires sending a request to Google servers. This can take a long time # and even fail. When project name is unknown, P9K_GCLOUD_PROJECT_NAME is not set and gcloud @@ -1321,7 +1348,7 @@ #[ google_app_cred: google application credentials (https://cloud.google.com/docs/authentication/production) ]# # Show google_app_cred only when the the command you are typing invokes one of these tools. # Tip: Remove the next line to always show google_app_cred. - typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_SHOW_ON_COMMAND='terraform|pulumi' + typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_SHOW_ON_COMMAND='terraform|pulumi|terragrunt' # Google application credentials classes for the purpose of using different colors, icons and # expansions with different credentials. @@ -1369,7 +1396,7 @@ # P9K_GOOGLE_APP_CRED_PROJECT_ID | project_id # P9K_GOOGLE_APP_CRED_CLIENT_EMAIL | client_email # - # Note: ${VARIABLE//\%/%%} expands to ${VARIABLE} with all occurences of '%' replaced by '%%'. + # Note: ${VARIABLE//\%/%%} expands to ${VARIABLE} with all occurrences of '%' replaced by '%%'. typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_DEFAULT_CONTENT_EXPANSION='${P9K_GOOGLE_APP_CRED_PROJECT_ID//\%/%%}' ###############################[ public_ip: public IP address ]############################### @@ -1386,7 +1413,7 @@ typeset -g POWERLEVEL9K_VPN_IP_CONTENT_EXPANSION= # Regular expression for the VPN network interface. Run `ifconfig` or `ip -4 a show` while on VPN # to see the name of the interface. - typeset -g POWERLEVEL9K_VPN_IP_INTERFACE='(wg|(.*tun))[0-9]*' + typeset -g POWERLEVEL9K_VPN_IP_INTERFACE='(gpd|wg|(.*tun))[0-9]*' # If set to true, show one segment per matching network interface. If set to false, show only # one segment corresponding to the first matching network interface. # Tip: If you set it to true, you'll probably want to unset POWERLEVEL9K_VPN_IP_CONTENT_EXPANSION. @@ -1429,7 +1456,7 @@ # Show battery in yellow when it's discharging. typeset -g POWERLEVEL9K_BATTERY_DISCONNECTED_FOREGROUND=178 # Battery pictograms going from low to high level of charge. - typeset -g POWERLEVEL9K_BATTERY_STAGES='\uf58d\uf579\uf57a\uf57b\uf57c\uf57d\uf57e\uf57f\uf580\uf581\uf578' + typeset -g POWERLEVEL9K_BATTERY_STAGES=('%K{232}▁' '%K{232}▂' '%K{232}▃' '%K{232}▄' '%K{232}▅' '%K{232}▆' '%K{232}▇' '%K{232}█') # Don't show the remaining time to charge/discharge. typeset -g POWERLEVEL9K_BATTERY_VERBOSE=false @@ -1453,15 +1480,11 @@ # Parameter | Meaning # ----------------------+--------------- # P9K_WIFI_SSID | service set identifier, a.k.a. network name - # P9K_WIFI_LINK_AUTH | authentication protocol such as "wpa2-psk" or "none" + # P9K_WIFI_LINK_AUTH | authentication protocol such as "wpa2-psk" or "none"; empty if unknown # P9K_WIFI_LAST_TX_RATE | wireless transmit rate in megabits per second # P9K_WIFI_RSSI | signal strength in dBm, from -120 to 0 # P9K_WIFI_NOISE | noise in dBm, from -120 to 0 # P9K_WIFI_BARS | signal strength in bars, from 0 to 4 (derived from P9K_WIFI_RSSI and P9K_WIFI_NOISE) - # - # All parameters except P9K_WIFI_BARS are extracted from the output of the following command: - # - # /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -I ####################################[ time: current time ]#################################### # Current time color. @@ -1473,7 +1496,7 @@ # behavior where they contain the end times of their preceding commands. typeset -g POWERLEVEL9K_TIME_UPDATE_ON_COMMAND=false # Custom icon. - # typeset -g POWERLEVEL9K_TIME_VISUAL_IDENTIFIER_EXPANSION='⭐' + typeset -g POWERLEVEL9K_TIME_VISUAL_IDENTIFIER_EXPANSION= # Custom prefix. # typeset -g POWERLEVEL9K_TIME_PREFIX='%fat ' @@ -1528,7 +1551,7 @@ # - verbose: Enable instant prompt and print a warning when detecting console output during # zsh initialization. Choose this if you've never tried instant prompt, haven't # seen the warning, or if you are unsure what this all means. - typeset -g POWERLEVEL9K_INSTANT_PROMPT=off + typeset -g POWERLEVEL9K_INSTANT_PROMPT=quiet # Hot reload allows you to change POWERLEVEL9K options after Powerlevel10k has been initialized. # For example, you can type POWERLEVEL9K_BACKGROUND=red and see your prompt turn red. Hot reload -- cgit v1.2.3