Skip to content

Instantly share code, notes, and snippets.

@TfTHacker
Last active April 1, 2024 06:39
Show Gist options
  • Star 12 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TfTHacker/29f838b51338a5c7f46b04973bd0f401 to your computer and use it in GitHub Desktop.
Save TfTHacker/29f838b51338a5c7f46b04973bd0f401 to your computer and use it in GitHub Desktop.
FastStart Script for Obsidian - makes it easy to delay the startup of plugins
<%*
fastStart = async (filename, delayInSecond) => {
if (tp.file.exists(filename)) {
const f = tp.file.find_tfile(filename);
let plugins = (await app.vault.read(f)).split(/\r?\n/);
setTimeout(async () => {
plugins.forEach(async (p) => await app.plugins.enablePlugin(p))
}, delayInSecond * 1000)
}
}
await fastStart("FastStart-Plugins-ShortDelay", 2)
await fastStart("FastStart-Plugins-LongDelay", 30)
%>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment