2 #define I3__FILE__ "commands.c"
19 #define y(x, ...) yajl_gen_ ## x (cmd_output->json_gen, ##__VA_ARGS__)
20 #define ystr(str) yajl_gen_string(cmd_output->json_gen, (unsigned char*)str, strlen(str))
21 #define ysuccess(success) do { \
33 #define HANDLE_EMPTY_MATCH do { \
34 if (match_is_empty(current_match)) { \
35 owindow *ow = smalloc(sizeof(owindow)); \
37 TAILQ_INIT(&owindows); \
38 TAILQ_INSERT_TAIL(&owindows, ow, owindows); \
48 return (a - b) > ( (fabs(a) < fabs(b) ? fabs(b) : fabs(a)) * epsilon);
59 if (strcasecmp(output_str,
"left") == 0)
61 else if (strcasecmp(output_str,
"right") == 0)
63 else if (strcasecmp(output_str,
"up") == 0)
65 else if (strcasecmp(output_str,
"down") == 0)
83 if (strcmp(ws->
name, name) != 0)
86 DLOG(
"This workspace is already focused.\n");
106 if (current == workspace) {
109 DLOG(
"Substituting workspace with back_and_forth, as it is focused.\n");
120 static pid_t migration_pid = -1;
127 static void nagbar_exited(EV_P_ ev_child *watcher,
int revents) {
128 ev_child_stop(EV_A_ watcher);
129 if (!WIFEXITED(watcher->rstatus)) {
130 fprintf(stderr,
"ERROR: i3-nagbar did not exit normally.\n");
134 int exitcode = WEXITSTATUS(watcher->rstatus);
135 printf(
"i3-nagbar process exited with status %d\n", exitcode);
137 fprintf(stderr,
"ERROR: i3-nagbar could not be found. Is it correctly installed on your system?\n");
146 #if EV_VERSION_MAJOR >= 4
152 static void nagbar_cleanup(EV_P_ ev_cleanup *watcher,
int revent) {
153 if (migration_pid != -1) {
154 LOG(
"Sending SIGKILL (9) to i3-nagbar with PID %d\n", migration_pid);
155 kill(migration_pid, SIGKILL);
160 void cmd_MIGRATION_start_nagbar(
void) {
161 if (migration_pid != -1) {
162 fprintf(stderr,
"i3-nagbar already running.\n");
165 fprintf(stderr,
"Starting i3-nagbar, command parsing differs from expected output.\n");
166 ELOG(
"Please report this on IRC or in the bugtracker. Make sure to include the full debug level logfile:\n");
167 ELOG(
"i3-dump-log | gzip -9c > /tmp/i3.log.gz\n");
168 ELOG(
"FYI: Your i3 version is " I3_VERSION
"\n");
169 migration_pid = fork();
170 if (migration_pid == -1) {
171 warn(
"Could not fork()");
176 if (migration_pid == 0) {
184 "You found a parsing error. Please, please, please, report it!",
195 ev_child *child =
smalloc(
sizeof(ev_child));
202 #if EV_VERSION_MAJOR >= 4
205 ev_cleanup *cleanup =
smalloc(
sizeof(ev_cleanup));
229 static owindows_head owindows;
264 DLOG(
"match specification finished, matching...\n");
267 struct owindows_head old = owindows;
276 DLOG(
"checking if con %p / %s matches\n", current->
con, current->
con->
name);
279 DLOG(
"matches container!\n");
284 DLOG(
"match by mark\n");
290 DLOG(
"matches window!\n");
293 DLOG(
"doesnt match\n");
310 DLOG(
"ctype=*%s*, cvalue=*%s*\n", ctype, cvalue);
312 if (strcmp(ctype,
"class") == 0) {
317 if (strcmp(ctype,
"instance") == 0) {
322 if (strcmp(ctype,
"window_role") == 0) {
327 if (strcmp(ctype,
"con_id") == 0) {
329 long parsed = strtol(cvalue, &end, 10);
330 if (parsed == LONG_MIN ||
331 parsed == LONG_MAX ||
333 (end && *end !=
'\0')) {
334 ELOG(
"Could not parse con id \"%s\"\n", cvalue);
342 if (strcmp(ctype,
"id") == 0) {
344 long parsed = strtol(cvalue, &end, 10);
345 if (parsed == LONG_MIN ||
346 parsed == LONG_MAX ||
348 (end && *end !=
'\0')) {
349 ELOG(
"Could not parse window id \"%s\"\n", cvalue);
357 if (strcmp(ctype,
"con_mark") == 0) {
362 if (strcmp(ctype,
"title") == 0) {
367 if (strcmp(ctype,
"urgent") == 0) {
368 if (strcasecmp(cvalue,
"latest") == 0 ||
369 strcasecmp(cvalue,
"newest") == 0 ||
370 strcasecmp(cvalue,
"recent") == 0 ||
371 strcasecmp(cvalue,
"last") == 0) {
373 }
else if (strcasecmp(cvalue,
"oldest") == 0 ||
374 strcasecmp(cvalue,
"first") == 0) {
380 ELOG(
"Unknown criterion: %s\n", ctype);
391 DLOG(
"which=%s\n", which);
407 if (strcmp(which,
"next") == 0)
409 else if (strcmp(which,
"prev") == 0)
411 else if (strcmp(which,
"next_on_output") == 0)
413 else if (strcmp(which,
"prev_on_output") == 0)
415 else if (strcmp(which,
"current") == 0)
418 ELOG(
"BUG: called with which=%s\n", which);
428 cmd_output->needs_tree_render =
true;
448 ystr(
"No workspace was previously active.");
460 cmd_output->needs_tree_render =
true;
470 if (strncasecmp(name,
"__i3_", strlen(
"__i3_")) == 0) {
471 LOG(
"You cannot switch to the i3 internal workspaces.\n");
482 ELOG(
"No windows match your criteria, cannot move.\n");
492 LOG(
"should move window to workspace %s\n", name);
505 cmd_output->needs_tree_render =
true;
527 LOG(
"should move window to workspace %s\n", which);
529 Con *output, *workspace = NULL;
532 long parsed_num = strtol(which, &endptr, 10);
533 if (parsed_num == LONG_MIN ||
534 parsed_num == LONG_MAX ||
537 LOG(
"Could not parse initial part of \"%s\" as a number.\n", which);
543 ystr(
"Could not parse number");
550 child->
num == parsed_num);
565 cmd_output->needs_tree_render =
true;
571 LOG(
"floating resize\n");
578 if (strcmp(direction,
"up") == 0 || strcmp(direction,
"down") == 0 ||
579 strcmp(direction,
"height") == 0) {
583 px = (px < focused_con->height_increment) ? focused_con->
height_increment : px;
584 }
else if (strcmp(direction,
"left") == 0 || strcmp(direction,
"right") == 0) {
588 px = (px < focused_con->width_increment) ? focused_con->
width_increment : px;
591 if (strcmp(direction,
"up") == 0) {
593 }
else if (strcmp(direction,
"down") == 0 || strcmp(direction,
"height") == 0) {
595 }
else if (strcmp(direction,
"left") == 0) {
605 if (memcmp(&old_rect, &(floating_con->
rect),
sizeof(
Rect)) == 0)
608 if (strcmp(direction,
"up") == 0) {
610 }
else if (strcmp(direction,
"left") == 0) {
620 LOG(
"tiling resize\n");
623 double percentage = 0;
626 current = current->
parent;
630 (strcmp(direction,
"left") == 0 || strcmp(direction,
"right") == 0 ?
HORIZ :
VERT);
634 current = current->
parent;
640 LOG(
"ins. %d children\n", children);
641 percentage = 1.0 / children;
642 LOG(
"default percentage = %f\n", percentage);
646 if ((orientation ==
HORIZ &&
647 (strcmp(direction,
"up") == 0 || strcmp(direction,
"down") == 0)) ||
648 (orientation ==
VERT &&
649 (strcmp(direction,
"left") == 0 || strcmp(direction,
"right") == 0))) {
650 LOG(
"You cannot resize in that direction. Your focus is in a %s split container currently.\n",
651 (orientation ==
HORIZ ?
"horizontal" :
"vertical"));
656 if (strcmp(direction,
"up") == 0 || strcmp(direction,
"left") == 0) {
657 other =
TAILQ_PREV(current, nodes_head, nodes);
662 LOG(
"No other container in this direction found, trying to look further up in the tree...\n");
663 current = current->
parent;
667 }
while (current->
type != CT_WORKSPACE &&
668 current->
type != CT_FLOATING_CON);
671 LOG(
"No other container in this direction found, trying to look further up in the tree...\n");
677 LOG(
"current->percent before = %f\n", current->
percent);
682 double new_current_percent = current->
percent + ((double)ppt / 100.0);
683 double new_other_percent = other->
percent - ((double)ppt / 100.0);
684 LOG(
"new_current_percent = %f\n", new_current_percent);
685 LOG(
"new_other_percent = %f\n", new_other_percent);
690 current->
percent += ((double)ppt / 100.0);
691 other->
percent -= ((double)ppt / 100.0);
692 LOG(
"current->percent after = %f\n", current->
percent);
693 LOG(
"other->percent after = %f\n", other->
percent);
695 LOG(
"Not resizing, already at minimum size\n");
702 LOG(
"width/height resize\n");
706 current = current->
parent;
710 (strcmp(direction,
"width") == 0 ?
HORIZ :
VERT);
712 while (current->
type != CT_WORKSPACE &&
713 current->
type != CT_FLOATING_CON &&
715 current = current->
parent;
719 LOG(
"ins. %d children\n", children);
720 double percentage = 1.0 / children;
721 LOG(
"default percentage = %f\n", percentage);
725 if ((orientation ==
HORIZ &&
726 strcmp(direction,
"height") == 0) ||
727 (orientation ==
VERT &&
728 strcmp(direction,
"width") == 0)) {
729 LOG(
"You cannot resize in that direction. Your focus is in a %s split container currently.\n",
730 (orientation ==
HORIZ ?
"horizontal" :
"vertical"));
736 LOG(
"This is the only container, cannot resize.\n");
744 LOG(
"child->percent = %f (child %p)\n", child->
percent, child);
749 double new_current_percent = current->
percent + ((double)ppt / 100.0);
750 double subtract_percent = ((double)ppt / 100.0) / (children - 1);
751 LOG(
"new_current_percent = %f\n", new_current_percent);
752 LOG(
"subtract_percent = %f\n", subtract_percent);
756 if (child == current)
759 LOG(
"Not resizing, already at minimum size (child %p would end up with a size of %.f\n", child, child->
percent - subtract_percent);
765 LOG(
"Not resizing, already at minimum size\n");
770 current->
percent += ((double)ppt / 100.0);
771 LOG(
"current->percent after = %f\n", current->
percent);
774 if (child == current)
776 child->
percent -= subtract_percent;
777 LOG(
"child->percent after (%p) = %f\n", child, child->
percent);
789 DLOG(
"resizing in way %s, direction %s, px %s or ppt %s\n", way, direction, resize_px, resize_ppt);
791 int px = atoi(resize_px);
792 int ppt = atoi(resize_ppt);
793 if (strcmp(way,
"shrink") == 0) {
806 if (strcmp(direction,
"width") == 0 ||
807 strcmp(direction,
"height") == 0) {
817 cmd_output->needs_tree_render =
true;
827 DLOG(
"border style should be changed to %s with border width %s\n", border_style_str, border_width);
836 int tmp_border_width = -1;
837 tmp_border_width = strtol(border_width, &end, 10);
838 if (end == border_width) {
840 tmp_border_width = -1;
842 if (strcmp(border_style_str,
"toggle") == 0) {
846 tmp_border_width = 2;
847 else if (border_style ==
BS_NONE)
848 tmp_border_width = 0;
850 tmp_border_width = 1;
852 if (strcmp(border_style_str,
"normal") == 0)
854 else if (strcmp(border_style_str,
"pixel") == 0)
856 else if (strcmp(border_style_str,
"1pixel") == 0){
858 tmp_border_width = 1;
859 }
else if (strcmp(border_style_str,
"none") == 0)
862 ELOG(
"BUG: called with border_style=%s\n", border_style_str);
870 cmd_output->needs_tree_render =
true;
880 LOG(
"-------------------------------------------------\n");
881 LOG(
" NOP: %s\n", comment);
882 LOG(
"-------------------------------------------------\n");
890 LOG(
"Appending layout \"%s\"\n", path);
893 cmd_output->needs_tree_render =
true;
905 DLOG(
"which=%s\n", which);
907 if (strcmp(which,
"next") == 0)
909 else if (strcmp(which,
"prev") == 0)
911 else if (strcmp(which,
"next_on_output") == 0)
913 else if (strcmp(which,
"prev_on_output") == 0)
916 ELOG(
"BUG: called with which=%s\n", which);
923 cmd_output->needs_tree_render =
true;
933 Con *output, *workspace = NULL;
936 long parsed_num = strtol(which, &endptr, 10);
937 if (parsed_num == LONG_MIN ||
938 parsed_num == LONG_MAX ||
941 LOG(
"Could not parse initial part of \"%s\" as a number.\n", which);
947 ystr(
"Could not parse number");
955 child->
num == parsed_num);
958 LOG(
"There is no workspace with number %ld, creating a new one.\n", parsed_num);
961 cmd_output->needs_tree_render =
true;
968 cmd_output->needs_tree_render =
true;
980 cmd_output->needs_tree_render =
true;
990 if (strncasecmp(name,
"__i3_", strlen(
"__i3_")) == 0) {
991 LOG(
"You cannot switch to the i3 internal workspaces.\n");
996 DLOG(
"should switch to workspace %s\n", name);
1001 cmd_output->needs_tree_render =
true;
1011 DLOG(
"Clearing all windows which have that mark first\n");
1015 if (con->
mark && strcmp(con->
mark, mark) == 0)
1019 DLOG(
"marking window with str %s\n", mark);
1029 cmd_output->needs_tree_render =
true;
1044 DLOG(
"removed all window marks");
1048 if (con->
mark && strcmp(con->
mark, mark) == 0)
1051 DLOG(
"removed window mark %s\n", mark);
1054 cmd_output->needs_tree_render =
true;
1064 DLOG(
"mode=%s\n", mode);
1078 DLOG(
"should move window to output %s\n", name);
1083 Output *current_output = NULL;
1090 assert(current_output != NULL);
1093 if (strcasecmp(name,
"up") == 0)
1095 else if (strcasecmp(name,
"down") == 0)
1097 else if (strcasecmp(name,
"left") == 0)
1099 else if (strcasecmp(name,
"right") == 0)
1105 LOG(
"No such output found.\n");
1123 cmd_output->needs_tree_render =
true;
1135 DLOG(
"floating_mode=%s\n", floating_mode);
1141 if (strcmp(floating_mode,
"toggle") == 0) {
1142 DLOG(
"should toggle mode\n");
1145 DLOG(
"should switch mode to %s\n", floating_mode);
1146 if (strcmp(floating_mode,
"enable") == 0) {
1154 cmd_output->needs_tree_render =
true;
1164 DLOG(
"should move workspace to output %s\n", name);
1172 if (!current_output) {
1173 ELOG(
"Cannot get current output. This is a bug in i3.\n");
1179 ELOG(
"Could not get output from string \"%s\"\n", name);
1185 LOG(
"got output %p with content %p\n", output, content);
1187 Con *previously_visible_ws =
TAILQ_FIRST(&(content->nodes_head));
1188 LOG(
"Previously visible workspace = %p / %s\n", previously_visible_ws, previously_visible_ws->
name);
1191 LOG(
"should move workspace %p / %s\n", ws, ws->
name);
1195 LOG(
"Creating a new workspace to replace \"%s\" (last on its output).\n", ws->
name);
1198 bool used_assignment =
false;
1201 if (strcmp(assignment->
output, current_output->
name) != 0)
1205 Con *workspace = NULL, *out;
1208 !strcasecmp(child->name, assignment->
name));
1209 if (workspace != NULL)
1213 LOG(
"Creating workspace from assignment %s.\n", assignment->
name);
1215 used_assignment =
true;
1221 if (!used_assignment)
1225 ipc_send_event(
"workspace", I3_IPC_EVENT_WORKSPACE,
"{\"change\":\"init\"}");
1227 DLOG(
"Detaching\n");
1232 if (workspace_was_visible) {
1236 LOG(
"workspace was visible, focusing %p / %s now\n", focus_ws, focus_ws->
name);
1243 TAILQ_FOREACH(floating_con, &(ws->floating_head), floating_windows)
1246 ipc_send_event(
"workspace", I3_IPC_EVENT_WORKSPACE,
"{\"change\":\"move\"}");
1247 if (workspace_was_visible) {
1258 if (ws != previously_visible_ws)
1264 CALL(previously_visible_ws, on_remove_child);
1269 cmd_output->needs_tree_render =
true;
1281 LOG(
"splitting in direction %c\n", direction[0]);
1291 cmd_output->needs_tree_render =
true;
1301 if (kill_mode_str == NULL)
1302 kill_mode_str =
"window";
1305 DLOG(
"kill_mode=%s\n", kill_mode_str);
1308 if (strcmp(kill_mode_str,
"window") == 0)
1310 else if (strcmp(kill_mode_str,
"client") == 0)
1313 ELOG(
"BUG: called with kill_mode=%s\n", kill_mode_str);
1328 cmd_output->needs_tree_render =
true;
1338 bool no_startup_id = (nosn != NULL);
1340 DLOG(
"should execute %s, no_startup_id = %d\n", command, no_startup_id);
1352 DLOG(
"direction = *%s*\n", direction);
1354 if (strcmp(direction,
"left") == 0)
1356 else if (strcmp(direction,
"right") == 0)
1358 else if (strcmp(direction,
"up") == 0)
1360 else if (strcmp(direction,
"down") == 0)
1363 ELOG(
"Invalid focus direction (%s)\n", direction);
1368 cmd_output->needs_tree_render =
true;
1378 DLOG(
"window_mode = %s\n", window_mode);
1383 if (strcmp(window_mode,
"mode_toggle") == 0) {
1385 if (current != NULL && current->
type == CT_FLOATING_CON)
1386 window_mode =
"tiling";
1387 else window_mode =
"floating";
1390 if ((strcmp(window_mode,
"floating") == 0 && current->
type != CT_FLOATING_CON) ||
1391 (strcmp(window_mode,
"tiling") == 0 && current->
type == CT_FLOATING_CON))
1399 cmd_output->needs_tree_render =
true;
1409 DLOG(
"level = %s\n", level);
1410 bool success =
false;
1414 if (strcmp(level,
"parent") == 0) {
1419 ELOG(
"'focus parent': Currently in fullscreen, not going up\n");
1426 cmd_output->needs_tree_render = success;
1439 ELOG(
"You have to specify which window/container should be focused.\n");
1440 ELOG(
"Example: [class=\"urxvt\" title=\"irssi\"] focus\n");
1446 ystr(
"You have to specify which window/container should be focused");
1464 LOG(
"Cannot change focus while in fullscreen mode (fullscreen rules).\n");
1470 if (ws == __i3_scratch) {
1497 LOG(
"focusing %p / %s\n", current->
con, current->
con->
name);
1503 LOG(
"WARNING: Your criteria for the focus command matches %d containers, "
1504 "while only exactly one container can be focused at a time.\n", count);
1506 cmd_output->needs_tree_render =
true;
1516 if (fullscreen_mode == NULL)
1517 fullscreen_mode =
"output";
1518 DLOG(
"toggling fullscreen, mode = %s\n", fullscreen_mode);
1524 printf(
"matching: %p / %s\n", current->
con, current->
con->
name);
1528 cmd_output->needs_tree_render =
true;
1539 int px = atoi(move_px);
1542 DLOG(
"moving in direction %s, px %s\n", direction, move_px);
1544 DLOG(
"floating move with %d pixels\n", px);
1546 if (strcmp(direction,
"left") == 0) {
1548 }
else if (strcmp(direction,
"right") == 0) {
1550 }
else if (strcmp(direction,
"up") == 0) {
1552 }
else if (strcmp(direction,
"down") == 0) {
1558 (strcmp(direction,
"left") == 0 ?
D_LEFT :
1559 (strcmp(direction,
"up") == 0 ?
D_UP :
1561 cmd_output->needs_tree_render =
true;
1573 if (strcmp(layout_str,
"stacking") == 0)
1574 layout_str =
"stacked";
1578 if (strcmp(layout_str,
"default") == 0)
1580 else if (strcmp(layout_str,
"stacked") == 0)
1582 else if (strcmp(layout_str,
"tabbed") == 0)
1584 else if (strcmp(layout_str,
"splitv") == 0)
1586 else if (strcmp(layout_str,
"splith") == 0)
1589 ELOG(
"Unknown layout \"%s\", this is a mismatch between code and parser spec.\n", layout_str);
1593 DLOG(
"changing layout to %s (%d)\n", layout_str, layout);
1605 cmd_output->needs_tree_render =
true;
1617 if (toggle_mode == NULL)
1618 toggle_mode =
"default";
1620 DLOG(
"toggling layout (mode = %s)\n", toggle_mode);
1632 cmd_output->needs_tree_render =
true;
1642 LOG(
"Exiting due to user command.\n");
1643 xcb_disconnect(
conn);
1660 ipc_send_event(
"workspace", I3_IPC_EVENT_WORKSPACE,
"{\"change\":\"reload\"}");
1673 LOG(
"restarting i3\n");
1685 LOG(
"opening new container\n");
1694 y(integer, (
long int)con);
1697 cmd_output->needs_tree_render =
true;
1707 DLOG(
"name = %s\n", name);
1712 Output *current_output = NULL;
1717 assert(current_output != NULL);
1722 LOG(
"No such output found.\n");
1737 cmd_output->needs_tree_render =
true;
1752 ELOG(
"Cannot change position. The window/container is not floating\n");
1757 ystr(
"Cannot change position. The window/container is not floating.");
1762 if (strcmp(method,
"absolute") == 0) {
1766 DLOG(
"moving to absolute position %d %d\n", x, y);
1768 cmd_output->needs_tree_render =
true;
1771 if (strcmp(method,
"position") == 0) {
1774 DLOG(
"moving to position %d %d\n", x, y);
1792 ELOG(
"Cannot change position. The window/container is not floating\n");
1797 ystr(
"Cannot change position. The window/container is not floating.");
1801 if (strcmp(method,
"absolute") == 0) {
1804 DLOG(
"moving to absolute center\n");
1809 cmd_output->needs_tree_render =
true;
1812 if (strcmp(method,
"position") == 0) {
1816 DLOG(
"moving to center\n");
1832 DLOG(
"should move window to scratchpad\n");
1842 cmd_output->needs_tree_render =
true;
1852 DLOG(
"should show scratchpad window\n");
1864 cmd_output->needs_tree_render =
true;
1875 LOG(
"Renaming workspace \"%s\" to \"%s\"\n", old_name, new_name);
1877 LOG(
"Renaming current workspace to \"%s\"\n", new_name);
1884 !strcasecmp(child->name, old_name));
1897 ystr(
"Old workspace not found");
1902 Con *check_dest = NULL;
1905 !strcasecmp(child->name, new_name));
1907 if (check_dest != NULL) {
1915 ystr(
"New workspace already exists");
1923 char *endptr = NULL;
1924 long parsed_num = strtol(new_name, &endptr, 10);
1925 if (parsed_num == LONG_MIN ||
1926 parsed_num == LONG_MAX ||
1929 workspace->
num = -1;
1930 else workspace->
num = parsed_num;
1931 LOG(
"num = %d\n", workspace->
num);
1941 cmd_output->needs_tree_render =
true;
1944 ipc_send_event(
"workspace", I3_IPC_EVENT_WORKSPACE,
"{\"change\":\"rename\"}");
1953 bool toggle =
false;
1954 if (strcmp(bar_mode,
"dock") == 0)
1956 else if (strcmp(bar_mode,
"hide") == 0)
1958 else if (strcmp(bar_mode,
"invisible") == 0)
1960 else if (strcmp(bar_mode,
"toggle") == 0)
1963 ELOG(
"Unknown bar mode \"%s\", this is a mismatch between code and parser spec.\n", bar_mode);
1967 bool changed_sth =
false;
1970 if (bar_id && strcmp(current->
id, bar_id) != 0)
1974 mode = (current->
mode + 1) % 2;
1976 DLOG(
"Changing bar mode of bar_id '%s' to '%s (%d)'\n", current->
id, bar_mode, mode);
1977 current->
mode = mode;
1984 if (bar_id && !changed_sth) {
1985 DLOG(
"Changing bar mode of bar_id %s failed, bar_id not found.\n", bar_id);
1998 bool toggle =
false;
1999 if (strcmp(bar_hidden_state,
"hide") == 0)
2000 hidden_state = S_HIDE;
2001 else if (strcmp(bar_hidden_state,
"show") == 0)
2002 hidden_state = S_SHOW;
2003 else if (strcmp(bar_hidden_state,
"toggle") == 0)
2006 ELOG(
"Unknown bar state \"%s\", this is a mismatch between code and parser spec.\n", bar_hidden_state);
2010 bool changed_sth =
false;
2013 if (bar_id && strcmp(current->
id, bar_id) != 0)
2019 DLOG(
"Changing bar hidden_state of bar_id '%s' to '%s (%d)'\n", current->
id, bar_hidden_state, hidden_state);
2027 if (bar_id && !changed_sth) {
2028 DLOG(
"Changing bar hidden_state of bar_id %s failed, bar_id not found.\n", bar_id);
2041 if (strcmp(bar_type,
"mode") == 0)
2043 else if (strcmp(bar_type,
"hidden_state") == 0)
2046 ELOG(
"Unknown bar option type \"%s\", this is a mismatch between code and parser spec.\n", bar_type);
2062 if (!strcmp(argument,
"toggle"))
2065 else if (!strcmp(argument,
"on"))
2067 else if (!strcmp(argument,
"off"))
2073 LOG(
"Restarting shm logging...\n");
2081 LOG(
"%s shm logging\n",
shmlog_size > 0 ?
"Enabling" :
"Disabling");
2094 if (!strcmp(argument,
"toggle")) {
2095 LOG(
"%s debug logging\n", logging ?
"Disabling" :
"Enabling");
2097 }
else if (!strcmp(argument,
"on") && !logging) {
2098 LOG(
"Enabling debug logging\n");
2100 }
else if (!strcmp(argument,
"off") && logging) {
2101 LOG(
"Disabling debug logging\n");