20 lines
482 B
TypeScript
20 lines
482 B
TypeScript
import { showHUD } from "@raycast/api";
|
|
import { runYabaiCommand } from "./helpers/scripts";
|
|
import { showFailureToast } from "@raycast/utils";
|
|
|
|
export default async function Command() {
|
|
try {
|
|
const { stderr } = await runYabaiCommand("-m window --space prev --focus");
|
|
|
|
if (stderr) {
|
|
throw new Error(stderr);
|
|
}
|
|
|
|
showHUD(`Moved window to previous space`);
|
|
} catch (error) {
|
|
showFailureToast(error, {
|
|
title: "Failed to move window.",
|
|
});
|
|
}
|
|
}
|