From 1e7224e7b4fd4c342687092f040cc1581fb5bf6a Mon Sep 17 00:00:00 2001 From: Thanos Apollo Date: Tue, 27 Jun 2023 10:14:10 +0300 Subject: stumpwm: Update modeline --- stumpwm.org | 41 ++++++++++++++++++++++++++++++++--------- 1 file changed, 32 insertions(+), 9 deletions(-) (limited to 'stumpwm.org') diff --git a/stumpwm.org b/stumpwm.org index 9d25224..ba27642 100644 --- a/stumpwm.org +++ b/stumpwm.org @@ -206,7 +206,6 @@ (load-module "cpu") (load-module "mpd") (load-module "mem") - ;(load-module "stumptray") (setf *mode-line-timeout* 2) @@ -217,7 +216,7 @@ ,*mode-line-foreground-color* thanos-hope-fg) (setf *mode-line-border-color* thanos-hope1 - ,*mode-line-border-width* 0) + ,*mode-line-border-width* 2) (setf mem::*mem-modeline-fmt* "%a%p" mpd:*mpd-modeline-fmt* "%a - %t" @@ -225,7 +224,6 @@ ,*hidden-window-color* "^**" ,*mode-line-highlight-template* "«~A»") - (when *initializing* (grename "[EMACS]") (gnewbg "[BROWSER]") @@ -239,12 +237,34 @@ (close stream) hostname))) - (if (equal (get-hostname) "zeus") - (setf stumpwm:*screen-mode-line-format* - (list "%g %a%p | ^>" (stumpwm:run-shell-command "date" t))) - - (setf stumpwm:*screen-mode-line-format* - (list "%g | ^> | Battery : %B |" (stumpwm:run-shell-command "date" t)))) + (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))) + "% | CPU:" + '(:eval (string-trim '(#\Newline) + (stumpwm:run-shell-command "exec ~/Developer/scripts/get-cpu.sh" 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") + "BAT:%B |") + '(:eval (string-trim '(#\Newline) + (stumpwm:run-shell-command "exec ~/Developer/scripts/get-weather.sh" t))) + " %d")) +#+end_src +/Note: to trim new line when using shell commands for mode-line use something like this:/ +#+begin_src emacs-lisp :tangle nil + (setf *screen-mode-line-format* + (list + '(:eval (string-trim '(#\Newline) + (run-shell-command "date" t))) + '(:eval (run-shell-command "date" t)))) #+end_src * Keybindings #+begin_src lisp @@ -259,6 +279,9 @@ (define-key *root-map* (kbd "M-r") "restart-hard") (define-key *root-map* (kbd "p") "exec ~/Developer/rofi-pass/rofi-pass") (define-key *root-map* (kbd "f") "float-this") + (define-key *root-map* (kbd "b") "windowlist") + (define-key *root-map* (kbd "d") "delete-window") + (define-key *root-map* (kbd "D") "delete-window-and-frame") (define-key *root-map* (kbd "C-f") "unfloat-this") -- cgit v1.2.3