summaryrefslogtreecommitdiff
path: root/presenterctl.sh
blob: 3e3e75075f79619fe6c46d27fa52eb0f4555b0b3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/sh

[[ "x$1" = "xremove" ]] && exec sh -c 'xinput remove-master "remote pointer"'

xinput remove-master "remote pointer" &> /dev/null
xinput create-master remote
$(dirname $0 )/repeat-xi2 `xinput --list --id-only "remote keyboard"` 500 8

for id in `xinput --list --id-only | sed "s/[^0-9]*//g"`
do
	name=`xinput --list-props "$id" | sed -n "1s/.*'\([^']*\)'.*/\\1/p"`
	[[ "x$name" != "xLogitech USB Receiver" ]] && continue;

	xinput reattach "$id" "remote pointer"
done

echo -n "Attach 'TPPS/2 IBM TrackPoint' to 'remote pointer'? (Y/n): "
read attach
[[ "x$attach" = "xn" ]] && exit

xinput reattach "TPPS/2 IBM TrackPoint" "remote pointer"
echo -n "Type enter to attach back to core pointer."
read
xinput reattach "TPPS/2 IBM TrackPoint" "Virtual core pointer"