better workspace indicator styling

This commit is contained in:
2025-12-10 13:12:47 +01:00
parent 12546a36f8
commit 4d61a80a7c
3 changed files with 32 additions and 27 deletions

View File

@@ -348,30 +348,8 @@ void HyprlandService::switchToWorkspace(int monitorId, int slot)
auto wsIt = monitor.workspaceStates.find(slot);
std::string cmd;
if (wsIt != monitor.workspaceStates.end() && wsIt->second.hyprId >= 0)
{
// Use the Hyprland workspace id if available
cmd = "hyprctl dispatch workspace " + std::to_string(wsIt->second.hyprId);
}
else
{
// Fallback: ask Hyprland to switch/create a workspace on the monitor
// by using the slot number and the monitor name. Syntax: "<slot>:<monitor>"
// Example: hyprctl dispatch workspace 2:DP-1
// This may vary by Hyprland version; if it doesn't work on your system
// adjust the command accordingly.
std::string monName = monitor.name;
if (monName.empty())
{
// As a last resort, just try the slot number globally
cmd = "hyprctl dispatch workspace " + std::to_string(slot);
}
else
{
// Quote monitor name in case it contains spaces
cmd = "hyprctl dispatch workspace " + std::to_string(slot) + ":\"" + monName + "\"";
}
}
try
{