Added `findemacs` function to focus an emacs frame.
[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[] = "#ddff00";
8 static const char selbordercolor[] = "#000088";
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[] = { "one", "two", "three", "four", "five" };
19
20 static const Rule rules[] = {
21 /* class instance title tags mask isfloating monitor */
22 { "Gimp", NULL, NULL, 1 << 3, True, -1 },
23 { "Iceweasel", NULL, NULL, 1 << 4, False, -1 },
24 { "Firefox", NULL, NULL, 1 << 4, False, -1 },
25 { "Emacs", NULL, NULL, 1, False, -1 },
26 };
27
28 /* layout(s) */
29 static const float mfact = 0.66; /* factor of master area size [0.05..0.95] */
30 static const int nmaster = 1; /* number of clients in master area */
31 static const Bool resizehints = False; /* True means respect size hints in tiled resizals */
32
33 static const Layout layouts[] = {
34 /* symbol arrange function */
35 { "[M]", monocle },
36 { "[]=", tile }, /* first entry is default */
37 { "><>", NULL }, /* no layout function means floating behavior */
38 };
39
40 /* key definitions */
41 #define MODKEY Mod4Mask
42 #define TAGKEYS(KEY,TAG) \
43 { MODKEY, KEY, view, {.ui = 1 << TAG} }, \
44 { MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \
45 { MODKEY|ShiftMask, KEY, tag, {.ui = 1 << TAG} }, \
46 { MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG} },
47
48 /* helper for spawning shell commands in the pre dwm-5.0 fashion */
49 #define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
50
51 /* commands */
52 static const char *dmenucmd[] = { "dmenu_run", "-fn", font, "-nb", normbgcolor, "-nf", normfgcolor, "-sb", selbgcolor, "-sf", selfgcolor, NULL };
53 static const char *termcmd[] = { "x-terminal-emulator", NULL };
54 static const char *lockcmd[] = { "slock", NULL };
55 static const char *sshadd[] = { "ssh-add-x", NULL}; /* add .ssh/id_rsa to the ssh agent */
56 /* run rsync on the server's maildir. Run ssh-add before doing this.*/
57 static const char *getmail[] = { "/home/gpcf/software/mail/getmail.sh", NULL};
58 /* run script that sends emails over ssh */
59 static const char *sendmail[] = { "/home/gpcf/software/mail/sendmail.sh", NULL};
60
61 static Key keys[] = {
62 /* modifier key function argument */
63 { MODKEY, XK_a, spawn, {.v = sshadd} },
64 { MODKEY, XK_s, spawn, {.v = sendmail} },
65 { MODKEY, XK_g, spawn, {.v = getmail} },
66 { MODKEY, XK_x, spawn, {.v = dmenucmd } },
67 { MODKEY|ShiftMask, XK_l, spawn, {.v = lockcmd } },
68 { MODKEY, XK_e, findemacs, {0} },
69 { MODKEY|ShiftMask, XK_Return, spawn, {.v = termcmd } },
70 { MODKEY, XK_b, togglebar, {0} },
71 { MODKEY, XK_j, focusstack, {.i = +1 } },
72 { MODKEY, XK_k, focusstack, {.i = -1 } },
73 { MODKEY, XK_i, incnmaster, {.i = +1 } },
74 { MODKEY, XK_d, incnmaster, {.i = -1 } },
75 { MODKEY, XK_h, setmfact, {.f = -0.05} },
76 { MODKEY, XK_l, setmfact, {.f = +0.05} },
77 { MODKEY, XK_Return, zoom, {0} },
78 { MODKEY, XK_Tab, view, {0} },
79 { MODKEY|ShiftMask, XK_c, killclient, {0} },
80 { MODKEY, XK_t, setlayout, {.v = &layouts[1]} },
81 { MODKEY, XK_f, setlayout, {.v = &layouts[2]} },
82 { MODKEY, XK_m, setlayout, {.v = &layouts[0]} },
83 { MODKEY, XK_space, setlayout, {0} },
84 { MODKEY|ShiftMask, XK_space, togglefloating, {0} },
85 { MODKEY, XK_0, view, {.ui = ~0 } },
86 { MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } },
87 { MODKEY, XK_comma, focusmon, {.i = -1 } },
88 { MODKEY, XK_period, focusmon, {.i = +1 } },
89 { MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } },
90 { MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } },
91 { MODKEY, XK_w, list_clients, {0} },
92 TAGKEYS( XK_1, 0)
93 TAGKEYS( XK_2, 1)
94 TAGKEYS( XK_3, 2)
95 TAGKEYS( XK_4, 3)
96 TAGKEYS( XK_5, 4)
97 TAGKEYS( XK_6, 5)
98 TAGKEYS( XK_7, 6)
99 TAGKEYS( XK_8, 7)
100 TAGKEYS( XK_9, 8)
101 { MODKEY|ShiftMask, XK_q, quit, {0} },
102 };
103
104 /* button definitions */
105 /* click can be ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */
106 static Button buttons[] = {
107 /* click event mask button function argument */
108 { ClkLtSymbol, 0, Button1, setlayout, {0} },
109 { ClkLtSymbol, 0, Button3, setlayout, {.v = &layouts[2]} },
110 { ClkWinTitle, 0, Button2, zoom, {0} },
111 { ClkStatusText, 0, Button2, spawn, {.v = termcmd } },
112 { ClkClientWin, MODKEY, Button1, movemouse, {0} },
113 { ClkClientWin, MODKEY, Button2, togglefloating, {0} },
114 { ClkClientWin, MODKEY, Button3, resizemouse, {0} },
115 { ClkTagBar, 0, Button1, view, {0} },
116 { ClkTagBar, 0, Button3, toggleview, {0} },
117 { ClkTagBar, MODKEY, Button1, tag, {0} },
118 { ClkTagBar, MODKEY, Button3, toggletag, {0} },
119 };