Skip to content

Instantly share code, notes, and snippets.

@vermilion1
Last active May 1, 2023 07:47
Show Gist options
  • Save vermilion1/7e4f3e8d6b75422eb17d60dec40e1755 to your computer and use it in GitHub Desktop.
Save vermilion1/7e4f3e8d6b75422eb17d60dec40e1755 to your computer and use it in GitHub Desktop.
// Name: Make a fkn break
// Menu: Make a fkn break
// Schedule: */15 * * * *
import "@johnlindquist/kit"
const duration = 15; // 15 seconds
const openFrame = async () => {
const startDate = Date.now();
const html = `<h1>Look somewhere far far away for ${duration} seconds</h1>`;
const frame = await widget(html, {
alwaysOnTop: true,
draggable: false,
resizable: false,
movable: false,
closable: false,
enableLargerThanScreen: true,
center: true,
type: 'desktop', // disables ESC
opacity: 1,
backgroundColor: '#ccc',
width: 1980,
height: 1200,
});
return frame;
};
const schedule = async () => {
const frame = await openFrame();
setTimeout(() => frame.close(), duration * 1000);
};
schedule();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment