Created
July 18, 2019 04:06
-
-
Save adilio/0a6b4d96421d6849007318dc482daad4 to your computer and use it in GitHub Desktop.
Enables Slack Dark Mode for versions 3.4.1 and later
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Author: Colin Andress | |
# Modified by: adilio | |
# Github Link: https://github.com/Column01 | |
Write-Output 'Getting Windows User and Slack version' | |
$user = $env:UserName | |
if (Test-Path -Path "C:\Users\$user\AppData\Roaming\Slack\storage\slack-settings") { | |
$json = Get-Content "C:\Users\$user\AppData\Roaming\Slack\storage\slack-settings" | Out-String | ConvertFrom-Json | |
} | |
else { | |
Write-Output 'Unable to find the slack version info. Is slack installed from the windows store? Make sure it is from the slack website!' | |
exit | |
} | |
$version = $json.appVersion | |
Write-Output "Windows username: $user" | |
Write-Output "Slack Version: $version" | |
if ($user) { | |
Write-Output 'Moving to slack install location' | |
Set-Location "C:\Program Files\Slack\resources\app.asar.unpacked\src\static" | |
Write-Output 'Renaming the old ssb-interop.js to OLDssb-interop.js to preserve it in case of an error (rename it to the normal name to revert changes)' | |
try { | |
Rename-Item -Force -ErrorAction 'Stop' -Path 'ssb-interop.js' -NewName 'OLDssb-interop.js' | |
} | |
catch { | |
Write-Output 'Backed up file exists... Updating the backup copy to the current ssb-interop.js' | |
Remove-Item -Path 'OLDssb-interop.js' | |
Rename-Item -Force -Path 'ssb-interop.js' -NewName 'OLDssb-interop.js' | |
} | |
Write-Output 'Downloading modified ssb-interop.js from Github and placing it in the correct folder' | |
Invoke-WebRequest https://raw.githubusercontent.com/caiceA/slack-black-theme/master/ssb-interop.js -O ssb-interop.js; | |
Write-Output 'Download and install complete. Restart slack to apply the changes!' | |
Write-Output 'Exiting script in 3 seconds.' | |
Set-Location ~ | |
Start-Sleep -Seconds 3 | |
exit | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment