config.def.h 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. /* See LICENSE file for copyright and license details. */
  2. #include "dwm.h"
  3. #include "stackctl.h"
  4. /* appearance */
  5. static const char *fonts[] = {
  6. "-*-terminus-medium-r-*-*-16-*-*-*-*-*-*-*"
  7. };
  8. static const char dmenufont[] = "-*-terminus-medium-r-*-*-16-*-*-*-*-*-*-*";
  9. static const char normbordercolor[] = "#800000";
  10. static const char normbgcolor[] = "#000000";
  11. static const char normfgcolor[] = "#a00000";
  12. static const char selbordercolor[] = "#ff0000";
  13. static const char selbgcolor[] = "#000000";
  14. static const char selfgcolor[] = "#808080";
  15. static const unsigned int borderpx = 1; /* border pixel of windows */
  16. static const unsigned int snap = 32; /* snap pixel */
  17. static const int showbar = 1; /* 0 means no bar */
  18. static const int topbar = 1; /* 0 means bottom bar */
  19. /* tagging */
  20. static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8" };
  21. static const Rule rules[] = {
  22. /* xprop(1):
  23. * WM_CLASS(STRING) = instance, class
  24. * WM_NAME(STRING) = title
  25. */
  26. /* class instance title tags mask isfloating monitor */
  27. { NULL, NULL, "stalonetray", 1 << 7, False, -1 },
  28. };
  29. /* layout(s) */
  30. static const float mfact = 0.55; /* factor of master area size [0.05..0.95] */
  31. static const int nmaster = 1; /* number of clients in master area */
  32. static const int resizehints = 1; /* 1 means respect size hints in tiled resizals */
  33. static const Layout layouts[] = {
  34. /* symbol arrange function */
  35. { "[]=", tile }, /* first entry is default */
  36. { "><>", NULL }, /* no layout function means floating behavior */
  37. { "[M]", monocle },
  38. };
  39. /* key definitions */
  40. #define AltMask Mod1Mask
  41. #define MODKEY Mod4Mask
  42. #define TAGKEYS(KEY,TAG) \
  43. { MODKEY, KEY, view, {.ui = 1 << TAG} }, \
  44. { MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \
  45. { MODKEY|ShiftMask, KEY, tag, {.ui = 1 << TAG} }, \
  46. { MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG} },
  47. /* helper for spawning shell commands in the pre dwm-5.0 fashion */
  48. #define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
  49. /* commands */
  50. static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */
  51. static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", normbgcolor, "-nf", normfgcolor, "-sb", selbgcolor, "-sf", selfgcolor, NULL };
  52. static const char *termcmd[] = { "/bin/dash", "-c", "/usr/bin/ssh-agent /usr/local/bin/tabbed -cr2 /usr/local/bin/st -w ''", NULL };
  53. static const char *browsercmd[] = { "/usr/local/bin/abduco", "-c", "firefox", "firefox", NULL };
  54. static const char *termite[] = { "bash", "-c", "DEFAULTFG=7 st -r", NULL };
  55. static const char *altbrowsercmd[] = { "chromium", "--ignore-certificate-errors", NULL };
  56. static const char *screenshotcmd[] = { "scrot", "-e", "[[ -d ~/captures ]] && mv $f ~/captures/", NULL };
  57. static const char *screencastcmd[] = { "screencast", NULL };
  58. static const char *altscreenshotcmd[] = { "scrot", "-u", "-e", "[[ -d ~/captures ]] && mv $f ~/captures/", NULL };
  59. static const char *xseltfr[] = { "xsel -op | xsel -ib", NULL };
  60. static const char *slockcmd[] = { "bash", "-c", "~/bin/slock-wrapper.sh", NULL };
  61. static const char *trackpadtoggle[] = { "bash", "-c", "~/bin/trackpad-toggle", NULL };
  62. static const char *backlight_dec[] = { "xbacklight", "-dec", "10", NULL };
  63. static const char *backlight_inc[] = { "xbacklight", "-inc", "10", NULL };
  64. static const char *carbon_rs[] = { "carbon", "-b", "68", NULL };
  65. static Key keys[] = {
  66. /* modifier key function argument */
  67. { MODKEY, XK_p, spawn, {.v = dmenucmd } },
  68. { MODKEY, XK_Return, spawn, {.v = termcmd } },
  69. { MODKEY, XK_w, spawn, {.v = browsercmd } },
  70. { MODKEY|AltMask, XK_w, spawn, {.v = altbrowsercmd } },
  71. { MODKEY, XK_s, spawn, {.v = screenshotcmd } },
  72. { MODKEY|AltMask, XK_s, spawn, {.v = altscreenshotcmd } },
  73. { MODKEY|ControlMask, XK_s, spawn, {.v = screencastcmd } },
  74. { MODKEY, XK_i, spawn, {.v = xseltfr } },
  75. { MODKEY, XK_m, spawn, {.v = trackpadtoggle } },
  76. { MODKEY|AltMask, XK_Return, spawn, {.v = termite } },
  77. { MODKEY, XK_b, togglebar, {0} },
  78. { MODKEY, XK_j, focusstack, {.i = +1 } },
  79. { MODKEY, XK_k, focusstack, {.i = -1 } },
  80. { MODKEY, XK_minus, incnmaster, {.i = -1 } },
  81. { MODKEY, XK_plus, incnmaster, {.i = +1 } },
  82. { MODKEY|AltMask, XK_h, setmfact, {.f = -0.05} },
  83. { MODKEY|AltMask, XK_l, setmfact, {.f = +0.05} },
  84. { MODKEY|ShiftMask, XK_j, movestack, {.i = +1 } },
  85. { MODKEY|ShiftMask, XK_k, movestack, {.i = -1 } },
  86. { MODKEY, XK_h, first_client, {0} },
  87. { MODKEY, XK_l, last_client, {0} },
  88. { MODKEY, XK_Tab, view, {0} },
  89. { MODKEY|ShiftMask, XK_c, killclient, {0} },
  90. { MODKEY, XK_t, setlayout, {.v = &layouts[0]} },
  91. { MODKEY, XK_f, setlayout, {.v = &layouts[1]} },
  92. { MODKEY|AltMask, XK_m, setlayout, {.v = &layouts[2]} },
  93. { MODKEY, XK_space, setlayout, {0} },
  94. { MODKEY|ShiftMask, XK_space, togglefloating, {0} },
  95. { MODKEY, XK_0, view, {.ui = ~0 } },
  96. { MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } },
  97. { MODKEY, XK_comma, focusmon, {.i = -1 } },
  98. { MODKEY, XK_period, focusmon, {.i = +1 } },
  99. { MODKEY, XK_F5, spawn, {.v = backlight_dec} },
  100. { MODKEY, XK_F6, spawn, {.v = backlight_inc} },
  101. { MODKEY, XK_F7, spawn, {.v = carbon_rs} },
  102. { MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } },
  103. { MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } },
  104. { ControlMask|AltMask, XK_Delete, spawn, {.v = slockcmd } },
  105. TAGKEYS( XK_1, 0)
  106. TAGKEYS( XK_2, 1)
  107. TAGKEYS( XK_3, 2)
  108. TAGKEYS( XK_4, 3)
  109. TAGKEYS( XK_5, 4)
  110. TAGKEYS( XK_6, 5)
  111. TAGKEYS( XK_7, 6)
  112. TAGKEYS( XK_8, 7)
  113. TAGKEYS( XK_9, 8)
  114. { MODKEY|ShiftMask, XK_q, quit, {0} },
  115. };
  116. /* button definitions */
  117. /* click can be ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */
  118. static Button buttons[] = {
  119. /* click event mask button function argument */
  120. { ClkLtSymbol, 0, Button1, setlayout, {0} },
  121. { ClkLtSymbol, 0, Button3, setlayout, {.v = &layouts[2]} },
  122. { ClkWinTitle, 0, Button2, zoom, {0} },
  123. { ClkStatusText, 0, Button2, spawn, {.v = termcmd } },
  124. { ClkClientWin, MODKEY, Button1, movemouse, {0} },
  125. { ClkClientWin, MODKEY, Button2, togglefloating, {0} },
  126. { ClkClientWin, MODKEY, Button3, resizemouse, {0} },
  127. { ClkTagBar, 0, Button1, view, {0} },
  128. { ClkTagBar, 0, Button3, toggleview, {0} },
  129. { ClkTagBar, MODKEY, Button1, tag, {0} },
  130. { ClkTagBar, MODKEY, Button3, toggletag, {0} },
  131. };