-
Notifications
You must be signed in to change notification settings - Fork 1
/
visual.lisp
135 lines (112 loc) · 3.49 KB
/
visual.lisp
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
(in-package :stumpwm)
;;; Visual
(defvar *themes* (make-hash-table))
(defun add-theme (name theme)
(setf (gethash name *themes*) theme))
;;; Colors based off spacemacs-dark-theme for emacs
(defclass theme ()
((fg
:initarg :fg
:type string)
(bg
:initarg :bg
:type string)
(border
:initarg :border
:type string)
(focus
:initarg :focus
:type string)
(unfocus
:initarg :unfocus
:type string)
(mode-line-fg
:initarg :mode-line-fg
:type string)
(mode-line-bg
:initarg :mode-line-bg
:type string)
(mode-line-border
:initarg :mode-line-border
:type string)
(color-map-first
:initarg :color-map-first
:type string)
(color-map-last
:initarg :color-map-last
:type string)))
(defun apply-theme (theme)
(set-fg-color (slot-value theme 'fg))
(set-bg-color (slot-value theme 'bg))
(set-border-color (slot-value theme 'border))
(set-focus-color (slot-value theme 'focus))
(set-unfocus-color (slot-value theme 'unfocus))
(setf *mode-line-foreground-color* (slot-value theme 'mode-line-fg)
*mode-line-background-color* (slot-value theme 'mode-line-bg)
*mode-line-border-color* (slot-value theme 'mode-line-border))
(setf (car *colors*) (slot-value theme 'color-map-first)
(car (last *colors*)) (slot-value theme 'color-map-last))
(update-color-map (current-screen)))
(let ((grey "#292b2e")
(purple "#5d4d7a"))
(add-theme 'spacemacs
(make-instance 'theme
:fg purple
:bg grey
:border purple
:focus purple
:unfocus grey
:mode-line-fg purple
:mode-line-bg grey
:mode-line-border purple
:color-map-first grey
:color-map-last purple)))
(let ((fg "#ebdbb2")
(bg "#282828")
(border "#665c54"))
(add-theme 'gruvbox
(make-instance 'theme
:fg fg
:bg bg
:border border
:focus fg
:unfocus bg
:mode-line-fg fg
:mode-line-bg bg
:mode-line-border border
:color-map-first bg
:color-map-last fg)))
(apply-theme (gethash 'gruvbox *themes*))
;;; Load battery module
;; (load-module "notify")
;; Set notification text color to yellow to make it obvious
;; (in-package :notify)
;; (defun show-notification (app icon summary body)
;; "Show the notification using standard STUMPWM::MESSAGE function"
;; (declare (ignore app icon))
;; (stumpwm:message "^B^[^3*~A ~A^]" summary body))
;; ;;; Start notification server
;; (notify-server-toggle)
;; (load-module :ttf-fonts)
(in-package :stumpwm)
;; (load-module :battery-portable)
;; (ql:quickload :clx-truetype)
;; (load-module "ttf-fonts")
;; (xft:cache-fonts)
;; (set-font (make-instance 'xft:font :family "DejaVu Sans Mono" :subfamily "Bold" :slant "r" :size 10))
;; (defun get-utc-time ()
;; (subseq (run-shell-command "date -u +%H:%M" t) 0 5))
;; Show time, cpu usage and network traffic in the modelinecomment
(setf *screen-mode-line-format*
(list "%W"))
(setf *window-format* "%n %10c: %15t")
;;; When windows are desroyed window numbers are not synced
;;; 2kays <https://github.com/2kays> posted a solution on
;;; the TipsAndTricks section of the wiki
;;; This will repack window numbers every time a window is killed
(stumpwm:add-hook stumpwm:*destroy-window-hook*
#'(lambda (win) (stumpwm:repack-window-numbers)))
;; Turn on the modeline
(mapcar (lambda (head)
(toggle-mode-line (current-screen) head))
(screen-heads (current-screen)))