Fetch a random image from a website.
Find a file
finga 1b05a83a38 Allow fetching an image without using the cache
In order to allow fetching an image on-the-fly (without using the
cache) several functions were split up into smaller functions to gain
more flexibility. With that reorganization it is now possible to use
the `-n` or `--no-cache` flag when downloading an image. By using this
flag the cache is ignored.
2025-08-22 22:42:44 +02:00
src Allow fetching an image without using the cache 2025-08-22 22:42:44 +02:00
.gitignore Fetch images from a certain website 2025-08-18 18:12:06 +02:00
Cargo.lock chores: Bump dependencies 2025-08-22 22:13:28 +02:00
Cargo.toml cargo: Add package definitions 2025-08-22 22:24:32 +02:00
CHANGELOG.md Allow fetching an image without using the cache 2025-08-22 22:42:44 +02:00
README.md Allow fetching an image without using the cache 2025-08-22 22:42:44 +02:00

PicFetchRS

A small tool to fetch a random image from a website.

Install

Use cargo install --path . to install picfetchrs.

Configuration

If the -c, --config-file option is not used a configuration file is expected to be in one of the following locations:

  • /etc/picfetchrs/config.toml
  • $XDG_CONFIG_HOME/picfetchrs/config.toml or $HOME/.config/picfetchrs/config.toml
  • the config.toml in the local directory picfetchrs is called from

Supported parameters

Optional fields are commented out and filled with their default values where applicable.

# cache = ""
# log-level = "info"

[server]
url = "https://some.url"
# username = ""
# password = ""

Usage

The picfetchrs binary may be called directly, as a systemd service or a window manager/desktop environment's autostart task.

CLI

The following options and commands are available.

Fetch a random image from a website.

Usage: picfetchrs [OPTIONS] [COMMAND]

Commands:
  background  Download a random picture and set it as background
  download    Download a random picture
  update      Update the URL cache
  help        Print this message or the help of the given subcommand(s)

Options:
  -c, --config-file <FILE>  Set a specific config file
  -l, --log-level <LEVEL>   Set a log level [env: RUST_LOG=] [default: INFO]
  -h, --help                Print help
  -V, --version             Print version

Options

The following options are available.

-c, --config-file

Pass a path to a FILE used as configuration for PicFetchRs.

-l, --log-level

The following log levels are available: trace, debug, info, warn and error.

-h, --help

Print the help.

-V, --version

Print the version.

Commands

The following commands are available. When no command was given the background is called by default.

background

Same as the download command but also sets the downloaded image as background.

download

Download a random image.

-n, --no-cache

Do not write or use the cache.

help

Print the help or the help of a command.

update

Update the cache of image urls.