summaryrefslogtreecommitdiff
path: root/sway/commands/shadows.c
diff options
context:
space:
mode:
Diffstat (limited to 'sway/commands/shadows.c')
-rw-r--r--sway/commands/shadows.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/sway/commands/shadows.c b/sway/commands/shadows.c
new file mode 100644
index 00000000..2b57b2e6
--- /dev/null
+++ b/sway/commands/shadows.c
@@ -0,0 +1,31 @@
+#include <string.h>
+#include "sway/commands.h"
+#include "sway/config.h"
+#include "sway/tree/arrange.h"
+#include "sway/tree/view.h"
+#include "sway/tree/container.h"
+#include "log.h"
+#include "stringop.h"
+#include "util.h"
+
+struct cmd_results *cmd_shadows(int argc, char **argv) {
+ struct cmd_results *error = checkarg(argc, "shadows", EXPECTED_AT_LEAST, 1);
+
+ if (error) {
+ return error;
+ }
+
+ struct sway_container *con = config->handler_context.container;
+
+ bool result = parse_boolean(argv[0], config->shadow_enabled);
+ if (con == NULL) {
+ config->shadow_enabled = result;
+ } else {
+ con->shadow_enabled = result;
+ container_damage_whole(con);
+ }
+
+ arrange_root();
+
+ return cmd_results_new(CMD_SUCCESS, NULL);
+}