I have found the "geeqie --remote file:/tmp/my-next-image.jpeg" feature to be
particularly useful. I often find myself wanting to do the inverse: to ask
geeqie "what file are you viewing right now?"
Here is my proposal:
diff --git a/src/remote.c b/src/remote.c
index c89eff9..59c6a84 100644
--- a/src/remote.c
+++ b/src/remote.c
@@ -522,6 +522,13 @@ static void gr_file_load(const gchar *text, GIOChannel
*channel, gpointer data)
g_free(filename);
}
+static void gr_file_tell(const gchar *text, GIOChannel *channel, gpointer data)
+{
+ LayoutWindow *lw = NULL; /* NULL to force layout_valid() to do some
magic */
+ if (!layout_valid(&lw)) return;
+ printf("%s\n", image_get_path(lw->image));
+}
+
static void gr_config_load(const gchar *text, GIOChannel *channel, gpointer
data)
{
gchar *filename = expand_tilde(text);
@@ -666,6 +673,7 @@ static RemoteCommandEntry remote_commands[] = {
{ NULL, "--get-sidecars:", gr_get_sidecars, TRUE, FALSE,
N_("<FILE>"), N_("get list of sidecars of FILE") },
{ NULL, "--get-destination:", gr_get_destination, TRUE, FALSE,
N_("<FILE>"), N_("get destination path of FILE") },
{ NULL, "file:", gr_file_load, TRUE, FALSE,
N_("<FILE>"), N_("open FILE") },
+ { NULL, "--tell", gr_file_tell, FALSE, FALSE,
NULL, N_("print filename of current image") },
{ NULL, "view:", gr_file_view, TRUE, FALSE,
N_("<FILE>"), N_("open FILE in new window") },
{ NULL, "--list-clear", gr_list_clear, FALSE, FALSE,
NULL, N_("clear command line collection list") },
{ NULL, "--list-add:", gr_list_add, TRUE, FALSE,
N_("<FILE>"), N_("add FILE to command line collection list") },
--
Paul.
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Geeqie-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geeqie-devel