stumpwm/modeline.lisp @ dedc81b8510c

Diagram
author Steve Losh <steve@stevelosh.com>
date Tue, 19 Mar 2024 14:06:36 -0400
parents 4673e928c08e
children ea681bd9c52d
(in-package :stumpwm-user)

(defun ensure-mode-line ()
  (when (not (stumpwm::head-mode-line (current-head)))
    (toggle-mode-line (current-screen) (current-head))))


(defun configure-modeline ()
  (setf
    *time-modeline-string*
    "%a %b %e %H:%M"

    cpu::*cpu-usage-modeline-fmt*
    "^[~A~3D%^]"

    cpu::*cpu-modeline-fmt*
    "[%c] [%f]"

    mem::*mem-modeline-fmt*
    "%b"

    *screen-mode-line-format*
    (append
      (list "[^B"
            '(:eval (princ-to-string (group-number (current-group))))
            ":%n^b@%h] %W^>")

      #+todo-some-day (list ;; "(V "
                            ;; ;; '(:eval (volume))
                            ;; ")"
                            " ")

      ;; battery and brightness for laptops
      (hostcase
        ((:gro :juss)
         '("(B %B)"
           " (BR "
           (:eval (princ-to-string (brightness)))
           "%)")))

      ;; temp, cpu, mem, time, tray
      #+no (list "(TEMP %S) (CPU %C) (MEM %M) %d %T")
      (list "(CPU %C) (MEM %M) %d %T")
      ))

  (setf *mode-line-timeout* 10)
  (setf *mode-line-background-color* "#111111")

  (ensure-mode-line))

(configure-modeline)