summaryrefslogtreecommitdiffstats
path: root/sway/commands.c
diff options
context:
space:
mode:
Diffstat (limited to 'sway/commands.c')
-rw-r--r--sway/commands.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/sway/commands.c b/sway/commands.c
index 19b8e1a9..2cfda07c 100644
--- a/sway/commands.c
+++ b/sway/commands.c
@@ -761,7 +761,8 @@ static struct cmd_results *cmd_gaps(int argc, char **argv) {
761 return error; 761 return error;
762 } 762 }
763 const char* expected_syntax = 763 const char* expected_syntax =
764 "Expected 'gaps <inner|outer> <current|all|workspace> <set|plus|minus n>'"; 764 "Expected 'gaps edge_gaps <on|off|toggle>' or "
765 "'gaps <inner|outer> <current|all|workspace> <set|plus|minus n>'";
765 const char *amount_str = argv[0]; 766 const char *amount_str = argv[0];
766 // gaps amount 767 // gaps amount
767 if (argc >= 1 && isdigit(*amount_str)) { 768 if (argc >= 1 && isdigit(*amount_str)) {
@@ -789,6 +790,20 @@ static struct cmd_results *cmd_gaps(int argc, char **argv) {
789 } 790 }
790 arrange_windows(&root_container, -1, -1); 791 arrange_windows(&root_container, -1, -1);
791 return cmd_results_new(CMD_SUCCESS, NULL, NULL); 792 return cmd_results_new(CMD_SUCCESS, NULL, NULL);
793 } else if (argc == 2 && strcasecmp(argv[0], "edge_gaps") == 0) {
794 // gaps edge_gaps <on|off|toggle>
795 if (strcasecmp(argv[1], "toggle") == 0) {
796 if (config->reading) {
797 return cmd_results_new(CMD_FAILURE, "gaps edge_gaps toggle",
798 "Can't be used in config file.");
799 }
800 config->edge_gaps = !config->edge_gaps;
801 } else {
802 config->edge_gaps =
803 (strcasecmp(argv[1], "yes") == 0 || strcasecmp(argv[1], "on") == 0);
804 }
805 arrange_windows(&root_container, -1, -1);
806 return cmd_results_new(CMD_SUCCESS, NULL, NULL);
792 } 807 }
793 // gaps inner|outer current|all set|plus|minus n 808 // gaps inner|outer current|all set|plus|minus n
794 if (argc < 4 || config->reading) { 809 if (argc < 4 || config->reading) {