My patched version of suckless' dwm.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

127 lines
6.5 KiB

  1. /* See LICENSE file for copyright and license details. */
  2. /* for media keys */
  3. #include <X11/XF86keysym.h>
  4. /* appearance */
  5. static const unsigned int borderpx = 1; /* border pixel of windows */
  6. static const unsigned int snap = 32; /* snap pixel */
  7. static const int showbar = 1; /* 0 means no bar */
  8. static const int topbar = 1; /* 0 means bottom bar */
  9. static const char *fonts[] = { "monospace:size=10", "Noto Color Emoji:size=11" };
  10. static const char dmenufont[] = "monospace:size=10";
  11. static const char col_gray1[] = "#222222";
  12. static const char col_gray2[] = "#444444";
  13. static const unsigned int baralpha = 0xff;
  14. static const unsigned int borderalpha = 0xff;
  15. static const char col_gray3[] = "#f7f7f7";
  16. static const char col_gray4[] = "#000000";
  17. static const char col_cyan[] = "#a62238";
  18. static const char *colors[][3] = {
  19. /* fg bg border */
  20. [SchemeNorm] = { col_gray3, col_gray1, col_gray2 },
  21. [SchemeSel] = { col_gray4, col_cyan, col_gray3 },
  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 isCentered isfloating monitor */
  36. { "Gimp", NULL, NULL, 0, 0, 1, -1 },
  37. { "Firefox", NULL, NULL, 1 << 8, 0, 0, -1 },
  38. { NULL, "de.uol.swp.client.ClientApp", NULL, 0, 0, 1, -1 },
  39. };
  40. /* layout(s) */
  41. static const float mfact = 0.5; /* factor of master area size [0.05..0.95] */
  42. static const int nmaster = 1; /* number of clients in master area */
  43. static const int resizehints = 1; /* 1 means respect size hints in tiled resizals */
  44. static const Layout layouts[] = {
  45. /* symbol arrange function */
  46. { "[M]", monocle },
  47. { "[]=", tile }, /* first entry is default */
  48. { "[D]", deck },
  49. { "><>", NULL }, /* no layout function means floating behavior */
  50. };
  51. /* key definitions */
  52. #define MODKEY Mod4Mask
  53. #define TAGKEYS(KEY,TAG) \
  54. { MODKEY, KEY, view, {.ui = 1 << TAG} }, \
  55. { MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \
  56. { MODKEY|ShiftMask, KEY, tag, {.ui = 1 << TAG} }, \
  57. { MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG} },
  58. /* helper for spawning shell commands in the pre dwm-5.0 fashion */
  59. #define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
  60. /* commands */
  61. static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */
  62. static const char *dmenucmd[] = { "dmenu_run", "-c", "-l", "20", NULL };
  63. static Key keys[] = {
  64. /* modifier key function argument */
  65. { MODKEY|ShiftMask, XK_Escape, quit, {0} },
  66. { MODKEY|ShiftMask, XK_b, togglebar, {0} },
  67. { MODKEY|ShiftMask, XK_c, setlayout, {.v = &layouts[2]} },
  68. { MODKEY|ShiftMask, XK_d, togglefloating, {0} },
  69. { MODKEY|ShiftMask, XK_f, togglefullscr, {0} },
  70. { MODKEY, XK_h, focusstack, {.i = -1 } },
  71. { MODKEY|ShiftMask, XK_h, zoom, {0} },
  72. { MODKEY, XK_j, focusstack, {.i = +1 } },
  73. { MODKEY|ShiftMask, XK_j, zoom, {0} },
  74. { MODKEY, XK_k, focusstack, {.i = -1 } },
  75. { MODKEY|ShiftMask, XK_k, zoom, {0} },
  76. { MODKEY, XK_l, focusstack, {.i = +1 } },
  77. { MODKEY|ShiftMask, XK_m, setlayout, {.v = &layouts[0]} },
  78. { MODKEY|ShiftMask, XK_o, setmfact, {.f = +0.05} },
  79. { MODKEY, XK_q, killclient, {0} },
  80. { MODKEY|ShiftMask, XK_t, setlayout, {.v = &layouts[1]} },
  81. { MODKEY|ShiftMask, XK_z, setmfact, {.f = -0.05} },
  82. { MODKEY, XK_0, view, {.ui = ~0 } },
  83. { MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } },
  84. { MODKEY, XK_comma, focusmon, {.i = -1 } },
  85. { MODKEY, XK_period, focusmon, {.i = +1 } },
  86. { MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } },
  87. { MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } },
  88. //{ MODKEY|ShiftMask, XK_o, incnmaster, {.i = +1 } },
  89. //{ MODKEY|ShiftMask, XK_z, incnmaster, {.i = -1 } },
  90. //{ MODKEY, XK_space, setlayout, {0} },
  91. TAGKEYS( XK_1, 0)
  92. TAGKEYS( XK_2, 1)
  93. TAGKEYS( XK_3, 2)
  94. TAGKEYS( XK_4, 3)
  95. TAGKEYS( XK_5, 4)
  96. TAGKEYS( XK_6, 5)
  97. TAGKEYS( XK_7, 6)
  98. TAGKEYS( XK_8, 7)
  99. TAGKEYS( XK_9, 8)
  100. };
  101. /* button definitions */
  102. /* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */
  103. static Button buttons[] = {
  104. /* click event mask button function argument */
  105. { ClkLtSymbol, 0, Button1, setlayout, {0} },
  106. { ClkLtSymbol, 0, Button3, setlayout, {.v = &layouts[2]} },
  107. { ClkWinTitle, 0, Button2, zoom, {0} },
  108. { ClkClientWin, MODKEY, Button1, movemouse, {0} },
  109. { ClkClientWin, MODKEY, Button2, togglefloating, {0} },
  110. { ClkClientWin, MODKEY, Button3, resizemouse, {0} },
  111. { ClkTagBar, 0, Button1, view, {0} },
  112. { ClkTagBar, 0, Button3, toggleview, {0} },
  113. { ClkTagBar, MODKEY, Button1, tag, {0} },
  114. { ClkTagBar, MODKEY, Button3, toggletag, {0} },
  115. };