mirror of
				https://github.com/rad4day/Waybar.git
				synced 2025-11-04 01:32:42 +01:00 
			
		
		
		
	Add a configuration entry to disable auto_back_and_forth on Sway workspaces
This commit is contained in:
		@@ -257,11 +257,19 @@ Gtk::Button &Workspaces::addButton(const Json::Value &node) {
 | 
			
		||||
          ipc_.sendCmd(
 | 
			
		||||
              IPC_COMMAND,
 | 
			
		||||
              fmt::format(workspace_switch_cmd_ + "; move workspace to output \"{}\"; " + workspace_switch_cmd_,
 | 
			
		||||
                          "--no-auto-back-and-forth",
 | 
			
		||||
                          node["name"].asString(),
 | 
			
		||||
                          node["target_output"].asString(),
 | 
			
		||||
                          "--no-auto-back-and-forth",
 | 
			
		||||
                          node["name"].asString()));
 | 
			
		||||
        } else {
 | 
			
		||||
          ipc_.sendCmd(IPC_COMMAND, fmt::format(workspace_switch_cmd_, node["name"].asString()));
 | 
			
		||||
          ipc_.sendCmd(
 | 
			
		||||
              IPC_COMMAND,
 | 
			
		||||
              fmt::format("workspace {} \"{}\"",
 | 
			
		||||
                          config_["disable-auto-back-and-forth"].asBool()
 | 
			
		||||
                            ? "--no-auto-back-and-forth"
 | 
			
		||||
                            : "",
 | 
			
		||||
                          node["name"].asString()));
 | 
			
		||||
        }
 | 
			
		||||
      } catch (const std::exception &e) {
 | 
			
		||||
        spdlog::error("Workspaces: {}", e.what());
 | 
			
		||||
@@ -322,7 +330,9 @@ bool Workspaces::handleScroll(GdkEventScroll *e) {
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
  try {
 | 
			
		||||
    ipc_.sendCmd(IPC_COMMAND, fmt::format(workspace_switch_cmd_, name));
 | 
			
		||||
    ipc_.sendCmd(
 | 
			
		||||
        IPC_COMMAND,
 | 
			
		||||
        fmt::format(workspace_switch_cmd_, "--no-auto-back-and-forth", name));
 | 
			
		||||
  } catch (const std::exception &e) {
 | 
			
		||||
    spdlog::error("Workspaces: {}", e.what());
 | 
			
		||||
  }
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user