Skip to content

Instantly share code, notes, and snippets.

@selfire1
selfire1 / Pre-Publish Template.js
Last active October 7, 2023 06:15
To be run in the Obsidian Templater Plugin to update query files and permalinks. To be saved as a `.md` file.
<%*
const dv = app.plugins.plugins["dataview"].api;
const openPublishPanel = app.commands.commands["publish:view-changes"].callback;
// ----------------------
// Update query files
// ----------------------
const updateQueryFiles = async () => {
const fileAndQuery = new Map([
[
"Books Read (Auto-Updating)",
#!/usr/bin/env zx
// yabai message
const ym = async (arg) => await $`yabai -m ${arg.split(" ")}`;
const hideAllApps = async () => {
await $`osascript -e 'tell application "System Events" to set visible of every process whose visible is true to false'`;
};
const laptop = 1;