The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

randim - Download a random image from online sources

SYNOPSIS

  # Default, radim deletes all files in $HOME/Pictures/Desktop-Randim
  # and downloads a random image to that directory. Good for desktop
  # environments that can watch a directory for changes.
  $ randim

  # You can have it set the desktop wallpaper in gnome shell
  $ randim --gnome3

  # Maybe you want to view it in a viewer? Specify the executable with
  # this, or leave it blank for eog
  $ randim --viewer
  $ randim --viewer gwenview

  # Only want to pull from Desktoppr?
  $ randim --source Desktoppr

  # How about Desktoppr and Unsplash both?
  $ randim --source Desktoppr --source Unsplash

  # What plugins are available to pull from (sites)
  $ randim --list-sources

  # I dont't want to look at this man page
  $ randim --help

  # Don't keep me waiting for a response for more than 10 seconds
  $ randim --timeout 10

  # Just grab a random image and exit
  $ randim --no-prompt

  # Unsplash is rate limiting - I'll enter my own API key
  $ randim --unsplash-key 00023fd8ae25887....

DESCRIPTION

Script using the Perl Image::Randim::Source library to pull random images down that people have given out to the world on various websites. This was written for getting new desktop images, and it's always wonderful seeing what other people are creating and sharing for us. :)

Without any options, the program loops continuously after each downloaded image, asking if you want to keep it. So you can just let chance let you stumble on something you like.

It downloads to your home directory by default, into your Pictures folder, into a subdirectory there called Desktop-Randim. This directory gets cleaned out on every single loop so never put anything important there. Of course you can change this behavior.

This is done, for example, because some desktop environments you can set wallpaper changing to watch a directory for files. Just have it watch this directory, and when you download a new image, it will show up as your background, and keep on looping through until you find one you want to keep.

Gnome3 in its forever downward spiral into assuming the dumbest users possible, doesn't let you do something like this, but you can specify --gnome3 and it will set your background for you on each loop iteration.

For me, I just needed something that didn't rely on any one particular desktop environment's plugins to do, since I change environments frequently.

ARGUMENTS

  --list-sources
      List supported sources by installed plugins.
  --show-url
      Show the image URL in the info display.
  --source <name>
      By default all sources are used. Specify --source multiple times
      with a source name to limit images to just those sources.

  --output-dir <dir> (default: $HOME/Pictures/Desktop-Randim/)
      Directory where image will be downloaded. BY DEFAULT THIS MUST BE
      EMPTY AND ALL FILES/DIRECTORIES THERE WILL BE DELETED.

  --no-delete
      Do not delete everything from the --output-dir before downloading.

  --save-to-dir <dir> (default: $HOME/Pictures/Desktop-Saved/)
      Directory where images can be "permanently saved".

  --timeout <seconds> (default: 20)
      How many whole seconds to wait for each Internet request to
      respond.

  --no-prompt
      Just grab a random image and exit.
  --gnome3
      Set the desktop background to the image in Gnome3

  --viewer [<program>] (default: eog)
      Display image in default viewer or the one specified.

  --unsplash-key <key>
      Unsplash requires a so-called developer key. The default one is
      the author's, but they can become rate-limited. If you find that's
      the case for your use, you can register for your own developer
      client key and enter it here.

  --version
      Print the version.

EXAMPLES

I use an icon on a Debian Stretch Cinnamon Desktop to click and walk through random desktops until I find one I like. You just put a file called randim.desktop in your home directory's Desktop folder - and it contains this:

  [Desktop Entry]
  Name=Randim
  Exec=randim --gnome3
  Type=Application
  Categories=AudioVideo
  Comment=Change desktop to a random image
  Encoding=UTF-8
  Icon=image
  Terminal=true

AUTHOR

Mark Rushing <mark@orbislumen.net>

COPYRIGHT AND LICENSE

This software is copyright (c) 2017 by Home Grown Systems, SPC.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.