Commit Graph

36 Commits

Author SHA1 Message Date
Felix Buehler
2ef1d7440a use format_placeholder for cpu_temperature 2020-02-18 17:51:12 +01:00
Michael Stapelberg
a57cdc84e2
Switch to autotools (#316) 2019-01-23 08:56:40 +01: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
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
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
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
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
a8aa5d608c Adding glob check to cpu temperature fixes #55 2016-03-20 11:47:56 +01:00
Alexis Hildebrandt
d1cec2632d Fix undeclared identifier thermal_zone error
when THERMAL_ZONE is not defined.
2015-07-06 15:47:44 +02:00
Viktor Stanchev
a2b8529043 add apostrophe to error message to fix grammar 2015-06-12 23:08:46 -04:00
Michael Stapelberg
d74e904bf4 clang-format-3.5 -i **/*.[ch], update modeline
From here on, we’ll use clang-format to automatically format the source.

This has worked well in i3, so we are introducing it for i3status.
2015-03-16 10:01:07 +01:00
Robin Hahling
d73ca2fa82 Fix Dragonfly BSD CPU temperature gauge
This patch fixes CPU temperature gauge for DragonFly BSD.
Commit 0eeded8 assumed that fetching CPU temperature for DragonFly
BSD was similar to that of FreeBSD but this assumption is false.
2014-08-08 11:57:01 +02:00
Alexander Vasarab
b26b118d76 Fix NetBSD CPU temp gauge bug
This patch fixes a bug in which multiple (conflicting) CPU temps may be
included in the output for the "cpu temperature" module.

The bug is due to the way that the code parsed the envsys(4)-returned data,
and would manifest itself on x86-based NetBSD machines, since those use
cputemp(4) as well as acpitz(4), thereby creating multiple envsys(4) entries
with identical descriptions but which refer to different physical sensors.

Instead of matching the description attribute of each device returned by
envsys(4) against the target format, this patch throws away non-matching keys
in the first instruction inside the dict walk. This has the benefit of sparing
unnecessary CPU cycles, and preventing other sensors from being included
erroneously.

Additionally, the THERMAL_ZONE format is now joined with OpenBSD in that it
uses acpitz(4) explicitly. This is prefered since it is much older (dating
back to NetBSD 2.0), and does not exclude x86-based users (as with cputemp(4)).
2014-04-30 09:28:09 +02:00
Mats
4f7da73885 Unify use of string comparisons
* strncmp(s1, s2, strlen(s2)) → BEGINS_WITH(s1, s2)
* strncmp(s1, s2, strlen(s1)) → strcmp(s1, s2)
* Prefer case-insensitive comparison for options
2014-03-12 08:28:16 +01:00
Marco Hunsicker
26faed4c2f i3status: Bugfix: Reading multiple temperature sensors not possible
This patch inlines the creation of the thermal zone string in order
to force computation on each invocation. This is necessary to be able
to read the values of several temperature sensors.
2014-02-26 22:32:32 +01:00
Michael Stapelberg
ebfafc5dac print_cpu_temperature: fix memory leak (Thanks kuba) 2013-10-24 19:19:21 +02:00
Arnaud Degroote
c6e9fc84c6 Add support for cpu temperature on NetBSD (using envsys(4)) 2013-10-07 19:32:50 +02:00
Baptiste Daroussin
13ebebeb7a Support colored output for CPU temperature on FreeBSD 2013-03-20 11:16:53 +01:00
Jakob Haufe
d62e10c56d Fix FTBFS on Hurd
On GNU/Hurd, THERMAL_ZONE is undefined. This makes compilation fail as
outwalk is declared inside of #ifdef THERMAL_ZONE, but it's used outside
of it (by OUTPUT_FULL_TEXT).

This moves the declaration outside the #ifdef to allow for successful
compilation on Hurd again.
2013-03-02 13:48:43 +01:00
Michael Stapelberg
a5a43af186 retab! print_cpu_temperature 2013-01-28 11:37:23 +01:00
Emil Mikulic
a87b63c3e9 Make sure colorful_output variable is initialized. 2013-01-28 11:36:23 +01:00
Scott Tincman
0eeded8bc0 DragonFlyBSD support added 2012-11-15 12:31:17 +01:00
Michael Stapelberg
450424f97a implement max_threshold for linux, too 2012-10-16 10:52:57 +02:00
Jasper Lievisse Adriaanse
ae4873bac7 i3status - More temperature related fixes for OpenBSD, and a general feature
- Temperature sensors can now set a 'max_threshold' value to color the output red if exceeded.
- Allow for arbitrary temperature sensors nodes to be selected with 'path' on OpenBSD.
2012-10-16 10:51:15 +02:00
Jasper Lievisse Adriaanse
1c2517a399 i3status - Default to acpitz(4) instead of cpu(4) for OpenBSD temperature readings
The acpitz(4) values are eventually used by the kernel to determine if the machine
is getting too hot.
2012-10-16 10:48:44 +02:00
Michael Stapelberg
296eb5e706 Error handling: Never output null as full_text (JSON), prefix messages with i3status (Thanks Artemis)
The former made i3bar crash, the latter is helpful for debugging.
2012-05-09 18:56:57 +02:00
Michael Stapelberg
4ef47541b9 Improve error message when the cpu temperature cannot be read 2012-05-09 18:39:41 +02:00
Ewgenij Starostin
b5f89c83cc Handle %d with non-default CPU temperature path. 2012-05-04 12:29:02 +02:00
Jasper Lievisse Adriaanse
1c3fb04fb9 Implement basic fetching of cpu temperature on OpenBSD. 2012-04-30 13:00:46 +02:00
Michael Stapelberg
1b3aa40485 add yajl compat code 2012-04-08 14:05:47 +02:00
Michael Stapelberg
12b1bfa9b8 Properly output JSON with libyajl 2012-03-25 22:05:00 +02:00
Michael Stapelberg
d5b4c8e368 Implement the i3bar JSON protocol
This hardcodes all the JSON parts. Strings are not properly escaped currently.
The best/easiest way to fix this is by actually using libyajl.
2012-02-16 23:30:54 +00:00
Connor Lane Smith
cc1457c4f0 make modules more resilient to failure 2011-08-25 23:27:10 +02:00
Michael Stapelberg
319664ce43 only compile print_cpu_temperature if THERMAL_ZONE is available
Fixes FTBFS on hurd-i386
2011-07-24 23:17:34 +02:00
Michael Stapelberg
4ec02bea7b implement the 'path' option for cpu temperature 2011-01-06 18:22:46 +01:00
Michael Stapelberg
f947d0a446 Breaks configfiles! Major refactoring of i3status, see below
We finally switched to libconfuse for a configuration file format
which does not require much work for the programmer nor for the user.
Plus, it avoids the Not-Invented-Here syndrome of yet another config
file format.

Furthermore, as a consequence of providing format strings for every
"module" (ipv6, wireless, …), we directly print the output and thus
we needed to drop support for wmii. This allowed us to get rid of
quite some complexity.

Documentation about the new configuration file and options will
follow. This commit is the beginning of what will be i3status v2.0.
2009-10-11 22:14:29 +02:00