diff options
-rwxr-xr-x | fbgs | 4 | ||||
-rw-r--r-- | fbi.c | 8 | ||||
-rw-r--r-- | fbi.man | 1 | ||||
-rw-r--r-- | fbiconfig.c | 5 | ||||
-rw-r--r-- | fbiconfig.h | 2 |
5 files changed, 16 insertions, 4 deletions
@@ -1,8 +1,8 @@ #!/bin/bash # tmp dir -DIR="${TMPDIR-/var/tmp}/fbps-$$" -mkdir -p $DIR || exit 1 +DIR="$(mktemp -dtp ${TMPDIR-/var/tmp} fbgs-XXXXXX)" +test -d "$DIR" || exit 1 trap "rm -rf $DIR" EXIT # parse options @@ -120,6 +120,7 @@ static float fbgamma = 1; /* Command line options. */ int autodown; int autoup; +int autofirst; int comments; int transparency = 40; @@ -155,8 +156,8 @@ usage(char *name) "\n", name); - cfg_help_cmdline(fbi_cmd,4,20,0); - cfg_help_cmdline(fbi_cfg,4,20,40); + cfg_help_cmdline(stderr,fbi_cmd,4,20,0); + cfg_help_cmdline(stderr,fbi_cfg,4,20,40); fprintf(stderr, "\n" @@ -1181,6 +1182,7 @@ main(int argc, char *argv[]) once = GET_ONCE(); autoup = GET_AUTO_UP(); autodown = GET_AUTO_DOWN(); + autofirst = GET_AUTO_FIRST(); fitwidth = GET_FIT_WIDTH(); statusline = GET_VERBOSE(); textreading = GET_TEXT_MODE(); @@ -1259,6 +1261,8 @@ main(int argc, char *argv[]) scale = 1; if (scale > 1 && !autoup) scale = 1; + if (autofirst) + autoup = autodown = 0; } if (scale != 1) { snprintf(linebuffer, sizeof(linebuffer), @@ -96,6 +96,7 @@ V enable/disable status line H display textbox with brief help I display textbox with some EXIF info <number>g jump to image #<number> +<number>s set zoom to <number>% .fi .P The Return vs. Space key thing can be used to create a file list while diff --git a/fbiconfig.c b/fbiconfig.c index a6d1061..eec7fd0 100644 --- a/fbiconfig.c +++ b/fbiconfig.c @@ -61,6 +61,11 @@ struct cfg_cmdline fbi_cfg[] = { .yesno = 1, .desc = " like the above, but downscale only", },{ + .cmdline = "autofirst", + .option = { O_AUTO_FIRST }, + .yesno = 1, + .desc = " autoscale first image only", + },{ .cmdline = "fitwidth", .option = { O_FIT_WIDTH }, .yesno = 1, diff --git a/fbiconfig.h b/fbiconfig.h index 49ca23c..099907b 100644 --- a/fbiconfig.h +++ b/fbiconfig.h @@ -12,6 +12,7 @@ #define O_AUTO_UP O_OPTIONS, "auto-up" #define O_AUTO_DOWN O_OPTIONS, "auto-down" +#define O_AUTO_FIRST O_OPTIONS, "auto-first" #define O_FIT_WIDTH O_OPTIONS, "fit-width" #define O_QUIET O_OPTIONS, "quiet" #define O_VERBOSE O_OPTIONS, "verbose" @@ -41,6 +42,7 @@ #define GET_AUTO_UP() cfg_get_bool(O_AUTO_UP, 0) #define GET_AUTO_DOWN() cfg_get_bool(O_AUTO_DOWN, 0) +#define GET_AUTO_FIRST() cfg_get_bool(O_AUTO_DOWN, 0) #define GET_FIT_WIDTH() cfg_get_bool(O_FIT_WIDTH, 0) #define GET_QUIET() cfg_get_bool(O_QUIET, 0) #define GET_VERBOSE() cfg_get_bool(O_VERBOSE, 1) |