i3bar: Add current binding mode indicator

This commit is contained in:
Pavel Löbl
2012-11-10 13:41:39 +01:00
committed by Michael Stapelberg
parent 773654dbb8
commit 6148136e7c
6 changed files with 242 additions and 3 deletions

View File

@ -50,6 +50,7 @@ TAILQ_HEAD(statusline_head, status_block) statusline_head;
#include "outputs.h"
#include "util.h"
#include "workspaces.h"
#include "mode.h"
#include "trayclients.h"
#include "xcb.h"
#include "config.h"

31
i3bar/include/mode.h Normal file
View File

@ -0,0 +1,31 @@
/*
* vim:ts=4:sw=4:expandtab
*
* i3bar - an xcb-based status- and ws-bar for i3
* © 2010-2012 Axel Wagner and contributors (see also: LICENSE)
*
* mode.c: Handle mode-event and show current binding mode in the bar
*
*/
#ifndef MODE_H_
#define MODE_H_
#include <xcb/xproto.h>
#include "common.h"
/* Name of current binding mode and its render width */
struct mode {
i3String *name;
int width;
};
typedef struct mode mode;
/*
* Start parsing the received json-string
*
*/
void parse_mode_json(char *json);
#endif

View File

@ -118,4 +118,10 @@ void draw_bars(bool force_unhide);
*/
void redraw_bars(void);
/*
* Set the current binding mode
*
*/
void set_current_mode(struct mode *mode);
#endif