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.

151 lines
4.4 KiB

17 years ago
17 years ago
17 years ago
17 years ago
17 years ago
17 years ago
  1. /* See LICENSE file for copyright and license details. */
  2. /* appearance */
  3. #define BORDERPX 1
  4. #define FONT "-*-terminus-medium-r-normal-*-14-*-*-*-*-*-*-*"
  5. #define NORMBORDERCOLOR "#cccccc"
  6. #define NORMBGCOLOR "#cccccc"
  7. #define NORMFGCOLOR "#000000"
  8. #define SELBORDERCOLOR "#0066ff"
  9. #define SELBGCOLOR "#0066ff"
  10. #define SELFGCOLOR "#ffffff"
  11. /* tagging */
  12. const char tags[][MAXTAGLEN] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };
  13. Rule rules[] = {
  14. /* class:instance:title substr tags ref isfloating */
  15. { "Firefox", tags[8], False },
  16. { "Gimp", NULL, True },
  17. { "MPlayer", NULL, True },
  18. { "Acroread", NULL, True },
  19. };
  20. /* layout(s) */
  21. #define RESIZEHINTS True /* False - respect size hints in tiled resizals */
  22. #define SNAP 32 /* snap pixel */
  23. Layout layouts[] = {
  24. /* symbol function isfloating */
  25. { "[]|", tileh, False }, /* first entry is default */
  26. { "[]=", tilev, False },
  27. { "><>", floating, True },
  28. { "[M]", monocle, True },
  29. };
  30. void
  31. setanselmgeoms(void) {
  32. /* screen dimensions */
  33. sx = 0;
  34. sy = 0;
  35. sw = DisplayWidth(dpy, screen);
  36. sh = DisplayHeight(dpy, screen);
  37. /* bar position */
  38. bx = sx;
  39. by = sy;
  40. bw = 1280;
  41. bh = dc.font.height + 2;
  42. /* window area */
  43. wx = sx;
  44. wy = sy + bh;
  45. ww = sw;
  46. wh = sh - bh;
  47. /* master area */
  48. mx = wx;
  49. my = wy;
  50. mw = 1280;
  51. mh = 800;
  52. /* tile area */
  53. tx = 1280;
  54. ty = 0;
  55. tw = ww - 1280;
  56. th = wh;
  57. /* monocle area */
  58. mox = mx;
  59. moy = my;
  60. mow = mw;
  61. moh = mh;
  62. updatebarpos();
  63. }
  64. void
  65. anselmgeoms(const char *arg) {
  66. setgeoms = setanselmgeoms;
  67. setgeoms();
  68. setlayout("[]|");
  69. }
  70. void
  71. defgeoms(const char *arg) {
  72. setgeoms = setdefaultgeoms;
  73. setgeoms();
  74. setlayout("[]=");
  75. }
  76. /* key definitions */
  77. #define MODKEY Mod1Mask
  78. Key keys[] = {
  79. /* modifier key function argument */
  80. { MODKEY, XK_p, spawn,
  81. "exec dmenu_run -fn '"FONT"' -nb '"NORMBGCOLOR"' -nf '"NORMFGCOLOR"' -sb '"SELBGCOLOR"' -sf '"SELFGCOLOR"' -x 0 -y 0 -w 1280" },
  82. { MODKEY|ShiftMask, XK_Return, spawn, "exec uxterm" },
  83. { MODKEY, XK_a, anselmgeoms, NULL },
  84. { MODKEY, XK_d, defgeoms, NULL },
  85. { MODKEY, XK_j, focusnext, NULL },
  86. { MODKEY, XK_k, focusprev, NULL },
  87. { MODKEY, XK_r, reapply, NULL },
  88. { MODKEY, XK_Return, zoom, NULL },
  89. { MODKEY, XK_Tab, viewprevtag, NULL },
  90. { MODKEY, XK_m, setlayout, "[M]" },
  91. { MODKEY, XK_f, setlayout, "><>" },
  92. { MODKEY, XK_v, setlayout, "[]=" },
  93. { MODKEY, XK_h, setlayout, "[]|" },
  94. { MODKEY|ShiftMask, XK_space, togglefloating, NULL },
  95. { MODKEY|ShiftMask, XK_c, killclient, NULL },
  96. { MODKEY, XK_0, view, NULL },
  97. { MODKEY, XK_1, view, tags[0] },
  98. { MODKEY, XK_2, view, tags[1] },
  99. { MODKEY, XK_3, view, tags[2] },
  100. { MODKEY, XK_4, view, tags[3] },
  101. { MODKEY, XK_5, view, tags[4] },
  102. { MODKEY, XK_6, view, tags[5] },
  103. { MODKEY, XK_7, view, tags[6] },
  104. { MODKEY, XK_8, view, tags[7] },
  105. { MODKEY, XK_9, view, tags[8] },
  106. { MODKEY|ControlMask, XK_1, toggleview, tags[0] },
  107. { MODKEY|ControlMask, XK_2, toggleview, tags[1] },
  108. { MODKEY|ControlMask, XK_3, toggleview, tags[2] },
  109. { MODKEY|ControlMask, XK_4, toggleview, tags[3] },
  110. { MODKEY|ControlMask, XK_5, toggleview, tags[4] },
  111. { MODKEY|ControlMask, XK_6, toggleview, tags[5] },
  112. { MODKEY|ControlMask, XK_7, toggleview, tags[6] },
  113. { MODKEY|ControlMask, XK_8, toggleview, tags[7] },
  114. { MODKEY|ControlMask, XK_9, toggleview, tags[8] },
  115. { MODKEY|ShiftMask, XK_0, tag, NULL },
  116. { MODKEY|ShiftMask, XK_1, tag, tags[0] },
  117. { MODKEY|ShiftMask, XK_2, tag, tags[1] },
  118. { MODKEY|ShiftMask, XK_3, tag, tags[2] },
  119. { MODKEY|ShiftMask, XK_4, tag, tags[3] },
  120. { MODKEY|ShiftMask, XK_5, tag, tags[4] },
  121. { MODKEY|ShiftMask, XK_6, tag, tags[5] },
  122. { MODKEY|ShiftMask, XK_7, tag, tags[6] },
  123. { MODKEY|ShiftMask, XK_8, tag, tags[7] },
  124. { MODKEY|ShiftMask, XK_9, tag, tags[8] },
  125. { MODKEY|ControlMask|ShiftMask, XK_1, toggletag, tags[0] },
  126. { MODKEY|ControlMask|ShiftMask, XK_2, toggletag, tags[1] },
  127. { MODKEY|ControlMask|ShiftMask, XK_3, toggletag, tags[2] },
  128. { MODKEY|ControlMask|ShiftMask, XK_4, toggletag, tags[3] },
  129. { MODKEY|ControlMask|ShiftMask, XK_5, toggletag, tags[4] },
  130. { MODKEY|ControlMask|ShiftMask, XK_6, toggletag, tags[5] },
  131. { MODKEY|ControlMask|ShiftMask, XK_7, toggletag, tags[6] },
  132. { MODKEY|ControlMask|ShiftMask, XK_8, toggletag, tags[7] },
  133. { MODKEY|ControlMask|ShiftMask, XK_9, toggletag, tags[8] },
  134. { MODKEY|ShiftMask, XK_q, quit, NULL },
  135. };