My dwm build
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

174 lines
10 KiB

  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 = 15;
  5. static const unsigned int snap = 32; /* snap pixel */
  6. static const int swallowfloating = 0; /* 1 means swallow floating windows by default */
  7. static const int showbar = 1; /* 0 means no bar */
  8. static const int topbar = 1; /* 0 means bottom bar */
  9. /* Display modes of the tab bar: never shown, always shown, shown only in */
  10. /* monocle mode in presence of several windows. */
  11. /* Modes after showtab_nmodes are disabled */
  12. enum showtab_modes { showtab_never, showtab_auto, showtab_nmodes, showtab_always};
  13. static const int showtab = showtab_auto; /* Default tab bar show mode */
  14. static const Bool toptab = False; /* False means bottom tab bar */
  15. static const char *fonts[] = { "fontawesome:size=15", "DejaVuSansMono Nerd Font Mono:size=13"} ;
  16. static const char dmenufont[] = "monospace:size=13";
  17. static const char col_gray1[] = "#222222";
  18. static const char col_gray2[] = "#444444";
  19. static const char col_gray3[] = "#bbbbbb";
  20. static const char col_gray4[] = "#eeeeee";
  21. static const char col_cyan[] = "#41008c";
  22. static const char *colors[][3] = {
  23. /* fg bg border */
  24. [SchemeNorm] = { col_gray3, col_gray1, col_gray2 },
  25. [SchemeSel] = { col_gray4, col_cyan, col_cyan },
  26. };
  27. static const char *const autostart[] = {
  28. "sh", "-c", "sh ~/scripts/xinit.sh", NULL,
  29. NULL /* terminate */
  30. };
  31. /* tagging */
  32. static const char *tags[] = { "", "", "", "", "", "", "", "", "" };
  33. /* default layout per tags */
  34. /* The first element is for all-tag view, following i-th element corresponds to */
  35. /* tags[i]. Layout is referred using the layouts array index.*/
  36. static int def_layouts[1 + LENGTH(tags)] = { 0, 0, 0, 0, 0, 0, 2, 0, 2, 2};
  37. static const Rule rules[] = {
  38. /* xprop(1):
  39. * WM_CLASS(STRING) = instance, class
  40. * WM_NAME(STRING) = title
  41. */
  42. /* class instance title tags mask iscentered isfloating isterminal noswallow monitor */
  43. { "Gimp", NULL, NULL, 1 << 7, 0, 1, 0, 0, -1 },
  44. { "LibreWolf", NULL, NULL, 1 << 0, 0, 0, 0, -1, -1 },
  45. { "firefox", NULL, NULL, 1 << 0, 0, 0, 0, -1, -1 },
  46. { "St", NULL, NULL, 0, 0, 0, 1, 0, -1 },
  47. { NULL, NULL, "Event Tester", 0, 0, 0, 0, 1, -1 }, /* xev */
  48. };
  49. /* layout(s) */
  50. static const float mfact = 0.55; /* factor of master area size [0.05..0.95] */
  51. static const int nmaster = 1; /* number of clients in master area */
  52. static const int resizehints = 1; /* 1 means respect size hints in tiled resizals */
  53. static const Layout layouts[] = {
  54. /* symbol arrange function */
  55. { "[]=", tile }, /* first entry is default */
  56. { "><>", NULL }, /* no layout function means floating behavior */
  57. { "[M]", monocle },
  58. { "|M|", centeredmaster },
  59. { ">M>", centeredfloatingmaster },
  60. };
  61. /* key definitions */
  62. #define MODKEY Mod4Mask
  63. #define TAGKEYS(KEY,TAG) \
  64. { MODKEY, KEY, view, {.ui = 1 << TAG} }, \
  65. { MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \
  66. { MODKEY|ShiftMask, KEY, tag, {.ui = 1 << TAG} }, \
  67. { MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG} },
  68. /* helper for spawning shell commands in the pre dwm-5.0 fashion */
  69. #define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
  70. /* commands */
  71. static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */
  72. static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", col_gray1, "-nf", col_gray3, "-sb", col_cyan, "-sf", col_gray4, NULL };
  73. static const char *termcmd[] = { "st", NULL };
  74. #include <X11/XF86keysym.h>
  75. static Key keys[] = {
  76. /* modifier key function argument */
  77. { 0, XK_Print, spawn, SHCMD("~/scripts/screenshot.sh") },
  78. { 0, XF86XK_PowerOff, spawn, SHCMD("~/scripts/poweroff.sh") },
  79. { 0, XF86XK_AudioMute, spawn, SHCMD("pulsemixer --toggle-mute") },
  80. { 0, XF86XK_AudioRaiseVolume, spawn, SHCMD("amixer -c 1 sset Master 1+") },
  81. { 0, XF86XK_AudioLowerVolume, spawn, SHCMD("amixer -c 1 sset Master 1-") },
  82. { 0, XF86XK_AudioPrev, spawn, SHCMD("cmus-remote --prev") },
  83. { 0, XF86XK_AudioNext, spawn, SHCMD("cmus-remote --next") },
  84. { 0, XF86XK_AudioPause, spawn, SHCMD("cmus-remote --pause") },
  85. { 0, XF86XK_AudioPlay, spawn, SHCMD("cmus-remote --pause") },
  86. { 0, XF86XK_AudioStop, spawn, SHCMD("cmus-remote --stop") },
  87. { 0, XF86XK_AudioRewind, spawn, SHCMD("cmus-remote --seek -10") },
  88. { 0, XF86XK_AudioForward, spawn, SHCMD("cmus-remote --seek +10") },
  89. { 0, XF86XK_MonBrightnessUp, spawn, SHCMD("brightnessctl s +5%")},
  90. { 0, XF86XK_MonBrightnessDown, spawn, SHCMD("brightnessctl s 5%-")},
  91. { MODKEY|ShiftMask, XK_space, togglealwaysontop, {0} },
  92. { MODKEY, XK_w, spawn, SHCMD("firefox") },
  93. { MODKEY|ShiftMask, XK_l, spawn, SHCMD("slock") },
  94. { MODKEY|ShiftMask, XK_m, spawn, SHCMD("st ~/scripts/autostart.sh") },
  95. { MODKEY|ShiftMask, XK_j, spawn, SHCMD("joplin-desktop") },
  96. { MODKEY|ShiftMask, XK_s, spawn, SHCMD("~/scripts/screenshot.sh 1") },
  97. { MODKEY|ShiftMask, XK_n, spawn, SHCMD("connman-gtk") },
  98. { MODKEY|ShiftMask, XK_x, spawn, SHCMD("mixer.sh") },
  99. { MODKEY, XK_p, spawn, {.v = dmenucmd } },
  100. { MODKEY|ShiftMask, XK_Return, spawn, {.v = termcmd } },
  101. { MODKEY, XK_b, togglebar, {0} },
  102. { MODKEY, XK_w, tabmode, {-1} },
  103. { MODKEY, XK_j, focusstack, {.i = +1 } },
  104. { MODKEY, XK_k, focusstack, {.i = -1 } },
  105. { MODKEY, XK_i, incnmaster, {.i = +1 } },
  106. { MODKEY, XK_d, incnmaster, {.i = -1 } },
  107. { MODKEY, XK_h, setmfact, {.f = -0.05} },
  108. { MODKEY, XK_l, setmfact, {.f = +0.05} },
  109. { MODKEY, XK_Return, zoom, {0} },
  110. { MODKEY, XK_Tab, view, {0} },
  111. { MODKEY|ShiftMask, XK_c, killclient, {0} },
  112. { MODKEY, XK_t, setlayout, {.v = &layouts[0]} },
  113. { MODKEY, XK_f, setlayout, {.v = &layouts[1]} },
  114. { MODKEY, XK_m, setlayout, {.v = &layouts[2]} },
  115. { MODKEY, XK_u, setlayout, {.v = &layouts[3]} },
  116. { MODKEY, XK_o, setlayout, {.v = &layouts[4]} },
  117. { MODKEY, XK_space, setlayout, {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. { MODKEY, XK_minus, setgaps, {.i = -5 } },
  126. { MODKEY, XK_equal, setgaps, {.i = +5 } },
  127. { MODKEY|ShiftMask, XK_equal, setgaps, {.i = 0 } },
  128. TAGKEYS( XK_1, 0)
  129. TAGKEYS( XK_2, 1)
  130. TAGKEYS( XK_3, 2)
  131. TAGKEYS( XK_4, 3)
  132. TAGKEYS( XK_5, 4)
  133. TAGKEYS( XK_6, 5)
  134. TAGKEYS( XK_7, 6)
  135. TAGKEYS( XK_8, 7)
  136. TAGKEYS( XK_9, 8)
  137. { MODKEY|ShiftMask, XK_q, quit, {0} },
  138. };
  139. /* button definitions */
  140. /* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */
  141. static Button buttons[] = {
  142. /* click event mask button function argument */
  143. { ClkLtSymbol, 0, Button1, setlayout, {0} },
  144. { ClkLtSymbol, 0, Button3, setlayout, {.v = &layouts[2]} },
  145. { ClkWinTitle, 0, Button2, zoom, {0} },
  146. { ClkStatusText, 0, Button2, spawn, {.v = termcmd } },
  147. { ClkClientWin, MODKEY, Button1, movemouse, {0} },
  148. { ClkClientWin, MODKEY, Button2, togglefloating, {0} },
  149. { ClkClientWin, MODKEY, Button3, resizemouse, {0} },
  150. { ClkTagBar, 0, Button1, view, {0} },
  151. { ClkTagBar, 0, Button3, toggleview, {0} },
  152. { ClkTagBar, MODKEY, Button1, tag, {0} },
  153. { ClkTagBar, MODKEY, Button3, toggletag, {0} },
  154. { ClkTabBar, 0, Button1, focuswin, {0} },
  155. };