kore / overlays / dwl / config.h166 lines · 6537B · 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 *menucmd[] = { "wmenu-run", "-f", "Fantasque Sans Mono 11",
102 "-N", "@bgRgb@", "-n", "@fgRgb@", "-M", "@bgRgb@", "-m", "@greenRgb@",
103 "-S", "@surfaceRgb@", "-s", "@fgRgb@", NULL };
104
105static const Key keys[] = {
106 { MODKEY, XKB_KEY_d, spawn, {.v = menucmd} },
107 { MODKEY, XKB_KEY_Return, spawn, {.v = termcmd} },
108 { MODKEY, XKB_KEY_j, focusstack, {.i = +1} },
109 { MODKEY, XKB_KEY_h, setmfact, {.f = -0.05f} },
110 { MODKEY, XKB_KEY_l, setmfact, {.f = +0.05f} },
111 { MODKEY, XKB_KEY_i, incnmaster, {.i = +1} },
112 { MODKEY, XKB_KEY_o, incnmaster, {.i = -1} },
113 { MODKEY, XKB_KEY_k, focusstack, {.i = -1} },
114 { MODKEY, XKB_KEY_q, killclient, {0} },
115 { MODKEY|MODSHIFT, XKB_KEY_Tab, view, {0} },
116 { MODKEY|MODSHIFT, XKB_KEY_Return, zoom, {0} },
117 { MODKEY|MODSHIFT, XKB_KEY_t, setlayout, {.v = &layouts[0]} },
118 { MODKEY|MODSHIFT, XKB_KEY_f, setlayout, {.v = &layouts[1]} },
119 { MODKEY|MODSHIFT, XKB_KEY_m, setlayout, {.v = &layouts[2]} },
120 { MODKEY, XKB_KEY_space, togglefloating, {0} },
121 { MODKEY, XKB_KEY_f, togglefullscreen, {0} },
122 { MODKEY, XKB_KEY_g, togglegaps, {0} },
123 { MODKEY, XKB_KEY_b, togglebar, {0} },
124 { MODKEY, XKB_KEY_Escape, spawn, {.v = lockcmd} },
125 { MODKEY, XKB_KEY_n, spawn, {.v = dismisscmd} },
126 { MODKEY|MODSHIFT, XKB_KEY_n, spawn, {.v = dismissallcmd} },
127 { 0, XKB_KEY_Print, spawn, {.v = shotareacmd} },
128 { MODSHIFT, XKB_KEY_Print, spawn, {.v = shotoutputcmd} },
129 { MODKEY, XKB_KEY_Print, spawn, {.v = shotsavecmd} },
130 { MODKEY, XKB_KEY_comma, focusmon, {.i = WLR_DIRECTION_LEFT} },
131 { MODKEY, XKB_KEY_period, focusmon, {.i = WLR_DIRECTION_RIGHT} },
132 { MODKEY|MODSHIFT, XKB_KEY_comma, tagmon, {.i = WLR_DIRECTION_LEFT} },
133 { MODKEY|MODSHIFT, XKB_KEY_period, tagmon, {.i = WLR_DIRECTION_RIGHT} },
134 { MODKEY|MODSHIFT, XKB_KEY_p, quit, {0} },
135
136 /* Ctrl-Alt-Backspace and Ctrl-Alt-Fx used to be handled by X server */
137 { MODCTRL|MODALT, XKB_KEY_BackSpace, quit, {0} },
138
139 TAGKEYS(XKB_KEY_1, 0),
140 TAGKEYS(XKB_KEY_2, 1),
141 TAGKEYS(XKB_KEY_3, 2),
142 TAGKEYS(XKB_KEY_4, 3),
143 TAGKEYS(XKB_KEY_5, 4),
144 TAGKEYS(XKB_KEY_6, 5),
145
146 /* Ctrl-Alt-Fx is used to switch to another VT */
147 CHVT(1), CHVT(2), CHVT(3), CHVT(4), CHVT(5), CHVT(6),
148 CHVT(7), CHVT(8), CHVT(9), CHVT(10), CHVT(11), CHVT(12),
149};
150
151static const Button buttons[] = {
152 { ClkClient, MODKEY, BTN_LEFT, moveresize, {.ui = CurMove} },
153 { ClkClient, MODKEY, BTN_RIGHT, moveresize, {.ui = CurResize} },
154 { ClkClient, MODKEY, BTN_MIDDLE, togglefloating, {0} },
155 { ClkTagBar, 0, BTN_LEFT, view, {0} },
156 { ClkTagBar, 0, BTN_RIGHT, toggleview, {0} },
157 { ClkTagBar, MODKEY, BTN_LEFT, tag, {0} },
158 { ClkTagBar, MODKEY, BTN_RIGHT, toggletag, {0} },
159 { ClkLtSymbol, 0, BTN_LEFT, setlayout, {.v = &layouts[0]} },
160 { ClkLtSymbol, 0, BTN_RIGHT, setlayout, {.v = &layouts[2]} },
161};
162
163static const Axis axes[] = {
164 { MODKEY, AxisUp, focusstack, {.i = -1} },
165 { MODKEY, AxisDown, focusstack, {.i = +1} },
166};