18#define y(x, ...) (cmd_output->json_gen != NULL ? yajl_gen_##x(cmd_output->json_gen, ##__VA_ARGS__) : 0)
19#define ystr(str) (cmd_output->json_gen != NULL ? yajl_gen_string(cmd_output->json_gen, (unsigned char *)str, strlen(str)) : 0)
20#define ysuccess(success) \
22 if (cmd_output->json_gen != NULL) { \
29#define yerror(format, ...) \
31 if (cmd_output->json_gen != NULL) { \
33 sasprintf(&message, format, ##__VA_ARGS__); \
46#define HANDLE_INVALID_MATCH \
48 if (current_match->error != NULL) { \
49 yerror("Invalid match: %s", current_match->error); \
59#define HANDLE_EMPTY_MATCH \
61 HANDLE_INVALID_MATCH; \
63 if (match_is_empty(current_match)) { \
64 while (!TAILQ_EMPTY(&owindows)) { \
65 owindow *ow = TAILQ_FIRST(&owindows); \
66 TAILQ_REMOVE(&owindows, ow, owindows); \
69 owindow *ow = smalloc(sizeof(owindow)); \
71 TAILQ_INIT(&owindows); \
72 TAILQ_INSERT_TAIL(&owindows, ow, owindows); \
87 if (strcmp(ws->
name, name) != 0) {
91 DLOG(
"This workspace is already focused.\n");
112 if (current == workspace) {
115 DLOG(
"Substituting workspace with back_and_forth, as it is focused.\n");
139static owindows_head owindows;
175 DLOG(
"match specification finished, matching...\n");
178 struct owindows_head old = owindows;
187 DLOG(
"checking if con %p / %s matches\n", current->
con, current->
con->
name);
191 bool accept_match =
false;
197 DLOG(
"con_id matched.\n");
199 DLOG(
"con_id does not match.\n");
207 bool matched_by_mark =
false;
215 DLOG(
"match by mark\n");
216 matched_by_mark =
true;
220 if (!matched_by_mark) {
221 DLOG(
"mark does not match.\n");
229 DLOG(
"matches window!\n");
232 DLOG(
"doesn't match\n");
268#define CHECK_MOVE_CON_TO_WORKSPACE \
270 HANDLE_EMPTY_MATCH; \
271 if (TAILQ_EMPTY(&owindows)) { \
272 yerror("Nothing to move: specified criteria don't match any window"); \
275 bool found = false; \
276 owindow *current = TAILQ_FIRST(&owindows); \
278 owindow *next = TAILQ_NEXT(current, owindows); \
280 if (current->con->type == CT_WORKSPACE && !con_has_children(current->con)) { \
281 TAILQ_REMOVE(&owindows, current, owindows); \
289 yerror("Nothing to move: workspace empty"); \
301 DLOG(
"which=%s\n", which);
307 if (strcmp(which,
"next") == 0) {
309 }
else if (strcmp(which,
"prev") == 0) {
311 }
else if (strcmp(which,
"next_on_output") == 0) {
313 }
else if (strcmp(which,
"prev_on_output") == 0) {
315 }
else if (strcmp(which,
"current") == 0) {
318 yerror(
"BUG: called with which=%s", which);
324 cmd_output->needs_tree_render =
true;
336 yerror(
"No workspace was previously active.");
344 cmd_output->needs_tree_render =
true;
354 if (strncasecmp(name,
"__", strlen(
"__")) == 0) {
355 yerror(
"You cannot move containers to i3-internal workspaces (\"%s\").", name);
361 LOG(
"should move window to workspace %s\n", name);
365 if (no_auto_back_and_forth == NULL) {
371 cmd_output->needs_tree_render =
true;
383 LOG(
"should move window to workspace %s\n", which);
386 if (parsed_num == -1) {
387 LOG(
"Could not parse initial part of \"%s\" as a number.\n", which);
388 yerror(
"Could not parse number \"%s\"", which);
397 if (no_auto_back_and_forth == NULL) {
403 cmd_output->needs_tree_render =
true;
413 if (strcmp(str,
"left") == 0) {
415 }
else if (strcmp(str,
"right") == 0) {
417 }
else if (strcmp(str,
"up") == 0) {
419 }
else if (strcmp(str,
"down") == 0) {
422 ELOG(
"Invalid direction. This is a parser bug.\n");
432 if (strcmp(direction_str,
"height") == 0) {
434 }
else if (strcmp(direction_str,
"width") == 0) {
445 if (window != NULL) {
446 if (orientation ==
VERT) {
461 if (orientation ==
VERT) {
474 if (direction ==
D_UP) {
476 }
else if (direction ==
D_LEFT) {
488 Con *first = current;
493 yerror(
"No second container found in this direction.");
506 LOG(
"width/height resize\n");
512 if (search_result ==
false) {
513 yerror(
"Failed to find appropriate tiling containers for resize operation");
519 LOG(
"ins. %d children\n", children);
520 double percentage = 1.0 / children;
521 LOG(
"default percentage = %f\n", percentage);
526 LOG(
"child->percent = %f (child %p)\n", child->
percent, child);
532 double new_current_percent;
533 double subtract_percent;
535 new_current_percent = current->
percent + ppt;
539 new_current_percent = current->
percent + ppt;
541 subtract_percent = ppt / (children - 1);
543 yerror(
"Not resizing, container would end with less than 1px");
547 LOG(
"new_current_percent = %f\n", new_current_percent);
548 LOG(
"subtract_percent = %f\n", subtract_percent);
550 if (subtract_percent >= 0.0) {
552 if (child == current) {
556 yerror(
"Not resizing, already at minimum size (child %p would end up with a size of %.f", child, child->
percent - subtract_percent);
562 current->
percent = new_current_percent;
563 LOG(
"current->percent after = %f\n", current->
percent);
566 if (child == current) {
569 child->
percent -= subtract_percent;
570 LOG(
"child->percent after (%p) = %f\n", child, child->
percent);
580void cmd_resize(
I3_CMD,
const char *way,
const char *direction,
long resize_px,
long resize_ppt) {
581 DLOG(
"resizing in way %s, direction %s, px %ld or ppt %ld\n", way, direction, resize_px, resize_ppt);
582 if (strcmp(way,
"shrink") == 0) {
593 DLOG(
"This is a dock window. Not resizing (con = %p)\n)", current->
con);
601 if (strcmp(direction,
"width") == 0 ||
602 strcmp(direction,
"height") == 0) {
603 const double ppt = (double)resize_ppt / 100.0;
605 current->
con, direction,
612 current->
con, direction,
613 resize_px, resize_ppt)) {
621 cmd_output->needs_tree_render =
true;
629 if (resize_orientation ==
HORIZ) {
630 search_direction =
D_LEFT;
633 search_direction =
D_DOWN;
645 ppt = (double)target_size / 100.0 - target->
percent;
652 target, mode, px, ppt);
660 DLOG(
"resizing to %ld %s x %ld %s\n", cwidth, mode_width, cheight, mode_height);
661 if (cwidth < 0 || cheight < 0) {
662 yerror(
"Dimensions cannot be negative.");
676 }
else if (mode_width && strcmp(mode_width,
"ppt") == 0) {
677 cwidth = output->
rect.
width * ((double)cwidth / 100.0);
681 }
else if (mode_height && strcmp(mode_height,
"ppt") == 0) {
682 cheight = output->
rect.
height * ((double)cheight / 100.0);
687 DLOG(
"This is a dock window. Not resizing (con = %p)\n)", current->
con);
692 bool is_ppt = mode_width && strcmp(mode_width,
"ppt") == 0;
694 HORIZ, is_ppt, cwidth);
697 bool is_ppt = mode_height && strcmp(mode_height,
"ppt") == 0;
699 VERT, is_ppt, cheight);
704 cmd_output->needs_tree_render =
true;
712 if (border_width >= 0) {
733 DLOG(
"border style should be changed to %s with border width %ld\n", border_style_str, border_width);
742 if (strcmp(border_style_str,
"toggle") == 0) {
744 }
else if (strcmp(border_style_str,
"normal") == 0) {
746 }
else if (strcmp(border_style_str,
"pixel") == 0) {
748 }
else if (strcmp(border_style_str,
"none") == 0) {
751 yerror(
"BUG: called with border_style=%s", border_style_str);
761 cmd_output->needs_tree_render =
true;
770 LOG(
"-------------------------------------------------\n");
771 LOG(
" NOP: %.4000s\n", comment);
772 LOG(
"-------------------------------------------------\n");
781 LOG(
"Appending layout \"%s\"\n", cpath);
788 if ((len =
slurp(path, &buf)) < 0) {
789 yerror(
"Could not slurp \"%s\".", path);
795 ELOG(
"Could not parse \"%s\" as JSON, not loading.\n", path);
796 yerror(
"Could not parse \"%s\" as JSON.", path);
801 LOG(
"JSON content = %d\n", content);
803 ELOG(
"Could not determine the contents of \"%s\", not loading.\n", path);
804 yerror(
"Could not determine the contents of \"%s\".", path);
820 DLOG(
"Appending to parent=%p instead of focused=%p\n", parent,
focused);
821 char *errormsg = NULL;
823 if (errormsg != NULL) {
848 cmd_output->needs_tree_render =
true;
868 DLOG(
"which=%s\n", which);
872 if (strcmp(which,
"next") == 0) {
874 }
else if (strcmp(which,
"prev") == 0) {
876 }
else if (strcmp(which,
"next_on_output") == 0) {
878 }
else if (strcmp(which,
"prev_on_output") == 0) {
881 yerror(
"BUG: called with which=%s", which);
887 cmd_output->needs_tree_render =
true;
897 const bool no_auto_back_and_forth = (_no_auto_back_and_forth != NULL);
902 if (parsed_num == -1) {
903 yerror(
"Could not parse initial part of \"%s\" as a number.", which);
909 LOG(
"There is no workspace with number %ld, creating a new one.\n", parsed_num);
912 cmd_output->needs_tree_render =
true;
921 cmd_output->needs_tree_render =
true;
935 cmd_output->needs_tree_render =
true;
945 const bool no_auto_back_and_forth = (_no_auto_back_and_forth != NULL);
947 if (strncasecmp(name,
"__", strlen(
"__")) == 0) {
948 yerror(
"You cannot switch to the i3-internal workspaces (\"%s\").", name);
954 DLOG(
"should switch to workspace %s\n", name);
961 cmd_output->needs_tree_render =
true;
974 if (current == NULL) {
975 yerror(
"Given criteria don't match a window");
980 if (current !=
TAILQ_LAST(&owindows, owindows_head)) {
981 yerror(
"A mark must not be put onto more than one window");
988 if (toggle != NULL) {
994 cmd_output->needs_tree_render =
true;
1013 cmd_output->needs_tree_render =
true;
1023 DLOG(
"mode=%s\n", mode);
1036static void user_output_names_add(user_output_names_head *list,
const char *name) {
1037 const bool get_non_primary = (strcasecmp(
"nonprimary", name) == 0);
1038 if (get_non_primary || strcmp(name,
"next") == 0) {
1043 if (get_non_primary && output->
primary) {
1061 Output *target_output = NULL;
1064 if (!target_output) {
1092 return target_output;
1116 user_output_names_add(&names, name);
1123 yerror(
"At least one output must be specified");
1127 bool success =
false;
1137 if (target_output) {
1138 if (move_workspace) {
1148 cmd_output->needs_tree_render = success;
1152 yerror(
"No output matched");
1161 DLOG(
"moving window to mark \"%s\"\n", mark);
1168 DLOG(
"moving matched window %p / %s to mark \"%s\"\n", current->
con, current->
con->
name, mark);
1172 cmd_output->needs_tree_render =
true;
1183 DLOG(
"floating_mode=%s\n", floating_mode);
1189 if (strcmp(floating_mode,
"toggle") == 0) {
1190 DLOG(
"should toggle mode\n");
1193 DLOG(
"should switch mode to %s\n", floating_mode);
1194 if (strcmp(floating_mode,
"enable") == 0) {
1202 cmd_output->needs_tree_render =
true;
1215 LOG(
"splitting in direction %c\n", direction[0]);
1218 ELOG(
"Cannot split a docked container, skipping.\n");
1223 if (direction[0] ==
't') {
1225 if (current->
con->
type == CT_WORKSPACE) {
1241 cmd_output->needs_tree_render =
true;
1251 if (kill_mode_str == NULL) {
1252 kill_mode_str =
"window";
1255 DLOG(
"kill_mode=%s\n", kill_mode_str);
1258 if (strcmp(kill_mode_str,
"window") == 0) {
1260 }
else if (strcmp(kill_mode_str,
"client") == 0) {
1263 yerror(
"BUG: called with kill_mode=%s", kill_mode_str);
1274 cmd_output->needs_tree_render =
true;
1284 bool no_startup_id = (nosn != NULL);
1295 LOG(
"WARNING: Your criteria for the exec command match %d containers, "
1296 "so the command will execute this many times.\n",
1301 DLOG(
"should execute %s, no_startup_id = %d\n", command, no_startup_id);
1308#define CMD_FOCUS_WARN_CHILDREN \
1312 TAILQ_FOREACH (current, &owindows, owindows) { \
1317 LOG("WARNING: Your criteria for the focus command matches %d containers, " \
1318 "while only exactly one container can be focused at a time.\n", \
1333 bool auto_direction =
true;
1334 if (strcmp(direction_str,
"prev") == 0) {
1336 }
else if (strcmp(direction_str,
"next") == 0) {
1339 auto_direction =
false;
1349 if (auto_direction) {
1356 cmd_output->needs_tree_render =
true;
1378 if (next->
type == CT_WORKSPACE) {
1391 cmd_output->needs_tree_render =
true;
1401 DLOG(
"window_mode = %s\n", window_mode);
1403 bool to_floating =
false;
1404 if (strcmp(window_mode,
"mode_toggle") == 0) {
1406 }
else if (strcmp(window_mode,
"floating") == 0) {
1408 }
else if (strcmp(window_mode,
"tiling") == 0) {
1409 to_floating =
false;
1414 bool success =
false;
1416 if ((to_floating && current->
type != CT_FLOATING_CON) ||
1417 (!to_floating && current->
type == CT_FLOATING_CON)) {
1427 cmd_output->needs_tree_render =
true;
1430 yerror(
"Failed to find a %s container in workspace.", to_floating ?
"floating" :
"tiling");
1439 DLOG(
"level = %s\n", level);
1440 bool success =
false;
1444 if (strcmp(level,
"parent") == 0) {
1449 ELOG(
"'focus parent': Currently in fullscreen, not going up\n");
1459 cmd_output->needs_tree_render = success;
1472 ELOG(
"You have to specify which window/container should be focused.\n");
1473 ELOG(
"Example: [class=\"urxvt\" title=\"irssi\"] focus\n");
1475 yerror(
"You have to specify which window/container should be focused");
1478 yerror(
"No window matches given criteria");
1495 if (ws == __i3_scratch && !focus_workspace) {
1503 if (focus_workspace) {
1506 LOG(
"focusing workspace %p / %s - %p / %s\n", current->
con, current->
con->
name, ws, ws->
name);
1509 LOG(
"focusing %p / %s\n", current->
con, current->
con->
name);
1514 cmd_output->needs_tree_render =
true;
1525 DLOG(
"%s fullscreen, mode = %s\n", action, fullscreen_mode);
1532 if (strcmp(action,
"toggle") == 0) {
1534 }
else if (strcmp(action,
"enable") == 0) {
1536 }
else if (strcmp(action,
"disable") == 0) {
1541 cmd_output->needs_tree_render =
true;
1551 DLOG(
"%s sticky on window\n", action);
1557 ELOG(
"only containers holding a window can be made sticky, skipping con = %p\n", current->
con);
1560 DLOG(
"setting sticky for container = %p / %s\n", current->
con, current->
con->
name);
1562 bool sticky =
false;
1563 if (strcmp(action,
"enable") == 0) {
1565 }
else if (strcmp(action,
"disable") == 0) {
1567 }
else if (strcmp(action,
"toggle") == 0) {
1581 cmd_output->needs_tree_render =
true;
1595 const bool is_ppt = mode && strcmp(mode,
"ppt") == 0;
1597 DLOG(
"moving in direction %s, %ld %s\n", direction_str, amount, mode);
1600 DLOG(
"floating move with %ld %s\n", amount, mode);
1604 switch (direction) {
1606 newrect.
x -= is_ppt ? output->
rect.
width * ((double)amount / 100.0) : amount;
1609 newrect.
x += is_ppt ? output->
rect.
width * ((double)amount / 100.0) : amount;
1612 newrect.
y -= is_ppt ? output->
rect.
height * ((double)amount / 100.0) : amount;
1615 newrect.
y += is_ppt ? output->
rect.
height * ((double)amount / 100.0) : amount;
1622 cmd_output->needs_tree_render =
true;
1639 yerror(
"Unknown layout \"%s\", this is a mismatch between code and parser spec.", layout_str);
1643 DLOG(
"changing layout to %s (%d)\n", layout_str, layout);
1648 ELOG(
"cannot change layout of a docked container, skipping it.\n");
1656 cmd_output->needs_tree_render =
true;
1668 if (toggle_mode == NULL) {
1669 toggle_mode =
"default";
1672 DLOG(
"toggling layout (mode = %s)\n", toggle_mode);
1684 cmd_output->needs_tree_render =
true;
1694 LOG(
"Exiting due to user command.\n");
1735 LOG(
"restarting i3\n");
1737 if (cmd_output->client != NULL) {
1738 exempt_fd = cmd_output->client->fd;
1739 LOG(
"Carrying file descriptor %d across restart\n", exempt_fd);
1741 if ((flags = fcntl(exempt_fd, F_GETFD)) < 0 ||
1742 fcntl(exempt_fd, F_SETFD, flags & ~FD_CLOEXEC) < 0) {
1743 ELOG(
"Could not disable FD_CLOEXEC on fd %d\n", exempt_fd);
1747 setenv(
"_I3_RESTART_FD", fdstr, 1);
1767 LOG(
"opening new container\n");
1776 y(integer, (uintptr_t)con);
1779 cmd_output->needs_tree_render =
true;
1789 user_output_names_add(&names, name);
1794 yerror(
"At least one output must be specified");
1821 bool success =
false;
1822 if (target_output) {
1829 yerror(
"BUG: No workspace found on output.");
1836 cmd_output->needs_tree_render = success;
1840 yerror(
"No output matched");
1849 bool has_error =
false;
1856 ELOG(
"Cannot change position. The window/container is not floating\n");
1859 yerror(
"Cannot change position of a window/container because it is not floating.");
1869 newrect.
x = mode_x && strcmp(mode_x,
"ppt") == 0 ? output->
rect.
width * ((double)x / 100.0) : x;
1870 newrect.
y = mode_y && strcmp(mode_y,
"ppt") == 0 ? output->
rect.
height * ((double)
y / 100.0) :
y;
1871 DLOG(
"moving to position %d %s %d %s\n", newrect.
x, mode_x, newrect.
y, mode_y);
1874 yerror(
"Cannot move window/container out of bounds.");
1889 bool has_error =
false;
1895 if (floating_con == NULL) {
1896 ELOG(
"con %p / %s is not floating, cannot move it to the center.\n",
1900 yerror(
"Cannot change position of a window/container because it is not floating.");
1907 if (strcmp(method,
"absolute") == 0) {
1908 DLOG(
"moving to absolute center\n");
1912 cmd_output->needs_tree_render =
true;
1915 if (strcmp(method,
"position") == 0) {
1916 DLOG(
"moving to center\n");
1919 cmd_output->needs_tree_render =
true;
1939 if (floating_con == NULL) {
1940 DLOG(
"con %p / %s is not floating, cannot move it to the mouse position.\n",
1945 DLOG(
"moving floating container %p / %s to cursor position\n", floating_con, floating_con->
name);
1949 cmd_output->needs_tree_render =
true;
1958 DLOG(
"should move window to scratchpad\n");
1968 cmd_output->needs_tree_render =
true;
1978 DLOG(
"should show scratchpad window\n");
1980 bool result =
false;
1991 cmd_output->needs_tree_render =
true;
2004 if (match == NULL) {
2005 yerror(
"No match found for swapping.");
2008 if (match->
con == NULL) {
2009 yerror(
"Match %p has no container.", match);
2014 if (strcmp(mode,
"id") == 0) {
2017 yerror(
"Failed to parse %s into a window id.", arg);
2022 }
else if (strcmp(mode,
"con_id") == 0) {
2025 yerror(
"Failed to parse %s into a container id.", arg);
2030 }
else if (strcmp(mode,
"mark") == 0) {
2033 yerror(
"Unhandled swap mode \"%s\". This is a bug.", mode);
2038 yerror(
"Could not find container for %s = %s", mode, arg);
2042 if (match !=
TAILQ_LAST(&owindows, owindows_head)) {
2043 LOG(
"More than one container matched the swap command, only using the first one.");
2046 DLOG(
"Swapping %p with %p.\n", match->
con, con);
2049 cmd_output->needs_tree_render =
true;
2059 DLOG(
"setting title_format to \"%s\"\n", format);
2064 DLOG(
"setting title_format for %p / %s\n", current->
con, current->
con->
name);
2069 if (strcasecmp(format,
"%title") != 0) {
2093 cmd_output->needs_tree_render =
true;
2102 bool is_toggle =
false;
2103 if (enable != NULL) {
2104 if (strcmp(enable,
"toggle") == 0) {
2106 }
else if (!
boolstr(enable)) {
2110 DLOG(
"setting window_icon=%d\n", padding);
2118 if (current_padding < 0) {
2142 cmd_output->needs_tree_render =
true;
2151 if (strncasecmp(new_name,
"__", strlen(
"__")) == 0) {
2152 yerror(
"Cannot rename workspace to \"%s\": names starting with __ are i3-internal.", new_name);
2156 LOG(
"Renaming workspace \"%s\" to \"%s\"\n", old_name, new_name);
2158 LOG(
"Renaming current workspace to \"%s\"\n", new_name);
2166 old_name = workspace->
name;
2170 yerror(
"Old workspace \"%s\" not found", old_name);
2178 if (check_dest != NULL && check_dest != workspace) {
2179 yerror(
"New workspace \"%s\" already exists", new_name);
2185 char *old_name_copy =
sstrdup(old_name);
2190 LOG(
"num = %d\n", workspace->
num);
2205 bool can_restore_focus = previously_focused != NULL;
2211 if (previously_focused_content) {
2212 Con *workspace = NULL;
2213 GREP_FIRST(workspace, previously_focused_content, child == previously_focused);
2214 can_restore_focus &= (workspace != NULL);
2217 if (can_restore_focus) {
2230 cmd_output->needs_tree_render =
true;
2236 free(old_name_copy);
2245 bool toggle =
false;
2246 if (strcmp(bar_mode,
"dock") == 0) {
2248 }
else if (strcmp(bar_mode,
"hide") == 0) {
2250 }
else if (strcmp(bar_mode,
"invisible") == 0) {
2252 }
else if (strcmp(bar_mode,
"toggle") == 0) {
2255 ELOG(
"Unknown bar mode \"%s\", this is a mismatch between code and parser spec.\n", bar_mode);
2260 yerror(
"No bars found\n");
2266 if (bar_id && strcmp(current->
id, bar_id) != 0) {
2271 mode = (current->
mode + 1) % 2;
2274 DLOG(
"Changing bar mode of bar_id '%s' from '%d' to '%s (%d)'\n",
2275 current->
id, current->
mode, bar_mode, mode);
2276 if ((
int)current->
mode != mode) {
2277 current->
mode = mode;
2290 yerror(
"Changing bar mode of bar_id %s failed, bar_id not found.\n", bar_id);
2303 int hidden_state = S_SHOW;
2304 bool toggle =
false;
2305 if (strcmp(bar_hidden_state,
"hide") == 0) {
2306 hidden_state = S_HIDE;
2307 }
else if (strcmp(bar_hidden_state,
"show") == 0) {
2308 hidden_state = S_SHOW;
2309 }
else if (strcmp(bar_hidden_state,
"toggle") == 0) {
2312 ELOG(
"Unknown bar state \"%s\", this is a mismatch between code and parser spec.\n", bar_hidden_state);
2317 yerror(
"No bars found\n");
2323 if (bar_id && strcmp(current->
id, bar_id) != 0) {
2331 DLOG(
"Changing bar hidden_state of bar_id '%s' from '%d' to '%s (%d)'\n",
2332 current->
id, current->
hidden_state, bar_hidden_state, hidden_state);
2347 yerror(
"Changing bar hidden_state of bar_id %s failed, bar_id not found.\n", bar_id);
2360 if (!strcmp(argument,
"toggle")) {
2363 }
else if (!strcmp(argument,
"on")) {
2365 }
else if (!strcmp(argument,
"off")) {
2370 yerror(
"Failed to parse %s into a shmlog size.", argument);
2376 LOG(
"Restarting shm logging...\n");
2381 LOG(
"%s shm logging\n",
shmlog_size > 0 ?
"Enabling" :
"Disabling");
2393 if (!strcmp(argument,
"toggle")) {
2394 LOG(
"%s debug logging\n", logging ?
"Disabling" :
"Enabling");
2396 }
else if (!strcmp(argument,
"on") && !logging) {
2397 LOG(
"Enabling debug logging\n");
2399 }
else if (!strcmp(argument,
"off") && logging) {
2400 LOG(
"Disabling debug logging\n");
2408 return &(gaps->
inner);
2412 return &(gaps->
top);
2416 return &(gaps->
left);
2424 return &(gaps->
right);
2430 DLOG(
"gaps_update(scope=%s, mode=%s, pixels=%d)\n", scope, mode, pixels);
2433 const int global_gap_size = *get(&(
config.
gaps));
2434 int current_value = global_gap_size;
2435 if (strcmp(scope,
"current") == 0) {
2436 current_value += *get(&(workspace->
gaps));
2438 DLOG(
"global_gap_size=%d, current_value=%d\n", global_gap_size, current_value);
2441 if (strcmp(mode,
"plus") == 0) {
2442 current_value += pixels;
2443 }
else if (strcmp(mode,
"minus") == 0) {
2444 current_value -= pixels;
2445 }
else if (strcmp(mode,
"set") == 0) {
2446 current_value = pixels;
2448 }
else if (strcmp(mode,
"toggle") == 0) {
2449 current_value = !current_value * pixels;
2452 ELOG(
"Invalid mode %s when changing gaps", mode);
2461 if (strcmp(scope,
"all") == 0) {
2468 if (current_value < min_value) {
2469 current_value = min_value;
2472 if (strcmp(scope,
"all") == 0) {
2478 int *gaps_value = get(&(cur_ws->
gaps));
2479 DLOG(
"current gaps_value = %d\n", *gaps_value);
2484 int max_compensate = 0;
2488 if (*gaps_value + current_value + max_compensate < 0) {
2492 *gaps_value = -current_value - max_compensate;
2495 DLOG(
"gaps_value after fix = %d\n", *gaps_value);
2500 DLOG(
"global gaps value after fix = %d\n", *get(&(
config.
gaps)));
2502 int *gaps_value = get(&(workspace->
gaps));
2503 *gaps_value = current_value - global_gap_size;
2513void cmd_gaps(
I3_CMD,
const char *type,
const char *scope,
const char *mode,
const char *value) {
2516 if (!strcmp(type,
"inner")) {
2528 }
else if (!strcmp(type,
"outer")) {
2535 }
else if (!strcmp(type,
"vertical")) {
2540 }
else if (!strcmp(type,
"horizontal")) {
2545 }
else if (!strcmp(type,
"top")) {
2549 }
else if (!strcmp(type,
"bottom")) {
2553 }
else if (!strcmp(type,
"right")) {
2557 }
else if (!strcmp(type,
"left")) {
2562 ELOG(
"Invalid type %s when changing gaps", type);
2566 cmd_output->needs_tree_render =
true;
void switch_mode(const char *new_mode)
Switches the key bindings to the given mode, if the mode exists.
pid_t command_error_nagbar_pid
#define ysuccess(success)
static void cmd_resize_floating(I3_CMD, const char *direction_str, Con *floating_con, int px)
static int * gaps_bottom(gaps_t *gaps)
#define CMD_FOCUS_WARN_CHILDREN
static int * gaps_left(gaps_t *gaps)
void cmd_move_con_to_mark(I3_CMD, const char *mark)
Implementation of 'move [window|container] [to] mark <str>'.
void cmd_focus(I3_CMD, bool focus_workspace)
Implementation of 'focus'.
static bool gaps_update(gap_accessor get, const char *scope, const char *mode, int pixels)
void cmd_move_con_to_workspace_number(I3_CMD, const char *which, const char *no_auto_back_and_forth)
Implementation of 'move [–no-auto-back-and-forth] [window|container] [to] workspace number <number>'.
void cmd_append_layout(I3_CMD, const char *cpath)
Implementation of 'append_layout <path>'.
void cmd_focus_sibling(I3_CMD, const char *direction_str)
Implementation of 'focus next|prev sibling'.
static bool cmd_resize_tiling_direction(I3_CMD, Con *current, const char *direction, int px, int ppt)
struct user_output_name user_output_name
void cmd_mode(I3_CMD, const char *mode)
Implementation of 'mode <string>'.
void cmd_nop(I3_CMD, const char *comment)
Implementation of 'nop <comment>'.
void cmd_rename_workspace(I3_CMD, const char *old_name, const char *new_name)
Implementation of 'rename workspace <name> to <name>'.
void cmd_sticky(I3_CMD, const char *action)
Implementation of 'sticky enable|disable|toggle'.
void cmd_bar_hidden_state(I3_CMD, const char *bar_hidden_state, const char *bar_id)
Implementation of 'bar hidden_state hide|show|toggle [<bar_id>]'.
static int border_width_from_style(border_style_t border_style, long border_width, Con *con)
void cmd_bar_mode(I3_CMD, const char *bar_mode, const char *bar_id)
Implementation of 'bar mode dock|hide|invisible|toggle [<bar_id>]'.
void cmd_floating(I3_CMD, const char *floating_mode)
Implementation of 'floating enable|disable|toggle'.
static int * gaps_right(gaps_t *gaps)
void cmd_criteria_match_windows(I3_CMD)
A match specification just finished (the closing square bracket was found), so we filter the list of ...
static direction_t parse_direction(const char *str)
static bool maybe_back_and_forth(struct CommandResultIR *cmd_output, const char *name)
static Con * maybe_auto_back_and_forth_workspace(Con *workspace)
void cmd_focus_window_mode(I3_CMD, const char *window_mode)
Implementation of 'focus tiling|floating|mode_toggle'.
void cmd_mark(I3_CMD, const char *mark, const char *mode, const char *toggle)
Implementation of 'mark [–add|–replace] [–toggle] <mark>'.
void cmd_resize(I3_CMD, const char *way, const char *direction, long resize_px, long resize_ppt)
Implementation of 'resize grow|shrink <direction> [<px> px] [or <ppt> ppt]'.
void cmd_move_con_to_output(I3_CMD, const char *name, bool move_workspace)
Implementation of 'move [window|container] [to] output <str>'.
void cmd_exec(I3_CMD, const char *nosn, const char *command)
Implementation of 'exec [–no-startup-id] <command>'.
void cmd_move_window_to_position(I3_CMD, long x, const char *mode_x, long y, const char *mode_y)
Implementation of 'move [window|container] [to] [absolute] position [<pos_x> [px|ppt] <pos_y> [px|ppt...
void cmd_focus_direction(I3_CMD, const char *direction_str)
Implementation of 'focus left|right|up|down'.
void cmd_move_con_to_workspace_back_and_forth(I3_CMD)
Implementation of 'move [window|container] [to] workspace back_and_forth'.
void cmd_restart(I3_CMD)
Implementation of 'restart'.
void cmd_move_con_to_workspace_name(I3_CMD, const char *name, const char *no_auto_back_and_forth)
Implementation of 'move [–no-auto-back-and-forth] [window|container] [to] workspace <name>'.
void cmd_move_window_to_mouse(I3_CMD)
Implementation of 'move [window|container] [to] position mouse'.
void cmd_resize_set(I3_CMD, long cwidth, const char *mode_width, long cheight, const char *mode_height)
Implementation of 'resize set <width> [px | ppt] <height> [px | ppt]'.
#define CHECK_MOVE_CON_TO_WORKSPACE
void cmd_focus_level(I3_CMD, const char *level)
Implementation of 'focus parent|child'.
void cmd_swap(I3_CMD, const char *mode, const char *arg)
Implementation of 'swap [container] [with] id|con_id|mark <arg>'.
void cmd_criteria_add(I3_CMD, const char *ctype, const char *cvalue)
Interprets a ctype=cvalue pair and adds it to the current match specification.
#define HANDLE_EMPTY_MATCH
When the command did not include match criteria (!), we use the currently focused container.
void cmd_layout(I3_CMD, const char *layout_str)
Implementation of 'layout default|stacked|stacking|tabbed|splitv|splith'.
void cmd_title_window_icon(I3_CMD, const char *enable, int padding)
Implementation of 'title_window_icon <yes|no|toggle>' and 'title_window_icon <padding|toggle> <px>'.
void cmd_workspace(I3_CMD, const char *which)
Implementation of 'workspace next|prev|next_on_output|prev_on_output'.
void cmd_gaps(I3_CMD, const char *type, const char *scope, const char *mode, const char *value)
Implementation of 'gaps inner|outer|top|right|bottom|left|horizontal|vertical current|all set|plus|mi...
void cmd_unmark(I3_CMD, const char *mark)
Implementation of 'unmark [mark]'.
void cmd_fullscreen(I3_CMD, const char *action, const char *fullscreen_mode)
Implementation of 'fullscreen [enable|disable|toggle] [global]'.
void cmd_move_con_to_workspace(I3_CMD, const char *which)
Implementation of 'move [window|container] [to] workspace next|prev|next_on_output|prev_on_output'.
void cmd_open(I3_CMD)
Implementation of 'open'.
void cmd_shmlog(I3_CMD, const char *argument)
Implementation of 'shmlog <size>|toggle|on|off'.
void cmd_debuglog(I3_CMD, const char *argument)
Implementation of 'debuglog toggle|on|off'.
#define yerror(format,...)
void cmd_kill(I3_CMD, const char *kill_mode_str)
Implementation of 'kill [window|client]'.
void cmd_workspace_number(I3_CMD, const char *which, const char *_no_auto_back_and_forth)
Implementation of 'workspace [–no-auto-back-and-forth] number <number>'.
static bool resize_set_tiling(I3_CMD, Con *target, orientation_t resize_orientation, bool is_ppt, long target_size)
void cmd_move_direction(I3_CMD, const char *direction_str, long amount, const char *mode)
Implementation of 'move <direction> [<amount> [px|ppt]]'.
void cmd_move_window_to_center(I3_CMD, const char *method)
Implementation of 'move [window|container] [to] [absolute] position center.
void cmd_title_format(I3_CMD, const char *format)
Implementation of 'title_format <format>'.
void cmd_layout_toggle(I3_CMD, const char *toggle_mode)
Implementation of 'layout toggle [all|split]'.
void cmd_focus_output(I3_CMD, const char *name)
Implementation of 'focus output <output>'.
static int * gaps_inner(gaps_t *gaps)
void cmd_border(I3_CMD, const char *border_style_str, long border_width)
Implementation of 'border normal|pixel [<n>]', 'border none|1pixel|toggle'.
static Output * user_output_names_find_next(user_output_names_head *names, Output *current_output)
void cmd_workspace_name(I3_CMD, const char *name, const char *_no_auto_back_and_forth)
Implementation of 'workspace [–no-auto-back-and-forth] <name>'.
static int * gaps_top(gaps_t *gaps)
void cmd_scratchpad_show(I3_CMD)
Implementation of 'scratchpad show'.
static void disable_global_fullscreen(void)
static void move_matches_to_workspace(Con *ws)
void cmd_split(I3_CMD, const char *direction)
Implementation of 'split v|h|t|vertical|horizontal|toggle'.
static bool cmd_resize_tiling_width_height(I3_CMD, Con *current, const char *direction, int px, double ppt)
void cmd_workspace_back_and_forth(I3_CMD)
Implementation of 'workspace back_and_forth'.
static void user_output_names_free(user_output_names_head *names)
void cmd_reload(I3_CMD)
Implementation of 'reload'.
int *(* gap_accessor)(gaps_t *)
void cmd_exit(I3_CMD)
Implementation of 'exit'.
void cmd_move_scratchpad(I3_CMD)
Implementation of 'move scratchpad'.
static Match current_match
void con_move_to_workspace(Con *con, Con *workspace, bool fix_coordinates, bool dont_warp, bool ignore_focus)
Moves the given container to the currently focused container on the given workspace.
bool con_move_to_mark(Con *con, const char *mark)
Moves the given container to the given mark.
Con * con_get_fullscreen_con(Con *con, fullscreen_mode_t fullscreen_mode)
Returns the first fullscreen node below this node.
bool con_is_floating(Con *con)
Returns true if the node is floating.
void con_close(Con *con, kill_window_t kill_window)
Closes the given container.
orientation_t con_orientation(Con *con)
Returns the orientation of the given container (for stacked containers, vertical orientation is used ...
void con_unmark(Con *con, const char *name)
Removes marks from containers.
Con * con_get_workspace(Con *con)
Gets the workspace container this node is on.
void con_disable_fullscreen(Con *con)
Disables fullscreen mode for the given container, if necessary.
bool con_is_docked(Con *con)
Returns true if the container is a docked container.
void con_set_border_style(Con *con, border_style_t border_style, int border_width)
Sets the given border style on con, correctly keeping the position/size of a floating window.
Con * con_by_con_id(long target)
Returns the container with the given container ID or NULL if no such container exists.
void con_mark(Con *con, const char *mark, mark_mode_t mode)
Assigns a mark to the container.
Con * con_by_window_id(xcb_window_t window)
Returns the container with the given client window ID or NULL if no such container exists.
void con_activate_unblock(Con *con)
Activates the container like in con_activate but removes fullscreen restrictions and properly warps t...
Con * con_by_mark(const char *mark)
Returns the container with the given mark or NULL if no such container exists.
void con_mark_toggle(Con *con, const char *mark, mark_mode_t mode)
Toggles the mark on a container.
Con * con_inside_floating(Con *con)
Checks if the given container is either floating or inside some floating container.
bool con_fullscreen_permits_focusing(Con *con)
Returns true if changing the focus to con would be allowed considering the fullscreen focus constrain...
bool con_swap(Con *first, Con *second)
Swaps the two containers.
bool con_accepts_window(Con *con)
Returns true if this node accepts a window (if the node swallows windows, it might already have swall...
uint32_t con_rect_size_in_orientation(Con *con)
Returns given container's rect size depending on its orientation.
bool con_is_internal(Con *con)
Returns true if the container is internal, such as __i3_scratch.
void con_detach(Con *con)
Detaches the given container from its current parent.
void con_move_to_output(Con *con, Output *output, bool fix_coordinates)
Moves the given container to the currently focused container on the visible workspace on the given ou...
void con_toggle_fullscreen(Con *con, int fullscreen_mode)
Toggles fullscreen mode for the given container.
void con_attach(Con *con, Con *parent, bool ignore_focus)
Attaches the given container to the given parent.
i3String * con_parse_title_format(Con *con)
Returns the window title considering the current title format.
int con_num_children(Con *con)
Returns the number of children of this container.
void con_set_layout(Con *con, layout_t layout)
This function changes the layout of a given container.
void con_activate(Con *con)
Sets input focus to the given container and raises it to the top.
void con_toggle_layout(Con *con, const char *toggle_mode)
This function toggles the layout of a given container.
void con_enable_fullscreen(Con *con, fullscreen_mode_t fullscreen_mode)
Enables fullscreen mode for the given container, if necessary.
void con_focus(Con *con)
Sets input focus to the given container.
Con * con_get_output(Con *con)
Gets the output container (first container with CT_OUTPUT in hierarchy) this node is on.
Con * con_descend_focused(Con *con)
Returns the focused con inside this client, descending the tree as far as possible.
bool load_configuration(const char *override_configpath, config_load_t load_type)
(Re-)loads the configuration file (sets useful defaults before).
struct barconfig_head barconfigs
pid_t config_error_nagbar_pid
void ewmh_update_visible_name(xcb_window_t window, const char *name)
Updates _NET_WM_VISIBLE_NAME.
void ewmh_update_desktop_properties(void)
Updates all the EWMH desktop properties.
void ewmh_update_wm_desktop(void)
Updates _NET_WM_DESKTOP for all windows.
void ewmh_update_sticky(xcb_window_t window, bool sticky)
Set or remove _NET_WM_STATE_STICKY on the window.
void floating_check_size(Con *floating_con, bool prefer_height)
Called when a floating window is created or resized.
void floating_disable(Con *con)
Disables floating mode for the given container by re-attaching the container to its old parent.
void floating_center(Con *con, Rect rect)
Centers a floating con above the specified rect.
void toggle_floating_mode(Con *con, bool automatic)
Calls floating_enable() for tiling containers and floating_disable() for floating containers.
void floating_resize(Con *floating_con, uint32_t x, uint32_t y)
Sets size of the CT_FLOATING_CON to specified dimensions.
bool floating_maybe_reassign_ws(Con *con)
Checks if con’s coordinates are within its workspace and re-assigns it to the actual workspace if not...
void floating_move_to_pointer(Con *con)
Moves the given floating con to the current pointer position.
bool floating_enable(Con *con, bool automatic)
Enables floating mode for the given container by detaching it from its parent, creating a new contain...
bool floating_reposition(Con *con, Rect newrect)
Repositions the CT_FLOATING_CON to have the coordinates specified by newrect, but only if the coordin...
struct pending_marks * marks
bool json_validate(const char *buf, const size_t len)
Returns true if the provided JSON could be parsed by yajl.
json_content_t json_determine_content(const char *buf, const size_t len)
void tree_append_json(Con *con, const char *buf, const size_t len, char **errormsg)
bool match_is_empty(Match *match)
Check if a match is empty.
void match_init(Match *match)
Initializes the Match data structure.
void match_free(Match *match)
Frees the given match.
bool match_matches_window(Match *match, i3Window *window)
Check if a match data structure matches the given window.
void match_parse_property(Match *match, const char *ctype, const char *cvalue)
Interprets a ctype=cvalue pair and adds it to the given match specification.
void tree_move(Con *con, direction_t direction)
Moves the given container in the given direction.
Output * get_output_from_string(Output *current_output, const char *output_str)
Returns an 'output' corresponding to one of left/right/down/up or a specific output name.
void output_push_sticky_windows(Con *old_focus)
Iterates over all outputs and pushes sticky windows to the currently visible workspace on that output...
char * output_primary_name(Output *output)
Retrieves the primary name of an output.
Output * get_output_for_con(Con *con)
Retrieves the output for a given container.
Con * output_get_content(Con *output)
Returns the output container below the given output container.
struct outputs_head outputs
bool regex_matches(struct regex *regex, const char *input)
Checks if the given regular expression matches the given input and returns true if it does.
void render_con(Con *con)
"Renders" the given container (and its children), meaning that all rects are updated correctly.
bool resize_find_tiling_participants(Con **current, Con **other, direction_t direction, bool both_sides)
double percent_for_1px(Con *con)
Calculate the minimum percent needed for the given container to be at least 1 pixel.
bool resize_neighboring_cons(Con *first, Con *second, int px, int ppt)
Resize the two given containers using the given amount of pixels or percentage points.
void restore_open_placeholder_windows(Con *parent)
Open placeholder windows for all children of parent.
bool scratchpad_show(Con *con)
Either shows the top-most scratchpad window (con == NULL) or shows the specified con (if it is scratc...
void scratchpad_move(Con *con)
Moves the specified window to the __i3_scratch workspace, making it floating and setting the appropri...
void start_application(const char *command, bool no_startup_id)
Starts the given application by passing it through a shell.
void startup_sequence_rename_workspace(const char *old_name, const char *new_name)
Renames workspaces that are mentioned in the startup sequences.
void tree_next(Con *con, direction_t direction)
Changes focus in the given direction.
bool level_up(void)
Moves focus one level up.
bool level_down(void)
Moves focus one level down.
Con * tree_open_con(Con *con, i3Window *window)
Opens an empty container in the current container.
struct all_cons_head all_cons
void tree_split(Con *con, orientation_t orientation)
Splits (horizontally or vertically) the given container by creating a new container which contains th...
Con * get_tree_next_sibling(Con *con, position_t direction)
Get the previous / next sibling.
orientation_t orientation_from_direction(direction_t direction)
Convert a direction to its corresponding orientation.
int ws_name_to_number(const char *name)
Parses the workspace name as a number.
void kill_nagbar(pid_t nagbar_pid, bool wait_for_it)
Kills the i3-nagbar process, if nagbar_pid != -1.
void i3_restart(bool forget_layout)
Restart i3 in-place appends -a to argument list to disable autostart.
bool parse_long(const char *str, long *out, int base)
Converts a string into a long using strtol().
bool rect_equals(Rect a, Rect b)
ssize_t slurp(const char *path, char **buf)
Slurp reads path in its entirety into buf, returning the length of the file or -1 if the file could n...
bool layout_from_name(const char *layout_str, layout_t *out)
Set 'out' to the layout_t value for the given layout.
direction_t direction_from_orientation_position(orientation_t orientation, position_t position)
Convert orientation and position to the corresponding direction.
Con * workspace_back_and_forth_get(void)
Returns the previously focused workspace con, or NULL if unavailable.
Con * get_existing_workspace_by_name(const char *name)
Returns the workspace with the given name or NULL if such a workspace does not exist.
Con * workspace_next_on_output(void)
Returns the next workspace on the same output.
void workspace_show(Con *workspace)
Switches to the given workspace.
bool workspace_is_visible(Con *ws)
Returns true if the workspace is currently visible.
Con * workspace_prev_on_output(void)
Returns the previous workspace on the same output.
Con * workspace_get(const char *num)
Returns a pointer to the workspace with the given number (starting at 0), creating the workspace if n...
void workspace_back_and_forth(void)
Focuses the previously focused workspace.
void workspace_move_to_output(Con *ws, Output *output)
Move the given workspace to the specified output.
Con * workspace_next(void)
Returns the next workspace.
Con * get_existing_workspace_by_num(int num)
Returns the workspace with the given number or NULL if such a workspace does not exist.
Con * workspace_prev(void)
Returns the previous workspace.
void workspace_show_by_name(const char *num)
Looks up the workspace by name and switches to it.
char * previous_workspace_name
Stores a copy of the name of the last used workspace for the workspace back-and-forth switching.
Con * get_assigned_output(const char *name, long parsed_num)
Returns the first output that is assigned to a workspace specified by the given name or number.
void update_shmlog_atom(void)
Set up the SHMLOG_PATH atom.
void x_set_i3_atoms(void)
Sets up i3 specific atoms (I3_SOCKET_PATH and I3_CONFIG_PATH)
void ipc_shutdown(shutdown_reason_t reason, int exempt_fd)
Calls shutdown() on each socket and closes it.
void ipc_send_workspace_event(const char *change, Con *current, Con *old)
For the workspace events we send, along with the usual "change" field, also the workspace container i...
void ipc_send_barconfig_update_event(Barconfig *barconfig)
For the barconfig update events, we send the serialized barconfig.
bool get_debug_logging(void)
Checks if debug logging is active.
void init_logging(void)
Initializes logging by creating an error logfile in /tmp (or XDG_RUNTIME_DIR, see get_process_filenam...
void set_debug_logging(const bool _debug_logging)
Set debug logging.
char * current_log_stream_socket_path
void purge_zerobyte_logfile(void)
Deletes the unused log files.
const int default_shmlog_size
void cmd_criteria_init(I3_CMD)
Initializes the specified 'Match' data structure and the initial state of commands....
#define I3_CMD
The beginning of the prototype for every cmd_ function.
layout_t
Container layouts.
fullscreen_mode_t
Fullscreen modes.
struct _i3String i3String
Opaque data structure for storing strings.
int logical_px(const int logical)
Convert a logical amount of pixels (e.g.
char * resolve_tilde(const char *path)
This function resolves ~ in pathnames.
char * sstrdup(const char *str)
Safe-wrapper around strdup which exits if malloc returns NULL (meaning that there is no more memory a...
const char * i3string_as_utf8(i3String *str)
Returns the UTF-8 encoded version of the i3String.
void * scalloc(size_t num, size_t size)
Safe-wrapper around calloc which exits if malloc returns NULL (meaning that there is no more memory a...
int sasprintf(char **strp, const char *fmt,...)
Safe-wrapper around asprintf which exits if it returns -1 (meaning that there is no more memory avail...
bool boolstr(const char *str)
Reports whether str represents the enabled state (1, yes, true, …).
#define I3STRING_FREE(str)
Securely i3string_free by setting the pointer to NULL to prevent accidentally using freed memory.
void * smalloc(size_t size)
Safe-wrapper around malloc which exits if malloc returns NULL (meaning that there is no more memory a...
#define TAILQ_FOREACH(var, head, field)
#define TAILQ_HEAD(name, type)
#define TAILQ_INSERT_TAIL(head, elm, field)
#define TAILQ_FIRST(head)
#define TAILQ_REMOVE(head, elm, field)
#define TAILQ_NEXT(elm, field)
#define TAILQ_HEAD_INITIALIZER(head)
#define TAILQ_EMPTY(head)
#define TAILQ_LAST(head, headname)
#define TAILQ_ENTRY(type)
#define GREP_FIRST(dest, head, condition)
#define STARTS_WITH(string, needle)
@ SHUTDOWN_REASON_RESTART
Holds an intermediate representation of the result of a call to any command.
bool workspace_auto_back_and_forth
Automatic workspace back and forth switching.
int default_floating_border_width
border_style_t default_border
The default border style for new windows.
border_style_t default_floating_border
The default border style for new floating windows.
Holds the status bar configuration (i3bar).
enum Barconfig::@8 hidden_state
char * id
Automatically generated ID for this bar config.
enum Barconfig::@7 mode
Bar display mode (hide unless modifier is pressed or show in dock mode or always hide in invisible mo...
Stores a rectangle, for example the size of a window, the child window etc.
An Output is a physical output on your graphics driver.
Con * con
Pointer to the Con which represents this output.
A 'Window' is a type which contains an xcb_window_t and all the related information (hints like _NET_...
bool name_x_changed
Flag to force re-rendering the decoration upon changes.
enum Window::@11 dock
Whether the window says it is a dock window.
A 'Con' represents everything from the X11 root window down to a single X11 window.
enum Con::@20 scratchpad_state
gaps_t gaps
Only applicable for containers of type CT_WORKSPACE.
border_style_t max_user_border_style
int num
the workspace number, if this Con is of type CT_WORKSPACE and the workspace is not a named workspace ...
int window_icon_padding
Whether the window icon should be displayed, and with what padding.
char * title_format
The format with which the window's name should be displayed.
border_style_t border_style
struct deco_render_params * deco_render_params
Cache for the decoration rendering.