config.def.h 14 KB

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