summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.emacs.d/init.el15
-rw-r--r--.emacs.d/site-lisp/my-smt.el89
2 files changed, 102 insertions, 2 deletions
diff --git a/.emacs.d/init.el b/.emacs.d/init.el
index 4362237..2af4ed7 100644
--- a/.emacs.d/init.el
+++ b/.emacs.d/init.el
@@ -708,11 +708,22 @@ For `python-mode' I prefer `python-imenu-create-flat-index'."
"Try to set the theme for the current (first) frame."
(ignore frame)
(unless setp
- (run-at-time .1 nil (lambda () (setq setp (load-theme theme t)))))))
+ (run-at-time .1 nil (lambda () (setq setp (load-theme theme t))))
+ (smt/enable)
+ (require 'my-smt)
+ (smt/set-theme 'my-smt)
+ (set-face-attribute 'mode-line nil :box nil)
+ (set-face-attribute 'mode-line-inactive nil :box nil))))
(if (daemonp)
(add-hook 'after-make-frame-functions #'oni:set-theme)
- (oni:eval-after-init (load-theme theme t))))
+ (oni:eval-after-init
+ (load-theme theme t)
+ (smt/enable)
+ (require 'my-smt)
+ (smt/set-theme 'my-smt)
+ (set-face-attribute 'mode-line nil :box nil)
+ (set-face-attribute 'mode-line-inactive nil :box nil))))
(defun oni:shell-command-with-command (command &optional output-buffer)
"Print both COMMAND and the output into OUTPUT-BUFFER."
diff --git a/.emacs.d/site-lisp/my-smt.el b/.emacs.d/site-lisp/my-smt.el
new file mode 100644
index 0000000..d29fbe0
--- /dev/null
+++ b/.emacs.d/site-lisp/my-smt.el
@@ -0,0 +1,89 @@
+;;; my-smt.el --- My SVG mode-line theme -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2014 Tom Willemse
+
+;; Author: Tom Willemse <tom@ryuslash.org>
+;; Keywords: faces
+
+;; 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:
+
+;;
+
+;;; Code:
+
+(smt/defwidget my-smt-flycheck-errors
+ :text (lambda (widget)
+ (ignore widget)
+ (when flycheck-mode
+ (let ((counts (flycheck-count-errors
+ flycheck-current-errors)))
+ `(tspan " " (tspan :fill ,(if (smt/window-active-p)
+ "#a85454"
+ "#969696") ,(car counts))
+ "/" (tspan :fill ,(if (smt/window-active-p)
+ "#a88654"
+ "#969696") ,(cdr counts)))))))
+
+(smt/defwidget my-smt-jabber-activity
+ :text (lambda (widget)
+ (ignore widget)
+ (if (and (smt/window-active-p)
+ (boundp 'jabber-activity-mode-string)
+ (not (equal jabber-activity-mode-string "")))
+ (concat jabber-activity-mode-string " "))))
+
+(defun my-smt-yoshi-title-style (widget)
+ (list :fill (if (smt/window-active-p)
+ "#a85454"
+ "#969696")))
+
+(smt/defwidget my-smt-buffer-identification
+ :style 'my-smt-yoshi-title-style
+ :text (lambda (widget)
+ (ignore widget)
+ (concat
+ (s-trim
+ (substring-no-properties
+ (format-mode-line mode-line-buffer-identification)))
+ (when (and (or buffer-file-name
+ buffer-offer-save)
+ (buffer-modified-p))
+ "*"))))
+
+(smt/defrow my-smt-right
+ :prototype 'default-right
+ :widgets '(my-smt-jabber-activity major-mode my-smt-flycheck-errors
+ version-control minor-modes))
+
+(smt/defrow my-smt-left
+ :prototype 'default-left
+ :widgets '(buffer-info my-smt-buffer-identification which-function))
+
+(defun my-smt-major-mode-style (widget)
+ (ignore widget)
+ '(:fill "#ccc" :font-family "Fantasque Sans" :filter nil
+ :font-weight "bold" :font-style "italic"))
+
+(smt/deftheme my-smt
+ :prototype 'black-crystal
+ :local-widgets (list (cons 'major-mode
+ (smt/make-widget
+ :prototype 'major-mode
+ :style 'my-smt-major-mode-style)))
+ :rows '(my-smt-left default-position my-smt-right))
+
+(provide 'my-smt)
+;;; my-smt.el ends here