For security, since this script injects CSS via AJAX, first fork the main slack night mode repo. The reason is explained here
- save this script wherever you keep your ruby scripts for example
~/lacostenycoder/scripts/ruby/
- change the URL in the ruby script to use YOUR repo. The rawgit.com file is created when you fork the repo.
- For non-MacOS, find where the slack files are and replace line 17 to point to correct path, thanks simbalinux
so you would change line 17 for ubuntu like this
@file_target = '/usr/lib/slack/resources/app.asar.unpacked/src/static/ssb-interop.js'
- make script executable
sudo chmod +x nightslack
- symlink to a PATH load for example:
ln -s /Users/lacostenycoder/dev/ruby/nightslack.rb /usr/local/bin/nightslack
- Or if you prefer just drop the
.rb
from the filename and move it directly to/usr/local/bin/nightslack
From a terminal simply type nightslack
to start desktop app in night-mode.
To toggle back to day mode, simpley run nightslack -d
to pass the day mode option.
This will start or restart a running slack desktop in the desired mode!
- To update styles, sync your forked repo with upstream but be sure to inspect the css to insure it doesn't contain js code injeciton.