Tommie Gannert [Mon, 1 Aug 2016 17:03:03 +0000 (18:03 +0100)]
Implement aggregates for batteries.
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.
Cihangir Akturk [Mon, 22 Aug 2016 17:23:59 +0000 (20:23 +0300)]
Parse uevent file to detect network device type (#153)
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.
VPN was removed because it pointed to vpnc, which hasn’t been updated
since 2008 and is long obsolete in favor of openconnect. Since different
people use different VPN solutions, though (and other modules configured
by default do actually work regardless of the system), let’s remove this
and have people who need it configure it explicitly.
DHCP was removed because modern systems often don’t use dhclient anymore
(but rather systemd-networkd’s DHCP client, which can also be used via
NetworkManager these days) and because it fails our philosophy test:
it’s not something which you would look at every now and then if
i3status didn’t expose it.
eplanet [Tue, 16 Aug 2016 07:29:08 +0000 (09:29 +0200)]
Print empty string for not mounted disks. (#148)
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.
tommie [Mon, 15 Aug 2016 06:52:20 +0000 (07:52 +0100)]
Move time and ratio computations out of slurp_battery_info. (#151)
This allows OSes that support reporting multiple batteries to simply
sum into full_design,full_last,remaining and let print_battery_info
make computations.
Tommie Gannert [Mon, 1 Aug 2016 19:28:16 +0000 (20:28 +0100)]
Simplify string comparisons in slurp_battery_info for NetBSD.
Doing strlen(a) == strlen(b) && strncmp(a, b, N) seems to have no
benefits compared to just strcmp(a, b). The NetBSD cstring properties
come from the kernel, not the user.
The test for units did a prefix match, but that looked like a bug, the
unit is "Watt hour" in my Virtual box.
Tommie Gannert [Mon, 1 Aug 2016 00:00:31 +0000 (01:00 +0100)]
Remove emptytimebuf from print_battery_info.
This changes the behavior for NetBSD: previously this time was not
shown while charging. On Linux it was treated as "full time". This
change makes all OSes behave the same.
OpenBSD and FreeBSD did not support emptytime previously.
Mark Schreiber [Wed, 13 Apr 2016 16:07:12 +0000 (09:07 -0700)]
Add CPU usage color thresholds
CPU usage had previously not supported the color option. Add support
for a "degraded" state above which the degraded color is used, and a
higher "bad" state above which the "bad" color is used. One possible
use for these might be indicating whether one or all cores are
saturated.
Unlike the color settings for other, these are set high enough to be
disabled by default. This is done because i3status determines CPU
usage over only the last display interval, which means that, a user
with a low refresh rate might see frequent, potentially-annoying color
changes.
Clayton Craft [Mon, 25 Jan 2016 06:39:53 +0000 (22:39 -0800)]
This removes the 'remaining' time when the battery is full, since the remaining time is always 00:00:00. When the battery is discharging, the remaining time will show up again if the user has set their format correctly.
John Baldwin [Thu, 8 Oct 2015 20:15:38 +0000 (13:15 -0700)]
Properly detect the battery charging status under FreeBSD.
The hw.acpi.battery.state sysctl returns a bitmask of flags as
defined in <dev/acpica/acpiio.h>. Use constants from this header
to examine the state and check for the charging flag to determine
if the battery is charging.
John Baldwin [Tue, 15 Sep 2015 20:39:01 +0000 (13:39 -0700)]
Fix various issues with wireless information under FreeBSD:
- Instead of hoping that the currently associated AP will show up as
the first AP in the list of scan results, fetch the BSSID of the
currently associated AP and use that to fetch station info for the
AP. This provides more frequently updated signal strength
information than scan results and reliably provides information when
multiple APs are in range.
- Do not treat the RSSI value as a raw signal value in dBm. Instead, use
the same formula as ifconfig(8) to compute a signal value.
- Do not report the beacon interval value as a signal quality level.
John Baldwin [Tue, 15 Sep 2015 17:48:16 +0000 (10:48 -0700)]
Fix some issues with displaying Ethernet media status on recent FreeBSD kernels.
- Don't apply IFM_SUBTYPE to the raw subtype in the description table.
IFM_SUBTYPE() requires a fully populated word and was truncating values
in the table when comparing resulting in false matches (notably
"10GBase-KX4" for the no media case) after recent changes to add extended
Ethernet media states in FreeBSD.
- Explicitly check for IFM_ETHER.
- Use SIOCGIFXMEDIA when present to obtain extended media states on newer
kernels.
- Explicitly handle "no carrier".