Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/reujab/wallpaper
A cross-platform Golang library for getting and setting desktop wallpapers
https://github.com/reujab/wallpaper
Last synced: 3 months ago
JSON representation
A cross-platform Golang library for getting and setting desktop wallpapers
- Host: GitHub
- URL: https://github.com/reujab/wallpaper
- Owner: reujab
- License: unlicense
- Created: 2016-12-20T03:06:54.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2023-02-25T02:07:24.000Z (over 1 year ago)
- Last Synced: 2024-06-27T08:34:09.450Z (5 months ago)
- Language: Go
- Homepage:
- Size: 38.1 KB
- Stars: 201
- Watchers: 5
- Forks: 40
- Open Issues: 9
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
# wallpaper [![godoc](https://godoc.org/github.com/reujab/wallpaper?status.svg)](https://godoc.org/github.com/reujab/wallpaper)
A cross-platform (Linux, Windows, and macOS) Golang library for getting and setting the desktop background.
## Installation
```sh
go get github.com/reujab/wallpaper
```## Example
```go
package mainimport (
"fmt""github.com/reujab/wallpaper"
)func main() {
background, err := wallpaper.Get()
check(err)
fmt.Println("Current wallpaper:", background)err = wallpaper.SetFromFile("/usr/share/backgrounds/gnome/adwaita-day.jpg")
check(err)err = wallpaper.SetFromURL("https://i.imgur.com/pIwrYeM.jpg")
check(err)err = wallpaper.SetMode(wallpaper.Crop)
check(err)
}```
## Supported desktops
* Windows
* macOS
* GNOME
* KDE
* Cinnamon
* Unity
* Budgie
* XFCE
* LXDE
* MATE
* Deepin
* Most Wayland compositors (set only, requires swaybg)
* i3 (set only, requires feh)