Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add ydotool to the dx image #1426

Merged
merged 2 commits into from
Jun 23, 2024
Merged

Conversation

dylanmtaylor
Copy link
Contributor

@dylanmtaylor dylanmtaylor commented Jun 23, 2024

With ydotool, users can script and automate inputs for mouse and keyboard in a way that works on Wayland.

https://github.com/ReimuNotMoe/ydotool

With ydotool, users can script and automate inputs for mouse and keyboard in a way that works on Wayland.
@castrojo
Copy link
Member

This is pretty great, can you whip up quick instructions for the forum? Enabling one service is fine and probably not work doing a ujust for.

@dylanmtaylor
Copy link
Contributor Author

This is pretty great, can you whip up quick instructions for the forum? Enabling one service is fine and probably not work doing a ujust for.

I'm going to admit to something - I have it working and have tested it, but the way I did so is not 100% ideal.

https://koji.fedoraproject.org/koji/buildinfo?buildID=2391183 says to run

- systemctl enable ydotool
- systemctl start ydotool

(This can be simplified to one command - sudo systemctl enable ydotool --now).

This was not sufficient for me as it ran as root and created a file at /tmp/.ydotool_socket owned by root. To make ydotool work without using sudo in front of it, I did this:

export YDOTOOL_SOCKET=/tmp/.ydotool_socket # You can put this in your profile files
sudo chmod 666 /tmp/.ydotool_socket

I know the latter command is not great for security.

Someone at https://discussion.fedoraproject.org/t/ydotool-not-working-on-fedora-40/114333/4 had a better suggestion:

sudo dnf install ydotool
sudo tee /etc/profile.d/ydotool.sh << "EOF" > /dev/null
export YDOTOOL_SOCKET="/tmp/.ydotool_socket"
EOF
sudo mkdir -p /etc/systemd/system/ydotool.service.d
sudo tee /etc/systemd/system/ydotool.service.d/override.conf << EOF > /dev/null
[Service]
Group=input
ExecStart=
ExecStart=ydotoold -P 660
EOF
sudo systemctl daemon-reload
sudo systemctl enable ydotool.service
sudo systemctl restart ydotool.service
sudo usermod -a -G input ${USER}

If I want to recommend a solution to people other than myself, I'd want it to be more secure. The above is probably WAY better, and can be a ujust action.

@dylanmtaylor
Copy link
Contributor Author

To test this, here's a valid example:

ydotool type -D 1000 -d 50 'Universal blue is awesome!'

@m2Giles
Copy link
Member

m2Giles commented Jun 23, 2024

In this case I think a ujust command makes more sense.

I'm unsure if the command accepts UID and GID for that socket creation.

A ujust command would make it possible to setup the overrides appropriately.

@dylanmtaylor
Copy link
Contributor Author

In this case I think a ujust command makes more sense.

I'm unsure if the command accepts UID and GID for that socket creation.

A ujust command would make it possible to setup the overrides appropriately.

I agree with this. I'm not familiar with ujust, but will give it a shot. Can we merge this? I'll start work on the ujust in a separate PR.

@dylanmtaylor
Copy link
Contributor Author

Looks like asus kernel builds were pulled for 39. Maybe we need to add an override to not build those

https://download.copr.fedorainfracloud.org/results/lukenukem/asus-kernel/fedora-39-x86_64/repodata/repomd.xml

@castrojo castrojo merged commit b5eeaaf into ublue-os:main Jun 23, 2024
19 of 52 checks passed
@dylanmtaylor dylanmtaylor deleted the patch-5 branch June 23, 2024 21:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants