summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2012-11-13 08:02:53 +0100
committerDaniel Friesel <derf@finalrewind.org>2012-11-13 08:02:53 +0100
commitf9609945e76eef4ce36be9926e18b2383fbb67f3 (patch)
treee5e029dbafc7cb0e9651b8400b4089283c9318d8
parent96d57781be7171d29c7ea0ecbbddc48ad374885c (diff)
downloadfeh-f9609945e76eef4ce36be9926e18b2383fbb67f3.zip
Add %V format specifier (returns feh PID) - patch by 0ion9, closse #109
-rw-r--r--man/feh.pre4
-rw-r--r--src/slideshow.c4
2 files changed, 8 insertions, 0 deletions
diff --git a/man/feh.pre b/man/feh.pre
index c60e15a..701e399 100644
--- a/man/feh.pre
+++ b/man/feh.pre
@@ -873,6 +873,10 @@ Image width
.Nm
version
.
+.It %V
+.
+Process ID
+.
.It %z
.
current image zoom
diff --git a/src/slideshow.c b/src/slideshow.c
index 60bd99c..7dcf791 100644
--- a/src/slideshow.c
+++ b/src/slideshow.c
@@ -508,6 +508,10 @@ char *feh_printf(char *str, feh_file * file, winwidget winwid)
case 'v':
strcat(ret, VERSION);
break;
+ case 'V':
+ snprintf(buf, sizeof(buf), "%d", getpid());
+ strcat(ret, buf);
+ break;
case 'w':
if (file && (file->info || !feh_file_info_load(file, NULL))) {
snprintf(buf, sizeof(buf), "%d", file->info->width);