From e1509687b7bb79867eb14eb0970122d309fd5c06 Mon Sep 17 00:00:00 2001 From: Yidaozhan Ya Date: Thu, 8 Dec 2022 08:00:18 +0800 Subject: [PATCH] fix xdg-open --- PKGBUILD | 4 ++-- start.sh | 19 +++++++++++++++++-- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/PKGBUILD b/PKGBUILD index e94d848b9d35..1d0a1d1ac88a 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -2,7 +2,7 @@ _pkgname=linuxqq pkgname=linuxqq-nt-bwrap pkgver=2.0.1_429 -pkgrel=3 +pkgrel=4 pkgdesc="Tencent QQ NT for Linux with bubblewrap wrapper" arch=('x86_64') url="https://im.qq.com" @@ -16,7 +16,7 @@ install=${_pkgname}.install source=("https://dldir1.qq.com/qqfile/qq/QQNT/4691a571/QQ-v${pkgver//_/-}_x64.deb" 'start.sh') sha256sums=('e3aa15ff6ae089b655df3913c6020ca56726bd676995aaf29b313fbd0643ea42' - '5a6b2378ff764e347e17e1587ba588ae06cf4fc3081c2a2f4ee129872d8f4211') + 'f757df155db9147a9921af13cb18db3fa4e2f32a7c4d3422c6016d113cabc6d8') package(){ tar -xJ -f "data.tar.xz" -C "${pkgdir}" 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 "$@" # 移除无用崩溃报告和日志