autotile: allow defining workspaces where autotiling isn't enabled

This commit is contained in:
André Silva 2023-09-13 11:41:39 +01:00
parent 5b91b0e151
commit 95d7fdb67c
No known key found for this signature in database
GPG key ID: 7C34FA12A023DC55
2 changed files with 9 additions and 1 deletions

View file

@ -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);
}
}

View file

@ -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