Make rendering in terminal a bit prettier

This commit is contained in:
Jeremy Dormitzer 2019-08-19 13:36:09 -04:00
parent 90ff924c3b
commit abb6dcf86c

View File

@ -1011,9 +1011,45 @@ Display the column number in programming modes:
(add-hook 'prog-mode-hook #'column-number-mode)
#+END_SRC
Load up some tasty themes:
Render stuff differently based on whether or not we are graphical:
#+BEGIN_SRC emacs-lisp
(use-package solarized-theme)
(defun graphical-setup ()
(when (display-graphic-p (selected-frame))
(message "Running graphically")
(use-package solarized-theme)))
(defun non-graphical-setup ()
(when (not (display-graphic-p (selected-frame)))
(message "Running in terminal")
(menu-bar-mode -1)))
(defun do-graphical-non-graphical-setup ()
(graphical-setup)
(non-graphical-setup))
(add-hook 'window-setup-hook #'do-graphical-non-graphical-setup)
#+END_SRC
Try to make the background normal colored in the terminal:
#+BEGIN_SRC emacs-lisp
(defvar no-background-in-tty-faces '(default line-number))
(defun on-frame-open (frame)
(unless (display-graphic-p frame)
(menu-bar-mode -1)
(dolist (face no-background-in-tty-faces)
(set-face-background face "unspecified" frame))))
(mapc #'on-frame-open (frame-list))
(add-hook 'after-make-frame-functions #'on-frame-open)
(defun on-after-init ()
(unless (display-graphic-p (selected-frame))
(dolist (face no-background-in-tty-faces)
(set-face-background face "unspecified" (selected-frame)))))
(add-hook 'window-setup-hook #'on-after-init)
#+END_SRC
UI-related keybindings: