Skip to content

Instantly share code, notes, and snippets.

@jlindsey
Last active March 11, 2019 14:19
Show Gist options
  • Save jlindsey/c4cca3d4ba3be4ad5ed71cb268004469 to your computer and use it in GitHub Desktop.
Save jlindsey/c4cca3d4ba3be4ad5ed71cb268004469 to your computer and use it in GitHub Desktop.

Revisions

  1. jlindsey revised this gist Mar 11, 2019. 1 changed file with 7 additions and 2 deletions.
    9 changes: 7 additions & 2 deletions install_slack_dark_mode.sh
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    #!/bin/bash

    restart () {
    restart() {
    osascript -l JavaScript <<EOF > /dev/null
    var app = Application('$1')
    @@ -18,4 +18,9 @@ for (var i=0; i<40; ++i) {
    }
    }
    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
  2. jlindsey created this gist Mar 11, 2019.
    21 changes: 21 additions & 0 deletions install_slack_dark_mode.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,21 @@
    #!/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
    }