Announcement

Collapse
No announcement yet.

Disable network "disconnect button" in kde ubuntu

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    [Internet] Disable network "disconnect button" in kde ubuntu

    Is there any way to disable network "disconnect button" in kubuntu KDE, or hide it? Can't find any information or resolution to make this happen. Has anyone done this? Is it possible to simply deactivate it or make it inactive?

    SCREEN - https://drive.google.com/file/d/1JcF...ew?usp=sharing

    #2
    I don't see anything obvious in terms of configurations, so I'm going to assume that you could do that by modifying the source code and recompiling. Other than that, it looks like "disconnect" is just a normal feature of the application.

    Is there some reason why "disconnect" is not desirable? I find it useful, on occasion, such as turning off the connection when running a backup.
    The next brick house on the left
    Intel i7 11th Gen | 16GB | 1TB | KDE Plasma 5.27.11​| Kubuntu 24.04 | 6.8.0-31-generic



    Comment


      #3
      No, there isn't.
      Disconnecting.....deactivates the connection, makes the connection inactive.
      But I am not exactly sure what you want to do, really. What is wrong with being able to connect or disconnect?

      Comment


        #4
        Originally posted by claydoh View Post
        No, there isn't.
        Disconnecting.....deactivates the connection, makes the connection inactive.
        But I am not exactly sure what you want to do, really. What is wrong with being able to connect or disconnect?
        Hi there! We have several dozen computers running Kubuntu that are used by students. Each student has their own local account, which allows them to authenticate on any computer. Sometimes students press the disconnect button and then log out of their account. However, they cannot authenticate on a computer without internet connection. Therefore, there is a request to hide this button.

        Comment


          #5
          You would have to lobby the Plasma developers to create such an option, I think.
          But probably an easier/simpler solution is to have the connection automatically connect , and to be available to all users.
          This makes sure the wired connection is up and connected during boot, before anyone logs in, so at worst a reboot may be needed.

          Click image for larger version  Name:	Screenshot_20240620_063856.jpg Views:	0 Size:	27.5 KB ID:	680714

          There is also Kiosk framework that might be used to prevent being able to disconnect, though this seriously lacks good documentation.
          I don't see anything that might prevent users from disconnecting from the network.

          https://develop.kde.org/docs/adminis.../introduction/
          https://develop.kde.org/docs/administration/kiosk/
          https://develop.kde.org/docs/administration/kiosk/keys/

          This can be useful for locking down other things, if needed.

          (and why would they take the extra step to disconnect before logging out or shutting down to begin with? Well, yes, I can come up with a reason or two just on being annoying jerks , as well as attempting to connect to an external wifi or tether with a mobile device)

          I did forget that PolicyKit can be used for your purpose, though I have zero idea oin how to set it up.
          https://askubuntu.com/questions/1437...rk-connections
          https://unix.stackexchange.com/quest...rk-connections

          You can also have networkmanager NOT manage the ethernet connection, so the users can't enable/disable it at all. But that probably requires the connection to be set up and enabled 'manually' via startup scripts.

          Or hide the systray network icon and use kiosk to restrict access to to the tray settings.
          Last edited by claydoh; Jun 20, 2024, 06:02 AM.

          Comment


            #6
            Couldn't the OP just edit /usr/share/kcm_networkmanagement/qml/ConnectionItem.qml and comment this section:

            Code:
                   QQC.MenuItem {
                        text: ConnectionState == PlasmaNM.Enums.Deactivated ? i18n("Connect") : i18n("Disconnect")
                        visible: ItemType == 1
                        onTriggered: {
                            if (ConnectionState == PlasmaNM.Enums.Deactivated) {
                                handler.activateConnection(ConnectionPath, DevicePath, SpecificPath);
                            } else {
                                handler.deactivateConnection(ConnectionPath, DevicePath);
                            }
                        }
                    }​
            This would remove the button, and of course, prevent being able to connect to a network via the widget; one would have to use another tool (command line?) to manage network connections.
            Windows no longer obstructs my view.
            Using Kubuntu Linux since March 23, 2007.
            "It is a capital mistake to theorize before one has data." - Sherlock Holmes

            Comment


              #7
              It would likely be overwritten with each Plasma update.and distro release upgrade
              Not frequently mind you, but more than zero.

              Also one can disconnect from system settings as well., which isn't that hard to find.

              Comment

              Working...
              X