mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-08-03 13:41:59 -07:00
default workspace option
This commit is contained in:
@@ -156,6 +156,19 @@ void CConfigManager::handleBind(const std::string& command, const std::string& v
|
||||
g_pKeybindManager->addKeybind(SKeybind{KEY, MOD, HANDLER, COMMAND});
|
||||
}
|
||||
|
||||
void CConfigManager::handleDefaultWorkspace(const std::string& command, const std::string& value) {
|
||||
|
||||
const auto DISPLAY = value.substr(0, value.find_first_of(','));
|
||||
const auto WORKSPACEID = stoi(value.substr(value.find_first_of(',') + 1));
|
||||
|
||||
for (auto& mr : m_dMonitorRules) {
|
||||
if (mr.name == DISPLAY) {
|
||||
mr.defaultWorkspaceID = WORKSPACEID;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CConfigManager::parseLine(std::string& line) {
|
||||
// first check if its not a comment
|
||||
const auto COMMENTSTART = line.find_first_of('#');
|
||||
@@ -207,9 +220,11 @@ void CConfigManager::parseLine(std::string& line) {
|
||||
} else if (COMMAND == "bind") {
|
||||
handleBind(COMMAND, VALUE);
|
||||
return;
|
||||
} else if (COMMAND == "workspace") {
|
||||
handleDefaultWorkspace(COMMAND, VALUE);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
configSetValueSafe(currentCategory + (currentCategory == "" ? "" : ":") + COMMAND, VALUE);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user