#+TITLE: mms Emacs Config - GUI look and feel #+AUTHOR: MichaƂ Sapka (https://michal.sapka.me) #+STARTUP: showall indent logdone #+HUGO_BASE_DIR: ~/ghq/vcs.sapka.me/michal-sapka-me/ #+HUGO_WEIGHT: 20 #+HUGO_SECTION: emacs/config #+HUGO_CATEGORIES: emacs emacs-config #+HUGO_MENU :menu "emacs-config" :name GUI #+HUGO_CUSTOM_FRONT_MATTER: :abstract "My emacs config - GUI look and feel" #+HUGO_CUSTOM_FRONT_MATTER: :menu-abstract "The way Emacs look in gui mode" #+EXPORT_FILE_NAME: gui Here I set up how emacs looks when in GUI mode. # * Generic thingies Let's start with some basic settings. #+BEGIN_SRC emacs-lisp (tool-bar-mode -1) ; I am not a clicky button person (setq visible-bell nil) ; I am also not a "scream at me" type of guy #+END_SRC * Fonts I like to have readable fonts in all possible situations. I never use two monitors at the same time due to space restrictions, so I just have two modes: clamshell (lid closed, only external display) and laptop (laptop undocked, only internal monitor is in use). Having DPI problems on Xorg is always a thing, so it's easier to have explicit functions. It's not my idea, all credits go to [[https://howardabrams.com/hamacs/ha-display.html][Howard Abrams]]. I use Iosevka font. It's a 2GiB [sic!] download, but I like the way it looks. It is also available for FreeBSD and macOS: #+begin_src shell doas pkg install iosevka # for FreeBSD brew install iosevka # for MacOS #+end_src #+begin_src emacs-lisp (defun mms-mac-clamshell-font-mode () ;; Set fonts for Macbook in clamshell mode (interactive) (set-face-attribute 'default nil :font "iosevka" :height 135)) (defun mms-mac-laptop-font-mode () ;; Set fonts for Macbook in laptop mode (interactive) (set-face-attribute 'default nil :font "iosevka" :height 115)) (defun mms-voyager-clamshell-font-mode () ;; Set fonts for Voyager in clamshell mode (interactive) (set-face-attribute 'default nil :font "iosevka" :height 80)) (defun mms-voyager-laptop-font-mode () ;; Set fonts for Voyager in clamshell mode (interactive) (set-face-attribute 'default nil :font "iosevka" :height 115)) (defun mms-presentation-font-mode () ;; Set fonts for Voyager in clamshell mode (interactive) (set-face-attribute 'default nil :font "iosevka" :height 200)) #+end_src #+RESULTS: : mms-presentation-font-mode * Colors I, like everybody, like pretty colors. I have no idea what it means. All I know is that orange is a fruit, and not a color. This is 1:1 copy of what [[https://howardabrams.com/hamacs/ha-display.html#orgb97059f][Howard Abrams]] uses. #+begin_src emacs-lisp (use-package ef-themes :ensure t) (setq ef-themes-mixed-fonts t ef-themes-variable-pitch-ui t) (setq mms-bright-theme 'ef-spring mms-dark-theme 'ef-autumn) (defun mms-dark-room-mode() (interactive) (load-theme mms-dark-theme t)) (defun mms-light-room-mode () (interactive) (load-theme mms-bright-theme t)) #+end_src * Auto-setup For most of the day I use my work MacBook (and I am just as sad as you are reading it) and I have a window behind me. This makes using dark more impossible for most of the year, so light-room mode is the default there. In the evening I move to my personal computer, and since the Sun is longer the problem (screw you, Sun!) I run dark room as default there. #+begin_src emacs-lisp (defun mms-default-mac-mode () (interactive) (mms-light-room-mode) (mms-mac-clamshell-font-mode)) (defun mms-default-voyager-mode () (interactive) (mms-light-room-mode) (mms-voyager-clamshell-font-mode)) #+end_src Lets auto enable those on Emacs start By default, all devices run in external-monitor mode, so I will call respective function in local configs. #+begin_src emacs-lisp (with-eval-after-load 'ef-themes (if mms-is-voyager (mms-default-voyager-mode) (mms-default-mac-mode))) #+end_src * Org-mode After that - I don't need line numbers #+begin_src emacs-lisp (add-hook 'org-mode-hook (lambda () (mms-hide-line-numbers))) #+end_src Then, let's add nice bullets #+begin_src emacs-lisp (use-package org-bullets :config (add-hook 'org-mode-hook (lambda () (org-bullets-mode 1)))) #+end_src Then, I want my headings to differ only by size. I am no a fan of default xmass tree. #+begin_src emacs-lisp (setq mms-org-font-color (face-foreground 'default nil 'default) mms-org-headline `(:inherit default :weight bold :foreground ,mms-org-font-color) ) (custom-set-faces '(org-level-1 ((t (:inherit mms-org-headline :height 1.75)))) '(org-level-2 ((t (:inherit mms-org-headline :height 1.5)))) '(org-level-3 ((t (:inherit mms-org-headline :height 1.25)))) '(org-level-4 ((t (:inherit mms-org-headline :height 1.1)))) '(org-level-5 ((t (:inherit mms-org-headline :height 1.0)))) `(org-document-title ((t (:inherit mms-org-headline :height 2.0)))) ) #+end_src