New wallpapers every day
Luis Ángel Méndez Gort

Luis Ángel Méndez Gort @lamg

About: Solving problems

Location:
Germany
Joined:
Apr 4, 2023

New wallpapers every day

Publish Date: Oct 17 '24
2 1

There a lot of good wallpapers for free in the Internet, however I have found that the applications to get them automatically in Linux are quite disappointing. Because of that I made the following script.

#r "nuget: FsHttp"
#r "nuget: Fli"

open FsHttp
open Fli

let API_KEY = "<YOUR_UNSPLASH_API_KEY>"

type Urls = { full: string }

type UnsplashBody = { id: string; urls: Urls }
let wallpaper = "/YOUR/WALLPAPERS/wallpaper.jpeg"

let random () =
    http {
        GET "https://api.unsplash.com/photos/random?orientation=landscape&query=landscape"
        Authorization $"Client-ID {API_KEY}"
        header "Accept-Version" "v1"
    }
    |> Request.send
    |> Response.deserializeJson<UnsplashBody>
    |> _.urls.full

http {
    GET(random ())
    Authorization $"Client-ID {API_KEY}"
    header "Accept-Version" "v1"
}
|> Request.send
|> Response.toBytes
|> fun bs -> System.IO.File.WriteAllBytes(wallpaper, bs)


cli {
    Exec "<COMMAND>"
    Arguments [ "<TO>"; "<SET>"; wallpaper ]
}
|> fun o -> printfn $"%A{o}"
Enter fullscreen mode Exit fullscreen mode

You can run it with dotnet fsi wallpaper.fsx assuming you saved the above code in wallpaper.fsx

To improve the experience you could use it in a cron job.

Comments 1 total

  • Hazel Noah
    Hazel NoahAug 20, 2025

    Discover stunning Spider-Man wallpaper in 4K on this site! From classic comic art to epic movie scenes, find the perfect high-resolution background to bring your screen to life with the web-slinging hero. wallpaperers.com/best-spiderman-wa...

Add comment