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: 12,537

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.


Mark solved threads as [SOLVED] to make it easier for others to find solutions.
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

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

eriefisher
Wanderer
From: ON, Canada
Registered: 2008-10-25
Posts: 934

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".


But it's all right, when you're all in pain and you feel the rain come down
It's alright, when you find your way, then you see it disappear
It's alright....
Chris Cornell

Offline

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

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 12,537

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.....


Mark solved threads as [SOLVED] to make it easier for others to find solutions.
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

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

eriefisher
Wanderer
From: ON, Canada
Registered: 2008-10-25
Posts: 934

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.


But it's all right, when you're all in pain and you feel the rain come down
It's alright, when you find your way, then you see it disappear
It's alright....
Chris Cornell

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.019 seconds, 7 queries executed - Memory usage: 529.44 KiB (Peak: 530.41 KiB) ]