Initial commit

This commit is contained in:
2026-02-06 15:02:13 -05:00
Unverified
commit 4980ef15a5
43 changed files with 5123 additions and 0 deletions

40
src/destroy-space.tsx Normal file
View File

@@ -0,0 +1,40 @@
import { showHUD } from "@raycast/api";
import { runYabaiCommand } from "./helpers/scripts";
import { showFailureToast } from "@raycast/utils";
export default async function Command() {
try {
const { stdout: rawRecentSpace, stderr } = await runYabaiCommand(`-m query --spaces --space recent`);
if (stderr) {
throw new Error(stderr);
}
const recentSpace = JSON.parse(rawRecentSpace);
const lastSpaceIndex = recentSpace.index;
await runYabaiCommand(`-m space --destroy`);
try {
await runYabaiCommand(`-m space --focus ${lastSpaceIndex}`);
} catch (error) {
throw new Error(`Failed to focus space: ${error}`);
}
await showHUD(`Destroyed Space`);
} catch (error) {
if (error instanceof Error) {
if (error.message.includes("Yabai executable not found")) {
return;
}
showFailureToast(error, {
title: "Failed to destroy space",
});
} else {
showFailureToast(error, {
title: "Failed to destroy space",
});
}
}
}