summary refs log tree commit diff
path: root/emacs/custom/my-ui.el
blob: 9dc08020934b0bdbdfd90cd17fa69d85d3f1518b (plain) (blame)
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
;;; my-ui.el --- configure UI elements -*- lexical-binding: t -*-

;;; Commentary:

;;; Code:

;; cleaning up the UI
(scroll-bar-mode -1)
(tool-bar-mode -1)
(menu-bar-mode -1)
(blink-cursor-mode -1)

(when (memq window-system '(mac ns))
  (add-to-list 'default-frame-alist '(font . "Source Code Pro-15"))
  (add-to-list 'default-frame-alist '(fullscreen . maximized))
  (add-to-list 'default-frame-alist '(ns-appearance . nil))
  (add-to-list 'default-frame-alist '(ns-transparent-titlebar . nil))
  (when (boundp 'ns-use-native-fullscreen)
    (setq ns-use-native-fullscreen nil))
  (when (boundp 'mac-allow-anti-aliasing)
    (setq mac-allow-anti-aliasing t)))

(when (memq window-system '(x pgtk))
  (set-face-attribute 'default nil :font "Iosevka Term Extended" :height 130)
  (set-face-attribute 'variable-pitch nil :font "Iosevka Etoile" :height 130)
  ;; this is a fall back in the case we have Unicode characters.
  ;; For example, with this settings, the following source is
  ;; rendered correctly 😇 😀 and 🤢
  (set-fontset-font t 'symbol "Noto Color Emoji" nil 'append))

;; Load a custom theme
(eval-and-compile
  (require 'modus-themes nil t)
  (setq modus-themes-syntax '(faint)
        modus-themes-links '(bold)
        modus-themes-fringes '(intense)
        modus-themes-markup '(bold intense background)
        modus-themes-italic-constructs t
        modus-themes-lang-checkers '(background)
        modus-themes-org-blocks 'gray-background
        modus-themes-headings '((1 . (background 1))
                                (2 . (rainbow semibold 1))
                                (t . (bold)))
        modus-themes-completions '((matches   . (extrabold intense))
                                   (selection . (semibold  intense))
                                   (popup     . (extrabold intense)))
        modus-themes-operandi-color-overrides '((bg-main . "#f2efe4"))))

(eval-and-compile
  (require 'ef-themes)
  (setq ef-themes-to-toggle '(ef-duo-light ef-duo-dark))
  ;; set the typeface for headers
  (setq ef-themes-headings
      '((0 . (variable-pitch bold 1.4))
        (1 . (variable-pitch bold 1.3))
        (2 . (variable-pitch regular 1.2))
        (3 . (variable-pitch italic 1.1))
        (t . (variable-pitch 1.1))))

  ;; enable using variable pitch fonts for some part of the UI
  (setq ef-themes-mixed-fonts t
        ef-themes-variable-pitch-ui t)

  ;; Read the doc string or manual for this one.  The symbols can be
  ;; combined in any order.
  (setq ef-themes-region '(intense no-extend neutral))

  ;; Disable all other themes to avoid awkward blending:
  (mapc #'disable-theme custom-enabled-themes)

  ;; Load the theme of choice:
  (load-theme 'ef-duo-light :no-confirm)

  ;; OR use this to load the theme which also calls `ef-themes-post-load-hook':
  (ef-themes-select 'ef-duo-light))

(customize-set-variable 'display-time-24hr-format t)
(customize-set-variable 'display-time-day-and-date t)
(customize-set-variable 'display-time-format "%a %e %b, %H:%M")
(customize-set-variable 'display-time-interval 60)
(customize-set-variable 'display-time-default-load-average nil)
(customize-set-variable 'zoneinfo-style-world-list
                        '(("UTC" "UTC")
                          ("America/Los_Angeles" "Berkeley")
                          ("America/Denver" "Mountain Time")
                          ("America/Chicago" "Central Time")
                          ("America/New_York" "New York")
                          ("Europe/London" "London")
                          ("Europe/Paris" "Paris")
                          ("Asia/Calcutta" "Bangalore")
                          ("Asia/Tokyo" "Tokyo")))

;; the following setup only works with emacs >=28 I think
(when (boundp 'world-clock-list)
  (setq world-clock-list t))

(when (boundp 'world-clock-time-format)
  ;; UTC      => 02:42 +0000  Wednesday 20 April
  ;; Berkeley => 19:42 -0700  Tuesday 19 April
  (setq world-clock-time-format "%R %z  %A %d %B"))

(when (boundp 'world-clock-timer-enable)
  (setq world-clock-timer-enable t))

(when (boundp 'world-clock-timer-second)
  (setq world-clock-timer-second 60))

;; Disable help mouse-overs for mode-line as they provide little to no benefits
(setq mode-line-default-help-echo nil
      show-help-function nil)

(setq display-buffer-alist
      `(
        ("\\*\\(.* # Help.*\\|Help\\|xref\\)\\*" ; See the hooks for `visual-line-mode'
         (display-buffer-reuse-mode-window display-buffer-in-side-window)
         (window-width . 0.35)
         (side . left)
         (slot . 0))
        ("\\*\\(Flymake diagnostics\\|Package-Lint\\).*"
         (display-buffer-in-side-window)
         (window-height . 0.16)
         (side . top)
         (slot . 0))
        ("\\*\\(Backtrace\\|Warnings\\|Compile-Log\\|Flymake log\\|Async Shell Command\\)\\*"
         (display-buffer-in-side-window)
         (window-height . 0.16)
         (side . top)
         (slot . 2))
        ("\\*\\(Wo\\)\?Man"
         (display-buffer-in-side-window)
	     (window-width . 0.4)
	     (side . left)
	     (slot . 0))
        ("\\*\\(wclock\\|slo-calculator\\).*"
         (display-buffer-in-side-window)
         (window-width . 0.35)
         (side . left)
         (slot . 0))))

(add-hook 'help-mode-hook 'visual-line-mode)

(provide 'my-ui)
;;; my-ui.el ends here