summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--clipboard/selection.go18
-rw-r--r--cmd/indus/main.go3
2 files changed, 21 insertions, 0 deletions
diff --git a/clipboard/selection.go b/clipboard/selection.go
new file mode 100644
index 0000000..0ff5d7f
--- /dev/null
+++ b/clipboard/selection.go
@@ -0,0 +1,18 @@
+package clipboard
+
+import (
+	"os/exec"
+)
+
+// GetSel returns the primary clipboard selection using the xclip tool
+// & also returns an error (if exists) along with the primary
+// clipboard selection.
+func GetSel() (string, error) {
+	out, err := exec.Command("xclip", "-out").Output()
+	if err != nil {
+		return "", err
+	}
+
+	sel := string(out)
+	return sel, err
+}
diff --git a/cmd/indus/main.go b/cmd/indus/main.go
new file mode 100644
index 0000000..38dd16d
--- /dev/null
+++ b/cmd/indus/main.go
@@ -0,0 +1,3 @@
+package main
+
+func main() {}