-
Notifications
You must be signed in to change notification settings - Fork 2
/
micgoline.el
149 lines (116 loc) · 5.64 KB
/
micgoline.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
;;; micgoline.el --- powerline mode, color schemes from microsoft and google's logo.
;; Copyright (C) 2016 yzprofile
;;
;; Author: yzprofile <yzprofiles@gmail.com>
;; URL: https://github.com/yzprofile/micgoline
;; Version: 1.0.0
;; Keywords: mode-line powerline theme
;; Package-Requires: ((emacs "24.3") (powerline "2.3"))
;; This file is not part of GNU Emacs.
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with this program. If not, see <http://www.gnu.org/licenses/>.
;;; Commentary:
;; micgoline is a modular mode-line library built on the powerline package,
;; designed to make it easy to build beautiful mode-lines.
;;; Code:
(require 'powerline)
(defface micgoline-pl-active-blue
'((t (:background "#4885ed" :foreground "#FFFFFF" :inherit mode-line)))
"P face blue."
:group 'powerline)
(defface micgoline-pl-inactive-blue
'((t (:background "#00A1F1" :foreground "#FFFFFF" :inherit mode-line-inactive)))
"P face blue."
:group 'powerline)
(defface micgoline-pl-active-green
'((t (:background "#3cba54" :foreground "#FFFFFF" :inherit mode-line)))
"P face green."
:group 'powerline)
(defface micgoline-pl-inactive-green
'((t (:background "#7CBB00" :foreground "#FFFFFF" :inherit mode-line-inactive)))
"P face green."
:group 'powerline)
(defface micgoline-pl-active-red
'((t (:background "#db3236" :foreground "#FFFFFF" :inherit mode-line)))
"P face red."
:group 'powerline)
(defface micgoline-pl-inactive-red
'((t (:background "#F65314" :foreground "#FFFFFF" :inherit mode-line-inactive)))
"P face red."
:group 'powerline)
(defface micgoline-pl-active-yellow
'((t (:background "#f4c20d" :foreground "#FFFFFF" :inherit mode-line)))
"P face yellow."
:group 'powerline)
(defface micgoline-pl-inactive-yellow
'((t (:background "#FFBB00" :foreground "#FFFFFF" :inherit mode-line-inactive)))
"P face yellow."
:group 'powerline)
(setq powerline-default-separator 'slant)
(defun micgoline-load-theme ()
"Setup the default mode-line."
(interactive)
(setq-default
mode-line-format
'("%e"
(:eval
(let* ((active (powerline-selected-window-active))
(mode-line (if active 'mode-line 'mode-line-inactive))
(blue (if active 'micgoline-pl-active-blue 'micgoline-pl-inactive-blue))
(green (if active 'micgoline-pl-active-green 'micgoline-pl-inactive-green))
(red (if active 'micgoline-pl-active-red 'micgoline-pl-inactive-red))
(yellow (if active 'micgoline-pl-active-yellow 'micgoline-pl-inactive-yellow))
(separator-right (intern (format "powerline-%s-%s"
(powerline-current-separator)
(car powerline-default-separator-dir))))
(separator-left (intern (format "powerline-%s-%s"
(powerline-current-separator)
(cdr powerline-default-separator-dir))))
(lhs (list (powerline-raw "%*" blue 'l)
(powerline-raw "%4l" blue 'l)
(powerline-raw ":" blue 'l)
(powerline-raw "%3c" blue 'r)
(when powerline-display-buffer-size
(powerline-buffer-size blue 'l))
(when powerline-display-mule-info
(powerline-raw mode-line-mule-info blue 'l))
(funcall separator-left blue red)
(set-face-attribute 'mode-line-buffer-id nil :foreground "#FFFFFF")
(powerline-buffer-id red 'l)
(when (and (boundp 'which-func-mode) which-func-mode)
(powerline-raw which-func-format red 'l))
(powerline-raw " " red)
(funcall separator-right red yellow)
(when (boundp 'erc-modified-channels-object)
(powerline-raw erc-modified-channels-object nil 'l))
(powerline-major-mode yellow 'l)
(powerline-process yellow)
(powerline-raw " " yellow)
(funcall separator-left yellow blue)
(powerline-minor-modes blue 'l)
(powerline-narrow blue 'l)
(powerline-raw " " blue)
(funcall separator-right blue green)
(powerline-vc green 'l)))
(rhs (list (powerline-raw global-mode-string green 'r)
(funcall separator-right green red)
(unless window-system
(powerline-raw (char-to-string #xe0a1) red 'l))
(powerline-raw " " red)
(powerline-raw "%6p" red 'r)
(when powerline-display-hud
(powerline-hud mode-line blue)))))
(concat (powerline-render lhs)
(powerline-fill green (powerline-width rhs))
(powerline-render rhs)))))))
(micgoline-load-theme)
(provide 'micgoline)
;;; micgoline.el ends here