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. |
||
---|---|---|
src | ||
.gitignore | ||
Cargo.lock | ||
Cargo.toml | ||
CHANGELOG.md | ||
README.md |
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 directorypicfetchrs
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.