summaryrefslogtreecommitdiff
path: root/dotfiles-darwin/emacs/functions.el
diff options
context:
space:
mode:
authorGrégoire Duchêne <gduchene@awhk.org>2024-03-02 11:16:14 +0000
committerGrégoire Duchêne <gduchene@awhk.org>2024-03-02 11:16:14 +0000
commitedede428fcde701a334249459f769758b98a1cdd (patch)
treece45385116c15132c6f7c79450e8e949eb08d9a3 /dotfiles-darwin/emacs/functions.el
parentf35b5cc292299279ac9774151e44516b87406523 (diff)
emacs: Move my/macos-dark-p to the macOS dotfiles
Diffstat (limited to 'dotfiles-darwin/emacs/functions.el')
-rw-r--r--dotfiles-darwin/emacs/functions.el6
1 files changed, 6 insertions, 0 deletions
diff --git a/dotfiles-darwin/emacs/functions.el b/dotfiles-darwin/emacs/functions.el
index 938ae97..4a39418 100644
--- a/dotfiles-darwin/emacs/functions.el
+++ b/dotfiles-darwin/emacs/functions.el
@@ -1,5 +1,11 @@
;; -*- lexical-binding: t -*-
+(defun my/macos-dark-p ()
+ "Returns non-nil if macOS is currently in dark mode, nil otherwise."
+ (interactive)
+ (string= (shell-command-to-string "defaults read -g AppleInterfaceStyle")
+ "Dark\n"))
+
(defun my/modify-frame-parameters (parameters &optional frame)
(when (frame-parameter frame 'fullscreen)
(toggle-frame-maximized))