Themeing my Emacs
provide 'cce/appearance) (
I generally prefer dark and muted colors for the computers that I use. Barring e-paper, modern displays are forced to be needlessly bright for most conditions because of poorly glass displays perform under bright light. Dark themes work to off-set this, or at least that's the placebo effect. At least for me, it leads to far less intense light stimulation, especially when paired with follow-the-sun display tuning through Clight.
Right now, I am experimenting with using some themes from the Doom Themes or ef-themes repositories, trying to find an earthy natural theme which I can use also on my web sites.
I load a dark theme and a light theme, manegarm
and acario-light
ef-autumn
and ef-spring
ef-bio
and ef-cyprus
respectively.
load custom-file)
(
use-package ef-themes
(t
:ensure
:demand
:config'ef-bio t)
(load-theme 'ef-cyprus t t)) (load-theme
I don't use my mouse very often so things like icon-bars and scroll-bars aren't useful to me. The modeline contains the buffer's progress, and I don't actually use the scrollbar to navigate. This leaves a tiny bit more room for the fringe and the buffers, which I consider a win.
0)
(menu-bar-mode when (functionp 'tool-bar-mode) (tool-bar-mode 0))
(when (functionp 'scroll-bar-mode) (scroll-bar-mode 0))
(
(column-number-mode -1)
(line-number-mode -1)setq x-stretch-cursor t)
(setq visible-bell t)
("diminish"
(with-eval-after-load 'buffer-face-mode)
(diminish 'evil-collection-unimpaired-mode)) (diminish
Set
cursor for each evil-state
based on Doom
Theme colors
Use the Doom Themes colors for cursors… I'm doing this myself because the Emacs state is the same as the Normal Mode state is the same, which isn't great!!
defmacro cce/extract-doom-color (state color shape)
(setq ,(intern (concat "evil-" (symbol-name state) "-state-cursor"))
`(list ,(elt (alist-get color (ef-themes--current-theme-palette)) 0) ,shape)))
(
'box)
(cce/extract-doom-color emacs yellow 'box)
(cce/extract-doom-color normal blue-cooler 'box)
(cce/extract-doom-color visual green-warmer 'box)
(cce/extract-doom-color insert yellow-warmer replace yellow-warmer 'hollow)
(cce/extract-doom-color 'hollow) (cce/extract-doom-color operator blue-warmer
Setting Emacs font default preferences, tweaking face attributes
Here is a set of functions for CCE which set up my font preferences based on the specifics of the computer I am using, and set a font which scales to the DPI to roughly 0.25 inch pitch. This uses functionality from External Display Test Functions to intuit which displays are in play.
'prog-mode-hook (lambda () (variable-pitch-mode -1)))
(add-hook 'text-mode-hook (lambda () (variable-pitch-mode 1)))
(add-hook
require 'cl))
(eval-when-compile (defun cce/set-font-scale (size)
("nWhat font size do you want? ")
(interactive 'mode-line nil :inherit 'fixed-pitch :height (+ 10 size))
(set-face-attribute
(lexical-let ((size size))'org (set-face-attribute 'org-block nil :inherit 'fixed-pitch))
(with-eval-after-load 'linum (set-face-attribute 'linum nil :inherit 'default :height size)))
(with-eval-after-load 'default nil :height size)
(set-face-attribute ;; (set-face-attribute 'fixed-pitch nil)
'variable-pitch nil :slant 'oblique :height size)
(set-face-attribute / size 3))) (cce/enable-ipaex-font (
Tweak font scaling based on display DPI
This calculates the DPI of external displays, assuming they report
their physical size to RandR
. Evaluating
this requires my Japanese Study module
to load, I should reorganize these and add a #+ARROYO_MODULE_WANTS
sooner rather than
later…
'after-cce-hook #'cce/refresh-display-scale)
(add-hook use-package dash)
(defun cce/refresh-display-scale ()
(
(interactive)cond ((not (cce/has-display-frames)) nil)
(equal (system-name) "window-smoke") (cce/set-font-scale 110))
((equal (system-name) "rose-quine") (cce/set-font-scale 125))
((equal (system-name) "virtuous-cassette") (cce/set-font-scale 125))
((
((cce/external-display-connected) (-> (cce/external-display-dpis)first)
(cdr)
(* 0.80)
(floor)
(
(cce/set-font-scale)))equal (system-name) "tres-ebow") (cce/set-font-scale 125))
((equal (system-name) "solitary-living") (cce/set-font-scale 105))
((equal (system-name) "MeadowCrush") (cce/set-font-scale 110))
((t (cce/set-font-scale 105)))) (
Toggle Bright/Dark Theme in Emacs, KDE and FireFox
Installing free fonts fonts in My NixOS configuration
I use Vulfpeck Fonts, mostly, but have some other "standard" free fonts installed.
{ pkgs, lib, ... }:
{
fonts = {
fontDir.enable = true;
fontconfig.enable = true;
packages = [
pkgs.noto-fonts
pkgs.noto-fonts-cjk(pkgs.nerdfonts.override {
fonts = [
"DejaVuSansMono"
"DroidSansMono"
"FiraCode"
"OpenDyslexic"
"SourceCodePro"
"Terminus"
];
})
pkgs.xkcd-font];
};
}
DONE remove the dpi hack
https://github.com/NixOS/nixpkgs/pull/133303
KDE Default Appearance Configuration using declarative kwriteconfig5
These are some reasonable defaults for KDE applications, extracted from this table and placed in to a Nix derivation and compiled in to a home-manager configuration with Arroyo.
file | group | key | value | <30> |
---|---|---|---|---|
kwinrc | Compositing | OpenGLIsUnsafe | false | |
dolphinrc | General | FilterBar | true | Ctrl-i bound here by default |
dolphinrc | General | BrowseThroughArchives | true | Browse in to zip, etc; I use "Extract To" context menu option for
full extraction instead of invoking ark |
dolphinrc | General | ConfirmClosingMultipleTabs | false | Always fresh Dolphin |
dolphinrc | General | RememberOpenedTabs | false | Always fresh Dolphin |
kdeglobals | General | fixed | Vulf Mono,10,-1,5,50,0,0,0,0,0 | Vulfpeck Fonts are Fun |
kdeglobals | General | font | Vulf Sans,10,-1,5,50,0,0,0,0,0 | Vulfpeck Fonts are Fun |
kdeglobals | General | menuFont | Vulf Sans,10,-1,5,50,0,0,0,0,0 | Vulfpeck Fonts are Fun |
kdeglobals | General | smallestReadableFont | Vulf Sans,8,-1,5,50,0,0,0,0,0 | Vulfpeck Fonts are Fun |
kdeglobals | General | toolbarFont | Vulf Sans,8,-1,5,50,0,0,0,0,0 | Vulfpeck Fonts are Fun |
kdeglobals | General | activeFont | Vulf Sans,8,-1,5,50,0,0,0,0,0 | Vulfpeck Fonts are Fun |
breezerc | Windeco | ButtonSize | ButtonSmall | |
breezerc | Windeco Exception 0 | Enabled | true | Hide window decorations |
breezerc | Windeco Exception 0 | ExceptionPattern | .* | Hide window decorations |
breezerc | Windeco Exception 0 | ExceptionType | 1 | Hide window decorations |
breezerc | Windeco Exception 0 | Mask | 0 | Hide window decorations |
breezerc | Windeco Exception 0 | BorderSize | 0 | Hide window decorations |
breezerc | Windeco Exception 0 | HideTitleBar | true | Hide window decorations |
This table is transformed in to entries in a Nix attrset
here:
(->> tblapply (apply-partially #'format "%s.\"%s\".\"%s\" = \"%s\"; # %s") it))
(--map ("\n")) (s-join
And inserted in to a kconfig
generator
here:
{ pkgs, config, ... }:
{
home.activation.kconfigAppearance = pkgs.lib.mkKwriteConfig5 config {
appearance_str()>>
<<};
}