Skip to content

Instantly share code, notes, and snippets.

@bajcmartinez
Created June 4, 2019 19:23
Show Gist options
  • Save bajcmartinez/367d7ebaead3727952b7fd87b109d5e9 to your computer and use it in GitHub Desktop.
Save bajcmartinez/367d7ebaead3727952b7fd87b109d5e9 to your computer and use it in GitHub Desktop.
Enable Slack Dark Mode for MAC OS
#!/bin/bash
# Updates your slack installation on MAC to use dark mode
# adjust this URL for your chosen darkmode.
theme_url="https://cdn.rawgit.com/laCour/slack-night-mode/master/css/raw/black.css"
ssbj_dir="/Applications/Slack.app/Contents/Resources/app.asar.unpacked/src/static/"
# ensure we are root
if [[ "$EUID" -ne 0 ]]; then
echo "Run as root"
exit
fi
# make a backup of the current file, just in case
cp $ssbj_dir/ssb-interop.js $ssbj_dir/ssb-interop.js.bkp
# add the event listener
cat <<EOF >> $ssbj_dir/ssb-interop.js
document.addEventListener('DOMContentLoaded', function () {
\$.ajax({
url: '$theme_url',
success: function (css) {
\$("<style></style>").appendTo('head').html(css)
}
});
});
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment