Commit Graph

807 Commits

Author SHA1 Message Date
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
Michael Stapelberg
7b63102b9d Merge pull request #178 from eplanet/ut_cpu_temp
Unit testing some new cases
2016-11-15 09:27:44 -08:00
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
9c47240523 Added test case for run_watch
The valid test case assumes pid 1 exists, which should always
be true on Unix environment.
2016-11-14 21:33:09 +00:00
eplanet
243d08e1ad Added unit test case for path_exists 2016-11-14 21:24:16 +00:00
eplanet
7c9108c9b9 Added unit test case for CPU temperature 2016-11-14 20:58:58 +00: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