about summary refs log tree commit diff stats
path: root/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'main.c')
-rw-r--r--main.c71
1 files changed, 29 insertions, 42 deletions
diff --git a/main.c b/main.c
index 39172ee..b96157c 100644
--- a/main.c
+++ b/main.c
@@ -3,31 +3,17 @@
  * See LICENSE file for license details.
  */
 
+#include "dwm.h"
+
 #include <errno.h>
-#include <stdarg.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
-
 #include <X11/cursorfont.h>
 #include <X11/Xatom.h>
 #include <X11/Xproto.h>
 
-#include "dwm.h"
-
-/********** CUSTOMIZE **********/
-
-char *tags[TLast] = {
-	[Tscratch] = "scratch",
-	[Tdev] = "dev",
-	[Twww] = "www",
-	[Twork] = "work",
-};
-
-/********** CUSTOMIZE **********/
-
-/* X structs */
 Display *dpy;
 Window root, barwin;
 Atom wm_atom[WMLast], net_atom[NetLast];
@@ -48,8 +34,17 @@ static const char version[] =
 	"dwm-" VERSION ", (C)opyright MMVI Anselm R. Garbe\n";
 static int (*xerrorxlib)(Display *, XErrorEvent *);
 
+/* static functions */
+
 static void
-usage() {	eprint("usage: dwm [-v]\n"); }
+cleanup()
+{
+	while(sel) {
+		resize(sel, True);
+		unmanage(sel);
+	}
+	XSetInputFocus(dpy, PointerRoot, RevertToPointerRoot, CurrentTime);
+}
 
 static void
 scan()
@@ -73,22 +68,6 @@ scan()
 		XFree(wins);
 }
 
-static void
-cleanup()
-{
-	while(sel) {
-		resize(sel, True);
-		unmanage(sel);
-	}
-	XSetInputFocus(dpy, PointerRoot, RevertToPointerRoot, CurrentTime);
-}
-
-void
-quit(Arg *arg)
-{
-	running = False;
-}
-
 static int
 win_property(Window w, Atom a, Atom t, long l, unsigned char **prop)
 {
@@ -109,6 +88,19 @@ win_property(Window w, Atom a, Atom t, long l, unsigned char **prop)
 	return res;
 }
 
+/*
+ * Startup Error handler to check if another window manager
+ * is already running.
+ */
+static int
+xerrorstart(Display *dsply, XErrorEvent *ee)
+{
+	otherwm = True;
+	return -1;
+}
+
+/* extern functions */
+
 int
 getproto(Window w)
 {
@@ -144,15 +136,10 @@ sendevent(Window w, Atom a, long value)
 	XFlush(dpy);
 }
 
-/*
- * Startup Error handler to check if another window manager
- * is already running.
- */
-static int
-xerrorstart(Display *dsply, XErrorEvent *ee)
+void
+quit(Arg *arg)
 {
-	otherwm = True;
-	return -1;
+	running = False;
 }
 
 /*
@@ -201,7 +188,7 @@ main(int argc, char *argv[])
 			exit(0);
 			break;
 		default:
-			usage();
+			eprint("usage: dwm [-v]\n");
 			break;
 		}
 	}
081305a8fd93428ab842d7814df380'>23236d0c ^
cc952d63 ^


23236d0c ^
d46a05a8 ^
cc952d63 ^

23236d0c ^
cc952d63 ^

23236d0c ^
cc952d63 ^
23236d0c ^


cc952d63 ^
d46a05a8 ^
23236d0c ^

cc952d63 ^
d46a05a8 ^



cc952d63 ^
d46a05a8 ^






845bd407 ^




d46a05a8 ^
23236d0c ^


cc952d63 ^
23236d0c ^
d46a05a8 ^
23236d0c ^


cc952d63 ^
23236d0c ^

871c502d ^
cc952d63 ^
23236d0c ^

d46a05a8 ^
23236d0c ^










d46a05a8 ^
23236d0c ^




cc952d63 ^
d46a05a8 ^
ac0daa33 ^
23236d0c ^
ac0daa33 ^
845bd407 ^
d46a05a8 ^
845bd407 ^







d46a05a8 ^
845bd407 ^


d46a05a8 ^
845bd407 ^


d46a05a8 ^
845bd407 ^







d46a05a8 ^
845bd407 ^
8e1de917 ^
845bd407 ^
d46a05a8 ^
845bd407 ^


d46a05a8 ^
845bd407 ^
8e1de917 ^
845bd407 ^
d46a05a8 ^
845bd407 ^




1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162