config.h 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. /* See LICENSE file for copyright and license details. */
  2. #include "push.c"
  3. /* appearance */
  4. static const unsigned int borderpx = 1; /* border pixel of windows */
  5. static const unsigned int gappx = 0; /* gaps between 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[] = { "JetBrainsMono:size=8:antialias=true:autohint=true" };
  10. static const char dmenufont[] = "JetBrainsMono:size=8:antialias=true:autohint=true";
  11. static const char col_gray1[] = "#1f2024"; /* "#5d6f74"; */
  12. static const char col_gray2[] = "#c6c6c6";
  13. static const char col_gray3[] = "#7289bc";
  14. static const char col_gray4[] = "#484b58";
  15. static const char col_cyan[] = "#282b33";
  16. static const char *colors[][3] = {
  17. /* fg bg border */
  18. [SchemeNorm] = { col_gray2, col_cyan, col_cyan },
  19. [SchemeSel] = { col_gray2, col_gray4, col_gray3 },
  20. };
  21. /* tagging */
  22. static const char *tags[] = { "α", "β", "γ", "δ", "ε", "ζ", "η", "θ", "ι" };
  23. static const Rule rules[] = {
  24. /* xprop(1):
  25. * WM_CLASS(STRING) = instance, class
  26. * WM_NAME(STRING) = title
  27. */
  28. /* class instance title tags mask isfloating monitor */
  29. { "Emacs", NULL, NULL, 1 << 1, 0, -1 },
  30. { "qutebrowser", NULL, NULL, 1 << 2, 0, -1 },
  31. { "Firefox", NULL, NULL, 1 << 2, 0, -1 },
  32. { "Telegram", NULL, NULL, 1 << 5, 0, -1 },
  33. { "Ardour", NULL, NULL, 1 << 6, 0, -1 },
  34. { "Gimp", NULL, NULL, 1 << 6, 0, -1 },
  35. { "Drawing", NULL, NULL, 1 << 6, 0, -1 },
  36. };
  37. /* layout(s) */
  38. static const float mfact = 0.5; /* factor of master area size [0.05..0.95] */
  39. static const int nmaster = 1; /* number of clients in master area */
  40. static const int resizehints = 0; /* 1 means respect size hints in tiled resizals */
  41. static const int lockfullscreen = 1; /* 1 will force focus on the fullscreen window */
  42. static const Layout layouts[] = {
  43. /* symbol arrange function */
  44. { "[∀x]", tile }, /* first entry is default */
  45. { "[¬l]", NULL }, /* no layout function means floating behavior */
  46. { "[∃x]", monocle },
  47. };
  48. /* key definitions */
  49. #define MODKEY Mod4Mask
  50. #define TAGKEYS(KEY,TAG) \
  51. { MODKEY, KEY, view, {.ui = 1 << TAG} }, \
  52. { MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \
  53. { MODKEY|ShiftMask, KEY, tag, {.ui = 1 << TAG} }, \
  54. { MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG} },
  55. /* helper for spawning shell commands in the pre dwm-5.0 fashion */
  56. #define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
  57. /* commands */
  58. static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */
  59. static const char *dmenucmd[] = { "dmenu_run", "-p", ">>>", NULL };
  60. static const char *termcmd[] = { "st", NULL };
  61. static const char *fmcmd[] = { "dired", NULL };
  62. static Key keys[] = {
  63. /* modifier key function argument */
  64. { MODKEY, XK_p, spawn, {.v = dmenucmd } },
  65. { MODKEY, XK_Return, spawn, {.v = termcmd } },
  66. { MODKEY, XK_h, spawn, {.v = fmcmd } },
  67. { MODKEY, XK_w, spawn, SHCMD("qutebrowser") },
  68. { MODKEY|ShiftMask, XK_w, spawn, SHCMD("dmenu-www") },
  69. { MODKEY, XK_z, spawn, SHCMD("zathura") },
  70. { MODKEY, XK_e, spawn, SHCMD("emacs -mm") },
  71. { MODKEY, XK_a, spawn, SHCMD("ardour") },
  72. { MODKEY|ShiftMask, XK_Return, spawn, SHCMD("dmenu-logout") },
  73. { MODKEY, XK_b, togglebar, {0} },
  74. { MODKEY, XK_Down, focusstack, {.i = +1 } },
  75. { MODKEY, XK_Up, focusstack, {.i = -1 } },
  76. { MODKEY|ShiftMask, XK_Down, pushdown, {0} },
  77. { MODKEY|ShiftMask, XK_Up, pushup, {0} },
  78. { MODKEY, XK_i, incnmaster, {.i = +1 } },
  79. { MODKEY, XK_d, incnmaster, {.i = -1 } },
  80. { MODKEY|ShiftMask, XK_Left, setmfact, {.f = -0.05} },
  81. { MODKEY|ShiftMask, XK_Right, setmfact, {.f = +0.05} },
  82. { MODKEY|ShiftMask, XK_Return, zoom, {0} },
  83. { MODKEY, XK_Tab, view, {0} },
  84. { MODKEY|ShiftMask, XK_c, killclient, {0} },
  85. { MODKEY, XK_t, setlayout, {.v = &layouts[0]} },
  86. { MODKEY, XK_f, setlayout, {.v = &layouts[1]} },
  87. { MODKEY, XK_m, setlayout, {.v = &layouts[2]} },
  88. { MODKEY, XK_space, setlayout, {0} },
  89. { MODKEY|ShiftMask, XK_space, togglefloating, {0} },
  90. { MODKEY, XK_0, view, {.ui = ~0 } },
  91. { MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } },
  92. { MODKEY, XK_comma, focusmon, {.i = -1 } },
  93. { MODKEY, XK_period, focusmon, {.i = +1 } },
  94. { MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } },
  95. { MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } },
  96. TAGKEYS( XK_1, 0)
  97. TAGKEYS( XK_2, 1)
  98. TAGKEYS( XK_3, 2)
  99. TAGKEYS( XK_4, 3)
  100. TAGKEYS( XK_5, 4)
  101. TAGKEYS( XK_6, 5)
  102. TAGKEYS( XK_7, 6)
  103. TAGKEYS( XK_8, 7)
  104. TAGKEYS( XK_9, 8)
  105. { MODKEY|ShiftMask, XK_q, quit, {0} },
  106. };
  107. /* button definitions */
  108. /* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */
  109. static Button buttons[] = {
  110. /* click event mask button function argument */
  111. { ClkLtSymbol, 0, Button1, setlayout, {0} },
  112. { ClkLtSymbol, 0, Button3, setlayout, {.v = &layouts[2]} },
  113. { ClkWinTitle, 0, Button2, zoom, {0} },
  114. { ClkStatusText, 0, Button2, spawn, {.v = termcmd } },
  115. { ClkClientWin, MODKEY, Button1, movemouse, {0} },
  116. { ClkClientWin, MODKEY, Button2, togglefloating, {0} },
  117. { ClkClientWin, MODKEY, Button3, resizemouse, {0} },
  118. { ClkTagBar, 0, Button1, view, {0} },
  119. { ClkTagBar, 0, Button3, toggleview, {0} },
  120. { ClkTagBar, MODKEY, Button1, tag, {0} },
  121. { ClkTagBar, MODKEY, Button3, toggletag, {0} },
  122. };