суббота, 12 мая 2012 г.

Conky' various graph' scale parameter

Hello, folks!

At last i have some time and some linux-related stuff that worth of being posted to post.

So, here we go.

The first note is about conky' varios graphs' scale parameter. There are several unanswered topics out there in the www and the conky' official documentation lacks of the information about the proper usage of that parameter too.

OK, what the scale parameter means? The scale of the conky graph is the maximum value of the graph.

Let's look at this example (it's a real config line from my conky setup):

${downspeedgraph eth0 10,20 888888 FF8C8C 2441KiB -l -t}

The first parameter to downspeedgraph - eth0 - is the name of the network interface that looks out to the www through my ISP (Internet Service Provider). eth0 is a 100Mbit connection interface, but my ISP lowers its bandwidth to 20Mbit because of the internet plan i pay for. So, the maximum download speed for eth0 is 20Mbit. Most of ISPs (and, btw, mass storage hardware manufacturing vendors) use decimal bytes instead of binary bytes. Decimal kilobyte (kB) consists of 1000 bytes and binary kilobyte (kibibyte - KiB or KB) consists of 1024 bytes. Most operation systems and software use binary bytes (that is why OSs or file managers show lower capacity of your 3TB HDD). Just like any other normal software, conky uses binary bytes also (at least by default). So to figure out the proper value for the scale parameter 20Mbit (20 decimal megabits) should be converted to binary kilobytes (kibibytes). Using Qalculate it's done by simply typing "20Mbit to kibibyte" and hitting enter. If you do not trust your machine do the math yourself: (20*10^6)/8/1024. Don't know why, but scale should be set strictly in kilo's (KiBs).


That is how to get the proper value for conky' graphs.


Other parameters passed to downspeedgraph:
10,20 - 10 is the height of a graph and 20 is its width.
888888 - is the first color and FF8C8C is the second one.
A graph is drawn from the right to the left. The last measurement is shown at the right side of the graph. When it becomes obsolete it crawls to the left.
If -t switch is not used, then the rightmost measurement is FF8C8C and the leftmost is 888888. Graph' color fades from the second color at the right to the first color at the left.
If -t switch is used, then graph will be  888888 at the bottom and FF8C8C at the top. The higher value is - the more FF8C8C'er it will be.

So, that is pretty much it.


The other article will be all about a eclass i developed to make various game's additives like mods or addons easy to install using portage. Stay tuned and good luck.
xoxoxo

Комментариев нет: