|Scripts quick access edit this|
Access menus via a prompt with tab completion.
This provides the
prompt-menu function which gives you access to a menu via the prompt system. This gives you a sort of hierarchical command-line interface to sawfish commands.
NOTE: this supersedes the old
prext script. For now, this version only works with a sawfish compiled from the git repository. If you want to use it with an older sawfish try Prext.
Put the file in your lisp directory and:
Use this however you'd like. You could bind the root menu to a key:
(bind-keys global-keymap "H-r" '(prompt-menu root-menu "Menu: "))
But you can do more interesting things too. For example, I have something like to this in my
(defun ssh (user host #!optional title) (system (concat "xterm " (and title (concat "-title '" title"' ")) "-e ssh " user "@" host " &"))) (defvar ssh-menu '(("host1" (ssh "username" "host1.example.org" "Host #1")) ("host2" (ssh "username" "host2.example.org" "Host #2")))) (define-command 'ssh (lambda () (prompt-menu ssh-menu "ssh: "))) (bind-keys global-keymap "H-s" 'ssh)
Then when I hit hyper-s I'm given an "ssh: " prompt which tab completes on a list of hostnames, and I can use it to open up an ssh to that host.