diff options
author | Vincent Ambo <mail@tazj.in> | 2018-06-22T08·29+0200 |
---|---|---|
committer | Vincent Ambo <github@tazj.in> | 2019-02-10T20·43+0100 |
commit | 4fe8d78dbb16dbec2b8c173a5142b4b14927fd28 (patch) | |
tree | 481bd47ba446167088f846f9eeb383a847dc7d86 /init/look-and-feel.el | |
parent | f0dfc8b06de568e57050510a5b56fcbb725a6733 (diff) |
refactor: Begin moving package configuration to use-package
This is the first in a series of commits for refactoring my configuration to make use of jwiegley's use-package. In the previous layout of the configuration there were some questions around what settings go into which file, but in the end it is all just related to which packages are being configured (besides settings related to global Emacs behaviour). This commit introduces use-package forms for all currently used packages (which are still installed via Nix, not via package.el) but does not yet clean up the rest of the configuration in a suitable way. Note that this version introduces a bug in which the configuration of telephone line is not correctly initialised after package setup.
Diffstat (limited to 'init/look-and-feel.el')
-rw-r--r-- | init/look-and-feel.el | 63 |
1 files changed, 31 insertions, 32 deletions
diff --git a/init/look-and-feel.el b/init/look-and-feel.el index 555feca43fcf..3d480bd5f43e 100644 --- a/init/look-and-feel.el +++ b/init/look-and-feel.el @@ -1,7 +1,5 @@ ;;; -*- lexical-binding: t; -*- -(require 'telephone-line) - ;; Hide those ugly tool bars: (tool-bar-mode 0) (scroll-bar-mode 0) @@ -46,36 +44,37 @@ (when (bottom-right-window-p) (telephone-line-raw mode-line-misc-info t))) -(telephone-line-defsegment telephone-line-last-window-segment () - (telephone-misc-if-last-window)) - -;; Display the current EXWM workspace index in the mode-line -(telephone-line-defsegment telephone-line-exwm-workspace-index () - (when (bottom-right-window-p) - (format "[%s]" exwm-workspace-current-index))) - -;; Define a highlight font for ~ important ~ information in the last -;; window. -(defface special-highlight '((t (:foreground "white" :background "#5f627f"))) "") -(add-to-list 'telephone-line-faces - '(highlight . (special-highlight . special-highlight))) - -(setq telephone-line-lhs - '((nil . (telephone-line-position-segment)) - (accent . (telephone-line-buffer-segment)))) - -(setq telephone-line-rhs - '((accent . (telephone-line-major-mode-segment)) - (nil . (telephone-line-last-window-segment - telephone-line-exwm-workspace-index)) - (highlight . (telephone-line-notmuch-counts)))) - -(setq telephone-line-primary-left-separator 'telephone-line-tan-left - telephone-line-primary-right-separator 'telephone-line-tan-right - telephone-line-secondary-left-separator 'telephone-line-tan-hollow-left - telephone-line-secondary-right-separator 'telephone-line-tan-hollow-right) - -(telephone-line-mode 1) +(defun telephone-line-setup () + (telephone-line-defsegment telephone-line-last-window-segment () + (telephone-misc-if-last-window)) + + ;; Display the current EXWM workspace index in the mode-line + (telephone-line-defsegment telephone-line-exwm-workspace-index () + (when (bottom-right-window-p) + (format "[%s]" exwm-workspace-current-index))) + + ;; Define a highlight font for ~ important ~ information in the last + ;; window. + (defface special-highlight '((t (:foreground "white" :background "#5f627f"))) "") + (add-to-list 'telephone-line-faces + '(highlight . (special-highlight . special-highlight))) + + (setq telephone-line-lhs + '((nil . (telephone-line-position-segment)) + (accent . (telephone-line-buffer-segment)))) + + (setq telephone-line-rhs + '((accent . (telephone-line-major-mode-segment)) + (nil . (telephone-line-last-window-segment + telephone-line-exwm-workspace-index)) + (highlight . (telephone-line-notmuch-counts)))) + + (setq telephone-line-primary-left-separator 'telephone-line-tan-left + telephone-line-primary-right-separator 'telephone-line-tan-right + telephone-line-secondary-left-separator 'telephone-line-tan-hollow-left + telephone-line-secondary-right-separator 'telephone-line-tan-hollow-right) + + (telephone-line-mode 1)) ;; Auto refresh buffers (global-auto-revert-mode 1) |