summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2011-09-29 17:10:19 +0200
committerDaniel Friesel <derf@finalrewind.org>2011-09-29 17:10:19 +0200
commit702db61e222518bf71383e471547c233322b6b7f (patch)
treeb001b87fee715ec1bd2400ec3579c41b90325cc3 /src
parent7281c129a9bf11594179a768aa34213fe69e98ed (diff)
downloadfeh-702db61e222518bf71383e471547c233322b6b7f.zip
feh_printf: Add %S (size in kB)
Diffstat (limited to 'src')
-rw-r--r--src/slideshow.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/slideshow.c b/src/slideshow.c
index 52ef4b3..b9d9494 100644
--- a/src/slideshow.c
+++ b/src/slideshow.c
@@ -419,6 +419,13 @@ char *feh_printf(char *str, feh_file * file)
strcat(ret, buf);
}
break;
+ case 'S':
+ if (file && (file->info || !feh_file_info_load(file, NULL))) {
+ snprintf(buf, sizeof(buf),
+ "%.2fkB", ((double)file->info->size / 1000));
+ strcat(ret, buf);
+ }
+ break;
case 'p':
if (file && (file->info || !feh_file_info_load(file, NULL))) {
snprintf(buf, sizeof(buf), "%d", file->info->pixels);