cheesecakeufo / komorebi

A beautiful and customizable wallpapers manager for Linux
GNU General Public License v3.0
3.36k stars 234 forks source link

utilizing wallpapers from bing.com #224

Open HNoodles opened 4 years ago

HNoodles commented 4 years ago

Hello, I was trying to use wallpapers from bing.com to set them as wallpapers but there were some issues that I still haven't resolved. I'm currently taking the "unsplash" one as an example to write my own config for bing. The problem is that the url of wallpapers for bing.com isn't a fixed one. Instead, part of the url is achieved from the JSON response from the API. So I have to concatenate "https://www.bing.com/" with JSON['images'][0]['url'] to get the whole url. I have read the source code of the program, but I'm not very familiar with the language used, and I haven't fully understood how the program processes with web urls. Does anyone have any idea about this problem or have any solutions? Thanks a lot in advance!

rsubtil commented 4 years ago

Is this the same image, or does it change everyday?

A way to do it is to manually edit the config file with sed, with something like this:

sed -i 's|WebPageUrl=.*|WebPageUrl=anotherLink.com|' /System/Resources/Komorebi/<name of your config folder>/config

The added benefit of this is that if the image is not static (if it changes every so often), you can make a script that fetches the latest image and updates the URL of the wallpaper.