Network_tray

The last version of network_tray, used in Wary 030 I think, was version 2.3.2.

I have made some significant improvements. Firstly, the "Tx" and "Rx" (transmitted and received) counts were previously only shown in MB, which is not so good initially when the figures are below 1MB. I have now changed it to display in KB when less than 1MB.

The second change is the handling of mouse button clicks on the network tray icon.

Left button:
When there is no network connection, this runs the 'defaultconnect' script. Otherwise, 'ipinfo' is run.

Right button:
Displays a dynamic menu. The choices are:
"Setup networking"
"Network status information"
If there is an active network, then there is also this menu entry:
"Disconnect from network"
And having disconnected, there is then this:
"Reconnect to network"

The new version is 2.4 and the source is here:
http://bkhome.org/sources/alphabetical/n/

Note that reconnection does not work quite right in the case of SNS. The disconnect/reconnect operation is performed via
/usr/local/apps/Connect/AppRun --connect|--disconnect
and the case of SNS that in turn launches
/usr/local/simple_network_setup/rc.network start|stop
...I will be further investigating this.


Posted on 2 Jul 2010, 22:47


Comments:

Posted on 3 Jul 2010, 10:17 by BarryK
Network_tray 2.4.1
Bumped to version 2.4.1.

There was a problem with icon not updating when I did network disconnect/reconnect operations via the network_tray popup menu.



Posted on 3 Jul 2010, 13:04 by ecube
Network_tray
Barry,
I note that the IP Info screen is launched both by left and right click. I suggest that the response to left click is replaced by the attached little script with the "No IP-address found" and your "Note: right click ..." splash screens merged
Keep up the good work.
Olov
#!/bin/sh

IP=`ifconfig`; IP=${IP#* inet addr:}; IP1=${IP%% *}; FOUND=false
if [ "$IP1" = "127.0.0.1" ]
then
IP=${IP#* inet addr:}; IP1=${IP%% *}
if [ "$IP1" = "127.0.0.1" ]; then
yaf-splash -timeout 3 -font "9x15B" -outline 0 -margin 4 -bg orange -placement bottom -text "No IP-address found"
else
FOUND=true
fi
else
FOUND=true
fi
if $FOUND; then
yaf-splash -timeout 3 -font "9x15B" -outline 0 -margin 4 -bg cyan -placement bottom -text "$IP1"
fi

#



Posted on 3 Jul 2010, 15:48 by BarryK
network_tray left-click
No, left-click only runs ipinfo if there is a valid network interface. It ignores interface "lo".



Posted on 3 Jul 2010, 16:25 by ecube
network_tray left-click
My script also ignores interface "lo". Try it!
Olov


Posted on 4 Jul 2010, 4:45 by ecube
network_tray left-click
Barry,

To substitute the IPinfo window by a splash display showing just the ipaddress, replace the IPinfo call (in network_tray.c) by a call to pip0
    if (flagactive == 0)system("defaultconnect & ");


else {
system("pip0");
system("yaf-splash -placement bottom -bg purple -timeout 10 -text 'right-click icon for network menu' & ");
}

No "lo" interface shows up.

The pip0 is the previous script with the text "No-IP-adress found" removed.


#!/bin/sh
IP=`ifconfig`; IP=${IP#* inet addr:}; IP1=${IP%% *};
if [ "$IP1" = "127.0.0.1" ]
then
IP=${IP#* inet addr:}; IP1=${IP%% *}
if [ "$IP1" = "127.0.0.1" ]; then
FOUND=false
else
FOUND=true
fi
else
FOUND=true
fi
if $FOUND; then
yaf-splash -timeout 3 -font "9x15B" -outline 0 -margin 4 -bg cyan -placement bottom -text "$IP1"
fi

If you feel that the original network_tray version is better I will, of course, accept that. The reason for this comment is only that I don't understand the reason for your "No".
Regards,
Olov



Posted on 4 Jul 2010, 8:35 by BarryK
Re "no"
Well, it needs to be seen in actual operation first. There are also modifications to SNS. Spup 0.3 has these changes.