|
@@ -21,6 +21,15 @@
|
|
;; Battery
|
|
;; Battery
|
|
(defvar *display-battery* NIL)
|
|
(defvar *display-battery* NIL)
|
|
|
|
|
|
|
|
+;; Git
|
|
|
|
+(defvar *display-git* NIL)
|
|
|
|
+(defvar *git-string* NIL)
|
|
|
|
+
|
|
|
|
+(defun display-git-info ()
|
|
|
|
+ (if (probe-file (pathname (concatenate 'string (uiop:getenv "PWD") "/.git")))
|
|
|
|
+ ;; (legit:git-rev-parse "HEAD" :short T)))
|
|
|
|
+ (concatenate 'string (legit:current-branch ".") "|" (legit:current-commit "." :short T))))
|
|
|
|
+
|
|
(defun reload-config ()
|
|
(defun reload-config ()
|
|
(setf *config* (config-parse "~/Repos/cl-pest/config.toml"))
|
|
(setf *config* (config-parse "~/Repos/cl-pest/config.toml"))
|
|
(setf *fg* (if *config*
|
|
(setf *fg* (if *config*
|
|
@@ -36,7 +45,9 @@
|
|
(setf *style* (chlorophyll:new-style
|
|
(setf *style* (chlorophyll:new-style
|
|
:bold NIL
|
|
:bold NIL
|
|
:foreground *fg*
|
|
:foreground *fg*
|
|
- :background *bg*)))
|
|
|
|
|
|
+ :background *bg*))
|
|
|
|
+ (setf *git-string* (if (cdr (assoc "display_head" (cdr (assoc "git" *config* :test #'equal)) :test #'equal))
|
|
|
|
+ (setf *git-string* (display-git-info)))))
|
|
|
|
|
|
;; Regex Scanners
|
|
;; Regex Scanners
|
|
;; TODO $HOME rendered as /home/user as opposed to ~
|
|
;; TODO $HOME rendered as /home/user as opposed to ~
|
|
@@ -47,4 +58,4 @@
|
|
|
|
|
|
(defun main ()
|
|
(defun main ()
|
|
(reload-config)
|
|
(reload-config)
|
|
- (format T "~a λ " (chlorophyll:stylize *style* (pwd))))
|
|
|
|
|
|
+ (format T "~a ~a λ " (chlorophyll:stylize *style* (pwd)) *git-string*))
|