site  contact  subhomenews

Network_tray

July 02, 2010 — BarryK
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.

Comments

Network_tray 2.4.1
Username: BarryK
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. Username: 3 Jul 2010, 10:17
"01690"114.129.167.148'Network_tray"ecube"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 [code]#!/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[/code] # Username: 3 Jul 2010, 13:04
"01690"84.217.243.93'network_tray left-click"BarryK"No, left-click only runs ipinfo if there is a valid network interface. It ignores interface "lo". Username: 3 Jul 2010, 15:48
"01690"114.129.167.148'network_tray left-click"ecube"My script also ignores interface "lo". Try it! Olov"3 Jul 2010, 16:25"01690"84.217.243.93'network_tray left-click"ecube"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 [code] if (flagactive == 0)system("defaultconnect & "); else { [b]system("pip0");[/b] system("yaf-splash -placement bottom -bg purple -timeout 10 -text 'right-click icon for network menu' & "); }[/code] No "lo" interface shows up. [code]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 [/code] 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 Username: 4 Jul 2010, 4:45
"01690"84.217.243.93'Re "no""BarryK"Well, it needs to be seen in actual operation first. There are also modifications to SNS. Spup 0.3 has these changes. Username: 4 Jul 2010, 8:35
"01690"114.129.167.148'

Tags: puppy