SliTaz SliTaz Forum

You are not logged in.

#1 2011-05-20 12:39:16

Filou
Moderator
Registered: 2011-05-03
Posts: 256

Changing Device for lxpanel network monitor plugin (netstat)

Does anyone know a possibility to change the relevant device for the lxpanel network monitor plugin BY SHELL SCRIPT?

I know the plugin data is stored in ~/.config/lxpanel/default/panels/panel

but simply changing the iface value in

Plugin

{

type=netstatus [...]

won't do the trick because of necessity of a lxpanel restart, which seems to create some difficulties (killing lxpanel and restarting with lxpanel & seems to mess up and shouldn't be the shortest way).

Since bringing up the connection details by clicking the netstat icon and changing the given device works on the plugin immediately there seems to be another instance of the value... but where?!?

The reason for this question is that I use my netbook at home using wlan as well as using a 3G-Stick. Bringing up the 3G by script works like a charm, only the network monitor won't show me the connection as long as I don't manually change the device...

Thanks for support....

Offline

#2 2011-05-20 14:14:00

gibor
Moderator
Registered: 2011-04-30
Posts: 1,067

Re: Changing Device for lxpanel network monitor plugin (netstat)

I do not know if I understand your problem I have two netstatus right click panel preference panel applet + add net status monitor,

then select Status monitor edit set the net device wlan0 wlan1 pppoe .... etc,

sorry my English is powered google translate[attachment=1186,31]

Offline

#3 2011-05-20 14:18:00

pankso
Administrator
Registered: 2026-06-27
Posts: 341
Website

Re: Changing Device for lxpanel network monitor plugin (netstat)

Hi,

Have a look to your Openbox autostart script, it should have:

# update lxpanel config

#sed -i "s/iface=.*/[c]grep \"iface=\" /etc/lxpanel/default/panels/panel[/c]/" \

#    ~/.config/lxpanel/default/panels/panel

Wich will do the trick if uncommented since the main lxpanel config is updated by boot scripts.

Offline

#4 2011-05-20 21:33:00

Filou
Moderator
Registered: 2011-05-03
Posts: 256

Re: Changing Device for lxpanel network monitor plugin (netstat)

I think I didn't manage to detail my question clear enough...

Thanks, pankso, for your advice. But the openbox autostart configures the netstat plugin value during openbox startup. For this, my default value /dev/wlan0 is just fine.

For 3G usage, I plug in my 3G-USB-modem, udev executes the modeswitch and inserts a usbserial.

Then, as soon as I want to start a connection, I start another shell script that provides the necessary wvdial info (depending on the SIM-card used) and wvdial starts the pppd. Everything's fine except that netstat still shows that wlan0 (default) has no connection (which is correct).

What I want to do is change the device netstat is showing to ppp0 with a command in my shell-script.

Since changing the value in the Network status monitor windows, as shown by gibor, has direct influence on the shown interface, I suppose there might be a possibility (for example using sed) to change it via script... ?!?

Thanks for your time and support!

Offline

#5 2011-05-21 16:55:45

Filou
Moderator
Registered: 2011-05-03
Posts: 256

Re: Changing Device for lxpanel network monitor plugin (netstat)

... so what I want to do is change the displayed netstat device via command line while the application/plugin is running.

Another possibility might be to refresh lxpanel somehow (like if another application is added to /usr/share/applications)...

Offline

#6 2011-05-21 17:42:18

gibor
Moderator
Registered: 2011-04-30
Posts: 1,067

Re: Changing Device for lxpanel network monitor plugin (netstat)

If you have two icons one a wlan0 and ppp0 try to create the script.

I (at / home / tux / .config / lxpanel / default / panels / panel is the file that contains setup) I tried to edit while running but the icon does not automatically switch only when you logout xserver

good luck

Offline

#7 2011-05-21 17:54:57

Filou
Moderator
Registered: 2011-05-03
Posts: 256

Re: Changing Device for lxpanel network monitor plugin (netstat)

Yes, that's just the point. I CAN edit ~/.config/lxpanel/default/panels/panel, even by script. But the icon doesn't change then.

If I had any command to refresh either netstat plugin or maybe whole lxpanel that'd be a solution (-> change the value, refresh and be gone).

Since a change via Network Status Monitor window (see your screenshot above) does the trick, there will be a chance; it's just the question if I can trigger this via shellscript. (might be a c++ routine inside Network status monitor or anything...)

The Xserver logout is equivalent to a refresh of lxpanel, so that might do the trick too...

Offline

#8 2011-05-21 20:04:40

gibor
Moderator
Registered: 2011-04-30
Posts: 1,067

Re: Changing Device for lxpanel network monitor plugin (netstat)

refresh (stop and restart) you get from the command line with

killall lxpanel

lxpanel &

Offline

#9 2011-05-21 21:46:06

Filou
Moderator
Registered: 2011-05-03
Posts: 256

Re: Changing Device for lxpanel network monitor plugin (netstat)

Yes, that's the "brutal" way of a refresh that I wanted to avoid (tried to express that in my first post), because it seemingly had messed around with my system.

Nonetheless since I found no other way yet I added those lines to my script:

sed -i 's/\(iface=*\).*/iface=ppp0/' ~/.config/lxpanel/default/panels/panel

killall lxpanel

lxpanel &

and it works. Thanx, gibor, for bringing me to reason...

Offline

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

Board footer

Powered by FluxBB
Modified by Visman

[ Generated in 0.018 seconds, 8 queries executed - Memory usage: 1.55 MiB (Peak: 1.77 MiB) ]