Preface
Goal: Monitoring widget in statusbar using Vicious Library.
Using Vicious Library, we can manage monitoring widget, in statusbar.
Table of Content
1: Prerequisite
rc.lua
Put the statusbar code at the end of the rc.lua
,
and comment other statusbar.
Prerequisite: The Vicious Library
If your distribution does not support lain library,
you can clone Vicious
in AwesomeWM configuration directory.
Now you can include the vicious
as any other library.
Artefacts
We need additional vicious.lua
.
So now we need at least four lua files.
Arrow Decoration
This part can be skipped,
but I put it here anyway,
just in case anyone looking for it
Code Preview
For you impatient folks out there,
here I represent, all modules that we are going to use.
Do not get intimidated with codes above.
These can be explained step by step.
2: Simple Example: Memory
The best manual for vicious is the README.md,
that you can read in its respective github.
For example this Memory:
However the detail implementation might different from,
one dotfiles to another ricer.
vicious.lua
Step by step, the vicious.lua
.
Since I have to separate files, I have these objects:
Formatting code is cumbersome, so I made these two shortucts.
Registering Memory
Now my code is slightly different
Helper
As usual we put WB
object
Icon
If you wish, you can add eye candy icon,
just like shown in the figure above.
From icons.lua
in theme directory.
And finally the helper
3: More Standard Example
With those arrangement above we can setup more widget.
Step by step, the vicious.lua
.
Network
Date
Battery
Memory
CPU
HDD Temperature
Music Player Daemon
Example One
Consider show the wdiget above in this example below:
Example Two
Or this example below:
This is a little bit harder, since we should dive into Awesome documentation.
Official Vicious Documentation
Consider refer to official document first in README.md.
Custom Vicious
My customization is basically just a copy paste of above example.
It is pretty explanatory how the color change,
from red to yellow in the middle and stop to blue at the right most.
And so is the memory, we can use smoother color.
If you do not like the color,
just remember that this is just an example.
I know I suck at aestethic aspect sometimes.
Helper
Now here is the graph_cpu
and graph_mem
,
along with other widget
Luckily Awesome is so rich with Widget customization possibility.
I must admit I still don not understand most of them.
One of the is progressbar
.
Custom Vicious
However this is an example that I can share so far:
And the CPU:
We do not need to cache, because we have already cached it in left wibox.
Helper
Now here is the progress_cpu
and progress_mem
,
alone without any other widget.
What is Next?
Now that we are done with vicious
statusbar,
we can learn about more interesting library called lain
.
Consider continue reading [ Awesome WM - Statusbar - Lain ].