mirror of
https://github.com/archlinux/aur.git
synced 2026-02-07 20:52:55 +01:00
[feat] add custom bwrap args
This commit is contained in:
parent
027efb307b
commit
2e678b9fe8
4 changed files with 27 additions and 12 deletions
4
.SRCINFO
4
.SRCINFO
|
|
@ -1,7 +1,7 @@
|
|||
pkgbase = linuxqq-nt-bwrap
|
||||
pkgdesc = New Linux QQ based on Electron, with bubblewrap sandbox and some tweaks
|
||||
pkgver = 3.2.8_23873
|
||||
pkgrel = 1
|
||||
pkgrel = 2
|
||||
url = https://im.qq.com/linuxqq/index.shtml
|
||||
install = linuxqq-nt-bwrap.install
|
||||
arch = x86_64
|
||||
|
|
@ -34,7 +34,7 @@ pkgbase = linuxqq-nt-bwrap
|
|||
source = start.sh
|
||||
source = config.json
|
||||
source = xdg-open.sh
|
||||
sha256sums = bf956210c3feef339efbec3a7663dcc061a3066f038d74b1e8bd3eede780d1a5
|
||||
sha256sums = f52223dc193dccea1b43a654ba453169ca9467bc6f389400962fab9ee63e75ab
|
||||
sha256sums = bb2ec0f104da4da7422d9b0f51c71d0ab38ed2a21764a7a643ab42689e098e4b
|
||||
sha256sums = f1c778b5a8b23bc77fd8e5e89056fea07309794c9a44ec38134a176cf1f7b675
|
||||
source_x86_64 = https://dldir1.qq.com/qqfile/qq/QQNT/96fbb21f/linuxqq_3.2.8-23873_amd64.deb
|
||||
|
|
|
|||
4
PKGBUILD
4
PKGBUILD
|
|
@ -7,7 +7,7 @@ _update_pkgver=${_base_pkgver}
|
|||
_md5=96fbb21f
|
||||
pkgname=linuxqq-nt-bwrap
|
||||
pkgver="${_update_pkgver//-/_}"
|
||||
pkgrel=1
|
||||
pkgrel=2
|
||||
pkgdesc="New Linux QQ based on Electron, with bubblewrap sandbox and some tweaks"
|
||||
arch=('x86_64' 'aarch64' 'loong64')
|
||||
url='https://im.qq.com/linuxqq/index.shtml'
|
||||
|
|
@ -28,7 +28,7 @@ source_x86_64=("https://dldir1.qq.com/qqfile/qq/QQNT/${_md5}/linuxqq_${_base_pkg
|
|||
source_aarch64=("https://dldir1.qq.com/qqfile/qq/QQNT/${_md5}/linuxqq_${_base_pkgver}_arm64.deb")
|
||||
source_loong64=("https://dldir1.qq.com/qqfile/qq/QQNT/${_md5}/linuxqq_${_base_pkgver}_loongarch64.deb")
|
||||
source=('start.sh' 'config.json' 'xdg-open.sh')
|
||||
sha256sums=('bf956210c3feef339efbec3a7663dcc061a3066f038d74b1e8bd3eede780d1a5'
|
||||
sha256sums=('f52223dc193dccea1b43a654ba453169ca9467bc6f389400962fab9ee63e75ab'
|
||||
'bb2ec0f104da4da7422d9b0f51c71d0ab38ed2a21764a7a643ab42689e098e4b'
|
||||
'f1c778b5a8b23bc77fd8e5e89056fea07309794c9a44ec38134a176cf1f7b675')
|
||||
sha256sums_x86_64=('d23e212d26cf80a40e3eab44499aa76586eade3fc260d1b9f171294fb507393f')
|
||||
|
|
|
|||
|
|
@ -10,7 +10,8 @@ blue="${bold}$(tput setaf 4)"
|
|||
yellow="${bold}$(tput setaf 3)"
|
||||
|
||||
post_install() {
|
||||
note "要传递给 electron 的自定义参数应该写在: ~/.config/qq-electron-flags.conf"
|
||||
note "要传递给 bwrap 的自定义参数应该写在 ~/.config/qq-bwrap-flags.conf,可在此文件中设置自定义挂载目录。"
|
||||
note "要传递给 electron 的自定义参数应该写在 ~/.config/qq-electron-flags.conf。"
|
||||
note "如果要在 QQ 中下载文件,请先在「设置」->「存储管理」中把下载文件夹更改为系统的“下载”/“Downloads”文件夹。"
|
||||
}
|
||||
|
||||
|
|
|
|||
28
start.sh
28
start.sh
|
|
@ -43,16 +43,29 @@ fi
|
|||
# 从 flags 文件中加载参数
|
||||
|
||||
set -euo pipefail
|
||||
flags_file="${XDG_CONFIG_HOME}/qq-electron-flags.conf"
|
||||
declare -a flags
|
||||
electron_flags_file="${XDG_CONFIG_HOME}/qq-electron-flags.conf"
|
||||
declare -a electron_flags
|
||||
|
||||
if [[ -f "${flags_file}" ]]; then
|
||||
mapfile -t <"${flags_file}"
|
||||
if [[ -f "${electron_flags_file}" ]]; then
|
||||
mapfile -t ELECTRON_FLAGS_MAPFILE <"${electron_flags_file}"
|
||||
fi
|
||||
|
||||
for line in "${MAPFILE[@]}"; do
|
||||
for line in "${ELECTRON_FLAGS_MAPFILE[@]}"; do
|
||||
if [[ ! "${line}" =~ ^[[:space:]]*#.* ]]; then
|
||||
flags+=("${line}")
|
||||
electron_flags+=("${line}")
|
||||
fi
|
||||
done
|
||||
|
||||
bwrap_flags_file="${XDG_CONFIG_HOME}/qq-bwrap-flags.conf"
|
||||
declare -a bwrap_flags
|
||||
|
||||
if [[ -f "${bwrap_flags_file}" ]]; then
|
||||
mapfile -t BWRAP_FLAGS_MAPFILE <"${bwrap_flags_file}"
|
||||
fi
|
||||
|
||||
for line in "${BWRAP_FLAGS_MAPFILE[@]}"; do
|
||||
if [[ ! "${line}" =~ ^[[:space:]]*#.* ]]; then
|
||||
bwrap_flags+=("${line}")
|
||||
fi
|
||||
done
|
||||
|
||||
|
|
@ -126,7 +139,8 @@ bwrap --new-session --cap-drop ALL --unshare-user-try --unshare-pid --unshare-cg
|
|||
--setenv IBUS_USE_PORTAL 1 \
|
||||
--setenv QQNTIM_HOME "${QQ_APP_DIR}/QQNTim" \
|
||||
--setenv LITELOADERQQNT_PROFILE "${QQ_APP_DIR}/LiteLoaderQQNT" \
|
||||
/opt/QQ/electron "${flags[@]}" "$@" /opt/QQ/resources/app
|
||||
"${bwrap_flags[@]}" \
|
||||
/opt/QQ/electron "${electron_flags[@]}" "$@" /opt/QQ/resources/app
|
||||
|
||||
# 移除无用崩溃报告和日志
|
||||
# 如果需要向腾讯反馈 bug,请注释掉如下几行
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue