ydotool icon indicating copy to clipboard operation
ydotool copied to clipboard

Technical question (for creating PPA & using for touchpad gestures)

Open swanux opened this issue 6 years ago • 20 comments

Hello, I'd like to make a PPA for Ubuntu/Debian based distros of your project. My question is, what this program uses from boost-libs? Because Debian based distros hasn't got a separate boost-libs package so I need to intall the complete libboost-all-dev to be sure that the required function is included, but it's over 500MB.

Thank you in advance, Daniel

swanux avatar Sep 24 '19 17:09 swanux

Only libboost-program-options-dev is needed.

ReimuNotMoe avatar Sep 25 '19 14:09 ReimuNotMoe

Thank you! Another question. I've built the program but it says:

ydotool: error while loading shared libraries: libydotool.so: cannot open shared object file: No such file or directory

The commands were: mkdir build && cd build && cmake .. && make && sudo make install It installs everything to /usr/local/ instead of /usr/ (on Arch it places everything inside /usr/).

I've tried a workaround (placed everything inside /usr/ like on Arch), and the error disappeard. However it produces the following output:

ydotool: library search path: /usr/local/lib/ydotool:/usr/lib/ydotool:/usr/lib/x86_64-linux-gnu/ydotool:/usr/lib/i386-linux-gnu/ydotool

ydotool: notice: ydotoold backend unavailable, using direct method (has latency+delay issues!) terminate called after throwing an instance of 'std::runtime_error' what(): failed to open uinput device Aborted (core dumped)

swanux avatar Sep 26 '19 13:09 swanux

Checkout https://github.com/ReimuNotMoe/ydotool/issues/24

ClassicOldSong avatar Sep 27 '19 04:09 ClassicOldSong

As I mentioned the workaround worked, but produced another error. Same with symlinks.

ydotool: library search path: /usr/local/lib/ydotool:/usr/lib/ydotool:/usr/lib/x86_64-linux-gnu/ydotool:/usr/lib/i386-linux-gnu/ydotool

ydotool: notice: ydotoold backend unavailable, using direct method (has latency+delay issues!) terminate called after throwing an instance of 'std::runtime_error' what(): failed to open uinput device Aborted

swanux avatar Sep 27 '19 05:09 swanux

First of all, thanks to author for this great automation tool.

ydotool: library search path: /usr/local/lib/ydotool:/usr/lib/ydotool:/usr/lib/x86_64-linux-gnu/ydotool:/usr/lib/i386-linux-gnu/ydotool ydotool: notice: ydotoold backend unavailable, using direct method (has latency+delay issues!) terminate called after throwing an instance of 'std::runtime_error' what(): failed to open uinput device Aborted

I am on Fedora 29 and do this commands:

sudo usermod -a -G users $USER echo "KERNEL==\"uinput\", GROUP=\"users\", MODE=\"0660\", OPTIONS+=\"static_node=uinput\"" | sudo tee /etc/udev/rules.d/80-uinput.rules > /dev/null

Reboot

Check:

ls -l /dev/uinput

Should output smth like:

crw-rw----. 1 root users 10, 223 Sep 27 11:23 /dev/uinput'

gapeevanton avatar Sep 27 '19 08:09 gapeevanton

As I mentioned the workaround worked, but produced another error. Same with symlinks.

ydotool: library search path: /usr/local/lib/ydotool:/usr/lib/ydotool:/usr/lib/x86_64-linux-gnu/ydotool:/usr/lib/i386-linux-gnu/ydotool ydotool: notice: ydotoold backend unavailable, using direct method (has latency+delay issues!) terminate called after throwing an instance of 'std::runtime_error' what(): failed to open uinput device Aborted

O wait, did you run ydotool with root permission? For it'll create a fake input device, it needs root in order to work.

ClassicOldSong avatar Sep 27 '19 09:09 ClassicOldSong

First of all, thanks to author for this great automation tool.

ydotool: library search path: /usr/local/lib/ydotool:/usr/lib/ydotool:/usr/lib/x86_64-linux-gnu/ydotool:/usr/lib/i386-linux-gnu/ydotool ydotool: notice: ydotoold backend unavailable, using direct method (has latency+delay issues!) terminate called after throwing an instance of 'std::runtime_error' what(): failed to open uinput device Aborted

I am on Fedora 29 and do this commands:

sudo usermod -a -G users $USER echo "KERNEL==\"uinput\", GROUP=\"users\", MODE=\"0660\", OPTIONS+=\"static_node=uinput\"" | sudo tee /etc/udev/rules.d/80-uinput.rules > /dev/null

Reboot

Check:

ls -l /dev/uinput

Should output smth like:

crw-rw----. 1 root users 10, 223 Sep 27 11:23 /dev/uinput'

This could be less secure if you do so for any application may able to type anything from the uinput device using your username/group.

ClassicOldSong avatar Sep 27 '19 09:09 ClassicOldSong

Thank you @gapeevanton ! Now it works. There is still error in the output but it works without problems.

ydotool: library search path: /usr/local/lib/ydotool:/usr/lib/ydotool:/usr/lib/x86_64-linux-gnu/ydotool:/usr/lib/i386-linux-gnu/ydotool

ydotool: notice: ydotoold backend unavailable, using direct method (has latency+delay issues!) ydotool: debug: tool `key' constructed at 0x562efbb14460 argc = 3 argv[1] = send argv[2] = Ctrl+Alt+Right

Regarding security, I agree with you @ClassicOldSong . The problem is that I'd like to use this for some touchpad gestures so I won't be able to run everytime as root. Any idea for that?

swanux avatar Sep 27 '19 11:09 swanux

And what is ydotool backend which is unavailable? Because I can see that it really affects the speed of the tool.

swanux avatar Sep 28 '19 19:09 swanux

And what is ydotool backend which is unavailable? Because I can see that it really affects the speed of the tool.

See https://github.com/ReimuNotMoe/ydotool/issues/5

ReimuNotMoe avatar Oct 01 '19 13:10 ReimuNotMoe

This project is really lack of some docs and I feel very sorry for that. I'll work on these when I squeezed more time.

ReimuNotMoe avatar Oct 01 '19 13:10 ReimuNotMoe

Ah, ok, I see now. I could have thought of it. And regarding the permissions problem have you got any idea? (for touchpad gestures)

swanux avatar Oct 02 '19 06:10 swanux

Here's a .deb file @ReimuNotMoe that you can test, and tell me if I can upload it. It doesn't contain that modification with permissions because of the security. https://file.io/rfddYw

swanux avatar Oct 10 '19 13:10 swanux

Here's a .deb file @ReimuNotMoe that you can test, and tell me if I can upload it. It doesn't contain that modification with permissions because of the security. https://file.io/rfddYw

link 404 not found

ClassicOldSong avatar Oct 10 '19 18:10 ClassicOldSong

File.io... Sometimes it's just nonsense how it behaves.. Here's another link. Hopefully it'll work as expected. https://mega.nz/#!pSBTjKCD!75lCCcLbnriKg-ZIoE2PJi7o7kSKdh0leuWTvqQRIXQ Tell me whether it works or not.

swanux avatar Oct 10 '19 19:10 swanux

File.io... Sometimes it's just nonsense how it behaves.. Here's another link. Hopefully it'll work as expected. https://mega.nz/#!pSBTjKCD!75lCCcLbnriKg-ZIoE2PJi7o7kSKdh0leuWTvqQRIXQ Tell me whether it works or not.

Sorry for the delay.

AFAIK, the architecture should be 'amd64' instead of 'all'...

Personally I would like to just use Gitlab CI for debian-ish packages.

What the users want is simply running apt-add-repository from terminal, and get the software installed. However, this requires a PPA, and creating a PPA is really a pain.

Thank you very much anyway.

ReimuNotMoe avatar Oct 27 '19 03:10 ReimuNotMoe

I've never heard about gitlab ci before so I've googled it. It's really amazing! It's much more comfortable than building everything manually (I also use build tools, but just some basic self written stuff).

Regarding the PPA, it's really simple with launchpad. You can easily manage it with nearly zero in-terminal stuff. Or if you would like to have your own apt repo, you can do that also simply with github.

swanux avatar Oct 27 '19 11:10 swanux

I've created a controller for ydotool, that simply transfers commands to ydotool, launching it as root. https://github.com/pavel-the-best/ydotool-controller. Usage: launch daemon (ydotool_controllerd) as root, use client (ydotool_controller) with arguments that should be passed to ydotool.

p4vook avatar Nov 13 '20 05:11 p4vook

For those who would like to have the latest version of ydotool on Ubuntu.

Tested under Impish (21.10) and Jammy (22.04).

# Handle the dependencies.
sudo apt install -y build-essential cmake git libboost-program-options-dev scdoc

# Handle the installation.
current="$(dirname "$(readlink -f "${0}")")" && git clone https://github.com/ReimuNotMoe/ydotool.git
cd ydotool && mkdir build && cd build && cmake .. && make && sudo make install
cd "${current}" && source "{HOME}/.bashrc" && rm -rf ydotool

sharpordie avatar Jan 22 '22 13:01 sharpordie

"sudo apt install -y build-essential cmake git libboost-program-options-dev scdoc"

I suggest putting this in the readme. Make was failing and I almost quit installing this tool. Likewise there's no mention of the usage of the ydotoold daemon.

tomeeeS avatar Jul 16 '22 13:07 tomeeeS