Commit Graph

584 Commits

Author SHA1 Message Date
Mihai Coman
562f6e383d Add unit tests for threshold format 2016-11-15 13:34:06 +02:00
Mihai Coman
9375959b68 Add 'format_below_threshold' option for 'disk' module
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
2016-11-15 01:09:05 +02:00
eplanet
b0af4e4c85 Unit testing in Travis (#170) 2016-11-14 00:13:44 -08:00
Jon Bernard
220b9e1565 Use blank padding for wireless quality (#166) (#167) 2016-11-12 06:39:41 -08:00
Björn Lindström
be87c5ac38 Setting of custom locale in tztime configuration. (#168)
To be able to show my birth country's time zone in that country's locale, and my local time in my current locale.
2016-10-24 08:43:04 +02:00
Stu Zhao
707ceffc8b Detect batteries using glob (#163) 2016-10-23 21:20:31 +02:00
Watcom
8d2ef5f99b pulse device may be specified by name (#126) (#162) 2016-09-14 09:26:45 +02:00
Michael Stapelberg
48e10658b4 Bugfix: re-add single quotes around I3STATUS_VERSION
related to https://github.com/i3/i3/issues/2437
2016-09-05 08:35:24 +02:00
Michael Stapelberg
ad8b034e48 Merge pull request #140 from tommie/multibatt
Implement aggregates in print_battery_info
2016-08-29 09:45:15 +02:00
Tommie Gannert
dc072f9f53 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.

Fixes one obvious memory leak in NetBSD.
2016-08-28 14:29:08 +01:00
Tommie Gannert
ac8998ef03 Match trailing equal sign in slurp_battery_info.
Should make it more resilient to future ambiguities in uevent.
2016-08-22 21:18:31 +01:00
Cihangir Akturk
15de209cba 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.

Signed-off-by: Cihangir Akturk <cakturk@gmail.com>
2016-08-22 10:23:59 -07:00
Michael Stapelberg
ef16acfca5 print_wireless_info: fix FTBFS on hurd and kfreebsd
Patch by Axel Beckert.
2016-08-22 08:49:19 +02:00
tnnn
a2fd4bd074 Added missing ampere to watt conversion for last full capacity. (#158)
Signed-off-by: Tomasz Nitecki <tnnn@tnnn.pl>
2016-08-21 13:11:19 -07:00
Michael Stapelberg
08ee3bdf2d default config: remove DHCP, VPN
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.
2016-08-17 08:16:20 +02:00
eplanet
fde5ebfa1e 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.
2016-08-16 00:29:08 -07:00
tommie
7ce0044a03 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.
2016-08-14 23:52:20 -07:00
Michael Stapelberg
cf53cf0192 Merge pull request #150 from tommie/incremental_multibatt
Move full_design and full_last into struct battery_info
2016-08-14 13:01:35 -07:00
Tommie Gannert
d74bc90bfe Move full_design and full_last into struct battery_info.
This is in preparation for moving the ratio computation code out of
slurp_battery_info to support aggregating multiple batteries.
2016-08-14 20:44:54 +01:00
Tommie Gannert
9970af67e5 Also capture charge rate in NetBSD.
For time estimates when charging.
2016-08-14 20:44:54 +01:00
Michael Stapelberg
6e4ca31aa5 Merge pull request #149 from tommie/incremental_multibatt
Fix some compilation warnings on OpenBSD and NetBSD
2016-08-14 06:29:20 -07:00
Tommie Gannert
eb0b6412af Fix warnings about using a char array index on NetBSD.
The isspace macro is just a table lookup.
2016-08-14 12:37:38 +01:00
Tommie Gannert
a937693cef 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.
2016-08-14 12:20:43 +01:00
Tommie Gannert
7728cff370 Make print_disk_info, print_eth_info and print_wireless_info compile on NetBSD without warnings. 2016-08-14 11:52:27 +01:00
Tommie Gannert
185d70ecbb Remove warnings about unused variables in slurp_battery_info on OpenBSD. 2016-08-14 11:52:27 +01:00
Tommie Gannert
4189824ffb Define IW_ESSID_MAX_SIZE for OpenBSD.
Also fixes a signedness warning.
2016-08-14 11:52:27 +01:00
Michael Stapelberg
712c5b0f0b Merge pull request #145 from tommie/incremental_multibatt
Move OS-specific code from print_battery_info to a separate function
2016-08-13 14:01:48 -07:00
eplanet
535fc76fb3 Deleting VERSION and extracting it from I3STATUS_VERSION instead (#146) 2016-08-13 13:46:31 -07:00
Tommie Gannert
77f097dcca Move OS-specific code to slurp_battery_info. 2016-08-03 23:27:04 +01:00
Tommie Gannert
a537d1503a Introduce a struct battery_info to carry information from data retrieval to the output formatter. 2016-08-03 23:27:04 +01:00
Michael Stapelberg
2d16f144f5 Merge pull request #144 from tommie/incremental_multibatt
Refactor color code and computation of seconds_remaining in print_battery_info
2016-08-04 00:21:37 +02:00
Tommie Gannert
0b16860145 Refactor common seconds_remaining code in print_battery_info. 2016-08-03 23:09:16 +01:00
Tommie Gannert
52f0dd6a36 Remove an END_COLOR in print_battery_info for OpenBSD.
This was probably a bug since it makes no sense to have here.
2016-08-03 23:09:15 +01:00
Tommie Gannert
6d3e9991de Move START_COLOR to after OS-specific code.
This uses the more direct tests of whether percentage_remaining and
seconds_remaining are available or not (rather than looking at
present_rate).
2016-08-03 23:09:02 +01:00
Michael Stapelberg
1faa84d2f7 Merge pull request #143 from tommie/incremental_multibatt
Remove emptytimebuf and consumptionbuf from print_battery_info
2016-08-03 23:14:14 +02:00
Tommie Gannert
47ec48b85d Remove consumptionbuf from print_battery_info. 2016-08-03 20:13:10 +01:00
Tommie Gannert
b890d2e416 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.
2016-08-03 20:13:10 +01:00
Michael Stapelberg
9ba3ea0900 Merge pull request #142 from tommie/incremental_multibatt
Remove statusbuf, percentagebuf and remainingbuf from print_battery_info
2016-08-03 18:45:45 +02:00
Tommie Gannert
63724e2fa5 Remove remainingbuf from print_battery_info. 2016-08-03 08:24:24 +01:00
eplanet
b93afe8fb9 Fixed typo in README.md (#141) 2016-08-01 22:16:50 +02:00
Tommie Gannert
0390dbf2e0 Remove percentagebuf from print_battery_info. 2016-08-01 00:34:31 +01:00
Tommie Gannert
88a0c6923c Remove statusbuf from print_battery_info. 2016-08-01 00:24:40 +01:00
Michael Stapelberg
8e852fa945 Merge pull request #139 from Gjum/wb-colored-cpu-usage
Add CPU usage color thresholds
2016-07-30 19:23:20 +02:00
Gjum
dbc0f9bd8c change default cpu_usage thresholds to 90 and 95 2016-07-27 20:03:55 +02:00
Bandie Yip Kojote
dd0f6bf4b7 Manpage subsection TzTime: Example config now matches to the context (#134) 2016-06-30 08:52:35 +01:00
eplanet
4a37333cad Added version files for release tarball. Fixes #78 (#132) 2016-06-27 08:49:51 +02:00
eplanet
3a807af855 Default configuration paths ordered the same way as i3. Fixes #129 (#130) 2016-06-15 23:13:40 +02:00
Michael Stapelberg
7c0c82313e travis: use trusty instead of (failing) llvm repo 2016-06-15 21:45:34 +02:00
Alexis Hildebrandt
0a2d4d8a04 Add ifdef to compile wireless_info on Mac (#127) 2016-05-13 09:50:09 +02:00
Watcom
4807be8b5f reconnect to PulseAudio if connection is lost (fixes #124) (#125) 2016-05-08 00:19:30 +02:00