I'd like to write my own widget that display wireless signal strength. nm-applet
displays the strength on its icon (here it's between zero and four bars, but I believe that's dependant on the GTK theme). Where does it get its data from?
1 Answer
It'll be getting it from the same place as iwconfig:
$ iwconfig wlan0
wlan0 802.11bgn ESSID:"Jencorp Intersplice" Nickname:"rtl8191SEVA2"
Mode:Managed Frequency=2.422 GHz Access Point: 62:91:F5:71:27:E7
Bit Rate=21.5 Mb/s
Retry:on RTS thr:off Fragment thr:off
Power Management period:0us mode:All packets received
Link Quality=74/100 Signal level=-61 dBm Noise level=-107 dBm
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:0 Invalid misc:0 Missed beacon:0
See the Link Quality and Signal level line?
If you want to do it lower level than calling iwconfig and parsing the output then I suggest you look at the source code to iwconfig.
/proc/
- its a nice little place to poke your head in if you're feeling curious.