diff options
author | Brian Ashworth <[email protected]> | 2018-10-08 09:56:34 -0400 |
---|---|---|
committer | Brian Ashworth <[email protected]> | 2018-10-08 09:59:38 -0400 |
commit | 09c3c33081a8b8c941cbc1eeab0e5a70e54d04ff (patch) | |
tree | 9f657329f7775cd764b60326a419d369eae8a605 /sway/swaynag.c | |
parent | 45f2cd0c73cb21bea6ae27bd396cd3721f3cd41a (diff) |
Allow swaynag to be disabled
Diffstat (limited to 'sway/swaynag.c')
-rw-r--r-- | sway/swaynag.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/sway/swaynag.c b/sway/swaynag.c index d905db2b..38e74b88 100644 --- a/sway/swaynag.c +++ b/sway/swaynag.c @@ -11,6 +11,10 @@ bool swaynag_spawn(const char *swaynag_command, struct swaynag_instance *swaynag) { + if (!swaynag_command) { + return true; + } + if (swaynag->detailed) { if (pipe(swaynag->fd) != 0) { wlr_log(WLR_ERROR, "Failed to create pipe for swaynag"); @@ -58,6 +62,10 @@ void swaynag_kill(struct swaynag_instance *swaynag) { void swaynag_log(const char *swaynag_command, struct swaynag_instance *swaynag, const char *fmt, ...) { + if (!swaynag_command) { + return; + } + if (!swaynag->detailed) { wlr_log(WLR_ERROR, "Attempting to write to non-detailed swaynag inst"); return; |