summaryrefslogtreecommitdiff
path: root/mms-gui.org
blob: 8cb2c1b9fda3f053c525bef62b03436a54cec897 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
#+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)

  (use-package almost-mono-themes
    :ensure t)

  (setq ef-themes-mixed-fonts t
        ef-themes-variable-pitch-ui t)

  (setq mms-bright-theme 'almost-mono-white
        mms-dark-theme 'almost-mono-black)

  (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