Commit Graph

688 Commits

Author SHA1 Message Date
Ingo Bürk
1522f58ef0
Merge pull request #261 from tylerbrazier/no-sloc
Remove SLOC comment from man page
2018-02-03 09:36:36 +01:00
Tyler Brazier
d35e0ab9b6 Remove SLOC comment from man page
This changed happened for the readme in
73620dc876
2018-02-02 13:05:46 -06:00
johcgt
d5c69a9d60 Treat zero battery capacity as "not available" (#259)
`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.
2018-01-28 15:37:51 +01:00
Ingo Bürk
ef8f9ddcd7
Merge pull request #255 from eplanet/update_readme
Get rid of the SLOC comment
2017-12-12 18:07:19 +01:00
eplanet
73620dc876 Get rid of the SLOC comment 2017-12-11 22:50:16 +01:00
Emeric Planet
657c0498db Update comment as in #247 (#254) 2017-12-11 12:16:00 +01:00
Emeric Planet
53fb9b4f18 Add IPv6 address when IPv4 isn't available (#247) 2017-12-11 11:38:31 +01:00
Ingo Bürk
c3424e10be
Merge pull request #253 from eplanet/always_reload_tz
Call tzset at each time print
2017-12-09 16:17:42 +01:00
eplanet
20a701bdf0 Call tzset at each time print 2017-12-09 15:48:18 +01:00
Ingo Bürk
35bb9a06fb
Merge pull request #252 from GuyOfThePery/patch-1
Fixed minor typos
2017-12-09 13:36:27 +01:00
GuyOfThePery
223de595f0
Fixed minor typos
"you can chose" -> "you can choose"

"You can either disable the default separator altogether setting it to the empty string." -> " You can also disable the default separator altogether by setting it to the empty string."
2017-12-09 13:24:11 +02:00
Tomas Krizek
b9b676af20
man: explicitly use format_up/format_down in ethernet, wireless conf
Clearly indicate format_up and format_down are used for configuring ethernet
and wireless sections instead of format.

Signed-off-by: Tomas Krizek <tomas.krizek@mailbox.org>
2017-12-03 14:49:40 +01:00
Emeric Planet
6464ae2df9 Add network test cases (#246) 2017-11-20 19:51:48 +01:00
Michael Stapelberg
7ea12e3dff Merge pull request #237 from kousu/215-battery
Be more cautious about handling invalid battery measurements.
2017-10-05 22:53:58 -07:00
Emeric Planet
cb9b55217d Fix CPU unit tests (#239)
Support any amount of available cores on testing machine.
2017-10-05 13:18:23 -04:00
Michael Stapelberg
9f5ac89aa4 Makefile: make PKG_CONFIG overridable (patch by Helmut Grohne) 2017-09-18 08:30:48 +02:00
Jasper Lievisse Adriaanse
83d0b621c0 Remove overly aggressive #error
Change-Id: I8c20606d386d713cac51b620d1fcdb479a3622fe
2017-09-04 13:30:21 +02:00
Emeric Planet
884e4da673 Fix CPU unit tests (#239)
Support any amount of available cores on testing machine.
2017-08-29 19:01:30 +02:00
kousu
aefa784882 Repair test case.
This was introduced in #236. It looks like Travis never ran on that PR?
Anyway it's blocking me submitting this now so I'm fixing it.
2017-08-24 19:00:22 -04:00
kousu
62d0905c7f Be more cautious about handling invalid battery measurements. 2017-08-24 19:00:08 -04:00
Emeric Planet
ca9bee8b88 Use local timezone for battery %emptytime (#236) 2017-08-19 14:56:30 +02:00
Ingo Bürk
0e406a1f3b Merge pull request #219 from flammi/master
Add check for virtual ethernet devices
2017-04-16 07:43:30 +02:00
Emeric Planet
c7dea74751 Add battery capacity parsing (#216)
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
2017-04-13 21:46:21 +02:00
Fabian Franzen
6a19709e65 Added braces
Added braces to the if-statement as requested.
2017-04-13 12:51:29 +02:00
Fabian Franzen
ad3fac03c3 Fix memory leak/Use BEGINS_WITH macro
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.
2017-04-12 13:11:34 +02:00
Fabian Franzen
f45581f8d8 Add check for virtual ethernet devices
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).
2017-04-12 03:46:04 +02:00
eplanet
94651257ce Multiple CPU support for cpu_usage (#209)
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.
2017-03-26 06:54:07 -04:00
Ingo Bürk
3ae0decbb3 Merge pull request #211 from ixjlyons/issue210
disk: don't remove trailing slash if path is a single character
2017-03-16 14:27:21 +01:00
Kenneth Lyons
8e12ad8308 disk: don't remove trailing slash if path is a single character 2017-03-10 11:24:56 -08:00
Ingo Bürk
09c758eed5 Merge pull request #208 from stapelberg/warning
remove useless checks (we use char, not unsigned char)
2017-03-08 22:26:33 +01:00
Ingo Bürk
554db9fcc1 Merge pull request #207 from stapelberg/disk_info
disk: sanitize trailing slashes
2017-03-08 22:25:51 +01:00
Michael Stapelberg
eee4ace092 remove useless checks (we use char, not unsigned char)
fixes compilation warnings
2017-03-08 19:24:09 +01:00
Michael Stapelberg
27952b11f7 disk: sanitize trailing slashes
fixes #200
2017-03-08 19:22:22 +01:00
Ingo Bürk
37e73e77b0 Merge pull request #202 from jasperla/openbsd_fdleak
Plug an fd leak in the OpenBSD-specific code for _first_
2017-02-07 20:47:06 +01:00
Ingo Bürk
c1172065a7 Merge pull request #201 from jasperla/openbsd_bat_info
Suppress printing :00 seconds of remaining battery lifetime
2017-02-07 20:45:36 +01:00
Jasper Lievisse Adriaanse
3c6d5ac3d7 Plug an fd leak in the OpenBSD-specific code for _first_ 2017-02-07 19:29:01 +01:00
Jasper Lievisse Adriaanse
9166765803 Suppress printing :00 seconds of remaining battery lifetime, as apm(4)'s
estimate only has a granularity of minutes.

From tb@openbsd.org
2017-02-07 19:25:03 +01:00
Baptiste Daroussin
93576bccc3 Fix the deciKelvin to Celsius conversion on FreeBSD (#195)
Change from ceiled value to floored value to be consistent with the
FreeBSD kernel

https://svnweb.freebsd.org/base?view=revision&revision=300421
2017-02-01 11:28:01 -08:00
Jasper Lievisse Adriaanse
e09186fa19 Make first_eth_interface() work on OpenBSD: (#197)
- use a define for loopback interface device
- use an approach similar to ifconfig(8) for determining device type
2017-01-31 23:28:38 -08:00
Jasper Lievisse Adriaanse
897d03ed5e Include sys/select.h on OpenBSD (#198)
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
2017-01-31 23:26:13 -08:00
Michael Stapelberg
67ee99f71c release v2.11 2017-01-21 16:00:15 +01:00
Michael Stapelberg
ef5148c3e9 correctly write I3STATUS_VERSION on release 2017-01-21 16:00:13 +01:00
Michael Stapelberg
30fd21864b Makefile: sort objects for deterministic linking order
Patch by Reiner Herrmann
2017-01-21 15:34:20 +01:00
Michael Stapelberg
8e293f92b0 man: fix spelling errors 2017-01-21 15:32:01 +01:00
Michael Stapelberg
dbc8acb618 man: switch link to directly go to github 2017-01-21 15:15:01 +01:00
Moritz Warning
3f6d71feb9 Consolidate measure speed script (#188)
* remove old net speed scripts

* add reworked net-speed script

* add space between rate and speed suffix

it is easier to parse visually

* only use intervals greater zero

* add ifaces examples

* catch negativ byte count

happens when the counter resets
2017-01-02 16:06:06 +01:00
Zhong Jianxin
9832a0d93a Re-license contrib/netspeed to the same as i3status (#189)
Signed-off-by: Zhong Jianxin <azuwis@gmail.com>
2016-12-25 23:00:15 +01:00
Samuel Holland
7a7974d76d Fix i3status to compile with -fno-common (#185)
This avoids multiple declarations of the same global variable in
different source files.
2016-12-13 19:32:57 +01:00
eplanet
6f7724ec64 Adding documentation for PR #179 (#182) 2016-11-19 06:02:10 -08:00
Michael Stapelberg
b91e2a4b71 Merge pull request #179 from mihaicmn/feature-threshold-format
Provide format_above_threshold/format_below_threshold options
2016-11-16 13:45:59 -08:00