summaryrefslogtreecommitdiff
path: root/src/print_disk_info.c
diff options
context:
space:
mode:
authorBrendan Van Hook <me@bsvh.me>2015-10-02 02:28:53 -0400
committerBrendan Van Hook <me@bsvh.me>2015-10-04 14:52:32 -0400
commita13b2e7288e943359ccb37be86efb716efbe98c8 (patch)
treeb17acf7436a8b9de6c6d27aa4d82f01f6b8821aa /src/print_disk_info.c
parentf3125fdfded91144cb9f5b9ea3bf406598f17321 (diff)
Added support for lemonbar
Diffstat (limited to 'src/print_disk_info.c')
-rw-r--r--src/print_disk_info.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/print_disk_info.c b/src/print_disk_info.c
index e5e3ab1..12d7585 100644
--- a/src/print_disk_info.c
+++ b/src/print_disk_info.c
@@ -179,22 +179,22 @@ void print_disk_info(yajl_gen json_gen, char *buffer, const char *path, const ch
}
if (BEGINS_WITH(walk + 1, "percentage_free")) {
- outwalk += sprintf(outwalk, "%.01f%%", 100.0 * (double)buf.f_bfree / (double)buf.f_blocks);
+ outwalk += sprintf(outwalk, "%.01f%s", 100.0 * (double)buf.f_bfree / (double)buf.f_blocks, pct_mark);
walk += strlen("percentage_free");
}
if (BEGINS_WITH(walk + 1, "percentage_used_of_avail")) {
- outwalk += sprintf(outwalk, "%.01f%%", 100.0 * (double)(buf.f_blocks - buf.f_bavail) / (double)buf.f_blocks);
+ outwalk += sprintf(outwalk, "%.01f%s", 100.0 * (double)(buf.f_blocks - buf.f_bavail) / (double)buf.f_blocks, pct_mark);
walk += strlen("percentage_used_of_avail");
}
if (BEGINS_WITH(walk + 1, "percentage_used")) {
- outwalk += sprintf(outwalk, "%.01f%%", 100.0 * (double)(buf.f_blocks - buf.f_bfree) / (double)buf.f_blocks);
+ outwalk += sprintf(outwalk, "%.01f%s", 100.0 * (double)(buf.f_blocks - buf.f_bfree) / (double)buf.f_blocks, pct_mark);
walk += strlen("percentage_used");
}
if (BEGINS_WITH(walk + 1, "percentage_avail")) {
- outwalk += sprintf(outwalk, "%.01f%%", 100.0 * (double)buf.f_bavail / (double)buf.f_blocks);
+ outwalk += sprintf(outwalk, "%.01f%s", 100.0 * (double)buf.f_bavail / (double)buf.f_blocks, pct_mark);
walk += strlen("percentage_avail");
}
}