aboutsummaryrefslogtreecommitdiff
path: root/sway/commands/hide_edge_borders.c
blob: ee2a2644f64a78de6bdfca6fceaa0617b3093701 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#include <string.h>
#include <strings.h>
#include "sway/commands.h"

struct cmd_results *cmd_hide_edge_borders(int argc, char **argv) {
	struct cmd_results *error = NULL;
	if ((error = checkarg(argc, "hide_edge_borders", EXPECTED_EQUAL_TO, 1))) {
		return error;
	}

	if (strcasecmp(argv[0], "none") == 0) {
		config->hide_edge_borders = E_NONE;
	} else if (strcasecmp(argv[0], "vertical") == 0) {
		config->hide_edge_borders = E_VERTICAL;
	} else if (strcasecmp(argv[0], "horizontal") == 0) {
		config->hide_edge_borders = E_HORIZONTAL;
	} else if (strcasecmp(argv[0], "both") == 0) {
		config->hide_edge_borders = E_BOTH;
	} else if (strcasecmp(argv[0], "smart") == 0) {
		config->hide_edge_borders = E_SMART;
	} else {
		return cmd_results_new(CMD_INVALID, "hide_edge_borders",
				"Expected 'hide_edge_borders <none|vertical|horizontal|both>'");
	}

	return cmd_results_new(CMD_SUCCESS, NULL, NULL);
}