All pastes #427527 Raw Edit

Anonymous

public text v1 · immutable
·published 2007-04-06 20:43 UTC
rendered paste body
;;; to bind a menu on C-t . ;;;
(define-key *root-map* (kbd ".") "mymenu")

;;; the menu command ;;;
(define-stumpwm-command "mymenu" ()
  (labels ((pick (options)
             (let ((selection (stumpwm::select-from-menu (current-screen) options "")))
               (cond
                 ((null selection)
                  (throw 'stumpwm::error "Abort."))
                 ((stringp (second selection))
                  (second selection))
                 (t
                  (pick (cdr selection)))))))
    (let ((choice (pick *app-menu*)))
      (run-shell-command choice))))

;;; the menu contents ;;;

(defparameter *app-menu* '(("INTERNET"
                      ;; sub menu
			    ("Iceweasel" "iceweasel")
			    ("Icedove" "icedove")
			    ("Conkeror-xr" "xulrunner ~/conkeror-xr/src/xulrunner-build/application.ini")
			    ("Gaim" "gaim"))
			   ("FUN"
			    ;; sub menu
			    ("nethack" "xterm -e nethack")
			    ("option 2" "xlogo")
			    ("GnuChess" "xboard")
			    ("FrozenBubble" "frozen-bubble"))
			   ("WORK"
			    ("OpenOffice.org" "openoffice"))
			   ("GRAPHICS"
			    ("GIMP" "gimp"))
			   ("K3B" "k3b")))