]> git.earman.xyz Git - emacsinit.git/commitdiff
Try out new ultra-mono theme
authorrearman <rearman@r717.net>
Tue, 23 Sep 2025 21:01:30 +0000 (17:01 -0400)
committerrearman <rearman@r717.net>
Tue, 23 Sep 2025 21:01:30 +0000 (17:01 -0400)
even more monochrome than fully-mono.

init.el
re/wobow-bow-theme.el [new file with mode: 0644]
re/wobow-themes.el [new file with mode: 0644]

diff --git a/init.el b/init.el
index 6f5ce97297c538b8d2fd8a6edf06178e089faf57..85307cbbe7f5179a5327ad634b23b0455314048a 100644 (file)
--- a/init.el
+++ b/init.el
@@ -15,6 +15,7 @@
 (require 're-vc-defuns)
 (require 'acme-mouse)
 (require 'fully-mono-themes)
+(require 'wobow-themes)
 (require 're-os-specific)
 (require 're-bindings)
 
@@ -42,7 +43,7 @@
       scroll-conservatively 101)
 
 ;; Buffer dealiƋ
-(global-acme-mouse-mode t)
+;; (global-acme-mouse-mode t)
 
 (setq disabled-command-function nil
       save-interprogram-paste-before-kill t
          (lambda ()
            (keymap-set text-mode-map "<TAB>" 'self-insert-command)))
 
-(load-theme 'fully-mono-full-white t)
+;; (load-theme 'fully-mono-white t)
+(load-theme 'wobow-bow t)
 
 (setq show-paren-delay 0
       show-paren-style 'expression)
diff --git a/re/wobow-bow-theme.el b/re/wobow-bow-theme.el
new file mode 100644 (file)
index 0000000..db919c6
--- /dev/null
@@ -0,0 +1,2 @@
+(require 'wobow-themes)
+(wobow-themes--define-theme bow)
diff --git a/re/wobow-themes.el b/re/wobow-themes.el
new file mode 100644 (file)
index 0000000..ac98773
--- /dev/null
@@ -0,0 +1,176 @@
+;;; wobow-themes.el --- Fully monochromatic color themes -*- lexical-binding: t; -*-
+
+;;; Code:
+
+(defconst wobow-themes-colors
+  '((bow . ((background . "#ffffff")
+           (foreground . "#000000")
+           (weak       . "#000000")
+           (weaker     . "#000000")
+           (weakest    . "#000000")
+           (highlight  . "#ffffff")
+           (secondary  . "#ffffff")
+           (warning    . "#000000")
+           (success    . "#000000")
+           (string     . "#000000")))
+    (wob . ((background . "#000000")
+           (foreground . "#ffffff")
+           (weak       . "#ffffff")
+           (weaker     . "#ffffff")
+           (weakest    . "#ffffff")
+           (highlight  . "#000000")
+           (secondary  . "#000000")
+           (warning    . "#ffffff")
+           (success    . "#ffffff")
+           (string     . "#ffffff")))))
+
+(defmacro wobow-themes--variant-with-colors (variant &rest body)
+  "Execute BODY in a scope where the different colors for given VARIANT is bound."
+  `(let* ((colors (or (cdr (assoc ,variant wobow-themes-colors))
+                     (error "No such theme variant")))
+         (background (cdr (assoc 'background colors)))
+         (foreground (cdr (assoc 'foreground colors)))
+         (weak       (cdr (assoc 'weak colors)))
+         (weaker     (cdr (assoc 'weaker colors)))
+         (weakest    (cdr (assoc 'weakest colors)))
+         (highlight  (cdr (assoc 'highlight colors)))
+         (secondary  (cdr (assoc 'secondary colors)))
+         (warning    (cdr (assoc 'warning colors)))
+         (success    (cdr (assoc 'success colors)))
+         (string     (cdr (assoc 'string colors))))
+     ,@body))
+
+(defmacro wobow-themes--faces-spec ()
+  "Provide the faces specification."
+  (quote
+   (mapcar
+    (lambda (entry) (list (car entry) `((t ,@(cdr entry)))))
+    `(
+
+      ;; default
+      (default (:background ,background :foreground ,foreground))
+      (fringe  (:background ,background :foreground ,foreground))
+      (region  (:inverse-video t))
+      (highlight (:inverse-video t))
+      (secondary-selection  (:inverse-video t))
+      (shadow (:foreground ,foreground))
+      (show-paren-match (:bold t))
+      (show-paren-mismatch (:inverse-video t :bold t))
+      (minibuffer-prompt (:background ,background  :foreground ,foreground :weight bold))
+      (isearch (:inverse-video t :bold t))
+      (lazy-highlight (:background ,background :foreground ,foreground))
+      (link (:underline t))
+
+      ;; mode line
+      (mode-line (:box (:line-width -1 :color ,foreground)
+                      :background ,background :foreground ,foreground :inverse-video t))
+
+      (mode-line-inactive (:box (:line-width -1 :color ,foreground)
+                               :background ,background :foreground ,foreground))
+
+      ;; font lock
+      (font-lock-keyword-face (:bold t))
+      (font-lock-function-name-face (:bold t))
+      (font-lock-variable-name-face (:foreground ,foreground))
+      (font-lock-warning-face (:foreground ,foreground :underline (:color ,warning :inverse-video t :style wave)))
+      (font-lock-builtin-face (:bold t))
+      (font-lock-variable-name-face (:foreground ,foreground :italic t))
+      (font-lock-constant-face (:bold t :italic t))
+      (font-lock-type-face (:italic t))
+      (font-lock-preprocessor-face (:italic t))
+      (font-lock-comment-face (:foreground ,foreground :italic t))
+      (font-lock-string-face (:foreground ,foreground))
+      (font-lock-doc-face (:inherit font-lock-comment-face))
+      (line-number (:foreground ,foreground))
+      (linum (:inherit line-number))
+      (vertical-border (:foreground ,weaker))
+      (scroll-bar (:background ,background :foreground ,foreground :inverse-video t))
+
+      ;; eshell
+      (eshell-prompt (:foreground ,foreground :bold t))
+      (eshell-ls-directory (:foreground ,foreground :bold t))
+      (eshell-ls-archive (:inherit eshell-ls-unreadable))
+      (eshell-ls-backup (:inherit eshell-ls-unreadable))
+      (eshell-ls-clutter (:inherit eshell-ls-unreadable))
+      (eshell-ls-executable (:inherit eshell-ls-unreadable))
+      (eshell-ls-missing (:inherit eshell-ls-unreadable))
+      (eshell-ls-product (:inherit eshell-ls-unreadable))
+      (eshell-ls-readonly (:inherit eshell-ls-unreadable))
+      (eshell-ls-special (:inherit eshell-ls-unreadable))
+      (eshell-ls-symlink (:inherit eshell-ls-unreadable))
+
+      ;; corfu mode
+      (corfu-default (:background ,background))
+      (corfu-current (:inverse-video t :extend t))
+      (corfu-bar (:background ,foreground))
+      (corfu-border (:background ,foreground)
+
+      ;; git gutter
+      (git-gutter:modified (:background ,highlight :foreground ,highlight))
+      (git-gutter:added (:background ,success :foreground ,success))
+      (git-gutter:deleted (:background ,warning :foreground ,warning))
+
+      ;; diff hl
+      (diff-hl-change (:background ,highlight :foreground ,highlight))
+      (diff-hl-insert (:background ,success :foreground ,success))
+      (diff-hl-delete (:background ,warning :foreground ,warning))
+
+      ;; hl line
+      (hl-line (:background ,weakest))
+      (highlight-current-line-face (:inherit hl-line))
+
+      ;; ido
+      (ido-first-match (:bold t))
+      (ido-only-match (:bold t))
+      (ido-subdir (:italic t))
+      (ido-virtual (:foreground ,weak))
+      (ido-vertical-match-face (:bold t :italic nil))
+
+      ;; org mode
+      (org-drawer (:foreground ,weak))
+      (org-special-keyword (:bold t :foreground ,weak))
+      (org-property-value (:italic t :foreground ,weak))
+      (org-table (:foreground ,weak))
+
+      (org-todo (:bold t :foreground ,highlight))
+      (org-done (:bold t :foreground ,success))
+      (org-agenda-done (:bold t :foreground ,success))
+      (org-date (:foreground ,foreground))
+      (org-agenda-structure (:foreground ,foreground))
+      (org-headline-done (:bold t :foreground ,foreground))
+
+      ;; various completion matches
+      (vertico-current (:bold t :foreground ,foreground :background ,highlight))
+
+      (completions-common-part (:bold t :underline t))
+      (orderless-match-face-0 (:bold t :underline t))
+      (orderless-match-face-1 (:bold t :underline t))
+      (orderless-match-face-2 (:bold t :underline t))
+      (orderless-match-face-3 (:bold t :underline t))
+      ))))
+
+(defun wobow-themes--variant-name (variant)
+  "Create symbol for color theme variant VARIANT."
+  (intern (format "wobow-%s" (symbol-name variant))))
+
+(defmacro wobow-themes--define-theme (variant)
+  "Define a theme for the wobow variant VARIANT."
+  (let ((name (wobow-themes--variant-name variant))
+       (doc (format "wobow theme (%s version)" variant)))
+    `(progn
+       (deftheme ,name ,doc)
+       (put ',name 'theme-immediate t)
+       (wobow-themes--variant-with-colors
+       ',variant
+       (apply 'custom-theme-set-faces ',name
+              (wobow-themes--faces-spec)))
+       (provide-theme ',name))))
+
+;;;###autoload
+(when (and (boundp 'custom-theme-load-path) load-file-name)
+  (add-to-list 'custom-theme-load-path
+              (file-name-as-directory (file-name-directory load-file-name))))
+
+(provide 'wobow-themes)
+
+;;; wobow-themes.el ends here