summary refs log tree commit diff stats
path: root/pkg/background/set_darwin.go
diff options
context:
space:
mode:
authorAndinus <andinus@nand.sh>2020-03-24 11:49:57 +0530
committerAndinus <andinus@nand.sh>2020-03-24 11:49:57 +0530
commit522c16f46419ddc19cb07808c53862292b8fd3ba (patch)
tree86c80b37c26f29f4cda058e242f7b96e3f525ddb /pkg/background/set_darwin.go
parent7bf70520a744d5b6b60a805990a82aaa180fb64b (diff)
downloadcetus-522c16f46419ddc19cb07808c53862292b8fd3ba.tar.gz
Add darwin support
Diffstat (limited to 'pkg/background/set_darwin.go')
-rw-r--r--pkg/background/set_darwin.go14
1 files changed, 14 insertions, 0 deletions
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
+}