config.def.h 13 KB

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