about summary refs log tree commit diff
path: root/init/look-and-feel.el
diff options
context:
space:
mode:
authorVincent Ambo <tazjin@gmail.com>2017-12-03T17·36+0100
committerVincent Ambo <tazjin@gmail.com>2017-12-03T17·37+0100
commit443e8ea995e423f6a0795bd88b79164cd816b795 (patch)
tree512fda22df9c9ff8e92fed51a0ceaf545ce7279a /init/look-and-feel.el
parent5b946a930cdcab0d37ad1f06b2c40d43073e67d0 (diff)
feat(look-and-feel): Font-size based on host
My desktop is currently connected to a 4K screen and needs *slightly*
larger fonts for readability.
Diffstat (limited to 'init/look-and-feel.el')
-rw-r--r--init/look-and-feel.el10
1 files changed, 7 insertions, 3 deletions
diff --git a/init/look-and-feel.el b/init/look-and-feel.el
index 59a937a176b4..3229b85a4099 100644
--- a/init/look-and-feel.el
+++ b/init/look-and-feel.el
@@ -17,10 +17,14 @@
   (blink-cursor-mode -1))
 
 ;; Configure editor fonts
-(setq default-frame-alist '((font-backend . "xft")
-                            (font . "Input Mono-12")))
 
-(set-frame-font "Input Mono 12" t t)
+;; Determine fontsize based on machine (4K display on stallo):
+(letrec ((hostname (s-trim (f-read "/etc/hostname")))
+         (font-size (if (equal hostname "stallo") 38 12))
+         (font (format "Input Mono-%d" font-size)))
+  (setq default-frame-alist `((font-backend . "xft")
+                              (font . ,font)))
+  (set-frame-font font t t))
 
 (defun configure-new-frame (frame)
   "Configuration settings to run whenever a new frame is created."