emacs: change mode-line font-size and face
[dotfiles.git] / emacs.d / config / init-color-theme.el
1
2
3 ;(setq display-time-day-and-date t)
4 ;(display-time-mode t)
5
6
7 (setq ns-use-srgb-colorspace nil)
8
9 (require 'color-theme)
10 ;(load-theme 'tango-dark)
11 ;(require 'moe-theme)
12 ;(moe-dark)
13
14
15 ;(add-to-list 'custom-theme-load-path "~/.emacs.d/el-get/color-theme-tangotango")
16 ;(load-theme 'tangotango t)
17 (load-theme 'cyberpunk t)
18
19 ;(require 'color-theme-sanityinc-tomorrow)
20 ;(color-theme-sanityinc-tomorrow-bright)
21
22
23
24 ;(add-to-list 'load-path "~/.emacs.d/vendor/emacs-powerline")
25 (require 'powerline)
26 (powerline-default-theme)
27
28
29 ;(defconst color1 "#6b8e23")
30 ;(defconst color2 "#eedd82")
31
32 ;(make-face 'mode-line-color-1)
33 ;(set-face-attribute 'mode-line-color-1 nil
34 ;                    :foreground "#fffacd"
35 ;                    :bold t
36 ;                    :background color1)
37
38 ;(make-face 'mode-line-color-2)
39 ;(set-face-attribute 'mode-line-color-2 nil
40 ;                    :foreground "#fffacd"
41 ;                    :bold t
42 ;                    :background color2)
43
44
45 ;;(defface powerline-active2 '((t (:background "grey40" :inherit mode-line)))
46 ;;  "Powerline face 2."
47 ;;  :group 'powerline)
48 ;;
49
50
51 ;; https://github.com/howardabrams/dot-files/blob/master/emacs-mode-line.org
52 ;;;(custom-set-faces
53 ;;; '(mode-line-buffer-id ((t (:foreground "#008000" :bold t))))
54 ;;; '(which-func ((t (:foreground "#008000"))))
55 ;;; '(mode-line ((t (:foreground "#008000" :background "#dddddd" :box nil))))
56 ;;; '(mode-line-inactive ((t (:foreground "#008000" :background "#bbbbbb" :box nil)))))
57
58 ;;; this variable should equal as height in mode-line
59 (custom-set-variables
60  '(powerline-text-scale-factor 0.8))
61
62 (custom-set-faces
63  '(mode-line ((t (:foreground "#030303" :background "#bdbdbd" :box nil :height 0.8 ))))
64  '(mode-line-inactive ((t (:foreground "#f9f9f9" :background "#666666" :box nil :height 0.8)))))
65
66
67 (defface powerline-active-yel '((t (:background "yellow" :inherit mode-line)))
68   "Powerline face 1."
69   :group 'powerline)
70
71 (defface powerline-active-blue '((t (:background "blue" :inherit mode-line)))
72   "Powerline face 1."
73   :group 'powerline)
74
75 ;;
76 ;;http://emacser.com/mode-line.htm
77 (defun get-lines-4-mode-line ()
78   (let ((lines (count-lines (point-min) (point-max))))
79     (concat (propertize
80              (format "%d" lines)
81              'mouse-face 'mode-line-highlight
82              'face 'mode-line-lines-face
83              'help-echo (format "%d lines" lines)) " ")))
84
85
86
87 (defun powerline-simpler-vc-mode (s)
88   (if s
89       (replace-regexp-in-string "Git:" "" s)
90     s))
91
92 (defun powerline-simpler-minor-display (s)
93   (replace-regexp-in-string
94    (concat " "
95            (mapconcat 'identity '("Undo-Tree" "GitGutter" "Projectile"
96                                   "Abbrev" "ColorIds" "MRev" "ElDoc" "Paredit"
97                                   "+1" "+2" "FlyC" "Fly" ;; ":1/0"
98                                   "Fill" "AC" "FIC") "\\|")) "" s))
99
100 (defun powerline-ha-theme ()
101   "A powerline theme that removes many minor-modes that don't serve much purpose on the mode-line."
102   (interactive)
103   (setq-default mode-line-format
104                 '("%e"
105                   (:eval
106                    (let*
107                        ((active
108                          (powerline-selected-window-active))
109                         (mode-line
110                          (if active 'mode-line 'mode-line-inactive))
111                         (face1
112                          (if active 'powerline-active1 'powerline-inactive1))
113                         (face2
114                          (if active 'powerline-active2 'powerline-inactive2))
115                         (face3
116                          (if active 'powerline-active-yel 'powerline-inactive2))
117                         (separator-left
118                          (intern
119                           (format "powerline-%s-%s" powerline-default-separator
120                                   (car powerline-default-separator-dir))))
121                         (separator-right
122                          (intern
123                           (format "powerline-%s-%s" powerline-default-separator
124                                   (cdr powerline-default-separator-dir))))
125                         (lhs
126                             (list
127                                 (powerline-raw "%*" nil 'l)
128                                 ;; (powerline-buffer-size nil 'l)
129                                 (powerline-buffer-id nil 'l)
130                                 (powerline-raw " ")
131                                 (funcall separator-left mode-line face1)
132                                 (powerline-narrow face1 'l)
133                                 (powerline-simpler-vc-mode (powerline-vc face1))))
134                         
135                         (rhs
136                             (list
137 ;                               (powerline-raw mode-line-misc-info face1 'r)
138                                 (powerline-raw global-mode-string face1 'r)
139                                 (funcall separator-right face1 mode-line)
140                                             (powerline-raw '(:eval (format-time-string " %Y-%m-%d %I:%M %p %a")) nil 'r)
141                                 (funcall separator-right mode-line face1)
142 ;;                                          (powerline-raw '(:eval (propertize (format-time-string " %Y-%m-%d %I:%M %p %a")
143 ;;                                                              'help-echo
144 ;;                                                              (concat (format-time-string "%c; ")
145 ;;                                                                      (emacs-uptime "Uptime:%hh")))) nil)
146                                          
147                                 (powerline-raw "%3c, %l/" face1)
148                                 (powerline-raw (format "%d" (count-lines (point-min) (point-max))) face1 'r)
149                                 (funcall separator-right face1 face3)
150 ;                                (powerline-raw " ")
151 ;                                (powerline-raw " %4p" nil)))
152                                 (powerline-raw " %4p" face3)))
153                         (center
154                             (list
155                                 (powerline-raw " " face1)
156                                 (funcall separator-left face1 face2)
157                                 (when
158                                     (boundp 'erc-modified-channels-object)
159                                 (powerline-raw erc-modified-channels-object face2 'l))
160                                 (powerline-major-mode face2 'l)
161                                 (powerline-process face2)
162                                 (powerline-raw " :" face2)
163
164                                 (powerline-simpler-minor-display (powerline-minor-modes face2 'l))
165
166                                 (powerline-raw " " face2)
167                                 (funcall separator-right face2 face1))))
168
169
170                      (concat
171                       (powerline-render lhs)
172 ;                      (powerline-fill-center face1
173 ;                                             (/
174 ;                                              (powerline-width center)
175 ;                                              2.0))
176 ;                      (powerline-render center)
177                       (powerline-fill face1
178                                       (powerline-width rhs))
179                       (powerline-render rhs))
180                      ); let
181                    ); :eval
182                   ); '(
183                 ); setq
184   ); defun
185
186
187 (powerline-ha-theme)
188
189
190
191
192 (provide 'init-color-theme)