Compare commits

...

2 Commits

Author SHA1 Message Date
Gregory Rudolph 298750f396
Cleaning for macOS fixes 2 years ago
Gregory Rudolph aef66840fc
Fix typo 2 years ago
  1. 2
      .drone.yml
  2. 10
      main.go

2
.drone.yml

@ -6,7 +6,7 @@ steps:
- name: Build - name: Build
image: golang image: golang
commands: commands:
- go get ./.. - go get ./...
- go vet -v - go vet -v
- env - env
- GOOS="linux" go build -ldflags="-w -s" -o BackgroundDaemon-Linux - GOOS="linux" go build -ldflags="-w -s" -o BackgroundDaemon-Linux

10
main.go

@ -42,13 +42,11 @@ func init() {
func main() { func main() {
flag.Parse() flag.Parse()
background, err := wallpaper.Get()
if err != nil {
log.Panicln(err)
}
bounds := screenshot.GetDisplayBounds(0) bounds := screenshot.GetDisplayBounds(0)
var img image.Image var img image.Image
var err error
if useRandom { if useRandom {
img, err = loadRandomUnsplashImage(bounds.Dx(), bounds.Dy()) img, err = loadRandomUnsplashImage(bounds.Dx(), bounds.Dy())
if err != nil { if err != nil {
@ -83,6 +81,10 @@ func main() {
log.Panicln(err) log.Panicln(err)
} }
} else { } else {
background, err := wallpaper.Get()
if err != nil {
log.Panicln(err)
}
img, err = loadImage(background) img, err = loadImage(background)
if err != nil { if err != nil {
log.Println(background) log.Println(background)

Loading…
Cancel
Save