Howto: enable Do Not Disturb mode with Indicator Notifications on Ubuntu MATE 18.04 LTS

Recently I have completed a migration of my personal systems from Ubuntu MATE 16.04 LTS to Ubuntu MATE 18.04 LTS.
This release is a good and still supported alternative for modern Ubuntu MATE 20.04 LTS, it includes Python 2 and Qt4 stuff which is needed for some of my applications.

But Ubuntu MATE 18.04 LTS lacks the well-designed and useful feature for broadcasting and screen sharing - Do Not Disturb for Indicator Notifications.
It was introduced later, in Ubuntu 19.10 and then included to 20.04 LTS.

The below method allows one to get both Do Not Disturb mode with Indicator Notifications while using packages from 20.04 LTS.
So we need to download packages manually and then install them:

cd ~/Downloads


sudo apt-get install ./mate-notification-daemon-common_1.24.0-1_all.deb ./mate-notification-daemon_1.24.0-1_amd64.deb ./indicator-notifications_0.4.2-0ubuntu1_amd64.deb

Then logout (or reboot), login back and enjoy.

This will make available two checkboxes with Enable do not disturb - one inside Indicator Notifications settings:


and one inside MATE Control Center → Popup Notifications:


Technically they change two gsettings keys:


To have one-click switch I have created custom script ~/bin/ for DnD toggling.
The script maybe created in programmatic way by ececuting long command :

mkdir ~/bin
cat << EOF > ~/bin/

gsettings get net.launchpad.indicator.notifications do-not-disturb | grep true && \
gsettings set net.launchpad.indicator.notifications do-not-disturb false && notify-send -t 1000 "Do not disturb disabled" || \
gsettings set net.launchpad.indicator.notifications do-not-disturb true

chmod +x ~/bin/

and then it should be linked to Custom Application Launcher as follows:

  1. Do right mouse click on needed MATE Panel
  2. Locate Custom Application Launcher applet and click Add
  3. Set Name to Toggle DnD
  4. Set Command to /home/username/bin/ (change username to yours)
  5. Set Icon to the corresponding one, for example /usr/share/icons/hicolor/scalable/apps/mate-notification-properties.svg mate-notification-properties
  6. Click OK
  7. Try to toggle newly created launcher

This simple script is usable on modern versions of Ubuntu MATE too.

Notes. For me only one discrepancy exists - the Popper email notifier do not know about this DnD mode, and plays sound on e-mail arrival. Maybe I'll patch it in some way later.