From c0649c4b2a7c824abc743fa59457221e2bc3ab21 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sun, 24 Nov 2013 23:29:15 +0100 Subject: thumbnail mode: if --action is set, run it instead of opening images --- ChangeLog | 2 ++ man/feh.pre | 3 ++- src/events.c | 8 ++++++-- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index dcce150..936fb72 100644 --- a/ChangeLog +++ b/ChangeLog @@ -6,6 +6,8 @@ git HEAD display on startup * Fix off-by-one pixel error when warping the pointer in the bottom/right window border + * thumbnail mode: If --action is set, run specified command instead of + opening image on click. Tue, 11 Jun 2013 08:27:24 +0200 Daniel Friesel diff --git a/man/feh.pre b/man/feh.pre index ffbf933..6831a6e 100644 --- a/man/feh.pre +++ b/man/feh.pre @@ -136,7 +136,8 @@ For animated images, only the first frame is shown. Specify a shell command as an action to perform on the image. In slideshow or multiwindow mode, the action will be run when the action_0 key is pressed, in list mode, it will be run for each file. In loadable/unloadable mode, it will -be run for each loadable/unloadable file, respectively. +be run for each loadable/unloadable file, respectively. In thumbnail mode, +clicking on an image will cause the action to run instead of opening the image. . .Pp . diff --git a/src/events.c b/src/events.c index 15fd0fa..92b6e69 100644 --- a/src/events.c +++ b/src/events.c @@ -378,8 +378,12 @@ static void feh_event_handle_ButtonRelease(XEvent * ev) x /= winwid->zoom; y /= winwid->zoom; thumbfile = feh_thumbnail_get_file_from_coords(x, y); - if (thumbfile) - feh_thumbnail_show_fullsize(thumbfile); + if (thumbfile) { + if (opt.actions[0]) + feh_action_run(thumbfile, opt.actions[0]); + else + feh_thumbnail_show_fullsize(thumbfile); + } } } else { opt.mode = MODE_NORMAL; -- cgit v1.2.3