Configuration of dwm for Mac Computers
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.

157 lines
3.4 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
  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 "#0a2c2d"
  9. #define FGCOLOR "#ddeeee"
  10. #define BORDERCOLOR "#176164"
  11. /*
  12. #define BGCOLOR "#666699"
  13. #define FGCOLOR "#eeeeee"
  14. #define BORDERCOLOR "#9999CC"
  15. */
  16. #define MASTERW 52 /* percent */
  17. #define WM_PROTOCOL_DELWIN 1
  18. /* tags */
  19. enum { Tscratch, Tdev, Twww, Twork, TLast };
  20. /********** CUSTOMIZE **********/
  21. typedef union Arg Arg;
  22. typedef struct DC DC;
  23. typedef struct Client Client;
  24. typedef struct Fnt Fnt;
  25. typedef struct Key Key;
  26. typedef struct Rule Rule;
  27. union Arg {
  28. const char **argv;
  29. int i;
  30. };
  31. /* atoms */
  32. enum { NetSupported, NetWMName, NetLast };
  33. enum { WMProtocols, WMDelete, WMLast };
  34. /* cursor */
  35. enum { CurNormal, CurResize, CurMove, CurLast };
  36. struct Fnt {
  37. int ascent;
  38. int descent;
  39. int height;
  40. XFontSet set;
  41. XFontStruct *xfont;
  42. };
  43. struct DC { /* draw context */
  44. int x, y, w, h;
  45. unsigned long bg;
  46. unsigned long fg;
  47. unsigned long border;
  48. Drawable drawable;
  49. Fnt font;
  50. GC gc;
  51. };
  52. struct Client {
  53. char name[256];
  54. char *tags[TLast];
  55. int proto;
  56. int x, y, w, h;
  57. int tx, ty, tw, th;
  58. int basew, baseh, incw, inch, maxw, maxh, minw, minh;
  59. int grav;
  60. unsigned int border;
  61. long flags;
  62. Bool isfloat;
  63. Client *next;
  64. Client *revert;
  65. Window win;
  66. Window title;
  67. };
  68. struct Rule {
  69. const char *class;
  70. const char *instance;
  71. char *tags[TLast];
  72. Bool isfloat;
  73. };
  74. struct Key {
  75. unsigned long mod;
  76. KeySym keysym;
  77. void (*func)(Arg *arg);
  78. Arg arg;
  79. };
  80. extern char *tags[TLast], stext[1024];
  81. extern int tsel, screen, sx, sy, sw, sh, bx, by, bw, bh, mw;
  82. extern void (*handler[LASTEvent])(XEvent *);
  83. extern void (*arrange)(Arg *);
  84. extern Atom wmatom[WMLast], netatom[NetLast];
  85. extern Bool running, issel;
  86. extern Client *clients, *sel;
  87. extern Cursor cursor[CurLast];
  88. extern DC dc;
  89. extern Display *dpy;
  90. extern Key key[];
  91. extern Window root, barwin;
  92. /* client.c */
  93. extern void ban(Client *c);
  94. extern void focus(Client *c);
  95. extern void focusnext(Arg *arg);
  96. extern void focusprev(Arg *arg);
  97. extern Client *getclient(Window w);
  98. extern Client *getctitle(Window w);
  99. extern void gravitate(Client *c, Bool invert);
  100. extern void higher(Client *c);
  101. extern void killclient(Arg *arg);
  102. extern void lower(Client *c);
  103. extern void manage(Window w, XWindowAttributes *wa);
  104. extern void maximize(Arg *arg);
  105. extern void resize(Client *c, Bool inc);
  106. extern void setsize(Client *c);
  107. extern void settitle(Client *c);
  108. extern void unmanage(Client *c);
  109. extern void zoom(Arg *arg);
  110. /* draw.c */
  111. extern void drawall();
  112. extern void drawstatus();
  113. extern void drawtitle(Client *c);
  114. extern unsigned long getcolor(const char *colstr);
  115. extern void setfont(const char *fontstr);
  116. extern unsigned int textw(char *text);
  117. /* event.c */
  118. extern void grabkeys();
  119. /* main.c */
  120. extern int getproto(Window w);
  121. extern void quit(Arg *arg);
  122. extern void sendevent(Window w, Atom a, long value);
  123. extern int xerror(Display *dsply, XErrorEvent *ee);
  124. /* tag.c */
  125. extern void appendtag(Arg *arg);
  126. extern void dofloat(Arg *arg);
  127. extern void dotile(Arg *arg);
  128. extern Client *getnext(Client *c, unsigned int t);
  129. extern void heretag(Arg *arg);
  130. extern void replacetag(Arg *arg);
  131. extern void settags(Client *c);
  132. extern void view(Arg *arg);
  133. /* util.c */
  134. extern void *emallocz(unsigned int size);
  135. extern void eprint(const char *errstr, ...);
  136. extern void spawn(Arg *arg);