superkojiman / wallpaper

A cross-platform Golang library for getting and setting desktop wallpapers

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

wallpaper godoc

A cross-platform (Linux, Windows, and macOS) Golang library for getting and setting the desktop background.

Installation

go get github.com/reujab/wallpaper

Example

package main

import (
	"fmt"

	"github.com/reujab/wallpaper"
)

func main() {
	background, err := wallpaper.Get()

	if err != nil {
		panic(err)
	}

	fmt.Println("Current wallpaper:", background)
	wallpaper.SetFromFile("/usr/share/backgrounds/gnome/adwaita-day.jpg")
	wallpaper.SetFromURL("https://i.imgur.com/pIwrYeM.jpg")
}

Notes

  • Enlightenment is not supported.

About

A cross-platform Golang library for getting and setting desktop wallpapers

License:The Unlicense


Languages

Language:Go 100.0%