29

Can i disable all libnotify related notification from Network Manager ? 'Edit Connection' dialog doesn't help out

1
  • seem neither of this (answers below) works for ubuntu 14.04.
    – ses
    Dec 9, 2015 at 0:41

6 Answers 6

43
+100

12.10 - Dconf

Run these commands:

gsettings set org.gnome.nm-applet disable-disconnected-notifications "true"
gsettings set org.gnome.nm-applet disable-connected-notifications "true"

Or open dconf-editor and scroll down to orggnomenm-applet and check disable-connected-notifications and disable-disconnected-notifications settings there.

DConf


11.10 and 12.04 - Gconf

Gconf-editor lets you edit the network manager notifications.

To alter these settings, install gconf-editor from the software-center.

Scroll to / ▸ apps ▸ nm-applet and check disable-connected-notifications and disable-disconnected-notifications settings there. Check the attached image for clarifications.

gconf editor

6
  • 1
    Alternatively in cmdline: gconftool -s /apps/nm-applet/disable-disconnected-notifications --type=bool true (and same for disable-connected-notifications) (@joker feel free to merge into answer)
    – Caesium
    Nov 27, 2011 at 9:59
  • @Caesium You should probably create a new answer to this question :)
    – jokerdino
    Nov 27, 2011 at 10:02
  • Another one that bothers me is when it warns about connections available... to mute that up just write this: gsettings set org.gnome.nm-applet suppress-wireless-networks-available "true"
    – D.Snap
    Apr 26, 2016 at 5:48
  • Command line (gsettings) still works for Ubuntu 16.04
    – geekQ
    Jun 12, 2016 at 8:47
  • Can confirm, the gsettings ... commands work on ArchLinux (2023) (Kernel 6.1.8), with nm-applet (NetworkManager 1.40.12-1) and i3 (4.22)
    – Joel
    Jan 31, 2023 at 2:54
11

In addition to jokerdino's way, you can change this in commandline too:

gconftool -s /apps/nm-applet/disable-disconnected-notifications --type=bool true
gconftool -s /apps/nm-applet/disable-connected-notifications --type=bool true

To see what can be changed:

gconftool -R /apps/nm-applet
4

The other answers might help you with getting rid of "you are connnected" messages, but there's a bug, at https://bugs.launchpad.net/ubuntu/+source/network-manager-applet/+bug/445872 (see also https://bugs.launchpad.net/ubuntu/+source/network-manager-applet/+bug/921717 and https://bugs.launchpad.net/ubuntu/+source/network-manager-applet/+bug/835972 ), causing the disable-disconnected-notification setting to be ignored.

Until that's fixed, there is a workaround. Put this in /etc/pm/sleep.d/49_killall_notify:

#!/bin/sh

case "${1}" in
    resume|thaw)
    ( sleep 2 ; /usr/bin/killall /usr/lib/xfce4/notifyd/xfce4-notifyd ) &
    ( sleep 4 ; /usr/bin/killall /usr/lib/xfce4/notifyd/xfce4-notifyd ) &
     ;;
esac

then chmod +x /etc/pm/sleep.d/49_killall_notify. This is for Xubuntu, on regular Ubuntu I guess it would be /usr/bin/killall notify-osd or something like that. You might also need to tweak the sleep times.

But this is an ugly hack ;) it'd be better to see a real fix.

0
1

unhammer is correct that disabling disconnect notifications in gconf-editor doesn't work. In regular Ubuntu you can kill the disconnect notifications with:

sudo chmod -x /usr/lib/notify-osd/notify-osd

Then kill the notify-osd process.

I guess this probably kills all notifications, not just network-related ones.

1

A crude solution:

dbus-monitor "interface='org.freedesktop.Notifications'"                \
| grep --line-buffered  'string "NetworkManager"'                       \
| sed -u -e  's/.*/killall notify-osd/g'                                \
| bash

Caveat:
killall notify-osd is non-discriminating and completely wipes the notification stack of any pending messages irregardless of whether NM is the notifying agent.

An "honest" solution can be finessed but this requires that pending notifications, other than NM's, need to be reestablished while maintaining their temporal integrity. This means the chronological ordering needs to be maintained for the other notifications and the dbus monitored to check if the notifications' status has changed ... ie. canceled, message altered etc.

Ideally, the direct dbus use of

method void org.freedesktop.Notifications.CloseNotification(uint id)

to specifically target just the NM's notifications, is unfortunately not obvious ...

ref:

Bookmark:
How to disable notification from network-manager

0

If you are looking for ubuntu 18.10 then you can disable from gnome.

enter image description here

go to network section then

You must log in to answer this question.

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