emacs: Allow easier theme switching

This commit is contained in:
Charlotte Van Petegem 2024-09-12 23:38:47 +02:00
parent a1f09ed1d0
commit ed6e4913ca
3 changed files with 18 additions and 5 deletions

View file

@ -6,5 +6,9 @@
gc.interval = if config.chvp.base.nix.slowGc then { Hour = 0; Minute = 0; } else { Minute = 0; }; gc.interval = if config.chvp.base.nix.slowGc then { Hour = 0; Minute = 0; } else { Minute = 0; };
settings.sandbox = true; settings.sandbox = true;
}; };
nixpkgs.flake = {
setFlakeRegistry = false;
setNixPath = false;
};
services.nix-daemon.enable = true; services.nix-daemon.enable = true;
} }

View file

@ -137,8 +137,7 @@
}; };
darkModeScripts = { darkModeScripts = {
emacs = '' emacs = ''
emacsclient --eval "(setq catppuccin-flavor 'frappe)" emacsclient --eval "(chvp--dark-mode)"
emacsclient --eval "(load-theme 'catppuccin :no-confirm)"
''; '';
gtk = '' gtk = ''
${pkgs.glib}/bin/gsettings set org.gnome.desktop.interface gtk-theme Catppuccin-Frappe-Compact-Blue-Dark ${pkgs.glib}/bin/gsettings set org.gnome.desktop.interface gtk-theme Catppuccin-Frappe-Compact-Blue-Dark
@ -163,8 +162,7 @@
}; };
lightModeScripts = { lightModeScripts = {
emacs = '' emacs = ''
emacsclient --eval "(setq catppuccin-flavor 'latte)" emacsclient --eval "(chvp--light-mode)"
emacsclient --eval "(load-theme 'catppuccin :no-confirm)"
''; '';
gtk = '' gtk = ''
${pkgs.glib}/bin/gsettings set org.gnome.desktop.interface gtk-theme Catppuccin-Latte-Compact-Blue-Light ${pkgs.glib}/bin/gsettings set org.gnome.desktop.interface gtk-theme Catppuccin-Latte-Compact-Blue-Light

View file

@ -214,7 +214,18 @@
;; Theming ;; Theming
(use-package catppuccin-theme (use-package catppuccin-theme
:custom (catppuccin-flavor 'latte) :custom (catppuccin-flavor 'latte)
:config (load-theme 'catppuccin :no-confirm) :config
(load-theme 'catppuccin :no-confirm)
(defun chvp--dark-mode ()
(interactive)
(progn
(setq catppuccin-flavor 'frappe)
(load-theme 'catppuccin :no-confirm)))
(defun chvp--light-mode ()
(interactive)
(progn
(setq catppuccin-flavor 'latte)
(load-theme 'catppuccin :no-confirm)))
) )
(use-package no-littering (use-package no-littering