changelog shortlog graph tags branches changeset files revisions annotate raw help

Mercurial > core / lisp/lib/gui/wm/x11/stumpwm.lisp

changeset 698: 96958d3eb5b0
parent: da8521b4883e
author: Richard Westhaver <ellis@rwest.io>
date: Fri, 04 Oct 2024 22:04:59 -0400
permissions: -rw-r--r--
description: fixes
1 ;;; gui/wm/x11/stumpwm.lisp --- StumpWM wrappers
2 
3 ;; StumpWM is an excellent X11-based tiling window manager - on most
4 ;; CPU-bound systems running an X Display Server this is our default
5 ;; WM.
6 
7 ;;; Code:
8 (in-package :x11/stumpwm)
9 
10 (defvar *default-modules* '())
11 (defvar *default-prefix-key* (kbd "s-;"))
12 
13 (defvar *user-map* (make-sparse-keymap))
14 (defvar *sudo-map* (make-sparse-keymap))
15 (defvar *nav-map* (make-sparse-keymap))
16 (defvar *toggle-map* (make-sparse-keymap))
17 (defvar *edit-map* (make-sparse-keymap))
18 (defvar *app-map* (make-sparse-keymap))
19 
20 (defun load-swank (&rest args)
21  (apply #'swank-loader:init args))
22 
23 (defun show-kernel ()
24  (let ((ip (run-shell-command "uname -r" t)))
25  (substitute #\Space #\Newline ip)))
26 
27 (defun show-ip-address ()
28  (let ((ip (run-shell-command "ip addr show dev wlan0 | grep 'inet ' | awk '{print $2 }'" t)))
29  (substitute #\Space #\Newline ip)))
30 
31 (defun show-battery-charge ()
32  (let ((raw-battery (run-shell-command "acpi | cut -d, -f2" t)))
33  (substitute #\Space #\Newline raw-battery)))
34 
35 (defun show-battery-state ()
36  (let ((raw-battery (run-shell-command "acpi | cut -d: -f2 | cut -d, -f1" t)))
37  (substitute #\Space #\Newline raw-battery)))
38 
39 (defun show-hostname ()
40  (let ((host-name (run-shell-command "cat /etc/hostname" t)))
41  (substitute #\Space #\Newline host-name)))
42 
43 (defun toggle-mode-line-current ()
44  (toggle-mode-line (current-screen) (current-head)))
45