dwm/config.h

158 lines
9 KiB
C
Raw Normal View History

2020-08-17 23:06:04 +00:00
/* See LICENSE file for copyright and license details. */
2020-10-07 03:59:31 +00:00
#define TERMCLASS "st-256color"
2020-08-17 23:06:04 +00:00
/* appearance */
static const unsigned int borderpx = 1; /* border pixel of windows */
static const unsigned int snap = 32; /* snap pixel */
static const int showbar = 1; /* 0 means no bar */
static const int topbar = 1; /* 0 means bottom bar */
2020-09-28 19:18:32 +00:00
static const unsigned int gappih = 5; /* horiz inner gap between windows */
static const unsigned int gappiv = 5; /* vert inner gap between windows */
2020-08-17 23:06:04 +00:00
static const unsigned int gappoh = 5; /* horiz outer gap between windows and screen edge */
static const unsigned int gappov = 5; /* vert outer gap between windows and screen edge */
static int smartgaps = 0; /* 1 means no outer gap when there is only one window */
2020-10-07 03:59:31 +00:00
static const int swallowfloating = 0; /* 1 means swallow floating windows by default */
2020-08-17 23:06:04 +00:00
static const char *fonts[] = { "Roboto Mono:size=10", "Joypixels:size=10" };
static const char dmenufont[] = "Roboto Mono:size=10";
static const char col_gray1[] = "#222222";
static const char col_gray2[] = "#444444";
static const char col_gray3[] = "#bbbbbb";
static const char col_gray4[] = "#eeeeee";
static const char col_cyan[] = "#1c343c";
static const char *colors[][3] = {
/* fg bg border */
[SchemeNorm] = { col_gray3, col_gray1, col_gray2 },
[SchemeSel] = { col_gray4, col_cyan, col_cyan },
};
/* tagging */
2020-10-07 04:12:55 +00:00
static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };
2020-08-17 23:06:04 +00:00
static const Rule rules[] = {
/* xprop(1):
* WM_CLASS(STRING) = instance, class
* WM_NAME(STRING) = title
*/
2020-10-07 03:59:31 +00:00
/* class instance title tags mask isfloating isterminal noswallow monitor */
{ "Gimp", NULL, NULL, 0, 1, 0, 0, -1 },
{ "Firefox", NULL, NULL, 1 << 8, 0, 0, -1, -1 },
{ TERMCLASS, NULL, NULL, 0, 0, 1, 0, -1 },
{ NULL, NULL, "Event Tester", 0, 0, 0, 1, -1 }, /* xev */
2020-08-17 23:06:04 +00:00
};
/* layout(s) */
2020-10-07 03:59:31 +00:00
static const float mfact = 0.5; /* factor of master area size [0.05..0.95] */
2020-08-17 23:06:04 +00:00
static const int nmaster = 1; /* number of clients in master area */
static const int resizehints = 0; /* 1 means respect size hints in tiled resizals */
2020-09-28 19:18:32 +00:00
#define FORCE_VSPLIT 1 /* nrowgrid layout: force two clients to always split vertically */
2020-08-17 23:06:04 +00:00
#include "vanitygaps.c"
static const Layout layouts[] = {
/* symbol arrange function */
2020-10-07 03:59:31 +00:00
{ "[@]", spiral }, /* first entry is default */
{ "H[]", deck },
2020-08-17 23:06:04 +00:00
{ "HHH", grid },
2020-10-07 04:12:55 +00:00
/* { "[]=", tile }, */
/* { "[M]", monocle }, */
/* { "[\\]", dwindle }, */
/* { "TTT", bstack }, */
/* { "===", bstackhoriz }, */
/* { "###", nrowgrid }, */
/* { "---", horizgrid }, */
/* { ":::", gaplessgrid }, */
/* { "|M|", centeredmaster }, */
/* { ">M>", centeredfloatingmaster }, */
/* { "><>", NULL }, /1* no layout function means floating behavior *1/ */
/* { NULL, NULL }, */
2020-08-17 23:06:04 +00:00
};
/* key definitions */
#define MODKEY Mod4Mask
#define TAGKEYS(KEY,TAG) \
{ MODKEY, KEY, view, {.ui = 1 << TAG} }, \
{ MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \
{ MODKEY|ShiftMask, KEY, tag, {.ui = 1 << TAG} }, \
{ MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG} },
/* helper for spawning shell commands in the pre dwm-5.0 fashion */
#define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
/* make audio keys work */
#include <X11/XF86keysym.h>
/* commands */
static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */
static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", col_gray1, "-nf", col_gray3, "-sb", col_cyan, "-sf", col_gray4, NULL };
static const char *termcmd[] = { "st", NULL };
2020-10-07 03:59:31 +00:00
static const char *browser[] = { "waterfox-current", NULL };
2020-09-28 19:18:32 +00:00
static const char *passmenu[] = { "passmenu", "-m", dmenumon, "-fn", dmenufont, "-nb", col_gray1, "-nf", col_gray3, "-sb", col_cyan, "-sf", col_gray4, "-l", "5", "-i", NULL };
2020-09-03 22:13:58 +00:00
static const char *scrotselection[] = { "sleep", "0.5", "&&", "scrot", "-s", "~/pics/screenshots/%Y-%m-%d-%s%w%h.jpg", NULL };
2020-08-17 23:06:04 +00:00
static const char *manmenu[] = { "manmenu", NULL };
static const char *upvol[] = { "/usr/bin/pactl", "set-sink-volume", "@DEFAULT_SINK@", "+2%", NULL };
static const char *downvol[] = { "/usr/bin/pactl", "set-sink-volume", "@DEFAULT_SINK@", "-2%", NULL };
static const char *mutevol[] = { "/usr/bin/pactl", "set-sink-mute", "@DEFAULT_SINK@", "toggle", NULL };
static Key keys[] = {
/* modifier key function argument */
{ MODKEY, XK_d, spawn, {.v = dmenucmd } },
{ MODKEY, XK_Return, spawn, {.v = termcmd } },
{ MODKEY, XK_b, togglebar, {0} },
{ MODKEY, XK_j, focusstack, {.i = +1 } },
{ MODKEY, XK_k, focusstack, {.i = -1 } },
{ MODKEY, XK_i, incnmaster, {.i = +1 } },
{ MODKEY, XK_o, incnmaster, {.i = -1 } },
{ MODKEY, XK_h, setmfact, {.f = -0.05} },
{ MODKEY, XK_l, setmfact, {.f = +0.05} },
{ MODKEY, XK_v, zoom, {0} },
{ MODKEY, XK_Tab, view, {0} },
{ MODKEY|ShiftMask, XK_q, killclient, {0} },
{ MODKEY, XK_t, setlayout, {.v = &layouts[0]} },
{ MODKEY, XK_f, setlayout, {.v = &layouts[1]} },
{ MODKEY, XK_m, setlayout, {.v = &layouts[2]} },
{ MODKEY, XK_space, setlayout, {0} },
{ MODKEY|ShiftMask, XK_space, togglefloating, {0} },
{ MODKEY, XK_0, view, {.ui = ~0 } },
{ MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } },
{ MODKEY, XK_comma, focusmon, {.i = -1 } },
{ MODKEY, XK_period, focusmon, {.i = +1 } },
{ MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } },
{ MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } },
2020-09-28 19:18:32 +00:00
{ MODKEY, XK_w, spawn, {.v = browser } },
2020-08-17 23:06:04 +00:00
{ MODKEY, XK_p, spawn, {.v = passmenu } },
2020-09-03 22:13:58 +00:00
{ MODKEY, XK_Print, spawn, {.v = scrotselection } },
2020-08-17 23:06:04 +00:00
{ MODKEY, XK_c, spawn, {.v = manmenu } },
2020-09-03 22:13:58 +00:00
{ 0, XF86XK_AudioRaiseVolume, spawn, {.v = upvol } },
{ 0, XF86XK_AudioLowerVolume, spawn, {.v = downvol } },
{ 0, XF86XK_AudioMute, spawn, {.v = mutevol } },
2020-08-17 23:06:04 +00:00
TAGKEYS( XK_1, 0)
TAGKEYS( XK_2, 1)
TAGKEYS( XK_3, 2)
TAGKEYS( XK_4, 3)
TAGKEYS( XK_5, 4)
TAGKEYS( XK_6, 5)
TAGKEYS( XK_7, 6)
TAGKEYS( XK_8, 7)
TAGKEYS( XK_9, 8)
{ MODKEY|ShiftMask, XK_u, quit, {0} },
};
/* button definitions */
/* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */
static Button buttons[] = {
/* click event mask button function argument */
{ ClkLtSymbol, 0, Button1, setlayout, {0} },
{ ClkLtSymbol, 0, Button3, setlayout, {.v = &layouts[2]} },
{ ClkWinTitle, 0, Button2, zoom, {0} },
{ ClkStatusText, 0, Button2, spawn, {.v = termcmd } },
{ ClkClientWin, MODKEY, Button1, movemouse, {0} },
{ ClkClientWin, MODKEY, Button2, togglefloating, {0} },
{ ClkClientWin, MODKEY, Button3, resizemouse, {0} },
{ ClkTagBar, 0, Button1, view, {0} },
{ ClkTagBar, 0, Button3, toggleview, {0} },
{ ClkTagBar, MODKEY, Button1, tag, {0} },
{ ClkTagBar, MODKEY, Button3, toggletag, {0} },
};