(zsh) show if colima is running in the prompt

This commit is contained in:
Bartek Stalewski 2025-09-15 16:34:49 +02:00
parent 593d890ba4
commit 04feeec6da
Signed by: ftpd
SSH key fingerprint: SHA256:vGQiaNJcfUMLt3wF58+Zx15C6SpRDA9spUeggjVY8Yo
3 changed files with 11 additions and 3 deletions

View file

@ -1,6 +1,6 @@
---
config: config:
MD004: false MD004: false
MD013: false MD013: false
MD022: false
MD032: false MD032: false
MD034: false MD034: false

View file

@ -3,4 +3,4 @@ source "${ZDOTDIR}/common.zsh"
# local settings # local settings
if [[ -f "${HOME}/.local/config/zsh" ]]; then if [[ -f "${HOME}/.local/config/zsh" ]]; then
source "${HOME}/.local/config/zsh" source "${HOME}/.local/config/zsh"
fi fi

View file

@ -13,7 +13,14 @@
function prompt_container() { function prompt_container() {
container_status=$(ps auxw | grep container-apiserver | grep -v grep) container_status=$(ps auxw | grep container-apiserver | grep -v grep)
if [[ -n ${container_status} ]]; then if [[ -n ${container_status} ]]; then
p10k segment -f 2 -i '' -t 'CONTAINER' p10k segment -f 2 -i '' -t 'CONTAINER'
fi
}
function prompt_colima() {
colima_status=$(ps auxw | grep "colima daemon" | grep -v grep)
if [[ -n ${colima_status} ]]; then
p10k segment -f 1 -i '' -t 'colima'
fi fi
} }
@ -28,6 +35,7 @@
typeset -g POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=( typeset -g POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(
command_execution_time command_execution_time
vi_mode vi_mode
colima
container container
) )