Re: [README] Proposed list of new default keybindings

From: Vegard Vesterheim <vegard vesterheim uninett no>
Subject: Re: [README] Proposed list of new default keybindings
Date: Thu, 12 Feb 2009 14:54:24 +0100

> those in other applications. The extreme flexibility and extensibility
> in sawfish is one of the reasons I am still using it.

I agree. I hate WM's which steals the key-bindings that I use in emacs
all the time, e.g. M-space in metacity which is the just-one-space
command in emacs.

I love the flexibility in sawfish, but I hope that the number of
hard-coded and default key bindings are kept at a minimum. 

BTW: I've written the following lisp snippet so that I can bind
menu-of-emacs to H-1 and menu-of-xterm to H-2 (or whatever you
prefer). This way I get a popup menu of emacs windows or xterm
windows. I find this very useful as I can get straight to my most
frequently used windows without a lot of tabbing etc.

(bind-keys global-keymap
           "H-1" 'menu-of-emacs
           "H-2" 'menu-of-xterm

(provide 'menu-of)
(require 'sawfish.wm.menus)

(defun wm-class-is (w class)
  (equal (aref (get-x-text-property w 'WM_CLASS) 1) class))

(defun emacs-p (w)
  (wm-class-is w "Emacs"))

(defun xterm-p (w)
  (wm-class-is w "XTerm"))

(defun popup-menu-of (pred)
  "make popup windows of a certain type"
   (mapcar #'(lambda (w) 
               (list (window-name w) 
                     (lambda () 
                       (uniconify-window w)
                       (x-raise-window w)
                       (set-input-focus w))))
           (filter pred (managed-windows)))))

(defun menu-of-emacs ()
  "make a popup menu of emacs windows"
  (popup-menu-of emacs-p))

(defun menu-of-xterm ()
  "make a popup menu of xterm windows"
  (popup-menu-of xterm-p))


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