Age | Commit message (Collapse) | Author |
|
The following commit:
6a75ea9 Show IP address when address has a label
introduced a way to show the IP address of an interface when a label is
associated to the IP.
When a label is associated to an IP, the structure returned by
getifaddrs() has the label concatenated to the interface name in the
.ifa_name field as in the following example:
struct ifaddrs ifaddr = {
.ifa_name = "eth0:mylabel",
};
As a consequence, using a strict comparison between the interface name
and the .ifa_name field yields a falsy result. However, checking if the
.ifa_name starts with the interface name (e.g. eth0) does not work
either because other network interfaces can have a name which starts
with eth0.
This commit solves the issue by stripping out the optional label from
the .ifa_name field before making a strict comparison with the interface
name.
Fix #283
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
|
|
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
|
|
initial support of memory-usage for linux
|
|
|
|
|
|
|
|
|
|
Fix NULL value on OpenBSD when there is no acpitz0
|
|
Using %degrees on OpenBSD resulted in garbage values if sysctl doesn't
know about any cpu temperature sensors.
|
|
If an address has been added with a label, ensure the correct address is
shown.
|
|
|
|
Remove overly aggressive #error
|
|
On some hardware the AUDIO_MIXER_READ ioctl requires the current number
of channels to be set, and the mute device found needs to be checked if
it belongs to the master output device.
|
|
|
|
`print_battery_info` computes `batt_info.percentage_remaining` by
dividing batt_info.remaining by `full`. If `full` is `0` then the
battery remaining will be reported as "inf".
Before this, it tries to set `full` to either the design capacity or to
the last known good charge. It determines if these values are available
by checking whether their fields in `batt_info` are non-negative. As it
initialized `batt_info` with values of `-1`, a non-negative value
implies that something has provided a value.
`slurp_all_batteries` and `add_battery_info` however initialize these
fields to zero, so if these functions are called then
`batt_info.full_design` will always be used.
This means that on systems that don't provide a value for design
capacity the percentage remaining will be reported as "inf", unless the
user has set `last_full_capacity` to `true` in their `i3status.conf`.
This patch changes `print_battery_info` to expect values for the battery
capacity to be strictly greater than zero. This seems reasonable as a
battery with a capacity of zero isn't useful.
An alternative solution would be to change `slurp_all_batteries` and
`add_battery_info` to initialize `batt_info` with `-1`, as
`print_battery_info` does. This is less appealing as `add_battery_info`
is accumulating the values, so using `-1` would introduce off-by-one
errors without additional code to avoid them.
|
|
|
|
|
|
|
|
Change-Id: I8c20606d386d713cac51b620d1fcdb479a3622fe
|
|
|
|
|
|
Add check for virtual ethernet devices
|
|
The Linux power supply class defines three entries to provide battery status.
One of them wasn't used: POWER_SUPPLY_CAPACITY.
https://www.kernel.org/doc/Documentation/power/power_supply_class.txt
|
|
Added braces to the if-statement as requested.
|
|
The orignal proposed code had a memory leak when returning true.
Furthermore I included the handy BEGINS_WITH macro of i3 which makes the
code (IMHO) a lot more readable.
|
|
The _first_ option for ethernet devices now uses the link in sysfs to determine
if it's a real device or just a virtual one (i.e veth** devices created by docker).
|
|
This change addresses the issue #199 asking for multiple CPU support. It
takes an arbitrary CPU number and outputs its usage using the same
arithmetics as for CPU aggregation. It currently doesn't support
FreeBSD.
|
|
|
|
remove useless checks (we use char, not unsigned char)
|
|
fixes compilation warnings
|
|
fixes #200
|
|
Plug an fd leak in the OpenBSD-specific code for _first_
|
|
|
|
estimate only has a granularity of minutes.
From tb@openbsd.org
|
|
Change from ceiled value to floored value to be consistent with the
FreeBSD kernel
https://svnweb.freebsd.org/base?view=revision&revision=300421
|
|
- use a define for loopback interface device
- use an approach similar to ifconfig(8) for determining device type
|
|
Fixes a compilation error:
/usr/include/net80211/ieee80211_ioctl.h:339: warning: implicit declaration of function 'howmany'
/usr/include/net80211/ieee80211_ioctl.h:339: error: 'NBBY' undeclared here (not in a function)
/usr/include/net80211/ieee80211_ioctl.h:339: error: variably modified 'nr_rxmcs' at file scope
|
|
Add 'format_above_threshold' option for 'cpu_temperature' module
Add 'format_above_threshold' option for 'cpu_usage' module
Add 'format_above_threshold' option for 'load' module
|
|
|
|
To be able to show my birth country's time zone in that country's locale, and my local time in my current locale.
|
|
|
|
|
|
Using title number all, this enables aggregates. Note that FreeBSD and
OpenBSD previously only reported aggregates, so this is bringing Linux
and NetBSD that functionality.
Changes the default battery reporting to the aggregate since most
users probably don't care about individual batteries. For single-battery
systems there should be no change.
Fixes one obvious memory leak in NetBSD.
|
|
Should make it more resilient to future ambiguities in uevent.
|
|
Currently i3status differentiates wireless and wired devices based
on the existence of wireless directory inside the device's sysfs
directory. This approach seems to cause 3g modems to be incorrectly
identified as the first ethernet device.
This commit solves this problem by using DEVTYPE variable from
uevent file.
Signed-off-by: Cihangir Akturk <cakturk@gmail.com>
|
|
Patch by Axel Beckert.
|
|
Signed-off-by: Tomasz Nitecki <tnnn@tnnn.pl>
|
|
An empty string becomes the default value for format_not_mounted parameter
for any disk entry. This avoids printing erroneous values when a
filesystem is not mounted.
|
|
This allows OSes that support reporting multiple batteries to simply
sum into full_design,full_last,remaining and let print_battery_info
make computations.
|
|
This is in preparation for moving the ratio computation code out of
slurp_battery_info to support aggregating multiple batteries.
|