Skip to content

Instantly share code, notes, and snippets.

@jlindsey
Last active March 11, 2019 14:19
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 jlindsey/c4cca3d4ba3be4ad5ed71cb268004469 to your computer and use it in GitHub Desktop.
Save jlindsey/c4cca3d4ba3be4ad5ed71cb268004469 to your computer and use it in GitHub Desktop.
Slack Dark Mode installer
#!/bin/bash
restart() {
osascript -l JavaScript <<EOF > /dev/null
var app = Application('$1')
if (app.running()) {
try { app.quit() } catch (e) {}
}
// Waits at most 4 seconds, checking every 100ms
// if the app has terminated.
for (var i=0; i<40; ++i) {
delay(0.1)
if (! app.running()) {
app.launch()
break
}
}
EOF
}
pushd /Applications/Slack.app/Contents/Resources/app.asar.unpacked/src/static
curl https://raw.githubusercontent.com/caiceA/slack-black-theme/master/ssb-interop.js -o ssb-interop.js
popd
restart Slack
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment