Age | Commit message (Collapse) | Author |
|
|
|
Since different locales support different date formats, this allows
specification of the locale for a given time/date instance, rather than
setting the locale for the entire program instance and affecting all
other instances.
Note that this probably will not have much of an effect unless the
default `fmt` value is overridden (try `%c` for fun).
|
|
|
|
Previously it was assumed that this was not needed, as the program
executes in an infinite loop. However, for best practices, this cleans
up all memory usage on program exit should the program actually exit.
|
|
|
|
The sysinfo call does no provide a value for cached memory, so the
overall memory usage displayed by this is far too high most of the time.
This implements a new struct, `_meminfo`, which holds the relevant
values from `/proc/meminfo` so actual usage metrics can be more
accurately calculated. This also adds a new function, `_meminfo_read`,
to support this.
|
|
|
|
|
|
The config_date code is effectively identical to the code for
config_time. The one difference is the format of the date output.
This replaces all of the config_date code, except for the init function,
with referenes to the config_time code to reduce and simplify
maintenance. This also adds the new configurable fmt support to the date
class as well, since it is now just config_time.
|
|
|
|
This key allows the time format to be configurable. The default is '%T',
but some users may not want the seconds or may want additional
information.
|
|
|
|
|
|
Previously this module would cause i3cstat to segfault if no swap was
enabled (like in my case where I selectively enable zram swap devices as
needed). This adds an early return if total swap is 0 (which previously
resulted in a divide by 0 when this case came up), setting the "value"
to "none" with color yellow.
|
|
Subtract bufferram also from totalram to better calculate used ram
(since buffer is fluid and doesn't represend actually "used" memory).
|
|
|
|
The meminfo is read and parsed as a file, which is complex and prone to
breakage. The sysinfo library is part of the system and requires no
parsing, so is much more reliable (and gives more granular numbers as
well).
|
|
|
|
Previously printbar wasn't correctly calculating data width. The fill of
bars included the surrounding brackets (so a width of 10 was actually 8
+ 2 brackets). This makes the fill width the defined with, +2 extra
chars for the square bracket. This makes the fill calculations accurate
now.
|
|
|
|
Previously, each module defined its own width for the bar (typically 12
wide), should the output be bar format.
This introduces a config_node level configuration "width". This
configuration is ignored unless display == bar in the config for the
given module. This width configurations allows the width of each module
bar to be configured by the user without requiring modification of
source and recompiling of the app.
|
|
|
|
|
|
|
|
This adds a new config section titled "swap". It configures the same way
as the memory config entity.
|
|
|
|
This node block supports calling out to a shell program for a custom
status section. It reads the first line of stdout from whatever is
called.
|
|
This allows the user to specify run intervals for each configured module
in seconds. The purpose of this is for the modules that the user may not
want running on every load cycle, so they can specify to run less
frequently (minimum resolution is 1 second). Running less frequently on
more cpu intensive operations can save power and reduce unecessary
processing (such as checking free space on storage, which doesn't update
often).
|
|
This was previously printing too much whitespace. It was also doing a
strlen comparison to determine where to write the label text, but it
always resolved to index 0, so is not needed.
|
|
|
|
Labels for the fs node type were previously being written when the load
function was called. Now we set this on initial config load and do not
override on data load.
|
|
This includes support for printing battery, cpu, filesystem, memory,
time, and date sections. Sections with percentage values also support
the `display = bar` configuration to make them display a bar rather than
the actual percent. Finally, for relevant data types, colors change from
green to red as percentage approaches appropriate levels (eg: when
memory is high, color is red; when battery is low, color is red,
otherwise green).
|