e579160d33c234050e50542d8809a57e590530cb
[dwm.git] / config.def.h
1 /* See LICENSE file for copyright and license details. */
2
3 /* appearance */
4 static const char font[] = "Latin Modern Mono 9";
5 static const char normbordercolor[] = "#444444";
6 static const char normbgcolor[] = "#000022";
7 static const char normfgcolor[] = "#ddaaff";
8 static const char selbordercolor[] = "#aa00aa";
9 static const char selbgcolor[] = "#000022";
10 static const char selfgcolor[] = "#ffffff";
11 static const unsigned int borderpx = 1; /* border pixel of windows */
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 static const Bool statusmarkup = True; /* True means use pango markup in status message */
16
17 /* tagging */
18 static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };
19
20 static const Rule rules[] = {
21 /* class instance title tags mask isfloating monitor */
22 { "Gimp", NULL, NULL, 1 << 3, False, -1 },
23 { "fontforge", NULL, NULL, 1 << 2, True, -1 },
24 { "Iceweasel", NULL, NULL, 1 << 4, False, -1 },
25 { "Firefox", NULL, NULL, 1 << 4, False, -1 },
26 { "Emacs", NULL, NULL, 1, False, -1 },
27 { "Pidgin", NULL, NULL, 1 << 5, False, -1 },
28 };
29
30 /* layout(s) */
31 static const float mfact = 0.66; /* factor of master area size [0.05..0.95] */
32 static const int nmaster = 1; /* number of clients in master area */
33 static const Bool resizehints = False; /* True means respect size hints in tiled resizals */
34
35 static const Layout layouts[] = {
36 /* symbol arrange function */
37 { "[M]", monocle },
38 { "[]=", tile }, /* first entry is default */
39 { "><>", NULL }, /* no layout function means floating behavior */
40 };
41
42 /* key definitions */
43 #define MODKEY Mod4Mask
44 #define TAGKEYS(KEY,TAG) \
45 { MODKEY, KEY, view, {.ui = 1 << TAG} }, \
46 { MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \
47 { MODKEY|ShiftMask, KEY, tag, {.ui = 1 << TAG} }, \
48 { MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG} },
49
50 /* helper for spawning shell commands in the pre dwm-5.0 fashion */
51 #define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
52
53 /* commands */
54 static const char *dmenucmd[] = { "dmenu_run", "-fn", font, "-nb", normbgcolor, "-nf", normfgcolor, "-sb", selbgcolor, "-sf", selfgcolor, NULL };
55 static const char *termcmd[] = { "x-terminal-emulator", NULL };
56 static const char *lockcmd[] = { "slock", NULL };
57 static const char *sshadd[] = { "ssh-add-x", NULL}; /* add .ssh/id_rsa to the ssh agent */
58 /* run rsync on the server's maildir. Run ssh-add before doing this.*/
59 static const char *getmail[] = { "/home/gpcf/software/mail/getmail.sh", NULL};
60 /* run script that sends emails over ssh */
61 static const char *sendmail[] = { "/home/gpcf/software/mail/sendmail.sh", NULL};
62
63 static Key keys[] = {
64 /* modifier key function argument */
65 { MODKEY, XK_a, spawn, {.v = sshadd} },
66 { MODKEY, XK_s, spawn, {.v = sendmail} },
67 { MODKEY, XK_g, spawn, {.v = getmail} },
68 { MODKEY, XK_x, spawn, {.v = dmenucmd } },
69 { MODKEY|ShiftMask, XK_l, spawn, {.v = lockcmd } },
70 { MODKEY, XK_e, findwindow, {.v= "Emacs"} },
71 { MODKEY, XK_p, findwindow, {.v= "Pidgin"} },
72 { MODKEY|ShiftMask, XK_Return, spawn, {.v = termcmd } },
73 { MODKEY, XK_b, togglebar, {0} },
74 { MODKEY, XK_j, focusstack, {.i = +1 } },
75 { MODKEY, XK_k, focusstack, {.i = -1 } },
76 { MODKEY, XK_i, incnmaster, {.i = +1 } },
77 { MODKEY, XK_d, incnmaster, {.i = -1 } },
78 { MODKEY, XK_h, setmfact, {.f = -0.05} },
79 { MODKEY, XK_l, setmfact, {.f = +0.05} },
80 { MODKEY, XK_Return, zoom, {0} },
81 { MODKEY, XK_Tab, view, {0} },
82 { MODKEY|ShiftMask, XK_c, killclient, {0} },
83 { MODKEY, XK_t, setlayout, {.v = &layouts[1]} },
84 { MODKEY, XK_f, setlayout, {.v = &layouts[2]} },
85 { MODKEY, XK_m, setlayout, {.v = &layouts[0]} },
86 { MODKEY, XK_space, setlayout, {0} },
87 { MODKEY|ShiftMask, XK_space, togglefloating, {0} },
88 { MODKEY, XK_0, view, {.ui = ~0 } },
89 { MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } },
90 { MODKEY, XK_comma, focusmon, {.i = -1 } },
91 { MODKEY, XK_period, focusmon, {.i = +1 } },
92 { MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } },
93 { MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } },
94 { MODKEY, XK_w, list_clients, {0} },
95 TAGKEYS( XK_1, 0)
96 TAGKEYS( XK_2, 1)
97 TAGKEYS( XK_3, 2)
98 TAGKEYS( XK_4, 3)
99 TAGKEYS( XK_5, 4)
100 TAGKEYS( XK_6, 5)
101 TAGKEYS( XK_7, 6)
102 TAGKEYS( XK_8, 7)
103 TAGKEYS( XK_9, 8)
104 { MODKEY|ShiftMask, XK_q, quit, {0} },
105 };
106
107 /* button definitions */
108 /* click can be ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */
109 static Button buttons[] = {
110 /* click event mask button function argument */
111 { ClkLtSymbol, 0, Button1, setlayout, {0} },
112 { ClkLtSymbol, 0, Button3, setlayout, {.v = &layouts[2]} },
113 { ClkWinTitle, 0, Button2, zoom, {0} },
114 { ClkStatusText, 0, Button2, spawn, {.v = termcmd } },
115 { ClkClientWin, MODKEY, Button1, movemouse, {0} },
116 { ClkClientWin, MODKEY, Button2, togglefloating, {0} },
117 { ClkClientWin, MODKEY, Button3, resizemouse, {0} },
118 { ClkTagBar, 0, Button1, view, {0} },
119 { ClkTagBar, 0, Button3, toggleview, {0} },
120 { ClkTagBar, MODKEY, Button1, tag, {0} },
121 { ClkTagBar, MODKEY, Button3, toggletag, {0} },
122 };
123
124 static const char *dwmfifo = "/tmp/dwm.fifo";
125 static Command commands[] = {
126 { "dmenu", spawn, {.v = dmenucmd} },
127 { "term", spawn, {.v = termcmd} },
128 { "togglebar", togglebar, {0} },
129 { "focusstack+", focusstack, {.i = +1} },
130 { "focusstack-", focusstack, {.i = -1} },
131 { "incnmaster+", incnmaster, {.i = +1} },
132 { "incnmaster-", incnmaster, {.i = -1} },
133 { "setmfact+", setmfact, {.f = +0.05} },
134 { "setmfact-", setmfact, {.f = -0.05} },
135 { "zoom", zoom, {0} },
136 { "view", view, {0} },
137 { "killclient", killclient, {0} },
138 { "setlayout-tiled", setlayout, {.v = &layouts[0]} },
139 { "setlayout-float", setlayout, {.v = &layouts[1]} },
140 { "setlayout-mono", setlayout, {.v = &layouts[2]} },
141 { "togglelayout", setlayout, {0} },
142 { "togglefloating", togglefloating, {0} },
143 { "viewall", view, {.ui = ~0} },
144 { "tag", tag, {.ui = ~0} },
145 { "focusmon+", focusmon, {.i = +1} },
146 { "focusmon-", focusmon, {.i = -1} },
147 { "tagmon+", tagmon, {.i = +1} },
148 { "tagmon-", tagmon, {.i = -1} },
149 { "view1", view, {.ui = 1 << 0} },
150 { "view2", view, {.ui = 1 << 1} },
151 { "view3", view, {.ui = 1 << 2} },
152 { "view4", view, {.ui = 1 << 3} },
153 { "view5", view, {.ui = 1 << 4} },
154 { "view6", view, {.ui = 1 << 5} },
155 { "view7", view, {.ui = 1 << 6} },
156 { "view8", view, {.ui = 1 << 7} },
157 { "view9", view, {.ui = 1 << 8} },
158 { "toggleview1", toggleview, {.ui = 1 << 0} },
159 { "toggleview2", toggleview, {.ui = 1 << 1} },
160 { "toggleview3", toggleview, {.ui = 1 << 2} },
161 { "toggleview4", toggleview, {.ui = 1 << 3} },
162 { "toggleview5", toggleview, {.ui = 1 << 4} },
163 { "toggleview6", toggleview, {.ui = 1 << 5} },
164 { "toggleview7", toggleview, {.ui = 1 << 6} },
165 { "toggleview8", toggleview, {.ui = 1 << 7} },
166 { "toggleview9", toggleview, {.ui = 1 << 8} },
167 { "tag1", tag, {.ui = 1 << 0} },
168 { "tag2", tag, {.ui = 1 << 1} },
169 { "tag3", tag, {.ui = 1 << 2} },
170 { "tag4", tag, {.ui = 1 << 3} },
171 { "tag5", tag, {.ui = 1 << 4} },
172 { "tag6", tag, {.ui = 1 << 5} },
173 { "tag7", tag, {.ui = 1 << 6} },
174 { "tag8", tag, {.ui = 1 << 7} },
175 { "tag9", tag, {.ui = 1 << 8} },
176 { "toggletag1", toggletag, {.ui = 1 << 0} },
177 { "toggletag2", toggletag, {.ui = 1 << 1} },
178 { "toggletag3", toggletag, {.ui = 1 << 2} },
179 { "toggletag4", toggletag, {.ui = 1 << 3} },
180 { "toggletag5", toggletag, {.ui = 1 << 4} },
181 { "toggletag6", toggletag, {.ui = 1 << 5} },
182 { "toggletag7", toggletag, {.ui = 1 << 6} },
183 { "toggletag8", toggletag, {.ui = 1 << 7} },
184 { "toggletag9", toggletag, {.ui = 1 << 8} },
185 };
186