/* See LICENSE file for copyright and license details. */

/* appearance */
static const char font[]            = "-*-terminus-medium-r-normal-*-12-*-*-*-*-*-*-*";
static const char normbordercolor[] = "#000000";
static const char normbgcolor[]     = "#dddddd";
static const char normfgcolor[]     = "#000000";
static const char selbordercolor[]  = "#dddddd";
static const char selbgcolor[]      = "#000000";
static const char selfgcolor[]      = "#dddddd";
static const unsigned int borderpx        = 0;        /* border pixel of windows */
static const unsigned int snap            = 16;       /* snap pixel */
static const Bool showbar                 = False;     /* False means no bar */
static const Bool topbar                  = True;     /* False means bottom bar */

/* tagging */
static const char *tags[] = { "0", "1", "2","3", "4", "5", "6", "7", "8", "9", "10" };

static Rule rules[] = {
	/* class      instance    title       tags mask     isfloating */
	{ "Gimp",     NULL,       NULL,       0,            True },
	{ "Firefox",  NULL,       NULL,       1 << 5,       True },
	{ "MPlayer",	NULL,		NULL,		0,		True }, \
	{ "xine",	NULL,		NULL,		0,		True }, \
	{ "Xsane",	NULL,		NULL,		0,	True }, \
	{ "GQview",	NULL,		NULL,		0,		True }, \
	{ "xmms",	NULL,		NULL,		0,		True }, \
	{ "Quodlibet",	NULL,		NULL,		1 << 8,	True }, \
	{ "Alsaplayer", NULL,		NULL,		0,		True }, \
	{ "Gecko",	NULL,		NULL,		0,		True }, \
	{ "Mozilla",	NULL,		NULL,		0,		True }, \
	{ "navigator:browser",	NULL,		NULL,		1 << 5,		True }, \
	{ "bookmarks:manager",  NULL,           NULL,           0,              True }, \
    	{ "Download:Manager",   NULL,           NULL,           0,              True }, \
	{ "Navigator",	NULL,		NULL,		0,		True }, \
	{ "Extension",	NULL,		NULL,		0,		True }, \
	{ "Firefox-bin",	NULL,		NULL,		0,		True }, \
	{ "Seamonkey-bin",	NULL,		NULL,		1 << 6,		True }, \
	{ "SeaMonkey",	NULL,		NULL,		0,		True }, \
	{ "Iceweasel-bin",	NULL,		NULL,		0,		True }, \
	{ "Iceweasel",	NULL,		NULL,		1 << 5,		True }, \
	{ "Shiretoko",	NULL,		NULL,		1 << 5,		True }, \
	{ "gFTP",	NULL,		NULL,		1 << 6,		True }, \
	{ "Xchat",	NULL,		NULL,		1 << 9,		True }, \
	{ "Browser",	NULL,		NULL,		0,		True }, \
	{ "Kazehakase",	NULL,		NULL,		0,		True }, \
	{ "Liferea",	NULL,		NULL,		0,		True }, \
	{ "OpenOffice.org 3.0",	NULL,		NULL,		1 << 4,		True }, \
	{ "OpenOffice.org 3.1",	NULL,		NULL,		1 << 4,		True }, \
	{ "OpenOffice.org 2.4",	NULL,		NULL,		1 << 4,		True }, \
	{ "Texmaker",	NULL,		NULL,		1 << 4,		True }, \
	{ "Abiword",	NULL,		NULL,		0,		True }, \
	{ "Evince",	NULL,		NULL,		0,		True }, \
	{ "GV",		NULL,		NULL,		0,		True }, \
	{ "Xpdf",	NULL,		NULL,		0,		True }, \
	{ "Epdfview",	NULL,		NULL,		0,		True }, \
	{ "Aumix",	NULL,		NULL,		0,		True }, \
	{ "Nicotine",	NULL,		NULL,		1 << 8,		True }, \
	{ "XClock",	NULL,		NULL,		0,		True }, \
	{ "Streamtuner",	NULL,		NULL,		1 << 8,	True }, \
	{ "Geany",	NULL,		NULL,		0,		True }, \
	{ "Xmessage",	NULL,		NULL,		0,		True }, \
	{ "Audacity",	NULL,		NULL,		0,		True }, \
	{ "Sylpheed",	NULL,		NULL,		0,		True }, \
	{ "frame",	NULL,		NULL,		0,		True }, \
	{ "dialog",	NULL,		NULL,		0,		True }, \
	{ "Totem",	NULL,		NULL,		0,		True }, \
	{ "Claws-mail",	NULL,		NULL,		0,		True }, \
	{ "Audacious",	NULL,		NULL,		0,		True }, \
	{ "Tea",	NULL,		NULL,		0,		True }, \
	{ "Gtkdialog",	NULL,		NULL,		0,		True }, \
	{ "Xdialog",	NULL,		NULL,		0,		True }, \
	{ "XCalc",	NULL,		NULL,		0,		True }, \
	{ "Gcalctool",	NULL,		NULL,		0,		True }, \
	{ "Ogle",	NULL,		NULL,		0,		True }, \
	{ "Avidemux",	NULL,		NULL,		1 << 8,		True }, \
	{ "Gvim",	NULL,		NULL,		0,		True }, \
	{ "GNU IceCat",	NULL,		NULL,		0,		True }, \
	{ "Dillo",	NULL,		NULL,		0,		True }, \
	{ "Fltk",	NULL,		NULL,		0,		True }, \
	{ "Emacs",	NULL,		NULL,		0,		True }, \
       	{ "SWT",	NULL,		NULL,		0,		True }, \
	{ "Hydrogen",	NULL,		NULL,		0,		True }, \
	{ "hydrogen",	NULL,		NULL,		0,		True }, \
	{ "Geeqie",	NULL,		NULL,		0,		True }, \
	{ "geeqie",	NULL,		NULL,		0,		True }, \
        { "Midori",     NULL,           NULL,           0,              True }, \
};

/* layout(s) */
static const float mfact      = 0.55; /* factor of master area size [0.05..0.95] */
static const Bool resizehints = True; /* False means respect size hints in tiled resizals */

static const Layout layouts[] = {
	/* symbol     arrange function */
	{ "[]=",      tile },    /* first entry is default */
	{ "><>",      NULL },    /* no layout function means floating behavior */
	{ "[M]",      monocle },
};

/* key definitions */
#define MODKEY Mod4Mask
#define TAGKEYS(KEY,TAG) \
	{ MODKEY,                       KEY,      view,           {.ui = 1 << TAG} }, \
	{ MODKEY|ControlMask,           KEY,      toggleview,     {.ui = 1 << TAG} }, \
	{ MODKEY|ShiftMask,             KEY,      tag,            {.ui = 1 << TAG} }, \
	{ MODKEY|ControlMask|ShiftMask, KEY,      toggletag,      {.ui = 1 << TAG} },

/* helper for spawning shell commands in the pre dwm-5.0 fashion */
#define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }

/* commands */
static const char *dmenucmd[] = { "dmenu_run", "-fn", font, "-nb", normfgcolor, "-nf", normbgcolor, "-sb", selfgcolor, "-sf", selbgcolor, NULL };
static const char *termcmd[]  = { "urxvt", NULL };

static Key keys[] = {
	/* modifier                     key        function        argument */
	{ MODKEY,                       XK_p,      spawn,          {.v = dmenucmd } },
	{ MODKEY|ShiftMask,             XK_Return, spawn,          {.v = termcmd } },
	{ MODKEY,                       XK_b,      togglebar,      {0} },
	{ MODKEY,                       XK_j,      focusstack,     {.i = +1 } },
	{ MODKEY,                       XK_k,      focusstack,     {.i = -1 } },
	{ MODKEY,                       XK_less,      focusstack,     {.i = -1 } },
	{ MODKEY|ShiftMask,             XK_less,      focusstack,     {.i = +1 } },
	{ MODKEY,            			XK_w,      focusstack,     {.i = +1 } },
	{ MODKEY,                       XK_h,      setmfact,       {.f = -0.05} },
	{ MODKEY,                       XK_l,      setmfact,       {.f = +0.05} },
	{ MODKEY,                       XK_d,      setmfact,       {.f = -0.05} },
	{ MODKEY,                       XK_g,      setmfact,       {.f = +0.05} },
	{ MODKEY,                       XK_KP_Subtract,	setmfact,       {.f = -0.05} },
	{ MODKEY,                       XK_KP_Add,	setmfact,       {.f = +0.05} },
	{ MODKEY,                       XK_Return, zoom,           {0} },
	{ MODKEY,                       XK_Tab,    view,           {0} },
	/*{ MODKEY|Mod1Mask,              XK_space,    view,           {0} },*/\
	{ MODKEY|ShiftMask,             XK_c,      killclient,     {0} },
	{ MODKEY,             			XK_c,      killclient,     {0} },
	{ MODKEY,                       XK_t,      setlayout,      {.v = &layouts[0]} },
	{ MODKEY,						XK_f,      setlayout,      {.v = &layouts[1]} },
	{ MODKEY,                       XK_m,      setlayout,      {.v = &layouts[2]} },
	{ MODKEY,                       XK_Escape,      togglefloating, {0} },
	{ MODKEY|ShiftMask,             XK_space,  setlayout,      {0} },
	{ MODKEY,            			XK_space,  togglefloating, {0} },
	{ MODKEY,                       XK_a,      view,           {.ui = ~0 } },
	{ MODKEY|ShiftMask,             XK_a,      tag,            {.ui = ~0 } },
	{ MODKEY,                       XK_comma,  focusmon,       {.i = -1 } },
	{ MODKEY,                       XK_period, focusmon,       {.i = +1 } },
	{ MODKEY|ShiftMask,             XK_comma,  tagmon,         {.i = -1 } },
	{ MODKEY|ShiftMask,             XK_period, tagmon,         {.i = +1 } },
	{ MODKEY,                       XK_parenright,      view,           {.ui = ~0 } },
	{ MODKEY|ShiftMask,             XK_parenright,      tag,            {.ui = ~0 } },
	{ MODKEY,                       XK_KP_Multiply,      view,           {.ui = ~0 } },
	{ MODKEY|ShiftMask,             XK_KP_Multiply,      tag,            {.ui = ~0 } },
	TAGKEYS(                        XK_oe,                      0)
	TAGKEYS(                        XK_ampersand,                      1)
	TAGKEYS(                        XK_eacute,                      2)
	TAGKEYS(                        XK_quotedbl,                      3)
	TAGKEYS(                        XK_apostrophe,                      4)
	TAGKEYS(                        XK_parenleft,                      5)
	TAGKEYS(                        XK_minus,                      6)
	TAGKEYS(                        XK_egrave,                      7)
	TAGKEYS(                        XK_underscore,                      8)
	TAGKEYS(                        XK_ccedilla,                      9)
	TAGKEYS(                        XK_KP_Insert,                      0)
	TAGKEYS(                        XK_KP_End,                      1)
	TAGKEYS(                        XK_KP_Down,                      2)
	TAGKEYS(                        XK_KP_Next,                      3)
	TAGKEYS(                        XK_KP_Left,                      4)
	TAGKEYS(                        XK_KP_Begin,                      5)
	TAGKEYS(                        XK_KP_Right,                      6)
	TAGKEYS(                        XK_KP_Home,                      7)
	TAGKEYS(                        XK_KP_Up,                      8)
	TAGKEYS(                        XK_KP_Prior,                      9)
	TAGKEYS(                        XK_KP_Delete,                      10)
	TAGKEYS(                        XK_dead_circumflex,                      9)
	TAGKEYS(                        XK_dollar,                      8)
	TAGKEYS(                        XK_comma,                      4)
	TAGKEYS(                        XK_semicolon,                      5)
	TAGKEYS(                        XK_colon,                      6)
	TAGKEYS(                        XK_exclam,                      7)
	TAGKEYS(                        XK_agrave,                      10)
	TAGKEYS(                        XK_q,                      0)
	TAGKEYS(                        XK_s,                      1)
	TAGKEYS(                        XK_ugrave,                      2)
	TAGKEYS(                        XK_asterisk,                      3)
	{ MODKEY|ShiftMask,             XK_End,      quit,           {0} },
};

/* button definitions */
/* click can be a tag number (starting at 0),
 * ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */
static Button buttons[] = {
	/* click                event mask      button          function        argument */
	{ ClkLtSymbol,          0,              Button1,        setlayout,      {0} },
	{ ClkLtSymbol,          0,              Button3,        setlayout,      {.v = &layouts[2]} },
	{ ClkWinTitle,          0,              Button2,        zoom,           {0} },
	{ ClkStatusText,        0,              Button2,        spawn,          {.v = termcmd } },
	{ ClkClientWin,         MODKEY,         Button1,        movemouse,      {0} },
	{ ClkClientWin,         MODKEY,         Button2,        togglefloating, {0} },
	{ ClkClientWin,         MODKEY,         Button3,        resizemouse,    {0} },
	{ ClkTagBar,            0,              Button1,        view,           {0} },
	{ ClkTagBar,            0,              Button3,        toggleview,     {0} },
	{ ClkTagBar,            MODKEY,         Button1,        tag,            {0} },
	{ ClkTagBar,            MODKEY,         Button3,        toggletag,      {0} },
};



syntax highlighted by Code2HTML, v. 0.9.1