Code Monkey home page Code Monkey logo

unsplash-wallpaper's Introduction

unsplash-wallpaper

Use an image from unsplash.com as your background image from a simple command.

Koala search screenshot

This downloads an image from source.unsplash.com and assigns it as the background image for the active main screen.

Tested on Mac, Windows and Ubuntu. (should work on every Linux).

Install

# NPM
$ npm i -g unsplash-wallpaper

# Yarn
$ yarn global add unsplash-wallpaper

Usage

$ unsplash-wallpaper --help

  -r, --random 
    Get a random image.
    $ unsplash-wallpaper --random

  -a, --daily 
    Get a fixed daily image.
    $ unsplash-wallpaper --user erondu --daily

  -e, --weekly 
    Get a fixed weekly image.
    $ unsplash-wallpaper --search water --weekly

  -f, --featured 
    Limit the results to the curated collections.
    $ unsplash-wallpaper -f --search montreal

  -w, --width {Number}
    Set the width of desired image.
    $ unsplash-wallpaper --width 2880 --save-config

  -h, --height {Number}
    Set the height of desired image.
    $ unsplash-wallpaper --width 2880 --height 1800 --save-config

  -d, --dir {String}
    Download the image to a specific directory.
    "." uses the current working directory.
    "./" stores the current working directory even when it changes.
    $ unsplash-wallpaper --dir "/Users/Shared
    $ unsplash-wallpaper --dir "C:UsersPublic
    $ unsplash-wallpaper -d .

  -s, --save-config 
    Saves any width, height or dir value in a config file.
    $ unsplash-wallpaper -s --width 1600 --height 1200
    Leave the values blank to reset width and height:
    $ unsplash-wallpaper -whs

  -p, --photo {PHOTO ID}
    Get a specific image by the photo ID.
    $ unsplash-wallpaper -p WLUHO9A_xik
    $ unsplash-wallpaper --photo="-oWyJoSqBRM"

  -c, --category {CATEGORY NAME}
    Get a photo in a category.
    $ unsplash-wallpaper --category nature

  -u, --user {USERNAME}
    Get a photo from a specific user.
    $ unsplash-wallpaper -u erondu

  -l, --likes {USERNAME}
    Get a photo liked by a user.
    $ unsplash-wallpaper --likes jackie

  -o, --collection {COLLECTION ID}
    Get a photo apart of a specific collection.
    $ unsplash-wallpaper --collection 190727

  -q, --search {KEYWORD,KEYWORD}
    Get a photo from a search query.
    $ unsplash-wallpaper -q nature,water
    $ unsplash-wallpaper -q="water falls"

  -v, --version 

  --help 

Thanks

This program wouldn't be possible without

unsplash-wallpaper's People

Contributors

cuth avatar insign avatar scips avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

unsplash-wallpaper's Issues

Fails after image download on latest Ubuntu

sudo unsplash-wallpaper --user erondu --daily
Request https://source.unsplash.com/user/erondu/daily
Downloading [==============================================================================================================]
✔︎ Image saved to /home/darrylwright/wallpaper-photo-1434315137270-a8fa0f484639.jpg
✗ Command failed: which -a gsettings; which -a setroot; which -a pcmanfm; which -a feh; which -a nitrogen; which -a xfconf-query; which -a gconftool-2; which -a dcop; which -a dconf; which -a qdbus

How to set proxy ?

How to set proxy to get images from unsplash. As of now, its failing as I am behind proxy and it can not reach the host to get images.

Not Working on Windows

How i use this on windows? Opening the js file doesn't work.
Where should i put the files in?

Sorry Newbie

not working on default ubuntu 16.10 install

niedakh@niedakh-Latitude-E6520:~$ unsplash-wallpaper 
/usr/local/lib/node_modules/unsplash-wallpaper/cli.js:6
const { boolOptions, minimistAliases, triggerDownload } = require('./lib/args');
      ^

SyntaxError: Unexpected token {
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:374:25)
    at Object.Module._extensions..js (module.js:417:10)
    at Module.load (module.js:344:32)
    at Function.Module._load (module.js:301:12)
    at Function.Module.runMain (module.js:442:10)
    at startup (node.js:136:18)
    at node.js:966:3
niedakh@niedakh-Latitude-E6520:~$

Feature request: Blur and/or darken

First of all, thanks for this great and simple application. It really spices up my wallpaper game.

One thing I would love to see is the option to blur and/or darken the wallpapers (--blur --darken). This way wallpapers are never too "busy" or "in your face".

A similar application on my Android phone does this pretty well (Muzei + Muzei Unsplash).

feature: cli exit code

Return code could be useful for scripting. For example, I always keep only one image file in my wallpapers folder. If download was succesful, I would like to remove previous wallpaper, but I have no way of knowing if new image was actually downloaded.

In theory I could write some hacky script, that checks, if file count in folder has increased, but exit code seems more elegant solution.

Failure to set downloaded image as wallpaper in a Desbian Stretch install

Evening.

In a unmodified installation of your application, I'm getting the following error after downloading an image: ✗ Command failed: which -a gsettings; which -a setroot; which -a pcmanfm; which -a feh; which -a nitrogen; which -a xfconf-query; which -a gconftool-2; which -a dcop; which -a dconf; which -a qdbus

In Linux doesn't change the background

If I understood the goal of this module when I put "unsplash-wallpaper random" the script must set the desktop background with the image already downloaded through the "wallpaper" module .link to module!.
Why doesn't work on Ubuntu? or I don't understand the goal of this script?

the wallpaper is a pure color of black

First of all, let me know that this tool is awesome, thanks for it.
All of the package work well on my computer.
But everytime I start my computer, the windows wallpaper is a pure color of black.
In addition, the system is Win10, node version is v8.9.3, npm version is 5.5.1

Error: read ECONNRESET

I am running [email protected]

➜ ~ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04.1 LTS
Release: 18.04
Codename: bionic

➜ ~ unsplash-wallpaper -v
version 6.2.0

➜ ~ unsplash-wallpaper -r
Request https://source.unsplash.com/random
Downloading [===================================================================================================================================== ]
internal/streams/legacy.js:59
throw er; // Unhandled stream error in pipe.
^

Error: read ECONNRESET
at _errnoException (util.js:992:11)
at TLSWrap.onread (net.js:618:25)

Photo: We couldn't find that photo

First of all, let me know that this tool is awesome, thanks for it.
I'm putting this issue here to discuss it, I'll propose a solution via a pull request if you find this is appropriate.

My use case:
I'm on ubuntu and I use a cron that call a shell script (to setup all the info needed to access the current wallpaper ubuntu service) that runs your script.
I change the picture every 5 minutes (night & day 24/7 ...)
So I have a lot of chance to come across an issue more than someone that run it manually daily.

This time I got the picture: https://images.unsplash.com/photo-1446704477871-62a4972035cd?fit=crop&fm=jpg&h=800&q=50&w=1200 (or a similar one, this one is from a random google image search)

So what would have been expected (from my point of view): to have an error that I can handle further on in my script

Feature request: no random name

Dear,

With my intensive usage of the application I start to have disk space issues.
So I'm thinking about using unique name for picture instead of random name.

Why, because I'm running the application 24/7 every 5 minutes and after a week I'm about: 10k picture... but I'm taking picture from a collection of 192 pictures (and counting) so I got about 50 times each picture.

If I can have a parameter such as --skip-if-already-downloaded and --use-picture-id-as-filename I could overcome this problem.

Please consider this as a discussion for a future pull request I'll make if it make sens.

Regards,

Sébastien

Specify fit

Noticed that the redirect to the image always defaults to fit=crop, it'd be great to be able to specify a fit. e.g. fit=max and save it as a configuration.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.