Re: run a shell command interactively



William Xu <william.xwl <at> gmail.com> writes:
>
> Hi people,
> 
> Is there a sawfish command, which will pop up a small shell command
> line, in which i can type some command there and execute. I thought
> there used to be some key to invoke this, but i can't call it back.

I do the following which uses the sawfish prompt function (I bind it to C-t C-!
to keep it similar to emacs):

(require 'sawfish.wm.util.prompt)

(defvar jh-exec-history (list)
  "List of previously executed items.")

(defun jh-prompt-for-exec ()
  (let ( (e (prompt-from-list jh-exec-history "Execute: " nil t)))
    (delete e jh-exec-history)
    (when (and e (not (string= "" e)))
      (setq jh-exec-history (append (list e) jh-exec-history))
      (system (concat e "&")))))

jason





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