 (with-eval-after-load "mu4e"
   ;; Disable message sending with C-c C-s (make it more complicated to
   ;; not send messages by accident)
-  (define-key mu4e-headers-mode-map (kbd "C-c C-s") 'nil))
+  (define-key mu4e-headers-mode-map (kbd "C-c C-s") 'nil)
+  ;; Update mail periodically in the background
+  (run-with-timer `,danylo/email-refresh-period
+		  `,danylo/email-refresh-period
+		  (lambda () (mu4e-update-mail-and-index t))))
 
 ;;;###autoload
 (defun danylo/mu4e~headers-remove-handler (docid &optional skip-hook)

  :config
  (ivy-mode 1))

(use-package helm
  ;; https://emacs-helm.github.io/helm/
  ;; Emacs incremental completion and selection narrowing framework

  ;; https://github.com/seagle0128/doom-modeline
  ;; A fancy and fast mode-line inspired by minimalism design.
  :init (setq doom-modeline-height 10
	      doom-modeline-bar-width 2
	      doom-modeline-major-mode-icon nil
	      doom-modeline-icon nil
	      doom-modeline-buffer-state-icon nil
