better laptop prompt!

This commit is contained in:
Ava Apples Affine 2023-04-19 21:05:03 -07:00
parent 5afc2cc4a1
commit 61076597d2
Signed by: affine
GPG key ID: 3A4645B8CF806069

View file

@ -57,10 +57,26 @@
()
(display-batteries))
(def _fancy-cwd 'prints (up to) last three segments of current path'
()
(let ((cdir (load-to-string pwd))
(dir-segs (split cdir '/'))
(dir-iter (dq dir-segs))
(i 0))
(if (lte? (len dir-segs) 4)
cdir
(let ((final ""))
(while (lt? i 3)
(set (q final) (concat "/" (car dir-iter) final))
(set (q dir-iter) (dq (cdr dir-iter)))
(inc i))
(concat "..." final)))))
(def CFG_RELISH_L_PROMPT 'display user and dir (git info in future)'
()
(concat
"[" USER "] "
(load-to-string basename (load-to-string pwd)) " "
(_fancy-cwd) " "
;; add more prompt elements here
"\n" ;; newline before delimiter
))