Skip to content

Instantly share code, notes, and snippets.

@mattpocock
Created September 8, 2022 12:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mattpocock/fa3d11744bdf2e898d3beb62f0344472 to your computer and use it in GitHub Desktop.
Save mattpocock/fa3d11744bdf2e898d3beb62f0344472 to your computer and use it in GitHub Desktop.
// Name: Stop Work
// Description: It's the end of the day! Time to chill.
import "@johnlindquist/kit";
const appsToClose = [
`Slack`,
`Discord`,
`QuickTime Player`,
`Centered`,
`Electron`,
`Terminal`,
`Preview`,
`Zoom`,
];
for (const app of appsToClose) {
try {
await $`killall "${app}"`;
} catch (e) {}
}
await applescript(`
tell windows of application "Google Chrome"
close (every tab whose URL contains "mail.google")
close (every tab whose URL contains "twitter")
close (every tab whose URL contains "github")
close (every tab whose URL contains "convertkit")
close (every tab whose URL contains "stripe")
end tell
`);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment