6 bpm
=1048576 # 1024*1024
7 up_interfaces
=$
(ifconfig |
grep "UP,BROADCAST,RUNNING" |\
8 sed 's/://' |
awk '{print $1}')
19 OpenBSD
) up_type
=$
(ifconfig
$1 |
grep "groups" |
awk '{print $2}') ;;
24 if [[ "$up_type" == "wlan" ]]; then
27 wifi_ssid
=$
(iw dev
$1 link |
grep SSID | cut
-d " " -f 2-)
28 wifi_strength
=$
(grep "^\s*w" /proc
/net
/wireless |\
29 awk '{print int($3 * 100 / 70) "%"}')
30 ssid_strength
='\n'$wifi_ssid' '$wifi_strength;;
32 OpenBSD
) ssid_strength
=$
(echo "$int" |
grep join |\
33 awk '{print "\n"$3"\t"int((-0.0154*$8*$8)-(0.3794*$8)+98.182)"%"}');;
40 for each_interface
in $up_interfaces; do
43 cat /sys
/class
/net
/$each_interface/statistics
/rx_bytes
);;
44 OpenBSD
) total_in
=$
(netstat
-b -I $each_interface |\
45 egrep "[0-9]{2}:" |
awk '{print $5}');;
47 check_type
$each_interface
49 egress
) icon
=$other_icon ;;
50 wlan
) icon
=$wifi_icon ;;
51 eth
) icon
=$eth_icon ;;
52 *) icon
=$other_icon ;;
54 in_sum
=$
(($total_in / $bpm))
55 result
+=$icon' '$in_sum' '
61 for each_interface
in $up_interfaces; do
62 int
=$
(ifconfig
$each_interface)
63 ip
=$
(echo "$int" |
grep 'inet ' |
awk '{print $2}')
64 check_type
$each_interface
65 get_ssid_strength
$each_interface
66 result
+="$up_type\t($each_interface)$ssid_strength\n$ip\n\n"
68 notify-send
"Network details" "$result"
72 notify
) notify_status
;;