PDQ.com mobilePDQ.com desktop

Keep Slack Patched With a True Dark Theme

Steven van DijkSteven van Dijk

I recently figured out a way to automatically patch Slack in our environment AND apply a dark theme to any user who wants it. I accomplished this with PowerShell, this Github repository, and PDQ Deploy and PDQ Inventory. If dark mode allows you to see better, cranks your hacker image up to the next level, or maybe you just want to look super cool (trust me, it works), this guide is for you.

And if you're one of these non-dark mode users I keep hearing about, well,

Grab this PowerShell script to automatically apply a dark theme to Slack. Download the file, open up PowerShell, and run it on a test machine to make sure it successfully applies the dark theme to Slack.


Keeping the Dark Theme Persistent

The problem with the PowerShell script is whenever Slack updates, the update overwrites the custom theme and reverts back to the standard theme. We need a way to apply the script every time Slack updates. To accomplish this, we're going to grab the 'Auto Download Slack' package from the PDQ Package Library and set up a Schedule.

Fire up PDQ Deploy, download Slack from the Package Library, and create a new Schedule to deploy Slack when it updates. We've covered this before, so here's a guide to get you started if you need help.

Next, we're going to modify the Slack package to apply the dark theme in a Post-Step.

  1. Open up the Slack Package

  2. Select Post-Steps -> New Step -> PowerShell

  3. Click 'Insert PowerShell Script'

  4. Select Apply-SlackDarkTheme.ps1

It should look something like this:

Make sure you're running Deploy in dark mode, obviously.[/caption]

We don't want to apply the dark theme to every user, just the ones who want it. So let's move over to Inventory and create a static collection of computers that will get the dark theme. That should look like this:

Make sure you're running Inventory in dark mode, obviously.[/caption]

We'll make the dark theme step only apply to computers in that collection.

  1. Go back to your Slack package and select the 'Apply Dark Theme' Post-Step you just made

  2. Open the Conditions tab.

  3. Under 'PDQ Inventory Collection', select 'Is A Member'

  4. Select the new 'Slack Dark Mode' Inventory collection.

It should look like this:

Set it and Forget it

Lastly, let's finish up our Schedule. I have a pretty standard Schedule with a daily trigger to hit machines that usually stay on, and a heartbeat trigger for machines that come online. For Targets, I link to the 'Slack (Per-Machine Install) (Old)' collection. Then, of course, don't forget to attach the Slack package in the Packages tab.

At this point, all you have to do to keep Slack patched is set it and forget it. Your Schedule will effectively kill two Jedis with one lightsaber: keep Slack up to date, and apply the dark theme to any user who wants it.

Don't miss the next post!

Using PowerShell to Install Printers

When installing printers, we will need to do the four things; Add Driver to the Store, Install the Driver, Create Printer Port, and Install the Printer