Last active
May 1, 2023 07:47
-
-
Save vermilion1/7e4f3e8d6b75422eb17d60dec40e1755 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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