10

I am running Centos 7 with GNOME-Shell 3.8.4.

I can happily disable all notifications from the top-right menu, as pictured:

disabling/enabling GNOME shell notifications via GUI

I need to do that from the command line, though, because I need to automate that in a script to trigger according to certain circumstances.

Is there any way to do that? Thanks all.

Dakatine
  • 2,928

1 Answers1

12

Newer gnome-shell (~3.10+):

disable:

gsettings set org.gnome.desktop.notifications show-banners false

enable:

gsettings set org.gnome.desktop.notifications show-banners true

Note that you might need to enable/disable notifications also on a per-app basis, e.g. to disable Nautilus notifications:

gsettings set org.gnome.desktop.notifications.application:/org/gnome/desktop/notifications/application/org-gnome-nautilus/ enable false

and to re-enable them:

gsettings set org.gnome.desktop.notifications.application:/org/gnome/desktop/notifications/application/org-gnome-nautilus/ enable true

Old gnome-shell (<3.8 or 3.10):

disable:

gsettings set org.gnome.desktop.notifications enable false

enable:

gsettings set org.gnome.desktop.notifications enable true
Udi
  • 304
don_crissti
  • 2,864