added CheckSystemTheme script into config directory

Former-commit-id: 109f8f882e
This commit is contained in:
a. fox 2023-04-20 21:04:14 -04:00
parent 5a451f8722
commit d5200b7a3f
2 changed files with 10 additions and 8 deletions

6
CheckSystemTheme.scpt Normal file
View File

@ -0,0 +1,6 @@
tell application "System Events"
tell appearance preferences
set darkMode to dark mode
log darkMode
end tell
end tell

View File

@ -38,9 +38,7 @@
(defvar enable-dark-theme t)
(defvar face-height 120)
;; got this disabled for now because (macos-theme) always returns dark if
;; the system theme is set to auto :rolling-eyes:
(defvar config-root (file-name-directory (file-truename "~/.emacs")))
(defvar auto-update-macos-theme t)
;;;
@ -356,7 +354,7 @@ ensures disabling all prior loaded themes before changing"
"gets the current macOS window theme
returns either 'dark or 'light"
(let ((theme (shell-command-to-string (concat "osascript " (getenv "HOME") "/Library/Mobile\\ Documents/com~apple~ScriptEditor2/Documents/CheckSystemTheme.scpt"))))
(let ((theme (shell-command-to-string (concat "osascript " config-root "CheckSystemTheme.scpt"))))
(if (string= theme (concat "true" (char-to-string ?\n)))
'dark
'light)))
@ -399,13 +397,11 @@ returns either 'dark or 'light"
(add-to-list 'package-archives
'("melpa" . "http://melpa.org/packages/"))
(eval-when-compile
(add-to-list 'load-path (stringify (file-name-directory
(file-truename "~/.emacs"))
"use-package"))
(add-to-list 'load-path (concat config-root"use-package"))
(require 'use-package))
;; allow for local, git-ignored configurations
(defvar local-file (stringify (file-name-directory (file-truename "~/.emacs")) "local.el"))
(defvar local-file (stringify config-root "local.el"))
;; remove slime stuff
(when (package-installed-p 'slime-company)