diff options
Diffstat (limited to 'user-profiles')
-rw-r--r-- | user-profiles/direnv.nix | 9 | ||||
-rw-r--r-- | user-profiles/mpv/default.nix | 83 | ||||
-rw-r--r-- | user-profiles/tmux/default.nix | 26 | ||||
-rw-r--r-- | user-profiles/tmux/tmux.conf | 25 | ||||
-rw-r--r-- | user-profiles/utils.nix | 23 | ||||
-rw-r--r-- | user-profiles/zsh/default.nix | 31 | ||||
-rw-r--r-- | user-profiles/zsh/p10k.zsh | 1578 | ||||
-rw-r--r-- | user-profiles/zsh/zshrc | 26 |
8 files changed, 1801 insertions, 0 deletions
diff --git a/user-profiles/direnv.nix b/user-profiles/direnv.nix new file mode 100644 index 00000000..2c1e58d6 --- /dev/null +++ b/user-profiles/direnv.nix | |||
@@ -0,0 +1,9 @@ | |||
1 | { userName, ... }: | ||
2 | { | ||
3 | home-manager.users.${userName} = { | ||
4 | programs.direnv = { | ||
5 | enable = true; | ||
6 | enableNixDirenvIntegration = true; | ||
7 | }; | ||
8 | }; | ||
9 | } | ||
diff --git a/user-profiles/mpv/default.nix b/user-profiles/mpv/default.nix new file mode 100644 index 00000000..045094db --- /dev/null +++ b/user-profiles/mpv/default.nix | |||
@@ -0,0 +1,83 @@ | |||
1 | { config, userName, pkgs, ... }: | ||
2 | { | ||
3 | home-manager.users.${userName}.programs.mpv = { | ||
4 | enable = true; | ||
5 | bindings = { | ||
6 | "CTRL+n" = "af toggle \"lavfi=[dynaudnorm=f=100:g=31:s=20.0]\""; | ||
7 | }; | ||
8 | config = { | ||
9 | ytdl = true; | ||
10 | ytdl-format = "bestvideo[width<=2560][height<=1440][fps<=60][protocol!=http_dash_segments]+bestaudio[protocol!=http_dash_segments]/best[width<=2560][height<=1440][fps<=60][protocol!=http_dash_segments]/best[protocol!=http_dash_segments]"; | ||
11 | ytdl-raw-options = "netrc=,mark-watched=,cookies=${config.home-manager.users.${userName}.home.homeDirectory}/Downloads/cookies.txt"; | ||
12 | sub = false; | ||
13 | osd-font = "DejaVu Sans"; | ||
14 | vo = "gpu"; | ||
15 | hwdec = "auto"; | ||
16 | force-window = "yes"; | ||
17 | script-opts = "osc-layout=topbar,vidscale=no,deadzonesize=0.9"; | ||
18 | af = "lavfi=[dynaudnorm=f=100:g=31:s=20.0]"; | ||
19 | }; | ||
20 | scripts = let | ||
21 | reload = pkgs.stdenv.mkDerivation rec { | ||
22 | version = "2b8a719f"; | ||
23 | pname = "reload"; | ||
24 | name = "${pname}-${version}"; | ||
25 | |||
26 | src = pkgs.fetchFromGitHub { | ||
27 | owner = "4e6"; | ||
28 | repo = "mpv-reload"; | ||
29 | rev = "2b8a719fe166d6d42b5f1dd64761f97997b54a86"; | ||
30 | sha256 = "19ycvnwzf8vgv0g63d4k1ll6hlfrd92is9gl8hzfic7w32ycphbg"; | ||
31 | }; | ||
32 | |||
33 | installPhase = '' | ||
34 | install -d $out/share/mpv/scripts | ||
35 | install -m 0644 reload.lua $out/share/mpv/scripts/${passthru.scriptName} | ||
36 | ''; | ||
37 | |||
38 | passthru.scriptName = "reload.lua"; | ||
39 | }; | ||
40 | autosave = pkgs.stdenv.mkDerivation rec { | ||
41 | version = "0bv9wjrq"; | ||
42 | pname = "autosave"; | ||
43 | name = "${pname}-${version}.lua"; | ||
44 | |||
45 | src = pkgs.fetchzip { | ||
46 | url = "https://gist.github.com/Hakkin/5489e511bd6c8068a0fc09304c9c5a82/archive/7a19f7cdb6dd0b1c6878b41e13b244e2503c15fc.zip"; | ||
47 | sha256 = "0bv9wjrqm2ragd7rp8vw768bja2ghascwlljd6rzzf2ybi10fxs2"; | ||
48 | }; | ||
49 | |||
50 | installPhase = '' | ||
51 | install -d $out/share/mpv/scripts | ||
52 | install -m 0644 autosave.lua $out/share/mpv/scripts/${passthru.scriptName} | ||
53 | ''; | ||
54 | |||
55 | passthru.scriptName = "autosave.lua"; | ||
56 | }; | ||
57 | mpris = pkgs.stdenv.mkDerivation rec { | ||
58 | version = "0.4"; | ||
59 | pname = "mpv-mpris"; | ||
60 | name = "${pname}-${version}.so"; | ||
61 | |||
62 | src = pkgs.fetchFromGitHub { | ||
63 | owner = "hoyon"; | ||
64 | repo = "mpv-mpris"; | ||
65 | rev = version; | ||
66 | sha256 = "1fr3jvja8s2gdpx8qyk9r17977flms3qpm8zci62nd9r5wjdvr5i"; | ||
67 | }; | ||
68 | |||
69 | installPhase = '' | ||
70 | install -d $out/share/mpv/scripts | ||
71 | install -m 0644 mpris.so $out/share/mpv/scripts/${passthru.scriptName} | ||
72 | ''; | ||
73 | |||
74 | nativeBuildInputs = with pkgs; [ pkgconfig glib mpv ]; | ||
75 | |||
76 | passthru.scriptName = "mpris.so"; | ||
77 | }; | ||
78 | in [ reload | ||
79 | autosave | ||
80 | mpris | ||
81 | ]; | ||
82 | }; | ||
83 | } | ||
diff --git a/user-profiles/tmux/default.nix b/user-profiles/tmux/default.nix new file mode 100644 index 00000000..9e66cadd --- /dev/null +++ b/user-profiles/tmux/default.nix | |||
@@ -0,0 +1,26 @@ | |||
1 | { userName, pkgs, lib, ... }: | ||
2 | { | ||
3 | home-manager.users.${userName} = { | ||
4 | programs.tmux = { | ||
5 | enable = true; | ||
6 | clock24 = true; | ||
7 | historyLimit = 50000; | ||
8 | extraConfig = lib.readFile (pkgs.stdenv.mkDerivation { | ||
9 | name = "tmux.conf"; | ||
10 | src = ./tmux.conf; | ||
11 | |||
12 | buildInputs = with pkgs; [ makeWrapper ]; | ||
13 | |||
14 | phases = [ "installPhase" ]; | ||
15 | |||
16 | inherit (pkgs) zsh; | ||
17 | mandb = pkgs.man-db; | ||
18 | |||
19 | installPhase = '' | ||
20 | substituteAll $src $out | ||
21 | ''; | ||
22 | }); | ||
23 | tmuxp.enable = true; | ||
24 | }; | ||
25 | }; | ||
26 | } | ||
diff --git a/user-profiles/tmux/tmux.conf b/user-profiles/tmux/tmux.conf new file mode 100644 index 00000000..1403698d --- /dev/null +++ b/user-profiles/tmux/tmux.conf | |||
@@ -0,0 +1,25 @@ | |||
1 | set-option -g history-limit 50000 | ||
2 | set-option -g status-bg black | ||
3 | set-option -g status-fg white | ||
4 | set-option -g clock-mode-colour white | ||
5 | set-option -g clock-mode-style 24 | ||
6 | set-option -g bell-action any | ||
7 | set-option -g default-shell @zsh@/bin/zsh | ||
8 | set-option -g update-environment 'DISPLAY SSH_ASKPASS SSH_AUTH_SOCK SSH_AGENT_PID SSH_CONNECTION WINDOWID XAUTHORITY PROMPT_INFO PATH PGHOST PGLOG' | ||
9 | set-option -g mouse on | ||
10 | set-option -g set-clipboard on | ||
11 | set-option -g terminal-overrides 'rxvt-uni*:XT:Ms=\E]52;%p1%s;%p2%s\007' | ||
12 | |||
13 | ## determine if we should enable 256-colour support | ||
14 | if "[[ ''${TERM} =~ 256color || ''${TERM} == fbterm ]]" 'set -g default-terminal tmux-256color' | ||
15 | |||
16 | set-option -g status-right "" | ||
17 | |||
18 | bind / command-prompt "split-window -h 'exec @mandb@/bin/man %%'" | ||
19 | bind C clock-mode | ||
20 | bind r respawn-pane -k | ||
21 | |||
22 | bind -n M-Left select-pane -L | ||
23 | bind -n M-Right select-pane -R | ||
24 | bind -n M-Up select-pane -U | ||
25 | bind -n M-Down select-pane -D \ No newline at end of file | ||
diff --git a/user-profiles/utils.nix b/user-profiles/utils.nix new file mode 100644 index 00000000..7b9a0da7 --- /dev/null +++ b/user-profiles/utils.nix | |||
@@ -0,0 +1,23 @@ | |||
1 | { userName, pkgs, ... }: | ||
2 | { | ||
3 | home-manager.users.${userName} = { | ||
4 | programs = { | ||
5 | htop = { | ||
6 | enable = true; | ||
7 | delay = 5; | ||
8 | highlightBaseName = true; | ||
9 | treeView = true; | ||
10 | }; | ||
11 | |||
12 | jq.enable = true; | ||
13 | }; | ||
14 | |||
15 | home.packages = with pkgs; [ | ||
16 | autossh usbutils pciutils exa ag pwgen unzip magic-wormhole | ||
17 | qrencode tty-clock dnsutils openssl sshfs psmisc mosh tree | ||
18 | vnstat file pv bc fast-cli zip nmap aspell aspellDicts.de | ||
19 | aspellDicts.en borgbackup man-pages rsync socat telnet yq | ||
20 | cached-nix-shell persistent-nix-shell rage | ||
21 | ]; | ||
22 | }; | ||
23 | } | ||
diff --git a/user-profiles/zsh/default.nix b/user-profiles/zsh/default.nix new file mode 100644 index 00000000..88873c1a --- /dev/null +++ b/user-profiles/zsh/default.nix | |||
@@ -0,0 +1,31 @@ | |||
1 | { userName, pkgs, customUtils, lib, config, ... }: | ||
2 | let | ||
3 | dotDir = ".config/zsh"; | ||
4 | p10kZsh = "${dotDir}/.p10k.zsh"; | ||
5 | cfg = config.home-manager.users.${userName}; | ||
6 | in { | ||
7 | home-manager.users.${userName} = { | ||
8 | programs.zsh = { | ||
9 | inherit dotDir; | ||
10 | enable = true; | ||
11 | autocd = true; | ||
12 | enableCompletion = true; | ||
13 | |||
14 | plugins = [ | ||
15 | { name = "powerlevel10k"; | ||
16 | file = "share/zsh-powerlevel10k/powerlevel10k.zsh-theme"; | ||
17 | src = pkgs.zsh-powerlevel10k; | ||
18 | } | ||
19 | ]; | ||
20 | initExtraBeforeCompInit = '' | ||
21 | source "${cfg.home.homeDirectory}/${p10kZsh}" | ||
22 | ''; | ||
23 | initExtra = lib.mkAfter '' | ||
24 | source ${./zshrc} | ||
25 | source "${pkgs.zsh-syntax-highlighting}/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" | ||
26 | ''; | ||
27 | }; | ||
28 | |||
29 | home.file.${p10kZsh}.source = ./p10k.zsh; | ||
30 | }; | ||
31 | } | ||
diff --git a/user-profiles/zsh/p10k.zsh b/user-profiles/zsh/p10k.zsh new file mode 100644 index 00000000..e3b364c2 --- /dev/null +++ b/user-profiles/zsh/p10k.zsh | |||
@@ -0,0 +1,1578 @@ | |||
1 | # Generated by Powerlevel10k configuration wizard on 2021-01-03 at 15:43 CET. | ||
2 | # Based on romkatv/powerlevel10k/config/p10k-lean.zsh. | ||
3 | # Wizard options: nerdfont-complete + powerline, small icons, unicode, lean, 24h time, | ||
4 | # 2 lines, solid, no frame, darkest-ornaments, sparse, many icons, concise, | ||
5 | # transient_prompt, instant_prompt=quiet. | ||
6 | # Type `p10k configure` to generate another config. | ||
7 | # | ||
8 | # Config for Powerlevel10k with lean prompt style. Type `p10k configure` to generate | ||
9 | # your own config based on it. | ||
10 | # | ||
11 | # Tip: Looking for a nice color? Here's a one-liner to print colormap. | ||
12 | # | ||
13 | # for i in {0..255}; do print -Pn "%K{$i} %k%F{$i}${(l:3::0:)i}%f " ${${(M)$((i%6)):#3}:+$'\n'}; done | ||
14 | |||
15 | # Temporarily change options. | ||
16 | 'builtin' 'local' '-a' 'p10k_config_opts' | ||
17 | [[ ! -o 'aliases' ]] || p10k_config_opts+=('aliases') | ||
18 | [[ ! -o 'sh_glob' ]] || p10k_config_opts+=('sh_glob') | ||
19 | [[ ! -o 'no_brace_expand' ]] || p10k_config_opts+=('no_brace_expand') | ||
20 | 'builtin' 'setopt' 'no_aliases' 'no_sh_glob' 'brace_expand' | ||
21 | |||
22 | () { | ||
23 | emulate -L zsh -o extended_glob | ||
24 | |||
25 | # Unset all configuration options. This allows you to apply configuration changes without | ||
26 | # restarting zsh. Edit ~/.p10k.zsh and type `source ~/.p10k.zsh`. | ||
27 | unset -m '(POWERLEVEL9K_*|DEFAULT_USER)~POWERLEVEL9K_GITSTATUS_DIR' | ||
28 | |||
29 | # Zsh >= 5.1 is required. | ||
30 | autoload -Uz is-at-least && is-at-least 5.1 || return | ||
31 | |||
32 | # The list of segments shown on the left. Fill it with the most important segments. | ||
33 | typeset -g POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=( | ||
34 | # =========================[ Line #1 ]========================= | ||
35 | # os_icon # os identifier | ||
36 | context # user@hostname | ||
37 | dir # current directory | ||
38 | vcs # git status | ||
39 | # =========================[ Line #2 ]========================= | ||
40 | newline # \n | ||
41 | context # user@hostname | ||
42 | dir | ||
43 | prompt_char # prompt symbol | ||
44 | ) | ||
45 | |||
46 | # The list of segments shown on the right. Fill it with less important segments. | ||
47 | # Right prompt on the last prompt line (where you are typing your commands) gets | ||
48 | # automatically hidden when the input line reaches it. Right prompt above the | ||
49 | # last prompt line gets hidden if it would overlap with left prompt. | ||
50 | typeset -g POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=( | ||
51 | # =========================[ Line #1 ]========================= | ||
52 | status # exit code of the last command | ||
53 | command_execution_time # duration of the last command | ||
54 | time # current time | ||
55 | background_jobs # presence of background jobs | ||
56 | # =========================[ Line #2 ]========================= | ||
57 | newline | ||
58 | direnv # direnv status (https://direnv.net/) | ||
59 | asdf # asdf version manager (https://github.com/asdf-vm/asdf) | ||
60 | virtualenv # python virtual environment (https://docs.python.org/3/library/venv.html) | ||
61 | anaconda # conda environment (https://conda.io/) | ||
62 | pyenv # python environment (https://github.com/pyenv/pyenv) | ||
63 | goenv # go environment (https://github.com/syndbg/goenv) | ||
64 | nodenv # node.js version from nodenv (https://github.com/nodenv/nodenv) | ||
65 | nvm # node.js version from nvm (https://github.com/nvm-sh/nvm) | ||
66 | nodeenv # node.js environment (https://github.com/ekalinin/nodeenv) | ||
67 | # node_version # node.js version | ||
68 | # go_version # go version (https://golang.org) | ||
69 | # rust_version # rustc version (https://www.rust-lang.org) | ||
70 | # dotnet_version # .NET version (https://dotnet.microsoft.com) | ||
71 | # php_version # php version (https://www.php.net/) | ||
72 | # laravel_version # laravel php framework version (https://laravel.com/) | ||
73 | # java_version # java version (https://www.java.com/) | ||
74 | # package # name@version from package.json (https://docs.npmjs.com/files/package.json) | ||
75 | rbenv # ruby version from rbenv (https://github.com/rbenv/rbenv) | ||
76 | rvm # ruby version from rvm (https://rvm.io) | ||
77 | fvm # flutter version management (https://github.com/leoafarias/fvm) | ||
78 | luaenv # lua version from luaenv (https://github.com/cehoffman/luaenv) | ||
79 | jenv # java version from jenv (https://github.com/jenv/jenv) | ||
80 | plenv # perl version from plenv (https://github.com/tokuhirom/plenv) | ||
81 | phpenv # php version from phpenv (https://github.com/phpenv/phpenv) | ||
82 | scalaenv # scala version from scalaenv (https://github.com/scalaenv/scalaenv) | ||
83 | haskell_stack # haskell version from stack (https://haskellstack.org/) | ||
84 | kubecontext # current kubernetes context (https://kubernetes.io/) | ||
85 | terraform # terraform workspace (https://www.terraform.io) | ||
86 | aws # aws profile (https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html) | ||
87 | aws_eb_env # aws elastic beanstalk environment (https://aws.amazon.com/elasticbeanstalk/) | ||
88 | azure # azure account name (https://docs.microsoft.com/en-us/cli/azure) | ||
89 | gcloud # google cloud cli account and project (https://cloud.google.com/) | ||
90 | google_app_cred # google application credentials (https://cloud.google.com/docs/authentication/production) | ||
91 | nordvpn # nordvpn connection status, linux only (https://nordvpn.com/) | ||
92 | ranger # ranger shell (https://github.com/ranger/ranger) | ||
93 | nnn # nnn shell (https://github.com/jarun/nnn) | ||
94 | vim_shell # vim shell indicator (:sh) | ||
95 | midnight_commander # midnight commander shell (https://midnight-commander.org/) | ||
96 | nix_shell # nix shell (https://nixos.org/nixos/nix-pills/developing-with-nix-shell.html) | ||
97 | # vpn_ip # virtual private network indicator | ||
98 | # load # CPU load | ||
99 | # disk_usage # disk usage | ||
100 | # ram # free RAM | ||
101 | # swap # used swap | ||
102 | todo # todo items (https://github.com/todotxt/todo.txt-cli) | ||
103 | timewarrior # timewarrior tracking status (https://timewarrior.net/) | ||
104 | taskwarrior # taskwarrior task count (https://taskwarrior.org/) | ||
105 | status # exit code of the last command | ||
106 | command_execution_time # duration of the last command | ||
107 | time # current time | ||
108 | background_jobs # presence of background jobs | ||
109 | # ip # ip address and bandwidth usage for a specified network interface | ||
110 | # public_ip # public IP address | ||
111 | # proxy # system-wide http/https/ftp proxy | ||
112 | # battery # internal battery | ||
113 | # wifi # wifi speed | ||
114 | # example # example user-defined segment (see prompt_example function below) | ||
115 | ) | ||
116 | |||
117 | # Defines character set used by powerlevel10k. It's best to let `p10k configure` set it for you. | ||
118 | typeset -g POWERLEVEL9K_MODE=nerdfont-complete | ||
119 | # When set to `moderate`, some icons will have an extra space after them. This is meant to avoid | ||
120 | # icon overlap when using non-monospace fonts. When set to `none`, spaces are not added. | ||
121 | typeset -g POWERLEVEL9K_ICON_PADDING=none | ||
122 | |||
123 | # Basic style options that define the overall look of your prompt. You probably don't want to | ||
124 | # change them. | ||
125 | typeset -g POWERLEVEL9K_BACKGROUND= # transparent background | ||
126 | typeset -g POWERLEVEL9K_{LEFT,RIGHT}_{LEFT,RIGHT}_WHITESPACE= # no surrounding whitespace | ||
127 | typeset -g POWERLEVEL9K_{LEFT,RIGHT}_SUBSEGMENT_SEPARATOR=' ' # separate segments with a space | ||
128 | typeset -g POWERLEVEL9K_{LEFT,RIGHT}_SEGMENT_SEPARATOR= # no end-of-line symbol | ||
129 | |||
130 | # When set to true, icons appear before content on both sides of the prompt. When set | ||
131 | # to false, icons go after content. If empty or not set, icons go before content in the left | ||
132 | # prompt and after content in the right prompt. | ||
133 | # | ||
134 | # You can also override it for a specific segment: | ||
135 | # | ||
136 | # POWERLEVEL9K_STATUS_ICON_BEFORE_CONTENT=false | ||
137 | # | ||
138 | # Or for a specific segment in specific state: | ||
139 | # | ||
140 | # POWERLEVEL9K_DIR_NOT_WRITABLE_ICON_BEFORE_CONTENT=false | ||
141 | typeset -g POWERLEVEL9K_ICON_BEFORE_CONTENT=true | ||
142 | |||
143 | # Add an empty line before each prompt. | ||
144 | typeset -g POWERLEVEL9K_PROMPT_ADD_NEWLINE=true | ||
145 | |||
146 | # Connect left prompt lines with these symbols. | ||
147 | typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_PREFIX= | ||
148 | typeset -g POWERLEVEL9K_MULTILINE_NEWLINE_PROMPT_PREFIX= | ||
149 | typeset -g POWERLEVEL9K_MULTILINE_LAST_PROMPT_PREFIX= | ||
150 | # Connect right prompt lines with these symbols. | ||
151 | typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_SUFFIX= | ||
152 | typeset -g POWERLEVEL9K_MULTILINE_NEWLINE_PROMPT_SUFFIX= | ||
153 | typeset -g POWERLEVEL9K_MULTILINE_LAST_PROMPT_SUFFIX= | ||
154 | |||
155 | # The left end of left prompt. | ||
156 | typeset -g POWERLEVEL9K_LEFT_PROMPT_FIRST_SEGMENT_START_SYMBOL= | ||
157 | # The right end of right prompt. | ||
158 | typeset -g POWERLEVEL9K_RIGHT_PROMPT_LAST_SEGMENT_END_SYMBOL= | ||
159 | |||
160 | # Ruler, a.k.a. the horizontal line before each prompt. If you set it to true, you'll | ||
161 | # probably want to set POWERLEVEL9K_PROMPT_ADD_NEWLINE=false above and | ||
162 | # POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_CHAR=' ' below. | ||
163 | typeset -g POWERLEVEL9K_SHOW_RULER=false | ||
164 | typeset -g POWERLEVEL9K_RULER_CHAR='─' # reasonable alternative: '·' | ||
165 | typeset -g POWERLEVEL9K_RULER_FOREGROUND=238 | ||
166 | |||
167 | # Filler between left and right prompt on the first prompt line. You can set it to '·' or '─' | ||
168 | # to make it easier to see the alignment between left and right prompt and to separate prompt | ||
169 | # from command output. It serves the same purpose as ruler (see above) without increasing | ||
170 | # the number of prompt lines. You'll probably want to set POWERLEVEL9K_SHOW_RULER=false | ||
171 | # if using this. You might also like POWERLEVEL9K_PROMPT_ADD_NEWLINE=false for more compact | ||
172 | # prompt. | ||
173 | typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_CHAR='─' | ||
174 | if [[ $POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_CHAR != ' ' ]]; then | ||
175 | # The color of the filler. | ||
176 | typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_FOREGROUND=238 | ||
177 | # Add a space between the end of left prompt and the filler. | ||
178 | typeset -g POWERLEVEL9K_LEFT_PROMPT_LAST_SEGMENT_END_SYMBOL=' ' | ||
179 | # Add a space between the filler and the start of right prompt. | ||
180 | typeset -g POWERLEVEL9K_RIGHT_PROMPT_FIRST_SEGMENT_START_SYMBOL=' ' | ||
181 | # Start filler from the edge of the screen if there are no left segments on the first line. | ||
182 | typeset -g POWERLEVEL9K_EMPTY_LINE_LEFT_PROMPT_FIRST_SEGMENT_END_SYMBOL='%{%}' | ||
183 | # End filler on the edge of the screen if there are no right segments on the first line. | ||
184 | typeset -g POWERLEVEL9K_EMPTY_LINE_RIGHT_PROMPT_FIRST_SEGMENT_START_SYMBOL='%{%}' | ||
185 | fi | ||
186 | |||
187 | #################################[ os_icon: os identifier ]################################## | ||
188 | # OS identifier color. | ||
189 | typeset -g POWERLEVEL9K_OS_ICON_FOREGROUND= | ||
190 | # Custom icon. | ||
191 | # typeset -g POWERLEVEL9K_OS_ICON_CONTENT_EXPANSION='⭐' | ||
192 | |||
193 | ################################[ prompt_char: prompt symbol ]################################ | ||
194 | typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_{VIINS,VICMD,VIVIS,VIOWR}_FOREGROUND=2 | ||
195 | # Default prompt symbol. | ||
196 | typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIINS_CONTENT_EXPANSION='❯' | ||
197 | # Prompt symbol in command vi mode. | ||
198 | typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VICMD_CONTENT_EXPANSION='❮' | ||
199 | # Prompt symbol in visual vi mode. | ||
200 | typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIVIS_CONTENT_EXPANSION='V' | ||
201 | # Prompt symbol in overwrite vi mode. | ||
202 | typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIOWR_CONTENT_EXPANSION='▶' | ||
203 | typeset -g POWERLEVEL9K_PROMPT_CHAR_OVERWRITE_STATE=true | ||
204 | # No line terminator if prompt_char is the last segment. | ||
205 | typeset -g POWERLEVEL9K_PROMPT_CHAR_LEFT_PROMPT_LAST_SEGMENT_END_SYMBOL='' | ||
206 | # No line introducer if prompt_char is the first segment. | ||
207 | typeset -g POWERLEVEL9K_PROMPT_CHAR_LEFT_PROMPT_FIRST_SEGMENT_START_SYMBOL= | ||
208 | |||
209 | ##################################[ dir: current directory ]################################## | ||
210 | # Default current directory color. | ||
211 | typeset -g POWERLEVEL9K_DIR_FOREGROUND=31 | ||
212 | # If directory is too long, shorten some of its segments to the shortest possible unique | ||
213 | # prefix. The shortened directory can be tab-completed to the original. | ||
214 | typeset -g POWERLEVEL9K_SHORTEN_STRATEGY=truncate_to_unique | ||
215 | # Replace removed segment suffixes with this symbol. | ||
216 | typeset -g POWERLEVEL9K_SHORTEN_DELIMITER= | ||
217 | # Color of the shortened directory segments. | ||
218 | typeset -g POWERLEVEL9K_DIR_SHORTENED_FOREGROUND=103 | ||
219 | # Color of the anchor directory segments. Anchor segments are never shortened. The first | ||
220 | # segment is always an anchor. | ||
221 | typeset -g POWERLEVEL9K_DIR_ANCHOR_FOREGROUND=39 | ||
222 | # Display anchor directory segments in bold. | ||
223 | typeset -g POWERLEVEL9K_DIR_ANCHOR_BOLD=true | ||
224 | # Don't shorten directories that contain any of these files. They are anchors. | ||
225 | local anchor_files=( | ||
226 | .bzr | ||
227 | .citc | ||
228 | .git | ||
229 | .hg | ||
230 | .node-version | ||
231 | .python-version | ||
232 | .go-version | ||
233 | .ruby-version | ||
234 | .lua-version | ||
235 | .java-version | ||
236 | .perl-version | ||
237 | .php-version | ||
238 | .tool-version | ||
239 | .shorten_folder_marker | ||
240 | .svn | ||
241 | .terraform | ||
242 | CVS | ||
243 | Cargo.toml | ||
244 | composer.json | ||
245 | go.mod | ||
246 | package.json | ||
247 | stack.yaml | ||
248 | ) | ||
249 | typeset -g POWERLEVEL9K_SHORTEN_FOLDER_MARKER="(${(j:|:)anchor_files})" | ||
250 | # If set to "first" ("last"), remove everything before the first (last) subdirectory that contains | ||
251 | # files matching $POWERLEVEL9K_SHORTEN_FOLDER_MARKER. For example, when the current directory is | ||
252 | # /foo/bar/git_repo/nested_git_repo/baz, prompt will display git_repo/nested_git_repo/baz (first) | ||
253 | # or nested_git_repo/baz (last). This assumes that git_repo and nested_git_repo contain markers | ||
254 | # and other directories don't. | ||
255 | # | ||
256 | # Optionally, "first" and "last" can be followed by ":<offset>" where <offset> is an integer. | ||
257 | # This moves the truncation point to the right (positive offset) or to the left (negative offset) | ||
258 | # relative to the marker. Plain "first" and "last" are equivalent to "first:0" and "last:0" | ||
259 | # respectively. | ||
260 | typeset -g POWERLEVEL9K_DIR_TRUNCATE_BEFORE_MARKER=false | ||
261 | # Don't shorten this many last directory segments. They are anchors. | ||
262 | typeset -g POWERLEVEL9K_SHORTEN_DIR_LENGTH=1 | ||
263 | # Shorten directory if it's longer than this even if there is space for it. The value can | ||
264 | # be either absolute (e.g., '80') or a percentage of terminal width (e.g, '50%'). If empty, | ||
265 | # directory will be shortened only when prompt doesn't fit or when other parameters demand it | ||
266 | # (see POWERLEVEL9K_DIR_MIN_COMMAND_COLUMNS and POWERLEVEL9K_DIR_MIN_COMMAND_COLUMNS_PCT below). | ||
267 | # If set to `0`, directory will always be shortened to its minimum length. | ||
268 | typeset -g POWERLEVEL9K_DIR_MAX_LENGTH=30% | ||
269 | # When `dir` segment is on the last prompt line, try to shorten it enough to leave at least this | ||
270 | # many columns for typing commands. | ||
271 | typeset -g POWERLEVEL9K_DIR_MIN_COMMAND_COLUMNS=40 | ||
272 | # When `dir` segment is on the last prompt line, try to shorten it enough to leave at least | ||
273 | # COLUMNS * POWERLEVEL9K_DIR_MIN_COMMAND_COLUMNS_PCT * 0.01 columns for typing commands. | ||
274 | typeset -g POWERLEVEL9K_DIR_MIN_COMMAND_COLUMNS_PCT=50 | ||
275 | # If set to true, embed a hyperlink into the directory. Useful for quickly | ||
276 | # opening a directory in the file manager simply by clicking the link. | ||
277 | # Can also be handy when the directory is shortened, as it allows you to see | ||
278 | # the full directory that was used in previous commands. | ||
279 | typeset -g POWERLEVEL9K_DIR_HYPERLINK=false | ||
280 | |||
281 | # Enable special styling for non-writable and non-existent directories. See POWERLEVEL9K_LOCK_ICON | ||
282 | # and POWERLEVEL9K_DIR_CLASSES below. | ||
283 | typeset -g POWERLEVEL9K_DIR_SHOW_WRITABLE=v3 | ||
284 | |||
285 | # The default icon shown next to non-writable and non-existent directories when | ||
286 | # POWERLEVEL9K_DIR_SHOW_WRITABLE is set to v3. | ||
287 | # typeset -g POWERLEVEL9K_LOCK_ICON='⭐' | ||
288 | |||
289 | # POWERLEVEL9K_DIR_CLASSES allows you to specify custom icons and colors for different | ||
290 | # directories. It must be an array with 3 * N elements. Each triplet consists of: | ||
291 | # | ||
292 | # 1. A pattern against which the current directory ($PWD) is matched. Matching is done with | ||
293 | # extended_glob option enabled. | ||
294 | # 2. Directory class for the purpose of styling. | ||
295 | # 3. An empty string. | ||
296 | # | ||
297 | # Triplets are tried in order. The first triplet whose pattern matches $PWD wins. | ||
298 | # | ||
299 | # If POWERLEVEL9K_DIR_SHOW_WRITABLE is set to v3, non-writable and non-existent directories | ||
300 | # acquire class suffix _NOT_WRITABLE and NON_EXISTENT respectively. | ||
301 | # | ||
302 | # For example, given these settings: | ||
303 | # | ||
304 | # typeset -g POWERLEVEL9K_DIR_CLASSES=( | ||
305 | # '~/work(|/*)' WORK '' | ||
306 | # '~(|/*)' HOME '' | ||
307 | # '*' DEFAULT '') | ||
308 | # | ||
309 | # Whenever the current directory is ~/work or a subdirectory of ~/work, it gets styled with one | ||
310 | # of the following classes depending on its writability and existence: WORK, WORK_NOT_WRITABLE or | ||
311 | # WORK_NON_EXISTENT. | ||
312 | # | ||
313 | # Simply assigning classes to directories doesn't have any visible effects. It merely gives you an | ||
314 | # option to define custom colors and icons for different directory classes. | ||
315 | # | ||
316 | # # Styling for WORK. | ||
317 | # typeset -g POWERLEVEL9K_DIR_WORK_VISUAL_IDENTIFIER_EXPANSION='⭐' | ||
318 | # typeset -g POWERLEVEL9K_DIR_WORK_FOREGROUND=31 | ||
319 | # typeset -g POWERLEVEL9K_DIR_WORK_SHORTENED_FOREGROUND=103 | ||
320 | # typeset -g POWERLEVEL9K_DIR_WORK_ANCHOR_FOREGROUND=39 | ||
321 | # | ||
322 | # # Styling for WORK_NOT_WRITABLE. | ||
323 | # typeset -g POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_VISUAL_IDENTIFIER_EXPANSION='⭐' | ||
324 | # typeset -g POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_FOREGROUND=31 | ||
325 | # typeset -g POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_SHORTENED_FOREGROUND=103 | ||
326 | # typeset -g POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_ANCHOR_FOREGROUND=39 | ||
327 | # | ||
328 | # # Styling for WORK_NON_EXISTENT. | ||
329 | # typeset -g POWERLEVEL9K_DIR_WORK_NON_EXISTENT_VISUAL_IDENTIFIER_EXPANSION='⭐' | ||
330 | # typeset -g POWERLEVEL9K_DIR_WORK_NON_EXISTENT_FOREGROUND=31 | ||
331 | # typeset -g POWERLEVEL9K_DIR_WORK_NON_EXISTENT_SHORTENED_FOREGROUND=103 | ||
332 | # typeset -g POWERLEVEL9K_DIR_WORK_NON_EXISTENT_ANCHOR_FOREGROUND=39 | ||
333 | # | ||
334 | # If a styling parameter isn't explicitly defined for some class, it falls back to the classless | ||
335 | # parameter. For example, if POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_FOREGROUND is not set, it falls | ||
336 | # back to POWERLEVEL9K_DIR_FOREGROUND. | ||
337 | # | ||
338 | typeset -g POWERLEVEL9K_DIR_CLASSES=() | ||
339 | |||
340 | # Custom prefix. | ||
341 | # typeset -g POWERLEVEL9K_DIR_PREFIX='%fin ' | ||
342 | |||
343 | #####################################[ vcs: git status ]###################################### | ||
344 | # Branch icon. Set this parameter to '\uF126 ' for the popular Powerline branch icon. | ||
345 | typeset -g POWERLEVEL9K_VCS_BRANCH_ICON='' | ||
346 | |||
347 | # Untracked files icon. It's really a question mark, your font isn't broken. | ||
348 | # Change the value of this parameter to show a different icon. | ||
349 | typeset -g POWERLEVEL9K_VCS_UNTRACKED_ICON='?' | ||
350 | |||
351 | # Formatter for Git status. | ||
352 | # | ||
353 | # Example output: master ⇣42⇡42 *42 merge ~42 +42 !42 ?42. | ||
354 | # | ||
355 | # You can edit the function to customize how Git status looks. | ||
356 | # | ||
357 | # VCS_STATUS_* parameters are set by gitstatus plugin. See reference: | ||
358 | # https://github.com/romkatv/gitstatus/blob/master/gitstatus.plugin.zsh. | ||
359 | function my_git_formatter() { | ||
360 | emulate -L zsh | ||
361 | |||
362 | if [[ -n $P9K_CONTENT ]]; then | ||
363 | # If P9K_CONTENT is not empty, use it. It's either "loading" or from vcs_info (not from | ||
364 | # gitstatus plugin). VCS_STATUS_* parameters are not available in this case. | ||
365 | typeset -g my_git_format=$P9K_CONTENT | ||
366 | return | ||
367 | fi | ||
368 | |||
369 | if (( $1 )); then | ||
370 | # Styling for up-to-date Git status. | ||
371 | local meta='%f' # default foreground | ||
372 | local clean='%76F' # green foreground | ||
373 | local modified='%178F' # yellow foreground | ||
374 | local untracked='%39F' # blue foreground | ||
375 | local conflicted='%196F' # red foreground | ||
376 | else | ||
377 | # Styling for incomplete and stale Git status. | ||
378 | local meta='%244F' # grey foreground | ||
379 | local clean='%244F' # grey foreground | ||
380 | local modified='%244F' # grey foreground | ||
381 | local untracked='%244F' # grey foreground | ||
382 | local conflicted='%244F' # grey foreground | ||
383 | fi | ||
384 | |||
385 | local res | ||
386 | local where # branch or tag | ||
387 | if [[ -n $VCS_STATUS_LOCAL_BRANCH ]]; then | ||
388 | res+="${clean}${(g::)POWERLEVEL9K_VCS_BRANCH_ICON}" | ||
389 | where=${(V)VCS_STATUS_LOCAL_BRANCH} | ||
390 | elif [[ -n $VCS_STATUS_TAG ]]; then | ||
391 | res+="${meta}#" | ||
392 | where=${(V)VCS_STATUS_TAG} | ||
393 | fi | ||
394 | |||
395 | # If local branch name or tag is at most 32 characters long, show it in full. | ||
396 | # Otherwise show the first 12 … the last 12. | ||
397 | # Tip: To always show local branch name in full without truncation, delete the next line. | ||
398 | (( $#where > 32 )) && where[13,-13]="…" | ||
399 | |||
400 | res+="${clean}${where//\%/%%}" # escape % | ||
401 | |||
402 | # Display the current Git commit if there is no branch or tag. | ||
403 | # Tip: To always display the current Git commit, remove `[[ -z $where ]] &&` from the next line. | ||
404 | [[ -z $where ]] && res+="${meta}@${clean}${VCS_STATUS_COMMIT[1,8]}" | ||
405 | |||
406 | # Show tracking branch name if it differs from local branch. | ||
407 | if [[ -n ${VCS_STATUS_REMOTE_BRANCH:#$VCS_STATUS_LOCAL_BRANCH} ]]; then | ||
408 | res+="${meta}:${clean}${(V)VCS_STATUS_REMOTE_BRANCH//\%/%%}" # escape % | ||
409 | fi | ||
410 | |||
411 | # ⇣42 if behind the remote. | ||
412 | (( VCS_STATUS_COMMITS_BEHIND )) && res+=" ${clean}⇣${VCS_STATUS_COMMITS_BEHIND}" | ||
413 | # ⇡42 if ahead of the remote; no leading space if also behind the remote: ⇣42⇡42. | ||
414 | (( VCS_STATUS_COMMITS_AHEAD && !VCS_STATUS_COMMITS_BEHIND )) && res+=" " | ||
415 | (( VCS_STATUS_COMMITS_AHEAD )) && res+="${clean}⇡${VCS_STATUS_COMMITS_AHEAD}" | ||
416 | # ⇠42 if behind the push remote. | ||
417 | (( VCS_STATUS_PUSH_COMMITS_BEHIND )) && res+=" ${clean}⇠${VCS_STATUS_PUSH_COMMITS_BEHIND}" | ||
418 | (( VCS_STATUS_PUSH_COMMITS_AHEAD && !VCS_STATUS_PUSH_COMMITS_BEHIND )) && res+=" " | ||
419 | # ⇢42 if ahead of the push remote; no leading space if also behind: ⇠42⇢42. | ||
420 | (( VCS_STATUS_PUSH_COMMITS_AHEAD )) && res+="${clean}⇢${VCS_STATUS_PUSH_COMMITS_AHEAD}" | ||
421 | # *42 if have stashes. | ||
422 | (( VCS_STATUS_STASHES )) && res+=" ${clean}*${VCS_STATUS_STASHES}" | ||
423 | # 'merge' if the repo is in an unusual state. | ||
424 | [[ -n $VCS_STATUS_ACTION ]] && res+=" ${conflicted}${VCS_STATUS_ACTION}" | ||
425 | # ~42 if have merge conflicts. | ||
426 | (( VCS_STATUS_NUM_CONFLICTED )) && res+=" ${conflicted}~${VCS_STATUS_NUM_CONFLICTED}" | ||
427 | # +42 if have staged changes. | ||
428 | (( VCS_STATUS_NUM_STAGED )) && res+=" ${modified}+${VCS_STATUS_NUM_STAGED}" | ||
429 | # !42 if have unstaged changes. | ||
430 | (( VCS_STATUS_NUM_UNSTAGED )) && res+=" ${modified}!${VCS_STATUS_NUM_UNSTAGED}" | ||
431 | # ?42 if have untracked files. It's really a question mark, your font isn't broken. | ||
432 | # See POWERLEVEL9K_VCS_UNTRACKED_ICON above if you want to use a different icon. | ||
433 | # Remove the next line if you don't want to see untracked files at all. | ||
434 | (( VCS_STATUS_NUM_UNTRACKED )) && res+=" ${untracked}${(g::)POWERLEVEL9K_VCS_UNTRACKED_ICON}${VCS_STATUS_NUM_UNTRACKED}" | ||
435 | # "─" if the number of unstaged files is unknown. This can happen due to | ||
436 | # POWERLEVEL9K_VCS_MAX_INDEX_SIZE_DIRTY (see below) being set to a non-negative number lower | ||
437 | # than the number of files in the Git index, or due to bash.showDirtyState being set to false | ||
438 | # in the repository config. The number of staged and untracked files may also be unknown | ||
439 | # in this case. | ||
440 | (( VCS_STATUS_HAS_UNSTAGED == -1 )) && res+=" ${modified}─" | ||
441 | |||
442 | typeset -g my_git_format=$res | ||
443 | } | ||
444 | functions -M my_git_formatter 2>/dev/null | ||
445 | |||
446 | # Don't count the number of unstaged, untracked and conflicted files in Git repositories with | ||
447 | # more than this many files in the index. Negative value means infinity. | ||
448 | # | ||
449 | # If you are working in Git repositories with tens of millions of files and seeing performance | ||
450 | # sagging, try setting POWERLEVEL9K_VCS_MAX_INDEX_SIZE_DIRTY to a number lower than the output | ||
451 | # of `git ls-files | wc -l`. Alternatively, add `bash.showDirtyState = false` to the repository's | ||
452 | # config: `git config bash.showDirtyState false`. | ||
453 | typeset -g POWERLEVEL9K_VCS_MAX_INDEX_SIZE_DIRTY=-1 | ||
454 | |||
455 | # Don't show Git status in prompt for repositories whose workdir matches this pattern. | ||
456 | # For example, if set to '~', the Git repository at $HOME/.git will be ignored. | ||
457 | # Multiple patterns can be combined with '|': '~(|/foo)|/bar/baz/*'. | ||
458 | # typeset -g POWERLEVEL9K_VCS_DISABLED_WORKDIR_PATTERN='~' | ||
459 | |||
460 | # Disable the default Git status formatting. | ||
461 | typeset -g POWERLEVEL9K_VCS_DISABLE_GITSTATUS_FORMATTING=true | ||
462 | # Install our own Git status formatter. | ||
463 | typeset -g POWERLEVEL9K_VCS_CONTENT_EXPANSION='${$((my_git_formatter(1)))+${my_git_format}}' | ||
464 | typeset -g POWERLEVEL9K_VCS_LOADING_CONTENT_EXPANSION='${$((my_git_formatter(0)))+${my_git_format}}' | ||
465 | # Enable counters for staged, unstaged, etc. | ||
466 | typeset -g POWERLEVEL9K_VCS_{STAGED,UNSTAGED,UNTRACKED,CONFLICTED,COMMITS_AHEAD,COMMITS_BEHIND}_MAX_NUM=-1 | ||
467 | |||
468 | # Icon color. | ||
469 | typeset -g POWERLEVEL9K_VCS_VISUAL_IDENTIFIER_COLOR=76 | ||
470 | typeset -g POWERLEVEL9K_VCS_LOADING_VISUAL_IDENTIFIER_COLOR=244 | ||
471 | # Custom icon. | ||
472 | # typeset -g POWERLEVEL9K_VCS_VISUAL_IDENTIFIER_EXPANSION='⭐' | ||
473 | # Custom prefix. | ||
474 | # typeset -g POWERLEVEL9K_VCS_PREFIX='%fon ' | ||
475 | |||
476 | # Show status of repositories of these types. You can add svn and/or hg if you are | ||
477 | # using them. If you do, your prompt may become slow even when your current directory | ||
478 | # isn't in an svn or hg reposotiry. | ||
479 | typeset -g POWERLEVEL9K_VCS_BACKENDS=(git) | ||
480 | |||
481 | # These settings are used for repositories other than Git or when gitstatusd fails and | ||
482 | # Powerlevel10k has to fall back to using vcs_info. | ||
483 | typeset -g POWERLEVEL9K_VCS_CLEAN_FOREGROUND=76 | ||
484 | typeset -g POWERLEVEL9K_VCS_UNTRACKED_FOREGROUND=76 | ||
485 | typeset -g POWERLEVEL9K_VCS_MODIFIED_FOREGROUND=178 | ||
486 | |||
487 | ##########################[ status: exit code of the last command ]########################### | ||
488 | # Enable OK_PIPE, ERROR_PIPE and ERROR_SIGNAL status states to allow us to enable, disable and | ||
489 | # style them independently from the regular OK and ERROR state. | ||
490 | typeset -g POWERLEVEL9K_STATUS_EXTENDED_STATES=true | ||
491 | |||
492 | # Status on success. No content, just an icon. No need to show it if prompt_char is enabled as | ||
493 | # it will signify success by turning green. | ||
494 | typeset -g POWERLEVEL9K_STATUS_OK=false | ||
495 | typeset -g POWERLEVEL9K_STATUS_OK_FOREGROUND=70 | ||
496 | typeset -g POWERLEVEL9K_STATUS_OK_VISUAL_IDENTIFIER_EXPANSION='✔' | ||
497 | |||
498 | # Status when some part of a pipe command fails but the overall exit status is zero. It may look | ||
499 | # like this: 1|0. | ||
500 | typeset -g POWERLEVEL9K_STATUS_OK_PIPE=true | ||
501 | typeset -g POWERLEVEL9K_STATUS_OK_PIPE_FOREGROUND=70 | ||
502 | typeset -g POWERLEVEL9K_STATUS_OK_PIPE_VISUAL_IDENTIFIER_EXPANSION='✔' | ||
503 | |||
504 | # Status when it's just an error code (e.g., '1'). No need to show it if prompt_char is enabled as | ||
505 | # it will signify error by turning red. | ||
506 | typeset -g POWERLEVEL9K_STATUS_ERROR=true | ||
507 | typeset -g POWERLEVEL9K_STATUS_ERROR_FOREGROUND=160 | ||
508 | typeset -g POWERLEVEL9K_STATUS_ERROR_VISUAL_IDENTIFIER_EXPANSION='✘' | ||
509 | |||
510 | # Status when the last command was terminated by a signal. | ||
511 | typeset -g POWERLEVEL9K_STATUS_ERROR_SIGNAL=true | ||
512 | typeset -g POWERLEVEL9K_STATUS_ERROR_SIGNAL_FOREGROUND=160 | ||
513 | # Use terse signal names: "INT" instead of "SIGINT(2)". | ||
514 | typeset -g POWERLEVEL9K_STATUS_VERBOSE_SIGNAME=false | ||
515 | typeset -g POWERLEVEL9K_STATUS_ERROR_SIGNAL_VISUAL_IDENTIFIER_EXPANSION='✘' | ||
516 | |||
517 | # Status when some part of a pipe command fails and the overall exit status is also non-zero. | ||
518 | # It may look like this: 1|0. | ||
519 | typeset -g POWERLEVEL9K_STATUS_ERROR_PIPE=true | ||
520 | typeset -g POWERLEVEL9K_STATUS_ERROR_PIPE_FOREGROUND=160 | ||
521 | typeset -g POWERLEVEL9K_STATUS_ERROR_PIPE_VISUAL_IDENTIFIER_EXPANSION='✘' | ||
522 | |||
523 | ###################[ command_execution_time: duration of the last command ]################### | ||
524 | # Show duration of the last command if takes at least this many seconds. | ||
525 | typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_THRESHOLD=3 | ||
526 | # Show this many fractional digits. Zero means round to seconds. | ||
527 | typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_PRECISION=0 | ||
528 | # Execution time color. | ||
529 | typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_FOREGROUND=101 | ||
530 | # Duration format: 1d 2h 3m 4s. | ||
531 | typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_FORMAT='d h m s' | ||
532 | # Custom icon. | ||
533 | # typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_VISUAL_IDENTIFIER_EXPANSION='⭐' | ||
534 | # Custom prefix. | ||
535 | # typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_PREFIX='%ftook ' | ||
536 | |||
537 | #######################[ background_jobs: presence of background jobs ]####################### | ||
538 | # Don't show the number of background jobs. | ||
539 | typeset -g POWERLEVEL9K_BACKGROUND_JOBS_VERBOSE=false | ||
540 | # Background jobs color. | ||
541 | typeset -g POWERLEVEL9K_BACKGROUND_JOBS_FOREGROUND=70 | ||
542 | # Custom icon. | ||
543 | # typeset -g POWERLEVEL9K_BACKGROUND_JOBS_VISUAL_IDENTIFIER_EXPANSION='⭐' | ||
544 | |||
545 | #######################[ direnv: direnv status (https://direnv.net/) ]######################## | ||
546 | # Direnv color. | ||
547 | typeset -g POWERLEVEL9K_DIRENV_FOREGROUND=178 | ||
548 | # Custom icon. | ||
549 | # typeset -g POWERLEVEL9K_DIRENV_VISUAL_IDENTIFIER_EXPANSION='⭐' | ||
550 | |||
551 | ###############[ asdf: asdf version manager (https://github.com/asdf-vm/asdf) ]############### | ||
552 | # Default asdf color. Only used to display tools for which there is no color override (see below). | ||
553 | # Tip: Override this parameter for ${TOOL} with POWERLEVEL9K_ASDF_${TOOL}_FOREGROUND. | ||
554 | typeset -g POWERLEVEL9K_ASDF_FOREGROUND=66 | ||
555 | |||
556 | # There are four parameters that can be used to hide asdf tools. Each parameter describes | ||
557 | # conditions under which a tool gets hidden. Parameters can hide tools but not unhide them. If at | ||
558 | # least one parameter decides to hide a tool, that tool gets hidden. If no parameter decides to | ||
559 | # hide a tool, it gets shown. | ||
560 | # | ||
561 | # Special note on the difference between POWERLEVEL9K_ASDF_SOURCES and | ||
562 | # POWERLEVEL9K_ASDF_PROMPT_ALWAYS_SHOW. Consider the effect of the following commands: | ||
563 | # | ||
564 | # asdf local python 3.8.1 | ||
565 | # asdf global python 3.8.1 | ||
566 | # | ||
567 | # After running both commands the current python version is 3.8.1 and its source is "local" as | ||
568 | # it takes precedence over "global". If POWERLEVEL9K_ASDF_PROMPT_ALWAYS_SHOW is set to false, | ||
569 | # it'll hide python version in this case because 3.8.1 is the same as the global version. | ||
570 | # POWERLEVEL9K_ASDF_SOURCES will hide python version only if the value of this parameter doesn't | ||
571 | # contain "local". | ||
572 | |||
573 | # Hide tool versions that don't come from one of these sources. | ||
574 | # | ||
575 | # Available sources: | ||
576 | # | ||
577 | # - shell `asdf current` says "set by ASDF_${TOOL}_VERSION environment variable" | ||
578 | # - local `asdf current` says "set by /some/not/home/directory/file" | ||
579 | # - global `asdf current` says "set by /home/username/file" | ||
580 | # | ||
581 | # Note: If this parameter is set to (shell local global), it won't hide tools. | ||
582 | # Tip: Override this parameter for ${TOOL} with POWERLEVEL9K_ASDF_${TOOL}_SOURCES. | ||
583 | typeset -g POWERLEVEL9K_ASDF_SOURCES=(shell local global) | ||
584 | |||
585 | # If set to false, hide tool versions that are the same as global. | ||
586 | # | ||
587 | # Note: The name of this parameter doesn't reflect its meaning at all. | ||
588 | # Note: If this parameter is set to true, it won't hide tools. | ||
589 | # Tip: Override this parameter for ${TOOL} with POWERLEVEL9K_ASDF_${TOOL}_PROMPT_ALWAYS_SHOW. | ||
590 | typeset -g POWERLEVEL9K_ASDF_PROMPT_ALWAYS_SHOW=false | ||
591 | |||
592 | # If set to false, hide tool versions that are equal to "system". | ||
593 | # | ||
594 | # Note: If this parameter is set to true, it won't hide tools. | ||
595 | # Tip: Override this parameter for ${TOOL} with POWERLEVEL9K_ASDF_${TOOL}_SHOW_SYSTEM. | ||
596 | typeset -g POWERLEVEL9K_ASDF_SHOW_SYSTEM=true | ||
597 | |||
598 | # If set to non-empty value, hide tools unless there is a file matching the specified file pattern | ||
599 | # in the current directory, or its parent directory, or its grandparent directory, and so on. | ||
600 | # | ||
601 | # Note: If this parameter is set to empty value, it won't hide tools. | ||
602 | # Note: SHOW_ON_UPGLOB isn't specific to asdf. It works with all prompt segments. | ||
603 | # Tip: Override this parameter for ${TOOL} with POWERLEVEL9K_ASDF_${TOOL}_SHOW_ON_UPGLOB. | ||
604 | # | ||
605 | # Example: Hide nodejs version when there is no package.json and no *.js files in the current | ||
606 | # directory, in `..`, in `../..` and so on. | ||
607 | # | ||
608 | # typeset -g POWERLEVEL9K_ASDF_NODEJS_SHOW_ON_UPGLOB='*.js|package.json' | ||
609 | typeset -g POWERLEVEL9K_ASDF_SHOW_ON_UPGLOB= | ||
610 | |||
611 | # Ruby version from asdf. | ||
612 | typeset -g POWERLEVEL9K_ASDF_RUBY_FOREGROUND=168 | ||
613 | # typeset -g POWERLEVEL9K_ASDF_RUBY_VISUAL_IDENTIFIER_EXPANSION='⭐' | ||
614 | # typeset -g POWERLEVEL9K_ASDF_RUBY_SHOW_ON_UPGLOB='*.foo|*.bar' | ||
615 | |||
616 | # Python version from asdf. | ||
617 | typeset -g POWERLEVEL9K_ASDF_PYTHON_FOREGROUND=37 | ||
618 | # typeset -g POWERLEVEL9K_ASDF_PYTHON_VISUAL_IDENTIFIER_EXPANSION='⭐' | ||
619 | # typeset -g POWERLEVEL9K_ASDF_PYTHON_SHOW_ON_UPGLOB='*.foo|*.bar' | ||
620 | |||
621 | # Go version from asdf. | ||
622 | typeset -g POWERLEVEL9K_ASDF_GOLANG_FOREGROUND=37 | ||
623 | # typeset -g POWERLEVEL9K_ASDF_GOLANG_VISUAL_IDENTIFIER_EXPANSION='⭐' | ||
624 | # typeset -g POWERLEVEL9K_ASDF_GOLANG_SHOW_ON_UPGLOB='*.foo|*.bar' | ||
625 | |||
626 | # Node.js version from asdf. | ||
627 | typeset -g POWERLEVEL9K_ASDF_NODEJS_FOREGROUND=70 | ||
628 | # typeset -g POWERLEVEL9K_ASDF_NODEJS_VISUAL_IDENTIFIER_EXPANSION='⭐' | ||
629 | # typeset -g POWERLEVEL9K_ASDF_NODEJS_SHOW_ON_UPGLOB='*.foo|*.bar' | ||
630 | |||
631 | # Rust version from asdf. | ||
632 | typeset -g POWERLEVEL9K_ASDF_RUST_FOREGROUND=37 | ||
633 | # typeset -g POWERLEVEL9K_ASDF_RUST_VISUAL_IDENTIFIER_EXPANSION='⭐' | ||
634 | # typeset -g POWERLEVEL9K_ASDF_RUST_SHOW_ON_UPGLOB='*.foo|*.bar' | ||
635 | |||
636 | # .NET Core version from asdf. | ||
637 | typeset -g POWERLEVEL9K_ASDF_DOTNET_CORE_FOREGROUND=134 | ||
638 | # typeset -g POWERLEVEL9K_ASDF_DOTNET_CORE_VISUAL_IDENTIFIER_EXPANSION='⭐' | ||
639 | # typeset -g POWERLEVEL9K_ASDF_DOTNET_SHOW_ON_UPGLOB='*.foo|*.bar' | ||
640 | |||
641 | # Flutter version from asdf. | ||
642 | typeset -g POWERLEVEL9K_ASDF_FLUTTER_FOREGROUND=38 | ||
643 | # typeset -g POWERLEVEL9K_ASDF_FLUTTER_VISUAL_IDENTIFIER_EXPANSION='⭐' | ||
644 | # typeset -g POWERLEVEL9K_ASDF_FLUTTER_SHOW_ON_UPGLOB='*.foo|*.bar' | ||
645 | |||
646 | # Lua version from asdf. | ||
647 | typeset -g POWERLEVEL9K_ASDF_LUA_FOREGROUND=32 | ||
648 | # typeset -g POWERLEVEL9K_ASDF_LUA_VISUAL_IDENTIFIER_EXPANSION='⭐' | ||
649 | # typeset -g POWERLEVEL9K_ASDF_LUA_SHOW_ON_UPGLOB='*.foo|*.bar' | ||
650 | |||
651 | # Java version from asdf. | ||
652 | typeset -g POWERLEVEL9K_ASDF_JAVA_FOREGROUND=32 | ||
653 | # typeset -g POWERLEVEL9K_ASDF_JAVA_VISUAL_IDENTIFIER_EXPANSION='⭐' | ||
654 | # typeset -g POWERLEVEL9K_ASDF_JAVA_SHOW_ON_UPGLOB='*.foo|*.bar' | ||
655 | |||
656 | # Perl version from asdf. | ||
657 | typeset -g POWERLEVEL9K_ASDF_PERL_FOREGROUND=67 | ||
658 | # typeset -g POWERLEVEL9K_ASDF_PERL_VISUAL_IDENTIFIER_EXPANSION='⭐' | ||
659 | # typeset -g POWERLEVEL9K_ASDF_PERL_SHOW_ON_UPGLOB='*.foo|*.bar' | ||
660 | |||
661 | # Erlang version from asdf. | ||
662 | typeset -g POWERLEVEL9K_ASDF_ERLANG_FOREGROUND=125 | ||
663 | # typeset -g POWERLEVEL9K_ASDF_ERLANG_VISUAL_IDENTIFIER_EXPANSION='⭐' | ||
664 | # typeset -g POWERLEVEL9K_ASDF_ERLANG_SHOW_ON_UPGLOB='*.foo|*.bar' | ||
665 | |||
666 | # Elixir version from asdf. | ||
667 | typeset -g POWERLEVEL9K_ASDF_ELIXIR_FOREGROUND=129 | ||
668 | # typeset -g POWERLEVEL9K_ASDF_ELIXIR_VISUAL_IDENTIFIER_EXPANSION='⭐' | ||
669 | # typeset -g POWERLEVEL9K_ASDF_ELIXIR_SHOW_ON_UPGLOB='*.foo|*.bar' | ||
670 | |||
671 | # Postgres version from asdf. | ||
672 | typeset -g POWERLEVEL9K_ASDF_POSTGRES_FOREGROUND=31 | ||
673 | # typeset -g POWERLEVEL9K_ASDF_POSTGRES_VISUAL_IDENTIFIER_EXPANSION='⭐' | ||
674 | # typeset -g POWERLEVEL9K_ASDF_POSTGRES_SHOW_ON_UPGLOB='*.foo|*.bar' | ||
675 | |||
676 | # PHP version from asdf. | ||
677 | typeset -g POWERLEVEL9K_ASDF_PHP_FOREGROUND=99 | ||
678 | # typeset -g POWERLEVEL9K_ASDF_PHP_VISUAL_IDENTIFIER_EXPANSION='⭐' | ||
679 | # typeset -g POWERLEVEL9K_ASDF_PHP_SHOW_ON_UPGLOB='*.foo|*.bar' | ||
680 | |||
681 | # Haskell version from asdf. | ||
682 | typeset -g POWERLEVEL9K_ASDF_HASKELL_FOREGROUND=172 | ||
683 | # typeset -g POWERLEVEL9K_ASDF_HASKELL_VISUAL_IDENTIFIER_EXPANSION='⭐' | ||
684 | # typeset -g POWERLEVEL9K_ASDF_HASKELL_SHOW_ON_UPGLOB='*.foo|*.bar' | ||
685 | |||
686 | # Julia version from asdf. | ||
687 | typeset -g POWERLEVEL9K_ASDF_JULIA_FOREGROUND=70 | ||
688 | # typeset -g POWERLEVEL9K_ASDF_JULIA_VISUAL_IDENTIFIER_EXPANSION='⭐' | ||
689 | # typeset -g POWERLEVEL9K_ASDF_JULIA_SHOW_ON_UPGLOB='*.foo|*.bar' | ||
690 | |||
691 | ##########[ nordvpn: nordvpn connection status, linux only (https://nordvpn.com/) ]########### | ||
692 | # NordVPN connection indicator color. | ||
693 | typeset -g POWERLEVEL9K_NORDVPN_FOREGROUND=39 | ||
694 | # Hide NordVPN connection indicator when not connected. | ||
695 | typeset -g POWERLEVEL9K_NORDVPN_{DISCONNECTED,CONNECTING,DISCONNECTING}_CONTENT_EXPANSION= | ||
696 | typeset -g POWERLEVEL9K_NORDVPN_{DISCONNECTED,CONNECTING,DISCONNECTING}_VISUAL_IDENTIFIER_EXPANSION= | ||
697 | # Custom icon. | ||
698 | # typeset -g POWERLEVEL9K_NORDVPN_VISUAL_IDENTIFIER_EXPANSION='⭐' | ||
699 | |||
700 | #################[ ranger: ranger shell (https://github.com/ranger/ranger) ]################## | ||
701 | # Ranger shell color. | ||
702 | typeset -g POWERLEVEL9K_RANGER_FOREGROUND=178 | ||
703 | # Custom icon. | ||
704 | # typeset -g POWERLEVEL9K_RANGER_VISUAL_IDENTIFIER_EXPANSION='⭐' | ||
705 | |||
706 | ######################[ nnn: nnn shell (https://github.com/jarun/nnn) ]####################### | ||
707 | # Nnn shell color. | ||
708 | typeset -g POWERLEVEL9K_NNN_FOREGROUND=72 | ||
709 | # Custom icon. | ||
710 | # typeset -g POWERLEVEL9K_NNN_VISUAL_IDENTIFIER_EXPANSION='⭐' | ||
711 | |||
712 | ###########################[ vim_shell: vim shell indicator (:sh) ]########################### | ||
713 | # Vim shell indicator color. | ||
714 | typeset -g POWERLEVEL9K_VIM_SHELL_FOREGROUND=34 | ||
715 | # Custom icon. | ||
716 | # typeset -g POWERLEVEL9K_VIM_SHELL_VISUAL_IDENTIFIER_EXPANSION='⭐' | ||
717 | |||
718 | ######[ midnight_commander: midnight commander shell (https://midnight-commander.org/) ]###### | ||
719 | # Midnight Commander shell color. | ||
720 | typeset -g POWERLEVEL9K_MIDNIGHT_COMMANDER_FOREGROUND=178 | ||
721 | # Custom icon. | ||
722 | # typeset -g POWERLEVEL9K_MIDNIGHT_COMMANDER_VISUAL_IDENTIFIER_EXPANSION='⭐' | ||
723 | |||
724 | #[ nix_shell: nix shell (https://nixos.org/nixos/nix-pills/developing-with-nix-shell.html) ]## | ||
725 | # Nix shell color. | ||
726 | typeset -g POWERLEVEL9K_NIX_SHELL_FOREGROUND=74 | ||
727 | |||
728 | # Tip: If you want to see just the icon without "pure" and "impure", uncomment the next line. | ||
729 | # typeset -g POWERLEVEL9K_NIX_SHELL_CONTENT_EXPANSION= | ||
730 | |||
731 | # Custom icon. | ||
732 | # typeset -g POWERLEVEL9K_NIX_SHELL_VISUAL_IDENTIFIER_EXPANSION='⭐' | ||
733 | |||
734 | ##################################[ disk_usage: disk usage ]################################## | ||
735 | # Colors for different levels of disk usage. | ||
736 | typeset -g POWERLEVEL9K_DISK_USAGE_NORMAL_FOREGROUND=35 | ||
737 | typeset -g POWERLEVEL9K_DISK_USAGE_WARNING_FOREGROUND=220 | ||
738 | typeset -g POWERLEVEL9K_DISK_USAGE_CRITICAL_FOREGROUND=160 | ||
739 | # Thresholds for different levels of disk usage (percentage points). | ||
740 | typeset -g POWERLEVEL9K_DISK_USAGE_WARNING_LEVEL=90 | ||
741 | typeset -g POWERLEVEL9K_DISK_USAGE_CRITICAL_LEVEL=95 | ||
742 | # If set to true, hide disk usage when below $POWERLEVEL9K_DISK_USAGE_WARNING_LEVEL percent. | ||
743 | typeset -g POWERLEVEL9K_DISK_USAGE_ONLY_WARNING=false | ||
744 | # Custom icon. | ||
745 | # typeset -g POWERLEVEL9K_DISK_USAGE_VISUAL_IDENTIFIER_EXPANSION='⭐' | ||
746 | |||
747 | ######################################[ ram: free RAM ]####################################### | ||
748 | # RAM color. | ||
749 | typeset -g POWERLEVEL9K_RAM_FOREGROUND=66 | ||
750 | # Custom icon. | ||
751 | # typeset -g POWERLEVEL9K_RAM_VISUAL_IDENTIFIER_EXPANSION='⭐' | ||
752 | |||
753 | #####################################[ swap: used swap ]###################################### | ||
754 | # Swap color. | ||
755 | typeset -g POWERLEVEL9K_SWAP_FOREGROUND=96 | ||
756 | # Custom icon. | ||
757 | # typeset -g POWERLEVEL9K_SWAP_VISUAL_IDENTIFIER_EXPANSION='⭐' | ||
758 | |||
759 | ######################################[ load: CPU load ]###################################### | ||
760 | # Show average CPU load over this many last minutes. Valid values are 1, 5 and 15. | ||
761 | typeset -g POWERLEVEL9K_LOAD_WHICH=5 | ||
762 | # Load color when load is under 50%. | ||
763 | typeset -g POWERLEVEL9K_LOAD_NORMAL_FOREGROUND=66 | ||
764 | # Load color when load is between 50% and 70%. | ||
765 | typeset -g POWERLEVEL9K_LOAD_WARNING_FOREGROUND=178 | ||
766 | # Load color when load is over 70%. | ||
767 | typeset -g POWERLEVEL9K_LOAD_CRITICAL_FOREGROUND=166 | ||
768 | # Custom icon. | ||
769 | # typeset -g POWERLEVEL9K_LOAD_VISUAL_IDENTIFIER_EXPANSION='⭐' | ||
770 | |||
771 | ################[ todo: todo items (https://github.com/todotxt/todo.txt-cli) ]################ | ||
772 | # Todo color. | ||
773 | typeset -g POWERLEVEL9K_TODO_FOREGROUND=110 | ||
774 | # Hide todo when the total number of tasks is zero. | ||
775 | typeset -g POWERLEVEL9K_TODO_HIDE_ZERO_TOTAL=true | ||
776 | # Hide todo when the number of tasks after filtering is zero. | ||
777 | typeset -g POWERLEVEL9K_TODO_HIDE_ZERO_FILTERED=false | ||
778 | |||
779 | # Todo format. The following parameters are available within the expansion. | ||
780 | # | ||
781 | # - P9K_TODO_TOTAL_TASK_COUNT The total number of tasks. | ||
782 | # - P9K_TODO_FILTERED_TASK_COUNT The number of tasks after filtering. | ||
783 | # | ||
784 | # These variables correspond to the last line of the output of `todo.sh -p ls`: | ||
785 | # | ||
786 | # TODO: 24 of 42 tasks shown | ||
787 | # | ||
788 | # Here 24 is P9K_TODO_FILTERED_TASK_COUNT and 42 is P9K_TODO_TOTAL_TASK_COUNT. | ||
789 | # | ||
790 | # typeset -g POWERLEVEL9K_TODO_CONTENT_EXPANSION='$P9K_TODO_FILTERED_TASK_COUNT' | ||
791 | |||
792 | # Custom icon. | ||
793 | # typeset -g POWERLEVEL9K_TODO_VISUAL_IDENTIFIER_EXPANSION='⭐' | ||
794 | |||
795 | ###########[ timewarrior: timewarrior tracking status (https://timewarrior.net/) ]############ | ||
796 | # Timewarrior color. | ||
797 | typeset -g POWERLEVEL9K_TIMEWARRIOR_FOREGROUND=110 | ||
798 | # If the tracked task is longer than 24 characters, truncate and append "…". | ||
799 | # Tip: To always display tasks without truncation, delete the following parameter. | ||
800 | # Tip: To hide task names and display just the icon when time tracking is enabled, set the | ||
801 | # value of the following parameter to "". | ||
802 | typeset -g POWERLEVEL9K_TIMEWARRIOR_CONTENT_EXPANSION='${P9K_CONTENT:0:24}${${P9K_CONTENT:24}:+…}' | ||
803 | |||
804 | # Custom icon. | ||
805 | # typeset -g POWERLEVEL9K_TIMEWARRIOR_VISUAL_IDENTIFIER_EXPANSION='⭐' | ||
806 | |||
807 | ##############[ taskwarrior: taskwarrior task count (https://taskwarrior.org/) ]############## | ||
808 | # Taskwarrior color. | ||
809 | typeset -g POWERLEVEL9K_TASKWARRIOR_FOREGROUND=74 | ||
810 | |||
811 | # Taskwarrior segment format. The following parameters are available within the expansion. | ||
812 | # | ||
813 | # - P9K_TASKWARRIOR_PENDING_COUNT The number of pending tasks: `task +PENDING count`. | ||
814 | # - P9K_TASKWARRIOR_OVERDUE_COUNT The number of overdue tasks: `task +OVERDUE count`. | ||
815 | # | ||
816 | # Zero values are represented as empty parameters. | ||
817 | # | ||
818 | # The default format: | ||
819 | # | ||
820 | # '${P9K_TASKWARRIOR_OVERDUE_COUNT:+"!$P9K_TASKWARRIOR_OVERDUE_COUNT/"}$P9K_TASKWARRIOR_PENDING_COUNT' | ||
821 | # | ||
822 | # typeset -g POWERLEVEL9K_TASKWARRIOR_CONTENT_EXPANSION='$P9K_TASKWARRIOR_PENDING_COUNT' | ||
823 | |||
824 | # Custom icon. | ||
825 | # typeset -g POWERLEVEL9K_TASKWARRIOR_VISUAL_IDENTIFIER_EXPANSION='⭐' | ||
826 | |||
827 | ##################################[ context: user@hostname ]################################## | ||
828 | # Context color when running with privileges. | ||
829 | typeset -g POWERLEVEL9K_CONTEXT_ROOT_FOREGROUND=178 | ||
830 | # Context color in SSH without privileges. | ||
831 | typeset -g POWERLEVEL9K_CONTEXT_{REMOTE,REMOTE_SUDO}_FOREGROUND=31 | ||
832 | # Default context color (no privileges, no SSH). | ||
833 | typeset -g POWERLEVEL9K_CONTEXT_FOREGROUND=31 | ||
834 | |||
835 | # Context format when running with privileges: bold user@hostname. | ||
836 | typeset -g POWERLEVEL9K_CONTEXT_ROOT_TEMPLATE='%B%n@%m' | ||
837 | # Context format when in SSH without privileges: user@hostname. | ||
838 | typeset -g POWERLEVEL9K_CONTEXT_{REMOTE,REMOTE_SUDO}_TEMPLATE='%n@%m' | ||
839 | # Default context format (no privileges, no SSH): user@hostname. | ||
840 | typeset -g POWERLEVEL9K_CONTEXT_TEMPLATE='%n@%m' | ||
841 | |||
842 | # Don't show context unless running with privileges or in SSH. | ||
843 | # Tip: Remove the next line to always show context. | ||
844 | typeset -g POWERLEVEL9K_CONTEXT_{DEFAULT,SUDO}_{CONTENT,VISUAL_IDENTIFIER}_EXPANSION= | ||
845 | |||
846 | # Custom icon. | ||
847 | # typeset -g POWERLEVEL9K_CONTEXT_VISUAL_IDENTIFIER_EXPANSION='⭐' | ||
848 | # Custom prefix. | ||
849 | # typeset -g POWERLEVEL9K_CONTEXT_PREFIX='%fwith ' | ||
850 | |||
851 | ###[ virtualenv: python virtual environment (https://docs.python.org/3/library/venv.html) ]### | ||
852 | # Python virtual environment color. | ||
853 | typeset -g POWERLEVEL9K_VIRTUALENV_FOREGROUND=37 | ||
854 | # Don't show Python version next to the virtual environment name. | ||
855 | typeset -g POWERLEVEL9K_VIRTUALENV_SHOW_PYTHON_VERSION=false | ||
856 | # If set to "false", won't show virtualenv if pyenv is already shown. | ||
857 | # If set to "if-different", won't show virtualenv if it's the same as pyenv. | ||
858 | typeset -g POWERLEVEL9K_VIRTUALENV_SHOW_WITH_PYENV=false | ||
859 | # Separate environment name from Python version only with a space. | ||
860 | typeset -g POWERLEVEL9K_VIRTUALENV_{LEFT,RIGHT}_DELIMITER= | ||
861 | # Custom icon. | ||
862 | # typeset -g POWERLEVEL9K_VIRTUALENV_VISUAL_IDENTIFIER_EXPANSION='⭐' | ||
863 | |||
864 | #####################[ anaconda: conda environment (https://conda.io/) ]###################### | ||
865 | # Anaconda environment color. | ||
866 | typeset -g POWERLEVEL9K_ANACONDA_FOREGROUND=37 | ||
867 | |||
868 | # Anaconda segment format. The following parameters are available within the expansion. | ||
869 | # | ||
870 | # - CONDA_PREFIX Absolute path to the active Anaconda/Miniconda environment. | ||
871 | # - CONDA_DEFAULT_ENV Name of the active Anaconda/Miniconda environment. | ||
872 | # - CONDA_PROMPT_MODIFIER Configurable prompt modifier (see below). | ||
873 | # - P9K_ANACONDA_PYTHON_VERSION Current python version (python --version). | ||
874 | # | ||
875 | # CONDA_PROMPT_MODIFIER can be configured with the following command: | ||
876 | # | ||
877 | # conda config --set env_prompt '({default_env}) ' | ||
878 | # | ||
879 | # The last argument is a Python format string that can use the following variables: | ||
880 | # | ||
881 | # - prefix The same as CONDA_PREFIX. | ||
882 | # - default_env The same as CONDA_DEFAULT_ENV. | ||
883 | # - name The last segment of CONDA_PREFIX. | ||
884 | # - stacked_env Comma-separated list of names in the environment stack. The first element is | ||
885 | # always the same as default_env. | ||
886 | # | ||
887 | # Note: '({default_env}) ' is the default value of env_prompt. | ||
888 | # | ||
889 | # The default value of POWERLEVEL9K_ANACONDA_CONTENT_EXPANSION expands to $CONDA_PROMPT_MODIFIER | ||
890 | # without the surrounding parentheses, or to the last path component of CONDA_PREFIX if the former | ||
891 | # is empty. | ||
892 | typeset -g POWERLEVEL9K_ANACONDA_CONTENT_EXPANSION='${${${${CONDA_PROMPT_MODIFIER#\(}% }%\)}:-${CONDA_PREFIX:t}}' | ||
893 | |||
894 | # Custom icon. | ||
895 | # typeset -g POWERLEVEL9K_ANACONDA_VISUAL_IDENTIFIER_EXPANSION='⭐' | ||
896 | |||
897 | ################[ pyenv: python environment (https://github.com/pyenv/pyenv) ]################ | ||
898 | # Pyenv color. | ||
899 | typeset -g POWERLEVEL9K_PYENV_FOREGROUND=37 | ||
900 | # Hide python version if it doesn't come from one of these sources. | ||
901 | typeset -g POWERLEVEL9K_PYENV_SOURCES=(shell local global) | ||
902 | # If set to false, hide python version if it's the same as global: | ||
903 | # $(pyenv version-name) == $(pyenv global). | ||
904 | typeset -g POWERLEVEL9K_PYENV_PROMPT_ALWAYS_SHOW=false | ||
905 | # If set to false, hide python version if it's equal to "system". | ||
906 | typeset -g POWERLEVEL9K_PYENV_SHOW_SYSTEM=true | ||
907 | |||
908 | # Pyenv segment format. The following parameters are available within the expansion. | ||
909 | # | ||
910 | # - P9K_CONTENT Current pyenv environment (pyenv version-name). | ||
911 | # - P9K_PYENV_PYTHON_VERSION Current python version (python --version). | ||
912 | # | ||
913 | # The default format has the following logic: | ||
914 | # | ||
915 | # 1. Display "$P9K_CONTENT $P9K_PYENV_PYTHON_VERSION" if $P9K_PYENV_PYTHON_VERSION is not | ||
916 | # empty and unequal to $P9K_CONTENT. | ||
917 | # 2. Otherwise display just "$P9K_CONTENT". | ||
918 | typeset -g POWERLEVEL9K_PYENV_CONTENT_EXPANSION='${P9K_CONTENT}${${P9K_PYENV_PYTHON_VERSION:#$P9K_CONTENT}:+ $P9K_PYENV_PYTHON_VERSION}' | ||
919 | |||
920 | # Custom icon. | ||
921 | # typeset -g POWERLEVEL9K_PYENV_VISUAL_IDENTIFIER_EXPANSION='⭐' | ||
922 | |||
923 | ################[ goenv: go environment (https://github.com/syndbg/goenv) ]################ | ||
924 | # Goenv color. | ||
925 | typeset -g POWERLEVEL9K_GOENV_FOREGROUND=37 | ||
926 | # Hide go version if it doesn't come from one of these sources. | ||
927 | typeset -g POWERLEVEL9K_GOENV_SOURCES=(shell local global) | ||
928 | # If set to false, hide go version if it's the same as global: | ||
929 | # $(goenv version-name) == $(goenv global). | ||
930 | typeset -g POWERLEVEL9K_GOENV_PROMPT_ALWAYS_SHOW=false | ||
931 | # If set to false, hide go version if it's equal to "system". | ||
932 | typeset -g POWERLEVEL9K_GOENV_SHOW_SYSTEM=true | ||
933 | # Custom icon. | ||
934 | # typeset -g POWERLEVEL9K_GOENV_VISUAL_IDENTIFIER_EXPANSION='⭐' | ||
935 | |||
936 | ##########[ nodenv: node.js version from nodenv (https://github.com/nodenv/nodenv) ]########## | ||
937 | # Nodenv color. | ||
938 | typeset -g POWERLEVEL9K_NODENV_FOREGROUND=70 | ||
939 | # Hide node version if it doesn't come from one of these sources. | ||
940 | typeset -g POWERLEVEL9K_NODENV_SOURCES=(shell local global) | ||
941 | # If set to false, hide node version if it's the same as global: | ||
942 | # $(nodenv version-name) == $(nodenv global). | ||
943 | typeset -g POWERLEVEL9K_NODENV_PROMPT_ALWAYS_SHOW=false | ||
944 | # If set to false, hide node version if it's equal to "system". | ||
945 | typeset -g POWERLEVEL9K_NODENV_SHOW_SYSTEM=true | ||
946 | # Custom icon. | ||
947 | # typeset -g POWERLEVEL9K_NODENV_VISUAL_IDENTIFIER_EXPANSION='⭐' | ||
948 | |||
949 | ##############[ nvm: node.js version from nvm (https://github.com/nvm-sh/nvm) ]############### | ||
950 | # Nvm color. | ||
951 | typeset -g POWERLEVEL9K_NVM_FOREGROUND=70 | ||
952 | # Custom icon. | ||
953 | # typeset -g POWERLEVEL9K_NVM_VISUAL_IDENTIFIER_EXPANSION='⭐' | ||
954 | |||
955 | ############[ nodeenv: node.js environment (https://github.com/ekalinin/nodeenv) ]############ | ||
956 | # Nodeenv color. | ||
957 | typeset -g POWERLEVEL9K_NODEENV_FOREGROUND=70 | ||
958 | # Don't show Node version next to the environment name. | ||
959 | typeset -g POWERLEVEL9K_NODEENV_SHOW_NODE_VERSION=false | ||
960 | # Separate environment name from Node version only with a space. | ||
961 | typeset -g POWERLEVEL9K_NODEENV_{LEFT,RIGHT}_DELIMITER= | ||
962 | # Custom icon. | ||
963 | # typeset -g POWERLEVEL9K_NODEENV_VISUAL_IDENTIFIER_EXPANSION='⭐' | ||
964 | |||
965 | ##############################[ node_version: node.js version ]############################### | ||
966 | # Node version color. | ||
967 | typeset -g POWERLEVEL9K_NODE_VERSION_FOREGROUND=70 | ||
968 | # Show node version only when in a directory tree containing package.json. | ||
969 | typeset -g POWERLEVEL9K_NODE_VERSION_PROJECT_ONLY=true | ||
970 | # Custom icon. | ||
971 | # typeset -g POWERLEVEL9K_NODE_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' | ||
972 | |||
973 | #######################[ go_version: go version (https://golang.org) ]######################## | ||
974 | # Go version color. | ||
975 | typeset -g POWERLEVEL9K_GO_VERSION_FOREGROUND=37 | ||
976 | # Show go version only when in a go project subdirectory. | ||
977 | typeset -g POWERLEVEL9K_GO_VERSION_PROJECT_ONLY=true | ||
978 | # Custom icon. | ||
979 | # typeset -g POWERLEVEL9K_GO_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' | ||
980 | |||
981 | #################[ rust_version: rustc version (https://www.rust-lang.org) ]################## | ||
982 | # Rust version color. | ||
983 | typeset -g POWERLEVEL9K_RUST_VERSION_FOREGROUND=37 | ||
984 | # Show rust version only when in a rust project subdirectory. | ||
985 | typeset -g POWERLEVEL9K_RUST_VERSION_PROJECT_ONLY=true | ||
986 | # Custom icon. | ||
987 | # typeset -g POWERLEVEL9K_RUST_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' | ||
988 | |||
989 | ###############[ dotnet_version: .NET version (https://dotnet.microsoft.com) ]################ | ||
990 | # .NET version color. | ||
991 | typeset -g POWERLEVEL9K_DOTNET_VERSION_FOREGROUND=134 | ||
992 | # Show .NET version only when in a .NET project subdirectory. | ||
993 | typeset -g POWERLEVEL9K_DOTNET_VERSION_PROJECT_ONLY=true | ||
994 | # Custom icon. | ||
995 | # typeset -g POWERLEVEL9K_DOTNET_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' | ||
996 | |||
997 | #####################[ php_version: php version (https://www.php.net/) ]###################### | ||
998 | # PHP version color. | ||
999 | typeset -g POWERLEVEL9K_PHP_VERSION_FOREGROUND=99 | ||
1000 | # Show PHP version only when in a PHP project subdirectory. | ||
1001 | typeset -g POWERLEVEL9K_PHP_VERSION_PROJECT_ONLY=true | ||
1002 | # Custom icon. | ||
1003 | # typeset -g POWERLEVEL9K_PHP_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' | ||
1004 | |||
1005 | ##########[ laravel_version: laravel php framework version (https://laravel.com/) ]########### | ||
1006 | # Laravel version color. | ||
1007 | typeset -g POWERLEVEL9K_LARAVEL_VERSION_FOREGROUND=161 | ||
1008 | # Custom icon. | ||
1009 | # typeset -g POWERLEVEL9K_LARAVEL_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' | ||
1010 | |||
1011 | ####################[ java_version: java version (https://www.java.com/) ]#################### | ||
1012 | # Java version color. | ||
1013 | typeset -g POWERLEVEL9K_JAVA_VERSION_FOREGROUND=32 | ||
1014 | # Show java version only when in a java project subdirectory. | ||
1015 | typeset -g POWERLEVEL9K_JAVA_VERSION_PROJECT_ONLY=true | ||
1016 | # Show brief version. | ||
1017 | typeset -g POWERLEVEL9K_JAVA_VERSION_FULL=false | ||
1018 | # Custom icon. | ||
1019 | # typeset -g POWERLEVEL9K_JAVA_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' | ||
1020 | |||
1021 | ###[ package: name@version from package.json (https://docs.npmjs.com/files/package.json) ]#### | ||
1022 | # Package color. | ||
1023 | typeset -g POWERLEVEL9K_PACKAGE_FOREGROUND=117 | ||
1024 | # Package format. The following parameters are available within the expansion. | ||
1025 | # | ||
1026 | # - P9K_PACKAGE_NAME The value of `name` field in package.json. | ||
1027 | # - P9K_PACKAGE_VERSION The value of `version` field in package.json. | ||
1028 | # | ||
1029 | # typeset -g POWERLEVEL9K_PACKAGE_CONTENT_EXPANSION='${P9K_PACKAGE_NAME//\%/%%}@${P9K_PACKAGE_VERSION//\%/%%}' | ||
1030 | # Custom icon. | ||
1031 | # typeset -g POWERLEVEL9K_PACKAGE_VISUAL_IDENTIFIER_EXPANSION='⭐' | ||
1032 | |||
1033 | #############[ rbenv: ruby version from rbenv (https://github.com/rbenv/rbenv) ]############## | ||
1034 | # Rbenv color. | ||
1035 | typeset -g POWERLEVEL9K_RBENV_FOREGROUND=168 | ||
1036 | # Hide ruby version if it doesn't come from one of these sources. | ||
1037 | typeset -g POWERLEVEL9K_RBENV_SOURCES=(shell local global) | ||
1038 | # If set to false, hide ruby version if it's the same as global: | ||
1039 | # $(rbenv version-name) == $(rbenv global). | ||
1040 | typeset -g POWERLEVEL9K_RBENV_PROMPT_ALWAYS_SHOW=false | ||
1041 | # If set to false, hide ruby version if it's equal to "system". | ||
1042 | typeset -g POWERLEVEL9K_RBENV_SHOW_SYSTEM=true | ||
1043 | # Custom icon. | ||
1044 | # typeset -g POWERLEVEL9K_RBENV_VISUAL_IDENTIFIER_EXPANSION='⭐' | ||
1045 | |||
1046 | #######################[ rvm: ruby version from rvm (https://rvm.io) ]######################## | ||
1047 | # Rvm color. | ||
1048 | typeset -g POWERLEVEL9K_RVM_FOREGROUND=168 | ||
1049 | # Don't show @gemset at the end. | ||
1050 | typeset -g POWERLEVEL9K_RVM_SHOW_GEMSET=false | ||
1051 | # Don't show ruby- at the front. | ||
1052 | typeset -g POWERLEVEL9K_RVM_SHOW_PREFIX=false | ||
1053 | # Custom icon. | ||
1054 | # typeset -g POWERLEVEL9K_RVM_VISUAL_IDENTIFIER_EXPANSION='⭐' | ||
1055 | |||
1056 | ###########[ fvm: flutter version management (https://github.com/leoafarias/fvm) ]############ | ||
1057 | # Fvm color. | ||
1058 | typeset -g POWERLEVEL9K_FVM_FOREGROUND=38 | ||
1059 | # Custom icon. | ||
1060 | # typeset -g POWERLEVEL9K_FVM_VISUAL_IDENTIFIER_EXPANSION='⭐' | ||
1061 | |||
1062 | ##########[ luaenv: lua version from luaenv (https://github.com/cehoffman/luaenv) ]########### | ||
1063 | # Lua color. | ||
1064 | typeset -g POWERLEVEL9K_LUAENV_FOREGROUND=32 | ||
1065 | # Hide lua version if it doesn't come from one of these sources. | ||
1066 | typeset -g POWERLEVEL9K_LUAENV_SOURCES=(shell local global) | ||
1067 | # If set to false, hide lua version if it's the same as global: | ||
1068 | # $(luaenv version-name) == $(luaenv global). | ||
1069 | typeset -g POWERLEVEL9K_LUAENV_PROMPT_ALWAYS_SHOW=false | ||
1070 | # If set to false, hide lua version if it's equal to "system". | ||
1071 | typeset -g POWERLEVEL9K_LUAENV_SHOW_SYSTEM=true | ||
1072 | # Custom icon. | ||
1073 | # typeset -g POWERLEVEL9K_LUAENV_VISUAL_IDENTIFIER_EXPANSION='⭐' | ||
1074 | |||
1075 | ###############[ jenv: java version from jenv (https://github.com/jenv/jenv) ]################ | ||
1076 | # Java color. | ||
1077 | typeset -g POWERLEVEL9K_JENV_FOREGROUND=32 | ||
1078 | # Hide java version if it doesn't come from one of these sources. | ||
1079 | typeset -g POWERLEVEL9K_JENV_SOURCES=(shell local global) | ||
1080 | # If set to false, hide java version if it's the same as global: | ||
1081 | # $(jenv version-name) == $(jenv global). | ||
1082 | typeset -g POWERLEVEL9K_JENV_PROMPT_ALWAYS_SHOW=false | ||
1083 | # If set to false, hide java version if it's equal to "system". | ||
1084 | typeset -g POWERLEVEL9K_JENV_SHOW_SYSTEM=true | ||
1085 | # Custom icon. | ||
1086 | # typeset -g POWERLEVEL9K_JENV_VISUAL_IDENTIFIER_EXPANSION='⭐' | ||
1087 | |||
1088 | ###########[ plenv: perl version from plenv (https://github.com/tokuhirom/plenv) ]############ | ||
1089 | # Perl color. | ||
1090 | typeset -g POWERLEVEL9K_PLENV_FOREGROUND=67 | ||
1091 | # Hide perl version if it doesn't come from one of these sources. | ||
1092 | typeset -g POWERLEVEL9K_PLENV_SOURCES=(shell local global) | ||
1093 | # If set to false, hide perl version if it's the same as global: | ||
1094 | # $(plenv version-name) == $(plenv global). | ||
1095 | typeset -g POWERLEVEL9K_PLENV_PROMPT_ALWAYS_SHOW=false | ||
1096 | # If set to false, hide perl version if it's equal to "system". | ||
1097 | typeset -g POWERLEVEL9K_PLENV_SHOW_SYSTEM=true | ||
1098 | # Custom icon. | ||
1099 | # typeset -g POWERLEVEL9K_PLENV_VISUAL_IDENTIFIER_EXPANSION='⭐' | ||
1100 | |||
1101 | ############[ phpenv: php version from phpenv (https://github.com/phpenv/phpenv) ]############ | ||
1102 | # PHP color. | ||
1103 | typeset -g POWERLEVEL9K_PHPENV_FOREGROUND=99 | ||
1104 | # Hide php version if it doesn't come from one of these sources. | ||
1105 | typeset -g POWERLEVEL9K_PHPENV_SOURCES=(shell local global) | ||
1106 | # If set to false, hide php version if it's the same as global: | ||
1107 | # $(phpenv version-name) == $(phpenv global). | ||
1108 | typeset -g POWERLEVEL9K_PHPENV_PROMPT_ALWAYS_SHOW=false | ||
1109 | # If set to false, hide php version if it's equal to "system". | ||
1110 | typeset -g POWERLEVEL9K_PHPENV_SHOW_SYSTEM=true | ||
1111 | # Custom icon. | ||
1112 | # typeset -g POWERLEVEL9K_PHPENV_VISUAL_IDENTIFIER_EXPANSION='⭐' | ||
1113 | |||
1114 | #######[ scalaenv: scala version from scalaenv (https://github.com/scalaenv/scalaenv) ]####### | ||
1115 | # Scala color. | ||
1116 | typeset -g POWERLEVEL9K_SCALAENV_FOREGROUND=160 | ||
1117 | # Hide scala version if it doesn't come from one of these sources. | ||
1118 | typeset -g POWERLEVEL9K_SCALAENV_SOURCES=(shell local global) | ||
1119 | # If set to false, hide scala version if it's the same as global: | ||
1120 | # $(scalaenv version-name) == $(scalaenv global). | ||
1121 | typeset -g POWERLEVEL9K_SCALAENV_PROMPT_ALWAYS_SHOW=false | ||
1122 | # If set to false, hide scala version if it's equal to "system". | ||
1123 | typeset -g POWERLEVEL9K_SCALAENV_SHOW_SYSTEM=true | ||
1124 | # Custom icon. | ||
1125 | # typeset -g POWERLEVEL9K_SCALAENV_VISUAL_IDENTIFIER_EXPANSION='⭐' | ||
1126 | |||
1127 | ##########[ haskell_stack: haskell version from stack (https://haskellstack.org/) ]########### | ||
1128 | # Haskell color. | ||
1129 | typeset -g POWERLEVEL9K_HASKELL_STACK_FOREGROUND=172 | ||
1130 | # Hide haskell version if it doesn't come from one of these sources. | ||
1131 | # | ||
1132 | # shell: version is set by STACK_YAML | ||
1133 | # local: version is set by stack.yaml up the directory tree | ||
1134 | # global: version is set by the implicit global project (~/.stack/global-project/stack.yaml) | ||
1135 | typeset -g POWERLEVEL9K_HASKELL_STACK_SOURCES=(shell local) | ||
1136 | # If set to false, hide haskell version if it's the same as in the implicit global project. | ||
1137 | typeset -g POWERLEVEL9K_HASKELL_STACK_ALWAYS_SHOW=true | ||
1138 | # Custom icon. | ||
1139 | # typeset -g POWERLEVEL9K_HASKELL_STACK_VISUAL_IDENTIFIER_EXPANSION='⭐' | ||
1140 | |||
1141 | #############[ kubecontext: current kubernetes context (https://kubernetes.io/) ]############# | ||
1142 | # Show kubecontext only when the the command you are typing invokes one of these tools. | ||
1143 | # Tip: Remove the next line to always show kubecontext. | ||
1144 | typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito|k9s|helmfile' | ||
1145 | |||
1146 | # Kubernetes context classes for the purpose of using different colors, icons and expansions with | ||
1147 | # different contexts. | ||
1148 | # | ||
1149 | # POWERLEVEL9K_KUBECONTEXT_CLASSES is an array with even number of elements. The first element | ||
1150 | # in each pair defines a pattern against which the current kubernetes context gets matched. | ||
1151 | # More specifically, it's P9K_CONTENT prior to the application of context expansion (see below) | ||
1152 | # that gets matched. If you unset all POWERLEVEL9K_KUBECONTEXT_*CONTENT_EXPANSION parameters, | ||
1153 | # you'll see this value in your prompt. The second element of each pair in | ||
1154 | # POWERLEVEL9K_KUBECONTEXT_CLASSES defines the context class. Patterns are tried in order. The | ||
1155 | # first match wins. | ||
1156 | # | ||
1157 | # For example, given these settings: | ||
1158 | # | ||
1159 | # typeset -g POWERLEVEL9K_KUBECONTEXT_CLASSES=( | ||
1160 | # '*prod*' PROD | ||
1161 | # '*test*' TEST | ||
1162 | # '*' DEFAULT) | ||
1163 | # | ||
1164 | # If your current kubernetes context is "deathray-testing/default", its class is TEST | ||
1165 | # because "deathray-testing/default" doesn't match the pattern '*prod*' but does match '*test*'. | ||
1166 | # | ||
1167 | # You can define different colors, icons and content expansions for different classes: | ||
1168 | # | ||
1169 | # typeset -g POWERLEVEL9K_KUBECONTEXT_TEST_FOREGROUND=28 | ||
1170 | # typeset -g POWERLEVEL9K_KUBECONTEXT_TEST_VISUAL_IDENTIFIER_EXPANSION='⭐' | ||
1171 | # typeset -g POWERLEVEL9K_KUBECONTEXT_TEST_CONTENT_EXPANSION='> ${P9K_CONTENT} <' | ||
1172 | typeset -g POWERLEVEL9K_KUBECONTEXT_CLASSES=( | ||
1173 | # '*prod*' PROD # These values are examples that are unlikely | ||
1174 | # '*test*' TEST # to match your needs. Customize them as needed. | ||
1175 | '*' DEFAULT) | ||
1176 | typeset -g POWERLEVEL9K_KUBECONTEXT_DEFAULT_FOREGROUND=134 | ||
1177 | # typeset -g POWERLEVEL9K_KUBECONTEXT_DEFAULT_VISUAL_IDENTIFIER_EXPANSION='⭐' | ||
1178 | |||
1179 | # Use POWERLEVEL9K_KUBECONTEXT_CONTENT_EXPANSION to specify the content displayed by kubecontext | ||
1180 | # segment. Parameter expansions are very flexible and fast, too. See reference: | ||
1181 | # http://zsh.sourceforge.net/Doc/Release/Expansion.html#Parameter-Expansion. | ||
1182 | # | ||
1183 | # Within the expansion the following parameters are always available: | ||
1184 | # | ||
1185 | # - P9K_CONTENT The content that would've been displayed if there was no content | ||
1186 | # expansion defined. | ||
1187 | # - P9K_KUBECONTEXT_NAME The current context's name. Corresponds to column NAME in the | ||
1188 | # output of `kubectl config get-contexts`. | ||
1189 | # - P9K_KUBECONTEXT_CLUSTER The current context's cluster. Corresponds to column CLUSTER in the | ||
1190 | # output of `kubectl config get-contexts`. | ||
1191 | # - P9K_KUBECONTEXT_NAMESPACE The current context's namespace. Corresponds to column NAMESPACE | ||
1192 | # in the output of `kubectl config get-contexts`. If there is no | ||
1193 | # namespace, the parameter is set to "default". | ||
1194 | # - P9K_KUBECONTEXT_USER The current context's user. Corresponds to column AUTHINFO in the | ||
1195 | # output of `kubectl config get-contexts`. | ||
1196 | # | ||
1197 | # If the context points to Google Kubernetes Engine (GKE) or Elastic Kubernetes Service (EKS), | ||
1198 | # the following extra parameters are available: | ||
1199 | # | ||
1200 | # - P9K_KUBECONTEXT_CLOUD_NAME Either "gke" or "eks". | ||
1201 | # - P9K_KUBECONTEXT_CLOUD_ACCOUNT Account/project ID. | ||
1202 | # - P9K_KUBECONTEXT_CLOUD_ZONE Availability zone. | ||
1203 | # - P9K_KUBECONTEXT_CLOUD_CLUSTER Cluster. | ||
1204 | # | ||
1205 | # P9K_KUBECONTEXT_CLOUD_* parameters are derived from P9K_KUBECONTEXT_CLUSTER. For example, | ||
1206 | # if P9K_KUBECONTEXT_CLUSTER is "gke_my-account_us-east1-a_my-cluster-01": | ||
1207 | # | ||
1208 | # - P9K_KUBECONTEXT_CLOUD_NAME=gke | ||
1209 | # - P9K_KUBECONTEXT_CLOUD_ACCOUNT=my-account | ||
1210 | # - P9K_KUBECONTEXT_CLOUD_ZONE=us-east1-a | ||
1211 | # - P9K_KUBECONTEXT_CLOUD_CLUSTER=my-cluster-01 | ||
1212 | # | ||
1213 | # If P9K_KUBECONTEXT_CLUSTER is "arn:aws:eks:us-east-1:123456789012:cluster/my-cluster-01": | ||
1214 | # | ||
1215 | # - P9K_KUBECONTEXT_CLOUD_NAME=eks | ||
1216 | # - P9K_KUBECONTEXT_CLOUD_ACCOUNT=123456789012 | ||
1217 | # - P9K_KUBECONTEXT_CLOUD_ZONE=us-east-1 | ||
1218 | # - P9K_KUBECONTEXT_CLOUD_CLUSTER=my-cluster-01 | ||
1219 | typeset -g POWERLEVEL9K_KUBECONTEXT_DEFAULT_CONTENT_EXPANSION= | ||
1220 | # Show P9K_KUBECONTEXT_CLOUD_CLUSTER if it's not empty and fall back to P9K_KUBECONTEXT_NAME. | ||
1221 | POWERLEVEL9K_KUBECONTEXT_DEFAULT_CONTENT_EXPANSION+='${P9K_KUBECONTEXT_CLOUD_CLUSTER:-${P9K_KUBECONTEXT_NAME}}' | ||
1222 | # Append the current context's namespace if it's not "default". | ||
1223 | POWERLEVEL9K_KUBECONTEXT_DEFAULT_CONTENT_EXPANSION+='${${:-/$P9K_KUBECONTEXT_NAMESPACE}:#/default}' | ||
1224 | |||
1225 | # Custom prefix. | ||
1226 | # typeset -g POWERLEVEL9K_KUBECONTEXT_PREFIX='%fat ' | ||
1227 | |||
1228 | ################[ terraform: terraform workspace (https://www.terraform.io) ]################# | ||
1229 | # Don't show terraform workspace if it's literally "default". | ||
1230 | typeset -g POWERLEVEL9K_TERRAFORM_SHOW_DEFAULT=false | ||
1231 | # POWERLEVEL9K_TERRAFORM_CLASSES is an array with even number of elements. The first element | ||
1232 | # in each pair defines a pattern against which the current terraform workspace gets matched. | ||
1233 | # More specifically, it's P9K_CONTENT prior to the application of context expansion (see below) | ||
1234 | # that gets matched. If you unset all POWERLEVEL9K_TERRAFORM_*CONTENT_EXPANSION parameters, | ||
1235 | # you'll see this value in your prompt. The second element of each pair in | ||
1236 | # POWERLEVEL9K_TERRAFORM_CLASSES defines the workspace class. Patterns are tried in order. The | ||
1237 | # first match wins. | ||
1238 | # | ||
1239 | # For example, given these settings: | ||
1240 | # | ||
1241 | # typeset -g POWERLEVEL9K_TERRAFORM_CLASSES=( | ||
1242 | # '*prod*' PROD | ||
1243 | # '*test*' TEST | ||
1244 | # '*' OTHER) | ||
1245 | # | ||
1246 | # If your current terraform workspace is "project_test", its class is TEST because "project_test" | ||
1247 | # doesn't match the pattern '*prod*' but does match '*test*'. | ||
1248 | # | ||
1249 | # You can define different colors, icons and content expansions for different classes: | ||
1250 | # | ||
1251 | # typeset -g POWERLEVEL9K_TERRAFORM_TEST_FOREGROUND=28 | ||
1252 | # typeset -g POWERLEVEL9K_TERRAFORM_TEST_VISUAL_IDENTIFIER_EXPANSION='⭐' | ||
1253 | # typeset -g POWERLEVEL9K_TERRAFORM_TEST_CONTENT_EXPANSION='> ${P9K_CONTENT} <' | ||
1254 | typeset -g POWERLEVEL9K_TERRAFORM_CLASSES=( | ||
1255 | # '*prod*' PROD # These values are examples that are unlikely | ||
1256 | # '*test*' TEST # to match your needs. Customize them as needed. | ||
1257 | '*' OTHER) | ||
1258 | typeset -g POWERLEVEL9K_TERRAFORM_OTHER_FOREGROUND=38 | ||
1259 | # typeset -g POWERLEVEL9K_TERRAFORM_OTHER_VISUAL_IDENTIFIER_EXPANSION='⭐' | ||
1260 | |||
1261 | #[ aws: aws profile (https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html) ]# | ||
1262 | # Show aws only when the the command you are typing invokes one of these tools. | ||
1263 | # Tip: Remove the next line to always show aws. | ||
1264 | typeset -g POWERLEVEL9K_AWS_SHOW_ON_COMMAND='aws|awless|terraform|pulumi|terragrunt' | ||
1265 | |||
1266 | # POWERLEVEL9K_AWS_CLASSES is an array with even number of elements. The first element | ||
1267 | # in each pair defines a pattern against which the current AWS profile gets matched. | ||
1268 | # More specifically, it's P9K_CONTENT prior to the application of context expansion (see below) | ||
1269 | # that gets matched. If you unset all POWERLEVEL9K_AWS_*CONTENT_EXPANSION parameters, | ||
1270 | # you'll see this value in your prompt. The second element of each pair in | ||
1271 | # POWERLEVEL9K_AWS_CLASSES defines the profile class. Patterns are tried in order. The | ||
1272 | # first match wins. | ||
1273 | # | ||
1274 | # For example, given these settings: | ||
1275 | # | ||
1276 | # typeset -g POWERLEVEL9K_AWS_CLASSES=( | ||
1277 | # '*prod*' PROD | ||
1278 | # '*test*' TEST | ||
1279 | # '*' DEFAULT) | ||
1280 | # | ||
1281 | # If your current AWS profile is "company_test", its class is TEST | ||
1282 | # because "company_test" doesn't match the pattern '*prod*' but does match '*test*'. | ||
1283 | # | ||
1284 | # You can define different colors, icons and content expansions for different classes: | ||
1285 | # | ||
1286 | # typeset -g POWERLEVEL9K_AWS_TEST_FOREGROUND=28 | ||
1287 | # typeset -g POWERLEVEL9K_AWS_TEST_VISUAL_IDENTIFIER_EXPANSION='⭐' | ||
1288 | # typeset -g POWERLEVEL9K_AWS_TEST_CONTENT_EXPANSION='> ${P9K_CONTENT} <' | ||
1289 | typeset -g POWERLEVEL9K_AWS_CLASSES=( | ||
1290 | # '*prod*' PROD # These values are examples that are unlikely | ||
1291 | # '*test*' TEST # to match your needs. Customize them as needed. | ||
1292 | '*' DEFAULT) | ||
1293 | typeset -g POWERLEVEL9K_AWS_DEFAULT_FOREGROUND=208 | ||
1294 | # typeset -g POWERLEVEL9K_AWS_DEFAULT_VISUAL_IDENTIFIER_EXPANSION='⭐' | ||
1295 | |||
1296 | #[ aws_eb_env: aws elastic beanstalk environment (https://aws.amazon.com/elasticbeanstalk/) ]# | ||
1297 | # AWS Elastic Beanstalk environment color. | ||
1298 | typeset -g POWERLEVEL9K_AWS_EB_ENV_FOREGROUND=70 | ||
1299 | # Custom icon. | ||
1300 | # typeset -g POWERLEVEL9K_AWS_EB_ENV_VISUAL_IDENTIFIER_EXPANSION='⭐' | ||
1301 | |||
1302 | ##########[ azure: azure account name (https://docs.microsoft.com/en-us/cli/azure) ]########## | ||
1303 | # Show azure only when the the command you are typing invokes one of these tools. | ||
1304 | # Tip: Remove the next line to always show azure. | ||
1305 | typeset -g POWERLEVEL9K_AZURE_SHOW_ON_COMMAND='az|terraform|pulumi|terragrunt' | ||
1306 | # Azure account name color. | ||
1307 | typeset -g POWERLEVEL9K_AZURE_FOREGROUND=32 | ||
1308 | # Custom icon. | ||
1309 | # typeset -g POWERLEVEL9K_AZURE_VISUAL_IDENTIFIER_EXPANSION='⭐' | ||
1310 | |||
1311 | ##########[ gcloud: google cloud account and project (https://cloud.google.com/) ]########### | ||
1312 | # Show gcloud only when the the command you are typing invokes one of these tools. | ||
1313 | # Tip: Remove the next line to always show gcloud. | ||
1314 | typeset -g POWERLEVEL9K_GCLOUD_SHOW_ON_COMMAND='gcloud|gcs' | ||
1315 | # Google cloud color. | ||
1316 | typeset -g POWERLEVEL9K_GCLOUD_FOREGROUND=32 | ||
1317 | |||
1318 | # Google cloud format. Change the value of POWERLEVEL9K_GCLOUD_PARTIAL_CONTENT_EXPANSION and/or | ||
1319 | # POWERLEVEL9K_GCLOUD_COMPLETE_CONTENT_EXPANSION if the default is too verbose or not informative | ||
1320 | # enough. You can use the following parameters in the expansions. Each of them corresponds to the | ||
1321 | # output of `gcloud` tool. | ||
1322 | # | ||
1323 | # Parameter | Source | ||
1324 | # -------------------------|-------------------------------------------------------------------- | ||
1325 | # P9K_GCLOUD_CONFIGURATION | gcloud config configurations list --format='value(name)' | ||
1326 | # P9K_GCLOUD_ACCOUNT | gcloud config get-value account | ||
1327 | # P9K_GCLOUD_PROJECT_ID | gcloud config get-value project | ||
1328 | # P9K_GCLOUD_PROJECT_NAME | gcloud projects describe $P9K_GCLOUD_PROJECT_ID --format='value(name)' | ||
1329 | # | ||
1330 | # Note: ${VARIABLE//\%/%%} expands to ${VARIABLE} with all occurrences of '%' replaced with '%%'. | ||
1331 | # | ||
1332 | # Obtaining project name requires sending a request to Google servers. This can take a long time | ||
1333 | # and even fail. When project name is unknown, P9K_GCLOUD_PROJECT_NAME is not set and gcloud | ||
1334 | # prompt segment is in state PARTIAL. When project name gets known, P9K_GCLOUD_PROJECT_NAME gets | ||
1335 | # set and gcloud prompt segment transitions to state COMPLETE. | ||
1336 | # | ||
1337 | # You can customize the format, icon and colors of gcloud segment separately for states PARTIAL | ||
1338 | # and COMPLETE. You can also hide gcloud in state PARTIAL by setting | ||
1339 | # POWERLEVEL9K_GCLOUD_PARTIAL_VISUAL_IDENTIFIER_EXPANSION and | ||
1340 | # POWERLEVEL9K_GCLOUD_PARTIAL_CONTENT_EXPANSION to empty. | ||
1341 | typeset -g POWERLEVEL9K_GCLOUD_PARTIAL_CONTENT_EXPANSION='${P9K_GCLOUD_PROJECT_ID//\%/%%}' | ||
1342 | typeset -g POWERLEVEL9K_GCLOUD_COMPLETE_CONTENT_EXPANSION='${P9K_GCLOUD_PROJECT_NAME//\%/%%}' | ||
1343 | |||
1344 | # Send a request to Google (by means of `gcloud projects describe ...`) to obtain project name | ||
1345 | # this often. Negative value disables periodic polling. In this mode project name is retrieved | ||
1346 | # only when the current configuration, account or project id changes. | ||
1347 | typeset -g POWERLEVEL9K_GCLOUD_REFRESH_PROJECT_NAME_SECONDS=60 | ||
1348 | |||
1349 | # Custom icon. | ||
1350 | # typeset -g POWERLEVEL9K_GCLOUD_VISUAL_IDENTIFIER_EXPANSION='⭐' | ||
1351 | |||
1352 | #[ google_app_cred: google application credentials (https://cloud.google.com/docs/authentication/production) ]# | ||
1353 | # Show google_app_cred only when the the command you are typing invokes one of these tools. | ||
1354 | # Tip: Remove the next line to always show google_app_cred. | ||
1355 | typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_SHOW_ON_COMMAND='terraform|pulumi|terragrunt' | ||
1356 | |||
1357 | # Google application credentials classes for the purpose of using different colors, icons and | ||
1358 | # expansions with different credentials. | ||
1359 | # | ||
1360 | # POWERLEVEL9K_GOOGLE_APP_CRED_CLASSES is an array with even number of elements. The first | ||
1361 | # element in each pair defines a pattern against which the current kubernetes context gets | ||
1362 | # matched. More specifically, it's P9K_CONTENT prior to the application of context expansion | ||
1363 | # (see below) that gets matched. If you unset all POWERLEVEL9K_GOOGLE_APP_CRED_*CONTENT_EXPANSION | ||
1364 | # parameters, you'll see this value in your prompt. The second element of each pair in | ||
1365 | # POWERLEVEL9K_GOOGLE_APP_CRED_CLASSES defines the context class. Patterns are tried in order. | ||
1366 | # The first match wins. | ||
1367 | # | ||
1368 | # For example, given these settings: | ||
1369 | # | ||
1370 | # typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_CLASSES=( | ||
1371 | # '*:*prod*:*' PROD | ||
1372 | # '*:*test*:*' TEST | ||
1373 | # '*' DEFAULT) | ||
1374 | # | ||
1375 | # If your current Google application credentials is "service_account deathray-testing x@y.com", | ||
1376 | # its class is TEST because it doesn't match the pattern '* *prod* *' but does match '* *test* *'. | ||
1377 | # | ||
1378 | # You can define different colors, icons and content expansions for different classes: | ||
1379 | # | ||
1380 | # typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_TEST_FOREGROUND=28 | ||
1381 | # typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_TEST_VISUAL_IDENTIFIER_EXPANSION='⭐' | ||
1382 | # typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_TEST_CONTENT_EXPANSION='$P9K_GOOGLE_APP_CRED_PROJECT_ID' | ||
1383 | typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_CLASSES=( | ||
1384 | # '*:*prod*:*' PROD # These values are examples that are unlikely | ||
1385 | # '*:*test*:*' TEST # to match your needs. Customize them as needed. | ||
1386 | '*' DEFAULT) | ||
1387 | typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_DEFAULT_FOREGROUND=32 | ||
1388 | # typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_DEFAULT_VISUAL_IDENTIFIER_EXPANSION='⭐' | ||
1389 | |||
1390 | # Use POWERLEVEL9K_GOOGLE_APP_CRED_CONTENT_EXPANSION to specify the content displayed by | ||
1391 | # google_app_cred segment. Parameter expansions are very flexible and fast, too. See reference: | ||
1392 | # http://zsh.sourceforge.net/Doc/Release/Expansion.html#Parameter-Expansion. | ||
1393 | # | ||
1394 | # You can use the following parameters in the expansion. Each of them corresponds to one of the | ||
1395 | # fields in the JSON file pointed to by GOOGLE_APPLICATION_CREDENTIALS. | ||
1396 | # | ||
1397 | # Parameter | JSON key file field | ||
1398 | # ---------------------------------+--------------- | ||
1399 | # P9K_GOOGLE_APP_CRED_TYPE | type | ||
1400 | # P9K_GOOGLE_APP_CRED_PROJECT_ID | project_id | ||
1401 | # P9K_GOOGLE_APP_CRED_CLIENT_EMAIL | client_email | ||
1402 | # | ||
1403 | # Note: ${VARIABLE//\%/%%} expands to ${VARIABLE} with all occurrences of '%' replaced by '%%'. | ||
1404 | typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_DEFAULT_CONTENT_EXPANSION='${P9K_GOOGLE_APP_CRED_PROJECT_ID//\%/%%}' | ||
1405 | |||
1406 | ###############################[ public_ip: public IP address ]############################### | ||
1407 | # Public IP color. | ||
1408 | typeset -g POWERLEVEL9K_PUBLIC_IP_FOREGROUND=94 | ||
1409 | # Custom icon. | ||
1410 | # typeset -g POWERLEVEL9K_PUBLIC_IP_VISUAL_IDENTIFIER_EXPANSION='⭐' | ||
1411 | |||
1412 | ########################[ vpn_ip: virtual private network indicator ]######################### | ||
1413 | # VPN IP color. | ||
1414 | typeset -g POWERLEVEL9K_VPN_IP_FOREGROUND=81 | ||
1415 | # When on VPN, show just an icon without the IP address. | ||
1416 | # Tip: To display the private IP address when on VPN, remove the next line. | ||
1417 | typeset -g POWERLEVEL9K_VPN_IP_CONTENT_EXPANSION= | ||
1418 | # Regular expression for the VPN network interface. Run `ifconfig` or `ip -4 a show` while on VPN | ||
1419 | # to see the name of the interface. | ||
1420 | typeset -g POWERLEVEL9K_VPN_IP_INTERFACE='(gpd|wg|(.*tun))[0-9]*' | ||
1421 | # If set to true, show one segment per matching network interface. If set to false, show only | ||
1422 | # one segment corresponding to the first matching network interface. | ||
1423 | # Tip: If you set it to true, you'll probably want to unset POWERLEVEL9K_VPN_IP_CONTENT_EXPANSION. | ||
1424 | typeset -g POWERLEVEL9K_VPN_IP_SHOW_ALL=false | ||
1425 | # Custom icon. | ||
1426 | # typeset -g POWERLEVEL9K_VPN_IP_VISUAL_IDENTIFIER_EXPANSION='⭐' | ||
1427 | |||
1428 | ###########[ ip: ip address and bandwidth usage for a specified network interface ]########### | ||
1429 | # IP color. | ||
1430 | typeset -g POWERLEVEL9K_IP_FOREGROUND=38 | ||
1431 | # The following parameters are accessible within the expansion: | ||
1432 | # | ||
1433 | # Parameter | Meaning | ||
1434 | # ----------------------+--------------- | ||
1435 | # P9K_IP_IP | IP address | ||
1436 | # P9K_IP_INTERFACE | network interface | ||
1437 | # P9K_IP_RX_BYTES | total number of bytes received | ||
1438 | # P9K_IP_TX_BYTES | total number of bytes sent | ||
1439 | # P9K_IP_RX_RATE | receive rate (since last prompt) | ||
1440 | # P9K_IP_TX_RATE | send rate (since last prompt) | ||
1441 | typeset -g POWERLEVEL9K_IP_CONTENT_EXPANSION='$P9K_IP_IP${P9K_IP_RX_RATE:+ %70F⇣$P9K_IP_RX_RATE}${P9K_IP_TX_RATE:+ %215F⇡$P9K_IP_TX_RATE}' | ||
1442 | # Show information for the first network interface whose name matches this regular expression. | ||
1443 | # Run `ifconfig` or `ip -4 a show` to see the names of all network interfaces. | ||
1444 | typeset -g POWERLEVEL9K_IP_INTERFACE='e.*' | ||
1445 | # Custom icon. | ||
1446 | # typeset -g POWERLEVEL9K_IP_VISUAL_IDENTIFIER_EXPANSION='⭐' | ||
1447 | |||
1448 | #########################[ proxy: system-wide http/https/ftp proxy ]########################## | ||
1449 | # Proxy color. | ||
1450 | typeset -g POWERLEVEL9K_PROXY_FOREGROUND=68 | ||
1451 | # Custom icon. | ||
1452 | # typeset -g POWERLEVEL9K_PROXY_VISUAL_IDENTIFIER_EXPANSION='⭐' | ||
1453 | |||
1454 | ################################[ battery: internal battery ]################################# | ||
1455 | # Show battery in red when it's below this level and not connected to power supply. | ||
1456 | typeset -g POWERLEVEL9K_BATTERY_LOW_THRESHOLD=20 | ||
1457 | typeset -g POWERLEVEL9K_BATTERY_LOW_FOREGROUND=160 | ||
1458 | # Show battery in green when it's charging or fully charged. | ||
1459 | typeset -g POWERLEVEL9K_BATTERY_{CHARGING,CHARGED}_FOREGROUND=70 | ||
1460 | # Show battery in yellow when it's discharging. | ||
1461 | typeset -g POWERLEVEL9K_BATTERY_DISCONNECTED_FOREGROUND=178 | ||
1462 | # Battery pictograms going from low to high level of charge. | ||
1463 | typeset -g POWERLEVEL9K_BATTERY_STAGES='\uf58d\uf579\uf57a\uf57b\uf57c\uf57d\uf57e\uf57f\uf580\uf581\uf578' | ||
1464 | # Don't show the remaining time to charge/discharge. | ||
1465 | typeset -g POWERLEVEL9K_BATTERY_VERBOSE=false | ||
1466 | |||
1467 | #####################################[ wifi: wifi speed ]##################################### | ||
1468 | # WiFi color. | ||
1469 | typeset -g POWERLEVEL9K_WIFI_FOREGROUND=68 | ||
1470 | # Custom icon. | ||
1471 | # typeset -g POWERLEVEL9K_WIFI_VISUAL_IDENTIFIER_EXPANSION='⭐' | ||
1472 | |||
1473 | # Use different colors and icons depending on signal strength ($P9K_WIFI_BARS). | ||
1474 | # | ||
1475 | # # Wifi colors and icons for different signal strength levels (low to high). | ||
1476 | # typeset -g my_wifi_fg=(68 68 68 68 68) # <-- change these values | ||
1477 | # typeset -g my_wifi_icon=('WiFi' 'WiFi' 'WiFi' 'WiFi' 'WiFi') # <-- change these values | ||
1478 | # | ||
1479 | # typeset -g POWERLEVEL9K_WIFI_CONTENT_EXPANSION='%F{${my_wifi_fg[P9K_WIFI_BARS+1]}}$P9K_WIFI_LAST_TX_RATE Mbps' | ||
1480 | # typeset -g POWERLEVEL9K_WIFI_VISUAL_IDENTIFIER_EXPANSION='%F{${my_wifi_fg[P9K_WIFI_BARS+1]}}${my_wifi_icon[P9K_WIFI_BARS+1]}' | ||
1481 | # | ||
1482 | # The following parameters are accessible within the expansions: | ||
1483 | # | ||
1484 | # Parameter | Meaning | ||
1485 | # ----------------------+--------------- | ||
1486 | # P9K_WIFI_SSID | service set identifier, a.k.a. network name | ||
1487 | # P9K_WIFI_LINK_AUTH | authentication protocol such as "wpa2-psk" or "none"; empty if unknown | ||
1488 | # P9K_WIFI_LAST_TX_RATE | wireless transmit rate in megabits per second | ||
1489 | # P9K_WIFI_RSSI | signal strength in dBm, from -120 to 0 | ||
1490 | # P9K_WIFI_NOISE | noise in dBm, from -120 to 0 | ||
1491 | # P9K_WIFI_BARS | signal strength in bars, from 0 to 4 (derived from P9K_WIFI_RSSI and P9K_WIFI_NOISE) | ||
1492 | |||
1493 | ####################################[ time: current time ]#################################### | ||
1494 | # Current time color. | ||
1495 | typeset -g POWERLEVEL9K_TIME_FOREGROUND=66 | ||
1496 | # Format for the current time: 09:51:02. See `man 3 strftime`. | ||
1497 | typeset -g POWERLEVEL9K_TIME_FORMAT='%D{%H:%M}' | ||
1498 | # If set to true, time will update when you hit enter. This way prompts for the past | ||
1499 | # commands will contain the start times of their commands as opposed to the default | ||
1500 | # behavior where they contain the end times of their preceding commands. | ||
1501 | typeset -g POWERLEVEL9K_TIME_UPDATE_ON_COMMAND=false | ||
1502 | # Custom icon. | ||
1503 | typeset -g POWERLEVEL9K_TIME_VISUAL_IDENTIFIER_EXPANSION='' | ||
1504 | # Custom prefix. | ||
1505 | # typeset -g POWERLEVEL9K_TIME_PREFIX='%fat ' | ||
1506 | |||
1507 | # Example of a user-defined prompt segment. Function prompt_example will be called on every | ||
1508 | # prompt if `example` prompt segment is added to POWERLEVEL9K_LEFT_PROMPT_ELEMENTS or | ||
1509 | # POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS. It displays an icon and orange text greeting the user. | ||
1510 | # | ||
1511 | # Type `p10k help segment` for documentation and a more sophisticated example. | ||
1512 | function prompt_example() { | ||
1513 | p10k segment -f 208 -i '⭐' -t 'hello, %n' | ||
1514 | } | ||
1515 | |||
1516 | # User-defined prompt segments may optionally provide an instant_prompt_* function. Its job | ||
1517 | # is to generate the prompt segment for display in instant prompt. See | ||
1518 | # https://github.com/romkatv/powerlevel10k/blob/master/README.md#instant-prompt. | ||
1519 | # | ||
1520 | # Powerlevel10k will call instant_prompt_* at the same time as the regular prompt_* function | ||
1521 | # and will record all `p10k segment` calls it makes. When displaying instant prompt, Powerlevel10k | ||
1522 | # will replay these calls without actually calling instant_prompt_*. It is imperative that | ||
1523 | # instant_prompt_* always makes the same `p10k segment` calls regardless of environment. If this | ||
1524 | # rule is not observed, the content of instant prompt will be incorrect. | ||
1525 | # | ||
1526 | # Usually, you should either not define instant_prompt_* or simply call prompt_* from it. If | ||
1527 | # instant_prompt_* is not defined for a segment, the segment won't be shown in instant prompt. | ||
1528 | function instant_prompt_example() { | ||
1529 | # Since prompt_example always makes the same `p10k segment` calls, we can call it from | ||
1530 | # instant_prompt_example. This will give us the same `example` prompt segment in the instant | ||
1531 | # and regular prompts. | ||
1532 | prompt_example | ||
1533 | } | ||
1534 | |||
1535 | # User-defined prompt segments can be customized the same way as built-in segments. | ||
1536 | # typeset -g POWERLEVEL9K_EXAMPLE_FOREGROUND=208 | ||
1537 | # typeset -g POWERLEVEL9K_EXAMPLE_VISUAL_IDENTIFIER_EXPANSION='⭐' | ||
1538 | |||
1539 | # Transient prompt works similarly to the builtin transient_rprompt option. It trims down prompt | ||
1540 | # when accepting a command line. Supported values: | ||
1541 | # | ||
1542 | # - off: Don't change prompt when accepting a command line. | ||
1543 | # - always: Trim down prompt when accepting a command line. | ||
1544 | # - same-dir: Trim down prompt when accepting a command line unless this is the first command | ||
1545 | # typed after changing current working directory. | ||
1546 | typeset -g POWERLEVEL9K_TRANSIENT_PROMPT=off | ||
1547 | |||
1548 | function p10k-on-pre-prompt() { p10k display '1'=show '2/left/(dir|context)'=hide '2/right/*'=show '2/right/(status|command_execution_time|time|background_jobs)'=hide } | ||
1549 | function p10k-on-post-prompt() { p10k display '2/left/(dir|context|prompt_char)'=show 'empty_line|1'=hide '2/right/*'=hide '2/right/(status|command_execution_time|time|background_jobs)'=show } | ||
1550 | |||
1551 | # Instant prompt mode. | ||
1552 | # | ||
1553 | # - off: Disable instant prompt. Choose this if you've tried instant prompt and found | ||
1554 | # it incompatible with your zsh configuration files. | ||
1555 | # - quiet: Enable instant prompt and don't print warnings when detecting console output | ||
1556 | # during zsh initialization. Choose this if you've read and understood | ||
1557 | # https://github.com/romkatv/powerlevel10k/blob/master/README.md#instant-prompt. | ||
1558 | # - verbose: Enable instant prompt and print a warning when detecting console output during | ||
1559 | # zsh initialization. Choose this if you've never tried instant prompt, haven't | ||
1560 | # seen the warning, or if you are unsure what this all means. | ||
1561 | typeset -g POWERLEVEL9K_INSTANT_PROMPT=quiet | ||
1562 | |||
1563 | # Hot reload allows you to change POWERLEVEL9K options after Powerlevel10k has been initialized. | ||
1564 | # For example, you can type POWERLEVEL9K_BACKGROUND=red and see your prompt turn red. Hot reload | ||
1565 | # can slow down prompt by 1-2 milliseconds, so it's better to keep it turned off unless you | ||
1566 | # really need it. | ||
1567 | typeset -g POWERLEVEL9K_DISABLE_HOT_RELOAD=true | ||
1568 | |||
1569 | # If p10k is already loaded, reload configuration. | ||
1570 | # This works even with POWERLEVEL9K_DISABLE_HOT_RELOAD=true. | ||
1571 | (( ! $+functions[p10k] )) || p10k reload | ||
1572 | } | ||
1573 | |||
1574 | # Tell `p10k configure` which file it should overwrite. | ||
1575 | typeset -g POWERLEVEL9K_CONFIG_FILE=${${(%):-%x}:a} | ||
1576 | |||
1577 | (( ${#p10k_config_opts} )) && setopt ${p10k_config_opts[@]} | ||
1578 | 'builtin' 'unset' 'p10k_config_opts' | ||
diff --git a/user-profiles/zsh/zshrc b/user-profiles/zsh/zshrc new file mode 100644 index 00000000..3660ef27 --- /dev/null +++ b/user-profiles/zsh/zshrc | |||
@@ -0,0 +1,26 @@ | |||
1 | fancy-ctrl-z () { | ||
2 | emulate -LR zsh | ||
3 | if [[ $#BUFFER -eq 0 ]]; then | ||
4 | [[ -n $(jobs -s) ]] && bg | ||
5 | zle redisplay | ||
6 | else | ||
7 | zle push-input | ||
8 | fi | ||
9 | } | ||
10 | zle -N fancy-ctrl-z | ||
11 | bindkey '^Z' fancy-ctrl-z | ||
12 | |||
13 | function fancy-ctrl-d() { | ||
14 | zle || exit 0 | ||
15 | [[ -n $BUFFER ]] && return | ||
16 | typeset -g precmd_functions=(fancy-ctrl-d) | ||
17 | zle accept-line | ||
18 | } | ||
19 | zle -N fancy-ctrl-d | ||
20 | bindkey '^D' fancy-ctrl-d | ||
21 | setopt ignore_eof | ||
22 | |||
23 | # word navigation for urxvt | ||
24 | bindkey -e | ||
25 | bindkey ';5C' emacs-forward-word | ||
26 | bindkey ';5D' emacs-backward-word \ No newline at end of file | ||