Disable stylix themeing of emacs, switch to modus-vivendi-tinted theme

Move all of UI config section in to new format, including changing to
use-package
This commit is contained in:
Evie Litherland-Smith 2023-11-08 06:27:32 +00:00
parent a111797e49
commit 7b051c3c36
3 changed files with 257 additions and 231 deletions

View file

@ -1,6 +1,7 @@
{ config, pkgs, ... }:
{
stylix.targets.emacs.enable = false;
xdg.configFile = {
"emacs/init.el".source = ./init.el;
"emacs/snippets".source = ./snippets;
@ -10,6 +11,12 @@
package = pkgs.emacs29-pgtk;
extraPackages = epkgs:
with epkgs; [
# themes
modus-themes
doom-themes
base16-theme
tron-legacy-theme
# completion-packages
cape
consult

View file

@ -56,7 +56,80 @@
(when (require 'auth-source nil :noerror)
(setq auth-sources '("secrets:Login"))
(auth-source-pass-enable))
(when (require 'auth-source-pass nil :noerror)
(auth-source-pass-enable)))
;; Make `describe-*' screens more helpful
(use-package helpful
:ensure t
:bind (("<remap> <describe-command>" . helpful-command)
("<remap> <describe-function>" . helpful-callable)
("<remap> <describe-key>" . helpful-key)
("<remap> <describe-symbol>" . helpful-symbol)
("<remap> <describe-variable>" . helpful-variable)
("C-h F" . helpful-function)
:map helpful-mode-map
("<remap> <revert-buffer>" . helpful-update)))
;; Bind extra `describe-*' commands
(keymap-global-set "C-h K" #'describe-keymap)
(setq use-dialog-box nil
fill-column 80
truncate-lines nil
truncate-partial-width-windows nil)
(menu-bar-mode -1)
(tab-bar-mode -1)
(tool-bar-mode -1)
(scroll-bar-mode -1)
(line-number-mode)
(global-display-line-numbers-mode -1)
(global-prettify-symbols-mode +1)
(global-visual-line-mode +1)
(use-package which-key
:ensure t
:config (which-key-mode +1))
(use-package page-break-lines
:ensure t
:config (global-page-break-lines-mode +1))
;; add visual pulse when changing focus, like beacon but built-in
;; from from https://karthinks.com/software/batteries-included-with-emacs/
(defun pulse-line (&rest _)
"Pulse the current line."
(pulse-momentary-highlight-one-line (point)))
(dolist (command '(scroll-up-command
scroll-down-command
recenter-top-bottom
other-window))
(advice-add command :after #'pulse-line))
(set-frame-font "Fira Code-12")
(set-frame-parameter nil 'alpha-background 80)
;; Theme
(use-package modus-themes
:ensure t
:config (load-theme 'modus-vivendi-tinted :noconfirm))
;; Nerd-Icons modes
(use-package nerd-icons
:ensure t
:config (nerd-icons-set-font "Symbols Nerd Font Mono"))
(use-package nerd-icons-ibuffer
:ensure t
:hook dired-mode)
(use-package nerd-icons-completion
:ensure t
:requires marginalia
:hook marginalia-mode
:config (nerd-icons-completion-mode +1))
(use-package ligature
:ensure t
@ -129,6 +202,47 @@
;; per mode with `ligature-mode'.
(global-ligature-mode t))
;; Doom-Modeline
(setq doom-modeline-icon t
doom-modeline-mu4e nil ;; Use mu4e own formatting
doom-modeline-modal nil
doom-modeline-modal-icon nil
doom-modeline-persp-name nil
doom-modeline-persp-icon nil)
(use-package doom-modeline
:ensure t
:config (doom-modeline-mode +1))
;; Dashboard
(setq dashboard-icon-type 'nerd-icons
dashboard-set-heading-icons t
dashboard-set-file-icons t
dashboard-set-navigator t
dashboard-set-init-info t
dashboard-startup-banner 'ascii
dashboard-projects-backend 'project-el
dashboard-projects-switch-function 'project-switch-project
dashboard-projects-show-base t
dashboard-recentf-show-base 'align
dashboard-items '()
dashboard-banner-ascii (concat " .000000. \n"
" .0. .0. \n"
" .00. .00. \n"
" .000cl. .lc000. \n"
".0 0.\n"
"0. .o0000o. .0\n"
" 00 .0' '0. 00 \n"
" 00 .0 0. 00 \n"
" HHHHH HHHHHHHHHHHH HHHHH \n"
"HHHH HHH HHHHHHHHHHHHHH HHHH\n"
" HHHHHH HHHHHHHHH HHHHHHHH \n"
" HHH HHHH HHHHHHHHH HHHH \n"
" HHH HHHHHH \n"
" HHHHH HH \n"))
(use-package dashboard
:ensure t
:config (setq initial-buffer-choice 'dashboard-open))
(setq org-directory "~/Org"
org-default-notes-file (expand-file-name "notes.org" org-directory)
org-pretty-entities-include-sub-superscripts t
@ -202,116 +316,6 @@
(add-hook 'org-agenda-mode-hook #'khalel-import-events)
(khalel-add-capture-template "e"))
(setq use-dialog-box nil
fill-column 80
truncate-lines nil
truncate-partial-width-windows nil)
(menu-bar-mode -1)
(tab-bar-mode -1)
(tool-bar-mode -1)
(scroll-bar-mode -1)
(line-number-mode)
(global-display-line-numbers-mode -1)
(global-prettify-symbols-mode +1)
(global-visual-line-mode +1)
;; (set-frame-font "FiraCode Nerd Font-12")
;; (set-frame-parameter nil 'alpha-background 80)
;; Nerd-Icons modes
(when (require 'nerd-icons nil :noerror)
(nerd-icons-set-font "Symbols Nerd Font Mono")
(when (require 'nerd-icons-dired nil :noerror)
(add-hook 'dired-mode-hook #'nerd-icons-dired-mode))
(when (require 'nerd-icons-ibuffer nil :noerror)
(add-hook 'ibuffer-mode-hook #'nerd-icons-ibuffer-mode))
(when (require 'nerd-icons-completion nil :noerror)
(nerd-icons-completion-mode)
(when (require 'marginalia nil :noerror)
(add-hook 'marginalia-mode-hook #'nerd-icons-completion-marginalia-setup))))
;; Doom-Modeline
(setq doom-modeline-icon t
doom-modeline-mu4e nil ;; Use mu4e own formatting
doom-modeline-modal nil
doom-modeline-modal-icon nil
doom-modeline-persp-name nil
doom-modeline-persp-icon nil)
(when (require 'doom-modeline nil :noerror)
(doom-modeline-mode +1))
;; Dashboard
(setq initial-buffer-choice 'dashboard-open
dashboard-icon-type 'nerd-icons
dashboard-set-heading-icons t
dashboard-set-file-icons t
dashboard-set-navigator t
dashboard-set-init-info t
dashboard-startup-banner 'ascii
dashboard-projects-backend 'project-el
dashboard-projects-switch-function 'project-switch-project
dashboard-projects-show-base t
dashboard-recentf-show-base 'align
dashboard-items '()
dashboard-banner-ascii (concat " .000000. \n"
" .0. .0. \n"
" .00. .00. \n"
" .000cl. .lc000. \n"
".0 0.\n"
"0. .o0000o. .0\n"
" 00 .0' '0. 00 \n"
" 00 .0 0. 00 \n"
" HHHHH HHHHHHHHHHHH HHHHH \n"
"HHHH HHH HHHHHHHHHHHHHH HHHH\n"
" HHHHHH HHHHHHHHH HHHHHHHH \n"
" HHH HHHH HHHHHHHHH HHHH \n"
" HHH HHHHHH \n"
" HHHHH HH \n"))
(when (require 'dashboard nil :noerror)
(keymap-global-set "C-c d" #'dashboard-open))
;; Extra minor-modes
(when (require 'git-gutter nil :noerror)
(global-git-gutter-mode +1))
(when (require 'which-key nil :noerror)
(which-key-mode +1))
(when (require 'page-break-lines nil :noerror)
(global-page-break-lines-mode +1))
;;;; Help Buffers
;; Make `describe-*' screens more helpful
(when (require 'helpful nil :noerror)
(keymap-set helpful-mode-map "<remap> <revert-buffer>" #'helpful-update)
(keymap-global-set "<remap> <describe-command>" #'helpful-command)
(keymap-global-set "<remap> <describe-function>" #'helpful-callable)
(keymap-global-set "<remap> <describe-key>" #'helpful-key)
(keymap-global-set "<remap> <describe-symbol>" #'helpful-symbol)
(keymap-global-set "<remap> <describe-variable>" #'helpful-variable)
(keymap-global-set "C-h F" #'helpful-function))
;; Bind extra `describe-*' commands
(keymap-global-set "C-h K" #'describe-keymap)
;; add visual pulse when changing focus, like beacon but built-in
;; from from https://karthinks.com/software/batteries-included-with-emacs/
(defun pulse-line (&rest _)
"Pulse the current line."
(pulse-momentary-highlight-one-line (point)))
(dolist (command '(scroll-up-command
scroll-down-command
recenter-top-bottom
other-window))
(advice-add command :after #'pulse-line))
;;; custom-ui-config.el ends here
(setq sendmail-program (executable-find "msmtp")
send-mail-function #'smtpmail-send-it
message-sendmail-f-is-evil t

View file

@ -5,7 +5,6 @@
#+PROPERTY: header-args:emacs-lisp :tangle yes :mkdirp yes :results output silent
* Common defaults
#+BEGIN_SRC emacs-lisp :results output silent
(setq custom-file (locate-user-emacs-file "custom.el"))
(when (and custom-file (file-exists-p custom-file))
@ -71,9 +70,92 @@
#+begin_src emacs-lisp
(when (require 'auth-source nil :noerror)
(setq auth-sources '("secrets:Login"))
(auth-source-pass-enable))
(when (require 'auth-source-pass nil :noerror)
(auth-source-pass-enable)))
#+end_src
** Helpful
#+begin_src emacs-lisp
;; Make `describe-*' screens more helpful
(use-package helpful
:ensure t
:bind (("<remap> <describe-command>" . helpful-command)
("<remap> <describe-function>" . helpful-callable)
("<remap> <describe-key>" . helpful-key)
("<remap> <describe-symbol>" . helpful-symbol)
("<remap> <describe-variable>" . helpful-variable)
("C-h F" . helpful-function)
:map helpful-mode-map
("<remap> <revert-buffer>" . helpful-update)))
;; Bind extra `describe-*' commands
(keymap-global-set "C-h K" #'describe-keymap)
#+end_src
* UI
#+begin_src emacs-lisp
(setq use-dialog-box nil
fill-column 80
truncate-lines nil
truncate-partial-width-windows nil)
(menu-bar-mode -1)
(tab-bar-mode -1)
(tool-bar-mode -1)
(scroll-bar-mode -1)
(line-number-mode)
(global-display-line-numbers-mode -1)
(global-prettify-symbols-mode +1)
(global-visual-line-mode +1)
(use-package which-key
:ensure t
:config (which-key-mode +1))
(use-package page-break-lines
:ensure t
:config (global-page-break-lines-mode +1))
;; add visual pulse when changing focus, like beacon but built-in
;; from from https://karthinks.com/software/batteries-included-with-emacs/
(defun pulse-line (&rest _)
"Pulse the current line."
(pulse-momentary-highlight-one-line (point)))
(dolist (command '(scroll-up-command
scroll-down-command
recenter-top-bottom
other-window))
(advice-add command :after #'pulse-line))
#+end_src
** Theme, font and nerd-icons
#+begin_src emacs-lisp
(set-frame-font "Fira Code-12")
(set-frame-parameter nil 'alpha-background 80)
;; Theme
(use-package modus-themes
:ensure t
:config (load-theme 'modus-vivendi-tinted :noconfirm))
;; Nerd-Icons modes
(use-package nerd-icons
:ensure t
:config (nerd-icons-set-font "Symbols Nerd Font Mono"))
(use-package nerd-icons-dired
:ensure t
:hook (dired-mode))
(use-package nerd-icons-ibuffer
:ensure t
:hook (ibuffer-mode))
(use-package nerd-icons-completion
:ensure t
:config (nerd-icons-completion-mode +1))
#+end_src
** Font ligatures
#+begin_src emacs-lisp
@ -148,6 +230,53 @@
;; per mode with `ligature-mode'.
(global-ligature-mode t))
#+end_src
** Modeline
#+begin_src emacs-lisp
;; Doom-Modeline
(setq doom-modeline-icon t
doom-modeline-mu4e nil ;; Use mu4e own formatting
doom-modeline-modal nil
doom-modeline-modal-icon nil
doom-modeline-persp-name nil
doom-modeline-persp-icon nil)
(use-package doom-modeline
:ensure t
:config (doom-modeline-mode +1))
#+end_src
** Dashboard
#+begin_src emacs-lisp
;; Dashboard
(setq dashboard-icon-type 'nerd-icons
dashboard-set-heading-icons t
dashboard-set-file-icons t
dashboard-set-navigator t
dashboard-set-init-info t
dashboard-startup-banner 'ascii
dashboard-projects-backend 'project-el
dashboard-projects-switch-function 'project-switch-project
dashboard-projects-show-base t
dashboard-recentf-show-base 'align
dashboard-items '()
dashboard-banner-ascii (concat " .000000. \n"
" .0. .0. \n"
" .00. .00. \n"
" .000cl. .lc000. \n"
".0 0.\n"
"0. .o0000o. .0\n"
" 00 .0' '0. 00 \n"
" 00 .0 0. 00 \n"
" HHHHH HHHHHHHHHHHH HHHHH \n"
"HHHH HHH HHHHHHHHHHHHHH HHHH\n"
" HHHHHH HHHHHHHHH HHHHHHHH \n"
" HHH HHHH HHHHHHHHH HHHH \n"
" HHH HHHHHH \n"
" HHHHH HH \n"))
(use-package dashboard
:ensure t
:config (setq initial-buffer-choice 'dashboard-open))
#+end_src
* Org-mode
For reference information, see [[https://orgmode.com][Org-mode website]]
@ -247,120 +376,6 @@ For reference information, see [[https://orgmode.com][Org-mode website]]
For now I'll just copy all config into this file, to confirm that it works properly.
Will reorganise into separate sections later
** TODO UI
#+BEGIN_SRC emacs-lisp
(setq use-dialog-box nil
fill-column 80
truncate-lines nil
truncate-partial-width-windows nil)
(menu-bar-mode -1)
(tab-bar-mode -1)
(tool-bar-mode -1)
(scroll-bar-mode -1)
(line-number-mode)
(global-display-line-numbers-mode -1)
(global-prettify-symbols-mode +1)
(global-visual-line-mode +1)
;; (set-frame-font "FiraCode Nerd Font-12")
;; (set-frame-parameter nil 'alpha-background 80)
;; Nerd-Icons modes
(when (require 'nerd-icons nil :noerror)
(nerd-icons-set-font "Symbols Nerd Font Mono")
(when (require 'nerd-icons-dired nil :noerror)
(add-hook 'dired-mode-hook #'nerd-icons-dired-mode))
(when (require 'nerd-icons-ibuffer nil :noerror)
(add-hook 'ibuffer-mode-hook #'nerd-icons-ibuffer-mode))
(when (require 'nerd-icons-completion nil :noerror)
(nerd-icons-completion-mode)
(when (require 'marginalia nil :noerror)
(add-hook 'marginalia-mode-hook #'nerd-icons-completion-marginalia-setup))))
;; Doom-Modeline
(setq doom-modeline-icon t
doom-modeline-mu4e nil ;; Use mu4e own formatting
doom-modeline-modal nil
doom-modeline-modal-icon nil
doom-modeline-persp-name nil
doom-modeline-persp-icon nil)
(when (require 'doom-modeline nil :noerror)
(doom-modeline-mode +1))
;; Dashboard
(setq initial-buffer-choice 'dashboard-open
dashboard-icon-type 'nerd-icons
dashboard-set-heading-icons t
dashboard-set-file-icons t
dashboard-set-navigator t
dashboard-set-init-info t
dashboard-startup-banner 'ascii
dashboard-projects-backend 'project-el
dashboard-projects-switch-function 'project-switch-project
dashboard-projects-show-base t
dashboard-recentf-show-base 'align
dashboard-items '()
dashboard-banner-ascii (concat " .000000. \n"
" .0. .0. \n"
" .00. .00. \n"
" .000cl. .lc000. \n"
".0 0.\n"
"0. .o0000o. .0\n"
" 00 .0' '0. 00 \n"
" 00 .0 0. 00 \n"
" HHHHH HHHHHHHHHHHH HHHHH \n"
"HHHH HHH HHHHHHHHHHHHHH HHHH\n"
" HHHHHH HHHHHHHHH HHHHHHHH \n"
" HHH HHHH HHHHHHHHH HHHH \n"
" HHH HHHHHH \n"
" HHHHH HH \n"))
(when (require 'dashboard nil :noerror)
(keymap-global-set "C-c d" #'dashboard-open))
;; Extra minor-modes
(when (require 'git-gutter nil :noerror)
(global-git-gutter-mode +1))
(when (require 'which-key nil :noerror)
(which-key-mode +1))
(when (require 'page-break-lines nil :noerror)
(global-page-break-lines-mode +1))
;;;; Help Buffers
;; Make `describe-*' screens more helpful
(when (require 'helpful nil :noerror)
(keymap-set helpful-mode-map "<remap> <revert-buffer>" #'helpful-update)
(keymap-global-set "<remap> <describe-command>" #'helpful-command)
(keymap-global-set "<remap> <describe-function>" #'helpful-callable)
(keymap-global-set "<remap> <describe-key>" #'helpful-key)
(keymap-global-set "<remap> <describe-symbol>" #'helpful-symbol)
(keymap-global-set "<remap> <describe-variable>" #'helpful-variable)
(keymap-global-set "C-h F" #'helpful-function))
;; Bind extra `describe-*' commands
(keymap-global-set "C-h K" #'describe-keymap)
;; add visual pulse when changing focus, like beacon but built-in
;; from from https://karthinks.com/software/batteries-included-with-emacs/
(defun pulse-line (&rest _)
"Pulse the current line."
(pulse-momentary-highlight-one-line (point)))
(dolist (command '(scroll-up-command
scroll-down-command
recenter-top-bottom
other-window))
(advice-add command :after #'pulse-line))
;;; custom-ui-config.el ends here
#+END_SRC
** TODO Email
#+BEGIN_SRC emacs-lisp
(setq sendmail-program (executable-find "msmtp")