stumpwm-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[STUMP] *apps-map*, to make more room for program shortcuts


From: Edward Trumbo
Subject: [STUMP] *apps-map*, to make more room for program shortcuts
Date: Fri, 20 Feb 2015 14:25:26 -0500

I prefer keyboard shortcuts to menus when it comes to launching
programs, but StumpWM's many default bindings already take up so many of
the ones I want. It occurred to me that if we already have a *group-map*
to hang group-related keybindings off of a prefix key, why not try the
same thing for users to map shortcuts to applications?

I've patched my StumpWM's bindings.lisp to include an *apps-map* and
assigned it to my equivalent of "C-t e". OK, I can already hear the
bellowing from the crowd, "That's our Emacs key, you fool! You fiend!"
Bear with me a moment; Emacs is still there on "C-t e e", just like
XTerm is on "C-t e c". The Ctrl-chorded versions are still there like
always. But by using an extra key to put us into an *apps-map*, we free
up so many more keys users can bind as shortcuts to favorite programs,
without shadowing important StumpWM keys or resorting to menus.

I'll include the patch here so you can see what it looks like, though at
this point I'm more interested in feeling out interest than in seriously
submitting it. So what do you all think -- an idea worth pursuing (as-is
or with changes) or drop it?

---
 bindings.lisp | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/bindings.lisp b/bindings.lisp
index 83c9593..f8186c3 100644
--- a/bindings.lisp
+++ b/bindings.lisp
@@ -25,7 +25,8 @@
 (in-package #:stumpwm)
 
 (export '(*groups-map*
-          *movement-map* 
+          *movement-map*
+          *apps-map*
           *help-map*
          set-prefix-key))
 
@@ -43,6 +44,9 @@ C-t.")
 (defvar *exchange-window-map* nil
   "The keymap that exchange-window key bindings sit on. It is bound to 
@kbd{C-t x} by default.")
 
+(defvar *apps-map* nil
+  "The keymap that application related key bindings sit on. It is bound to 
@kbd{C-t e} by default.")
+
 (defvar *help-map* nil
   "Help related bindings hang from this keymap")
 
@@ -78,9 +82,8 @@ from most specific groups to most general groups.")
   *escape-key* '*root-map*)
 
 (fill-keymap *root-map*
-  (kbd "c")   "exec xterm"
   (kbd "C-c") "exec xterm"
-  (kbd "e")   "emacs"
+  (kbd "e")   '*apps-map*
   (kbd "C-e") "emacs"
   (kbd "b")   "banish"
   (kbd "C-b") "banish"
@@ -233,6 +236,9 @@ from most specific groups to most general groups.")
              (kbd "j")     "exchange-direction down" 
              (kbd "l")     "exchange-direction left" 
              (kbd "h")     "exchange-direction right")    
+(fill-keymap *apps-map*
+  (kbd "e") "emacs"
+  (kbd "c") "exec xterm")
 (fill-keymap *help-map*
   (kbd "v") "describe-variable"
   (kbd "f") "describe-function"
-- 
1.8.4


-- 
Edward Trumbo

"In Emacs Veritas."





reply via email to

[Prev in Thread] Current Thread [Next in Thread]