aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Tom Willemse2013-11-26 01:44:34 +0100
committerGravatar Tom Willemse2013-11-26 01:44:34 +0100
commit6eeb770d0022affaf1c8caa192cf32df80ced610 (patch)
tree9ba9f8c2a0f9af1db47023473077e8ecaf545137
parent4fb35e37da4b9b7e1289d2ec4dbd8fd2e6b972b6 (diff)
downloadstumpwm-6eeb770d0022affaf1c8caa192cf32df80ced610.tar.gz
stumpwm-6eeb770d0022affaf1c8caa192cf32df80ced610.zip
Add keybinding to save current desktop config
I don't use it very often, but it's still useful.
-rw-r--r--.stumpwmrc10
1 files changed, 10 insertions, 0 deletions
diff --git a/.stumpwmrc b/.stumpwmrc
index 0ecc3ee..18227e5 100644
--- a/.stumpwmrc
+++ b/.stumpwmrc
@@ -48,6 +48,11 @@
"Hook run right before the screen gets locked.")
(defvar *screen-unlocked-hook* nil
"Hook run right after the screen is unlocked.")
+(defvar *desktop-bindings*
+ (let ((m (make-sparse-keymap)))
+ (define-key m (kbd "s") "save-desktop-configuration")
+ m)
+ "Special keymap for desktop management commands.")
(defun get-mail-count (mailbox &optional (inbox "inbox"))
"Check how many new messages there are in MAILBOX."
@@ -147,6 +152,10 @@ itself."
"Open URxvt"
(run-or-raise *urxvt-program* '(:class "URxvt")))
+(defcommand save-desktop-configuration () ()
+ "Save the current desktop configuration."
+ (dump-desktop-to-file "~/.stumpwm.d/desktop.lisp"))
+
(defun run-stumpwm-hook-on-exit (process)
"Run `*screen-unlocked-hook*' if PROCESS' status is `:exited'."
(when (eq (sb-ext:process-status process) :exited)
@@ -231,6 +240,7 @@ Run `*lock-screen-hook*' before locking it and run
(define-key *root-map* (kbd "p") "move-focus up")
(define-key *root-map* (kbd "SPC") "next-in-frame")
(define-key *root-map* (kbd "C-z") "other-in-frame")
+(define-key *root-map* (kbd "d") '*desktop-bindings*)
(undefine-key *root-map* (kbd "C-a"))
(undefine-key *root-map* (kbd "C-c"))