From 6eeb770d0022affaf1c8caa192cf32df80ced610 Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Tue, 26 Nov 2013 01:44:34 +0100 Subject: Add keybinding to save current desktop config I don't use it very often, but it's still useful. --- .stumpwmrc | 10 ++++++++++ 1 file changed, 10 insertions(+) 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")) -- cgit v1.2.3-54-g00ecf