config.h 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. /* See LICENSE file for copyright and license details. */
  2. /* appearance */
  3. static const unsigned int borderpx = 1; /* border pixel of windows */
  4. static const unsigned int snap = 32; /* snap pixel */
  5. static const int showbar = 1; /* 0 means no bar */
  6. static const int topbar = 1; /* 0 means bottom bar */
  7. static const char *fonts[] = { "monospace:size=10" };
  8. static const char dmenufont[] = "monospace:size=10";
  9. static const char col_gray1[] = "#222222";
  10. static const char col_gray2[] = "#444444";
  11. static const char col_gray3[] = "#bbbbbb";
  12. static const char col_gray4[] = "#eeeeee";
  13. static const char col_cyan[] = "#005577";
  14. static const char col_black[] = "#000000";
  15. static const char col_violet[] = "#8f00ff";
  16. static const char col_pink[] = "#ff00f0";
  17. static const char *colors[][3] = {
  18. /* fg bg border */
  19. [SchemeNorm] = { col_pink, col_black, col_gray2 },
  20. [SchemeSel] = { col_gray4, col_violet, col_violet },
  21. };
  22. /* tagging */
  23. static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };
  24. static const Rule rules[] = {
  25. /* xprop(1):
  26. * WM_CLASS(STRING) = instance, class
  27. * WM_NAME(STRING) = title
  28. */
  29. /* class instance title tags mask isfloating monitor */
  30. { "Tor Browser", NULL, NULL, 1 << 1, 0, -1 },
  31. { "Mozilla Firefox", NULL, NULL, 1 << 1, 0, -1 },
  32. { "keepassxc", NULL, NULL, 1 << 1, 0, -1 },
  33. { "Chromium", NULL, NULL, 1 << 2, 0, -1 },
  34. { "scrcpy", NULL, NULL, 1 << 3, 0, -1 },
  35. { "jetbrains-idea-ce", NULL, NULL, 1 << 4, 0, -1 },
  36. { "JDownloader", NULL, NULL, 1 << 6, 0, -1 },
  37. { "Transmission-gtk", NULL, NULL, 1 << 6, 0, -1 },
  38. { "Amule", NULL, NULL, 1 << 6, 0, -1 },
  39. { "appium-desktop", NULL, NULL, 1 << 8, 0, -1 },
  40. };
  41. /* layout(s) */
  42. static const float mfact = 0.50; /* factor of master area size [0.05..0.95] */
  43. static const int nmaster = 1; /* number of clients in master area */
  44. static const int resizehints = 0; /* 1 means respect size hints in tiled resizals */
  45. static const int lockfullscreen = 1; /* 1 will force focus on the fullscreen window */
  46. static const Layout layouts[] = {
  47. /* symbol arrange function */
  48. { "[M]", monocle },
  49. { "[]=", tile }, /* first entry is default */
  50. { "><>", NULL }, /* no layout function means floating behavior */
  51. };
  52. /* key definitions */
  53. #define MODKEY Mod4Mask
  54. #define TAGKEYS(KEY,TAG) \
  55. { MODKEY, KEY, view, {.ui = 1 << TAG} }, \
  56. { MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \
  57. { MODKEY|ShiftMask, KEY, tag, {.ui = 1 << TAG} }, \
  58. { MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG} },
  59. /* helper for spawning shell commands in the pre dwm-5.0 fashion */
  60. #define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
  61. /* commands */
  62. static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */
  63. static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", col_black, "-nf", col_pink, "-sb", col_violet, "-sf", col_gray4, NULL };
  64. static const char *termcmd[] = { "st", "-f", "Dejavu sans mono:pixelsize=12:antialias=true:autohint=false", NULL };
  65. static const char *termcmdalt[] = { "st", "-f", "Dejavu sans mono:pixelsize=36:antialias=true:autohint=false", NULL };
  66. static const char *amixerdown[] = { "amixer", "-q", "sset", "Master", "5%-", NULL };
  67. static const char *amixerup[] = { "amixer", "-q", "sset", "Master", "5%+", NULL };
  68. static const char *brightnessdown[] = { "brightnessctl", "set", "5%-", NULL };
  69. static const char *brightnessup[] = { "brightnessctl", "set", "+5%", NULL };
  70. static const char *lock[] = { "slock", NULL };
  71. static const char *scrot[] = { "scrot", "-s", "-f", NULL };
  72. static const char *dmenubookmarks[] = { "./src/scripts/dmenu_bookmarks.sh", NULL };
  73. static const char *dmenubookmarksnoscript[] = { "./src/scripts/dmenu_bookmarks_noscript.sh", NULL };
  74. static const char *browser[] = { "surf", "-bdfgIS", "www.startpage.com", NULL };
  75. static Key keys[] = {
  76. /* modifier key function argument */
  77. { MODKEY|ShiftMask, XK_p, spawn, {.v = dmenucmd } },
  78. { MODKEY|ShiftMask, XK_Return, spawn, {.v = termcmd } },
  79. { MODKEY|ShiftMask|ControlMask, XK_Return, spawn, {.v = termcmdalt } },
  80. { MODKEY|ShiftMask, XK_F5, spawn, {.v = amixerdown } },
  81. { MODKEY|ShiftMask, XK_F6, spawn, {.v = amixerup } },
  82. { MODKEY|ShiftMask, XK_F7, spawn, {.v = brightnessdown } },
  83. { MODKEY|ShiftMask, XK_F8, spawn, {.v = brightnessup } },
  84. { MODKEY|ShiftMask, XK_l, spawn, {.v = lock } },
  85. { MODKEY|ShiftMask, XK_F12, spawn, {.v = scrot } },
  86. { MODKEY|ShiftMask, XK_w, spawn, {.v = browser } },
  87. { MODKEY|ShiftMask, XK_o, spawn, {.v = dmenubookmarks } },
  88. { MODKEY|ControlMask, XK_o, spawn, {.v = dmenubookmarksnoscript } },
  89. { MODKEY, XK_b, togglebar, {0} },
  90. { MODKEY, XK_j, focusstack, {.i = +1 } },
  91. { MODKEY, XK_k, focusstack, {.i = -1 } },
  92. { MODKEY, XK_i, incnmaster, {.i = +1 } },
  93. { MODKEY, XK_d, incnmaster, {.i = -1 } },
  94. { MODKEY, XK_h, setmfact, {.f = -0.05} },
  95. { MODKEY, XK_l, setmfact, {.f = +0.05} },
  96. { MODKEY, XK_Return, zoom, {0} },
  97. { MODKEY, XK_Tab, view, {0} },
  98. { MODKEY|ShiftMask, XK_c, killclient, {0} },
  99. { MODKEY, XK_t, setlayout, {.v = &layouts[1]} },
  100. { MODKEY, XK_f, setlayout, {.v = &layouts[2]} },
  101. { MODKEY, XK_m, setlayout, {.v = &layouts[0]} },
  102. { MODKEY, XK_space, setlayout, {0} },
  103. { MODKEY|ShiftMask, XK_space, togglefloating, {0} },
  104. { MODKEY, XK_0, view, {.ui = ~0 } },
  105. { MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } },
  106. { MODKEY, XK_comma, focusmon, {.i = -1 } },
  107. { MODKEY, XK_period, focusmon, {.i = +1 } },
  108. { MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } },
  109. { MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } },
  110. TAGKEYS( XK_1, 0)
  111. TAGKEYS( XK_2, 1)
  112. TAGKEYS( XK_3, 2)
  113. TAGKEYS( XK_4, 3)
  114. TAGKEYS( XK_5, 4)
  115. TAGKEYS( XK_6, 5)
  116. TAGKEYS( XK_7, 6)
  117. TAGKEYS( XK_8, 7)
  118. TAGKEYS( XK_9, 8)
  119. { MODKEY|ShiftMask, XK_q, quit, {0} },
  120. };
  121. /* button definitions */
  122. /* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */
  123. static Button buttons[] = {
  124. /* click event mask button function argument */
  125. { ClkLtSymbol, 0, Button1, setlayout, {0} },
  126. { ClkLtSymbol, 0, Button3, setlayout, {.v = &layouts[2]} },
  127. { ClkWinTitle, 0, Button2, zoom, {0} },
  128. { ClkStatusText, 0, Button2, spawn, {.v = termcmd } },
  129. { ClkClientWin, MODKEY, Button1, movemouse, {0} },
  130. { ClkClientWin, MODKEY, Button2, togglefloating, {0} },
  131. { ClkClientWin, MODKEY, Button3, resizemouse, {0} },
  132. { ClkTagBar, 0, Button1, view, {0} },
  133. { ClkTagBar, 0, Button3, toggleview, {0} },
  134. { ClkTagBar, MODKEY, Button1, tag, {0} },
  135. { ClkTagBar, MODKEY, Button3, toggletag, {0} },
  136. };