Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] New package: ydotool-1.0.1
@ 2022-07-25 12:49 JohnGebbie
  2022-07-25 12:51 ` [PR PATCH] [Updated] " JohnGebbie
                   ` (29 more replies)
  0 siblings, 30 replies; 37+ messages in thread
From: JohnGebbie @ 2022-07-25 12:49 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1170 bytes --]

There is a new pull request by JohnGebbie against master on the void-packages repository

https://github.com/JohnGebbie/void-packages ydotool
https://github.com/void-linux/void-packages/pull/38268

New package: ydotool-1.0.1
#### Testing the changes
- I tested the changes in this PR: **YES**

#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures:
  - aarch64-musl
  - armv7l
  - armv6l-musl


I copied https://github.com/void-linux/void-packages/pull/31237 but ydotool has got easier to install.
To use it, you enable the ydotoold service and add your user to the "input" group.
This should press and release the A key: `ydotool key 30:1 30:0`

Currently I seem to need to `sv restart ydotoold` after I reboot.
Their manpages are out of date: https://github.com/ReimuNotMoe/ydotool/pull/144



A patch file from https://github.com/void-linux/void-packages/pull/38268.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-ydotool-38268.patch --]
[-- Type: text/x-diff, Size: 2037 bytes --]

From 943ccbc36b06a7545abc02b38313398ac2038d7e Mon Sep 17 00:00:00 2001
From: John Gebbie <me@johngebbie.com>
Date: Mon, 25 Jul 2022 12:36:16 +0100
Subject: [PATCH] New package: ydotool-1.0.1

---
 srcpkgs/ydotool/files/80-uinput.rules |  3 +++
 srcpkgs/ydotool/files/ydotoold/run    |  2 ++
 srcpkgs/ydotool/template              | 20 ++++++++++++++++++++
 3 files changed, 25 insertions(+)
 create mode 100644 srcpkgs/ydotool/files/80-uinput.rules
 create mode 100755 srcpkgs/ydotool/files/ydotoold/run
 create mode 100644 srcpkgs/ydotool/template

diff --git a/srcpkgs/ydotool/files/80-uinput.rules b/srcpkgs/ydotool/files/80-uinput.rules
new file mode 100644
index 000000000000..988d34547f52
--- /dev/null
+++ b/srcpkgs/ydotool/files/80-uinput.rules
@@ -0,0 +1,3 @@
+## ydotoold fix
+## https://github.com/ReimuNotMoe/ydotool/issues/25#issuecomment-535842993
+KERNEL=="uinput", GROUP="input", MODE="0660", OPTIONS+="static_node=uinput"
diff --git a/srcpkgs/ydotool/files/ydotoold/run b/srcpkgs/ydotool/files/ydotoold/run
new file mode 100755
index 000000000000..b9dc8c51bc2f
--- /dev/null
+++ b/srcpkgs/ydotool/files/ydotoold/run
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec chpst -u _ydotoold:input ydotoold --socket-perm 660 2>&1
diff --git a/srcpkgs/ydotool/template b/srcpkgs/ydotool/template
new file mode 100644
index 000000000000..da43c6a9a6b4
--- /dev/null
+++ b/srcpkgs/ydotool/template
@@ -0,0 +1,20 @@
+# Template file for 'ydotool'
+pkgname=ydotool
+version=1.0.1
+revision=1
+build_style=cmake
+hostmakedepends="scdoc"
+short_desc="Generic command-line automation tool, works on Wayland and X11"
+maintainer="John Gebbie <me@johngebbie.com>"
+license="AGPL-3.0-only"
+homepage="https://github.com/ReimuNotMoe/ydotool"
+distfiles="https://github.com/ReimuNotMoe/ydotool/archive/v${version}.tar.gz"
+checksum=02311cdc608f205711b06a95e5fd71093b2294f4920efc526f5e98a2ddab42b8
+
+system_accounts="_ydotoold"
+_ydotoold_groups="input"
+
+post_install() {
+	vsv ydotoold
+	vinstall "${FILESDIR}/80-uinput.rules" 644 usr/lib/udev/rules.d
+}

^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: [PR PATCH] [Updated] New package: ydotool-1.0.1
  2022-07-25 12:49 [PR PATCH] New package: ydotool-1.0.1 JohnGebbie
@ 2022-07-25 12:51 ` JohnGebbie
  2022-07-25 15:14 ` JohnGebbie
                   ` (28 subsequent siblings)
  29 siblings, 0 replies; 37+ messages in thread
From: JohnGebbie @ 2022-07-25 12:51 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1175 bytes --]

There is an updated pull request by JohnGebbie against master on the void-packages repository

https://github.com/JohnGebbie/void-packages ydotool
https://github.com/void-linux/void-packages/pull/38268

New package: ydotool-1.0.1
#### Testing the changes
- I tested the changes in this PR: **YES**

#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures:
  - aarch64-musl
  - armv7l
  - armv6l-musl


I copied https://github.com/void-linux/void-packages/pull/31237 but ydotool has got easier to install.
To use it, you enable the ydotoold service and add your user to the "input" group.
This should press and release the A key: `ydotool key 30:1 30:0`

Currently I seem to need to `sv restart ydotoold` after I reboot.
Their manpages are out of date: https://github.com/ReimuNotMoe/ydotool/pull/144



A patch file from https://github.com/void-linux/void-packages/pull/38268.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-ydotool-38268.patch --]
[-- Type: text/x-diff, Size: 2057 bytes --]

From 9e70b14c380413bd2d79dd0c953ac75b902efee6 Mon Sep 17 00:00:00 2001
From: John Gebbie <me@johngebbie.com>
Date: Mon, 25 Jul 2022 12:36:16 +0100
Subject: [PATCH] New package: ydotool-1.0.1

---
 srcpkgs/ydotool/files/80-uinput.rules |  3 +++
 srcpkgs/ydotool/files/ydotoold/run    |  2 ++
 srcpkgs/ydotool/template              | 21 +++++++++++++++++++++
 3 files changed, 26 insertions(+)
 create mode 100644 srcpkgs/ydotool/files/80-uinput.rules
 create mode 100755 srcpkgs/ydotool/files/ydotoold/run
 create mode 100644 srcpkgs/ydotool/template

diff --git a/srcpkgs/ydotool/files/80-uinput.rules b/srcpkgs/ydotool/files/80-uinput.rules
new file mode 100644
index 000000000000..988d34547f52
--- /dev/null
+++ b/srcpkgs/ydotool/files/80-uinput.rules
@@ -0,0 +1,3 @@
+## ydotoold fix
+## https://github.com/ReimuNotMoe/ydotool/issues/25#issuecomment-535842993
+KERNEL=="uinput", GROUP="input", MODE="0660", OPTIONS+="static_node=uinput"
diff --git a/srcpkgs/ydotool/files/ydotoold/run b/srcpkgs/ydotool/files/ydotoold/run
new file mode 100755
index 000000000000..b9dc8c51bc2f
--- /dev/null
+++ b/srcpkgs/ydotool/files/ydotoold/run
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec chpst -u _ydotoold:input ydotoold --socket-perm 660 2>&1
diff --git a/srcpkgs/ydotool/template b/srcpkgs/ydotool/template
new file mode 100644
index 000000000000..5da849a71673
--- /dev/null
+++ b/srcpkgs/ydotool/template
@@ -0,0 +1,21 @@
+# Template file for 'ydotool'
+pkgname=ydotool
+version=1.0.1
+revision=1
+build_style=cmake
+hostmakedepends="scdoc"
+short_desc="Generic command-line automation tool, works on Wayland and X11"
+maintainer="John Gebbie <me@johngebbie.com>"
+license="AGPL-3.0-only"
+homepage="https://github.com/ReimuNotMoe/ydotool"
+distfiles="https://github.com/ReimuNotMoe/ydotool/archive/v${version}.tar.gz"
+checksum=02311cdc608f205711b06a95e5fd71093b2294f4920efc526f5e98a2ddab42b8
+
+system_accounts="_ydotoold"
+_ydotoold_groups="input"
+
+post_install() {
+	vsv ydotoold
+	vinstall "${FILESDIR}/80-uinput.rules" 644 usr/lib/udev/rules.d
+	vlicense LICENSE
+}

^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: [PR PATCH] [Updated] New package: ydotool-1.0.1
  2022-07-25 12:49 [PR PATCH] New package: ydotool-1.0.1 JohnGebbie
  2022-07-25 12:51 ` [PR PATCH] [Updated] " JohnGebbie
@ 2022-07-25 15:14 ` JohnGebbie
  2022-07-25 15:27 ` JohnGebbie
                   ` (27 subsequent siblings)
  29 siblings, 0 replies; 37+ messages in thread
From: JohnGebbie @ 2022-07-25 15:14 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1238 bytes --]

There is an updated pull request by JohnGebbie against master on the void-packages repository

https://github.com/JohnGebbie/void-packages ydotool
https://github.com/void-linux/void-packages/pull/38268

New package: ydotool-1.0.1
#### Testing the changes
- I tested the changes in this PR: **YES**

#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures:
  - aarch64-musl
  - armv7l
  - armv6l-musl


I copied https://github.com/void-linux/void-packages/pull/31237 but ydotool has got easier to install.
To use it, you enable the ydotoold service and add your user to the "input" group.
This should press and release the A key: `ydotool key 30:1 30:0`

Currently I seem to need to `sv restart ydotoold` after I reboot.
Their manpages are out of date: https://github.com/ReimuNotMoe/ydotool/pull/144

Closes https://github.com/void-linux/void-packages/issues/31163

A patch file from https://github.com/void-linux/void-packages/pull/38268.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-ydotool-38268.patch --]
[-- Type: text/x-diff, Size: 2057 bytes --]

From 94edf8fced0a751261373d6adc29234fdc983395 Mon Sep 17 00:00:00 2001
From: John Gebbie <me@johngebbie.com>
Date: Mon, 25 Jul 2022 12:36:16 +0100
Subject: [PATCH] New package: ydotool-1.0.1

---
 srcpkgs/ydotool/files/80-uinput.rules |  3 +++
 srcpkgs/ydotool/files/ydotoold/run    |  2 ++
 srcpkgs/ydotool/template              | 21 +++++++++++++++++++++
 3 files changed, 26 insertions(+)
 create mode 100644 srcpkgs/ydotool/files/80-uinput.rules
 create mode 100755 srcpkgs/ydotool/files/ydotoold/run
 create mode 100644 srcpkgs/ydotool/template

diff --git a/srcpkgs/ydotool/files/80-uinput.rules b/srcpkgs/ydotool/files/80-uinput.rules
new file mode 100644
index 000000000000..988d34547f52
--- /dev/null
+++ b/srcpkgs/ydotool/files/80-uinput.rules
@@ -0,0 +1,3 @@
+## ydotoold fix
+## https://github.com/ReimuNotMoe/ydotool/issues/25#issuecomment-535842993
+KERNEL=="uinput", GROUP="input", MODE="0660", OPTIONS+="static_node=uinput"
diff --git a/srcpkgs/ydotool/files/ydotoold/run b/srcpkgs/ydotool/files/ydotoold/run
new file mode 100755
index 000000000000..b9dc8c51bc2f
--- /dev/null
+++ b/srcpkgs/ydotool/files/ydotoold/run
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec chpst -u _ydotoold:input ydotoold --socket-perm 660 2>&1
diff --git a/srcpkgs/ydotool/template b/srcpkgs/ydotool/template
new file mode 100644
index 000000000000..5da849a71673
--- /dev/null
+++ b/srcpkgs/ydotool/template
@@ -0,0 +1,21 @@
+# Template file for 'ydotool'
+pkgname=ydotool
+version=1.0.1
+revision=1
+build_style=cmake
+hostmakedepends="scdoc"
+short_desc="Generic command-line automation tool, works on Wayland and X11"
+maintainer="John Gebbie <me@johngebbie.com>"
+license="AGPL-3.0-only"
+homepage="https://github.com/ReimuNotMoe/ydotool"
+distfiles="https://github.com/ReimuNotMoe/ydotool/archive/v${version}.tar.gz"
+checksum=02311cdc608f205711b06a95e5fd71093b2294f4920efc526f5e98a2ddab42b8
+
+system_accounts="_ydotoold"
+_ydotoold_groups="input"
+
+post_install() {
+	vsv ydotoold
+	vinstall "${FILESDIR}/80-uinput.rules" 644 usr/lib/udev/rules.d
+	vlicense LICENSE
+}

^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: New package: ydotool-1.0.1
  2022-07-25 12:49 [PR PATCH] New package: ydotool-1.0.1 JohnGebbie
  2022-07-25 12:51 ` [PR PATCH] [Updated] " JohnGebbie
  2022-07-25 15:14 ` JohnGebbie
@ 2022-07-25 15:27 ` JohnGebbie
  2022-08-03 15:23 ` [PR REVIEW] " classabbyamp
                   ` (26 subsequent siblings)
  29 siblings, 0 replies; 37+ messages in thread
From: JohnGebbie @ 2022-07-25 15:27 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 183 bytes --]

New comment by JohnGebbie on void-packages repository

https://github.com/void-linux/void-packages/pull/38268#issuecomment-1194200637

Comment:
I pushed to make my branch up to date.

^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: [PR REVIEW] New package: ydotool-1.0.1
  2022-07-25 12:49 [PR PATCH] New package: ydotool-1.0.1 JohnGebbie
                   ` (2 preceding siblings ...)
  2022-07-25 15:27 ` JohnGebbie
@ 2022-08-03 15:23 ` classabbyamp
  2022-08-04  2:35 ` RunningDroid
                   ` (25 subsequent siblings)
  29 siblings, 0 replies; 37+ messages in thread
From: classabbyamp @ 2022-08-03 15:23 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 611 bytes --]

New review comment by classabbyamp on void-packages repository

https://github.com/void-linux/void-packages/pull/38268#discussion_r936781029

Comment:
from configure output:
```
-- Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE) 
-- Configuring done
```
with `pkg-config` added to `hostmakedepends`:
```
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.2") 
-- Checking for module 'systemd'
--   No package 'systemd' found
-- Configuring done
```
seems to not be fully necessary at the moment, but it would be good to add for future updates, in case upstream adds dependencies

^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: New package: ydotool-1.0.1
  2022-07-25 12:49 [PR PATCH] New package: ydotool-1.0.1 JohnGebbie
                   ` (3 preceding siblings ...)
  2022-08-03 15:23 ` [PR REVIEW] " classabbyamp
@ 2022-08-04  2:35 ` RunningDroid
  2022-08-07 20:34 ` [PR PATCH] [Updated] " JohnGebbie
                   ` (24 subsequent siblings)
  29 siblings, 0 replies; 37+ messages in thread
From: RunningDroid @ 2022-08-04  2:35 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 499 bytes --]

New comment by RunningDroid on void-packages repository

https://github.com/void-linux/void-packages/pull/38268#issuecomment-1204687691

Comment:
It looks like the manpage wasn't updated after the refactor: https://github.com/ReimuNotMoe/ydotool/issues/147

[help output for the key command](https://github.com/ReimuNotMoe/ydotool/blob/master/Client/tool_key.c#L39-L59)
[relevant section of the manpage](https://github.com/ReimuNotMoe/ydotool/blob/master/manpage/ydotool.1.scd#keyboard-commands)

^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: [PR PATCH] [Updated] New package: ydotool-1.0.1
  2022-07-25 12:49 [PR PATCH] New package: ydotool-1.0.1 JohnGebbie
                   ` (4 preceding siblings ...)
  2022-08-04  2:35 ` RunningDroid
@ 2022-08-07 20:34 ` JohnGebbie
  2022-08-07 20:36 ` JohnGebbie
                   ` (23 subsequent siblings)
  29 siblings, 0 replies; 37+ messages in thread
From: JohnGebbie @ 2022-08-07 20:34 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1238 bytes --]

There is an updated pull request by JohnGebbie against master on the void-packages repository

https://github.com/JohnGebbie/void-packages ydotool
https://github.com/void-linux/void-packages/pull/38268

New package: ydotool-1.0.1
#### Testing the changes
- I tested the changes in this PR: **YES**

#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures:
  - aarch64-musl
  - armv7l
  - armv6l-musl


I copied https://github.com/void-linux/void-packages/pull/31237 but ydotool has got easier to install.
To use it, you enable the ydotoold service and add your user to the "input" group.
This should press and release the A key: `ydotool key 30:1 30:0`

Currently I seem to need to `sv restart ydotoold` after I reboot.
Their manpages are out of date: https://github.com/ReimuNotMoe/ydotool/pull/144

Closes https://github.com/void-linux/void-packages/issues/31163

A patch file from https://github.com/void-linux/void-packages/pull/38268.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-ydotool-38268.patch --]
[-- Type: text/x-diff, Size: 2057 bytes --]

From 13c47e5ee4e33e45646a8c5e9af08ea08e6e2a52 Mon Sep 17 00:00:00 2001
From: John Gebbie <me@johngebbie.com>
Date: Mon, 25 Jul 2022 12:36:16 +0100
Subject: [PATCH] New package: ydotool-1.0.1

---
 srcpkgs/ydotool/files/80-uinput.rules |  3 +++
 srcpkgs/ydotool/files/ydotoold/run    |  2 ++
 srcpkgs/ydotool/template              | 21 +++++++++++++++++++++
 3 files changed, 26 insertions(+)
 create mode 100644 srcpkgs/ydotool/files/80-uinput.rules
 create mode 100755 srcpkgs/ydotool/files/ydotoold/run
 create mode 100644 srcpkgs/ydotool/template

diff --git a/srcpkgs/ydotool/files/80-uinput.rules b/srcpkgs/ydotool/files/80-uinput.rules
new file mode 100644
index 000000000000..988d34547f52
--- /dev/null
+++ b/srcpkgs/ydotool/files/80-uinput.rules
@@ -0,0 +1,3 @@
+## ydotoold fix
+## https://github.com/ReimuNotMoe/ydotool/issues/25#issuecomment-535842993
+KERNEL=="uinput", GROUP="input", MODE="0660", OPTIONS+="static_node=uinput"
diff --git a/srcpkgs/ydotool/files/ydotoold/run b/srcpkgs/ydotool/files/ydotoold/run
new file mode 100755
index 000000000000..b9dc8c51bc2f
--- /dev/null
+++ b/srcpkgs/ydotool/files/ydotoold/run
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec chpst -u _ydotoold:input ydotoold --socket-perm 660 2>&1
diff --git a/srcpkgs/ydotool/template b/srcpkgs/ydotool/template
new file mode 100644
index 000000000000..5da849a71673
--- /dev/null
+++ b/srcpkgs/ydotool/template
@@ -0,0 +1,21 @@
+# Template file for 'ydotool'
+pkgname=ydotool
+version=1.0.1
+revision=1
+build_style=cmake
+hostmakedepends="scdoc"
+short_desc="Generic command-line automation tool, works on Wayland and X11"
+maintainer="John Gebbie <me@johngebbie.com>"
+license="AGPL-3.0-only"
+homepage="https://github.com/ReimuNotMoe/ydotool"
+distfiles="https://github.com/ReimuNotMoe/ydotool/archive/v${version}.tar.gz"
+checksum=02311cdc608f205711b06a95e5fd71093b2294f4920efc526f5e98a2ddab42b8
+
+system_accounts="_ydotoold"
+_ydotoold_groups="input"
+
+post_install() {
+	vsv ydotoold
+	vinstall "${FILESDIR}/80-uinput.rules" 644 usr/lib/udev/rules.d
+	vlicense LICENSE
+}

^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: [PR PATCH] [Updated] New package: ydotool-1.0.1
  2022-07-25 12:49 [PR PATCH] New package: ydotool-1.0.1 JohnGebbie
                   ` (5 preceding siblings ...)
  2022-08-07 20:34 ` [PR PATCH] [Updated] " JohnGebbie
@ 2022-08-07 20:36 ` JohnGebbie
  2022-08-07 20:38 ` [PR REVIEW] " JohnGebbie
                   ` (22 subsequent siblings)
  29 siblings, 0 replies; 37+ messages in thread
From: JohnGebbie @ 2022-08-07 20:36 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1238 bytes --]

There is an updated pull request by JohnGebbie against master on the void-packages repository

https://github.com/JohnGebbie/void-packages ydotool
https://github.com/void-linux/void-packages/pull/38268

New package: ydotool-1.0.1
#### Testing the changes
- I tested the changes in this PR: **YES**

#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures:
  - aarch64-musl
  - armv7l
  - armv6l-musl


I copied https://github.com/void-linux/void-packages/pull/31237 but ydotool has got easier to install.
To use it, you enable the ydotoold service and add your user to the "input" group.
This should press and release the A key: `ydotool key 30:1 30:0`

Currently I seem to need to `sv restart ydotoold` after I reboot.
Their manpages are out of date: https://github.com/ReimuNotMoe/ydotool/pull/144

Closes https://github.com/void-linux/void-packages/issues/31163

A patch file from https://github.com/void-linux/void-packages/pull/38268.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-ydotool-38268.patch --]
[-- Type: text/x-diff, Size: 2068 bytes --]

From cf0923f66b80ae932510ee67c7f55f83b281a32f Mon Sep 17 00:00:00 2001
From: John Gebbie <me@johngebbie.com>
Date: Mon, 25 Jul 2022 12:36:16 +0100
Subject: [PATCH] New package: ydotool-1.0.1

---
 srcpkgs/ydotool/files/80-uinput.rules |  3 +++
 srcpkgs/ydotool/files/ydotoold/run    |  2 ++
 srcpkgs/ydotool/template              | 21 +++++++++++++++++++++
 3 files changed, 26 insertions(+)
 create mode 100644 srcpkgs/ydotool/files/80-uinput.rules
 create mode 100755 srcpkgs/ydotool/files/ydotoold/run
 create mode 100644 srcpkgs/ydotool/template

diff --git a/srcpkgs/ydotool/files/80-uinput.rules b/srcpkgs/ydotool/files/80-uinput.rules
new file mode 100644
index 000000000000..988d34547f52
--- /dev/null
+++ b/srcpkgs/ydotool/files/80-uinput.rules
@@ -0,0 +1,3 @@
+## ydotoold fix
+## https://github.com/ReimuNotMoe/ydotool/issues/25#issuecomment-535842993
+KERNEL=="uinput", GROUP="input", MODE="0660", OPTIONS+="static_node=uinput"
diff --git a/srcpkgs/ydotool/files/ydotoold/run b/srcpkgs/ydotool/files/ydotoold/run
new file mode 100755
index 000000000000..b9dc8c51bc2f
--- /dev/null
+++ b/srcpkgs/ydotool/files/ydotoold/run
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec chpst -u _ydotoold:input ydotoold --socket-perm 660 2>&1
diff --git a/srcpkgs/ydotool/template b/srcpkgs/ydotool/template
new file mode 100644
index 000000000000..44d31187e4c6
--- /dev/null
+++ b/srcpkgs/ydotool/template
@@ -0,0 +1,21 @@
+# Template file for 'ydotool'
+pkgname=ydotool
+version=1.0.1
+revision=1
+build_style=cmake
+hostmakedepends="pkg-config scdoc"
+short_desc="Generic command-line automation tool, works on Wayland and X11"
+maintainer="John Gebbie <me@johngebbie.com>"
+license="AGPL-3.0-only"
+homepage="https://github.com/ReimuNotMoe/ydotool"
+distfiles="https://github.com/ReimuNotMoe/ydotool/archive/v${version}.tar.gz"
+checksum=02311cdc608f205711b06a95e5fd71093b2294f4920efc526f5e98a2ddab42b8
+
+system_accounts="_ydotoold"
+_ydotoold_groups="input"
+
+post_install() {
+	vsv ydotoold
+	vinstall "${FILESDIR}/80-uinput.rules" 644 usr/lib/udev/rules.d
+	vlicense LICENSE
+}

^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: [PR REVIEW] New package: ydotool-1.0.1
  2022-07-25 12:49 [PR PATCH] New package: ydotool-1.0.1 JohnGebbie
                   ` (6 preceding siblings ...)
  2022-08-07 20:36 ` JohnGebbie
@ 2022-08-07 20:38 ` JohnGebbie
  2022-08-08 19:28 ` [PR PATCH] [Closed]: " JohnGebbie
                   ` (21 subsequent siblings)
  29 siblings, 0 replies; 37+ messages in thread
From: JohnGebbie @ 2022-08-07 20:38 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 172 bytes --]

New review comment by JohnGebbie on void-packages repository

https://github.com/void-linux/void-packages/pull/38268#discussion_r939719485

Comment:
I've added it, thanks.

^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: [PR PATCH] [Closed]: New package: ydotool-1.0.1
  2022-07-25 12:49 [PR PATCH] New package: ydotool-1.0.1 JohnGebbie
                   ` (7 preceding siblings ...)
  2022-08-07 20:38 ` [PR REVIEW] " JohnGebbie
@ 2022-08-08 19:28 ` JohnGebbie
  2022-08-08 19:28 ` [PR PATCH] [Updated] " JohnGebbie
                   ` (20 subsequent siblings)
  29 siblings, 0 replies; 37+ messages in thread
From: JohnGebbie @ 2022-08-08 19:28 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1076 bytes --]

There's a closed pull request on the void-packages repository

New package: ydotool-1.0.1
https://github.com/void-linux/void-packages/pull/38268

Description:
#### Testing the changes
- I tested the changes in this PR: **YES**

#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures:
  - aarch64-musl
  - armv7l
  - armv6l-musl


I copied https://github.com/void-linux/void-packages/pull/31237 but ydotool has got easier to install.
To use it, you enable the ydotoold service and add your user to the "input" group.
This should press and release the A key: `ydotool key 30:1 30:0`

Currently I seem to need to `sv restart ydotoold` after I reboot.
Their manpages are out of date: https://github.com/ReimuNotMoe/ydotool/pull/144

Closes https://github.com/void-linux/void-packages/issues/31163

^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: [PR PATCH] [Updated] New package: ydotool-1.0.1
  2022-07-25 12:49 [PR PATCH] New package: ydotool-1.0.1 JohnGebbie
                   ` (8 preceding siblings ...)
  2022-08-08 19:28 ` [PR PATCH] [Closed]: " JohnGebbie
@ 2022-08-08 19:28 ` JohnGebbie
  2022-08-08 19:44 ` JohnGebbie
                   ` (19 subsequent siblings)
  29 siblings, 0 replies; 37+ messages in thread
From: JohnGebbie @ 2022-08-08 19:28 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1238 bytes --]

There is an updated pull request by JohnGebbie against master on the void-packages repository

https://github.com/JohnGebbie/void-packages ydotool
https://github.com/void-linux/void-packages/pull/38268

New package: ydotool-1.0.1
#### Testing the changes
- I tested the changes in this PR: **YES**

#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures:
  - aarch64-musl
  - armv7l
  - armv6l-musl


I copied https://github.com/void-linux/void-packages/pull/31237 but ydotool has got easier to install.
To use it, you enable the ydotoold service and add your user to the "input" group.
This should press and release the A key: `ydotool key 30:1 30:0`

Currently I seem to need to `sv restart ydotoold` after I reboot.
Their manpages are out of date: https://github.com/ReimuNotMoe/ydotool/pull/144

Closes https://github.com/void-linux/void-packages/issues/31163

A patch file from https://github.com/void-linux/void-packages/pull/38268.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-ydotool-38268.patch --]
[-- Type: text/x-diff, Size: 0 bytes --]



^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: [PR PATCH] [Updated] New package: ydotool-1.0.1
  2022-07-25 12:49 [PR PATCH] New package: ydotool-1.0.1 JohnGebbie
                   ` (9 preceding siblings ...)
  2022-08-08 19:28 ` [PR PATCH] [Updated] " JohnGebbie
@ 2022-08-08 19:44 ` JohnGebbie
  2022-08-08 19:44 ` JohnGebbie
                   ` (18 subsequent siblings)
  29 siblings, 0 replies; 37+ messages in thread
From: JohnGebbie @ 2022-08-08 19:44 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1238 bytes --]

There is an updated pull request by JohnGebbie against master on the void-packages repository

https://github.com/JohnGebbie/void-packages ydotool
https://github.com/void-linux/void-packages/pull/38268

New package: ydotool-1.0.1
#### Testing the changes
- I tested the changes in this PR: **YES**

#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures:
  - aarch64-musl
  - armv7l
  - armv6l-musl


I copied https://github.com/void-linux/void-packages/pull/31237 but ydotool has got easier to install.
To use it, you enable the ydotoold service and add your user to the "input" group.
This should press and release the A key: `ydotool key 30:1 30:0`

Currently I seem to need to `sv restart ydotoold` after I reboot.
Their manpages are out of date: https://github.com/ReimuNotMoe/ydotool/pull/144

Closes https://github.com/void-linux/void-packages/issues/31163

A patch file from https://github.com/void-linux/void-packages/pull/38268.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-ydotool-38268.patch --]
[-- Type: text/x-diff, Size: 2067 bytes --]

From 81d58ff1d50739d517f58a53c66fdb9cc78c0800 Mon Sep 17 00:00:00 2001
From: John Gebbie <me@johngebbie.com>
Date: Mon, 8 Aug 2022 20:37:27 +0100
Subject: [PATCH] New package: ydotool-1.0.1

---
 srcpkgs/ydotool/files/80-uinput.rules |  3 +++
 srcpkgs/ydotool/files/ydotoold/run    |  2 ++
 srcpkgs/ydotool/template              | 21 +++++++++++++++++++++
 3 files changed, 26 insertions(+)
 create mode 100644 srcpkgs/ydotool/files/80-uinput.rules
 create mode 100755 srcpkgs/ydotool/files/ydotoold/run
 create mode 100644 srcpkgs/ydotool/template

diff --git a/srcpkgs/ydotool/files/80-uinput.rules b/srcpkgs/ydotool/files/80-uinput.rules
new file mode 100644
index 000000000000..988d34547f52
--- /dev/null
+++ b/srcpkgs/ydotool/files/80-uinput.rules
@@ -0,0 +1,3 @@
+## ydotoold fix
+## https://github.com/ReimuNotMoe/ydotool/issues/25#issuecomment-535842993
+KERNEL=="uinput", GROUP="input", MODE="0660", OPTIONS+="static_node=uinput"
diff --git a/srcpkgs/ydotool/files/ydotoold/run b/srcpkgs/ydotool/files/ydotoold/run
new file mode 100755
index 000000000000..b9dc8c51bc2f
--- /dev/null
+++ b/srcpkgs/ydotool/files/ydotoold/run
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec chpst -u _ydotoold:input ydotoold --socket-perm 660 2>&1
diff --git a/srcpkgs/ydotool/template b/srcpkgs/ydotool/template
new file mode 100644
index 000000000000..44d31187e4c6
--- /dev/null
+++ b/srcpkgs/ydotool/template
@@ -0,0 +1,21 @@
+# Template file for 'ydotool'
+pkgname=ydotool
+version=1.0.1
+revision=1
+build_style=cmake
+hostmakedepends="pkg-config scdoc"
+short_desc="Generic command-line automation tool, works on Wayland and X11"
+maintainer="John Gebbie <me@johngebbie.com>"
+license="AGPL-3.0-only"
+homepage="https://github.com/ReimuNotMoe/ydotool"
+distfiles="https://github.com/ReimuNotMoe/ydotool/archive/v${version}.tar.gz"
+checksum=02311cdc608f205711b06a95e5fd71093b2294f4920efc526f5e98a2ddab42b8
+
+system_accounts="_ydotoold"
+_ydotoold_groups="input"
+
+post_install() {
+	vsv ydotoold
+	vinstall "${FILESDIR}/80-uinput.rules" 644 usr/lib/udev/rules.d
+	vlicense LICENSE
+}

^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: New package: ydotool-1.0.1
  2022-07-25 12:49 [PR PATCH] New package: ydotool-1.0.1 JohnGebbie
                   ` (10 preceding siblings ...)
  2022-08-08 19:44 ` JohnGebbie
@ 2022-08-08 19:44 ` JohnGebbie
  2022-08-08 21:33 ` JohnGebbie
                   ` (17 subsequent siblings)
  29 siblings, 0 replies; 37+ messages in thread
From: JohnGebbie @ 2022-08-08 19:44 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 241 bytes --]

New comment by JohnGebbie on void-packages repository

https://github.com/void-linux/void-packages/pull/38268#issuecomment-1208537095

Comment:
Sorry I don't know how it closed, I meant to update the branch and somehow clobbered everything.

^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: New package: ydotool-1.0.1
  2022-07-25 12:49 [PR PATCH] New package: ydotool-1.0.1 JohnGebbie
                   ` (11 preceding siblings ...)
  2022-08-08 19:44 ` JohnGebbie
@ 2022-08-08 21:33 ` JohnGebbie
  2022-08-10  9:58 ` [PR PATCH] [Updated] " JohnGebbie
                   ` (16 subsequent siblings)
  29 siblings, 0 replies; 37+ messages in thread
From: JohnGebbie @ 2022-08-08 21:33 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 400 bytes --]

New comment by JohnGebbie on void-packages repository

https://github.com/void-linux/void-packages/pull/38268#issuecomment-1208635726

Comment:
We've got a yodotoold service that runs as the _yodotoold user so the yodotool command works without root, but it'd be good to the able to run the yodotoold command without root as well (provided you're in the "input" group).
I'm not sure how to do that.

^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: [PR PATCH] [Updated] New package: ydotool-1.0.1
  2022-07-25 12:49 [PR PATCH] New package: ydotool-1.0.1 JohnGebbie
                   ` (12 preceding siblings ...)
  2022-08-08 21:33 ` JohnGebbie
@ 2022-08-10  9:58 ` JohnGebbie
  2022-08-10 10:00 ` JohnGebbie
                   ` (15 subsequent siblings)
  29 siblings, 0 replies; 37+ messages in thread
From: JohnGebbie @ 2022-08-10  9:58 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1238 bytes --]

There is an updated pull request by JohnGebbie against master on the void-packages repository

https://github.com/JohnGebbie/void-packages ydotool
https://github.com/void-linux/void-packages/pull/38268

New package: ydotool-1.0.1
#### Testing the changes
- I tested the changes in this PR: **YES**

#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures:
  - aarch64-musl
  - armv7l
  - armv6l-musl


I copied https://github.com/void-linux/void-packages/pull/31237 but ydotool has got easier to install.
To use it, you enable the ydotoold service and add your user to the "input" group.
This should press and release the A key: `ydotool key 30:1 30:0`

Currently I seem to need to `sv restart ydotoold` after I reboot.
Their manpages are out of date: https://github.com/ReimuNotMoe/ydotool/pull/144

Closes https://github.com/void-linux/void-packages/issues/31163

A patch file from https://github.com/void-linux/void-packages/pull/38268.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-ydotool-38268.patch --]
[-- Type: text/x-diff, Size: 3724 bytes --]

From 0b0eee2b6ed519535f49b63284166e8d5f5490ea Mon Sep 17 00:00:00 2001
From: John Gebbie <me@johngebbie.com>
Date: Mon, 8 Aug 2022 20:37:27 +0100
Subject: [PATCH] New package: ydotool-1.0.1

---
 srcpkgs/ydotool/INSTALL.msg               |  6 +++++
 srcpkgs/ydotool/files/80-uinput.rules     |  3 +++
 srcpkgs/ydotool/files/ydotool-workaround  |  2 ++
 srcpkgs/ydotool/files/ydotoold-workaround |  2 ++
 srcpkgs/ydotool/files/ydotoold/run        |  2 ++
 srcpkgs/ydotool/template                  | 28 +++++++++++++++++++++++
 6 files changed, 43 insertions(+)
 create mode 100644 srcpkgs/ydotool/INSTALL.msg
 create mode 100644 srcpkgs/ydotool/files/80-uinput.rules
 create mode 100755 srcpkgs/ydotool/files/ydotool-workaround
 create mode 100755 srcpkgs/ydotool/files/ydotoold-workaround
 create mode 100755 srcpkgs/ydotool/files/ydotoold/run
 create mode 100644 srcpkgs/ydotool/template

diff --git a/srcpkgs/ydotool/INSTALL.msg b/srcpkgs/ydotool/INSTALL.msg
new file mode 100644
index 000000000000..1812d29a7afc
--- /dev/null
+++ b/srcpkgs/ydotool/INSTALL.msg
@@ -0,0 +1,6 @@
+udev rules for uinput has been installed,
+to access /dev/uinput, add yourself to group input:
+
+    $ sudo usermod -a -G input $USER
+
+and then re-login to make it effective.
diff --git a/srcpkgs/ydotool/files/80-uinput.rules b/srcpkgs/ydotool/files/80-uinput.rules
new file mode 100644
index 000000000000..988d34547f52
--- /dev/null
+++ b/srcpkgs/ydotool/files/80-uinput.rules
@@ -0,0 +1,3 @@
+## ydotoold fix
+## https://github.com/ReimuNotMoe/ydotool/issues/25#issuecomment-535842993
+KERNEL=="uinput", GROUP="input", MODE="0660", OPTIONS+="static_node=uinput"
diff --git a/srcpkgs/ydotool/files/ydotool-workaround b/srcpkgs/ydotool/files/ydotool-workaround
new file mode 100755
index 000000000000..7264726a6433
--- /dev/null
+++ b/srcpkgs/ydotool/files/ydotool-workaround
@@ -0,0 +1,2 @@
+#!/bin/sh
+YDOTOOL_SOCKET="${YDOTOOL_SOCKET:-/var/lib/ydotoold/socket}" /usr/libexec/ydotool "$@"
diff --git a/srcpkgs/ydotool/files/ydotoold-workaround b/srcpkgs/ydotool/files/ydotoold-workaround
new file mode 100755
index 000000000000..ae4558078719
--- /dev/null
+++ b/srcpkgs/ydotool/files/ydotoold-workaround
@@ -0,0 +1,2 @@
+#!/bin/sh
+/usr/libexec/ydotoold -p /var/lib/ydotoold/socket -P 660
diff --git a/srcpkgs/ydotool/files/ydotoold/run b/srcpkgs/ydotool/files/ydotoold/run
new file mode 100755
index 000000000000..430cefd9bcd9
--- /dev/null
+++ b/srcpkgs/ydotool/files/ydotoold/run
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec chpst -u _ydotoold:input ydotoold 2>&1
diff --git a/srcpkgs/ydotool/template b/srcpkgs/ydotool/template
new file mode 100644
index 000000000000..fce12650fb4d
--- /dev/null
+++ b/srcpkgs/ydotool/template
@@ -0,0 +1,28 @@
+# Template file for 'ydotool'
+pkgname=ydotool
+version=1.0.1
+revision=1
+build_style=cmake
+hostmakedepends="pkg-config scdoc"
+short_desc="Generic command-line automation tool, works on Wayland and X11"
+maintainer="John Gebbie <me@johngebbie.com>"
+license="AGPL-3.0-only"
+homepage="https://github.com/ReimuNotMoe/ydotool"
+distfiles="https://github.com/ReimuNotMoe/ydotool/archive/v${version}.tar.gz"
+checksum=02311cdc608f205711b06a95e5fd71093b2294f4920efc526f5e98a2ddab42b8
+
+system_accounts="_ydotoold"
+_ydotoold_groups="input"
+
+# Used instead of /tmp so any group input user can replace the socket.
+make_dirs='/var/lib/ydotoold 0775 _ydotoold input'
+
+post_install() {
+	vinstall "${DESTDIR}/usr/bin/ydotool" 755 /usr/libexec
+	vbin "${FILESDIR}/ydotool-workaround" ydotool
+	vinstall "${DESTDIR}/usr/bin/ydotoold" 755 /usr/libexec
+	vbin "${FILESDIR}/ydotoold-workaround" ydotoold
+	vsv ydotoold
+	vinstall "${FILESDIR}/80-uinput.rules" 644 usr/lib/udev/rules.d
+	vlicense LICENSE
+}

^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: New package: ydotool-1.0.1
  2022-07-25 12:49 [PR PATCH] New package: ydotool-1.0.1 JohnGebbie
                   ` (13 preceding siblings ...)
  2022-08-10  9:58 ` [PR PATCH] [Updated] " JohnGebbie
@ 2022-08-10 10:00 ` JohnGebbie
  2022-08-10 11:50 ` [PR PATCH] [Updated] " JohnGebbie
                   ` (14 subsequent siblings)
  29 siblings, 0 replies; 37+ messages in thread
From: JohnGebbie @ 2022-08-10 10:00 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 400 bytes --]

New comment by JohnGebbie on void-packages repository

https://github.com/void-linux/void-packages/pull/38268#issuecomment-1208635726

Comment:
We've got a yodotoold service that runs as the _yodotoold user so the yodotool command works without root, but it'd be good to the able to run the yodotoold command without root as well (provided you're in the "input" group).
I'm not sure how to do that.

^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: [PR PATCH] [Updated] New package: ydotool-1.0.1
  2022-07-25 12:49 [PR PATCH] New package: ydotool-1.0.1 JohnGebbie
                   ` (14 preceding siblings ...)
  2022-08-10 10:00 ` JohnGebbie
@ 2022-08-10 11:50 ` JohnGebbie
  2022-08-10 12:54 ` JohnGebbie
                   ` (13 subsequent siblings)
  29 siblings, 0 replies; 37+ messages in thread
From: JohnGebbie @ 2022-08-10 11:50 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1238 bytes --]

There is an updated pull request by JohnGebbie against master on the void-packages repository

https://github.com/JohnGebbie/void-packages ydotool
https://github.com/void-linux/void-packages/pull/38268

New package: ydotool-1.0.1
#### Testing the changes
- I tested the changes in this PR: **YES**

#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures:
  - aarch64-musl
  - armv7l
  - armv6l-musl


I copied https://github.com/void-linux/void-packages/pull/31237 but ydotool has got easier to install.
To use it, you enable the ydotoold service and add your user to the "input" group.
This should press and release the A key: `ydotool key 30:1 30:0`

Currently I seem to need to `sv restart ydotoold` after I reboot.
Their manpages are out of date: https://github.com/ReimuNotMoe/ydotool/pull/144

Closes https://github.com/void-linux/void-packages/issues/31163

A patch file from https://github.com/void-linux/void-packages/pull/38268.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-ydotool-38268.patch --]
[-- Type: text/x-diff, Size: 9533 bytes --]

From 9748443c64470168a4d0f3947c8fe265540f9b71 Mon Sep 17 00:00:00 2001
From: John Gebbie <me@johngebbie.com>
Date: Mon, 8 Aug 2022 20:37:27 +0100
Subject: [PATCH] New package: ydotool-1.0.1

---
 srcpkgs/ydotool/INSTALL.msg               |   6 +
 srcpkgs/ydotool/files/80-uinput.rules     |   3 +
 srcpkgs/ydotool/files/ydotool-workaround  |   2 +
 srcpkgs/ydotool/files/ydotool.1           | 287 ++++++++++++++++++++++
 srcpkgs/ydotool/files/ydotoold-workaround |   2 +
 srcpkgs/ydotool/files/ydotoold/run        |   2 +
 srcpkgs/ydotool/template                  |  30 +++
 7 files changed, 332 insertions(+)
 create mode 100644 srcpkgs/ydotool/INSTALL.msg
 create mode 100644 srcpkgs/ydotool/files/80-uinput.rules
 create mode 100755 srcpkgs/ydotool/files/ydotool-workaround
 create mode 100644 srcpkgs/ydotool/files/ydotool.1
 create mode 100755 srcpkgs/ydotool/files/ydotoold-workaround
 create mode 100755 srcpkgs/ydotool/files/ydotoold/run
 create mode 100644 srcpkgs/ydotool/template

diff --git a/srcpkgs/ydotool/INSTALL.msg b/srcpkgs/ydotool/INSTALL.msg
new file mode 100644
index 000000000000..1812d29a7afc
--- /dev/null
+++ b/srcpkgs/ydotool/INSTALL.msg
@@ -0,0 +1,6 @@
+udev rules for uinput has been installed,
+to access /dev/uinput, add yourself to group input:
+
+    $ sudo usermod -a -G input $USER
+
+and then re-login to make it effective.
diff --git a/srcpkgs/ydotool/files/80-uinput.rules b/srcpkgs/ydotool/files/80-uinput.rules
new file mode 100644
index 000000000000..988d34547f52
--- /dev/null
+++ b/srcpkgs/ydotool/files/80-uinput.rules
@@ -0,0 +1,3 @@
+## ydotoold fix
+## https://github.com/ReimuNotMoe/ydotool/issues/25#issuecomment-535842993
+KERNEL=="uinput", GROUP="input", MODE="0660", OPTIONS+="static_node=uinput"
diff --git a/srcpkgs/ydotool/files/ydotool-workaround b/srcpkgs/ydotool/files/ydotool-workaround
new file mode 100755
index 000000000000..7264726a6433
--- /dev/null
+++ b/srcpkgs/ydotool/files/ydotool-workaround
@@ -0,0 +1,2 @@
+#!/bin/sh
+YDOTOOL_SOCKET="${YDOTOOL_SOCKET:-/var/lib/ydotoold/socket}" /usr/libexec/ydotool "$@"
diff --git a/srcpkgs/ydotool/files/ydotool.1 b/srcpkgs/ydotool/files/ydotool.1
new file mode 100644
index 000000000000..d054dd7ec3e5
--- /dev/null
+++ b/srcpkgs/ydotool/files/ydotool.1
@@ -0,0 +1,287 @@
+.\" Generated by scdoc  1.11.2
+.\" Complete documentation for this program is not available as a GNU info page
+.ie \n(.g .ds Aq \(aq
+.el       .ds Aq '
+.nh
+.ad l
+.\" Begin generated content:
+.TH "YDOTOOL" "1" "2022-08-10"
+.SH NAME
+.P
+ydotool - command-line \fI/dev/uinput\fR automation tool
+.P
+.SH SYNOPSIS
+.P
+\fBydotool\fR \fBcmd\fR \fIargs\fR
+.P
+\fBydotool\fR \fBcmd\fR --help
+.P
+.SH DESCRIPTION
+.P
+\fBydotool\fR lets you programmatically (or manually) simulate keyboard input and mouse activity, etc.\& It does this by writing directly to \fI/dev/uinput\fR so it generally needs to run as root.\&
+.P
+Currently implemented command(s):
+.P
+\fBtype\fR
+.RS 4
+Type a string
+.RE
+\fBkey\fR
+.RS 4
+Press keys
+.RE
+\fBmousemove\fR
+.RS 4
+Move mouse pointer to absolute position
+.RE
+\fBclick\fR
+.RS 4
+Click on mouse buttons
+.P
+.RE
+.SH KEYBOARD COMMANDS
+\fBkey\fR [\fB-d\fR,\fB--key-delay\fR \fI<ms>\fR] [\fI<KEYCODE:PRESSED>\fR .\&.\&.\&]
+.P
+.RS 4
+Type a given keycode.\&
+.P
+e.\&g.\& 28:1 28:0 means pressing on the Enter button on a standard US keyboard.\&
+.P
+42:1 38:1 38:0 24:1 24:0 38:1 38:0 42:0 - "LOL"
+.P
+Non-interpretable values, such as 0, aaa, l0l, will only cause a delay.\&
+.P
+See `/usr/include/linux/input-event-codes.\&h'\& for available key codes (KEY_*).\&
+.P
+Options:
+\fB-d\fR,\fB--key-delay\fR \fI<ms>\fR
+.RS 4
+Delay time between keystrokes.\& Default 12ms.\&
+.P
+.RE
+.RE
+\fBtype\fR [\fB-D\fR,\fB--next-delay\fR \fI<ms>\fR] [\fB-d\fR,\fB--key-delay\fR \fI<ms>\fR] [\fB-f\fR,\fB--file\fR \fI<filepath>\fR] "\fItext\fR"
+.P
+.RS 4
+Types text as if you had typed it on the keyboard.\&
+.P
+Options:
+.P
+\fB-d\fR,\fB--key-delay\fR \fI<ms>\fR
+.RS 4
+Delay time between key events (up/down each).\& Default 12ms.\&
+.P
+.RE
+\fB-D\fR,\fB--next-delay\fR \fI<ms>\fR
+.RS 4
+Delay between strings.\& Default 0ms.\&
+.P
+.RE
+\fB-f\fR,\fB--file\fR \fI<filepath>\fR
+.RS 4
+Specify a file, the contents of which will be typed as if passed as an argument.\& The filepath may also be '\&-'\& to read from stdin.\&
+.P
+.RE
+Example: to type '\&Hello world!\&'\& you would do:
+.RS 4
+ydotool type '\&Hello world!\&'\&
+.P
+.RE
+.RE
+.SH MOUSE COMMANDS
+.P
+\fBmousemove\fR [\fB-a\fR,\fB--absolute\fR] \fI<x> <y>\fR
+.RS 4
+Move the mouse to the relative X and Y coordinates on the screen.\&
+.P
+Options:
+\fB--absolute\fR
+.RS 4
+Use absolute position
+.P
+.RE
+Example: to move the cursor to absolute coordinates (100,100):
+.RS 4
+ydotool mousemove --absolute 100 100
+.P
+.RE
+.RE
+\fBclick\fR [\fB-d\fR,\fB--next-delay\fR \fI<ms>\fR] [\fB-r\fR,\fB--repeat\fR \fIN\fR ] [\fIbutton\fR .\&.\&.\&]
+.RS 4
+Send a click.\&
+.P
+Options:
+\fB-d\fR,\fB--next-delay\fR \fI<ms>\fR
+.RS 4
+Delay between input events (up/down, a compete click means doubled time).\& Default 25ms.\&
+.P
+.RE
+\fB-r\fR,\fB--repeat\fR \fIN\fR
+.RS 4
+Repeat entire sequence N times
+.P
+.RE
+all mouse buttons are represented using hexadecimal numeric values, with an optional
+bit mask to specify if mouse up/down needs to be omitted.\&
+.P
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.IP \(bu 4
+.\}
+0x00 - LEFT
+.RE
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.IP \(bu 4
+.\}
+0x01 - RIGHT
+.RE
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.IP \(bu 4
+.\}
+0x02 - MIDDLE
+.RE
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.IP \(bu 4
+.\}
+0x03 - SIDE
+.RE
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.IP \(bu 4
+.\}
+0x04 - EXTR
+.RE
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.IP \(bu 4
+.\}
+0x05 - FORWARD
+.RE
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.IP \(bu 4
+.\}
+0x06 - BACK
+.RE
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.IP \(bu 4
+.\}
+0x07 - TASK
+.RE
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.IP \(bu 4
+.\}
+0x40 - Mouse down
+.RE
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.IP \(bu 4
+.\}
+0x80 - Mouse up
+.RE
+  
+.RS 4
+
+.RE
+.RE
+Examples:
+.P
+.RS 4
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.IP \(bu 4
+.\}
+0x00: chooses left button, but does nothing (you can use this to implement extra sleeps)
+.RE
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.IP \(bu 4
+.\}
+0xC0: left button click (down then up)
+.RE
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.IP \(bu 4
+.\}
+0x41: right button down
+.RE
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.IP \(bu 4
+.\}
+0x82: middle button up
+
+.RE
+.P
+The '\&0x'\& prefix can be omitted if you want.\&
+.P
+.RE
+.SH AUTHOR
+.P
+ydotool was written by ReimuNotMoe.\&
+.P
+This man page by bob.\&hepple@gmail.\&com
+.P
+.SH BUGS
+.P
+When \fBydotool\fR(1) runs and creates a virtual input device, it will take some time for your graphical environment (eg X11/Wayland) to recognize and enable the virtual input device.\& (Usually done by udev)
+.P
+If the delay is too short, the virtual input device may not be recognized & enabled by the graphical environment in time.\&
+.P
+In order to solve this problem, there is a persistent background service, \fBydotoold\fR(1), to hold a persistent virtual device, and accept input from \fBydotool\fR(1).\& When \fBydotoold\fR(1) is unavailable, \fBydotool\fR(1) will work without it.\&
+.P
+.SH LICENCE
+AGPLv3
+.P
+.SH SEE ALSO
+.P
+\fBydotoold\fR(8)
+.P
+Project site: <https://github.\&com/ReimuNotMoe/ydotool>
diff --git a/srcpkgs/ydotool/files/ydotoold-workaround b/srcpkgs/ydotool/files/ydotoold-workaround
new file mode 100755
index 000000000000..ae4558078719
--- /dev/null
+++ b/srcpkgs/ydotool/files/ydotoold-workaround
@@ -0,0 +1,2 @@
+#!/bin/sh
+/usr/libexec/ydotoold -p /var/lib/ydotoold/socket -P 660
diff --git a/srcpkgs/ydotool/files/ydotoold/run b/srcpkgs/ydotool/files/ydotoold/run
new file mode 100755
index 000000000000..430cefd9bcd9
--- /dev/null
+++ b/srcpkgs/ydotool/files/ydotoold/run
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec chpst -u _ydotoold:input ydotoold 2>&1
diff --git a/srcpkgs/ydotool/template b/srcpkgs/ydotool/template
new file mode 100644
index 000000000000..20360580a3e7
--- /dev/null
+++ b/srcpkgs/ydotool/template
@@ -0,0 +1,30 @@
+# Template file for 'ydotool'
+pkgname=ydotool
+version=1.0.1
+revision=1
+build_style=cmake
+hostmakedepends="pkg-config scdoc"
+short_desc="Generic command-line automation tool, works on Wayland and X11"
+maintainer="John Gebbie <me@johngebbie.com>"
+license="AGPL-3.0-only"
+homepage="https://github.com/ReimuNotMoe/ydotool"
+distfiles="https://github.com/ReimuNotMoe/ydotool/archive/v${version}.tar.gz"
+checksum=02311cdc608f205711b06a95e5fd71093b2294f4920efc526f5e98a2ddab42b8
+
+system_accounts="_ydotoold"
+_ydotoold_groups="input"
+
+# Used instead of /tmp so any group input user can replace the socket.
+make_dirs='/var/lib/ydotoold 0775 _ydotoold input'
+
+post_install() {
+	vinstall "${DESTDIR}/usr/bin/ydotool" 755 /usr/libexec
+	vbin "${FILESDIR}/ydotool-workaround" ydotool
+	vinstall "${DESTDIR}/usr/bin/ydotoold" 755 /usr/libexec
+	vbin "${FILESDIR}/ydotoold-workaround" ydotoold
+	vsv ydotoold
+	vinstall "${FILESDIR}/80-uinput.rules" 644 usr/lib/udev/rules.d
+	vlicense LICENSE
+	# https://github.com/ReimuNotMoe/ydotool/pull/144
+	vman "${FILESDIR}/ydotool.1"
+}

^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: [PR PATCH] [Updated] New package: ydotool-1.0.1
  2022-07-25 12:49 [PR PATCH] New package: ydotool-1.0.1 JohnGebbie
                   ` (15 preceding siblings ...)
  2022-08-10 11:50 ` [PR PATCH] [Updated] " JohnGebbie
@ 2022-08-10 12:54 ` JohnGebbie
  2022-08-10 13:07 ` JohnGebbie
                   ` (12 subsequent siblings)
  29 siblings, 0 replies; 37+ messages in thread
From: JohnGebbie @ 2022-08-10 12:54 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1238 bytes --]

There is an updated pull request by JohnGebbie against master on the void-packages repository

https://github.com/JohnGebbie/void-packages ydotool
https://github.com/void-linux/void-packages/pull/38268

New package: ydotool-1.0.1
#### Testing the changes
- I tested the changes in this PR: **YES**

#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures:
  - aarch64-musl
  - armv7l
  - armv6l-musl


I copied https://github.com/void-linux/void-packages/pull/31237 but ydotool has got easier to install.
To use it, you enable the ydotoold service and add your user to the "input" group.
This should press and release the A key: `ydotool key 30:1 30:0`

Currently I seem to need to `sv restart ydotoold` after I reboot.
Their manpages are out of date: https://github.com/ReimuNotMoe/ydotool/pull/144

Closes https://github.com/void-linux/void-packages/issues/31163

A patch file from https://github.com/void-linux/void-packages/pull/38268.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-ydotool-38268.patch --]
[-- Type: text/x-diff, Size: 9637 bytes --]

From 68997073e23f82ba0b94b8363463d0669b221cf6 Mon Sep 17 00:00:00 2001
From: John Gebbie <me@johngebbie.com>
Date: Mon, 8 Aug 2022 20:37:27 +0100
Subject: [PATCH] New package: ydotool-1.0.1

---
 srcpkgs/ydotool/INSTALL.msg               |   6 +
 srcpkgs/ydotool/files/80-uinput.rules     |   3 +
 srcpkgs/ydotool/files/ydotool-workaround  |   2 +
 srcpkgs/ydotool/files/ydotool.1           | 287 ++++++++++++++++++++++
 srcpkgs/ydotool/files/ydotoold-workaround |   2 +
 srcpkgs/ydotool/files/ydotoold/run        |   5 +
 srcpkgs/ydotool/template                  |  30 +++
 7 files changed, 335 insertions(+)
 create mode 100644 srcpkgs/ydotool/INSTALL.msg
 create mode 100644 srcpkgs/ydotool/files/80-uinput.rules
 create mode 100755 srcpkgs/ydotool/files/ydotool-workaround
 create mode 100644 srcpkgs/ydotool/files/ydotool.1
 create mode 100755 srcpkgs/ydotool/files/ydotoold-workaround
 create mode 100755 srcpkgs/ydotool/files/ydotoold/run
 create mode 100644 srcpkgs/ydotool/template

diff --git a/srcpkgs/ydotool/INSTALL.msg b/srcpkgs/ydotool/INSTALL.msg
new file mode 100644
index 000000000000..1812d29a7afc
--- /dev/null
+++ b/srcpkgs/ydotool/INSTALL.msg
@@ -0,0 +1,6 @@
+udev rules for uinput has been installed,
+to access /dev/uinput, add yourself to group input:
+
+    $ sudo usermod -a -G input $USER
+
+and then re-login to make it effective.
diff --git a/srcpkgs/ydotool/files/80-uinput.rules b/srcpkgs/ydotool/files/80-uinput.rules
new file mode 100644
index 000000000000..988d34547f52
--- /dev/null
+++ b/srcpkgs/ydotool/files/80-uinput.rules
@@ -0,0 +1,3 @@
+## ydotoold fix
+## https://github.com/ReimuNotMoe/ydotool/issues/25#issuecomment-535842993
+KERNEL=="uinput", GROUP="input", MODE="0660", OPTIONS+="static_node=uinput"
diff --git a/srcpkgs/ydotool/files/ydotool-workaround b/srcpkgs/ydotool/files/ydotool-workaround
new file mode 100755
index 000000000000..7264726a6433
--- /dev/null
+++ b/srcpkgs/ydotool/files/ydotool-workaround
@@ -0,0 +1,2 @@
+#!/bin/sh
+YDOTOOL_SOCKET="${YDOTOOL_SOCKET:-/var/lib/ydotoold/socket}" /usr/libexec/ydotool "$@"
diff --git a/srcpkgs/ydotool/files/ydotool.1 b/srcpkgs/ydotool/files/ydotool.1
new file mode 100644
index 000000000000..d054dd7ec3e5
--- /dev/null
+++ b/srcpkgs/ydotool/files/ydotool.1
@@ -0,0 +1,287 @@
+.\" Generated by scdoc  1.11.2
+.\" Complete documentation for this program is not available as a GNU info page
+.ie \n(.g .ds Aq \(aq
+.el       .ds Aq '
+.nh
+.ad l
+.\" Begin generated content:
+.TH "YDOTOOL" "1" "2022-08-10"
+.SH NAME
+.P
+ydotool - command-line \fI/dev/uinput\fR automation tool
+.P
+.SH SYNOPSIS
+.P
+\fBydotool\fR \fBcmd\fR \fIargs\fR
+.P
+\fBydotool\fR \fBcmd\fR --help
+.P
+.SH DESCRIPTION
+.P
+\fBydotool\fR lets you programmatically (or manually) simulate keyboard input and mouse activity, etc.\& It does this by writing directly to \fI/dev/uinput\fR so it generally needs to run as root.\&
+.P
+Currently implemented command(s):
+.P
+\fBtype\fR
+.RS 4
+Type a string
+.RE
+\fBkey\fR
+.RS 4
+Press keys
+.RE
+\fBmousemove\fR
+.RS 4
+Move mouse pointer to absolute position
+.RE
+\fBclick\fR
+.RS 4
+Click on mouse buttons
+.P
+.RE
+.SH KEYBOARD COMMANDS
+\fBkey\fR [\fB-d\fR,\fB--key-delay\fR \fI<ms>\fR] [\fI<KEYCODE:PRESSED>\fR .\&.\&.\&]
+.P
+.RS 4
+Type a given keycode.\&
+.P
+e.\&g.\& 28:1 28:0 means pressing on the Enter button on a standard US keyboard.\&
+.P
+42:1 38:1 38:0 24:1 24:0 38:1 38:0 42:0 - "LOL"
+.P
+Non-interpretable values, such as 0, aaa, l0l, will only cause a delay.\&
+.P
+See `/usr/include/linux/input-event-codes.\&h'\& for available key codes (KEY_*).\&
+.P
+Options:
+\fB-d\fR,\fB--key-delay\fR \fI<ms>\fR
+.RS 4
+Delay time between keystrokes.\& Default 12ms.\&
+.P
+.RE
+.RE
+\fBtype\fR [\fB-D\fR,\fB--next-delay\fR \fI<ms>\fR] [\fB-d\fR,\fB--key-delay\fR \fI<ms>\fR] [\fB-f\fR,\fB--file\fR \fI<filepath>\fR] "\fItext\fR"
+.P
+.RS 4
+Types text as if you had typed it on the keyboard.\&
+.P
+Options:
+.P
+\fB-d\fR,\fB--key-delay\fR \fI<ms>\fR
+.RS 4
+Delay time between key events (up/down each).\& Default 12ms.\&
+.P
+.RE
+\fB-D\fR,\fB--next-delay\fR \fI<ms>\fR
+.RS 4
+Delay between strings.\& Default 0ms.\&
+.P
+.RE
+\fB-f\fR,\fB--file\fR \fI<filepath>\fR
+.RS 4
+Specify a file, the contents of which will be typed as if passed as an argument.\& The filepath may also be '\&-'\& to read from stdin.\&
+.P
+.RE
+Example: to type '\&Hello world!\&'\& you would do:
+.RS 4
+ydotool type '\&Hello world!\&'\&
+.P
+.RE
+.RE
+.SH MOUSE COMMANDS
+.P
+\fBmousemove\fR [\fB-a\fR,\fB--absolute\fR] \fI<x> <y>\fR
+.RS 4
+Move the mouse to the relative X and Y coordinates on the screen.\&
+.P
+Options:
+\fB--absolute\fR
+.RS 4
+Use absolute position
+.P
+.RE
+Example: to move the cursor to absolute coordinates (100,100):
+.RS 4
+ydotool mousemove --absolute 100 100
+.P
+.RE
+.RE
+\fBclick\fR [\fB-d\fR,\fB--next-delay\fR \fI<ms>\fR] [\fB-r\fR,\fB--repeat\fR \fIN\fR ] [\fIbutton\fR .\&.\&.\&]
+.RS 4
+Send a click.\&
+.P
+Options:
+\fB-d\fR,\fB--next-delay\fR \fI<ms>\fR
+.RS 4
+Delay between input events (up/down, a compete click means doubled time).\& Default 25ms.\&
+.P
+.RE
+\fB-r\fR,\fB--repeat\fR \fIN\fR
+.RS 4
+Repeat entire sequence N times
+.P
+.RE
+all mouse buttons are represented using hexadecimal numeric values, with an optional
+bit mask to specify if mouse up/down needs to be omitted.\&
+.P
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.IP \(bu 4
+.\}
+0x00 - LEFT
+.RE
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.IP \(bu 4
+.\}
+0x01 - RIGHT
+.RE
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.IP \(bu 4
+.\}
+0x02 - MIDDLE
+.RE
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.IP \(bu 4
+.\}
+0x03 - SIDE
+.RE
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.IP \(bu 4
+.\}
+0x04 - EXTR
+.RE
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.IP \(bu 4
+.\}
+0x05 - FORWARD
+.RE
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.IP \(bu 4
+.\}
+0x06 - BACK
+.RE
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.IP \(bu 4
+.\}
+0x07 - TASK
+.RE
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.IP \(bu 4
+.\}
+0x40 - Mouse down
+.RE
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.IP \(bu 4
+.\}
+0x80 - Mouse up
+.RE
+  
+.RS 4
+
+.RE
+.RE
+Examples:
+.P
+.RS 4
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.IP \(bu 4
+.\}
+0x00: chooses left button, but does nothing (you can use this to implement extra sleeps)
+.RE
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.IP \(bu 4
+.\}
+0xC0: left button click (down then up)
+.RE
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.IP \(bu 4
+.\}
+0x41: right button down
+.RE
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.IP \(bu 4
+.\}
+0x82: middle button up
+
+.RE
+.P
+The '\&0x'\& prefix can be omitted if you want.\&
+.P
+.RE
+.SH AUTHOR
+.P
+ydotool was written by ReimuNotMoe.\&
+.P
+This man page by bob.\&hepple@gmail.\&com
+.P
+.SH BUGS
+.P
+When \fBydotool\fR(1) runs and creates a virtual input device, it will take some time for your graphical environment (eg X11/Wayland) to recognize and enable the virtual input device.\& (Usually done by udev)
+.P
+If the delay is too short, the virtual input device may not be recognized & enabled by the graphical environment in time.\&
+.P
+In order to solve this problem, there is a persistent background service, \fBydotoold\fR(1), to hold a persistent virtual device, and accept input from \fBydotool\fR(1).\& When \fBydotoold\fR(1) is unavailable, \fBydotool\fR(1) will work without it.\&
+.P
+.SH LICENCE
+AGPLv3
+.P
+.SH SEE ALSO
+.P
+\fBydotoold\fR(8)
+.P
+Project site: <https://github.\&com/ReimuNotMoe/ydotool>
diff --git a/srcpkgs/ydotool/files/ydotoold-workaround b/srcpkgs/ydotool/files/ydotoold-workaround
new file mode 100755
index 000000000000..ae4558078719
--- /dev/null
+++ b/srcpkgs/ydotool/files/ydotoold-workaround
@@ -0,0 +1,2 @@
+#!/bin/sh
+/usr/libexec/ydotoold -p /var/lib/ydotoold/socket -P 660
diff --git a/srcpkgs/ydotool/files/ydotoold/run b/srcpkgs/ydotool/files/ydotoold/run
new file mode 100755
index 000000000000..e52ad8606eb2
--- /dev/null
+++ b/srcpkgs/ydotool/files/ydotoold/run
@@ -0,0 +1,5 @@
+#!/bin/sh
+# This service is experimental.
+# At boot, without the sleep, X11 sometimes ignores ydotool.
+sleep 2
+exec chpst -u _ydotoold:input ydotoold 2>&1
diff --git a/srcpkgs/ydotool/template b/srcpkgs/ydotool/template
new file mode 100644
index 000000000000..20360580a3e7
--- /dev/null
+++ b/srcpkgs/ydotool/template
@@ -0,0 +1,30 @@
+# Template file for 'ydotool'
+pkgname=ydotool
+version=1.0.1
+revision=1
+build_style=cmake
+hostmakedepends="pkg-config scdoc"
+short_desc="Generic command-line automation tool, works on Wayland and X11"
+maintainer="John Gebbie <me@johngebbie.com>"
+license="AGPL-3.0-only"
+homepage="https://github.com/ReimuNotMoe/ydotool"
+distfiles="https://github.com/ReimuNotMoe/ydotool/archive/v${version}.tar.gz"
+checksum=02311cdc608f205711b06a95e5fd71093b2294f4920efc526f5e98a2ddab42b8
+
+system_accounts="_ydotoold"
+_ydotoold_groups="input"
+
+# Used instead of /tmp so any group input user can replace the socket.
+make_dirs='/var/lib/ydotoold 0775 _ydotoold input'
+
+post_install() {
+	vinstall "${DESTDIR}/usr/bin/ydotool" 755 /usr/libexec
+	vbin "${FILESDIR}/ydotool-workaround" ydotool
+	vinstall "${DESTDIR}/usr/bin/ydotoold" 755 /usr/libexec
+	vbin "${FILESDIR}/ydotoold-workaround" ydotoold
+	vsv ydotoold
+	vinstall "${FILESDIR}/80-uinput.rules" 644 usr/lib/udev/rules.d
+	vlicense LICENSE
+	# https://github.com/ReimuNotMoe/ydotool/pull/144
+	vman "${FILESDIR}/ydotool.1"
+}

^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: New package: ydotool-1.0.1
  2022-07-25 12:49 [PR PATCH] New package: ydotool-1.0.1 JohnGebbie
                   ` (16 preceding siblings ...)
  2022-08-10 12:54 ` JohnGebbie
@ 2022-08-10 13:07 ` JohnGebbie
  2022-08-10 13:19 ` JohnGebbie
                   ` (11 subsequent siblings)
  29 siblings, 0 replies; 37+ messages in thread
From: JohnGebbie @ 2022-08-10 13:07 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 314 bytes --]

New comment by JohnGebbie on void-packages repository

https://github.com/void-linux/void-packages/pull/38268#issuecomment-1210650085

Comment:
That should be it. The ydotoold and ydotool commands work without root for any user in group input.
There's also a service for ydotoold, and a now up to date manpage.


^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: New package: ydotool-1.0.1
  2022-07-25 12:49 [PR PATCH] New package: ydotool-1.0.1 JohnGebbie
                   ` (17 preceding siblings ...)
  2022-08-10 13:07 ` JohnGebbie
@ 2022-08-10 13:19 ` JohnGebbie
  2022-08-10 14:29 ` [PR PATCH] [Updated] " JohnGebbie
                   ` (10 subsequent siblings)
  29 siblings, 0 replies; 37+ messages in thread
From: JohnGebbie @ 2022-08-10 13:19 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 257 bytes --]

New comment by JohnGebbie on void-packages repository

https://github.com/void-linux/void-packages/pull/38268#issuecomment-1210663922

Comment:
Actually not quite, the ydotool manpage should say ydotoold needs to be running, as it does since the refractor.

^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: [PR PATCH] [Updated] New package: ydotool-1.0.1
  2022-07-25 12:49 [PR PATCH] New package: ydotool-1.0.1 JohnGebbie
                   ` (18 preceding siblings ...)
  2022-08-10 13:19 ` JohnGebbie
@ 2022-08-10 14:29 ` JohnGebbie
  2022-08-10 14:33 ` JohnGebbie
                   ` (9 subsequent siblings)
  29 siblings, 0 replies; 37+ messages in thread
From: JohnGebbie @ 2022-08-10 14:29 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 903 bytes --]

There is an updated pull request by JohnGebbie against master on the void-packages repository

https://github.com/JohnGebbie/void-packages ydotool
https://github.com/void-linux/void-packages/pull/38268

New package: ydotool-1.0.1
#### Testing the changes
- I tested the changes in this PR: **YES**

#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures:
  - aarch64-musl
  - armv7l
  - armv6l-musl

I started with https://github.com/void-linux/void-packages/pull/31237

Closes https://github.com/void-linux/void-packages/issues/31163

A patch file from https://github.com/void-linux/void-packages/pull/38268.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-ydotool-38268.patch --]
[-- Type: text/x-diff, Size: 10535 bytes --]

From d2eeda9f1435aea0455693ac281d4f1b83eb6718 Mon Sep 17 00:00:00 2001
From: John Gebbie <me@johngebbie.com>
Date: Mon, 8 Aug 2022 20:37:27 +0100
Subject: [PATCH] New package: ydotool-1.0.1

---
 srcpkgs/ydotool/INSTALL.msg               |   6 +
 srcpkgs/ydotool/files/80-uinput.rules     |   3 +
 srcpkgs/ydotool/files/ydotool-workaround  |   2 +
 srcpkgs/ydotool/files/ydotool.1           | 285 ++++++++++++++++++++++
 srcpkgs/ydotool/files/ydotoold-workaround |   2 +
 srcpkgs/ydotool/files/ydotoold.8          |  55 +++++
 srcpkgs/ydotool/files/ydotoold/run        |   5 +
 srcpkgs/ydotool/template                  |  31 +++
 8 files changed, 389 insertions(+)
 create mode 100644 srcpkgs/ydotool/INSTALL.msg
 create mode 100644 srcpkgs/ydotool/files/80-uinput.rules
 create mode 100755 srcpkgs/ydotool/files/ydotool-workaround
 create mode 100644 srcpkgs/ydotool/files/ydotool.1
 create mode 100755 srcpkgs/ydotool/files/ydotoold-workaround
 create mode 100644 srcpkgs/ydotool/files/ydotoold.8
 create mode 100755 srcpkgs/ydotool/files/ydotoold/run
 create mode 100644 srcpkgs/ydotool/template

diff --git a/srcpkgs/ydotool/INSTALL.msg b/srcpkgs/ydotool/INSTALL.msg
new file mode 100644
index 000000000000..1812d29a7afc
--- /dev/null
+++ b/srcpkgs/ydotool/INSTALL.msg
@@ -0,0 +1,6 @@
+udev rules for uinput has been installed,
+to access /dev/uinput, add yourself to group input:
+
+    $ sudo usermod -a -G input $USER
+
+and then re-login to make it effective.
diff --git a/srcpkgs/ydotool/files/80-uinput.rules b/srcpkgs/ydotool/files/80-uinput.rules
new file mode 100644
index 000000000000..988d34547f52
--- /dev/null
+++ b/srcpkgs/ydotool/files/80-uinput.rules
@@ -0,0 +1,3 @@
+## ydotoold fix
+## https://github.com/ReimuNotMoe/ydotool/issues/25#issuecomment-535842993
+KERNEL=="uinput", GROUP="input", MODE="0660", OPTIONS+="static_node=uinput"
diff --git a/srcpkgs/ydotool/files/ydotool-workaround b/srcpkgs/ydotool/files/ydotool-workaround
new file mode 100755
index 000000000000..7264726a6433
--- /dev/null
+++ b/srcpkgs/ydotool/files/ydotool-workaround
@@ -0,0 +1,2 @@
+#!/bin/sh
+YDOTOOL_SOCKET="${YDOTOOL_SOCKET:-/var/lib/ydotoold/socket}" /usr/libexec/ydotool "$@"
diff --git a/srcpkgs/ydotool/files/ydotool.1 b/srcpkgs/ydotool/files/ydotool.1
new file mode 100644
index 000000000000..cd18f3e908c8
--- /dev/null
+++ b/srcpkgs/ydotool/files/ydotool.1
@@ -0,0 +1,285 @@
+.\" Generated by scdoc  1.11.2
+.\" Complete documentation for this program is not available as a GNU info page
+.ie \n(.g .ds Aq \(aq
+.el       .ds Aq '
+.nh
+.ad l
+.\" Begin generated content:
+.TH "YDOTOOL" "1" "2022-08-10"
+.SH NAME
+.P
+ydotool - command-line \fI/dev/uinput\fR automation tool
+.P
+.SH SYNOPSIS
+.P
+\fBydotool\fR \fBcmd\fR \fIargs\fR
+.P
+\fBydotool\fR \fBcmd\fR --help
+.P
+.SH DESCRIPTION
+.P
+\fBydotool\fR lets you programmatically (or manually) simulate keyboard input and mouse activity, etc.\&
+The \fBydotoold\fR(1) daemon must be running.\&
+.P
+.P
+Currently implemented command(s):
+.P
+\fBtype\fR
+.RS 4
+Type a string
+.RE
+\fBkey\fR
+.RS 4
+Press keys
+.RE
+\fBmousemove\fR
+.RS 4
+Move mouse pointer to absolute position
+.RE
+\fBclick\fR
+.RS 4
+Click on mouse buttons
+.P
+.RE
+.SH KEYBOARD COMMANDS
+\fBkey\fR [\fB-d\fR,\fB--key-delay\fR \fI<ms>\fR] [\fI<KEYCODE:PRESSED>\fR .\&.\&.\&]
+.P
+.RS 4
+Type a given keycode.\&
+.P
+e.\&g.\& 28:1 28:0 means pressing on the Enter button on a standard US keyboard.\&
+.P
+42:1 38:1 38:0 24:1 24:0 38:1 38:0 42:0 - "LOL"
+.P
+Non-interpretable values, such as 0, aaa, l0l, will only cause a delay.\&
+.P
+See `/usr/include/linux/input-event-codes.\&h'\& for available key codes (KEY_*).\&
+.P
+Options:
+\fB-d\fR,\fB--key-delay\fR \fI<ms>\fR
+.RS 4
+Delay time between keystrokes.\& Default 12ms.\&
+.P
+.RE
+.RE
+\fBtype\fR [\fB-D\fR,\fB--next-delay\fR \fI<ms>\fR] [\fB-d\fR,\fB--key-delay\fR \fI<ms>\fR] [\fB-f\fR,\fB--file\fR \fI<filepath>\fR] "\fItext\fR"
+.P
+.RS 4
+Types text as if you had typed it on the keyboard.\&
+.P
+Options:
+.P
+\fB-d\fR,\fB--key-delay\fR \fI<ms>\fR
+.RS 4
+Delay time between key events (up/down each).\& Default 12ms.\&
+.P
+.RE
+\fB-D\fR,\fB--next-delay\fR \fI<ms>\fR
+.RS 4
+Delay between strings.\& Default 0ms.\&
+.P
+.RE
+\fB-f\fR,\fB--file\fR \fI<filepath>\fR
+.RS 4
+Specify a file, the contents of which will be typed as if passed as an argument.\& The filepath may also be '\&-'\& to read from stdin.\&
+.P
+.RE
+Example: to type '\&Hello world!\&'\& you would do:
+.RS 4
+ydotool type '\&Hello world!\&'\&
+.P
+.RE
+.RE
+.SH MOUSE COMMANDS
+.P
+\fBmousemove\fR [\fB-a\fR,\fB--absolute\fR] \fI<x> <y>\fR
+.RS 4
+Move the mouse to the relative X and Y coordinates on the screen.\&
+.P
+Options:
+\fB--absolute\fR
+.RS 4
+Use absolute position
+.P
+.RE
+Example: to move the cursor to absolute coordinates (100,100):
+.RS 4
+ydotool mousemove --absolute 100 100
+.P
+.RE
+.RE
+\fBclick\fR [\fB-d\fR,\fB--next-delay\fR \fI<ms>\fR] [\fB-r\fR,\fB--repeat\fR \fIN\fR ] [\fIbutton\fR .\&.\&.\&]
+.RS 4
+Send a click.\&
+.P
+Options:
+\fB-d\fR,\fB--next-delay\fR \fI<ms>\fR
+.RS 4
+Delay between input events (up/down, a compete click means doubled time).\& Default 25ms.\&
+.P
+.RE
+\fB-r\fR,\fB--repeat\fR \fIN\fR
+.RS 4
+Repeat entire sequence N times
+.P
+.RE
+all mouse buttons are represented using hexadecimal numeric values, with an optional
+bit mask to specify if mouse up/down needs to be omitted.\&
+.P
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.IP \(bu 4
+.\}
+0x00 - LEFT
+.RE
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.IP \(bu 4
+.\}
+0x01 - RIGHT
+.RE
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.IP \(bu 4
+.\}
+0x02 - MIDDLE
+.RE
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.IP \(bu 4
+.\}
+0x03 - SIDE
+.RE
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.IP \(bu 4
+.\}
+0x04 - EXTR
+.RE
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.IP \(bu 4
+.\}
+0x05 - FORWARD
+.RE
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.IP \(bu 4
+.\}
+0x06 - BACK
+.RE
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.IP \(bu 4
+.\}
+0x07 - TASK
+.RE
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.IP \(bu 4
+.\}
+0x40 - Mouse down
+.RE
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.IP \(bu 4
+.\}
+0x80 - Mouse up
+.RE
+  
+.RS 4
+
+.RE
+.RE
+Examples:
+.P
+.RS 4
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.IP \(bu 4
+.\}
+0x00: chooses left button, but does nothing (you can use this to implement extra sleeps)
+.RE
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.IP \(bu 4
+.\}
+0xC0: left button click (down then up)
+.RE
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.IP \(bu 4
+.\}
+0x41: right button down
+.RE
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.IP \(bu 4
+.\}
+0x82: middle button up
+
+.RE
+.P
+The '\&0x'\& prefix can be omitted if you want.\&
+.P
+.RE
+.SH YDOTOOL SOCKET
+.P
+The socket to write to for \fBydotoold\fR(1) can be changed by the environment variable YDOTOOL_SOCKET.\&
+.P
+.SH AUTHOR
+.P
+ydotool was written by ReimuNotMoe.\&
+.P
+This manpage was written by bob.\&hepple@gmail.\&com but updated since.\&
+.P
+.SH LICENCE
+AGPLv3
+.P
+.SH SEE ALSO
+.P
+\fBydotoold\fR(8)
+.P
+Project site: <https://github.\&com/ReimuNotMoe/ydotool>
diff --git a/srcpkgs/ydotool/files/ydotoold-workaround b/srcpkgs/ydotool/files/ydotoold-workaround
new file mode 100755
index 000000000000..ae4558078719
--- /dev/null
+++ b/srcpkgs/ydotool/files/ydotoold-workaround
@@ -0,0 +1,2 @@
+#!/bin/sh
+/usr/libexec/ydotoold -p /var/lib/ydotoold/socket -P 660
diff --git a/srcpkgs/ydotool/files/ydotoold.8 b/srcpkgs/ydotool/files/ydotoold.8
new file mode 100644
index 000000000000..a2f4b67af9e1
--- /dev/null
+++ b/srcpkgs/ydotool/files/ydotoold.8
@@ -0,0 +1,55 @@
+.\" Generated by scdoc  1.11.2
+.\" Complete documentation for this program is not available as a GNU info page
+.ie \n(.g .ds Aq \(aq
+.el       .ds Aq '
+.nh
+.ad l
+.\" Begin generated content:
+.TH "ydotoold" "8" "2022-08-10"
+.P
+.SH NAME
+.P
+ydotoold - daemon for \fBydotool\fR(1)
+.P
+.SH SYNOPSIS
+.P
+\fBydotoold\fR \fI[OPTION.\&.\&.\&]\fR
+.P
+.SH DESCRIPTION
+.P
+\fBydotoold\fR holds a persistent virtual device, and accepts input from \fBydotool\fR(1).\&
+.P
+.SH OPTIONS
+.P
+.RS 4
+\fB-p\fR, \fB--socket-path arg\fR \fI<path>\fR
+.RS 4
+Set socket path.\&
+.P
+.RE
+\fB-P\fR, \fB--socket-perm arg\fR \fI<perms>\fR
+.RS 4
+Set socket permission.\&
+.P
+.RE
+\fB-h\fR, \fB--help\fR
+.RS 4
+Display help and exit.\&
+.P
+.RE
+.RE
+.SH AUTHOR
+.P
+\fBydotool\fR(1) and \fBydotoold\fR(8) were written by ReimuNotMoe.\&
+.P
+This manpage was written by bob.\&hepple@gmail.\&com but updated since.\&
+.P
+.SH LICENCE
+.P
+AGPLv3
+.P
+.SH SEE ALSO
+.P
+\fBydotool\fR(1)
+.P
+Project site: <https://github.\&com/ReimuNotMoe/ydotool>
diff --git a/srcpkgs/ydotool/files/ydotoold/run b/srcpkgs/ydotool/files/ydotoold/run
new file mode 100755
index 000000000000..e52ad8606eb2
--- /dev/null
+++ b/srcpkgs/ydotool/files/ydotoold/run
@@ -0,0 +1,5 @@
+#!/bin/sh
+# This service is experimental.
+# At boot, without the sleep, X11 sometimes ignores ydotool.
+sleep 2
+exec chpst -u _ydotoold:input ydotoold 2>&1
diff --git a/srcpkgs/ydotool/template b/srcpkgs/ydotool/template
new file mode 100644
index 000000000000..bdff53085307
--- /dev/null
+++ b/srcpkgs/ydotool/template
@@ -0,0 +1,31 @@
+# Template file for 'ydotool'
+pkgname=ydotool
+version=1.0.1
+revision=1
+build_style=cmake
+hostmakedepends="pkg-config scdoc"
+short_desc="Generic command-line automation tool, works on Wayland and X11"
+maintainer="John Gebbie <me@johngebbie.com>"
+license="AGPL-3.0-only"
+homepage="https://github.com/ReimuNotMoe/ydotool"
+distfiles="https://github.com/ReimuNotMoe/ydotool/archive/v${version}.tar.gz"
+checksum=02311cdc608f205711b06a95e5fd71093b2294f4920efc526f5e98a2ddab42b8
+
+system_accounts="_ydotoold"
+_ydotoold_groups="input"
+
+# Used instead of /tmp so any group input user can replace the socket.
+make_dirs='/var/lib/ydotoold 0775 _ydotoold input'
+
+post_install() {
+	vinstall "${DESTDIR}/usr/bin/ydotool" 755 /usr/libexec
+	vbin "${FILESDIR}/ydotool-workaround" ydotool
+	vinstall "${DESTDIR}/usr/bin/ydotoold" 755 /usr/libexec
+	vbin "${FILESDIR}/ydotoold-workaround" ydotoold
+	vsv ydotoold
+	vinstall "${FILESDIR}/80-uinput.rules" 644 usr/lib/udev/rules.d
+	vlicense LICENSE
+	# https://github.com/ReimuNotMoe/ydotool/pull/168
+	vman "${FILESDIR}/ydotool.1"
+	vman "${FILESDIR}/ydotoold.8"
+}

^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: New package: ydotool-1.0.1
  2022-07-25 12:49 [PR PATCH] New package: ydotool-1.0.1 JohnGebbie
                   ` (19 preceding siblings ...)
  2022-08-10 14:29 ` [PR PATCH] [Updated] " JohnGebbie
@ 2022-08-10 14:33 ` JohnGebbie
  2022-08-10 14:35 ` JohnGebbie
                   ` (8 subsequent siblings)
  29 siblings, 0 replies; 37+ messages in thread
From: JohnGebbie @ 2022-08-10 14:33 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 196 bytes --]

New comment by JohnGebbie on void-packages repository

https://github.com/void-linux/void-packages/pull/38268#issuecomment-1210763313

Comment:
Ok that's it for realsies with up to date manpages.

^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: New package: ydotool-1.0.1
  2022-07-25 12:49 [PR PATCH] New package: ydotool-1.0.1 JohnGebbie
                   ` (20 preceding siblings ...)
  2022-08-10 14:33 ` JohnGebbie
@ 2022-08-10 14:35 ` JohnGebbie
  2022-08-10 14:52 ` JohnGebbie
                   ` (7 subsequent siblings)
  29 siblings, 0 replies; 37+ messages in thread
From: JohnGebbie @ 2022-08-10 14:35 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 171 bytes --]

New comment by JohnGebbie on void-packages repository

https://github.com/void-linux/void-packages/pull/38268#issuecomment-1210763313

Comment:
Ok that's it for realsies.

^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: New package: ydotool-1.0.1
  2022-07-25 12:49 [PR PATCH] New package: ydotool-1.0.1 JohnGebbie
                   ` (21 preceding siblings ...)
  2022-08-10 14:35 ` JohnGebbie
@ 2022-08-10 14:52 ` JohnGebbie
  2022-08-10 14:55 ` [PR PATCH] [Updated] " JohnGebbie
                   ` (6 subsequent siblings)
  29 siblings, 0 replies; 37+ messages in thread
From: JohnGebbie @ 2022-08-10 14:52 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 171 bytes --]

New comment by JohnGebbie on void-packages repository

https://github.com/void-linux/void-packages/pull/38268#issuecomment-1210763313

Comment:
Ok that's it for realsies.

^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: [PR PATCH] [Updated] New package: ydotool-1.0.1
  2022-07-25 12:49 [PR PATCH] New package: ydotool-1.0.1 JohnGebbie
                   ` (22 preceding siblings ...)
  2022-08-10 14:52 ` JohnGebbie
@ 2022-08-10 14:55 ` JohnGebbie
  2022-08-17  9:13 ` JohnGebbie
                   ` (5 subsequent siblings)
  29 siblings, 0 replies; 37+ messages in thread
From: JohnGebbie @ 2022-08-10 14:55 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 903 bytes --]

There is an updated pull request by JohnGebbie against master on the void-packages repository

https://github.com/JohnGebbie/void-packages ydotool
https://github.com/void-linux/void-packages/pull/38268

New package: ydotool-1.0.1
#### Testing the changes
- I tested the changes in this PR: **YES**

#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures:
  - aarch64-musl
  - armv7l
  - armv6l-musl

I started with https://github.com/void-linux/void-packages/pull/31237

Closes https://github.com/void-linux/void-packages/issues/31163

A patch file from https://github.com/void-linux/void-packages/pull/38268.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-ydotool-38268.patch --]
[-- Type: text/x-diff, Size: 10535 bytes --]

From 3357141d4dcb0987423162b3d9611678e4d01009 Mon Sep 17 00:00:00 2001
From: John Gebbie <me@johngebbie.com>
Date: Mon, 8 Aug 2022 20:37:27 +0100
Subject: [PATCH] New package: ydotool-1.0.1

---
 srcpkgs/ydotool/INSTALL.msg               |   6 +
 srcpkgs/ydotool/files/80-uinput.rules     |   3 +
 srcpkgs/ydotool/files/ydotool-workaround  |   2 +
 srcpkgs/ydotool/files/ydotool.1           | 285 ++++++++++++++++++++++
 srcpkgs/ydotool/files/ydotoold-workaround |   2 +
 srcpkgs/ydotool/files/ydotoold.8          |  55 +++++
 srcpkgs/ydotool/files/ydotoold/run        |   5 +
 srcpkgs/ydotool/template                  |  31 +++
 8 files changed, 389 insertions(+)
 create mode 100644 srcpkgs/ydotool/INSTALL.msg
 create mode 100644 srcpkgs/ydotool/files/80-uinput.rules
 create mode 100755 srcpkgs/ydotool/files/ydotool-workaround
 create mode 100644 srcpkgs/ydotool/files/ydotool.1
 create mode 100755 srcpkgs/ydotool/files/ydotoold-workaround
 create mode 100644 srcpkgs/ydotool/files/ydotoold.8
 create mode 100755 srcpkgs/ydotool/files/ydotoold/run
 create mode 100644 srcpkgs/ydotool/template

diff --git a/srcpkgs/ydotool/INSTALL.msg b/srcpkgs/ydotool/INSTALL.msg
new file mode 100644
index 000000000000..1812d29a7afc
--- /dev/null
+++ b/srcpkgs/ydotool/INSTALL.msg
@@ -0,0 +1,6 @@
+udev rules for uinput has been installed,
+to access /dev/uinput, add yourself to group input:
+
+    $ sudo usermod -a -G input $USER
+
+and then re-login to make it effective.
diff --git a/srcpkgs/ydotool/files/80-uinput.rules b/srcpkgs/ydotool/files/80-uinput.rules
new file mode 100644
index 000000000000..988d34547f52
--- /dev/null
+++ b/srcpkgs/ydotool/files/80-uinput.rules
@@ -0,0 +1,3 @@
+## ydotoold fix
+## https://github.com/ReimuNotMoe/ydotool/issues/25#issuecomment-535842993
+KERNEL=="uinput", GROUP="input", MODE="0660", OPTIONS+="static_node=uinput"
diff --git a/srcpkgs/ydotool/files/ydotool-workaround b/srcpkgs/ydotool/files/ydotool-workaround
new file mode 100755
index 000000000000..7264726a6433
--- /dev/null
+++ b/srcpkgs/ydotool/files/ydotool-workaround
@@ -0,0 +1,2 @@
+#!/bin/sh
+YDOTOOL_SOCKET="${YDOTOOL_SOCKET:-/var/lib/ydotoold/socket}" /usr/libexec/ydotool "$@"
diff --git a/srcpkgs/ydotool/files/ydotool.1 b/srcpkgs/ydotool/files/ydotool.1
new file mode 100644
index 000000000000..0c2e5528c479
--- /dev/null
+++ b/srcpkgs/ydotool/files/ydotool.1
@@ -0,0 +1,285 @@
+.\" Generated by scdoc  1.11.2
+.\" Complete documentation for this program is not available as a GNU info page
+.ie \n(.g .ds Aq \(aq
+.el       .ds Aq '
+.nh
+.ad l
+.\" Begin generated content:
+.TH "YDOTOOL" "1" "2022-08-10"
+.SH NAME
+.P
+ydotool - command-line \fI/dev/uinput\fR automation tool
+.P
+.SH SYNOPSIS
+.P
+\fBydotool\fR \fBcmd\fR \fIargs\fR
+.P
+\fBydotool\fR \fBcmd\fR --help
+.P
+.SH DESCRIPTION
+.P
+\fBydotool\fR lets you programmatically (or manually) simulate keyboard input and mouse activity, etc.\&
+The \fBydotoold\fR(8) daemon must be running.\&
+.P
+.P
+Currently implemented command(s):
+.P
+\fBtype\fR
+.RS 4
+Type a string
+.RE
+\fBkey\fR
+.RS 4
+Press keys
+.RE
+\fBmousemove\fR
+.RS 4
+Move mouse pointer to absolute position
+.RE
+\fBclick\fR
+.RS 4
+Click on mouse buttons
+.P
+.RE
+.SH KEYBOARD COMMANDS
+\fBkey\fR [\fB-d\fR,\fB--key-delay\fR \fI<ms>\fR] [\fI<KEYCODE:PRESSED>\fR .\&.\&.\&]
+.P
+.RS 4
+Type a given keycode.\&
+.P
+e.\&g.\& 28:1 28:0 means pressing on the Enter button on a standard US keyboard.\&
+.P
+42:1 38:1 38:0 24:1 24:0 38:1 38:0 42:0 - "LOL"
+.P
+Non-interpretable values, such as 0, aaa, l0l, will only cause a delay.\&
+.P
+See `/usr/include/linux/input-event-codes.\&h'\& for available key codes (KEY_*).\&
+.P
+Options:
+\fB-d\fR,\fB--key-delay\fR \fI<ms>\fR
+.RS 4
+Delay time between keystrokes.\& Default 12ms.\&
+.P
+.RE
+.RE
+\fBtype\fR [\fB-D\fR,\fB--next-delay\fR \fI<ms>\fR] [\fB-d\fR,\fB--key-delay\fR \fI<ms>\fR] [\fB-f\fR,\fB--file\fR \fI<filepath>\fR] "\fItext\fR"
+.P
+.RS 4
+Types text as if you had typed it on the keyboard.\&
+.P
+Options:
+.P
+\fB-d\fR,\fB--key-delay\fR \fI<ms>\fR
+.RS 4
+Delay time between key events (up/down each).\& Default 12ms.\&
+.P
+.RE
+\fB-D\fR,\fB--next-delay\fR \fI<ms>\fR
+.RS 4
+Delay between strings.\& Default 0ms.\&
+.P
+.RE
+\fB-f\fR,\fB--file\fR \fI<filepath>\fR
+.RS 4
+Specify a file, the contents of which will be typed as if passed as an argument.\& The filepath may also be '\&-'\& to read from stdin.\&
+.P
+.RE
+Example: to type '\&Hello world!\&'\& you would do:
+.RS 4
+ydotool type '\&Hello world!\&'\&
+.P
+.RE
+.RE
+.SH MOUSE COMMANDS
+.P
+\fBmousemove\fR [\fB-a\fR,\fB--absolute\fR] \fI<x> <y>\fR
+.RS 4
+Move the mouse to the relative X and Y coordinates on the screen.\&
+.P
+Options:
+\fB--absolute\fR
+.RS 4
+Use absolute position
+.P
+.RE
+Example: to move the cursor to absolute coordinates (100,100):
+.RS 4
+ydotool mousemove --absolute 100 100
+.P
+.RE
+.RE
+\fBclick\fR [\fB-d\fR,\fB--next-delay\fR \fI<ms>\fR] [\fB-r\fR,\fB--repeat\fR \fIN\fR ] [\fIbutton\fR .\&.\&.\&]
+.RS 4
+Send a click.\&
+.P
+Options:
+\fB-d\fR,\fB--next-delay\fR \fI<ms>\fR
+.RS 4
+Delay between input events (up/down, a compete click means doubled time).\& Default 25ms.\&
+.P
+.RE
+\fB-r\fR,\fB--repeat\fR \fIN\fR
+.RS 4
+Repeat entire sequence N times
+.P
+.RE
+all mouse buttons are represented using hexadecimal numeric values, with an optional
+bit mask to specify if mouse up/down needs to be omitted.\&
+.P
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.IP \(bu 4
+.\}
+0x00 - LEFT
+.RE
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.IP \(bu 4
+.\}
+0x01 - RIGHT
+.RE
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.IP \(bu 4
+.\}
+0x02 - MIDDLE
+.RE
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.IP \(bu 4
+.\}
+0x03 - SIDE
+.RE
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.IP \(bu 4
+.\}
+0x04 - EXTR
+.RE
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.IP \(bu 4
+.\}
+0x05 - FORWARD
+.RE
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.IP \(bu 4
+.\}
+0x06 - BACK
+.RE
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.IP \(bu 4
+.\}
+0x07 - TASK
+.RE
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.IP \(bu 4
+.\}
+0x40 - Mouse down
+.RE
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.IP \(bu 4
+.\}
+0x80 - Mouse up
+.RE
+  
+.RS 4
+
+.RE
+.RE
+Examples:
+.P
+.RS 4
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.IP \(bu 4
+.\}
+0x00: chooses left button, but does nothing (you can use this to implement extra sleeps)
+.RE
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.IP \(bu 4
+.\}
+0xC0: left button click (down then up)
+.RE
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.IP \(bu 4
+.\}
+0x41: right button down
+.RE
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.IP \(bu 4
+.\}
+0x82: middle button up
+
+.RE
+.P
+The '\&0x'\& prefix can be omitted if you want.\&
+.P
+.RE
+.SH YDOTOOL SOCKET
+.P
+The socket to write to for \fBydotoold\fR(8) can be changed by the environment variable YDOTOOL_SOCKET.\&
+.P
+.SH AUTHOR
+.P
+ydotool was written by ReimuNotMoe.\&
+.P
+This manpage was written by bob.\&hepple@gmail.\&com but updated since.\&
+.P
+.SH LICENCE
+AGPLv3
+.P
+.SH SEE ALSO
+.P
+\fBydotoold\fR(8)
+.P
+Project site: <https://github.\&com/ReimuNotMoe/ydotool>
diff --git a/srcpkgs/ydotool/files/ydotoold-workaround b/srcpkgs/ydotool/files/ydotoold-workaround
new file mode 100755
index 000000000000..ae4558078719
--- /dev/null
+++ b/srcpkgs/ydotool/files/ydotoold-workaround
@@ -0,0 +1,2 @@
+#!/bin/sh
+/usr/libexec/ydotoold -p /var/lib/ydotoold/socket -P 660
diff --git a/srcpkgs/ydotool/files/ydotoold.8 b/srcpkgs/ydotool/files/ydotoold.8
new file mode 100644
index 000000000000..a2f4b67af9e1
--- /dev/null
+++ b/srcpkgs/ydotool/files/ydotoold.8
@@ -0,0 +1,55 @@
+.\" Generated by scdoc  1.11.2
+.\" Complete documentation for this program is not available as a GNU info page
+.ie \n(.g .ds Aq \(aq
+.el       .ds Aq '
+.nh
+.ad l
+.\" Begin generated content:
+.TH "ydotoold" "8" "2022-08-10"
+.P
+.SH NAME
+.P
+ydotoold - daemon for \fBydotool\fR(1)
+.P
+.SH SYNOPSIS
+.P
+\fBydotoold\fR \fI[OPTION.\&.\&.\&]\fR
+.P
+.SH DESCRIPTION
+.P
+\fBydotoold\fR holds a persistent virtual device, and accepts input from \fBydotool\fR(1).\&
+.P
+.SH OPTIONS
+.P
+.RS 4
+\fB-p\fR, \fB--socket-path arg\fR \fI<path>\fR
+.RS 4
+Set socket path.\&
+.P
+.RE
+\fB-P\fR, \fB--socket-perm arg\fR \fI<perms>\fR
+.RS 4
+Set socket permission.\&
+.P
+.RE
+\fB-h\fR, \fB--help\fR
+.RS 4
+Display help and exit.\&
+.P
+.RE
+.RE
+.SH AUTHOR
+.P
+\fBydotool\fR(1) and \fBydotoold\fR(8) were written by ReimuNotMoe.\&
+.P
+This manpage was written by bob.\&hepple@gmail.\&com but updated since.\&
+.P
+.SH LICENCE
+.P
+AGPLv3
+.P
+.SH SEE ALSO
+.P
+\fBydotool\fR(1)
+.P
+Project site: <https://github.\&com/ReimuNotMoe/ydotool>
diff --git a/srcpkgs/ydotool/files/ydotoold/run b/srcpkgs/ydotool/files/ydotoold/run
new file mode 100755
index 000000000000..e52ad8606eb2
--- /dev/null
+++ b/srcpkgs/ydotool/files/ydotoold/run
@@ -0,0 +1,5 @@
+#!/bin/sh
+# This service is experimental.
+# At boot, without the sleep, X11 sometimes ignores ydotool.
+sleep 2
+exec chpst -u _ydotoold:input ydotoold 2>&1
diff --git a/srcpkgs/ydotool/template b/srcpkgs/ydotool/template
new file mode 100644
index 000000000000..bdff53085307
--- /dev/null
+++ b/srcpkgs/ydotool/template
@@ -0,0 +1,31 @@
+# Template file for 'ydotool'
+pkgname=ydotool
+version=1.0.1
+revision=1
+build_style=cmake
+hostmakedepends="pkg-config scdoc"
+short_desc="Generic command-line automation tool, works on Wayland and X11"
+maintainer="John Gebbie <me@johngebbie.com>"
+license="AGPL-3.0-only"
+homepage="https://github.com/ReimuNotMoe/ydotool"
+distfiles="https://github.com/ReimuNotMoe/ydotool/archive/v${version}.tar.gz"
+checksum=02311cdc608f205711b06a95e5fd71093b2294f4920efc526f5e98a2ddab42b8
+
+system_accounts="_ydotoold"
+_ydotoold_groups="input"
+
+# Used instead of /tmp so any group input user can replace the socket.
+make_dirs='/var/lib/ydotoold 0775 _ydotoold input'
+
+post_install() {
+	vinstall "${DESTDIR}/usr/bin/ydotool" 755 /usr/libexec
+	vbin "${FILESDIR}/ydotool-workaround" ydotool
+	vinstall "${DESTDIR}/usr/bin/ydotoold" 755 /usr/libexec
+	vbin "${FILESDIR}/ydotoold-workaround" ydotoold
+	vsv ydotoold
+	vinstall "${FILESDIR}/80-uinput.rules" 644 usr/lib/udev/rules.d
+	vlicense LICENSE
+	# https://github.com/ReimuNotMoe/ydotool/pull/168
+	vman "${FILESDIR}/ydotool.1"
+	vman "${FILESDIR}/ydotoold.8"
+}

^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: New package: ydotool-1.0.1
  2022-07-25 12:49 [PR PATCH] New package: ydotool-1.0.1 JohnGebbie
                   ` (23 preceding siblings ...)
  2022-08-10 14:55 ` [PR PATCH] [Updated] " JohnGebbie
@ 2022-08-17  9:13 ` JohnGebbie
  2022-08-17  9:27 ` [PR PATCH] [Updated] " JohnGebbie
                   ` (4 subsequent siblings)
  29 siblings, 0 replies; 37+ messages in thread
From: JohnGebbie @ 2022-08-17  9:13 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 268 bytes --]

New comment by JohnGebbie on void-packages repository

https://github.com/void-linux/void-packages/pull/38268#issuecomment-1217726741

Comment:
Found an issue, mousemouse --absolute is wrong due to mouse acceleration: https://github.com/ReimuNotMoe/ydotool/issues/158

^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: [PR PATCH] [Updated] New package: ydotool-1.0.1
  2022-07-25 12:49 [PR PATCH] New package: ydotool-1.0.1 JohnGebbie
                   ` (24 preceding siblings ...)
  2022-08-17  9:13 ` JohnGebbie
@ 2022-08-17  9:27 ` JohnGebbie
  2022-08-17  9:37 ` JohnGebbie
                   ` (3 subsequent siblings)
  29 siblings, 0 replies; 37+ messages in thread
From: JohnGebbie @ 2022-08-17  9:27 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 903 bytes --]

There is an updated pull request by JohnGebbie against master on the void-packages repository

https://github.com/JohnGebbie/void-packages ydotool
https://github.com/void-linux/void-packages/pull/38268

New package: ydotool-1.0.1
#### Testing the changes
- I tested the changes in this PR: **YES**

#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures:
  - aarch64-musl
  - armv7l
  - armv6l-musl

I started with https://github.com/void-linux/void-packages/pull/31237

Closes https://github.com/void-linux/void-packages/issues/31163

A patch file from https://github.com/void-linux/void-packages/pull/38268.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-ydotool-38268.patch --]
[-- Type: text/x-diff, Size: 10535 bytes --]

From e5cc8d6846bcb61036d6397269bd184fc496572b Mon Sep 17 00:00:00 2001
From: John Gebbie <me@johngebbie.com>
Date: Mon, 8 Aug 2022 20:37:27 +0100
Subject: [PATCH] New package: ydotool-1.0.1

---
 srcpkgs/ydotool/INSTALL.msg               |   6 +
 srcpkgs/ydotool/files/80-uinput.rules     |   3 +
 srcpkgs/ydotool/files/ydotool-workaround  |   2 +
 srcpkgs/ydotool/files/ydotool.1           | 285 ++++++++++++++++++++++
 srcpkgs/ydotool/files/ydotoold-workaround |   2 +
 srcpkgs/ydotool/files/ydotoold.8          |  55 +++++
 srcpkgs/ydotool/files/ydotoold/run        |   5 +
 srcpkgs/ydotool/template                  |  31 +++
 8 files changed, 389 insertions(+)
 create mode 100644 srcpkgs/ydotool/INSTALL.msg
 create mode 100644 srcpkgs/ydotool/files/80-uinput.rules
 create mode 100755 srcpkgs/ydotool/files/ydotool-workaround
 create mode 100644 srcpkgs/ydotool/files/ydotool.1
 create mode 100755 srcpkgs/ydotool/files/ydotoold-workaround
 create mode 100644 srcpkgs/ydotool/files/ydotoold.8
 create mode 100755 srcpkgs/ydotool/files/ydotoold/run
 create mode 100644 srcpkgs/ydotool/template

diff --git a/srcpkgs/ydotool/INSTALL.msg b/srcpkgs/ydotool/INSTALL.msg
new file mode 100644
index 000000000000..1812d29a7afc
--- /dev/null
+++ b/srcpkgs/ydotool/INSTALL.msg
@@ -0,0 +1,6 @@
+udev rules for uinput has been installed,
+to access /dev/uinput, add yourself to group input:
+
+    $ sudo usermod -a -G input $USER
+
+and then re-login to make it effective.
diff --git a/srcpkgs/ydotool/files/80-uinput.rules b/srcpkgs/ydotool/files/80-uinput.rules
new file mode 100644
index 000000000000..988d34547f52
--- /dev/null
+++ b/srcpkgs/ydotool/files/80-uinput.rules
@@ -0,0 +1,3 @@
+## ydotoold fix
+## https://github.com/ReimuNotMoe/ydotool/issues/25#issuecomment-535842993
+KERNEL=="uinput", GROUP="input", MODE="0660", OPTIONS+="static_node=uinput"
diff --git a/srcpkgs/ydotool/files/ydotool-workaround b/srcpkgs/ydotool/files/ydotool-workaround
new file mode 100755
index 000000000000..7264726a6433
--- /dev/null
+++ b/srcpkgs/ydotool/files/ydotool-workaround
@@ -0,0 +1,2 @@
+#!/bin/sh
+YDOTOOL_SOCKET="${YDOTOOL_SOCKET:-/var/lib/ydotoold/socket}" /usr/libexec/ydotool "$@"
diff --git a/srcpkgs/ydotool/files/ydotool.1 b/srcpkgs/ydotool/files/ydotool.1
new file mode 100644
index 000000000000..0c2e5528c479
--- /dev/null
+++ b/srcpkgs/ydotool/files/ydotool.1
@@ -0,0 +1,285 @@
+.\" Generated by scdoc  1.11.2
+.\" Complete documentation for this program is not available as a GNU info page
+.ie \n(.g .ds Aq \(aq
+.el       .ds Aq '
+.nh
+.ad l
+.\" Begin generated content:
+.TH "YDOTOOL" "1" "2022-08-10"
+.SH NAME
+.P
+ydotool - command-line \fI/dev/uinput\fR automation tool
+.P
+.SH SYNOPSIS
+.P
+\fBydotool\fR \fBcmd\fR \fIargs\fR
+.P
+\fBydotool\fR \fBcmd\fR --help
+.P
+.SH DESCRIPTION
+.P
+\fBydotool\fR lets you programmatically (or manually) simulate keyboard input and mouse activity, etc.\&
+The \fBydotoold\fR(8) daemon must be running.\&
+.P
+.P
+Currently implemented command(s):
+.P
+\fBtype\fR
+.RS 4
+Type a string
+.RE
+\fBkey\fR
+.RS 4
+Press keys
+.RE
+\fBmousemove\fR
+.RS 4
+Move mouse pointer to absolute position
+.RE
+\fBclick\fR
+.RS 4
+Click on mouse buttons
+.P
+.RE
+.SH KEYBOARD COMMANDS
+\fBkey\fR [\fB-d\fR,\fB--key-delay\fR \fI<ms>\fR] [\fI<KEYCODE:PRESSED>\fR .\&.\&.\&]
+.P
+.RS 4
+Type a given keycode.\&
+.P
+e.\&g.\& 28:1 28:0 means pressing on the Enter button on a standard US keyboard.\&
+.P
+42:1 38:1 38:0 24:1 24:0 38:1 38:0 42:0 - "LOL"
+.P
+Non-interpretable values, such as 0, aaa, l0l, will only cause a delay.\&
+.P
+See `/usr/include/linux/input-event-codes.\&h'\& for available key codes (KEY_*).\&
+.P
+Options:
+\fB-d\fR,\fB--key-delay\fR \fI<ms>\fR
+.RS 4
+Delay time between keystrokes.\& Default 12ms.\&
+.P
+.RE
+.RE
+\fBtype\fR [\fB-D\fR,\fB--next-delay\fR \fI<ms>\fR] [\fB-d\fR,\fB--key-delay\fR \fI<ms>\fR] [\fB-f\fR,\fB--file\fR \fI<filepath>\fR] "\fItext\fR"
+.P
+.RS 4
+Types text as if you had typed it on the keyboard.\&
+.P
+Options:
+.P
+\fB-d\fR,\fB--key-delay\fR \fI<ms>\fR
+.RS 4
+Delay time between key events (up/down each).\& Default 12ms.\&
+.P
+.RE
+\fB-D\fR,\fB--next-delay\fR \fI<ms>\fR
+.RS 4
+Delay between strings.\& Default 0ms.\&
+.P
+.RE
+\fB-f\fR,\fB--file\fR \fI<filepath>\fR
+.RS 4
+Specify a file, the contents of which will be typed as if passed as an argument.\& The filepath may also be '\&-'\& to read from stdin.\&
+.P
+.RE
+Example: to type '\&Hello world!\&'\& you would do:
+.RS 4
+ydotool type '\&Hello world!\&'\&
+.P
+.RE
+.RE
+.SH MOUSE COMMANDS
+.P
+\fBmousemove\fR [\fB-a\fR,\fB--absolute\fR] \fI<x> <y>\fR
+.RS 4
+Move the mouse to the relative X and Y coordinates on the screen.\&
+.P
+Options:
+\fB--absolute\fR
+.RS 4
+Use absolute position
+.P
+.RE
+Example: to move the cursor to absolute coordinates (100,100):
+.RS 4
+ydotool mousemove --absolute 100 100
+.P
+.RE
+.RE
+\fBclick\fR [\fB-d\fR,\fB--next-delay\fR \fI<ms>\fR] [\fB-r\fR,\fB--repeat\fR \fIN\fR ] [\fIbutton\fR .\&.\&.\&]
+.RS 4
+Send a click.\&
+.P
+Options:
+\fB-d\fR,\fB--next-delay\fR \fI<ms>\fR
+.RS 4
+Delay between input events (up/down, a compete click means doubled time).\& Default 25ms.\&
+.P
+.RE
+\fB-r\fR,\fB--repeat\fR \fIN\fR
+.RS 4
+Repeat entire sequence N times
+.P
+.RE
+all mouse buttons are represented using hexadecimal numeric values, with an optional
+bit mask to specify if mouse up/down needs to be omitted.\&
+.P
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.IP \(bu 4
+.\}
+0x00 - LEFT
+.RE
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.IP \(bu 4
+.\}
+0x01 - RIGHT
+.RE
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.IP \(bu 4
+.\}
+0x02 - MIDDLE
+.RE
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.IP \(bu 4
+.\}
+0x03 - SIDE
+.RE
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.IP \(bu 4
+.\}
+0x04 - EXTR
+.RE
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.IP \(bu 4
+.\}
+0x05 - FORWARD
+.RE
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.IP \(bu 4
+.\}
+0x06 - BACK
+.RE
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.IP \(bu 4
+.\}
+0x07 - TASK
+.RE
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.IP \(bu 4
+.\}
+0x40 - Mouse down
+.RE
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.IP \(bu 4
+.\}
+0x80 - Mouse up
+.RE
+  
+.RS 4
+
+.RE
+.RE
+Examples:
+.P
+.RS 4
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.IP \(bu 4
+.\}
+0x00: chooses left button, but does nothing (you can use this to implement extra sleeps)
+.RE
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.IP \(bu 4
+.\}
+0xC0: left button click (down then up)
+.RE
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.IP \(bu 4
+.\}
+0x41: right button down
+.RE
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.IP \(bu 4
+.\}
+0x82: middle button up
+
+.RE
+.P
+The '\&0x'\& prefix can be omitted if you want.\&
+.P
+.RE
+.SH YDOTOOL SOCKET
+.P
+The socket to write to for \fBydotoold\fR(8) can be changed by the environment variable YDOTOOL_SOCKET.\&
+.P
+.SH AUTHOR
+.P
+ydotool was written by ReimuNotMoe.\&
+.P
+This manpage was written by bob.\&hepple@gmail.\&com but updated since.\&
+.P
+.SH LICENCE
+AGPLv3
+.P
+.SH SEE ALSO
+.P
+\fBydotoold\fR(8)
+.P
+Project site: <https://github.\&com/ReimuNotMoe/ydotool>
diff --git a/srcpkgs/ydotool/files/ydotoold-workaround b/srcpkgs/ydotool/files/ydotoold-workaround
new file mode 100755
index 000000000000..ae4558078719
--- /dev/null
+++ b/srcpkgs/ydotool/files/ydotoold-workaround
@@ -0,0 +1,2 @@
+#!/bin/sh
+/usr/libexec/ydotoold -p /var/lib/ydotoold/socket -P 660
diff --git a/srcpkgs/ydotool/files/ydotoold.8 b/srcpkgs/ydotool/files/ydotoold.8
new file mode 100644
index 000000000000..a2f4b67af9e1
--- /dev/null
+++ b/srcpkgs/ydotool/files/ydotoold.8
@@ -0,0 +1,55 @@
+.\" Generated by scdoc  1.11.2
+.\" Complete documentation for this program is not available as a GNU info page
+.ie \n(.g .ds Aq \(aq
+.el       .ds Aq '
+.nh
+.ad l
+.\" Begin generated content:
+.TH "ydotoold" "8" "2022-08-10"
+.P
+.SH NAME
+.P
+ydotoold - daemon for \fBydotool\fR(1)
+.P
+.SH SYNOPSIS
+.P
+\fBydotoold\fR \fI[OPTION.\&.\&.\&]\fR
+.P
+.SH DESCRIPTION
+.P
+\fBydotoold\fR holds a persistent virtual device, and accepts input from \fBydotool\fR(1).\&
+.P
+.SH OPTIONS
+.P
+.RS 4
+\fB-p\fR, \fB--socket-path arg\fR \fI<path>\fR
+.RS 4
+Set socket path.\&
+.P
+.RE
+\fB-P\fR, \fB--socket-perm arg\fR \fI<perms>\fR
+.RS 4
+Set socket permission.\&
+.P
+.RE
+\fB-h\fR, \fB--help\fR
+.RS 4
+Display help and exit.\&
+.P
+.RE
+.RE
+.SH AUTHOR
+.P
+\fBydotool\fR(1) and \fBydotoold\fR(8) were written by ReimuNotMoe.\&
+.P
+This manpage was written by bob.\&hepple@gmail.\&com but updated since.\&
+.P
+.SH LICENCE
+.P
+AGPLv3
+.P
+.SH SEE ALSO
+.P
+\fBydotool\fR(1)
+.P
+Project site: <https://github.\&com/ReimuNotMoe/ydotool>
diff --git a/srcpkgs/ydotool/files/ydotoold/run b/srcpkgs/ydotool/files/ydotoold/run
new file mode 100755
index 000000000000..e52ad8606eb2
--- /dev/null
+++ b/srcpkgs/ydotool/files/ydotoold/run
@@ -0,0 +1,5 @@
+#!/bin/sh
+# This service is experimental.
+# At boot, without the sleep, X11 sometimes ignores ydotool.
+sleep 2
+exec chpst -u _ydotoold:input ydotoold 2>&1
diff --git a/srcpkgs/ydotool/template b/srcpkgs/ydotool/template
new file mode 100644
index 000000000000..bdff53085307
--- /dev/null
+++ b/srcpkgs/ydotool/template
@@ -0,0 +1,31 @@
+# Template file for 'ydotool'
+pkgname=ydotool
+version=1.0.1
+revision=1
+build_style=cmake
+hostmakedepends="pkg-config scdoc"
+short_desc="Generic command-line automation tool, works on Wayland and X11"
+maintainer="John Gebbie <me@johngebbie.com>"
+license="AGPL-3.0-only"
+homepage="https://github.com/ReimuNotMoe/ydotool"
+distfiles="https://github.com/ReimuNotMoe/ydotool/archive/v${version}.tar.gz"
+checksum=02311cdc608f205711b06a95e5fd71093b2294f4920efc526f5e98a2ddab42b8
+
+system_accounts="_ydotoold"
+_ydotoold_groups="input"
+
+# Used instead of /tmp so any group input user can replace the socket.
+make_dirs='/var/lib/ydotoold 0775 _ydotoold input'
+
+post_install() {
+	vinstall "${DESTDIR}/usr/bin/ydotool" 755 /usr/libexec
+	vbin "${FILESDIR}/ydotool-workaround" ydotool
+	vinstall "${DESTDIR}/usr/bin/ydotoold" 755 /usr/libexec
+	vbin "${FILESDIR}/ydotoold-workaround" ydotoold
+	vsv ydotoold
+	vinstall "${FILESDIR}/80-uinput.rules" 644 usr/lib/udev/rules.d
+	vlicense LICENSE
+	# https://github.com/ReimuNotMoe/ydotool/pull/168
+	vman "${FILESDIR}/ydotool.1"
+	vman "${FILESDIR}/ydotoold.8"
+}

^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: [PR PATCH] [Updated] New package: ydotool-1.0.1
  2022-07-25 12:49 [PR PATCH] New package: ydotool-1.0.1 JohnGebbie
                   ` (25 preceding siblings ...)
  2022-08-17  9:27 ` [PR PATCH] [Updated] " JohnGebbie
@ 2022-08-17  9:37 ` JohnGebbie
  2022-08-17  9:38 ` JohnGebbie
                   ` (2 subsequent siblings)
  29 siblings, 0 replies; 37+ messages in thread
From: JohnGebbie @ 2022-08-17  9:37 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 903 bytes --]

There is an updated pull request by JohnGebbie against master on the void-packages repository

https://github.com/JohnGebbie/void-packages ydotool
https://github.com/void-linux/void-packages/pull/38268

New package: ydotool-1.0.1
#### Testing the changes
- I tested the changes in this PR: **YES**

#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures:
  - aarch64-musl
  - armv7l
  - armv6l-musl

I started with https://github.com/void-linux/void-packages/pull/31237

Closes https://github.com/void-linux/void-packages/issues/31163

A patch file from https://github.com/void-linux/void-packages/pull/38268.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-ydotool-38268.patch --]
[-- Type: text/x-diff, Size: 11142 bytes --]

From e972cb76d8727c629cdae735e31a82cc1939e290 Mon Sep 17 00:00:00 2001
From: John Gebbie <me@johngebbie.com>
Date: Mon, 8 Aug 2022 20:37:27 +0100
Subject: [PATCH] New package: ydotool-1.0.1

---
 srcpkgs/ydotool/INSTALL.msg               |   6 +
 srcpkgs/ydotool/files/50-ydotool.conf     |   7 +
 srcpkgs/ydotool/files/80-uinput.rules     |   3 +
 srcpkgs/ydotool/files/ydotool-workaround  |   2 +
 srcpkgs/ydotool/files/ydotool.1           | 285 ++++++++++++++++++++++
 srcpkgs/ydotool/files/ydotoold-workaround |   2 +
 srcpkgs/ydotool/files/ydotoold.8          |  55 +++++
 srcpkgs/ydotool/files/ydotoold/run        |   5 +
 srcpkgs/ydotool/template                  |  32 +++
 9 files changed, 397 insertions(+)
 create mode 100644 srcpkgs/ydotool/INSTALL.msg
 create mode 100644 srcpkgs/ydotool/files/50-ydotool.conf
 create mode 100644 srcpkgs/ydotool/files/80-uinput.rules
 create mode 100755 srcpkgs/ydotool/files/ydotool-workaround
 create mode 100644 srcpkgs/ydotool/files/ydotool.1
 create mode 100755 srcpkgs/ydotool/files/ydotoold-workaround
 create mode 100644 srcpkgs/ydotool/files/ydotoold.8
 create mode 100755 srcpkgs/ydotool/files/ydotoold/run
 create mode 100644 srcpkgs/ydotool/template

diff --git a/srcpkgs/ydotool/INSTALL.msg b/srcpkgs/ydotool/INSTALL.msg
new file mode 100644
index 000000000000..1812d29a7afc
--- /dev/null
+++ b/srcpkgs/ydotool/INSTALL.msg
@@ -0,0 +1,6 @@
+udev rules for uinput has been installed,
+to access /dev/uinput, add yourself to group input:
+
+    $ sudo usermod -a -G input $USER
+
+and then re-login to make it effective.
diff --git a/srcpkgs/ydotool/files/50-ydotool.conf b/srcpkgs/ydotool/files/50-ydotool.conf
new file mode 100644
index 000000000000..a799b618728b
--- /dev/null
+++ b/srcpkgs/ydotool/files/50-ydotool.conf
@@ -0,0 +1,7 @@
+# https://github.com/ReimuNotMoe/ydotool/issues/158
+Section "InputClass"
+	Identifier "ydotoold virtual device"
+	MatchDriver "libinput"
+	Option "AccelProfile" "flat"
+	Option "AccelSpeed" "0"
+EndSection
diff --git a/srcpkgs/ydotool/files/80-uinput.rules b/srcpkgs/ydotool/files/80-uinput.rules
new file mode 100644
index 000000000000..988d34547f52
--- /dev/null
+++ b/srcpkgs/ydotool/files/80-uinput.rules
@@ -0,0 +1,3 @@
+## ydotoold fix
+## https://github.com/ReimuNotMoe/ydotool/issues/25#issuecomment-535842993
+KERNEL=="uinput", GROUP="input", MODE="0660", OPTIONS+="static_node=uinput"
diff --git a/srcpkgs/ydotool/files/ydotool-workaround b/srcpkgs/ydotool/files/ydotool-workaround
new file mode 100755
index 000000000000..7264726a6433
--- /dev/null
+++ b/srcpkgs/ydotool/files/ydotool-workaround
@@ -0,0 +1,2 @@
+#!/bin/sh
+YDOTOOL_SOCKET="${YDOTOOL_SOCKET:-/var/lib/ydotoold/socket}" /usr/libexec/ydotool "$@"
diff --git a/srcpkgs/ydotool/files/ydotool.1 b/srcpkgs/ydotool/files/ydotool.1
new file mode 100644
index 000000000000..0c2e5528c479
--- /dev/null
+++ b/srcpkgs/ydotool/files/ydotool.1
@@ -0,0 +1,285 @@
+.\" Generated by scdoc  1.11.2
+.\" Complete documentation for this program is not available as a GNU info page
+.ie \n(.g .ds Aq \(aq
+.el       .ds Aq '
+.nh
+.ad l
+.\" Begin generated content:
+.TH "YDOTOOL" "1" "2022-08-10"
+.SH NAME
+.P
+ydotool - command-line \fI/dev/uinput\fR automation tool
+.P
+.SH SYNOPSIS
+.P
+\fBydotool\fR \fBcmd\fR \fIargs\fR
+.P
+\fBydotool\fR \fBcmd\fR --help
+.P
+.SH DESCRIPTION
+.P
+\fBydotool\fR lets you programmatically (or manually) simulate keyboard input and mouse activity, etc.\&
+The \fBydotoold\fR(8) daemon must be running.\&
+.P
+.P
+Currently implemented command(s):
+.P
+\fBtype\fR
+.RS 4
+Type a string
+.RE
+\fBkey\fR
+.RS 4
+Press keys
+.RE
+\fBmousemove\fR
+.RS 4
+Move mouse pointer to absolute position
+.RE
+\fBclick\fR
+.RS 4
+Click on mouse buttons
+.P
+.RE
+.SH KEYBOARD COMMANDS
+\fBkey\fR [\fB-d\fR,\fB--key-delay\fR \fI<ms>\fR] [\fI<KEYCODE:PRESSED>\fR .\&.\&.\&]
+.P
+.RS 4
+Type a given keycode.\&
+.P
+e.\&g.\& 28:1 28:0 means pressing on the Enter button on a standard US keyboard.\&
+.P
+42:1 38:1 38:0 24:1 24:0 38:1 38:0 42:0 - "LOL"
+.P
+Non-interpretable values, such as 0, aaa, l0l, will only cause a delay.\&
+.P
+See `/usr/include/linux/input-event-codes.\&h'\& for available key codes (KEY_*).\&
+.P
+Options:
+\fB-d\fR,\fB--key-delay\fR \fI<ms>\fR
+.RS 4
+Delay time between keystrokes.\& Default 12ms.\&
+.P
+.RE
+.RE
+\fBtype\fR [\fB-D\fR,\fB--next-delay\fR \fI<ms>\fR] [\fB-d\fR,\fB--key-delay\fR \fI<ms>\fR] [\fB-f\fR,\fB--file\fR \fI<filepath>\fR] "\fItext\fR"
+.P
+.RS 4
+Types text as if you had typed it on the keyboard.\&
+.P
+Options:
+.P
+\fB-d\fR,\fB--key-delay\fR \fI<ms>\fR
+.RS 4
+Delay time between key events (up/down each).\& Default 12ms.\&
+.P
+.RE
+\fB-D\fR,\fB--next-delay\fR \fI<ms>\fR
+.RS 4
+Delay between strings.\& Default 0ms.\&
+.P
+.RE
+\fB-f\fR,\fB--file\fR \fI<filepath>\fR
+.RS 4
+Specify a file, the contents of which will be typed as if passed as an argument.\& The filepath may also be '\&-'\& to read from stdin.\&
+.P
+.RE
+Example: to type '\&Hello world!\&'\& you would do:
+.RS 4
+ydotool type '\&Hello world!\&'\&
+.P
+.RE
+.RE
+.SH MOUSE COMMANDS
+.P
+\fBmousemove\fR [\fB-a\fR,\fB--absolute\fR] \fI<x> <y>\fR
+.RS 4
+Move the mouse to the relative X and Y coordinates on the screen.\&
+.P
+Options:
+\fB--absolute\fR
+.RS 4
+Use absolute position
+.P
+.RE
+Example: to move the cursor to absolute coordinates (100,100):
+.RS 4
+ydotool mousemove --absolute 100 100
+.P
+.RE
+.RE
+\fBclick\fR [\fB-d\fR,\fB--next-delay\fR \fI<ms>\fR] [\fB-r\fR,\fB--repeat\fR \fIN\fR ] [\fIbutton\fR .\&.\&.\&]
+.RS 4
+Send a click.\&
+.P
+Options:
+\fB-d\fR,\fB--next-delay\fR \fI<ms>\fR
+.RS 4
+Delay between input events (up/down, a compete click means doubled time).\& Default 25ms.\&
+.P
+.RE
+\fB-r\fR,\fB--repeat\fR \fIN\fR
+.RS 4
+Repeat entire sequence N times
+.P
+.RE
+all mouse buttons are represented using hexadecimal numeric values, with an optional
+bit mask to specify if mouse up/down needs to be omitted.\&
+.P
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.IP \(bu 4
+.\}
+0x00 - LEFT
+.RE
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.IP \(bu 4
+.\}
+0x01 - RIGHT
+.RE
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.IP \(bu 4
+.\}
+0x02 - MIDDLE
+.RE
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.IP \(bu 4
+.\}
+0x03 - SIDE
+.RE
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.IP \(bu 4
+.\}
+0x04 - EXTR
+.RE
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.IP \(bu 4
+.\}
+0x05 - FORWARD
+.RE
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.IP \(bu 4
+.\}
+0x06 - BACK
+.RE
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.IP \(bu 4
+.\}
+0x07 - TASK
+.RE
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.IP \(bu 4
+.\}
+0x40 - Mouse down
+.RE
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.IP \(bu 4
+.\}
+0x80 - Mouse up
+.RE
+  
+.RS 4
+
+.RE
+.RE
+Examples:
+.P
+.RS 4
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.IP \(bu 4
+.\}
+0x00: chooses left button, but does nothing (you can use this to implement extra sleeps)
+.RE
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.IP \(bu 4
+.\}
+0xC0: left button click (down then up)
+.RE
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.IP \(bu 4
+.\}
+0x41: right button down
+.RE
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.IP \(bu 4
+.\}
+0x82: middle button up
+
+.RE
+.P
+The '\&0x'\& prefix can be omitted if you want.\&
+.P
+.RE
+.SH YDOTOOL SOCKET
+.P
+The socket to write to for \fBydotoold\fR(8) can be changed by the environment variable YDOTOOL_SOCKET.\&
+.P
+.SH AUTHOR
+.P
+ydotool was written by ReimuNotMoe.\&
+.P
+This manpage was written by bob.\&hepple@gmail.\&com but updated since.\&
+.P
+.SH LICENCE
+AGPLv3
+.P
+.SH SEE ALSO
+.P
+\fBydotoold\fR(8)
+.P
+Project site: <https://github.\&com/ReimuNotMoe/ydotool>
diff --git a/srcpkgs/ydotool/files/ydotoold-workaround b/srcpkgs/ydotool/files/ydotoold-workaround
new file mode 100755
index 000000000000..ae4558078719
--- /dev/null
+++ b/srcpkgs/ydotool/files/ydotoold-workaround
@@ -0,0 +1,2 @@
+#!/bin/sh
+/usr/libexec/ydotoold -p /var/lib/ydotoold/socket -P 660
diff --git a/srcpkgs/ydotool/files/ydotoold.8 b/srcpkgs/ydotool/files/ydotoold.8
new file mode 100644
index 000000000000..a2f4b67af9e1
--- /dev/null
+++ b/srcpkgs/ydotool/files/ydotoold.8
@@ -0,0 +1,55 @@
+.\" Generated by scdoc  1.11.2
+.\" Complete documentation for this program is not available as a GNU info page
+.ie \n(.g .ds Aq \(aq
+.el       .ds Aq '
+.nh
+.ad l
+.\" Begin generated content:
+.TH "ydotoold" "8" "2022-08-10"
+.P
+.SH NAME
+.P
+ydotoold - daemon for \fBydotool\fR(1)
+.P
+.SH SYNOPSIS
+.P
+\fBydotoold\fR \fI[OPTION.\&.\&.\&]\fR
+.P
+.SH DESCRIPTION
+.P
+\fBydotoold\fR holds a persistent virtual device, and accepts input from \fBydotool\fR(1).\&
+.P
+.SH OPTIONS
+.P
+.RS 4
+\fB-p\fR, \fB--socket-path arg\fR \fI<path>\fR
+.RS 4
+Set socket path.\&
+.P
+.RE
+\fB-P\fR, \fB--socket-perm arg\fR \fI<perms>\fR
+.RS 4
+Set socket permission.\&
+.P
+.RE
+\fB-h\fR, \fB--help\fR
+.RS 4
+Display help and exit.\&
+.P
+.RE
+.RE
+.SH AUTHOR
+.P
+\fBydotool\fR(1) and \fBydotoold\fR(8) were written by ReimuNotMoe.\&
+.P
+This manpage was written by bob.\&hepple@gmail.\&com but updated since.\&
+.P
+.SH LICENCE
+.P
+AGPLv3
+.P
+.SH SEE ALSO
+.P
+\fBydotool\fR(1)
+.P
+Project site: <https://github.\&com/ReimuNotMoe/ydotool>
diff --git a/srcpkgs/ydotool/files/ydotoold/run b/srcpkgs/ydotool/files/ydotoold/run
new file mode 100755
index 000000000000..e52ad8606eb2
--- /dev/null
+++ b/srcpkgs/ydotool/files/ydotoold/run
@@ -0,0 +1,5 @@
+#!/bin/sh
+# This service is experimental.
+# At boot, without the sleep, X11 sometimes ignores ydotool.
+sleep 2
+exec chpst -u _ydotoold:input ydotoold 2>&1
diff --git a/srcpkgs/ydotool/template b/srcpkgs/ydotool/template
new file mode 100644
index 000000000000..c9e4850a6ac3
--- /dev/null
+++ b/srcpkgs/ydotool/template
@@ -0,0 +1,32 @@
+# Template file for 'ydotool'
+pkgname=ydotool
+version=1.0.1
+revision=1
+build_style=cmake
+hostmakedepends="pkg-config scdoc"
+short_desc="Generic command-line automation tool, works on Wayland and X11"
+maintainer="John Gebbie <me@johngebbie.com>"
+license="AGPL-3.0-only"
+homepage="https://github.com/ReimuNotMoe/ydotool"
+distfiles="https://github.com/ReimuNotMoe/ydotool/archive/v${version}.tar.gz"
+checksum=02311cdc608f205711b06a95e5fd71093b2294f4920efc526f5e98a2ddab42b8
+
+system_accounts="_ydotoold"
+_ydotoold_groups="input"
+
+# Used instead of /tmp so any group input user can replace the socket.
+make_dirs='/var/lib/ydotoold 0775 _ydotoold input'
+
+post_install() {
+	vinstall "${DESTDIR}/usr/bin/ydotool" 755 /usr/libexec
+	vbin "${FILESDIR}/ydotool-workaround" ydotool
+	vinstall "${DESTDIR}/usr/bin/ydotoold" 755 /usr/libexec
+	vbin "${FILESDIR}/ydotoold-workaround" ydotoold
+	vsv ydotoold
+	vinstall "${FILESDIR}/80-uinput.rules" 644 usr/lib/udev/rules.d
+	vinstall "${FILESDIR}/50-ydotool.conf" 644 usr/share/X11/xorg.conf.d
+	vlicense LICENSE
+	# https://github.com/ReimuNotMoe/ydotool/pull/168
+	vman "${FILESDIR}/ydotool.1"
+	vman "${FILESDIR}/ydotoold.8"
+}

^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: New package: ydotool-1.0.1
  2022-07-25 12:49 [PR PATCH] New package: ydotool-1.0.1 JohnGebbie
                   ` (26 preceding siblings ...)
  2022-08-17  9:37 ` JohnGebbie
@ 2022-08-17  9:38 ` JohnGebbie
  2022-08-17 14:52 ` JohnGebbie
  2022-10-12 19:31 ` [PR PATCH] [Closed]: " JohnGebbie
  29 siblings, 0 replies; 37+ messages in thread
From: JohnGebbie @ 2022-08-17  9:38 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 213 bytes --]

New comment by JohnGebbie on void-packages repository

https://github.com/void-linux/void-packages/pull/38268#issuecomment-1217772071

Comment:
That's a fix for the mouse acceleration and I've updated the branch.

^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: New package: ydotool-1.0.1
  2022-07-25 12:49 [PR PATCH] New package: ydotool-1.0.1 JohnGebbie
                   ` (27 preceding siblings ...)
  2022-08-17  9:38 ` JohnGebbie
@ 2022-08-17 14:52 ` JohnGebbie
  2022-10-12 19:31 ` [PR PATCH] [Closed]: " JohnGebbie
  29 siblings, 0 replies; 37+ messages in thread
From: JohnGebbie @ 2022-08-17 14:52 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 161 bytes --]

New comment by JohnGebbie on void-packages repository

https://github.com/void-linux/void-packages/pull/38268#issuecomment-1218118670

Comment:
That's it ready.

^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: [PR PATCH] [Closed]: New package: ydotool-1.0.1
  2022-07-25 12:49 [PR PATCH] New package: ydotool-1.0.1 JohnGebbie
                   ` (28 preceding siblings ...)
  2022-08-17 14:52 ` JohnGebbie
@ 2022-10-12 19:31 ` JohnGebbie
  29 siblings, 0 replies; 37+ messages in thread
From: JohnGebbie @ 2022-10-12 19:31 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 741 bytes --]

There's a closed pull request on the void-packages repository

New package: ydotool-1.0.1
https://github.com/void-linux/void-packages/pull/38268

Description:
#### Testing the changes
- I tested the changes in this PR: **YES**

#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures:
  - aarch64-musl
  - armv7l
  - armv6l-musl

I started with https://github.com/void-linux/void-packages/pull/31237

Closes https://github.com/void-linux/void-packages/issues/31163

^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: [PR PATCH] [Updated] New package: ydotool-1.0.1
  2022-10-12 20:19 [PR PATCH] " JohnGebbie
                   ` (4 preceding siblings ...)
  2022-10-15 11:14 ` JohnGebbie
@ 2022-10-16 10:06 ` JohnGebbie
  5 siblings, 0 replies; 37+ messages in thread
From: JohnGebbie @ 2022-10-16 10:06 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1359 bytes --]

There is an updated pull request by JohnGebbie against master on the void-packages repository

https://github.com/JohnGebbie/void-packages ydotool
https://github.com/void-linux/void-packages/pull/39920

New package: ydotool-1.0.1
#### Testing the changes
- I tested the changes in this PR: **YES**

#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I cross built it for i686 and tested it on my laptop.
- I cross built it for aarch64-musl and tested it on my Raspberry Pi 4.

I started with https://github.com/void-linux/void-packages/pull/31237

Closes https://github.com/void-linux/void-packages/issues/31163


Sorry this is a continuation of https://github.com/void-linux/void-packages/pull/38268. I did a bad push that automatically closed the pull request, and then a force push to fix it but github won't let me reopen it because I force pushed when it was closed :( I was just trying to add a log/run to the service and update the branch.

The package is ready. I use it to type (with my voice) so I've been using it a lot.

A patch file from https://github.com/void-linux/void-packages/pull/39920.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-ydotool-39920.patch --]
[-- Type: text/x-diff, Size: 14834 bytes --]

From 0548811f926d352165ed66950e748a4e4233b22d Mon Sep 17 00:00:00 2001
From: John Gebbie <me@johngebbie.com>
Date: Wed, 12 Oct 2022 20:50:01 +0100
Subject: [PATCH] New package: ydotool-1.0.1

---
 srcpkgs/ydotool/INSTALL.msg                   |   6 +
 srcpkgs/ydotool/files/50-ydotool.conf         |   8 +
 srcpkgs/ydotool/files/80-uinput.rules         |   4 +
 srcpkgs/ydotool/files/ydotoold/log/run        |   2 +
 srcpkgs/ydotool/files/ydotoold/run            |   2 +
 .../patches/man-update-for-1.0.1.patch        | 266 ++++++++++++++++++
 .../patches/socket-group-permission.patch     |  36 +++
 srcpkgs/ydotool/template                      |  28 ++
 8 files changed, 352 insertions(+)
 create mode 100644 srcpkgs/ydotool/INSTALL.msg
 create mode 100644 srcpkgs/ydotool/files/50-ydotool.conf
 create mode 100644 srcpkgs/ydotool/files/80-uinput.rules
 create mode 100755 srcpkgs/ydotool/files/ydotoold/log/run
 create mode 100755 srcpkgs/ydotool/files/ydotoold/run
 create mode 100644 srcpkgs/ydotool/patches/man-update-for-1.0.1.patch
 create mode 100644 srcpkgs/ydotool/patches/socket-group-permission.patch
 create mode 100644 srcpkgs/ydotool/template

diff --git a/srcpkgs/ydotool/INSTALL.msg b/srcpkgs/ydotool/INSTALL.msg
new file mode 100644
index 000000000000..1812d29a7afc
--- /dev/null
+++ b/srcpkgs/ydotool/INSTALL.msg
@@ -0,0 +1,6 @@
+udev rules for uinput has been installed,
+to access /dev/uinput, add yourself to group input:
+
+    $ sudo usermod -a -G input $USER
+
+and then re-login to make it effective.
diff --git a/srcpkgs/ydotool/files/50-ydotool.conf b/srcpkgs/ydotool/files/50-ydotool.conf
new file mode 100644
index 000000000000..bb6d376aa21c
--- /dev/null
+++ b/srcpkgs/ydotool/files/50-ydotool.conf
@@ -0,0 +1,8 @@
+# This fixes `ydotool mousemove` by disabling acceleration:
+# https://github.com/ReimuNotMoe/ydotool/issues/158
+Section "InputClass"
+	Identifier "ydotoold virtual device"
+	MatchDriver "libinput"
+	Option "AccelProfile" "flat"
+	Option "AccelSpeed" "0"
+EndSection
diff --git a/srcpkgs/ydotool/files/80-uinput.rules b/srcpkgs/ydotool/files/80-uinput.rules
new file mode 100644
index 000000000000..6067c917b4c5
--- /dev/null
+++ b/srcpkgs/ydotool/files/80-uinput.rules
@@ -0,0 +1,4 @@
+# This allows users in group input to write to /dev/uinput,
+# as required by the ydotoold command:
+# https://github.com/ReimuNotMoe/ydotool/issues/25#issuecomment-535842993
+KERNEL=="uinput", GROUP="input", MODE="0660", OPTIONS+="static_node=uinput"
diff --git a/srcpkgs/ydotool/files/ydotoold/log/run b/srcpkgs/ydotool/files/ydotoold/log/run
new file mode 100755
index 000000000000..14f2459503cc
--- /dev/null
+++ b/srcpkgs/ydotool/files/ydotoold/log/run
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec logger -p daemon.info -t ydotoold
diff --git a/srcpkgs/ydotool/files/ydotoold/run b/srcpkgs/ydotool/files/ydotoold/run
new file mode 100755
index 000000000000..430cefd9bcd9
--- /dev/null
+++ b/srcpkgs/ydotool/files/ydotoold/run
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec chpst -u _ydotoold:input ydotoold 2>&1
diff --git a/srcpkgs/ydotool/patches/man-update-for-1.0.1.patch b/srcpkgs/ydotool/patches/man-update-for-1.0.1.patch
new file mode 100644
index 000000000000..1f5812eb8933
--- /dev/null
+++ b/srcpkgs/ydotool/patches/man-update-for-1.0.1.patch
@@ -0,0 +1,266 @@
+From d06f10c5ff5ad0217ef0655964deb51e211fba90 Mon Sep 17 00:00:00 2001
+From: John Gebbie <me@johngebbie.com>
+Date: Sat, 15 Oct 2022 11:36:32 +0100
+Subject: [PATCH] Update ydotool.1.scd and ydotoold.8.scd
+
+Bring manual up to date with version 1.0.1
+---
+ manpage/ydotool.1.scd  | 140 ++++++++++++++---------------------------
+ manpage/ydotoold.8.scd |  23 +++----
+ 2 files changed, 57 insertions(+), 106 deletions(-)
+
+diff --git a/manpage/ydotool.1.scd b/manpage/ydotool.1.scd
+index b8f318c..4c01a38 100644
+--- a/manpage/ydotool.1.scd
++++ b/manpage/ydotool.1.scd
+@@ -1,20 +1,19 @@
+ YDOTOOL(1)
+-
+ # NAME
+ 
+ ydotool - command-line _/dev/uinput_ automation tool
+ 
+ # SYNOPSIS
+ 
+-*ydotool* *cmd* _args_ [ , *cmd* _args_ ... ]
++*ydotool* *cmd* _args_
+ 
+ *ydotool* *cmd* --help
+ 
+ # DESCRIPTION
+ 
+-*ydotool* lets you programmatically (or manually) simulate keyboard input and mouse activity, etc. It does this by writing directly to _/dev/uinput_ so it generally needs to run as root.
++*ydotool* lets you programmatically (or manually) simulate keyboard input and mouse activity, etc.
++The *ydotoold*(8) daemon must be running.
+ 
+-It's possible to chain multiple commands together, separated by a comma between two spaces.
+ 
+ Currently implemented command(s):
+ 
+@@ -26,67 +25,37 @@ Currently implemented command(s):
+ 	Move mouse pointer to absolute position
+ *click*
+ 	Click on mouse buttons
+-*recorder*
+-	Record/replay input events
+-*sleep*
+-	sleep for a while
+ 
+ # KEYBOARD COMMANDS
+-*key* [*--up*] [*--down*] [*--next-delay* _<ms>_] [*--key-delay* _<ms>_] [*--repeat* _<times>_] [*--repeat-delay <ms>*] _<key sequence>_
++*key* [*-d*,*--key-delay* _<ms>_] [_<KEYCODE:PRESSED>_ ...]
+ 
+-	Type a given keystroke. Examples being "alt+r", "ctrl+J",
+-	"ctrl+alt+n", "backspace".
++	Type a given keycode.
++	
++	e.g. 28:1 28:0 means pressing on the Enter button on a standard US keyboard.
+ 
+-	Options:
++	42:1 38:1 38:0 24:1 24:0 38:1 38:0 42:0 - "LOL"
+ 
+-	*--up*
+-		Only keyup
+-		
+-	*--down*
+-		Only keydown
++	Non-interpretable values, such as 0, aaa, l0l, will only cause a delay.
+ 
+-	*--delay* _<ms>_
+-		Delay before starting to output keystrokes. Default 100ms.
++	See `/usr/include/linux/input-event-codes.h' for available key codes (KEY_\*).
+ 
+-	*--key-delay* _<ms>_
++	Options:
++	*-d*,*--key-delay* _<ms>_
+ 		Delay time between keystrokes. Default 12ms.
+ 
+-	*--repeat* _<times>_
+-		Times to repeat the key sequence.
+-
+-	*--repeat-delay* _<ms>_
+-		Delay time between repetitions. Default 0ms.
+-
+-	Generally, any valid name from _/usr/include/linux/input-event-codes.h_ will work. Multiple keys are separated by '+'.
+-
+-	Each key sequence can be any number of modifiers and keys, separated by plus (+)
+-
+-	For example: alt+r Alt+F4 CTRL+alt+f3 aLT+1+2+3 ctrl+Backspace 
+-
+-	Since we are emulating keyboard input, combinations like Shift+# is invalid because typing a `#' involves pressing Shift and 3.
+-
+-	Example: Switch to tty1:
+-		ydotool key ctrl+alt+f1
+-
+-	Example: Close a window in graphical environment:
+-		ydotool key Alt+F4
+-
+-*type* [*--next-delay* _<ms>_] [*--key-delay* _<ms>_] [*--texts* _arg_] [*--file* _<filepath>_] "_texts_"
++*type* [*-D*,*--next-delay* _<ms>_] [*-d*,*--key-delay* _<ms>_] [*-f*,*--file* _<filepath>_] "_text_"
+ 
+ 	Types text as if you had typed it on the keyboard.
+ 
+ 	Options:
+ 
+-	*--next-delay* _<ms>_
+-		Delay before starting typing. Default 100ms.
+-
+-	*--key-delay* _<ms>_
+-		Delay time between keystrokes. Default 12ms.
++	*-d*,*--key-delay* _<ms>_
++		Delay time between key events (up/down each). Default 12ms.
+ 
+-	*--texts* _arg_
+-		Texts to type
++	*-D*,*--next-delay* _<ms>_
++		Delay between strings. Default 0ms.
+ 
+-	*--file* _<filepath>_
++	*-f*,*--file* _<filepath>_
+ 		Specify a file, the contents of which will be typed as if passed as an argument. The filepath may also be '-' to read from stdin.
+ 
+ 	Example: to type 'Hello world!' you would do:
+@@ -94,8 +63,8 @@ Currently implemented command(s):
+ 
+ # MOUSE COMMANDS
+ 
+-*mousemove* _<x> <y>_
+-	Move the mouse to the specific relative X and Y coordinates on the screen.
++*mousemove* [*-a*,*--absolute*] _<x> <y>_
++	Move the mouse to the relative X and Y coordinates on the screen.
+ 
+ 	Options:
+ 	*--absolute*
+@@ -104,61 +73,48 @@ Currently implemented command(s):
+ 	Example: to move the cursor to absolute coordinates (100,100):
+ 		ydotool mousemove --absolute 100 100
+ 
+-*click*  [*--next-delay* _<ms>_] _button_
+-	Send a click. Buttons are: _left_, _right_ or _middle_
++*click* [*-d*,*--next-delay* _<ms>_] [*-r*,*--repeat* _N_ ] [_button_ ...]
++	Send a click.
+ 
+ 	Options:
++	*-d*,*--next-delay* _<ms>_
++		Delay between input events (up/down, a compete click means doubled time). Default 25ms.
+ 
+-	*--next-delay* _<ms>_
+-		Delay before click. Default 100ms.
+-
+-	*--up*
+-		Only mouseup
+-
+-	*--down*
+-		Only mousedown
+-
+-	*--buttons* _<arg>_
+-		Buttons to press (left, right, middle)
+-
+-	Example: Mouse middle click:
+-		ydotool click middle
+-
+-*recorder* [*--record* _<devices>_] [*--replay* _<input files>_] [*--display*] [*--duration* _<ms>_] [*--devices* _<path>_] [*--file* _<path>_]
++	*-r*,*--repeat* _N_
++		Repeat entire sequence N times
+ 
+-	Options:
+-
+-	*--record* _<devices>_
+-		Devices to record from. Default is all, including non-keyboard devices.
++	all mouse buttons are represented using hexadecimal numeric values, with an optional
++	bit mask to specify if mouse up/down needs to be omitted.
+ 
+-	*--replay* _<input files>_
+-		The record file can't be replayed on an architecture with different endianness.
++	- 0x00 - LEFT
++	- 0x01 - RIGHT
++	- 0x02 - MIDDLE
++	- 0x03 - SIDE
++	- 0x04 - EXTR
++	- 0x05 - FORWARD
++	- 0x06 - BACK
++	- 0x07 - TASK
++	- 0x40 - Mouse down
++	- 0x80 - Mouse up
++    
++	Examples:
+ 
+-	*--display*
+-		Display
++	- 0x00: chooses left button, but does nothing (you can use this to implement extra sleeps)
++	- 0xC0: left button click (down then up)
++	- 0x41: right button down
++	- 0x82: middle button up
+ 
+-	*--duration* _<ms>_
+-		Record duration. Otherwise use SIGINT to stop recording.
++	The '0x' prefix can be omitted if you want.
+ 
+-	*--devices* _<path>_
+-		Devices, separated by comma, to record from. Default is all devices (default: "")
++# YDOTOOL SOCKET
+ 
+-	*--file* _<path>_
+-		File to record to / replay from
++The socket to write to for *ydotoold*(8) can be changed by the environment variable YDOTOOL_SOCKET.
+ 
+ # AUTHOR
+ 
+ ydotool was written by ReimuNotMoe.
+ 
+-This man page by bob.hepple@gmail.com
+-
+-# BUGS
+-
+-When *ydotool*(1) runs and creates a virtual input device, it will take some time for your graphical environment (eg X11/Wayland) to recognize and enable the virtual input device. (Usually done by udev)
+-
+-If the delay is too short, the virtual input device may not be recognized & enabled by the graphical environment in time.
+-
+-In order to solve this problem, there is a persistent background service, *ydotoold*(1), to hold a persistent virtual device, and accept input from *ydotool*(1). When *ydotoold*(1) is unavailable, *ydotool*(1) will work without it.
++This manpage was written by bob.hepple@gmail.com but updated since.
+ 
+ # LICENCE
+ AGPLv3
+diff --git a/manpage/ydotoold.8.scd b/manpage/ydotoold.8.scd
+index 8ed56ec..5c33cb4 100644
+--- a/manpage/ydotoold.8.scd
++++ b/manpage/ydotoold.8.scd
+@@ -10,29 +10,24 @@ ydotoold \- daemon for *ydotool*(1)
+ 
+ # DESCRIPTION
+ 
+-*ydotool* lets you programmatically (or manually) simulate
+-keyboard input and mouse activity, etc. It does this by writing
+-directly to */dev/uinput* so it generally needs to run as root.
+-
+-When *ydotool*(1) runs and creates a virtual input device, it will take some time for your graphical environment (eg X11/Wayland) to recognize and enable the virtual input device. (Usually done by udev)
+-
+-If the delay is too short, the virtual input device may not be recognized & enabled by the graphical environment in time.
+-
+-In order to solve this problem, the *ydotoold* background service holds a persistent virtual device, and accepts input from *ydotool*(1). When *ydotoold*(1) is unavailable, *ydotool*(1) will work without it.
++*ydotoold* holds a persistent virtual device, and accepts input from *ydotool*(1).
+ 
+ # OPTIONS
+ 
+-	*--socket-path arg*  _<path>_
+-		Socket path (default: /tmp/.ydotool_socket)
++	*-p*, *--socket-path arg* _<path>_
++		Set socket path.
++
++	*-P*, *--socket-perm arg* _<perms>_
++		Set socket permission.
+ 
+-	*--socket-perm arg* _<perms>_
+-		Socket permission (default: 0600)
++	*-h*, *--help*
++		Display help and exit.
+ 
+ # AUTHOR
+ 
+ *ydotool*(1) and *ydotoold*(8) were written by ReimuNotMoe.
+ 
+-This man page by bob.hepple@gmail.com
++This manpage was written by bob.hepple@gmail.com but updated since.
+ 
+ # LICENCE
+ 
diff --git a/srcpkgs/ydotool/patches/socket-group-permission.patch b/srcpkgs/ydotool/patches/socket-group-permission.patch
new file mode 100644
index 000000000000..ed8d31284496
--- /dev/null
+++ b/srcpkgs/ydotool/patches/socket-group-permission.patch
@@ -0,0 +1,36 @@
+This requires the user to be in the group used for ydotoold, rather
+than the same user. This means a user in the correct group can use the
+service without root permissions.
+
+The socket path is changed due to the restricted deletion flag of /tmp,
+which stops a member of the same group overwriting it, which ydotoold
+does each time.
+
+diff --git a/Client/ydotool.c b/Client/ydotool.c
+index c86f20b..79bd8b0 100644
+--- a/Client/ydotool.c
++++ b/Client/ydotool.c
+@@ -134,7 +134,7 @@ int main(int argc, char **argv) {
+ 	if (env_sp) {
+ 		daemon_socket_path = env_sp;
+ 	} else {
+-		daemon_socket_path = "/tmp/.ydotool_socket";
++		daemon_socket_path = "/var/lib/ydotoold/socket";
+ 	}
+ 
+ 	fd_daemon_socket = socket(AF_UNIX, SOCK_DGRAM, 0);
+diff --git a/Daemon/ydotoold.c b/Daemon/ydotoold.c
+index 10b4ca2..e0d061b 100644
+--- a/Daemon/ydotoold.c
++++ b/Daemon/ydotoold.c
+@@ -59,8 +59,8 @@
+ 
+ #include <linux/uinput.h>
+ 
+-static const char *opt_socket_path = "/tmp/.ydotool_socket";
+-static const char *opt_socket_perm = "0600";
++static const char *opt_socket_path = "/var/lib/ydotoold/socket";
++static const char *opt_socket_perm = "0660";
+ 
+ static void show_help() {
+ 	puts(
diff --git a/srcpkgs/ydotool/template b/srcpkgs/ydotool/template
new file mode 100644
index 000000000000..8fafaea4a431
--- /dev/null
+++ b/srcpkgs/ydotool/template
@@ -0,0 +1,28 @@
+# Template file for 'ydotool'
+pkgname=ydotool
+version=1.0.1
+revision=1
+build_style=cmake
+hostmakedepends="pkg-config scdoc"
+short_desc="Generic command-line automation tool, works on Wayland and X11"
+maintainer="John Gebbie <me@johngebbie.com>"
+license="AGPL-3.0-only"
+homepage="https://github.com/ReimuNotMoe/ydotool"
+distfiles="https://github.com/ReimuNotMoe/ydotool/archive/v${version}.tar.gz"
+checksum=02311cdc608f205711b06a95e5fd71093b2294f4920efc526f5e98a2ddab42b8
+
+system_accounts="_ydotoold"
+_ydotoold_groups="input"
+
+# Used instead of /tmp so any group input user can replace the socket.
+# See patches/socket-group-permission.patch
+make_dirs='/var/lib/ydotoold 0775 _ydotoold input'
+
+post_install() {
+	vsv ydotoold
+	vinstall "${FILESDIR}/80-uinput.rules" 644 usr/lib/udev/rules.d
+	vinstall "${FILESDIR}/50-ydotool.conf" 644 usr/share/X11/xorg.conf.d
+	vlicense LICENSE
+	vman build/manpage/ydotool.1
+	vman build/manpage/ydotoold.8
+}

^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: [PR PATCH] [Updated] New package: ydotool-1.0.1
  2022-10-12 20:19 [PR PATCH] " JohnGebbie
                   ` (3 preceding siblings ...)
  2022-10-15 11:10 ` JohnGebbie
@ 2022-10-15 11:14 ` JohnGebbie
  2022-10-16 10:06 ` JohnGebbie
  5 siblings, 0 replies; 37+ messages in thread
From: JohnGebbie @ 2022-10-15 11:14 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1359 bytes --]

There is an updated pull request by JohnGebbie against master on the void-packages repository

https://github.com/JohnGebbie/void-packages ydotool
https://github.com/void-linux/void-packages/pull/39920

New package: ydotool-1.0.1
#### Testing the changes
- I tested the changes in this PR: **YES**

#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I cross built it for i686 and tested it on my laptop.
- I cross built it for aarch64-musl and tested it on my Raspberry Pi 4.

I started with https://github.com/void-linux/void-packages/pull/31237

Closes https://github.com/void-linux/void-packages/issues/31163


Sorry this is a continuation of https://github.com/void-linux/void-packages/pull/38268. I did a bad push that automatically closed the pull request, and then a force push to fix it but github won't let me reopen it because I force pushed when it was closed :( I was just trying to add a log/run to the service and update the branch.

The package is ready. I use it to type (with my voice) so I've been using it a lot.

A patch file from https://github.com/void-linux/void-packages/pull/39920.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-ydotool-39920.patch --]
[-- Type: text/x-diff, Size: 14834 bytes --]

From 9053ae5ccb5e9d4b7221edf738026cff96000172 Mon Sep 17 00:00:00 2001
From: John Gebbie <me@johngebbie.com>
Date: Wed, 12 Oct 2022 20:50:01 +0100
Subject: [PATCH] New package: ydotool-1.0.1

---
 srcpkgs/ydotool/INSTALL.msg                   |   6 +
 srcpkgs/ydotool/files/50-ydotool.conf         |   8 +
 srcpkgs/ydotool/files/80-uinput.rules         |   4 +
 srcpkgs/ydotool/files/ydotoold/log/run        |   2 +
 srcpkgs/ydotool/files/ydotoold/run            |   2 +
 .../patches/man-update-for-1.0.1.patch        | 266 ++++++++++++++++++
 .../patches/socket-group-permission.patch     |  36 +++
 srcpkgs/ydotool/template                      |  28 ++
 8 files changed, 352 insertions(+)
 create mode 100644 srcpkgs/ydotool/INSTALL.msg
 create mode 100644 srcpkgs/ydotool/files/50-ydotool.conf
 create mode 100644 srcpkgs/ydotool/files/80-uinput.rules
 create mode 100755 srcpkgs/ydotool/files/ydotoold/log/run
 create mode 100755 srcpkgs/ydotool/files/ydotoold/run
 create mode 100644 srcpkgs/ydotool/patches/man-update-for-1.0.1.patch
 create mode 100644 srcpkgs/ydotool/patches/socket-group-permission.patch
 create mode 100644 srcpkgs/ydotool/template

diff --git a/srcpkgs/ydotool/INSTALL.msg b/srcpkgs/ydotool/INSTALL.msg
new file mode 100644
index 000000000000..1812d29a7afc
--- /dev/null
+++ b/srcpkgs/ydotool/INSTALL.msg
@@ -0,0 +1,6 @@
+udev rules for uinput has been installed,
+to access /dev/uinput, add yourself to group input:
+
+    $ sudo usermod -a -G input $USER
+
+and then re-login to make it effective.
diff --git a/srcpkgs/ydotool/files/50-ydotool.conf b/srcpkgs/ydotool/files/50-ydotool.conf
new file mode 100644
index 000000000000..bb6d376aa21c
--- /dev/null
+++ b/srcpkgs/ydotool/files/50-ydotool.conf
@@ -0,0 +1,8 @@
+# This fixes `ydotool mousemove` by disabling acceleration:
+# https://github.com/ReimuNotMoe/ydotool/issues/158
+Section "InputClass"
+	Identifier "ydotoold virtual device"
+	MatchDriver "libinput"
+	Option "AccelProfile" "flat"
+	Option "AccelSpeed" "0"
+EndSection
diff --git a/srcpkgs/ydotool/files/80-uinput.rules b/srcpkgs/ydotool/files/80-uinput.rules
new file mode 100644
index 000000000000..6067c917b4c5
--- /dev/null
+++ b/srcpkgs/ydotool/files/80-uinput.rules
@@ -0,0 +1,4 @@
+# This allows users in group input to write to /dev/uinput,
+# as required by the ydotoold command:
+# https://github.com/ReimuNotMoe/ydotool/issues/25#issuecomment-535842993
+KERNEL=="uinput", GROUP="input", MODE="0660", OPTIONS+="static_node=uinput"
diff --git a/srcpkgs/ydotool/files/ydotoold/log/run b/srcpkgs/ydotool/files/ydotoold/log/run
new file mode 100755
index 000000000000..14f2459503cc
--- /dev/null
+++ b/srcpkgs/ydotool/files/ydotoold/log/run
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec logger -p daemon.info -t ydotoold
diff --git a/srcpkgs/ydotool/files/ydotoold/run b/srcpkgs/ydotool/files/ydotoold/run
new file mode 100755
index 000000000000..430cefd9bcd9
--- /dev/null
+++ b/srcpkgs/ydotool/files/ydotoold/run
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec chpst -u _ydotoold:input ydotoold 2>&1
diff --git a/srcpkgs/ydotool/patches/man-update-for-1.0.1.patch b/srcpkgs/ydotool/patches/man-update-for-1.0.1.patch
new file mode 100644
index 000000000000..1f5812eb8933
--- /dev/null
+++ b/srcpkgs/ydotool/patches/man-update-for-1.0.1.patch
@@ -0,0 +1,266 @@
+From d06f10c5ff5ad0217ef0655964deb51e211fba90 Mon Sep 17 00:00:00 2001
+From: John Gebbie <me@johngebbie.com>
+Date: Sat, 15 Oct 2022 11:36:32 +0100
+Subject: [PATCH] Update ydotool.1.scd and ydotoold.8.scd
+
+Bring manual up to date with version 1.0.1
+---
+ manpage/ydotool.1.scd  | 140 ++++++++++++++---------------------------
+ manpage/ydotoold.8.scd |  23 +++----
+ 2 files changed, 57 insertions(+), 106 deletions(-)
+
+diff --git a/manpage/ydotool.1.scd b/manpage/ydotool.1.scd
+index b8f318c..4c01a38 100644
+--- a/manpage/ydotool.1.scd
++++ b/manpage/ydotool.1.scd
+@@ -1,20 +1,19 @@
+ YDOTOOL(1)
+-
+ # NAME
+ 
+ ydotool - command-line _/dev/uinput_ automation tool
+ 
+ # SYNOPSIS
+ 
+-*ydotool* *cmd* _args_ [ , *cmd* _args_ ... ]
++*ydotool* *cmd* _args_
+ 
+ *ydotool* *cmd* --help
+ 
+ # DESCRIPTION
+ 
+-*ydotool* lets you programmatically (or manually) simulate keyboard input and mouse activity, etc. It does this by writing directly to _/dev/uinput_ so it generally needs to run as root.
++*ydotool* lets you programmatically (or manually) simulate keyboard input and mouse activity, etc.
++The *ydotoold*(8) daemon must be running.
+ 
+-It's possible to chain multiple commands together, separated by a comma between two spaces.
+ 
+ Currently implemented command(s):
+ 
+@@ -26,67 +25,37 @@ Currently implemented command(s):
+ 	Move mouse pointer to absolute position
+ *click*
+ 	Click on mouse buttons
+-*recorder*
+-	Record/replay input events
+-*sleep*
+-	sleep for a while
+ 
+ # KEYBOARD COMMANDS
+-*key* [*--up*] [*--down*] [*--next-delay* _<ms>_] [*--key-delay* _<ms>_] [*--repeat* _<times>_] [*--repeat-delay <ms>*] _<key sequence>_
++*key* [*-d*,*--key-delay* _<ms>_] [_<KEYCODE:PRESSED>_ ...]
+ 
+-	Type a given keystroke. Examples being "alt+r", "ctrl+J",
+-	"ctrl+alt+n", "backspace".
++	Type a given keycode.
++	
++	e.g. 28:1 28:0 means pressing on the Enter button on a standard US keyboard.
+ 
+-	Options:
++	42:1 38:1 38:0 24:1 24:0 38:1 38:0 42:0 - "LOL"
+ 
+-	*--up*
+-		Only keyup
+-		
+-	*--down*
+-		Only keydown
++	Non-interpretable values, such as 0, aaa, l0l, will only cause a delay.
+ 
+-	*--delay* _<ms>_
+-		Delay before starting to output keystrokes. Default 100ms.
++	See `/usr/include/linux/input-event-codes.h' for available key codes (KEY_\*).
+ 
+-	*--key-delay* _<ms>_
++	Options:
++	*-d*,*--key-delay* _<ms>_
+ 		Delay time between keystrokes. Default 12ms.
+ 
+-	*--repeat* _<times>_
+-		Times to repeat the key sequence.
+-
+-	*--repeat-delay* _<ms>_
+-		Delay time between repetitions. Default 0ms.
+-
+-	Generally, any valid name from _/usr/include/linux/input-event-codes.h_ will work. Multiple keys are separated by '+'.
+-
+-	Each key sequence can be any number of modifiers and keys, separated by plus (+)
+-
+-	For example: alt+r Alt+F4 CTRL+alt+f3 aLT+1+2+3 ctrl+Backspace 
+-
+-	Since we are emulating keyboard input, combinations like Shift+# is invalid because typing a `#' involves pressing Shift and 3.
+-
+-	Example: Switch to tty1:
+-		ydotool key ctrl+alt+f1
+-
+-	Example: Close a window in graphical environment:
+-		ydotool key Alt+F4
+-
+-*type* [*--next-delay* _<ms>_] [*--key-delay* _<ms>_] [*--texts* _arg_] [*--file* _<filepath>_] "_texts_"
++*type* [*-D*,*--next-delay* _<ms>_] [*-d*,*--key-delay* _<ms>_] [*-f*,*--file* _<filepath>_] "_text_"
+ 
+ 	Types text as if you had typed it on the keyboard.
+ 
+ 	Options:
+ 
+-	*--next-delay* _<ms>_
+-		Delay before starting typing. Default 100ms.
+-
+-	*--key-delay* _<ms>_
+-		Delay time between keystrokes. Default 12ms.
++	*-d*,*--key-delay* _<ms>_
++		Delay time between key events (up/down each). Default 12ms.
+ 
+-	*--texts* _arg_
+-		Texts to type
++	*-D*,*--next-delay* _<ms>_
++		Delay between strings. Default 0ms.
+ 
+-	*--file* _<filepath>_
++	*-f*,*--file* _<filepath>_
+ 		Specify a file, the contents of which will be typed as if passed as an argument. The filepath may also be '-' to read from stdin.
+ 
+ 	Example: to type 'Hello world!' you would do:
+@@ -94,8 +63,8 @@ Currently implemented command(s):
+ 
+ # MOUSE COMMANDS
+ 
+-*mousemove* _<x> <y>_
+-	Move the mouse to the specific relative X and Y coordinates on the screen.
++*mousemove* [*-a*,*--absolute*] _<x> <y>_
++	Move the mouse to the relative X and Y coordinates on the screen.
+ 
+ 	Options:
+ 	*--absolute*
+@@ -104,61 +73,48 @@ Currently implemented command(s):
+ 	Example: to move the cursor to absolute coordinates (100,100):
+ 		ydotool mousemove --absolute 100 100
+ 
+-*click*  [*--next-delay* _<ms>_] _button_
+-	Send a click. Buttons are: _left_, _right_ or _middle_
++*click* [*-d*,*--next-delay* _<ms>_] [*-r*,*--repeat* _N_ ] [_button_ ...]
++	Send a click.
+ 
+ 	Options:
++	*-d*,*--next-delay* _<ms>_
++		Delay between input events (up/down, a compete click means doubled time). Default 25ms.
+ 
+-	*--next-delay* _<ms>_
+-		Delay before click. Default 100ms.
+-
+-	*--up*
+-		Only mouseup
+-
+-	*--down*
+-		Only mousedown
+-
+-	*--buttons* _<arg>_
+-		Buttons to press (left, right, middle)
+-
+-	Example: Mouse middle click:
+-		ydotool click middle
+-
+-*recorder* [*--record* _<devices>_] [*--replay* _<input files>_] [*--display*] [*--duration* _<ms>_] [*--devices* _<path>_] [*--file* _<path>_]
++	*-r*,*--repeat* _N_
++		Repeat entire sequence N times
+ 
+-	Options:
+-
+-	*--record* _<devices>_
+-		Devices to record from. Default is all, including non-keyboard devices.
++	all mouse buttons are represented using hexadecimal numeric values, with an optional
++	bit mask to specify if mouse up/down needs to be omitted.
+ 
+-	*--replay* _<input files>_
+-		The record file can't be replayed on an architecture with different endianness.
++	- 0x00 - LEFT
++	- 0x01 - RIGHT
++	- 0x02 - MIDDLE
++	- 0x03 - SIDE
++	- 0x04 - EXTR
++	- 0x05 - FORWARD
++	- 0x06 - BACK
++	- 0x07 - TASK
++	- 0x40 - Mouse down
++	- 0x80 - Mouse up
++    
++	Examples:
+ 
+-	*--display*
+-		Display
++	- 0x00: chooses left button, but does nothing (you can use this to implement extra sleeps)
++	- 0xC0: left button click (down then up)
++	- 0x41: right button down
++	- 0x82: middle button up
+ 
+-	*--duration* _<ms>_
+-		Record duration. Otherwise use SIGINT to stop recording.
++	The '0x' prefix can be omitted if you want.
+ 
+-	*--devices* _<path>_
+-		Devices, separated by comma, to record from. Default is all devices (default: "")
++# YDOTOOL SOCKET
+ 
+-	*--file* _<path>_
+-		File to record to / replay from
++The socket to write to for *ydotoold*(8) can be changed by the environment variable YDOTOOL_SOCKET.
+ 
+ # AUTHOR
+ 
+ ydotool was written by ReimuNotMoe.
+ 
+-This man page by bob.hepple@gmail.com
+-
+-# BUGS
+-
+-When *ydotool*(1) runs and creates a virtual input device, it will take some time for your graphical environment (eg X11/Wayland) to recognize and enable the virtual input device. (Usually done by udev)
+-
+-If the delay is too short, the virtual input device may not be recognized & enabled by the graphical environment in time.
+-
+-In order to solve this problem, there is a persistent background service, *ydotoold*(1), to hold a persistent virtual device, and accept input from *ydotool*(1). When *ydotoold*(1) is unavailable, *ydotool*(1) will work without it.
++This manpage was written by bob.hepple@gmail.com but updated since.
+ 
+ # LICENCE
+ AGPLv3
+diff --git a/manpage/ydotoold.8.scd b/manpage/ydotoold.8.scd
+index 8ed56ec..5c33cb4 100644
+--- a/manpage/ydotoold.8.scd
++++ b/manpage/ydotoold.8.scd
+@@ -10,29 +10,24 @@ ydotoold \- daemon for *ydotool*(1)
+ 
+ # DESCRIPTION
+ 
+-*ydotool* lets you programmatically (or manually) simulate
+-keyboard input and mouse activity, etc. It does this by writing
+-directly to */dev/uinput* so it generally needs to run as root.
+-
+-When *ydotool*(1) runs and creates a virtual input device, it will take some time for your graphical environment (eg X11/Wayland) to recognize and enable the virtual input device. (Usually done by udev)
+-
+-If the delay is too short, the virtual input device may not be recognized & enabled by the graphical environment in time.
+-
+-In order to solve this problem, the *ydotoold* background service holds a persistent virtual device, and accepts input from *ydotool*(1). When *ydotoold*(1) is unavailable, *ydotool*(1) will work without it.
++*ydotoold* holds a persistent virtual device, and accepts input from *ydotool*(1).
+ 
+ # OPTIONS
+ 
+-	*--socket-path arg*  _<path>_
+-		Socket path (default: /tmp/.ydotool_socket)
++	*-p*, *--socket-path arg* _<path>_
++		Set socket path.
++
++	*-P*, *--socket-perm arg* _<perms>_
++		Set socket permission.
+ 
+-	*--socket-perm arg* _<perms>_
+-		Socket permission (default: 0600)
++	*-h*, *--help*
++		Display help and exit.
+ 
+ # AUTHOR
+ 
+ *ydotool*(1) and *ydotoold*(8) were written by ReimuNotMoe.
+ 
+-This man page by bob.hepple@gmail.com
++This manpage was written by bob.hepple@gmail.com but updated since.
+ 
+ # LICENCE
+ 
diff --git a/srcpkgs/ydotool/patches/socket-group-permission.patch b/srcpkgs/ydotool/patches/socket-group-permission.patch
new file mode 100644
index 000000000000..ed8d31284496
--- /dev/null
+++ b/srcpkgs/ydotool/patches/socket-group-permission.patch
@@ -0,0 +1,36 @@
+This requires the user to be in the group used for ydotoold, rather
+than the same user. This means a user in the correct group can use the
+service without root permissions.
+
+The socket path is changed due to the restricted deletion flag of /tmp,
+which stops a member of the same group overwriting it, which ydotoold
+does each time.
+
+diff --git a/Client/ydotool.c b/Client/ydotool.c
+index c86f20b..79bd8b0 100644
+--- a/Client/ydotool.c
++++ b/Client/ydotool.c
+@@ -134,7 +134,7 @@ int main(int argc, char **argv) {
+ 	if (env_sp) {
+ 		daemon_socket_path = env_sp;
+ 	} else {
+-		daemon_socket_path = "/tmp/.ydotool_socket";
++		daemon_socket_path = "/var/lib/ydotoold/socket";
+ 	}
+ 
+ 	fd_daemon_socket = socket(AF_UNIX, SOCK_DGRAM, 0);
+diff --git a/Daemon/ydotoold.c b/Daemon/ydotoold.c
+index 10b4ca2..e0d061b 100644
+--- a/Daemon/ydotoold.c
++++ b/Daemon/ydotoold.c
+@@ -59,8 +59,8 @@
+ 
+ #include <linux/uinput.h>
+ 
+-static const char *opt_socket_path = "/tmp/.ydotool_socket";
+-static const char *opt_socket_perm = "0600";
++static const char *opt_socket_path = "/var/lib/ydotoold/socket";
++static const char *opt_socket_perm = "0660";
+ 
+ static void show_help() {
+ 	puts(
diff --git a/srcpkgs/ydotool/template b/srcpkgs/ydotool/template
new file mode 100644
index 000000000000..8fafaea4a431
--- /dev/null
+++ b/srcpkgs/ydotool/template
@@ -0,0 +1,28 @@
+# Template file for 'ydotool'
+pkgname=ydotool
+version=1.0.1
+revision=1
+build_style=cmake
+hostmakedepends="pkg-config scdoc"
+short_desc="Generic command-line automation tool, works on Wayland and X11"
+maintainer="John Gebbie <me@johngebbie.com>"
+license="AGPL-3.0-only"
+homepage="https://github.com/ReimuNotMoe/ydotool"
+distfiles="https://github.com/ReimuNotMoe/ydotool/archive/v${version}.tar.gz"
+checksum=02311cdc608f205711b06a95e5fd71093b2294f4920efc526f5e98a2ddab42b8
+
+system_accounts="_ydotoold"
+_ydotoold_groups="input"
+
+# Used instead of /tmp so any group input user can replace the socket.
+# See patches/socket-group-permission.patch
+make_dirs='/var/lib/ydotoold 0775 _ydotoold input'
+
+post_install() {
+	vsv ydotoold
+	vinstall "${FILESDIR}/80-uinput.rules" 644 usr/lib/udev/rules.d
+	vinstall "${FILESDIR}/50-ydotool.conf" 644 usr/share/X11/xorg.conf.d
+	vlicense LICENSE
+	vman build/manpage/ydotool.1
+	vman build/manpage/ydotoold.8
+}

^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: [PR PATCH] [Updated] New package: ydotool-1.0.1
  2022-10-12 20:19 [PR PATCH] " JohnGebbie
                   ` (2 preceding siblings ...)
  2022-10-15 10:47 ` JohnGebbie
@ 2022-10-15 11:10 ` JohnGebbie
  2022-10-15 11:14 ` JohnGebbie
  2022-10-16 10:06 ` JohnGebbie
  5 siblings, 0 replies; 37+ messages in thread
From: JohnGebbie @ 2022-10-15 11:10 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1359 bytes --]

There is an updated pull request by JohnGebbie against master on the void-packages repository

https://github.com/JohnGebbie/void-packages ydotool
https://github.com/void-linux/void-packages/pull/39920

New package: ydotool-1.0.1
#### Testing the changes
- I tested the changes in this PR: **YES**

#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I cross built it for i686 and tested it on my laptop.
- I cross built it for aarch64-musl and tested it on my Raspberry Pi 4.

I started with https://github.com/void-linux/void-packages/pull/31237

Closes https://github.com/void-linux/void-packages/issues/31163


Sorry this is a continuation of https://github.com/void-linux/void-packages/pull/38268. I did a bad push that automatically closed the pull request, and then a force push to fix it but github won't let me reopen it because I force pushed when it was closed :( I was just trying to add a log/run to the service and update the branch.

The package is ready. I use it to type (with my voice) so I've been using it a lot.

A patch file from https://github.com/void-linux/void-packages/pull/39920.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-ydotool-39920.patch --]
[-- Type: text/x-diff, Size: 14789 bytes --]

From 1d6d0491a5c60a32287b6fc88726e43fc946a177 Mon Sep 17 00:00:00 2001
From: John Gebbie <me@johngebbie.com>
Date: Wed, 12 Oct 2022 20:50:01 +0100
Subject: [PATCH] New package: ydotool-1.0.1

---
 srcpkgs/ydotool/INSTALL.msg                   |   6 +
 srcpkgs/ydotool/files/50-ydotool.conf         |   8 +
 srcpkgs/ydotool/files/80-uinput.rules         |   4 +
 srcpkgs/ydotool/files/ydotoold/log/run        |   2 +
 srcpkgs/ydotool/files/ydotoold/run            |   2 +
 .../patches/man-update-for-1.0.1.patch        | 266 ++++++++++++++++++
 .../patches/socket-group-permission.patch     |  36 +++
 srcpkgs/ydotool/template                      |  27 ++
 8 files changed, 351 insertions(+)
 create mode 100644 srcpkgs/ydotool/INSTALL.msg
 create mode 100644 srcpkgs/ydotool/files/50-ydotool.conf
 create mode 100644 srcpkgs/ydotool/files/80-uinput.rules
 create mode 100755 srcpkgs/ydotool/files/ydotoold/log/run
 create mode 100755 srcpkgs/ydotool/files/ydotoold/run
 create mode 100644 srcpkgs/ydotool/patches/man-update-for-1.0.1.patch
 create mode 100644 srcpkgs/ydotool/patches/socket-group-permission.patch
 create mode 100644 srcpkgs/ydotool/template

diff --git a/srcpkgs/ydotool/INSTALL.msg b/srcpkgs/ydotool/INSTALL.msg
new file mode 100644
index 000000000000..1812d29a7afc
--- /dev/null
+++ b/srcpkgs/ydotool/INSTALL.msg
@@ -0,0 +1,6 @@
+udev rules for uinput has been installed,
+to access /dev/uinput, add yourself to group input:
+
+    $ sudo usermod -a -G input $USER
+
+and then re-login to make it effective.
diff --git a/srcpkgs/ydotool/files/50-ydotool.conf b/srcpkgs/ydotool/files/50-ydotool.conf
new file mode 100644
index 000000000000..bb6d376aa21c
--- /dev/null
+++ b/srcpkgs/ydotool/files/50-ydotool.conf
@@ -0,0 +1,8 @@
+# This fixes `ydotool mousemove` by disabling acceleration:
+# https://github.com/ReimuNotMoe/ydotool/issues/158
+Section "InputClass"
+	Identifier "ydotoold virtual device"
+	MatchDriver "libinput"
+	Option "AccelProfile" "flat"
+	Option "AccelSpeed" "0"
+EndSection
diff --git a/srcpkgs/ydotool/files/80-uinput.rules b/srcpkgs/ydotool/files/80-uinput.rules
new file mode 100644
index 000000000000..6067c917b4c5
--- /dev/null
+++ b/srcpkgs/ydotool/files/80-uinput.rules
@@ -0,0 +1,4 @@
+# This allows users in group input to write to /dev/uinput,
+# as required by the ydotoold command:
+# https://github.com/ReimuNotMoe/ydotool/issues/25#issuecomment-535842993
+KERNEL=="uinput", GROUP="input", MODE="0660", OPTIONS+="static_node=uinput"
diff --git a/srcpkgs/ydotool/files/ydotoold/log/run b/srcpkgs/ydotool/files/ydotoold/log/run
new file mode 100755
index 000000000000..14f2459503cc
--- /dev/null
+++ b/srcpkgs/ydotool/files/ydotoold/log/run
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec logger -p daemon.info -t ydotoold
diff --git a/srcpkgs/ydotool/files/ydotoold/run b/srcpkgs/ydotool/files/ydotoold/run
new file mode 100755
index 000000000000..430cefd9bcd9
--- /dev/null
+++ b/srcpkgs/ydotool/files/ydotoold/run
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec chpst -u _ydotoold:input ydotoold 2>&1
diff --git a/srcpkgs/ydotool/patches/man-update-for-1.0.1.patch b/srcpkgs/ydotool/patches/man-update-for-1.0.1.patch
new file mode 100644
index 000000000000..1f5812eb8933
--- /dev/null
+++ b/srcpkgs/ydotool/patches/man-update-for-1.0.1.patch
@@ -0,0 +1,266 @@
+From d06f10c5ff5ad0217ef0655964deb51e211fba90 Mon Sep 17 00:00:00 2001
+From: John Gebbie <me@johngebbie.com>
+Date: Sat, 15 Oct 2022 11:36:32 +0100
+Subject: [PATCH] Update ydotool.1.scd and ydotoold.8.scd
+
+Bring manual up to date with version 1.0.1
+---
+ manpage/ydotool.1.scd  | 140 ++++++++++++++---------------------------
+ manpage/ydotoold.8.scd |  23 +++----
+ 2 files changed, 57 insertions(+), 106 deletions(-)
+
+diff --git a/manpage/ydotool.1.scd b/manpage/ydotool.1.scd
+index b8f318c..4c01a38 100644
+--- a/manpage/ydotool.1.scd
++++ b/manpage/ydotool.1.scd
+@@ -1,20 +1,19 @@
+ YDOTOOL(1)
+-
+ # NAME
+ 
+ ydotool - command-line _/dev/uinput_ automation tool
+ 
+ # SYNOPSIS
+ 
+-*ydotool* *cmd* _args_ [ , *cmd* _args_ ... ]
++*ydotool* *cmd* _args_
+ 
+ *ydotool* *cmd* --help
+ 
+ # DESCRIPTION
+ 
+-*ydotool* lets you programmatically (or manually) simulate keyboard input and mouse activity, etc. It does this by writing directly to _/dev/uinput_ so it generally needs to run as root.
++*ydotool* lets you programmatically (or manually) simulate keyboard input and mouse activity, etc.
++The *ydotoold*(8) daemon must be running.
+ 
+-It's possible to chain multiple commands together, separated by a comma between two spaces.
+ 
+ Currently implemented command(s):
+ 
+@@ -26,67 +25,37 @@ Currently implemented command(s):
+ 	Move mouse pointer to absolute position
+ *click*
+ 	Click on mouse buttons
+-*recorder*
+-	Record/replay input events
+-*sleep*
+-	sleep for a while
+ 
+ # KEYBOARD COMMANDS
+-*key* [*--up*] [*--down*] [*--next-delay* _<ms>_] [*--key-delay* _<ms>_] [*--repeat* _<times>_] [*--repeat-delay <ms>*] _<key sequence>_
++*key* [*-d*,*--key-delay* _<ms>_] [_<KEYCODE:PRESSED>_ ...]
+ 
+-	Type a given keystroke. Examples being "alt+r", "ctrl+J",
+-	"ctrl+alt+n", "backspace".
++	Type a given keycode.
++	
++	e.g. 28:1 28:0 means pressing on the Enter button on a standard US keyboard.
+ 
+-	Options:
++	42:1 38:1 38:0 24:1 24:0 38:1 38:0 42:0 - "LOL"
+ 
+-	*--up*
+-		Only keyup
+-		
+-	*--down*
+-		Only keydown
++	Non-interpretable values, such as 0, aaa, l0l, will only cause a delay.
+ 
+-	*--delay* _<ms>_
+-		Delay before starting to output keystrokes. Default 100ms.
++	See `/usr/include/linux/input-event-codes.h' for available key codes (KEY_\*).
+ 
+-	*--key-delay* _<ms>_
++	Options:
++	*-d*,*--key-delay* _<ms>_
+ 		Delay time between keystrokes. Default 12ms.
+ 
+-	*--repeat* _<times>_
+-		Times to repeat the key sequence.
+-
+-	*--repeat-delay* _<ms>_
+-		Delay time between repetitions. Default 0ms.
+-
+-	Generally, any valid name from _/usr/include/linux/input-event-codes.h_ will work. Multiple keys are separated by '+'.
+-
+-	Each key sequence can be any number of modifiers and keys, separated by plus (+)
+-
+-	For example: alt+r Alt+F4 CTRL+alt+f3 aLT+1+2+3 ctrl+Backspace 
+-
+-	Since we are emulating keyboard input, combinations like Shift+# is invalid because typing a `#' involves pressing Shift and 3.
+-
+-	Example: Switch to tty1:
+-		ydotool key ctrl+alt+f1
+-
+-	Example: Close a window in graphical environment:
+-		ydotool key Alt+F4
+-
+-*type* [*--next-delay* _<ms>_] [*--key-delay* _<ms>_] [*--texts* _arg_] [*--file* _<filepath>_] "_texts_"
++*type* [*-D*,*--next-delay* _<ms>_] [*-d*,*--key-delay* _<ms>_] [*-f*,*--file* _<filepath>_] "_text_"
+ 
+ 	Types text as if you had typed it on the keyboard.
+ 
+ 	Options:
+ 
+-	*--next-delay* _<ms>_
+-		Delay before starting typing. Default 100ms.
+-
+-	*--key-delay* _<ms>_
+-		Delay time between keystrokes. Default 12ms.
++	*-d*,*--key-delay* _<ms>_
++		Delay time between key events (up/down each). Default 12ms.
+ 
+-	*--texts* _arg_
+-		Texts to type
++	*-D*,*--next-delay* _<ms>_
++		Delay between strings. Default 0ms.
+ 
+-	*--file* _<filepath>_
++	*-f*,*--file* _<filepath>_
+ 		Specify a file, the contents of which will be typed as if passed as an argument. The filepath may also be '-' to read from stdin.
+ 
+ 	Example: to type 'Hello world!' you would do:
+@@ -94,8 +63,8 @@ Currently implemented command(s):
+ 
+ # MOUSE COMMANDS
+ 
+-*mousemove* _<x> <y>_
+-	Move the mouse to the specific relative X and Y coordinates on the screen.
++*mousemove* [*-a*,*--absolute*] _<x> <y>_
++	Move the mouse to the relative X and Y coordinates on the screen.
+ 
+ 	Options:
+ 	*--absolute*
+@@ -104,61 +73,48 @@ Currently implemented command(s):
+ 	Example: to move the cursor to absolute coordinates (100,100):
+ 		ydotool mousemove --absolute 100 100
+ 
+-*click*  [*--next-delay* _<ms>_] _button_
+-	Send a click. Buttons are: _left_, _right_ or _middle_
++*click* [*-d*,*--next-delay* _<ms>_] [*-r*,*--repeat* _N_ ] [_button_ ...]
++	Send a click.
+ 
+ 	Options:
++	*-d*,*--next-delay* _<ms>_
++		Delay between input events (up/down, a compete click means doubled time). Default 25ms.
+ 
+-	*--next-delay* _<ms>_
+-		Delay before click. Default 100ms.
+-
+-	*--up*
+-		Only mouseup
+-
+-	*--down*
+-		Only mousedown
+-
+-	*--buttons* _<arg>_
+-		Buttons to press (left, right, middle)
+-
+-	Example: Mouse middle click:
+-		ydotool click middle
+-
+-*recorder* [*--record* _<devices>_] [*--replay* _<input files>_] [*--display*] [*--duration* _<ms>_] [*--devices* _<path>_] [*--file* _<path>_]
++	*-r*,*--repeat* _N_
++		Repeat entire sequence N times
+ 
+-	Options:
+-
+-	*--record* _<devices>_
+-		Devices to record from. Default is all, including non-keyboard devices.
++	all mouse buttons are represented using hexadecimal numeric values, with an optional
++	bit mask to specify if mouse up/down needs to be omitted.
+ 
+-	*--replay* _<input files>_
+-		The record file can't be replayed on an architecture with different endianness.
++	- 0x00 - LEFT
++	- 0x01 - RIGHT
++	- 0x02 - MIDDLE
++	- 0x03 - SIDE
++	- 0x04 - EXTR
++	- 0x05 - FORWARD
++	- 0x06 - BACK
++	- 0x07 - TASK
++	- 0x40 - Mouse down
++	- 0x80 - Mouse up
++    
++	Examples:
+ 
+-	*--display*
+-		Display
++	- 0x00: chooses left button, but does nothing (you can use this to implement extra sleeps)
++	- 0xC0: left button click (down then up)
++	- 0x41: right button down
++	- 0x82: middle button up
+ 
+-	*--duration* _<ms>_
+-		Record duration. Otherwise use SIGINT to stop recording.
++	The '0x' prefix can be omitted if you want.
+ 
+-	*--devices* _<path>_
+-		Devices, separated by comma, to record from. Default is all devices (default: "")
++# YDOTOOL SOCKET
+ 
+-	*--file* _<path>_
+-		File to record to / replay from
++The socket to write to for *ydotoold*(8) can be changed by the environment variable YDOTOOL_SOCKET.
+ 
+ # AUTHOR
+ 
+ ydotool was written by ReimuNotMoe.
+ 
+-This man page by bob.hepple@gmail.com
+-
+-# BUGS
+-
+-When *ydotool*(1) runs and creates a virtual input device, it will take some time for your graphical environment (eg X11/Wayland) to recognize and enable the virtual input device. (Usually done by udev)
+-
+-If the delay is too short, the virtual input device may not be recognized & enabled by the graphical environment in time.
+-
+-In order to solve this problem, there is a persistent background service, *ydotoold*(1), to hold a persistent virtual device, and accept input from *ydotool*(1). When *ydotoold*(1) is unavailable, *ydotool*(1) will work without it.
++This manpage was written by bob.hepple@gmail.com but updated since.
+ 
+ # LICENCE
+ AGPLv3
+diff --git a/manpage/ydotoold.8.scd b/manpage/ydotoold.8.scd
+index 8ed56ec..5c33cb4 100644
+--- a/manpage/ydotoold.8.scd
++++ b/manpage/ydotoold.8.scd
+@@ -10,29 +10,24 @@ ydotoold \- daemon for *ydotool*(1)
+ 
+ # DESCRIPTION
+ 
+-*ydotool* lets you programmatically (or manually) simulate
+-keyboard input and mouse activity, etc. It does this by writing
+-directly to */dev/uinput* so it generally needs to run as root.
+-
+-When *ydotool*(1) runs and creates a virtual input device, it will take some time for your graphical environment (eg X11/Wayland) to recognize and enable the virtual input device. (Usually done by udev)
+-
+-If the delay is too short, the virtual input device may not be recognized & enabled by the graphical environment in time.
+-
+-In order to solve this problem, the *ydotoold* background service holds a persistent virtual device, and accepts input from *ydotool*(1). When *ydotoold*(1) is unavailable, *ydotool*(1) will work without it.
++*ydotoold* holds a persistent virtual device, and accepts input from *ydotool*(1).
+ 
+ # OPTIONS
+ 
+-	*--socket-path arg*  _<path>_
+-		Socket path (default: /tmp/.ydotool_socket)
++	*-p*, *--socket-path arg* _<path>_
++		Set socket path.
++
++	*-P*, *--socket-perm arg* _<perms>_
++		Set socket permission.
+ 
+-	*--socket-perm arg* _<perms>_
+-		Socket permission (default: 0600)
++	*-h*, *--help*
++		Display help and exit.
+ 
+ # AUTHOR
+ 
+ *ydotool*(1) and *ydotoold*(8) were written by ReimuNotMoe.
+ 
+-This man page by bob.hepple@gmail.com
++This manpage was written by bob.hepple@gmail.com but updated since.
+ 
+ # LICENCE
+ 
diff --git a/srcpkgs/ydotool/patches/socket-group-permission.patch b/srcpkgs/ydotool/patches/socket-group-permission.patch
new file mode 100644
index 000000000000..ed8d31284496
--- /dev/null
+++ b/srcpkgs/ydotool/patches/socket-group-permission.patch
@@ -0,0 +1,36 @@
+This requires the user to be in the group used for ydotoold, rather
+than the same user. This means a user in the correct group can use the
+service without root permissions.
+
+The socket path is changed due to the restricted deletion flag of /tmp,
+which stops a member of the same group overwriting it, which ydotoold
+does each time.
+
+diff --git a/Client/ydotool.c b/Client/ydotool.c
+index c86f20b..79bd8b0 100644
+--- a/Client/ydotool.c
++++ b/Client/ydotool.c
+@@ -134,7 +134,7 @@ int main(int argc, char **argv) {
+ 	if (env_sp) {
+ 		daemon_socket_path = env_sp;
+ 	} else {
+-		daemon_socket_path = "/tmp/.ydotool_socket";
++		daemon_socket_path = "/var/lib/ydotoold/socket";
+ 	}
+ 
+ 	fd_daemon_socket = socket(AF_UNIX, SOCK_DGRAM, 0);
+diff --git a/Daemon/ydotoold.c b/Daemon/ydotoold.c
+index 10b4ca2..e0d061b 100644
+--- a/Daemon/ydotoold.c
++++ b/Daemon/ydotoold.c
+@@ -59,8 +59,8 @@
+ 
+ #include <linux/uinput.h>
+ 
+-static const char *opt_socket_path = "/tmp/.ydotool_socket";
+-static const char *opt_socket_perm = "0600";
++static const char *opt_socket_path = "/var/lib/ydotoold/socket";
++static const char *opt_socket_perm = "0660";
+ 
+ static void show_help() {
+ 	puts(
diff --git a/srcpkgs/ydotool/template b/srcpkgs/ydotool/template
new file mode 100644
index 000000000000..850eeef9dd7d
--- /dev/null
+++ b/srcpkgs/ydotool/template
@@ -0,0 +1,27 @@
+# Template file for 'ydotool'
+pkgname=ydotool
+version=1.0.1
+revision=1
+build_style=cmake
+hostmakedepends="pkg-config scdoc"
+short_desc="Generic command-line automation tool, works on Wayland and X11"
+maintainer="John Gebbie <me@johngebbie.com>"
+license="AGPL-3.0-only"
+homepage="https://github.com/ReimuNotMoe/ydotool"
+distfiles="https://github.com/ReimuNotMoe/ydotool/archive/v${version}.tar.gz"
+checksum=02311cdc608f205711b06a95e5fd71093b2294f4920efc526f5e98a2ddab42b8
+
+system_accounts="_ydotoold"
+_ydotoold_groups="input"
+
+# Used instead of /tmp so any group input user can replace the socket.
+make_dirs='/var/lib/ydotoold 0775 _ydotoold input'
+
+post_install() {
+	vsv ydotoold
+	vinstall "${FILESDIR}/80-uinput.rules" 644 usr/lib/udev/rules.d
+	vinstall "${FILESDIR}/50-ydotool.conf" 644 usr/share/X11/xorg.conf.d
+	vlicense LICENSE
+	vman build/manpage/ydotool.1
+	vman build/manpage/ydotoold.8
+}

^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: [PR PATCH] [Updated] New package: ydotool-1.0.1
  2022-10-12 20:19 [PR PATCH] " JohnGebbie
  2022-10-12 22:13 ` [PR PATCH] [Updated] " JohnGebbie
  2022-10-15  9:18 ` JohnGebbie
@ 2022-10-15 10:47 ` JohnGebbie
  2022-10-15 11:10 ` JohnGebbie
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 37+ messages in thread
From: JohnGebbie @ 2022-10-15 10:47 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1359 bytes --]

There is an updated pull request by JohnGebbie against master on the void-packages repository

https://github.com/JohnGebbie/void-packages ydotool
https://github.com/void-linux/void-packages/pull/39920

New package: ydotool-1.0.1
#### Testing the changes
- I tested the changes in this PR: **YES**

#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I cross built it for i686 and tested it on my laptop.
- I cross built it for aarch64-musl and tested it on my Raspberry Pi 4.

I started with https://github.com/void-linux/void-packages/pull/31237

Closes https://github.com/void-linux/void-packages/issues/31163


Sorry this is a continuation of https://github.com/void-linux/void-packages/pull/38268. I did a bad push that automatically closed the pull request, and then a force push to fix it but github won't let me reopen it because I force pushed when it was closed :( I was just trying to add a log/run to the service and update the branch.

The package is ready. I use it to type (with my voice) so I've been using it a lot.

A patch file from https://github.com/void-linux/void-packages/pull/39920.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-ydotool-39920.patch --]
[-- Type: text/x-diff, Size: 14645 bytes --]

From dc64a80cb73673eacfc14e8dbf3f0dc513c0ed99 Mon Sep 17 00:00:00 2001
From: John Gebbie <me@johngebbie.com>
Date: Wed, 12 Oct 2022 20:50:01 +0100
Subject: [PATCH] New package: ydotool-1.0.1

---
 srcpkgs/ydotool/INSTALL.msg                   |   6 +
 srcpkgs/ydotool/files/50-ydotool.conf         |   7 +
 srcpkgs/ydotool/files/80-uinput.rules         |   3 +
 srcpkgs/ydotool/files/ydotoold/log/run        |   2 +
 srcpkgs/ydotool/files/ydotoold/run            |   2 +
 .../patches/man-update-for-1.0.1.patch        | 266 ++++++++++++++++++
 .../patches/socket-group-permission.patch     |  36 +++
 srcpkgs/ydotool/template                      |  27 ++
 8 files changed, 349 insertions(+)
 create mode 100644 srcpkgs/ydotool/INSTALL.msg
 create mode 100644 srcpkgs/ydotool/files/50-ydotool.conf
 create mode 100644 srcpkgs/ydotool/files/80-uinput.rules
 create mode 100755 srcpkgs/ydotool/files/ydotoold/log/run
 create mode 100755 srcpkgs/ydotool/files/ydotoold/run
 create mode 100644 srcpkgs/ydotool/patches/man-update-for-1.0.1.patch
 create mode 100644 srcpkgs/ydotool/patches/socket-group-permission.patch
 create mode 100644 srcpkgs/ydotool/template

diff --git a/srcpkgs/ydotool/INSTALL.msg b/srcpkgs/ydotool/INSTALL.msg
new file mode 100644
index 000000000000..1812d29a7afc
--- /dev/null
+++ b/srcpkgs/ydotool/INSTALL.msg
@@ -0,0 +1,6 @@
+udev rules for uinput has been installed,
+to access /dev/uinput, add yourself to group input:
+
+    $ sudo usermod -a -G input $USER
+
+and then re-login to make it effective.
diff --git a/srcpkgs/ydotool/files/50-ydotool.conf b/srcpkgs/ydotool/files/50-ydotool.conf
new file mode 100644
index 000000000000..a799b618728b
--- /dev/null
+++ b/srcpkgs/ydotool/files/50-ydotool.conf
@@ -0,0 +1,7 @@
+# https://github.com/ReimuNotMoe/ydotool/issues/158
+Section "InputClass"
+	Identifier "ydotoold virtual device"
+	MatchDriver "libinput"
+	Option "AccelProfile" "flat"
+	Option "AccelSpeed" "0"
+EndSection
diff --git a/srcpkgs/ydotool/files/80-uinput.rules b/srcpkgs/ydotool/files/80-uinput.rules
new file mode 100644
index 000000000000..988d34547f52
--- /dev/null
+++ b/srcpkgs/ydotool/files/80-uinput.rules
@@ -0,0 +1,3 @@
+## ydotoold fix
+## https://github.com/ReimuNotMoe/ydotool/issues/25#issuecomment-535842993
+KERNEL=="uinput", GROUP="input", MODE="0660", OPTIONS+="static_node=uinput"
diff --git a/srcpkgs/ydotool/files/ydotoold/log/run b/srcpkgs/ydotool/files/ydotoold/log/run
new file mode 100755
index 000000000000..14f2459503cc
--- /dev/null
+++ b/srcpkgs/ydotool/files/ydotoold/log/run
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec logger -p daemon.info -t ydotoold
diff --git a/srcpkgs/ydotool/files/ydotoold/run b/srcpkgs/ydotool/files/ydotoold/run
new file mode 100755
index 000000000000..430cefd9bcd9
--- /dev/null
+++ b/srcpkgs/ydotool/files/ydotoold/run
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec chpst -u _ydotoold:input ydotoold 2>&1
diff --git a/srcpkgs/ydotool/patches/man-update-for-1.0.1.patch b/srcpkgs/ydotool/patches/man-update-for-1.0.1.patch
new file mode 100644
index 000000000000..1f5812eb8933
--- /dev/null
+++ b/srcpkgs/ydotool/patches/man-update-for-1.0.1.patch
@@ -0,0 +1,266 @@
+From d06f10c5ff5ad0217ef0655964deb51e211fba90 Mon Sep 17 00:00:00 2001
+From: John Gebbie <me@johngebbie.com>
+Date: Sat, 15 Oct 2022 11:36:32 +0100
+Subject: [PATCH] Update ydotool.1.scd and ydotoold.8.scd
+
+Bring manual up to date with version 1.0.1
+---
+ manpage/ydotool.1.scd  | 140 ++++++++++++++---------------------------
+ manpage/ydotoold.8.scd |  23 +++----
+ 2 files changed, 57 insertions(+), 106 deletions(-)
+
+diff --git a/manpage/ydotool.1.scd b/manpage/ydotool.1.scd
+index b8f318c..4c01a38 100644
+--- a/manpage/ydotool.1.scd
++++ b/manpage/ydotool.1.scd
+@@ -1,20 +1,19 @@
+ YDOTOOL(1)
+-
+ # NAME
+ 
+ ydotool - command-line _/dev/uinput_ automation tool
+ 
+ # SYNOPSIS
+ 
+-*ydotool* *cmd* _args_ [ , *cmd* _args_ ... ]
++*ydotool* *cmd* _args_
+ 
+ *ydotool* *cmd* --help
+ 
+ # DESCRIPTION
+ 
+-*ydotool* lets you programmatically (or manually) simulate keyboard input and mouse activity, etc. It does this by writing directly to _/dev/uinput_ so it generally needs to run as root.
++*ydotool* lets you programmatically (or manually) simulate keyboard input and mouse activity, etc.
++The *ydotoold*(8) daemon must be running.
+ 
+-It's possible to chain multiple commands together, separated by a comma between two spaces.
+ 
+ Currently implemented command(s):
+ 
+@@ -26,67 +25,37 @@ Currently implemented command(s):
+ 	Move mouse pointer to absolute position
+ *click*
+ 	Click on mouse buttons
+-*recorder*
+-	Record/replay input events
+-*sleep*
+-	sleep for a while
+ 
+ # KEYBOARD COMMANDS
+-*key* [*--up*] [*--down*] [*--next-delay* _<ms>_] [*--key-delay* _<ms>_] [*--repeat* _<times>_] [*--repeat-delay <ms>*] _<key sequence>_
++*key* [*-d*,*--key-delay* _<ms>_] [_<KEYCODE:PRESSED>_ ...]
+ 
+-	Type a given keystroke. Examples being "alt+r", "ctrl+J",
+-	"ctrl+alt+n", "backspace".
++	Type a given keycode.
++	
++	e.g. 28:1 28:0 means pressing on the Enter button on a standard US keyboard.
+ 
+-	Options:
++	42:1 38:1 38:0 24:1 24:0 38:1 38:0 42:0 - "LOL"
+ 
+-	*--up*
+-		Only keyup
+-		
+-	*--down*
+-		Only keydown
++	Non-interpretable values, such as 0, aaa, l0l, will only cause a delay.
+ 
+-	*--delay* _<ms>_
+-		Delay before starting to output keystrokes. Default 100ms.
++	See `/usr/include/linux/input-event-codes.h' for available key codes (KEY_\*).
+ 
+-	*--key-delay* _<ms>_
++	Options:
++	*-d*,*--key-delay* _<ms>_
+ 		Delay time between keystrokes. Default 12ms.
+ 
+-	*--repeat* _<times>_
+-		Times to repeat the key sequence.
+-
+-	*--repeat-delay* _<ms>_
+-		Delay time between repetitions. Default 0ms.
+-
+-	Generally, any valid name from _/usr/include/linux/input-event-codes.h_ will work. Multiple keys are separated by '+'.
+-
+-	Each key sequence can be any number of modifiers and keys, separated by plus (+)
+-
+-	For example: alt+r Alt+F4 CTRL+alt+f3 aLT+1+2+3 ctrl+Backspace 
+-
+-	Since we are emulating keyboard input, combinations like Shift+# is invalid because typing a `#' involves pressing Shift and 3.
+-
+-	Example: Switch to tty1:
+-		ydotool key ctrl+alt+f1
+-
+-	Example: Close a window in graphical environment:
+-		ydotool key Alt+F4
+-
+-*type* [*--next-delay* _<ms>_] [*--key-delay* _<ms>_] [*--texts* _arg_] [*--file* _<filepath>_] "_texts_"
++*type* [*-D*,*--next-delay* _<ms>_] [*-d*,*--key-delay* _<ms>_] [*-f*,*--file* _<filepath>_] "_text_"
+ 
+ 	Types text as if you had typed it on the keyboard.
+ 
+ 	Options:
+ 
+-	*--next-delay* _<ms>_
+-		Delay before starting typing. Default 100ms.
+-
+-	*--key-delay* _<ms>_
+-		Delay time between keystrokes. Default 12ms.
++	*-d*,*--key-delay* _<ms>_
++		Delay time between key events (up/down each). Default 12ms.
+ 
+-	*--texts* _arg_
+-		Texts to type
++	*-D*,*--next-delay* _<ms>_
++		Delay between strings. Default 0ms.
+ 
+-	*--file* _<filepath>_
++	*-f*,*--file* _<filepath>_
+ 		Specify a file, the contents of which will be typed as if passed as an argument. The filepath may also be '-' to read from stdin.
+ 
+ 	Example: to type 'Hello world!' you would do:
+@@ -94,8 +63,8 @@ Currently implemented command(s):
+ 
+ # MOUSE COMMANDS
+ 
+-*mousemove* _<x> <y>_
+-	Move the mouse to the specific relative X and Y coordinates on the screen.
++*mousemove* [*-a*,*--absolute*] _<x> <y>_
++	Move the mouse to the relative X and Y coordinates on the screen.
+ 
+ 	Options:
+ 	*--absolute*
+@@ -104,61 +73,48 @@ Currently implemented command(s):
+ 	Example: to move the cursor to absolute coordinates (100,100):
+ 		ydotool mousemove --absolute 100 100
+ 
+-*click*  [*--next-delay* _<ms>_] _button_
+-	Send a click. Buttons are: _left_, _right_ or _middle_
++*click* [*-d*,*--next-delay* _<ms>_] [*-r*,*--repeat* _N_ ] [_button_ ...]
++	Send a click.
+ 
+ 	Options:
++	*-d*,*--next-delay* _<ms>_
++		Delay between input events (up/down, a compete click means doubled time). Default 25ms.
+ 
+-	*--next-delay* _<ms>_
+-		Delay before click. Default 100ms.
+-
+-	*--up*
+-		Only mouseup
+-
+-	*--down*
+-		Only mousedown
+-
+-	*--buttons* _<arg>_
+-		Buttons to press (left, right, middle)
+-
+-	Example: Mouse middle click:
+-		ydotool click middle
+-
+-*recorder* [*--record* _<devices>_] [*--replay* _<input files>_] [*--display*] [*--duration* _<ms>_] [*--devices* _<path>_] [*--file* _<path>_]
++	*-r*,*--repeat* _N_
++		Repeat entire sequence N times
+ 
+-	Options:
+-
+-	*--record* _<devices>_
+-		Devices to record from. Default is all, including non-keyboard devices.
++	all mouse buttons are represented using hexadecimal numeric values, with an optional
++	bit mask to specify if mouse up/down needs to be omitted.
+ 
+-	*--replay* _<input files>_
+-		The record file can't be replayed on an architecture with different endianness.
++	- 0x00 - LEFT
++	- 0x01 - RIGHT
++	- 0x02 - MIDDLE
++	- 0x03 - SIDE
++	- 0x04 - EXTR
++	- 0x05 - FORWARD
++	- 0x06 - BACK
++	- 0x07 - TASK
++	- 0x40 - Mouse down
++	- 0x80 - Mouse up
++    
++	Examples:
+ 
+-	*--display*
+-		Display
++	- 0x00: chooses left button, but does nothing (you can use this to implement extra sleeps)
++	- 0xC0: left button click (down then up)
++	- 0x41: right button down
++	- 0x82: middle button up
+ 
+-	*--duration* _<ms>_
+-		Record duration. Otherwise use SIGINT to stop recording.
++	The '0x' prefix can be omitted if you want.
+ 
+-	*--devices* _<path>_
+-		Devices, separated by comma, to record from. Default is all devices (default: "")
++# YDOTOOL SOCKET
+ 
+-	*--file* _<path>_
+-		File to record to / replay from
++The socket to write to for *ydotoold*(8) can be changed by the environment variable YDOTOOL_SOCKET.
+ 
+ # AUTHOR
+ 
+ ydotool was written by ReimuNotMoe.
+ 
+-This man page by bob.hepple@gmail.com
+-
+-# BUGS
+-
+-When *ydotool*(1) runs and creates a virtual input device, it will take some time for your graphical environment (eg X11/Wayland) to recognize and enable the virtual input device. (Usually done by udev)
+-
+-If the delay is too short, the virtual input device may not be recognized & enabled by the graphical environment in time.
+-
+-In order to solve this problem, there is a persistent background service, *ydotoold*(1), to hold a persistent virtual device, and accept input from *ydotool*(1). When *ydotoold*(1) is unavailable, *ydotool*(1) will work without it.
++This manpage was written by bob.hepple@gmail.com but updated since.
+ 
+ # LICENCE
+ AGPLv3
+diff --git a/manpage/ydotoold.8.scd b/manpage/ydotoold.8.scd
+index 8ed56ec..5c33cb4 100644
+--- a/manpage/ydotoold.8.scd
++++ b/manpage/ydotoold.8.scd
+@@ -10,29 +10,24 @@ ydotoold \- daemon for *ydotool*(1)
+ 
+ # DESCRIPTION
+ 
+-*ydotool* lets you programmatically (or manually) simulate
+-keyboard input and mouse activity, etc. It does this by writing
+-directly to */dev/uinput* so it generally needs to run as root.
+-
+-When *ydotool*(1) runs and creates a virtual input device, it will take some time for your graphical environment (eg X11/Wayland) to recognize and enable the virtual input device. (Usually done by udev)
+-
+-If the delay is too short, the virtual input device may not be recognized & enabled by the graphical environment in time.
+-
+-In order to solve this problem, the *ydotoold* background service holds a persistent virtual device, and accepts input from *ydotool*(1). When *ydotoold*(1) is unavailable, *ydotool*(1) will work without it.
++*ydotoold* holds a persistent virtual device, and accepts input from *ydotool*(1).
+ 
+ # OPTIONS
+ 
+-	*--socket-path arg*  _<path>_
+-		Socket path (default: /tmp/.ydotool_socket)
++	*-p*, *--socket-path arg* _<path>_
++		Set socket path.
++
++	*-P*, *--socket-perm arg* _<perms>_
++		Set socket permission.
+ 
+-	*--socket-perm arg* _<perms>_
+-		Socket permission (default: 0600)
++	*-h*, *--help*
++		Display help and exit.
+ 
+ # AUTHOR
+ 
+ *ydotool*(1) and *ydotoold*(8) were written by ReimuNotMoe.
+ 
+-This man page by bob.hepple@gmail.com
++This manpage was written by bob.hepple@gmail.com but updated since.
+ 
+ # LICENCE
+ 
diff --git a/srcpkgs/ydotool/patches/socket-group-permission.patch b/srcpkgs/ydotool/patches/socket-group-permission.patch
new file mode 100644
index 000000000000..ed8d31284496
--- /dev/null
+++ b/srcpkgs/ydotool/patches/socket-group-permission.patch
@@ -0,0 +1,36 @@
+This requires the user to be in the group used for ydotoold, rather
+than the same user. This means a user in the correct group can use the
+service without root permissions.
+
+The socket path is changed due to the restricted deletion flag of /tmp,
+which stops a member of the same group overwriting it, which ydotoold
+does each time.
+
+diff --git a/Client/ydotool.c b/Client/ydotool.c
+index c86f20b..79bd8b0 100644
+--- a/Client/ydotool.c
++++ b/Client/ydotool.c
+@@ -134,7 +134,7 @@ int main(int argc, char **argv) {
+ 	if (env_sp) {
+ 		daemon_socket_path = env_sp;
+ 	} else {
+-		daemon_socket_path = "/tmp/.ydotool_socket";
++		daemon_socket_path = "/var/lib/ydotoold/socket";
+ 	}
+ 
+ 	fd_daemon_socket = socket(AF_UNIX, SOCK_DGRAM, 0);
+diff --git a/Daemon/ydotoold.c b/Daemon/ydotoold.c
+index 10b4ca2..e0d061b 100644
+--- a/Daemon/ydotoold.c
++++ b/Daemon/ydotoold.c
+@@ -59,8 +59,8 @@
+ 
+ #include <linux/uinput.h>
+ 
+-static const char *opt_socket_path = "/tmp/.ydotool_socket";
+-static const char *opt_socket_perm = "0600";
++static const char *opt_socket_path = "/var/lib/ydotoold/socket";
++static const char *opt_socket_perm = "0660";
+ 
+ static void show_help() {
+ 	puts(
diff --git a/srcpkgs/ydotool/template b/srcpkgs/ydotool/template
new file mode 100644
index 000000000000..850eeef9dd7d
--- /dev/null
+++ b/srcpkgs/ydotool/template
@@ -0,0 +1,27 @@
+# Template file for 'ydotool'
+pkgname=ydotool
+version=1.0.1
+revision=1
+build_style=cmake
+hostmakedepends="pkg-config scdoc"
+short_desc="Generic command-line automation tool, works on Wayland and X11"
+maintainer="John Gebbie <me@johngebbie.com>"
+license="AGPL-3.0-only"
+homepage="https://github.com/ReimuNotMoe/ydotool"
+distfiles="https://github.com/ReimuNotMoe/ydotool/archive/v${version}.tar.gz"
+checksum=02311cdc608f205711b06a95e5fd71093b2294f4920efc526f5e98a2ddab42b8
+
+system_accounts="_ydotoold"
+_ydotoold_groups="input"
+
+# Used instead of /tmp so any group input user can replace the socket.
+make_dirs='/var/lib/ydotoold 0775 _ydotoold input'
+
+post_install() {
+	vsv ydotoold
+	vinstall "${FILESDIR}/80-uinput.rules" 644 usr/lib/udev/rules.d
+	vinstall "${FILESDIR}/50-ydotool.conf" 644 usr/share/X11/xorg.conf.d
+	vlicense LICENSE
+	vman build/manpage/ydotool.1
+	vman build/manpage/ydotoold.8
+}

^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: [PR PATCH] [Updated] New package: ydotool-1.0.1
  2022-10-12 20:19 [PR PATCH] " JohnGebbie
  2022-10-12 22:13 ` [PR PATCH] [Updated] " JohnGebbie
@ 2022-10-15  9:18 ` JohnGebbie
  2022-10-15 10:47 ` JohnGebbie
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 37+ messages in thread
From: JohnGebbie @ 2022-10-15  9:18 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1359 bytes --]

There is an updated pull request by JohnGebbie against master on the void-packages repository

https://github.com/JohnGebbie/void-packages ydotool
https://github.com/void-linux/void-packages/pull/39920

New package: ydotool-1.0.1
#### Testing the changes
- I tested the changes in this PR: **YES**

#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I cross built it for i686 and tested it on my laptop.
- I cross built it for aarch64-musl and tested it on my Raspberry Pi 4.

I started with https://github.com/void-linux/void-packages/pull/31237

Closes https://github.com/void-linux/void-packages/issues/31163


Sorry this is a continuation of https://github.com/void-linux/void-packages/pull/38268. I did a bad push that automatically closed the pull request, and then a force push to fix it but github won't let me reopen it because I force pushed when it was closed :( I was just trying to add a log/run to the service and update the branch.

The package is ready. I use it to type (with my voice) so I've been using it a lot.

A patch file from https://github.com/void-linux/void-packages/pull/39920.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-ydotool-39920.patch --]
[-- Type: text/x-diff, Size: 14120 bytes --]

From e6398def25329956aecf551f3e44ae2407067496 Mon Sep 17 00:00:00 2001
From: John Gebbie <me@johngebbie.com>
Date: Wed, 12 Oct 2022 20:50:01 +0100
Subject: [PATCH] New package: ydotool-1.0.1

---
 srcpkgs/ydotool/INSTALL.msg                   |   6 +
 srcpkgs/ydotool/files/50-ydotool.conf         |   7 +
 srcpkgs/ydotool/files/80-uinput.rules         |   3 +
 srcpkgs/ydotool/files/ydotool-workaround      |   2 +
 srcpkgs/ydotool/files/ydotoold-workaround     |   2 +
 srcpkgs/ydotool/files/ydotoold/log/run        |   2 +
 srcpkgs/ydotool/files/ydotoold/run            |   2 +
 .../patches/man-update-for-1.0.1.patch        | 266 ++++++++++++++++++
 srcpkgs/ydotool/template                      |  31 ++
 9 files changed, 321 insertions(+)
 create mode 100644 srcpkgs/ydotool/INSTALL.msg
 create mode 100644 srcpkgs/ydotool/files/50-ydotool.conf
 create mode 100644 srcpkgs/ydotool/files/80-uinput.rules
 create mode 100755 srcpkgs/ydotool/files/ydotool-workaround
 create mode 100755 srcpkgs/ydotool/files/ydotoold-workaround
 create mode 100755 srcpkgs/ydotool/files/ydotoold/log/run
 create mode 100755 srcpkgs/ydotool/files/ydotoold/run
 create mode 100644 srcpkgs/ydotool/patches/man-update-for-1.0.1.patch
 create mode 100644 srcpkgs/ydotool/template

diff --git a/srcpkgs/ydotool/INSTALL.msg b/srcpkgs/ydotool/INSTALL.msg
new file mode 100644
index 000000000000..1812d29a7afc
--- /dev/null
+++ b/srcpkgs/ydotool/INSTALL.msg
@@ -0,0 +1,6 @@
+udev rules for uinput has been installed,
+to access /dev/uinput, add yourself to group input:
+
+    $ sudo usermod -a -G input $USER
+
+and then re-login to make it effective.
diff --git a/srcpkgs/ydotool/files/50-ydotool.conf b/srcpkgs/ydotool/files/50-ydotool.conf
new file mode 100644
index 000000000000..a799b618728b
--- /dev/null
+++ b/srcpkgs/ydotool/files/50-ydotool.conf
@@ -0,0 +1,7 @@
+# https://github.com/ReimuNotMoe/ydotool/issues/158
+Section "InputClass"
+	Identifier "ydotoold virtual device"
+	MatchDriver "libinput"
+	Option "AccelProfile" "flat"
+	Option "AccelSpeed" "0"
+EndSection
diff --git a/srcpkgs/ydotool/files/80-uinput.rules b/srcpkgs/ydotool/files/80-uinput.rules
new file mode 100644
index 000000000000..988d34547f52
--- /dev/null
+++ b/srcpkgs/ydotool/files/80-uinput.rules
@@ -0,0 +1,3 @@
+## ydotoold fix
+## https://github.com/ReimuNotMoe/ydotool/issues/25#issuecomment-535842993
+KERNEL=="uinput", GROUP="input", MODE="0660", OPTIONS+="static_node=uinput"
diff --git a/srcpkgs/ydotool/files/ydotool-workaround b/srcpkgs/ydotool/files/ydotool-workaround
new file mode 100755
index 000000000000..7264726a6433
--- /dev/null
+++ b/srcpkgs/ydotool/files/ydotool-workaround
@@ -0,0 +1,2 @@
+#!/bin/sh
+YDOTOOL_SOCKET="${YDOTOOL_SOCKET:-/var/lib/ydotoold/socket}" /usr/libexec/ydotool "$@"
diff --git a/srcpkgs/ydotool/files/ydotoold-workaround b/srcpkgs/ydotool/files/ydotoold-workaround
new file mode 100755
index 000000000000..ae4558078719
--- /dev/null
+++ b/srcpkgs/ydotool/files/ydotoold-workaround
@@ -0,0 +1,2 @@
+#!/bin/sh
+/usr/libexec/ydotoold -p /var/lib/ydotoold/socket -P 660
diff --git a/srcpkgs/ydotool/files/ydotoold/log/run b/srcpkgs/ydotool/files/ydotoold/log/run
new file mode 100755
index 000000000000..14f2459503cc
--- /dev/null
+++ b/srcpkgs/ydotool/files/ydotoold/log/run
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec logger -p daemon.info -t ydotoold
diff --git a/srcpkgs/ydotool/files/ydotoold/run b/srcpkgs/ydotool/files/ydotoold/run
new file mode 100755
index 000000000000..430cefd9bcd9
--- /dev/null
+++ b/srcpkgs/ydotool/files/ydotoold/run
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec chpst -u _ydotoold:input ydotoold 2>&1
diff --git a/srcpkgs/ydotool/patches/man-update-for-1.0.1.patch b/srcpkgs/ydotool/patches/man-update-for-1.0.1.patch
new file mode 100644
index 000000000000..02fe182845fd
--- /dev/null
+++ b/srcpkgs/ydotool/patches/man-update-for-1.0.1.patch
@@ -0,0 +1,266 @@
+From 9fd36b83d7c311bfc4b268aa187cdbc94dec98dd Mon Sep 17 00:00:00 2001
+From: Bob Hepple <bob.hepple@gmail.com>
+Date: Mon, 21 Mar 2022 15:04:47 +1000
+Subject: [PATCH] Update ydotool.1.scd and ydotoold.8.scd
+
+Bring manual up to date with version 1.0.1
+---
+ manpage/ydotool.1.scd  | 140 ++++++++++++++---------------------------
+ manpage/ydotoold.8.scd |  23 +++----
+ 2 files changed, 57 insertions(+), 106 deletions(-)
+
+diff --git a/manpage/ydotool.1.scd b/manpage/ydotool.1.scd
+index b8f318c..4c01a38 100644
+--- a/manpage/ydotool.1.scd
++++ b/manpage/ydotool.1.scd
+@@ -1,20 +1,19 @@
+ YDOTOOL(1)
+-
+ # NAME
+ 
+ ydotool - command-line _/dev/uinput_ automation tool
+ 
+ # SYNOPSIS
+ 
+-*ydotool* *cmd* _args_ [ , *cmd* _args_ ... ]
++*ydotool* *cmd* _args_
+ 
+ *ydotool* *cmd* --help
+ 
+ # DESCRIPTION
+ 
+-*ydotool* lets you programmatically (or manually) simulate keyboard input and mouse activity, etc. It does this by writing directly to _/dev/uinput_ so it generally needs to run as root.
++*ydotool* lets you programmatically (or manually) simulate keyboard input and mouse activity, etc.
++The *ydotoold*(8) daemon must be running.
+ 
+-It's possible to chain multiple commands together, separated by a comma between two spaces.
+ 
+ Currently implemented command(s):
+ 
+@@ -26,67 +25,37 @@ Currently implemented command(s):
+ 	Move mouse pointer to absolute position
+ *click*
+ 	Click on mouse buttons
+-*recorder*
+-	Record/replay input events
+-*sleep*
+-	sleep for a while
+ 
+ # KEYBOARD COMMANDS
+-*key* [*--up*] [*--down*] [*--next-delay* _<ms>_] [*--key-delay* _<ms>_] [*--repeat* _<times>_] [*--repeat-delay <ms>*] _<key sequence>_
++*key* [*-d*,*--key-delay* _<ms>_] [_<KEYCODE:PRESSED>_ ...]
+ 
+-	Type a given keystroke. Examples being "alt+r", "ctrl+J",
+-	"ctrl+alt+n", "backspace".
++	Type a given keycode.
++	
++	e.g. 28:1 28:0 means pressing on the Enter button on a standard US keyboard.
+ 
+-	Options:
++	42:1 38:1 38:0 24:1 24:0 38:1 38:0 42:0 - "LOL"
+ 
+-	*--up*
+-		Only keyup
+-		
+-	*--down*
+-		Only keydown
++	Non-interpretable values, such as 0, aaa, l0l, will only cause a delay.
+ 
+-	*--delay* _<ms>_
+-		Delay before starting to output keystrokes. Default 100ms.
++	See `/usr/include/linux/input-event-codes.h' for available key codes (KEY_\*).
+ 
+-	*--key-delay* _<ms>_
++	Options:
++	*-d*,*--key-delay* _<ms>_
+ 		Delay time between keystrokes. Default 12ms.
+ 
+-	*--repeat* _<times>_
+-		Times to repeat the key sequence.
+-
+-	*--repeat-delay* _<ms>_
+-		Delay time between repetitions. Default 0ms.
+-
+-	Generally, any valid name from _/usr/include/linux/input-event-codes.h_ will work. Multiple keys are separated by '+'.
+-
+-	Each key sequence can be any number of modifiers and keys, separated by plus (+)
+-
+-	For example: alt+r Alt+F4 CTRL+alt+f3 aLT+1+2+3 ctrl+Backspace 
+-
+-	Since we are emulating keyboard input, combinations like Shift+# is invalid because typing a `#' involves pressing Shift and 3.
+-
+-	Example: Switch to tty1:
+-		ydotool key ctrl+alt+f1
+-
+-	Example: Close a window in graphical environment:
+-		ydotool key Alt+F4
+-
+-*type* [*--next-delay* _<ms>_] [*--key-delay* _<ms>_] [*--texts* _arg_] [*--file* _<filepath>_] "_texts_"
++*type* [*-D*,*--next-delay* _<ms>_] [*-d*,*--key-delay* _<ms>_] [*-f*,*--file* _<filepath>_] "_text_"
+ 
+ 	Types text as if you had typed it on the keyboard.
+ 
+ 	Options:
+ 
+-	*--next-delay* _<ms>_
+-		Delay before starting typing. Default 100ms.
+-
+-	*--key-delay* _<ms>_
+-		Delay time between keystrokes. Default 12ms.
++	*-d*,*--key-delay* _<ms>_
++		Delay time between key events (up/down each). Default 12ms.
+ 
+-	*--texts* _arg_
+-		Texts to type
++	*-D*,*--next-delay* _<ms>_
++		Delay between strings. Default 0ms.
+ 
+-	*--file* _<filepath>_
++	*-f*,*--file* _<filepath>_
+ 		Specify a file, the contents of which will be typed as if passed as an argument. The filepath may also be '-' to read from stdin.
+ 
+ 	Example: to type 'Hello world!' you would do:
+@@ -94,8 +63,8 @@ Currently implemented command(s):
+ 
+ # MOUSE COMMANDS
+ 
+-*mousemove* _<x> <y>_
+-	Move the mouse to the specific relative X and Y coordinates on the screen.
++*mousemove* [*-a*,*--absolute*] _<x> <y>_
++	Move the mouse to the relative X and Y coordinates on the screen.
+ 
+ 	Options:
+ 	*--absolute*
+@@ -104,61 +73,48 @@ Currently implemented command(s):
+ 	Example: to move the cursor to absolute coordinates (100,100):
+ 		ydotool mousemove --absolute 100 100
+ 
+-*click*  [*--next-delay* _<ms>_] _button_
+-	Send a click. Buttons are: _left_, _right_ or _middle_
++*click* [*-d*,*--next-delay* _<ms>_] [*-r*,*--repeat* _N_ ] [_button_ ...]
++	Send a click.
+ 
+ 	Options:
++	*-d*,*--next-delay* _<ms>_
++		Delay between input events (up/down, a compete click means doubled time). Default 25ms.
+ 
+-	*--next-delay* _<ms>_
+-		Delay before click. Default 100ms.
+-
+-	*--up*
+-		Only mouseup
+-
+-	*--down*
+-		Only mousedown
+-
+-	*--buttons* _<arg>_
+-		Buttons to press (left, right, middle)
+-
+-	Example: Mouse middle click:
+-		ydotool click middle
+-
+-*recorder* [*--record* _<devices>_] [*--replay* _<input files>_] [*--display*] [*--duration* _<ms>_] [*--devices* _<path>_] [*--file* _<path>_]
++	*-r*,*--repeat* _N_
++		Repeat entire sequence N times
+ 
+-	Options:
+-
+-	*--record* _<devices>_
+-		Devices to record from. Default is all, including non-keyboard devices.
++	all mouse buttons are represented using hexadecimal numeric values, with an optional
++	bit mask to specify if mouse up/down needs to be omitted.
+ 
+-	*--replay* _<input files>_
+-		The record file can't be replayed on an architecture with different endianness.
++	- 0x00 - LEFT
++	- 0x01 - RIGHT
++	- 0x02 - MIDDLE
++	- 0x03 - SIDE
++	- 0x04 - EXTR
++	- 0x05 - FORWARD
++	- 0x06 - BACK
++	- 0x07 - TASK
++	- 0x40 - Mouse down
++	- 0x80 - Mouse up
++    
++	Examples:
+ 
+-	*--display*
+-		Display
++	- 0x00: chooses left button, but does nothing (you can use this to implement extra sleeps)
++	- 0xC0: left button click (down then up)
++	- 0x41: right button down
++	- 0x82: middle button up
+ 
+-	*--duration* _<ms>_
+-		Record duration. Otherwise use SIGINT to stop recording.
++	The '0x' prefix can be omitted if you want.
+ 
+-	*--devices* _<path>_
+-		Devices, separated by comma, to record from. Default is all devices (default: "")
++# YDOTOOL SOCKET
+ 
+-	*--file* _<path>_
+-		File to record to / replay from
++The socket to write to for *ydotoold*(8) can be changed by the environment variable YDOTOOL_SOCKET.
+ 
+ # AUTHOR
+ 
+ ydotool was written by ReimuNotMoe.
+ 
+-This man page by bob.hepple@gmail.com
+-
+-# BUGS
+-
+-When *ydotool*(1) runs and creates a virtual input device, it will take some time for your graphical environment (eg X11/Wayland) to recognize and enable the virtual input device. (Usually done by udev)
+-
+-If the delay is too short, the virtual input device may not be recognized & enabled by the graphical environment in time.
+-
+-In order to solve this problem, there is a persistent background service, *ydotoold*(1), to hold a persistent virtual device, and accept input from *ydotool*(1). When *ydotoold*(1) is unavailable, *ydotool*(1) will work without it.
++This manpage was written by bob.hepple@gmail.com but updated since.
+ 
+ # LICENCE
+ AGPLv3
+diff --git a/manpage/ydotoold.8.scd b/manpage/ydotoold.8.scd
+index 8ed56ec..5c33cb4 100644
+--- a/manpage/ydotoold.8.scd
++++ b/manpage/ydotoold.8.scd
+@@ -10,29 +10,24 @@ ydotoold \- daemon for *ydotool*(1)
+ 
+ # DESCRIPTION
+ 
+-*ydotool* lets you programmatically (or manually) simulate
+-keyboard input and mouse activity, etc. It does this by writing
+-directly to */dev/uinput* so it generally needs to run as root.
+-
+-When *ydotool*(1) runs and creates a virtual input device, it will take some time for your graphical environment (eg X11/Wayland) to recognize and enable the virtual input device. (Usually done by udev)
+-
+-If the delay is too short, the virtual input device may not be recognized & enabled by the graphical environment in time.
+-
+-In order to solve this problem, the *ydotoold* background service holds a persistent virtual device, and accepts input from *ydotool*(1). When *ydotoold*(1) is unavailable, *ydotool*(1) will work without it.
++*ydotoold* holds a persistent virtual device, and accepts input from *ydotool*(1).
+ 
+ # OPTIONS
+ 
+-	*--socket-path arg*  _<path>_
+-		Socket path (default: /tmp/.ydotool_socket)
++	*-p*, *--socket-path arg* _<path>_
++		Set socket path.
++
++	*-P*, *--socket-perm arg* _<perms>_
++		Set socket permission.
+ 
+-	*--socket-perm arg* _<perms>_
+-		Socket permission (default: 0600)
++	*-h*, *--help*
++		Display help and exit.
+ 
+ # AUTHOR
+ 
+ *ydotool*(1) and *ydotoold*(8) were written by ReimuNotMoe.
+ 
+-This man page by bob.hepple@gmail.com
++This manpage was written by bob.hepple@gmail.com but updated since.
+ 
+ # LICENCE
+ 
diff --git a/srcpkgs/ydotool/template b/srcpkgs/ydotool/template
new file mode 100644
index 000000000000..4973d0c5edaa
--- /dev/null
+++ b/srcpkgs/ydotool/template
@@ -0,0 +1,31 @@
+# Template file for 'ydotool'
+pkgname=ydotool
+version=1.0.1
+revision=1
+build_style=cmake
+hostmakedepends="pkg-config scdoc"
+short_desc="Generic command-line automation tool, works on Wayland and X11"
+maintainer="John Gebbie <me@johngebbie.com>"
+license="AGPL-3.0-only"
+homepage="https://github.com/ReimuNotMoe/ydotool"
+distfiles="https://github.com/ReimuNotMoe/ydotool/archive/v${version}.tar.gz"
+checksum=02311cdc608f205711b06a95e5fd71093b2294f4920efc526f5e98a2ddab42b8
+
+system_accounts="_ydotoold"
+_ydotoold_groups="input"
+
+# Used instead of /tmp so any group input user can replace the socket.
+make_dirs='/var/lib/ydotoold 0775 _ydotoold input'
+
+post_install() {
+	vinstall "${DESTDIR}/usr/bin/ydotool" 755 /usr/libexec
+	vbin "${FILESDIR}/ydotool-workaround" ydotool
+	vinstall "${DESTDIR}/usr/bin/ydotoold" 755 /usr/libexec
+	vbin "${FILESDIR}/ydotoold-workaround" ydotoold
+	vsv ydotoold
+	vinstall "${FILESDIR}/80-uinput.rules" 644 usr/lib/udev/rules.d
+	vinstall "${FILESDIR}/50-ydotool.conf" 644 usr/share/X11/xorg.conf.d
+	vlicense LICENSE
+	vman build/manpage/ydotool.1
+	vman build/manpage/ydotoold.8
+}

^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: [PR PATCH] [Updated] New package: ydotool-1.0.1
  2022-10-12 20:19 [PR PATCH] " JohnGebbie
@ 2022-10-12 22:13 ` JohnGebbie
  2022-10-15  9:18 ` JohnGebbie
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 37+ messages in thread
From: JohnGebbie @ 2022-10-12 22:13 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1229 bytes --]

There is an updated pull request by JohnGebbie against master on the void-packages repository

https://github.com/JohnGebbie/void-packages ydotool
https://github.com/void-linux/void-packages/pull/39920

New package: ydotool-1.0.1
#### Testing the changes
- I tested the changes in this PR: **YES**

#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)

I started with https://github.com/void-linux/void-packages/pull/31237

Closes https://github.com/void-linux/void-packages/issues/31163


Sorry this is a continuation of https://github.com/void-linux/void-packages/pull/38268. I did a bad push that automatically closed the pull request, and then a force push to fix it but github won't let me reopen it because I force pushed when it was closed :( I was just trying to add a log/run to the service and update the branch.

The package is ready. I use it to type (with my voice) so I've been using it a lot.

A patch file from https://github.com/void-linux/void-packages/pull/39920.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-ydotool-39920.patch --]
[-- Type: text/x-diff, Size: 13626 bytes --]

From d32c751e43dff4cee4038b3442a9905353a253c9 Mon Sep 17 00:00:00 2001
From: John Gebbie <me@johngebbie.com>
Date: Wed, 12 Oct 2022 20:50:01 +0100
Subject: [PATCH] New package: ydotool-1.0.1

---
 srcpkgs/ydotool/INSTALL.msg               |   6 +
 srcpkgs/ydotool/files/50-ydotool.conf     |   7 +
 srcpkgs/ydotool/files/80-uinput.rules     |   3 +
 srcpkgs/ydotool/files/ydotool-workaround  |   2 +
 srcpkgs/ydotool/files/ydotoold-workaround |   2 +
 srcpkgs/ydotool/files/ydotoold/log/run    |   2 +
 srcpkgs/ydotool/files/ydotoold/run        |   2 +
 srcpkgs/ydotool/patches/manpages.diff     | 255 ++++++++++++++++++++++
 srcpkgs/ydotool/template                  |  31 +++
 9 files changed, 310 insertions(+)
 create mode 100644 srcpkgs/ydotool/INSTALL.msg
 create mode 100644 srcpkgs/ydotool/files/50-ydotool.conf
 create mode 100644 srcpkgs/ydotool/files/80-uinput.rules
 create mode 100755 srcpkgs/ydotool/files/ydotool-workaround
 create mode 100755 srcpkgs/ydotool/files/ydotoold-workaround
 create mode 100755 srcpkgs/ydotool/files/ydotoold/log/run
 create mode 100755 srcpkgs/ydotool/files/ydotoold/run
 create mode 100644 srcpkgs/ydotool/patches/manpages.diff
 create mode 100644 srcpkgs/ydotool/template

diff --git a/srcpkgs/ydotool/INSTALL.msg b/srcpkgs/ydotool/INSTALL.msg
new file mode 100644
index 0000000000000..1812d29a7afc2
--- /dev/null
+++ b/srcpkgs/ydotool/INSTALL.msg
@@ -0,0 +1,6 @@
+udev rules for uinput has been installed,
+to access /dev/uinput, add yourself to group input:
+
+    $ sudo usermod -a -G input $USER
+
+and then re-login to make it effective.
diff --git a/srcpkgs/ydotool/files/50-ydotool.conf b/srcpkgs/ydotool/files/50-ydotool.conf
new file mode 100644
index 0000000000000..a799b618728bf
--- /dev/null
+++ b/srcpkgs/ydotool/files/50-ydotool.conf
@@ -0,0 +1,7 @@
+# https://github.com/ReimuNotMoe/ydotool/issues/158
+Section "InputClass"
+	Identifier "ydotoold virtual device"
+	MatchDriver "libinput"
+	Option "AccelProfile" "flat"
+	Option "AccelSpeed" "0"
+EndSection
diff --git a/srcpkgs/ydotool/files/80-uinput.rules b/srcpkgs/ydotool/files/80-uinput.rules
new file mode 100644
index 0000000000000..988d34547f52f
--- /dev/null
+++ b/srcpkgs/ydotool/files/80-uinput.rules
@@ -0,0 +1,3 @@
+## ydotoold fix
+## https://github.com/ReimuNotMoe/ydotool/issues/25#issuecomment-535842993
+KERNEL=="uinput", GROUP="input", MODE="0660", OPTIONS+="static_node=uinput"
diff --git a/srcpkgs/ydotool/files/ydotool-workaround b/srcpkgs/ydotool/files/ydotool-workaround
new file mode 100755
index 0000000000000..7264726a64337
--- /dev/null
+++ b/srcpkgs/ydotool/files/ydotool-workaround
@@ -0,0 +1,2 @@
+#!/bin/sh
+YDOTOOL_SOCKET="${YDOTOOL_SOCKET:-/var/lib/ydotoold/socket}" /usr/libexec/ydotool "$@"
diff --git a/srcpkgs/ydotool/files/ydotoold-workaround b/srcpkgs/ydotool/files/ydotoold-workaround
new file mode 100755
index 0000000000000..ae4558078719f
--- /dev/null
+++ b/srcpkgs/ydotool/files/ydotoold-workaround
@@ -0,0 +1,2 @@
+#!/bin/sh
+/usr/libexec/ydotoold -p /var/lib/ydotoold/socket -P 660
diff --git a/srcpkgs/ydotool/files/ydotoold/log/run b/srcpkgs/ydotool/files/ydotoold/log/run
new file mode 100755
index 0000000000000..14f2459503cc9
--- /dev/null
+++ b/srcpkgs/ydotool/files/ydotoold/log/run
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec logger -p daemon.info -t ydotoold
diff --git a/srcpkgs/ydotool/files/ydotoold/run b/srcpkgs/ydotool/files/ydotoold/run
new file mode 100755
index 0000000000000..430cefd9bcd94
--- /dev/null
+++ b/srcpkgs/ydotool/files/ydotoold/run
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec chpst -u _ydotoold:input ydotoold 2>&1
diff --git a/srcpkgs/ydotool/patches/manpages.diff b/srcpkgs/ydotool/patches/manpages.diff
new file mode 100644
index 0000000000000..8c4d0f86434d4
--- /dev/null
+++ b/srcpkgs/ydotool/patches/manpages.diff
@@ -0,0 +1,255 @@
+diff --git a/manpage/ydotool.1.scd b/manpage/ydotool.1.scd
+index b8f318c..4c01a38 100644
+--- a/manpage/ydotool.1.scd
++++ b/manpage/ydotool.1.scd
+@@ -1,20 +1,19 @@
+ YDOTOOL(1)
+-
+ # NAME
+ 
+ ydotool - command-line _/dev/uinput_ automation tool
+ 
+ # SYNOPSIS
+ 
+-*ydotool* *cmd* _args_ [ , *cmd* _args_ ... ]
++*ydotool* *cmd* _args_
+ 
+ *ydotool* *cmd* --help
+ 
+ # DESCRIPTION
+ 
+-*ydotool* lets you programmatically (or manually) simulate keyboard input and mouse activity, etc. It does this by writing directly to _/dev/uinput_ so it generally needs to run as root.
++*ydotool* lets you programmatically (or manually) simulate keyboard input and mouse activity, etc.
++The *ydotoold*(8) daemon must be running.
+ 
+-It's possible to chain multiple commands together, separated by a comma between two spaces.
+ 
+ Currently implemented command(s):
+ 
+@@ -26,67 +25,37 @@ Currently implemented command(s):
+ 	Move mouse pointer to absolute position
+ *click*
+ 	Click on mouse buttons
+-*recorder*
+-	Record/replay input events
+-*sleep*
+-	sleep for a while
+ 
+ # KEYBOARD COMMANDS
+-*key* [*--up*] [*--down*] [*--next-delay* _<ms>_] [*--key-delay* _<ms>_] [*--repeat* _<times>_] [*--repeat-delay <ms>*] _<key sequence>_
++*key* [*-d*,*--key-delay* _<ms>_] [_<KEYCODE:PRESSED>_ ...]
+ 
+-	Type a given keystroke. Examples being "alt+r", "ctrl+J",
+-	"ctrl+alt+n", "backspace".
++	Type a given keycode.
++	
++	e.g. 28:1 28:0 means pressing on the Enter button on a standard US keyboard.
+ 
+-	Options:
++	42:1 38:1 38:0 24:1 24:0 38:1 38:0 42:0 - "LOL"
+ 
+-	*--up*
+-		Only keyup
+-		
+-	*--down*
+-		Only keydown
++	Non-interpretable values, such as 0, aaa, l0l, will only cause a delay.
+ 
+-	*--delay* _<ms>_
+-		Delay before starting to output keystrokes. Default 100ms.
++	See `/usr/include/linux/input-event-codes.h' for available key codes (KEY_\*).
+ 
+-	*--key-delay* _<ms>_
++	Options:
++	*-d*,*--key-delay* _<ms>_
+ 		Delay time between keystrokes. Default 12ms.
+ 
+-	*--repeat* _<times>_
+-		Times to repeat the key sequence.
+-
+-	*--repeat-delay* _<ms>_
+-		Delay time between repetitions. Default 0ms.
+-
+-	Generally, any valid name from _/usr/include/linux/input-event-codes.h_ will work. Multiple keys are separated by '+'.
+-
+-	Each key sequence can be any number of modifiers and keys, separated by plus (+)
+-
+-	For example: alt+r Alt+F4 CTRL+alt+f3 aLT+1+2+3 ctrl+Backspace 
+-
+-	Since we are emulating keyboard input, combinations like Shift+# is invalid because typing a `#' involves pressing Shift and 3.
+-
+-	Example: Switch to tty1:
+-		ydotool key ctrl+alt+f1
+-
+-	Example: Close a window in graphical environment:
+-		ydotool key Alt+F4
+-
+-*type* [*--next-delay* _<ms>_] [*--key-delay* _<ms>_] [*--texts* _arg_] [*--file* _<filepath>_] "_texts_"
++*type* [*-D*,*--next-delay* _<ms>_] [*-d*,*--key-delay* _<ms>_] [*-f*,*--file* _<filepath>_] "_text_"
+ 
+ 	Types text as if you had typed it on the keyboard.
+ 
+ 	Options:
+ 
+-	*--next-delay* _<ms>_
+-		Delay before starting typing. Default 100ms.
+-
+-	*--key-delay* _<ms>_
+-		Delay time between keystrokes. Default 12ms.
++	*-d*,*--key-delay* _<ms>_
++		Delay time between key events (up/down each). Default 12ms.
+ 
+-	*--texts* _arg_
+-		Texts to type
++	*-D*,*--next-delay* _<ms>_
++		Delay between strings. Default 0ms.
+ 
+-	*--file* _<filepath>_
++	*-f*,*--file* _<filepath>_
+ 		Specify a file, the contents of which will be typed as if passed as an argument. The filepath may also be '-' to read from stdin.
+ 
+ 	Example: to type 'Hello world!' you would do:
+@@ -94,8 +63,8 @@ Currently implemented command(s):
+ 
+ # MOUSE COMMANDS
+ 
+-*mousemove* _<x> <y>_
+-	Move the mouse to the specific relative X and Y coordinates on the screen.
++*mousemove* [*-a*,*--absolute*] _<x> <y>_
++	Move the mouse to the relative X and Y coordinates on the screen.
+ 
+ 	Options:
+ 	*--absolute*
+@@ -104,61 +73,48 @@ Currently implemented command(s):
+ 	Example: to move the cursor to absolute coordinates (100,100):
+ 		ydotool mousemove --absolute 100 100
+ 
+-*click*  [*--next-delay* _<ms>_] _button_
+-	Send a click. Buttons are: _left_, _right_ or _middle_
++*click* [*-d*,*--next-delay* _<ms>_] [*-r*,*--repeat* _N_ ] [_button_ ...]
++	Send a click.
+ 
+ 	Options:
++	*-d*,*--next-delay* _<ms>_
++		Delay between input events (up/down, a compete click means doubled time). Default 25ms.
+ 
+-	*--next-delay* _<ms>_
+-		Delay before click. Default 100ms.
+-
+-	*--up*
+-		Only mouseup
+-
+-	*--down*
+-		Only mousedown
+-
+-	*--buttons* _<arg>_
+-		Buttons to press (left, right, middle)
+-
+-	Example: Mouse middle click:
+-		ydotool click middle
+-
+-*recorder* [*--record* _<devices>_] [*--replay* _<input files>_] [*--display*] [*--duration* _<ms>_] [*--devices* _<path>_] [*--file* _<path>_]
++	*-r*,*--repeat* _N_
++		Repeat entire sequence N times
+ 
+-	Options:
+-
+-	*--record* _<devices>_
+-		Devices to record from. Default is all, including non-keyboard devices.
++	all mouse buttons are represented using hexadecimal numeric values, with an optional
++	bit mask to specify if mouse up/down needs to be omitted.
+ 
+-	*--replay* _<input files>_
+-		The record file can't be replayed on an architecture with different endianness.
++	- 0x00 - LEFT
++	- 0x01 - RIGHT
++	- 0x02 - MIDDLE
++	- 0x03 - SIDE
++	- 0x04 - EXTR
++	- 0x05 - FORWARD
++	- 0x06 - BACK
++	- 0x07 - TASK
++	- 0x40 - Mouse down
++	- 0x80 - Mouse up
++    
++	Examples:
+ 
+-	*--display*
+-		Display
++	- 0x00: chooses left button, but does nothing (you can use this to implement extra sleeps)
++	- 0xC0: left button click (down then up)
++	- 0x41: right button down
++	- 0x82: middle button up
+ 
+-	*--duration* _<ms>_
+-		Record duration. Otherwise use SIGINT to stop recording.
++	The '0x' prefix can be omitted if you want.
+ 
+-	*--devices* _<path>_
+-		Devices, separated by comma, to record from. Default is all devices (default: "")
++# YDOTOOL SOCKET
+ 
+-	*--file* _<path>_
+-		File to record to / replay from
++The socket to write to for *ydotoold*(8) can be changed by the environment variable YDOTOOL_SOCKET.
+ 
+ # AUTHOR
+ 
+ ydotool was written by ReimuNotMoe.
+ 
+-This man page by bob.hepple@gmail.com
+-
+-# BUGS
+-
+-When *ydotool*(1) runs and creates a virtual input device, it will take some time for your graphical environment (eg X11/Wayland) to recognize and enable the virtual input device. (Usually done by udev)
+-
+-If the delay is too short, the virtual input device may not be recognized & enabled by the graphical environment in time.
+-
+-In order to solve this problem, there is a persistent background service, *ydotoold*(1), to hold a persistent virtual device, and accept input from *ydotool*(1). When *ydotoold*(1) is unavailable, *ydotool*(1) will work without it.
++This manpage was written by bob.hepple@gmail.com but updated since.
+ 
+ # LICENCE
+ AGPLv3
+diff --git a/manpage/ydotoold.8.scd b/manpage/ydotoold.8.scd
+index 8ed56ec..5c33cb4 100644
+--- a/manpage/ydotoold.8.scd
++++ b/manpage/ydotoold.8.scd
+@@ -10,29 +10,24 @@ ydotoold \- daemon for *ydotool*(1)
+ 
+ # DESCRIPTION
+ 
+-*ydotool* lets you programmatically (or manually) simulate
+-keyboard input and mouse activity, etc. It does this by writing
+-directly to */dev/uinput* so it generally needs to run as root.
+-
+-When *ydotool*(1) runs and creates a virtual input device, it will take some time for your graphical environment (eg X11/Wayland) to recognize and enable the virtual input device. (Usually done by udev)
+-
+-If the delay is too short, the virtual input device may not be recognized & enabled by the graphical environment in time.
+-
+-In order to solve this problem, the *ydotoold* background service holds a persistent virtual device, and accepts input from *ydotool*(1). When *ydotoold*(1) is unavailable, *ydotool*(1) will work without it.
++*ydotoold* holds a persistent virtual device, and accepts input from *ydotool*(1).
+ 
+ # OPTIONS
+ 
+-	*--socket-path arg*  _<path>_
+-		Socket path (default: /tmp/.ydotool_socket)
++	*-p*, *--socket-path arg* _<path>_
++		Set socket path.
++
++	*-P*, *--socket-perm arg* _<perms>_
++		Set socket permission.
+ 
+-	*--socket-perm arg* _<perms>_
+-		Socket permission (default: 0600)
++	*-h*, *--help*
++		Display help and exit.
+ 
+ # AUTHOR
+ 
+ *ydotool*(1) and *ydotoold*(8) were written by ReimuNotMoe.
+ 
+-This man page by bob.hepple@gmail.com
++This manpage was written by bob.hepple@gmail.com but updated since.
+ 
+ # LICENCE
+ 
diff --git a/srcpkgs/ydotool/template b/srcpkgs/ydotool/template
new file mode 100644
index 0000000000000..4973d0c5edaa0
--- /dev/null
+++ b/srcpkgs/ydotool/template
@@ -0,0 +1,31 @@
+# Template file for 'ydotool'
+pkgname=ydotool
+version=1.0.1
+revision=1
+build_style=cmake
+hostmakedepends="pkg-config scdoc"
+short_desc="Generic command-line automation tool, works on Wayland and X11"
+maintainer="John Gebbie <me@johngebbie.com>"
+license="AGPL-3.0-only"
+homepage="https://github.com/ReimuNotMoe/ydotool"
+distfiles="https://github.com/ReimuNotMoe/ydotool/archive/v${version}.tar.gz"
+checksum=02311cdc608f205711b06a95e5fd71093b2294f4920efc526f5e98a2ddab42b8
+
+system_accounts="_ydotoold"
+_ydotoold_groups="input"
+
+# Used instead of /tmp so any group input user can replace the socket.
+make_dirs='/var/lib/ydotoold 0775 _ydotoold input'
+
+post_install() {
+	vinstall "${DESTDIR}/usr/bin/ydotool" 755 /usr/libexec
+	vbin "${FILESDIR}/ydotool-workaround" ydotool
+	vinstall "${DESTDIR}/usr/bin/ydotoold" 755 /usr/libexec
+	vbin "${FILESDIR}/ydotoold-workaround" ydotoold
+	vsv ydotoold
+	vinstall "${FILESDIR}/80-uinput.rules" 644 usr/lib/udev/rules.d
+	vinstall "${FILESDIR}/50-ydotool.conf" 644 usr/share/X11/xorg.conf.d
+	vlicense LICENSE
+	vman build/manpage/ydotool.1
+	vman build/manpage/ydotoold.8
+}

^ permalink raw reply	[flat|nested] 37+ messages in thread

end of thread, other threads:[~2022-10-16 10:06 UTC | newest]

Thread overview: 37+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-25 12:49 [PR PATCH] New package: ydotool-1.0.1 JohnGebbie
2022-07-25 12:51 ` [PR PATCH] [Updated] " JohnGebbie
2022-07-25 15:14 ` JohnGebbie
2022-07-25 15:27 ` JohnGebbie
2022-08-03 15:23 ` [PR REVIEW] " classabbyamp
2022-08-04  2:35 ` RunningDroid
2022-08-07 20:34 ` [PR PATCH] [Updated] " JohnGebbie
2022-08-07 20:36 ` JohnGebbie
2022-08-07 20:38 ` [PR REVIEW] " JohnGebbie
2022-08-08 19:28 ` [PR PATCH] [Closed]: " JohnGebbie
2022-08-08 19:28 ` [PR PATCH] [Updated] " JohnGebbie
2022-08-08 19:44 ` JohnGebbie
2022-08-08 19:44 ` JohnGebbie
2022-08-08 21:33 ` JohnGebbie
2022-08-10  9:58 ` [PR PATCH] [Updated] " JohnGebbie
2022-08-10 10:00 ` JohnGebbie
2022-08-10 11:50 ` [PR PATCH] [Updated] " JohnGebbie
2022-08-10 12:54 ` JohnGebbie
2022-08-10 13:07 ` JohnGebbie
2022-08-10 13:19 ` JohnGebbie
2022-08-10 14:29 ` [PR PATCH] [Updated] " JohnGebbie
2022-08-10 14:33 ` JohnGebbie
2022-08-10 14:35 ` JohnGebbie
2022-08-10 14:52 ` JohnGebbie
2022-08-10 14:55 ` [PR PATCH] [Updated] " JohnGebbie
2022-08-17  9:13 ` JohnGebbie
2022-08-17  9:27 ` [PR PATCH] [Updated] " JohnGebbie
2022-08-17  9:37 ` JohnGebbie
2022-08-17  9:38 ` JohnGebbie
2022-08-17 14:52 ` JohnGebbie
2022-10-12 19:31 ` [PR PATCH] [Closed]: " JohnGebbie
2022-10-12 20:19 [PR PATCH] " JohnGebbie
2022-10-12 22:13 ` [PR PATCH] [Updated] " JohnGebbie
2022-10-15  9:18 ` JohnGebbie
2022-10-15 10:47 ` JohnGebbie
2022-10-15 11:10 ` JohnGebbie
2022-10-15 11:14 ` JohnGebbie
2022-10-16 10:06 ` JohnGebbie

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).