summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThanos Apollo <[email protected]>2023-08-22 05:44:46 +0300
committerThanos Apollo <[email protected]>2023-08-22 05:44:46 +0300
commite35c285e81e9415c891d58ffb6dab49bf42f6613 (patch)
treeca7511302312d795a35e3417eede94e96058697e
parent4b7f3dc1b77940d038d27752711163bb46973a87 (diff)
stumpwm: update modeline
-rw-r--r--stumpwm.org20
1 files changed, 9 insertions, 11 deletions
diff --git a/stumpwm.org b/stumpwm.org
index a35d83e..f5e09c9 100644
--- a/stumpwm.org
+++ b/stumpwm.org
@@ -231,34 +231,32 @@
,*mode-line-border-width* 2)
(when *initializing*
- (grename "[EMACS]")
- (gnewbg "[BROWSER]")
+ (grename "[ALPHA]")
+ (gnewbg "[BETA]")
+ (gnewbg "[GAMMA]")
+ (gnewbg "[DELTA]")
(gnewbg "[LAMBDA]"))
(clear-window-placement-rules)
(setf *dynamic-group-master-split-ratio* 1/2)
- (defun get-hostname ()
- (with-open-file (stream "/etc/hostname")
- (let ((hostname (read-line stream)))
- (close stream)
- hostname)))
-
(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 "exec ~/Developer/scripts/get-ram.sh" t)))
+ (stumpwm:run-shell-command
+ "free | awk '/Mem/ { printf(\"%.2f%\"), $3/$2 * 100.0 }'" t)))
"% | CPU:"
'(:eval (string-trim '(#\Newline)
- (stumpwm:run-shell-command "exec ~/Developer/scripts/get-cpu.sh" t)))
+ (stumpwm:run-shell-command
+ "grep 'cpu ' /proc/stat | awk '{usage=($2+$4)*100/($2+$4+$5)} END {printf \"%.2f%\n\", usage}'"t)))
"% | VOL:"
'(:eval (string-trim '(#\Newline)
(stumpwm:run-shell-command "pamixer --get-volume" t)))
"% | "
;; Check when hermes(laptop) t display battery
- (when (equal (get-hostname) "hermes")
+ (when is-hermes
"BAT:%B |")
"%d"))
(mode-line)