From 6378dd1a7661e815603a81f0d6a7ad7aa9e4ee94 Mon Sep 17 00:00:00 2001 From: John Gebbie 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/ydotool.1 | 285 ++++++++++++++++++++++ srcpkgs/ydotool/files/ydotoold-workaround | 2 + srcpkgs/ydotool/files/ydotoold.8 | 55 +++++ srcpkgs/ydotool/files/ydotoold/log/run | 2 + srcpkgs/ydotool/files/ydotoold/run | 2 + srcpkgs/ydotool/template | 32 +++ 10 files changed, 396 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/log/run 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 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/ydotool.1 b/srcpkgs/ydotool/files/ydotool.1 new file mode 100644 index 0000000000000..0c2e5528c479b --- /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\fR] [\fI\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\fR +.RS 4 +Delay time between keystrokes.\& Default 12ms.\& +.P +.RE +.RE +\fBtype\fR [\fB-D\fR,\fB--next-delay\fR \fI\fR] [\fB-d\fR,\fB--key-delay\fR \fI\fR] [\fB-f\fR,\fB--file\fR \fI\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\fR +.RS 4 +Delay time between key events (up/down each).\& Default 12ms.\& +.P +.RE +\fB-D\fR,\fB--next-delay\fR \fI\fR +.RS 4 +Delay between strings.\& Default 0ms.\& +.P +.RE +\fB-f\fR,\fB--file\fR \fI\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 \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\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\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: 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.8 b/srcpkgs/ydotool/files/ydotoold.8 new file mode 100644 index 0000000000000..a2f4b67af9e1c --- /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\fR +.RS 4 +Set socket path.\& +.P +.RE +\fB-P\fR, \fB--socket-perm arg\fR \fI\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: 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/template b/srcpkgs/ydotool/template new file mode 100644 index 0000000000000..c9e4850a6ac3e --- /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 " +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" +}