UP | HOME

Theme Configuration

Table of Contents


Custom Faces

This section contains custom set faces.

Change Calfw Grid Color

When using Calfw, the default grid color does not show very well when using the Droom theme doom-outrun-electric. The following will change it to a color that will be easier to see.

(custom-theme-set-faces
 'user
  '(cfw:face-grid ((t (:foreground "magenta")))))

Default Font

Change the default font to use Source Code Pro if it is available.

(custom-theme-set-faces
 'user
 '(default ((t (:family "Source Code Pro" :foundry "outline" :slant normal :weight normal :height 100 :width normal)))))

Fixed and Variable Pitch Fonts

To make Mixed Pitch mode visually appealing, the fonts variable-pitch and fixed-pitch can be set. If Emacs is used on multiple operating systems, the fonts can be specified per operating system using a conditional cond statement. The code below will use different fonts for a Windows system versus a GNU/Linux system.

(cond ((eq system-type 'windows-nt)
       (custom-theme-set-faces
        'user
        '(variable-pitch ((t (:family "Times New Roman"))))
        '(fixed-pitch ((t (:family "Source Code Pro"))))))
      ((eq system-type 'gnu/linux)
      (custom-theme-set-faces
       'user
       '(variable-pitch ((t (:family "Source Serif Pro"))))
       '(fixed-pitch ((t (:family "Source Code Pro")))))))

Sunrise Comnmander Faces

Some of the faces in Sunrise Commander do not appear well in Doom themes. The following configuration changes these fonts to look better with the doom-outrun-electric theme.

(custom-theme-set-faces
 'user
 '(sr-active-path-face ((t (:foreground "yellow" :weight bold :height 120))))
 '(sr-highlight-path-face ((t (:background "yellow" :foreground "dark violet" :weight bold :height 120))))
 '(sr-passive-path-face ((t (:foreground "lightgray" :weight bold :height 120)))))

Display Time

This will display the time in the Emacs mode line. This can be very useful if task bars are hidden on the desktop or working from a text-only terminal.

(use-package time
  :defer 3
  :custom
  (display-time-and-date t)
  :config
  (display-time-mode t))

When I am running Emacs with EXWM as my window manager, I want to be able to see the date and time. Since this is a nice feature to have in EXWM and does not detract much from the overall experience of Emacs, I might as well turn it on all the time.

(display-time-and-date t)

Doom Themes

I have switched to the Doom theme doom-outrun-electric because I find the colors appealing and it has been easier to configure than my earlier attempts to configure a Spacemacs-like theme.

(use-package doom-themes
  :straight t
  :if window-system
  :defer 1
  :config
  (load-theme 'doom-outrun-electric t)
  (doom-themes-org-config))

Doom Modeline

The Doom Modeline decorates the modeline with icons and cleans up much of the clutter in the modeline. An example of the Doom Modeline is below.

./screenshots/doom-modeline.png

(use-package doom-modeline
  :straight t
  :if window-system
  :defer 1
  :config (doom-modeline-mode))

Menu Bar, Scroll Bar, and Tool Bar

Turn off the menu bar, scroll bar, and tool bar because it looks so darn cool and I tend to use the keyboard for everything now anyways.

(use-package menu-bar
  :straight (:type built-in)
  :config
  (menu-bar-mode -1))
(use-package tool-bar
  :straight (:type built-in)
  :config
  (tool-bar-mode -1))
(use-package scroll-bar
  :straight (:type built-in)
  :config
  (toggle-scroll-bar -1))

Mixed Pitch

Mixed pitch mode is a package that makes it easy to use a combination of fixed-width and variable-width fonts in the same buffer. I use this with Org Mode to use different file types for prose and and for source code blocks.

(use-package mixed-pitch
  :straight t
  :hook
  (org-mode . mixed-pitch-mode))

Nyan Mode

Nyan-mode displays a nyan cat on the mode line that shows progress through a buffer.

(use-package nyan-mode
  :straight t
  :if window-system
  :defer 3
  :init
  ;; Requires mplayer to play the music
  (whicher "mplayer")
  :custom
  (nyan-wavy-trail t)
  :config
  (nyan-mode)
  (nyan-start-animation))

End

(provide 'freemacs-theme)

;;; freemacs-theme.el ends here

Date: Time-stamp: <2022-07-21 Thu 18:25>

Author: Thomas Freeman

Created: 2022-07-21 Thu 18:26

Validate