Make themes available via the flag system

This commit is contained in:
Sameer Rahmani 2024-02-11 12:18:21 +00:00
parent 5d06272e19
commit 8a275d7873
Signed by: lxsameer
GPG Key ID: B0A4AF28AB9FD90B
3 changed files with 89 additions and 19 deletions

View File

@ -234,25 +234,25 @@ data. The typical example of this would be Lisp or Scheme source code."
(set-face-attribute 'default t :font font))))
;TODO: Replace this cube with a `theme-cube'
(defcube fg42/dracula-theme-cube
"Replace this with a theme cube"
:title "Dracula theme"
:no-flag t
:ui-hook (lambda ()
(fpkg/use dracula-theme
:init
(fg42/setup-theme
(load-theme 'dracula t)
(custom-theme-set-faces
'dracula
'(match ((t (:background "#44475a"))))
'(all-the-icons-lgreen ((t (:background "#bd93f9"))))
'(all-the-icons-faicon ((t (:background "#bd93f9"))))
'(font-lock-comment-face ((t (:foreground "#8B9298"))))
'(font-lock-comment-delimiter-face ((t (:foreground "#5B6268")))))
(enable-theme 'dracula)
(set-face-attribute 'region nil :background "#888")))))
;; ;TODO: Replace this cube with a `theme-cube'
;; (defcube fg42/dracula-theme-cube
;; "Replace this with a theme cube"
;; :title "Dracula theme"
;; :no-flag t
;; :ui-hook (lambda ()
;; (fpkg/use dracula-theme
;; :init
;; (fg42/setup-theme
;; (load-theme 'dracula t)
;; (custom-theme-set-faces
;; 'dracula
;; '(match ((t (:background "#44475a"))))
;; '(all-the-icons-lgreen ((t (:background "#bd93f9"))))
;; '(all-the-icons-faicon ((t (:background "#bd93f9"))))
;; '(font-lock-comment-face ((t (:foreground "#8B9298"))))
;; '(font-lock-comment-delimiter-face ((t (:foreground "#5B6268")))))
;; (enable-theme 'dracula)
;; (set-face-attribute 'region nil :background "#888")))))
(defcube fg42/badwolf-theme-cube
"Badwolf theme cube. An Emacs port of Bad Wolf theme for Vim.

View File

@ -56,6 +56,7 @@
(require 'cubes/noether)
(require 'cubes/nix)
(require 'cubes/julia)
(require 'cubes/themes)
(defcube fg42/editor

69
core/cubes/themes.el Normal file
View File

@ -0,0 +1,69 @@
;;; Themes --- The common cubes for FG42 -*- lexical-binding: t; -*-
;;
;; Copyright (c) 2010-2023 Sameer Rahmani & Contributors
;;
;; Author: Sameer Rahmani <lxsameer@gnu.org>
;; URL: https://devheroes.codes/FG42/FG42
;; Version: 3.0.0
;;
;; 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:
(require 'fpkg)
(require 'fg42/cube)
(require 'fg42/utils)
(require 'fg42/themes)
(defcube fg42/dracula-theme-cube
"Replace this with a theme cube"
:title "Dracula theme"
:flag dracula-theme
:flag-default t
:ui-hook (lambda ()
(fpkg/use dracula-theme
:init
(fg42/setup-theme
(load-theme 'dracula t)
(custom-theme-set-faces
'dracula
'(match ((t (:background "#44475a"))))
'(all-the-icons-lgreen ((t (:background "#bd93f9"))))
'(all-the-icons-faicon ((t (:background "#bd93f9"))))
'(font-lock-comment-face ((t (:foreground "#8B9298"))))
'(lsp-ui-sideline-current-symbol ((t (:line-width -1 :foreground "#bd93f9"))))
'(font-lock-comment-delimiter-face ((t (:foreground "#5B6268")))))
(enable-theme 'dracula)
(set-face-attribute 'region nil :background "#888")))))
(defcube fg42/badwolf-theme-cube
"Badwolf theme cube. An Emacs port of Bad Wolf theme for Vim.
https://emacsthemes.com/themes/badwolf-theme.html"
:title "Badwolf theme"
:flag badwolf-theme
:flag-default nil
:ui-hook (lambda ()
(fpkg/use badwolf-theme
:init
(fg42/setup-theme
(load-theme 'badwolf t)
(custom-theme-set-faces
'badwolf)
(enable-theme 'badwolf)))))
(provide 'cubes/themes)
;;; themes.el ends here