config.def.h.orig 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  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 unsigned int borderpx = 1; /* border pixel of windows */
  10. static const int showbar = 1; /* 0 means no bar */
  11. static const int topbar = 1; /* 0 means bottom bar */
  12. static const char *fonts[] = {"monospace:size=10"};
  13. static const float rootcolor[] = COLOR(0x000000ff);
  14. /* This conforms to the xdg-protocol. Set the alpha to zero to restore the old behavior */
  15. static const float fullscreen_bg[] = {0.1f, 0.1f, 0.1f, 1.0f}; /* You can also use glsl colors */
  16. static uint32_t colors[][3] = {
  17. /* fg bg border */
  18. [SchemeNorm] = { 0xbbbbbbff, 0x222222ff, 0x444444ff },
  19. [SchemeSel] = { 0xeeeeeeff, 0x005577ff, 0x005577ff },
  20. [SchemeUrg] = { 0, 0, 0x770000ff },
  21. };
  22. /* keyboard layout change notification for status bar */
  23. static const char kblayout_file[] = "/tmp/dwl-keymap";
  24. static const char *kblayout_cmd[] = {"pkill", "-RTMIN+3", "someblocks", NULL};
  25. /* tagging - TAGCOUNT must be no greater than 31 */
  26. #define TAGCOUNT (9)
  27. static char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };
  28. /* logging */
  29. static int log_level = WLR_ERROR;
  30. /* Autostart */
  31. static const char *const autostart[] = {
  32. "wbg", "/path/to/your/image", NULL,
  33. NULL /* terminate */
  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. /* layout(s) */
  43. static const Layout layouts[] = {
  44. /* symbol arrange function */
  45. { "[]=", tile },
  46. { "><>", NULL }, /* no layout function means floating behavior */
  47. { "[M]", monocle },
  48. { "TTT", bstack },
  49. { "===", bstackhoriz },
  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. /* keyboard */
  66. static const struct xkb_rule_names xkb_rules = {
  67. /* can specify fields: rules, model, layout, variant, options */
  68. /* example:
  69. .options = "ctrl:nocaps",
  70. */
  71. .options = NULL,
  72. };
  73. static const int repeat_rate = 25;
  74. static const int repeat_delay = 600;
  75. /* Trackpad */
  76. static const int tap_to_click = 1;
  77. static const int tap_and_drag = 1;
  78. static const int drag_lock = 1;
  79. static const int natural_scrolling = 0;
  80. static const int disable_while_typing = 1;
  81. static const int left_handed = 0;
  82. static const int middle_button_emulation = 0;
  83. /* You can choose between:
  84. LIBINPUT_CONFIG_SCROLL_NO_SCROLL
  85. LIBINPUT_CONFIG_SCROLL_2FG
  86. LIBINPUT_CONFIG_SCROLL_EDGE
  87. LIBINPUT_CONFIG_SCROLL_ON_BUTTON_DOWN
  88. */
  89. static const enum libinput_config_scroll_method scroll_method = LIBINPUT_CONFIG_SCROLL_2FG;
  90. /* You can choose between:
  91. LIBINPUT_CONFIG_CLICK_METHOD_NONE
  92. LIBINPUT_CONFIG_CLICK_METHOD_BUTTON_AREAS
  93. LIBINPUT_CONFIG_CLICK_METHOD_CLICKFINGER
  94. */
  95. static const enum libinput_config_click_method click_method = LIBINPUT_CONFIG_CLICK_METHOD_BUTTON_AREAS;
  96. /* You can choose between:
  97. LIBINPUT_CONFIG_SEND_EVENTS_ENABLED
  98. LIBINPUT_CONFIG_SEND_EVENTS_DISABLED
  99. LIBINPUT_CONFIG_SEND_EVENTS_DISABLED_ON_EXTERNAL_MOUSE
  100. */
  101. static const uint32_t send_events_mode = LIBINPUT_CONFIG_SEND_EVENTS_ENABLED;
  102. /* You can choose between:
  103. LIBINPUT_CONFIG_ACCEL_PROFILE_FLAT
  104. LIBINPUT_CONFIG_ACCEL_PROFILE_ADAPTIVE
  105. */
  106. static const enum libinput_config_accel_profile accel_profile = LIBINPUT_CONFIG_ACCEL_PROFILE_ADAPTIVE;
  107. static const double accel_speed = 0.0;
  108. /* You can choose between:
  109. LIBINPUT_CONFIG_TAP_MAP_LRM -- 1/2/3 finger tap maps to left/right/middle
  110. LIBINPUT_CONFIG_TAP_MAP_LMR -- 1/2/3 finger tap maps to left/middle/right
  111. */
  112. static const enum libinput_config_tap_button_map button_map = LIBINPUT_CONFIG_TAP_MAP_LRM;
  113. static const int cursor_timeout = 5;
  114. /* If you want to use the windows key for MODKEY, use WLR_MODIFIER_LOGO */
  115. #define MODKEY WLR_MODIFIER_ALT
  116. #define TAGKEYS(KEY,SKEY,TAG) \
  117. { MODKEY, KEY, view, {.ui = 1 << TAG} }, \
  118. { MODKEY|WLR_MODIFIER_CTRL, KEY, toggleview, {.ui = 1 << TAG} }, \
  119. { MODKEY|WLR_MODIFIER_SHIFT, SKEY, tag, {.ui = 1 << TAG} }, \
  120. { MODKEY|WLR_MODIFIER_CTRL|WLR_MODIFIER_SHIFT,SKEY,toggletag, {.ui = 1 << TAG} }
  121. /* helper for spawning shell commands in the pre dwm-5.0 fashion */
  122. #define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
  123. /* commands */
  124. static const char *termcmd[] = { "foot", NULL };
  125. static const char *menucmd[] = { "wmenu-run", NULL };
  126. static const Key keys[] = {
  127. /* Note that Shift changes certain key codes: c -> C, 2 -> at, etc. */
  128. /* modifier key function argument */
  129. { MODKEY, XKB_KEY_p, spawn, {.v = menucmd} },
  130. { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_Return, spawn, {.v = termcmd} },
  131. { MODKEY, XKB_KEY_b, togglebar, {0} },
  132. { MODKEY, XKB_KEY_j, focusstack, {.i = +1} },
  133. { MODKEY, XKB_KEY_k, focusstack, {.i = -1} },
  134. { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_J, movestack, {.i = +1} },
  135. { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_K, movestack, {.i = -1} },
  136. { MODKEY, XKB_KEY_i, incnmaster, {.i = +1} },
  137. { MODKEY, XKB_KEY_d, incnmaster, {.i = -1} },
  138. { MODKEY, XKB_KEY_h, setmfact, {.f = -0.05f} },
  139. { MODKEY, XKB_KEY_l, setmfact, {.f = +0.05f} },
  140. { MODKEY, XKB_KEY_Return, zoom, {0} },
  141. { MODKEY, XKB_KEY_Tab, view, {0} },
  142. { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_C, killclient, {0} },
  143. { MODKEY, XKB_KEY_t, setlayout, {.v = &layouts[0]} },
  144. { MODKEY, XKB_KEY_f, setlayout, {.v = &layouts[1]} },
  145. { MODKEY, XKB_KEY_m, setlayout, {.v = &layouts[2]} },
  146. { MODKEY, XKB_KEY_u, setlayout, {.v = &layouts[3]} },
  147. { MODKEY, XKB_KEY_o, setlayout, {.v = &layouts[4]} },
  148. { MODKEY, XKB_KEY_space, setlayout, {0} },
  149. { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_space, togglefloating, {0} },
  150. { MODKEY, XKB_KEY_e, togglefullscreen, {0} },
  151. { MODKEY, XKB_KEY_0, view, {.ui = ~0} },
  152. { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_parenright, tag, {.ui = ~0} },
  153. { MODKEY, XKB_KEY_comma, focusmon, {.i = WLR_DIRECTION_LEFT} },
  154. { MODKEY, XKB_KEY_period, focusmon, {.i = WLR_DIRECTION_RIGHT} },
  155. { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_less, tagmon, {.i = WLR_DIRECTION_LEFT} },
  156. { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_greater, tagmon, {.i = WLR_DIRECTION_RIGHT} },
  157. TAGKEYS( XKB_KEY_1, XKB_KEY_exclam, 0),
  158. TAGKEYS( XKB_KEY_2, XKB_KEY_at, 1),
  159. TAGKEYS( XKB_KEY_3, XKB_KEY_numbersign, 2),
  160. TAGKEYS( XKB_KEY_4, XKB_KEY_dollar, 3),
  161. TAGKEYS( XKB_KEY_5, XKB_KEY_percent, 4),
  162. TAGKEYS( XKB_KEY_6, XKB_KEY_asciicircum, 5),
  163. TAGKEYS( XKB_KEY_7, XKB_KEY_ampersand, 6),
  164. TAGKEYS( XKB_KEY_8, XKB_KEY_asterisk, 7),
  165. TAGKEYS( XKB_KEY_9, XKB_KEY_parenleft, 8),
  166. { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_Q, quit, {0} },
  167. /* Ctrl-Alt-Backspace and Ctrl-Alt-Fx used to be handled by X server */
  168. { WLR_MODIFIER_CTRL|WLR_MODIFIER_ALT,XKB_KEY_Terminate_Server, quit, {0} },
  169. /* Ctrl-Alt-Fx is used to switch to another VT, if you don't know what a VT is
  170. * do not remove them.
  171. */
  172. #define CHVT(n) { WLR_MODIFIER_CTRL|WLR_MODIFIER_ALT,XKB_KEY_XF86Switch_VT_##n, chvt, {.ui = (n)} }
  173. CHVT(1), CHVT(2), CHVT(3), CHVT(4), CHVT(5), CHVT(6),
  174. CHVT(7), CHVT(8), CHVT(9), CHVT(10), CHVT(11), CHVT(12),
  175. };
  176. static const Button buttons[] = {
  177. { ClkLtSymbol, 0, BTN_LEFT, setlayout, {.v = &layouts[0]} },
  178. { ClkLtSymbol, 0, BTN_RIGHT, setlayout, {.v = &layouts[2]} },
  179. { ClkTitle, 0, BTN_MIDDLE, zoom, {0} },
  180. { ClkStatus, 0, BTN_MIDDLE, spawn, {.v = termcmd} },
  181. { ClkClient, MODKEY, BTN_LEFT, moveresize, {.ui = CurMove} },
  182. { ClkClient, MODKEY, BTN_MIDDLE, togglefloating, {0} },
  183. { ClkClient, MODKEY, BTN_RIGHT, moveresize, {.ui = CurResize} },
  184. { ClkTagBar, 0, BTN_LEFT, view, {0} },
  185. { ClkTagBar, 0, BTN_RIGHT, toggleview, {0} },
  186. { ClkTagBar, MODKEY, BTN_LEFT, tag, {0} },
  187. { ClkTagBar, MODKEY, BTN_RIGHT, toggletag, {0} },
  188. };