Skip to content

Instantly share code, notes, and snippets.

@offby1
Created June 23, 2015 22:12
Show Gist options
  • Select an option

  • Save offby1/decf412c8ffc53390ddb to your computer and use it in GitHub Desktop.

Select an option

Save offby1/decf412c8ffc53390ddb to your computer and use it in GitHub Desktop.
(defun set-approporiate-font (frame)
(when (eq window-system 'ns)
(global-set-key (kbd "M-`") 'other-frame)
(set-frame-font
(cond
((= (display-pixel-height) 1440)
;; fancy iMac at work
"Inconsolata-20")
((= (display-pixel-height) 2240)
;; fancy monitor at home
"Inconsolata-24")
;; laptop at home
(t
"Source Code Pro-15")
)
nil
(list frame))))
(add-to-list 'after-make-frame-functions 'set-approporiate-font)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment