From a253de518464dc9c6d5ef49afed0298557f6cba4 Mon Sep 17 00:00:00 2001 From: Ryan Fox Date: Sat, 15 Jan 2022 18:28:55 -0800 Subject: [PATCH] Initial commit --- .gitignore | 1 + README.txt | 3 +++ dummy-pointer.go | 20 ++++++++++++++++++++ dummy-pointer.service | 8 ++++++++ go.mod | 5 +++++ go.sum | 2 ++ 6 files changed, 39 insertions(+) create mode 100644 .gitignore create mode 100644 README.txt create mode 100644 dummy-pointer.go create mode 100644 dummy-pointer.service create mode 100644 go.mod create mode 100644 go.sum diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..0873008 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +dummy-pointer diff --git a/README.txt b/README.txt new file mode 100644 index 0000000..bcbbf2a --- /dev/null +++ b/README.txt @@ -0,0 +1,3 @@ +dummy-pointer + +Creates a dummy mouse pointer with uinput. diff --git a/dummy-pointer.go b/dummy-pointer.go new file mode 100644 index 0000000..3599c6b --- /dev/null +++ b/dummy-pointer.go @@ -0,0 +1,20 @@ +package main + +import ( + "os" + "os/signal" + "syscall" + "github.com/bendahl/uinput" +) + +func main() { + mouse, err := uinput.CreateMouse("/dev/uinput", []byte("dummy-pointer")) + if err != nil { + os.Exit(1) + } + sc := make(chan os.Signal, 1) + signal.Notify(sc, syscall.SIGINT, syscall.SIGTERM) + <-sc + mouse.Close() + os.Exit(0) +} diff --git a/dummy-pointer.service b/dummy-pointer.service new file mode 100644 index 0000000..55fa25f --- /dev/null +++ b/dummy-pointer.service @@ -0,0 +1,8 @@ +[Unit] +Description=Enable the dummy pointer + +[Service] +ExecStart=/usr/local/bin/dummy-pointer + +[Install] +WantedBy=multi-user.target diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..60ab6a1 --- /dev/null +++ b/go.mod @@ -0,0 +1,5 @@ +module dummy-pointer + +go 1.17 + +require github.com/bendahl/uinput v1.5.0 diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..a14eb03 --- /dev/null +++ b/go.sum @@ -0,0 +1,2 @@ +github.com/bendahl/uinput v1.5.0 h1:W+QLck2vvOQeo8McsZzPgFJZEg8KP4IIYOB3mbVvTWY= +github.com/bendahl/uinput v1.5.0/go.mod h1:Np7w3DINc9wB83p12fTAM3DPPhFnAKP0WTXRqCQJ6Z8=