Recently Written · git

stumpwm-init

I use dwm now. Archived.

git clone https://github.com/equwal/stumpwm-init

Log | Files | Refs


commit b7998e412e5c31aab2e8ea2168b5e4584e08afb7
Spenser Truex <web@spensertruex.com>
2019-12-17 20:34:07 -0800

Prompt on quit, and bind quit

See this pull request adding this to stumpwm:
- https://github.com/stumpwm/stumpwm/pull/676

 config.lisp      | 9 +++++++++
 keybindings.lisp | 2 ++
 2 files changed, 11 insertions(+)
diff --git a/config.lisp b/config.lisp
index 359aec2..07c3f90 100644
--- a/config.lisp
+++ b/config.lisp
@@ -1,6 +1,7 @@
 (in-package #:stumpwm-init)
 
 (defun pushnew-apps (&rest apps)
+  "Keep apps sorted as they are pushed into the app-menu."
   (dolist (app apps)
     (pushnew app
              app-menu::*app-menu*
@@ -21,3 +22,11 @@
 (setf *screen-mode-line-format*
       (list "[^B%n^b] %W^>" "%B | %d"))
 (setf *window-format* "%m%n%s%c")
+
+;; Since this is bound to a key by default in this configuration, it is nice to
+;; warn the user before closing everything. *prompt-on-quit* only exists on the
+;; latest git version as of 2019-12-07, so we need to make sure it exists first.
+(when (apropos :*prompt-on-quit* (find-package :stumpwm) t)
+  ;; FIXME: Should not need to use eval! Or execute the setf around 2021 without
+  ;; the condition above.
+  (eval (read-from-string "(setf stumpwm:*prompt-on-quit* t)")))
diff --git a/keybindings.lisp b/keybindings.lisp
index 81ee16e..8f6eef8 100644
--- a/keybindings.lisp
+++ b/keybindings.lisp
@@ -9,6 +9,8 @@
 (define-key *root-map* (kbd "d") "poison")
 (define-key *root-map* (kbd "B") "browse")
 (define-key *root-map* (kbd "C-y") "show-clipboard-history")
+(define-key *root-map* (kbd "q") "quit")
+
 
 (defvar *movement*
   '(("C-j" . "Down")