aboutsummaryrefslogtreecommitdiffstats
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, 17 insertions, 0 deletions
diff --git a/sway/commands.c b/sway/commands.c
index 33a5e485..efa72f19 100644
--- a/sway/commands.c
+++ b/sway/commands.c
@@ -146,6 +146,22 @@ int cmd_set(struct sway_config *config, int argc, char **argv) {
146 return 0; 146 return 0;
147} 147}
148 148
149int cmd_log_colors(struct sway_config *config, int argc, char **argv) {
150 if (argc != 1) {
151 sway_log(L_ERROR, "Invalid log_colors command (expected 1 argument, got %d)", argc);
152 return 1;
153 }
154
155 if (strcasecmp(argv[0], "no") != 0 && strcasecmp(argv[0], "yes") != 0) {
156 sway_log(L_ERROR, "Invalid log_colors command (expected `yes` or `no`, got '%s')", argv[0]);
157 return 1;
158 }
159
160 sway_log_colors(!strcasecmp(argv[0], "yes"));
161 return 0;
162}
163
164
149/* Keep alphabetized */ 165/* Keep alphabetized */
150struct cmd_handler handlers[] = { 166struct cmd_handler handlers[] = {
151 { "bindsym", cmd_bindsym }, 167 { "bindsym", cmd_bindsym },
@@ -153,6 +169,7 @@ struct cmd_handler handlers[] = {
153 { "exit", cmd_exit }, 169 { "exit", cmd_exit },
154 { "focus_follows_mouse", cmd_focus_follows_mouse }, 170 { "focus_follows_mouse", cmd_focus_follows_mouse },
155 { "layout", cmd_layout }, 171 { "layout", cmd_layout },
172 { "log_colors", cmd_log_colors },
156 { "set", cmd_set }, 173 { "set", cmd_set },
157}; 174};
158 175