aboutsummaryrefslogtreecommitdiff
path: root/stumpwm/.stumpwm.d/style.lisp
blob: a8154d99558dc8922acc7d00606e4aa25e565568 (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
(in-package :stumpwm)

(defparameter *reload-mode-line-p* nil)

(defparameter *menu-prompt* "Select theme:")

(defvar *themes* (make-hash-table :test 'equal))

(defmacro define-theme (name &body body)
  `(setf (gethash ,name *themes*) #'(lambda () ,@body)))

(defun select-from-themes-menu ()
  (when-let* ((items (hash-table-keys *themes*))
              (item (select-from-menu (current-screen) items *menu-prompt*)))
    (gethash (car item) *themes*)))

(defun reloads ()
  (update-color-map (current-screen))
  (when *reload-mode-line-p*
    (mode-line)
    (mode-line)))

(defun themes-menu ()
  (when-let (theme (select-from-themes-menu))
    (funcall theme)
    (reloads)))

(define-theme "Ef Autumn"
  (set-fg-color "#cfbcba")
  (set-bg-color "#0f0e06")
  (set-focus-color "#692a12")
  (set-unfocus-color "#36322f")
  (setf *mode-line-background-color* "#0f0e06"
        *mode-line-foreground-color* "#cfbcba")
  )

(define-theme "Ef Bio"

  (set-fg-color "#cfdfd5")
  (set-bg-color "#111111")
  (set-focus-color "#00552f")
  (set-unfocus-color "#2a3644")
  (setf *mode-line-background-color* "#111111"
        *mode-line-foreground-color* "#cfdfd5")
  )

(define-theme "Gruber Darker"

  (set-fg-color "#e4e4e4")
  (set-bg-color "#181818")
  (set-focus-color "#cc8c3c")
  (set-unfocus-color "#282828")
  (setf *mode-line-background-color* "#181818"
        *mode-line-foreground-color* "#e4e4e4")
  )

(define-theme "Gruvbox"

  (set-fg-color "#ebdbb2")
  (set-bg-color "#1d2021")
  (set-focus-color "#b8bb26")
  (set-unfocus-color "#83a598")
  (setf *mode-line-background-color* "#1d2021"
        *mode-line-foreground-color* "#ebdbb2")
  )

(defcommand theme () () (themes-menu))

(setq *startup-message* (format nil "^bWelcome Home!!!"))

(setf *message-window-padding* 4
      *message-window-y-padding* 4
      *message-window-gravity* :center)

(setf *input-window-gravity* :center)

;;;; Fonts
(ql:quickload "clx-truetype")
(pushnew (concat (getenv "HOME")
                 "/.local/share/fonts/")
         xft:*font-dirs* :test #'string=)
(xft:cache-fonts)

(let ((parent-font "Iosevka Comfy"))
  (when (find parent-font (the list (clx-truetype:get-font-families))
              :test #'string=)
    (load-module "ttf-fonts")
    (set-font `(,(make-instance 'xft:font
                                :family "Iosevka Comfy"
                                :subfamily "Regular"
                                :size 12
                                :antialias t)))
    (mode-line)))