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.
 
 
 
 
 

146 lines
8.0 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 showbar = 1; /* 0 means no bar */
  7. static const int topbar = 1; /* 0 means bottom bar */
  8. static const char *fonts[] = { "monospace:size=13", "fontawesome:size=15"};
  9. static const char dmenufont[] = "monospace:size=13";
  10. static const char col_gray1[] = "#222222";
  11. static const char col_gray2[] = "#444444";
  12. static const char col_gray3[] = "#bbbbbb";
  13. static const char col_gray4[] = "#eeeeee";
  14. static const char col_cyan[] = "#41008c";
  15. static const char *colors[][3] = {
  16. /* fg bg border */
  17. [SchemeNorm] = { col_gray3, col_gray1, col_gray2 },
  18. [SchemeSel] = { col_gray4, col_cyan, col_cyan },
  19. };
  20. static const char *const autostart[] = {
  21. "sh", "-c", "sh ~/scripts/xinit.sh", NULL,
  22. "dunst", NULL,
  23. "slstatus", NULL,
  24. NULL /* terminate */
  25. };
  26. /* tagging */
  27. static const char *tags[] = { "", "", "", "", "", "", "" };
  28. static const Rule rules[] = {
  29. /* xprop(1):
  30. * WM_CLASS(STRING) = instance, class
  31. * WM_NAME(STRING) = title
  32. */
  33. /* class instance title tags mask iscentered isfloating monitor */
  34. { "Gimp", NULL, NULL, 0, 0, 1, -1 },
  35. { "Firefox", NULL, NULL, 1 << 8, 0, 0, -1 },
  36. };
  37. /* layout(s) */
  38. static const float mfact = 0.55; /* factor of master area size [0.05..0.95] */
  39. static const int nmaster = 1; /* number of clients in master area */
  40. static const int resizehints = 1; /* 1 means respect size hints in tiled resizals */
  41. static const Layout layouts[] = {
  42. /* symbol arrange function */
  43. { "[]=", tile }, /* first entry is default */
  44. { "><>", NULL }, /* no layout function means floating behavior */
  45. { "[M]", monocle },
  46. };
  47. /* key definitions */
  48. #define MODKEY Mod4Mask
  49. #define TAGKEYS(KEY,TAG) \
  50. { MODKEY, KEY, view, {.ui = 1 << TAG} }, \
  51. { MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \
  52. { MODKEY|ShiftMask, KEY, tag, {.ui = 1 << TAG} }, \
  53. { MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG} },
  54. /* helper for spawning shell commands in the pre dwm-5.0 fashion */
  55. #define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
  56. /* commands */
  57. static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */
  58. static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", col_gray1, "-nf", col_gray3, "-sb", col_cyan, "-sf", col_gray4, NULL };
  59. static const char *termcmd[] = { "st", NULL };
  60. #include <X11/XF86keysym.h>
  61. static Key keys[] = {
  62. /* modifier key function argument */
  63. { 0, XF86XK_PowerOff, spawn, SHCMD("~/scripts/poweroff.sh") },
  64. { 0, XF86XK_AudioMute, spawn, SHCMD("pulsemixer --toggle-mute") },
  65. { 0, XF86XK_AudioRaiseVolume, spawn, SHCMD("pulsemixer --change-volume +1") },
  66. { 0, XF86XK_AudioLowerVolume, spawn, SHCMD("pulsemixer --change-volume -1") },
  67. { 0, XF86XK_AudioPrev, spawn, SHCMD("cmus-remote --prev") },
  68. { 0, XF86XK_AudioNext, spawn, SHCMD("cmus-remote --next") },
  69. { 0, XF86XK_AudioPause, spawn, SHCMD("cmus-remote --pause") },
  70. { 0, XF86XK_AudioPlay, spawn, SHCMD("cmus-remote --pause") },
  71. { 0, XF86XK_AudioStop, spawn, SHCMD("cmus-remote --stop") },
  72. { 0, XF86XK_AudioRewind, spawn, SHCMD("cmus-remote --seek -10") },
  73. { 0, XF86XK_AudioForward, spawn, SHCMD("cmus-remote --seek +10") },
  74. { MODKEY, XK_w, spawn, SHCMD("firefox") },
  75. { MODKEY|ShiftMask, XK_l, spawn, SHCMD("xsecurelock") },
  76. { MODKEY|ShiftMask, XK_m, spawn, SHCMD("st ~/scripts/autostart.sh") },
  77. { MODKEY|ShiftMask, XK_j, spawn, SHCMD("joplin-desktop") },
  78. { MODKEY|ShiftMask, XK_s, spawn, SHCMD("deepin-screenshot") },
  79. { MODKEY|ShiftMask, XK_n, spawn, SHCMD("networkmanager_dmenu") },
  80. { MODKEY, XK_p, spawn, {.v = dmenucmd } },
  81. { MODKEY|ShiftMask, XK_Return, spawn, {.v = termcmd } },
  82. { MODKEY, XK_b, togglebar, {0} },
  83. { MODKEY, XK_j, focusstack, {.i = +1 } },
  84. { MODKEY, XK_k, focusstack, {.i = -1 } },
  85. { MODKEY, XK_i, incnmaster, {.i = +1 } },
  86. { MODKEY, XK_d, incnmaster, {.i = -1 } },
  87. { MODKEY, XK_h, setmfact, {.f = -0.05} },
  88. { MODKEY, XK_l, setmfact, {.f = +0.05} },
  89. { MODKEY, XK_Return, zoom, {0} },
  90. { MODKEY, XK_Tab, view, {0} },
  91. { MODKEY|ShiftMask, XK_c, killclient, {0} },
  92. { MODKEY, XK_t, setlayout, {.v = &layouts[0]} },
  93. { MODKEY, XK_f, setlayout, {.v = &layouts[1]} },
  94. { MODKEY, XK_m, setlayout, {.v = &layouts[2]} },
  95. { MODKEY, XK_space, setlayout, {0} },
  96. { MODKEY|ShiftMask, XK_space, togglefloating, {0} },
  97. { MODKEY, XK_0, view, {.ui = ~0 } },
  98. { MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } },
  99. { MODKEY, XK_comma, focusmon, {.i = -1 } },
  100. { MODKEY, XK_period, focusmon, {.i = +1 } },
  101. { MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } },
  102. { MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } },
  103. { MODKEY, XK_minus, setgaps, {.i = -5 } },
  104. { MODKEY, XK_equal, setgaps, {.i = +5 } },
  105. { MODKEY|ShiftMask, XK_equal, setgaps, {.i = 0 } },
  106. TAGKEYS( XK_1, 0)
  107. TAGKEYS( XK_2, 1)
  108. TAGKEYS( XK_3, 2)
  109. TAGKEYS( XK_4, 3)
  110. TAGKEYS( XK_5, 4)
  111. TAGKEYS( XK_6, 5)
  112. TAGKEYS( XK_7, 6)
  113. TAGKEYS( XK_8, 7)
  114. TAGKEYS( XK_9, 8)
  115. { MODKEY|ShiftMask, XK_q, quit, {0} },
  116. };
  117. /* button definitions */
  118. /* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */
  119. static Button buttons[] = {
  120. /* click event mask button function argument */
  121. { ClkLtSymbol, 0, Button1, setlayout, {0} },
  122. { ClkLtSymbol, 0, Button3, setlayout, {.v = &layouts[2]} },
  123. { ClkWinTitle, 0, Button2, zoom, {0} },
  124. { ClkStatusText, 0, Button2, spawn, {.v = termcmd } },
  125. { ClkClientWin, MODKEY, Button1, movemouse, {0} },
  126. { ClkClientWin, MODKEY, Button2, togglefloating, {0} },
  127. { ClkClientWin, MODKEY, Button3, resizemouse, {0} },
  128. { ClkTagBar, 0, Button1, view, {0} },
  129. { ClkTagBar, 0, Button3, toggleview, {0} },
  130. { ClkTagBar, MODKEY, Button1, tag, {0} },
  131. { ClkTagBar, MODKEY, Button3, toggletag, {0} },
  132. };