dwm.h (7122B) download
1/* See LICENSE file for copyright and license details. */
2
3#include <X11/XF86keysym.h>
4
5static const char black[] = "#282828";
6static const char blue[] = "#83a598"; // focused window border
7static const char gray2[] = "#282828"; // unfocused window border
8static const char gray3[] = "#3c3836";
9static const char gray4[] = "#282828";
10static const char green[] = "#8ec07c";
11static const char orange[] = "#fe8019";
12static const char pink[] = "#d3869b";
13static const char red[] = "#fb4934";
14static const char white[] = "#ebdbb2";
15static const char yellow[] = "#b8bb26";
16static const char col_borderbar[] = "#1e2122";
17
18/* appearance */
19static const unsigned int borderpx = 2; /* border pixel of windows */
20static const unsigned int snap = 10; /* snap pixel */
21static const int horizpadbar = 10; /* horizontal padding for statusbar */
22static const int vertpadbar = 10; /* vertical padding for statusbar */
23static const int showbar = 1; /* 0 means no bar */
24static const int topbar = 1; /* 0 means bottom bar */
25static const unsigned int systraypinning =
26 0; /* 0: sloppy systray follows selected monitor, >0: pin systray to monitor
27 X */
28static const unsigned int systrayonleft =
29 0; /* 0: systray in the right corner, >0: systray on left of status text */
30static const unsigned int systrayspacing = 2; /* systray spacing */
31static const int systraypinningfailfirst =
32 1; /* 1: if pinning fails, display systray on the first monitor, False:
33 display systray on the last monitor*/
34static const int showsystray = 1; /* 0 means no systray */
35static const char *fonts[] = {"Monaco:size=10"};
36static const char *colors_[][3] = { // light
37 /* fg bg border */
38 [SchemeNorm] = {gray3, white, gray2},
39 [SchemeSel] = {gray3, blue, blue},
40 [SchemeUrg] = {gray3, orange, red},
41 [3] = {gray3, orange, gray2},
42 [4] = {gray3, green, gray2}};
43static const char *colors[][3] = { // dark
44 /* fg bg border */
45 [SchemeNorm] = {white, gray2, gray2},
46 [SchemeSel] = {blue, gray3, blue},
47 [SchemeUrg] = {orange, gray3, red},
48 [3] = {gray3, orange, gray2},
49 [4] = {gray3, green, gray2}};
50
51static const char dwmrc[] = ".dwmrc";
52
53/* tagging */
54static const char *tags[] = {"1", "2", "3", "4", "5"};
55
56static const Rule rules[] = {
57 /* xprop(1):
58 * WM_CLASS(STRING) = instance, class
59 * WM_NAME(STRING) = title
60 */
61 /* class instance title tags mask isfloating monitor */
62 {"Firefox", NULL, NULL, 1 << 5, 0, -1},
63};
64
65/* layout(s) */
66static const float mfact = 0.55; /* factor of master area size [0.05..0.95] */
67static const int nmaster = 1; /* number of clients in master area */
68static const int resizehints =
69 1; /* 1 means respect size hints in tiled resizals */
70static const int lockfullscreen =
71 1; /* 1 will force focus on the fullscreen window */
72
73static const Layout layouts[] = {
74 /* symbol arrange function */
75 {"[]=", tile}, /* first entry is default */
76 {"{ }", NULL}, /* no layout function means floating behavior */
77 {"[o]", monocle},
78};
79
80/* key definitions */
81#define MODKEY Mod4Mask
82#define TAGKEYS(KEY, TAG) \
83 {MODKEY, KEY, view, {.ui = 1 << TAG}}, \
84 {MODKEY | ControlMask, KEY, toggleview, {.ui = 1 << TAG}}, \
85 {MODKEY | ShiftMask, KEY, tag, {.ui = 1 << TAG}}, { \
86 MODKEY | ControlMask | ShiftMask, KEY, toggletag, { .ui = 1 << TAG } \
87 }
88
89/* helper for spawning shell commands in the pre dwm-5.0 fashion */
90#define SHELL(cmd) \
91 { \
92 .v = (const char *[]) { "/bin/sh", "-c", cmd, NULL } \
93 }
94#define COMMAND(...) \
95 { \
96 .v = (const char *[]) { __VA_ARGS__, NULL } \
97 }
98#define BACKLIGHT(device, value) \
99 COMMAND("brightnessctl", "-q", "-d", device, "set", value)
100
101#define monitor_backlight "acpi_video0"
102#define keyboard_backlight "smc::kbd_backlight"
103
104static const Key keys[] = {
105 /* modifier key function argument */
106 {MODKEY, XK_Return, spawn, COMMAND("st")},
107 {MODKEY | ShiftMask, XK_w, spawn, COMMAND("surf")},
108 {MODKEY, XK_w, spawn, COMMAND("firefox")},
109 {MODKEY, XK_space, spawn, COMMAND("dmenu_run")},
110 {MODKEY, XK_m, spawn, SHELL("man -k | dmenu -l 25 | cut -d' ' -f1-2 | sed -E 's/(\\S+) \\((\\S+)\\)/\\2 \\1/' | xargs st -f 'SF Mono' -e man -s")},
111 {0, XF86XK_MonBrightnessUp, spawn, BACKLIGHT(monitor_backlight, "+5%")},
112 {0, XF86XK_MonBrightnessDown, spawn, BACKLIGHT(monitor_backlight, "5%-")},
113 {0, XF86XK_KbdBrightnessUp, spawn, BACKLIGHT(keyboard_backlight, "+5%")},
114 {0, XF86XK_KbdBrightnessDown, spawn, BACKLIGHT(keyboard_backlight, "5%-")},
115 {MODKEY, XK_o, spawn, COMMAND("dfm")},
116 {MODKEY | ShiftMask, XK_o, spawn, COMMAND("dfm", "-c")},
117 {MODKEY, XK_b, togglebar, {0}},
118 {MODKEY, XK_j, focusstack, {.i = +1}},
119 {MODKEY, XK_k, focusstack, {.i = -1}},
120 {MODKEY, XK_i, incnmaster, {.i = +1}},
121 {MODKEY, XK_d, incnmaster, {.i = -1}},
122 {MODKEY, XK_Left, setmfact, {.f = -0.05}},
123 {MODKEY, XK_Right, setmfact, {.f = +0.05}},
124 {MODKEY | ShiftMask, XK_Return, zoom, {0}},
125 {MODKEY, XK_Tab, view, {0}},
126 {MODKEY, XK_q, killclient, {0}},
127 {MODKEY | ControlMask, XK_comma, cyclelayout, {.i = -1}},
128 {MODKEY | ControlMask, XK_period, cyclelayout, {.i = +1}},
129 {MODKEY | ControlMask, XK_space, setlayout, {0}},
130 {MODKEY | ShiftMask, XK_space, togglefloating, {0}},
131 {MODKEY, XK_0, view, {.ui = ~0}},
132 {MODKEY | ShiftMask, XK_0, tag, {.ui = ~0}},
133 {MODKEY, XK_comma, focusmon, {.i = -1}},
134 {MODKEY, XK_period, focusmon, {.i = +1}},
135 {MODKEY | ShiftMask, XK_comma, tagmon, {.i = -1}},
136 {MODKEY | ShiftMask, XK_period, tagmon, {.i = +1}},
137 TAGKEYS(XK_1, 0),
138 TAGKEYS(XK_2, 1),
139 TAGKEYS(XK_3, 2),
140 TAGKEYS(XK_4, 3),
141 TAGKEYS(XK_5, 4),
142 {MODKEY | ShiftMask, XK_q, quit, {0}},
143};
144
145/* button definitions */
146/* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle,
147 * ClkClientWin, or ClkRootWin */
148static const Button buttons[] = {
149 /* click event mask button function argument */
150 {ClkLtSymbol, 0, Button1, cyclelayout, {.i = +1}},
151 {ClkWinTitle, 0, Button2, zoom, {0}},
152 {ClkStatusText, 0, Button2, spawn, COMMAND("st")},
153 {ClkClientWin, MODKEY, Button1, movemouse, {0}},
154 {ClkClientWin, MODKEY, Button2, togglefloating, {0}},
155 {ClkClientWin, MODKEY, Button3, resizemouse, {0}},
156 {ClkTagBar, 0, Button1, view, {0}},
157 {ClkTagBar, 0, Button3, toggleview, {0}},
158 {ClkTagBar, MODKEY, Button1, tag, {0}},
159 {ClkTagBar, MODKEY, Button3, toggletag, {0}},
160};