]> git.sur5r.net Git - i3/i3/blob - include/startup.h
Add a --no-startup-id flag for exec (command), exec (config), exec_always (config)
[i3/i3] / include / startup.h
1 /*
2  * vim:ts=4:sw=4:expandtab
3  *
4  * i3 - an improved dynamic tiling window manager
5  * © 2009-2011 Michael Stapelberg and contributors (see also: LICENSE)
6  *
7  * startup.c: Startup notification code. Ensures a startup notification context
8  *            is setup when launching applications. We store the current
9  *            workspace to open windows in that startup notification context on
10  *            the appropriate workspace.
11  *
12  */
13 #ifndef _STARTUP_H
14 #define _STARTUP_H
15
16 #define SN_API_NOT_YET_FROZEN 1
17 #include <libsn/sn-monitor.h>
18
19 /**
20  * Starts the given application by passing it through a shell. We use double
21  * fork to avoid zombie processes. As the started application’s parent exits
22  * (immediately), the application is reparented to init (process-id 1), which
23  * correctly handles childs, so we don’t have to do it :-).
24  *
25  * The shell is determined by looking for the SHELL environment variable. If
26  * it does not exist, /bin/sh is used.
27  *
28  * The no_startup_id flag determines whether a startup notification context
29  * (and ID) should be created, which is the default and encouraged behavior.
30  *
31  */
32 void start_application(const char *command, bool no_startup_id);
33
34 /**
35  * Called by libstartup-notification when something happens
36  *
37  */
38 void startup_monitor_event(SnMonitorEvent *event, void *userdata);
39
40 /**
41  * Checks if the given window belongs to a startup notification by checking if
42  * the _NET_STARTUP_ID property is set on the window (or on its leader, if it’s
43  * unset).
44  *
45  * If so, returns the workspace on which the startup was initiated.
46  * Returns NULL otherwise.
47  *
48  */
49 char *startup_workspace_for_window(i3Window *cwindow, xcb_get_property_reply_t *startup_id_reply);
50
51 #endif