Add function to change font based on current resolution

Also, change default themes to dark for a while
This commit is contained in:
Maciej 2020-11-27 20:33:58 +02:00
parent bd676f6e54
commit 81c60f404d
Signed by: maciej
GPG key ID: 41D62D42D3B0D765
2 changed files with 17 additions and 6 deletions

View file

@ -69,7 +69,7 @@ _s_: Swiper
_k_: Kill buffer and window _<left>_: Move left
_h_: Split horizontally _<right>_: Move right
_v_: Split vertically _<up>_: Move up
^^ _<down>_: Move down
_f_: Set font size to screen _<down>_: Move down
^^ _p_: Previous buffer
^^ _n_: Next buffer
"
@ -78,6 +78,7 @@ _v_: Split vertically _<up>_: Move up
("k" kill-buffer-and-window)
("h" split-window-below)
("v" split-window-right)
("f" set-font-to-screen)
("<left>" windmove-left)
("<right>" windmove-right)

View file

@ -17,16 +17,20 @@
;; Disable cursor blinking
(blink-cursor-mode 0)
(load "$HOME/.emacs.d/themes/base16-summerfruit-light-modified-theme" 'f 't)
;; Light themes
(load-theme 'base16-atelier-forest-light t t)
(load-theme 'base16-harmonic-light t t)
;; Dark themes
(load-theme 'base16-solarflare t t)
(load-theme 'base16-snazzy t t)
(if (display-graphic-p)
(progn
(sml/apply-theme 'respectful)
(enable-theme (nth
(random 2)
'(base16-atelier-forest-light base16-harmonic-light))))
'(base16-snazzy base16-solarflare))))
(progn
(defvar base16-theme-256-color-source "base16-shell")
(enable-theme 'base16-atelier-forest-light)))
@ -39,9 +43,15 @@
(set-face-attribute 'default nil :font (format "%s %d" name size))
(set-face-attribute 'mode-line nil :font (format "%s %d" name size)))
;; Set font
;; (set-font "IBM Plex Mono" 16)
(set-font "Hack" 16)
(defun set-font-to-screen ()
"Automatically set font size to suit the monitor."
(interactive)
(if (>= 1080 (x-display-pixel-height))
(set-font "Hack" 13)
(set-font "Hack" 16)))
;; Do it automatically on startup
(set-font-to-screen)
;; Remove ugly black line
(set-face-attribute 'vertical-border nil :foreground