void got_output_event(char *event) {
DLOG("Got Output Event!\n");
i3_send_msg(I3_IPC_MESSAGE_TYPE_GET_OUTPUTS, NULL);
- i3_send_msg(I3_IPC_MESSAGE_TYPE_GET_WORKSPACES, NULL);
+ if (!config.disable_ws) {
+ i3_send_msg(I3_IPC_MESSAGE_TYPE_GET_WORKSPACES, NULL);
+ }
}
/* Data-structure to easily call the reply-handlers later */
*
*/
void subscribe_events() {
- i3_send_msg(I3_IPC_MESSAGE_TYPE_SUBSCRIBE, "[ \"workspace\", \"output\" ]");
+ if (config.disable_ws) {
+ i3_send_msg(I3_IPC_MESSAGE_TYPE_SUBSCRIBE, "[ \"output\" ]");
+ } else {
+ i3_send_msg(I3_IPC_MESSAGE_TYPE_SUBSCRIBE, "[ \"workspace\", \"output\" ]");
+ }
}
printf("\t\tIf -c is specified, the childprocess is sent a SIGSTOP on hiding,\n");
printf("\t\tand a SIGCONT on unhiding of the bars\n");
printf("-f <font>\tUse X-Core-Font <font> for display\n");
+ printf("-w\t\tDisable workspace-buttons\n");
printf("-V\t\tBe (very) verbose with the debug-output\n");
printf("-h\t\tDisplay this help-message and exit\n");
}
/* Definition of the standard-config */
config.hide_on_modifier = 0;
config.dockpos = DOCKPOS_NONE;
+ config.disable_ws = 0;
static struct option long_opt[] = {
{ "socket", required_argument, 0, 's' },
{ "hide", no_argument, 0, 'm' },
{ "dock", optional_argument, 0, 'd' },
{ "font", required_argument, 0, 'f' },
+ { "nows", no_argument, 0, 'w' },
{ "help", no_argument, 0, 'h' },
{ "version", no_argument, 0, 'v' },
{ "verbose", no_argument, 0, 'V' },
{ NULL, 0, 0, 0}
};
- while ((opt = getopt_long(argc, argv, "s:c:d::mf:hvVA:B:C:D:E:F:G:H:I:J:", long_opt, &option_index)) != -1) {
+ while ((opt = getopt_long(argc, argv, "s:c:d::mf:whvVA:B:C:D:E:F:G:H:I:J:", long_opt, &option_index)) != -1) {
switch (opt) {
case 's':
socket_path = expand_path(optarg);
case 'f':
fontname = strdup(optarg);
break;
+ case 'w':
+ config.disable_ws = 1;
+ break;
case 'v':
printf("i3bar version " I3BAR_VERSION " © 2010 Axel Wagner and contributors\n");
exit(EXIT_SUCCESS);
* workspaces. Everything else (creating the bars, showing the right workspace-
* buttons and more) is taken care of by the event-driveniness of the code */
i3_send_msg(I3_IPC_MESSAGE_TYPE_GET_OUTPUTS, NULL);
- i3_send_msg(I3_IPC_MESSAGE_TYPE_GET_WORKSPACES, NULL);
+ if (!config.disable_ws) {
+ i3_send_msg(I3_IPC_MESSAGE_TYPE_GET_WORKSPACES, NULL);
+ }
/* The name of this function is actually misleading. Even if no -c is specified,
* this function initiates the watchers to listen on stdin and react accordingly */
/* If hide_on_modifier is set, i3 is not supposed to manage our bar-windows */
values[1] = config.hide_on_modifier;
/* The events we want to receive */
- values[2] = XCB_EVENT_MASK_EXPOSURE |
- XCB_EVENT_MASK_BUTTON_PRESS;
+ values[2] = XCB_EVENT_MASK_EXPOSURE;
+ if (!config.disable_ws) {
+ values[2] |= XCB_EVENT_MASK_BUTTON_PRESS;
+ }
xcb_void_cookie_t win_cookie = xcb_create_window_checked(xcb_connection,
xcb_screen->root_depth,
walk->bar,
MIN(outputs_walk->rect.w - 4, statusline_width), font_height);
}
+ if (config.disable_ws) {
+ continue;
+ }
+
i3_ws *ws_walk;
TAILQ_FOREACH(ws_walk, outputs_walk->workspaces, tailq) {
DLOG("Drawing Button for WS %s at x = %d\n", ws_walk->name, i);
i += 10 + ws_walk->name_width;
}
- redraw_bars();
-
i = 0;
}
+
+ redraw_bars();
}
/*