Return to repo list

wacout

Choose to use one out of multiple monitors for your Wacom tablet.
Return to HMagellan.com

commit bdde2e43f3a68837841b0a049854b0413c31bf0a
parent 8467154a8a3f4ea1f8866d81dfb80b84b51e8081
Author: Erik Letson <hmagellan@hmagellan.com>
Date:   Mon,  6 Jul 2020 12:06:28 -0500

first ver of script

Diffstat:
Awacout.sh | 36++++++++++++++++++++++++++++++++++++
1 file changed, 36 insertions(+), 0 deletions(-)

diff --git a/wacout.sh b/wacout.sh @@ -0,0 +1,36 @@ +#!/bin/bash + +LIST=$(xrandr | grep '\<connected' | cut --delimiter=" " -f1) +COUNT=0 +COUNT2=0 +SELECTION="" +COMPLETED=0 + +# TODO: This needs to be MUCH more general... +echo "Choose the display port: " +for i in $LIST; do + echo "$COUNT) $i" + COUNT=$((COUNT + 1)) +done + +read SELECTION + +for j in $(seq 0 $COUNT); do + if [[ $SELECTION -eq $j ]] + then + for k in $LIST; do + if [[ $SELECTION -eq $COUNT2 ]] + then + xsetwacom set "Wacom Bamboo Pen Pen stylus" MapToOutput $k + xsetwacom set "Wacom Bamboo Pen Pen eraser" MapToOutput $k + fi + COUNT2=$((COUNT2 + 1)) + done + COMPLETED=1 + fi +done + +if [[ $COMPLETED -eq 0 ]] +then + echo "$SELECTION not in list of options. Exiting..." +fi