Commit Graph

850 Commits

Author SHA1 Message Date
Ingo Bürk
639a67f752
Merge pull request #296 from Stunkymonkey/include-order
switch to clang 3.8 & ignore include sort order
2018-07-16 16:18:06 +02:00
Ingo Bürk
0b25052cd0
Merge pull request #299 from tuxillo/patch-2
Detect interface type on DragonFly BSD
2018-07-16 16:13:47 +02:00
Antonio Huete Jimenez
afd7e44d97 Detect interface type on DragonFly BSD 2018-07-15 21:59:18 +00:00
Ingo Bürk
1174bfa7da
Merge pull request #298 from tuxillo/patch-1
Do not use pulseaudio for DragonFly BSD
2018-07-15 21:47:26 +02:00
Antonio Huete Jimenez
deca11c0a0 Do not use pulseaudio for DragonFly BSD 2018-07-14 20:23:22 +00:00
Felix Buehler
3fd61f86db clang-format-3.8 fix travis error 2018-07-13 16:28:22 +02:00
Ingo Bürk
fc9da67e65
Merge pull request #297 from Stunkymonkey/percent-first
able to print percentage
2018-07-13 15:17:51 +02:00
Felix Buehler
d099a907f6 fix clang errors 2018-07-13 15:11:43 +02:00
Felix Buehler
52e9f6f63b able to print percentage
its now possible to have percentage before and after a variable. except
for the date. But percentage with dates does not make much sense to me, so
i skipped it.
2018-07-13 15:03:31 +02:00
Ingo Bürk
9aafc38370
Merge pull request #256 from oyvinht/master
Read multiple batteries on DragonFly BSD.
2018-07-13 12:31:04 +02:00
Ingo Bürk
c7f04b7447
Merge pull request #295 from Stunkymonkey/fix-min_width-docs
fix min_width doc
2018-07-13 12:27:28 +02:00
Felix Buehler
a40d7d928f switch to clang 3.8 & ignore sort oder of includes 2018-07-08 13:48:28 +02:00
Felix Buehler
530c6f01d3 fix min_width doc 2018-07-07 22:57:39 +02:00
Ingo Bürk
c5ad20bf50
Merge pull request #294 from Stunkymonkey/remove_memory_discussion
forgot to remove memory discussion from man page (it is implemented)
2018-06-30 06:52:58 +02:00
Felix Buehler
4e62a853ee forgot to remove memory discussion from man page (it is implemented) 2018-06-30 00:52:59 +02:00
Ingo Bürk
302966374b
Merge pull request #292 from Stunkymonkey/format_quality
add format_quality option in wireless
2018-06-29 23:10:53 +02:00
Felix Buehler
4ea804b751 add format_quality option in wireless 2018-06-29 22:56:09 +02:00
Ingo Bürk
78c0a53c45
Merge pull request #293 from Stunkymonkey/hide_seconds_battery
hide seconds in battery by default
2018-06-29 22:49:52 +02:00
Ingo Bürk
a916481aab
Merge pull request #291 from duskCoder/cap_net_admin
Stop requiring CAP_NET_ADMIN
2018-06-29 22:43:39 +02:00
Felix Buehler
50b899ba42 hide seconds in battery by default 2018-06-29 14:37:48 +02:00
Olivier Gayot
03c8908ec6 Stop requiring CAP_NET_ADMIN
Since the following commit in the Linux kernel tree

  0fdc100bdc4b ethtool: allow non-netadmin to query settings

it is no longer necessary to have the CAP_NET_ADMIN capability to query
a device speed using ioctl(..., SIOCETHTOOL) in conjonction with the
ETHTOOL_GSET ethtool command.

The mentioned commit landed first in the 2.6.37 version of the Kernel.
This version is no longer maintained nowdays.

Since it is not necessary anymore, it is strongly prefered from a
security standpoint to drop the CAP_NET_ADMIN capability from the
binary.

Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
2018-06-25 11:53:05 +02:00
Ingo Bürk
4d3344ab9c
Merge pull request #290 from duskCoder/changes
Fix potential issues & avoid unnecessary instructions
2018-06-22 13:55:09 +02:00
Olivier Gayot
c221b4d331 Prevent potential crash if glob() fails
Calling globfree(NULL) is undefined behaviour. In Linux (glibc), it
results in a segmentation fault.

It is also undefined behaviour to call globfree(&pglob) if a previous
call to glob(&pglob) returned an error.

Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
2018-06-20 14:20:17 +02:00
Olivier Gayot
445b1925e3 Fix potential memory leak on Linux
The function slurp_all_batteries(), on Linux, allocates memory
dynamically

Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
2018-06-20 14:20:17 +02:00
Olivier Gayot
c64195d147 Fix invalid handling of glob() errors on Linux
The manual of glob(3) says that the function returns 0 on successful
completion. Any other integer value should be considered an error, not
only negative integers.

In practice, *BSD systems use negative values but Linux uses positive
integers.

Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
2018-06-20 14:20:17 +02:00
Olivier Gayot
95c068358a Fix use of undefined macro __OpenBSD__
Compiling on Linux with -Wundef produces the following warning:

  warning: "__OpenBSD__" is not defined, evaluates to 0 [-Wundef]

Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
2018-06-20 14:20:17 +02:00
Olivier Gayot
a6dd14c8c6 Avoid assigning a new value to a var before using the old value
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
2018-06-20 14:20:17 +02:00
Olivier Gayot
598b76cc53 Make sure the arguments passed to printf/die(...) match the format
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
2018-06-20 14:20:17 +02:00
Olivier Gayot
ca8c3e7337 No longer use a temporary buffer in the die() function
Before the following change

  f947d0a Breaks configfiles! Major refactoring of i3status, see below

The die(fmt, ...) function was outputting the reason to the status bar
in addition to stderr. For this reason, it was meaningful to create a
temporary string according to the format string and then passing it
around to the different functions.

Nowadays, we only display the error message to stderr so calling
fprintf(stderr, ...) is much simpler.

Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
2018-06-20 11:01:59 +02:00
Ingo Bürk
64fd6e1047
Merge pull request #289 from bebehei/testsuite
Testsuite
2018-06-20 08:39:59 +02:00
Benedikt Heine
bffc9ed962 Show differing results, if testcase fails 2018-06-19 17:17:51 +02:00
Benedikt Heine
a073acd406 Run all travis tests and expose the final result as exit code 2018-06-19 17:17:51 +02:00
Benedikt Heine
adc9348e80 Expose the testsuite in the Makefile 2018-06-19 17:17:51 +02:00
Benedikt Heine
bc29d468ca Fail the tests, if i3status actually crashes 2018-06-19 16:47:02 +02:00
Ingo Bürk
f300f6e466
Merge pull request #287 from eplanet/emeric/man_typo
Fix man typo
2018-06-16 14:49:09 +02:00
eplanet
5b4eb1069d Fix man typo 2018-06-14 22:09:03 +02:00
Ingo Bürk
ac78e1abe3
Merge pull request #286 from duskCoder/#283
Fix issue #283 (shown IP belonging to wrong network interface)
2018-06-11 22:18:53 +02:00
Olivier Gayot
451ff9be0b Fix shown IP address belonging to wrong interface
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>
2018-06-11 22:06:57 +02:00
Olivier Gayot
99a6fb5e49 Simplify the algorithm used to determine the IP address
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
2018-06-04 19:59:09 +02:00
Ingo Bürk
9f08fe297a
Merge pull request #282 from Stunkymonkey/mem-support
fix wrong memory-documentation
2018-05-22 06:57:45 +02:00
Felix Buehler
c7253ac5e4 fix wrong memory-documentation 2018-05-22 02:07:28 +02:00
Ingo Bürk
b850f5852d
Merge pull request #270 from Stunkymonkey/mem-support
initial support of memory-usage for linux
2018-05-19 22:08:42 +02:00
Orestis
ffe41cc944
Merge pull request #281 from eplanet/fix_warnings
Fix MacOS build
2018-05-15 14:46:06 +03:00
eplanet
9a8106fab9 Fix MacOS build 2018-05-15 13:34:36 +02:00
Michael Stapelberg
c983ff96f2 release v2.12 2018-05-11 11:07:22 +02:00
Benedikt Heine
cba8f55938 Simplify the memory thresholds 2018-05-04 18:46:59 +02:00
Benedikt Heine
7839e93c9b Rename ram variables consistently 2018-05-04 18:46:38 +02:00
Felix Buehler
c55754542e Implement support for memory-usage on Linux 2018-04-11 22:36:41 +02:00
Ingo Bürk
82d25dc362
Merge pull request #275 from winks/patch-2
Fix NULL value on OpenBSD when there is no acpitz0
2018-04-08 15:53:19 +02:00
Florian Anderiasch
46b5c264d1 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.
2018-04-06 19:56:55 +02:00