diff options
author | Andinus <andinus@inventati.org> | 2020-03-14 14:18:30 +0530 |
---|---|---|
committer | Andinus <andinus@inventati.org> | 2020-03-14 14:18:30 +0530 |
commit | dde2d726d5b65e648b99e45538221014562f1a18 (patch) | |
tree | 1db38a43964b205a6dcbb0c160c66213fdffd94e /cmd | |
parent | 82a53c3c5b5ffd8af9c69c6184134f100f80b89a (diff) | |
download | cetus-dde2d726d5b65e648b99e45538221014562f1a18.tar.gz |
Add support for random photo as background v0.3.1
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/cetus/cetus.go | 8 |
1 files changed, 8 insertions, 0 deletions
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) { |