greenhouse

kore

my public infrastructure monorepo

git clone [email protected]:kore.git

kore / overlays / dwl / config.h181 lines · 7436B · raw

1#define COLOR(hex) { ((hex >> 24) & 0xFF) / 255.0f, \
2                     ((hex >> 16) & 0xFF) / 255.0f, \
3                     ((hex >> 8) & 0xFF) / 255.0f, \
4                     (hex & 0xFF) / 255.0f }
5
6/* general */
7static char *tags[] = { "❦", "✾", "❁", "☘", "❃", "❋" };
8
9static int log_level                       = WLR_ERROR;
10static const int sloppyfocus               = 1;
11static const int bypass_surface_visibility = 0;
12
13/* appearance */
14static const unsigned int borderpx         = 1;
15static const unsigned int snap             = 32;
16static const unsigned int gappx            = 10;
17static const int smartgaps                 = 0;
18static int gaps                            = 1;
19static const int showbar                   = 1;
20static const int topbar                    = 1;
21static const char *fonts[]                 = { "Fantasque Sans Mono:size=11", "Noto Sans Symbols 2:size=13" };
22static const float rootcolor[]             = COLOR(@bg@);
23static const float fullscreen_bg[]         = COLOR(@bg@);
24
25static uint32_t colors[][3] = {
26	/*                fg          bg     border */
27	[SchemeNorm]  = { @fg@,      @bg@, @surface@ },
28	[SchemeSel]   = { @green@,   @bg@, @green@ },
29	[SchemeUrg]   = { @red@,     @bg@, @red@ },
30	[SchemeOcc]   = { @fg@,      @bg@, @surface@ },
31	[SchemeEmpty] = { @surface@, @bg@, @surface@ },
32	[SchemeKb]    = { @teal@,    @bg@, @surface@ },
33};
34
35static const char *kblayouts[] = { "en", "th" };
36
37/* rules */
38static const Rule rules[] = {
39	{ "Gimp_EXAMPLE", NULL, 0, 1, -1 },
40};
41
42/* layouts */
43static const Layout layouts[] = {
44	{ "[T]", tile },
45	{ "[F]", NULL },
46	{ "[M]", monocle },
47};
48
49/* monitors */
50static const MonitorRule monrules[] = {
51	{ NULL, 0.55f, 1, 1, &layouts[0], WL_OUTPUT_TRANSFORM_NORMAL, -1, -1 },
52};
53
54/* keyboard */
55static const int repeat_rate = 25;
56static const int repeat_delay = 600;
57
58static const struct xkb_rule_names xkb_rules = {
59	.layout = "us,th",
60	.options = "grp:alt_shift_toggle",
61};
62
63
64/* trackpad */
65static const int tap_to_click = 1;
66static const int tap_and_drag = 1;
67static const int drag_lock = 1;
68static const int natural_scrolling = 0;
69static const int disable_while_typing = 1;
70static const int left_handed = 0;
71static const int middle_button_emulation = 0;
72
73static const enum libinput_config_scroll_method scroll_method = LIBINPUT_CONFIG_SCROLL_2FG;
74static const enum libinput_config_click_method click_method = LIBINPUT_CONFIG_CLICK_METHOD_BUTTON_AREAS;
75static const uint32_t send_events_mode = LIBINPUT_CONFIG_SEND_EVENTS_ENABLED;
76static const enum libinput_config_accel_profile accel_profile = LIBINPUT_CONFIG_ACCEL_PROFILE_ADAPTIVE;
77static const double accel_speed = 0.0;
78static const enum libinput_config_tap_button_map button_map = LIBINPUT_CONFIG_TAP_MAP_LRM;
79
80/* commands */
81#define MODKEY WLR_MODIFIER_LOGO
82#define MODALT WLR_MODIFIER_ALT
83#define MODCTRL WLR_MODIFIER_CTRL
84#define MODSHIFT WLR_MODIFIER_SHIFT
85
86#define TAGKEYS(KEY, TAG) \
87	{ MODKEY, KEY, view, {.ui = 1 << TAG} }, \
88	{ MODKEY|MODCTRL, KEY, toggleview, {.ui = 1 << TAG} }, \
89	{ MODKEY|MODSHIFT, KEY, tag, {.ui = 1 << TAG} }, \
90	{ MODKEY|MODCTRL|MODSHIFT, KEY, toggletag, {.ui = 1 << TAG} }
91
92#define CHVT(n) { MODCTRL|MODALT, XKB_KEY_F##n, chvt, {.ui = (n)} }
93
94static const char *termcmd[] = { "foot", NULL };
95static const char *lockcmd[] = { "swaylock", NULL };
96static const char *dismisscmd[] = { "makoctl", "dismiss", NULL };
97static const char *dismissallcmd[] = { "makoctl", "dismiss", "--all", NULL };
98static const char *shotareacmd[] = { "screenshot", "area", NULL };
99static const char *shotoutputcmd[] = { "screenshot", "output", NULL };
100static const char *shotsavecmd[] = { "screenshot", "save", NULL };
101static const char *volupcmd[] = { "volume", "up", NULL };
102static const char *voldowncmd[] = { "volume", "down", NULL };
103static const char *volmutecmd[] = { "volume", "mute", NULL };
104static const char *micmutecmd[] = { "volume", "mic", NULL };
105static const char *playcmd[] = { "playerctl", "play-pause", NULL };
106static const char *nextcmd[] = { "playerctl", "next", NULL };
107static const char *prevcmd[] = { "playerctl", "previous", NULL };
108static const char *menucmd[] = { "wmenu-run", "-f", "Fantasque Sans Mono 11",
109	"-N", "@bgRgb@", "-n", "@fgRgb@", "-M", "@bgRgb@", "-m", "@greenRgb@",
110	"-S", "@surfaceRgb@", "-s", "@fgRgb@", NULL };
111
112static const Key keys[] = {
113	{ MODKEY, XKB_KEY_d, spawn, {.v = menucmd} },
114	{ MODKEY, XKB_KEY_Return, spawn, {.v = termcmd} },
115	{ MODKEY, XKB_KEY_j, focusstack, {.i = +1} },
116	{ MODKEY, XKB_KEY_h, setmfact, {.f = -0.05f} },
117	{ MODKEY, XKB_KEY_l, setmfact, {.f = +0.05f} },
118	{ MODKEY, XKB_KEY_i, incnmaster, {.i = +1} },
119	{ MODKEY, XKB_KEY_o, incnmaster, {.i = -1} },
120	{ MODKEY, XKB_KEY_k, focusstack, {.i = -1} },
121	{ MODKEY, XKB_KEY_q, killclient, {0} },
122	{ MODKEY|MODSHIFT, XKB_KEY_Tab, view, {0} },
123	{ MODKEY|MODSHIFT, XKB_KEY_Return, zoom, {0} },
124	{ MODKEY|MODSHIFT, XKB_KEY_t, setlayout, {.v = &layouts[0]} },
125	{ MODKEY|MODSHIFT, XKB_KEY_f, setlayout, {.v = &layouts[1]} },
126	{ MODKEY|MODSHIFT, XKB_KEY_m, setlayout, {.v = &layouts[2]} },
127	{ MODKEY, XKB_KEY_space, togglefloating, {0} },
128	{ MODKEY, XKB_KEY_f, togglefullscreen, {0} },
129	{ MODKEY, XKB_KEY_g, togglegaps, {0} },
130	{ MODKEY, XKB_KEY_b, togglebar, {0} },
131	{ MODKEY, XKB_KEY_Escape, spawn, {.v = lockcmd} },
132	{ MODKEY, XKB_KEY_n, spawn, {.v = dismisscmd} },
133	{ MODKEY|MODSHIFT, XKB_KEY_n, spawn, {.v = dismissallcmd} },
134	{ 0, XKB_KEY_Print, spawn, {.v = shotareacmd} },
135	{ MODSHIFT, XKB_KEY_Print, spawn, {.v = shotoutputcmd} },
136	{ MODKEY, XKB_KEY_Print, spawn, {.v = shotsavecmd} },
137	{ 0, XKB_KEY_XF86AudioRaiseVolume, spawn, {.v = volupcmd} },
138	{ 0, XKB_KEY_XF86AudioLowerVolume, spawn, {.v = voldowncmd} },
139	{ 0, XKB_KEY_XF86AudioMute, spawn, {.v = volmutecmd} },
140	{ 0, XKB_KEY_XF86AudioMicMute, spawn, {.v = micmutecmd} },
141	{ 0, XKB_KEY_XF86AudioPlay, spawn, {.v = playcmd} },
142	{ 0, XKB_KEY_XF86AudioPause, spawn, {.v = playcmd} },
143	{ 0, XKB_KEY_XF86AudioNext, spawn, {.v = nextcmd} },
144	{ 0, XKB_KEY_XF86AudioPrev, spawn, {.v = prevcmd} },
145	{ MODKEY, XKB_KEY_comma, focusmon, {.i = WLR_DIRECTION_LEFT} },
146	{ MODKEY, XKB_KEY_period, focusmon, {.i = WLR_DIRECTION_RIGHT} },
147	{ MODKEY|MODSHIFT, XKB_KEY_comma, tagmon, {.i = WLR_DIRECTION_LEFT} },
148	{ MODKEY|MODSHIFT, XKB_KEY_period, tagmon, {.i = WLR_DIRECTION_RIGHT} },
149	{ MODKEY|MODSHIFT, XKB_KEY_p, quit, {0} },
150
151	/* Ctrl-Alt-Backspace and Ctrl-Alt-Fx used to be handled by X server */
152	{ MODCTRL|MODALT, XKB_KEY_BackSpace, quit, {0} },
153
154	TAGKEYS(XKB_KEY_1, 0),
155	TAGKEYS(XKB_KEY_2, 1),
156	TAGKEYS(XKB_KEY_3, 2),
157	TAGKEYS(XKB_KEY_4, 3),
158	TAGKEYS(XKB_KEY_5, 4),
159	TAGKEYS(XKB_KEY_6, 5),
160
161	/* Ctrl-Alt-Fx is used to switch to another VT */
162	CHVT(1), CHVT(2), CHVT(3), CHVT(4), CHVT(5), CHVT(6),
163	CHVT(7), CHVT(8), CHVT(9), CHVT(10), CHVT(11), CHVT(12),
164};
165
166static const Button buttons[] = {
167	{ ClkClient, MODKEY, BTN_LEFT, moveresize, {.ui = CurMove} },
168	{ ClkClient, MODKEY, BTN_RIGHT, moveresize, {.ui = CurResize} },
169	{ ClkClient, MODKEY, BTN_MIDDLE, togglefloating, {0} },
170	{ ClkTagBar, 0, BTN_LEFT, view, {0} },
171	{ ClkTagBar, 0, BTN_RIGHT, toggleview, {0} },
172	{ ClkTagBar, MODKEY, BTN_LEFT, tag, {0} },
173	{ ClkTagBar, MODKEY, BTN_RIGHT, toggletag, {0} },
174	{ ClkLtSymbol, 0, BTN_LEFT, setlayout, {.v = &layouts[0]} },
175	{ ClkLtSymbol, 0, BTN_RIGHT, setlayout, {.v = &layouts[2]} },
176};
177
178static const Axis axes[] = {
179	{ MODKEY, AxisUp, focusstack, {.i = -1} },
180	{ MODKEY, AxisDown, focusstack, {.i = +1} },
181};