Use correct xinput flag and fix quoting issue

This commit is contained in:
David Thurstenson 2017-02-16 09:33:10 -06:00
parent 5a43d3eba2
commit cbdaf1bfbd
1 changed files with 6 additions and 6 deletions

View File

@ -2,9 +2,9 @@
maptouchscreen() { maptouchscreen() {
# maptouchscreen <name> <output> # maptouchscreen <name> <output>
# <name> should be a full name from the output of `xinput list` local name="$1" # <name> should be a full name from the output of `xinput list`
# <output> should be an xrandr output name local output="$2" # <output> should be an xrandr output name
xinput --map-to-output $(xinput list --idonly "$1") $2 xinput --map-to-output $(xinput list --id-only "$name") "$output"
} }
setpasink() { setpasink() {
@ -21,12 +21,12 @@ case "$(hostname)" in
case "$SRANDRD_ACTION" in case "$SRANDRD_ACTION" in
"$hdmi connected") xrandr --output $hdmi --auto --right-of $mainoutput "$hdmi connected") xrandr --output $hdmi --auto --right-of $mainoutput
maptouchscreen $tsid $mainoutput maptouchscreen "$tsid" "$mainoutput"
setpasink hdmi setpasink hdmi
;; ;;
"$hdmi disconnected") xrandr --output $hdmi --off --output $mainoutput --auto "$hdmi disconnected") xrandr --output $hdmi --off --output $mainoutput --auto
maptouchscreen $tsid $mainoutput maptouchscreen "$tsid" "$mainoutput"
setpasink analog setpasink analog
;; ;;
esac esac
@ -38,7 +38,7 @@ case "$(hostname)" in
hdmi="HDMI1" hdmi="HDMI1"
xrandr --output $mainoutput --auto --output $hdmi --right-of $mainoutput xrandr --output $mainoutput --auto --output $hdmi --right-of $mainoutput
maptouchscreen $tsid $mainoutput maptouchscreen "$tsid" "$mainoutput"
;; ;;
esac esac