i have modified Fynn’s one liner to allow the script to be executed multiple times without adding the code more than once. If you place this script in an automator application on your mac, you can add it as a startup program so that it runs on boot.
sed -i.bak '/darkmode BEGIN/,/darkmode END/d' /Applications/Slack.app/Contents/Resources/app.asar.unpacked/src/static/ssb-interop.js && echo -e '//darkmode BEGIN\ndocument.addEventListener("DOMContentLoaded", function() {\n $.ajax({\n url: "https://cdn.jsdelivr.net/gh/laCour/slack-night-mode/css/raw/black.css",\n success: function(css) {\n let overrides = `\n code, pre { background-color: #535353; color: #ffffff; }\n .c-mrkdwn__pre, .c-mrkdwn__quote, pre { background: #535353 !important; background-color: #535353 !important; }\n #client_body:not(.onboarding):not(.feature_global_nav_layout):before {display: none;}\n `\n $("<style></style>").appendTo("head").html(css + overrides);\n }\n })});\n//darkmode END' >> /Applications/Slack.app/Contents/Resources/app.asar.unpacked/src/static/ssb-interop.js
edit: Implemented Wayne's jsdelivr modification, used absolute path to ssb-interop.js in sed command
I love this community
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
i have modified Fynn’s one liner to allow the script to be executed multiple times without adding the code more than once. If you place this script in an automator application on your mac, you can add it as a startup program so that it runs on boot.
edit: Implemented Wayne's jsdelivr modification, used absolute path to ssb-interop.js in sed command
I love this community