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.

1 Answer 1

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
4
  • 1
    where do you find the relevant keys for these things? For instance, I used gsettings list-keys org.gnome.desktop.notifications to find keys, but I couldn't see any applicaton, let alone any hint on throwing in the whole :/org/gnome/desktop/notifications/application/org-gnome-nautilus/ bit. This has always seemed like a mystery to me, much like the keys of RegEdit in Windows - although I know a lot more about navigating that!
    – oligofren
    Feb 15, 2018 at 15:37
  • 1
    @oligofren - it's all in the manual (although not easy to figure it out)... this is a relocatable schema (to list all relocatable schemas use gsettings list-relocatable-schemas) so you need to provide a path for the schema in the format SCHEMA [:PATH] - you get the list of paths with stuff like dconf list /org/gnome/desktop/notifications/application/ . Feb 15, 2018 at 16:44
  • Install dconf editor. It's like regex for gnome-based shells. May 3, 2019 at 5:17
  • ...and for me to get rid of the current "printer added" notification which is blocking my video playlist call pkill gjs Apr 30, 2022 at 19:32

You must log in to answer this question.

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