How to run ydotoold at start up

Hello,

I have the following command that I would like to run at start up automatically without having to enter any passwords. This is for ydotool, and I have read their page and the suggestions did not work for me. Any ideas?

sudo -b ydotoold --socket-path=“$HOME/.ydotool_socket” --socket-own=“$(id -u):$(id -g)”

Copy-paste the entire block of code to the terminal:
Ydotool not working on Fedora 40? - #4 by vgaetera

Thanks for the reply.

I just tried this and rebooted, but unfortunately the daemon still did not run at start up.

Any ideas?

lee@leenux:~$ systemctl status ydotool.service
● ydotool.service - Starts ydotoold service
Loaded: loaded (/usr/lib/systemd/system/ydotool.service; enabled; preset: >
Drop-In: /usr/lib/systemd/system/service.d
└─10-timeout-abort.conf
/etc/systemd/system/ydotool.service.d
└─override.conf
Active: active (running) since Mon 2024-10-21 09:44:12 EEST; 4h 13min ago
Main PID: 1190 (ydotoold)
Tasks: 1 (limit: 18864)
Memory: 200.0K (peak: 764.0K)
CPU: 8ms
CGroup: /system.slice/ydotool.service
└─1190 ydotoold -P 660

Oct 21 09:44:12 leenux systemd[1]: Started ydotool.service - Starts ydotoold se>
lines 1-15/15 (END)

1 Like

This is the output (after I put the sudo -b ydotoold --socket-path=“$HOME/.ydotool_socket” --socket-own=“$(id -u):$(id -g)” command).

lee@leenux:~$ ls -l -Z /tmp/.ydotool_socket; echo ${YDOTOOL_SOCKET}; groups
srw-rw----. 1 root input system_u:object_r:tmp_t:s0 0 Oct 21 15:33 /tmp/.ydotool_socket
/home/lee/.ydotool_socket
lee wheel input

1 Like

It outputs the following:

lee@leenux:~$ ydotool key 42:1 38:1 38:0 24:1 24:0 38:1 38:0 42:0
LOLlee@leenux:~$ LOL

Ydotool works in general. I just want to not have to enter the command from my first post at every startup in order for it to work.

How can I change it? Will this make it autorun at start up?

lee@leenux:~$ grep -r -e YDOTOOL_SOCKET /etc/profile* ~/.bash*; echo ${SHELL}
/etc/profile.d/ydotool.sh:export YDOTOOL_SOCKET=“/tmp/.ydotool_socket”
/home/lee/.bash_history:YDOTOOL_SOCKET=“$HOME/.ydotool_socket” ydotool key 125:1 32:1 32:0 125:0; sleep 2; YDOTOOL_SOCKET=“$HOME/.ydotool_socket” ydotool key 125:1 32:1 32:0 125:0
/home/lee/.bash_history:YDOTOOL_SOCKET=“$HOME/.ydotool_socket” ydotool key 125:1 32:1 32:0 125:0
/home/lee/.bash_history:YDOTOOL_SOCKET=“$HOME/.ydotool_socket” ydotool key 20
/home/lee/.bash_history:YDOTOOL_SOCKET=“$HOME/.ydotool_socket” ydotool key 125:1 32:1 32:0 125:0
/home/lee/.bash_history:YDOTOOL_SOCKET=“$HOME/.ydotool_socket” ydotool key 125:1 32:1 32:0 125:0
/home/lee/.bash_history:YDOTOOL_SOCKET=“$HOME/.ydotool_socket” ydotool key --key-delay 0 --key 14
/home/lee/.bash_history:YDOTOOL_SOCKET=“$HOME/.ydotool_socket” ydotool key 42:1 38:1 38:0 24:1 24:0 38:1 38:0 42:0
/home/lee/.bash_history:YDOTOOL_SOCKET=“$HOME/.ydotool_socket” ydotool key 125:1 32:1 32:0 125:0;
/home/lee/.bash_history:YDOTOOL_SOCKET=“$HOME/.ydotool_socket” ydotool key 125:1 32:1 32:0 125:0; sleep 2; YDOTOOL_SOCKET=“$HOME/.ydotool_socket” ydotool key 125:1 32:1 32:0 125:0
/home/lee/.bash_history:YDOTOOL_SOCKET=“$HOME/.ydotool_socket” ydotool key 14:1 14:0
/home/lee/.bash_history:YDOTOOL_SOCKET=“$HOME/.ydotool_socket” ydotool key 125:1 56:1 106:1 106:0 56:0 125:0
/home/lee/.bash_history:YDOTOOL_SOCKET=“$HOME/.ydotool_socket” ydotool key 125:1 102:1 102:0 125:0
/home/lee/.bash_history:YDOTOOL_SOCKET=“$HOME/.ydotool_socket” ydotool key 125:1 102:1 102:0 125:0
/home/lee/.bash_history:export YDOTOOL_SOCKET=“/tmp/.ydotool_socket”
/home/lee/.bash_history:export YDOTOOL_SOCKET=“/tmp/.ydotool_socket”
/home/lee/.bash_history:YDOTOOL_SOCKET=“$HOME/.ydotool_socket” ydotool key 125:1 56:1 106:1 106:0 56:0 125:0
/home/lee/.bash_history:ls -l -Z /tmp/.ydotool_socket; echo ${YDOTOOL_SOCKET}; groups
/home/lee/.bashrc:export YDOTOOL_SOCKET=“$HOME/.ydotool_socket”
/bin/bash

How can I use the correct socket path?

1 Like

This should fix the path to the socket:

sed -i -e '/YDOTOOL_SOCKET/d' ~/.bashrc

Thank you very much, this worked!

1 Like