I had a problem with displaying wifi signal strength and IP in conky (though downloaded and uploaded amounts and DL/UP bitrates were getting displayed). I use a Dell Studio 1535 laptop with a broadcom wireless adapter (BCM4312). After googling for a while and being unable to find a solution, I thought it might be beneficial to share my experience of resolving this problem. It's worth to mention that I use Linux Mint 15 64 bit, which is based on Ubuntu (repositories and everything), therefore I think this must apply to Ubuntu as well.
There were 2 issues: conky permissions, and network interface (NIC) name. The short summary is:
run this command to give Conky the needed permissions:
Rename your wireless NIC from eth1 to wlan0. Here is how.
Why?
Some people had suggested (in their websites) that the problem might be with the boradcom wireless adapter, which blocks conky request to get the adapter's info, but since the command-line tool iwlist was able to get the list of wireless networks in my neighborhood, I doubted that blocking requests would be the issue, though another command line tool iwspy was unable to get info.
You can get a detailed list of wireless networks in your neighborhood using the command-line tool iwlist:
Indeed, one of the issues was this lack of having appropriate root user priviledges. Apparently, Conky needs to have root priviledges to access network libraries and functionalities. If you don't want to run conky with root priviledges, there is a way (since Linux kernel 2.2) to give programs the priviledges they need without running them under root priviledges. You can give any program (its executable binary file) partial root priviledges for performing specific functionalities (eg. network functionalities, filesystem functionalities, etc). This is fully explained in this man page, and partially here. So, we need to delegate (to Conky's binary file) the appropriate root priviledges to perform network-related tasks and to capture raw packets from wire/wireless adapter. In other words, tasks are categorized into different categories of priviledges. Two of these access categories (which conky needs them) are called cap_net_admin and cap_net_raw. We need to give conky these classes of permission. This is done by the following command (source: here):
In addition to this permission issue, a reply to a topic gave me a clue that the name of my network interface card (NIC) (in this case my wireless adapter) might be the source of the problem, since conky "assumes" that the interface names starting with "eth" (eth1, in my case) are ethernet (cable) network cards and thus, these cards are not supposed to represent signal strength. Although the clue was very precious, but no solution was offered there in the above-mentioned topic. I thought renaming the interface may resolve the problem, and indeed it did! I renamed wireless interface (which was named eth1 by default) to wlan0. Here, you can find how to rename a network interface card in Linux. Just note that in that article, they renamed the interface to "wan0", I renamed it to wlan0.
And here is the network part of my .conkyrc config file:
And finally here is some extra commands for displaying and removing capabilities (partial and categorized root priviledges) of (executable/binary) files:
You can find out the permissions that each file has by running the following command:
And remove all permissions (capabilities) of a file:
By the way, just in case someone didn't notice and if this can help: Don't forget to remove any slashes after
wlan0
in the.conkryc
file. Examples:If no one has any slashes after
wlan0
, then no problem, but I had to remove the slashes in my.conkyrc
file or else Conky wouldn't show the networkupspeedf
(similarly, fordownspeedf
) - even after following Metallica's post.Here is what I did to solve the problem: first I got my wireless adapter name using this command:
My wireless adapter name is
wlp2s0
So I changedwlan0
towlp2s0
and problems solved.you can follow main thread here.
I am using Lubuntu 16.04