From 78aa88aa778e7ce212a06918285a8aae0e0dae0d Mon Sep 17 00:00:00 2001 From: rene Date: Sun, 15 Mar 2026 10:51:09 +0100 Subject: [PATCH] zshrc: cowsay Cowfile-Fix und Powerlevel10k Instant Prompt quiet --- zsh/.zshrc | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/zsh/.zshrc b/zsh/.zshrc index 882f721..12e9b95 100644 --- a/zsh/.zshrc +++ b/zsh/.zshrc @@ -85,17 +85,18 @@ TRAPALRM() { } # 11) Begruessung: zufaellig Systemstatus, Spruch oder Witz +# (in exec-Block damit Powerlevel10k Instant Prompt nicht meckert) if [[ -o interactive ]] && command -v cowsay &>/dev/null; then + typeset -g POWERLEVEL9K_INSTANT_PROMPT=quiet _greet() { - local cow_files=(cow default tux sheep elephant) - local cow="-f ${cow_files[$((RANDOM % ${#cow_files[@]} + 1))]}" + local cow_files=(default tux sheep elephant dragon gnu koala) + local cow="${cow_files[$((RANDOM % ${#cow_files[@]} + 1))]}" case $((RANDOM % 3)) in 0) # Systemstatus - local up host load + local host load host=$(hostname -s) - up=$(uptime | sed 's/.*up *\([^,]*\),.*/\1/') load=$(uptime | sed 's/.*average[s]*: *\([^ ]*\).*/\1/') - echo "$host | up $up | load $load" | cowsay $cow + echo "$host | load $load" | cowsay -f "$cow" ;; 1) # Datum-Spruch local day=$(date +%u) msg @@ -108,13 +109,13 @@ if [[ -o interactive ]] && command -v cowsay &>/dev/null; then 6) msg="Samstag - Zeit fuer Projekte!" ;; 7) msg="Sonntag - entspann dich mal." ;; esac - echo "$msg ($(date '+%d.%m.%Y, %H:%M'))" | cowsay $cow + echo "$msg ($(date '+%d.%m.%Y, %H:%M'))" | cowsay -f "$cow" ;; 2) # Witz/Spruch via fortune if command -v fortune &>/dev/null; then - fortune -s 2>/dev/null | cowsay $cow + fortune -s 2>/dev/null | cowsay -f "$cow" else - echo "Keine Witze installiert. Sad." | cowsay $cow + echo "Keine Witze installiert. Sad." | cowsay -f "$cow" fi ;; esac