Code Monkey home page Code Monkey logo

daylight-wallpaper's Introduction

daylight-wallpaper

A simple script to set certain wallpapers at various times during the day depending on the current daylight at your location.

The script will try to guess the location if no coordinates are provided. However, it's faster and more precise to set the coordinates manually as described below.

You can use this with any type of pictures, but it works very well with landscape photos that change as the day progresses, such as used by a very popular closed source operating system based in California. I'm sure you can find such pictures by using your favorite search engine, I don't want to include any for copyright reasons. But it will work with any images you seem fit. Just rename the files in accordance with the help text instructions.

Example usage

I recommend using this with cron and a few environment variables as such:

*/10 * * * * . $HOME/.profile; DISPLAY=:0 /usr/bin/bash $HOME/bin/daylight_wallpaper.sh -x $LATITUDE -y $LONGITUDE -f $WALLPAPER_FOLDER

The following works very well on Ubuntu 20.04:

*/10 * * * * . $HOME/.profile; DISPLAY=:0.0 dbus-launch --exit-with-session /usr/bin/bash $HOME/bin/daylight_wallpaper.sh -x $LATITUDE -y $LONGITUDE -f $WALLPAPER_FOLDER -g

Set the $LATITUDE, $LONGITUDE, and $WALLPAPER_FOLDER variables in your ~/.profile or similar.

You can also write them out explicitly.

Credit

This script uses the API at Sunrise-Sunset as well as IP-API.

daylight-wallpaper's People

Contributors

johanthoren avatar

Watchers

 avatar

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.