diff options
author | mms <michal@sapka.me> | 2024-01-19 15:22:13 +0100 |
---|---|---|
committer | mms <michal@sapka.me> | 2024-01-19 15:22:13 +0100 |
commit | 9ab57ee255a03b86ed7303aa94959e3b104e1719 (patch) | |
tree | 926293dc6d9460f1eab12231573b71abc8d5ac4e /mms-gui.org |
feat: extract into dedicated repo
Diffstat (limited to 'mms-gui.org')
-rw-r--r-- | mms-gui.org | 155 |
1 files changed, 155 insertions, 0 deletions
diff --git a/mms-gui.org b/mms-gui.org new file mode 100644 index 0000000..b7dcdc3 --- /dev/null +++ b/mms-gui.org @@ -0,0 +1,155 @@ +#+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 Adams]]. + +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 135)) + + (defun mms-voyager-laptop-font-mode () + ;; Set fonts for Voyager in clamshell mode + (interactive) + (set-face-attribute 'default nil :font "iosevka" :height 115)) +#+end_src + +* 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 Adams]] uses. + +#+begin_src emacs-lisp + (use-package color-theme-sanityinc-tomorrow + :ensure t) + + (defun mms-dark-room-mode() + (interactive) + (load-theme 'sanityinc-tomorrow-night t) + (set-face-attribute 'region nil :background "#000096") + (set-face-attribute 'mode-line nil :background "black") + (set-face-attribute 'mode-line-inactive nil :background "#444444")) + + (defun mms-light-room-mode () + (interactive) + (load-theme 'sanityinc-tomorrow-day t) + (set-face-attribute 'region nil :background "orange1") + (set-face-attribute 'mode-line nil :background "#cccccc") + (set-face-attribute 'mode-line-inactive nil :background "#888888")) +#+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 'color-theme-sanityinc-tomorrow + (if mms-is-voyager (mms-default-voyager-mode) (mms-default-mac-mode))) +#+end_src + +* Org-mode + +First of all, let's disable presenting emphasis markers + +#+begin_src emacs-lisp + (setq org-hide-emphasis-markers t) +#+end_src + +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 + |