-
Notifications
You must be signed in to change notification settings - Fork 0
/
sideload-change-rate
executable file
·88 lines (54 loc) · 2.08 KB
/
sideload-change-rate
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
78
79
80
81
82
83
84
85
86
87
88
#!/bin/bash
source sideloader-config
while test $# -gt 0; do
case "$1" in
--askpackage)
ASKPACKAGE=1
shift
;;
--packagename*)
PACKAGENAME=`echo $1 | sed -e 's/^[^=]*=//g'`
shift
;;
--rate*)
RATE=`echo $1 | sed -e 's/^[^=]*=//g'`
shift
;;
*)
break
;;
esac
done
clearLog
deviceCheck
if [ $ASKPACKAGE ]; then
while [ -z $PACKAGENAME ] && [ -z $CI ]; do
PACKAGENAME=$(dialog --title "Packagename" --inputbox "Please enter a packagename:" 0 0 --output-fd 1)
done
fi
HZONE=FALSE
HZTWO=FALSE
if [ -z $PACKAGENAME ]; then
[ -z $CI ] && OLDRATE=$($ADB shell getprop debug.oculus.refreshRate)
[ -z $CI ] && [ "$OLDRATE" == "72" ] && ok "Current global refreshRate (setprop) detected as \"$OLDRATE\"" && HZONE=TRUE
[ -z $CI ] && [ "$OLDRATE" == "90" ] && ok "Current global refreshRate (setprop) detected as \"$OLDRATE\"" && HZTWO=TRUE
[ -z $CI ] && [ "$OLDRATE" == "" ] && ok "Current global refreshRate (setprop) not set"
fi
if [ ! -z $PACKAGENAME ]; then
[ -z $CI ] && [[ "$($ADB shell settings put global 90hz_$PACKAGENAME)" == 0 ]] && ok "$PACKAGENAME refreshRate (putglobal) detected as \"72\"" && HZONE=TRUE
[ -z $CI ] && [[ "$($ADB shell settings put global 90hz_$PACKAGENAME)" == 1 ]] && ok "$PACKAGENAME refreshRate (putglobal) detected as \"90\"" && HZTWO=TRUE
[ -z $CI ] && [[ "$($ADB shell settings put global 90hz_$PACKAGENAME)" == '' ]] && ok "$PACKAGENAME refreshRate (putglobal) not set"
fi
while [[ $RATE != "72" ]] && [[ $RATE != "90" ]] && [ -z $CI ]; do
RATE=$(dialog --menu "Please choose a refreshrate:" 0 0 0 72 "72 Hertz" 90 "90 Hertz" --output-fd 1)
done
if [ -z $PACKAGENAME ]; then
$ADB shell setprop debug.oculus.refreshRate "$RATE"
ok "Current global refreshRate (setprop) changed to \"$RATE\""
fi
if [ ! -z $PACKAGENAME ]; then
[[ $RATE == "72" ]] && $ADB shell settings put global 90hz_$PACKAGENAME 0
[[ $RATE == "90" ]] && $ADB shell settings put global 90hz_$PACKAGENAME 1
ok "$PACKAGENAME refreshRate (putglobal) changed to \"$RATE\""
fi
dialogLog