Slack Dark Theme

UPDATE Using this repo now.

Slack doesn’t have a dark theme. If you want slack for macOS to have a dark theme you can run this script. You will have to run it every time slack updates. The script was shared and updated in this github issue. Confirmed working in version 3.2.0.

#!/bin/bash

#https://github.com/laCour/slack-night-mode/issues/73

SLACK_PATH='/Applications/Slack.app/Contents'
CSS_URL='https://cdn.rawgit.com/laCour/slack-night-mode/master/css/raw/black.css'

sudo bash -c "cat >> \"${SLACK_PATH}\"/resources/app.asar.unpacked/src/static/ssb-interop.js" << EOF
document.addEventListener('DOMContentLoaded', function() {
 $.ajax({
   url: '${CSS_URL}',
   success: function(css) {
     \$("<style></style>").appendTo('head').html(css);
   }
 });
});
EOF

sudo bash -c "cat >> \"${SLACK_PATH}\"/resources/app.asar.unpacked/src/static/index.js" << EOF
document.addEventListener('DOMContentLoaded', function() {
 $.ajax({
   url: '${CSS_URL}',
   success: function(css) {
     \$("<style></style>").appendTo('head').html(css);
   }
 });
});
EOF

sudo bash -c "cat >> \"${SLACK_PATH}\"/resources/app.asar.unpacked/src/static/ssb-interop.js" << EOF
document.addEventListener('DOMContentLoaded', function() {
 $.ajax({
   url: '${CSS_URL}',
   success: function(css) {
     css += \`
       div.c-virtual_list__scroll_container {
           background-color: #222222 !important;
       }
       .p-message_pane .c-message_list:not(.c-virtual_list--scrollbar), .p-message_pane .c-message_list.c-virtual_list--scrollbar > .c-scrollbar__hider {
            z-index: 0;
       }
       div.c-message__content:hover {
           background-color: #222222 !important;
       }

       div.c-message:hover {
           background-color: #222222 !important;
       }
     \`;
     \$("<style></style>").appendTo('head').html(css);
   }
 });
});
EOF