Skip to content

Instantly share code, notes, and snippets.

@larsvilhuber
Created November 19, 2018 15:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save larsvilhuber/31cc0eed30a825a7915d3b9a89977547 to your computer and use it in GitHub Desktop.
Save larsvilhuber/31cc0eed30a825a7915d3b9a89977547 to your computer and use it in GitHub Desktop.
Re-adjust X11 and touch screen when using laptop and touch screen monitor
#!/bin/bash
# get Wacom IDS
[[ -z $1 ]] && undo= || undo=yes
WACOM_IDS=$(xinput --list | grep "Wacom" | awk -F= '{ print $2 } ' | awk ' { print $1 } ')
# get device
INTERNAL=LVDS1
for arg in $WACOM_IDS
do
xinput --map-to-output $arg $INTERNAL
done
[[ "$undo" = "yes" ]] && exit
# now the same for the Dell monitor
DELL_IDS=$(xinput --list | grep "CoolTouch" | awk -F= '{ print $2 } ' | awk ' { print $1 } ')
# get device
DELL=$(xrandr | grep "1920x1080" | awk '{ print $1 } ')
for arg in $DELL_IDS
do
xinput --map-to-output $arg $DELL
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment