blob: 585b079d4b5e5bddbbd2d7b0a02c533168428960 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
#include <string.h>
#include <strings.h>
#include "sway/config.h"
#include "sway/commands.h"
#include "util.h"
struct cmd_results *cmd_primary_selection(int argc, char **argv) {
struct cmd_results *error = NULL;
if ((error = checkarg(argc, "primary_selection", EXPECTED_EQUAL_TO, 1))) {
return error;
}
bool primary_selection = parse_boolean(argv[0], true);
if (config->reloading && config->primary_selection != primary_selection) {
return cmd_results_new(CMD_FAILURE,
"primary_selection can only be enabled/disabled at launch");
}
config->primary_selection = parse_boolean(argv[0], true);
return cmd_results_new(CMD_SUCCESS, NULL);
}
|