mirror of
https://github.com/Llewellynvdm/conky.git
synced 2024-11-17 18:45:10 +00:00
* Fixed messed up percentages (fs_free_perc, fs_used_perc, mpd_percent).
git-svn-id: https://conky.svn.sourceforge.net/svnroot/conky/trunk/conky1@1053 7f574dfc-610e-0410-a909-a81674777703
This commit is contained in:
parent
8de47c132d
commit
60985a41e7
@ -1,5 +1,8 @@
|
||||
# $Id$
|
||||
|
||||
2008-03-28
|
||||
* Fixed messed up percentages (fs_free_perc, fs_used_perc, mpd_percent).
|
||||
|
||||
2008-03-24
|
||||
* Fixed for specifying a non-existent configuration file.
|
||||
* Added disk_protect.
|
||||
|
12
src/conky.c
12
src/conky.c
@ -5070,8 +5070,8 @@ static void generate_text_internal(char *p, int p_max_size,
|
||||
OBJ(fs_free_perc) {
|
||||
if (obj->data.fs != NULL) {
|
||||
if (obj->data.fs->size) {
|
||||
spaced_print(p, p_max_size, "%*d", pad_percents,
|
||||
"fs_free_perc", (int) ((obj->data.fs->avail * 100) /
|
||||
spaced_print(p, p_max_size, "%*d", 4, "fs_free_perc",
|
||||
pad_percents, (int) ((obj->data.fs->avail * 100) /
|
||||
obj->data.fs->size));
|
||||
} else {
|
||||
snprintf(p, p_max_size, "0");
|
||||
@ -5108,8 +5108,8 @@ static void generate_text_internal(char *p, int p_max_size,
|
||||
OBJ(fs_used_perc) {
|
||||
if (obj->data.fs != NULL) {
|
||||
if (obj->data.fs->size) {
|
||||
spaced_print(p, 4, "%*d", pad_percents,
|
||||
"fs_used_perc", 100 - ((int) ((obj->data.fs->avail * 100) /
|
||||
spaced_print(p, 4, "%*d", 4, "fs_used_perc",
|
||||
pad_percents, 100 - ((int) ((obj->data.fs->avail * 100) /
|
||||
obj->data.fs->size)));
|
||||
} else {
|
||||
snprintf(p, p_max_size, "0");
|
||||
@ -5639,8 +5639,8 @@ static void generate_text_internal(char *p, int p_max_size,
|
||||
}
|
||||
}
|
||||
OBJ(mpd_percent) {
|
||||
spaced_print(p, p_max_size, "%*d", pad_percents,
|
||||
"mpd_percent", (int) (cur->mpd.progress * 100));
|
||||
spaced_print(p, p_max_size, "%*d", 4, "mpd_percent",
|
||||
pad_percents, (int) (cur->mpd.progress * 100));
|
||||
}
|
||||
OBJ(mpd_bar) {
|
||||
new_bar(p, obj->data.pair.a, obj->data.pair.b,
|
||||
|
Loading…
Reference in New Issue
Block a user