2018-07-07 22:34:00 +02:00
|
|
|
;;; em-modeline.el --- Module file for configuring the modeline.
|
2018-02-11 23:34:08 +01:00
|
|
|
;;
|
|
|
|
;; Copyright (C) 2018 Wojciech Kozlowski
|
|
|
|
;;
|
|
|
|
;; Author: Wojciech Kozlowski <wk@wojciechkozlowski.eu>
|
|
|
|
;; Created: 11 Feb 2018
|
|
|
|
;;
|
|
|
|
;; This file is not part of GNU Emacs.
|
|
|
|
;;
|
|
|
|
;;; Commentary:
|
|
|
|
;;
|
|
|
|
;; This module is used for configuring the modeline.
|
|
|
|
;;
|
|
|
|
;;; License: GPLv3
|
|
|
|
|
|
|
|
;;; Required packages:
|
|
|
|
|
2018-07-07 22:34:00 +02:00
|
|
|
;;; Code:
|
2018-02-11 23:34:08 +01:00
|
|
|
|
2018-07-07 22:34:00 +02:00
|
|
|
(defvar emodule/em-modeline-packages
|
2018-02-11 23:34:08 +01:00
|
|
|
|
2018-07-07 22:52:39 +02:00
|
|
|
'(doom-modeline)
|
2018-07-07 22:34:00 +02:00
|
|
|
|
|
|
|
)
|
2018-02-11 23:34:08 +01:00
|
|
|
|
|
|
|
;;; Configuration:
|
|
|
|
|
2018-07-07 22:34:00 +02:00
|
|
|
(defun emodule/em-modeline-init ()
|
|
|
|
"Initialise the `em-modeline' module."
|
2018-02-11 23:34:08 +01:00
|
|
|
|
2018-07-07 20:06:37 +02:00
|
|
|
;; Note that doom-modeline requires all-the-icons which in turn require the
|
|
|
|
;; user to manually install the fonts with the command `M-x
|
|
|
|
;; all-the-icons-install-fonts'.
|
|
|
|
(use-package doom-modeline
|
|
|
|
:hook
|
2018-07-08 01:29:39 +02:00
|
|
|
(after-init . doom-modeline-init)
|
|
|
|
:config
|
2018-07-08 15:03:10 +02:00
|
|
|
(setq-default doom-modeline-height 23)
|
2018-02-11 23:34:08 +01:00
|
|
|
|
2018-07-08 15:03:10 +02:00
|
|
|
;; Add perspective to modeline
|
|
|
|
(doom-modeline-def-segment perspectives
|
|
|
|
"Perspectives list and selection. Requires `persp-mode' to be enabled."
|
|
|
|
(if (and (bound-and-true-p persp-mode)
|
|
|
|
(< 1 (hash-table-count (perspectives-hash))))
|
|
|
|
(persp-mode-line)
|
|
|
|
""))
|
|
|
|
|
|
|
|
;; Set the modeline
|
|
|
|
(doom-modeline-def-modeline main
|
|
|
|
|
|
|
|
(perspectives
|
|
|
|
workspace-number
|
|
|
|
bar
|
|
|
|
matches
|
|
|
|
" "
|
|
|
|
buffer-info
|
|
|
|
" %l:%c %p "
|
|
|
|
selection-info)
|
|
|
|
|
|
|
|
(buffer-encoding
|
|
|
|
major-mode
|
|
|
|
vcs
|
|
|
|
flycheck))
|
|
|
|
)
|
2018-02-11 23:34:08 +01:00
|
|
|
)
|
2018-07-07 22:34:00 +02:00
|
|
|
|
|
|
|
(provide 'em-modeline)
|
|
|
|
;;; em-modeline.el ends here
|