-
Notifications
You must be signed in to change notification settings - Fork 0
/
device-quirks
332 lines (310 loc) · 11.6 KB
/
device-quirks
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
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
#!/usr/bin/bash
# This file would be sourced by gamescope-session script (meant for
# ChimeraOS devices).
SYS_ID="$(cat /sys/devices/virtual/dmi/id/product_name)"
CPU_VENDOR="$(lscpu | grep "Vendor ID" | cut -d : -f 2 | xargs)"
CURSOR_DELAY=${GAMESCOPE_OVERRIDE_CURSOR_DELAY:-3000}
# OXP Devices
OXP_LIST="ONE XPLAYER:ONEXPLAYER 1 T08:ONEXPLAYER 1S A08:ONEXPLAYER 1S T08:ONEXPLAYER mini A07:ONEXPLAYER mini GA72:ONEXPLAYER mini GT72:ONEXPLAYER Mini Pro:ONEXPLAYER GUNDAM GA72:ONEXPLAYER 2 ARP23:ONEXPLAYER 2 PRO ARP23P:ONEXPLAYER 2 PRO ARP23P EVA-01:ONEXPLAYER X1 i"
AOK_LIST="AOKZOE A1 AR07:AOKZOE A1 Pro"
if [[ ":$OXP_LIST:" =~ ":$SYS_ID:" ]] || [[ ":$AOK_LIST:" =~ ":$SYS_ID:" ]]; then
# Intel support is extremely experimental, this is the bare minimum to get the system to boot.
# Dependent on a special --force-external-orientation option in gamescope
if ( gamescope --help 2>&1 | grep -e "--force-external-orientation" > /dev/null ) && [[ "$CPU_VENDOR" =~ "GenuineIntel" ]]; then
export GAMESCOPECMD="/usr/bin/gamescope \
-e \
--generate-drm-mode fixed \
--xwayland-count 2 \
-O *,eDP-1 \
--default-touch-mode 4 \
--hide-cursor-delay $CURSOR_DELAY \
--fade-out-duration 200 \
--cursor-scale-height 720 \
--force-panel-type external \
--force-external-orientation left "
# Fallback method. Dependent on a special --force-orientation option in gamescope
elif ( gamescope --help 2>&1 | grep -e "--force-orientation" > /dev/null ) ; then
export GAMESCOPECMD="/usr/bin/gamescope \
-e \
--generate-drm-mode fixed \
--xwayland-count 2 \
-O *,eDP-1 \
--default-touch-mode 4 \
--hide-cursor-delay $CURSOR_DELAY \
--fade-out-duration 200 \
--cursor-scale-height 720 \
--force-orientation left "
fi
# Set refresh rate range and enable refresh rate switching
export STEAM_DISPLAY_REFRESH_LIMITS=${GAMESCOPE_OVERRIDE_REFRESH_RATE:-40,60}
fi
# OXP 120hz Devices
OXP_120_LIST="ONEXPLAYER F1"
if [[ ":$OXP_120_LIST:" =~ ":$SYS_ID:" ]]; then
# Dependent on a special --force-external-orientation option in gamescope-plus
if ( gamescope --help 2>&1 | grep -e "--force-external-orientation" > /dev/null ) ; then
export GAMESCOPECMD="/usr/bin/gamescope \
-e \
--xwayland-count 2 \
-O *,eDP-1 \
--default-touch-mode 4 \
--hide-cursor-delay $CURSOR_DELAY \
--fade-out-duration 200 \
--cursor-scale-height 720 \
--force-panel-type external \
--force-external-orientation left "
# Fallback method. Dependent on a special --force-orientation option in gamescope
elif ( gamescope --help 2>&1 | grep -e "--force-orientation" > /dev/null ) ; then
export GAMESCOPECMD="/usr/bin/gamescope \
-e \
--xwayland-count 2 \
-O *,eDP-1 \
--default-touch-mode 4 \
--hide-cursor-delay $CURSOR_DELAY \
--fade-out-duration 200 \
--cursor-scale-height 720 \
--force-orientation left "
fi
# Set refresh rate range and enable refresh rate switching
export STEAM_DISPLAY_REFRESH_LIMITS=${GAMESCOPE_OVERRIDE_REFRESH_RATE:-40,120}
fi
# AYANEO AIR, SLIDE, and FLIP Devices
AIR_LIST="AIR:AIR Pro:AIR Plus:SLIDE:FLIP KB:FLIP DS:"
if [[ ":$AIR_LIST:" =~ ":$SYS_ID:" ]]; then
# Dependent on a special --force-external-orientation option in gamescope-plus
if ( gamescope --help 2>&1 | grep -e "--force-external-orientation" > /dev/null ) ; then
export GAMESCOPECMD="/usr/bin/gamescope \
-e \
--xwayland-count 2 \
-O *,eDP-1 \
--default-touch-mode 4 \
--hide-cursor-delay $CURSOR_DELAY \
--fade-out-duration 200 \
--cursor-scale-height 720 \
--force-panel-type external \
--force-external-orientation left "
# Fallback method. Dependent on a special --force-orientation option in gamescope
elif ( gamescope --help 2>&1 | grep -e "--force-orientation" > /dev/null ) ; then
export GAMESCOPECMD="/usr/bin/gamescope \
-e \
--xwayland-count 2 \
-O *,eDP-1 \
--default-touch-mode 4 \
--hide-cursor-delay $CURSOR_DELAY \
--fade-out-duration 200 \
--cursor-scale-height 720 \
--force-orientation left "
fi
fi
# AYN Loki Devices
AYN_LIST="Loki Max:Loki Zero:Loki MiniPro"
if [[ ":$AYN_LIST:" =~ ":$SYS_ID:" ]]; then
# Dependent on a special --force-external-orientation option in gamescope
if ( gamescope --help 2>&1 | grep -e "--force-orientation" > /dev/null ) ; then
export GAMESCOPECMD="/usr/bin/gamescope \
-e \
--generate-drm-mode fixed \
--xwayland-count 2 \
-O *,eDP-1 \
--default-touch-mode 4 \
--hide-cursor-delay $CURSOR_DELAY \
--fade-out-duration 200 \
--cursor-scale-height 720 \
--force-orientation left "
fi
# Set refresh rate range and enable refresh rate switching
export STEAM_DISPLAY_REFRESH_LIMITS=${GAMESCOPE_OVERRIDE_REFRESH_RATE:-40,60}
fi
# GDP Win devices
GDP_LIST="G1619-01:G1621-02:G1618-03:MicroPC:WIN2"
if [[ ":$GDP_LIST:" =~ ":$SYS_ID:" ]]; then
# Dependent on a special --force-orientation option in gamescope
if ( gamescope --help 2>&1 | grep -e "--force-orientation" > /dev/null ) ; then
export GAMESCOPECMD="/usr/bin/gamescope \
-e \
--generate-drm-mode fixed \
--xwayland-count 2 \
-O *,DSI-1 \
--default-touch-mode 4 \
--hide-cursor-delay $CURSOR_DELAY \
--fade-out-duration 200 \
--cursor-scale-height 720 \
--force-orientation right "
fi
fi
# GPD Win 3 specifc quirk to prevent crashing
# The GPD Win 3 does not support hardware rotation for 270/90 modes. We need to implement shader rotations to get this working correctly.
# 0/180 rotations should work.
if [[ ":G1618-03:" =~ ":$SYS_ID:" ]]; then
# Dependent on a special --force-orientation option in gamescope
if ( gamescope --help 2>&1 | grep -e "--force-orientation" > /dev/null ) ; then
export GAMESCOPECMD="/usr/bin/gamescope \
-e \
--generate-drm-mode fixed \
--xwayland-count 2 \
-O *,DSI-1 \
--default-touch-mode 4 \
--hide-cursor-delay 3000 \
--fade-out-duration 200 \
--force-orientation right "
fi
fi
#GPD Win 4 supports 40-60hz refresh rate changing
if [[ ":G1618-04:" =~ ":$SYS_ID:" ]]; then
export GAMESCOPECMD="/usr/bin/gamescope \
-e \
--xwayland-count 2 \
-O *,eDP-1 \
--default-touch-mode 4 \
--hide-cursor-delay $CURSOR_DELAY \
--fade-out-duration 200 \
--cursor-scale-height 720 "
export STEAM_DISPLAY_REFRESH_LIMITS=${GAMESCOPE_OVERRIDE_REFRESH_RATE:-40,60}
fi
#GPD Win Mini supports up to 60-120hz refresh rate changing
if [[ ":G1617-01:" =~ ":$SYS_ID:" ]]; then
export STEAM_DISPLAY_REFRESH_LIMITS=${GAMESCOPE_OVERRIDE_REFRESH_RATE:-60,120}
fi
# GPD Win mini
if [[ ":G1617-01:" =~ ":$SYS_ID:" ]]; then
ROTATION=""
if ( xrandr --prop 2>$1 | grep -e "1080x1920 " > /dev/null ) ; then
ROTATION=" --force-orientation right "
fi
export GAMESCOPECMD="/usr/bin/gamescope \
-e \
--xwayland-count 2 \
-O *,eDP-1 \
--default-touch-mode 4 \
--hide-cursor-delay 3000 \
--fade-out-duration 200 \
$ROTATION "
fi
# Steam Deck
if [[ ":Jupiter:" =~ ":$SYS_ID:" ]]; then
# Dependent on a special --force-orientation option in gamescope
if ( gamescope --help 2>&1 | grep -e "--force-orientation" > /dev/null ) ; then
export GAMESCOPECMD="/usr/bin/gamescope \
-e \
--generate-drm-mode fixed \
--xwayland-count 2 \
-O *,eDP-1 \
--default-touch-mode 4 \
--hide-cursor-delay 3000 \
--fade-out-duration 200 "
fi
export STEAM_DISPLAY_REFRESH_LIMITS=40,60
fi
# Steam Deck
if [[ ":Jupiter:" =~ ":$SYS_ID:" ]]; then
export GAMESCOPECMD="/usr/bin/gamescope \
-e \
--generate-drm-mode fixed \
--max-scale 2 \
--xwayland-count 2 \
-O *,eDP-1 \
--default-touch-mode 4 \
--hide-cursor-delay $CURSOR_DELAY \
--max-scale 2 \
--fade-out-duration 200 \
--cursor-scale-height 720 "
# Set refresh rate range and enable refresh rate switching
export STEAM_DISPLAY_REFRESH_LIMITS=${GAMESCOPE_OVERRIDE_REFRESH_RATE:-40,60}
# Enables the adaptive brightness toggle
export STEAM_ENABLE_DYNAMIC_BACKLIGHT=1
# Allows the fan controller service to be toggled from gamemode
export STEAM_ENABLE_FAN_CONTROL=1
# Sets CPU topology for Steam Deck hardware
export WINE_CPU_TOPOLOGY=8:0,1,2,3,4,5,6,7
# Enables default resolution behavior if not already set by user
if [ -z $GAMESCOPE_ENABLE_720P_RESTRICT ]; then
export GAMESCOPE_ENABLE_720P_RESTRICT=1
fi
if [ -f "/usr/share/plymouth/themes/steamos/steamos-jupiter.png" ]; then
export STEAM_UPDATEUI_PNG_BACKGROUND=/usr/share/plymouth/themes/steamos/steamos-jupiter.png
fi
fi
# OLED Steam Deck
if [[ ":Galileo:" =~ ":$SYS_ID:" ]]; then
mura_args=()
mura_path=$(galileo-mura-setup)
if [ $? -eq 0 ]; then
mura_args=("--mura-map" "$mura_path")
fi
export GAMESCOPECMD="/usr/bin/gamescope \
-e \
--generate-drm-mode fixed \
--xwayland-count 2 \
-O *,eDP-1 \
"${mura_args[@]}" \
--default-touch-mode 4 \
--hide-cursor-delay $CURSOR_DELAY \
--max-scale 2 \
--fade-out-duration 200 \
--cursor-scale-height 720 "
# Set refresh rate range and enable refresh rate switching
export STEAM_DISPLAY_REFRESH_LIMITS=${GAMESCOPE_OVERRIDE_REFRESH_RATE:-45,90}
# Enables the adaptive brightness toggle
export STEAM_ENABLE_DYNAMIC_BACKLIGHT=1
# Allows the fan controller service to be toggled from gamemode
export STEAM_ENABLE_FAN_CONTROL=1
# Sets CPU topology for Steam Deck hardware
export WINE_CPU_TOPOLOGY=8:0,1,2,3,4,5,6,7
# Enables default resolution behavior if not already set by user
if [ -z $GAMESCOPE_ENABLE_720P_RESTRICT ]; then
export GAMESCOPE_ENABLE_720P_RESTRICT=1
fi
export STEAM_GAMESCOPE_FORCE_HDR_DEFAULT=1
export STEAM_GAMESCOPE_FORCE_OUTPUT_TO_HDR10PQ_DEFAULT=1
export STEAM_ENABLE_STATUS_LED_BRIGHTNESS=1
if [ -f "/usr/share/plymouth/themes/steamos/steamos-galileo.png" ]; then
export STEAM_UPDATEUI_PNG_BACKGROUND=/usr/share/plymouth/themes/steamos/steamos-galileo.png
fi
fi
# ROG Ally
ALLY_LIST="ROG Ally RC71L_RC71L:ROG Ally RC71L_Action:ROG Ally RC71L"
if [[ ":$ALLY_LIST:" =~ ":$SYS_ID:" ]]; then
# Dependent on a special --force-panel-type option in gamescope-plus
if ( gamescope --help 2>&1 | grep -e "--force-panel-type" > /dev/null ) ; then
export GAMESCOPECMD="/usr/bin/gamescope \
-e \
--xwayland-count 2 \
-O *,eDP-1 \
--default-touch-mode 4 \
--hide-cursor-delay $CURSOR_DELAY \
--fade-out-duration 200 \
--cursor-scale-height 720 \
--force-panel-type external \
--adaptive-sync "
# fallback for users of gamescope-git.
else
export GAMESCOPECMD="/usr/bin/gamescope \
-e \
--xwayland-count 2 \
-O *,eDP-1 \
--default-touch-mode 4 \
--hide-cursor-delay $CURSOR_DELAY \
--fade-out-duration 200 \
--cursor-scale-height 720 "
fi
# Set refresh rate range and enable refresh rate switching
export STEAM_DISPLAY_REFRESH_LIMITS=${GAMESCOPE_OVERRIDE_REFRESH_RATE:-40,120}
fi
# Lenovo Legion Go
if [[ ":83E1:" =~ ":$SYS_ID:" ]]; then
# Dependent on --force-orientation in gamescope-plus
if ( gamescope --help 2>&1 | grep -e "--force-orientation" > /dev/null ) ; then
export GAMESCOPECMD="/usr/bin/gamescope \
-e \
--xwayland-count 2 \
-O *,eDP-1 \
--default-touch-mode 4 \
--hide-cursor-delay $CURSOR_DELAY \
--fade-out-duration 200 \
--cursor-scale-height 720 \
--adaptive-sync \
--force-orientation left "
fi
# Set refresh rate range and enable refresh rate switching
export STEAM_DISPLAY_REFRESH_LIMITS=${GAMESCOPE_OVERRIDE_REFRESH_RATE:-60,144}
fi