zshrc: cowsay Cowfile-Fix und Powerlevel10k Instant Prompt quiet
This commit is contained in:
parent
3ad4382c50
commit
78aa88aa77
1 changed files with 9 additions and 8 deletions
17
zsh/.zshrc
17
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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue