-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstartapp.sh
More file actions
51 lines (44 loc) · 1.37 KB
/
Copy pathstartapp.sh
File metadata and controls
51 lines (44 loc) · 1.37 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
#!/bin/sh
export HOME=/config
cd /opt/QQ
# AppRun in Linux QQ is broken in some envs, so we find and run the binary directly.
BINARY=""
if [ -f "qq" ]; then
BINARY="./qq"
elif [ -f "QQ" ]; then
BINARY="./QQ"
elif [ -f "linuxqq" ]; then
BINARY="./linuxqq"
else
# Fallback: Find largest executable file (likely the binary)
BINARY=$(find . -maxdepth 1 -type f -executable ! -name "AppRun" ! -name "*.sh" -printf "%s\t%p\n" | sort -n | tail -1 | cut -f2)
fi
if [ -z "$BINARY" ]; then
echo "Error: Could not find executable in /opt/QQ"
ls -la
exit 1
fi
# Determine number of instances
QQ_INSTANCE_COUNT=${QQ_INSTANCE_COUNT:-1}
if [ "$QQ_INSTANCE_COUNT" -lt 1 ]; then
QQ_INSTANCE_COUNT=1
fi
# Launch lightweight taskbar if enabled
if [ "$ENABLE_TASKBAR" = "1" ]; then
echo "Starting tint2 taskbar..."
tint2 &
fi
echo "Starting $QQ_INSTANCE_COUNT instance(s) of QQ..."
# Start secondary instances in background
i=2
while [ "$i" -le "$QQ_INSTANCE_COUNT" ]; do
echo "Starting QQ instance $i..."
# Isolate user data to prevent white screen/crashes
# Default user data is in ~/.config/QQ
DATA_DIR="$HOME/.config/QQ_$i"
"$BINARY" --no-sandbox --disable-gpu --disable-dev-shm-usage --user-data-dir="$DATA_DIR" &
i=$((i + 1))
sleep 5
done
echo "Starting main QQ instance..."
exec "$BINARY" --no-sandbox --disable-gpu --disable-dev-shm-usage