stumpwm/modeline.lisp @ 417f91fae3c2

More
author Steve Losh <steve@stevelosh.com>
date Thu, 28 Mar 2024 16:06:55 -0400
parents ea681bd9c52d
children (none)
(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*
    "%p"

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

      (list "(V %V) ")

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

      ;; temperature
      (list "(TEMP %S) ")

      ;; cpu, mem, time, tray
      (list "(CPU %C) (MEM%M) %d %T")
      ))

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

  (ensure-mode-line))

(configure-modeline)