-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathacm.sh
151 lines (132 loc) · 2.8 KB
/
acm.sh
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
#Adreno Catalyst Manager by Pizza_Dox
#info
#this script is designed to be that interface between
#your graphics cards performance and quality slider.
# thanks to tldp.org for loop stuffs, hoholee12 for misc code, spizzy & cosmicdan for egl.
#vars
verbose=1
mainver=0.1
waiter=60 #60 = min
if [ "$verbose" == 1 ]; then
waiter=5
fi
head(){
echo -e '\e[1;31m[-=ADRENO CATALYST MANAGER=-]\e[0m'
echo
}
body(){
echo "OPTIONS:"
echo "[1] Resolution Control"
echo "[2] EGL Profiling"
echo "[3] Catalyst Control"
echo -n "> "
read body_opt
case $body_opt in
1 ) clear && res_control;;
2 ) clear && egl_control;;
3 ) clear && catalyst_control;;
* ) echo "?";;
esac
}
main(){
clear
sleep 1;
head #call title
sleep 3;
body #call body
}
function res_control(){ #done
echo "Available Resoultions:"
echo "[1] 720x1280"
echo "[2] 540x960"
echo "[C] Custom"
echo "[M] Exit to main menu"
echo -n "> "
read res_opt
case $res_opt in
1 ) clear && wm size 720x1280 && wm density 320 && res_control;;
2 ) clear && wm size 540x960 && wm density 256 && res_control;;
C ) clear && res_custom(){
echo "Please enter your resolution:"
echo "ex: 720x1280"
echo -n "> "
read res_custom_in
echo "Please enter your display density:"
echo "ex: 320"
echo -n "> "
read density_custom_in
#apply
wm size $res_custom_in
sleep 1; #adjustment wait
wm density $density_custom_in
} && res_custom;; #call res_custom() after creating
* ) clear && echo "?";;
M ) clear && body;;
esac
}
egl_control(){
echo "WIP!"
}
catalyst_control(){
echo "(|CATALYST CONTROL|)"
echo "[1] Inject Catalyst"
echo "[2] Control Catalyst Injection Rate"
echo "[M] Exit to main menu"
echo -n "> "
read catalyst_control_opt
case $catalyst_control_opt in
1 ) clear && catalyst_inject;;
2 ) clear && catalyst_time_cfg;;
M ) clear && body;;
* ) clear && echo "?";;
esac
}
catalyst_inject(){
echo "Please leave the terminal emulator running"
echo "This will continue to run untill you press X or Close"
if [ "$verbose" == 1 ]; then
echo
echo "log:"
fi
sleep 3;
#clear
(
while [ 1 ]
do
sleep $waiter;
sync; #write to disk
echo "3" > /proc/sys/vm/drop_caches
if [ "$verbose" == 1 ]; then
echo -n "catalyst inject exec time: " && date
fi
done
)
catalyst_control #back
}
catalyst_time_cfg(){
echo "Current rate: $waiter"
echo "60 - Every minute - Default"
echo "3600 - Every hour"
sleep 1;
echo ""
echo "Please enter a rate:"
echo -n "> "
read catalyst_time_in
waiter=$catalyst_time_in
echo ""
clear && echo "Time updated!"
sleep 2;
clear
catalyst_control #back
}
get_mount(){
sync; #write data to disk
busybox mount -o remount,rw /system;
busybox mount -o remount,rw /data;
}
#session_behaviour(){
get_mount #init mount
sleep 1;
main #call head & body
sleep 1;
#}