]> git.armaanb.net Git - dwm.git/blob - config.h
Update
[dwm.git] / config.h
1 /* See LICENSE file for copyright and license details. */
2
3 /* appearance */
4 static const unsigned int borderpx  = 2;        /* border pixel of windows */
5 static const unsigned int snap      = 32;       /* snap pixel */
6 static const int showbar            = 1;        /* 0 means no bar */
7 static const int topbar             = 1;        /* 0 means bottom bar */
8 static const char *fonts[]          = { "JetBrainsMono Medium NF:pixelsize=14:antialias=true:autohint=true" };
9 static const char white[]       = "#ffffff";
10 static const char black[]       = "#000000";
11 static const char mgray[]       = "#555555";
12 static const char *colors[][3]      = {
13         /*               fg     bg     border   */
14         [SchemeNorm] = { white, black, mgray },
15         [SchemeSel]  = { black, white, white },
16 };
17
18 /* tagging */
19 static const char *tags[] = { "1", "2", "3", "4" };
20
21 static const Rule rules[] = {
22         /* xprop(1):
23          *      WM_CLASS(STRING) = instance, class
24          *      WM_NAME(STRING) = title
25          */
26         /* class     instance  title           tags mask  isfloating  monitor */
27         { "St",      NULL,     "pinentry",     0,         1,          -1 },
28 };
29
30 /* layout(s) */
31 static const float mfact     = 0.5;  /* factor of master area size [0.05..0.95] */
32 static const int nmaster     = 1;    /* number of clients in master area */
33 static const int resizehints = 0;    /* 1 means respect size hints in tiled resizals */
34
35 static const Layout layouts[] = {
36         /* symbol     arrange function */
37         { "[]=",      tile },    /* first entry is default */
38         { "><>",      NULL },    /* no layout function means floating behavior */
39         { "[M]",      monocle },
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 and emacs 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 char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */
55 static const char *dmenucmd[] = { "dmenu_run", NULL };
56 static const char *termcmd[]  = { "st", "-e", "dvtm" };
57
58 static Key keys[] = {
59         /* modifier         key        function        argument */
60         { MODKEY,           XK_p,      spawn,          {.v = dmenucmd } },
61         { MODKEY|ShiftMask, XK_p,      spawn,          SHCMD("passmenu") },
62         { MODKEY|ShiftMask, XK_Return, spawn,          {.v = termcmd} },
63         { MODKEY,           XK_b,      togglebar,      {0} },
64         { MODKEY,           XK_j,      focusstack,     {.i = +1 } },
65         { MODKEY,           XK_k,      focusstack,     {.i = -1 } },
66         { MODKEY|ShiftMask, XK_j,      pushdown,       {0} },
67         { MODKEY|ShiftMask, XK_k,      pushup,         {0} },
68         { MODKEY,           XK_i,      incnmaster,     {.i = +1 } },
69         { MODKEY,           XK_d,      incnmaster,     {.i = -1 } },
70         { MODKEY,           XK_h,      setmfact,       {.f = -0.05} },
71         { MODKEY,           XK_l,      setmfact,       {.f = +0.05} },
72         { MODKEY,           XK_Return, zoom,           {0} },
73         { MODKEY,           XK_Tab,    view,           {0} },
74         { MODKEY|ShiftMask, XK_c,      killclient,     {0} },
75         { MODKEY,           XK_t,      setlayout,      {.v = &layouts[0]} },
76         { MODKEY,           XK_f,      setlayout,      {.v = &layouts[1]} },
77         { MODKEY,           XK_m,      setlayout,      {.v = &layouts[2]} },
78         { MODKEY,           XK_space,  setlayout,      {0} },
79         { MODKEY|ShiftMask, XK_space,  togglefloating, {0} },
80         { MODKEY,           XK_comma,  focusmon,       {.i = -1 } },
81         { MODKEY,           XK_period, focusmon,       {.i = +1 } },
82         { MODKEY|ShiftMask, XK_comma,  tagmon,         {.i = -1 } },
83         { MODKEY|ShiftMask, XK_period, tagmon,         {.i = +1 } },
84         TAGKEYS(            XK_1,                      0)
85         TAGKEYS(            XK_2,                      1)
86         TAGKEYS(            XK_3,                      2)
87         TAGKEYS(            XK_4,                      3)
88         { MODKEY,           XK_5,      view,           {.ui = ~0 } },
89         { MODKEY|ShiftMask, XK_5,      tag,            {.ui = ~0 } },
90         { MODKEY|ShiftMask, XK_q,      quit,           {0} },
91         /***************************************************************/
92         { MODKEY|ControlMask, XK_i,      spawn, SHCMD("dweb uri") },
93         { MODKEY|ControlMask, XK_o,      spawn, SHCMD("dweb search") },
94         { MODKEY|ControlMask, XK_p,      spawn, SHCMD("chromium") },
95         /***************************************************************/
96         { 0,           XF86XK_AudioLowerVolume,  spawn, SHCMD("amixer sset Master 5%-; pkill -RTMIN+10 dwmblocks") },
97         { 0,           XF86XK_AudioRaiseVolume,  spawn, SHCMD("amixer sset Master 5%+; pkill -RTMIN+10 dwmblocks") },
98         { 0,           XF86XK_AudioMute,         spawn, SHCMD("amixer sset Master toggle; pkill -RTMIN+10 dwmblocks") },
99         { 0,           XF86XK_MonBrightnessDown, spawn, SHCMD("brightnessctl set 5%-") },
100         { 0,           XF86XK_MonBrightnessUp,   spawn, SHCMD("brightnessctl set 5%+") },
101         { 0,           XF86XK_Sleep,             spawn, SHCMD("doas zzz") },
102         { ControlMask, XF86XK_Sleep,             spawn, SHCMD("slock") },
103         /***************************************************************/
104         { MODKEY|ControlMask, XK_h, spawn, SHCMD("xdotool keyup h key --clearmodifiers Left") },
105         { MODKEY|ControlMask, XK_j, spawn, SHCMD("xdotool keyup j key --clearmodifiers Down") },
106         { MODKEY|ControlMask, XK_k, spawn, SHCMD("xdotool keyup k key --clearmodifiers Up") },
107         { MODKEY|ControlMask, XK_l, spawn, SHCMD("xdotool keyup l key --clearmodifiers Right") },
108 };
109
110 /* button definitions */
111 /* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */
112 static Button buttons[] = {
113         /* click                event mask      button          function        argument */
114         { ClkLtSymbol,          0,              Button1,        setlayout,      {0} },
115         { ClkLtSymbol,          0,              Button3,        setlayout,      {.v = &layouts[2]} },
116         { ClkWinTitle,          0,              Button2,        zoom,           {0} },
117         { ClkClientWin,         MODKEY,         Button1,        movemouse,      {0} },
118         { ClkClientWin,         MODKEY,         Button2,        togglefloating, {0} },
119         { ClkClientWin,         MODKEY,         Button3,        resizemouse,    {0} },
120         { ClkTagBar,            0,              Button1,        view,           {0} },
121         { ClkTagBar,            0,              Button3,        toggleview,     {0} },
122         { ClkTagBar,            MODKEY,         Button1,        tag,            {0} },
123         { ClkTagBar,            MODKEY,         Button3,        toggletag,      {0} },
124 };
125
126 static const char *const autostart[] = {
127         "xbanish", NULL,
128         "xsetroot", "-gray", NULL,
129         "dwmblocks", NULL,
130         "xmodmap", "/home/armaa/.config/xmodmap", NULL,
131         "xcape", NULL,
132         "brownoutd", NULL,
133         "syncthing", NULL,
134         NULL /* terminate */
135 };