summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2018-04-04 08:35:11 +0200
committerDaniel Friesel <derf@finalrewind.org>2018-04-04 08:35:11 +0200
commit1e212f65c87fd634c738b4c79e1ffed5c29b039d (patch)
tree402dec61cff929013dadbb459c093d5fc1c635e4 /src
parentf8640490308f29de951b7b59f07be8b744f6e895 (diff)
Add %g and %Z format specifiers (closes #391)
Diffstat (limited to 'src')
-rw-r--r--src/slideshow.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/slideshow.c b/src/slideshow.c
index effdcaf..7bad2c9 100644
--- a/src/slideshow.c
+++ b/src/slideshow.c
@@ -468,6 +468,12 @@ char *feh_printf(char *str, feh_file * file, winwidget winwid)
if (file)
strncat(ret, shell_escape(file->filename), sizeof(ret) - strlen(ret) - 1);
break;
+ case 'g':
+ if (winwid) {
+ snprintf(buf, sizeof(buf), "%d,%d", winwid->w, winwid->h);
+ strncat(ret, buf, sizeof(ret) - strlen(ret) - 1);
+ }
+ break;
case 'h':
if (file && (file->info || !feh_file_info_load(file, NULL))) {
snprintf(buf, sizeof(buf), "%d", file->info->height);
@@ -564,6 +570,12 @@ char *feh_printf(char *str, feh_file * file, winwidget winwid)
strncat(ret, "1.00", sizeof(ret) - strlen(ret) - 1);
}
break;
+ case 'Z':
+ if (winwid) {
+ snprintf(buf, sizeof(buf), "%f", winwid->zoom);
+ strncat(ret, buf, sizeof(ret) - strlen(ret) - 1);
+ }
+ break;
case '%':
strncat(ret, "%", sizeof(ret) - strlen(ret) - 1);
break;