From 152e30c374382eecccb917e5c26d72a2ea53ef87 Mon Sep 17 00:00:00 2001
From: Brian Ashworth <bosrsf04@gmail.com>
Date: Tue, 9 Jul 2019 02:57:59 -0400
Subject: cmd_bindswitch: add option to execute on reload

This adds a --reload flag to cmd_bindswitch that allows for the binding
to be executed on reload. One possible use case for this is to  allow
users to disable outputs when the lid closes and enable them when the
lid opens without having to open and re-close the lid after a reload.
---
 sway/commands/bind.c | 2 ++
 1 file changed, 2 insertions(+)

(limited to 'sway/commands')

diff --git a/sway/commands/bind.c b/sway/commands/bind.c
index 49b511ad..767c2fee 100644
--- a/sway/commands/bind.c
+++ b/sway/commands/bind.c
@@ -478,6 +478,8 @@ struct cmd_results *cmd_bind_or_unbind_switch(int argc, char **argv,
 			binding->flags |= BINDING_LOCKED;
 		} else if (strcmp("--no-warn", argv[0]) == 0) {
 			warn = false;
+		} else if (strcmp("--reload", argv[0]) == 0) {
+			binding->flags |= BINDING_RELOAD;
 		} else {
 			break;
 		}
-- 
cgit v1.2.3