Preface
Goal: Monitoring widget in statusbar using Lain Library.
Using Lain 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 Lain Library
If your distribution does not support lain library,
you can clone Lain
in AwesomeWM configuration directory.
Now you can include the lain
as any other library.
Artefacts
We need additional lain.lua
.
Here I refactor long configuration in separate files,
such as battery
, diskfree
, and sound
.
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.
Where the long lain.lua
configuration itself,
will be refactore into separated files as below:
Do not get intimidated with codes above.
These can be explained step by step.
2: Simple Example: Memory
The best manual for lain is in the wiki,
that you can read in its respective github.
For example this Memory:
However the detail implementation might different from,
one dotfiles to another ricer.
lain.lua
Step by step, the lain.lua
.
Since I have to separate files, I have these objects:
Formatting code is cumbersome, so I made these two shortucts.
Now my code is slightly different
You can read more about mem_now.used
in its wiki.
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 lain.lua
.
CPU
Text Clock
Weather
Network
Battery
File system
ALSA
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 container and margin,
just to show widget progressbar.
Refactoring
For some reason I prefer to separate code so now we have this lines:
Battery Bar
The battery bar itself is battery_bar
widget.
Battery Updating
We utilize lain.widget.bat
as a trigger to update the battery bar.
Disk Free Bar
The diskfree bar itself is disk_bar
widget.
Disk Free Update
We utilize lain.widget.fs
as a trigger to update the diskfree bar.
ALSA Bar
Lain has this alsabar
widget
Now we can configure further
ALSA Update
We do not need. It is handled by Lain.
Helper
Now here is the alsa volume
, disk free
and battery
,
along with other widget
What is Next?
Now that we are done with lain
statusbar,
we can go down with ricing using arrow, lain
widget, and pallete colors.
Consider continue reading [ Awesome WM - Statusbar - Arrow ].