c319253ac73a2eabc46bc3c6a5dee905e1feac80
[dotfiles.git] / config.h / dwm / config.h
1 /* See LICENSE file for copyright and license details. */
2
3 #include <X11/XF86keysym.h>
4
5 /* appearance */
6 static const unsigned int borderpx = 1; /* border pixel of windows */
7 static const unsigned int snap = 32; /* snap pixel */
8 static const unsigned int systraypinning = 0; /* 0: sloppy systray follows selected monitor, >0: pin systray to monitor X */
9 static const unsigned int systrayonleft = 0; /* 0: systray in the right corner, >0: systray on left of status text */
10 static const unsigned int systrayspacing = 2; /* systray spacing */
11 static const int systraypinningfailfirst = 1; /* 1: if pinning fails, display systray on the first monitor, False: display systray on the last monitor*/
12 static const int showsystray = 1; /* 0 means no systray */
13 static const int showbar = 1; /* 0 means no bar */
14 static const int topbar = 0; /* 0 means bottom bar */
15 //static const char *fonts[] = { "monospace:size=10" };
16 static const char *fonts[] = { "monospace:size=14" };
17 //static const char dmenufont[] = "monospace:size=10";
18 static const char dmenufont[] = "monospace:size=14";
19 static const char col_gray1[] = "#222222";
20 static const char col_gray2[] = "#444444";
21 static const char col_gray3[] = "#bbbbbb";
22 static const char col_gray4[] = "#eeeeee";
23 static const char col_cyan[] = "#005577";
24 static const char *colors[][3] = {
25 /* fg bg border */
26 [SchemeNorm] = { col_gray3, col_gray1, col_gray2 },
27 [SchemeSel] = { col_gray4, col_cyan, col_cyan },
28 };
29
30 /* tagging */
31 //static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };
32 static const char *tags[] = { "1", "2", "3", "4", "5" };
33
34 static const Rule rules[] = {
35 /* xprop(1):
36 * WM_CLASS(STRING) = instance, class
37 * WM_NAME(STRING) = title
38 */
39 /* class instance title tags mask isfloating monitor */
40 { "Gimp", NULL, NULL, 0, 1, -1 },
41 // { "Firefox", NULL, NULL, 1 << 8, 0, -1 },
42 };
43
44 /* layout(s) */
45 static const float mfact = 0.55; /* factor of master area size [0.05..0.95] */
46 static const int nmaster = 1; /* number of clients in master area */
47 static const int resizehints = 1; /* 1 means respect size hints in tiled resizals */
48 static const int lockfullscreen = 1; /* 1 will force focus on the fullscreen window */
49
50 static const Layout layouts[] = {
51 /* symbol arrange function */
52 { "[]=", tile }, /* first entry is default */
53 { "><>", NULL }, /* no layout function means floating behavior */
54 { "[M]", monocle },
55 };
56
57 /* key definitions */
58 //#define MODKEY Mod1Mask
59 #define MODKEY Mod4Mask
60 #define TAGKEYS(KEY,TAG) \
61 { MODKEY, KEY, view, {.ui = 1 << TAG} }, \
62 { MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \
63 { MODKEY|ShiftMask, KEY, tag, {.ui = 1 << TAG} }, \
64 { MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG} },
65
66 /* helper for spawning shell commands in the pre dwm-5.0 fashion */
67 #define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
68
69 /* commands */
70 static const char *dmenucmd[] = { "dmenu_run", "-fn", dmenufont, "-nb", col_gray1, "-nf", col_gray3, "-sb", col_cyan, "-sf", col_gray4, NULL };
71 static const char *termcmd[] = { "st", NULL };
72 static const char *quitcmd[] = { "killall", "xinit", NULL };
73 static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */
74 static const char *passmenu[] = { "passmenu", "-m", dmenumon, "-fn", dmenufont, "-nb", col_gray1, "-nf", col_gray3, "-sb", col_cyan, "-sf", col_gray4, NULL };
75 static const char *passmenu_tmux[] = { "passmenu", "--tmux", "-m", dmenumon, "-fn", dmenufont, "-nb", col_gray1, "-nf", col_gray3, "-sb", col_cyan, "-sf", col_gray4, NULL };
76 static const char *scr[] = { "scr", NULL };
77 static const char *scr_sel[] = { "scr", "selection", NULL };
78 static const char *lock[] = { "xautolock", "-locknow", NULL };
79 static const char *brightup[] = { "xbacklight", "-inc", "5", NULL };
80 static const char *brightdown[] = { "xbacklight", "-dec", "5", NULL };
81 static const char *volume_mute[] = {"pactl", "set-sink-mute", "@DEFAULT_SINK@", "toggle", NULL};
82 static const char *volume_dec[] = {"pactl", "set-sink-volume", "@DEFAULT_SINK@", "-5%", NULL};
83 static const char *volume_inc[] = {"pactl", "set-sink-volume", "@DEFAULT_SINK@", "+5%", NULL};
84 static const char *toggle_music[] = {"music_toggle", NULL};
85
86 static const Key keys[] = {
87 /* modifier key function argument */
88 { MODKEY, XK_p, spawn, {.v = dmenucmd } },
89 { MODKEY|ShiftMask, XK_Return, spawn, {.v = termcmd } },
90 { MODKEY, XK_y, spawn, {.v = passmenu } },
91 { MODKEY|ShiftMask, XK_y, spawn, {.v = passmenu_tmux } },
92 { MODKEY|ShiftMask, XK_l, spawn, {.v = lock } },
93 { MODKEY, XK_b, togglebar, {0} },
94 { MODKEY, XK_j, focusstack, {.i = +1 } },
95 { MODKEY, XK_k, focusstack, {.i = -1 } },
96 { MODKEY, XK_i, incnmaster, {.i = +1 } },
97 { MODKEY, XK_d, incnmaster, {.i = -1 } },
98 { MODKEY, XK_h, setmfact, {.f = -0.05} },
99 { MODKEY, XK_l, setmfact, {.f = +0.05} },
100 { MODKEY, XK_Return, zoom, {0} },
101 { MODKEY, XK_Tab, view, {0} },
102 { MODKEY|ShiftMask, XK_c, killclient, {0} },
103 { MODKEY, XK_t, setlayout, {.v = &layouts[0]} },
104 { MODKEY, XK_f, setlayout, {.v = &layouts[1]} },
105 { MODKEY, XK_m, setlayout, {.v = &layouts[2]} },
106 { MODKEY, XK_space, setlayout, {0} },
107 { MODKEY|ShiftMask, XK_space, togglefloating, {0} },
108 { MODKEY, XK_0, view, {.ui = ~0 } },
109 { MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } },
110 { MODKEY, XK_comma, focusmon, {.i = -1 } },
111 { MODKEY, XK_period, focusmon, {.i = +1 } },
112 { MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } },
113 { MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } },
114 TAGKEYS( XK_1, 0)
115 TAGKEYS( XK_2, 1)
116 TAGKEYS( XK_3, 2)
117 TAGKEYS( XK_4, 3)
118 TAGKEYS( XK_5, 4)
119 TAGKEYS( XK_6, 5)
120 TAGKEYS( XK_7, 6)
121 TAGKEYS( XK_8, 7)
122 TAGKEYS( XK_9, 8)
123 //Quit
124 { MODKEY, XK_q, quit, {0} },
125 { MODKEY|ShiftMask, XK_q, spawn, {.v = quitcmd } },
126 //Without mod
127 { 0, XF86XK_MonBrightnessUp, spawn, {.v = brightup } },
128 { 0, XF86XK_MonBrightnessDown, spawn, {.v = brightdown } },
129 { 0, XF86XK_AudioLowerVolume, spawn, {.v = volume_dec } },
130 { 0, XF86XK_AudioMute, spawn, {.v = volume_mute } },
131 { 0, XF86XK_AudioRaiseVolume, spawn, {.v = volume_inc } },
132 { 0, XK_Print, spawn, {.v = scr } },
133 { ShiftMask, XK_Print, spawn, {.v = scr_sel } },
134 { 0, XK_Pause, spawn, {.v = toggle_music } },
135 };
136
137 /* button definitions */
138 /* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */
139 static const Button buttons[] = {
140 /* click event mask button function argument */
141 { ClkTagBar, MODKEY, Button1, tag, {0} },
142 { ClkTagBar, MODKEY, Button3, toggletag, {0} },
143 { ClkWinTitle, 0, Button2, zoom, {0} },
144 { ClkStatusText, 0, Button2, spawn, {.v = termcmd } },
145 { ClkClientWin, MODKEY, Button1, movemouse, {0} },
146 { ClkClientWin, MODKEY, Button2, togglefloating, {0} },
147 { ClkClientWin, MODKEY, Button3, resizemouse, {0} },
148 { ClkTagBar, 0, Button1, view, {0} },
149 { ClkTagBar, 0, Button3, toggleview, {0} },
150 { ClkTagBar, MODKEY, Button1, tag, {0} },
151 { ClkTagBar, MODKEY, Button3, toggletag, {0} },
152 };
153