Skip to content

Instantly share code, notes, and snippets.

@itskenny0
Created September 22, 2021 11:18
Show Gist options
  • Save itskenny0/24a4ca24dce6c03a10c32db9c75423e7 to your computer and use it in GitHub Desktop.
Save itskenny0/24a4ca24dce6c03a10c32db9c75423e7 to your computer and use it in GitHub Desktop.
assign touchscreen to monitor in linux

You need to replace DP-1 with your display name from xrandr, and "MTouch" with a string that shows up in your touch screen's name when executing "xinput".

#!/bin/bash
IDS=$(xinput | grep MTouch | grep -oP 'id=[0-9]{2}' | sed 's/id=//g')
for i in $IDS; do
xinput map-to-output $i DP-1
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment