]> git.sur5r.net Git - i3/i3/blobdiff - include/util.h
Merge branch 'master' into next
[i3/i3] / include / util.h
index cd88863c282a90b976bd9ba02fb6b4c3c58ef3ca..53ea68e4d7699d57deeb7c065614e49c2fc0599f 100644 (file)
@@ -8,8 +8,7 @@
  *         also libi3).
  *
  */
-#ifndef _UTIL_H
-#define _UTIL_H
+#pragma once
 
 #include <err.h>
 
@@ -105,13 +104,6 @@ char *resolve_tilde(const char *path);
  */
 bool path_exists(const char *path);
 
-
-/**
- * Returns the name of a temporary file with the specified prefix.
- *
- */
-char *get_process_filename(const char *prefix);
-
 /**
  * Restart i3 in-place
  * appends -a to argument list to disable autostart
@@ -130,4 +122,21 @@ void *memmem(const void *l, size_t l_len, const void *s, size_t s_len);
 
 #endif
 
-#endif
+/**
+ * Starts an i3-nagbar instance with the given parameters. Takes care of
+ * handling SIGCHLD and killing i3-nagbar when i3 exits.
+ *
+ * The resulting PID will be stored in *nagbar_pid and can be used with
+ * kill_nagbar() to kill the bar later on.
+ *
+ */
+void start_nagbar(pid_t *nagbar_pid, char *argv[]);
+
+/**
+ * Kills the i3-nagbar process, if *nagbar_pid != -1.
+ *
+ * If wait_for_it is set (restarting i3), this function will waitpid(),
+ * otherwise, ev is assumed to handle it (reloading).
+ *
+ */
+void kill_nagbar(pid_t *nagbar_pid, bool wait_for_it);