X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=include%2Futil.h;h=61a38f3ec030537f184cf9a84c1f23b96373efa2;hb=06730f44e61ea845b56f86e9aa55a8eb1c66064a;hp=e397a4e80ac37bbc77e230c6b497f12b3f33b638;hpb=71ccb4bef2850bd5beab8a4ef4669bf53b5a9781;p=i3%2Fi3 diff --git a/include/util.h b/include/util.h index e397a4e8..61a38f3e 100644 --- a/include/util.h +++ b/include/util.h @@ -105,13 +105,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 +123,23 @@ void *memmem(const void *l, size_t l_len, const void *s, size_t s_len); #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); + #endif