Giter Club home page Giter Club logo

bashdynamicpaper's Introduction

BashDynamicPaper

Dynamic wallpaper setter written in bash that works on Linux and MacOS. Using all of the features, it will change your wallpaper based both on the time of day and the weather. The time of day is divided into four categories: morning, day, evening, and night. A sunrise/sunset api is used, which means that the code will adjust as the seasons change and night grows shorter or longer. The supported weather types right now are just rain, sun, and snow. If there are more of them you'd like to see I'm more than happy to add support. It requires both jq and feh on linux. On mac it still requires jq but instead of feh, coreutils (For shuf and gdate). Additionally on both linux and MacOS, if you want to use the embed feature, you will also need imagemagick. The code will also play nicely with pywal should you want to change your themes w/r/t the wallpaper. Right now it uses wttr.in's ability to get the location via IP so if you're using a VPN it might not play nicely.

Example

Example

Usage

USAGE: dynamicWallpaper -p [PAPER_PREFIX]
    -p: The prefix of your wallpaper folder without a trailing /
    -e: Embed a weather report into the middle of the background (OPTIONAL)
 --wal: Use pywal if it's installed (OPTIONAL)

File Formatting

There are four different time chunks to sort your wallpapers into: Morning, Day, Evening, and Night. This will be set dynamically based on the time of the sunrise and sunset in your time-zone (based on airport code).

Weather specific papers should be stored in subdirectories of the four time directories. Currently the code respects 3 types of weather: "Sun", "Rain", and "Snow". Additionally, a "Misc" folder can be used to store backgrounds that don't fit any of the three categories and these will be added to the wallpaper pool for ALL weather types.

Ergo an example of a rainy day wallpaper might be: /home/joe/Pictures/Wallpapers/Day/Rain/wet_park_bench.png

As long as the folder structure is correct the actual images can be named whatever you like. Technically, if you have time of day folders, but no weather folders, the script will still work correctly. It will just default to selecting any image located in the time folder.

Personal Wallpapers

Here are the personal wallpapers I use if you want a small, already sorted, collection to start with.

A Note on macOS

Unfortunately, macOS does not have an accessible API for "spaces", or the virtual desktops that you can access with 3 fingered swipes. Most wallpaper switchers (that I've seen) overcome this limitation by running killall Dock after changing the wallpaper and thus forcing a refresh. To me this seems like it's asking for trouble. Thanks to the help of my very clever friend, a different solution has been found. Right now the solution is to make a new directory ~/Pictures/Weather Wallpaper. After doing so, set up the system wallpaper changer to randomly set a new wallpaper from that folder. Run your cron-job at an interval slightly shorter than the interval you've set to rotate the wallpaper. The script will then manage the images in this folder, but allow the system to actually manage the wallpaper, obviously albiet from a limited selection. Thus we overcome the limitations while avoiding killing the dock every time we want to change a paper.

bashdynamicpaper's People

Contributors

nuolong avatar theniwo avatar wtheisen avatar

Stargazers

 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

bashdynamicpaper's Issues

Background image doesn't change

Hi, I am running ubuntu-studio 18.04 with xfce.
The command runs without error, but the background doesn't change.
When I logoff, however, I see the changed background when the DE is shutting down. When the login screen is loaded, the default wallpaper is applied.
It looks like feh is unable to overwrite the wallpaper settings from xfce
I changed the feh command to an `xfconf-query' command. Look at my fork. Maybe you can include that code and check for the desktop env in the script ;-)

Inconsistent embedded weather scaling

Because the wallpapers are not a consistent size, the embedded weather image is also inconsistently sized, meaning that there's a visually annoying variance in how it appears when the wallpaper is finally displayed. It's probably not all THAT hard to fix.

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.