 ;; Eldoc-in-mode-line support (for `eval-expression')
 ;;
 
-(defvar doom-eldoc-modeline-bar
-  (pl/percent-xpm doom-modeline-height 100 0 100 0 3
-                  (face-background 'doom-modeline-eldoc-bar)
-                  nil))
+(defvar doom-modeline-eldoc-bar-color (face-background 'doom-modeline-eldoc-bar)
+  "The color to use for the bar when eldoc uses the mode-line.")
 
 (defun doom-eldoc-modeline ()
   `(:eval
     (let ((active (eq (selected-window) doom-ml-selected-window)))
-      (list (list (propertize " " 'display doom-eldoc-modeline-bar)
+      (list (list (propertize " " 'display (doom-make-xpm doom-modeline-eldoc-bar-color
+                                                          doom-modeline-height
+                                                          doom-modeline-bar-width))
                   (and (bound-and-true-p str) str))
             (propertize " " 'display `((space :align-to (1- (+ right right-fringe right-margin)))))))))
 

(defvar doom-modeline-height 29
  "How tall the mode-line should be. This is only respected in GUI emacs.")

;; Custom faces
(defface doom-modeline-alternate '((t (:inherit mode-line)))
  "Secondary color for the modeline.")

  (add-hook 'focus-in-hook 'doom-ml|env-update)
  (add-hook 'find-file-hook 'doom-ml|env-update)
  `(add-hook ',mode (lambda () (setq doom-ml--env-command ,command))))

(defun doom-make-xpm (color height width)
  "Create an XPM bitmap."
  (let ((data nil)
        (i 0))
    (setq data (make-list height (make-list width 1)))
    (pl/make-xpm "percent" color color (reverse data))))

(pl/memoize 'doom-make-xpm)


;;
