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.

154 lines
4.5 KiB

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