$OpenBSD: patch-i3-nagbar_main_c,v 1.13 2017/10/21 19:22:04 tb Exp $

Index: i3-nagbar/main.c
--- i3-nagbar/main.c.orig
+++ i3-nagbar/main.c
@@ -184,7 +184,7 @@ static void handle_button_release(xcb_connection_t *co
     }
 
     char *terminal_cmd;
-    sasprintf(&terminal_cmd, "i3-sensible-terminal -e %s", link_path);
+    sasprintf(&terminal_cmd, "${X11BASE}/bin/xterm -e %s", link_path);
     printf("argv0 = %s\n", argv0);
     printf("terminal_cmd = %s\n", terminal_cmd);
 
@@ -438,11 +438,6 @@ int main(int argc, char *argv[]) {
     font = load_font(pattern, true);
     set_font(&font);
 
-#if defined(__OpenBSD__)
-    if (pledge("stdio rpath wpath cpath getpw proc exec", NULL) == -1)
-        err(EXIT_FAILURE, "pledge");
-#endif
-
     xcb_rectangle_t win_pos = get_window_position();
 
     xcb_cursor_t cursor;
@@ -543,6 +538,11 @@ int main(int argc, char *argv[]) {
 
     /* Initialize the drawable bar */
     draw_util_surface_init(conn, &bar, win, get_visualtype(root_screen), win_pos.width, win_pos.height);
+
+#if defined(__OpenBSD__)
+    if (pledge("stdio rpath wpath cpath getpw proc exec", NULL) == -1)
+        err(EXIT_FAILURE, "pledge");
+#endif
 
     /* Grab the keyboard to get all input */
     xcb_flush(conn);
