summaryrefslogtreecommitdiff
path: root/src/sxwm.c
diff options
context:
space:
mode:
authoruint23 <[email protected]>2025-04-14 22:18:55 +0100
committeruint23 <[email protected]>2025-04-14 22:18:55 +0100
commit7883981fe9976b3933959c04fa8cc62158c70855 (patch)
tree0dbec9721c71c3f1e638a0bffc40cd18622077a1 /src/sxwm.c
parent54c9dd27d5674990ddc8d444f14336d549d52725 (diff)
inital window manager setup. check for other window managers too
Diffstat (limited to 'src/sxwm.c')
-rw-r--r--src/sxwm.c39
1 files changed, 39 insertions, 0 deletions
diff --git a/src/sxwm.c b/src/sxwm.c
new file mode 100644
index 0000000..19b8975
--- /dev/null
+++ b/src/sxwm.c
@@ -0,0 +1,39 @@
+#include "sxwm.h"
+#include "util.h"
+
+static void
+run(void)
+{
+ XEvent xev;
+ for (;;) {
+ XNextEvent(dpy, &xev);
+ }
+}
+
+void
+setup(void)
+{
+ dpy = XOpenDisplay(NULL);
+ if (dpy == 0)
+ errx(0, "sxwm: can't open display.");
+
+ root = XDefaultRootWindow(dpy);
+ otherwm();
+ XSelectInput(dpy, root,
+ SubstructureRedirectMask | KeyPressMask | KeyReleaseMask
+ );
+}
+
+int
+main(int ac, char **av)
+{
+ if (ac > 1) {
+ if (strcmp(av[1], "-v") == 0 || strcmp(av[1], "--version") == 0)
+ errx(0, "%s\n%s\n%s\n", SXWM_VERSION, SXWM_AUTHOR, SXWM_LICINFO);
+ else
+ errx(0, "usage:\n[-v || --version]: See the version of sxwm\n");
+ }
+ run();
+ dpy = XOpenDisplay(NULL);
+ return 0;
+}