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.
 
 
 
 
 

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