mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-08-07 15:41:58 -07:00
workspacerules: Add new optional "default command" for auto-launching apps on new workspaces (#3559)
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
#include "../managers/KeybindManager.hpp"
|
||||
|
||||
#include <string.h>
|
||||
#include <string>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
@@ -1176,7 +1177,10 @@ void CConfigManager::handleWorkspaceRules(const std::string& command, const std:
|
||||
rules = value.substr(WORKSPACE_DELIM + 1);
|
||||
}
|
||||
|
||||
auto assignRule = [&](std::string rule) {
|
||||
const static std::string ruleOnCreatedEmtpy = "on-created-empty:";
|
||||
const static int ruleOnCreatedEmtpyLen = ruleOnCreatedEmtpy.length();
|
||||
|
||||
auto assignRule = [&](std::string rule) {
|
||||
size_t delim = std::string::npos;
|
||||
if ((delim = rule.find("gapsin:")) != std::string::npos)
|
||||
wsRule.gapsIn = std::stoi(rule.substr(delim + 7));
|
||||
@@ -1198,6 +1202,8 @@ void CConfigManager::handleWorkspaceRules(const std::string& command, const std:
|
||||
wsRule.isDefault = configStringToInt(rule.substr(delim + 8));
|
||||
else if ((delim = rule.find("persistent:")) != std::string::npos)
|
||||
wsRule.isPersistent = configStringToInt(rule.substr(delim + 11));
|
||||
else if ((delim = rule.find(ruleOnCreatedEmtpy)) != std::string::npos)
|
||||
wsRule.onCreatedEmptyRunCmd = cleanCmdForWorkspace(name, rule.substr(delim + ruleOnCreatedEmtpyLen));
|
||||
};
|
||||
|
||||
size_t pos = 0;
|
||||
|
Reference in New Issue
Block a user