config.def.h (11405B)
1 /* Taken from https://github.com/djpohly/dwl/issues/466 */ 2 #define COLOR(hex) { ((hex >> 24) & 0xFF) / 255.0f, \ 3 ((hex >> 16) & 0xFF) / 255.0f, \ 4 ((hex >> 8) & 0xFF) / 255.0f, \ 5 (hex & 0xFF) / 255.0f } 6 /* appearance */ 7 static const int sloppyfocus = 1; /* focus follows mouse */ 8 static const int bypass_surface_visibility = 0; /* 1 means idle inhibitors will disable idle tracking even if it's surface isn't visible */ 9 static const int smartgaps = 0; /* 1 means no outer gap when there is only one window */ 10 static const int monoclegaps = 0; /* 1 means outer gaps in monocle layout */ 11 static const unsigned int borderpx = 1; /* border pixel of windows */ 12 static const unsigned int gappih = 10; /* horiz inner gap between windows */ 13 static const unsigned int gappiv = 10; /* vert inner gap between windows */ 14 static const unsigned int gappoh = 10; /* horiz outer gap between windows and screen edge */ 15 static const unsigned int gappov = 10; /* vert outer gap between windows and screen edge */ 16 static const int showbar = 1; /* 0 means no bar */ 17 static const int topbar = 1; /* 0 means bottom bar */ 18 static const char *fonts[] = {"monospace:size=10"}; 19 static const float rootcolor[] = COLOR(0x000000ff); 20 /* This conforms to the xdg-protocol. Set the alpha to zero to restore the old behavior */ 21 static const float fullscreen_bg[] = {0.1f, 0.1f, 0.1f, 1.0f}; /* You can also use glsl colors */ 22 static uint32_t colors[][3] = { 23 /* fg bg border */ 24 [SchemeNorm] = { 0xbbbbbbff, 0x222222ff, 0x444444ff }, 25 [SchemeSel] = { 0xeeeeeeff, 0x005577ff, 0x005577ff }, 26 [SchemeUrg] = { 0, 0, 0x770000ff }, 27 }; 28 29 /* tagging - TAGCOUNT must be no greater than 31 */ 30 static char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" }; 31 32 /* logging */ 33 static int log_level = WLR_ERROR; 34 35 /* NOTE: ALWAYS keep a rule declared even if you don't use rules (e.g leave at least one example) */ 36 static const Rule rules[] = { 37 /* app_id title tags mask isfloating monitor */ 38 /* examples: */ 39 { "Gimp_EXAMPLE", NULL, 0, 1, -1 }, /* Start on currently visible tags floating, not tiled */ 40 { "firefox_EXAMPLE", NULL, 1 << 8, 0, -1 }, /* Start on ONLY tag "9" */ 41 }; 42 43 /* layout(s) */ 44 static const Layout layouts[] = { 45 /* symbol arrange function */ 46 { "[]=", tile }, 47 { "><>", NULL }, /* no layout function means floating behavior */ 48 { "[M]", monocle }, 49 }; 50 51 /* monitors */ 52 /* (x=-1, y=-1) is reserved as an "autoconfigure" monitor position indicator 53 * WARNING: negative values other than (-1, -1) cause problems with Xwayland clients 54 * https://gitlab.freedesktop.org/xorg/xserver/-/issues/899 55 */ 56 /* NOTE: ALWAYS add a fallback rule, even if you are completely sure it won't be used */ 57 static const MonitorRule monrules[] = { 58 /* name mfact nmaster scale layout rotate/reflect x y */ 59 /* example of a HiDPI laptop monitor: 60 { "eDP-1", 0.5f, 1, 2, &layouts[0], WL_OUTPUT_TRANSFORM_NORMAL, -1, -1 }, 61 */ 62 /* defaults */ 63 { NULL, 0.55f, 1, 1, &layouts[0], WL_OUTPUT_TRANSFORM_NORMAL, -1, -1 }, 64 }; 65 66 /* keyboard */ 67 static const struct xkb_rule_names xkb_rules = { 68 /* can specify fields: rules, model, layout, variant, options */ 69 /* example: 70 .options = "ctrl:nocaps", 71 */ 72 .options = NULL, 73 }; 74 75 static const int repeat_rate = 25; 76 static const int repeat_delay = 600; 77 78 /* Trackpad */ 79 static const int tap_to_click = 1; 80 static const int tap_and_drag = 1; 81 static const int drag_lock = 1; 82 static const int natural_scrolling = 0; 83 static const int disable_while_typing = 1; 84 static const int left_handed = 0; 85 static const int middle_button_emulation = 0; 86 /* You can choose between: 87 LIBINPUT_CONFIG_SCROLL_NO_SCROLL 88 LIBINPUT_CONFIG_SCROLL_2FG 89 LIBINPUT_CONFIG_SCROLL_EDGE 90 LIBINPUT_CONFIG_SCROLL_ON_BUTTON_DOWN 91 */ 92 static const enum libinput_config_scroll_method scroll_method = LIBINPUT_CONFIG_SCROLL_2FG; 93 94 /* You can choose between: 95 LIBINPUT_CONFIG_CLICK_METHOD_NONE 96 LIBINPUT_CONFIG_CLICK_METHOD_BUTTON_AREAS 97 LIBINPUT_CONFIG_CLICK_METHOD_CLICKFINGER 98 */ 99 static const enum libinput_config_click_method click_method = LIBINPUT_CONFIG_CLICK_METHOD_BUTTON_AREAS; 100 101 /* You can choose between: 102 LIBINPUT_CONFIG_SEND_EVENTS_ENABLED 103 LIBINPUT_CONFIG_SEND_EVENTS_DISABLED 104 LIBINPUT_CONFIG_SEND_EVENTS_DISABLED_ON_EXTERNAL_MOUSE 105 */ 106 static const uint32_t send_events_mode = LIBINPUT_CONFIG_SEND_EVENTS_ENABLED; 107 108 /* You can choose between: 109 LIBINPUT_CONFIG_ACCEL_PROFILE_FLAT 110 LIBINPUT_CONFIG_ACCEL_PROFILE_ADAPTIVE 111 */ 112 static const enum libinput_config_accel_profile accel_profile = LIBINPUT_CONFIG_ACCEL_PROFILE_ADAPTIVE; 113 static const double accel_speed = 0.0; 114 115 /* You can choose between: 116 LIBINPUT_CONFIG_TAP_MAP_LRM -- 1/2/3 finger tap maps to left/right/middle 117 LIBINPUT_CONFIG_TAP_MAP_LMR -- 1/2/3 finger tap maps to left/middle/right 118 */ 119 static const enum libinput_config_tap_button_map button_map = LIBINPUT_CONFIG_TAP_MAP_LRM; 120 121 /* If you want to use the windows key for MODKEY, use WLR_MODIFIER_LOGO */ 122 #define MODKEY WLR_MODIFIER_ALT 123 124 #define TAGKEYS(KEY,SKEY,TAG) \ 125 { MODKEY, KEY, view, {.ui = 1 << TAG} }, \ 126 { MODKEY|WLR_MODIFIER_CTRL, KEY, toggleview, {.ui = 1 << TAG} }, \ 127 { MODKEY|WLR_MODIFIER_SHIFT, SKEY, tag, {.ui = 1 << TAG} }, \ 128 { MODKEY|WLR_MODIFIER_CTRL|WLR_MODIFIER_SHIFT,SKEY,toggletag, {.ui = 1 << TAG} } 129 130 /* helper for spawning shell commands in the pre dwm-5.0 fashion */ 131 #define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } } 132 133 /* commands */ 134 static const char *termcmd[] = { "foot", NULL }; 135 static const char *menucmd[] = { "wmenu-run", NULL }; 136 137 static const Key keys[] = { 138 /* Note that Shift changes certain key codes: c -> C, 2 -> at, etc. */ 139 /* modifier key function argument */ 140 { MODKEY, XKB_KEY_p, spawn, {.v = menucmd} }, 141 { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_Return, spawn, {.v = termcmd} }, 142 { MODKEY, XKB_KEY_b, togglebar, {0} }, 143 { MODKEY, XKB_KEY_j, focusstack, {.i = +1} }, 144 { MODKEY, XKB_KEY_k, focusstack, {.i = -1} }, 145 { MODKEY, XKB_KEY_i, incnmaster, {.i = +1} }, 146 { MODKEY, XKB_KEY_d, incnmaster, {.i = -1} }, 147 { MODKEY, XKB_KEY_h, setmfact, {.f = -0.05f} }, 148 { MODKEY, XKB_KEY_l, setmfact, {.f = +0.05f} }, 149 { MODKEY|WLR_MODIFIER_LOGO, XKB_KEY_h, incgaps, {.i = +1 } }, 150 { MODKEY|WLR_MODIFIER_LOGO, XKB_KEY_l, incgaps, {.i = -1 } }, 151 { MODKEY|WLR_MODIFIER_LOGO|WLR_MODIFIER_SHIFT, XKB_KEY_H, incogaps, {.i = +1 } }, 152 { MODKEY|WLR_MODIFIER_LOGO|WLR_MODIFIER_SHIFT, XKB_KEY_L, incogaps, {.i = -1 } }, 153 { MODKEY|WLR_MODIFIER_LOGO|WLR_MODIFIER_CTRL, XKB_KEY_h, incigaps, {.i = +1 } }, 154 { MODKEY|WLR_MODIFIER_LOGO|WLR_MODIFIER_CTRL, XKB_KEY_l, incigaps, {.i = -1 } }, 155 { MODKEY|WLR_MODIFIER_LOGO, XKB_KEY_0, togglegaps, {0} }, 156 { MODKEY|WLR_MODIFIER_LOGO|WLR_MODIFIER_SHIFT, XKB_KEY_parenright,defaultgaps, {0} }, 157 { MODKEY, XKB_KEY_y, incihgaps, {.i = +1 } }, 158 { MODKEY, XKB_KEY_o, incihgaps, {.i = -1 } }, 159 { MODKEY|WLR_MODIFIER_CTRL, XKB_KEY_y, incivgaps, {.i = +1 } }, 160 { MODKEY|WLR_MODIFIER_CTRL, XKB_KEY_o, incivgaps, {.i = -1 } }, 161 { MODKEY|WLR_MODIFIER_LOGO, XKB_KEY_y, incohgaps, {.i = +1 } }, 162 { MODKEY|WLR_MODIFIER_LOGO, XKB_KEY_o, incohgaps, {.i = -1 } }, 163 { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_Y, incovgaps, {.i = +1 } }, 164 { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_O, incovgaps, {.i = -1 } }, 165 { MODKEY, XKB_KEY_Return, zoom, {0} }, 166 { MODKEY, XKB_KEY_Tab, view, {0} }, 167 { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_C, killclient, {0} }, 168 { MODKEY, XKB_KEY_t, setlayout, {.v = &layouts[0]} }, 169 { MODKEY, XKB_KEY_f, setlayout, {.v = &layouts[1]} }, 170 { MODKEY, XKB_KEY_m, setlayout, {.v = &layouts[2]} }, 171 { MODKEY, XKB_KEY_space, setlayout, {0} }, 172 { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_space, togglefloating, {0} }, 173 { MODKEY, XKB_KEY_e, togglefullscreen, {0} }, 174 { MODKEY, XKB_KEY_0, view, {.ui = ~0} }, 175 { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_parenright, tag, {.ui = ~0} }, 176 { MODKEY, XKB_KEY_comma, focusmon, {.i = WLR_DIRECTION_LEFT} }, 177 { MODKEY, XKB_KEY_period, focusmon, {.i = WLR_DIRECTION_RIGHT} }, 178 { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_less, tagmon, {.i = WLR_DIRECTION_LEFT} }, 179 { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_greater, tagmon, {.i = WLR_DIRECTION_RIGHT} }, 180 TAGKEYS( XKB_KEY_1, XKB_KEY_exclam, 0), 181 TAGKEYS( XKB_KEY_2, XKB_KEY_at, 1), 182 TAGKEYS( XKB_KEY_3, XKB_KEY_numbersign, 2), 183 TAGKEYS( XKB_KEY_4, XKB_KEY_dollar, 3), 184 TAGKEYS( XKB_KEY_5, XKB_KEY_percent, 4), 185 TAGKEYS( XKB_KEY_6, XKB_KEY_asciicircum, 5), 186 TAGKEYS( XKB_KEY_7, XKB_KEY_ampersand, 6), 187 TAGKEYS( XKB_KEY_8, XKB_KEY_asterisk, 7), 188 TAGKEYS( XKB_KEY_9, XKB_KEY_parenleft, 8), 189 { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_Q, quit, {0} }, 190 191 /* Ctrl-Alt-Backspace and Ctrl-Alt-Fx used to be handled by X server */ 192 { WLR_MODIFIER_CTRL|WLR_MODIFIER_ALT,XKB_KEY_Terminate_Server, quit, {0} }, 193 /* Ctrl-Alt-Fx is used to switch to another VT, if you don't know what a VT is 194 * do not remove them. 195 */ 196 #define CHVT(n) { WLR_MODIFIER_CTRL|WLR_MODIFIER_ALT,XKB_KEY_XF86Switch_VT_##n, chvt, {.ui = (n)} } 197 CHVT(1), CHVT(2), CHVT(3), CHVT(4), CHVT(5), CHVT(6), 198 CHVT(7), CHVT(8), CHVT(9), CHVT(10), CHVT(11), CHVT(12), 199 }; 200 201 static const Button buttons[] = { 202 { ClkLtSymbol, 0, BTN_LEFT, setlayout, {.v = &layouts[0]} }, 203 { ClkLtSymbol, 0, BTN_RIGHT, setlayout, {.v = &layouts[2]} }, 204 { ClkTitle, 0, BTN_MIDDLE, zoom, {0} }, 205 { ClkStatus, 0, BTN_MIDDLE, spawn, {.v = termcmd} }, 206 { ClkClient, MODKEY, BTN_LEFT, moveresize, {.ui = CurMove} }, 207 { ClkClient, MODKEY, BTN_MIDDLE, togglefloating, {0} }, 208 { ClkClient, MODKEY, BTN_RIGHT, moveresize, {.ui = CurResize} }, 209 { ClkTagBar, 0, BTN_LEFT, view, {0} }, 210 { ClkTagBar, 0, BTN_RIGHT, toggleview, {0} }, 211 { ClkTagBar, MODKEY, BTN_LEFT, tag, {0} }, 212 { ClkTagBar, MODKEY, BTN_RIGHT, toggletag, {0} }, 213 };