config.h 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. /* See LICENSE file for copyright and license details. */
  2. #include <xkbcommon/xkbcommon-keysyms.h>
  3. /* appearance */
  4. static const char font[] = "-*-terminus-medium-r-*-*-16-*-*-*-*-*-*-*";
  5. //static const char font[] = "-*-terminus-medium-r-normal-*-14-*-*-*-*-*-*-*";
  6. static const char normbordercolor[] = "#ff0000";
  7. static const char normbgcolor[] = "#330000";
  8. static const char normfgcolor[] = "#ff0000";
  9. static const char selbordercolor[] = "#00ff00";
  10. static const char selbgcolor[] = "#440000";
  11. static const char selfgcolor[] = "#ffff00";
  12. static const unsigned int borderpx = 1; /* border pixel of windows */
  13. static const unsigned int snap = 8; /* snap pixel */
  14. static unsigned int padding = 0;
  15. static const Bool showbar = True; /* False means no bar */
  16. static const Bool topbar = True; /* False means bottom bar */
  17. static unsigned char systray_spacing= 16;
  18. static Bool systray_enable = True;
  19. /* tagging */
  20. static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };
  21. static const Rule rules[] = {
  22. /* class instance title tags mask isfloating is bg monitor */
  23. { "mplayer", NULL, NULL, 0, True, False, -1 },
  24. { "mpv", NULL, NULL, 0, True, False, -1 },
  25. { "Gimp", NULL, NULL, 0, True, False, -1 },
  26. { "Firefox", NULL, NULL, 1 << 8, False, False, -1 },
  27. };
  28. /* layout(s) */
  29. static const float mfact = 0.55; /* factor of master area size [0.05..0.95] */
  30. static const Bool resizehints = True; /* True means respect size hints in tiled resizals */
  31. #include "bstack.c"
  32. #include "bstackhoriz.c"
  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. { "TTT", bstack },
  39. { "===", bstackhoriz },
  40. };
  41. /* key definitions */
  42. #define MODKEY Mod1Mask
  43. #define TAGKEYS(KEY,TAG) \
  44. { MODKEY, KEY, view, {.ui = 1 << TAG} }, \
  45. { MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \
  46. { MODKEY|ShiftMask, KEY, tag, {.ui = 1 << TAG} }, \
  47. { MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG} },
  48. /* helper for spawning shell commands in the pre dwm-5.0 fashion */
  49. #define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
  50. /* commands */
  51. static const char *dmenucmd[] = { "_dwm_menu.sh", "-fn", font, "-nb", normbgcolor, "-nf", normfgcolor, "-sb", selbgcolor, "-sf", selfgcolor, NULL };
  52. static const char *termcmd[] = { "xterm", NULL };
  53. static const char *xwwwbrowserselcmd[] = { "x-www-browser-xsel", NULL };
  54. //static const char *itscmd[] = { "redmine.sh", NULL };
  55. static const char *itsissueselcmd[] = { "redmine-issue-sel.sh", NULL };
  56. static const char *itsissuedelselcmd[] = { "redmine-issue-del-sel.sh", NULL };
  57. static const char *itsissuedelselconfirmcmd[] = { "redmine-issue-del-sel.sh", "confirm", NULL };
  58. static const char *muteToggleCmd[] = { "_dwm_mute.sh", NULL };
  59. static const char *mpvPrevCmd[] = { "_dwm_mpv_prev.sh", NULL };
  60. static const char *mpvNextCmd[] = { "_dwm_mpv_next.sh", NULL };
  61. static const char *mpvPlayPauseCmd[] = { "_dwm_mpv_playpause.sh", NULL };
  62. static const char *mpvForwardCmd[] = { "_dwm_mpv_forward.sh", NULL };
  63. static const char *mpvBackwardCmd[] = { "_dwm_mpv_backward.sh", NULL };
  64. static const char *layoutEn[] = { "xkblayout-state", "set", "0", NULL };
  65. static const char *layoutRu[] = { "xkblayout-state", "set", "1", NULL };
  66. static const char *keyboardChangeColor[] = { "/usr/local/bin/_keyboard_randomFromCycle_color.sh", NULL };
  67. //static const char *xk_XF86WebCam_cmd[] = { "XF86WebCam.sh", NULL };
  68. static Key keys[] = {
  69. /* modifier key function argument */
  70. // { 0, XK_XF86WebCam,spawn, {.v = xk_XF86WebCam_cmd } },
  71. { MODKEY, XK_p, spawn, {.v = dmenucmd } },
  72. { MODKEY|ShiftMask, XK_w, spawn, {.v = xwwwbrowserselcmd } },
  73. { MODKEY|ShiftMask, XK_Return, spawn, {.v = termcmd } },
  74. { MODKEY|ShiftMask, XK_b, togglebar, {0} },
  75. { MODKEY, XK_j, focusstack, {.i = +1 } },
  76. { MODKEY, XK_k, focusstack, {.i = -1 } },
  77. { MODKEY, XK_h, setmfact, {.f = -0.05} },
  78. { MODKEY, XK_l, setmfact, {.f = +0.05} },
  79. { MODKEY, XK_Return, zoom, {0} },
  80. { MODKEY, XK_Tab, view, {0} },
  81. { MODKEY|ShiftMask, XK_c, killclient, {0} },
  82. { MODKEY, XK_z, setlayout, {.v = &layouts[0]} },
  83. { MODKEY, XK_x, setlayout, {.v = &layouts[1]} },
  84. { MODKEY, XK_c, setlayout, {.v = &layouts[2]} },
  85. { MODKEY, XK_v, setlayout, {.v = &layouts[3]} },
  86. { MODKEY, XK_b, setlayout, {.v = &layouts[4]} },
  87. { MODKEY, XK_space, setlayout, {0} },
  88. { MODKEY|ShiftMask, XK_space, togglefloating, {0} },
  89. { MODKEY|ControlMask, XK_space, togglebg, {0} },
  90. { MODKEY, XK_0, view, {.ui = ~0 } },
  91. { MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } },
  92. { MODKEY, XK_grave, spawn, {.v = itsissueselcmd} },
  93. { MODKEY|ShiftMask, XK_grave, spawn, {.v = itsissuedelselcmd} },
  94. { MODKEY|ShiftMask|ControlMask, XK_grave, spawn, {.v = itsissuedelselconfirmcmd} },
  95. { MODKEY, XK_comma, focusmon, {.i = +1 } },
  96. { MODKEY, XK_period, focusmon, {.i = -1 } },
  97. { MODKEY|ShiftMask, XK_comma, tagmon, {.i = +1 } },
  98. { MODKEY|ShiftMask, XK_period, tagmon, {.i = -1 } },
  99. TAGKEYS( XK_1, 0)
  100. TAGKEYS( XK_2, 1)
  101. TAGKEYS( XK_3, 2)
  102. TAGKEYS( XK_4, 3)
  103. TAGKEYS( XK_5, 4)
  104. TAGKEYS( XK_6, 5)
  105. TAGKEYS( XK_7, 6)
  106. TAGKEYS( XK_8, 7)
  107. TAGKEYS( XK_9, 8)
  108. { MODKEY|ShiftMask, XK_q, quit, {0} },
  109. { 0, XK_Super_L, spawn, {.v = layoutEn} },
  110. { ShiftMask, XK_Super_L, spawn, {.v = layoutRu} },
  111. { 0, XKB_KEY_XF86WWW, spawn, {.v = layoutEn} },
  112. { 0, XKB_KEY_XF86Back, spawn, {.v = layoutRu} },
  113. { 0, XKB_KEY_XF86AudioMute, spawn, {.v = muteToggleCmd} },
  114. { 0, XKB_KEY_XF86AudioPrev, spawn, {.v = mpvPrevCmd} },
  115. { 0, XKB_KEY_XF86AudioNext, spawn, {.v = mpvNextCmd} },
  116. { 0, XKB_KEY_XF86AudioPlay, spawn, {.v = mpvPlayPauseCmd} },
  117. { 0, XKB_KEY_XF86AudioRaiseVolume, spawn, {.v = mpvForwardCmd} },
  118. { 0, XKB_KEY_XF86AudioLowerVolume, spawn, {.v = mpvBackwardCmd} },
  119. { 0, XKB_KEY_XF86Launch0, spawn, {.v = keyboardChangeColor} },
  120. { MODKEY|ControlMask, XK_bracketright, paddingAdd, {.i = +1 } },
  121. { MODKEY|ControlMask, XK_bracketleft, paddingAdd, {.i = -1 } },
  122. };
  123. /* button definitions */
  124. /* click can be ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */
  125. static Button buttons[] = {
  126. /* click event mask button function argument */
  127. { ClkLtSymbol, 0, Button1, setlayout, {0} },
  128. { ClkLtSymbol, 0, Button3, setlayout, {.v = &layouts[2]} },
  129. { ClkWinTitle, 0, Button2, zoom, {0} },
  130. { ClkStatusText, 0, Button2, spawn, {.v = termcmd } },
  131. { ClkClientWin, MODKEY, Button1, movemouse, {0} },
  132. { ClkClientWin, MODKEY, Button2, togglefloating, {0} },
  133. { ClkClientWin, MODKEY, Button3, resizemouse, {0} },
  134. { ClkTagBar, 0, Button1, view, {0} },
  135. { ClkTagBar, 0, Button3, toggleview, {0} },
  136. { ClkTagBar, MODKEY, Button1, tag, {0} },
  137. { ClkTagBar, MODKEY, Button3, toggletag, {0} },
  138. };