aboutsummaryrefslogtreecommitdiff
path: root/i3-nagbar
diff options
context:
space:
mode:
authorOrestis Floros <orestisflo@gmail.com>2020-04-19 11:14:20 +0200
committerOrestis Floros <orestisflo@gmail.com>2020-04-20 04:25:45 +0200
commit2954125324431c3d5605e2490769b54410d41110 (patch)
treea92498ded9fc2cd716f7968871be3270b76509a3 /i3-nagbar
parent0b621292246f2736eeed82ef106f64749c058f68 (diff)
downloadi3-2954125324431c3d5605e2490769b54410d41110.tar.gz
i3-2954125324431c3d5605e2490769b54410d41110.zip
nagbar: Remove i3-nagbar.h
Diffstat (limited to 'i3-nagbar')
-rw-r--r--i3-nagbar/i3-nagbar.h18
-rw-r--r--i3-nagbar/main.c22
2 files changed, 12 insertions, 28 deletions
diff --git a/i3-nagbar/i3-nagbar.h b/i3-nagbar/i3-nagbar.h
deleted file mode 100644
index cb672bea..00000000
--- a/i3-nagbar/i3-nagbar.h
+++ /dev/null
@@ -1,18 +0,0 @@
-#pragma once
-
-#include <config.h>
-
-#include <err.h>
-
-#define die(...) errx(EXIT_FAILURE, __VA_ARGS__);
-#define FREE(pointer) \
- do { \
- free(pointer); \
- pointer = NULL; \
- } while (0)
-
-#define xmacro(atom) xcb_atom_t A_##atom;
-#include "atoms.xmacro"
-#undef xmacro
-
-extern xcb_window_t root;
diff --git a/i3-nagbar/main.c b/i3-nagbar/main.c
index 5558865b..be29aa0f 100644
--- a/i3-nagbar/main.c
+++ b/i3-nagbar/main.c
@@ -8,15 +8,15 @@
* when the user has an error in their configuration file.
*
*/
+#include <config.h>
+#include "libi3.h"
+
#include <err.h>
-#include <errno.h>
#include <fcntl.h>
#include <getopt.h>
#include <limits.h>
#include <paths.h>
-#include <stdbool.h>
#include <stdint.h>
-#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
@@ -28,14 +28,10 @@
#include <xcb/xcb.h>
#include <xcb/xcb_aux.h>
#include <xcb/xcb_cursor.h>
-#include <xcb/xcb_event.h>
xcb_visualtype_t *visual_type = NULL;
-#include "libi3.h"
#define SN_API_NOT_YET_FROZEN 1
-#include "i3-nagbar.h"
-
#include <libsn/sn-launchee.h>
#define MSG_PADDING logical_px(8)
@@ -45,6 +41,12 @@ xcb_visualtype_t *visual_type = NULL;
#define CLOSE_BTN_GAP logical_px(15)
#define BAR_BORDER logical_px(2)
+#define xmacro(atom) xcb_atom_t A_##atom;
+#include "atoms.xmacro"
+#undef xmacro
+
+#define die(...) errx(EXIT_FAILURE, __VA_ARGS__);
+
static char *argv0 = NULL;
typedef struct {
@@ -314,8 +316,8 @@ static xcb_rectangle_t get_window_position(void) {
goto free_resources;
free_resources:
- FREE(res);
- FREE(primary);
+ free(res);
+ free(primary);
return result;
}
@@ -598,7 +600,7 @@ int main(int argc, char *argv[]) {
free(event);
}
- FREE(pattern);
+ free(pattern);
draw_util_surface_free(conn, &bar);
return 0;