config.h 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. /* See LICENSE file for copyright and license details. */
  2. /* appearance */
  3. static const unsigned int borderpx = 2; /* border pixel of windows */
  4. static const unsigned int snap = 32; /* snap pixel */
  5. static const unsigned int gappih = 12; /* horiz inner gap between windows */
  6. static const unsigned int gappiv = 15; /* vert inner gap between windows */
  7. static const int vertpad = 10; /* vertical padding of bar */
  8. static const int sidepad = 10; /* horizontal padding of bar */
  9. static const unsigned int gappoh = 12; /* horiz outer gap between windows and screen edge */
  10. static const unsigned int gappov = 12; /* 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 int showbar = 1; /* 0 means no bar */
  13. static const int topbar = 1; /* 0 means bottom bar */
  14. static const int horizpadbar = 10; /* horizontal padding for statusbar */
  15. static const int vertpadbar = 11; /* vertical padding for statusbar */
  16. static const char *fonts[] = { "Iosevka Nerd Font:bold:size=10", "FontAwesome:size=15" };
  17. static const char dmenufont[] = "Iosevka Nerd Font:semibold:size=10";
  18. static const char col_gray1[] = "#1f1f28";
  19. static const char col_gray2[] = "#2D4F67";
  20. static const char col_gray3[] = "#DCD7BA";
  21. static const char col_gray4[] = "#DCD7BA";
  22. static const char col_cyan[] = "#1F1F28";
  23. static const char *colors[][3] = {
  24. /* fg bg border */
  25. [SchemeNorm] = { col_gray3, col_gray1, col_cyan },
  26. [SchemeSel] = { col_gray4, col_cyan, col_gray2 },
  27. };
  28. /* tagging */
  29. static const char *tags[] = { "Workspace 1", "Workspace 2", "Workspace 3", "Workspace 4", "Workspace 5", "Workspace 6", "Workspace 7", "Workspace 8", "Workspace 9" };
  30. static const Rule rules[] = {
  31. /* xprop(1):
  32. * WM_CLASS(STRING) = instance, class
  33. * WM_NAME(STRING) = title
  34. */
  35. /* class instance title tags mask isfloating monitor */
  36. { "Gimp", NULL, NULL, 0, 1, -1 },
  37. { "Firefox", NULL, NULL, 1 << 8, 0, -1 },
  38. };
  39. /* layout(s) */
  40. static const float mfact = 0.55; /* factor of master area size [0.05..0.95] */
  41. static const int nmaster = 1; /* number of clients in master area */
  42. static const int resizehints = 0; /* 1 means respect size hints in tiled resizals */
  43. static const int lockfullscreen = 1; /* 1 will force focus on the fullscreen window */
  44. #define FORCE_VSPLIT 1 /* nrowgrid layout: force two clients to always split vertically */
  45. #include "vanitygaps.c"
  46. static const Layout layouts[] = {
  47. /* symbol arrange function */
  48. { "", tile }, /* first entry is default */
  49. { "[M]", monocle },
  50. { "[@]", spiral },
  51. { "", grid },
  52. { "󰈐", dwindle },
  53. { "H[]", deck },
  54. { "TTT", bstack },
  55. { "===", bstackhoriz },
  56. { "###", nrowgrid },
  57. { "---", horizgrid },
  58. { ":::", gaplessgrid },
  59. { "|M|", centeredmaster },
  60. { ">M>", centeredfloatingmaster },
  61. { "><>", NULL }, /* no layout function means floating behavior */
  62. { NULL, NULL },
  63. };
  64. /* key definitions */
  65. #define MODKEY Mod1Mask
  66. #define TAGKEYS(KEY,TAG) \
  67. { MODKEY, KEY, view, {.ui = 1 << TAG} }, \
  68. { MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \
  69. { MODKEY|ShiftMask, KEY, tag, {.ui = 1 << TAG} }, \
  70. { MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG} },
  71. /* helper for spawning shell commands in the pre dwm-5.0 fashion */
  72. #define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
  73. /* commands */
  74. static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */
  75. static const char *dmenucmd[] = { "rofi", "-show", "run", NULL };
  76. static const char *termcmd[] = { "st", NULL };
  77. #include <X11/XF86keysym.h> // Include this if you want to use multimedia keys
  78. static const Key keys[] = {
  79. /* modifier key function argument */
  80. { MODKEY, XK_p, spawn, {.v = dmenucmd } },
  81. { MODKEY|ShiftMask, XK_Return, spawn, {.v = termcmd } },
  82. { MODKEY, XK_KP_Subtract, spawn, SHCMD("~/scripts/screenshot_upload.sh") },
  83. { 0, XF86XK_AudioLowerVolume, spawn, SHCMD("amixer -D pulse sset Master 3%- unmute") },
  84. { 0, XF86XK_AudioRaiseVolume, spawn, SHCMD("amixer -D pulse sset Master 3%+ unmute") },
  85. { 0, XF86XK_AudioMute, spawn, SHCMD("amixer -D pulse sset Master toggle") },
  86. { MODKEY, XK_b, togglebar, {0} },
  87. { MODKEY|ShiftMask, XK_j, rotatestack, {.i = +1 } },
  88. { MODKEY|ShiftMask, XK_k, rotatestack, {.i = -1 } },
  89. { MODKEY|ControlMask|ShiftMask, XK_q, quit, {1} },
  90. { MODKEY, XK_g, setlayout, {.v = &layouts[3]} },
  91. { MODKEY, XK_t, setlayout, {.v = &layouts[4]} },
  92. { MODKEY, XK_space, setlayout, {.v = &layouts[0]} },
  93. { MODKEY, XK_j, focusstack, {.i = +1 } },
  94. { MODKEY, XK_k, focusstack, {.i = -1 } },
  95. { MODKEY, XK_i, incnmaster, {.i = +1 } },
  96. { MODKEY, XK_d, incnmaster, {.i = -1 } },
  97. { MODKEY, XK_h, setmfact, {.f = -0.05} },
  98. { MODKEY, XK_l, setmfact, {.f = +0.05} },
  99. { MODKEY, XK_Return, zoom, {0} },
  100. { MODKEY|Mod4Mask, XK_u, incrgaps, {.i = +1 } },
  101. { MODKEY|Mod4Mask|ShiftMask, XK_u, incrgaps, {.i = -1 } },
  102. { MODKEY|Mod4Mask, XK_i, incrigaps, {.i = +1 } },
  103. { MODKEY|Mod4Mask|ShiftMask, XK_i, incrigaps, {.i = -1 } },
  104. { MODKEY|Mod4Mask, XK_o, incrogaps, {.i = +1 } },
  105. { MODKEY|Mod4Mask|ShiftMask, XK_o, incrogaps, {.i = -1 } },
  106. { MODKEY|Mod4Mask, XK_6, incrihgaps, {.i = +1 } },
  107. { MODKEY|Mod4Mask|ShiftMask, XK_6, incrihgaps, {.i = -1 } },
  108. { MODKEY|Mod4Mask, XK_7, incrivgaps, {.i = +1 } },
  109. { MODKEY|Mod4Mask|ShiftMask, XK_7, incrivgaps, {.i = -1 } },
  110. { MODKEY|Mod4Mask, XK_8, incrohgaps, {.i = +1 } },
  111. { MODKEY|Mod4Mask|ShiftMask, XK_8, incrohgaps, {.i = -1 } },
  112. { MODKEY|Mod4Mask, XK_9, incrovgaps, {.i = +1 } },
  113. { MODKEY|Mod4Mask|ShiftMask, XK_9, incrovgaps, {.i = -1 } },
  114. { MODKEY|Mod4Mask, XK_0, togglegaps, {0} },
  115. { MODKEY|Mod4Mask|ShiftMask, XK_0, defaultgaps, {0} },
  116. { MODKEY, XK_Tab, view, {0} },
  117. { MODKEY|ShiftMask, XK_c, killclient, {0} },
  118. { MODKEY|ShiftMask, XK_space, togglefloating, {0} },
  119. { MODKEY, XK_0, view, {.ui = ~0 } },
  120. { MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } },
  121. { MODKEY, XK_comma, focusmon, {.i = -1 } },
  122. { MODKEY, XK_period, focusmon, {.i = +1 } },
  123. { MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } },
  124. { MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } },
  125. TAGKEYS( XK_1, 0)
  126. TAGKEYS( XK_2, 1)
  127. TAGKEYS( XK_3, 2)
  128. TAGKEYS( XK_4, 3)
  129. TAGKEYS( XK_5, 4)
  130. TAGKEYS( XK_6, 5)
  131. TAGKEYS( XK_7, 6)
  132. TAGKEYS( XK_8, 7)
  133. TAGKEYS( XK_9, 8)
  134. { MODKEY|ShiftMask, XK_q, quit, {0} },
  135. };
  136. /* button definitions */
  137. /* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */
  138. static const Button buttons[] = {
  139. /* click event mask button function argument */
  140. { ClkLtSymbol, 0, Button1, setlayout, {0} },
  141. { ClkLtSymbol, 0, Button3, setlayout, {.v = &layouts[2]} },
  142. { ClkStatusText, 0, Button2, spawn, {.v = termcmd } },
  143. { ClkClientWin, MODKEY, Button1, movemouse, {0} },
  144. { ClkClientWin, MODKEY, Button2, togglefloating, {0} },
  145. { ClkClientWin, MODKEY, Button3, resizemouse, {0} },
  146. { ClkTagBar, 0, Button1, view, {0} },
  147. { ClkTagBar, 0, Button3, toggleview, {0} },
  148. { ClkTagBar, MODKEY, Button1, tag, {0} },
  149. { ClkTagBar, MODKEY, Button3, toggletag, {0} },
  150. };