in

Daypaper sets your GNOME wallpaper based on the time of day from a random and relevant Unsplash image


Daypaper sets your GNOME wallpaper based on the time of day from a random and relevant Unsplash image.

  1. here after registration.
  2. Create the necessary configuration files:
mkdir ~/.config/daypaper/
touch ~/.config/daypaper/.token
  1. Paste your Access Token inside .token
  2. Clone this repository
  3. Run go install
  4. You’re ready to go!

Usage

$: daypaper -h
Usage:
  daypaper [OPTIONS]

Application Options:
  -f, --force                                       Forces a wallpaper refresh even when in the same time span
  -t, --time=[morning|noon|afternoon|evening|night] Specify a particular time of day
  -s, --search=                                     Additional text query to be added while searching
  -q, --quality=                                    The downloaded image quality (default: 75)
  -e, --ext=                                        The downloaded image extension (default: jpg)
  -w, --width=                                      The downloaded image width (default: 1920)
  -a, --api=                                        The API endpoint (default: https://api.unsplash.com/photos/random)

Help Options:
  -h, --help                                        Show this help message

The simplest way to activate daypaper is to run it every hour:

$: crontab -e

0 * * * * ~/go/bin/daypaper > ~/.daypaper.log

Daypaper will contact the API only when needed (i.e. the current day period has changed).

The periods are defined like this:

h := time.Now().Hour()

if h >= 7 && h <= 11 {
    return "morning"
} else if h >= 12 && h <= 14 {
    return "noon"
} else if h >= 15 && h <= 17 {
    return "afternoon"
} else if h >= 18 && h <= 21 {
    return "evening"
}

return "night"

View Github




Leave a Reply

Your email address will not be published. Required fields are marked *

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

GIPHY App Key not set. Please check settings

Make a Custom Right Click Menu with Javascript

What is Blitz.js & How to Get Started With It