summaryrefslogtreecommitdiffstats
path: root/sway/commands.c
diff options
context:
space:
mode:
Diffstat (limited to 'sway/commands.c')
-rw-r--r--sway/commands.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/sway/commands.c b/sway/commands.c
index e03eef24..4da411c4 100644
--- a/sway/commands.c
+++ b/sway/commands.c
@@ -68,6 +68,7 @@ static sway_cmd cmd_reload;
68static sway_cmd cmd_resize; 68static sway_cmd cmd_resize;
69static sway_cmd cmd_scratchpad; 69static sway_cmd cmd_scratchpad;
70static sway_cmd cmd_set; 70static sway_cmd cmd_set;
71static sway_cmd cmd_smart_gaps;
71static sway_cmd cmd_split; 72static sway_cmd cmd_split;
72static sway_cmd cmd_splith; 73static sway_cmd cmd_splith;
73static sway_cmd cmd_splitt; 74static sway_cmd cmd_splitt;
@@ -1480,6 +1481,23 @@ static struct cmd_results *cmd_gaps(int argc, char **argv) {
1480 return cmd_results_new(CMD_SUCCESS, NULL, NULL); 1481 return cmd_results_new(CMD_SUCCESS, NULL, NULL);
1481} 1482}
1482 1483
1484static struct cmd_results *cmd_smart_gaps(int argc, char **argv) {
1485 struct cmd_results *error = NULL;
1486 if ((error = checkarg(argc, "smart_gaps", EXPECTED_EQUAL_TO, 1))) {
1487 return error;
1488 }
1489
1490 if (strcasecmp(argv[0], "on") == 0) {
1491 config->smart_gaps = true;
1492 } else if (strcasecmp(argv[0], "off") == 0) {
1493 config->smart_gaps = false;
1494 } else {
1495 return cmd_results_new(CMD_INVALID, "smart_gaps", "Expected 'smart_gaps <on|off>'");
1496 }
1497
1498 return cmd_results_new(CMD_SUCCESS, NULL, NULL);
1499}
1500
1483static struct cmd_results *cmd_kill(int argc, char **argv) { 1501static struct cmd_results *cmd_kill(int argc, char **argv) {
1484 if (config->reading) return cmd_results_new(CMD_FAILURE, "kill", "Can't be used in config file."); 1502 if (config->reading) return cmd_results_new(CMD_FAILURE, "kill", "Can't be used in config file.");
1485 if (!config->active) return cmd_results_new(CMD_FAILURE, "kill", "Can only be used when sway is running."); 1503 if (!config->active) return cmd_results_new(CMD_FAILURE, "kill", "Can only be used when sway is running.");
@@ -2048,6 +2066,7 @@ static struct cmd_handler handlers[] = {
2048 { "scratchpad", cmd_scratchpad }, 2066 { "scratchpad", cmd_scratchpad },
2049 { "seamless_mouse", cmd_seamless_mouse }, 2067 { "seamless_mouse", cmd_seamless_mouse },
2050 { "set", cmd_set }, 2068 { "set", cmd_set },
2069 { "smart_gaps", cmd_smart_gaps },
2051 { "split", cmd_split }, 2070 { "split", cmd_split },
2052 { "splith", cmd_splith }, 2071 { "splith", cmd_splith },
2053 { "splitt", cmd_splitt }, 2072 { "splitt", cmd_splitt },