From 95d7fdb67c7c65f4d874748af2a1c323d58d5804 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Silva?= Date: Wed, 13 Sep 2023 11:41:39 +0100 Subject: [PATCH] autotile: allow defining workspaces where autotiling isn't enabled --- src/Hy3Layout.cpp | 9 ++++++++- src/main.cpp | 1 + 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/Hy3Layout.cpp b/src/Hy3Layout.cpp index bcf84d0..eb63370 100644 --- a/src/Hy3Layout.cpp +++ b/src/Hy3Layout.cpp @@ -1751,5 +1751,12 @@ void Hy3Layout::updateAtWorkspaces() { } bool Hy3Layout::shouldAtWorkspace(int workspace_id) { - return this->at_workspaces.empty() || this->at_workspaces.contains(workspace_id); + static const auto* at_workspaces_except + = &HyprlandAPI::getConfigValue(PHANDLE, "plugin:hy3:autotile:workspaces.except")->intValue; + + if (*at_workspaces_except) { + return !this->at_workspaces.empty() && !this->at_workspaces.contains(workspace_id); + } else { + return this->at_workspaces.empty() || this->at_workspaces.contains(workspace_id); + } } diff --git a/src/main.cpp b/src/main.cpp index 138ec7f..55afe9e 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -44,6 +44,7 @@ APICALL EXPORT PLUGIN_DESCRIPTION_INFO PLUGIN_INIT(HANDLE handle) { CONF("autotile:trigger_height", int, 0); CONF("autotile:trigger_width", int, 0); CONF("autotile:workspaces", str, "all"); + CONF("autotile:workspaces.except", int, 0); #undef CONF