commit b40ca4b071e0200c664935ebf6b131c36ac99888
parent a56da6782ca8921525016bb8e7338edbbfdf0712
Author: nyangkosense <sebastian.michalk@protonmail.com>
Date: Mon, 14 Oct 2024 20:30:36 +0000
clean up code
Diffstat:
4 files changed, 14 insertions(+), 13 deletions(-)
diff --git a/config.h b/config.h
@@ -1,7 +1,6 @@
#ifndef CONFIG_H
#define CONFIG_H
-
// stats bar
#define BAR_HEIGHT 25
#define FONT "Monospace:size=14"
diff --git a/nyxwm b/nyxwm
Binary files differ.
diff --git a/nyxwm.c b/nyxwm.c
@@ -2,20 +2,17 @@
#include <X11/XF86keysym.h>
#include <X11/keysym.h>
#include <X11/XKBlib.h>
+#include <X11/Xproto.h>
+#include <X11/Xft/Xft.h>
#include <stdlib.h>
#include <signal.h>
#include <unistd.h>
#include <stdio.h>
#include <pthread.h>
-#include <X11/Xproto.h>
#include <sys/wait.h>
#include <sys/select.h>
#include <errno.h>
-
-// new includes
-#include <X11/Xft/Xft.h>
#include <time.h>
-
#include "nyxwm.h"
#include "config.h"
#include "nyxwmblocks.h"
@@ -38,8 +35,10 @@ static client *list = {0}, *ws_list[10] = {0}, *cur;
static int ws = 1, sw, sh, wx, wy, numlock = 0;
static unsigned int ww, wh;
static int s;
-Display *d;
static XButtonEvent mouse;
+int num_systray_icons;
+
+Display *d;
Window root;
Window bar;
XftFont *xft_font;
@@ -47,7 +46,6 @@ XftColor xft_color;
XftDraw *xft_draw;
Window systray;
Window systray_icons[MAX_SYSTRAY_ICONS];
-int num_systray_icons;
Atom xembed_atom;
Atom manager_atom;
Atom system_tray_opcode_atom;
@@ -73,7 +71,6 @@ unsigned long getcolor(const char *col) {
return (!XAllocNamedColor(d, m, col, &c, &c))?0:c.pixel;
}
-
void runAutoStart(void) {
system("cd ~/.nyxwm; ./autostart.sh &");
}
diff --git a/nyxwm.h b/nyxwm.h
@@ -1,5 +1,5 @@
-#ifndef SOWM_H
-#define SOWM_H
+#ifndef NYXWM_H
+#define NYXWM_H
#include <X11/Xlib.h>
#include <X11/Xft/Xft.h>
@@ -24,8 +24,14 @@
#define XEMBED_UNREGISTER_ACCELERATOR 13
#define XEMBED_ACTIVATE_ACCELERATOR 14
+
+#ifndef MAX_SYSTRAY_ICONS
#define MAX_SYSTRAY_ICONS 20
+#endif
+
+#ifndef BAR_HEIGHT
#define BAR_HEIGHT 23
+#endif
#define win (client *t=0, *c=list; c && t!=list->prev; t=c, c=c->next)
#define ws_save(W) ws_list[W] = list
@@ -112,4 +118,4 @@ extern Atom manager_atom;
extern Atom system_tray_opcode_atom;
extern Atom system_tray_selection_atom;
-#endif
-\ No newline at end of file
+#endif