config.def.h 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  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 gappx = 6; /* gaps between windows */
  5. static const unsigned int snap = 32; /* snap pixel */
  6. static const unsigned int systraypinning =
  7. 0; /* 0: sloppy systray follows selected monitor, >0: pin systray to monitor
  8. X */
  9. static const unsigned int systrayonleft =
  10. 0; /* 0: systray in the right corner, >0: systray on left of status text */
  11. static const unsigned int systrayspacing = 2; /* systray spacing */
  12. static const int systraypinningfailfirst =
  13. 1; /* 1: if pinning fails, display systray on the first monitor, False:
  14. display systray on the last monitor*/
  15. static const int showsystray = 1; /* 0 means no systray */
  16. static const int showbar = 1; /* 0 means no bar */
  17. static const int topbar = 1; /* 0 means bottom bar */
  18. static const int focusonwheel = 0;
  19. static const char *fonts[] = {"Iosevka Term Light:size=11"};
  20. static const char dmenufont[] = "Iosevka Term Light:size=11";
  21. // static const char *fonts[] = { "JetBrains Mono:size=10" };
  22. // static const char dmenufont[] = "JetBrains Mono:size=10";
  23. static const char col_gray1[] = "#1d1f21";
  24. static const char col_gray2[] = "#1d1f21";
  25. static const char col_gray3[] = "#c5c8c6";
  26. static const char col_gray4[] = "#1d1f21";
  27. static const char col_cyan[] = "#81a2be";
  28. static const char col_active[] = "#85678f";
  29. static const char *colors[][3] = {
  30. /* fg bg border */
  31. [SchemeNorm] = {col_gray3, col_gray1, col_gray2},
  32. [SchemeSel] = {col_gray4, col_cyan, col_active},
  33. };
  34. typedef struct {
  35. const char *name;
  36. const void *cmd;
  37. } Sp;
  38. const char *spcmd1[] = {"st", "-n", "spterm", "-g", "144x41", NULL};
  39. const char *spcmd2[] = {"st", "-n", "spfm", "-g",
  40. "144x41", "-e", "ranger", NULL};
  41. const char *spcmd3[] = {"keepassxc", NULL};
  42. const char *spcmd4[] = {"st", "-n", "spmus", "-g",
  43. "144x41", "-e", "cmus", NULL};
  44. const char *spcmd5[] = {"galculator", NULL};
  45. static Sp scratchpads[] = {
  46. /* name cmd */
  47. {"spterm", spcmd1}, {"spranger", spcmd2}, {"keepassxc", spcmd3},
  48. {"spmus", spcmd4}, {"galculator", spcmd5},
  49. };
  50. /* tagging */
  51. static const char *tags[] = {"1", "2", "3", "4", "5", "6", "7", "8", "9"};
  52. static const Rule rules[] = {
  53. /* xprop(1):
  54. * WM_CLASS(STRING) = instance, class
  55. * WM_NAME(STRING) = title
  56. */
  57. /* class instance title tags mask isfloating
  58. monitor */
  59. {"Gimp", NULL, NULL, 0, 1, -1},
  60. {"firefox", NULL, NULL, 1 << 1, 0, -1},
  61. {"code-oss", NULL, NULL, 1 << 1, 0, -1},
  62. {"st", NULL, NULL, 1 << 0, 0, -1},
  63. {"Alacritty", NULL, NULL, 1 << 0, 0, -1},
  64. {"kitty", NULL, NULL, 1 << 0, 0, -1},
  65. {"veracrypt", NULL, NULL, 1 << 6, 1, -1},
  66. {"mpv", NULL, NULL, 0, 1, -1},
  67. {"TelegramDesktop", NULL, NULL, 1 << 2, 0, -1},
  68. {"Element", NULL, NULL, 1 << 2, 0, -1},
  69. {"Rocket.Chat", NULL, NULL, 1 << 2, 0, -1},
  70. // SCRATCHPADS
  71. {NULL, "spterm", NULL, SPTAG(0), 1, -1},
  72. {NULL, "spfm", NULL, SPTAG(1), 1, -1},
  73. {NULL, "keepassxc", NULL, SPTAG(2), 1, -1},
  74. {NULL, "spmus", NULL, SPTAG(3), 1, -1},
  75. {NULL, "galculator", NULL, SPTAG(4), 1, -1},
  76. };
  77. /* layout(s) */
  78. static const float mfact = 0.55; /* 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 =
  81. 1; /* 1 means respect size hints in tiled resizals */
  82. static const int lockfullscreen =
  83. 1; /* 1 will force focus on the fullscreen window */
  84. static const Layout layouts[] = {
  85. /* symbol arrange function */
  86. {"[T]=", tile}, /* first entry is default */
  87. {"><F>", NULL}, /* no layout function means floating behavior */
  88. {"[M]", monocle},
  89. };
  90. /* key definitions */
  91. #define MODKEY Mod4Mask
  92. #define TAGKEYS(KEY, TAG) \
  93. {MODKEY, KEY, view, {.ui = 1 << TAG}}, \
  94. {MODKEY | ControlMask, KEY, toggleview, {.ui = 1 << TAG}}, \
  95. {MODKEY | ShiftMask, KEY, tag, {.ui = 1 << TAG}}, \
  96. {MODKEY | ControlMask | ShiftMask, KEY, toggletag, {.ui = 1 << TAG}},
  97. /* helper for spawning shell commands in the pre dwm-5.0 fashion */
  98. #define SHCMD(cmd) \
  99. { \
  100. .v = (const char *[]) { "/bin/sh", "-c", cmd, NULL } \
  101. }
  102. #include <X11/XF86keysym.h>
  103. /* static const char *upvol[] = { "amixer", "set", "Master", "1+", NULL };
  104. */
  105. /* static const char *downvol[] = { "amixer", "set", "Master", "1-", NULL };
  106. */
  107. /* static const char *mutevol[] = { "amixer", "set", "Master", "toggle", NULL };
  108. */
  109. static const char *upvol[] = {"/usr/bin/pactl", "set-sink-volume", "0", "+5%",
  110. NULL};
  111. static const char *downvol[] = {"/usr/bin/pactl", "set-sink-volume", "0", "-5%",
  112. NULL};
  113. static const char *mutevol[] = {"/usr/bin/pactl", "set-sink-mute", "0",
  114. "toggle", NULL};
  115. /* commands */
  116. static const char *dmenucmd[] = {
  117. "dmenu_run", "-fn", dmenufont, "-nb", col_gray1, "-nf", col_gray3,
  118. "-sb", col_cyan, "-sf", col_gray4, "-p", "RUN: ", NULL};
  119. static const char *termcmd[] = {"st", "-e", "fish", NULL};
  120. static const char *web1[] = {"firefox", NULL};
  121. static const char *webpriv1[] = {"firefox", "-private-window", NULL};
  122. static const char *lock[] = {"slock", NULL};
  123. static const char *fshot[] = {"flameshot", "gui", NULL};
  124. static const Key keys[] = {
  125. /* modifier key function argument */
  126. {MODKEY, XK_p, spawn, {.v = dmenucmd}},
  127. {MODKEY | ShiftMask, XK_Return, spawn, {.v = termcmd}},
  128. {MODKEY, XK_F12, spawn, {.v = web1}},
  129. {MODKEY | ShiftMask, XK_F12, spawn, {.v = webpriv1}},
  130. {MODKEY | ShiftMask, XK_l, spawn, {.v = lock}},
  131. {MODKEY, XK_Print, spawn, {.v = fshot}},
  132. {MODKEY, XK_F3, spawn, {.v = upvol}},
  133. {MODKEY, XK_F2, spawn, {.v = downvol}},
  134. {MODKEY, XK_F1, spawn, {.v = mutevol}},
  135. {MODKEY, XK_b, togglebar, {0}},
  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, XK_Return, zoom, {0}},
  143. {MODKEY, XK_Tab, view, {0}},
  144. {MODKEY | ShiftMask, XK_c, killclient, {0}},
  145. {MODKEY, XK_t, setlayout, {.v = &layouts[0]}},
  146. {MODKEY, XK_f, setlayout, {.v = &layouts[1]}},
  147. {MODKEY, XK_m, setlayout, {.v = &layouts[2]}},
  148. {MODKEY, XK_space, setlayout, {0}},
  149. {MODKEY | ShiftMask, XK_space, togglefloating, {0}},
  150. {MODKEY, XK_0, view, {.ui = ~0}},
  151. {MODKEY | ShiftMask, XK_0, tag, {.ui = ~0}},
  152. {MODKEY, XK_comma, focusmon, {.i = -1}},
  153. {MODKEY, XK_period, focusmon, {.i = +1}},
  154. {MODKEY | ShiftMask, XK_comma, tagmon, {.i = -1}},
  155. {MODKEY | ShiftMask, XK_period, tagmon, {.i = +1}},
  156. {MODKEY, XK_minus, setgaps, {.i = -1}},
  157. {MODKEY, XK_equal, setgaps, {.i = +1}},
  158. {MODKEY | ShiftMask, XK_equal, setgaps, {.i = 0}},
  159. {MODKEY, XK_grave, togglescratch, {.ui = 0}},
  160. {MODKEY, XK_u, togglescratch, {.ui = 1}},
  161. {MODKEY, XK_x, togglescratch, {.ui = 2}},
  162. {MODKEY, XK_c, togglescratch, {.ui = 3}},
  163. {MODKEY, XK_q, togglescratch, {.ui = 4}},
  164. TAGKEYS(XK_1, 0) TAGKEYS(XK_2, 1) TAGKEYS(XK_3, 2) TAGKEYS(XK_4, 3)
  165. TAGKEYS(XK_5, 4) TAGKEYS(XK_6, 5) TAGKEYS(XK_7, 6) TAGKEYS(XK_8, 7)
  166. TAGKEYS(XK_9, 8){MODKEY | ShiftMask, XK_q, quit, {0}},
  167. };
  168. /* button definitions */
  169. /* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle,
  170. * ClkClientWin, or ClkRootWin */
  171. static const Button buttons[] = {
  172. /* click event mask button function argument */
  173. {ClkTagBar, MODKEY, Button1, tag, {0}},
  174. {ClkTagBar, MODKEY, Button3, toggletag, {0}},
  175. {ClkWinTitle, 0, Button2, zoom, {0}},
  176. {ClkStatusText, 0, Button2, spawn, {.v = termcmd}},
  177. {ClkClientWin, MODKEY, Button1, movemouse, {0}},
  178. {ClkClientWin, MODKEY, Button2, togglefloating, {0}},
  179. {ClkClientWin, MODKEY, Button1, resizemouse, {0}},
  180. {ClkTagBar, 0, Button1, view, {0}},
  181. {ClkTagBar, 0, Button3, toggleview, {0}},
  182. {ClkTagBar, MODKEY, Button1, tag, {0}},
  183. {ClkTagBar, MODKEY, Button3, toggletag, {0}},
  184. };