summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorYidaozhan Ya2023-02-15 18:19:32 +0800
committerYidaozhan Ya2023-02-15 18:19:32 +0800
commitab9f836abea10a8c8cb0ad8cfd2d4c3e0c7ad5b3 (patch)
tree47f82700ce0aa68c48d9c4652c6260e95c48c578
parent82971427a24d43eb64f687d1f657b0c225656767 (diff)
downloadaur-ab9f836abea10a8c8cb0ad8cfd2d4c3e0c7ad5b3.tar.gz
[chore] 把自定义参数移至 qq-electron-flags.conf
-rw-r--r--.SRCINFO5
-rw-r--r--PKGBUILD6
-rw-r--r--linuxqq-nt-bwrap.install21
-rwxr-xr-xstart.sh17
4 files changed, 41 insertions, 8 deletions
diff --git a/.SRCINFO b/.SRCINFO
index c7d2a3bc1ab9..313174c8c7ef 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,8 +1,9 @@
pkgbase = linuxqq-nt-bwrap
pkgdesc = New Linux QQ based on Electron, with bubblewrap sandbox and some tweaks
pkgver = 3.0.0_571
- pkgrel = 7
+ pkgrel = 8
url = https://im.qq.com/linuxqq/index.shtml
+ install = linuxqq-nt-bwrap.install
arch = x86_64
arch = aarch64
license = custom
@@ -29,7 +30,7 @@ pkgbase = linuxqq-nt-bwrap
source = start.sh
source = config.json
source = xdg-open.sh
- sha256sums = c57f548ed30572f9557a25b62eb67ba5f9563cadf9c430661721362ab2070c9f
+ sha256sums = d4b5d55823da0a9c0b48987af0620ffb2a6d4275d83c11ddf8c411b1b0587053
sha256sums = 82182e49c883e16c7ff38e4722c3950e2758b4342c51521147423026965196a9
sha256sums = 78a573867355fb4c3e728d0c8ac0746d47fa7d64f90ee2b62ee9f0ccae095edb
source_x86_64 = https://dldir1.qq.com/qqfile/qq/QQNT/4691a571/QQ-v2.0.1-429_x64.deb
diff --git a/PKGBUILD b/PKGBUILD
index 856e99ea1a97..2e61a82e5500 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -2,7 +2,7 @@
_pkgname=linuxqq
pkgname=linuxqq-nt-bwrap
pkgver=3.0.0_571
-pkgrel=7
+pkgrel=8
pkgdesc="New Linux QQ based on Electron, with bubblewrap sandbox and some tweaks"
arch=('x86_64' 'aarch64')
url='https://im.qq.com/linuxqq/index.shtml'
@@ -14,7 +14,7 @@ optdepends=('libappindicator-gtk3: 以显示托盘图标'
provides=('qq' 'linuxqq')
conflicts=('linuxqq')
options=('!strip' '!emptydirs')
-#install=${_pkgname}.install
+install="${pkgname}.install"
source_x86_64=("https://dldir1.qq.com/qqfile/qq/QQNT/4691a571/QQ-v2.0.1-429_x64.deb" # 底包
"https://qqpatch.gtimg.cn/hotUpdate_new/release/linux-x64/${pkgver//_/-}/${pkgver//_/-}.zip.zip" ) # 热更新补丁
source_aarch64=("https://dldir1.qq.com/qqfile/qq/QQNT/0186a650/QQ-v2.0.1-453_arm64.deb" # 底包
@@ -24,7 +24,7 @@ sha256sums_x86_64=('e3aa15ff6ae089b655df3913c6020ca56726bd676995aaf29b313fbd0643
'bfebcd22346b32bce2a8f9e494898b336aa0fc9bd7065f085c7d281b98a740fe') # 热更新补丁
sha256sums_aarch64=('70c286006dae10da06c191b5f0718d17d686a8ef792f6f72215734773f01498b' # 底包
'c25c6aab9a79781b290f70900af44ed58a3c17c96d1762db09059461eb6aec66') # 热更新补丁
-sha256sums=('c57f548ed30572f9557a25b62eb67ba5f9563cadf9c430661721362ab2070c9f' # start.sh
+sha256sums=('d4b5d55823da0a9c0b48987af0620ffb2a6d4275d83c11ddf8c411b1b0587053' # start.sh
'82182e49c883e16c7ff38e4722c3950e2758b4342c51521147423026965196a9' # config.json
'78a573867355fb4c3e728d0c8ac0746d47fa7d64f90ee2b62ee9f0ccae095edb') # xdg-open.sh
diff --git a/linuxqq-nt-bwrap.install b/linuxqq-nt-bwrap.install
new file mode 100644
index 000000000000..61b2f118d251
--- /dev/null
+++ b/linuxqq-nt-bwrap.install
@@ -0,0 +1,21 @@
+# Colored makepkg-like functions
+msg_blue() {
+ printf "${blue}==>${bold} $1${all_off}\n"
+}
+
+note() {
+ printf "${blue}==>${yellow} NOTE:${bold} $1${all_off}\n"
+}
+
+all_off="$(tput sgr0)"
+bold="${all_off}$(tput bold)"
+blue="${bold}$(tput setaf 4)"
+yellow="${bold}$(tput setaf 3)"
+
+post_install() {
+ note "Custom flags should be put directly in: ~/.config/qq-electron-flags.conf"
+}
+
+post_upgrade() {
+ post_install
+}
diff --git a/start.sh b/start.sh
index 4b8346b6b78e..ed6ff4524f79 100755
--- a/start.sh
+++ b/start.sh
@@ -11,11 +11,22 @@ if [ -z "${QQ_DOWNLOAD_DIR}" ]; then
fi
QQ_DOWNLOAD_DIR="${XDG_DOWNLOAD_DIR:-$HOME/Downloads}"
fi
+set -euo pipefail
-if [ "${XDG_SESSION_TYPE}" == "wayland" ]; then
- QQ_ELECTRON_FLAGS="--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations ${QQ_ELECTRON_FLAGS}"
+flags_file="${XDG_CONFIG_HOME}/qq-electron-flags.conf"
+
+declare -a flags
+
+if [[ -f "${flags_file}" ]]; then
+ mapfile -t < "${flags_file}"
fi
+for line in "${MAPFILE[@]}"; do
+ if [[ ! "${line}" =~ ^[[:space:]]*#.* ]]; then
+ flags+=("${line}")
+ fi
+done
+
QQ_HOTUPDATE_DIR="${QQ_APP_DIR}/versions"
QQ_HOTUPDATE_VERSION="3.0.0-571"
QQ_PREVIOUS_VERSIONS=("2.0.1-429" "2.0.1-453" "2.0.2-510" "2.0.3-543" "3.0.0-565")
@@ -73,7 +84,7 @@ bwrap --new-session --cap-drop ALL --unshare-user-try --unshare-pid --unshare-cg
--ro-bind-try "${HOME}/local/share/.icons" "${HOME}/local/share/.icons" \
--ro-bind-try "${XDG_CONFIG_HOME}/gtk-3.0" "${XDG_CONFIG_HOME}/gtk-3.0" \
--setenv IBUS_USE_PORTAL 1 \
- /opt/QQ/electron "${QQ_ELECTRON_FLAGS}" "$@" /opt/QQ/resources/app
+ /opt/QQ/electron "${flags[@]}" "$@" /opt/QQ/resources/app
# 移除无用崩溃报告和日志
# 如果需要向腾讯反馈 bug,请注释掉如下几行