Skip to content

berkerol/photo-of-the-day

Repository files navigation

Photo of the Day

NPM

Sonarcloud Status CI contributions welcome semistandard ECMAScript license

Downloads Bing Photo of the Day, NASA Astronomy Picture of the Day, National Geographic Photo of the Day, Unsplash Source Random Photo and sets it as wallpaper.

Features

  • Choose Bing, NASA, National Geographic or Unsplash photos.
  • Set date, locale & resolution for Bing photos.
  • Use custom API key for NASA.
  • Set date for NASA & National Geographic photos.
  • Choose a random photo from NASA & National Geographic & Unsplash.
  • Set resolution for Unsplash photos.
  • Set background display option for Linux.
  • Stores all photos in ~/Pictures/Bing, ~/Pictures/NASA, ~/Pictures/National Geographic, ~/Pictures/Unsplash.
  • Runs at startup automatically.

Supported Desktops

  • Mac OS X
  • Linux GNOME
  • Linux Unity

Options

  • Bing Date (# of days before): 0 (default), 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14
  • Bing Locales: ar-XA, bg-BG, cs-CZ, da-DK, de-AT, de-CH, de-DE, el-GR, en-AU, en-CA, en-GB, en-ID, en-IE, en-IN, en-MY, en-NZ, en-PH, en-SG, en-US (default), en-XA, en-ZA, es-AR, es-CL, es-ES, es-MX, es-US, es-XL, et-EE, fi-FI, fr-BE, fr-CA, fr-CH, fr-FR, he-IL, hr-HR, hu-HU, it-IT, ja-JP, ko-KR, lt-LT, lv-LV, nb-NO, nl-BE, nl-NL, pl-PL, pt-BR, pt-PT, ro-RO, ru-RU, sk-SK, sl-SL, sv-SE, th-TH, tr-TR, uk-UA, zh-CN, zh-HK, zh-TW
  • Bing & Unsplash Resolutions: 800x600, 1024x768, 1280x720, 1280x768, 1366x768, 1920x1080 (default), 1920x1200 (watermarked for Bing)
  • Linux Background Display Options: wallpaper, centered, scaled, stretched, zoom (default), spanned

Installation

$ npm install photo-of-the-day

Run at startup

$ cd startup
$ ./autostart.sh

You must install it globally first in order to use this feature. You can customize the startup command in potd.plist (for Mac OS X) or potd.desktop (for Linux) file.

Usage

Flag Short Description Usage
--nasa -n Choose NASA photo -n
--ng -N Choose National Geographic photo -N
--unsplash -u Choose Unsplash photo -u
--before -b Set date for Bing -b 1
--locale -l Set locale for Bing -l en-GB
--resolution -r Set resolution for Bing & Unsplash -r 1920x1200
--key -k Set API key for NASA -k SOME_API_KEY
--date -d Set date for NASA or National Geographic (YYYY-mm-dd) -d 2019-06-19
--random -R Choose a random photo from NASA or National Geographic or Unsplash -R
--wallpaper -w Don't set downloaded photo as wallpaper (can be used for bulk downloading) -w
--option -o Set background display option for Linux -o centered

Examples

Example Description
$ potd Sets wallpaper as Bing photo
$ potd -n Sets wallpaper as NASA photo
$ potd -N Sets wallpaper as National Geographic photo
$ potd -u Sets wallpaper as Unsplash photo
$ potd -b 1 Sets wallpaper as Bing from yesterday
$ potd -l en-GB Sets wallpaper as Bing from Great Britain
$ potd -r 1920x1200 Sets wallpaper as Bing with 1920x1200 resolution
$ potd -b 1 -l en-GB -r 1920x1200 Sets wallpaper as Bing from yesterday and Great Britain with 1920x1200 resolution
$ potd -n -k SOME_API_KEY Sets wallpaper as NASA using specified API key
$ potd -n -d 2019-06-18 Sets wallpaper as NASA from 2019-06-18
$ potd -n -R Sets wallpaper as a random NASA photo
$ potd -n -k SOME_API_KEY -d 2019-06-18 Sets wallpaper as NASA from 2019-06-18 using specified API key
$ potd -n -k SOME_API_KEY -R Sets wallpaper as a random NASA photo using specified API key
$ potd -N -d 2019-06-06 Sets wallpaper as National Geographic from 2019-06-06
$ potd -N -R Sets wallpaper as a random National Geographic photo
$ potd -u -r 1920x1200 Sets wallpaper as Unsplash with 1920x1200 resolution
$ potd -u -R Sets wallpaper as a random Unsplash photo
$ potd -u -r 1920x1200 -R Sets wallpaper as a random Unsplash photo with 1920x1200 resolution
$ potd -w Only downloads Bing photo (doesn't set it as wallpaper)
$ potd -o centered Wallpaper centered on desktop

TODO

  • Run at startup
  • Bing Photo of the Day
  • NASA Astronomy Picture of the Day
  • National Geographic Photo of the Day
  • Unsplash Source Random Photo
  • Date option for Bing
  • Locale option for Bing
  • Resolution option for Bing
  • Custom API key for NASA
  • Date option for NASA
  • Random option for NASA
  • Date option for National Geographic
  • Random option for National Geographic
  • Resolution option for Unsplash
  • Random option for Unsplash
  • Background display option for Linux
  • Windows 10 (saves image but can't set as wallpaper)
  • Mac OS X
  • Linux GNOME & Unity
  • Other Linux desktops

Continous Integration

It is setup using GitHub Actions in .github/workflows/lint.yml

Contribution

Feel free to contribute according to the semistandard rules and latest ECMAScript Specification.

Distribution

You can distribute this software freely under GNU GPL v3.0.