diff --git a/lisp/fg42/modeline.el b/lisp/fg42/modeline.el index 1db1188..029784d 100644 --- a/lisp/fg42/modeline.el +++ b/lisp/fg42/modeline.el @@ -74,11 +74,69 @@ to Emacs modeline." (if fg42/modeline-inactive-face fg42/modeline-inactive-face 'fg42/-disabled-modeline-dective-border) (default-value 'face-remapping-alist) face-remaps)) - (setq-default noether-views (or fg42/modeline-views - (list - noether-minimal-mode-line - noether-minimal-location - noether-minimal-exwm)))) + (when-not-wm + (require 'noether-units) + (require 'nerd-icons) + (require 'projectile) + + (defvar noether--mode-icon) + + (defun noether--update-mode-icon () + "Set the current buffer name to the watched var." + (setq noether--mode-icon major-mode)) + + + (defun noether--format-mode-icon (_ v _ _) + "Format the icon V." + (nerd-icons-icon-for-mode v)) + + + (noether-defunit mode-icon + "Draws an icon for the current major mode." + :label "" + :len 1 + :init (lambda () + (add-hook 'post-command-hook #'noether--update-mode-icon)) + + :deinit (lambda () + (remove-hook 'post-command-hook #'noether--update-mode-icon)) + + :var 'noether--mode-icon + :fn #'noether--format-mode-icon) + + + (noether-defview fg42-modeline + "A simple and minimalist mode-line like status bar" + :managed? t + :binding (kbd "C-c 0") + :buffer "*modeline" + :visible? t + :timeout 0 + + :frame + (list + :position + (cons (- (frame-inner-width) 690) + (- (frame-outer-height) 20)) + :border-width 0 + :border-color "#bd93f9") + + :units + (list + (buffer-name-unit :label (format "%s " (nerd-icons-codicon "nf-cod-layers")) + :len 20) + ;; (mode-name-unit :label " " :len 4) + (projectile-project-unit :label (format "%s " (nerd-icons-octicon "nf-oct-project")) + :len 20) + (git-branch-unit :label (format "%s " (nerd-icons-devicon "nf-dev-git_branch")) + :len 20) + (mode-icon) + (line-unit :label ""))) + + (setq-default noether-views (list fg42-modeline))) + + (when-wm + (setq-default noether-views (list noether-minimal-exwm)))) (provide 'fg42/modeline) ;;; modeline.el ends here