Commit Graph

44 Commits

Author SHA1 Message Date
Sepherosa Ziehau 28399bf846 disk_info: BSDs use f_bsize instead of f_frsize. 2021-12-19 22:38:08 +01:00
Robert Nagy f3b9ad2086
use statvfs(3) on OpenBSD (#472) 2021-12-15 13:29:58 +01:00
Baptiste Daroussin db279644c3
Fix freebsd (#464)
* FreeBSD: catchup with the internal changes in code

* FreeBSD: use statvfs instead on statfs

Follow NetBSD here while here, catch up with code architecture changes
2021-11-25 08:55:33 +01:00
Michael Stapelberg 73c6eb2d4c use param structs everywhere for consistency 2021-11-02 21:45:31 +01:00
Michael Stapelberg 9a6f96b309 disk: fix colors (+param struct) 2021-11-02 21:16:25 +01:00
Orestis Floros 24c417966e
Fix fall-through warnings 2020-05-01 19:09:35 +02:00
tripledonkey d088baea4f
use statvfs f_frsize for file system block size (#405)
* use statvfs f_frsize for file system block size
2020-04-08 16:06:35 +02:00
Felix Buehler e60eb9f3d1 use format_placeholder for disk.info 2020-03-03 21:32:49 +01:00
Michael Stapelberg a57cdc84e2
Switch to autotools (#316) 2019-01-23 08:56:40 +01:00
eplanet e545525148 Read /proc/mounts if /etc/mtab can't be read 2018-11-08 07:59:15 +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 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
Kenneth Lyons 8e12ad8308 disk: don't remove trailing slash if path is a single character 2017-03-10 11:24:56 -08:00
Michael Stapelberg 27952b11f7 disk: sanitize trailing slashes
fixes #200
2017-03-08 19:22:22 +01: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 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 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
Michael Stapelberg fad9c8237c Bugfix: check that format_not_mounted is not NULL before using it
This issue was introduced with commit 75a83574.

fixes #92
2016-01-12 09:50:44 +01:00
Brendan Van Hook a13b2e7288 Added support for lemonbar 2015-10-04 14:52:32 -04:00
Alexis Hildebrandt 80e7b83d54 Add ifdef to compile print_disk_info on Mac 2015-07-06 15:48:39 +02:00
Ingo Bürk 75a835742e Use format_not_mounted if the directory for a disk_info block does not exist.
This is useful for dynamically mounted devices like thumb drives that get mounted into a directory such as
'/media/$UID/$NAME'.

fixes #33
2015-05-29 08:43:29 +02:00
Baptiste Daroussin e9fc4c1c06 Fix build on FreeBSD 2015-03-25 08:03:23 +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 562a879f7c removing Yoda-Style
adding some words in the manpage
2015-02-22 18:25:12 +01:00
Christian Kohlstedde 85bb373095 Adding optional configuration option to "print_disk_info". 2015-02-18 23:43:25 +01:00
Christian Kohlstedde f7b25a15dd Excluding the code on BSD systems. 2015-02-18 22:11:57 +01:00
Christian Kohlstedde 014e66563f Make the code more readable. 2015-02-18 22:11:16 +01:00
Christian Kohlstedde e70ea4247f Modify print_disk_info. Now there is no output if the path is no mountpoint. 2015-02-18 16:53:24 +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
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
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
Scott Tincman 0eeded8bc0 DragonFlyBSD support added 2012-11-15 12:31:17 +01:00
Michael Stapelberg d6b8a4efc1 introduce percentages for all values, document them 2012-08-31 14:16:58 +02:00
gereon 50ad0334f6 adding percentage format string for disk info module
explicit cast to double, changed format string to percentage
2012-08-31 14:07:46 +02:00
Jasper Lievisse Adriaanse 688d300646 Fix disk usage on OpenBSD. 2012-04-29 11:13:14 +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
Baptiste Daroussin be61907ad5 FreeBSD: fix disk usage print 2011-12-09 23:39:01 +00:00
Mirko Augsburger 28ba2ae892 disk_info: implement %avail 2010-06-25 01:24:26 +02:00
Michael Stapelberg 6823fbf055 disk: also round when printing TB (Thanks Merovius) 2010-01-10 11:07:21 +01:00
Michael Stapelberg cb9bab4255 Bugfix: Cast the integers to uint64_t *before* multiplying (Thanks msi)
This fixes problems on 32-bit computers.
2009-10-16 00:25:05 +02:00
Michael Stapelberg c4c17294ad Cleanup disk "module" 2009-10-12 00:53:47 +02:00
Michael Stapelberg 783707906c Implement disk info (%free/%used/%total) 2009-10-11 23:27:26 +02:00