From 64c531330fd314b98988d96deab8fce73477ffa5 Mon Sep 17 00:00:00 2001 From: Riyyi Date: Fri, 14 Aug 2020 22:33:42 +0200 Subject: [PATCH] Add HiDPI detection to config.org --- .config/emacs/config.org | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.config/emacs/config.org b/.config/emacs/config.org index 6a069e1..54fc6d7 100644 --- a/.config/emacs/config.org +++ b/.config/emacs/config.org @@ -123,6 +123,12 @@ Variables for directories, leader keys, etc. (defvar dot/shell "/bin/zsh" "Command interpreter binary path.") + + (defvar dot/hidpi + (let (resolution) + (setq resolution (nthcdr 3 (assoc 'geometry (car (display-monitor-attributes-list))))) + (>= (* (car resolution) (car (cdr resolution))) (* 2560 1440))) + "Return t if the primary screen is HiDPI, nil otherwise.") #+END_SRC * Customizations @@ -279,7 +285,7 @@ Emacs mode line replacement. #+BEGIN_SRC emacs-lisp (use-package telephone-line :custom - (telephone-line-height 20) + (telephone-line-height (if dot/hidpi 20 18)) (telephone-line-lhs '((evil . (telephone-line-evil-tag-segment)) (accent . (telephone-line-erc-modified-channels-segment @@ -315,7 +321,7 @@ Places buffers as tabs in a bar at the top. :after all-the-icons :demand :custom - (centaur-tabs-height 26) + (centaur-tabs-height (if dot/hidpi 26 18)) (centaur-tabs-modified-marker "•") (centaur-tabs-set-icons t) (centaur-tabs-set-modified-marker t)