summaryrefslogtreecommitdiff
path: root/.config/stumpwm/modeline.lisp
blob: 43dfb9a94f9a4665b5dec2ec17030012e16cdc03 (about) (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

;; Modeline
(setf *window-format* "%m%n%s%c")
(setf *screen-mode-line-format* (list "%g ^> %d"))

(enable-mode-line (current-screen) (current-head) t)

(setf *mode-line-timeout* 2)

(setf *time-modeline-string* "%F %H:%M")

(setf *group-format* "%t")

(setf *window-format* "%n: %30t")

(load "~/.config/stumpwm/colors.lisp")

(setf *mode-line-background-color* phundrak-nord1
      *mode-line-foreground-color* phundrak-nord5)

(setf *mode-line-border-color* phundrak-nord1
      *mode-line-border-width* 0)

;; (defvar *mode-line-formatter-list*
;;   '(("%g") ("%W") ("^>") ("mu-unread" . t) ("%m") ("%C") ("%M") ("%B") ("%d"))
;;   "List of formatters for the modeline.")


;; (defun generate-modeline (elements &optional not-invertedp rightp)
;;   "Generate a modeline for StumpWM.
;; ELEMENTS should be a list of `cons'es which `car' is the modeline
;; formatter or the shell command to run, and their `cdr' is either nil
;; when the `car' is a formatter and t when it is a shell command."
;;   (when elements
;;     (cons (format nil
;;                   " ^[~A^]^(:bg \"~A\") "
;;                   (format nil "^(:fg \"~A\")^(:bg \"~A\")^f1~A^f0"
;;                           (if (xor not-invertedp rightp) phundrak-nord1 phundrak-nord3)
;;                           (if (xor not-invertedp rightp) phundrak-nord3 phundrak-nord1)
;;                           (if rightp "" ""))
;;                   (if not-invertedp phundrak-nord3 phundrak-nord1))
;;           (let* ((current-element (car elements))
;;                  (formatter       (car current-element))
;;                  (commandp        (cdr current-element)))
;;             (cons (if commandp
;;                       `(:eval (run-shell-command ,formatter t))
;;                     (format nil "~A" formatter))
;;                   (generate-modeline (cdr elements)
;;                                      (not not-invertedp)
;;                                      (if (string= "^>" (caar elements)) t rightp)))))))

;; (defcommand reload-modeline () ()
;;   "Reload modeline."
;;   (sb-thread:make-thread
;;    (lambda ()
;;      (setf *screen-mode-line-format*
;;            (cdr (generate-modeline *mode-line-formatter-list*))))))

;; (reload-modeline)