nixos-dotfiles

nixos-dotfiles

https://git.tonybtw.com/nixos-dotfiles.git git://git.tonybtw.com/nixos-dotfiles.git
8,463 bytes raw
1
/* See LICENSE file for copyright and license details. */
2
3
/* appearance */
4
static const unsigned int borderpx  = 0;        /* border pixel of windows */
5
static const unsigned int snap      = 32;       /* snap pixel */
6
static const unsigned int gappih    = 20;       /* horiz inner gap between windows */
7
static const unsigned int gappiv    = 10;       /* vert inner gap between windows */
8
static const unsigned int gappoh    = 10;       /* horiz outer gap between windows and screen edge */
9
static const unsigned int gappov    = 30;       /* vert outer gap between windows and screen edge */
10
static       int smartgaps          = 0;        /* 1 means no outer gap when there is only one window */
11
static const int showbar            = 1;        /* 0 means no bar */
12
static const int topbar             = 1;        /* 0 means bottom bar */
13
static const char *fonts[]          = { "JetBrainsMono Nerd Font:size=16" };
14
static const char dmenufont[]       = "JetBrainsMono Nerd Font:size=16";
15
static const char col_gray1[]       = "#222222";
16
static const char col_gray2[]       = "#444444";
17
static const char col_gray3[]       = "#bbbbbb";
18
static const char col_gray4[]       = "#eeeeee";
19
/*static const char col_cyan[]        = "#005577";*/
20
/*static const char col_cyan[]        = "#0b104f";*/
21
static const char col_cyan[]        = "#6dade3";
22
static const char *colors[][3]      = {
23
	/*               fg         bg         border   */
24
	[SchemeNorm] = { col_gray3, col_gray1, col_gray2 },
25
	[SchemeSel]  = { col_gray4, col_cyan,  col_cyan  },
26
};
27
28
/* tagging */
29
static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };
30
31
static const Rule rules[] = {
32
	/* xprop(1):
33
	 *	WM_CLASS(STRING) = instance, class
34
	 *	WM_NAME(STRING) = title
35
	 */
36
	/* class            instance    title       tags mask     isfloating   monitor */
37
	{ "Gimp",            NULL,       NULL,       0,            1,           -1 },
38
    { "Google-chrome",   NULL,       NULL,       1 << 1,       0,           -1 },
39
	{ "firefox",         NULL,       NULL,       1 << 2,       0,           -1 },
40
	{ "Slack",           NULL,       NULL,       1 << 3,       0,           -1 },
41
	{ "discord",         NULL,       NULL,       1 << 4,       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
#define FORCE_VSPLIT 1  /* nrowgrid layout: force two clients to always split vertically */
51
#include "vanitygaps.c"
52
/*#include "fibonacci.c"*/
53
static const Layout layouts[] = {
54
	/* symbol     arrange function */
55
	{ "[]=",      tile },    /* first entry is default */
56
	{ "><>",      NULL },    /* no layout function means floating behavior */
57
	{ "[M]",      monocle },
58
 	{ "[@]",      spiral },
59
 	{ "[\\]",      dwindle },
60
};
61
62
/* key definitions */
63
#define MODKEY Mod4Mask
64
#define TAGKEYS(KEY,TAG) \
65
	{ MODKEY,                       KEY,      view,           {.ui = 1 << TAG} }, \
66
	{ MODKEY|ControlMask,           KEY,      toggleview,     {.ui = 1 << TAG} }, \
67
	{ MODKEY|ShiftMask,             KEY,      tag,            {.ui = 1 << TAG} }, \
68
	{ MODKEY|ControlMask|ShiftMask, KEY,      toggletag,      {.ui = 1 << TAG} },
69
70
/* helper for spawning shell commands in the pre dwm-5.0 fashion */
71
#define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
72
73
/* commands */
74
static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */
75
static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", col_gray1, "-nf", col_gray3, "-sb", col_cyan, "-sf", col_gray4, NULL };
76
static const char *termcmd[]  = { "st", NULL };
77
static const char *slock[]    = { "slock", NULL };
78
static const char *screenshotcmd[] = { "/bin/sh", "-c", "maim -s | xclip -selection clipboard -t image/png", NULL };
79
static const char *rofi[]  = { "rofi", "-show", "drun", "-theme", "~/.config/rofi/config.rasi", NULL };
80
81
static const Key keys[] = {
82
	/* modifier                     key        function        argument */
83
	{ MODKEY,                       XK_r,      spawn,          {.v = dmenucmd } },
84
	{ MODKEY,                       XK_Return, spawn,          {.v = termcmd } },
85
	{ MODKEY,                       XK_l,      spawn,          {.v = slock } },
86
	{ ControlMask,                  XK_Print,  spawn,          {.v = screenshotcmd } },
87
	{ MODKEY,                       XK_d,      spawn,          {.v = rofi } },
88
	{ MODKEY,                       XK_b,      togglebar,      {0} },
89
	{ MODKEY,                       XK_j,      focusstack,     {.i = +1 } },
90
	{ MODKEY,                       XK_k,      focusstack,     {.i = -1 } },
91
	{ MODKEY,                       XK_i,      incnmaster,     {.i = +1 } },
92
	{ MODKEY,                       XK_p,      incnmaster,     {.i = -1 } },
93
	{ MODKEY,                       XK_g,      setmfact,       {.f = -0.05} },
94
	{ MODKEY,                       XK_h,      setmfact,       {.f = +0.05} },
95
	{ MODKEY,                       XK_space,  zoom,           {0} },
96
	{ MODKEY,                       XK_z,      incrgaps,       {.i = +3 } },
97
	{ MODKEY,                       XK_x,      incrgaps,       {.i = -3 } },
98
	{ MODKEY,                       XK_a,      togglegaps,     {0} },
99
	{ MODKEY|ShiftMask,             XK_a,      defaultgaps,    {0} },
100
	{ MODKEY,                       XK_Tab,    view,           {0} },
101
	{ MODKEY,                       XK_q,      killclient,     {0} },
102
	{ MODKEY,                       XK_t,      setlayout,      {.v = &layouts[0]} },
103
	{ MODKEY,                       XK_f,      setlayout,      {.v = &layouts[1]} },
104
	{ MODKEY,                       XK_m,      setlayout,      {.v = &layouts[2]} },
105
	{ MODKEY,                       XK_c,      setlayout,      {.v = &layouts[3]} },
106
	{ MODKEY,                       XK_o,      setlayout,      {.v = &layouts[4]} },
107
	{ MODKEY|ShiftMask,             XK_Return, setlayout,      {0} },
108
	{ MODKEY|ShiftMask,             XK_f,      fullscreen,     {0} },
109
	{ MODKEY|ShiftMask,             XK_space,  togglefloating, {0} },
110
	{ MODKEY,                       XK_0,      view,           {.ui = ~0 } },
111
	{ MODKEY|ShiftMask,             XK_0,      tag,            {.ui = ~0 } },
112
	{ MODKEY,                       XK_comma,  focusmon,       {.i = -1 } },
113
	{ MODKEY,                       XK_period, focusmon,       {.i = +1 } },
114
	{ MODKEY|ShiftMask,             XK_comma,  tagmon,         {.i = -1 } },
115
	{ MODKEY|ShiftMask,             XK_period, tagmon,         {.i = +1 } },
116
	TAGKEYS(                        XK_1,                      0)
117
	TAGKEYS(                        XK_2,                      1)
118
	TAGKEYS(                        XK_3,                      2)
119
	TAGKEYS(                        XK_4,                      3)
120
	TAGKEYS(                        XK_5,                      4)
121
	TAGKEYS(                        XK_6,                      5)
122
	TAGKEYS(                        XK_7,                      6)
123
	TAGKEYS(                        XK_8,                      7)
124
	TAGKEYS(                        XK_9,                      8)
125
	{ MODKEY|ShiftMask,             XK_q,      quit,           {0} },
126
	{ MODKEY|ControlMask|ShiftMask, XK_q,      quit,           {1} }, 
127
};
128
129
/* button definitions */
130
/* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */
131
static const Button buttons[] = {
132
	/* click                event mask      button          function        argument */
133
	{ ClkLtSymbol,          0,              Button1,        setlayout,      {0} },
134
	{ ClkLtSymbol,          0,              Button3,        setlayout,      {.v = &layouts[2]} },
135
	{ ClkStatusText,        0,              Button2,        spawn,          {.v = termcmd } },
136
	{ ClkClientWin,         MODKEY,         Button1,        movemouse,      {0} },
137
	{ ClkClientWin,         MODKEY,         Button2,        togglefloating, {0} },
138
	{ ClkClientWin,         MODKEY,         Button3,        resizemouse,    {0} },
139
	{ ClkTagBar,            0,              Button1,        view,           {0} },
140
	{ ClkTagBar,            0,              Button3,        toggleview,     {0} },
141
	{ ClkTagBar,            MODKEY,         Button1,        tag,            {0} },
142
	{ ClkTagBar,            MODKEY,         Button3,        toggletag,      {0} },
143
};