It runs flawlessly as a service. After moving evdev-rce to /usr/local/sbin I created a evdev-rce.service file in /etc/systemd/system like this:
[Unit]
Description=Event Device Right Click Emulation
[Service]
ExecStart=/usr/local/sbin/evdev-rce
[Install]
WantedBy=multi-user.target
I had to do it because the program needed sudo to work.
I tested it with sudo systemctl start evdev-rce.service and noticed that long-press was also acting like a right click for the touchpad. I didn't want that, I only wanted it for the touchscreen so I stopped the service and added the environmental variable using:
sudo systemctl edit evdev-rce
and in the /etc/systemd/system/evdev-rce.service.d/override.conf created I added:
#!/bin/bash
tmp_dir=$(mktemp -d)
pushd $tmp_dir > /dev/null
# Export whole database
udevadm info --export-db > udevdb.txt
csplit -s udevdb.txt /^$/ {*}
FILES=./xx*
for f in $FILES
do
if [[ ! -z $(grep ID_INPUT_TOUCHSCREEN=1 $f) ]] && [[ ! -z $(grep " NAME=*" $f) ]];
then
# Extract touchscreen name
grep " NAME=*" $f | cut -d "=" -f 2
fi
done
popd > /dev/null
rm -rf $tmp_dir
Big thanks to artsin and Pablo Bianchi. The result gave me:
"CUST0000:00 04F3:2A12"
The first part, CUST0000:00 I didn't need. I used only the actual identifier, 04F3:2A12. This of course will be different for another machine. Then I tested again, and seeing it worked as I needed I installed it to run at startup with
sudo systemctl enable evdev-rce.service
It works flawlessly. This utility is a life-saver.
This may help someone.
It runs flawlessly as a service. After moving
evdev-rce
to /usr/local/sbin I created aevdev-rce.service
file in /etc/systemd/system like this:I had to do it because the program needed
sudo
to work.I tested it with
sudo systemctl start evdev-rce.service
and noticed that long-press was also acting like a right click for the touchpad. I didn't want that, I only wanted it for the touchscreen so I stopped the service and added the environmental variable using:sudo systemctl edit evdev-rce
and in the /etc/systemd/system/evdev-rce.service.d/override.conf created I added:
To find the right ID to use for my device I ran this script found here: https://askubuntu.com/questions/520359/how-to-detect-touchscreen-devices-from-a-script
Big thanks to artsin and Pablo Bianchi. The result gave me:
"CUST0000:00 04F3:2A12"
The first part, CUST0000:00 I didn't need. I used only the actual identifier, 04F3:2A12. This of course will be different for another machine. Then I tested again, and seeing it worked as I needed I installed it to run at startup with
sudo systemctl enable evdev-rce.service
It works flawlessly. This utility is a life-saver.