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.

152 lines
4.5 KiB

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. { "[]=", tilev, False }, /* first entry is default */
  26. { "[]|", tileh, 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. if(dc.drawable != 0)
  63. XFreePixmap(dpy, dc.drawable);
  64. dc.drawable = XCreatePixmap(dpy, root, bw, bh, DefaultDepth(dpy, screen));
  65. XMoveResizeWindow(dpy, barwin, bx, by, bw, bh);
  66. }
  67. void
  68. anselmgeoms(const char *arg) {
  69. setgeoms = setanselmgeoms;
  70. arrange();
  71. }
  72. void
  73. defgeoms(const char *arg) {
  74. setgeoms = setdefaultgeoms;
  75. arrange();
  76. }
  77. /* key definitions */
  78. #define MODKEY Mod1Mask
  79. Key keys[] = {
  80. /* modifier key function argument */
  81. { MODKEY, XK_p, spawn,
  82. "exec dmenu_run -fn '"FONT"' -nb '"NORMBGCOLOR"' -nf '"NORMFGCOLOR"' -sb '"SELBGCOLOR"' -sf '"SELFGCOLOR"' -x 0 -y 0 -w 1280" },
  83. { MODKEY|ShiftMask, XK_Return, spawn, "exec uxterm" },
  84. { MODKEY, XK_a, anselmgeoms, NULL },
  85. { MODKEY, XK_d, defgeoms, NULL },
  86. { MODKEY, XK_j, focusnext, NULL },
  87. { MODKEY, XK_k, focusprev, NULL },
  88. { MODKEY, XK_r, reapply, NULL },
  89. { MODKEY, XK_Return, zoom, NULL },
  90. { MODKEY, XK_Tab, viewprevtag, NULL },
  91. { MODKEY, XK_m, setlayout, "[M]" },
  92. { MODKEY, XK_f, setlayout, "><>" },
  93. { MODKEY, XK_v, setlayout, "[]=" },
  94. { MODKEY, XK_h, setlayout, "[]|" },
  95. { MODKEY|ShiftMask, XK_space, togglefloating, NULL },
  96. { MODKEY|ShiftMask, XK_c, killclient, NULL },
  97. { MODKEY, XK_0, view, NULL },
  98. { MODKEY, XK_1, view, tags[0] },
  99. { MODKEY, XK_2, view, tags[1] },
  100. { MODKEY, XK_3, view, tags[2] },
  101. { MODKEY, XK_4, view, tags[3] },
  102. { MODKEY, XK_5, view, tags[4] },
  103. { MODKEY, XK_6, view, tags[5] },
  104. { MODKEY, XK_7, view, tags[6] },
  105. { MODKEY, XK_8, view, tags[7] },
  106. { MODKEY, XK_9, view, tags[8] },
  107. { MODKEY|ControlMask, XK_1, toggleview, tags[0] },
  108. { MODKEY|ControlMask, XK_2, toggleview, tags[1] },
  109. { MODKEY|ControlMask, XK_3, toggleview, tags[2] },
  110. { MODKEY|ControlMask, XK_4, toggleview, tags[3] },
  111. { MODKEY|ControlMask, XK_5, toggleview, tags[4] },
  112. { MODKEY|ControlMask, XK_6, toggleview, tags[5] },
  113. { MODKEY|ControlMask, XK_7, toggleview, tags[6] },
  114. { MODKEY|ControlMask, XK_8, toggleview, tags[7] },
  115. { MODKEY|ControlMask, XK_9, toggleview, tags[8] },
  116. { MODKEY|ShiftMask, XK_0, tag, NULL },
  117. { MODKEY|ShiftMask, XK_1, tag, tags[0] },
  118. { MODKEY|ShiftMask, XK_2, tag, tags[1] },
  119. { MODKEY|ShiftMask, XK_3, tag, tags[2] },
  120. { MODKEY|ShiftMask, XK_4, tag, tags[3] },
  121. { MODKEY|ShiftMask, XK_5, tag, tags[4] },
  122. { MODKEY|ShiftMask, XK_6, tag, tags[5] },
  123. { MODKEY|ShiftMask, XK_7, tag, tags[6] },
  124. { MODKEY|ShiftMask, XK_8, tag, tags[7] },
  125. { MODKEY|ShiftMask, XK_9, tag, tags[8] },
  126. { MODKEY|ControlMask|ShiftMask, XK_1, toggletag, tags[0] },
  127. { MODKEY|ControlMask|ShiftMask, XK_2, toggletag, tags[1] },
  128. { MODKEY|ControlMask|ShiftMask, XK_3, toggletag, tags[2] },
  129. { MODKEY|ControlMask|ShiftMask, XK_4, toggletag, tags[3] },
  130. { MODKEY|ControlMask|ShiftMask, XK_5, toggletag, tags[4] },
  131. { MODKEY|ControlMask|ShiftMask, XK_6, toggletag, tags[5] },
  132. { MODKEY|ControlMask|ShiftMask, XK_7, toggletag, tags[6] },
  133. { MODKEY|ControlMask|ShiftMask, XK_8, toggletag, tags[7] },
  134. { MODKEY|ControlMask|ShiftMask, XK_9, toggletag, tags[8] },
  135. { MODKEY|ShiftMask, XK_q, quit, NULL },
  136. };