Skip to content

Instantly share code, notes, and snippets.

@filviu
Last active June 4, 2019 09:42
Show Gist options
  • Save filviu/d4347b4d51d3bb5f223d704475fcb35e to your computer and use it in GitHub Desktop.
Save filviu/d4347b4d51d3bb5f223d704475fcb35e to your computer and use it in GitHub Desktop.
Sets a dark mode for slack. Run once after each update without slack running.
$darkString = @'
document.addEventListener('DOMContentLoaded', function() {
$.ajax({
url: 'https://cdn.jsdelivr.net/gh/laCour/slack-night-mode/css/raw/black.css',
success: function(css) {
let overrides = `
code { background-color: #535353; color: #85c5ff; } /* Change color: to whatever font color you want */
.c-mrkdwn__pre, .c-mrkdwn__quote { background: #535353 !important; background-color: #535353 !important; }
.p-threads_footer__input .p-message_input_field { background: #000 }
`
$("<style></style>").appendTo('head').html(css + overrides);
}
});
});
'@
$slackVerDir = (Get-ChildItem -Path $env:LOCALAPPDATA\slack\app-* -Name -Directory | Select-Object -Last 1)
$darkString | Out-File -Append -Encoding "UTF8" $env:LOCALAPPDATA\slack\$slackVerDir\resources\app.asar.unpacked\src\static\ssb-interop.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment