-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathrotate.sh
More file actions
executable file
·77 lines (59 loc) · 1.84 KB
/
rotate.sh
File metadata and controls
executable file
·77 lines (59 loc) · 1.84 KB
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#!/bin/bash
#
# Author: Ramon Antonio Parada <ramon@bigpress.net>
#
#xrandr -o left
#xrandr -o right
#xrandr -o inverted
#xrandr -o normal
#xsetwacom set "TabletStylus" Rotate CW
#xsetwacom set "TabletStylus" Rotate HALF
#xsetwacom set "TabletStylus" Rotate CCW
#xsetwacom set "TabletStylus" Rotate NONE
#keycode 237 = XF86Launch0
#keycode 205 = XF86Launch1
#237 on DVD-näppäin ja 205 Quickplay.
#xmodmap ~/.Xmodmap
#Name Value
#run_command0_key XF86Launch0
#run_command1_key XF86Launch1
#Name Value
#command0
#command1 ~/rotation.sh
#Skripti toimii tällä versiossa 6.06 (Dapper Drake):
#rotation="$(xrandr -q | grep 'Current rotation' | cut -d' ' -f4)"
#Ja tällä versiossa 8.04 (Hardy Heron):
rotation="$(xrandr -q --verbose | sed -n '2 {p;q}' | cut -d' ' -f5)"
#xinput list con mode absolute
case "$rotation" in
normal)
xrandr -o right
xsetwacom set "TabletStylus" Rotate CW
xsetwacom set "TabletEraser" Rotate CW
xsetwacom set "TabletTouch" Rotate CW
;;
right)
xrandr -o inverted
xsetwacom set "TabletStylus" Rotate HALF
xsetwacom set "TabletEraser" Rotate HALF
xsetwacom set "TabletTouch" Rotate HALF
;;
inverted)
xrandr -o left
xsetwacom set "TabletStylus" Rotate CCW
xsetwacom set "TabletEraser" Rotate CCW
xsetwacom set "TabletTouch" Rotate CCW
;;
left)
xrandr -o normal
xsetwacom set "TabletStylus" Rotate NONE
xsetwacom set "TabletEraser" Rotate NONE
xsetwacom set "TabletTouch" Rotate NONE
;;
default)
xrandr -o right
xsetwacom set "TabletStylus" Rotate CW
xsetwacom set "TabletEraser" Rotate CW
xsetwacom set "TabletTouch" Rotate CW
;;
esac