summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuoxin Pu2024-03-15 13:55:55 +0800
committerGuoxin Pu2024-03-15 13:57:39 +0800
commitffda4deef53320cfb458b3fd41f5417a931f9c2e (patch)
tree4bfccf31aa10e284d3cdc911d426dc0e926fdff7
parentd8e04c34d7dc69d720887d6c80f8351668874ae1 (diff)
downloadaur-ffda4deef53320cfb458b3fd41f5417a931f9c2e.tar.gz
support custom binds from ~/.config/wechat-universal/binds.list
-rw-r--r--.SRCINFO6
-rw-r--r--PKGBUILD4
-rw-r--r--wechat-universal.sh11
3 files changed, 15 insertions, 6 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 253706bf8017..1fd370a1293a 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = wechat-universal-bwrap
pkgdesc = WeChat (Universal) with bwrap sandbox
pkgver = 1.0.0.238
- pkgrel = 7
+ pkgrel = 8
url = https://weixin.qq.com
arch = x86_64
arch = aarch64
@@ -40,9 +40,9 @@ pkgbase = wechat-universal-bwrap
source = license.tar.gz
source = wechat-universal.sh
source = wechat-universal.desktop
- sha256sums = 9aef4eb1f701ccbcf182e680c18f6f117d1c184894141f8a859cde76fc5dc298
+ sha256sums = b25598b64964e4a38f8027b9e8b9a412c6c8d438a64f862d1b72550ac8c75164
sha256sums = 53760079c1a5b58f2fa3d5effe1ed35239590b288841d812229ef4e55b2dbd69
- sha256sums = 7329f11851c65d11378cdfe82e20d554df617919a32d53eef57e540d5d6e3a5a
+ sha256sums = 0d5c27fb5534fcac0405f3bfe36aa98191c36e6da003163f9e1455784350959f
sha256sums = b783b7b0035efb5a0fcb4ddba6446f645a4911e4a9f71475e408a5c87ef04c30
source_x86_64 = wechat-universal_1.0.0.238_x86_64.deb::https://home-store-packages.uniontech.com/appstore/pool/appstore/c/com.tencent.wechat/com.tencent.wechat_1.0.0.238_amd64.deb
sha256sums_x86_64 = 371026679dba25a033023b4077dc527059d906ec03ea2db05f6fc012ab40c96b
diff --git a/PKGBUILD b/PKGBUILD
index f170ef09fe64..42c054468fd2 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -5,7 +5,7 @@
_pkgname=wechat-universal
pkgname=${_pkgname}-bwrap
pkgver=1.0.0.238
-pkgrel=7
+pkgrel=8
pkgdesc="WeChat (Universal) with bwrap sandbox"
arch=('x86_64' 'aarch64' 'loong64')
url="https://weixin.qq.com"
@@ -62,7 +62,7 @@ noextract=("${_deb_stem}"_{x86_64,aarch64,loong64}.deb)
sha256sums=(
'b25598b64964e4a38f8027b9e8b9a412c6c8d438a64f862d1b72550ac8c75164'
'53760079c1a5b58f2fa3d5effe1ed35239590b288841d812229ef4e55b2dbd69'
- 'e315c691f9679d8e6a12627dd727f66186848a76641ff5690d8e7a64fab778a2'
+ '0d5c27fb5534fcac0405f3bfe36aa98191c36e6da003163f9e1455784350959f'
'b783b7b0035efb5a0fcb4ddba6446f645a4911e4a9f71475e408a5c87ef04c30'
)
diff --git a/wechat-universal.sh b/wechat-universal.sh
index e409114f66d0..ed52f66f64db 100644
--- a/wechat-universal.sh
+++ b/wechat-universal.sh
@@ -54,6 +54,15 @@ for DEV_NODE in /dev/{nvidia{-uvm,ctl,*[0-9]},video*[0-9]}; do
[[ -e "${DEV_NODE}" ]] && BWRAP_DEV_BINDS+=(--dev-bind "${DEV_NODE}"{,})
done
+# Custom exposed folders
+echo "Hint: Custom binds could be declared in '~/.config/wechat-universal/binds.list', each line a path, absolute or relative to your HOME"
+BWRAP_CUSTOM_BINDS=()
+while IFS='' read -r CUSTOM_BIND || [[ "${CUSTOM_BIND}" ]]; do
+ CUSTOM_BIND=$(readlink -f -- "${CUSTOM_BIND}")
+ echo "Custom bind: '${CUSTOM_BIND}'"
+ BWRAP_CUSTOM_BINDS+=(--bind "${CUSTOM_BIND}"{,})
+done < ~/.config/wechat-universal/binds.list
+
mkdir -p "${WECHAT_FILES_DIR}" "${WECHAT_HOME_DIR}"
ln -snf "${WECHAT_FILES_DIR}" "${WECHAT_HOME_DIR}/xwechat_files"
@@ -128,4 +137,4 @@ BWRAP_ARGS=(
--ro-bind "${XDG_RUNTIME_DIR}/pulse"{,}
)
-exec bwrap "${BWRAP_ARGS[@]}" "${BWRAP_DEV_BINDS[@]}" "${BWRAP_ENV_APPEND[@]}" /opt/wechat-universal/wechat "$@" \ No newline at end of file
+exec bwrap "${BWRAP_ARGS[@]}" "${BWRAP_CUSTOM_BINDS[@]}" "${BWRAP_DEV_BINDS[@]}" "${BWRAP_ENV_APPEND[@]}" /opt/wechat-universal/wechat "$@" \ No newline at end of file