Commit Graph

153 Commits

Author SHA1 Message Date
eplanet
3a807af855 Default configuration paths ordered the same way as i3. Fixes #129 (#130) 2016-06-15 23:13:40 +02:00
Mark Schreiber
1e8dab273d Add CPU usage color thresholds
CPU usage had previously not supported the color option.  Add support
for a "degraded" state above which the degraded color is used, and a
higher "bad" state above which the "bad" color is used.  One possible
use for these might be indicating whether one or all cores are
saturated.

Unlike the color settings for other, these are set high enough to be
disabled by default.  This is done because i3status determines CPU
usage over only the last display interval, which means that, a user
with a low refresh rate might see frequent, potentially-annoying color
changes.
2016-04-13 09:11:32 -07:00
eoin
d59589bf9e Added status_unk to battery_info 2016-03-21 22:41:22 +00:00
johannes karoff
6f4819f7a5 add separator and separator_block_width as universal module options
fixes #104
2016-01-31 19:39:29 +01:00
Watcom Hecht
dd75c260f8 revert back to using nanosleep
Fixes #93
2016-01-12 11:46:42 -02:00
Richard Petri
8d86198d3c Forgotten wakeup call from USR1 handler
Fixes #93
2016-01-11 09:58:51 +01:00
Kenneth Lyons
dcd0518e25 Added support for Pango markup. 2015-12-04 10:27:18 -08:00
Brendan Van Hook
a13b2e7288 Added support for lemonbar 2015-10-04 14:52:32 -04:00
Alexis Hildebrandt
2113737107 Use gettimeofday instead of clock_gettime on Mac
since the latter is not available.
2015-07-06 15:48:33 +02:00
Deiz
36a3be24aa Update copyright notices and get rid of ranges
The script used to make these changes can be found at:

   https://gist.github.com/Deiz/32322020f76d23e2bf8f
2015-04-21 11:48:29 -04:00
Michael Stapelberg
9abe0a9d59 Merge pull request #7 from Watcom/master
PulseAudio support for volume input
2015-04-03 14:45:40 -07:00
Watcom Hecht
1710c206cf PulseAudio support for volume input 2015-04-03 17:57:40 -03:00
Christian Kohlstedde
5c094a5493 Adding the option "format_down" to path_exists and run_watch.
This fixes #1.
2015-04-02 22:31:06 +02:00
Ingo Bürk
0a84bcb74a Pass the "instance" JSON property key for tztime blocks
fixes #10
2015-03-23 21:42:52 +01: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
Christian Kohlstedde
85bb373095 Adding optional configuration option to "print_disk_info". 2015-02-18 23:43:25 +01:00
Alexander Monakov
3818dabceb Allocate and expose per-instance pointers for plugins 2014-12-10 19:58:54 +01:00
Michael Stapelberg
b219f47f39 support the special interface name _first_ for ethernet/wireless
Since we have deterministic device names in Linux, these strings are a
much better default in the i3status config than "eth0" and "wlan0" (what
we used before).
2014-12-07 15:17:31 +01:00
Cyril Andreatta
8e22f3839d Created three individual Strings for each battery status (charging, dicharching, full)
Replaced hard coded status strings (CHR, BAT, FULL) in
print_battery_info.c with user defined strings. The new strings are
'status_chr', 'status_bat' and 'status_full' and can be set in i3status.conf.
e.g.
status_chr = " CHR"

If any of the new status strings is omitted the standard strings (CHR,
BAT, FULL) are used.
2014-10-07 18:52:01 +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
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
Iakov Davydov
c01a8110a4 Add hide_seconds option
fixes: #1134
2014-02-08 20:36:59 +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
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
M. Kory Woods
41be50a983 allow load to be a float 2013-07-09 23:22:26 +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
Christoph Göttschkes
5e0b8812bf Added format_down option for battery if no battery is available. 2013-03-09 11:43:55 +01:00
Raphael Michel
6279964c6b Add colorized output for load avg 2013-02-22 14:09:58 +01:00
Julien Lequertier
67c2c1a7ea Added option to show battery capacity without decimals 2013-02-14 19:35:15 +01:00
Emil Mikulic
2ebe1f3726 Add tztime module to support multiple different timezones. 2013-02-10 17:18:32 +01:00
Gereon Kremer
11757b8105 make refreshs align with minutes 2013-01-08 22:02:03 +01:00
Michael Stapelberg
0a608d4af6 make SIGUSR1 do nothing, so that killall -USR1 i3status will force an update
Sending SIGUSR1 will interrupt the nanosleep() and thus force a new
iteration of i3status’s output loop. The signal handler itself is empty.

Based on the question by ttjjss at
http://faq.i3wm.org/question/854/how-to-force-status-bar-update/
2012-12-05 17:49:54 +01:00
Michael Stapelberg
2f20400d7a Bugfix: make custom colors configurable for battery (Thanks thomas)
fixes #865
2012-11-10 08:46:26 +01:00
Michael Stapelberg
264068551f Bugfix: make custom colors configurable for cpu_temperature (Thanks thomas)
fixes #865
2012-11-07 21:14:02 +01:00
Marcelo Cerri
dbf3adc81d add good, degraded and bad colors per module
This commit adds support for color_good, color_degraded and color_bad
directives per module section in the config file.
2012-10-24 18:59:46 +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
Simon Elsbrock
68f438ec9e add additional battery threshold type "percentage"
The battery threshold can now be configured as type "time" or
"percentage", but defaults to "time" to prevent unexpected behavior.
Also, low_threshold was set to a more reasonable default of 30.
2012-08-28 18:05:11 +02:00
Michael Stapelberg
850f6720b5 rename threshold to low_threshold and document it properly 2012-05-25 09:57:03 +02:00
Simon Elsbrock
7c02c10b72 colorize battery output if remaining time below threshold 2012-05-25 09:53:49 +02:00
Michael Stapelberg
4ddd115af8 Use (void) instead of () for functions without args (Thanks fernandotcl)
See also:
http://article.gmane.org/gmane.linux.kernel/1268792

The C compiler will handle (void) as "no arguments" and () as "variadic
function" (equivalent to (...)) which might lead to subtle errors.
2012-05-07 08:28:04 +02:00
Michael Stapelberg
47e2bc273d bump copyright 2012-05-02 17:29:28 +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
188e5873be Fix configuration paths in error message 2012-03-11 14:47:58 +01: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
Michael Stapelberg
3471ff39f8 battery: implement "path" option for batteries with non-standard paths 2011-11-26 18:26:38 +00:00
Michael Stapelberg
631e460f8a make libconfuse handle config files case insensitive 2011-10-18 22:40:14 +01:00
Michael Stapelberg
692f0124a3 Don’t use a default setting for 'order'
This will make i3status depend on a useful configuration file (so
/etc/i3status.conf has to be installed) to actually output anything.

However, it fixes a very common error: people edit their i3status.conf and
don’t get that the first order directive has to use =, not +=. Since order is
now empty by default, you can use += everywhere.
2011-10-10 20:46:55 +01:00
Michael Stapelberg
9429d93a7e Fix the default value for the load, also the manpage description (Thanks XTaran) 2011-10-03 18:33:36 +01:00
Michael Stapelberg
f1a33824e8 bump copyright 2011-07-21 23:11:13 +02:00
Michael Stapelberg
53bf8bcb01 Bugfix: Use gettimeofday instead of time. It provides higher precision.
Otherwise, we sometimes have a wrong date/time.
2011-07-21 22:46:35 +02:00
Michael Stapelberg
602b6fcef0 update manpage, bump version, update copyrights, sync authors list 2011-07-19 15:28:28 +02:00
Michael Stapelberg
7ab9167536 magic: try to auto-detect output_format by default (dzen2/i3bar/xmobar) 2011-07-13 03:27:57 +02:00
Michael Stapelberg
8bcb4e5c17 Bugfix: call setlocale() to make %c work in the date format (Thanks loz) 2011-06-30 19:55:04 +02:00
Michael Stapelberg
0b299f740d Fix trailing whitespaces, document cpu_usage in manpage 2011-05-06 13:17:26 +02:00
Peter Bui
8b18e8e33c Add print_cpu_usage 2011-05-06 13:13:11 +02:00
Michael Stapelberg
0a13d30465 Also use the correct time for the ddate module 2011-04-22 01:10:40 +02:00
Michael Stapelberg
28934ef858 Bugfix: use localtime_r so that later calls in print_battery_info don’t overwrite the time 2011-04-22 01:06:53 +02:00
Michael Stapelberg
4fa8a4e0ab get time at the beginning of the loop 2011-04-21 20:50:14 +02:00
Michael Stapelberg
4ec02bea7b implement the 'path' option for cpu temperature 2011-01-06 18:22:46 +01:00
Fernando Tarlá Cardoso Lemos
0846c307d0 More sensible lookup order loading the config. 2010-10-24 00:34:53 +02:00
Michael Stapelberg
862297ecad initialize result to NULL to shun compiler warning 2010-09-23 00:20:16 +02:00
Michael Stapelberg
c3f7fc4994 port support for xdg basedir and some makefile fixes from i3 2010-09-23 00:12:48 +02:00
Michael Stapelberg
aedbf650ef Implement --version/-v parameter 2010-09-22 20:15:08 +02:00
Michael Stapelberg
af5fd7b77e Implement displaying the wireless connection speed (Thanks Felicitus)
Based on a patch by Felicitus.
2010-09-22 19:59:48 +02:00
Michael Stapelberg
e37b2076b8 Bugfix: s/CASE_SEC/CASE_SEC_TITLE for volume 2010-07-21 10:57:47 +02:00
Michael Stapelberg
eb46963d4c Implement ALSA volume support 2010-07-20 19:33:41 +02:00
Fernando Tarlá Cardoso Lemos
38337511e9 Support customized colors. 2010-07-04 21:52:43 +02:00
Michael Stapelberg
9db8f7221a Add fernandotcl to copyright notice 2010-06-28 16:53:22 +02:00
Axel Wagner
6298377bd4 Implemented a ddate-module 2010-06-19 12:44:43 +02:00
Christian Dietrich
8edce05764 ipv6: provide format strings for ipv6 up and ipv6 down 2010-04-06 14:54:25 +02:00
Christian Dietrich
8ddab6fe05 ipv6: don't require a title for config option 2010-04-06 02:32:52 +02:00
Michael Stapelberg
18c4b9866d Instead of a relative sleep(1), sleep until the full second
This makes sure you don’t lag behind up to nearly one second in
the worst case, depending on the start time of your i3status.
2010-01-30 00:02:17 +01:00
Michael Stapelberg
f45906a08b Fix function signature / pointer type 2009-10-24 13:39:36 +02:00
Michael Stapelberg
ea236a90da config: first try ~/.i3status.conf, then /etc/i3status.conf 2009-10-24 13:36:07 +02:00
Michael Stapelberg
013fdece8d Change output format to be a config option instead of a compile time define 2009-10-24 13:27:02 +02:00
Michael Stapelberg
e4bd4bd2a3 battery: split up %remaining into %percentage and %remaining (Thanks shatter) 2009-10-16 22:21:05 +02:00
Michael Stapelberg
da8cb9ebfc Implement option to use the last full capacity instead of the design capacity 2009-10-16 20:37:41 +02:00
Michael Stapelberg
b88a55ffa6 Implement format_up/format_down for ethernet 2009-10-16 20:14:40 +02:00
Michael Stapelberg
211899480d Separate license into file LICENSE 2009-10-15 20:44:24 +02:00
Michael Stapelberg
783707906c Implement disk info (%free/%used/%total) 2009-10-11 23:27:26 +02: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
Michael Stapelberg
1c0e5ea560 Fix compilation warning 2009-09-01 23:43:24 +02:00
Michael Stapelberg
39b153fdd1 Bugfix: Correctly terminate output if time is specified in order but no time_format given (Thanks XTaran) 2009-08-18 22:09:07 +02:00
Michael Stapelberg
bb52b40c8e Add support for xmobar
Use i3status-xmobar | xmobar -o -t "%StdinReader%" -c "[Run StdinReader]"
You might need to copy the default configuration to ~/.xmobarrc
2009-08-18 21:29:44 +02:00
Michael Stapelberg
34ba9fa908 Correctly handle the order of items 2009-07-21 20:23:08 +02:00
Michael Stapelberg
6fda988f36 Use own files for each function, add get_ipv6_addr.c 2009-07-21 19:07:30 +02:00
Michael Stapelberg
098f7bac23 Bugfix: Correctly handle SIGPIPE to avoid unnecessary zombie processes
Negative return value of printf() is not used when write() returns
a negative value, instead, SIGPIPE is sent.
2009-06-21 14:15:14 +02:00
Michael Stapelberg
747c814453 Bugfix: Exit upon errors from printf in dzen2-mode (usually SIGPIPE because dzen2 exited)
This prevents i3status processes from still running on your system
after you’ve restarted X and dzen2 is long gone.
2009-06-16 18:43:13 +02:00
Michael Stapelberg
15977d8a17 Merge getting thermal zone temperature from atsutane, thanks! 2009-05-22 21:24:28 +02:00
Michael Stapelberg
b7bf1dd722 Implement flags for batteries to use the last full capacity. This breaks configfiles. 2009-05-01 17:53:27 +02:00
Michael Stapelberg
ac39765685 Display 0 instead of negative values for remaining time
This could happen with new batteries which are charged further than
their design capacity is
2009-05-01 15:32:51 +02:00
Michael Stapelberg
086c2ffe2f Enable expandtab, retab! source 2009-04-30 19:47:19 +02:00