Guest User

Untitled

a guest
May 24th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.56 KB | None | 0 0
  1. /* See LICENSE file for copyright and license details. */
  2.  
  3. /* appearance */
  4. static const char *fonts[] = {
  5. "monospace:size=12"
  6. };
  7. static const char dmenufont[] = "monospace:size=12";
  8. static const char normbordercolor[] = "#666666";
  9. static const char normbgcolor[] = "#2f343f";
  10. static const char normfgcolor[] = "#cccccc";
  11. static const char selbordercolor[] = "#ff0000";
  12. static const char selbgcolor[] = "#2f343f";
  13. static const char selfgcolor[] = "#ffffff";
  14. static const unsigned int borderpx = 0; /* border pixel of windows */
  15. static const unsigned int snap = 32; /* snap pixel */
  16. static const int showbar = 1; /* 0 means no bar */
  17. static const int topbar = 1; /* 0 means bottom bar */
  18.  
  19. /* tagging */
  20. static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };
  21.  
  22. static const Rule rules[] = {
  23. /* xprop(1):
  24. * WM_CLASS(STRING) = instance, class
  25. * WM_NAME(STRING) = title
  26. */
  27. /* class instance title tags mask isfloating monitor */
  28. { NULL, "About", NULL, 0, 1, -1 },
  29. { NULL, "Toplevel", NULL, 0, 1, -1 },
  30. { NULL, "Msgcompose", NULL, 0, 1, -1 },
  31. { NULL, "Update", NULL, 0, 1, -1 },
  32. { NULL, NULL, "Address Book", 0, 1, -1 },
  33. { NULL, NULL, "Copying files", 0, 1, -1 },
  34. { NULL, NULL, "Preferences", 0, 1, -1 },
  35. };
  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.  
  42. static const Layout layouts[] = {
  43. /* symbol arrange function */
  44. { "[]=", tile }, /* first entry is default */
  45. { "><>", NULL }, /* no layout function means floating behavior */
  46. { "[M]", monocle },
  47. };
  48.  
  49. /* key definitions */
  50. #define MODKEY Mod4Mask
  51. #define TAGKEYS(KEY,TAG) \
  52. { MODKEY, KEY, view, {.ui = 1 << TAG} }, \
  53. { MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \
  54. { MODKEY|ShiftMask, KEY, tag, {.ui = 1 << TAG} }, \
  55. { MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG} },
  56.  
  57. /* helper for spawning shell commands in the pre dwm-5.0 fashion */
  58. #define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
  59. #include <X11/XF86keysym.h>
  60.  
  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", normbgcolor, "-nf", normfgcolor, "-sb", selbgcolor, "-sf", selfgcolor, NULL };
  64. static const char *termcmd[] = { "st", "fish", NULL };
  65. static const char *voldown[] = { "amixer", "-q", "set", "Master", "1%-", "unmute", NULL };
  66. static const char *volup[] = { "amixer", "-q", "set", "Master", "1%+", "unmute", NULL };
  67. static const char *mute[] = { "amixer", "-q", "set", "Master", "toggle", NULL };
  68. static const char *prnt[] = { "scrot", "-z", "-q", "1", NULL };
  69. static const char *slk[] = { "slock", NULL };
  70. static const char *yta[] = { "dash", ".local/bin/yta.sh", NULL };
  71. static const char *ytv[] = { "dash", ".local/bin/ytv.sh", NULL };
  72. static const char *xlk[] = { "dash", ".local/bin/xlcd.sh", NULL };
  73.  
  74. static Key keys[] = {
  75. /* modifier key function argument */
  76. { MODKEY, XK_d, spawn, {.v = dmenucmd } },
  77. { MODKEY|ShiftMask, XK_Return, spawn, {.v = termcmd } },
  78. { 0, XF86XK_AudioLowerVolume, spawn, {.v = voldown } },
  79. { 0, XF86XK_AudioRaiseVolume, spawn, {.v = volup } },
  80. { 0, XF86XK_AudioMute, spawn, {.v = mute } },
  81. { 0, XK_Print, spawn, {.v = prnt } },
  82. { 0, XK_Pause, spawn, {.v = xlk } },
  83. { 0, XK_Scroll_Lock, spawn, {.v = slk } },
  84. { MODKEY, XK_y, spawn, {.v = yta } },
  85. { MODKEY|ShiftMask, XK_y, spawn, {.v = ytv } },
  86. { MODKEY, XK_b, togglebar, {0} },
  87. { MODKEY, XK_e, focusstack, {.i = +1 } },
  88. { MODKEY, XK_n, focusstack, {.i = -1 } },
  89. { MODKEY, XK_k, incnmaster, {.i = +1 } },
  90. { MODKEY, XK_j, incnmaster, {.i = -1 } },
  91. { MODKEY, XK_h, setmfact, {.f = -0.05} },
  92. { MODKEY, XK_i, setmfact, {.f = +0.05} },
  93. { MODKEY, XK_Return, zoom, {0} },
  94. { MODKEY, XK_Tab, view, {0} },
  95. { MODKEY, XK_q, killclient, {0} },
  96. { MODKEY, XK_t, setlayout, {.v = &layouts[0]} },
  97. { MODKEY, XK_f, setlayout, {.v = &layouts[1]} },
  98. { MODKEY, XK_m, setlayout, {.v = &layouts[2]} },
  99. { MODKEY, XK_space, setlayout, {0} },
  100. { MODKEY|ShiftMask, XK_space, togglefloating, {0} },
  101. { MODKEY, XK_0, view, {.ui = ~0 } },
  102. { MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } },
  103. { MODKEY, XK_comma, focusmon, {.i = -1 } },
  104. { MODKEY, XK_period, focusmon, {.i = +1 } },
  105. { MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } },
  106. { MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } },
  107. TAGKEYS( XK_1, 0)
  108. TAGKEYS( XK_2, 1)
  109. TAGKEYS( XK_3, 2)
  110. TAGKEYS( XK_4, 3)
  111. TAGKEYS( XK_5, 4)
  112. TAGKEYS( XK_6, 5)
  113. TAGKEYS( XK_7, 6)
  114. TAGKEYS( XK_8, 7)
  115. TAGKEYS( XK_9, 8)
  116. { MODKEY|ShiftMask, XK_Escape, quit, {0} },
  117. };
  118.  
  119. /* button definitions */
  120. /* click can be ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */
  121. static Button buttons[] = {
  122. /* click event mask button function argument */
  123. { ClkLtSymbol, 0, Button1, setlayout, {0} },
  124. { ClkLtSymbol, 0, Button3, setlayout, {.v = &layouts[2]} },
  125. { ClkWinTitle, 0, Button2, zoom, {0} },
  126. { ClkStatusText, 0, Button2, spawn, {.v = termcmd } },
  127. { ClkClientWin, MODKEY, Button1, movemouse, {0} },
  128. { ClkClientWin, MODKEY, Button2, togglefloating, {0} },
  129. { ClkClientWin, MODKEY, Button3, resizemouse, {0} },
  130. { ClkTagBar, 0, Button1, view, {0} },
  131. { ClkTagBar, 0, Button3, toggleview, {0} },
  132. { ClkTagBar, MODKEY, Button1, tag, {0} },
  133. { ClkTagBar, MODKEY, Button3, toggletag, {0} },
  134. };
Add Comment
Please, Sign In to add comment