forked from seanpringle/goomwwm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
goomwwm.c
85 lines (73 loc) · 2.6 KB
/
goomwwm.c
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
/* GoomwWM, Get out of my way, Window Manager!
MIT/X11 License
Copyright (c) 2012 Sean Pringle <[email protected]>
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#define _GNU_SOURCE
#include "version.h"
#include "goomwwm.h"
#include "proto.h"
#include "util.c"
#include "box.c"
#include "textbox.c"
#include "winlist.c"
#include "rule.c"
#include "window.c"
#include "monitor.c"
#include "client.c"
#include "ewmh.c"
#include "tag.c"
#include "menu.c"
#include "handle.c"
#include "grab.c"
#include "cli.c"
#include "wm.c"
int main(int argc, char *argv[])
{
int i;
// catch help request
if (find_arg(argc, argv, "-help") >= 0
|| find_arg(argc, argv, "--help") >= 0
|| find_arg(argc, argv, "-h") >= 0)
{
fprintf(stderr, "See the man page or visit http://github.com/seanpringle/goomwwm\n");
return EXIT_SUCCESS;
}
// catch version request
if (find_arg(argc, argv, "-version") >= 0
|| find_arg(argc, argv, "--version") >= 0
|| find_arg(argc, argv, "-v") >= 0)
{
fprintf(stderr, "%s\n", VERSION);
return EXIT_SUCCESS;
}
if(!(display = XOpenDisplay(0)))
{
fprintf(stderr, "cannot open display!\n");
return EXIT_FAILURE;
}
signal(SIGCHLD, catch_exit);
screen = DefaultScreenOfDisplay(display);
screen_id = DefaultScreen(display);
root = DefaultRootWindow(display);
// X atom values
for (i = 0; i < ATOMS; i++) atoms[i] = XInternAtom(display, atom_names[i], False);
for (i = 0; i < GATOMS; i++) gatoms[i] = XInternAtom(display, gatom_names[i], False);
for (i = 0; i < NETATOMS; i++) netatoms[i] = XInternAtom(display, netatom_names[i], False);
return find_arg(argc, argv, "-cli") >= 0 ? cli_main(argc, argv): wm_main(argc, argv);
}