summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/feh.h2
-rw-r--r--src/keyevents.c5
-rw-r--r--src/slideshow.c3
3 files changed, 9 insertions, 1 deletions
diff --git a/src/feh.h b/src/feh.h
index 25b7398..f81a3c0 100644
--- a/src/feh.h
+++ b/src/feh.h
@@ -93,7 +93,7 @@ enum bgmode_type { BG_MODE_NONE = 0, BG_MODE_TILE, BG_MODE_CENTER,
BG_MODE_SEAMLESS, BG_MODE_SCALE, BG_MODE_FILL
};
-enum slide_change { SLIDE_NEXT, SLIDE_PREV, SLIDE_FIRST, SLIDE_LAST,
+enum slide_change { SLIDE_NEXT, SLIDE_PREV, SLIDE_RAND, SLIDE_FIRST, SLIDE_LAST,
SLIDE_JUMP_FWD,
SLIDE_JUMP_BACK
};
diff --git a/src/keyevents.c b/src/keyevents.c
index 0350c8a..3f3cdcc 100644
--- a/src/keyevents.c
+++ b/src/keyevents.c
@@ -328,6 +328,11 @@ void feh_event_handle_keypress(XEvent * ev)
if (opt.slideshow)
slideshow_change_image(winwid, SLIDE_PREV);
break;
+ case 'z':
+ case 'Z':
+ if (opt.slideshow)
+ slideshow_change_image(winwid, SLIDE_RAND);
+ break;
case 'q':
case 'Q':
winwidget_destroy_all();
diff --git a/src/slideshow.c b/src/slideshow.c
index 0a70347..4835360 100644
--- a/src/slideshow.c
+++ b/src/slideshow.c
@@ -205,6 +205,9 @@ void slideshow_change_image(winwidget winwid, int change)
case SLIDE_PREV:
current_file = feh_list_jump(filelist, current_file, BACK, 1);
break;
+ case SLIDE_RAND:
+ current_file = feh_list_jump(filelist, current_file, FORWARD, rand() % filelist_len);
+ break;
case SLIDE_JUMP_FWD:
if (filelist_len < 5)
jmp = 1;