summaryrefslogtreecommitdiff
path: root/.stumpwm.d/modeline.lisp
blob: 2701e705c565412821a6058e09a6c6d46e147f9d (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
;; Modeline configuration
(load "~/.stumpwm.d/colors.lisp")
(load-module "battery-portable")

(setf *mode-line-timeout* 2)
(setf *group-format* "%t")
(setf *window-format* "%n: %30t")

;; set modeline colors and highlight
(setf *mode-line-background-color* thanos-hope ;"#252B48"
      *mode-line-foreground-color* thanos-hope-fg
      *mode-line-border-color* thanos-hope
      *mode-line-highlight-template* "«~A»")


(setf *mode-line-border-color* thanos-hope1
      *mode-line-border-width* 2)

(setf *time-modeline-string* "%a %d/%m/%Y | %H:%M")

(setf stumpwm:*screen-mode-line-format*
      (list "%g ^>"
	    "RAM:"
	    '(:eval (string-trim '(#\Newline)
		     (stumpwm:run-shell-command
		      "free | awk '/Mem/ { printf(\"%.2f%\"), $3/$2 * 100.0 }'" t)))
	    "% | CPU:"
	    '(:eval (string-trim '(#\Newline)
		     (stumpwm:run-shell-command
		      "grep 'cpu ' /proc/stat | awk '{usage=($2+$4)*100/($2+$4+$5)} END {printf(\"%.2f\", usage)}'" t)))
	    "% | VOL:"
	    '(:eval (string-trim '(#\Newline)
		     (stumpwm:run-shell-command "amixer sget Master | grep 'Right:' | awk -F'[][]' '{print $2}'" t)))
	    "% | "
	    ;; Check when hermes(laptop) t display battery
	    (when (equal (asdf:hostname) "hermes")
	      "BAT:%B |")
	    "%d"))


(when stumpwm:*initializing*
  (mode-line))