File: monWIFI

package info (click to toggle)
xfce4-genmon-plugin 4.3.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 932 kB
  • sloc: ansic: 1,273; sh: 314; makefile: 129; perl: 21
file content (22 lines) | stat: -rwxr-xr-x 847 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/bash

# An example script for the genmon plugin displaying information on the Wireless connection

# Change eth1 to your Wifi interface

echo "<img>/usr/local/share/icons/Tango/16x16/devices/network-wireless.png</img>"

res1=$(/sbin/ifconfig eth1 | grep inet)
res2=$(/sbin/iwconfig eth1 | grep unassociated)
if [ -z "$res2" ] && ! [ -z "$res1" ]
then
  echo "<txt>"$(/sbin/iwconfig eth1 | grep "Link Quality" |cut -d "=" -f 2 |cut -d "/" -f 1)"%</txt>"
  echo "<tool>Essid: "$(/sbin/iwconfig eth1 | grep "ESSID" |cut -d "\"" -f 2)
  echo "Signal Level: "$(/sbin/iwconfig eth1 | grep "Signal level" |cut -d "=" -f 3)"</tool>"
  echo "<bar>"$(/sbin/iwconfig eth1 | grep "Link Quality" |cut -d "=" -f 2 |cut -d "/" -f 1)"</bar>"
else
  echo "<txt>--%</txt>"
  echo "<tool>Essid: ???"
  echo "Signal Level: ???</tool>"
  echo "<bar>0</bar>"
fi