8 bpm
=1048576 # 1024*1024
9 up_interfaces
=$
(ifconfig |
grep "UP,BROADCAST,RUNNING" |\
10 sed 's/://' |
awk '{print $1}')
21 OpenBSD
) up_type
=$
(ifconfig
$1 |
grep "groups" |
awk '{print $2}') ;;
26 if [[ "$up_type" == "wlan" ]]; then
29 wifi_ssid
=$
(iw dev
$1 link |
grep SSID | cut
-d " " -f 2-)
30 wifi_strength
=$
(grep "^\s*w" /proc
/net
/wireless |\
31 awk '{print int($3 * 100 / 70) "%"}')
32 ssid_strength
='\n'$wifi_ssid' '$wifi_strength;;
34 OpenBSD
) ssid_strength
=$
(echo "$int" |
grep join |\
35 awk '{print "\n"$3"\t"int((-0.0154*$8*$8)-(0.3794*$8)+98.182)"%"}');;
44 for each_interface
in $up_interfaces; do
47 # cat /sys/class/net/$each_interface/statistics/rx_bytes);;
48 # OpenBSD) total_in=$(netstat -b -I $each_interface |\
49 # egrep "[a-z0-9]{2}:" | awk '{print $5}');;
51 check_type
$each_interface
53 egress
) icon
=$other_icon ;;
54 wlan
) icon
=$wifi_icon ;;
55 eth
) icon
=$eth_icon ;;
56 *) icon
=$other_icon ;;
58 # in_sum=$(($total_in / $bpm))
59 # result+=$icon' '$in_sum' '
66 for each_interface
in $up_interfaces; do
67 int
=$
(ifconfig
$each_interface)
68 ip
=$
(echo "$int" |
grep 'inet ' |
awk '{print $2}')
69 check_type
$each_interface
70 get_ssid_strength
$each_interface
71 result
+="$up_type\t($each_interface)$ssid_strength\n$ip\n\n"
73 notify-send
"Network details" "$result"
77 [ "$(uname)" = "Linux" ] && ifconfig |
grep -A1 "$up_interfaces" |
awk '/inet/ {print $2}'
78 [ "$(uname)" = "OpenBSD" ] && ifconfig |
grep -A7 "$up_interfaces" |
awk '/inet/ {print $2}'
82 notify
) notify_status
;;