config.def.h 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256
  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 = True;
  21. static const int topbar = 1; /* 0 means bottom bar */
  22. static const int horizpadbar = 5;
  23. static const int vertpadbar = 11;
  24. static const int vertpadtab = 33;
  25. static const int horizpadtabi = 15;
  26. static const int horizpadtabo = 15;
  27. static const int scalepreview = 4;
  28. static int tag_preview = 0; /* 1 means enable, 0 is off */
  29. static const char *fonts[] = { "JetBrainsMono Nerd Font:style:medium:size=10",
  30. "Material Design Icons-Regular:size=10",
  31. };
  32. static const char dmenufont[] = "monospace:size=10";
  33. static const int colorfultag = 1; /* 0 means use SchemeSel for selected non vacant tag */
  34. // theme
  35. #include "themes/gruvchad.h"
  36. static const char *colors[][3] = {
  37. /* fg bg border */
  38. [SchemeNorm] = { gray3, black, gray2 },
  39. [SchemeSel] = { gray4, blue, gray4 },
  40. [TabSel] = { blue, gray2, black },
  41. [TabNorm] = { gray3, black, black },
  42. [SchemeTag] = { gray3, black, black },
  43. [SchemeTag1] = { blue, black, black },
  44. [SchemeTag2] = { red, black, black },
  45. [SchemeTag3] = { orange, black,black },
  46. [SchemeTag4] = { green, black, black },
  47. [SchemeTag5] = { pink, black, black },
  48. [SchemeLayout] = { green, black, black },
  49. [SchemeBtnPrev] = { green, black, black },
  50. [SchemeBtnNext] = { yellow, black, black },
  51. [SchemeBtnClose] = { red, black, black },
  52. };
  53. /* tagging */
  54. static 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 iscentered isfloating monitor */
  68. { "Gimp", NULL, NULL, 0, 0, 1, -1 },
  69. { "Firefox", NULL, NULL, 1 << 8, 0, 0, -1 },
  70. { "eww", NULL, NULL, 0, 0, 1, -1 },
  71. };
  72. /* layout(s) */
  73. static const float mfact = 0.50; /* factor of master area size [0.05..0.95] */
  74. static const int nmaster = 1; /* number of clients in master area */
  75. static const int resizehints = 0; /* 1 means respect size hints in tiled resizals */
  76. static const int lockfullscreen = 1; /* 1 will force focus on the fullscreen window */
  77. #define FORCE_VSPLIT 1 /* nrowgrid layout: force two clients to always split vertically */
  78. #include "functions.h"
  79. static const Layout layouts[] = {
  80. /* symbol arrange function */
  81. { "[]=", tile }, /* first entry is default */
  82. { "[M]", monocle },
  83. { "[@]", spiral },
  84. { "[\\]", dwindle },
  85. { "H[]", deck },
  86. { "TTT", bstack },
  87. { "===", bstackhoriz },
  88. { "HHH", grid },
  89. { "###", nrowgrid },
  90. { "---", horizgrid },
  91. { ":::", gaplessgrid },
  92. { "|M|", centeredmaster },
  93. { ">M>", centeredfloatingmaster },
  94. { "><>", NULL }, /* no layout function means floating behavior */
  95. };
  96. /* key definitions */
  97. #define MODKEY Mod4Mask
  98. #define TAGKEYS(KEY,TAG) \
  99. { MODKEY, KEY, view, {.ui = 1 << TAG} }, \
  100. { MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \
  101. { MODKEY|ShiftMask, KEY, tag, {.ui = 1 << TAG} }, \
  102. { MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG} },
  103. /* helper for spawning shell commands in the pre dwm-5.0 fashion */
  104. #define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
  105. /* commands */
  106. static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */
  107. static const char *dmenucmd[] = { "dmenu_run", NULL };
  108. static const char *termcmd[] = { "st", NULL }; // change this to your term
  109. static const char *rofi[] = {"rofi", "-show", "drun", NULL };
  110. static const char *xi[] = {"xbacklight", "-inc", "7", NULL};
  111. static const char *xd[] = {"xbacklight", "-dec", "7", NULL};
  112. static Key keys[] = {
  113. /* modifier key function argument */
  114. { MODKEY, XK_c, spawn, {.v = rofi } },
  115. // if you dont use st and this script my rm this and uncomment line below it!
  116. { MODKEY, XK_Return, spawn, SHCMD("~/.local/bin/./st_settings && st")},
  117. /* { MODKEY, XK_Return, spawn, {.v = termcmd }}, */
  118. {MODKEY | ControlMask, XK_u, spawn, SHCMD("maim | xclip -selection clipboard -t image/png")},
  119. {MODKEY, XK_u, spawn, SHCMD("maim --select | xclip -selection clipboard -t image/png")},
  120. {0, XF86MonBrightnessDown, spawn, {.v = xd}},
  121. {0, XF86MonBrightnessUp, spawn, {.v = xi}},
  122. { MODKEY, XK_b, togglebar, {0} },
  123. { MODKEY|ControlMask, XK_w, tabmode, { -1 } },
  124. { MODKEY, XK_j, focusstack, {.i = +1 } },
  125. { MODKEY, XK_k, focusstack, {.i = -1 } },
  126. { MODKEY, XK_i, incnmaster, {.i = +1 } },
  127. { MODKEY, XK_d, incnmaster, {.i = -1 } },
  128. { MODKEY, XK_h, setmfact, {.f = -0.05} },
  129. { MODKEY, XK_l, setmfact, {.f = +0.05} },
  130. { MODKEY|ShiftMask, XK_h, setcfact, {.f = +0.25} },
  131. { MODKEY|ShiftMask, XK_l, setcfact, {.f = -0.25} },
  132. { MODKEY|ShiftMask, XK_o, setcfact, {.f = 0.00} },
  133. { MODKEY|ShiftMask, XK_j, movestack, {.i = +1 } },
  134. { MODKEY|ShiftMask, XK_k, movestack, {.i = -1 } },
  135. { MODKEY, XK_Return, zoom, {0} },
  136. { MODKEY, XK_Tab, view, {0} },
  137. // overall gaps
  138. { MODKEY|ControlMask, XK_i, incrgaps, {.i = +1 } },
  139. { MODKEY|ControlMask, XK_d, incrgaps, {.i = -1 } },
  140. // inner gaps
  141. { MODKEY|ShiftMask, XK_i, incrigaps, {.i = +1 } },
  142. { MODKEY|ControlMask|ShiftMask, XK_i, incrigaps, {.i = -1 } },
  143. // outer gaps
  144. { MODKEY|ControlMask, XK_o, incrogaps, {.i = +1 } },
  145. { MODKEY|ControlMask|ShiftMask, XK_o, incrogaps, {.i = -1 } },
  146. { MODKEY|ControlMask, XK_6, incrihgaps, {.i = +1 } },
  147. { MODKEY|ControlMask|ShiftMask, XK_6, incrihgaps, {.i = -1 } },
  148. { MODKEY|ControlMask, XK_7, incrivgaps, {.i = +1 } },
  149. { MODKEY|ControlMask|ShiftMask, XK_7, incrivgaps, {.i = -1 } },
  150. { MODKEY|ControlMask, XK_8, incrohgaps, {.i = +1 } },
  151. { MODKEY|ControlMask|ShiftMask, XK_8, incrohgaps, {.i = -1 } },
  152. { MODKEY|ControlMask, XK_9, incrovgaps, {.i = +1 } },
  153. { MODKEY|ControlMask|ShiftMask, XK_9, incrovgaps, {.i = -1 } },
  154. { MODKEY|ControlMask, XK_t, togglegaps, {0} },
  155. { MODKEY|ControlMask|ShiftMask, XK_d, defaultgaps, {0} },
  156. { MODKEY, XK_q, killclient, {0} },
  157. { MODKEY, XK_t, setlayout, {.v = &layouts[0]} },
  158. { MODKEY|ShiftMask, XK_f, setlayout, {.v = &layouts[1]} },
  159. { MODKEY, XK_m, setlayout, {.v = &layouts[2]} },
  160. { MODKEY|ControlMask, XK_g, setlayout, {.v = &layouts[10]} },
  161. { MODKEY|ControlMask|ShiftMask, XK_t, setlayout, {.v = &layouts[13]} },
  162. { MODKEY, XK_space, setlayout, {0} },
  163. { MODKEY|ControlMask, XK_comma, cyclelayout, {.i = -1 } },
  164. { MODKEY|ControlMask, XK_period, cyclelayout, {.i = +1 } },
  165. { MODKEY|ShiftMask, XK_space, togglefloating, {0} },
  166. { MODKEY, XK_f, togglefullscr, {0} },
  167. { MODKEY, XK_0, view, {.ui = ~0 } },
  168. { MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } },
  169. { MODKEY, XK_comma, focusmon, {.i = -1 } },
  170. { MODKEY, XK_period, focusmon, {.i = +1 } },
  171. { MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } },
  172. { MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } },
  173. { MODKEY|ShiftMask, XK_minus, setborderpx, {.i = -1 } },
  174. { MODKEY|ShiftMask, XK_p, setborderpx, {.i = +1 } },
  175. { MODKEY|ShiftMask, XK_w, setborderpx, {.i = default_border } },
  176. TAGKEYS( XK_1, 0)
  177. TAGKEYS( XK_2, 1)
  178. TAGKEYS( XK_3, 2)
  179. TAGKEYS( XK_4, 3)
  180. TAGKEYS( XK_5, 4)
  181. TAGKEYS( XK_6, 5)
  182. TAGKEYS( XK_7, 6)
  183. TAGKEYS( XK_8, 7)
  184. TAGKEYS( XK_9, 8)
  185. {
  186. MODKEY|ControlMask, XK_q, quit, {0}
  187. },
  188. { MODKEY|ShiftMask, XK_r, quit, {1} },
  189. { MODKEY, XK_e, hidewin, {0} },
  190. { MODKEY|ShiftMask, XK_e, restorewin, {0} },
  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. { ClkWinTitle, 0, Button2, zoom, {0} },
  199. { ClkStatusText, 0, Button2, spawn, {.v = termcmd } },
  200. /* Keep movemouse? */
  201. /* { ClkClientWin, MODKEY, Button1, movemouse, {0} }, */
  202. /* placemouse options, choose which feels more natural:
  203. * 0 - tiled position is relative to mouse cursor
  204. * 1 - tiled postiion is relative to window center
  205. * 2 - mouse pointer warps to window center
  206. *
  207. * The moveorplace uses movemouse or placemouse depending on the floating state
  208. * of the selected client. Set up individual keybindings for the two if you want
  209. * to control these separately (i.e. to retain the feature to move a tiled window
  210. * into a floating position).
  211. */
  212. { ClkClientWin, MODKEY, Button1, moveorplace, {.i = 0} },
  213. { ClkClientWin, MODKEY, Button2, togglefloating, {0} },
  214. { ClkClientWin, MODKEY, Button3, resizemouse, {0} },
  215. { ClkClientWin, ControlMask, Button1, dragmfact, {0} },
  216. { ClkClientWin, ControlMask, Button3, dragcfact, {0} },
  217. { ClkTagBar, 0, Button1, view, {0} },
  218. { ClkTagBar, 0, Button3, toggleview, {0} },
  219. { ClkTagBar, MODKEY, Button1, tag, {0} },
  220. { ClkTagBar, MODKEY, Button3, toggletag, {0} },
  221. { ClkTabBar, 0, Button1, focuswin, {0} },
  222. { ClkTabBar, 0, Button1, focuswin, {0} },
  223. { ClkTabPrev, 0, Button1, movestack, { .i = -1 } },
  224. { ClkTabNext, 0, Button1, movestack, { .i = +1 } },
  225. { ClkTabClose, 0, Button1, killclient, {0} },
  226. };