(Scripts|Emacs/app)~ported eshell banner to a script

Instead of doing it all in Emacs lisp (which while pretty fun to
write, is not fun to execute outside of Emacs), I wrote a shell script
which generates the same banners, then just linked
+eshell/banner-message to it.
This commit is contained in:
2024-05-08 01:17:29 +05:30
parent 907068b34d
commit 2450e47882
2 changed files with 6 additions and 5 deletions

View File

@@ -512,11 +512,7 @@ changes that haven't been committed).
'("𝜆> " :foreground "DeepSkyBlue")))))
(defun +eshell/banner-message ()
(concat (shell-command-to-string
(let ((possible-cows '("default" "cower" "moofasa" "moose"
"mutilated" "satanic" "sheep"
"small" "tux" "vader")))
(format "fortune | cowsay -f %s" (nth (random (length possible-cows)) possible-cows))))
(concat (shell-command-to-string "~/.local/scripts/cowfortune")
"\n"))
(setq eshell-cmpl-ignore-case t

View File

@@ -0,0 +1,5 @@
#!/usr/bin/env sh
cow=$(echo -e "default\ncower\nmoofasa\nmoose\nmutilated\nsatanic\nsheep\nsmall\ntux\nvader" | shuf | head -1)
fortune | cowsay -f $cow