aboutsummaryrefslogtreecommitdiff
path: root/.local/share/bin/wacommode
blob: 3e8ff8a590ad435586d6872f56d90e2294eba79f (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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/bin/sh

defaults () {
	# smoothing
	setwacom Suppress 2
	setwacom RawSample 5
	
	# full pen area
	setwacom Area 0 0 15200 9500

	setwacom Rotate none
}

SCREEN_1_GEOMETRY="$(xrandr -q | awk '$2 == "connected" && $3 == "primary" { print $4 }')"
SCREEN_2_GEOMETRY="$(xrandr -q | awk '$2 == "connected" && $3 != "primary" { print $3 }')"
ALL_GEOMETRY="$(xrandr -q | awk '$1 == "Screen" { print ; exit }' | grep -o '\<current\>[^,]\+' | sed -e 's/^current//' -e 's/ //g' -e 's/$/+0+0/')"

topleft() {
	notify-send "screen 1 only (landscape)"

	setwacom MapToOutput "$SCREEN_1_GEOMETRY"
}

bottomleft() {
	notify-send "screen 2 only (portrait)"

	setwacom Rotate ccw
	setwacom MapToOutput "$SCREEN_2_GEOMETRY"
}

topright() {
	notify-send "screen 1 only [osu] (landscape)"

	setwacom Suppress 0
	setwacom RawSample 1

	setwacom Area 0 1623 7600 5898
	setwacom MapToOutput "$SCREEN_1_GEOMETRY"
}

bottomright() {
	notify-send "both screens (landscape)"

	setwacom Area 0 0 11875 7600
	setwacom MapToOutput "$ALL_GEOMETRY"
}

defaults
$1