summaryrefslogtreecommitdiff
path: root/powerlevel9k.zsh-theme
diff options
context:
space:
mode:
authorChristian Rebischke <Chris.Rebischke@posteo.de>2016-12-11 07:16:02 +0300
committerChristian Rebischke <Chris.Rebischke@posteo.de>2016-12-17 20:51:03 +0300
commit881ce33263c596d8cbe4d9099345d48de997c408 (patch)
treef6c6b50b3c94db758c7f7c67209b0dbe5158d274 /powerlevel9k.zsh-theme
parent1ff9da64d974265ce2f22bd1da4a47d0b8f7ca90 (diff)
added virtualization detection with systemd
Diffstat (limited to 'powerlevel9k.zsh-theme')
-rwxr-xr-xpowerlevel9k.zsh-theme20
1 files changed, 20 insertions, 0 deletions
diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme
index c06d1286..49e066a5 100755
--- a/powerlevel9k.zsh-theme
+++ b/powerlevel9k.zsh-theme
@@ -538,6 +538,26 @@ prompt_history() {
"$1_prompt_segment" "$0" "$2" "244" "$DEFAULT_COLOR" '%h'
}
+# Detection for virtualization (systemd based systems only)
+prompt_detect_virt() {
+ if ! command -v systemd-detect-virt;then
+ return
+ fi
+ local virt=$(systemd-detect-virt)
+ local color="yellow"
+ if [[ "$virt" == "none" ]]; then
+ if [[ "$(ls -di / | grep -o 2)" != "2" ]]; then
+ virt="chroot"
+ "$1_prompt_segment" "$0" "$2" "$color" "$virt" ""
+ else
+ ;
+ fi
+ else
+ "$1_prompt_segment" "$0" "$2" "$color" "$virt" ""
+ fi
+}
+
+
prompt_icons_test() {
for key in ${(@k)icons}; do
# The lower color spectrum in ZSH makes big steps. Choosing