Wallpaper

Dynamic colors

System colors #

All Kustom apps can extract color palette from different sources, such as:

  • Wallpaper through the System Info function: $si(wpcolor1)
  • A given image using the Bitmap Palette function: $bp(img, 1)
  • System palette either based on wallpaper or via Material You color, see below

Material You #

On devices supporting dynamic themes Kustom will try to extract the palette definition from the System. Following colors will then be available as variables through the System Info:

...

Get a random image on click

Get a random image on click #

Flows can react to different things including clicks, in this example we will see how to trigger a Flow by clicking an item and making the flow pick a random file from a folder and show the image on the widget

Tutorial #

Steps #

First of all add a Widget (or a wallpaper or any other Kustom item), then:

...

Get title and image from a JSON API every hour

Get title and image from a JSON API every hour #

Kustom Flows can chain events and store data into files that can be used later in formulas. In this example we will get some data from an external API (the NASA daily picture API) and store the results locally, we will finally use that data to display the image and its title

Tutorial #

Steps #

First of all add a Widget (or a wallpaper or any other Kustom item), then:

...

Random image from Unsplash on click

Random image from Unsplash on click #

In this simple example #CraftMath downloads a random image JSON from Unsplash using their APIs updating it everything time a click is triggered

Tutorial #

Video #

Steps #

First of all add a Widget (or a wallpaper or any other Kustom item), then:

  • Register Unsplash account and request an API key
  • Store API key as a “secret” or normal global, name it “key”
  • Create a new text global, name it “json”
  • Go to Flows, add a new Flow
  • Add a “manual trigger” this will trigger the flow manually via touch
  • Add an Action of type WebGet and use “ https://api.unsplash.com/photos/random?client_id=$gv(key)$" as URL
  • Add an action to store to a Global, select “json” as the global, flow will download the JSON file and assign the global to the local JSON file path (unless you switch “store file content not path” which will intead store the file content in the global)
  • Finally add an image, switch “Bitmap” to a formula and use $wg(gv(json), json, .urls.raw)$ to use the image url from the json
  • You are done

Random wallpaper daily from reddit.com/r/EarthPorn

Random wallpaper daily from reddit.com/r/EarthPorn #

Lets say you want to get a nice random image from the wonderful sub reddit at https://reddit.com/r/EarthPorn

Nothing easier:

  • Start a blank preset
  • Go to the background tab
  • Select the bitmap property
  • Switch to a formula
  • Enter this formula: $tv(reg, wg("https://www.reddit.com/r/EarthPorn/.rss?refresh="+df(D), url, "i.redd.it", 0), "&.*", "")$

Save and done!

You can update this more frequently by changing for example df(D) to df(H) and it will be updated at the hour (if content changed)

...




Privacy Policy