config.h 3.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. /* See LICENSE file for copyright and license details. */
  2. /* appearance */
  3. static char *font = "monospace:size=9";
  4. static char *normbgcolor = "#222222";
  5. static char *normfgcolor = "#cccccc";
  6. static char *selbgcolor = "#555555";
  7. static char *selfgcolor = "#ffffff";
  8. static char *urgbgcolor = "#111111";
  9. static char *urgfgcolor = "#cc0000";
  10. static char before[] = "<";
  11. static char after[] = ">";
  12. static char titletrim[] = "...";
  13. static int tabwidth = 200;
  14. static int foreground = 1;
  15. static int urgentswitch = 0;
  16. static int barheight = 0; /* 0 means derive by font (default), otherwise absolute height */
  17. /*
  18. * Where to place a new tab when it is opened. When npisrelative is 1,
  19. * then the current position is changed + newposition. If npisrelative
  20. * is 0, then newposition is an absolute position.
  21. */
  22. static int newposition = 0;
  23. static int npisrelative = 0;
  24. #define SETPROP(p) { \
  25. .v = (char *[]){ "/bin/sh", "-c", \
  26. "prop=\"`xwininfo -children -id $1 | grep '^ 0x' |" \
  27. "sed -e's@^ *\\(0x[0-9a-f]*\\) \"\\([^\"]*\\)\".*@\\1 \\2@' |" \
  28. "xargs -0 printf %b | dmenu -l 10 -w $1`\" &&" \
  29. "xprop -id $1 -f $0 8s -set $0 \"$prop\"", \
  30. p, winid, NULL \
  31. } \
  32. }
  33. /*
  34. * Xresources preferences to load at startup
  35. */
  36. ResourcePref resources[] = {
  37. { "font", STRING, &font },
  38. { "color0", STRING, &normbgcolor },
  39. { "color4", STRING, &normfgcolor },
  40. { "color4", STRING, &selbgcolor },
  41. { "color7", STRING, &selfgcolor },
  42. { "color2", STRING, &urgbgcolor },
  43. { "color3", STRING, &urgfgcolor },
  44. { "before", STRING, &before },
  45. { "after", STRING, &after },
  46. { "titletrim", STRING, &titletrim },
  47. { "tabwidth", INTEGER, &tabwidth },
  48. { "foreground", INTEGER, &foreground },
  49. { "urgentswitch", INTEGER, &urgentswitch },
  50. { "newposition", INTEGER, &newposition },
  51. { "npisrelative", INTEGER, &npisrelative },
  52. { "barheight", INTEGER, &barheight },
  53. };
  54. #define MODKEY ControlMask
  55. static const Key keys[] = {
  56. /* modifier key function argument */
  57. { MODKEY|ShiftMask, XK_Return, focusonce, { 0 } },
  58. { MODKEY|ShiftMask, XK_Return, spawn, { 0 } },
  59. { MODKEY|ShiftMask, XK_l, rotate, { .i = +1 } },
  60. { MODKEY|ShiftMask, XK_h, rotate, { .i = -1 } },
  61. { MODKEY|ShiftMask, XK_j, movetab, { .i = -1 } },
  62. { MODKEY|ShiftMask, XK_k, movetab, { .i = +1 } },
  63. { MODKEY, XK_Tab, rotate, { .i = 0 } },
  64. { MODKEY, XK_grave, spawn, SETPROP("_TABBED_SELECT_TAB") },
  65. { MODKEY, XK_1, move, { .i = 0 } },
  66. { MODKEY, XK_2, move, { .i = 1 } },
  67. { MODKEY, XK_3, move, { .i = 2 } },
  68. { MODKEY, XK_4, move, { .i = 3 } },
  69. { MODKEY, XK_5, move, { .i = 4 } },
  70. { MODKEY, XK_6, move, { .i = 5 } },
  71. { MODKEY, XK_7, move, { .i = 6 } },
  72. { MODKEY, XK_8, move, { .i = 7 } },
  73. { MODKEY, XK_9, move, { .i = 8 } },
  74. { MODKEY, XK_0, move, { .i = 9 } },
  75. { MODKEY, XK_q, killclient, { 0 } },
  76. { MODKEY, XK_u, focusurgent, { 0 } },
  77. { MODKEY|ShiftMask, XK_u, toggle, { .v = (void*) &urgentswitch } },
  78. { 0, XK_F11, fullscreen, { 0 } },
  79. };