Re: [dwm] dwm/dmenu how to use?

From: Jack J. Woehr <jwoehr_AT_absolute-performance.com>
Date: Wed, 20 Dec 2006 09:32:24 -0700

Michael Muster wrote:
> 1. How to start dmenu?
>
You add a line in config.h which ties a script invoking dmenu to a key
sequence.
Then when you do that key sequence, your script invoking dmenu runs.
> 2. How to create the menu?
I dont' have an installation right here, but I invoke gm4(see above) to
run the following
script when I hit alt-m:

    dnl()divert(-1)

    define(`browser_menu',`esyscmd(`dmenu<<END
    firefox
    mozilla
    END')')

    define(`comms_menu',`esyscmd(`dmenu<<END
    ns400
    tn5250
    x3270
    END')')

    define(`top_menu',`esyscmd(`dmenu<<END
    editors
    browsers
    comms
    ides
    xlock
    END')')

    define(`edit_menu',`esyscmd(`dmenu<<END
    emacs
    gvim
    jedit
    END')')

    define(`ide_menu',`esyscmd(`dmenu<<END
    eclipse
    netbeans
    END')')

    define(`run_menu',
    `define(`$1_menu_pick',$1_menu())
    define(`$1_menu_rcode',sysval())
    ')

    define(`do_browser_menu',`run_menu(`browser')
    ifelse(edit_menu_rcode,`0',`
    ifelse(browser_menu_pick,`firefox',syscmd(`firefox &'),
    browser_menu_pick,`mozilla',syscmd(`mozilla &'),
    `Unknown menu option')')')

    define(`do_comms_menu',`run_menu(`comms')
    ifelse(comms_menu_rcode,`0',`
    ifelse(comms_menu_pick,`ns400',syscmd(`ns400'),
    comms_menu_pick,`tn5250',syscmd(`tn5250&'),
    comms_menu_pick,`x3270',syscmd(`x3270&'),
    `Unknown menu option')')')

    define(`do_edit_menu',`run_menu(`edit')
    ifelse(edit_menu_rcode,`0',`
    ifelse(edit_menu_pick,`emacs',syscmd(`emacs &'),
    edit_menu_pick,`gvim',syscmd(`gvim &'),
    edit_menu_pick,`jedit',syscmd(`jedit &'),
    `Unknown edit menu selection')')')

    define(`run_menus',`run_a_menu(`top'),
    ifelse(`top_menu_rcode', `0',
    ifelse (`top_menu_pick',`editors',`run_menu(`edit'),
    `top_menu_pick',`browsers',`run_menu(`browser'),
    `top_menu_pick',`ides',`run_menu(`ide'),
    `top_menu_pick',`comms',`run_menu(`comm'),
    `top_menu_pick',`xlock',`syscmd(`xlock'),
    `Unknown top menu selection')')')

-- 
Jack J. Woehr
Director of Development
Absolute Performance, Inc.
jwoehr_AT_absolute-performance.com
303-443-7000 ext. 527
Received on Wed Dec 20 2006 - 17:32:08 UTC

This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 14:33:57 UTC