Xfce Forum

Sub domains
 

You are not logged in.

#1 2024-03-06 14:33:17

Hoomer70
Member
Registered: 2024-03-04
Posts: 5

Plugin for network control on/off?

Hello, is there a plugin for the XFCE desktop or for the bar to activate/deactivate the network?
Unfortunately, I have not been able to find one so far.

Many thanks for help in advance.

Offline

#2 2024-03-06 17:02:28

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,485

Re: Plugin for network control on/off?

What do you use to manage your network?

If its NetworkManager, you can use the nmcli utility to disable and enable your network card. For example:

$ nmcli dev
DEVICE         TYPE      STATE                   CONNECTION 
wlan0          wifi      connected               xxxxxx   
lo             loopback  connected (externally)  lo         
p2p-dev-wlan0  wifi-p2p  disconnected            --         
enp0s31f6      ethernet  unavailable             --    

..."wlan0" is my device.

nmcli dev down wlan0

...disables it and:

nmcli dev up wlan0

...enables it.

As for Xfce tools, you could use a launcher script, the genmon plugin, or the wavelan plugin.

For the wavelan plugin, change the value of the "Wifi Manager Command" to:

sh -c "[[ "$(nmcli dev status | grep ^wlan0 | awk '{print $3}')" == "disconnected" ]] && nmcli dev up wlan0 || nmcli dev down wlan0"

...change "wlan0" to your specific device name. That command is executed when you click on the plugin icon and will basically toggle the up/down status of your network device.

You can do something similar with a launcher or the genmon plugin.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#3 2024-03-06 19:01:33

eriefisher
Member
From: ON, Canada
Registered: 2008-10-25
Posts: 528

Re: Plugin for network control on/off?

Assuming NetworkManager and the applet in the system tray, right click on the icon and uncheck "Enable Networking" or "Enable Wifi".


Siduction
Debian Sid
Xfce 4.18

Offline

#4 2024-03-06 23:31:02

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,485

Re: Plugin for network control on/off?

eriefisher wrote:

Assuming NetworkManager and the applet in the system tray, right click on the icon and uncheck "Enable Networking" or "Enable Wifi".

I might have a tendency to over-complicate things.....


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#5 2024-03-06 23:33:50

eriefisher
Member
From: ON, Canada
Registered: 2008-10-25
Posts: 528

Re: Plugin for network control on/off?

ToZ wrote:
eriefisher wrote:

Assuming NetworkManager and the applet in the system tray, right click on the icon and uncheck "Enable Networking" or "Enable Wifi".

I might have a tendency to over-complicate things.....

Haha! But you understand the inner workings better than anybody.


Siduction
Debian Sid
Xfce 4.18

Offline

#6 2024-03-07 15:25:47

Hoomer70
Member
Registered: 2024-03-04
Posts: 5

Re: Plugin for network control on/off?

Thank you in advance for your comments. I'm a bit stressed at the moment.
I will have to take a closer look and then get back to you.

Offline

Registered users online in this topic: 0, guests: 1
[Bot] ClaudeBot

Board footer

Powered by FluxBB
Modified by Visman

[ Generated in 0.014 seconds, 9 queries executed - Memory usage: 535.74 KiB (Peak: 536.59 KiB) ]