better workspace indicator styling
This commit is contained in:
@@ -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
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user