stumpwm.stumpwm-contrib/util/app-menu/README.org
2019-11-26 15:49:42 -08:00

1.3 KiB

Application menu for StumpWM

/x11-wm/stumpwm.stumpwm-contrib/media/branch/master/util/app-menu/menu-inaction.png

Usage

(load-module "app-menu")

Define app-menu:*app-menu* in your .stumpwmrc. You can use strings to run shell commands or symbols to run Stumpwm commands (e.g. to popup existing application instead of start new one if applcation is already running).

  (defcommand firefox () ()
    "run firefox"
    (run-or-raise "firefox" '(:class "Firefox")))

  (setq app-menu:*app-menu*
        '(("INTERNET"
           ;; submenu
           ("Firefox" firefox)       ; call stumpwm command
           ("Skype" "skypeforlinux") ; run shell script
           )
          ("WORK"
           ("OpenOffice.org"  "openoffice"))
          ("GRAPHICS"
           ("GIMP" "gimp")
           ("Inkscape" "inkscape"))
          ("urxvt" urxvt)
          ("K3B" "k3b")))

Menus can also be loaded from files:

# Run (app-menu-load-menu-file #P"file") to load in this file.
("INTERNET"
 ;; submenu
 ("Firefox" firefox)
 ("Skype" "skypeforlinux"))

Add show-menu command to your keybindings, e.g.:

(define-key *top-map* (kbd "M-`") "show-menu")

Navigate the menu with C-n, C-p, or just start typing to jump to a matching item.