Skip to content

Commit

Permalink
updated example
Browse files Browse the repository at this point in the history
  • Loading branch information
reujab committed Jun 30, 2021
1 parent b68feb1 commit e8ff89d
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,17 @@ import (

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

if err != nil {
panic(err)
}

check(err)
fmt.Println("Current wallpaper:", background)

err = wallpaper.SetFromFile("/usr/share/backgrounds/gnome/adwaita-day.jpg")
if err != nil {
panic(err)
}
check(err)

err = wallpaper.SetFromURL("https://i.imgur.com/pIwrYeM.jpg")
if err != nil {
panic(err)
}
check(err)

err = wallpaper.SetMode(wallpaper.Crop)
check(err)
}

```
Expand Down

0 comments on commit e8ff89d

Please sign in to comment.