add i3-nagbar. tells you about config file errors (for example)

This commit is contained in:
Michael Stapelberg
2011-07-10 14:33:19 +02:00
parent b63a559c28
commit c55abca115
17 changed files with 864 additions and 45 deletions

View File

@ -32,6 +32,8 @@ extern SLIST_HEAD(modes_head, Mode) modes;
*
*/
struct context {
bool has_errors;
int line_number;
char *line_copy;
const char *filename;
@ -190,6 +192,17 @@ void switch_mode(const char *new_mode);
*/
Binding *get_binding(uint16_t modifiers, xcb_keycode_t keycode);
/**
* Kills the configerror i3-nagbar process, if any.
*
* Called when reloading/restarting.
*
* If wait_for_it is set (restarting), this function will waitpid(), otherwise,
* ev is assumed to handle it (reloading).
*
*/
void kill_configerror_nagbar(bool wait_for_it);
/* prototype for src/cfgparse.y */
void parse_file(const char *f);

View File

@ -32,5 +32,6 @@ extern SLIST_HEAD(stack_wins_head, Stack_Window) stack_wins;
extern uint8_t root_depth;
extern bool xcursor_supported, xkb_supported;
extern xcb_window_t root;
extern struct ev_loop *main_loop;
#endif

View File

@ -1,9 +1,9 @@
/*
* vim:ts=8:expandtab
* vim:ts=4:sw=4:expandtab
*
* i3 - an improved dynamic tiling window manager
*
* © 2009-2010 Michael Stapelberg and contributors
* © 2009-2011 Michael Stapelberg and contributors
*
* See file LICENSE for license information.
*
@ -21,6 +21,14 @@
#define DLOG(fmt, ...) debuglog(LOGLEVEL, "%s:%s:%d - " fmt, __FILE__, __FUNCTION__, __LINE__, ##__VA_ARGS__)
extern char *loglevels[];
extern char *errorfilename;
/**
* Initializes logging by creating an error logfile in /tmp (or
* XDG_RUNTIME_DIR, see get_process_filename()).
*
*/
void init_logging();
/**
* Enables the given loglevel.

View File

@ -102,6 +102,23 @@ char *sstrdup(const char *str);
*/
void start_application(const char *command);
/**
* exec()s an i3 utility, for example the config file migration script or
* i3-nagbar. This function first searches $PATH for the given utility named,
* then falls back to the dirname() of the i3 executable path and then falls
* back to the dirname() of the target of /proc/self/exe (on linux).
*
* This function should be called after fork()ing.
*
* The first argument of the given argv vector will be overwritten with the
* executable name, so pass NULL.
*
* If the utility cannot be found in any of these locations, it exits with
* return code 2.
*
*/
void exec_i3_utility(char *name, char *argv[]);
/**
* Checks a generic cookie for errors and quits with the given message if
* there was an error.