config.def.h 13 KB

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