Closed lmr97 closed 2 months ago
Update: after installing the libxdo-dev
library, I was able to build the utility from the source.
The problem, however, persists, with identical errors.
libinput-three-finger-drag[10748]: Error: Can't open display: (null)
Maybe because it starts too early, even before X. Can you try KDE auto start?
Okay, I think I got it. I did add the executable to KDE's autostart, and it's no longer raising any errors. That must've been it! I'm also running it as a user-level daemon (not root-level), so that may have helped as well.
libxdo-dev
is installed before building).~/.config/systemd/user
, if one doesn't already exist.three-finger-drag.service
(or whatever you please), and paste the following text into it (substituting the path to the executable for /your/path/to/three-finger-drag-executable
, of course), then save:
[Unit]
Description=Three Finger Drag daemon
DefaultDependencies=no
Before=shutdown.target
[Service] ExecStart=/your/path/to/three-finger-drag-executable Type=simple Restart=on-failure RestartSec=1
[Install] WantedBy=shutdown.target
5. Go into your System Settings application (GUI), then Startup & Shutdown > Autostart, and add your executable to the list of applications (you'll probably have to add it by its path).
6. Run the following in the terminal:
systemctl --user enable three-finger-drag.service systemctl --user start three-finger-drag.service
7. You should be able to use three-finger dragging on your trackpad now!
This is probably only one solution to this problem; I'm not sure everything in the `three-finger-drag.service` file is necessary for it to run properly, but I can say that **`Type=simple` is essential**: this allows the OS to consider the service started as soon as the process forks. Some other options for this line (like `exec`) require `main()` to exit before considering the service started. Since this executable runs continuously, an option like that would not be ideal.
Thanks for the great program, and your help!
I have since learned that the systemd service file is redundant for the executable to run in the background; you only need to add it to the KDE Autostart list.
I wanted to have this highly useful utility available as a daemon, but I'm running into trouble. The executable runs beautifully when run from the command line, but fails to launch when run as a systemd service. I was unable to build the project from the source code (due to local linker issues), so the copy I have is simply the pre-built executable.
Error log
This error log is the one generated by running
journalctl -xeu three-finger-drag.service
:My service file
Setup:
rustc
1.80.1rustup
home:/home/$USER/.rustup
From what I was able to find online, the first error implies a lack of access to the the windows it needs. Should I be executing the command from in a different working directory, or after a different target?
I am new to Linux, so maybe this is a simple fix; if so, I apologize for wasting your time.
Thanks!