Configuration file for DWM on MacBook Air
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.

148 lines
3.2 KiB

18 years ago
18 years ago
18 years ago
18 years ago
18 years ago
18 years ago
18 years ago
18 years ago
18 years ago
18 years ago
18 years ago
18 years ago
18 years ago
18 years ago
18 years ago
18 years ago
18 years ago
18 years ago
18 years ago
18 years ago
18 years ago
18 years ago
18 years ago
18 years ago
18 years ago
  1. /*
  2. * (C)opyright MMVI Anselm R. Garbe <garbeam at gmail dot com>
  3. * See LICENSE file for license details.
  4. */
  5. #include <X11/Xlib.h>
  6. /********** CUSTOMIZE **********/
  7. #define FONT "-*-terminus-medium-*-*-*-13-*-*-*-*-*-iso10646-*"
  8. #define BGCOLOR "#666699"
  9. #define FGCOLOR "#eeeeee"
  10. #define BORDERCOLOR "#9999CC"
  11. #define MASTERW 52 /* percent */
  12. #define WM_PROTOCOL_DELWIN 1
  13. /* tags */
  14. enum { Tscratch, Tdev, Twww, Twork, TLast };
  15. /********** CUSTOMIZE **********/
  16. typedef union Arg Arg;
  17. typedef struct DC DC;
  18. typedef struct Client Client;
  19. typedef struct Fnt Fnt;
  20. typedef struct Key Key;
  21. typedef struct Rule Rule;
  22. union Arg {
  23. const char **argv;
  24. int i;
  25. };
  26. /* atoms */
  27. enum { WMProtocols, WMDelete, WMLast };
  28. enum { NetSupported, NetWMName, NetLast };
  29. /* cursor */
  30. enum { CurNormal, CurResize, CurMove, CurInput, CurLast };
  31. struct Fnt {
  32. XFontStruct *xfont;
  33. XFontSet set;
  34. int ascent;
  35. int descent;
  36. int height;
  37. };
  38. struct DC { /* draw context */
  39. GC gc;
  40. Drawable drawable;
  41. int x, y, w, h;
  42. Fnt font;
  43. unsigned long bg;
  44. unsigned long fg;
  45. unsigned long border;
  46. };
  47. struct Client {
  48. char name[256];
  49. char *tags[TLast];
  50. int proto;
  51. int x, y, w, h;
  52. int tx, ty, tw, th;
  53. int basew, baseh, incw, inch, maxw, maxh, minw, minh;
  54. int grav;
  55. unsigned int border;
  56. long flags;
  57. Bool floating;
  58. Window win;
  59. Window title;
  60. Client *next;
  61. Client *revert;
  62. };
  63. struct Rule {
  64. const char *class;
  65. const char *instance;
  66. char *tags[TLast];
  67. Bool floating;
  68. };
  69. struct Key {
  70. unsigned long mod;
  71. KeySym keysym;
  72. void (*func)(Arg *arg);
  73. Arg arg;
  74. };
  75. extern Display *dpy;
  76. extern Window root, barwin;
  77. extern Atom wm_atom[WMLast], net_atom[NetLast];
  78. extern Cursor cursor[CurLast];
  79. extern Bool running, issel;
  80. extern void (*handler[LASTEvent])(XEvent *);
  81. extern void (*arrange)(Arg *);
  82. extern Key key[];
  83. extern int tsel, screen, sx, sy, sw, sh, bx, by, bw, bh, mw;
  84. extern char *tags[TLast], stext[1024];
  85. extern DC dc;
  86. extern Client *clients, *sel;
  87. /* client.c */
  88. extern void manage(Window w, XWindowAttributes *wa);
  89. extern void unmanage(Client *c);
  90. extern Client *getclient(Window w);
  91. extern void focus(Client *c);
  92. extern void update_name(Client *c);
  93. extern void resize(Client *c, Bool inc);
  94. extern void update_size(Client *c);
  95. extern Client *gettitle(Window w);
  96. extern void craise(Client *c);
  97. extern void lower(Client *c);
  98. extern void gravitate(Client *c, Bool invert);
  99. extern void ban_client(Client *c);
  100. extern Client *next(Client *c);
  101. /* draw.c */
  102. extern void draw_bar();
  103. extern void draw_client(Client *c);
  104. extern void drawtext(const char *text, Bool invert, Bool border);
  105. extern unsigned long initcolor(const char *colstr);
  106. extern void initfont(const char *fontstr);
  107. extern unsigned int textnw(char *text, unsigned int len);
  108. extern unsigned int textw(char *text);
  109. extern unsigned int texth(void);
  110. /* key.c */
  111. extern void grabkeys();
  112. extern void keypress(XEvent *e);
  113. /* main.c */
  114. extern int error_handler(Display *dsply, XErrorEvent *e);
  115. extern void send_message(Window w, Atom a, long value);
  116. extern int win_proto(Window w);
  117. extern void quit(Arg *arg);
  118. /* screen.c */
  119. extern void floating(Arg *arg);
  120. extern void tiling(Arg *arg);
  121. extern void view(Arg *arg);
  122. /* util.c */
  123. extern void error(const char *errstr, ...);
  124. extern void *emallocz(unsigned int size);
  125. extern void spawn(Arg *arg);