Page 1 of 1

How do you remove the Network icon from Gnome GUI?

Posted: 2020/01/12 23:48:52
by neofita2
Can I get rid of the Network icon from the top right in the gnome panel?

Re: How do you remove the Network icon from Gnome GUI?

Posted: 2020/01/16 16:48:21
by djast
I'd like to know that as well, but in the meantime: if your goal is to prevent console users from disabling/reconfiguring network settings, be aware that you'll need to do that through PolicyKit (or else the user will still be able to run "nmcli networking off", etc.)

Not sure whether this is complete and correct, but my current attempt to disallow network and power actions for console users is to create /etc/polkit-1/rules.d/50-disable-actions.rules containing:

Code: Select all

polkit.addRule(function(action, subject) {
    var actionList = [
        "NetworkManager",
        "login1.halt", "login1.power-off", "login1.suspend",
        "login1.hibernate", "login1.reboot",
        "login1.set-wall-message",
        "systemd1",
    ];
    for (i in actionList) {
        if (action.id.indexOf("org.freedesktop." + actionList[i]) == 0) {
            return polkit.Result.NO;
        }
    }
});
This addition doesn't remove the NetworkManager icon from the GUI, but it prevents "Wired Networking" -> "Turn off" from doing anything. It does remove the power icon, though, and I think also disables suspending via the physical power button. (If you only want to disable NetworkManager and not the power actions, you can remove everything except "NetworkManager" from actionList[].)

Hope this helps; if anyone has a more elegant/correct approach, I'd be interested in feedback.