* i3bar - an xcb-based status- and ws-bar for i3
* © 2010-2012 Axel Wagner and contributors (see also: LICENSE)
*
- * child.c: Getting Input for the statusline
+ * child.c: Getting input for the statusline
*
*/
#pragma once
void destroy_connection(void);
/*
- * Sends a Message to i3.
+ * Sends a message to i3.
* type must be a valid I3_IPC_MESSAGE_TYPE (see i3/ipc.h for further information)
*
*/
} \
} while (0)
-/* Securely fee single-linked list */
+/* Securely free single-linked list */
#define FREE_SLIST(l, type) \
do { \
type *walk = SLIST_FIRST(l); \
} \
} while (0)
-/* Securely fee tail-queues */
+/* Securely free tail queue */
#define FREE_TAILQ(l, type) \
do { \
type *walk = TAILQ_FIRST(l); \
/*
* We need to set the _NET_SYSTEM_TRAY_COLORS atom on the tray selection window
- * to make GTK+ 3 applets with Symbolic Icons visible. If the colors are unset,
+ * to make GTK+ 3 applets with symbolic icons visible. If the colors are unset,
* they assume a light background.
* See also https://bugzilla.gnome.org/show_bug.cgi?id=679591
*
* i3bar - an xcb-based status- and ws-bar for i3
* © 2010-2012 Axel Wagner and contributors (see also: LICENSE)
*
- * child.c: Getting Input for the statusline
+ * child.c: Getting input for the statusline
*
*/
#include <stdlib.h>
state = yajl_parse(handle, (const unsigned char *)json, strlen(json));
- /* FIXME: Proper errorhandling for JSON-parsing */
+ /* FIXME: Proper error handling for JSON parsing */
switch (state) {
case yajl_status_ok:
break;
*
*/
void got_workspace_reply(char *reply) {
- DLOG("Got Workspace-Data!\n");
+ DLOG("Got workspace data!\n");
parse_workspaces_json(reply);
draw_bars(false);
}
*
*/
void got_subscribe_reply(char *reply) {
- DLOG("Got Subscribe Reply: %s\n", reply);
+ DLOG("Got subscribe reply: %s\n", reply);
/* TODO: Error handling for subscribe commands */
}
*
*/
void got_output_reply(char *reply) {
- DLOG("Parsing Outputs-JSON...\n");
+ DLOG("Parsing outputs JSON...\n");
parse_outputs_json(reply);
- DLOG("Reconfiguring Windows...\n");
+ DLOG("Reconfiguring windows...\n");
realloc_sl_buffer();
reconfig_windows(false);
FREE(config.command);
}
-/* Data-structure to easily call the reply handlers later */
+/* Data structure to easily call the reply handlers later */
handler_t reply_handlers[] = {
&got_command_reply,
&got_workspace_reply,
*
*/
void got_workspace_event(char *event) {
- DLOG("Got Workspace Event!\n");
+ DLOG("Got workspace event!\n");
i3_send_msg(I3_IPC_MESSAGE_TYPE_GET_WORKSPACES, NULL);
}
/*
- * Called, when an output event arrives (i.e. the screen-configuration changed)
+ * Called, when an output event arrives (i.e. the screen configuration changed)
*
*/
void got_output_event(char *event) {
- DLOG("Got Output Event!\n");
+ DLOG("Got output event!\n");
i3_send_msg(I3_IPC_MESSAGE_TYPE_GET_OUTPUTS, NULL);
if (!config.disable_ws) {
i3_send_msg(I3_IPC_MESSAGE_TYPE_GET_WORKSPACES, NULL);
*
*/
void got_mode_event(char *event) {
- DLOG("Got Mode Event!\n");
+ DLOG("Got mode event!\n");
parse_mode_json(event);
draw_bars(false);
}
draw_bars(false);
}
-/* Data-structure to easily call the event handlers later */
+/* Data structure to easily call the event handlers later */
handler_t event_handlers[] = {
&got_workspace_event,
&got_output_event,
uint32_t header_len = strlen(I3_IPC_MAGIC) + sizeof(uint32_t) * 2;
char *header = smalloc(header_len);
- /* We first parse the fixed-length IPC-header, to know, how much data
+ /* We first parse the fixed-length IPC header, to know, how much data
* we have to expect */
uint32_t rec = 0;
while (rec < header_len) {
}
/*
- * Sends a Message to i3.
+ * Sends a message to i3.
* type must be a valid I3_IPC_MESSAGE_TYPE (see i3/ipc.h for further information)
*
*/
}
if (socket_path == NULL) {
- ELOG("No Socket Path Specified, default to %s\n", i3_default_sock_path);
+ ELOG("No socket path specified, default to %s\n", i3_default_sock_path);
socket_path = expand_path(i3_default_sock_path);
}
state = yajl_parse(handle, (const unsigned char *)json, strlen(json));
- /* FIXME: Propper errorhandling for JSON-parsing */
+ /* FIXME: Propper error handling for JSON parsing */
switch (state) {
case yajl_status_ok:
break;
params->workspaces_walk->name_width =
predict_text_width(params->workspaces_walk->name);
- DLOG("Got Workspace canonical: %s, name: '%s', name_width: %d, glyphs: %zu\n",
+ DLOG("Got workspace canonical: %s, name: '%s', name_width: %d, glyphs: %zu\n",
params->workspaces_walk->canonical_name,
i3string_as_utf8(params->workspaces_walk->name),
params->workspaces_walk->name_width,
state = yajl_parse(handle, (const unsigned char *)json, strlen(json));
- /* FIXME: Propper errorhandling for JSON-parsing */
+ /* FIXME: Propper error handling for JSON parsing */
switch (state) {
case yajl_status_ok:
break;
case yajl_status_client_canceled:
case yajl_status_error:
- ELOG("Could not parse workspaces-reply!\n");
+ ELOG("Could not parse workspaces reply!\n");
exit(EXIT_FAILURE);
break;
}
#include "common.h"
#include "libi3.h"
-/* We save the Atoms in an easy to access array, indexed by an enum */
+/* We save the atoms in an easy to access array, indexed by an enum */
enum {
#define ATOM_DO(name) name,
#include "xcb_atoms.def"
xcb_pixmap_t statusline_pm;
uint32_t statusline_width;
-/* Event-Watchers, to interact with the user */
+/* Event watchers, to interact with the user */
ev_prepare *xcb_prep;
ev_check *xcb_chk;
ev_io *xcb_io;
redraw_bars();
break;
case XCB_BUTTON_PRESS:
- /* Button press events are mouse-buttons clicked on one of our bars */
+ /* Button press events are mouse buttons clicked on one of our bars */
handle_button((xcb_button_press_event_t *)event);
break;
case XCB_CLIENT_MESSAGE:
}
/*
- * Dummy Callback. We only need this, so that the Prepare- and Check-Watchers
+ * Dummy callback. We only need this, so that the prepare and check watchers
* are triggered
*
*/
*
*/
char *init_xcb_early() {
- /* FIXME: xcb_connect leaks Memory */
+ /* FIXME: xcb_connect leaks memory */
xcb_connection = xcb_connect(NULL, &screen);
if (xcb_connection_has_error(xcb_connection)) {
ELOG("Cannot open display\n");
root_screen->width_in_pixels,
root_screen->height_in_pixels);
- /* The various Watchers to communicate with xcb */
+ /* The various watchers to communicate with xcb */
xcb_io = smalloc(sizeof(ev_io));
xcb_prep = smalloc(sizeof(ev_prepare));
xcb_chk = smalloc(sizeof(ev_check));
/*
* We need to set the _NET_SYSTEM_TRAY_COLORS atom on the tray selection window
- * to make GTK+ 3 applets with Symbolic Icons visible. If the colors are unset,
+ * to make GTK+ 3 applets with symbolic icons visible. If the colors are unset,
* they assume a light background.
* See also https://bugzilla.gnome.org/show_bug.cgi?id=679591
*