# Plug monitor
lsusb > 1_input.txt
# Unplug monitor
lsusb > 2_input.txt
diff 1_input.txt 2_input.txt # Get USB entry
# Bus 003 Device 048: ID 27c0:0859 Cadwell Laboratories, Inc. TouchScreen
######################
cat $HOME/.config/monitors.xml > 1_monitor.txt
# Switch monitor resolution
cat $HOME/.config/monitors.xml > 2_monitor.txt
# Find <monitorspec> in diff between 1_monitor.txt and 2_monitor.txt
# <monitorspec>
# <connector>DP-3</connector>
# <vendor>RTK</vendor>
# <product>ANMITE</product>
# <serial> </serial>
# </monitorspec>
############################################
gsettings set org.gnome.desktop.peripherals.touchscreen:/org/gnome/desktop/peripherals/touchscreens/27c0:0859/ output "['RTK', 'ANMITE', ' ']"
# Extra bits:
# For detecting which event is the touchscreen connected to.
# Prb can be automated to get usb device id somehow - I didn't investigate further, lsusb was sufficient for me.
sudo apt install libinput-tools
sudo libinput record
References: