config.h 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. /* See LICENSE file for copyright and license details. */
  2. /* appearance */
  3. static const unsigned int borderpx = 1; /* border pixel of windows */
  4. static const unsigned int snap = 32; /* snap pixel */
  5. static const unsigned int gappih = 0; /* horiz inner gap between windows */
  6. static const unsigned int gappiv = 0; /* vert inner gap between windows */
  7. static const unsigned int gappoh = 0; /* horiz outer gap between windows and screen edge */
  8. static const unsigned int gappov = 0; /* vert outer gap between windows and screen edge */
  9. static const int swallowfloating = 0; /* 1 means swallow floating windows by default */
  10. static const int smartgaps = 1; /* 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[] = { "Hack:pixelsize=14" };
  14. static const char dmenufont[] = "Hack:pixelsize=14";
  15. static char normbgcolor[] = "#222222";
  16. static char normbordercolor[] = "#444444";
  17. static char normfgcolor[] = "#bbbbbb";
  18. static char selfgcolor[] = "#eeeeee";
  19. static char selbordercolor[] = "#005577";
  20. static char selbgcolor[] = "#005577";
  21. static char col_yellow[] = "#FFFF00";
  22. static char col_red[] = "#FF0000";
  23. static char *colors[][3] = {
  24. /* fg bg border */
  25. [SchemeNorm] = { normfgcolor, normbgcolor, normbordercolor },
  26. [SchemeSel] = { selfgcolor, selbgcolor, selbordercolor },
  27. [SchemeWarn] = { col_yellow, normbgcolor, normbordercolor },
  28. [SchemeUrgent] = { col_red, normbgcolor, normbordercolor },
  29. };
  30. static const unsigned int baralpha = 0xcc;
  31. static const unsigned int borderalpha = 0xcc;
  32. static const unsigned int alphas[][3] = {
  33. /* fg bg border */
  34. [SchemeNorm] = { OPAQUE, baralpha, borderalpha },
  35. [SchemeSel] = { OPAQUE, baralpha, borderalpha },
  36. [SchemeWarn] = { OPAQUE, baralpha, borderalpha },
  37. [SchemeUrgent]={ OPAQUE, baralpha, borderalpha },
  38. };
  39. /* tagging */
  40. static const char *tags[] = { "一", "二", "三", "四", "五", "六", "七", "八", "九" };
  41. static const Rule rules[] = {
  42. /* xprop(1):
  43. * WM_CLASS(STRING) = instance, class
  44. * WM_NAME(STRING) = title
  45. */
  46. /* class instance title tags mask isfloating isterminal noswallow monitor */
  47. { "Firefox", NULL, NULL, 1 << 8, 0, 0, -1, -1 },
  48. { "St", NULL, NULL, 0, 0, 1, 0, -1 },
  49. { "Riot", NULL, NULL, 1 << 1, 0, 0, 0, -1 },
  50. { "origin.exe", "origin.exe", NULL, 0, 0, 0, 0, 1 },
  51. };
  52. /* layout(s) */
  53. static const float mfact = 0.55; /* factor of master area size [0.05..0.95] */
  54. static const int nmaster = 1; /* number of clients in master area */
  55. static const int resizehints = 0; /* 1 means respect size hints in tiled resizals */
  56. static const Layout layouts[] = {
  57. /* symbol arrange function */
  58. { "[]=", tile }, /* first entry is default */
  59. { "><>", NULL }, /* no layout function means floating behavior */
  60. { "[M]", monocle },
  61. { "|M|", centeredmaster },
  62. { ">M>", centeredfloatingmaster },
  63. };
  64. /* key definitions */
  65. #define MODKEY Mod1Mask
  66. #define TAGKEYS(KEY,TAG) \
  67. { MODKEY, KEY, comboview, {.ui = 1 << TAG} }, \
  68. { MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \
  69. { MODKEY|ShiftMask, KEY, combotag, {.ui = 1 << TAG} }, \
  70. { MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG} },
  71. /* helper for spawning shell commands in the pre dwm-5.0 fashion */
  72. #define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
  73. /* commands */
  74. static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */
  75. static const char *dmenucmd[] = { "rofi", "-show", "run", NULL };
  76. static const char *termcmd[] = { "st", "tmux", NULL };
  77. static const char scratchpadname[] = "scratchpad";
  78. static const char *scratchpadcmd[] = { "st", "-t", scratchpadname, "-g", "120x34", NULL };
  79. static Key keys[] = {
  80. /* modifier key function argument */
  81. { MODKEY, XK_p, spawn, {.v = dmenucmd } },
  82. { MODKEY|ShiftMask, XK_Return, spawn, {.v = termcmd } },
  83. { MODKEY, XK_s, togglescratch, {.v = scratchpadcmd } },
  84. { MODKEY, XK_b, togglebar, {0} },
  85. { MODKEY, XK_j, focusstack, {.i = +1 } },
  86. { MODKEY, XK_k, focusstack, {.i = -1 } },
  87. { MODKEY, XK_i, incnmaster, {.i = +1 } },
  88. { MODKEY, XK_d, incnmaster, {.i = -1 } },
  89. { MODKEY, XK_h, setmfact, {.f = -0.05} },
  90. { MODKEY, XK_l, setmfact, {.f = +0.05} },
  91. { MODKEY, XK_g, incrgaps, {.i = +5 } },
  92. { MODKEY|ShiftMask, XK_g, incrgaps, {.i = -5 } },
  93. { MODKEY, XK_Return, zoom, {0} },
  94. { MODKEY, XK_Tab, view, {0} },
  95. { MODKEY, XK_q, killclient, {0} },
  96. { MODKEY, XK_t, setlayout, {.v = &layouts[0]} },
  97. { MODKEY, XK_f, setlayout, {.v = &layouts[1]} },
  98. { MODKEY, XK_m, setlayout, {.v = &layouts[2]} },
  99. { MODKEY, XK_u, setlayout, {.v = &layouts[3]} },
  100. { MODKEY, XK_o, setlayout, {.v = &layouts[4]} },
  101. { MODKEY, XK_space, setlayout, {0} },
  102. { MODKEY|ShiftMask, XK_space, togglefloating, {0} },
  103. { MODKEY, XK_0, view, {.ui = ~0 } },
  104. { MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } },
  105. { MODKEY, XK_comma, focusmon, {.i = -1 } },
  106. { MODKEY, XK_period, focusmon, {.i = +1 } },
  107. { MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } },
  108. { MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } },
  109. TAGKEYS( XK_1, 0)
  110. TAGKEYS( XK_2, 1)
  111. TAGKEYS( XK_3, 2)
  112. TAGKEYS( XK_4, 3)
  113. TAGKEYS( XK_5, 4)
  114. TAGKEYS( XK_6, 5)
  115. TAGKEYS( XK_7, 6)
  116. TAGKEYS( XK_8, 7)
  117. TAGKEYS( XK_9, 8)
  118. { MODKEY|ShiftMask, XK_q, quit, {0} },
  119. { MODKEY|ShiftMask, XK_r, quit, {1} },
  120. { MODKEY, XK_c, xrdb, {.v = NULL } },
  121. };
  122. /* button definitions */
  123. /* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */
  124. static Button buttons[] = {
  125. /* click event mask button function argument */
  126. { ClkLtSymbol, 0, Button1, setlayout, {0} },
  127. { ClkLtSymbol, 0, Button3, setlayout, {.v = &layouts[2]} },
  128. { ClkWinTitle, 0, Button2, zoom, {0} },
  129. { ClkStatusText, 0, Button2, spawn, {.v = termcmd } },
  130. { ClkClientWin, MODKEY, Button1, movemouse, {0} },
  131. { ClkClientWin, MODKEY, Button2, togglefloating, {0} },
  132. { ClkClientWin, MODKEY, Button3, resizemouse, {0} },
  133. { ClkTagBar, 0, Button1, view, {0} },
  134. { ClkTagBar, 0, Button3, toggleview, {0} },
  135. { ClkTagBar, MODKEY, Button1, tag, {0} },
  136. { ClkTagBar, MODKEY, Button3, toggletag, {0} },
  137. };