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