Also available on Github: https://github.com/Seednode/roulette
Go to file
Seednode 76e1ad90f7 Added contact info to readme 2022-11-10 23:33:20 -06:00
cmd Images are now centered, both vertically and horizontally 2022-11-10 23:24:14 -06:00
licenses Added licenses 2022-09-09 19:01:52 -05:00
vendor Updated transitive dependencies 2022-11-10 00:31:50 -06:00
.gitignore Initial commit 2022-09-08 10:12:06 -05:00
LICENSE Initial commit 2022-09-08 10:12:06 -05:00
README.md Added contact info to readme 2022-11-10 23:33:20 -06:00
build.sh Re-enabled Windows builds 2022-10-23 16:49:32 -05:00
go.mod Updated transitive dependencies 2022-11-10 00:31:50 -06:00
go.sum Updated transitive dependencies 2022-11-10 00:31:50 -06:00
main.go Initial commit 2022-09-08 10:12:06 -05:00

README.md

About

Sometimes, you just need a way to randomly display images from your filesystem.

Simply point this tool at one or more directories, and then open the specified port (default 8080) in your browser.

A new image will be selected if you open / directly, or if you click on any displayed image.

Browser history is preserved, so you can always go back to any previously displayed image.

Supported file types and extensions are bmp, gif, jp[e]g, png, and webp.

Feature requests, code criticism, bug reports, general chit-chat, and unrelated angst accepted at roulette@seedno.de.

Builds available here.

Filtering

You can provide a comma-delimited string of alphanumeric patterns to match via the include= query parameter, assuming the -f|--filter flag is enabled.

Only filenames matching one or more of the patterns will be served.

You can also provide a comma-delimited string of alphanumeric patterns to exclude, via the exclude= query parameter.

Filenames matching any of these patterns will not be served.

You can also combine these two parameters, with exclusions take priority over inclusions.

Both filtering parameters ignore the file extension and full path; they only compare against the bare filename.

Sorting

You can specify a sorting pattern via the sort= query parameter, assuming the -s|--sort flag is enabled.

A value of sort=asc means files will be served in ascending order (lowest-numbered to highest).

If a file exists with a numbered suffix one higher than the currently displayed file, it will be served next.

A value of sort=desc means files will be served in descending order (highest-numbered to lowest).

If a file exists with a numbered suffix one lower than the currently displayed file, it will be served next.

In either case, if no sequential file is found, a new random one will be chosen.

For sort=asc, the lowest-numbered file matching a given name will be served first.

For sort=desc, the highest-numbered file will be served instead.

If any other (or no) value is provided, the selected file will be random.

Note: These patterns require sequentially-numbered files matching the following pattern: filename###.extension.

Refresh

If a non-zero refresh=<time in seconds> query parameter is provided, the page will reload after that interval.

This can be used to generate a sort of slideshow of images.

Usage output

Usage:
  roulette <path> [path2]... [flags]
  roulette [command]

Available Commands:
  completion  Generate the autocompletion script for the specified shell
  help        Help about any command
  version     Print version

Flags:
  -c, --cache         only scan directories once, at startup (incompatible with --filter)
  -f, --filter        enable filtering via query parameters (incompatible with --cache)
  -h, --help          help for roulette
  -p, --port uint16   port to listen on (default 8080)
  -r, --recursive     recurse into subdirectories
  -s, --sort          enable sorting via query parameters
  -v, --verbose       log accessed files to stdout

Use "roulette [command] --help" for more information about a command.