summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--build/ci/gitlab-ci.yml2
-rw-r--r--pkg/background/set_darwin.go14
-rw-r--r--pkg/background/set_unix.go (renamed from pkg/background/set.go)2
3 files changed, 18 insertions, 0 deletions
diff --git a/build/ci/gitlab-ci.yml b/build/ci/gitlab-ci.yml
index f6d776e..2a140ea 100644
--- a/build/ci/gitlab-ci.yml
+++ b/build/ci/gitlab-ci.yml
@@ -18,7 +18,9 @@ compile:
       - cd $GOPATH/src/$REPO_NAME/cmd/cetus
       - GOOS=openbsd GOARCH=amd64 go build -o $CI_PROJECT_DIR/cetus-openbsd-amd64
       - GOOS=linux GOARCH=amd64 go build -o $CI_PROJECT_DIR/cetus-linux-amd64
+      - GOOS=darwin GOARCH=amd64 go build -o $CI_PROJECT_DIR/cetus-darwin-amd64
     artifacts:
       paths:
         - cetus-openbsd-amd64
         - cetus-linux-amd64
+        - cetus-darwin-amd64
diff --git a/pkg/background/set_darwin.go b/pkg/background/set_darwin.go
new file mode 100644
index 0000000..2ead214
--- /dev/null
+++ b/pkg/background/set_darwin.go
@@ -0,0 +1,14 @@
+// +build darwin
+
+package background
+
+import (
+	"os/exec"
+	"strconv"
+)
+
+// Set calls feh to set the background
+func Set(path string) error {
+	err := exec.Command("osascript", "-e", `tell application "System Events" to tell every desktop to set picture to `+strconv.Quote(path)).Run()
+	return err
+}
diff --git a/pkg/background/set.go b/pkg/background/set_unix.go
index 0f7333d..cd75ae3 100644
--- a/pkg/background/set.go
+++ b/pkg/background/set_unix.go
@@ -1,3 +1,5 @@
+// +build linux netbsd openbsd freebsd dragonfly
+
 package background
 
 import (