@@ -201,8 +201,6 @@ void Workspaces::initializeWorkspaces() {
201201 // a persistent workspace config is defined, so use that instead of workspace rules
202202 loadPersistentWorkspacesFromConfig (clientsJson);
203203 }
204- // load Hyprland's workspace rules
205- loadPersistentWorkspacesFromWorkspaceRules (clientsJson);
206204}
207205
208206bool isDoubleSpecial (std::string const &workspace_name) {
@@ -277,42 +275,6 @@ void Workspaces::loadPersistentWorkspacesFromConfig(Json::Value const &clientsJs
277275 }
278276}
279277
280- void Workspaces::loadPersistentWorkspacesFromWorkspaceRules (const Json::Value &clientsJson) {
281- spdlog::info (" Loading persistent workspaces from Hyprland workspace rules" );
282-
283- auto const workspaceRules = m_ipc.getSocket1JsonReply (" workspacerules" );
284- for (Json::Value const &rule : workspaceRules) {
285- if (!rule[" workspaceString" ].isString ()) {
286- spdlog::warn (" Workspace rules: invalid workspaceString, skipping: {}" , rule);
287- continue ;
288- }
289- if (!rule[" persistent" ].asBool ()) {
290- continue ;
291- }
292- auto workspace = rule.isMember (" defaultName" ) ? rule[" defaultName" ].asString ()
293- : rule[" workspaceString" ].asString ();
294-
295- // The prefix "name:" cause mismatches with workspace names taken anywhere else.
296- if (workspace.starts_with (" name:" )) {
297- workspace = workspace.substr (5 );
298- }
299- auto const &monitor = rule[" monitor" ].asString ();
300- // create this workspace persistently if:
301- // 1. the allOutputs config option is enabled
302- // 2. the rule's monitor is the current monitor
303- // 3. no monitor is specified in the rule => assume it needs to be persistent on every monitor
304- if (allOutputs () || m_bar.output ->name == monitor || monitor.empty ()) {
305- // => persistent workspace should be shown on this monitor
306- auto workspaceData = createMonitorWorkspaceData (workspace, m_bar.output ->name );
307- workspaceData[" persistent-rule" ] = true ;
308- m_workspacesToCreate.emplace_back (workspaceData, clientsJson);
309- } else {
310- // This can be any workspace selector.
311- m_workspacesToRemove.emplace_back (workspace);
312- }
313- }
314- }
315-
316278void Workspaces::onEvent (const std::string &ev) {
317279 std::lock_guard<std::mutex> lock (m_mutex);
318280 std::string eventName (begin (ev), begin (ev) + ev.find_first_of (' >' ));
0 commit comments