Created
November 19, 2018 15:32
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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