summarylogtreecommitdiffstats
path: root/start.sh
diff options
context:
space:
mode:
authorYidaozhan Ya2022-12-08 08:00:18 +0800
committerYidaozhan Ya2022-12-08 08:00:18 +0800
commite1509687b7bb79867eb14eb0970122d309fd5c06 (patch)
treea6f64afbc9a90d0c262d06429fbb38ca7fcecad6 /start.sh
parent84b06a192084a84654557074cc2ac1128d8f5a2d (diff)
downloadaur-e1509687b7bb79867eb14eb0970122d309fd5c06.tar.gz
fix xdg-open
Diffstat (limited to 'start.sh')
-rwxr-xr-xstart.sh19
1 files changed, 17 insertions, 2 deletions
diff --git a/start.sh b/start.sh
index 914abb0c3f91..7526aee20e05 100755
--- a/start.sh
+++ b/start.sh
@@ -1,6 +1,8 @@
#!/bin/bash
+USER_RUN_DIR="/run/user/$(id -u)"
CONFIG_DIR="${XDG_CONFIG_HOME:-$HOME/.config}"
+FONTCONFIG_DIR="$CONFIG_DIR/fontconfig"
QQ_APP_DIR="${CONFIG_DIR}/QQ"
DOWNLOAD_DIR="$(xdg-user-dir DOWNLOAD)"
if [ "$DOWNLOAD_DIR" == "$HOME" ]; then DOWNLOAD_DIR="$HOME/Downloads"; fi
@@ -8,13 +10,26 @@ if [ "$DOWNLOAD_DIR" == "$HOME" ]; then DOWNLOAD_DIR="$HOME/Downloads"; fi
cd /opt/QQ
bwrap --new-session --die-with-parent --cap-drop ALL --unshare-user-try --unshare-pid --unshare-cgroup-try \
- --dev-bind / / \
+ --symlink usr/lib /lib \
+ --symlink usr/lib64 /lib64 \
+ --symlink usr/bin /bin \
+ --ro-bind /usr /usr \
+ --ro-bind /opt/QQ /opt/QQ \
+ --dev-bind /dev /dev \
+ --ro-bind /sys /sys \
+ --ro-bind /etc/resolv.conf /etc/resolv.conf \
+ --ro-bind /etc/localtime /etc/localtime \
--proc /proc \
- --tmpfs "$HOME" \
+ --dev-bind /run/dbus /run/dbus \
+ --bind "$USER_RUN_DIR" "$USER_RUN_DIR" \
+ --ro-bind-try /etc/fonts /etc/fonts \
+ --ro-bind-try "$FONTCONFIG_DIR" "$FONTCONFIG_DIR" \
+ --bind /tmp /tmp \
--bind "$HOME/.pki" "$HOME/.pki" \
--ro-bind "$HOME/.Xauthority" "$HOME/.Xauthority" \
--bind "${DOWNLOAD_DIR}" "${DOWNLOAD_DIR}" \
--bind "$QQ_APP_DIR" "$QQ_APP_DIR" \
+ --setenv IBUS_USE_PORTAL 1 \
/opt/QQ/qq "$@"
# 移除无用崩溃报告和日志