mirror of
https://github.com/dcarrillo/dotfiles.git
synced 2024-12-22 18:38:00 +00:00
[p10k] Add hcloud prompt
This commit is contained in:
parent
2df2a9ec0e
commit
3e5f0cfd1c
14
.p10k.zsh
14
.p10k.zsh
@ -101,6 +101,7 @@
|
|||||||
# battery # internal battery
|
# battery # internal battery
|
||||||
# wifi # wifi speed
|
# wifi # wifi speed
|
||||||
# example # example user-defined segment (see prompt_example function below)
|
# example # example user-defined segment (see prompt_example function below)
|
||||||
|
hcloud
|
||||||
)
|
)
|
||||||
|
|
||||||
# Defines character set used by powerlevel10k. It's best to let `p10k configure` set it for you.
|
# Defines character set used by powerlevel10k. It's best to let `p10k configure` set it for you.
|
||||||
@ -1526,6 +1527,19 @@
|
|||||||
# Custom prefix.
|
# Custom prefix.
|
||||||
# typeset -g POWERLEVEL9K_TIME_PREFIX='%fat '
|
# typeset -g POWERLEVEL9K_TIME_PREFIX='%fat '
|
||||||
|
|
||||||
|
typeset -g POWERLEVEL9K_HCLOUD_SHOW_ON_COMMAND='hcloud'
|
||||||
|
typeset -g POWERLEVEL9K_HCLOUD_FOREGROUND=214
|
||||||
|
function prompt_hcloud() {
|
||||||
|
hcloud_file="$HOME/.config/hcloud/cli.toml"
|
||||||
|
if [ -f $hcloud_file ] ; then
|
||||||
|
context=$(fgrep active_context $hcloud_file | cut -f 2 -d "=" | tr -d " \"")
|
||||||
|
p10k segment -f 208 -i '' -t "$context"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
function instant_prompt_hcloud() {
|
||||||
|
prompt_hcloud
|
||||||
|
}
|
||||||
|
|
||||||
# Example of a user-defined prompt segment. Function prompt_example will be called on every
|
# Example of a user-defined prompt segment. Function prompt_example will be called on every
|
||||||
# prompt if `example` prompt segment is added to POWERLEVEL9K_LEFT_PROMPT_ELEMENTS or
|
# prompt if `example` prompt segment is added to POWERLEVEL9K_LEFT_PROMPT_ELEMENTS or
|
||||||
# POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS. It displays an icon and orange text greeting the user.
|
# POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS. It displays an icon and orange text greeting the user.
|
||||||
|
Loading…
Reference in New Issue
Block a user