Created
September 8, 2022 12:56
-
-
Save mattpocock/fa3d11744bdf2e898d3beb62f0344472 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: 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