diff options
-rw-r--r-- | doc/imv.1.txt | 3 | ||||
-rw-r--r-- | src/imv.c | 3 |
2 files changed, 6 insertions, 0 deletions
diff --git a/doc/imv.1.txt b/doc/imv.1.txt index 6474036..98b4498 100644 --- a/doc/imv.1.txt +++ b/doc/imv.1.txt @@ -161,6 +161,9 @@ When imv executes a shell command, it provides a number of environment variables exposing imv's state. These environment variables are also available when customising the window's title, or the overlay text. +*$imv_pid*:: + The pid of this instance of imv. Useful for running imv-msg in scripts. + *$imv_current_file*:: Path of currently selected image. @@ -1675,6 +1675,9 @@ static void update_env_vars(struct imv *imv) { char str[64]; + snprintf(str, sizeof str, "%d", getpid()); + setenv("imv_pid", str, 1); + setenv("imv_current_file", imv_navigator_selection(imv->navigator), 1); setenv("imv_scaling_mode", scaling_label[imv->scaling_mode], 1); setenv("imv_loading", imv->loading ? "1" : "0", 1); |