config.h 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. /* See LICENSE file for copyright and license details. */
  2. /* appearance */
  3. static const char *fonts[] = {
  4. "Terminus:pixelsize=20:style=Bold",
  5. "M+ 2p medium:size=16",
  6. };
  7. static const char dmenufont[] = "Terminus:pixelsize=20:style=Bold";
  8. /*
  9. static const char normbordercolor[] = "#222222";
  10. static const char normbgcolor[] = "#2c0d2a";
  11. static const char normfgcolor[] = "#bbbbbb";
  12. static const char selbordercolor[] = "#467874";
  13. static const char selbgcolor[] = "#467874";
  14. static const char selfgcolor[] = "#eeeeee";
  15. */
  16. #define NUMCOLORS 6
  17. static const char colors[NUMCOLORS][MAXCOLORS][8] = {
  18. // border foreground background
  19. /*
  20. { "#222222", "#bbbbbb", "#2c0d2a" }, // normal
  21. { "#467874", "#eeeeee", "#467874" }, // selected
  22. { "#467874", "#bbbbbb", "#521930" }, // song
  23. { "#467874", "#bbbbbb", "#360027" }, // alt1
  24. { "#467874", "#bbbbbb", "#2a0036" }, // alt2
  25. */
  26. { "#222222", "#563d54", "#2c0d2a" }, // normal
  27. { "#467874", "#e0e0e0", "#2c0d2a" }, // selected
  28. { "#467874", "#b50082", "#2c0d2a" }, // song
  29. { "#467874", "#4c3a42", "#2c0d2a" }, // alt1
  30. { "#467874", "#4c3a42", "#2c0d2a" }, // alt2
  31. { "#467874", "#e0e0e0", "#467874" }, // user
  32. // add more here
  33. // some old colors, to be remembered
  34. /*
  35. { "#222222", "#bbbbbb", "#2c083a" }, // normal
  36. { "#433a8c", "#eeeeee", "#433a8c" }, // selected
  37. { "#433a8c", "#bbbbbb", "#2c083a" }, // ip
  38. { "#433a8c", "#eeeeee", "#433a8c" }, // username
  39. */
  40. };
  41. static const unsigned int borderpx = 0; /* border pixel of windows */
  42. static const unsigned int snap = 32; /* snap pixel */
  43. static const int showbar = 1; /* 0 means no bar */
  44. static const int topbar = 0; /* 0 means bottom bar */
  45. static const int extrabar = 0;
  46. static const int gappx = 32;
  47. /* tagging */
  48. static const char *tags[] = { "一","二", "三", "四", "五", "六", "七", "八", "九" };
  49. static const Rule rules[] = {
  50. /* xprop(1):
  51. * WM_CLASS(STRING) = instance, class
  52. * WM_NAME(STRING) = title
  53. */
  54. /* class instance title tags mask isfloating monitor */
  55. { "Gimp", NULL, NULL, 0, 1, -1 },
  56. { "Firefox", NULL, NULL, 1 << 8, 0, -1 },
  57. { "Xfe", NULL, NULL, 0, 1, -1 },
  58. { "Wine", "th123.exe", NULL, 0, 1, -1 },
  59. { "mpv", NULL, "mpv", 0, 1, -1 },
  60. };
  61. /* layout(s) */
  62. static const float mfact = 0.65; /* factor of master area size [0.05..0.95] */
  63. static const int nmaster = 1; /* number of clients in master area */
  64. static const int resizehints = 0; /* 1 means respect size hints in tiled resizals */
  65. static const Layout layouts[] = {
  66. /* symbol arrange function */
  67. { "[]=", tile }, /* first entry is default */
  68. { "><>", NULL }, /* no layout function means floating behavior */
  69. { "[M]", monocle },
  70. };
  71. /* key definitions */
  72. #define MODKEY Mod1Mask
  73. #define TAGKEYS(KEY,TAG) \
  74. { MODKEY, KEY, view, {.ui = 1 << TAG} }, \
  75. { MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \
  76. { MODKEY|ShiftMask, KEY, tag, {.ui = 1 << TAG} }, \
  77. { MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG} },
  78. /* helper for spawning shell commands in the pre dwm-5.0 fashion */
  79. #define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
  80. /* commands */
  81. static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */
  82. //static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", normbgcolor, "-nf", normfgcolor, "-sb", selbgcolor, "-sf", selfgcolor, NULL };
  83. static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", colors[0][2], "-nf", colors[0][1], "-sb", colors[1][2], "-sf", colors[1][1], NULL };
  84. static const char *termcmd[] = { "st", NULL };
  85. static const char *surfcmd[] = { "surf", "~/dotfiles/startpage/index.html", NULL };
  86. static const char *rovercmd[] = { "st", "rover", NULL };
  87. static const char *cmuscmd[] = { "st", "cmus", NULL };
  88. static const char *xfecmd[] = { "xfe", NULL };
  89. static const char *cmusartcmd[] = { "cmusart", NULL };
  90. #include "movestack.c"
  91. static Key keys[] = {
  92. /* modifier key function argument */
  93. { MODKEY, XK_p, spawn, {.v = dmenucmd } },
  94. { MODKEY|ShiftMask, XK_Return, spawn, {.v = termcmd } },
  95. { MODKEY|ShiftMask, XK_t, spawn, {.v = termcmd } },
  96. { MODKEY|ShiftMask, XK_s, spawn, {.v = surfcmd } },
  97. { MODKEY|ShiftMask, XK_r, spawn, {.v = rovercmd } },
  98. { MODKEY|ShiftMask, XK_z, spawn, {.v = cmuscmd } },
  99. { MODKEY, XK_e, spawn, {.v = xfecmd } },
  100. { MODKEY|ShiftMask, XK_u, spawn, {.v = cmusartcmd } },
  101. { MODKEY, XK_b, togglebar, {0} },
  102. //{ MODKEY, XK_b, toggleextrabar, {0} },
  103. { MODKEY|ShiftMask, XK_b, toggleextrabar, {0} },
  104. { MODKEY, XK_j, focusstack, {.i = +1 } },
  105. { MODKEY, XK_k, focusstack, {.i = -1 } },
  106. { MODKEY, XK_i, incnmaster, {.i = +1 } },
  107. { MODKEY, XK_d, incnmaster, {.i = -1 } },
  108. { MODKEY, XK_h, setmfact, {.f = -0.05} },
  109. { MODKEY, XK_l, setmfact, {.f = +0.05} },
  110. { MODKEY, XK_Return, zoom, {0} },
  111. { MODKEY, XK_Tab, view, {0} },
  112. { MODKEY|ShiftMask, XK_c, killclient, {0} },
  113. { MODKEY, XK_t, setlayout, {.v = &layouts[0]} },
  114. { MODKEY, XK_f, setlayout, {.v = &layouts[1]} },
  115. { MODKEY, XK_m, setlayout, {.v = &layouts[2]} },
  116. { MODKEY, XK_space, setlayout, {0} },
  117. { MODKEY|ShiftMask, XK_space, togglefloating, {0} },
  118. { MODKEY, XK_0, view, {.ui = ~0 } },
  119. { MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } },
  120. { MODKEY, XK_comma, focusmon, {.i = -1 } },
  121. { MODKEY, XK_period, focusmon, {.i = +1 } },
  122. { MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } },
  123. { MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } },
  124. TAGKEYS( XK_1, 0)
  125. TAGKEYS( XK_2, 1)
  126. TAGKEYS( XK_3, 2)
  127. TAGKEYS( XK_4, 3)
  128. TAGKEYS( XK_5, 4)
  129. TAGKEYS( XK_6, 5)
  130. TAGKEYS( XK_7, 6)
  131. TAGKEYS( XK_8, 7)
  132. TAGKEYS( XK_9, 8)
  133. { MODKEY|ShiftMask, XK_j, movestack, {.i = +1 } },
  134. { MODKEY|ShiftMask, XK_k, movestack, {.i = -1 } },
  135. { MODKEY|ShiftMask, XK_q, quit, {0} },
  136. };
  137. /* button definitions */
  138. /* click can be ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */
  139. static Button buttons[] = {
  140. /* click event mask button function argument */
  141. { ClkLtSymbol, 0, Button1, setlayout, {0} },
  142. { ClkLtSymbol, 0, Button3, setlayout, {.v = &layouts[2]} },
  143. { ClkWinTitle, 0, Button2, zoom, {0} },
  144. { ClkStatusText, 0, Button2, spawn, {.v = termcmd } },
  145. { ClkClientWin, MODKEY, Button1, movemouse, {0} },
  146. { ClkClientWin, MODKEY, Button2, togglefloating, {0} },
  147. { ClkClientWin, MODKEY, Button3, resizemouse, {0} },
  148. { ClkTagBar, 0, Button1, view, {0} },
  149. { ClkTagBar, 0, Button3, toggleview, {0} },
  150. { ClkTagBar, MODKEY, Button1, tag, {0} },
  151. { ClkTagBar, MODKEY, Button3, toggletag, {0} },
  152. };