config.h 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  1. /* See LICENSE file for copyright and license details. */
  2. #define XF86MonBrightnessDown 0x1008ff03
  3. #define XF86MonBrightnessUp 0x1008ff02
  4. /* appearance */
  5. static const unsigned int borderpx = 0; /* border pixel of windows */
  6. static const unsigned int snap = 32; /* snap pixel */
  7. static const unsigned int gappih = 10; /* horiz inner gap between windows */
  8. static const unsigned int gappiv = 10; /* vert inner gap between windows */
  9. static const unsigned int gappoh = 10; /* horiz outer gap between windows and screen edge */
  10. static const unsigned int gappov = 10; /* vert outer gap between windows and screen edge */
  11. static int smartgaps = 0; /* 1 means no outer gap when there is only one window */
  12. static const unsigned int systraypinning = 0; /* 0: sloppy systray follows selected monitor, >0: pin systray to monitor X */
  13. static const unsigned int systrayspacing = 2; /* systray spacing */
  14. static const int systraypinningfailfirst = 1; /* 1: if pinning fails,display systray on the 1st monitor,False: display systray on last monitor*/
  15. static const int showsystray = 1; /* 0 means no systray */
  16. static const int showbar = 1; /* 0 means no bar */
  17. static const int topbar = 1; /* 0 means bottom bar */
  18. static const int horizpadbar = 10;
  19. static const int vertpadbar = 10;
  20. static const char *fonts[] = { "JetBrainsMono Nerd Font:style:bold:size=10",
  21. "Material Design Icons-Regular:size=10",
  22. };
  23. static const char dmenufont[] = "monospace:size=10";
  24. static const char col_gray1[] = "#2E3440";
  25. static const char col_gray2[] = "#444444";
  26. static const char col_gray3[] = "#abb2bf";
  27. static const char col_gray4[] = "#6d8dad";
  28. static const char col_cyann[] = "#81A1C1";
  29. static const char col_bg2[] = "#3b414d";
  30. static const char col_borderbar[] = "#2E3440";
  31. static const char *colors[][3] = {
  32. /* fg bg border */
  33. [SchemeNorm] = { col_gray3, col_gray1, col_gray2 },
  34. [SchemeSel] = { col_gray4, col_bg2, col_cyann },
  35. };
  36. /* tagging */
  37. static const char *tags[] = {" ", " ", " ", " ", " "};
  38. static const unsigned int ulinepad = 5; /* horizontal padding between the underline and tag */
  39. static const unsigned int ulinestroke = 2; /* thickness / height of the underline */
  40. static const unsigned int ulinevoffset = 0; /* how far above the bottom of the bar the line should appear */
  41. static const int ulineall = 0; /* 1 to show underline on all tags, 0 for just the active ones */
  42. static const Rule rules[] = {
  43. /* xprop(1):
  44. * WM_CLASS(STRING) = instance, class
  45. * WM_NAME(STRING) = title
  46. */
  47. /* class instance title tags mask isfloating monitor */
  48. { "Gimp", NULL, NULL, 0, 1, -1 },
  49. { "Firefox", NULL, NULL, 1 << 8, 0, -1 },
  50. };
  51. /* layout(s) */
  52. static const float mfact = 0.50; /* factor of master area size [0.05..0.95] */
  53. static const int nmaster = 1; /* number of clients in master area */
  54. static const int resizehints = 1; /* 1 means respect size hints in tiled resizals */
  55. static const int lockfullscreen = 1; /* 1 will force focus on the fullscreen window */
  56. #define FORCE_VSPLIT 1 /* nrowgrid layout: force two clients to always split vertically */
  57. #include "vanitygaps.c"
  58. #include "movestack.c"
  59. #include "tatami.c"
  60. static const Layout layouts[] = {
  61. /* symbol arrange function */
  62. { "[]=", tile }, /* first entry is default */
  63. { "[M]", monocle },
  64. { "[@]", spiral },
  65. { "[\\]", dwindle },
  66. { "H[]", deck },
  67. { "TTT", bstack },
  68. { "===", bstackhoriz },
  69. { "HHH", grid },
  70. { "###", nrowgrid },
  71. { "---", horizgrid },
  72. { ":::", gaplessgrid },
  73. { "|M|", centeredmaster },
  74. { ">M>", centeredfloatingmaster },
  75. { "><>", NULL }, /* no layout function means floating behavior */
  76. { NULL, NULL },
  77. };
  78. /* key definitions */
  79. #define MODKEY Mod4Mask
  80. #define TAGKEYS(KEY,TAG) \
  81. { MODKEY, KEY, view, {.ui = 1 << TAG} }, \
  82. { MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \
  83. { MODKEY|ShiftMask, KEY, tag, {.ui = 1 << TAG} }, \
  84. { MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG} },
  85. /* helper for spawning shell commands in the pre dwm-5.0 fashion */
  86. #define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
  87. /* commands */
  88. static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */
  89. static const char *dmenucmd[] = { "dmenu_run", NULL };
  90. static const char *termcmd[] = { "st", NULL };
  91. static const char *rofi[] = {"rofi", "-show" , "drun", NULL };
  92. static const char *layoutmenu_cmd = "layoutmenu.sh";
  93. static const char *xi[] = {"xbacklight", "-inc", "7", NULL};
  94. static const char *xd[] = {"xbacklight", "-dec", "7", NULL};
  95. static Key keys[] = {
  96. /* modifier key function argument */
  97. { MODKEY, XK_c, spawn, {.v = rofi } },
  98. { MODKEY, XK_Return, spawn, SHCMD("~/.local/bin/./st_settings && st")},
  99. {MODKEY | ControlMask, XK_u, spawn, SHCMD("maim | xclip -selection clipboard -t image/png")},
  100. {MODKEY, XK_u, spawn, SHCMD("maim --select | xclip -selection clipboard -t image/png")},
  101. {0, XF86MonBrightnessDown, spawn, {.v = xd}},
  102. {0, XF86MonBrightnessUp, spawn, {.v = xi}},
  103. { MODKEY, XK_b, togglebar, {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|ShiftMask, XK_h, setcfact, {.f = +0.25} },
  111. { MODKEY|ShiftMask, XK_l, setcfact, {.f = -0.25} },
  112. { MODKEY|ShiftMask, XK_o, setcfact, {.f = 0.00} },
  113. { MODKEY|ShiftMask, XK_j, movestack, {.i = +1 } },
  114. { MODKEY|ShiftMask, XK_k, movestack, {.i = -1 } },
  115. { MODKEY, XK_Return, zoom, {0} },
  116. { MODKEY, XK_Tab, view, {0} },
  117. // overall gaps
  118. { MODKEY|ControlMask, XK_i, incrgaps, {.i = +1 } },
  119. { MODKEY|ControlMask, XK_d, incrgaps, {.i = -1 } },
  120. // inner gaps
  121. { MODKEY|ShiftMask, XK_i, incrigaps, {.i = +1 } },
  122. { MODKEY|ControlMask|ShiftMask, XK_i, incrigaps, {.i = -1 } },
  123. // outer gaps
  124. { MODKEY|ControlMask, XK_o, incrogaps, {.i = +1 } },
  125. { MODKEY|ControlMask|ShiftMask, XK_o, incrogaps, {.i = -1 } },
  126. { MODKEY|ControlMask, XK_6, incrihgaps, {.i = +1 } },
  127. { MODKEY|ControlMask|ShiftMask, XK_6, incrihgaps, {.i = -1 } },
  128. { MODKEY|ControlMask, XK_7, incrivgaps, {.i = +1 } },
  129. { MODKEY|ControlMask|ShiftMask, XK_7, incrivgaps, {.i = -1 } },
  130. { MODKEY|ControlMask, XK_8, incrohgaps, {.i = +1 } },
  131. { MODKEY|ControlMask|ShiftMask, XK_8, incrohgaps, {.i = -1 } },
  132. { MODKEY|ControlMask, XK_9, incrovgaps, {.i = +1 } },
  133. { MODKEY|ControlMask|ShiftMask, XK_9, incrovgaps, {.i = -1 } },
  134. { MODKEY|ControlMask, XK_t, togglegaps, {0} },
  135. { MODKEY|ControlMask|ShiftMask, XK_d, defaultgaps, {0} },
  136. { MODKEY, XK_q, killclient, {0} },
  137. { MODKEY, XK_t, setlayout, {.v = &layouts[0]} },
  138. { MODKEY|ShiftMask, XK_f, setlayout, {.v = &layouts[1]} },
  139. { MODKEY, XK_m, setlayout, {.v = &layouts[2]} },
  140. { MODKEY|ControlMask, XK_g, setlayout, {.v = &layouts[10]} },
  141. { MODKEY|ControlMask|ShiftMask, XK_t, setlayout, {.v = &layouts[13]} },
  142. { MODKEY, XK_space, setlayout, {0} },
  143. { MODKEY|ControlMask, XK_comma, cyclelayout, {.i = -1 } },
  144. { MODKEY|ControlMask, XK_period, cyclelayout, {.i = +1 } },
  145. { MODKEY|ShiftMask, XK_space, togglefloating, {0} },
  146. { MODKEY, XK_f, togglefullscr, {0} },
  147. { MODKEY, XK_0, view, {.ui = ~0 } },
  148. { MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } },
  149. { MODKEY, XK_comma, focusmon, {.i = -1 } },
  150. { MODKEY, XK_period, focusmon, {.i = +1 } },
  151. { MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } },
  152. { MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } },
  153. { MODKEY|ShiftMask, XK_minus, setborderpx, {.i = -1 } },
  154. { MODKEY|ShiftMask, XK_p, setborderpx, {.i = +1 } },
  155. TAGKEYS( XK_1, 0)
  156. TAGKEYS( XK_2, 1)
  157. TAGKEYS( XK_3, 2)
  158. TAGKEYS( XK_4, 3)
  159. TAGKEYS( XK_5, 4)
  160. TAGKEYS( XK_6, 5)
  161. TAGKEYS( XK_7, 6)
  162. TAGKEYS( XK_8, 7)
  163. TAGKEYS( XK_9, 8)
  164. { MODKEY|ControlMask, XK_q, quit, {0} },
  165. { MODKEY|ShiftMask, XK_r, quit, {1} },
  166. };
  167. /* button definitions */
  168. /* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */
  169. static Button buttons[] = {
  170. /* click event mask button function argument */
  171. { ClkLtSymbol, 0, Button1, setlayout, {0} },
  172. { ClkLtSymbol, 0, Button3, setlayout, {.v = &layouts[2]} },
  173. { ClkLtSymbol, 0, Button3, layoutmenu, {0} },
  174. { ClkWinTitle, 0, Button2, zoom, {0} },
  175. { ClkStatusText, 0, Button2, spawn, {.v = termcmd } },
  176. { ClkClientWin, MODKEY, Button1, movemouse, {0} },
  177. { ClkClientWin, MODKEY, Button2, togglefloating, {0} },
  178. { ClkClientWin, MODKEY, Button3, resizemouse, {0} },
  179. { ClkClientWin, ControlMask, Button1, dragmfact, {0} },
  180. { ClkClientWin, ControlMask, Button3, dragcfact, {0} },
  181. { ClkTagBar, 0, Button1, view, {0} },
  182. { ClkTagBar, 0, Button3, toggleview, {0} },
  183. { ClkTagBar, MODKEY, Button1, tag, {0} },
  184. { ClkTagBar, MODKEY, Button3, toggletag, {0} },
  185. };