42

When at work I want to disable the blue icon notification that happens when there's any activity in a channel that I'm in. Specifically, I don't want this notification from certain slack teams: enter image description here

Is there a way to "mute an entire slack team" so that I won't get that blue icon notification? Thanks.

2
  • 3
    Did you ever figure out a solution for this?
    – Zev
    Jun 9, 2018 at 0:27
  • I didn't. A "solution" might be using something like twistapp.com instead of Slack.
    – L42
    Jun 9, 2018 at 8:53

13 Answers 13

25

I don't seem to have the setting that Shawn mentions, but i was able to make this work by opening up the /usr/lib/slack/resources/app.asar.unpacked/src/static directory, making a copy of the slack-taskbar-rest.png file and renaming it to slack-taskbar-unread.png to overwrite the version with the blue dot.

of course, that gets rid of the blue dot for all teams, but that's what i wanted.

Edit (2019-05-28): Idea is still correct, but for the newest Slack version (3.4.2) on Ubuntu, two more files have to be replaced. The following worked for me:

cd /usr/lib/slack/resources/app.asar.unpacked/src/static
sudo cp slack-taskbar-rest.ico slack-taskbar-unread.ico
sudo cp slack-taskbar-rest.png slack-taskbar-unread.png
sudo cp slack-taskbar-rest-linux.png slack-taskbar-unread-linux.png
2
  • 2
    What about if its in snap?
    – goksel
    Mar 17, 2020 at 16:42
  • very likely not possible in a snap package, uninstall the snap package and install via .deb or .rpm via slack website
    – n0tis
    Oct 10, 2022 at 8:37
8

The short answer is: You can't, without hacking slack.

The long answer is that exactly how to hack it will differ from one version to the next, as they update the source code. We should all team up and submit a feature request (or maybe this could even be considered a bug – it's clearly bugging people).

Until then, this should be a community wiki, to prevent a new answer from being generated for each new slack version. Add your scripts here, and clearly state the latest version on which it works, newest on top.


4.7.0

This is an improvement on Dmitry S.'s answer.

  • unreads>0 is replaced with false, so slack should always think there are no unread messages.
  • Replacement is done in all .js files, since the code seems to have been split up in the latest version.
  • asar is not run with super user privileges, which is useful for people using npm-g_nosudo.

Prerequisites:

  • asar installed globally through npm: npm install -g asar

Script:

#!/usr/bin/env sh

set -eu

# Clean up previous failed attempts
rm -rf ~/tmp/slack
rm -rf ~/tmp/app.asar

# Unpack
mkdir -p ~/tmp/slack
asar extract /usr/lib/slack/resources/app.asar ~/tmp/slack

# Modify
sed -i 's/unreads>0/false/g' ~/tmp/slack/dist/*.js

# Replace
sudo rm /usr/lib/slack/resources/app.asar
sudo rm -rf /usr/lib/slack/resources/app.asar.unpacked
asar pack ~/tmp/slack ~/tmp/app.asar
sudo cp ~/tmp/app.asar /usr/lib/slack/resources/app.asar
sudo cp -r ~/tmp/slack /usr/lib/slack/resources/app.asar.unpacked

echo "Enjoy your productivity"

3
  • Tested and works with Slack 4.13.0 as of March 2021. Thanks for that solution! I am just wondering why Slack have got so many settings and preferences but is still missing this one important for productivity - they probably want people to slack instead of focused working?
    – geekQ
    Mar 11, 2021 at 8:35
  • 1
    This is broken again as of 4.20.0 Oct 12, 2021 at 6:25
  • @TatuLahtela Workaround for now (until somebody develops a new JavaScript patch): download the previous version from downloads.slack-edge.com/linux_releases/…, install, patch as before, prevent inadvertent upgrades with sudo apt-mark hold slack-desktop
    – geekQ
    Oct 18, 2021 at 19:23
6

The newest version 4.1.2 doesn't read the .ico file on Linux, and changes src to dist. Instead it builds a badge + base. Luckily unread>0 is the check responsible for the badge and only appears once in the minified JS, so it's easy to patch. You'll need the ASAR tool to modify the Electron archive (npm install -g asar):

mkdir -p ~/tmp/slack
asar extract /usr/lib/slack/resources/app.asar ~/tmp/slack
sed -i 's/unreads>0/unreads<0/g' ~/tmp/slack/dist/main.1.*.js
sudo rm /usr/lib/slack/resources/app.asar
sudo rm -rf /usr/lib/slack/resources/app.asar.unpacked
sudo asar pack ~/tmp/slack /usr/lib/slack/resources/app.asar
sudo mv ~/tmp/slack /usr/lib/slack/resources/app.asar.unpacked
2
  • This no longer works with Slack 4.2.0. I am digging around now trying to find a new way to accomplish this.
    – Matt Greer
    Dec 13, 2019 at 15:56
  • 2
    It seems to have moved to the main.2.*.js file. Change: sed -i 's/unreads>0/unreads<0/g' ~/tmp/slack/dist/main.1.*.js to sed -i 's/unreads>0/unreads<0/g' ~/tmp/slack/dist/main.2.*.js I would edit my answer, but I can't verify the fix at the moment. I grepped for 'setTrayIcon' to find the relevant file, and double-checked that 'unreads>0' is still the check.
    – Dmitry S.
    Dec 14, 2019 at 16:19
2

Same idea as notatoad, but with the newest Slack version (3.4.2) on Linux, there are two more files which have to be overwritten to replace the "blue dot" icon by the "rest" icon. I did the following:

cd /usr/lib/slack/resources/app.asar.unpacked/src/static
sudo cp slack-taskbar-rest.ico slack-taskbar-unread.ico
sudo cp slack-taskbar-rest.png slack-taskbar-unread.png
sudo cp slack-taskbar-rest-linux.png slack-taskbar-unread-linux.png

After a restart of Slack, we are rid of the blue dot.

2

Version 4.27.156

This is updated version of Dmitry S answer with the change of how the code is updated. Follow his answer for extracting and packing files using asar.

More elaborate but hopefully future-proof answer. You want to search for setTrayIcon function in the main.*.js file (in 4.27 it's named main.bundle.js). Look for code using the icon file - const O = nt.resolve(__dirname, "resources", 'slack-taskbar-${t}.ico'); In this case variable t is the status selecting the image. You want to add condition changing t to "rest" when it's "unread".

Unminified result:

...
setTrayIcon(t, n, o) {

  if (t === "hidden") {
    this.tray && (ee.kg.debug("Tray Handler: Destroying tray."), this.tray.destroy(), this.tray = null);
    return
  }
  if (!t) return;
  if (t === "unread") t = "rest"; // <----- new line
  let y;
  if (al) {
    const O = nt.resolve(__dirname, "resources", `slack-taskbar-${t}.ico`);
    y = ce.nativeImage.createFromPath(O)
  } else {
    const O = WM[t];
    y = ce.nativeImage.createFromDataURL(O)
  }
  this.tray ? this.tray.setImage(y) : this.createTrayIcon(y, n, o)
}
...

1

I don't see a way to modify this per channel but you can change it per team. In your preferences go to "notifications" and uncheck "show a badge on Slack's icon to indicate new activity" and that should do it.

2
  • 1
    Thanks, but that'll disable the red icon as well (which I want to keep).
    – L42
    Aug 9, 2017 at 19:18
  • 5
    I just started using slack and can't find this option in the current linux client (3.3.1 64 bit). Was this removed? Jan 14, 2019 at 14:24
1

In Preferences -> Notifications: enter image description here

1
  • 3
    When a question asks "How to",  we generally expect that an answer will contain at least one verb. Mar 14, 2019 at 23:00
1

Slack version 4.2.0, remove both blue (notifications) and red (highlights) notification dot:

mkdir ~/tmp/slack
asar extract /usr/lib/slack/resources/app.asar ~/tmp/slack
sed -i 's/unreads>0/unreads<0/g' ~/tmp/slack/dist/main.2.*.js
sed -i 's/unreadHighlights>0/unreadHighlights<0/g' ~/tmp/slack/dist/main.2.*.js
sudo rm /usr/lib/slack/resources/app.asar
sudo rm -rf /usr/lib/slack/resources/app.asar.unpacked
sudo asar pack ~/tmp/slack /usr/lib/slack/resources/app.asar
rm -rf ~/tmp/slack

What this does is - It unpacks slack source code and edits the check for displaying the unread and highlight messages from when numberOfMessages>0 to when numberOfMessages<0. This means that when you have less than 0 of unread or highlight messages it will show the blue/red dot. You will never have less than zero of unread messages so you will never see the blue/red dot in taskbar. After this it packs the code again and replaces the original version with the edited one.

5
  • Do you have an explanation for what that does?
    – RalfFriedl
    Dec 19, 2019 at 11:12
  • It unpacks slack source code and edits the check for displaying the unread and highlight messages from when numberOfMessages>0 to when numberOfMessages<0. This means that when you have less than 0 of unread or highlight messages it will show the blue/red dot. You will never have less than zero of unread messages so you will never see the blue/red dot in taskbar. After this it packs the code again and replaces the original version with the edited one. Dec 30, 2019 at 8:10
  • You should edit the answer, not add that as a comment.
    – RalfFriedl
    Dec 30, 2019 at 11:03
  • Altering unreadHighlights gets rid of the red dot notification. The OP didn't want that. If you just want blue dot notifications to go away, alter unreads only.
    – Matt Greer
    Apr 20, 2020 at 21:55
  • I wanted to get rid of both of them, as both are equally distracting to me and I clearly stated what it does: "Slack version 4.2.0, remove both blue (notifications) and red (highlights) notification dot:". It is not just for the OP, but for everyone who ends up here in his attempts to remove the notification dot(s). Apr 22, 2020 at 4:50
1

To provide a solution for Windows users, too:

The following short PowerShell script will 'disable' the notifications dot by replacing the icons with a dot with a blank one (as suggested by other answers).

# Set the path to the current Slack version here
# (by default the Slack installer puts it in %LocalAppData%)
$currentSlackVersionDir = "$env:LOCALAPPDATA\slack\app-4.3.4"

# Only change the following values if the names of the icons change
$blankIconFile = 'slack-taskbar-rest.ico'
$dottedIconFiles = 'slack-taskbar-highlight.ico', 'slack-taskbar-unread.ico'

# Get default icons folder path
$iconsFolder = "$currentSlackVersionDir\resources\app.asar.unpacked\dist\static"

foreach ($dottedIcon in $dottedIconFiles ) {
  # Rename dotted icon (as backup)
  Rename-Item -Path "$iconsFolder\$dottedIcon" -NewName "$iconsFolder\$dottedIcon.bak.ico"

  # Copy blank icon using its name
  Copy-Item -Path "$iconsFolder\$blankIconFile" -Destination "$iconsFolder\$dottedIcon"
}

Of course, you can also do this manually, but you'll probably have to redo it for every app update. (An improved version of this script could also try to find the $currentSlackVersionDir automatically, feel free to edit! :-))

1

In Slack 4.8.0 you can disable this by patching main.bundle.js. You'll need to have the asar archive program available.

mkdir /tmp/slack
asar extract /usr/lib/slack/resources/app.asar /tmp/slack
sed -i 's/icon="unread"/icon="rest"/g' ~/tmp/slack/dist/main.bundle.js
sudo rm /usr/lib/slack/resources/app.asar
sudo rm -rf /usr/lib/slack/resources/app.asar.unpacked
sudo asar pack /tmp/slack /usr/lib/slack/resources/app.asar
sudo mv /tmp/slack /usr/lib/slack/resources/app.asar.unpacked
1
1

Slack 4.26.1 here.

Unpack app.asar, edit main.bundle.js. There's an object that maps 'unread' to a data URL within the bundle. In the below, you see I changed it to refer to the same data URL as 'rest'.

:; grep -oE ......................unread:.... main.bundle.js 
{highlight:E3,rest:b3,unread:b3};

After changing it, pack app.asar again.

1

In version 4.20.0, assuming that "unread", "highlight", and "rest" strings in main.bundle.js are referring to the corresponding taskbar icons, changing "unread" to "rest" will hide the blue indicator dot, which it does.

#!/bin/bash

mkdir -p ~/tmp/slack
asar extract /usr/lib/slack/resources/app.asar ~/tmp/slack
sed -i 's/"unread"/"rest"/' ~/tmp/slack/dist/main.bundle.js
sudo rm /usr/lib/slack/resources/app.asar
sudo rm -rf /usr/lib/slack/resources/app.asar.unpacked
sudo asar pack ~/tmp/slack /usr/lib/slack/resources/app.asar
sudo mv ~/tmp/slack /usr/lib/slack/resources/app.asar.unpacked
2
  • I realize that rudolfbyker invited edits to his answer, but that was to avoid a proliferation of answers. You already have an answer, so editing your answer would not be counter to rudolfbyker’s intent.  And your edit to his answer was just a trivial modification of your answer (above); IMNSHO, you should just edit your answer.  If you really want to edit rudolfbyker’s answer, then offer a solution that incorporates the spirit (enhancements and style) of his answer. Oct 13, 2021 at 19:13
  • This didnt work for me (4.25).
    – goksel
    Apr 6, 2022 at 11:44
0

as of version 4.1.2 this doesn't seem to work because it appears that the electron app doesn't appear to use the assets on disk or something. I asked this to coworkers and was given the following that has worked for me:

mkdir ~/tmp/slack
asar extract /usr/lib/slack/resources/app.asar ~/tmp/slack
sed -i 's/unreads>0/unreads<0/g' ~/tmp/slack/dist/main.1.*.js
sudo rm /usr/lib/slack/resources/app.asar
sudo rm -rf /usr/lib/slack/resources/app.asar.unpacked
sudo asar pack ~/tmp/slack /usr/lib/slack/resources/app.asar
rm -rf ~/tmp/slack

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .