config.def.h 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. /* See LICENSE file for copyright and license details. */
  2. /* appearance */
  3. static unsigned int borderpx = 1; /* border pixel of windows */
  4. static unsigned int snap = 32; /* snap pixel */
  5. static int showbar = 1; /* 0 means no bar */
  6. static int topbar = 1; /* 0 means bottom bar */
  7. static char font[] = "monospace:size=10";
  8. static char dmenufont[] = "monospace:size=10";
  9. static const char *fonts[] = { font };
  10. static char normbgcolor[] = "#222222";
  11. static char normbordercolor[] = "#444444";
  12. static char normfgcolor[] = "#bbbbbb";
  13. static char selfgcolor[] = "#eeeeee";
  14. static const unsigned int baralpha = 0xd0;
  15. static const unsigned int borderalpha = OPAQUE;
  16. static char selbordercolor[] = "#005577";
  17. static char selbgcolor[] = "#005577";
  18. static char *colors[][3] = {
  19. /* fg bg border */
  20. [SchemeNorm] = { normfgcolor, normbgcolor, normbordercolor },
  21. [SchemeSel] = { selfgcolor, selbgcolor, selbordercolor },
  22. };
  23. static const unsigned int alphas[][3] = {
  24. /* fg bg border */
  25. [SchemeNorm] = { OPAQUE, baralpha, borderalpha },
  26. [SchemeSel] = { OPAQUE, baralpha, borderalpha },
  27. };
  28. /* tagging */
  29. static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };
  30. static const Rule rules[] = {
  31. /* xprop(1):
  32. * WM_CLASS(STRING) = instance, class
  33. * WM_NAME(STRING) = title
  34. */
  35. /* class instance title tags mask isfloating monitor */
  36. { "Gimp", NULL, NULL, 0, 1, -1 },
  37. { "Firefox", NULL, NULL, 1 << 8, 0, -1 },
  38. };
  39. /* layout(s) */
  40. static float mfact = 0.55; /* factor of master area size [0.05..0.95] */
  41. static int nmaster = 1; /* number of clients in master area */
  42. static int resizehints = 1; /* 1 means respect size hints in tiled resizals */
  43. static const int lockfullscreen = 1; /* 1 will force focus on the fullscreen window */
  44. static const Layout layouts[] = {
  45. /* symbol arrange function */
  46. { "[]=", tile }, /* first entry is default */
  47. { "><>", NULL }, /* no layout function means floating behavior */
  48. { "[M]", monocle },
  49. };
  50. /* key definitions */
  51. #define MODKEY Mod4Mask
  52. #define TAGKEYS(KEY,TAG) \
  53. { MODKEY, KEY, view, {.ui = 1 << TAG} }, \
  54. { MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \
  55. { MODKEY|ShiftMask, KEY, tag, {.ui = 1 << TAG} }, \
  56. { MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG} },
  57. /* helper for spawning shell commands in the pre dwm-5.0 fashion */
  58. #define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
  59. /* commands */
  60. static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */
  61. static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", normbgcolor, "-nf", normfgcolor, "-sb", selbordercolor, "-sf", selfgcolor, NULL };
  62. static const char *termcmd[] = { "st", NULL };
  63. /*
  64. * Xresources preferences to load at startup
  65. */
  66. ResourcePref resources[] = {
  67. { "font", STRING, &font },
  68. { "dmenufont", STRING, &dmenufont },
  69. { "normbgcolor", STRING, &normbgcolor },
  70. { "normbordercolor", STRING, &normbordercolor },
  71. { "normfgcolor", STRING, &normfgcolor },
  72. { "selbgcolor", STRING, &selbgcolor },
  73. { "selbordercolor", STRING, &selbordercolor },
  74. { "selfgcolor", STRING, &selfgcolor },
  75. { "borderalpha", INTEGER, &borderalpha },
  76. { "baralpha", INTEGER, &baralpha },
  77. { "borderpx", INTEGER, &borderpx },
  78. { "snap", INTEGER, &snap },
  79. { "showbar", INTEGER, &showbar },
  80. { "topbar", INTEGER, &topbar },
  81. { "nmaster", INTEGER, &nmaster },
  82. { "resizehints", INTEGER, &resizehints },
  83. { "mfact", FLOAT, &mfact },
  84. };
  85. static Key keys[] = {
  86. /* modifier key function argument */
  87. { MODKEY, XK_p, spawn, {.v = dmenucmd } },
  88. { MODKEY|ShiftMask, XK_Return, spawn, {.v = termcmd } },
  89. { MODKEY, XK_b, togglebar, {0} },
  90. { MODKEY, XK_j, focusstack, {.i = +1 } },
  91. { MODKEY, XK_k, focusstack, {.i = -1 } },
  92. { MODKEY, XK_i, incnmaster, {.i = +1 } },
  93. { MODKEY, XK_d, incnmaster, {.i = -1 } },
  94. { MODKEY, XK_h, setmfact, {.f = -0.05} },
  95. { MODKEY, XK_l, setmfact, {.f = +0.05} },
  96. { MODKEY, XK_Return, zoom, {0} },
  97. { MODKEY, XK_Tab, view, {0} },
  98. { MODKEY|ShiftMask, XK_c, killclient, {0} },
  99. { MODKEY, XK_t, setlayout, {.v = &layouts[0]} },
  100. { MODKEY, XK_f, setlayout, {.v = &layouts[1]} },
  101. { MODKEY, XK_m, setlayout, {.v = &layouts[2]} },
  102. { MODKEY, XK_space, setlayout, {0} },
  103. { MODKEY|ShiftMask, XK_space, togglefloating, {0} },
  104. { MODKEY, XK_0, view, {.ui = ~0 } },
  105. { MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } },
  106. { MODKEY, XK_comma, focusmon, {.i = -1 } },
  107. { MODKEY, XK_period, focusmon, {.i = +1 } },
  108. { MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } },
  109. { MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } },
  110. TAGKEYS( XK_1, 0)
  111. TAGKEYS( XK_2, 1)
  112. TAGKEYS( XK_3, 2)
  113. TAGKEYS( XK_4, 3)
  114. TAGKEYS( XK_5, 4)
  115. TAGKEYS( XK_6, 5)
  116. TAGKEYS( XK_7, 6)
  117. TAGKEYS( XK_8, 7)
  118. TAGKEYS( XK_9, 8)
  119. { MODKEY|ShiftMask, XK_q, quit, {0} },
  120. };
  121. /* button definitions */
  122. /* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */
  123. static Button buttons[] = {
  124. /* click event mask button function argument */
  125. { ClkLtSymbol, 0, Button1, setlayout, {0} },
  126. { ClkLtSymbol, 0, Button3, setlayout, {.v = &layouts[2]} },
  127. { ClkWinTitle, 0, Button2, zoom, {0} },
  128. { ClkStatusText, 0, Button2, spawn, {.v = termcmd } },
  129. { ClkClientWin, MODKEY, Button1, movemouse, {0} },
  130. { ClkClientWin, MODKEY, Button2, togglefloating, {0} },
  131. { ClkClientWin, MODKEY, Button3, resizemouse, {0} },
  132. { ClkTagBar, 0, Button1, view, {0} },
  133. { ClkTagBar, 0, Button3, toggleview, {0} },
  134. { ClkTagBar, MODKEY, Button1, tag, {0} },
  135. { ClkTagBar, MODKEY, Button3, toggletag, {0} },
  136. };