From dde2d726d5b65e648b99e45538221014562f1a18 Mon Sep 17 00:00:00 2001 From: Andinus Date: Sat, 14 Mar 2020 14:18:30 +0530 Subject: Add support for random photo as background --- cmd/cetus/cetus.go | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'cmd/cetus') diff --git a/cmd/cetus/cetus.go b/cmd/cetus/cetus.go index 35afd01..e6799c8 100644 --- a/cmd/cetus/cetus.go +++ b/cmd/cetus/cetus.go @@ -24,6 +24,7 @@ import ( func main() { var ( photoID string + random bool width int height int @@ -32,6 +33,7 @@ func main() { ) flag.StringVar(&photoID, "photo-id", "", "Unsplash Photo ID to set as background") + flag.BoolVar(&random, "random", true, "Set a random photo as background") flag.IntVar(&width, "width", 1920, "Width of the image") flag.IntVar(&height, "height", 1080, "Height of the image") @@ -43,6 +45,12 @@ func main() { errChk(err) return } + + if random { + err = unsplash.SetRandom(width, height) + errChk(err) + return + } } func errChk(err error) { -- cgit 1.4.1-2-gfad0