Skip to content

Instantly share code, notes, and snippets.

@patricksanders
Forked from Kenny-MWI/slack_tweaks.md
Created October 20, 2023 17:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save patricksanders/66433055df416d9d886f9580a107625d to your computer and use it in GitHub Desktop.
Save patricksanders/66433055df416d9d886f9580a107625d to your computer and use it in GitHub Desktop.
Slack Tweaks

Slack Tweaks

In Fall 2023, Slack introduced an updated client with some unpopular UI changes. The tweaks in this document can be used to revert to the old client or hide the new side bar. These will reset every time you fully close Slack but they are easy to re-apply once you get the hang of it.

The fist step is to enable dev mode, which can be accomplished by setting a system-wide environment variable.

(Mac OS) Enable Dev Mode

  1. Close the Slack app (command + Q)
  2. Open the terminal and run these two commands separately:
    • export SLACK_DEVELOPER_MENU=true
    • open /Applications/Slack.app
  3. Slack will re-open with but now we have access to its console
  4. Open Slack’s console by pressing command + option + I and clicking on the Console tab at the top
    • At the bottom of the console window you should see a blue > character. This is the prompt where you'll want to paste the code snippets found below.

Note If you close (cmd + q) or reload the app (cmd + r), you will have to do this again. There are instructions on how to make this permanent at the bottom of the document.

(Windows) Enable Dev Mode

  1. Close the Slack app if it's open (ctrl + Q or File -> Quit Slack)
  2. Add an environment variable SLACK_DEVELOPER_MENU with a value of true to your system
  3. Re-open Slack
  4. Open Slack's console by pressing ctrl + alt + I and clicking on the console tab at the top
    • At the bottom of the console window you should see a blue > character. This is the prompt where you'll want to paste the code snippets found below.

(Cross Platform) Enable Dev Mode [Alternative Option]

According to @steveafrost in the comments, you can get to the dev console without adding the environment variable to your system by typing /slackdevtools in a Slack channel.


Hide the sidebar

You can hide the sidebar by pasting the following into the console, courtesy of /u/CherryDT on reddit with a few edits by me:

document.querySelector('[data-qa="top-nav-help-button"]').parentNode.parentNode.parentNode.insertAdjacentElement('afterend', document.querySelector('[data-qa="user-button"]').parentNode.parentNode);
document.querySelector('.p-tab_rail').style.display = 'none';
document.querySelector('.p-control_strip').style.display = 'none';
document.querySelector('.p-ia4_client .p-client_workspace--including_tab_rail').style.gridTemplateAreas = 'p-client-workspace p-client-workspace';
document.querySelector('.p-ia4_client .p-client_workspace--including_tab_rail').className="p-theme_background";

This will hide the workspace switcher and you won't be able to see the "Mentions & reactions" link. It moves your profile image to the top right of the screen so you can still set your Slack status, pause notifications, edit preferences, etc. On mouseover, you'll see a tooltip block your profile image but you can click through it. I'm still working on a way to remove the tooltip.

According to @chipbite in the comments, if you have multiple workspaces can still switch using keyboard shortcuts. So, ctrl-1, ctrl-2, etc would still work to switch workspaces.

You can undo this change by restarting Slack if you change your mind or if it causes problems for you in the future.


Revert to old client (pre-update)

Instead of hiding the new navbar, you can completely revert (temporarily) to the old client by pasting this into the console:

localStorage.setItem("localConfig_v2", localStorage.getItem("localConfig_v2").replace(/\"is_unified_user_client_enabled\":true/g, '\"is_unified_user_client_enabled\":false'))

It'll probably return undefined, but that's fine. Reload Slack with command+R or ctrl+R and it should revert back until you restart Slack.


(Mac OS) Set environment variable automatically

If you want SLACK_DEVELOPER_MENU=true to be set whenever you log in, create a file in ~/Library/LaunchAgents/setenv.SLACK_DEVELOPER_MENU.plist with these contents. (Thanks to @navels for this!)

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
  <plist version="1.0">
  <dict>
  <key>Label</key>
  <string>setenv.SLACK_DEVELOPER_MENU</string>
  <key>ProgramArguments</key>
  <array>
    <string>/bin/launchctl</string>
    <string>setenv</string>
    <string>SLACK_DEVELOPER_MENU</string>
    <string>true</string>
  </array>
  <key>RunAtLoad</key>
  <true/>
</dict>
</plist>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment