JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
update config.def.h with my settings, docs
[dwm.git] / config.def.h
1 /* See LICENSE file for copyright and license details. */
2
3 /* appearance */
4 static const char font[]            = "-*-terminus-medium-r-*-*-16-*-*-*-*-*-*-*";
5 static const char normbordercolor[] = "#444444";
6 static const char normbgcolor[]     = "#222222";
7 static const char normfgcolor[]     = "#bbbbbb";
8 static const char selbordercolor[]  = "#005577";
9 static const char selbgcolor[]      = "#005577";
10 static const char selfgcolor[]      = "#eeeeee";
11 static const unsigned int borderpx  = 0;        /* border pixel of windows. leave at 0, use xcompmgr to show focus instead. */
12 static const unsigned int snap      = 32;       /* snap pixel */
13 static const Bool showbar           = True;     /* False means no bar */
14 static const Bool topbar            = True;     /* False means bottom bar */
15
16 /* tagging */
17 static const char *tags[] = { "`", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "[", "]" };
18 static const char *workspace_numbers_str[] = { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12" };
19
20 #define TBC(tag, wclass) { wclass, NULL, NULL, 1 << tag, False, False, -1 },
21 #define TBT(tag, title) { NULL, NULL, title, 1 << tag, False, False, -1 },
22 #define SHBC(tag, wclass) { wclass, NULL, NULL, 1 << tag, False, True, -1 },
23 static const Rule rules[] = {
24         /* xprop(1):
25          *      WM_CLASS(STRING) = instance, class
26          *      WM_NAME(STRING) = title
27          */
28         // Tag By Class
29         TBC( 1, "Chromium")
30         TBC( 1, "Firefox")
31         TBC( 1, "Iceweasel")
32         TBC(10, "Pidgin")
33         // Screen Hog (By class) + tag
34         SHBC( 2, "Inkscape")
35         SHBC( 2, "org-openstreetmap-josm-Main") // Josm (both splash and main window)
36         SHBC( 5, "Gimp")
37         // Tag By Title (matches prefix)
38         // These rules are used to keep terminals in the right workspace accross dwm restarts
39         // Put something like this in your .zshrc:
40         //     function preexec { echo -ne "\033]0;w$WORKSPACE_NUMBER: $1\a"; }
41         //     function precmd { echo -ne "\033]0;w$WORKSPACE_NUMBER: $PWD\a"; }
42         TBT( 1, "w1: ")
43         TBT( 2, "w2: ")
44         TBT( 3, "w3: ")
45         TBT( 4, "w4: ")
46         TBT( 5, "w5: ")
47         TBT( 6, "w6: ")
48         TBT( 7, "w7: ")
49         TBT( 8, "w8: ")
50         TBT( 9, "w9: ")
51         TBT(10, "w10: ")
52         TBT(11, "w11: ")
53         TBT(12, "w12: ")
54 };
55
56 /* layout(s) */
57 static const float mfact      = 0.595; /* factor of master area size [0.05..0.95] */
58 static const int nmaster      = 1;    /* number of clients in master area. This setting probably does nothing */
59 static const Bool resizehints = False; /* True means respect size hints in tiled resizals */
60
61 static const Layout layouts[] = {
62         /* symbol     arrange function */
63         { "   ",      jason_layout },
64         { "Flo",      NULL },    // floating (don't think this gets used ever)
65         { "   ",      monocle }, // symbol is ignored
66 };
67
68 /* key definitions */
69 #define MODKEY Mod4Mask
70 #define TAGKEYS(KEY,TAG) \
71         { MODKEY,                       KEY,      view,           {.ui = 1 << TAG} }, \
72         { MODKEY|ControlMask,           KEY,      toggleview,     {.ui = 1 << TAG} }, \
73         { MODKEY|ShiftMask,             KEY,      tag,            {.ui = 1 << TAG} }, \
74         { MODKEY|ControlMask|ShiftMask, KEY,      toggletag,      {.ui = 1 << TAG} },
75
76 /* helper for spawning shell commands in the pre dwm-5.0 fashion */
77 #define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
78
79 /* commands */
80 static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */
81 //static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", font, "-nb", normbgcolor, "-nf", normfgcolor, "-sb", selbgcolor, "-sf", selfgcolor, NULL };
82 static const char *dmenucmd[] = { "dmenu_run", "-fn", font, "-nb", normbgcolor, "-nf", normfgcolor, "-sb", selbgcolor, "-sf", selfgcolor, NULL };
83 char WORKSPACE_NUMBER[] = "WORKSPACE_NUMBER=00";
84 static const char *termcmd[]  = { "env", (const char *)(&(WORKSPACE_NUMBER[0])), "st", NULL };
85
86 static Key keys[] = {
87         /* modifier                     key        function        argument */
88         { 0,                            XK_F1,     spawn,          {.v = dmenucmd } },
89         { 0,                            XK_F2,     spawn,          {.v = termcmd } },
90         { MODKEY,                       XK_b,      togglebar,      {0} },
91         { MODKEY,                       XK_n,      focusstack,     {.i = +1 } },
92         { MODKEY,                       XK_h,      focusstack,     {.i = 0 } },
93 //      { MODKEY,                       XK_i,      incnmaster,     {.i = +1 } },
94 //      { MODKEY,                       XK_d,      incnmaster,     {.i = -1 } },
95         { MODKEY|ControlMask,           XK_h,      setmfact,       {.f = -0.05} },
96         { MODKEY|ControlMask,           XK_n,      setmfact,       {.f = +0.05} },
97         { MODKEY|ShiftMask,             XK_h,      zoom,           {0} },
98         { MODKEY,                       XK_Tab,    view,           {0} },
99         { MODKEY,                       XK_w,      killclient,     {0} },
100         { MODKEY|ShiftMask,             XK_f,      setlayout,      {.v = &layouts[0]} },
101         { MODKEY|ShiftMask|ControlMask, XK_f,      setlayout,      {.v = &layouts[1]} },
102         { MODKEY,                       XK_f,      setlayout,      {.v = &layouts[2]} },
103 //      { MODKEY,                       XK_space,  setlayout,      {0} },
104         { MODKEY|ShiftMask,             XK_space,  togglefloating, {0} },
105 //      { MODKEY,                       XK_0,      view,           {.ui = ~0 } },
106 //      { MODKEY|ShiftMask,             XK_0,      tag,            {.ui = ~0 } },
107 //      { MODKEY,                       XK_comma,  focusmon,       {.i = -1 } },
108 //      { MODKEY,                       XK_period, focusmon,       {.i = +1 } },
109 //      { MODKEY|ShiftMask,             XK_comma,  tagmon,         {.i = -1 } },
110 //      { MODKEY|ShiftMask,             XK_period, tagmon,         {.i = +1 } },
111         TAGKEYS(                        XK_grave,                  0)
112         TAGKEYS(                        XK_1,                      1)
113         TAGKEYS(                        XK_2,                      2)
114         TAGKEYS(                        XK_3,                      3)
115         TAGKEYS(                        XK_4,                      4)
116         TAGKEYS(                        XK_5,                      5)
117         TAGKEYS(                        XK_6,                      6)
118         TAGKEYS(                        XK_7,                      7)
119         TAGKEYS(                        XK_8,                      8)
120         TAGKEYS(                        XK_9,                      9)
121         TAGKEYS(                        XK_0,                      10)
122         TAGKEYS(                        XK_bracketleft,            11)
123         TAGKEYS(                        XK_bracketright,           12)
124         { MODKEY|ShiftMask,             XK_q,      quit,           {0} },
125 };
126
127 /* button definitions */
128 /* click can be ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */
129 static Button buttons[] = {
130         /* click                event mask      button          function        argument */
131         { ClkLtSymbol,          0,              Button1,        setlayout,      {0} },
132         { ClkLtSymbol,          0,              Button3,        setlayout,      {.v = &layouts[2]} },
133         { ClkWinTitle,          0,              Button2,        zoom,           {0} },
134         { ClkStatusText,        0,              Button2,        spawn,          {.v = termcmd } },
135         { ClkClientWin,         MODKEY,         Button1,        movemouse,      {0} },
136         { ClkClientWin,         MODKEY,         Button2,        togglefloating, {0} },
137         { ClkClientWin,         MODKEY,         Button3,        resizemouse,    {0} },
138         { ClkTagBar,            0,              Button1,        view,           {0} },
139         { ClkTagBar,            0,              Button3,        toggleview,     {0} },
140         { ClkTagBar,            MODKEY,         Button1,        tag,            {0} },
141         { ClkTagBar,            MODKEY,         Button3,        toggletag,      {0} },
142 };
143