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.

155 lines
3.5 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
  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 int tsel, screen, sx, sy, sw, sh, bx, by, bw, bh, mw;
  83. extern char *tags[TLast], stext[1024];
  84. extern DC dc;
  85. extern Client *clients, *sel;
  86. /* bar.c */
  87. extern void draw_bar();
  88. extern void barclick(XButtonPressedEvent *e);
  89. /* client.c */
  90. extern void manage(Window w, XWindowAttributes *wa);
  91. extern void unmanage(Client *c);
  92. extern Client *getclient(Window w);
  93. extern void focus(Client *c);
  94. extern void update_name(Client *c);
  95. extern void draw_client(Client *c);
  96. extern void resize(Client *c, Bool inc);
  97. extern void update_size(Client *c);
  98. extern Client *gettitle(Window w);
  99. extern void craise(Client *c);
  100. extern void lower(Client *c);
  101. extern void ckill(Arg *arg);
  102. extern void nextc(Arg *arg);
  103. extern void prevc(Arg *arg);
  104. extern void max(Arg *arg);
  105. extern void floating(Arg *arg);
  106. extern void tiling(Arg *arg);
  107. extern void ttrunc(Arg *arg);
  108. extern void tappend(Arg *arg);
  109. extern void view(Arg *arg);
  110. extern void zoom(Arg *arg);
  111. extern void gravitate(Client *c, Bool invert);
  112. /* draw.c */
  113. extern void drawtext(const char *text, Bool invert, Bool border);
  114. extern unsigned long initcolor(const char *colstr);
  115. extern void initfont(const char *fontstr);
  116. extern unsigned int textnw(char *text, unsigned int len);
  117. extern unsigned int textw(char *text);
  118. extern unsigned int texth(void);
  119. /* dev.c */
  120. extern void update_keys(void);
  121. extern void keypress(XEvent *e);
  122. extern void mresize(Client *c);
  123. extern void mmove(Client *c);
  124. /* main.c */
  125. extern int error_handler(Display *dsply, XErrorEvent *e);
  126. extern void send_message(Window w, Atom a, long value);
  127. extern int win_proto(Window w);
  128. extern void quit(Arg *arg);
  129. /* util.c */
  130. extern void error(const char *errstr, ...);
  131. extern void *emallocz(unsigned int size);
  132. extern void spawn(Arg *arg);