Commit Graph

508 Commits

Author SHA1 Message Date
Michael Stapelberg
8a57208b1d Bugfix: fix wrong color tags with xmobar
fixes #1353
2014-08-26 20:54:04 +02:00
Klemen Košir
fcd95c2408 Fix battery indicator on systems without POWER_SUPPLY_VOLTAGE_NOW.
In my case, the voltage variable would stay initialized as -1,
which caused the calculation of battery charge percentage to be
incorrect (I would get the message that there is no battery present
or even -0% charge).

I have no idea how this would affect other systems, since I don't
have a chance to test this.
2014-08-25 19:36:02 +02: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
Robin Hahling
a85bd9b930 Fix CFLAGS and LDFLAGS for DragonFly and FreeBSD 2014-08-01 13:01:05 +02:00
Bas Pape
e4b854543a Clarify color_separator relation to output_format 2014-06-08 13:56:24 +02:00
Michael Stapelberg
2158128ea0 Use the absolute values for (dis)charging rates
Apparently some notebooks report a negative current, whereas most don’t.

fixes #1249
2014-05-31 14:01:18 +02:00
Michael Stapelberg
653505a3bb run_watch: check all matching pid files (until first valid one) (Thanks brotbart)
fixes #1245
2014-05-15 21:51: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
Alexander Vasarab
628149b227 Implement battery functionality for NetBSD users
This patch takes a similar approach as the NetBSD CPU temperature
code in that it uses proplib(3) to walk dictionaries supplied by
envsys(4).

In addition to providing the basic functionality, it:

* Provides all existing format specifiers (%emptytime %consumption
  %status %percentage %remaining)
* Respects all existing config options (hide_seconds, low_threshold,
  integer_battery_capacity, last_full_capacity)
* Projects "time until full" when battery status is CS_CHARGING
2014-04-30 09:23:17 +02:00
Marco Hunsicker
93ead58bc1 Avoid unnecessary string duplication
This patch removes an unnecessary string duplication that was only
used to avoid a compiler warning.
2014-03-15 18:00:54 +01:00
Marco Hunsicker
d198403a3b Remove custom color options from order array 2014-03-15 18:00:27 +01: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
Jasper Lievisse Adriaanse
52814295a0 For the %percentage display of batteries, drop the leading '0' for values < 10. 2014-03-12 08:27:00 +01:00
Mats
bc0bd8c9e0 disk: Colorize output when below given threshold
New disk module options:
* threshold_type: ^(percentage|[kmgt]?bytes)_(free|avail)$
* low_threshold: <double>

fixes #912
2014-03-09 22:57:19 +01:00
Marco Hunsicker
1de12e7b20 Support align and min_width module options
This patch enables users to define "align" and "min_width" options
right in the i3status module config sections.

Specifically this patch:
 * Adds macros for the two new options that are used in the option
   definitions. As the min_width option can take either a string or a
   number, a custom type has been added along with a corresponding callback
   function that parses the provided value (and provides input validation).
   The align option also uses a callback for input validation
 * Expands all module config option definitions to include the new
   options
 * Extends the SEC_CLOSE_MAP() macro to generate the JSON for the new
   options as necessary
 * Updates the manpage to explain the new options
2014-03-07 08:46:44 +01:00
Marco Hunsicker
0c2b518b8a Typo in function name
Fixes the typo in print_seperator()
2014-03-01 22:35:37 +01:00
Marco Hunsicker
7b021d3eb2 i3status: Allow customization of module separator
This patch adds the ability to customize the separator that is placed
between modules.

Specifically this patch:

* adds the "separator" general directive
* moves the definition of the default separator for the different
  output formats (excluding color formatting) to src/i3status.c
* updates the SEC_CLOSE_MAP macro to disable the separator for the
  i3bar output format if the separator directive dictates so
* changes print_seperator() in src/output.c to take a separator
  parameter in order to disable the output of the separator if
  the separator is empty and to use the provided separator
  otherwise
* updates the manpage to explain the new directive
2014-03-01 10:21:11 +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
530c82edfd make release: install the README file (Thanks myou) 2014-02-19 22:58:30 +01:00
Iakov Davydov
c01a8110a4 Add hide_seconds option
fixes: #1134
2014-02-08 20:36:59 +01:00
Wieland Hoffmann
38938c3444 Add a format_down example for battery 2014-01-06 22:03:17 +01:00
Wieland Hoffmann
f3c5f18bff man: Add a missing colon 2014-01-06 22:03:13 +01:00
Michael Stapelberg
b75b3aec68 manpage: update version number 2014-01-05 12:18:48 +01:00
Michael Stapelberg
a1f157bc46 update CHANGELOG 2014-01-05 12:17:18 +01:00
Mats
596f2264f4 disk: Distinguish between IEC, SI and custom prefixes
* IEC: Ki, Mi, Gi, Ti (powers of 1024)
* SI: k, M, G, T (powers of 1000)
* custom: K, M, G, T (powers of 1024)
2013-12-10 21:18:14 +01:00
Kinware AB
717484184f Add support for path_exists directive. 2013-11-22 15:52:27 +01:00
Michael Stapelberg
98595f9f28 document format_muted in the manpage 2013-11-18 22:32:48 +01:00
Gereon Kremer
4bd0ba88c8 Added different format string for volume in case it is muted.
If the volume is muted, the volume level would simply be displayed as zero and the color changed to color_degraded.
This patch lets the user define a custom format string for when the volume is muted.
The default value is "♪: 0%" ("♪: %volume" being the usual format).
2013-11-18 22:31:42 +01:00
Sebastian Ullrich
09330976e5 default config: show %avail disk space instead of %free
The former property is generally more relevant to end users
2013-11-16 10:11:25 +01:00
Michael Stapelberg
14b43bdec2 format detection: simplify code, handle "sh" processes in the hierarchy
i3 starts processes using /bin/sh now, not $SHELL. This increases the
likelihood with which we are started by dash, which tends to leave its
processes in the hierarchy, e.g.:

michael       1524  i3bar --bar_id=bar-0 --socket=/run/user/1000/i3/ipc-s
michael       1525   \_ /bin/sh -c i3status
michael       1526       \_ i3status

This case is now handled correctly — when the parent is “sh”, the parent
of sh will be used instead.
2013-11-09 14:37:05 +01:00
Michael Stapelberg
31509b0d56 fix slurp(), it needs to read size-1 for the trailing NUL 2013-11-09 14:37:04 +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
Arnaud Degroote
32551729e8 Allow to print cpu usage on NetBSD 2013-10-07 19:31:01 +02:00
Arnaud Degroote
cf2fb61911 Allow to print eth information on NetBSD 2013-10-07 19:30:51 +02:00
Arnaud Degroote
57730f726f Fix the build on NetBSD 2013-10-07 19:30:32 +02:00
Jan-Erik Rediger
bcc8932c86 Add example path for CPU temperature 2013-07-19 00:19:43 +02:00
Michael Stapelberg
10e9c3a173 manpage: update example for load’s max_threshold 2013-07-09 23:25:49 +02:00
M. Kory Woods
41be50a983 allow load to be a float 2013-07-09 23:22:26 +02:00
Michael Stapelberg
cf417ffeb1 Makefile: use .SILENT and support V=1 for verbose builds 2013-06-18 18:14:38 +02:00
Axel Wagner
86d1b5df7a Bugfix: In term-output, clear line before drawing new one
If we don't do this, the output of i3status will remain on the terminal,
which is really ugly if the statusline becomes shorter after a while
(for example a connection get's lost), because there will be garbage.
2013-06-11 23:50:29 +02:00
Michael Stapelberg
3beb6b4406 signal handler: set flag because directly calling fprintf() is unsafe 2013-05-19 19:58:51 +02:00
Axel Wagner
7a372b0f46 Implement term-output-format 2013-05-19 19:51:01 +02:00
oblique
8445d6a929 print_volume(linux): Open a new mixer every time.
This fix the following bug:
    If you switch your sound card on-the-fly, print_volume continued to
    use the old sound card.
2013-05-19 19:48:07 +02:00
Jonas Cleve
6a84138251 fix #1017: i3status uses generic battery instance 2013-05-04 17:53:20 +02:00
Michael Stapelberg
de8c6cba60 manpage: be more explicit about the path option 2013-05-04 17:50:05 +02:00
Baptiste Daroussin
13ebebeb7a Support colored output for CPU temperature on FreeBSD 2013-03-20 11:16:53 +01:00
Michael Stapelberg
1ec54a2971 man: mention i3bar in the description (Thanks andi) 2013-03-19 19:58:22 +01:00
Michael Stapelberg
f0cd726bf0 print_volume: don’t return, complete the buffer first
Otherwise, i3bar will display “SPEC VIOLATION” because full_text is
missing in the block.
2013-03-19 19:56:44 +01:00
Baptiste Daroussin
8dbadb6d4e Enable colored output for battery on FreeBSD 2013-03-19 19:54:15 +01:00