mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-01-29 07:52:50 -05:00
feat: add workspace rename dialog (#1429)
* feat: add workspace rename dialog - Adds a modal dialog to rename the current workspace - Supports both Niri (via IPC socket) and Hyprland (via hyprctl dispatch) - Default keybinding: Ctrl+Shift+R to open the dialog - Pre-fills with current workspace name - Allows setting empty name to reset to default * refactor: wrap WorkspaceRenameModal in LazyLoader Reduces memory footprint when the modal is not in use.
This commit is contained in:
committed by
GitHub
parent
775b381987
commit
b3ea28c5c4
@@ -308,4 +308,18 @@ decoration {
|
||||
reloadConfig();
|
||||
});
|
||||
}
|
||||
|
||||
function renameWorkspace(newName) {
|
||||
if (!Hyprland.focusedWorkspace)
|
||||
return;
|
||||
const wsId = Hyprland.focusedWorkspace.id;
|
||||
if (!wsId)
|
||||
return;
|
||||
const fullName = wsId + " " + newName;
|
||||
Proc.runCommand("hyprland-rename-ws", ["hyprctl", "dispatch", "renameworkspace", String(wsId), fullName], (output, exitCode) => {
|
||||
if (exitCode !== 0) {
|
||||
console.warn("HyprlandService: Failed to rename workspace:", output);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user