The installation may currently fail. We recommend copying the code below and creating the extension manually in Eidos.
By: Mayne
Rotates through available themes every 1 second
export async function switchTheme(input: Input, context: Context) {
const themes = await eidos.currentSpace.theme.listThemes();
if (!themes || themes.length === 0) {
eidos.currentSpace.notify({
title: "No Themes Found",
description: "Could not find any themes to cycle through."
});
return;
}
for (let i = 0; i < themes.length; i++) {
const themeIndex = i % themes.length;
const { name } = themes[themeIndex];
await eidos.currentSpace.theme.setCurrentTheme(name);
// eidos.currentSpace.notify({
// title: "Theme Changed",
// description: `Current theme: ${name}`
// });
// Wait for 1 second before changing to the next theme
await new Promise(resolve => setTimeout(resolve, 1000));
}
}
export default switchTheme;
export const commands = [
{
name: "switchTheme",
description: "Rotates through available themes every 1 second",
inputJSONSchema: {
type: "object",
properties: {},
},
outputJSONSchema: {
type: "object",
properties: {},
},
asTableAction: false,
},
];