From 0ab13ec1d17cdeacb042b9c935618e9f018d81b0 Mon Sep 17 00:00:00 2001 From: GrĂ©goire DuchĂȘne Date: Sat, 11 Dec 2021 13:03:03 +0000 Subject: emacs: Refactor configuration --- dotfiles-darwin/emacs/init.el | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'dotfiles-darwin') diff --git a/dotfiles-darwin/emacs/init.el b/dotfiles-darwin/emacs/init.el index 44bcda6..184d681 100644 --- a/dotfiles-darwin/emacs/init.el +++ b/dotfiles-darwin/emacs/init.el @@ -1,14 +1,15 @@ -(setq mac-right-option-modifier 'none) +;; General Configuration + +(setq mac-right-command-modifier 'meta + mac-right-option-modifier 'none) (when (executable-find "gls") (setq insert-directory-program "gls")) -(defun macos-dark-p () - (interactive) - (string= (shell-command-to-string "defaults read -g AppleInterfaceStyle") - "Dark\n")) -(add-hook 'after-init-hook - (lambda () - (run-at-time nil (* 15 60) 'maybe-switch-theme awhk-day-theme - awhk-night-theme 'macos-dark-p))) +;; Theme Management + +(when window-system + (my/with-add-hook 'after-init-hook + (run-at-time nil (* 15 60) #'my/maybe-switch-theme my/day-theme + my/night-theme #'my/macos-dark-p))) -- cgit v1.2.3-70-g09d2