summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAlan Pearce2017-06-01 17:52:17 +0200
committerAlan Pearce2017-06-01 17:52:17 +0200
commitd2347ab4129a975b226aaab0d1d3aba806c5a766 (patch)
tree23946a2f3028b1abc896898f1b5d9f2c3fb2a563
parente2cd7e8101cab293469deb21eb6758ba6b48a9dc (diff)
downloadnixfiles-d2347ab4129a975b226aaab0d1d3aba806c5a766.tar.lz
nixfiles-d2347ab4129a975b226aaab0d1d3aba806c5a766.tar.zst
nixfiles-d2347ab4129a975b226aaab0d1d3aba806c5a766.zip
Emacs: Detect Windows even outside of zsh environment
-rw-r--r--emacs/.emacs.d/init.org13
1 files changed, 10 insertions, 3 deletions
diff --git a/emacs/.emacs.d/init.org b/emacs/.emacs.d/init.org
index a6aecc5a..0719ad8c 100644
--- a/emacs/.emacs.d/init.org
+++ b/emacs/.emacs.d/init.org
@@ -18,6 +18,13 @@ Open Emacs with just a plain window.  No graphics or messages, please!
 (remove-hook 'find-file-hooks #'vc-refresh-state)
 #+END_SRC
 
+Are we running on Windows via the WSL?
+
+#+BEGIN_SRC emacs-lisp
+(when (string-match "Microsoft$" (file-to-string "/proc/sys/kernel/osrelease"))
+    (setq system-type 'gnu/linux/windows))
+#+END_SRC
+
 ** Compatibility
 
 #+BEGIN_SRC emacs-lisp
@@ -227,12 +234,12 @@ because I manage those in my [[file:~/projects/dotfiles/tag-xresources/xresource
             (ap/set-fonts "Monaco" 16 "Lucida Grande" 16 t 0.2)
           (ap/set-fonts "Monoid" 12 "Helvetica Neue" 12 t 0.1))))
      ((and (eq window-system 'x)
-           (not (getenv "windows")))
+           (not (eq system-type 'gnu/linux/windows)))
       (set-fontset-font "fontset-default" 'unicode (font-spec :name "Terminus" :size 18))
       (ap/set-fonts "Terminus" 18 "Lucida" 14 nil))
      ((and (eq window-system 'x)
-           (getenv "windows"))
-      (ap/set-fonts "Noto Mono" 15 "Sans" 15 nil))))
+           (eq system-type 'gnu/linux/windows))
+      (ap/set-fonts "Noto Mono" 15 "Sans" 15 nil)))
 
   (ap/set-fonts-according-to-system))
 #+END_SRC